/* Extension context invalidation guard */
(()=>{
  const _wr=window.__wr=window.__wr||(()=>{});
  window.addEventListener('error',(e)=>{
    if(e?.error?.message?.includes('Extension context invalidated')||
       e?.message?.includes('Extension context invalidated')){
      e.preventDefault();e.stopImmediatePropagation();
      console.warn('[FLOWhatsapp] Extension context invalidated — recarregue a página para restaurar a extensão.');
      return false;
    }
  },{capture:true});
  window.addEventListener('unhandledrejection',(e)=>{
    if(e?.reason?.message?.includes('Extension context invalidated')){
      e.preventDefault();
      console.warn('[FLOWhatsapp] Extension context invalidated (promise) — recarregue a página.');
      return false;
    }
  },{capture:true});
  // Patch chrome.runtime to be safe after context invalidation
  try{
    if(typeof chrome!=='undefined'&&chrome?.runtime){
      const _orig_sendMsg=chrome.runtime.sendMessage?.bind(chrome.runtime);
      if(_orig_sendMsg){
        chrome.runtime.sendMessage=function(...args){
          try{return _orig_sendMsg(...args);}catch(e){
            if(e?.message?.includes('Extension context invalidated'))return Promise.resolve();
            throw e;
          }
        };
      }
    }
  }catch(e){}
})();
/* FLOWhatsapp v1.5 pt-BR + WCAG AAA patch */
(()=>{const SID="flowhatsapp-ptbr-wcag-aaa-v15",MIG="flowhatsapp_ptbr_default_migrated_v15",DEFAULT_LANG="pt",PTBR={"feature.schedule":"Mensagens agendadas","languages.hi":"Hindi","languages.bn":"Bengali","languages.ur":"Urdu","errors.extensionUpdated":"A extensão foi atualizada. Recarregue a página e tente novamente.","fluxo.responseTimeout":"Tempo limite da resposta (minutos):","fluxo.responseTimeoutHint":"Quando \"Chamar próximo bloco\" e \"Ao responder\" estiverem conectados, define quanto tempo aguardar a resposta do usuário. Padrão: 5 minutos.","crm.dontRespondIfTagged":"Não responder se o contato tiver etiqueta","crm.dontRespondToTags":"Não responder às etiquetas","crm.respondOnlyToTags":"Responder apenas às etiquetas","crm.image":"Imagem:","crm.editToInsertImage":"[Edite para inserir a imagem]","crm.tipReactivationEx4":"24 horas = mensagem de boas-vindas uma vez por dia","followUp.messagesTitle":"Mensagens","followUp.tooltip.messagesTitle":"Mensagens - o que enviar?","followUp.tooltip.messagesContent":"Defina as mensagens enviadas quando o follow-up disparar. Você pode adicionar várias mensagens com tipos de anexo diferentes e intervalos entre elas.","followUp.tooltip.messagesHowToUse":"Clique em \"+ Adicionar mensagem\" para adicionar mensagens. Cada mensagem pode ter texto, imagens/vídeos, documentos, enquetes e mais.","followUp.tooltip.postActionsTitle":"Ações posteriores - ações de CRM após as mensagens","followUp.tooltip.postActionsContent":"Configure ações de CRM para executar depois que todas as mensagens forem enviadas. Adicione ou remova contatos de grupos, abas personalizadas, etiquetas do WhatsApp ou etapas do Kanban.","followUp.tooltip.postActionsHowToUse":"Ative uma categoria de a??o no seletor e escolha em quais grupos, abas, etiquetas ou etapas o contato será adicionado ou removido.","followUp.scheduleWizard.title":"Configuração da agenda","followUp.scheduleWizard.step1":"Etapa 1: tipo de agenda","followUp.scheduleWizard.step2":"Etapa 2: selecionar dias","followUp.scheduleWizard.step3":"Etapa 3: horário e mensagens","followUp.scheduleWizard.next":"Avan?ar","followUp.scheduleWizard.back":"Voltar","followUp.scheduleWizard.done":"Concluir","followUp.schedule.daily":"Diário","followUp.schedule.dailyDesc":"Enviar em datas específicas do mês","followUp.schedule.weekly":"Semanal","followUp.schedule.weeklyDesc":"Enviar nos dias da semana selecionados","followUp.schedule.monthly":"Mensal","followUp.schedule.monthlyDesc":"Enviar em datas específicas a cada mês","followUp.schedule.yearly":"Anual","followUp.schedule.yearlyDesc":"Enviar em datas específicas a cada ano","followUp.weekday.mon":"Seg","followUp.weekday.tue":"Ter","followUp.weekday.wed":"Qua","followUp.weekday.thu":"Qui","followUp.weekday.fri":"Sex","followUp.weekday.sat":"Sab","followUp.weekday.sun":"Dom","followUp.weekday.monday":"Segunda-feira","followUp.weekday.tuesday":"Terça-feira","followUp.weekday.wednesday":"Quarta-feira","followUp.weekday.thursday":"Quinta-feira","followUp.weekday.friday":"Sexta-feira","followUp.weekday.saturday":"Sábado","followUp.weekday.sunday":"Domingo","followUp.month.jan":"Janeiro","followUp.month.feb":"Fevereiro","followUp.month.mar":"Março","followUp.month.apr":"Abril","followUp.month.may":"Maio","followUp.month.jun":"Junho","followUp.month.jul":"Julho","followUp.month.aug":"Agosto","followUp.month.sep":"Setembro","followUp.month.oct":"Outubro","followUp.month.nov":"Novembro","followUp.month.dec":"Dezembro","followUp.selectWeekdays":"Selecionar dias da semana","followUp.selectDates":"Selecionar datas","followUp.selectYearlyDates":"Selecionar datas anuais","followUp.selectedDays":"Selecionados","followUp.noSelection":"Nenhuma seleção","followUp.addDate":"Adicionar data","followUp.removeDate":"Remover","followUp.selectMonth":"Selecionar mês","followUp.selectDay":"Selecionar dia","followUp.monthlySelectInfo":"Selecione datas que serão repetidas todos os meses","followUp.dailySelectInfo":"Selecione datas específicas para esta agenda","followUp.calendarSelectInfo":"Selecione datas específicas no calend?rio. Navegue pelos meses usando as setas.","followUp.messageMode":"Modo de mensagem","followUp.sameMessage":"Mesma mensagem para todos os dias","followUp.sameMessageDesc":"Use a mesma configuração de mensagem para todos os dias selecionados","followUp.differentMessages":"Mensagem diferente por dia","followUp.differentMessagesDesc":"Configure mensagens separadas para cada dia selecionado","followUp.messageFor":"Mensagem para","followUp.sendTime":"Horário de envio","followUp.selectTime":"Selecionar horário de envio","schedule.templateType_message":"Mensagem","schedule.templateType_message_image_video":"Mensagem + imagens/vídeos","schedule.templateType_message_document":"Mensagem + documentos","schedule.templateType_message_audio":"Mensagem + áudio","schedule.templateType_message_contacts":"Mensagem + contatos","schedule.templateType_message_buttons":"Mensagem + botões","schedule.templateType_message_poll":"Mensagem + enquete","schedule.templateType_message_list":"Mensagem + lista","schedule.templateType_message_product":"Mensagem + produto","schedule.templateType_fluxo_flow":"Fluxos ativos do Fluxo","schedule.selectFlow":"Selecionar fluxo","schedule.selectFluxoFlow":"Selecionar um fluxo","schedule.selectTemplates":"Selecionar modelos","schedule.replyReceived":"Ações ao receber resposta","schedule.additionalOptions":"Opções adicionais","schedule.archiveChat":"Arquivar conversa","schedule.blockChat":"Bloquear conversa","schedule.autoSendIfMissed":"Enviar automaticamente se o horário já passou","schedule.webhookExecution":"Execução de webhook","crm.flow":"fluxo","crm.flows":"fluxos","templates.sortManual":"Ordem manual","templates.sortMar":"Ordem manual","templates.sortName":"Nome (A-Z)","templates.sortNewest":"Mais recentes","templates.sortOldest":"Mais antigos","templates.sortNameAZ":"Nome A-Z","templates.sortNameZA":"Nome Z-A","common.add":"Adicionar","common.save":"Salvar","common.cancel":"Cancelar","common.close":"Fechar","common.delete":"Excluir","common.edit":"Editar","common.loading":"Carregando...","crm.fullName":"Nome completo","crm.phoneNumber":"Número de telefone","crm.email":"E-mail","crm.gender":"Gênero","crm.dateOfBirth":"Data de nascimento","crm.details":"Detalhes","crm.address":"Endereço","crm.language":"Idioma","crm.aiBotBlacklist":"Bot de IA","crm.aiBotDisabled":"Desativado para este contato","crm.aiBotEnabled":"Ativado para este contato","team.namePlaceholder":"Ex.: Vendas - João","team.phonePlaceholder":"Ex.: +55 11 99999-9999","templates.messageType.individual":"Individual","templates.messageType.tab":"Aba","templates.messageType.group":"Grupo","templates.messageType.label":"Etiqueta","templates.messageType.kanban":"Kanban","templates.messageType.quickReply":"Resposta Rápida","templates.attachmentType.imagevideo":"Mensagem + Imagens/Vídeos","templates.attachmentType.fluxo":"Fluxo Chatbot","ai.regenerate":"Reescrever","ai.regenerateWithAI":"Reescrever com IA","ai.regenerating":"Reescrevendo...","actionSidebar.uncategorized":"Sem categoria","crm.uncategorized":"Sem categoria","templates.uncategorized":"Sem categoria","followUp.uncategorized":"Sem categoria","crm.confirmDeleteFollowUpCategory":"Excluir esta categoria? Os follow-ups serão movidos para Sem categoria.","crm.confirmDeleteCategory":"Excluir esta categoria? Os fluxos serão movidos para Sem categoria.","templates.confirmDeleteCategory":"Tem certeza de que deseja excluir esta categoria? Os modelos serão movidos para Sem categoria.","templates.form.templateStatus":"Status do Modelo","broadcast.errorStartingCampaign":"Falha ao iniciar a campanha","broadcast.phonePlaceholder":"Números de telefone com código do país (ex: 5511...)","broadcast.upload":"Enviar","broadcast.select":"Selecionar","broadcast.recurring":"Recorrente","broadcast.recurringHowToUse":"Como usar o Envio Recorrente","broadcast.recurringTip1":"Ative o envio recorrente para repetir automaticamente este envio.","broadcast.recurringTip2":"Escolha a frequência: Diário, Semanal, Mensal ou Anual.","broadcast.recurringTip3":"Para Semanal: Selecione os dias específicos da semana.","broadcast.recurringTip4":"Defina uma data de término ou use 'Nunca' para enviar indefinidamente.","broadcast.recurringTip5":"Após cada envio, o próximo será agendado automaticamente.","broadcast.repeatInterval":"Repetir","broadcast.daily":"Diário","broadcast.weekly":"Semanal","broadcast.monthly":"Mensal","broadcast.yearly":"Anual","broadcast.selectDays":"Selecionar Dias","broadcast.sun":"Dom","broadcast.mon":"Seg","broadcast.tue":"Ter","broadcast.wed":"Qua","broadcast.thu":"Qui","broadcast.fri":"Sex","broadcast.sat":"Sáb","broadcast.selectDates":"Selecionar Datas","broadcast.datesSelected":"datas selecionadas","broadcast.calendarSelectInfo":"Selecione as datas específicas no calendário. Navegue pelos meses usando as setas.","broadcast.ends":"Termina em","broadcast.endNever":"Nunca","broadcast.endOnDate":"Na data","broadcast.searchGroups":"Buscar grupos...","broadcast.selectTemplates":"Selecionar Modelo","broadcast.noTemplates":"Nenhum modelo disponível","broadcast.groupsSelected":"grupos selecionados","broadcast.selectGroups":"Selecionar Grupos","broadcast.tabsSelected":"abas selecionadas","broadcast.selectTabs":"Selecionar Abas","broadcast.labelsSelected":"etiquetas selecionadas","broadcast.selectLabels":"Selecionar Etiquetas","broadcast.selectCRMStage":"Selecionar Funil/Etapa"};function shouldSet(v,m){return!v||(!m&&/^en([_-]|$)?/i.test(String(v)))}function setLocal(){try{const migrated=localStorage.getItem(MIG)==="1";const patch={};if(shouldSet(localStorage.getItem("wa_language"),migrated))patch.wa_language=DEFAULT_LANG;if(shouldSet(localStorage.getItem("wa_ui_language"),migrated))patch.wa_ui_language=DEFAULT_LANG;Object.keys(patch).forEach(k=>localStorage.setItem(k,patch[k]));if(!migrated)localStorage.setItem(MIG,"1");if(Object.keys(patch).length)window.dispatchEvent(new CustomEvent("languageChanged",{detail:{newLang:DEFAULT_LANG,source:"flowhatsapp-default"}}));}catch(e){}}function setChrome(){try{const c=globalThis.chrome;if(!c?.storage?.local)return;c.storage.local.get(["wa_language","wa_ui_language",MIG],r=>{const patch={};if(shouldSet(r?.wa_language,r?.[MIG]))patch.wa_language=DEFAULT_LANG;if(shouldSet(r?.wa_ui_language,r?.[MIG]))patch.wa_ui_language=DEFAULT_LANG;if(!r?.[MIG])patch[MIG]=true;if(Object.keys(patch).length)c.storage.local.set(patch,()=>{try{window.dispatchEvent(new CustomEvent("languageChanged",{detail:{newLang:DEFAULT_LANG,source:"flowhatsapp-default"}}))}catch(e){}});});}catch(e){}}function installStyle(){try{if(!document||document.getElementById(SID))return;const s=document.createElement("style");s.id=SID;s.textContent="\n:root{--lion-primary:#064ea8!important;--lion-primary-rgb:6,78,168!important;--lion-primary-hover:#073f8f!important;--lion-primary-light:#dbeafe!important;--lion-primary-dark:#073f8f!important;--lion-accent:#0ea5e9!important;--lion-text-primary:#0b1220!important;--lion-text-secondary:#1f2937!important;--lion-text-muted:#273449!important;--lion-text-light:#334155!important;--lion-bg-primary:#ffffff!important;--lion-bg-secondary:#f8fafc!important;--lion-bg-tertiary:#eef2f7!important;--lion-border-light:#94a3b8!important;--lion-border-medium:#64748b!important;--lion-border-dark:#334155!important;--lion-focus-ring:0 0 0 3px rgba(6,78,168,.35)!important;}\n.lion-dark,[data-theme=\"dark\"],body.lion-dark,body.dark{--lion-primary:#60a5fa!important;--lion-primary-rgb:96,165,250!important;--lion-primary-hover:#93c5fd!important;--lion-primary-light:#0b2447!important;--lion-primary-dark:#bfdbfe!important;--lion-text-primary:#f8fafc!important;--lion-text-secondary:#e2e8f0!important;--lion-text-muted:#cbd5e1!important;--lion-text-light:#cbd5e1!important;--lion-bg-primary:#0f172a!important;--lion-bg-secondary:#111827!important;--lion-bg-tertiary:#1e293b!important;--lion-border-light:#cbd5e1!important;--lion-border-medium:#94a3b8!important;--lion-border-dark:#e2e8f0!important;}\n.crm-profile-tab,.crm-sub-modal,.tabs-manager-modal,.add-tab-modal,.template-manager-overlay,.wa-template-editor-overlay,.broadcast-modal-overlay,.webhook-modal-overlay,.api-config-modal,.api-modal,.calendar-modal,.todo-modal,.fluxo-app,.kanban-app,.license-modal,.license-card{color:var(--lion-text-primary,#0b1220)!important;}\n.crm-profile-field-label,.crm-form-label,.tabs-table-header,.template-sidebar-section,.filter-info,.webhook-upload-time,.calendar-day.other-month,.wa-delay-input-group label,.api-toggle-desc{color:var(--lion-text-secondary,#1f2937)!important;}\n.crm-profile-field-value,.crm-table-cell,.template-card-preview,.template-card-meta,.webhook-no-uploads,.empty-state,.no-templates,.group-select-placeholder{color:var(--lion-text-primary,#0b1220)!important;}\n.crm-profile-field-value{font-weight:700!important;line-height:1.45!important;}\n.crm-profile-tab.lion-dark,.lion-dark .crm-profile-tab{background:var(--lion-bg-primary,#0f172a)!important;color:#f8fafc!important;}\n.crm-profile-tab.lion-dark .crm-profile-field-label,.lion-dark .crm-profile-field-label{color:#e2e8f0!important;}\n.crm-profile-tab.lion-dark .crm-profile-field-value,.lion-dark .crm-profile-field-value{color:#f8fafc!important;}\n.crm-form-input,.crm-form-textarea,.crm-form-select,.add-tab-input,.add-tab-textarea,.add-tab-search-input,.webhook-url-input,.wa-form-input,.wa-template-editor-overlay input,.wa-template-editor-overlay textarea,.wa-template-editor-overlay select,.template-manager-overlay input,.template-manager-overlay textarea,.template-manager-overlay select,.broadcast-modal-overlay input,.broadcast-modal-overlay textarea,.broadcast-modal-overlay select,.api-config-modal input,.api-config-modal textarea,.api-config-modal select,.fluxo-app input,.fluxo-app textarea,.fluxo-app select,.kanban-app input,.kanban-app textarea,.kanban-app select,.license-input,.max-input{color:#0b1220!important;background:#ffffff!important;border-color:#334155!important;caret-color:#064ea8!important;}\n.crm-form-input::placeholder,.crm-form-textarea::placeholder,.add-tab-input::placeholder,.add-tab-textarea::placeholder,.add-tab-search-input::placeholder,.webhook-url-input::placeholder,.wa-form-input::placeholder,.wa-template-editor-overlay input::placeholder,.wa-template-editor-overlay textarea::placeholder,.template-manager-overlay input::placeholder,.broadcast-modal-overlay input::placeholder,.broadcast-modal-overlay textarea::placeholder,.api-config-modal input::placeholder,.api-config-modal textarea::placeholder,.fluxo-app input::placeholder,.fluxo-app textarea::placeholder,.kanban-app input::placeholder,.license-input::placeholder,.max-input::placeholder{color:#334155!important;opacity:1!important;}\n.lion-dark .crm-form-input,.lion-dark .crm-form-textarea,.lion-dark .crm-form-select,.lion-dark .add-tab-input,.lion-dark .add-tab-textarea,.lion-dark .add-tab-search-input,.lion-dark .webhook-url-input,.lion-dark .wa-form-input,.lion-dark .wa-template-editor-overlay input,.lion-dark .wa-template-editor-overlay textarea,.lion-dark .wa-template-editor-overlay select,.lion-dark .template-manager-overlay input,.lion-dark .template-manager-overlay textarea,.lion-dark .template-manager-overlay select,.lion-dark .broadcast-modal-overlay input,.lion-dark .broadcast-modal-overlay textarea,.lion-dark .broadcast-modal-overlay select,.lion-dark .api-config-modal input,.lion-dark .api-config-modal textarea,.lion-dark .api-config-modal select,.lion-dark .fluxo-app input,.lion-dark .fluxo-app textarea,.lion-dark .fluxo-app select,.lion-dark .kanban-app input,.lion-dark .kanban-app textarea,.lion-dark .kanban-app select,.lion-dark .license-input,.lion-dark .max-input{color:#f8fafc!important;background:#0f172a!important;border-color:#cbd5e1!important;}\n.lion-dark .crm-form-input::placeholder,.lion-dark .crm-form-textarea::placeholder,.lion-dark .add-tab-input::placeholder,.lion-dark .add-tab-textarea::placeholder,.lion-dark .add-tab-search-input::placeholder,.lion-dark .webhook-url-input::placeholder,.lion-dark .wa-form-input::placeholder,.lion-dark .wa-template-editor-overlay input::placeholder,.lion-dark .wa-template-editor-overlay textarea::placeholder,.lion-dark .template-manager-overlay input::placeholder,.lion-dark .broadcast-modal-overlay input::placeholder,.lion-dark .broadcast-modal-overlay textarea::placeholder,.lion-dark .api-config-modal input::placeholder,.lion-dark .api-config-modal textarea::placeholder,.lion-dark .fluxo-app input::placeholder,.lion-dark .fluxo-app textarea::placeholder,.lion-dark .kanban-app input::placeholder,.lion-dark .license-input::placeholder,.lion-dark .max-input::placeholder{color:#cbd5e1!important;opacity:1!important;}\n.crm-form-input:focus,.crm-form-textarea:focus,.crm-form-select:focus,.add-tab-input:focus,.add-tab-textarea:focus,.add-tab-search-input:focus,.webhook-url-input:focus,.wa-form-input:focus,.template-manager-overlay input:focus,.broadcast-modal-overlay input:focus,.api-config-modal input:focus,.fluxo-app input:focus,.kanban-app input:focus,.license-input:focus,.max-input:focus{outline:2px solid transparent!important;border-color:#064ea8!important;box-shadow:var(--lion-focus-ring)!important;}\nbutton[disabled],input[disabled],textarea[disabled],select[disabled],.disabled{opacity:1!important;}\nbutton[disabled]{color:#273449!important;background:#e2e8f0!important;border-color:#94a3b8!important;}\n.lion-dark button[disabled]{color:#e2e8f0!important;background:#334155!important;border-color:#94a3b8!important;}\n.crm-btn-primary,.btn-primary,.btn-new-template,.header-create-btn,.broadcast-modal-overlay .btn-primary,.webhook-save-btn,.api-config-modal .btn-primary{background:#064ea8!important;color:#ffffff!important;border-color:#064ea8!important;}\n.crm-btn-primary:hover,.btn-primary:hover,.btn-new-template:hover,.header-create-btn:hover{background:#073f8f!important;color:#ffffff!important;}\n.lion-dark .wizard-btn-primary, .lion-dark .wizard-btn-next, .lion-dark .wizard-btn-upload, .lion-dark .btn-done, [data-theme=\"dark\"] .wizard-btn-primary, [data-theme=\"dark\"] .wizard-btn-next, [data-theme=\"dark\"] .wizard-btn-upload, [data-theme=\"dark\"] .btn-done { color: #ffffff !important; }\n.wa-template-editor-overlay.lion-dark .status-hint { color: #cbd5e1 !important; }\n";(document.head||document.documentElement).appendChild(s);}catch(e){}}function replaceKeys(value){return typeof value==="string"?value.replace(/\b((?:common|crm|templates|tabs|profile|license|settings|feature|team|webhook|broadcast|api|aiBot|kanban|calendar|todo|followUp|schedule|fluxo|errors|languages)\.[A-Za-z0-9_.-]+)\b/g,(m)=>PTBR[m]||m):value}function translateDom(root){try{if(!root||!document)return;const walker=document.createTreeWalker(root,NodeFilter.SHOW_TEXT,{acceptNode(node){const p=node.parentElement;if(!p||/^(SCRIPT|STYLE|TEXTAREA|INPUT)$/i.test(p.tagName))return NodeFilter.FILTER_REJECT;return /\b(?:common|crm|templates|tabs|profile|license|settings|feature|team|webhook|broadcast|api|aiBot|kanban|calendar|todo|followUp|schedule|fluxo|errors|languages)\./.test(node.nodeValue)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT;}});const nodes=[];while(walker.nextNode())nodes.push(walker.currentNode);nodes.forEach(n=>{const v=replaceKeys(n.nodeValue);if(v!==n.nodeValue)n.nodeValue=v;});const selector="[placeholder],[title],[aria-label],[data-tooltip],[data-title]";(root.querySelectorAll?root.querySelectorAll(selector):[]).forEach(el=>["placeholder","title","aria-label","data-tooltip","data-title"].forEach(attr=>{const v=el.getAttribute(attr);if(v){const nv=replaceKeys(v);if(nv!==v)el.setAttribute(attr,nv);}}));}catch(e){}}function boot(){try{document.documentElement&&document.documentElement.setAttribute("lang","pt-BR");installStyle();translateDom(document.body||document.documentElement);const obs=new MutationObserver(ms=>{for(const m of ms){m.addedNodes&&m.addedNodes.forEach(n=>{if(n.nodeType===1)translateDom(n);else if(n.nodeType===3&&n.parentElement)translateDom(n.parentElement);});if(m.type==="characterData"&&m.target?.parentElement)translateDom(m.target.parentElement);}});obs.observe(document.documentElement,{childList:true,subtree:true,characterData:true});}catch(e){}}setLocal();setChrome();if(typeof document!=="undefined"){if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",boot,{once:true});else boot();setTimeout(boot,1200);setTimeout(boot,4000);}})();
(()=>{var e,t,n={4582(e,t){"use strict";function n(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var a=n({HTML:"text/html",isHTML:function(e){return e===a.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),r=n({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===r.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});t.assign=function(e,t){if(null===e||"object"!=typeof e)throw new TypeError("target is not an object");for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},t.find=function(e,t,n){if(void 0===n&&(n=Array.prototype),e&&"function"==typeof n.find)return n.find.call(e,t);for(var a=0;a<e.length;a++)if(Object.prototype.hasOwnProperty.call(e,a)){var r=e[a];if(t.call(void 0,r,a,e))return r}},t.freeze=n,t.MIME_TYPE=a,t.NAMESPACE=r},5752(e,t,n){var a=n(4582),r=n(4722),o=n(6559),i=n(4466),s=r.DOMImplementation,l=a.NAMESPACE,c=i.ParseError,d=i.XMLReader;function m(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function p(e){this.options=e||{locator:{}}}function u(){this.cdata=!1}function g(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function h(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function b(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}p.prototype.parseFromString=function(e,t){var n=this.options,a=new d,r=n.domBuilder||new u,i=n.errorHandler,s=n.locator,c=n.xmlns||{},p=/\/x?html?$/.test(t),g=p?o.HTML_ENTITIES:o.XML_ENTITIES;s&&r.setDocumentLocator(s),a.errorHandler=function(e,t,n){if(!e){if(t instanceof u)return t;e=t}var a={},r=e instanceof Function;function o(t){var o=e[t];!o&&r&&(o=2==e.length?function(n){e(t,n)}:e),a[t]=o&&function(e){o("[xmldom "+t+"]\t"+e+function(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}(n))}||function(){}}return n=n||{},o("warning"),o("error"),o("fatalError"),a}(i,r,s),a.domBuilder=n.domBuilder||r,p&&(c[""]=l.HTML),c.xml=c.xml||l.XML;var h=n.normalizeLineEndings||m;return e&&"string"==typeof e?a.parse(h(e),c,g):a.errorHandler.error("invalid doc source"),r.doc},u.prototype={startDocument:function(){this.doc=(new s).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,a){var r=this.doc,o=r.createElementNS(e,n||t),i=a.length;b(this,o),this.currentElement=o,this.locator&&g(this.locator,o);for(var s=0;s<i;s++){e=a.getURI(s);var l=a.getValue(s),c=(n=a.getQName(s),r.createAttributeNS(e,n));this.locator&&g(a.getLocator(s),c),c.value=c.nodeValue=l,o.setAttributeNode(c)}},endElement:function(e,t,n){var a=this.currentElement;a.tagName;this.currentElement=a.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&g(this.locator,n),b(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=h.apply(this,arguments)){if(this.cdata)var a=this.doc.createCDATASection(e);else a=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(a):/^\s*$/.test(e)&&this.doc.appendChild(a),this.locator&&g(this.locator,a)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,n){e=h.apply(this,arguments);var a=this.doc.createComment(e);this.locator&&g(this.locator,a),b(this,a)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n){var a=this.doc.implementation;if(a&&a.createDocumentType){var r=a.createDocumentType(e,t,n);this.locator&&g(this.locator,r),b(this,r),this.doc.doctype=r}},warning:function(e){},error:function(e){},fatalError:function(e){throw new c(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){u.prototype[e]=function(){return null}}),t.DOMParser=p},4722(e,t,n){var a=n(4582),r=a.find,o=a.NAMESPACE;function i(e){return""!==e}function s(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function l(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(i):[]}(e);return Object.keys(t.reduce(s,{}))}function c(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function d(e,t){var n=e.prototype;if(!(n instanceof t)){function a(){}a.prototype=t.prototype,c(n,a=new a),e.prototype=n=a}n.constructor!=e&&(n.constructor=e)}var m={},p=m.ELEMENT_NODE=1,u=m.ATTRIBUTE_NODE=2,g=m.TEXT_NODE=3,h=m.CDATA_SECTION_NODE=4,b=m.ENTITY_REFERENCE_NODE=5,f=m.ENTITY_NODE=6,v=m.PROCESSING_INSTRUCTION_NODE=7,y=m.COMMENT_NODE=8,x=m.DOCUMENT_NODE=9,w=m.DOCUMENT_TYPE_NODE=10,k=m.DOCUMENT_FRAGMENT_NODE=11,E=m.NOTATION_NODE=12,S={},C={},T=(S.INDEX_SIZE_ERR=(C[1]="Index size error",1),S.DOMSTRING_SIZE_ERR=(C[2]="DOMString size error",2),S.HIERARCHY_REQUEST_ERR=(C[3]="Hierarchy request error",3)),A=(S.WRONG_DOCUMENT_ERR=(C[4]="Wrong document",4),S.INVALID_CHARACTER_ERR=(C[5]="Invalid character",5)),D=(S.NO_DATA_ALLOWED_ERR=(C[6]="No data allowed",6),S.NO_MODIFICATION_ALLOWED_ERR=(C[7]="No modification allowed",7),S.NOT_FOUND_ERR=(C[8]="Not found",8)),_=(S.NOT_SUPPORTED_ERR=(C[9]="Not supported",9),S.INUSE_ATTRIBUTE_ERR=(C[10]="Attribute in use",10)),N=S.INVALID_STATE_ERR=(C[11]="Invalid state",11);S.SYNTAX_ERR=(C[12]="Syntax error",12),S.INVALID_MODIFICATION_ERR=(C[13]="Invalid modification",13),S.NAMESPACE_ERR=(C[14]="Invalid namespace",14),S.INVALID_ACCESS_ERR=(C[15]="Invalid access",15);function M(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,C[e]),this.message=C[e],Error.captureStackTrace&&Error.captureStackTrace(this,M);return n.code=e,t&&(this.message=this.message+": "+t),n}function I(){}function R(e,t){this._node=e,this._refresh=t,B(this)}function B(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(ke(e,"length",n.length),!e.$$length||n.length<e.$$length)for(var a=n.length;a in e;a++)Object.prototype.hasOwnProperty.call(e,a)&&delete e[a];c(n,e),e._inc=t}}function P(){}function L(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function U(e,t,n,a){if(a?t[L(t,a)]=n:t[t.length++]=n,e){n.ownerElement=e;var r=e.ownerDocument;r&&(a&&V(r,e,a),function(e,t,n){e&&e._inc++;var a=n.namespaceURI;a===o.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value)}(r,e,n))}}function F(e,t,n){var a=L(t,n);if(!(a>=0))throw new M(D,new Error(e.tagName+"@"+n));for(var r=t.length-1;a<r;)t[a]=t[++a];if(t.length=r,e){var o=e.ownerDocument;o&&(V(o,e,n),n.ownerElement=null)}}function z(){}function O(){}function W(e){return("<"==e?"&lt;":">"==e&&"&gt;")||"&"==e&&"&amp;"||'"'==e&&"&quot;"||"&#"+e.charCodeAt()+";"}function q(e,t){return H(e,null,{enter:function(e){return!t(e)||H.STOP}})===H.STOP}function H(e,t,n){for(var a=[{node:e,context:t,phase:H.ENTER}];a.length>0;){var r=a.pop();if(r.phase===H.ENTER){var o=n.enter(r.node,r.context);if(o===H.STOP)return H.STOP;if(a.push({node:r.node,context:o,phase:H.EXIT}),null==o)continue;for(var i=r.node.lastChild;i;)a.push({node:i,context:o,phase:H.ENTER}),i=i.previousSibling}else n.exit&&n.exit(r.node,r.context)}}function j(){this.ownerDocument=this}function V(e,t,n,a){e&&e._inc++,n.namespaceURI===o.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function G(e,t,n){if(e&&e._inc){e._inc++;var a=t.childNodes;if(n)a[a.length++]=n;else{for(var r=t.firstChild,o=0;r;)a[o++]=r,r=r.nextSibling;a.length=o,delete a[a.length]}}}function K(e,t){var n=t.previousSibling,a=t.nextSibling;return n?n.nextSibling=a:e.firstChild=a,a?a.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,G(e.ownerDocument,e),t}function $(e){return e&&e.nodeType===O.DOCUMENT_TYPE_NODE}function Y(e){return e&&e.nodeType===O.ELEMENT_NODE}function X(e){return e&&e.nodeType===O.TEXT_NODE}function J(e,t){var n=e.childNodes||[];if(r(n,Y)||$(t))return!1;var a=r(n,$);return!(t&&a&&n.indexOf(a)>n.indexOf(t))}function Q(e,t){var n=e.childNodes||[];if(r(n,function(e){return Y(e)&&e!==t}))return!1;var a=r(n,$);return!(t&&a&&n.indexOf(a)>n.indexOf(t))}function Z(e,t,n){if(!function(e){return e&&(e.nodeType===O.DOCUMENT_NODE||e.nodeType===O.DOCUMENT_FRAGMENT_NODE||e.nodeType===O.ELEMENT_NODE)}(e))throw new M(T,"Unexpected parent node type "+e.nodeType);if(n&&n.parentNode!==e)throw new M(D,"child not in parent");if(!function(e){return e&&(Y(e)||X(e)||$(e)||e.nodeType===O.DOCUMENT_FRAGMENT_NODE||e.nodeType===O.COMMENT_NODE||e.nodeType===O.PROCESSING_INSTRUCTION_NODE)}(t)||$(t)&&e.nodeType!==O.DOCUMENT_NODE)throw new M(T,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function ee(e,t,n){var a=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===O.DOCUMENT_FRAGMENT_NODE){var i=o.filter(Y);if(i.length>1||r(o,X))throw new M(T,"More than one element or text in fragment");if(1===i.length&&!J(e,n))throw new M(T,"Element in fragment can not be inserted before doctype")}if(Y(t)&&!J(e,n))throw new M(T,"Only one element can be added and only after doctype");if($(t)){if(r(a,$))throw new M(T,"Only one doctype is allowed");var s=r(a,Y);if(n&&a.indexOf(s)<a.indexOf(n))throw new M(T,"Doctype can only be inserted before an element");if(!n&&s)throw new M(T,"Doctype can not be appended since element is present")}}function te(e,t,n){var a=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===O.DOCUMENT_FRAGMENT_NODE){var i=o.filter(Y);if(i.length>1||r(o,X))throw new M(T,"More than one element or text in fragment");if(1===i.length&&!Q(e,n))throw new M(T,"Element in fragment can not be inserted before doctype")}if(Y(t)&&!Q(e,n))throw new M(T,"Only one element can be added and only after doctype");if($(t)){if(r(a,function(e){return $(e)&&e!==n}))throw new M(T,"Only one doctype is allowed");var s=r(a,Y);if(n&&a.indexOf(s)<a.indexOf(n))throw new M(T,"Doctype can only be inserted before an element")}}function ne(e,t,n,a){Z(e,t,n),e.nodeType===O.DOCUMENT_NODE&&(a||ee)(e,t,n);var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===k){var o=t.firstChild;if(null==o)return t;var i=t.lastChild}else o=i=t;var s=n?n.previousSibling:e.lastChild;o.previousSibling=s,i.nextSibling=n,s?s.nextSibling=o:e.firstChild=o,null==n?e.lastChild=i:n.previousSibling=i;do{o.parentNode=e,ae(o,e.ownerDocument||e)}while(o!==i&&(o=o.nextSibling));return G(e.ownerDocument||e,e),t.nodeType==k&&(t.firstChild=t.lastChild=null),t}function ae(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===p&&e.attributes)for(var n=0;n<e.attributes.length;n++){var a=e.attributes.item(n);a&&(a.ownerDocument=t)}for(var r=e.firstChild;r;)ae(r,t),r=r.nextSibling}}function re(){this._nsMap={}}function oe(){}function ie(){}function se(){}function le(){}function ce(){}function de(){}function me(){}function pe(){}function ue(){}function ge(){}function he(){}function be(){}function fe(e,t,n){var a=!!n&&!!n.requireWellFormed,r=[],o=9==this.nodeType&&this.documentElement||this,i=o.prefix,s=o.namespaceURI;if(s&&null==i&&null==(i=o.lookupPrefix(s)))var l=[{namespace:s,prefix:null}];return xe(this,r,e,t,l,a),r.join("")}function ve(e,t,n){var a=e.prefix||"",r=e.namespaceURI;if(!r)return!1;if("xml"===a&&r===o.XML||r===o.XMLNS)return!1;for(var i=n.length;i--;){var s=n[i];if(s.prefix===a)return s.namespace!==r}return!0}function ye(e,t,n){e.push(" ",t,'="',n.replace(/[<>&"\t\n\r]/g,W),'"')}function xe(e,t,n,a,r,i){r||(r=[]),H(e,{ns:r,isHTML:n},{enter:function(e,n){var r=n.ns,s=n.isHTML;if(a){if(!(e=a(e)))return null;if("string"==typeof e)return t.push(e),null}switch(e.nodeType){case p:var l=e.attributes,c=l.length,d=e.tagName,m=d;if(!(s=o.isHTML(e.namespaceURI)||s)&&!e.prefix&&e.namespaceURI){for(var f,E=0;E<l.length;E++)if("xmlns"===l.item(E).name){f=l.item(E).value;break}if(!f)for(var S=r.length-1;S>=0;S--){if(""===(C=r[S]).prefix&&C.namespace===e.namespaceURI){f=C.namespace;break}}if(f!==e.namespaceURI)for(S=r.length-1;S>=0;S--){var C;if((C=r[S]).namespace===e.namespaceURI){C.prefix&&(m=C.prefix+":"+d);break}}}t.push("<",m);for(var T=r.slice(),A=0;A<c;A++){"xmlns"==(D=l.item(A)).prefix?T.push({prefix:D.localName,namespace:D.value}):"xmlns"==D.nodeName&&T.push({prefix:"",namespace:D.value})}for(A=0;A<c;A++){var D;if(ve(D=l.item(A),0,T)){var _=D.prefix||"",I=D.namespaceURI;ye(t,_?"xmlns:"+_:"xmlns",I),T.push({prefix:_,namespace:I})}var R=a?a(D):D;R&&("string"==typeof R?t.push(R):ye(t,R.name,R.value))}if(d===m&&ve(e,0,T)){var B=e.prefix||"";I=e.namespaceURI;ye(t,B?"xmlns:"+B:"xmlns",I),T.push({prefix:B,namespace:I})}var P=e.firstChild;if(P||s&&!/^(?:meta|link|img|br|hr|input)$/i.test(d)){if(t.push(">"),s&&/^script$/i.test(d)){for(;P;)P.data?t.push(P.data):xe(P,t,s,a,T.slice(),i),P=P.nextSibling;return t.push("</",d,">"),null}return{ns:T,isHTML:s,tag:m}}return t.push("/>"),null;case x:case k:return{ns:r.slice(),isHTML:s,tag:null};case u:return ye(t,e.name,e.value),null;case g:return t.push(e.data.replace(/[<&>]/g,W)),null;case h:if(i&&-1!==e.data.indexOf("]]>"))throw new M(N,'The CDATASection data contains "]]>"');return t.push("<![CDATA[",e.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case y:if(i&&-1!==e.data.indexOf("--\x3e"))throw new M(N,'The comment node data contains "--\x3e"');return t.push("\x3c!--",e.data,"--\x3e"),null;case w:if(i){if(e.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(e.publicId))throw new M(N,"DocumentType publicId is not a valid PubidLiteral");if(e.systemId&&!/^("[^"]*"|'[^']*')$/.test(e.systemId))throw new M(N,"DocumentType systemId is not a valid SystemLiteral");if(e.internalSubset&&-1!==e.internalSubset.indexOf("]>"))throw new M(N,'DocumentType internalSubset contains "]>"')}var L=e.publicId,U=e.systemId;if(t.push("<!DOCTYPE ",e.name),L)t.push(" PUBLIC ",L),U&&"."!=U&&t.push(" ",U),t.push(">");else if(U&&"."!=U)t.push(" SYSTEM ",U,">");else{var F=e.internalSubset;F&&t.push(" [",F,"]"),t.push(">")}return null;case v:if(i&&-1!==e.data.indexOf("?>"))throw new M(N,'The ProcessingInstruction data contains "?>"');return t.push("<?",e.target," ",e.data,"?>"),null;case b:return t.push("&",e.nodeName,";"),null;default:return t.push("??",e.nodeName),null}},exit:function(e,n){n&&n.tag&&t.push("</",n.tag,">")}})}function we(e,t,n){var a;return H(t,null,{enter:function(t,r){var o=new t.constructor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];"object"!=typeof s&&s!=o[i]&&(o[i]=s)}t.childNodes&&(o.childNodes=new I),o.ownerDocument=e;var l=n;switch(o.nodeType){case p:var c=t.attributes,d=o.attributes=new P,m=c.length;d._ownerElement=o;for(var g=0;g<m;g++)o.setAttributeNode(we(e,c.item(g),!0));break;case u:l=!0}return null!==r?r.appendChild(o):a=o,l?o:null}}),a}function ke(e,t,n){e[t]=n}M.prototype=Error.prototype,c(S,M),I.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t,n){for(var a=!!n&&!!n.requireWellFormed,r=[],o=0;o<this.length;o++)xe(this[o],r,e,t,null,a);return r.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},R.prototype.item=function(e){return B(this),this[e]||null},d(R,I),P.prototype={length:0,item:I.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var n=this[t];if(n.nodeName==e)return n}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new M(_);var n=this.getNamedItem(e.nodeName);return U(this._ownerElement,this,e,n),n},setNamedItemNS:function(e){var t,n=e.ownerElement;if(n&&n!=this._ownerElement)throw new M(_);return t=this.getNamedItemNS(e.namespaceURI,e.localName),U(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return F(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);return F(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){for(var n=this.length;n--;){var a=this[n];if(a.localName==t&&a.namespaceURI==e)return a}return null}},z.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var a=new j;if(a.implementation=this,a.childNodes=new I,a.doctype=n||null,n&&a.appendChild(n),t){var r=a.createElementNS(e,t);a.appendChild(r)}return a},createDocumentType:function(e,t,n){var a=new de;return a.name=e,a.nodeName=e,a.publicId=t||"",a.systemId=n||"",a}},O.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return ne(this,e,t)},replaceChild:function(e,t){ne(this,e,t,te),t&&this.removeChild(t)},removeChild:function(e){return K(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return we(this.ownerDocument||this,this,e)},normalize:function(){H(this,null,{enter:function(e){for(var t=e.firstChild;t;){var n=t.nextSibling;null!==n&&n.nodeType===g&&t.nodeType===g?(e.removeChild(n),t.appendData(n.data)):t=n}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var a in n)if(Object.prototype.hasOwnProperty.call(n,a)&&n[a]===e)return a;t=t.nodeType==u?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&Object.prototype.hasOwnProperty.call(n,e))return n[e];t=t.nodeType==u?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},c(m,O),c(m,O.prototype),H.STOP=Symbol("walkDOM.STOP"),H.ENTER=0,H.EXIT=1,j.prototype={nodeName:"#document",nodeType:x,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==k){for(var n=e.firstChild;n;){var a=n.nextSibling;this.insertBefore(n,t),n=a}return e}return ne(this,e,t),ae(e,this),null===this.documentElement&&e.nodeType===p&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),K(this,e)},replaceChild:function(e,t){ne(this,e,t,te),ae(e,this),t&&this.removeChild(t),Y(e)&&(this.documentElement=e)},importNode:function(e,t){return function(e,t,n){var a;return H(t,null,{enter:function(t,r){var o=t.cloneNode(!1);return o.ownerDocument=e,o.parentNode=null,null===r?a=o:r.appendChild(o),t.nodeType===u||n?o:null}}),a}(this,e,t)},getElementById:function(e){var t=null;return q(this.documentElement,function(n){if(n.nodeType==p&&n.getAttribute("id")==e)return t=n,!0}),t},getElementsByClassName:function(e){var t=l(e);return new R(this,function(n){var a=[];return t.length>0&&q(n.documentElement,function(r){if(r!==n&&r.nodeType===p){var o=r.getAttribute("class");if(o){var i=e===o;if(!i){var s=l(o);i=t.every((c=s,function(e){return c&&-1!==c.indexOf(e)}))}i&&a.push(r)}}var c}),a})},createElement:function(e){var t=new re;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new I,(t.attributes=new P)._ownerElement=t,t},createDocumentFragment:function(){var e=new ge;return e.ownerDocument=this,e.childNodes=new I,e},createTextNode:function(e){var t=new se;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new le;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){if(-1!==e.indexOf("]]>"))throw new M(A,'data contains "]]>"');var t=new ce;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new he;return n.ownerDocument=this,n.tagName=n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new oe;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new ue;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new re,a=t.split(":"),r=n.attributes=new P;return n.childNodes=new I,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==a.length?(n.prefix=a[0],n.localName=a[1]):n.localName=t,r._ownerElement=n,n},createAttributeNS:function(e,t){var n=new oe,a=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==a.length?(n.prefix=a[0],n.localName=a[1]):n.localName=t,n}},d(j,O),re.prototype={nodeType:p,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===k?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,G(e.ownerDocument,e,t),ae(t,e.ownerDocument||e),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var a=this.ownerDocument.createAttributeNS(e,t);a.value=a.nodeValue=""+n,this.setAttributeNode(a)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new R(this,function(t){var n=[];return q(t,function(a){a===t||a.nodeType!=p||"*"!==e&&a.tagName!=e||n.push(a)}),n})},getElementsByTagNameNS:function(e,t){return new R(this,function(n){var a=[];return q(n,function(r){r===n||r.nodeType!==p||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||a.push(r)}),a})}},j.prototype.getElementsByTagName=re.prototype.getElementsByTagName,j.prototype.getElementsByTagNameNS=re.prototype.getElementsByTagNameNS,d(re,O),oe.prototype.nodeType=u,d(oe,O),ie.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(C[T])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},d(ie,O),se.prototype={nodeName:"#text",nodeType:g,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var a=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling),a}},d(se,ie),le.prototype={nodeName:"#comment",nodeType:y},d(le,ie),ce.prototype={nodeName:"#cdata-section",nodeType:h},d(ce,ie),de.prototype.nodeType=w,d(de,O),me.prototype.nodeType=E,d(me,O),pe.prototype.nodeType=f,d(pe,O),ue.prototype.nodeType=b,d(ue,O),ge.prototype.nodeName="#document-fragment",ge.prototype.nodeType=k,d(ge,O),he.prototype.nodeType=v,d(he,O),be.prototype.serializeToString=function(e,t,n,a){return fe.call(e,t,n,a)},O.prototype.toString=fe;try{Object.defineProperty&&(Object.defineProperty(R.prototype,"length",{get:function(){return B(this),this.$$length}}),Object.defineProperty(O.prototype,"textContent",{get:function(){if(this.nodeType===p||this.nodeType===k){var e=[];return H(this,null,{enter:function(t){return t.nodeType===p||t.nodeType===k||(t.nodeType===v||t.nodeType===y?null:void e.push(t.nodeValue))}}),e.join("")}return this.nodeValue},set:function(e){switch(this.nodeType){case p:case k:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ke=function(e,t,n){e["$$"+t]=n})}catch(e){}t.DocumentType=de,t.DOMException=M,t.DOMImplementation=z,t.Element=re,t.Node=O,t.NodeList=I,t.walkDOM=H,t.XMLSerializer=be},6559(e,t,n){"use strict";var a=n(4582).freeze;t.XML_ENTITIES=a({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=a({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ﬃ",fflig:"ﬀ",ffllig:"ﬄ",Ffr:"𝔉",ffr:"𝔣",filig:"ﬁ",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"ﬂ",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"Ĳ",ijlig:"ĳ",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ŉ",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),t.entityMap=t.HTML_ENTITIES},8978(e,t,n){var a=n(4722);t.DOMImplementation=a.DOMImplementation,t.XMLSerializer=a.XMLSerializer,t.DOMParser=n(5752).DOMParser},4466(e,t,n){var a=n(4582).NAMESPACE,r=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,o=new RegExp("[\\-\\.0-9"+r.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+r.source+o.source+"*(?::"+r.source+o.source+"*)?$");function s(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,s)}function l(){}function c(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function d(e,t,n,r,o,i){function s(e,t,a){n.attributeNames.hasOwnProperty(e)&&i.fatalError("Attribute "+e+" redefined"),n.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,o),a)}for(var l,c=++t,d=0;;){var m=e.charAt(c);switch(m){case"=":if(1===d)l=e.slice(t,c),d=3;else{if(2!==d)throw new Error("attribute equal must after attrName");d=3}break;case"'":case'"':if(3===d||1===d){if(1===d&&(i.warning('attribute value must after "="'),l=e.slice(t,c)),t=c+1,!((c=e.indexOf(m,t))>0))throw new Error("attribute value no end '"+m+"' match");s(l,p=e.slice(t,c),t-1),d=5}else{if(4!=d)throw new Error('attribute value must after "="');s(l,p=e.slice(t,c),t),i.warning('attribute "'+l+'" missed start quot('+m+")!!"),t=c+1,d=5}break;case"/":switch(d){case 0:n.setTagName(e.slice(t,c));case 5:case 6:case 7:d=7,n.closed=!0;case 4:case 1:break;case 2:n.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),0==d&&n.setTagName(e.slice(t,c)),c;case">":switch(d){case 0:n.setTagName(e.slice(t,c));case 5:case 6:case 7:break;case 4:case 1:"/"===(p=e.slice(t,c)).slice(-1)&&(n.closed=!0,p=p.slice(0,-1));case 2:2===d&&(p=l),4==d?(i.warning('attribute "'+p+'" missed quot(")!'),s(l,p,t)):(a.isHTML(r[""])&&p.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+p+'" missed value!! "'+p+'" instead!!'),s(p,p,t));break;case 3:throw new Error("attribute value missed!!")}return c;case"":m=" ";default:if(m<=" ")switch(d){case 0:n.setTagName(e.slice(t,c)),d=6;break;case 1:l=e.slice(t,c),d=2;break;case 4:var p=e.slice(t,c);i.warning('attribute "'+p+'" missed quot(")!!'),s(l,p,t);case 5:d=6}else switch(d){case 2:n.tagName;a.isHTML(r[""])&&l.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),s(l,l,t),t=c,d=1;break;case 5:i.warning('attribute space is required"'+l+'"!!');case 6:d=1,t=c;break;case 3:d=4,t=c;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function m(e,t,n){for(var r=e.tagName,o=null,i=e.length;i--;){var s=e[i],l=s.qName,c=s.value;if((u=l.indexOf(":"))>0)var d=s.prefix=l.slice(0,u),m=l.slice(u+1),p="xmlns"===d&&m;else m=l,d=null,p="xmlns"===l&&"";s.localName=m,!1!==p&&(null==o&&(o={},g(n,n={})),n[p]=o[p]=c,s.uri=a.XMLNS,t.startPrefixMapping(p,c))}for(i=e.length;i--;){(d=(s=e[i]).prefix)&&("xml"===d&&(s.uri=a.XML),"xmlns"!==d&&(s.uri=n[d||""]))}var u;(u=r.indexOf(":"))>0?(d=e.prefix=r.slice(0,u),m=e.localName=r.slice(u+1)):(d=null,m=e.localName=r);var h=e.uri=n[d||""];if(t.startElement(h,m,r,e),!e.closed)return e.currentNSMap=n,e.localNSMap=o,!0;if(t.endElement(h,m,r),o)for(d in o)Object.prototype.hasOwnProperty.call(o,d)&&t.endPrefixMapping(d)}function p(e,t,n,a,r){if(/^(?:script|textarea)$/i.test(n)){var o=e.indexOf("</"+n+">",t),i=e.substring(t+1,o);if(/[&<]/.test(i))return/^script$/i.test(n)?(r.characters(i,0,i.length),o):(i=i.replace(/&#?\w+;/g,a),r.characters(i,0,i.length),o)}return t+1}function u(e,t,n,a){var r=a[n];return null==r&&((r=e.lastIndexOf("</"+n+">"))<t&&(r=e.lastIndexOf("</"+n)),a[n]=r),r<t}function g(e,t){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}function h(e,t,n,a){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(r=e.indexOf("--\x3e",t+4))>t?(n.comment(e,t+4,r-t-4),r+3):(a.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,r-t-9),n.endCDATA(),r+3}var o=function(e,t){var n,a=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;r.lastIndex=t,r.exec(e);for(;n=r.exec(e);)if(a.push(n),n[1])return a}(e,t),i=o.length;if(i>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],l=!1,c=!1;i>3&&(/^public$/i.test(o[2][0])?(l=o[3][0],c=i>4&&o[4][0]):/^system$/i.test(o[2][0])&&(c=o[3][0]));var d=o[i-1];return n.startDTD(s,l,c),n.endDTD(),d.index+d[0].length}return-1}function b(e,t,n){var a=e.indexOf("?>",t);if(a){var r=e.substring(t,a).match(/^<\?(\S*)\s*([\s\S]*?)$/);if(r){r[0].length;return n.processingInstruction(r[1],r[2]),a+2}return-1}return-1}function f(){this.attributeNames={}}s.prototype=new Error,s.prototype.name=s.name,l.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),g(t,t={}),function(e,t,n,r,o){function i(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function l(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(n,t)?n[t]:"#"===t.charAt(0)?i(parseInt(t.substr(1).replace("x","0x"))):(o.error("entity not found:"+e),e)}function g(t){if(t>C){var n=e.substring(C,t).replace(/&#?\w+;/g,l);k&&v(C),r.characters(n,0,t-C),C=t}}function v(t,n){for(;t>=x&&(n=w.exec(e));)y=n.index,x=y+n[0].length,k.lineNumber++;k.columnNumber=t-y+1}var y=0,x=0,w=/.*(?:\r\n?|\n)|.*$/g,k=r.locator,E=[{currentNSMap:t}],S={},C=0;for(;;){try{var T=e.indexOf("<",C);if(T<0){if(!e.substr(C).match(/^\s*$/)){var A=r.doc,D=A.createTextNode(e.substr(C));A.appendChild(D),r.currentElement=D}return}switch(T>C&&g(T),e.charAt(T+1)){case"/":var _=e.indexOf(">",T+3),N=e.substring(T+2,_).replace(/[ \t\n\r]+$/g,""),M=E.pop();_<0?(N=e.substring(T+2).replace(/[\s<].*/,""),o.error("end tag name: "+N+" is not complete:"+M.tagName),_=T+1+N.length):N.match(/\s</)&&(N=N.replace(/[\s<].*/,""),o.error("end tag name: "+N+" maybe not complete"),_=T+1+N.length);var I=M.localNSMap,R=M.tagName==N;if(R||M.tagName&&M.tagName.toLowerCase()==N.toLowerCase()){if(r.endElement(M.uri,M.localName,N),I)for(var B in I)Object.prototype.hasOwnProperty.call(I,B)&&r.endPrefixMapping(B);R||o.fatalError("end tag name: "+N+" is not match the current start tagName:"+M.tagName)}else E.push(M);_++;break;case"?":k&&v(T),_=b(e,T,r);break;case"!":k&&v(T),_=h(e,T,r,o);break;default:k&&v(T);var P=new f,L=E[E.length-1].currentNSMap,U=(_=d(e,T,P,L,l,o),P.length);if(!P.closed&&u(e,_,P.tagName,S)&&(P.closed=!0,n.nbsp||o.warning("unclosed xml attribute")),k&&U){for(var F=c(k,{}),z=0;z<U;z++){var O=P[z];v(O.offset),O.locator=c(k,{})}r.locator=F,m(P,r,L)&&E.push(P),r.locator=k}else m(P,r,L)&&E.push(P);a.isHTML(P.uri)&&!P.closed?_=p(e,_,P.tagName,l,r):_++}}catch(e){if(e instanceof s)throw e;o.error("element parse error: "+e),_=-1}_>C?C=_:g(Math.max(T,C)+1)}}(e,t,n,r,this.errorHandler),r.endDocument()}},f.prototype={setTagName:function(e){if(!i.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!i.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},t.XMLReader=l,t.ParseError=s},7526(e,t){"use strict";t.byteLength=function(e){var t=s(e),n=t[0],a=t[1];return 3*(n+a)/4-a},t.toByteArray=function(e){var t,n,o=s(e),i=o[0],l=o[1],c=new r(function(e,t,n){return 3*(t+n)/4-n}(0,i,l)),d=0,m=l>0?i-4:i;for(n=0;n<m;n+=4)t=a[e.charCodeAt(n)]<<18|a[e.charCodeAt(n+1)]<<12|a[e.charCodeAt(n+2)]<<6|a[e.charCodeAt(n+3)],c[d++]=t>>16&255,c[d++]=t>>8&255,c[d++]=255&t;2===l&&(t=a[e.charCodeAt(n)]<<2|a[e.charCodeAt(n+1)]>>4,c[d++]=255&t);1===l&&(t=a[e.charCodeAt(n)]<<10|a[e.charCodeAt(n+1)]<<4|a[e.charCodeAt(n+2)]>>2,c[d++]=t>>8&255,c[d++]=255&t);return c},t.fromByteArray=function(e){for(var t,a=e.length,r=a%3,o=[],i=16383,s=0,l=a-r;s<l;s+=i)o.push(c(e,s,s+i>l?l:s+i));1===r?(t=e[a-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[a-2]<<8)+e[a-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],a=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)n[i]=o[i],a[o.charCodeAt(i)]=i;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,n){for(var a,r=[],o=t;o<n;o+=3)a=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),r.push(l(a));return r.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},7988(e){"use strict";e.exports=function(e){var t=e._SomePromiseArray;function n(e){var n=new t(e),a=n.promise();return n.setHowMany(1),n.setUnwrap(),n.init(),a}e.any=function(e){return n(e)},e.prototype.any=function(){return n(this)}}},8210(e,t,n){"use strict";var a;try{throw new Error}catch(e){a=e}var r=n(1065),o=n(9937),i=n(2208);function s(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new o(16),this._normalQueue=new o(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=r}function l(e,t,n){this._lateQueue.push(e,t,n),this._queueTick()}function c(e,t,n){this._normalQueue.push(e,t,n),this._queueTick()}function d(e){this._normalQueue._pushOne(e),this._queueTick()}s.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},s.prototype.hasCustomScheduler=function(){return this._customScheduler},s.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},s.prototype.disableTrampolineIfNecessary=function(){i.hasDevTools&&(this._trampolineEnabled=!1)},s.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},s.prototype.fatalError=function(e,t){t?(process.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),process.exit(2)):this.throwLater(e)},s.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n")}},i.hasDevTools?(s.prototype.invokeLater=function(e,t,n){this._trampolineEnabled?l.call(this,e,t,n):this._schedule(function(){setTimeout(function(){e.call(t,n)},100)})},s.prototype.invoke=function(e,t,n){this._trampolineEnabled?c.call(this,e,t,n):this._schedule(function(){e.call(t,n)})},s.prototype.settlePromises=function(e){this._trampolineEnabled?d.call(this,e):this._schedule(function(){e._settlePromises()})}):(s.prototype.invokeLater=l,s.prototype.invoke=c,s.prototype.settlePromises=d),s.prototype._drainQueue=function(e){for(;e.length()>0;){var t=e.shift();if("function"==typeof t){var n=e.shift(),a=e.shift();t.call(n,a)}else t._settlePromises()}},s.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},s.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},s.prototype._reset=function(){this._isTickUsed=!1},e.exports=s,e.exports.firstLineError=a},4271(e){"use strict";e.exports=function(e,t,n,a){var r=!1,o=function(e,t){this._reject(t)},i=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(o,o,null,this,e)},s=function(e,t){50397184&this._bitField||this._resolveCallback(t.target)},l=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(o){r||(r=!0,e.prototype._propagateFrom=a.propagateFromFunction(),e.prototype._boundValue=a.boundValueFunction());var c=n(o),d=new e(t);d._propagateFrom(this,1);var m=this._target();if(d._setBoundTo(c),c instanceof e){var p={promiseRejectionQueued:!1,promise:d,target:m,bindingPromise:c};m._then(t,i,void 0,d,p),c._then(s,l,void 0,d,p),d._setOnCancel(c)}else d._resolveCallback(m);return d},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return!(2097152&~this._bitField)},e.bind=function(t,n){return e.resolve(n).bind(t)}}},1675(e,t,n){"use strict";var a=Object.create;if(a){var r=a(null),o=a(null);r[" size"]=o[" size"]=0}e.exports=function(e){var t,a,i=n(2208),s=i.canEvaluate,l=i.isIdentifier,c=function(e){return new Function("ensureMethod","                                    \n        return function(obj) {                                               \n            'use strict'                                                     \n            var len = this.length;                                           \n            ensureMethod(obj, 'methodName');                                 \n            switch(len) {                                                    \n                case 1: return obj.methodName(this[0]);                      \n                case 2: return obj.methodName(this[0], this[1]);             \n                case 3: return obj.methodName(this[0], this[1], this[2]);    \n                case 0: return obj.methodName();                             \n                default:                                                     \n                    return obj.methodName.apply(obj, this);                  \n            }                                                                \n        };                                                                   \n        ".replace(/methodName/g,e))(p)},d=function(e){return new Function("obj","                                             \n        'use strict';                                                        \n        return obj.propertyName;                                             \n        ".replace("propertyName",e))},m=function(e,t,n){var a=n[e];if("function"!=typeof a){if(!l(e))return null;if(a=t(e),n[e]=a,n[" size"]++,n[" size"]>512){for(var r=Object.keys(n),o=0;o<256;++o)delete n[r[o]];n[" size"]=r.length-256}}return a};function p(t,n){var a;if(null!=t&&(a=t[n]),"function"!=typeof a){var r="Object "+i.classString(t)+" has no method '"+i.toString(n)+"'";throw new e.TypeError(r)}return a}function u(e){return p(e,this.pop()).apply(e,this)}function g(e){return e[this]}function h(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}t=function(e){return m(e,c,r)},a=function(e){return m(e,d,o)},e.prototype.call=function(e){for(var n=arguments.length,a=new Array(Math.max(n-1,0)),r=1;r<n;++r)a[r-1]=arguments[r];if(s){var o=t(e);if(null!==o)return this._then(o,void 0,void 0,a,void 0)}return a.push(e),this._then(u,void 0,void 0,a,void 0)},e.prototype.get=function(e){var t;if("number"==typeof e)t=h;else if(s){var n=a(e);t=null!==n?n:g}else t=g;return this._then(t,void 0,void 0,e,void 0)}}},2994(e,t,n){"use strict";e.exports=function(e,t,a,r){var o=n(2208),i=o.tryCatch,s=o.errorObj,l=e._async;e.prototype.break=e.prototype.cancel=function(){if(!r.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var n=e._cancellationParent;if(null==n||!n._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),l.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(e,t){if(o.isArray(e))for(var n=0;n<e.length;++n)this._doInvokeOnCancel(e[n],t);else if(void 0!==e)if("function"==typeof e){if(!t){var a=i(e).call(this._boundValue());a===s&&(this._attachExtraTrace(a.e),l.throwLater(a.e))}}else e._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var e=this._onCancel();this._unsetOnCancel(),l.invoke(this._doInvokeOnCancel,this,e)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}},1674(e,t,n){"use strict";e.exports=function(e){var t=n(2208),a=n(7585).keys,r=t.tryCatch,o=t.errorObj;return function(n,i,s){return function(l){var c=s._boundValue();e:for(var d=0;d<n.length;++d){var m=n[d];if(m===Error||null!=m&&m.prototype instanceof Error){if(l instanceof m)return r(i).call(c,l)}else if("function"==typeof m){var p=r(m).call(c,l);if(p===o)return p;if(p)return r(i).call(c,l)}else if(t.isObject(l)){for(var u=a(m),g=0;g<u.length;++g){var h=u[g];if(m[h]!=l[h])continue e}return r(i).call(c,l)}}return e}}}},297(e){"use strict";e.exports=function(e){var t=!1,n=[];function a(){this._trace=new a.CapturedTrace(r())}function r(){var e=n.length-1;if(e>=0)return n[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},a.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,n.push(this._trace))},a.prototype._popContext=function(){if(void 0!==this._trace){var e=n.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},a.CapturedTrace=null,a.create=function(){if(t)return new a},a.deactivateLongStackTraces=function(){},a.activateLongStackTraces=function(){var n=e.prototype._pushContext,o=e.prototype._popContext,i=e._peekContext,s=e.prototype._peekContext,l=e.prototype._promiseCreated;a.deactivateLongStackTraces=function(){e.prototype._pushContext=n,e.prototype._popContext=o,e._peekContext=i,e.prototype._peekContext=s,e.prototype._promiseCreated=l,t=!1},t=!0,e.prototype._pushContext=a.prototype._pushContext,e.prototype._popContext=a.prototype._popContext,e._peekContext=e.prototype._peekContext=r,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},a}},6636(e,t,n){"use strict";e.exports=function(e,t){var a,r,o,i=e._getDomain,s=e._async,l=n(403).Warning,c=n(2208),d=c.canAttachTrace,m=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,p=/\((?:timers\.js):\d+:\d+\)/,u=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,g=null,h=null,b=!1,f=!(0==c.env("BLUEBIRD_DEBUG")||!c.env("BLUEBIRD_DEBUG")&&"development"!==c.env("NODE_ENV")),v=!(0==c.env("BLUEBIRD_WARNINGS")||!f&&!c.env("BLUEBIRD_WARNINGS")),y=!(0==c.env("BLUEBIRD_LONG_STACK_TRACES")||!f&&!c.env("BLUEBIRD_LONG_STACK_TRACES")),x=0!=c.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(v||!!c.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){524288&this._bitField||(this._setRejectionIsUnhandled(),s.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){q("rejectionHandled",a,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return!!(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),q("unhandledRejection",r,e,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(e,t,n){return F(e,t,n||this)},e.onPossiblyUnhandledRejection=function(e){var t=i();r="function"==typeof e?null===t?e:c.domainBind(t,e):void 0},e.onUnhandledRejectionHandled=function(e){var t=i();a="function"==typeof e?null===t?e:c.domainBind(t,e):void 0};var w=function(){};e.longStackTraces=function(){if(s.haveItemsQueued()&&!X.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");if(!X.longStackTraces&&j()){var n=e.prototype._captureStackTrace,a=e.prototype._attachExtraTrace;X.longStackTraces=!0,w=function(){if(s.haveItemsQueued()&&!X.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=n,e.prototype._attachExtraTrace=a,t.deactivateLongStackTraces(),s.enableTrampoline(),X.longStackTraces=!1},e.prototype._captureStackTrace=L,e.prototype._attachExtraTrace=U,t.activateLongStackTraces(),s.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return X.longStackTraces&&j()};var k=function(){try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return c.global.dispatchEvent(e),function(e,t){var n=new CustomEvent(e.toLowerCase(),{detail:t,cancelable:!0});return!c.global.dispatchEvent(n)}}if("function"==typeof Event){e=new Event("CustomEvent");return c.global.dispatchEvent(e),function(e,t){var n=new Event(e.toLowerCase(),{cancelable:!0});return n.detail=t,!c.global.dispatchEvent(n)}}return(e=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),c.global.dispatchEvent(e),function(e,t){var n=document.createEvent("CustomEvent");return n.initCustomEvent(e.toLowerCase(),!1,!0,t),!c.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),E=c.isNode?function(){return process.emit.apply(process,arguments)}:c.global?function(e){var t="on"+e.toLowerCase(),n=c.global[t];return!!n&&(n.apply(c.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function S(e,t){return{promise:t}}var C={promiseCreated:S,promiseFulfilled:S,promiseRejected:S,promiseResolved:S,promiseCancelled:S,promiseChained:function(e,t,n){return{promise:t,child:n}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,n){return{reason:t,promise:n}},rejectionHandled:S},T=function(e){var t=!1;try{t=E.apply(null,arguments)}catch(e){s.throwLater(e),t=!0}var n=!1;try{n=k(e,C[e].apply(null,arguments))}catch(e){s.throwLater(e),n=!0}return n||t};function A(){return!1}function D(e,t,n){var a=this;try{e(t,n,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+c.toString(e));a._attachCancellationCallback(e)})}catch(e){return e}}function _(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?c.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function N(){return this._onCancelField}function M(e){this._onCancelField=e}function I(){this._cancellationParent=void 0,this._onCancelField=void 0}function R(e,t){if(1&t){this._cancellationParent=e;var n=e._branchesRemainingToCancel;void 0===n&&(n=0),e._branchesRemainingToCancel=n+1}2&t&&e._isBound()&&this._setBoundTo(e._boundTo)}e.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&w()),"warnings"in t){var n=t.warnings;X.warnings=!!n,x=X.warnings,c.isObject(n)&&"wForgottenReturn"in n&&(x=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!X.cancellation){if(s.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=I,e.prototype._propagateFrom=R,e.prototype._onCancel=N,e.prototype._setOnCancel=M,e.prototype._attachCancellationCallback=_,e.prototype._execute=D,B=R,X.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!X.monitoring?(X.monitoring=!0,e.prototype._fireEvent=T):!t.monitoring&&X.monitoring&&(X.monitoring=!1,e.prototype._fireEvent=A)),e},e.prototype._fireEvent=A,e.prototype._execute=function(e,t,n){try{e(t,n)}catch(e){return e}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(e){},e.prototype._attachCancellationCallback=function(e){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(e,t){};var B=function(e,t){2&t&&e._isBound()&&this._setBoundTo(e._boundTo)};function P(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function L(){this._trace=new $(this._peekContext())}function U(e,t){if(d(e)){var n=this._trace;if(void 0!==n&&t&&(n=n._parent),void 0!==n)n.attachExtraTrace(e);else if(!e.__stackCleaned__){var a=O(e);c.notEnumerableProp(e,"stack",a.message+"\n"+a.stack.join("\n")),c.notEnumerableProp(e,"__stackCleaned__",!0)}}}function F(t,n,a){if(X.warnings){var r,o=new l(t);if(n)a._attachExtraTrace(o);else if(X.longStackTraces&&(r=e._peekContext()))r.attachExtraTrace(o);else{var i=O(o);o.stack=i.message+"\n"+i.stack.join("\n")}T("warning",o)||W(o,"",!0)}}function z(e){for(var t=[],n=0;n<e.length;++n){var a=e[n],r="    (No stack trace)"===a||g.test(a),o=r&&V(a);r&&!o&&(b&&" "!==a.charAt(0)&&(a="    "+a),t.push(a))}return t}function O(e){var t=e.stack,n=e.toString();return t="string"==typeof t&&t.length>0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),n=0;n<t.length;++n){var a=t[n];if("    (No stack trace)"===a||g.test(a))break}return n>0&&"SyntaxError"!=e.name&&(t=t.slice(n)),t}(e):["    (No stack trace)"],{message:n,stack:"SyntaxError"==e.name?t:z(t)}}function W(e,t,n){if("undefined"!=typeof console){var a;if(c.isObject(e)){var r=e.stack;a=t+h(r,e)}else a=t+String(e);"function"==typeof o?o(a,n):"function"==typeof console.log||console.log}}function q(e,t,n,a){var r=!1;try{"function"==typeof t&&(r=!0,"rejectionHandled"===e?t(a):t(n,a))}catch(e){s.throwLater(e)}"unhandledRejection"===e?T(e,n,a)||r||W(n,"Unhandled rejection "):T(e,a)}function H(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():c.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){var t=41;if(e.length<t)return e;return e.substr(0,t-3)+"..."}(t)+">, no stack trace)"}function j(){return"function"==typeof Y}var V=function(){return!1},G=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function K(e){var t=e.match(G);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function $(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Y(this,$),t>32&&this.uncycle()}c.inherits($,Error),t.CapturedTrace=$,$.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],n={},a=0,r=this;void 0!==r;++a)t.push(r),r=r._parent;for(a=(e=this._length=a)-1;a>=0;--a){var o=t[a].stack;void 0===n[o]&&(n[o]=a)}for(a=0;a<e;++a){var i=n[t[a].stack];if(void 0!==i&&i!==a){i>0&&(t[i-1]._parent=void 0,t[i-1]._length=1),t[a]._parent=void 0,t[a]._length=1;var s=a>0?t[a-1]:this;i<e-1?(s._parent=t[i+1],s._parent.uncycle(),s._length=s._parent._length+1):(s._parent=void 0,s._length=1);for(var l=s._length+1,c=a-2;c>=0;--c)t[c]._length=l,l++;return}}}},$.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=O(e),n=t.message,a=[t.stack],r=this;void 0!==r;)a.push(z(r.stack.split("\n"))),r=r._parent;!function(e){for(var t=e[0],n=1;n<e.length;++n){for(var a=e[n],r=t.length-1,o=t[r],i=-1,s=a.length-1;s>=0;--s)if(a[s]===o){i=s;break}for(s=i;s>=0;--s){var l=a[s];if(t[r]!==l)break;t.pop(),r--}t=a}}(a),function(e){for(var t=0;t<e.length;++t)(0===e[t].length||t+1<e.length&&e[t][0]===e[t+1][0])&&(e.splice(t,1),t--)}(a),c.notEnumerableProp(e,"stack",function(e,t){for(var n=0;n<t.length-1;++n)t[n].push("From previous event:"),t[n]=t[n].join("\n");return n<t.length&&(t[n]=t[n].join("\n")),e+"\n"+t.join("\n")}(n,a)),c.notEnumerableProp(e,"__stackCleaned__",!0)}};var Y=function(){var e=/^\s*at\s*/,t=function(e,t){return"string"==typeof e?e:void 0!==t.name&&void 0!==t.message?t.toString():H(t)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,g=e,h=t;var n=Error.captureStackTrace;return V=function(e){return m.test(e)},function(e,t){Error.stackTraceLimit+=6,n(e,t),Error.stackTraceLimit-=6}}var a,r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return g=/@/,h=t,b=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){a="stack"in e}return!("stack"in r)&&a&&"number"==typeof Error.stackTraceLimit?(g=e,h=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6}):(h=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?H(t):t.toString()},null)}();"undefined"!=typeof console&&void 0!==console.warn&&(o=function(e){},c.isNode&&process.stderr.isTTY?o=function(e,t){}:c.isNode||"string"!=typeof(new Error).stack||(o=function(e,t){}));var X={warnings:v,longStackTraces:!1,cancellation:!1,monitoring:!1};return y&&e.longStackTraces(),{longStackTraces:function(){return X.longStackTraces},warnings:function(){return X.warnings},cancellation:function(){return X.cancellation},monitoring:function(){return X.monitoring},propagateFromFunction:function(){return B},boundValueFunction:function(){return P},checkForgottenReturns:function(e,t,n,a,r){if(void 0===e&&null!==t&&x){if(void 0!==r&&r._returnedNonUndefined())return;if(!(65535&a._bitField))return;n&&(n+=" ");var o="",i="";if(t._trace){for(var s=t._trace.stack.split("\n"),l=z(s),c=l.length-1;c>=0;--c){var d=l[c];if(!p.test(d)){var m=d.match(u);m&&(o="at "+m[1]+":"+m[2]+":"+m[3]+" ");break}}if(l.length>0){var g=l[0];for(c=0;c<s.length;++c)if(s[c]===g){c>0&&(i="\n"+s[c-1]);break}}}var h="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+i;a._warn(h,!0,t)}},setBounds:function(e,t){if(j()){for(var n,a,r=e.stack.split("\n"),o=t.stack.split("\n"),i=-1,s=-1,l=0;l<r.length;++l){if(c=K(r[l])){n=c.fileName,i=c.line;break}}for(l=0;l<o.length;++l){var c;if(c=K(o[l])){a=c.fileName,s=c.line;break}}i<0||s<0||!n||!a||n!==a||i>=s||(V=function(e){if(m.test(e))return!0;var t=K(e);return!!(t&&t.fileName===n&&i<=t.line&&t.line<=s)})}},warn:F,deprecated:function(e,t){var n=e+" is deprecated and will be removed in a future version.";return t&&(n+=" Use "+t+" instead."),F(n)},CapturedTrace:$,fireDomEvent:k,fireGlobalEvent:E}}},6774(e){"use strict";e.exports=function(e){function t(){return this.value}function n(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(n){return n instanceof e&&n.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:n},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(n,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof e&&n.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:n},void 0);var a=arguments[1];a instanceof e&&a.suppressUnhandledRejections();return this.caught(n,function(){return a})}}},3425(e){"use strict";e.exports=function(e,t){var n=e.reduce,a=e.all;function r(){return a(this)}e.prototype.each=function(e){return n(this,e,t,0)._then(r,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return n(this,e,t,t)},e.each=function(e,a){return n(e,a,t,0)._then(r,void 0,void 0,e,void 0)},e.mapSeries=function(e,a){return n(e,a,t,t)}}},403(e,t,n){"use strict";var a,r,o=n(7585),i=o.freeze,s=n(2208),l=s.inherits,c=s.notEnumerableProp;function d(e,t){function n(a){if(!(this instanceof n))return new n(a);c(this,"message","string"==typeof a?a:t),c(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return l(n,Error),n}var m=d("Warning","warning"),p=d("CancellationError","cancellation error"),u=d("TimeoutError","timeout error"),g=d("AggregateError","aggregate error");try{a=TypeError,r=RangeError}catch(e){a=d("TypeError","type error"),r=d("RangeError","range error")}for(var h="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),b=0;b<h.length;++b)"function"==typeof Array.prototype[h[b]]&&(g.prototype[h[b]]=Array.prototype[h[b]]);o.defineProperty(g.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),g.prototype.isOperational=!0;var f=0;function v(e){if(!(this instanceof v))return new v(e);c(this,"name","OperationalError"),c(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(c(this,"message",e.message),c(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}g.prototype.toString=function(){var e=Array(4*f+1).join(" "),t="\n"+e+"AggregateError of:\n";f++,e=Array(4*f+1).join(" ");for(var n=0;n<this.length;++n){for(var a=this[n]===this?"[Circular AggregateError]":this[n]+"",r=a.split("\n"),o=0;o<r.length;++o)r[o]=e+r[o];t+=(a=r.join("\n"))+"\n"}return f--,t},l(v,Error);var y=Error.__BluebirdErrorTypes__;y||(y=i({CancellationError:p,TimeoutError:u,OperationalError:v,RejectionError:v,AggregateError:g}),o.defineProperty(Error,"__BluebirdErrorTypes__",{value:y,writable:!1,enumerable:!1,configurable:!1})),e.exports={Error,TypeError:a,RangeError:r,CancellationError:y.CancellationError,OperationalError:y.OperationalError,TimeoutError:y.TimeoutError,AggregateError:y.AggregateError,Warning:m}},7585(e){var t=function(){"use strict";return void 0===this}();if(t)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:t,propertyIsWritable:function(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!(n&&!n.writable&&!n.set)}};else{var n={}.hasOwnProperty,a={}.toString,r={}.constructor.prototype,o=function(e){var t=[];for(var a in e)n.call(e,a)&&t.push(a);return t};e.exports={isArray:function(e){try{return"[object Array]"===a.call(e)}catch(e){return!1}},keys:o,names:o,defineProperty:function(e,t,n){return e[t]=n.value,e},getDescriptor:function(e,t){return{value:e[t]}},freeze:function(e){return e},getPrototypeOf:function(e){try{return Object(e).constructor.prototype}catch(e){return r}},isES5:t,propertyIsWritable:function(){return!0}}}},2730(e){"use strict";e.exports=function(e,t){var n=e.map;e.prototype.filter=function(e,a){return n(this,e,a,t)},e.filter=function(e,a,r){return n(e,a,r,t)}}},401(e,t,n){"use strict";e.exports=function(e,t){var a=n(2208),r=e.CancellationError,o=a.errorObj;function i(e,t,n){this.promise=e,this.type=t,this.handler=n,this.called=!1,this.cancelPromise=null}function s(e){this.finallyHandler=e}function l(e,t){return null!=e.cancelPromise&&(arguments.length>1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function c(){return m.call(this,this.promise._target()._settledValue())}function d(e){if(!l(this,e))return o.e=e,o}function m(n){var a=this.promise,i=this.handler;if(!this.called){this.called=!0;var m=this.isFinallyHandler()?i.call(a._boundValue()):i.call(a._boundValue(),n);if(void 0!==m){a._setReturnedNonUndefined();var p=t(m,a);if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var u=new r("late cancellation observer");return a._attachExtraTrace(u),o.e=u,o}p.isPending()&&p._attachCancellationCallback(new s(this))}return p._then(c,d,void 0,this,void 0)}}}return a.isRejected()?(l(this),o.e=n,o):(l(this),n)}return i.prototype.isFinallyHandler=function(){return 0===this.type},s.prototype._resultCancelled=function(){l(this.finallyHandler)},e.prototype._passThrough=function(e,t,n,a){return"function"!=typeof e?this.then():this._then(n,a,void 0,new i(this,t,e),void 0)},e.prototype.lastly=e.prototype.finally=function(e){return this._passThrough(e,0,m,m)},e.prototype.tap=function(e){return this._passThrough(e,1,m)},i}},5734(e,t,n){"use strict";e.exports=function(e,t,a,r,o,i){var s=n(403).TypeError,l=n(2208),c=l.errorObj,d=l.tryCatch,m=[];function p(t,n,r,o){if(i.cancellation()){var s=new e(a),l=this._finallyPromise=new e(a);this._promise=s.lastly(function(){return l}),s._captureStackTrace(),s._setOnCancel(this)}else{(this._promise=new e(a))._captureStackTrace()}this._stack=o,this._generatorFunction=t,this._receiver=n,this._generator=void 0,this._yieldHandlers="function"==typeof r?[r].concat(m):m,this._yieldedPromise=null,this._cancellationPhase=!1}l.inherits(p,o),p.prototype._isResolved=function(){return null===this._promise},p.prototype._cleanup=function(){this._promise=this._generator=null,i.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},p.prototype._promiseCancelled=function(){if(!this._isResolved()){var t;if(void 0!==this._generator.return)this._promise._pushContext(),t=d(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var n=new e.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=n,this._promise._attachExtraTrace(n),this._promise._pushContext(),t=d(this._generator.throw).call(this._generator,n),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(t)}},p.prototype._promiseFulfilled=function(e){this._yieldedPromise=null,this._promise._pushContext();var t=d(this._generator.next).call(this._generator,e);this._promise._popContext(),this._continue(t)},p.prototype._promiseRejected=function(e){this._yieldedPromise=null,this._promise._attachExtraTrace(e),this._promise._pushContext();var t=d(this._generator.throw).call(this._generator,e);this._promise._popContext(),this._continue(t)},p.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var t=this._yieldedPromise;this._yieldedPromise=null,t.cancel()}},p.prototype.promise=function(){return this._promise},p.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},p.prototype._continue=function(t){var n=this._promise;if(t===c)return this._cleanup(),this._cancellationPhase?n.cancel():n._rejectCallback(t.e,!1);var a=t.value;if(!0===t.done)return this._cleanup(),this._cancellationPhase?n.cancel():n._resolveCallback(a);var o=r(a,this._promise);if(o instanceof e||(o=function(t,n,a){for(var o=0;o<n.length;++o){a._pushContext();var i=d(n[o])(t);if(a._popContext(),i===c){a._pushContext();var s=e.reject(c.e);return a._popContext(),s}var l=r(i,a);if(l instanceof e)return l}return null}(o,this._yieldHandlers,this._promise),null!==o)){var i=(o=o._target())._bitField;50397184&i?33554432&i?e._async.invoke(this._promiseFulfilled,this,o._value()):16777216&i?e._async.invoke(this._promiseRejected,this,o._reason()):this._promiseCancelled():(this._yieldedPromise=o,o._proxy(this,null))}else this._promiseRejected(new s("A value %s was yielded that could not be treated as a promise\n\n    See http://goo.gl/MqrFmX\n\n".replace("%s",a)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")))},e.coroutine=function(e,t){if("function"!=typeof e)throw new s("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");var n=Object(t).yieldHandler,a=p,r=(new Error).stack;return function(){var t=e.apply(this,arguments),o=new a(void 0,void 0,n,r),i=o.promise();return o._generator=t,o._promiseFulfilled(void 0),i}},e.coroutine.addYieldHandler=function(e){if("function"!=typeof e)throw new s("expecting a function but got "+l.classString(e));m.push(e)},e.spawn=function(n){if(i.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof n)return t("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");var a=new p(n,this),r=a.promise();return a._run(e.spawn),r}}},6564(e,t,n){"use strict";e.exports=function(e,t,a,r,o,i){var s,l=n(2208),c=l.canEvaluate,d=l.tryCatch,m=l.errorObj;if(c){for(var p=function(e){return new Function("value","holder","                             \n            'use strict';                                                    \n            holder.pIndex = value;                                           \n            holder.checkFulfillment(this);                                   \n            ".replace(/Index/g,e))},u=function(e){return new Function("promise","holder","                           \n            'use strict';                                                    \n            holder.pIndex = promise;                                         \n            ".replace(/Index/g,e))},g=function(t){for(var n=new Array(t),a=0;a<n.length;++a)n[a]="this.p"+(a+1);var r=n.join(" = ")+" = null;",i="var promise;\n"+n.map(function(e){return"                                                         \n                promise = "+e+";                                      \n                if (promise instanceof Promise) {                            \n                    promise.cancel();                                        \n                }                                                            \n            "}).join("\n"),s=n.join(", "),l="Holder$"+t,c="return function(tryCatch, errorObj, Promise, async) {    \n            'use strict';                                                    \n            function [TheName](fn) {                                         \n                [TheProperties]                                              \n                this.fn = fn;                                                \n                this.asyncNeeded = true;                                     \n                this.now = 0;                                                \n            }                                                                \n                                                                             \n            [TheName].prototype._callFunction = function(promise) {          \n                promise._pushContext();                                      \n                var ret = tryCatch(this.fn)([ThePassedArguments]);           \n                promise._popContext();                                       \n                if (ret === errorObj) {                                      \n                    promise._rejectCallback(ret.e, false);                   \n                } else {                                                     \n                    promise._resolveCallback(ret);                           \n                }                                                            \n            };                                                               \n                                                                             \n            [TheName].prototype.checkFulfillment = function(promise) {       \n                var now = ++this.now;                                        \n                if (now === [TheTotal]) {                                    \n                    if (this.asyncNeeded) {                                  \n                        async.invoke(this._callFunction, this, promise);     \n                    } else {                                                 \n                        this._callFunction(promise);                         \n                    }                                                        \n                                                                             \n                }                                                            \n            };                                                               \n                                                                             \n            [TheName].prototype._resultCancelled = function() {              \n                [CancellationCode]                                           \n            };                                                               \n                                                                             \n            return [TheName];                                                \n        }(tryCatch, errorObj, Promise, async);                               \n        ";return c=c.replace(/\[TheName\]/g,l).replace(/\[TheTotal\]/g,t).replace(/\[ThePassedArguments\]/g,s).replace(/\[TheProperties\]/g,r).replace(/\[CancellationCode\]/g,i),new Function("tryCatch","errorObj","Promise","async",c)(d,m,e,o)},h=[],b=[],f=[],v=0;v<8;++v)h.push(g(v+1)),b.push(p(v+1)),f.push(u(v+1));s=function(e){this._reject(e)}}e.join=function(){var n,o=arguments.length-1;if(o>0&&"function"==typeof arguments[o]&&(n=arguments[o],o<=8&&c)){(k=new e(r))._captureStackTrace();for(var d=new(0,h[o-1])(n),m=b,p=0;p<o;++p){var u=a(arguments[p],k);if(u instanceof e){var g=(u=u._target())._bitField;50397184&g?33554432&g?m[p].call(k,u._value(),d):16777216&g?k._reject(u._reason()):k._cancel():(u._then(m[p],s,void 0,k,d),f[p](u,d),d.asyncNeeded=!1)}else m[p].call(k,u,d)}if(!k._isFateSealed()){if(d.asyncNeeded){var v=i();null!==v&&(d.fn=l.domainBind(v,d.fn))}k._setAsyncGuaranteed(),k._setOnCancel(d)}return k}for(var y=arguments.length,x=new Array(y),w=0;w<y;++w)x[w]=arguments[w];n&&x.pop();var k=new t(x).promise();return void 0!==n?k.spread(n):k}}},5956(e,t,n){"use strict";e.exports=function(e,t,a,r,o,i){var s=e._getDomain,l=n(2208),c=l.tryCatch,d=l.errorObj,m=e._async;function p(e,t,n,a){this.constructor$(e),this._promise._captureStackTrace();var r=s();this._callback=null===r?t:l.domainBind(r,t),this._preservedValues=a===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],m.invoke(this._asyncInit,this,void 0)}function u(t,n,r,o){if("function"!=typeof n)return a("expecting a function but got "+l.classString(n));var i=0;if(void 0!==r){if("object"!=typeof r||null===r)return e.reject(new TypeError("options argument must be an object but it is "+l.classString(r)));if("number"!=typeof r.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+l.classString(r.concurrency)));i=r.concurrency}return new p(t,n,i="number"==typeof i&&isFinite(i)&&i>=1?i:0,o).promise()}l.inherits(p,t),p.prototype._asyncInit=function(){this._init$(void 0,-2)},p.prototype._init=function(){},p.prototype._promiseFulfilled=function(t,n){var a=this._values,o=this.length(),s=this._preservedValues,l=this._limit;if(n<0){if(a[n=-1*n-1]=t,l>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(l>=1&&this._inFlight>=l)return a[n]=t,this._queue.push(n),!1;null!==s&&(s[n]=t);var m=this._promise,p=this._callback,u=m._boundValue();m._pushContext();var g=c(p).call(u,t,n,o),h=m._popContext();if(i.checkForgottenReturns(g,h,null!==s?"Promise.filter":"Promise.map",m),g===d)return this._reject(g.e),!0;var b=r(g,this._promise);if(b instanceof e){var f=(b=b._target())._bitField;if(!(50397184&f))return l>=1&&this._inFlight++,a[n]=b,b._proxy(this,-1*(n+1)),!1;if(!(33554432&f))return 16777216&f?(this._reject(b._reason()),!0):(this._cancel(),!0);g=b._value()}a[n]=g}return++this._totalResolved>=o&&(null!==s?this._filter(a,s):this._resolve(a),!0)},p.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,n=this._values;e.length>0&&this._inFlight<t;){if(this._isResolved())return;var a=e.pop();this._promiseFulfilled(n[a],a)}},p.prototype._filter=function(e,t){for(var n=t.length,a=new Array(n),r=0,o=0;o<n;++o)e[o]&&(a[r++]=t[o]);a.length=r,this._resolve(a)},p.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(e,t){return u(this,e,t,null)},e.map=function(e,t,n,a){return u(e,t,n,a)}}},6241(e,t,n){"use strict";e.exports=function(e,t,a,r,o){var i=n(2208),s=i.tryCatch;e.method=function(n){if("function"!=typeof n)throw new e.TypeError("expecting a function but got "+i.classString(n));return function(){var a=new e(t);a._captureStackTrace(),a._pushContext();var r=s(n).apply(this,arguments),i=a._popContext();return o.checkForgottenReturns(r,i,"Promise.method",a),a._resolveFromSyncValue(r),a}},e.attempt=e.try=function(n){if("function"!=typeof n)return r("expecting a function but got "+i.classString(n));var a,l=new e(t);if(l._captureStackTrace(),l._pushContext(),arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],d=arguments[2];a=i.isArray(c)?s(n).apply(d,c):s(n).call(d,c)}else a=s(n)();var m=l._popContext();return o.checkForgottenReturns(a,m,"Promise.try",l),l._resolveFromSyncValue(a),l},e.prototype._resolveFromSyncValue=function(e){e===i.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},1231(e,t,n){"use strict";var a=n(2208),r=a.maybeWrapAsError,o=n(403).OperationalError,i=n(7585);var s=/^(?:name|message|stack|cause)$/;function l(e){var t;if(function(e){return e instanceof Error&&i.getPrototypeOf(e)===Error.prototype}(e)){(t=new o(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var n=i.keys(e),r=0;r<n.length;++r){var l=n[r];s.test(l)||(t[l]=e[l])}return t}return a.markAsOriginatingFromRejection(e),e}e.exports=function(e,t){return function(n,a){if(null!==e){if(n){var o=l(r(n));e._attachExtraTrace(o),e._reject(o)}else if(t){for(var i=arguments.length,s=new Array(Math.max(i-1,0)),c=1;c<i;++c)s[c-1]=arguments[c];e._fulfill(s)}else e._fulfill(a);e=null}}}},6340(e,t,n){"use strict";e.exports=function(e){var t=n(2208),a=e._async,r=t.tryCatch,o=t.errorObj;function i(e,n){if(!t.isArray(e))return s.call(this,e,n);var i=r(n).apply(this._boundValue(),[null].concat(e));i===o&&a.throwLater(i.e)}function s(e,t){var n=this._boundValue(),i=void 0===e?r(t).call(n,null):r(t).call(n,null,e);i===o&&a.throwLater(i.e)}function l(e,t){if(!e){var n=new Error(e+"");n.cause=e,e=n}var i=r(t).call(this._boundValue(),e);i===o&&a.throwLater(i.e)}e.prototype.asCallback=e.prototype.nodeify=function(e,t){if("function"==typeof e){var n=s;void 0!==t&&Object(t).spread&&(n=i),this._then(n,l,void 0,this,e)}return this}}},9979(e,t,n){"use strict";e.exports=function(){var t=function(){return new u("circular promise resolution chain\n\n    See http://goo.gl/MqrFmX\n")},a=function(){return new D.PromiseInspection(this._target())},r=function(e){return D.reject(new u(e))};function o(){}var i,s={},l=n(2208);i=l.isNode?function(){var e=process.domain;return void 0===e&&(e=null),e}:function(){return null},l.notEnumerableProp(D,"_getDomain",i);var c=n(7585),d=n(8210),m=new d;c.defineProperty(D,"_async",{value:m});var p=n(403),u=D.TypeError=p.TypeError;D.RangeError=p.RangeError;var g=D.CancellationError=p.CancellationError;D.TimeoutError=p.TimeoutError,D.OperationalError=p.OperationalError,D.RejectionError=p.OperationalError,D.AggregateError=p.AggregateError;var h=function(){},b={},f={},v=n(8974)(D,h),y=n(2661)(D,h,v,r,o),x=n(297)(D),w=x.create,k=n(6636)(D,x),E=(k.CapturedTrace,n(401)(D,v)),S=n(1674)(f),C=n(1231),T=l.errorObj,A=l.tryCatch;function D(e){this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,e!==h&&(!function(e,t){if("function"!=typeof t)throw new u("expecting a function but got "+l.classString(t));if(e.constructor!==D)throw new u("the promise constructor cannot be invoked directly\n\n    See http://goo.gl/MqrFmX\n")}(this,e),this._resolveFromExecutor(e)),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function _(e){this.promise._resolveCallback(e)}function N(e){this.promise._rejectCallback(e,!1)}function M(e){var t=new D(h);t._fulfillmentHandler0=e,t._rejectionHandler0=e,t._promise0=e,t._receiver0=e}return D.prototype.toString=function(){return"[object Promise]"},D.prototype.caught=D.prototype.catch=function(e){var t=arguments.length;if(t>1){var n,a=new Array(t-1),o=0;for(n=0;n<t-1;++n){var i=arguments[n];if(!l.isObject(i))return r("expecting an object but got A catch statement predicate "+l.classString(i));a[o++]=i}return a.length=o,e=arguments[n],this.then(void 0,S(a,e,this))}return this.then(void 0,e)},D.prototype.reflect=function(){return this._then(a,a,void 0,this,void 0)},D.prototype.then=function(e,t){if(k.warnings()&&arguments.length>0&&"function"!=typeof e&&"function"!=typeof t){var n=".then() only accepts functions but was passed: "+l.classString(e);arguments.length>1&&(n+=", "+l.classString(t)),this._warn(n)}return this._then(e,t,void 0,void 0,void 0)},D.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},D.prototype.spread=function(e){return"function"!=typeof e?r("expecting a function but got "+l.classString(e)):this.all()._then(e,void 0,void 0,b,void 0)},D.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},D.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new y(this).promise()},D.prototype.error=function(e){return this.caught(l.originatesFromRejection,e)},D.getNewLibraryCopy=e.exports,D.is=function(e){return e instanceof D},D.fromNode=D.fromCallback=function(e){var t=new D(h);t._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,a=A(e)(C(t,n));return a===T&&t._rejectCallback(a.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},D.all=function(e){return new y(e).promise()},D.cast=function(e){var t=v(e);return t instanceof D||((t=new D(h))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},D.resolve=D.fulfilled=D.cast,D.reject=D.rejected=function(e){var t=new D(h);return t._captureStackTrace(),t._rejectCallback(e,!0),t},D.setScheduler=function(e){if("function"!=typeof e)throw new u("expecting a function but got "+l.classString(e));return m.setScheduler(e)},D.prototype._then=function(e,t,n,a,r){var o=void 0!==r,s=o?r:new D(h),c=this._target(),d=c._bitField;o||(s._propagateFrom(this,3),s._captureStackTrace(),void 0===a&&2097152&this._bitField&&(a=50397184&d?this._boundValue():c===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,s));var p=i();if(50397184&d){var u,b,f=c._settlePromiseCtx;33554432&d?(b=c._rejectionHandler0,u=e):16777216&d?(b=c._fulfillmentHandler0,u=t,c._unsetRejectionIsUnhandled()):(f=c._settlePromiseLateCancellationObserver,b=new g("late cancellation observer"),c._attachExtraTrace(b),u=t),m.invoke(f,c,{handler:null===p?u:"function"==typeof u&&l.domainBind(p,u),promise:s,receiver:a,value:b})}else c._addCallbacks(e,t,s,a,p);return s},D.prototype._length=function(){return 65535&this._bitField},D.prototype._isFateSealed=function(){return!!(117506048&this._bitField)},D.prototype._isFollowing=function(){return!(67108864&~this._bitField)},D.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},D.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},D.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},D.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},D.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},D.prototype._isFinal=function(){return(4194304&this._bitField)>0},D.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},D.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},D.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},D.prototype._setAsyncGuaranteed=function(){m.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},D.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==s)return void 0===t&&this._isBound()?this._boundValue():t},D.prototype._promiseAt=function(e){return this[4*e-4+2]},D.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},D.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},D.prototype._boundValue=function(){},D.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,n=e._rejectionHandler0,a=e._promise0,r=e._receiverAt(0);void 0===r&&(r=s),this._addCallbacks(t,n,a,r,null)},D.prototype._migrateCallbackAt=function(e,t){var n=e._fulfillmentHandlerAt(t),a=e._rejectionHandlerAt(t),r=e._promiseAt(t),o=e._receiverAt(t);void 0===o&&(o=s),this._addCallbacks(n,a,r,o,null)},D.prototype._addCallbacks=function(e,t,n,a,r){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=a,"function"==typeof e&&(this._fulfillmentHandler0=null===r?e:l.domainBind(r,e)),"function"==typeof t&&(this._rejectionHandler0=null===r?t:l.domainBind(r,t));else{var i=4*o-4;this[i+2]=n,this[i+3]=a,"function"==typeof e&&(this[i+0]=null===r?e:l.domainBind(r,e)),"function"==typeof t&&(this[i+1]=null===r?t:l.domainBind(r,t))}return this._setLength(o+1),o},D.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},D.prototype._resolveCallback=function(e,n){if(!(117506048&this._bitField)){if(e===this)return this._rejectCallback(t(),!1);var a=v(e,this);if(!(a instanceof D))return this._fulfill(e);n&&this._propagateFrom(a,2);var r=a._target();if(r!==this){var o=r._bitField;if(50397184&o)if(33554432&o)this._fulfill(r._value());else if(16777216&o)this._reject(r._reason());else{var i=new g("late cancellation observer");r._attachExtraTrace(i),this._reject(i)}else{var s=this._length();s>0&&r._migrateCallback0(this);for(var l=1;l<s;++l)r._migrateCallbackAt(this,l);this._setFollowing(),this._setLength(0),this._setFollowee(r)}}else this._reject(t())}},D.prototype._rejectCallback=function(e,t,n){var a=l.ensureErrorObject(e),r=a===e;if(!r&&!n&&k.warnings()){var o="a promise was rejected with a non-error: "+l.classString(e);this._warn(o,!0)}this._attachExtraTrace(a,!!t&&r),this._reject(e)},D.prototype._resolveFromExecutor=function(e){var t=this;this._captureStackTrace(),this._pushContext();var n=!0,a=this._execute(e,function(e){t._resolveCallback(e)},function(e){t._rejectCallback(e,n)});n=!1,this._popContext(),void 0!==a&&t._rejectCallback(a,!0)},D.prototype._settlePromiseFromHandler=function(e,t,n,a){var r=a._bitField;if(!(65536&r)){var o;a._pushContext(),t===b?n&&"number"==typeof n.length?o=A(e).apply(this._boundValue(),n):(o=T).e=new u("cannot .spread() a non-array: "+l.classString(n)):o=A(e).call(t,n);var i=a._popContext();65536&(r=a._bitField)||(o===f?a._reject(n):o===T?a._rejectCallback(o.e,!1):(k.checkForgottenReturns(o,i,"",a,this),a._resolveCallback(o)))}},D.prototype._target=function(){for(var e=this;e._isFollowing();)e=e._followee();return e},D.prototype._followee=function(){return this._rejectionHandler0},D.prototype._setFollowee=function(e){this._rejectionHandler0=e},D.prototype._settlePromise=function(e,t,n,r){var i=e instanceof D,s=this._bitField,l=!!(134217728&s);65536&s?(i&&e._invokeInternalOnCancel(),n instanceof E&&n.isFinallyHandler()?(n.cancelPromise=e,A(t).call(n,r)===T&&e._reject(T.e)):t===a?e._fulfill(a.call(n)):n instanceof o?n._promiseCancelled(e):i||e instanceof y?e._cancel():n.cancel()):"function"==typeof t?i?(l&&e._setAsyncGuaranteed(),this._settlePromiseFromHandler(t,n,r,e)):t.call(n,r,e):n instanceof o?n._isResolved()||(33554432&s?n._promiseFulfilled(r,e):n._promiseRejected(r,e)):i&&(l&&e._setAsyncGuaranteed(),33554432&s?e._fulfill(r):e._reject(r))},D.prototype._settlePromiseLateCancellationObserver=function(e){var t=e.handler,n=e.promise,a=e.receiver,r=e.value;"function"==typeof t?n instanceof D?this._settlePromiseFromHandler(t,a,r,n):t.call(a,r,n):n instanceof D&&n._reject(r)},D.prototype._settlePromiseCtx=function(e){this._settlePromise(e.promise,e.handler,e.receiver,e.value)},D.prototype._settlePromise0=function(e,t,n){var a=this._promise0,r=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(a,e,r,t)},D.prototype._clearCallbackDataAtIndex=function(e){var t=4*e-4;this[t+2]=this[t+3]=this[t+0]=this[t+1]=void 0},D.prototype._fulfill=function(e){var n=this._bitField;if(!((117506048&n)>>>16)){if(e===this){var a=t();return this._attachExtraTrace(a),this._reject(a)}this._setFulfilled(),this._rejectionHandler0=e,(65535&n)>0&&(134217728&n?this._settlePromises():m.settlePromises(this))}},D.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,l.isNode);(65535&t)>0?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},D.prototype._fulfillPromises=function(e,t){for(var n=1;n<e;n++){var a=this._fulfillmentHandlerAt(n),r=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(r,a,o,t)}},D.prototype._rejectPromises=function(e,t){for(var n=1;n<e;n++){var a=this._rejectionHandlerAt(n),r=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(r,a,o,t)}},D.prototype._settlePromises=function(){var e=this._bitField,t=65535&e;if(t>0){if(16842752&e){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,e),this._rejectPromises(t,n)}else{var a=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,a,e),this._fulfillPromises(t,a)}this._setLength(0)}this._clearCancellationData()},D.prototype._settledValue=function(){var e=this._bitField;return 33554432&e?this._rejectionHandler0:16777216&e?this._fulfillmentHandler0:void 0},D.defer=D.pending=function(){return k.deprecated("Promise.defer","new Promise"),{promise:new D(h),resolve:_,reject:N}},l.notEnumerableProp(D,"_makeSelfResolutionError",t),n(6241)(D,h,v,r,k),n(4271)(D,h,v,k),n(2994)(D,y,r,k),n(6774)(D),n(4900)(D),n(6564)(D,y,v,h,m,i),D.Promise=D,D.version="3.4.7",n(5956)(D,y,r,v,h,k),n(1675)(D),n(6178)(D,r,v,w,h,k),n(6406)(D,h,k),n(5734)(D,r,h,v,o,k),n(6340)(D),n(3437)(D,h),n(4416)(D,y,v,r),n(3381)(D,h,v,r),n(8722)(D,y,r,v,h,k),n(9047)(D,y,k),n(7784)(D,y,r),n(2730)(D,h),n(3425)(D,h),n(7988)(D),l.toFastProperties(D),l.toFastProperties(D.prototype),M({a:1}),M({b:2}),M({c:3}),M(1),M(function(){}),M(void 0),M(!1),M(new D(h)),k.setBounds(d.firstLineError,l.lastLineError),D}},2661(e,t,n){"use strict";e.exports=function(e,t,a,r,o){var i=n(2208);i.isArray;function s(n){var a=this._promise=new e(t);n instanceof e&&a._propagateFrom(n,3),a._setOnCancel(this),this._values=n,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return i.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(n,o){var s=a(this._values,this._promise);if(s instanceof e){var l=(s=s._target())._bitField;if(this._values=s,!(50397184&l))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,o);if(!(33554432&l))return 16777216&l?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=i.asArray(s)))0!==s.length?this._iterate(s):-5===o?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{}}}(o));else{var c=r("expecting an array or an iterable object but got "+i.classString(s)).reason();this._promise._rejectCallback(c,!1)}},s.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var r=this._promise,o=!1,i=null,s=0;s<n;++s){var l=a(t[s],r);i=l instanceof e?(l=l._target())._bitField:null,o?null!==i&&l.suppressUnhandledRejections():null!==i?50397184&i?o=33554432&i?this._promiseFulfilled(l._value(),s):16777216&i?this._promiseRejected(l._reason(),s):this._promiseCancelled(s):(l._proxy(this,s),this._values[s]=l):o=this._promiseFulfilled(l,s)}o||r._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(e){this._values=null,this._promise._fulfill(e)},s.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(e){this._values=null,this._promise._rejectCallback(e,!1)},s.prototype._promiseFulfilled=function(e,t){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;n<t.length;++n)t[n]instanceof e&&t[n].cancel()}},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(e){return e},s}},3437(e,t,n){"use strict";e.exports=function(e,t){var a={},r=n(2208),o=n(1231),i=r.withAppended,s=r.maybeWrapAsError,l=r.canEvaluate,c=n(403).TypeError,d={__isPromisified__:!0},m=new RegExp("^(?:"+["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"].join("|")+")$"),p=function(e){return r.isIdentifier(e)&&"_"!==e.charAt(0)&&"constructor"!==e};function u(e){return!m.test(e)}function g(e){try{return!0===e.__isPromisified__}catch(e){return!1}}function h(e,t,n){var a=r.getDataPropertyOrDefault(e,t+n,d);return!!a&&g(a)}function b(e,t,n,a){for(var o=r.inheritedDataKeys(e),i=[],s=0;s<o.length;++s){var l=o[s],d=e[l],m=a===p||p(l);"function"!=typeof d||g(d)||h(e,l,t)||!a(l,d,e,m)||i.push(l,d)}return function(e,t,n){for(var a=0;a<e.length;a+=2){var r=e[a];if(n.test(r))for(var o=r.replace(n,""),i=0;i<e.length;i+=2)if(e[i]===o)throw new c("Cannot promisify an API that has normal methods with '%s'-suffix\n\n    See http://goo.gl/MqrFmX\n".replace("%s",t))}}(i,t,n),i}var f;f=function(n,l,c,d,m,p){var u=Math.max(0,function(e){return"number"==typeof e.length?Math.max(Math.min(e.length,1024),0):0}(d)-1),g=function(e){for(var t=[e],n=Math.max(0,e-1-3),a=e-1;a>=n;--a)t.push(a);for(a=e+1;a<=3;++a)t.push(a);return t}(u),h="string"==typeof n||l===a;function b(e){var t,n=(t=e,r.filledRange(t,"_arg","")).join(", "),a=e>0?", ":"";return(h?"ret = callback.call(this, {{args}}, nodeback); break;\n":void 0===l?"ret = callback({{args}}, nodeback); break;\n":"ret = callback.call(receiver, {{args}}, nodeback); break;\n").replace("{{args}}",n).replace(", ",a)}var f="string"==typeof n?"this != null ? this['"+n+"'] : fn":"fn",v="'use strict';                                                \n        var ret = function (Parameters) {                                    \n            'use strict';                                                    \n            var len = arguments.length;                                      \n            var promise = new Promise(INTERNAL);                             \n            promise._captureStackTrace();                                    \n            var nodeback = nodebackForPromise(promise, "+p+");   \n            var ret;                                                         \n            var callback = tryCatch([GetFunctionCode]);                      \n            switch(len) {                                                    \n                [CodeForSwitchCase]                                          \n            }                                                                \n            if (ret === errorObj) {                                          \n                promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n            }                                                                \n            if (!promise._isFateSealed()) promise._setAsyncGuaranteed();     \n            return promise;                                                  \n        };                                                                   \n        notEnumerableProp(ret, '__isPromisified__', true);                   \n        return ret;                                                          \n    ".replace("[CodeForSwitchCase]",function(){for(var e="",t=0;t<g.length;++t)e+="case "+g[t]+":"+b(g[t]);return e+="                                                             \n        default:                                                             \n            var args = new Array(len + 1);                                   \n            var i = 0;                                                       \n            for (var i = 0; i < len; ++i) {                                  \n               args[i] = arguments[i];                                       \n            }                                                                \n            args[i] = nodeback;                                              \n            [CodeForCall]                                                    \n            break;                                                           \n        ".replace("[CodeForCall]",h?"ret = callback.apply(this, args);\n":"ret = callback.apply(receiver, args);\n")}()).replace("[GetFunctionCode]",f);return v=v.replace("Parameters",function(e){return r.filledRange(Math.max(e,3),"_arg","")}(u)),new Function("Promise","fn","receiver","withAppended","maybeWrapAsError","nodebackForPromise","tryCatch","errorObj","notEnumerableProp","INTERNAL",v)(e,d,l,i,s,o,r.tryCatch,r.errorObj,r.notEnumerableProp,t)};var v=l?f:function(n,l,c,d,m,p){var u=function(){return this}(),g=n;function h(){var r=l;l===a&&(r=this);var c=new e(t);c._captureStackTrace();var d="string"==typeof g&&this!==u?this[g]:n,m=o(c,p);try{d.apply(r,i(arguments,m))}catch(e){c._rejectCallback(s(e),!0,!0)}return c._isFateSealed()||c._setAsyncGuaranteed(),c}return"string"==typeof g&&(n=d),r.notEnumerableProp(h,"__isPromisified__",!0),h};function y(e,t,n,o,i){for(var s=new RegExp(t.replace(/([$])/,"\\$")+"$"),l=b(e,t,s,n),c=0,d=l.length;c<d;c+=2){var m=l[c],p=l[c+1],u=m+t;if(o===v)e[u]=v(m,a,m,p,t,i);else{var g=o(p,function(){return v(m,a,m,p,t,i)});r.notEnumerableProp(g,"__isPromisified__",!0),e[u]=g}}return r.toFastProperties(e),e}e.promisify=function(e,t){if("function"!=typeof e)throw new c("expecting a function but got "+r.classString(e));if(g(e))return e;var n=function(e,t,n){return v(e,t,void 0,e,null,n)}(e,void 0===(t=Object(t)).context?a:t.context,!!t.multiArgs);return r.copyDescriptors(e,n,u),n},e.promisifyAll=function(e,t){if("function"!=typeof e&&"object"!=typeof e)throw new c("the target of promisifyAll must be an object or a function\n\n    See http://goo.gl/MqrFmX\n");var n=!!(t=Object(t)).multiArgs,a=t.suffix;"string"!=typeof a&&(a="Async");var o=t.filter;"function"!=typeof o&&(o=p);var i=t.promisifier;if("function"!=typeof i&&(i=v),!r.isIdentifier(a))throw new RangeError("suffix must be a valid identifier\n\n    See http://goo.gl/MqrFmX\n");for(var s=r.inheritedDataKeys(e),l=0;l<s.length;++l){var d=e[s[l]];"constructor"!==s[l]&&r.isClass(d)&&(y(d.prototype,a,o,i,n),y(d,a,o,i,n))}return y(e,a,o,i,n)}}},4416(e,t,n){"use strict";e.exports=function(e,t,a,r){var o,i=n(2208),s=i.isObject,l=n(7585);"function"==typeof Map&&(o=Map);var c=function(){var e=0,t=0;function n(n,a){this[e]=n,this[e+t]=a,e++}return function(a){t=a.size,e=0;var r=new Array(2*a.size);return a.forEach(n,r),r}}();function d(e){var t,n=!1;if(void 0!==o&&e instanceof o)t=c(e),n=!0;else{var a=l.keys(e),r=a.length;t=new Array(2*r);for(var i=0;i<r;++i){var s=a[i];t[i]=e[s],t[i+r]=s}}this.constructor$(t),this._isMap=n,this._init$(void 0,-3)}function m(t){var n,o=a(t);return s(o)?(n=o instanceof e?o._then(e.props,void 0,void 0,void 0,void 0):new d(o).promise(),o instanceof e&&n._propagateFrom(o,2),n):r("cannot await properties of a non-object\n\n    See http://goo.gl/MqrFmX\n")}i.inherits(d,t),d.prototype._init=function(){},d.prototype._promiseFulfilled=function(e,t){if(this._values[t]=e,++this._totalResolved>=this._length){var n;if(this._isMap)n=function(e){for(var t=new o,n=e.length/2|0,a=0;a<n;++a){var r=e[n+a],i=e[a];t.set(r,i)}return t}(this._values);else{n={};for(var a=this.length(),r=0,i=this.length();r<i;++r)n[this._values[r+a]]=this._values[r]}return this._resolve(n),!0}return!1},d.prototype.shouldCopyValues=function(){return!1},d.prototype.getActualLength=function(e){return e>>1},e.prototype.props=function(){return m(this)},e.props=function(e){return m(e)}}},9937(e){"use strict";function t(e){this._capacity=e,this._length=0,this._front=0}t.prototype._willBeOverCapacity=function(e){return this._capacity<e},t.prototype._pushOne=function(e){var t=this.length();this._checkCapacity(t+1),this[this._front+t&this._capacity-1]=e,this._length=t+1},t.prototype.push=function(e,t,n){var a=this.length()+3;if(this._willBeOverCapacity(a))return this._pushOne(e),this._pushOne(t),void this._pushOne(n);var r=this._front+a-3;this._checkCapacity(a);var o=this._capacity-1;this[r+0&o]=e,this[r+1&o]=t,this[r+2&o]=n,this._length=a},t.prototype.shift=function(){var e=this._front,t=this[e];return this[e]=void 0,this._front=e+1&this._capacity-1,this._length--,t},t.prototype.length=function(){return this._length},t.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(this._capacity<<1)},t.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e,function(e,t,n,a,r){for(var o=0;o<r;++o)n[o+a]=e[o+t],e[o+t]=void 0}(this,0,this,t,this._front+this._length&t-1)},e.exports=t},3381(e,t,n){"use strict";e.exports=function(e,t,a,r){var o=n(2208);function i(n,s){var l,c=a(n);if(c instanceof e)return(l=c).then(function(e){return i(e,l)});if(null===(n=o.asArray(n)))return r("expecting an array or an iterable object but got "+o.classString(n));var d=new e(t);void 0!==s&&d._propagateFrom(s,3);for(var m=d._fulfill,p=d._reject,u=0,g=n.length;u<g;++u){var h=n[u];(void 0!==h||u in n)&&e.cast(h)._then(m,p,void 0,d,null)}return d}e.race=function(e){return i(e,void 0)},e.prototype.race=function(){return i(this,void 0)}}},8722(e,t,n){"use strict";e.exports=function(e,t,a,r,o,i){var s=e._getDomain,l=n(2208),c=l.tryCatch;function d(t,n,a,r){this.constructor$(t);var i=s();this._fn=null===i?n:l.domainBind(i,n),void 0!==a&&(a=e.resolve(a))._attachCancellationCallback(this),this._initialValue=a,this._currentCancellable=null,this._eachValues=r===o?Array(this._length):0===r?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function m(e,t){this.isFulfilled()?t._resolve(e):t._reject(e)}function p(e,t,n,r){return"function"!=typeof t?a("expecting a function but got "+l.classString(t)):new d(e,t,n,r).promise()}function u(t){this.accum=t,this.array._gotAccum(t);var n=r(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(g,void 0,void 0,this,void 0)):g.call(this,n)}function g(t){var n,a=this.array,r=a._promise,o=c(a._fn);r._pushContext(),(n=void 0!==a._eachValues?o.call(r._boundValue(),t,this.index,this.length):o.call(r._boundValue(),this.accum,t,this.index,this.length))instanceof e&&(a._currentCancellable=n);var s=r._popContext();return i.checkForgottenReturns(n,s,void 0!==a._eachValues?"Promise.each":"Promise.reduce",r),n}l.inherits(d,t),d.prototype._gotAccum=function(e){void 0!==this._eachValues&&null!==this._eachValues&&e!==o&&this._eachValues.push(e)},d.prototype._eachComplete=function(e){return null!==this._eachValues&&this._eachValues.push(e),this._eachValues},d.prototype._init=function(){},d.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},d.prototype.shouldCopyValues=function(){return!1},d.prototype._resolve=function(e){this._promise._resolveCallback(e),this._values=null},d.prototype._resultCancelled=function(t){if(t===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel())},d.prototype._iterate=function(t){var n,a;this._values=t;var r=t.length;if(void 0!==this._initialValue?(n=this._initialValue,a=0):(n=e.resolve(t[0]),a=1),this._currentCancellable=n,!n.isRejected())for(;a<r;++a){var o={accum:null,value:t[a],index:a,length:r,array:this};n=n._then(u,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(m,m,void 0,n,this)},e.prototype.reduce=function(e,t){return p(this,e,t,null)},e.reduce=function(e,t,n,a){return p(e,t,n,a)}}},1065(e,t,n){"use strict";var a,r=n(2208),o=r.getNativePromise();if(r.isNode&&"undefined"==typeof MutationObserver){var i=n.g.setImmediate,s=process.nextTick;a=r.isRecentNode?function(e){i.call(n.g,e)}:function(e){s.call(process,e)}}else if("function"==typeof o&&"function"==typeof o.resolve){var l=o.resolve();a=function(e){l.then(e)}}else a="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?"undefined"!=typeof setImmediate?function(e){setImmediate(e)}:"undefined"!=typeof setTimeout?function(e){setTimeout(e,0)}:function(){throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n")}:function(){var e=document.createElement("div"),t={attributes:!0},n=!1,a=document.createElement("div");new MutationObserver(function(){e.classList.toggle("foo"),n=!1}).observe(a,t);return function(r){var o=new MutationObserver(function(){o.disconnect(),r()});o.observe(e,t),n||(n=!0,a.classList.toggle("foo"))}}();e.exports=a},9047(e,t,n){"use strict";e.exports=function(e,t,a){var r=e.PromiseInspection;function o(e){this.constructor$(e)}n(2208).inherits(o,t),o.prototype._promiseResolved=function(e,t){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(e,t){var n=new r;return n._bitField=33554432,n._settledValueField=e,this._promiseResolved(t,n)},o.prototype._promiseRejected=function(e,t){var n=new r;return n._bitField=16777216,n._settledValueField=e,this._promiseResolved(t,n)},e.settle=function(e){return a.deprecated(".settle()",".reflect()"),new o(e).promise()},e.prototype.settle=function(){return e.settle(this)}}},7784(e,t,n){"use strict";e.exports=function(e,t,a){var r=n(2208),o=n(403).RangeError,i=n(403).AggregateError,s=r.isArray,l={};function c(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function d(e,t){if((0|t)!==t||t<0)return a("expecting a positive integer\n\n    See http://goo.gl/MqrFmX\n");var n=new c(e),r=n.promise();return n.setHowMany(t),n.init(),r}r.inherits(c,t),c.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=s(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},c.prototype.init=function(){this._initialized=!0,this._init()},c.prototype.setUnwrap=function(){this._unwrap=!0},c.prototype.howMany=function(){return this._howMany},c.prototype.setHowMany=function(e){this._howMany=e},c.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},c.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},c.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},c.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new i,t=this.length();t<this._values.length;++t)this._values[t]!==l&&e.push(this._values[t]);return e.length>0?this._reject(e):this._cancel(),!0}return!1},c.prototype._fulfilled=function(){return this._totalResolved},c.prototype._rejected=function(){return this._values.length-this.length()},c.prototype._addRejected=function(e){this._values.push(e)},c.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},c.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},c.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new o(t)},c.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(e,t){return d(e,t)},e.prototype.some=function(e){return d(this,e)},e._SomePromiseArray=c}},4900(e){"use strict";e.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var n=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n    See http://goo.gl/MqrFmX\n");return this._settledValue()},a=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n    See http://goo.gl/MqrFmX\n");return this._settledValue()},r=t.prototype.isFulfilled=function(){return!!(33554432&this._bitField)},o=t.prototype.isRejected=function(){return!!(16777216&this._bitField)},i=t.prototype.isPending=function(){return!(50397184&this._bitField)},s=t.prototype.isResolved=function(){return!!(50331648&this._bitField)};t.prototype.isCancelled=function(){return!!(8454144&this._bitField)},e.prototype.__isCancelled=function(){return!(65536&~this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return!!(8454144&this._target()._bitField)},e.prototype.isPending=function(){return i.call(this._target())},e.prototype.isRejected=function(){return o.call(this._target())},e.prototype.isFulfilled=function(){return r.call(this._target())},e.prototype.isResolved=function(){return s.call(this._target())},e.prototype.value=function(){return n.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),a.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},8974(e,t,n){"use strict";e.exports=function(e,t){var a=n(2208),r=a.errorObj,o=a.isObject;var i={}.hasOwnProperty;return function(n,s){if(o(n)){if(n instanceof e)return n;var l=function(e){try{return function(e){return e.then}(e)}catch(e){return r.e=e,r}}(n);if(l===r){s&&s._pushContext();var c=e.reject(l.e);return s&&s._popContext(),c}if("function"==typeof l){if(function(e){try{return i.call(e,"_promise0")}catch(e){return!1}}(n)){c=new e(t);return n._then(c._fulfill,c._reject,void 0,c,null),c}return function(n,o,i){var s=new e(t),l=s;i&&i._pushContext();s._captureStackTrace(),i&&i._popContext();var c=!0,d=a.tryCatch(o).call(n,m,p);c=!1,s&&d===r&&(s._rejectCallback(d.e,!0,!0),s=null);function m(e){s&&(s._resolveCallback(e),s=null)}function p(e){s&&(s._rejectCallback(e,c,!0),s=null)}return l}(n,l,s)}}return n}}},6406(e,t,n){"use strict";e.exports=function(e,t,a){var r=n(2208),o=e.TimeoutError;function i(e){this.handle=e}i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(e){return l(+this).thenReturn(e)},l=e.delay=function(n,r){var o,l;return void 0!==r?(o=e.resolve(r)._then(s,null,null,n,void 0),a.cancellation()&&r instanceof e&&o._setOnCancel(r)):(o=new e(t),l=setTimeout(function(){o._fulfill()},+n),a.cancellation()&&o._setOnCancel(new i(l)),o._captureStackTrace()),o._setAsyncGuaranteed(),o};e.prototype.delay=function(e){return l(e,this)};function c(e){return clearTimeout(this.handle),e}function d(e){throw clearTimeout(this.handle),e}e.prototype.timeout=function(e,t){var n,s;e=+e;var l=new i(setTimeout(function(){n.isPending()&&function(e,t,n){var a;a="string"!=typeof t?t instanceof Error?t:new o("operation timed out"):new o(t),r.markAsOriginatingFromRejection(a),e._attachExtraTrace(a),e._reject(a),null!=n&&n.cancel()}(n,t,s)},e));return a.cancellation()?(s=this.then(),(n=s._then(c,d,void 0,l,void 0))._setOnCancel(l)):n=this._then(c,d,void 0,l,void 0),n}}},6178(e,t,n){"use strict";e.exports=function(e,t,a,r,o,i){var s=n(2208),l=n(403).TypeError,c=n(2208).inherits,d=s.errorObj,m=s.tryCatch,p={};function u(e){setTimeout(function(){throw e},0)}function g(t,n){var r=0,i=t.length,s=new e(o);return function o(){if(r>=i)return s._fulfill();var l=function(e){var t=a(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}(t[r++]);if(l instanceof e&&l._isDisposable()){try{l=a(l._getDisposer().tryDispose(n),t.promise)}catch(e){return u(e)}if(l instanceof e)return l._then(o,u,null,null,null)}o()}(),s}function h(e,t,n){this._data=e,this._promise=t,this._context=n}function b(e,t,n){this.constructor$(e,t,n)}function f(e){return h.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function v(e){this.length=e,this.promise=null,this[e-1]=null}h.prototype.data=function(){return this._data},h.prototype.promise=function(){return this._promise},h.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():p},h.prototype.tryDispose=function(e){var t=this.resource(),n=this._context;void 0!==n&&n._pushContext();var a=t!==p?this.doDispose(t,e):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,a},h.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},c(b,h),b.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},v.prototype._resultCancelled=function(){for(var t=this.length,n=0;n<t;++n){var a=this[n];a instanceof e&&a.cancel()}},e.using=function(){var n=arguments.length;if(n<2)return t("you must pass at least 2 arguments to Promise.using");var r,o=arguments[n-1];if("function"!=typeof o)return t("expecting a function but got "+s.classString(o));var l=!0;2===n&&Array.isArray(arguments[0])?(n=(r=arguments[0]).length,l=!1):(r=arguments,n--);for(var c=new v(n),p=0;p<n;++p){var u=r[p];if(h.isDisposer(u)){var b=u;(u=u.promise())._setDisposable(b)}else{var y=a(u);y instanceof e&&(u=y._then(f,null,null,{resources:c,index:p},void 0))}c[p]=u}var x=new Array(c.length);for(p=0;p<x.length;++p)x[p]=e.resolve(c[p]).reflect();var w=e.all(x).then(function(e){for(var t=0;t<e.length;++t){var n=e[t];if(n.isRejected())return d.e=n.error(),d;if(!n.isFulfilled())return void w.cancel();e[t]=n.value()}k._pushContext(),o=m(o);var a=l?o.apply(void 0,e):o(e),r=k._popContext();return i.checkForgottenReturns(a,r,"Promise.using",k),a}),k=w.lastly(function(){var t=new e.PromiseInspection(w);return g(c,t)});return c.promise=k,k._setOnCancel(c),k},e.prototype._setDisposable=function(e){this._bitField=131072|this._bitField,this._disposer=e},e.prototype._isDisposable=function(){return(131072&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(e){if("function"==typeof e)return new b(e,this,r());throw new l}}},2208(e,t,n){"use strict";var a,r=n(7585),o="undefined"==typeof navigator,i={e:{}},s="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:void 0!==this?this:null;function l(){try{var e=a;return a=null,e.apply(this,arguments)}catch(e){return i.e=e,i}}function c(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function d(e,t,n){if(c(e))return e;var a={value:n,configurable:!0,enumerable:!1,writable:!0};return r.defineProperty(e,t,a),e}var m=function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(t){for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1};if(r.isES5){var n=Object.getOwnPropertyNames;return function(e){for(var a=[],o=Object.create(null);null!=e&&!t(e);){var i;try{i=n(e)}catch(e){return a}for(var s=0;s<i.length;++s){var l=i[s];if(!o[l]){o[l]=!0;var c=Object.getOwnPropertyDescriptor(e,l);null!=c&&null==c.get&&null==c.set&&a.push(l)}}e=r.getPrototypeOf(e)}return a}}var a={}.hasOwnProperty;return function(n){if(t(n))return[];var r=[];e:for(var o in n)if(a.call(n,o))r.push(o);else{for(var i=0;i<e.length;++i)if(a.call(e[i],o))continue e;r.push(o)}return r}}(),p=/this\s*\.\s*\S+\s*=/;var u=/^[a-z$_][a-z$_0-9]*$/i;function g(e){try{return e+""}catch(e){return"[no string representation]"}}function h(e){return null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name}function b(e){return h(e)&&r.propertyIsWritable(e,"stack")}var f="stack"in new Error?function(e){return b(e)?e:new Error(g(e))}:function(e){if(b(e))return e;try{throw new Error(g(e))}catch(e){return e}};function v(e){return{}.toString.call(e)}var y=function(e){return r.isArray(e)?e:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var x="function"==typeof Array.from?function(e){return Array.from(e)}:function(e){for(var t,n=[],a=e[Symbol.iterator]();!(t=a.next()).done;)n.push(t.value);return n};y=function(e){return r.isArray(e)?e:null!=e&&"function"==typeof e[Symbol.iterator]?x(e):null}}var w="undefined"!=typeof process&&"[object process]"===v(process).toLowerCase(),k="undefined"!=typeof process&&void 0!==process.env;var E,S={isClass:function(e){try{if("function"==typeof e){var t=r.names(e.prototype),n=r.isES5&&t.length>1,a=t.length>0&&!(1===t.length&&"constructor"===t[0]),o=p.test(e+"")&&r.names(e).length>0;if(n||a||o)return!0}return!1}catch(e){return!1}},isIdentifier:function(e){return u.test(e)},inheritedDataKeys:m,getDataPropertyOrDefault:function(e,t,n){if(!r.isES5)return{}.hasOwnProperty.call(e,t)?e[t]:void 0;var a=Object.getOwnPropertyDescriptor(e,t);return null!=a?null==a.get&&null==a.set?a.value:n:void 0},thrower:function(e){throw e},isArray:r.isArray,asArray:y,notEnumerableProp:d,isPrimitive:c,isObject:function(e){return"function"==typeof e||"object"==typeof e&&null!==e},isError:h,canEvaluate:o,errorObj:i,tryCatch:function(e){return a=e,l},inherits:function(e,t){var n={}.hasOwnProperty;function a(){for(var a in this.constructor=e,this.constructor$=t,t.prototype)n.call(t.prototype,a)&&"$"!==a.charAt(a.length-1)&&(this[a+"$"]=t.prototype[a])}return a.prototype=t.prototype,e.prototype=new a,e.prototype},withAppended:function(e,t){var n,a=e.length,r=new Array(a+1);for(n=0;n<a;++n)r[n]=e[n];return r[n]=t,r},maybeWrapAsError:function(e){return c(e)?new Error(g(e)):e},toFastProperties:function(e){function t(){}t.prototype=e;for(var n=8;n--;)new t;return e},filledRange:function(e,t,n){for(var a=new Array(e),r=0;r<e;++r)a[r]=t+r+n;return a},toString:g,canAttachTrace:b,ensureErrorObject:f,originatesFromRejection:function(e){return null!=e&&(e instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===e.isOperational)},markAsOriginatingFromRejection:function(e){try{d(e,"isOperational",!0)}catch(e){}},classString:v,copyDescriptors:function(e,t,n){for(var a=r.names(e),o=0;o<a.length;++o){var i=a[o];if(n(i))try{r.defineProperty(t,i,r.getDescriptor(e,i))}catch(e){}}},hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:w,hasEnvVariables:k,env:function(e){return k?process.env[e]:void 0},global:s,getNativePromise:function(){if("function"==typeof Promise)try{var e=new Promise(function(){});if("[object Promise]"==={}.toString.call(e))return Promise}catch(e){}},domainBind:function(e,t){return e.bind(t)}};S.isRecentNode=S.isNode&&(0===(E=process.versions.node.split(".").map(Number))[0]&&E[1]>10||E[0]>0),S.isNode&&S.toFastProperties(process);try{throw new Error}catch(e){S.lastLineError=e}e.exports=S},955(e,t,n){var a;e.exports=(a=n(9021),n(754),n(4636),n(9506),n(7165),function(){var e=a,t=e.lib.BlockCipher,n=e.algo,r=[],o=[],i=[],s=[],l=[],c=[],d=[],m=[],p=[],u=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,a=0;for(t=0;t<256;t++){var g=a^a<<1^a<<2^a<<3^a<<4;g=g>>>8^255&g^99,r[n]=g,o[g]=n;var h=e[n],b=e[h],f=e[b],v=257*e[g]^16843008*g;i[n]=v<<24|v>>>8,s[n]=v<<16|v>>>16,l[n]=v<<8|v>>>24,c[n]=v,v=16843009*f^65537*b^257*h^16843008*n,d[g]=v<<24|v>>>8,m[g]=v<<16|v>>>16,p[g]=v<<8|v>>>24,u[g]=v,n?(n=h^e[e[e[f^h]]],a^=e[e[a]]):n=a=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],h=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,a=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],i=0;i<a;i++)i<n?o[i]=t[i]:(c=o[i-1],i%n?n>6&&i%n==4&&(c=r[c>>>24]<<24|r[c>>>16&255]<<16|r[c>>>8&255]<<8|r[255&c]):(c=r[(c=c<<8|c>>>24)>>>24]<<24|r[c>>>16&255]<<16|r[c>>>8&255]<<8|r[255&c],c^=g[i/n|0]<<24),o[i]=o[i-n]^c);for(var s=this._invKeySchedule=[],l=0;l<a;l++){if(i=a-l,l%4)var c=o[i];else c=o[i-4];s[l]=l<4||i<=4?c:d[r[c>>>24]]^m[r[c>>>16&255]]^p[r[c>>>8&255]]^u[r[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,i,s,l,c,r)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,d,m,p,u,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,a,r,o,i,s){for(var l=this._nRounds,c=e[t]^n[0],d=e[t+1]^n[1],m=e[t+2]^n[2],p=e[t+3]^n[3],u=4,g=1;g<l;g++){var h=a[c>>>24]^r[d>>>16&255]^o[m>>>8&255]^i[255&p]^n[u++],b=a[d>>>24]^r[m>>>16&255]^o[p>>>8&255]^i[255&c]^n[u++],f=a[m>>>24]^r[p>>>16&255]^o[c>>>8&255]^i[255&d]^n[u++],v=a[p>>>24]^r[c>>>16&255]^o[d>>>8&255]^i[255&m]^n[u++];c=h,d=b,m=f,p=v}h=(s[c>>>24]<<24|s[d>>>16&255]<<16|s[m>>>8&255]<<8|s[255&p])^n[u++],b=(s[d>>>24]<<24|s[m>>>16&255]<<16|s[p>>>8&255]<<8|s[255&c])^n[u++],f=(s[m>>>24]<<24|s[p>>>16&255]<<16|s[c>>>8&255]<<8|s[255&d])^n[u++],v=(s[p>>>24]<<24|s[c>>>16&255]<<16|s[d>>>8&255]<<8|s[255&m])^n[u++],e[t]=h,e[t+1]=b,e[t+2]=f,e[t+3]=v},keySize:8});e.AES=t._createHelper(h)}(),a.AES)},3128(e,t,n){var a;e.exports=(a=n(9021),n(754),n(4636),n(9506),n(7165),function(){var e=a,t=e.lib.BlockCipher,n=e.algo;const r=16,o=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],i=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var s={pbox:[],sbox:[]};function l(e,t){let n=t>>24&255,a=t>>16&255,r=t>>8&255,o=255&t,i=e.sbox[0][n]+e.sbox[1][a];return i^=e.sbox[2][r],i+=e.sbox[3][o],i}function c(e,t,n){let a,o=t,i=n;for(let t=0;t<r;++t)o^=e.pbox[t],i=l(e,o)^i,a=o,o=i,i=a;return a=o,o=i,i=a,i^=e.pbox[r],o^=e.pbox[r+1],{left:o,right:i}}function d(e,t,n){let a,o=t,i=n;for(let t=r+1;t>1;--t)o^=e.pbox[t],i=l(e,o)^i,a=o,o=i,i=a;return a=o,o=i,i=a,i^=e.pbox[1],o^=e.pbox[0],{left:o,right:i}}function m(e,t,n){for(let t=0;t<4;t++){e.sbox[t]=[];for(let n=0;n<256;n++)e.sbox[t][n]=i[t][n]}let a=0;for(let i=0;i<r+2;i++)e.pbox[i]=o[i]^t[a],a++,a>=n&&(a=0);let s=0,l=0,d=0;for(let t=0;t<r+2;t+=2)d=c(e,s,l),s=d.left,l=d.right,e.pbox[t]=s,e.pbox[t+1]=l;for(let t=0;t<4;t++)for(let n=0;n<256;n+=2)d=c(e,s,l),s=d.left,l=d.right,e.sbox[t][n]=s,e.sbox[t][n+1]=l;return!0}var p=n.Blowfish=t.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4;m(s,t,n)}},encryptBlock:function(e,t){var n=c(s,e[t],e[t+1]);e[t]=n.left,e[t+1]=n.right},decryptBlock:function(e,t){var n=d(s,e[t],e[t+1]);e[t]=n.left,e[t+1]=n.right},blockSize:2,keySize:4,ivSize:2});e.Blowfish=t._createHelper(p)}(),a.Blowfish)},7165(e,t,n){var a;e.exports=(a=n(9021),n(9506),void(a.lib.Cipher||function(e){var t=a,n=t.lib,r=n.Base,o=n.WordArray,i=n.BufferedBlockAlgorithm,s=t.enc,l=(s.Utf8,s.Base64),c=t.algo.EvpKDF,d=n.Cipher=i.extend({cfg:r.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?y:f}return function(t){return{encrypt:function(n,a,r){return e(a).encrypt(t,n,a,r)},decrypt:function(n,a,r){return e(a).decrypt(t,n,a,r)}}}}()}),m=(n.StreamCipher=d.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),t.mode={}),p=n.BlockCipherMode=r.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),u=m.CBC=function(){var t=p.extend();function n(t,n,a){var r,o=this._iv;o?(r=o,this._iv=e):r=this._prevBlock;for(var i=0;i<a;i++)t[n+i]^=r[i]}return t.Encryptor=t.extend({processBlock:function(e,t){var a=this._cipher,r=a.blockSize;n.call(this,e,t,r),a.encryptBlock(e,t),this._prevBlock=e.slice(t,t+r)}}),t.Decryptor=t.extend({processBlock:function(e,t){var a=this._cipher,r=a.blockSize,o=e.slice(t,t+r);a.decryptBlock(e,t),n.call(this,e,t,r),this._prevBlock=o}}),t}(),g=(t.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,a=n-e.sigBytes%n,r=a<<24|a<<16|a<<8|a,i=[],s=0;s<a;s+=4)i.push(r);var l=o.create(i,a);e.concat(l)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},h=(n.BlockCipher=d.extend({cfg:d.cfg.extend({mode:u,padding:g}),reset:function(){var e;d.reset.call(this);var t=this.cfg,n=t.iv,a=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=a.createEncryptor:(e=a.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(a,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),n.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),b=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?o.create([1398893684,1701076831]).concat(n).concat(t):t).toString(l)},parse:function(e){var t,n=l.parse(e),a=n.words;return 1398893684==a[0]&&1701076831==a[1]&&(t=o.create(a.slice(2,4)),a.splice(0,4),n.sigBytes-=16),h.create({ciphertext:n,salt:t})}},f=n.SerializableCipher=r.extend({cfg:r.extend({format:b}),encrypt:function(e,t,n,a){a=this.cfg.extend(a);var r=e.createEncryptor(n,a),o=r.finalize(t),i=r.cfg;return h.create({ciphertext:o,key:n,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:a.format})},decrypt:function(e,t,n,a){return a=this.cfg.extend(a),t=this._parse(t,a.format),e.createDecryptor(n,a).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,n,a,r){if(a||(a=o.random(8)),r)i=c.create({keySize:t+n,hasher:r}).compute(e,a);else var i=c.create({keySize:t+n}).compute(e,a);var s=o.create(i.words.slice(t),4*n);return i.sigBytes=4*t,h.create({key:i,iv:s,salt:a})}},y=n.PasswordBasedCipher=f.extend({cfg:f.cfg.extend({kdf:v}),encrypt:function(e,t,n,a){var r=(a=this.cfg.extend(a)).kdf.execute(n,e.keySize,e.ivSize,a.salt,a.hasher);a.iv=r.iv;var o=f.encrypt.call(this,e,t,r.key,a);return o.mixIn(r),o},decrypt:function(e,t,n,a){a=this.cfg.extend(a),t=this._parse(t,a.format);var r=a.kdf.execute(n,e.keySize,e.ivSize,t.salt,a.hasher);return a.iv=r.iv,f.decrypt.call(this,e,t,r.key,a)}})}()))},9021(e,t,n){var a;e.exports=(a=a||function(e,t){var a;if("undefined"!=typeof window&&window.crypto&&(a=window.crypto),"undefined"!=typeof self&&self.crypto&&(a=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(a=globalThis.crypto),!a&&"undefined"!=typeof window&&window.msCrypto&&(a=window.msCrypto),!a&&void 0!==n.g&&n.g.crypto&&(a=n.g.crypto),!a)try{a=n(477)}catch(e){}var r=function(){if(a){if("function"==typeof a.getRandomValues)try{return a.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof a.randomBytes)try{return a.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},s=i.lib={},l=s.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=s.WordArray=l.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||m).stringify(this)},concat:function(e){var t=this.words,n=e.words,a=this.sigBytes,r=e.sigBytes;if(this.clamp(),a%4)for(var o=0;o<r;o++){var i=n[o>>>2]>>>24-o%4*8&255;t[a+o>>>2]|=i<<24-(a+o)%4*8}else for(var s=0;s<r;s+=4)t[a+s>>>2]=n[s>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=l.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new c.init(t,e)}}),d=i.enc={},m=d.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,a=[],r=0;r<n;r++){var o=t[r>>>2]>>>24-r%4*8&255;a.push((o>>>4).toString(16)),a.push((15&o).toString(16))}return a.join("")},parse:function(e){for(var t=e.length,n=[],a=0;a<t;a+=2)n[a>>>3]|=parseInt(e.substr(a,2),16)<<24-a%8*4;return new c.init(n,t/2)}},p=d.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,a=[],r=0;r<n;r++){var o=t[r>>>2]>>>24-r%4*8&255;a.push(String.fromCharCode(o))}return a.join("")},parse:function(e){for(var t=e.length,n=[],a=0;a<t;a++)n[a>>>2]|=(255&e.charCodeAt(a))<<24-a%4*8;return new c.init(n,t)}},u=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},g=s.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=u.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,a=this._data,r=a.words,o=a.sigBytes,i=this.blockSize,s=o/(4*i),l=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*i,d=e.min(4*l,o);if(l){for(var m=0;m<l;m+=i)this._doProcessBlock(r,m);n=r.splice(0,l),a.sigBytes-=d}return new c.init(n,d)},clone:function(){var e=l.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),h=(s.Hasher=g.extend({cfg:l.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}}),i.algo={});return i}(Math),a)},754(e,t,n){var a;e.exports=(a=n(9021),function(){var e=a,t=e.lib.WordArray;function n(e,n,a){for(var r=[],o=0,i=0;i<n;i++)if(i%4){var s=a[e.charCodeAt(i-1)]<<i%4*2|a[e.charCodeAt(i)]>>>6-i%4*2;r[o>>>2]|=s<<24-o%4*8,o++}return t.create(r,o)}e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,a=this._map;e.clamp();for(var r=[],o=0;o<n;o+=3)for(var i=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<n;s++)r.push(a.charAt(i>>>6*(3-s)&63));var l=a.charAt(64);if(l)for(;r.length%4;)r.push(l);return r.join("")},parse:function(e){var t=e.length,a=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o<a.length;o++)r[a.charCodeAt(o)]=o}var i=a.charAt(64);if(i){var s=e.indexOf(i);-1!==s&&(t=s)}return n(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),a.enc.Base64)},4725(e,t,n){var a;e.exports=(a=n(9021),function(){var e=a,t=e.lib.WordArray;function n(e,n,a){for(var r=[],o=0,i=0;i<n;i++)if(i%4){var s=a[e.charCodeAt(i-1)]<<i%4*2|a[e.charCodeAt(i)]>>>6-i%4*2;r[o>>>2]|=s<<24-o%4*8,o++}return t.create(r,o)}e.enc.Base64url={stringify:function(e,t){void 0===t&&(t=!0);var n=e.words,a=e.sigBytes,r=t?this._safe_map:this._map;e.clamp();for(var o=[],i=0;i<a;i+=3)for(var s=(n[i>>>2]>>>24-i%4*8&255)<<16|(n[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|n[i+2>>>2]>>>24-(i+2)%4*8&255,l=0;l<4&&i+.75*l<a;l++)o.push(r.charAt(s>>>6*(3-l)&63));var c=r.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e,t){void 0===t&&(t=!0);var a=e.length,r=t?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<r.length;i++)o[r.charCodeAt(i)]=i}var s=r.charAt(64);if(s){var l=e.indexOf(s);-1!==l&&(a=l)}return n(e,a,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),a.enc.Base64url)},5503(e,t,n){var a;e.exports=(a=n(9021),function(){var e=a,t=e.lib.WordArray,n=e.enc;function r(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,a=[],r=0;r<n;r+=2){var o=t[r>>>2]>>>16-r%4*8&65535;a.push(String.fromCharCode(o))}return a.join("")},parse:function(e){for(var n=e.length,a=[],r=0;r<n;r++)a[r>>>1]|=e.charCodeAt(r)<<16-r%2*16;return t.create(a,2*n)}},n.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,a=[],o=0;o<n;o+=2){var i=r(t[o>>>2]>>>16-o%4*8&65535);a.push(String.fromCharCode(i))}return a.join("")},parse:function(e){for(var n=e.length,a=[],o=0;o<n;o++)a[o>>>1]|=r(e.charCodeAt(o)<<16-o%2*16);return t.create(a,2*n)}}}(),a.enc.Utf16)},9506(e,t,n){var a,r,o,i,s,l,c,d;e.exports=(d=n(9021),n(5471),n(1025),r=(a=d).lib,o=r.Base,i=r.WordArray,s=a.algo,l=s.MD5,c=s.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,a=this.cfg,r=a.hasher.create(),o=i.create(),s=o.words,l=a.keySize,c=a.iterations;s.length<l;){n&&r.update(n),n=r.update(e).finalize(t),r.reset();for(var d=1;d<c;d++)n=r.finalize(n),r.reset();o.concat(n)}return o.sigBytes=4*l,o}}),a.EvpKDF=function(e,t,n){return c.create(n).compute(e,t)},d.EvpKDF)},2406(e,t,n){var a,r,o,i;e.exports=(i=n(9021),n(7165),r=(a=i).lib.CipherParams,o=a.enc.Hex,a.format.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return r.create({ciphertext:t})}},i.format.Hex)},1025(e,t,n){var a,r,o,i;e.exports=(a=n(9021),o=(r=a).lib.Base,i=r.enc.Utf8,void(r.algo.HMAC=o.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var n=e.blockSize,a=4*n;t.sigBytes>a&&(t=e.finalize(t)),t.clamp();for(var r=this._oKey=t.clone(),o=this._iKey=t.clone(),s=r.words,l=o.words,c=0;c<n;c++)s[c]^=1549556828,l[c]^=909522486;r.sigBytes=o.sigBytes=a,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))},1396(e,t,n){var a;e.exports=(a=n(9021),n(3240),n(4059),n(5503),n(754),n(4725),n(4636),n(5471),n(3009),n(6308),n(1380),n(9557),n(5953),n(8056),n(1025),n(19),n(9506),n(7165),n(2169),n(6939),n(6372),n(3797),n(8454),n(2073),n(7286),n(482),n(2155),n(8124),n(2406),n(955),n(7628),n(7193),n(6298),n(2696),n(3128),a)},4059(e,t,n){var a;e.exports=(a=n(9021),function(){if("function"==typeof ArrayBuffer){var e=a.lib.WordArray,t=e.init,n=e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var n=e.byteLength,a=[],r=0;r<n;r++)a[r>>>2]|=e[r]<<24-r%4*8;t.call(this,a,n)}else t.apply(this,arguments)};n.prototype=e}}(),a.lib.WordArray)},4636(e,t,n){var a;e.exports=(a=n(9021),function(e){var t=a,n=t.lib,r=n.WordArray,o=n.Hasher,i=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=i.MD5=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var a=t+n,r=e[a];e[a]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var o=this._hash.words,i=e[t+0],l=e[t+1],u=e[t+2],g=e[t+3],h=e[t+4],b=e[t+5],f=e[t+6],v=e[t+7],y=e[t+8],x=e[t+9],w=e[t+10],k=e[t+11],E=e[t+12],S=e[t+13],C=e[t+14],T=e[t+15],A=o[0],D=o[1],_=o[2],N=o[3];A=c(A,D,_,N,i,7,s[0]),N=c(N,A,D,_,l,12,s[1]),_=c(_,N,A,D,u,17,s[2]),D=c(D,_,N,A,g,22,s[3]),A=c(A,D,_,N,h,7,s[4]),N=c(N,A,D,_,b,12,s[5]),_=c(_,N,A,D,f,17,s[6]),D=c(D,_,N,A,v,22,s[7]),A=c(A,D,_,N,y,7,s[8]),N=c(N,A,D,_,x,12,s[9]),_=c(_,N,A,D,w,17,s[10]),D=c(D,_,N,A,k,22,s[11]),A=c(A,D,_,N,E,7,s[12]),N=c(N,A,D,_,S,12,s[13]),_=c(_,N,A,D,C,17,s[14]),A=d(A,D=c(D,_,N,A,T,22,s[15]),_,N,l,5,s[16]),N=d(N,A,D,_,f,9,s[17]),_=d(_,N,A,D,k,14,s[18]),D=d(D,_,N,A,i,20,s[19]),A=d(A,D,_,N,b,5,s[20]),N=d(N,A,D,_,w,9,s[21]),_=d(_,N,A,D,T,14,s[22]),D=d(D,_,N,A,h,20,s[23]),A=d(A,D,_,N,x,5,s[24]),N=d(N,A,D,_,C,9,s[25]),_=d(_,N,A,D,g,14,s[26]),D=d(D,_,N,A,y,20,s[27]),A=d(A,D,_,N,S,5,s[28]),N=d(N,A,D,_,u,9,s[29]),_=d(_,N,A,D,v,14,s[30]),A=m(A,D=d(D,_,N,A,E,20,s[31]),_,N,b,4,s[32]),N=m(N,A,D,_,y,11,s[33]),_=m(_,N,A,D,k,16,s[34]),D=m(D,_,N,A,C,23,s[35]),A=m(A,D,_,N,l,4,s[36]),N=m(N,A,D,_,h,11,s[37]),_=m(_,N,A,D,v,16,s[38]),D=m(D,_,N,A,w,23,s[39]),A=m(A,D,_,N,S,4,s[40]),N=m(N,A,D,_,i,11,s[41]),_=m(_,N,A,D,g,16,s[42]),D=m(D,_,N,A,f,23,s[43]),A=m(A,D,_,N,x,4,s[44]),N=m(N,A,D,_,E,11,s[45]),_=m(_,N,A,D,T,16,s[46]),A=p(A,D=m(D,_,N,A,u,23,s[47]),_,N,i,6,s[48]),N=p(N,A,D,_,v,10,s[49]),_=p(_,N,A,D,C,15,s[50]),D=p(D,_,N,A,b,21,s[51]),A=p(A,D,_,N,E,6,s[52]),N=p(N,A,D,_,g,10,s[53]),_=p(_,N,A,D,w,15,s[54]),D=p(D,_,N,A,l,21,s[55]),A=p(A,D,_,N,y,6,s[56]),N=p(N,A,D,_,T,10,s[57]),_=p(_,N,A,D,f,15,s[58]),D=p(D,_,N,A,S,21,s[59]),A=p(A,D,_,N,h,6,s[60]),N=p(N,A,D,_,k,10,s[61]),_=p(_,N,A,D,u,15,s[62]),D=p(D,_,N,A,x,21,s[63]),o[0]=o[0]+A|0,o[1]=o[1]+D|0,o[2]=o[2]+_|0,o[3]=o[3]+N|0},_doFinalize:function(){var t=this._data,n=t.words,a=8*this._nDataBytes,r=8*t.sigBytes;n[r>>>5]|=128<<24-r%32;var o=e.floor(a/4294967296),i=a;n[15+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,l=s.words,c=0;c<4;c++){var d=l[c];l[c]=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,n,a,r,o,i){var s=e+(t&n|~t&a)+r+i;return(s<<o|s>>>32-o)+t}function d(e,t,n,a,r,o,i){var s=e+(t&a|n&~a)+r+i;return(s<<o|s>>>32-o)+t}function m(e,t,n,a,r,o,i){var s=e+(t^n^a)+r+i;return(s<<o|s>>>32-o)+t}function p(e,t,n,a,r,o,i){var s=e+(n^(t|~a))+r+i;return(s<<o|s>>>32-o)+t}t.MD5=o._createHelper(l),t.HmacMD5=o._createHmacHelper(l)}(Math),a.MD5)},2169(e,t,n){var a;e.exports=(a=n(9021),n(7165),a.mode.CFB=function(){var e=a.lib.BlockCipherMode.extend();function t(e,t,n,a){var r,o=this._iv;o?(r=o.slice(0),this._iv=void 0):r=this._prevBlock,a.encryptBlock(r,0);for(var i=0;i<n;i++)e[t+i]^=r[i]}return e.Encryptor=e.extend({processBlock:function(e,n){var a=this._cipher,r=a.blockSize;t.call(this,e,n,r,a),this._prevBlock=e.slice(n,n+r)}}),e.Decryptor=e.extend({processBlock:function(e,n){var a=this._cipher,r=a.blockSize,o=e.slice(n,n+r);t.call(this,e,n,r,a),this._prevBlock=o}}),e}(),a.mode.CFB)},6372(e,t,n){var a;e.exports=(a=n(9021),n(7165),a.mode.CTRGladman=function(){var e=a.lib.BlockCipherMode.extend();function t(e){if(255&~(e>>24))e+=1<<24;else{var t=e>>16&255,n=e>>8&255,a=255&e;255===t?(t=0,255===n?(n=0,255===a?a=0:++a):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=a}return e}function n(e){return 0===(e[0]=t(e[0]))&&(e[1]=t(e[1])),e}var r=e.Encryptor=e.extend({processBlock:function(e,t){var a=this._cipher,r=a.blockSize,o=this._iv,i=this._counter;o&&(i=this._counter=o.slice(0),this._iv=void 0),n(i);var s=i.slice(0);a.encryptBlock(s,0);for(var l=0;l<r;l++)e[t+l]^=s[l]}});return e.Decryptor=r,e}(),a.mode.CTRGladman)},6939(e,t,n){var a,r,o;e.exports=(o=n(9021),n(7165),o.mode.CTR=(a=o.lib.BlockCipherMode.extend(),r=a.Encryptor=a.extend({processBlock:function(e,t){var n=this._cipher,a=n.blockSize,r=this._iv,o=this._counter;r&&(o=this._counter=r.slice(0),this._iv=void 0);var i=o.slice(0);n.encryptBlock(i,0),o[a-1]=o[a-1]+1|0;for(var s=0;s<a;s++)e[t+s]^=i[s]}}),a.Decryptor=r,a),o.mode.CTR)},8454(e,t,n){var a,r;e.exports=(r=n(9021),n(7165),r.mode.ECB=((a=r.lib.BlockCipherMode.extend()).Encryptor=a.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),a.Decryptor=a.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),a),r.mode.ECB)},3797(e,t,n){var a,r,o;e.exports=(o=n(9021),n(7165),o.mode.OFB=(a=o.lib.BlockCipherMode.extend(),r=a.Encryptor=a.extend({processBlock:function(e,t){var n=this._cipher,a=n.blockSize,r=this._iv,o=this._keystream;r&&(o=this._keystream=r.slice(0),this._iv=void 0),n.encryptBlock(o,0);for(var i=0;i<a;i++)e[t+i]^=o[i]}}),a.Decryptor=r,a),o.mode.OFB)},2073(e,t,n){var a;e.exports=(a=n(9021),n(7165),a.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,a=4*t,r=a-n%a,o=n+r-1;e.clamp(),e.words[o>>>2]|=r<<24-o%4*8,e.sigBytes+=r},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},a.pad.Ansix923)},7286(e,t,n){var a;e.exports=(a=n(9021),n(7165),a.pad.Iso10126={pad:function(e,t){var n=4*t,r=n-e.sigBytes%n;e.concat(a.lib.WordArray.random(r-1)).concat(a.lib.WordArray.create([r<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},a.pad.Iso10126)},482(e,t,n){var a;e.exports=(a=n(9021),n(7165),a.pad.Iso97971={pad:function(e,t){e.concat(a.lib.WordArray.create([2147483648],1)),a.pad.ZeroPadding.pad(e,t)},unpad:function(e){a.pad.ZeroPadding.unpad(e),e.sigBytes--}},a.pad.Iso97971)},8124(e,t,n){var a;e.exports=(a=n(9021),n(7165),a.pad.NoPadding={pad:function(){},unpad:function(){}},a.pad.NoPadding)},2155(e,t,n){var a;e.exports=(a=n(9021),n(7165),a.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},a.pad.ZeroPadding)},19(e,t,n){var a,r,o,i,s,l,c,d,m;e.exports=(m=n(9021),n(3009),n(1025),r=(a=m).lib,o=r.Base,i=r.WordArray,s=a.algo,l=s.SHA256,c=s.HMAC,d=s.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:l,iterations:25e4}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,a=c.create(n.hasher,e),r=i.create(),o=i.create([1]),s=r.words,l=o.words,d=n.keySize,m=n.iterations;s.length<d;){var p=a.update(t).finalize(o);a.reset();for(var u=p.words,g=u.length,h=p,b=1;b<m;b++){h=a.finalize(h),a.reset();for(var f=h.words,v=0;v<g;v++)u[v]^=f[v]}r.concat(p),l[0]++}return r.sigBytes=4*d,r}}),a.PBKDF2=function(e,t,n){return d.create(n).compute(e,t)},m.PBKDF2)},2696(e,t,n){var a;e.exports=(a=n(9021),n(754),n(4636),n(9506),n(7165),function(){var e=a,t=e.lib.StreamCipher,n=e.algo,r=[],o=[],i=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],a=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var r=0;r<4;r++)l.call(this);for(r=0;r<8;r++)a[r]^=n[r+4&7];if(t){var o=t.words,i=o[0],s=o[1],c=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),d=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),m=c>>>16|4294901760&d,p=d<<16|65535&c;for(a[0]^=c,a[1]^=m,a[2]^=d,a[3]^=p,a[4]^=c,a[5]^=m,a[6]^=d,a[7]^=p,r=0;r<4;r++)l.call(this)}},_doProcessBlock:function(e,t){var n=this._X;l.call(this),r[0]=n[0]^n[5]>>>16^n[3]<<16,r[1]=n[2]^n[7]>>>16^n[5]<<16,r[2]=n[4]^n[1]>>>16^n[7]<<16,r[3]=n[6]^n[3]>>>16^n[1]<<16;for(var a=0;a<4;a++)r[a]=16711935&(r[a]<<8|r[a]>>>24)|4278255360&(r[a]<<24|r[a]>>>8),e[t+a]^=r[a]},blockSize:4,ivSize:2});function l(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var a=e[n]+t[n],r=65535&a,s=a>>>16,l=((r*r>>>17)+r*s>>>15)+s*s,c=((4294901760&a)*a|0)+((65535&a)*a|0);i[n]=l^c}e[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,e[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,e[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,e[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,e[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,e[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,e[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,e[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}e.RabbitLegacy=t._createHelper(s)}(),a.RabbitLegacy)},6298(e,t,n){var a;e.exports=(a=n(9021),n(754),n(4636),n(9506),n(7165),function(){var e=a,t=e.lib.StreamCipher,n=e.algo,r=[],o=[],i=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var a=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)l.call(this);for(n=0;n<8;n++)r[n]^=a[n+4&7];if(t){var o=t.words,i=o[0],s=o[1],c=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),d=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),m=c>>>16|4294901760&d,p=d<<16|65535&c;for(r[0]^=c,r[1]^=m,r[2]^=d,r[3]^=p,r[4]^=c,r[5]^=m,r[6]^=d,r[7]^=p,n=0;n<4;n++)l.call(this)}},_doProcessBlock:function(e,t){var n=this._X;l.call(this),r[0]=n[0]^n[5]>>>16^n[3]<<16,r[1]=n[2]^n[7]>>>16^n[5]<<16,r[2]=n[4]^n[1]>>>16^n[7]<<16,r[3]=n[6]^n[3]>>>16^n[1]<<16;for(var a=0;a<4;a++)r[a]=16711935&(r[a]<<8|r[a]>>>24)|4278255360&(r[a]<<24|r[a]>>>8),e[t+a]^=r[a]},blockSize:4,ivSize:2});function l(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var a=e[n]+t[n],r=65535&a,s=a>>>16,l=((r*r>>>17)+r*s>>>15)+s*s,c=((4294901760&a)*a|0)+((65535&a)*a|0);i[n]=l^c}e[0]=i[0]+(i[7]<<16|i[7]>>>16)+(i[6]<<16|i[6]>>>16)|0,e[1]=i[1]+(i[0]<<8|i[0]>>>24)+i[7]|0,e[2]=i[2]+(i[1]<<16|i[1]>>>16)+(i[0]<<16|i[0]>>>16)|0,e[3]=i[3]+(i[2]<<8|i[2]>>>24)+i[1]|0,e[4]=i[4]+(i[3]<<16|i[3]>>>16)+(i[2]<<16|i[2]>>>16)|0,e[5]=i[5]+(i[4]<<8|i[4]>>>24)+i[3]|0,e[6]=i[6]+(i[5]<<16|i[5]>>>16)+(i[4]<<16|i[4]>>>16)|0,e[7]=i[7]+(i[6]<<8|i[6]>>>24)+i[5]|0}e.Rabbit=t._createHelper(s)}(),a.Rabbit)},7193(e,t,n){var a;e.exports=(a=n(9021),n(754),n(4636),n(9506),n(7165),function(){var e=a,t=e.lib.StreamCipher,n=e.algo,r=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,a=this._S=[],r=0;r<256;r++)a[r]=r;r=0;for(var o=0;r<256;r++){var i=r%n,s=t[i>>>2]>>>24-i%4*8&255;o=(o+a[r]+s)%256;var l=a[r];a[r]=a[o],a[o]=l}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,n=this._j,a=0,r=0;r<4;r++){n=(n+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[n],e[n]=o,a|=e[(e[t]+e[n])%256]<<24-8*r}return this._i=t,this._j=n,a}e.RC4=t._createHelper(r);var i=n.RC4Drop=r.extend({cfg:r.cfg.extend({drop:192}),_doReset:function(){r._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(i)}(),a.RC4)},8056(e,t,n){var a;e.exports=(a=n(9021),function(){var e=a,t=e.lib,n=t.WordArray,r=t.Hasher,o=e.algo,i=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=n.create([0,1518500249,1859775393,2400959708,2840853838]),m=n.create([1352829926,1548603684,1836072691,2053994217,0]),p=o.RIPEMD160=r.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var a=t+n,r=e[a];e[a]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var o,p,y,x,w,k,E,S,C,T,A,D=this._hash.words,_=d.words,N=m.words,M=i.words,I=s.words,R=l.words,B=c.words;for(k=o=D[0],E=p=D[1],S=y=D[2],C=x=D[3],T=w=D[4],n=0;n<80;n+=1)A=o+e[t+M[n]]|0,A+=n<16?u(p,y,x)+_[0]:n<32?g(p,y,x)+_[1]:n<48?h(p,y,x)+_[2]:n<64?b(p,y,x)+_[3]:f(p,y,x)+_[4],A=(A=v(A|=0,R[n]))+w|0,o=w,w=x,x=v(y,10),y=p,p=A,A=k+e[t+I[n]]|0,A+=n<16?f(E,S,C)+N[0]:n<32?b(E,S,C)+N[1]:n<48?h(E,S,C)+N[2]:n<64?g(E,S,C)+N[3]:u(E,S,C)+N[4],A=(A=v(A|=0,B[n]))+T|0,k=T,T=C,C=v(S,10),S=E,E=A;A=D[1]+y+C|0,D[1]=D[2]+x+T|0,D[2]=D[3]+w+k|0,D[3]=D[4]+o+E|0,D[4]=D[0]+p+S|0,D[0]=A},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,a=8*e.sigBytes;t[a>>>5]|=128<<24-a%32,t[14+(a+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var r=this._hash,o=r.words,i=0;i<5;i++){var s=o[i];o[i]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return r},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n){return e^t^n}function g(e,t,n){return e&t|~e&n}function h(e,t,n){return(e|~t)^n}function b(e,t,n){return e&n|t&~n}function f(e,t,n){return e^(t|~n)}function v(e,t){return e<<t|e>>>32-t}e.RIPEMD160=r._createHelper(p),e.HmacRIPEMD160=r._createHmacHelper(p)}(Math),a.RIPEMD160)},5471(e,t,n){var a,r,o,i,s,l,c,d;e.exports=(d=n(9021),r=(a=d).lib,o=r.WordArray,i=r.Hasher,s=a.algo,l=[],c=s.SHA1=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,a=n[0],r=n[1],o=n[2],i=n[3],s=n[4],c=0;c<80;c++){if(c<16)l[c]=0|e[t+c];else{var d=l[c-3]^l[c-8]^l[c-14]^l[c-16];l[c]=d<<1|d>>>31}var m=(a<<5|a>>>27)+s+l[c];m+=c<20?1518500249+(r&o|~r&i):c<40?1859775393+(r^o^i):c<60?(r&o|r&i|o&i)-1894007588:(r^o^i)-899497514,s=i,i=o,o=r<<30|r>>>2,r=a,a=m}n[0]=n[0]+a|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+i|0,n[4]=n[4]+s|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,a=8*e.sigBytes;return t[a>>>5]|=128<<24-a%32,t[14+(a+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(a+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),a.SHA1=i._createHelper(c),a.HmacSHA1=i._createHmacHelper(c),d.SHA1)},6308(e,t,n){var a,r,o,i,s,l;e.exports=(l=n(9021),n(3009),r=(a=l).lib.WordArray,o=a.algo,i=o.SHA256,s=o.SHA224=i.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=i._doFinalize.call(this);return e.sigBytes-=4,e}}),a.SHA224=i._createHelper(s),a.HmacSHA224=i._createHmacHelper(s),l.SHA224)},3009(e,t,n){var a;e.exports=(a=n(9021),function(e){var t=a,n=t.lib,r=n.WordArray,o=n.Hasher,i=t.algo,s=[],l=[];!function(){function t(t){for(var n=e.sqrt(t),a=2;a<=n;a++)if(!(t%a))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var a=2,r=0;r<64;)t(a)&&(r<8&&(s[r]=n(e.pow(a,.5))),l[r]=n(e.pow(a,1/3)),r++),a++}();var c=[],d=i.SHA256=o.extend({_doReset:function(){this._hash=new r.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,a=n[0],r=n[1],o=n[2],i=n[3],s=n[4],d=n[5],m=n[6],p=n[7],u=0;u<64;u++){if(u<16)c[u]=0|e[t+u];else{var g=c[u-15],h=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,b=c[u-2],f=(b<<15|b>>>17)^(b<<13|b>>>19)^b>>>10;c[u]=h+c[u-7]+f+c[u-16]}var v=a&r^a&o^r&o,y=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),x=p+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&d^~s&m)+l[u]+c[u];p=m,m=d,d=s,s=i+x|0,i=o,o=r,r=a,a=x+(y+v)|0}n[0]=n[0]+a|0,n[1]=n[1]+r|0,n[2]=n[2]+o|0,n[3]=n[3]+i|0,n[4]=n[4]+s|0,n[5]=n[5]+d|0,n[6]=n[6]+m|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,a=8*this._nDataBytes,r=8*t.sigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=e.floor(a/4294967296),n[15+(r+64>>>9<<4)]=a,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(d),t.HmacSHA256=o._createHmacHelper(d)}(Math),a.SHA256)},5953(e,t,n){var a;e.exports=(a=n(9021),n(3240),function(e){var t=a,n=t.lib,r=n.WordArray,o=n.Hasher,i=t.x64.Word,s=t.algo,l=[],c=[],d=[];!function(){for(var e=1,t=0,n=0;n<24;n++){l[e+5*t]=(n+1)*(n+2)/2%64;var a=(2*e+3*t)%5;e=t%5,t=a}for(e=0;e<5;e++)for(t=0;t<5;t++)c[e+5*t]=t+(2*e+3*t)%5*5;for(var r=1,o=0;o<24;o++){for(var s=0,m=0,p=0;p<7;p++){if(1&r){var u=(1<<p)-1;u<32?m^=1<<u:s^=1<<u-32}128&r?r=r<<1^113:r<<=1}d[o]=i.create(s,m)}}();var m=[];!function(){for(var e=0;e<25;e++)m[e]=i.create()}();var p=s.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new i.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,a=this.blockSize/2,r=0;r<a;r++){var o=e[t+2*r],i=e[t+2*r+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),i=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),(D=n[r]).high^=i,D.low^=o}for(var s=0;s<24;s++){for(var p=0;p<5;p++){for(var u=0,g=0,h=0;h<5;h++)u^=(D=n[p+5*h]).high,g^=D.low;var b=m[p];b.high=u,b.low=g}for(p=0;p<5;p++){var f=m[(p+4)%5],v=m[(p+1)%5],y=v.high,x=v.low;for(u=f.high^(y<<1|x>>>31),g=f.low^(x<<1|y>>>31),h=0;h<5;h++)(D=n[p+5*h]).high^=u,D.low^=g}for(var w=1;w<25;w++){var k=(D=n[w]).high,E=D.low,S=l[w];S<32?(u=k<<S|E>>>32-S,g=E<<S|k>>>32-S):(u=E<<S-32|k>>>64-S,g=k<<S-32|E>>>64-S);var C=m[c[w]];C.high=u,C.low=g}var T=m[0],A=n[0];for(T.high=A.high,T.low=A.low,p=0;p<5;p++)for(h=0;h<5;h++){var D=n[w=p+5*h],_=m[w],N=m[(p+1)%5+5*h],M=m[(p+2)%5+5*h];D.high=_.high^~N.high&M.high,D.low=_.low^~N.low&M.low}D=n[0];var I=d[s];D.high^=I.high,D.low^=I.low}},_doFinalize:function(){var t=this._data,n=t.words,a=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;n[a>>>5]|=1<<24-a%32,n[(e.ceil((a+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var i=this._state,s=this.cfg.outputLength/8,l=s/8,c=[],d=0;d<l;d++){var m=i[d],p=m.high,u=m.low;p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8),c.push(u),c.push(p)}return new r.init(c,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=o._createHelper(p),t.HmacSHA3=o._createHmacHelper(p)}(Math),a.SHA3)},9557(e,t,n){var a,r,o,i,s,l,c,d;e.exports=(d=n(9021),n(3240),n(1380),r=(a=d).x64,o=r.Word,i=r.WordArray,s=a.algo,l=s.SHA512,c=s.SHA384=l.extend({_doReset:function(){this._hash=new i.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=l._doFinalize.call(this);return e.sigBytes-=16,e}}),a.SHA384=l._createHelper(c),a.HmacSHA384=l._createHmacHelper(c),d.SHA384)},1380(e,t,n){var a;e.exports=(a=n(9021),n(3240),function(){var e=a,t=e.lib.Hasher,n=e.x64,r=n.Word,o=n.WordArray,i=e.algo;function s(){return r.create.apply(r,arguments)}var l=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=s()}();var d=i.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,a=n[0],r=n[1],o=n[2],i=n[3],s=n[4],d=n[5],m=n[6],p=n[7],u=a.high,g=a.low,h=r.high,b=r.low,f=o.high,v=o.low,y=i.high,x=i.low,w=s.high,k=s.low,E=d.high,S=d.low,C=m.high,T=m.low,A=p.high,D=p.low,_=u,N=g,M=h,I=b,R=f,B=v,P=y,L=x,U=w,F=k,z=E,O=S,W=C,q=T,H=A,j=D,V=0;V<80;V++){var G,K,$=c[V];if(V<16)K=$.high=0|e[t+2*V],G=$.low=0|e[t+2*V+1];else{var Y=c[V-15],X=Y.high,J=Y.low,Q=(X>>>1|J<<31)^(X>>>8|J<<24)^X>>>7,Z=(J>>>1|X<<31)^(J>>>8|X<<24)^(J>>>7|X<<25),ee=c[V-2],te=ee.high,ne=ee.low,ae=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,re=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),oe=c[V-7],ie=oe.high,se=oe.low,le=c[V-16],ce=le.high,de=le.low;K=(K=(K=Q+ie+((G=Z+se)>>>0<Z>>>0?1:0))+ae+((G+=re)>>>0<re>>>0?1:0))+ce+((G+=de)>>>0<de>>>0?1:0),$.high=K,$.low=G}var me,pe=U&z^~U&W,ue=F&O^~F&q,ge=_&M^_&R^M&R,he=N&I^N&B^I&B,be=(_>>>28|N<<4)^(_<<30|N>>>2)^(_<<25|N>>>7),fe=(N>>>28|_<<4)^(N<<30|_>>>2)^(N<<25|_>>>7),ve=(U>>>14|F<<18)^(U>>>18|F<<14)^(U<<23|F>>>9),ye=(F>>>14|U<<18)^(F>>>18|U<<14)^(F<<23|U>>>9),xe=l[V],we=xe.high,ke=xe.low,Ee=H+ve+((me=j+ye)>>>0<j>>>0?1:0),Se=fe+he;H=W,j=q,W=z,q=O,z=U,O=F,U=P+(Ee=(Ee=(Ee=Ee+pe+((me+=ue)>>>0<ue>>>0?1:0))+we+((me+=ke)>>>0<ke>>>0?1:0))+K+((me+=G)>>>0<G>>>0?1:0))+((F=L+me|0)>>>0<L>>>0?1:0)|0,P=R,L=B,R=M,B=I,M=_,I=N,_=Ee+(be+ge+(Se>>>0<fe>>>0?1:0))+((N=me+Se|0)>>>0<me>>>0?1:0)|0}g=a.low=g+N,a.high=u+_+(g>>>0<N>>>0?1:0),b=r.low=b+I,r.high=h+M+(b>>>0<I>>>0?1:0),v=o.low=v+B,o.high=f+R+(v>>>0<B>>>0?1:0),x=i.low=x+L,i.high=y+P+(x>>>0<L>>>0?1:0),k=s.low=k+F,s.high=w+U+(k>>>0<F>>>0?1:0),S=d.low=S+O,d.high=E+z+(S>>>0<O>>>0?1:0),T=m.low=T+q,m.high=C+W+(T>>>0<q>>>0?1:0),D=p.low=D+j,p.high=A+H+(D>>>0<j>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,a=8*e.sigBytes;return t[a>>>5]|=128<<24-a%32,t[30+(a+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(a+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(d),e.HmacSHA512=t._createHmacHelper(d)}(),a.SHA512)},7628(e,t,n){var a;e.exports=(a=n(9021),n(754),n(4636),n(9506),n(7165),function(){var e=a,t=e.lib,n=t.WordArray,r=t.BlockCipher,o=e.algo,i=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],d=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],m=o.DES=r.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var a=i[n]-1;t[n]=e[a>>>5]>>>31-a%32&1}for(var r=this._subKeys=[],o=0;o<16;o++){var c=r[o]=[],d=l[o];for(n=0;n<24;n++)c[n/6|0]|=t[(s[n]-1+d)%28]<<31-n%6,c[4+(n/6|0)]|=t[28+(s[n+24]-1+d)%28]<<31-n%6;for(c[0]=c[0]<<1|c[0]>>>31,n=1;n<7;n++)c[n]=c[n]>>>4*(n-1)+3;c[7]=c[7]<<5|c[7]>>>27}var m=this._invSubKeys=[];for(n=0;n<16;n++)m[n]=r[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],p.call(this,4,252645135),p.call(this,16,65535),u.call(this,2,858993459),u.call(this,8,16711935),p.call(this,1,1431655765);for(var a=0;a<16;a++){for(var r=n[a],o=this._lBlock,i=this._rBlock,s=0,l=0;l<8;l++)s|=c[l][((i^r[l])&d[l])>>>0];this._lBlock=i,this._rBlock=o^s}var m=this._lBlock;this._lBlock=this._rBlock,this._rBlock=m,p.call(this,1,1431655765),u.call(this,8,16711935),u.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function p(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function u(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}e.DES=r._createHelper(m);var g=o.TripleDES=r.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),a=e.length<4?e.slice(0,2):e.slice(2,4),r=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=m.createEncryptor(n.create(t)),this._des2=m.createEncryptor(n.create(a)),this._des3=m.createEncryptor(n.create(r))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=r._createHelper(g)}(),a.TripleDES)},3240(e,t,n){var a;e.exports=(a=n(9021),function(e){var t=a,n=t.lib,r=n.Base,o=n.WordArray,i=t.x64={};i.Word=r.extend({init:function(e,t){this.high=e,this.low=t}}),i.WordArray=r.extend({init:function(t,n){t=this.words=t||[],this.sigBytes=n!=e?n:8*t.length},toX32:function(){for(var e=this.words,t=e.length,n=[],a=0;a<t;a++){var r=e[a];n.push(r.high),n.push(r.low)}return o.create(n,this.sigBytes)},clone:function(){for(var e=r.clone.call(this),t=e.words=this.words.slice(0),n=t.length,a=0;a<n;a++)t[a]=t[a].clone();return e}})}(),a)},7945(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=[{"Typeface name":"Symbol","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Symbol","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"33","Unicode hex":"21"},{"Typeface name":"Symbol","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"8704","Unicode hex":"2200"},{"Typeface name":"Symbol","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"35","Unicode hex":"23"},{"Typeface name":"Symbol","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"8707","Unicode hex":"2203"},{"Typeface name":"Symbol","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"37","Unicode hex":"25"},{"Typeface name":"Symbol","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"38","Unicode hex":"26"},{"Typeface name":"Symbol","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"8717","Unicode hex":"220D"},{"Typeface name":"Symbol","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"40","Unicode hex":"28"},{"Typeface name":"Symbol","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"41","Unicode hex":"29"},{"Typeface name":"Symbol","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"42","Unicode hex":"2A"},{"Typeface name":"Symbol","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"43","Unicode hex":"2B"},{"Typeface name":"Symbol","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"44","Unicode hex":"2C"},{"Typeface name":"Symbol","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"8722","Unicode hex":"2212"},{"Typeface name":"Symbol","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"46","Unicode hex":"2E"},{"Typeface name":"Symbol","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"47","Unicode hex":"2F"},{"Typeface name":"Symbol","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"48","Unicode hex":"30"},{"Typeface name":"Symbol","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"49","Unicode hex":"31"},{"Typeface name":"Symbol","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"50","Unicode hex":"32"},{"Typeface name":"Symbol","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"51","Unicode hex":"33"},{"Typeface name":"Symbol","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"52","Unicode hex":"34"},{"Typeface name":"Symbol","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"53","Unicode hex":"35"},{"Typeface name":"Symbol","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"54","Unicode hex":"36"},{"Typeface name":"Symbol","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"55","Unicode hex":"37"},{"Typeface name":"Symbol","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"56","Unicode hex":"38"},{"Typeface name":"Symbol","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"57","Unicode hex":"39"},{"Typeface name":"Symbol","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"58","Unicode hex":"3A"},{"Typeface name":"Symbol","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"59","Unicode hex":"3B"},{"Typeface name":"Symbol","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"60","Unicode hex":"3C"},{"Typeface name":"Symbol","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"61","Unicode hex":"3D"},{"Typeface name":"Symbol","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"62","Unicode hex":"3E"},{"Typeface name":"Symbol","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"63","Unicode hex":"3F"},{"Typeface name":"Symbol","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"8773","Unicode hex":"2245"},{"Typeface name":"Symbol","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"913","Unicode hex":"391"},{"Typeface name":"Symbol","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"914","Unicode hex":"392"},{"Typeface name":"Symbol","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"935","Unicode hex":"3A7"},{"Typeface name":"Symbol","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"916","Unicode hex":"394"},{"Typeface name":"Symbol","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"917","Unicode hex":"395"},{"Typeface name":"Symbol","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"934","Unicode hex":"3A6"},{"Typeface name":"Symbol","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"915","Unicode hex":"393"},{"Typeface name":"Symbol","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"919","Unicode hex":"397"},{"Typeface name":"Symbol","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"921","Unicode hex":"399"},{"Typeface name":"Symbol","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"977","Unicode hex":"3D1"},{"Typeface name":"Symbol","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"922","Unicode hex":"39A"},{"Typeface name":"Symbol","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"923","Unicode hex":"39B"},{"Typeface name":"Symbol","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"924","Unicode hex":"39C"},{"Typeface name":"Symbol","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"925","Unicode hex":"39D"},{"Typeface name":"Symbol","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"927","Unicode hex":"39F"},{"Typeface name":"Symbol","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"928","Unicode hex":"3A0"},{"Typeface name":"Symbol","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"920","Unicode hex":"398"},{"Typeface name":"Symbol","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"929","Unicode hex":"3A1"},{"Typeface name":"Symbol","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"931","Unicode hex":"3A3"},{"Typeface name":"Symbol","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"932","Unicode hex":"3A4"},{"Typeface name":"Symbol","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"933","Unicode hex":"3A5"},{"Typeface name":"Symbol","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"962","Unicode hex":"3C2"},{"Typeface name":"Symbol","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"937","Unicode hex":"3A9"},{"Typeface name":"Symbol","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"926","Unicode hex":"39E"},{"Typeface name":"Symbol","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"936","Unicode hex":"3A8"},{"Typeface name":"Symbol","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"918","Unicode hex":"396"},{"Typeface name":"Symbol","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"91","Unicode hex":"5B"},{"Typeface name":"Symbol","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"8756","Unicode hex":"2234"},{"Typeface name":"Symbol","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"93","Unicode hex":"5D"},{"Typeface name":"Symbol","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"8869","Unicode hex":"22A5"},{"Typeface name":"Symbol","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"95","Unicode hex":"5F"},{"Typeface name":"Symbol","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"8254","Unicode hex":"203E"},{"Typeface name":"Symbol","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"945","Unicode hex":"3B1"},{"Typeface name":"Symbol","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"946","Unicode hex":"3B2"},{"Typeface name":"Symbol","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"967","Unicode hex":"3C7"},{"Typeface name":"Symbol","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"948","Unicode hex":"3B4"},{"Typeface name":"Symbol","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"949","Unicode hex":"3B5"},{"Typeface name":"Symbol","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"966","Unicode hex":"3C6"},{"Typeface name":"Symbol","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"947","Unicode hex":"3B3"},{"Typeface name":"Symbol","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"951","Unicode hex":"3B7"},{"Typeface name":"Symbol","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"953","Unicode hex":"3B9"},{"Typeface name":"Symbol","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"981","Unicode hex":"3D5"},{"Typeface name":"Symbol","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"954","Unicode hex":"3BA"},{"Typeface name":"Symbol","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"955","Unicode hex":"3BB"},{"Typeface name":"Symbol","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"956","Unicode hex":"3BC"},{"Typeface name":"Symbol","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"957","Unicode hex":"3BD"},{"Typeface name":"Symbol","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"959","Unicode hex":"3BF"},{"Typeface name":"Symbol","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"960","Unicode hex":"3C0"},{"Typeface name":"Symbol","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"952","Unicode hex":"3B8"},{"Typeface name":"Symbol","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"961","Unicode hex":"3C1"},{"Typeface name":"Symbol","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"963","Unicode hex":"3C3"},{"Typeface name":"Symbol","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"964","Unicode hex":"3C4"},{"Typeface name":"Symbol","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"965","Unicode hex":"3C5"},{"Typeface name":"Symbol","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"982","Unicode hex":"3D6"},{"Typeface name":"Symbol","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"969","Unicode hex":"3C9"},{"Typeface name":"Symbol","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"958","Unicode hex":"3BE"},{"Typeface name":"Symbol","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"968","Unicode hex":"3C8"},{"Typeface name":"Symbol","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"950","Unicode hex":"3B6"},{"Typeface name":"Symbol","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"123","Unicode hex":"7B"},{"Typeface name":"Symbol","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"124","Unicode hex":"7C"},{"Typeface name":"Symbol","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"125","Unicode hex":"7D"},{"Typeface name":"Symbol","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"126","Unicode hex":"7E"},{"Typeface name":"Symbol","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"8364","Unicode hex":"20AC"},{"Typeface name":"Symbol","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"978","Unicode hex":"3D2"},{"Typeface name":"Symbol","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"8242","Unicode hex":"2032"},{"Typeface name":"Symbol","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"8804","Unicode hex":"2264"},{"Typeface name":"Symbol","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"8260","Unicode hex":"2044"},{"Typeface name":"Symbol","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"8734","Unicode hex":"221E"},{"Typeface name":"Symbol","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"402","Unicode hex":"192"},{"Typeface name":"Symbol","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"9827","Unicode hex":"2663"},{"Typeface name":"Symbol","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"9830","Unicode hex":"2666"},{"Typeface name":"Symbol","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"9829","Unicode hex":"2665"},{"Typeface name":"Symbol","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"9824","Unicode hex":"2660"},{"Typeface name":"Symbol","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"8596","Unicode hex":"2194"},{"Typeface name":"Symbol","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"8592","Unicode hex":"2190"},{"Typeface name":"Symbol","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"8593","Unicode hex":"2191"},{"Typeface name":"Symbol","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"8594","Unicode hex":"2192"},{"Typeface name":"Symbol","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"8595","Unicode hex":"2193"},{"Typeface name":"Symbol","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"176","Unicode hex":"B0"},{"Typeface name":"Symbol","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"177","Unicode hex":"B1"},{"Typeface name":"Symbol","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"8243","Unicode hex":"2033"},{"Typeface name":"Symbol","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"8805","Unicode hex":"2265"},{"Typeface name":"Symbol","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"215","Unicode hex":"D7"},{"Typeface name":"Symbol","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"8733","Unicode hex":"221D"},{"Typeface name":"Symbol","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"8706","Unicode hex":"2202"},{"Typeface name":"Symbol","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"8226","Unicode hex":"2022"},{"Typeface name":"Symbol","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"247","Unicode hex":"F7"},{"Typeface name":"Symbol","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"8800","Unicode hex":"2260"},{"Typeface name":"Symbol","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"8801","Unicode hex":"2261"},{"Typeface name":"Symbol","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"8776","Unicode hex":"2248"},{"Typeface name":"Symbol","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"8230","Unicode hex":"2026"},{"Typeface name":"Symbol","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"9168","Unicode hex":"23D0"},{"Typeface name":"Symbol","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"9135","Unicode hex":"23AF"},{"Typeface name":"Symbol","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"8629","Unicode hex":"21B5"},{"Typeface name":"Symbol","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"8501","Unicode hex":"2135"},{"Typeface name":"Symbol","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"8465","Unicode hex":"2111"},{"Typeface name":"Symbol","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"8476","Unicode hex":"211C"},{"Typeface name":"Symbol","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"8472","Unicode hex":"2118"},{"Typeface name":"Symbol","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"8855","Unicode hex":"2297"},{"Typeface name":"Symbol","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"8853","Unicode hex":"2295"},{"Typeface name":"Symbol","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"8709","Unicode hex":"2205"},{"Typeface name":"Symbol","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"8745","Unicode hex":"2229"},{"Typeface name":"Symbol","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"8746","Unicode hex":"222A"},{"Typeface name":"Symbol","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"8835","Unicode hex":"2283"},{"Typeface name":"Symbol","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"8839","Unicode hex":"2287"},{"Typeface name":"Symbol","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"8836","Unicode hex":"2284"},{"Typeface name":"Symbol","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"8834","Unicode hex":"2282"},{"Typeface name":"Symbol","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"8838","Unicode hex":"2286"},{"Typeface name":"Symbol","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"8712","Unicode hex":"2208"},{"Typeface name":"Symbol","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"8713","Unicode hex":"2209"},{"Typeface name":"Symbol","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"8736","Unicode hex":"2220"},{"Typeface name":"Symbol","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"8711","Unicode hex":"2207"},{"Typeface name":"Symbol","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"174","Unicode hex":"AE"},{"Typeface name":"Symbol","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"169","Unicode hex":"A9"},{"Typeface name":"Symbol","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"8482","Unicode hex":"2122"},{"Typeface name":"Symbol","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"8719","Unicode hex":"220F"},{"Typeface name":"Symbol","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"8730","Unicode hex":"221A"},{"Typeface name":"Symbol","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"8901","Unicode hex":"22C5"},{"Typeface name":"Symbol","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"172","Unicode hex":"AC"},{"Typeface name":"Symbol","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"8743","Unicode hex":"2227"},{"Typeface name":"Symbol","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"8744","Unicode hex":"2228"},{"Typeface name":"Symbol","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"8660","Unicode hex":"21D4"},{"Typeface name":"Symbol","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"8656","Unicode hex":"21D0"},{"Typeface name":"Symbol","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"8657","Unicode hex":"21D1"},{"Typeface name":"Symbol","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"8658","Unicode hex":"21D2"},{"Typeface name":"Symbol","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"8659","Unicode hex":"21D3"},{"Typeface name":"Symbol","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"9674","Unicode hex":"25CA"},{"Typeface name":"Symbol","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"12296","Unicode hex":"3008"},{"Typeface name":"Symbol","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"174","Unicode hex":"AE"},{"Typeface name":"Symbol","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"169","Unicode hex":"A9"},{"Typeface name":"Symbol","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"8482","Unicode hex":"2122"},{"Typeface name":"Symbol","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"8721","Unicode hex":"2211"},{"Typeface name":"Symbol","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"9115","Unicode hex":"239B"},{"Typeface name":"Symbol","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"9116","Unicode hex":"239C"},{"Typeface name":"Symbol","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"9117","Unicode hex":"239D"},{"Typeface name":"Symbol","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"9121","Unicode hex":"23A1"},{"Typeface name":"Symbol","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"9122","Unicode hex":"23A2"},{"Typeface name":"Symbol","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"9123","Unicode hex":"23A3"},{"Typeface name":"Symbol","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"9127","Unicode hex":"23A7"},{"Typeface name":"Symbol","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"9128","Unicode hex":"23A8"},{"Typeface name":"Symbol","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"9129","Unicode hex":"23A9"},{"Typeface name":"Symbol","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"9130","Unicode hex":"23AA"},{"Typeface name":"Symbol","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"63743","Unicode hex":"F8FF"},{"Typeface name":"Symbol","Dingbat dec":"241","Dingbat hex":"F1","Unicode dec":"12297","Unicode hex":"3009"},{"Typeface name":"Symbol","Dingbat dec":"242","Dingbat hex":"F2","Unicode dec":"8747","Unicode hex":"222B"},{"Typeface name":"Symbol","Dingbat dec":"243","Dingbat hex":"F3","Unicode dec":"8992","Unicode hex":"2320"},{"Typeface name":"Symbol","Dingbat dec":"244","Dingbat hex":"F4","Unicode dec":"9134","Unicode hex":"23AE"},{"Typeface name":"Symbol","Dingbat dec":"245","Dingbat hex":"F5","Unicode dec":"8993","Unicode hex":"2321"},{"Typeface name":"Symbol","Dingbat dec":"246","Dingbat hex":"F6","Unicode dec":"9118","Unicode hex":"239E"},{"Typeface name":"Symbol","Dingbat dec":"247","Dingbat hex":"F7","Unicode dec":"9119","Unicode hex":"239F"},{"Typeface name":"Symbol","Dingbat dec":"248","Dingbat hex":"F8","Unicode dec":"9120","Unicode hex":"23A0"},{"Typeface name":"Symbol","Dingbat dec":"249","Dingbat hex":"F9","Unicode dec":"9124","Unicode hex":"23A4"},{"Typeface name":"Symbol","Dingbat dec":"250","Dingbat hex":"FA","Unicode dec":"9125","Unicode hex":"23A5"},{"Typeface name":"Symbol","Dingbat dec":"251","Dingbat hex":"FB","Unicode dec":"9126","Unicode hex":"23A6"},{"Typeface name":"Symbol","Dingbat dec":"252","Dingbat hex":"FC","Unicode dec":"9131","Unicode hex":"23AB"},{"Typeface name":"Symbol","Dingbat dec":"253","Dingbat hex":"FD","Unicode dec":"9132","Unicode hex":"23AC"},{"Typeface name":"Symbol","Dingbat dec":"254","Dingbat hex":"FE","Unicode dec":"9133","Unicode hex":"23AD"},{"Typeface name":"Webdings","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Webdings","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"128375","Unicode hex":"1F577"},{"Typeface name":"Webdings","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"128376","Unicode hex":"1F578"},{"Typeface name":"Webdings","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"128370","Unicode hex":"1F572"},{"Typeface name":"Webdings","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"128374","Unicode hex":"1F576"},{"Typeface name":"Webdings","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"127942","Unicode hex":"1F3C6"},{"Typeface name":"Webdings","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"127894","Unicode hex":"1F396"},{"Typeface name":"Webdings","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"128391","Unicode hex":"1F587"},{"Typeface name":"Webdings","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"128488","Unicode hex":"1F5E8"},{"Typeface name":"Webdings","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"128489","Unicode hex":"1F5E9"},{"Typeface name":"Webdings","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"128496","Unicode hex":"1F5F0"},{"Typeface name":"Webdings","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"128497","Unicode hex":"1F5F1"},{"Typeface name":"Webdings","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"127798","Unicode hex":"1F336"},{"Typeface name":"Webdings","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"127895","Unicode hex":"1F397"},{"Typeface name":"Webdings","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"128638","Unicode hex":"1F67E"},{"Typeface name":"Webdings","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"128636","Unicode hex":"1F67C"},{"Typeface name":"Webdings","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"128469","Unicode hex":"1F5D5"},{"Typeface name":"Webdings","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"128470","Unicode hex":"1F5D6"},{"Typeface name":"Webdings","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"128471","Unicode hex":"1F5D7"},{"Typeface name":"Webdings","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"9204","Unicode hex":"23F4"},{"Typeface name":"Webdings","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"9205","Unicode hex":"23F5"},{"Typeface name":"Webdings","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"9206","Unicode hex":"23F6"},{"Typeface name":"Webdings","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"9207","Unicode hex":"23F7"},{"Typeface name":"Webdings","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"9194","Unicode hex":"23EA"},{"Typeface name":"Webdings","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"9193","Unicode hex":"23E9"},{"Typeface name":"Webdings","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"9198","Unicode hex":"23EE"},{"Typeface name":"Webdings","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"9197","Unicode hex":"23ED"},{"Typeface name":"Webdings","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"9208","Unicode hex":"23F8"},{"Typeface name":"Webdings","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"9209","Unicode hex":"23F9"},{"Typeface name":"Webdings","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"9210","Unicode hex":"23FA"},{"Typeface name":"Webdings","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"128474","Unicode hex":"1F5DA"},{"Typeface name":"Webdings","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"128499","Unicode hex":"1F5F3"},{"Typeface name":"Webdings","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"128736","Unicode hex":"1F6E0"},{"Typeface name":"Webdings","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"127959","Unicode hex":"1F3D7"},{"Typeface name":"Webdings","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"127960","Unicode hex":"1F3D8"},{"Typeface name":"Webdings","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"127961","Unicode hex":"1F3D9"},{"Typeface name":"Webdings","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"127962","Unicode hex":"1F3DA"},{"Typeface name":"Webdings","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"127964","Unicode hex":"1F3DC"},{"Typeface name":"Webdings","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"127981","Unicode hex":"1F3ED"},{"Typeface name":"Webdings","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"127963","Unicode hex":"1F3DB"},{"Typeface name":"Webdings","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"127968","Unicode hex":"1F3E0"},{"Typeface name":"Webdings","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"127958","Unicode hex":"1F3D6"},{"Typeface name":"Webdings","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"127965","Unicode hex":"1F3DD"},{"Typeface name":"Webdings","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"128739","Unicode hex":"1F6E3"},{"Typeface name":"Webdings","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"128269","Unicode hex":"1F50D"},{"Typeface name":"Webdings","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"127956","Unicode hex":"1F3D4"},{"Typeface name":"Webdings","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"128065","Unicode hex":"1F441"},{"Typeface name":"Webdings","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"128066","Unicode hex":"1F442"},{"Typeface name":"Webdings","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"127966","Unicode hex":"1F3DE"},{"Typeface name":"Webdings","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"127957","Unicode hex":"1F3D5"},{"Typeface name":"Webdings","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"128740","Unicode hex":"1F6E4"},{"Typeface name":"Webdings","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"127967","Unicode hex":"1F3DF"},{"Typeface name":"Webdings","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"128755","Unicode hex":"1F6F3"},{"Typeface name":"Webdings","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"128364","Unicode hex":"1F56C"},{"Typeface name":"Webdings","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"128363","Unicode hex":"1F56B"},{"Typeface name":"Webdings","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"128360","Unicode hex":"1F568"},{"Typeface name":"Webdings","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"128264","Unicode hex":"1F508"},{"Typeface name":"Webdings","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"127892","Unicode hex":"1F394"},{"Typeface name":"Webdings","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"127893","Unicode hex":"1F395"},{"Typeface name":"Webdings","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"128492","Unicode hex":"1F5EC"},{"Typeface name":"Webdings","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"128637","Unicode hex":"1F67D"},{"Typeface name":"Webdings","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"128493","Unicode hex":"1F5ED"},{"Typeface name":"Webdings","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"128490","Unicode hex":"1F5EA"},{"Typeface name":"Webdings","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"128491","Unicode hex":"1F5EB"},{"Typeface name":"Webdings","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"11156","Unicode hex":"2B94"},{"Typeface name":"Webdings","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"10004","Unicode hex":"2714"},{"Typeface name":"Webdings","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"128690","Unicode hex":"1F6B2"},{"Typeface name":"Webdings","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"11036","Unicode hex":"2B1C"},{"Typeface name":"Webdings","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"128737","Unicode hex":"1F6E1"},{"Typeface name":"Webdings","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"128230","Unicode hex":"1F4E6"},{"Typeface name":"Webdings","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"128753","Unicode hex":"1F6F1"},{"Typeface name":"Webdings","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"11035","Unicode hex":"2B1B"},{"Typeface name":"Webdings","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"128657","Unicode hex":"1F691"},{"Typeface name":"Webdings","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"128712","Unicode hex":"1F6C8"},{"Typeface name":"Webdings","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"128745","Unicode hex":"1F6E9"},{"Typeface name":"Webdings","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"128752","Unicode hex":"1F6F0"},{"Typeface name":"Webdings","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"128968","Unicode hex":"1F7C8"},{"Typeface name":"Webdings","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"128372","Unicode hex":"1F574"},{"Typeface name":"Webdings","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"11044","Unicode hex":"2B24"},{"Typeface name":"Webdings","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"128741","Unicode hex":"1F6E5"},{"Typeface name":"Webdings","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"128660","Unicode hex":"1F694"},{"Typeface name":"Webdings","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"128472","Unicode hex":"1F5D8"},{"Typeface name":"Webdings","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"128473","Unicode hex":"1F5D9"},{"Typeface name":"Webdings","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"10067","Unicode hex":"2753"},{"Typeface name":"Webdings","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"128754","Unicode hex":"1F6F2"},{"Typeface name":"Webdings","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"128647","Unicode hex":"1F687"},{"Typeface name":"Webdings","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"128653","Unicode hex":"1F68D"},{"Typeface name":"Webdings","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"9971","Unicode hex":"26F3"},{"Typeface name":"Webdings","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"10680","Unicode hex":"29B8"},{"Typeface name":"Webdings","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"8854","Unicode hex":"2296"},{"Typeface name":"Webdings","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"128685","Unicode hex":"1F6AD"},{"Typeface name":"Webdings","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"128494","Unicode hex":"1F5EE"},{"Typeface name":"Webdings","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"9168","Unicode hex":"23D0"},{"Typeface name":"Webdings","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"128495","Unicode hex":"1F5EF"},{"Typeface name":"Webdings","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"128498","Unicode hex":"1F5F2"},{"Typeface name":"Webdings","Dingbat dec":"128","Dingbat hex":"80","Unicode dec":"128697","Unicode hex":"1F6B9"},{"Typeface name":"Webdings","Dingbat dec":"129","Dingbat hex":"81","Unicode dec":"128698","Unicode hex":"1F6BA"},{"Typeface name":"Webdings","Dingbat dec":"130","Dingbat hex":"82","Unicode dec":"128713","Unicode hex":"1F6C9"},{"Typeface name":"Webdings","Dingbat dec":"131","Dingbat hex":"83","Unicode dec":"128714","Unicode hex":"1F6CA"},{"Typeface name":"Webdings","Dingbat dec":"132","Dingbat hex":"84","Unicode dec":"128700","Unicode hex":"1F6BC"},{"Typeface name":"Webdings","Dingbat dec":"133","Dingbat hex":"85","Unicode dec":"128125","Unicode hex":"1F47D"},{"Typeface name":"Webdings","Dingbat dec":"134","Dingbat hex":"86","Unicode dec":"127947","Unicode hex":"1F3CB"},{"Typeface name":"Webdings","Dingbat dec":"135","Dingbat hex":"87","Unicode dec":"9975","Unicode hex":"26F7"},{"Typeface name":"Webdings","Dingbat dec":"136","Dingbat hex":"88","Unicode dec":"127938","Unicode hex":"1F3C2"},{"Typeface name":"Webdings","Dingbat dec":"137","Dingbat hex":"89","Unicode dec":"127948","Unicode hex":"1F3CC"},{"Typeface name":"Webdings","Dingbat dec":"138","Dingbat hex":"8A","Unicode dec":"127946","Unicode hex":"1F3CA"},{"Typeface name":"Webdings","Dingbat dec":"139","Dingbat hex":"8B","Unicode dec":"127940","Unicode hex":"1F3C4"},{"Typeface name":"Webdings","Dingbat dec":"140","Dingbat hex":"8C","Unicode dec":"127949","Unicode hex":"1F3CD"},{"Typeface name":"Webdings","Dingbat dec":"141","Dingbat hex":"8D","Unicode dec":"127950","Unicode hex":"1F3CE"},{"Typeface name":"Webdings","Dingbat dec":"142","Dingbat hex":"8E","Unicode dec":"128664","Unicode hex":"1F698"},{"Typeface name":"Webdings","Dingbat dec":"143","Dingbat hex":"8F","Unicode dec":"128480","Unicode hex":"1F5E0"},{"Typeface name":"Webdings","Dingbat dec":"144","Dingbat hex":"90","Unicode dec":"128738","Unicode hex":"1F6E2"},{"Typeface name":"Webdings","Dingbat dec":"145","Dingbat hex":"91","Unicode dec":"128176","Unicode hex":"1F4B0"},{"Typeface name":"Webdings","Dingbat dec":"146","Dingbat hex":"92","Unicode dec":"127991","Unicode hex":"1F3F7"},{"Typeface name":"Webdings","Dingbat dec":"147","Dingbat hex":"93","Unicode dec":"128179","Unicode hex":"1F4B3"},{"Typeface name":"Webdings","Dingbat dec":"148","Dingbat hex":"94","Unicode dec":"128106","Unicode hex":"1F46A"},{"Typeface name":"Webdings","Dingbat dec":"149","Dingbat hex":"95","Unicode dec":"128481","Unicode hex":"1F5E1"},{"Typeface name":"Webdings","Dingbat dec":"150","Dingbat hex":"96","Unicode dec":"128482","Unicode hex":"1F5E2"},{"Typeface name":"Webdings","Dingbat dec":"151","Dingbat hex":"97","Unicode dec":"128483","Unicode hex":"1F5E3"},{"Typeface name":"Webdings","Dingbat dec":"152","Dingbat hex":"98","Unicode dec":"10031","Unicode hex":"272F"},{"Typeface name":"Webdings","Dingbat dec":"153","Dingbat hex":"99","Unicode dec":"128388","Unicode hex":"1F584"},{"Typeface name":"Webdings","Dingbat dec":"154","Dingbat hex":"9A","Unicode dec":"128389","Unicode hex":"1F585"},{"Typeface name":"Webdings","Dingbat dec":"155","Dingbat hex":"9B","Unicode dec":"128387","Unicode hex":"1F583"},{"Typeface name":"Webdings","Dingbat dec":"156","Dingbat hex":"9C","Unicode dec":"128390","Unicode hex":"1F586"},{"Typeface name":"Webdings","Dingbat dec":"157","Dingbat hex":"9D","Unicode dec":"128441","Unicode hex":"1F5B9"},{"Typeface name":"Webdings","Dingbat dec":"158","Dingbat hex":"9E","Unicode dec":"128442","Unicode hex":"1F5BA"},{"Typeface name":"Webdings","Dingbat dec":"159","Dingbat hex":"9F","Unicode dec":"128443","Unicode hex":"1F5BB"},{"Typeface name":"Webdings","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"128373","Unicode hex":"1F575"},{"Typeface name":"Webdings","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"128368","Unicode hex":"1F570"},{"Typeface name":"Webdings","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"128445","Unicode hex":"1F5BD"},{"Typeface name":"Webdings","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"128446","Unicode hex":"1F5BE"},{"Typeface name":"Webdings","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"128203","Unicode hex":"1F4CB"},{"Typeface name":"Webdings","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"128466","Unicode hex":"1F5D2"},{"Typeface name":"Webdings","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"128467","Unicode hex":"1F5D3"},{"Typeface name":"Webdings","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"128366","Unicode hex":"1F56E"},{"Typeface name":"Webdings","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"128218","Unicode hex":"1F4DA"},{"Typeface name":"Webdings","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"128478","Unicode hex":"1F5DE"},{"Typeface name":"Webdings","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"128479","Unicode hex":"1F5DF"},{"Typeface name":"Webdings","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"128451","Unicode hex":"1F5C3"},{"Typeface name":"Webdings","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"128450","Unicode hex":"1F5C2"},{"Typeface name":"Webdings","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"128444","Unicode hex":"1F5BC"},{"Typeface name":"Webdings","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"127917","Unicode hex":"1F3AD"},{"Typeface name":"Webdings","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"127900","Unicode hex":"1F39C"},{"Typeface name":"Webdings","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"127896","Unicode hex":"1F398"},{"Typeface name":"Webdings","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"127897","Unicode hex":"1F399"},{"Typeface name":"Webdings","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"127911","Unicode hex":"1F3A7"},{"Typeface name":"Webdings","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"128191","Unicode hex":"1F4BF"},{"Typeface name":"Webdings","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"127902","Unicode hex":"1F39E"},{"Typeface name":"Webdings","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"128247","Unicode hex":"1F4F7"},{"Typeface name":"Webdings","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"127903","Unicode hex":"1F39F"},{"Typeface name":"Webdings","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"127916","Unicode hex":"1F3AC"},{"Typeface name":"Webdings","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"128253","Unicode hex":"1F4FD"},{"Typeface name":"Webdings","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"128249","Unicode hex":"1F4F9"},{"Typeface name":"Webdings","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"128254","Unicode hex":"1F4FE"},{"Typeface name":"Webdings","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"128251","Unicode hex":"1F4FB"},{"Typeface name":"Webdings","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"127898","Unicode hex":"1F39A"},{"Typeface name":"Webdings","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"127899","Unicode hex":"1F39B"},{"Typeface name":"Webdings","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"128250","Unicode hex":"1F4FA"},{"Typeface name":"Webdings","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"128187","Unicode hex":"1F4BB"},{"Typeface name":"Webdings","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"128421","Unicode hex":"1F5A5"},{"Typeface name":"Webdings","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"128422","Unicode hex":"1F5A6"},{"Typeface name":"Webdings","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"128423","Unicode hex":"1F5A7"},{"Typeface name":"Webdings","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"128377","Unicode hex":"1F579"},{"Typeface name":"Webdings","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"127918","Unicode hex":"1F3AE"},{"Typeface name":"Webdings","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"128379","Unicode hex":"1F57B"},{"Typeface name":"Webdings","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"128380","Unicode hex":"1F57C"},{"Typeface name":"Webdings","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"128223","Unicode hex":"1F4DF"},{"Typeface name":"Webdings","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"128385","Unicode hex":"1F581"},{"Typeface name":"Webdings","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"128384","Unicode hex":"1F580"},{"Typeface name":"Webdings","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"128424","Unicode hex":"1F5A8"},{"Typeface name":"Webdings","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"128425","Unicode hex":"1F5A9"},{"Typeface name":"Webdings","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"128447","Unicode hex":"1F5BF"},{"Typeface name":"Webdings","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"128426","Unicode hex":"1F5AA"},{"Typeface name":"Webdings","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"128476","Unicode hex":"1F5DC"},{"Typeface name":"Webdings","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"128274","Unicode hex":"1F512"},{"Typeface name":"Webdings","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"128275","Unicode hex":"1F513"},{"Typeface name":"Webdings","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"128477","Unicode hex":"1F5DD"},{"Typeface name":"Webdings","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"128229","Unicode hex":"1F4E5"},{"Typeface name":"Webdings","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"128228","Unicode hex":"1F4E4"},{"Typeface name":"Webdings","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"128371","Unicode hex":"1F573"},{"Typeface name":"Webdings","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"127779","Unicode hex":"1F323"},{"Typeface name":"Webdings","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"127780","Unicode hex":"1F324"},{"Typeface name":"Webdings","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"127781","Unicode hex":"1F325"},{"Typeface name":"Webdings","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"127782","Unicode hex":"1F326"},{"Typeface name":"Webdings","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"9729","Unicode hex":"2601"},{"Typeface name":"Webdings","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"127784","Unicode hex":"1F328"},{"Typeface name":"Webdings","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"127783","Unicode hex":"1F327"},{"Typeface name":"Webdings","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"127785","Unicode hex":"1F329"},{"Typeface name":"Webdings","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"127786","Unicode hex":"1F32A"},{"Typeface name":"Webdings","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"127788","Unicode hex":"1F32C"},{"Typeface name":"Webdings","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"127787","Unicode hex":"1F32B"},{"Typeface name":"Webdings","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"127772","Unicode hex":"1F31C"},{"Typeface name":"Webdings","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"127777","Unicode hex":"1F321"},{"Typeface name":"Webdings","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"128715","Unicode hex":"1F6CB"},{"Typeface name":"Webdings","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"128719","Unicode hex":"1F6CF"},{"Typeface name":"Webdings","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"127869","Unicode hex":"1F37D"},{"Typeface name":"Webdings","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"127864","Unicode hex":"1F378"},{"Typeface name":"Webdings","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"128718","Unicode hex":"1F6CE"},{"Typeface name":"Webdings","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"128717","Unicode hex":"1F6CD"},{"Typeface name":"Webdings","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"9413","Unicode hex":"24C5"},{"Typeface name":"Webdings","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"9855","Unicode hex":"267F"},{"Typeface name":"Webdings","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"128710","Unicode hex":"1F6C6"},{"Typeface name":"Webdings","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"128392","Unicode hex":"1F588"},{"Typeface name":"Webdings","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"127891","Unicode hex":"1F393"},{"Typeface name":"Webdings","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"128484","Unicode hex":"1F5E4"},{"Typeface name":"Webdings","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"128485","Unicode hex":"1F5E5"},{"Typeface name":"Webdings","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"128486","Unicode hex":"1F5E6"},{"Typeface name":"Webdings","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"128487","Unicode hex":"1F5E7"},{"Typeface name":"Webdings","Dingbat dec":"241","Dingbat hex":"F1","Unicode dec":"128746","Unicode hex":"1F6EA"},{"Typeface name":"Webdings","Dingbat dec":"242","Dingbat hex":"F2","Unicode dec":"128063","Unicode hex":"1F43F"},{"Typeface name":"Webdings","Dingbat dec":"243","Dingbat hex":"F3","Unicode dec":"128038","Unicode hex":"1F426"},{"Typeface name":"Webdings","Dingbat dec":"244","Dingbat hex":"F4","Unicode dec":"128031","Unicode hex":"1F41F"},{"Typeface name":"Webdings","Dingbat dec":"245","Dingbat hex":"F5","Unicode dec":"128021","Unicode hex":"1F415"},{"Typeface name":"Webdings","Dingbat dec":"246","Dingbat hex":"F6","Unicode dec":"128008","Unicode hex":"1F408"},{"Typeface name":"Webdings","Dingbat dec":"247","Dingbat hex":"F7","Unicode dec":"128620","Unicode hex":"1F66C"},{"Typeface name":"Webdings","Dingbat dec":"248","Dingbat hex":"F8","Unicode dec":"128622","Unicode hex":"1F66E"},{"Typeface name":"Webdings","Dingbat dec":"249","Dingbat hex":"F9","Unicode dec":"128621","Unicode hex":"1F66D"},{"Typeface name":"Webdings","Dingbat dec":"250","Dingbat hex":"FA","Unicode dec":"128623","Unicode hex":"1F66F"},{"Typeface name":"Webdings","Dingbat dec":"251","Dingbat hex":"FB","Unicode dec":"128506","Unicode hex":"1F5FA"},{"Typeface name":"Webdings","Dingbat dec":"252","Dingbat hex":"FC","Unicode dec":"127757","Unicode hex":"1F30D"},{"Typeface name":"Webdings","Dingbat dec":"253","Dingbat hex":"FD","Unicode dec":"127759","Unicode hex":"1F30F"},{"Typeface name":"Webdings","Dingbat dec":"254","Dingbat hex":"FE","Unicode dec":"127758","Unicode hex":"1F30E"},{"Typeface name":"Webdings","Dingbat dec":"255","Dingbat hex":"FF","Unicode dec":"128330","Unicode hex":"1F54A"},{"Typeface name":"Wingdings","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Wingdings","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"128393","Unicode hex":"1F589"},{"Typeface name":"Wingdings","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"9986","Unicode hex":"2702"},{"Typeface name":"Wingdings","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"9985","Unicode hex":"2701"},{"Typeface name":"Wingdings","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"128083","Unicode hex":"1F453"},{"Typeface name":"Wingdings","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"128365","Unicode hex":"1F56D"},{"Typeface name":"Wingdings","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"128366","Unicode hex":"1F56E"},{"Typeface name":"Wingdings","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"128367","Unicode hex":"1F56F"},{"Typeface name":"Wingdings","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"128383","Unicode hex":"1F57F"},{"Typeface name":"Wingdings","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"9990","Unicode hex":"2706"},{"Typeface name":"Wingdings","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"128386","Unicode hex":"1F582"},{"Typeface name":"Wingdings","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"128387","Unicode hex":"1F583"},{"Typeface name":"Wingdings","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"128234","Unicode hex":"1F4EA"},{"Typeface name":"Wingdings","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"128235","Unicode hex":"1F4EB"},{"Typeface name":"Wingdings","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"128236","Unicode hex":"1F4EC"},{"Typeface name":"Wingdings","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"128237","Unicode hex":"1F4ED"},{"Typeface name":"Wingdings","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"128448","Unicode hex":"1F5C0"},{"Typeface name":"Wingdings","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"128449","Unicode hex":"1F5C1"},{"Typeface name":"Wingdings","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"128462","Unicode hex":"1F5CE"},{"Typeface name":"Wingdings","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"128463","Unicode hex":"1F5CF"},{"Typeface name":"Wingdings","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"128464","Unicode hex":"1F5D0"},{"Typeface name":"Wingdings","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"128452","Unicode hex":"1F5C4"},{"Typeface name":"Wingdings","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"8987","Unicode hex":"231B"},{"Typeface name":"Wingdings","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"128430","Unicode hex":"1F5AE"},{"Typeface name":"Wingdings","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"128432","Unicode hex":"1F5B0"},{"Typeface name":"Wingdings","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"128434","Unicode hex":"1F5B2"},{"Typeface name":"Wingdings","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"128435","Unicode hex":"1F5B3"},{"Typeface name":"Wingdings","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"128436","Unicode hex":"1F5B4"},{"Typeface name":"Wingdings","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"128427","Unicode hex":"1F5AB"},{"Typeface name":"Wingdings","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"128428","Unicode hex":"1F5AC"},{"Typeface name":"Wingdings","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"9991","Unicode hex":"2707"},{"Typeface name":"Wingdings","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"9997","Unicode hex":"270D"},{"Typeface name":"Wingdings","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"128398","Unicode hex":"1F58E"},{"Typeface name":"Wingdings","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"9996","Unicode hex":"270C"},{"Typeface name":"Wingdings","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"128399","Unicode hex":"1F58F"},{"Typeface name":"Wingdings","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"128077","Unicode hex":"1F44D"},{"Typeface name":"Wingdings","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"128078","Unicode hex":"1F44E"},{"Typeface name":"Wingdings","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"9756","Unicode hex":"261C"},{"Typeface name":"Wingdings","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"9758","Unicode hex":"261E"},{"Typeface name":"Wingdings","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"9757","Unicode hex":"261D"},{"Typeface name":"Wingdings","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"9759","Unicode hex":"261F"},{"Typeface name":"Wingdings","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"128400","Unicode hex":"1F590"},{"Typeface name":"Wingdings","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"9786","Unicode hex":"263A"},{"Typeface name":"Wingdings","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"128528","Unicode hex":"1F610"},{"Typeface name":"Wingdings","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"9785","Unicode hex":"2639"},{"Typeface name":"Wingdings","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"128163","Unicode hex":"1F4A3"},{"Typeface name":"Wingdings","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"128369","Unicode hex":"1F571"},{"Typeface name":"Wingdings","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"127987","Unicode hex":"1F3F3"},{"Typeface name":"Wingdings","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"127985","Unicode hex":"1F3F1"},{"Typeface name":"Wingdings","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"9992","Unicode hex":"2708"},{"Typeface name":"Wingdings","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"9788","Unicode hex":"263C"},{"Typeface name":"Wingdings","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"127778","Unicode hex":"1F322"},{"Typeface name":"Wingdings","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"10052","Unicode hex":"2744"},{"Typeface name":"Wingdings","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"128326","Unicode hex":"1F546"},{"Typeface name":"Wingdings","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"10014","Unicode hex":"271E"},{"Typeface name":"Wingdings","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"128328","Unicode hex":"1F548"},{"Typeface name":"Wingdings","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"10016","Unicode hex":"2720"},{"Typeface name":"Wingdings","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"10017","Unicode hex":"2721"},{"Typeface name":"Wingdings","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"9770","Unicode hex":"262A"},{"Typeface name":"Wingdings","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"9775","Unicode hex":"262F"},{"Typeface name":"Wingdings","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"128329","Unicode hex":"1F549"},{"Typeface name":"Wingdings","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"9784","Unicode hex":"2638"},{"Typeface name":"Wingdings","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"9800","Unicode hex":"2648"},{"Typeface name":"Wingdings","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"9801","Unicode hex":"2649"},{"Typeface name":"Wingdings","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"9802","Unicode hex":"264A"},{"Typeface name":"Wingdings","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"9803","Unicode hex":"264B"},{"Typeface name":"Wingdings","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"9804","Unicode hex":"264C"},{"Typeface name":"Wingdings","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"9805","Unicode hex":"264D"},{"Typeface name":"Wingdings","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"9806","Unicode hex":"264E"},{"Typeface name":"Wingdings","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"9807","Unicode hex":"264F"},{"Typeface name":"Wingdings","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"9808","Unicode hex":"2650"},{"Typeface name":"Wingdings","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"9809","Unicode hex":"2651"},{"Typeface name":"Wingdings","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"9810","Unicode hex":"2652"},{"Typeface name":"Wingdings","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"9811","Unicode hex":"2653"},{"Typeface name":"Wingdings","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"128624","Unicode hex":"1F670"},{"Typeface name":"Wingdings","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"128629","Unicode hex":"1F675"},{"Typeface name":"Wingdings","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"9899","Unicode hex":"26AB"},{"Typeface name":"Wingdings","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"128318","Unicode hex":"1F53E"},{"Typeface name":"Wingdings","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"9724","Unicode hex":"25FC"},{"Typeface name":"Wingdings","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"128911","Unicode hex":"1F78F"},{"Typeface name":"Wingdings","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"128912","Unicode hex":"1F790"},{"Typeface name":"Wingdings","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"10065","Unicode hex":"2751"},{"Typeface name":"Wingdings","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"10066","Unicode hex":"2752"},{"Typeface name":"Wingdings","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"128927","Unicode hex":"1F79F"},{"Typeface name":"Wingdings","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"10731","Unicode hex":"29EB"},{"Typeface name":"Wingdings","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"9670","Unicode hex":"25C6"},{"Typeface name":"Wingdings","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"10070","Unicode hex":"2756"},{"Typeface name":"Wingdings","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"11049","Unicode hex":"2B29"},{"Typeface name":"Wingdings","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"8999","Unicode hex":"2327"},{"Typeface name":"Wingdings","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"11193","Unicode hex":"2BB9"},{"Typeface name":"Wingdings","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"8984","Unicode hex":"2318"},{"Typeface name":"Wingdings","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"127989","Unicode hex":"1F3F5"},{"Typeface name":"Wingdings","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"127990","Unicode hex":"1F3F6"},{"Typeface name":"Wingdings","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"128630","Unicode hex":"1F676"},{"Typeface name":"Wingdings","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"128631","Unicode hex":"1F677"},{"Typeface name":"Wingdings","Dingbat dec":"127","Dingbat hex":"7F","Unicode dec":"9647","Unicode hex":"25AF"},{"Typeface name":"Wingdings","Dingbat dec":"128","Dingbat hex":"80","Unicode dec":"127243","Unicode hex":"1F10B"},{"Typeface name":"Wingdings","Dingbat dec":"129","Dingbat hex":"81","Unicode dec":"10112","Unicode hex":"2780"},{"Typeface name":"Wingdings","Dingbat dec":"130","Dingbat hex":"82","Unicode dec":"10113","Unicode hex":"2781"},{"Typeface name":"Wingdings","Dingbat dec":"131","Dingbat hex":"83","Unicode dec":"10114","Unicode hex":"2782"},{"Typeface name":"Wingdings","Dingbat dec":"132","Dingbat hex":"84","Unicode dec":"10115","Unicode hex":"2783"},{"Typeface name":"Wingdings","Dingbat dec":"133","Dingbat hex":"85","Unicode dec":"10116","Unicode hex":"2784"},{"Typeface name":"Wingdings","Dingbat dec":"134","Dingbat hex":"86","Unicode dec":"10117","Unicode hex":"2785"},{"Typeface name":"Wingdings","Dingbat dec":"135","Dingbat hex":"87","Unicode dec":"10118","Unicode hex":"2786"},{"Typeface name":"Wingdings","Dingbat dec":"136","Dingbat hex":"88","Unicode dec":"10119","Unicode hex":"2787"},{"Typeface name":"Wingdings","Dingbat dec":"137","Dingbat hex":"89","Unicode dec":"10120","Unicode hex":"2788"},{"Typeface name":"Wingdings","Dingbat dec":"138","Dingbat hex":"8A","Unicode dec":"10121","Unicode hex":"2789"},{"Typeface name":"Wingdings","Dingbat dec":"139","Dingbat hex":"8B","Unicode dec":"127244","Unicode hex":"1F10C"},{"Typeface name":"Wingdings","Dingbat dec":"140","Dingbat hex":"8C","Unicode dec":"10122","Unicode hex":"278A"},{"Typeface name":"Wingdings","Dingbat dec":"141","Dingbat hex":"8D","Unicode dec":"10123","Unicode hex":"278B"},{"Typeface name":"Wingdings","Dingbat dec":"142","Dingbat hex":"8E","Unicode dec":"10124","Unicode hex":"278C"},{"Typeface name":"Wingdings","Dingbat dec":"143","Dingbat hex":"8F","Unicode dec":"10125","Unicode hex":"278D"},{"Typeface name":"Wingdings","Dingbat dec":"144","Dingbat hex":"90","Unicode dec":"10126","Unicode hex":"278E"},{"Typeface name":"Wingdings","Dingbat dec":"145","Dingbat hex":"91","Unicode dec":"10127","Unicode hex":"278F"},{"Typeface name":"Wingdings","Dingbat dec":"146","Dingbat hex":"92","Unicode dec":"10128","Unicode hex":"2790"},{"Typeface name":"Wingdings","Dingbat dec":"147","Dingbat hex":"93","Unicode dec":"10129","Unicode hex":"2791"},{"Typeface name":"Wingdings","Dingbat dec":"148","Dingbat hex":"94","Unicode dec":"10130","Unicode hex":"2792"},{"Typeface name":"Wingdings","Dingbat dec":"149","Dingbat hex":"95","Unicode dec":"10131","Unicode hex":"2793"},{"Typeface name":"Wingdings","Dingbat dec":"150","Dingbat hex":"96","Unicode dec":"128610","Unicode hex":"1F662"},{"Typeface name":"Wingdings","Dingbat dec":"151","Dingbat hex":"97","Unicode dec":"128608","Unicode hex":"1F660"},{"Typeface name":"Wingdings","Dingbat dec":"152","Dingbat hex":"98","Unicode dec":"128609","Unicode hex":"1F661"},{"Typeface name":"Wingdings","Dingbat dec":"153","Dingbat hex":"99","Unicode dec":"128611","Unicode hex":"1F663"},{"Typeface name":"Wingdings","Dingbat dec":"154","Dingbat hex":"9A","Unicode dec":"128606","Unicode hex":"1F65E"},{"Typeface name":"Wingdings","Dingbat dec":"155","Dingbat hex":"9B","Unicode dec":"128604","Unicode hex":"1F65C"},{"Typeface name":"Wingdings","Dingbat dec":"156","Dingbat hex":"9C","Unicode dec":"128605","Unicode hex":"1F65D"},{"Typeface name":"Wingdings","Dingbat dec":"157","Dingbat hex":"9D","Unicode dec":"128607","Unicode hex":"1F65F"},{"Typeface name":"Wingdings","Dingbat dec":"158","Dingbat hex":"9E","Unicode dec":"8729","Unicode hex":"2219"},{"Typeface name":"Wingdings","Dingbat dec":"159","Dingbat hex":"9F","Unicode dec":"8226","Unicode hex":"2022"},{"Typeface name":"Wingdings","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"11037","Unicode hex":"2B1D"},{"Typeface name":"Wingdings","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"11096","Unicode hex":"2B58"},{"Typeface name":"Wingdings","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"128902","Unicode hex":"1F786"},{"Typeface name":"Wingdings","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"128904","Unicode hex":"1F788"},{"Typeface name":"Wingdings","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"128906","Unicode hex":"1F78A"},{"Typeface name":"Wingdings","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"128907","Unicode hex":"1F78B"},{"Typeface name":"Wingdings","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"128319","Unicode hex":"1F53F"},{"Typeface name":"Wingdings","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"9642","Unicode hex":"25AA"},{"Typeface name":"Wingdings","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"128910","Unicode hex":"1F78E"},{"Typeface name":"Wingdings","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"128961","Unicode hex":"1F7C1"},{"Typeface name":"Wingdings","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"128965","Unicode hex":"1F7C5"},{"Typeface name":"Wingdings","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"9733","Unicode hex":"2605"},{"Typeface name":"Wingdings","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"128971","Unicode hex":"1F7CB"},{"Typeface name":"Wingdings","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"128975","Unicode hex":"1F7CF"},{"Typeface name":"Wingdings","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"128979","Unicode hex":"1F7D3"},{"Typeface name":"Wingdings","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"128977","Unicode hex":"1F7D1"},{"Typeface name":"Wingdings","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"11216","Unicode hex":"2BD0"},{"Typeface name":"Wingdings","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"8982","Unicode hex":"2316"},{"Typeface name":"Wingdings","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"11214","Unicode hex":"2BCE"},{"Typeface name":"Wingdings","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"11215","Unicode hex":"2BCF"},{"Typeface name":"Wingdings","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"11217","Unicode hex":"2BD1"},{"Typeface name":"Wingdings","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"10026","Unicode hex":"272A"},{"Typeface name":"Wingdings","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"10032","Unicode hex":"2730"},{"Typeface name":"Wingdings","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"128336","Unicode hex":"1F550"},{"Typeface name":"Wingdings","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"128337","Unicode hex":"1F551"},{"Typeface name":"Wingdings","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"128338","Unicode hex":"1F552"},{"Typeface name":"Wingdings","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"128339","Unicode hex":"1F553"},{"Typeface name":"Wingdings","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"128340","Unicode hex":"1F554"},{"Typeface name":"Wingdings","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"128341","Unicode hex":"1F555"},{"Typeface name":"Wingdings","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"128342","Unicode hex":"1F556"},{"Typeface name":"Wingdings","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"128343","Unicode hex":"1F557"},{"Typeface name":"Wingdings","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"128344","Unicode hex":"1F558"},{"Typeface name":"Wingdings","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"128345","Unicode hex":"1F559"},{"Typeface name":"Wingdings","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"128346","Unicode hex":"1F55A"},{"Typeface name":"Wingdings","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"128347","Unicode hex":"1F55B"},{"Typeface name":"Wingdings","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"11184","Unicode hex":"2BB0"},{"Typeface name":"Wingdings","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"11185","Unicode hex":"2BB1"},{"Typeface name":"Wingdings","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"11186","Unicode hex":"2BB2"},{"Typeface name":"Wingdings","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"11187","Unicode hex":"2BB3"},{"Typeface name":"Wingdings","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"11188","Unicode hex":"2BB4"},{"Typeface name":"Wingdings","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"11189","Unicode hex":"2BB5"},{"Typeface name":"Wingdings","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"11190","Unicode hex":"2BB6"},{"Typeface name":"Wingdings","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"11191","Unicode hex":"2BB7"},{"Typeface name":"Wingdings","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"128618","Unicode hex":"1F66A"},{"Typeface name":"Wingdings","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"128619","Unicode hex":"1F66B"},{"Typeface name":"Wingdings","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"128597","Unicode hex":"1F655"},{"Typeface name":"Wingdings","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"128596","Unicode hex":"1F654"},{"Typeface name":"Wingdings","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"128599","Unicode hex":"1F657"},{"Typeface name":"Wingdings","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"128598","Unicode hex":"1F656"},{"Typeface name":"Wingdings","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"128592","Unicode hex":"1F650"},{"Typeface name":"Wingdings","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"128593","Unicode hex":"1F651"},{"Typeface name":"Wingdings","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"128594","Unicode hex":"1F652"},{"Typeface name":"Wingdings","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"128595","Unicode hex":"1F653"},{"Typeface name":"Wingdings","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"9003","Unicode hex":"232B"},{"Typeface name":"Wingdings","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"8998","Unicode hex":"2326"},{"Typeface name":"Wingdings","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"11160","Unicode hex":"2B98"},{"Typeface name":"Wingdings","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"11162","Unicode hex":"2B9A"},{"Typeface name":"Wingdings","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"11161","Unicode hex":"2B99"},{"Typeface name":"Wingdings","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"11163","Unicode hex":"2B9B"},{"Typeface name":"Wingdings","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"11144","Unicode hex":"2B88"},{"Typeface name":"Wingdings","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"11146","Unicode hex":"2B8A"},{"Typeface name":"Wingdings","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"11145","Unicode hex":"2B89"},{"Typeface name":"Wingdings","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"11147","Unicode hex":"2B8B"},{"Typeface name":"Wingdings","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"129128","Unicode hex":"1F868"},{"Typeface name":"Wingdings","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"129130","Unicode hex":"1F86A"},{"Typeface name":"Wingdings","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"129129","Unicode hex":"1F869"},{"Typeface name":"Wingdings","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"129131","Unicode hex":"1F86B"},{"Typeface name":"Wingdings","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"129132","Unicode hex":"1F86C"},{"Typeface name":"Wingdings","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"129133","Unicode hex":"1F86D"},{"Typeface name":"Wingdings","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"129135","Unicode hex":"1F86F"},{"Typeface name":"Wingdings","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"129134","Unicode hex":"1F86E"},{"Typeface name":"Wingdings","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"129144","Unicode hex":"1F878"},{"Typeface name":"Wingdings","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"129146","Unicode hex":"1F87A"},{"Typeface name":"Wingdings","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"129145","Unicode hex":"1F879"},{"Typeface name":"Wingdings","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"129147","Unicode hex":"1F87B"},{"Typeface name":"Wingdings","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"129148","Unicode hex":"1F87C"},{"Typeface name":"Wingdings","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"129149","Unicode hex":"1F87D"},{"Typeface name":"Wingdings","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"129151","Unicode hex":"1F87F"},{"Typeface name":"Wingdings","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"129150","Unicode hex":"1F87E"},{"Typeface name":"Wingdings","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"8678","Unicode hex":"21E6"},{"Typeface name":"Wingdings","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"8680","Unicode hex":"21E8"},{"Typeface name":"Wingdings","Dingbat dec":"241","Dingbat hex":"F1","Unicode dec":"8679","Unicode hex":"21E7"},{"Typeface name":"Wingdings","Dingbat dec":"242","Dingbat hex":"F2","Unicode dec":"8681","Unicode hex":"21E9"},{"Typeface name":"Wingdings","Dingbat dec":"243","Dingbat hex":"F3","Unicode dec":"11012","Unicode hex":"2B04"},{"Typeface name":"Wingdings","Dingbat dec":"244","Dingbat hex":"F4","Unicode dec":"8691","Unicode hex":"21F3"},{"Typeface name":"Wingdings","Dingbat dec":"245","Dingbat hex":"F5","Unicode dec":"11009","Unicode hex":"2B01"},{"Typeface name":"Wingdings","Dingbat dec":"246","Dingbat hex":"F6","Unicode dec":"11008","Unicode hex":"2B00"},{"Typeface name":"Wingdings","Dingbat dec":"247","Dingbat hex":"F7","Unicode dec":"11011","Unicode hex":"2B03"},{"Typeface name":"Wingdings","Dingbat dec":"248","Dingbat hex":"F8","Unicode dec":"11010","Unicode hex":"2B02"},{"Typeface name":"Wingdings","Dingbat dec":"249","Dingbat hex":"F9","Unicode dec":"129196","Unicode hex":"1F8AC"},{"Typeface name":"Wingdings","Dingbat dec":"250","Dingbat hex":"FA","Unicode dec":"129197","Unicode hex":"1F8AD"},{"Typeface name":"Wingdings","Dingbat dec":"251","Dingbat hex":"FB","Unicode dec":"128502","Unicode hex":"1F5F6"},{"Typeface name":"Wingdings","Dingbat dec":"252","Dingbat hex":"FC","Unicode dec":"10003","Unicode hex":"2713"},{"Typeface name":"Wingdings","Dingbat dec":"253","Dingbat hex":"FD","Unicode dec":"128503","Unicode hex":"1F5F7"},{"Typeface name":"Wingdings","Dingbat dec":"254","Dingbat hex":"FE","Unicode dec":"128505","Unicode hex":"1F5F9"},{"Typeface name":"Wingdings 2","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Wingdings 2","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"128394","Unicode hex":"1F58A"},{"Typeface name":"Wingdings 2","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"128395","Unicode hex":"1F58B"},{"Typeface name":"Wingdings 2","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"128396","Unicode hex":"1F58C"},{"Typeface name":"Wingdings 2","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"128397","Unicode hex":"1F58D"},{"Typeface name":"Wingdings 2","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"9988","Unicode hex":"2704"},{"Typeface name":"Wingdings 2","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"9984","Unicode hex":"2700"},{"Typeface name":"Wingdings 2","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"128382","Unicode hex":"1F57E"},{"Typeface name":"Wingdings 2","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"128381","Unicode hex":"1F57D"},{"Typeface name":"Wingdings 2","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"128453","Unicode hex":"1F5C5"},{"Typeface name":"Wingdings 2","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"128454","Unicode hex":"1F5C6"},{"Typeface name":"Wingdings 2","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"128455","Unicode hex":"1F5C7"},{"Typeface name":"Wingdings 2","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"128456","Unicode hex":"1F5C8"},{"Typeface name":"Wingdings 2","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"128457","Unicode hex":"1F5C9"},{"Typeface name":"Wingdings 2","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"128458","Unicode hex":"1F5CA"},{"Typeface name":"Wingdings 2","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"128459","Unicode hex":"1F5CB"},{"Typeface name":"Wingdings 2","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"128460","Unicode hex":"1F5CC"},{"Typeface name":"Wingdings 2","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"128461","Unicode hex":"1F5CD"},{"Typeface name":"Wingdings 2","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"128203","Unicode hex":"1F4CB"},{"Typeface name":"Wingdings 2","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"128465","Unicode hex":"1F5D1"},{"Typeface name":"Wingdings 2","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"128468","Unicode hex":"1F5D4"},{"Typeface name":"Wingdings 2","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"128437","Unicode hex":"1F5B5"},{"Typeface name":"Wingdings 2","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"128438","Unicode hex":"1F5B6"},{"Typeface name":"Wingdings 2","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"128439","Unicode hex":"1F5B7"},{"Typeface name":"Wingdings 2","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"128440","Unicode hex":"1F5B8"},{"Typeface name":"Wingdings 2","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"128429","Unicode hex":"1F5AD"},{"Typeface name":"Wingdings 2","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"128431","Unicode hex":"1F5AF"},{"Typeface name":"Wingdings 2","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"128433","Unicode hex":"1F5B1"},{"Typeface name":"Wingdings 2","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"128402","Unicode hex":"1F592"},{"Typeface name":"Wingdings 2","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"128403","Unicode hex":"1F593"},{"Typeface name":"Wingdings 2","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"128408","Unicode hex":"1F598"},{"Typeface name":"Wingdings 2","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"128409","Unicode hex":"1F599"},{"Typeface name":"Wingdings 2","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"128410","Unicode hex":"1F59A"},{"Typeface name":"Wingdings 2","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"128411","Unicode hex":"1F59B"},{"Typeface name":"Wingdings 2","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"128072","Unicode hex":"1F448"},{"Typeface name":"Wingdings 2","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"128073","Unicode hex":"1F449"},{"Typeface name":"Wingdings 2","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"128412","Unicode hex":"1F59C"},{"Typeface name":"Wingdings 2","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"128413","Unicode hex":"1F59D"},{"Typeface name":"Wingdings 2","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"128414","Unicode hex":"1F59E"},{"Typeface name":"Wingdings 2","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"128415","Unicode hex":"1F59F"},{"Typeface name":"Wingdings 2","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"128416","Unicode hex":"1F5A0"},{"Typeface name":"Wingdings 2","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"128417","Unicode hex":"1F5A1"},{"Typeface name":"Wingdings 2","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"128070","Unicode hex":"1F446"},{"Typeface name":"Wingdings 2","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"128071","Unicode hex":"1F447"},{"Typeface name":"Wingdings 2","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"128418","Unicode hex":"1F5A2"},{"Typeface name":"Wingdings 2","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"128419","Unicode hex":"1F5A3"},{"Typeface name":"Wingdings 2","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"128401","Unicode hex":"1F591"},{"Typeface name":"Wingdings 2","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"128500","Unicode hex":"1F5F4"},{"Typeface name":"Wingdings 2","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"128504","Unicode hex":"1F5F8"},{"Typeface name":"Wingdings 2","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"128501","Unicode hex":"1F5F5"},{"Typeface name":"Wingdings 2","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"9745","Unicode hex":"2611"},{"Typeface name":"Wingdings 2","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"11197","Unicode hex":"2BBD"},{"Typeface name":"Wingdings 2","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"9746","Unicode hex":"2612"},{"Typeface name":"Wingdings 2","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"11198","Unicode hex":"2BBE"},{"Typeface name":"Wingdings 2","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"11199","Unicode hex":"2BBF"},{"Typeface name":"Wingdings 2","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"128711","Unicode hex":"1F6C7"},{"Typeface name":"Wingdings 2","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"10680","Unicode hex":"29B8"},{"Typeface name":"Wingdings 2","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"128625","Unicode hex":"1F671"},{"Typeface name":"Wingdings 2","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"128628","Unicode hex":"1F674"},{"Typeface name":"Wingdings 2","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"128626","Unicode hex":"1F672"},{"Typeface name":"Wingdings 2","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"128627","Unicode hex":"1F673"},{"Typeface name":"Wingdings 2","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"8253","Unicode hex":"203D"},{"Typeface name":"Wingdings 2","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"128633","Unicode hex":"1F679"},{"Typeface name":"Wingdings 2","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"128634","Unicode hex":"1F67A"},{"Typeface name":"Wingdings 2","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"128635","Unicode hex":"1F67B"},{"Typeface name":"Wingdings 2","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"128614","Unicode hex":"1F666"},{"Typeface name":"Wingdings 2","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"128612","Unicode hex":"1F664"},{"Typeface name":"Wingdings 2","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"128613","Unicode hex":"1F665"},{"Typeface name":"Wingdings 2","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"128615","Unicode hex":"1F667"},{"Typeface name":"Wingdings 2","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"128602","Unicode hex":"1F65A"},{"Typeface name":"Wingdings 2","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"128600","Unicode hex":"1F658"},{"Typeface name":"Wingdings 2","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"128601","Unicode hex":"1F659"},{"Typeface name":"Wingdings 2","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"128603","Unicode hex":"1F65B"},{"Typeface name":"Wingdings 2","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"9450","Unicode hex":"24EA"},{"Typeface name":"Wingdings 2","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"9312","Unicode hex":"2460"},{"Typeface name":"Wingdings 2","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"9313","Unicode hex":"2461"},{"Typeface name":"Wingdings 2","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"9314","Unicode hex":"2462"},{"Typeface name":"Wingdings 2","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"9315","Unicode hex":"2463"},{"Typeface name":"Wingdings 2","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"9316","Unicode hex":"2464"},{"Typeface name":"Wingdings 2","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"9317","Unicode hex":"2465"},{"Typeface name":"Wingdings 2","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"9318","Unicode hex":"2466"},{"Typeface name":"Wingdings 2","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"9319","Unicode hex":"2467"},{"Typeface name":"Wingdings 2","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"9320","Unicode hex":"2468"},{"Typeface name":"Wingdings 2","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"9321","Unicode hex":"2469"},{"Typeface name":"Wingdings 2","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"9471","Unicode hex":"24FF"},{"Typeface name":"Wingdings 2","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"10102","Unicode hex":"2776"},{"Typeface name":"Wingdings 2","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"10103","Unicode hex":"2777"},{"Typeface name":"Wingdings 2","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"10104","Unicode hex":"2778"},{"Typeface name":"Wingdings 2","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"10105","Unicode hex":"2779"},{"Typeface name":"Wingdings 2","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"10106","Unicode hex":"277A"},{"Typeface name":"Wingdings 2","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"10107","Unicode hex":"277B"},{"Typeface name":"Wingdings 2","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"10108","Unicode hex":"277C"},{"Typeface name":"Wingdings 2","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"10109","Unicode hex":"277D"},{"Typeface name":"Wingdings 2","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"10110","Unicode hex":"277E"},{"Typeface name":"Wingdings 2","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"10111","Unicode hex":"277F"},{"Typeface name":"Wingdings 2","Dingbat dec":"128","Dingbat hex":"80","Unicode dec":"9737","Unicode hex":"2609"},{"Typeface name":"Wingdings 2","Dingbat dec":"129","Dingbat hex":"81","Unicode dec":"127765","Unicode hex":"1F315"},{"Typeface name":"Wingdings 2","Dingbat dec":"130","Dingbat hex":"82","Unicode dec":"9789","Unicode hex":"263D"},{"Typeface name":"Wingdings 2","Dingbat dec":"131","Dingbat hex":"83","Unicode dec":"9790","Unicode hex":"263E"},{"Typeface name":"Wingdings 2","Dingbat dec":"132","Dingbat hex":"84","Unicode dec":"11839","Unicode hex":"2E3F"},{"Typeface name":"Wingdings 2","Dingbat dec":"133","Dingbat hex":"85","Unicode dec":"10013","Unicode hex":"271D"},{"Typeface name":"Wingdings 2","Dingbat dec":"134","Dingbat hex":"86","Unicode dec":"128327","Unicode hex":"1F547"},{"Typeface name":"Wingdings 2","Dingbat dec":"135","Dingbat hex":"87","Unicode dec":"128348","Unicode hex":"1F55C"},{"Typeface name":"Wingdings 2","Dingbat dec":"136","Dingbat hex":"88","Unicode dec":"128349","Unicode hex":"1F55D"},{"Typeface name":"Wingdings 2","Dingbat dec":"137","Dingbat hex":"89","Unicode dec":"128350","Unicode hex":"1F55E"},{"Typeface name":"Wingdings 2","Dingbat dec":"138","Dingbat hex":"8A","Unicode dec":"128351","Unicode hex":"1F55F"},{"Typeface name":"Wingdings 2","Dingbat dec":"139","Dingbat hex":"8B","Unicode dec":"128352","Unicode hex":"1F560"},{"Typeface name":"Wingdings 2","Dingbat dec":"140","Dingbat hex":"8C","Unicode dec":"128353","Unicode hex":"1F561"},{"Typeface name":"Wingdings 2","Dingbat dec":"141","Dingbat hex":"8D","Unicode dec":"128354","Unicode hex":"1F562"},{"Typeface name":"Wingdings 2","Dingbat dec":"142","Dingbat hex":"8E","Unicode dec":"128355","Unicode hex":"1F563"},{"Typeface name":"Wingdings 2","Dingbat dec":"143","Dingbat hex":"8F","Unicode dec":"128356","Unicode hex":"1F564"},{"Typeface name":"Wingdings 2","Dingbat dec":"144","Dingbat hex":"90","Unicode dec":"128357","Unicode hex":"1F565"},{"Typeface name":"Wingdings 2","Dingbat dec":"145","Dingbat hex":"91","Unicode dec":"128358","Unicode hex":"1F566"},{"Typeface name":"Wingdings 2","Dingbat dec":"146","Dingbat hex":"92","Unicode dec":"128359","Unicode hex":"1F567"},{"Typeface name":"Wingdings 2","Dingbat dec":"147","Dingbat hex":"93","Unicode dec":"128616","Unicode hex":"1F668"},{"Typeface name":"Wingdings 2","Dingbat dec":"148","Dingbat hex":"94","Unicode dec":"128617","Unicode hex":"1F669"},{"Typeface name":"Wingdings 2","Dingbat dec":"149","Dingbat hex":"95","Unicode dec":"8901","Unicode hex":"22C5"},{"Typeface name":"Wingdings 2","Dingbat dec":"150","Dingbat hex":"96","Unicode dec":"128900","Unicode hex":"1F784"},{"Typeface name":"Wingdings 2","Dingbat dec":"151","Dingbat hex":"97","Unicode dec":"10625","Unicode hex":"2981"},{"Typeface name":"Wingdings 2","Dingbat dec":"152","Dingbat hex":"98","Unicode dec":"9679","Unicode hex":"25CF"},{"Typeface name":"Wingdings 2","Dingbat dec":"153","Dingbat hex":"99","Unicode dec":"9675","Unicode hex":"25CB"},{"Typeface name":"Wingdings 2","Dingbat dec":"154","Dingbat hex":"9A","Unicode dec":"128901","Unicode hex":"1F785"},{"Typeface name":"Wingdings 2","Dingbat dec":"155","Dingbat hex":"9B","Unicode dec":"128903","Unicode hex":"1F787"},{"Typeface name":"Wingdings 2","Dingbat dec":"156","Dingbat hex":"9C","Unicode dec":"128905","Unicode hex":"1F789"},{"Typeface name":"Wingdings 2","Dingbat dec":"157","Dingbat hex":"9D","Unicode dec":"8857","Unicode hex":"2299"},{"Typeface name":"Wingdings 2","Dingbat dec":"158","Dingbat hex":"9E","Unicode dec":"10687","Unicode hex":"29BF"},{"Typeface name":"Wingdings 2","Dingbat dec":"159","Dingbat hex":"9F","Unicode dec":"128908","Unicode hex":"1F78C"},{"Typeface name":"Wingdings 2","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"128909","Unicode hex":"1F78D"},{"Typeface name":"Wingdings 2","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"9726","Unicode hex":"25FE"},{"Typeface name":"Wingdings 2","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"9632","Unicode hex":"25A0"},{"Typeface name":"Wingdings 2","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"9633","Unicode hex":"25A1"},{"Typeface name":"Wingdings 2","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"128913","Unicode hex":"1F791"},{"Typeface name":"Wingdings 2","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"128914","Unicode hex":"1F792"},{"Typeface name":"Wingdings 2","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"128915","Unicode hex":"1F793"},{"Typeface name":"Wingdings 2","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"128916","Unicode hex":"1F794"},{"Typeface name":"Wingdings 2","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"9635","Unicode hex":"25A3"},{"Typeface name":"Wingdings 2","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"128917","Unicode hex":"1F795"},{"Typeface name":"Wingdings 2","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"128918","Unicode hex":"1F796"},{"Typeface name":"Wingdings 2","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"128919","Unicode hex":"1F797"},{"Typeface name":"Wingdings 2","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"128920","Unicode hex":"1F798"},{"Typeface name":"Wingdings 2","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"11049","Unicode hex":"2B29"},{"Typeface name":"Wingdings 2","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"11045","Unicode hex":"2B25"},{"Typeface name":"Wingdings 2","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"9671","Unicode hex":"25C7"},{"Typeface name":"Wingdings 2","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"128922","Unicode hex":"1F79A"},{"Typeface name":"Wingdings 2","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"9672","Unicode hex":"25C8"},{"Typeface name":"Wingdings 2","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"128923","Unicode hex":"1F79B"},{"Typeface name":"Wingdings 2","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"128924","Unicode hex":"1F79C"},{"Typeface name":"Wingdings 2","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"128925","Unicode hex":"1F79D"},{"Typeface name":"Wingdings 2","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"128926","Unicode hex":"1F79E"},{"Typeface name":"Wingdings 2","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"11050","Unicode hex":"2B2A"},{"Typeface name":"Wingdings 2","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"11047","Unicode hex":"2B27"},{"Typeface name":"Wingdings 2","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"9674","Unicode hex":"25CA"},{"Typeface name":"Wingdings 2","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"128928","Unicode hex":"1F7A0"},{"Typeface name":"Wingdings 2","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"9686","Unicode hex":"25D6"},{"Typeface name":"Wingdings 2","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"9687","Unicode hex":"25D7"},{"Typeface name":"Wingdings 2","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"11210","Unicode hex":"2BCA"},{"Typeface name":"Wingdings 2","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"11211","Unicode hex":"2BCB"},{"Typeface name":"Wingdings 2","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"11200","Unicode hex":"2BC0"},{"Typeface name":"Wingdings 2","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"11201","Unicode hex":"2BC1"},{"Typeface name":"Wingdings 2","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"11039","Unicode hex":"2B1F"},{"Typeface name":"Wingdings 2","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"11202","Unicode hex":"2BC2"},{"Typeface name":"Wingdings 2","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"11043","Unicode hex":"2B23"},{"Typeface name":"Wingdings 2","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"11042","Unicode hex":"2B22"},{"Typeface name":"Wingdings 2","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"11203","Unicode hex":"2BC3"},{"Typeface name":"Wingdings 2","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"11204","Unicode hex":"2BC4"},{"Typeface name":"Wingdings 2","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"128929","Unicode hex":"1F7A1"},{"Typeface name":"Wingdings 2","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"128930","Unicode hex":"1F7A2"},{"Typeface name":"Wingdings 2","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"128931","Unicode hex":"1F7A3"},{"Typeface name":"Wingdings 2","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"128932","Unicode hex":"1F7A4"},{"Typeface name":"Wingdings 2","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"128933","Unicode hex":"1F7A5"},{"Typeface name":"Wingdings 2","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"128934","Unicode hex":"1F7A6"},{"Typeface name":"Wingdings 2","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"128935","Unicode hex":"1F7A7"},{"Typeface name":"Wingdings 2","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"128936","Unicode hex":"1F7A8"},{"Typeface name":"Wingdings 2","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"128937","Unicode hex":"1F7A9"},{"Typeface name":"Wingdings 2","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"128938","Unicode hex":"1F7AA"},{"Typeface name":"Wingdings 2","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"128939","Unicode hex":"1F7AB"},{"Typeface name":"Wingdings 2","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"128940","Unicode hex":"1F7AC"},{"Typeface name":"Wingdings 2","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"128941","Unicode hex":"1F7AD"},{"Typeface name":"Wingdings 2","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"128942","Unicode hex":"1F7AE"},{"Typeface name":"Wingdings 2","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"128943","Unicode hex":"1F7AF"},{"Typeface name":"Wingdings 2","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"128944","Unicode hex":"1F7B0"},{"Typeface name":"Wingdings 2","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"128945","Unicode hex":"1F7B1"},{"Typeface name":"Wingdings 2","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"128946","Unicode hex":"1F7B2"},{"Typeface name":"Wingdings 2","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"128947","Unicode hex":"1F7B3"},{"Typeface name":"Wingdings 2","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"128948","Unicode hex":"1F7B4"},{"Typeface name":"Wingdings 2","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"128949","Unicode hex":"1F7B5"},{"Typeface name":"Wingdings 2","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"128950","Unicode hex":"1F7B6"},{"Typeface name":"Wingdings 2","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"128951","Unicode hex":"1F7B7"},{"Typeface name":"Wingdings 2","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"128952","Unicode hex":"1F7B8"},{"Typeface name":"Wingdings 2","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"128953","Unicode hex":"1F7B9"},{"Typeface name":"Wingdings 2","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"128954","Unicode hex":"1F7BA"},{"Typeface name":"Wingdings 2","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"128955","Unicode hex":"1F7BB"},{"Typeface name":"Wingdings 2","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"128956","Unicode hex":"1F7BC"},{"Typeface name":"Wingdings 2","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"128957","Unicode hex":"1F7BD"},{"Typeface name":"Wingdings 2","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"128958","Unicode hex":"1F7BE"},{"Typeface name":"Wingdings 2","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"128959","Unicode hex":"1F7BF"},{"Typeface name":"Wingdings 2","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"128960","Unicode hex":"1F7C0"},{"Typeface name":"Wingdings 2","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"128962","Unicode hex":"1F7C2"},{"Typeface name":"Wingdings 2","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"128964","Unicode hex":"1F7C4"},{"Typeface name":"Wingdings 2","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"128966","Unicode hex":"1F7C6"},{"Typeface name":"Wingdings 2","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"128969","Unicode hex":"1F7C9"},{"Typeface name":"Wingdings 2","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"128970","Unicode hex":"1F7CA"},{"Typeface name":"Wingdings 2","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"10038","Unicode hex":"2736"},{"Typeface name":"Wingdings 2","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"128972","Unicode hex":"1F7CC"},{"Typeface name":"Wingdings 2","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"128974","Unicode hex":"1F7CE"},{"Typeface name":"Wingdings 2","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"128976","Unicode hex":"1F7D0"},{"Typeface name":"Wingdings 2","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"128978","Unicode hex":"1F7D2"},{"Typeface name":"Wingdings 2","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"10041","Unicode hex":"2739"},{"Typeface name":"Wingdings 2","Dingbat dec":"241","Dingbat hex":"F1","Unicode dec":"128963","Unicode hex":"1F7C3"},{"Typeface name":"Wingdings 2","Dingbat dec":"242","Dingbat hex":"F2","Unicode dec":"128967","Unicode hex":"1F7C7"},{"Typeface name":"Wingdings 2","Dingbat dec":"243","Dingbat hex":"F3","Unicode dec":"10031","Unicode hex":"272F"},{"Typeface name":"Wingdings 2","Dingbat dec":"244","Dingbat hex":"F4","Unicode dec":"128973","Unicode hex":"1F7CD"},{"Typeface name":"Wingdings 2","Dingbat dec":"245","Dingbat hex":"F5","Unicode dec":"128980","Unicode hex":"1F7D4"},{"Typeface name":"Wingdings 2","Dingbat dec":"246","Dingbat hex":"F6","Unicode dec":"11212","Unicode hex":"2BCC"},{"Typeface name":"Wingdings 2","Dingbat dec":"247","Dingbat hex":"F7","Unicode dec":"11213","Unicode hex":"2BCD"},{"Typeface name":"Wingdings 2","Dingbat dec":"248","Dingbat hex":"F8","Unicode dec":"8251","Unicode hex":"203B"},{"Typeface name":"Wingdings 2","Dingbat dec":"249","Dingbat hex":"F9","Unicode dec":"8258","Unicode hex":"2042"},{"Typeface name":"Wingdings 3","Dingbat dec":"32","Dingbat hex":"20","Unicode dec":"32","Unicode hex":"20"},{"Typeface name":"Wingdings 3","Dingbat dec":"33","Dingbat hex":"21","Unicode dec":"11104","Unicode hex":"2B60"},{"Typeface name":"Wingdings 3","Dingbat dec":"34","Dingbat hex":"22","Unicode dec":"11106","Unicode hex":"2B62"},{"Typeface name":"Wingdings 3","Dingbat dec":"35","Dingbat hex":"23","Unicode dec":"11105","Unicode hex":"2B61"},{"Typeface name":"Wingdings 3","Dingbat dec":"36","Dingbat hex":"24","Unicode dec":"11107","Unicode hex":"2B63"},{"Typeface name":"Wingdings 3","Dingbat dec":"37","Dingbat hex":"25","Unicode dec":"11110","Unicode hex":"2B66"},{"Typeface name":"Wingdings 3","Dingbat dec":"38","Dingbat hex":"26","Unicode dec":"11111","Unicode hex":"2B67"},{"Typeface name":"Wingdings 3","Dingbat dec":"39","Dingbat hex":"27","Unicode dec":"11113","Unicode hex":"2B69"},{"Typeface name":"Wingdings 3","Dingbat dec":"40","Dingbat hex":"28","Unicode dec":"11112","Unicode hex":"2B68"},{"Typeface name":"Wingdings 3","Dingbat dec":"41","Dingbat hex":"29","Unicode dec":"11120","Unicode hex":"2B70"},{"Typeface name":"Wingdings 3","Dingbat dec":"42","Dingbat hex":"2A","Unicode dec":"11122","Unicode hex":"2B72"},{"Typeface name":"Wingdings 3","Dingbat dec":"43","Dingbat hex":"2B","Unicode dec":"11121","Unicode hex":"2B71"},{"Typeface name":"Wingdings 3","Dingbat dec":"44","Dingbat hex":"2C","Unicode dec":"11123","Unicode hex":"2B73"},{"Typeface name":"Wingdings 3","Dingbat dec":"45","Dingbat hex":"2D","Unicode dec":"11126","Unicode hex":"2B76"},{"Typeface name":"Wingdings 3","Dingbat dec":"46","Dingbat hex":"2E","Unicode dec":"11128","Unicode hex":"2B78"},{"Typeface name":"Wingdings 3","Dingbat dec":"47","Dingbat hex":"2F","Unicode dec":"11131","Unicode hex":"2B7B"},{"Typeface name":"Wingdings 3","Dingbat dec":"48","Dingbat hex":"30","Unicode dec":"11133","Unicode hex":"2B7D"},{"Typeface name":"Wingdings 3","Dingbat dec":"49","Dingbat hex":"31","Unicode dec":"11108","Unicode hex":"2B64"},{"Typeface name":"Wingdings 3","Dingbat dec":"50","Dingbat hex":"32","Unicode dec":"11109","Unicode hex":"2B65"},{"Typeface name":"Wingdings 3","Dingbat dec":"51","Dingbat hex":"33","Unicode dec":"11114","Unicode hex":"2B6A"},{"Typeface name":"Wingdings 3","Dingbat dec":"52","Dingbat hex":"34","Unicode dec":"11116","Unicode hex":"2B6C"},{"Typeface name":"Wingdings 3","Dingbat dec":"53","Dingbat hex":"35","Unicode dec":"11115","Unicode hex":"2B6B"},{"Typeface name":"Wingdings 3","Dingbat dec":"54","Dingbat hex":"36","Unicode dec":"11117","Unicode hex":"2B6D"},{"Typeface name":"Wingdings 3","Dingbat dec":"55","Dingbat hex":"37","Unicode dec":"11085","Unicode hex":"2B4D"},{"Typeface name":"Wingdings 3","Dingbat dec":"56","Dingbat hex":"38","Unicode dec":"11168","Unicode hex":"2BA0"},{"Typeface name":"Wingdings 3","Dingbat dec":"57","Dingbat hex":"39","Unicode dec":"11169","Unicode hex":"2BA1"},{"Typeface name":"Wingdings 3","Dingbat dec":"58","Dingbat hex":"3A","Unicode dec":"11170","Unicode hex":"2BA2"},{"Typeface name":"Wingdings 3","Dingbat dec":"59","Dingbat hex":"3B","Unicode dec":"11171","Unicode hex":"2BA3"},{"Typeface name":"Wingdings 3","Dingbat dec":"60","Dingbat hex":"3C","Unicode dec":"11172","Unicode hex":"2BA4"},{"Typeface name":"Wingdings 3","Dingbat dec":"61","Dingbat hex":"3D","Unicode dec":"11173","Unicode hex":"2BA5"},{"Typeface name":"Wingdings 3","Dingbat dec":"62","Dingbat hex":"3E","Unicode dec":"11174","Unicode hex":"2BA6"},{"Typeface name":"Wingdings 3","Dingbat dec":"63","Dingbat hex":"3F","Unicode dec":"11175","Unicode hex":"2BA7"},{"Typeface name":"Wingdings 3","Dingbat dec":"64","Dingbat hex":"40","Unicode dec":"11152","Unicode hex":"2B90"},{"Typeface name":"Wingdings 3","Dingbat dec":"65","Dingbat hex":"41","Unicode dec":"11153","Unicode hex":"2B91"},{"Typeface name":"Wingdings 3","Dingbat dec":"66","Dingbat hex":"42","Unicode dec":"11154","Unicode hex":"2B92"},{"Typeface name":"Wingdings 3","Dingbat dec":"67","Dingbat hex":"43","Unicode dec":"11155","Unicode hex":"2B93"},{"Typeface name":"Wingdings 3","Dingbat dec":"68","Dingbat hex":"44","Unicode dec":"11136","Unicode hex":"2B80"},{"Typeface name":"Wingdings 3","Dingbat dec":"69","Dingbat hex":"45","Unicode dec":"11139","Unicode hex":"2B83"},{"Typeface name":"Wingdings 3","Dingbat dec":"70","Dingbat hex":"46","Unicode dec":"11134","Unicode hex":"2B7E"},{"Typeface name":"Wingdings 3","Dingbat dec":"71","Dingbat hex":"47","Unicode dec":"11135","Unicode hex":"2B7F"},{"Typeface name":"Wingdings 3","Dingbat dec":"72","Dingbat hex":"48","Unicode dec":"11140","Unicode hex":"2B84"},{"Typeface name":"Wingdings 3","Dingbat dec":"73","Dingbat hex":"49","Unicode dec":"11142","Unicode hex":"2B86"},{"Typeface name":"Wingdings 3","Dingbat dec":"74","Dingbat hex":"4A","Unicode dec":"11141","Unicode hex":"2B85"},{"Typeface name":"Wingdings 3","Dingbat dec":"75","Dingbat hex":"4B","Unicode dec":"11143","Unicode hex":"2B87"},{"Typeface name":"Wingdings 3","Dingbat dec":"76","Dingbat hex":"4C","Unicode dec":"11151","Unicode hex":"2B8F"},{"Typeface name":"Wingdings 3","Dingbat dec":"77","Dingbat hex":"4D","Unicode dec":"11149","Unicode hex":"2B8D"},{"Typeface name":"Wingdings 3","Dingbat dec":"78","Dingbat hex":"4E","Unicode dec":"11150","Unicode hex":"2B8E"},{"Typeface name":"Wingdings 3","Dingbat dec":"79","Dingbat hex":"4F","Unicode dec":"11148","Unicode hex":"2B8C"},{"Typeface name":"Wingdings 3","Dingbat dec":"80","Dingbat hex":"50","Unicode dec":"11118","Unicode hex":"2B6E"},{"Typeface name":"Wingdings 3","Dingbat dec":"81","Dingbat hex":"51","Unicode dec":"11119","Unicode hex":"2B6F"},{"Typeface name":"Wingdings 3","Dingbat dec":"82","Dingbat hex":"52","Unicode dec":"9099","Unicode hex":"238B"},{"Typeface name":"Wingdings 3","Dingbat dec":"83","Dingbat hex":"53","Unicode dec":"8996","Unicode hex":"2324"},{"Typeface name":"Wingdings 3","Dingbat dec":"84","Dingbat hex":"54","Unicode dec":"8963","Unicode hex":"2303"},{"Typeface name":"Wingdings 3","Dingbat dec":"85","Dingbat hex":"55","Unicode dec":"8997","Unicode hex":"2325"},{"Typeface name":"Wingdings 3","Dingbat dec":"86","Dingbat hex":"56","Unicode dec":"9251","Unicode hex":"2423"},{"Typeface name":"Wingdings 3","Dingbat dec":"87","Dingbat hex":"57","Unicode dec":"9085","Unicode hex":"237D"},{"Typeface name":"Wingdings 3","Dingbat dec":"88","Dingbat hex":"58","Unicode dec":"8682","Unicode hex":"21EA"},{"Typeface name":"Wingdings 3","Dingbat dec":"89","Dingbat hex":"59","Unicode dec":"11192","Unicode hex":"2BB8"},{"Typeface name":"Wingdings 3","Dingbat dec":"90","Dingbat hex":"5A","Unicode dec":"129184","Unicode hex":"1F8A0"},{"Typeface name":"Wingdings 3","Dingbat dec":"91","Dingbat hex":"5B","Unicode dec":"129185","Unicode hex":"1F8A1"},{"Typeface name":"Wingdings 3","Dingbat dec":"92","Dingbat hex":"5C","Unicode dec":"129186","Unicode hex":"1F8A2"},{"Typeface name":"Wingdings 3","Dingbat dec":"93","Dingbat hex":"5D","Unicode dec":"129187","Unicode hex":"1F8A3"},{"Typeface name":"Wingdings 3","Dingbat dec":"94","Dingbat hex":"5E","Unicode dec":"129188","Unicode hex":"1F8A4"},{"Typeface name":"Wingdings 3","Dingbat dec":"95","Dingbat hex":"5F","Unicode dec":"129189","Unicode hex":"1F8A5"},{"Typeface name":"Wingdings 3","Dingbat dec":"96","Dingbat hex":"60","Unicode dec":"129190","Unicode hex":"1F8A6"},{"Typeface name":"Wingdings 3","Dingbat dec":"97","Dingbat hex":"61","Unicode dec":"129191","Unicode hex":"1F8A7"},{"Typeface name":"Wingdings 3","Dingbat dec":"98","Dingbat hex":"62","Unicode dec":"129192","Unicode hex":"1F8A8"},{"Typeface name":"Wingdings 3","Dingbat dec":"99","Dingbat hex":"63","Unicode dec":"129193","Unicode hex":"1F8A9"},{"Typeface name":"Wingdings 3","Dingbat dec":"100","Dingbat hex":"64","Unicode dec":"129194","Unicode hex":"1F8AA"},{"Typeface name":"Wingdings 3","Dingbat dec":"101","Dingbat hex":"65","Unicode dec":"129195","Unicode hex":"1F8AB"},{"Typeface name":"Wingdings 3","Dingbat dec":"102","Dingbat hex":"66","Unicode dec":"129104","Unicode hex":"1F850"},{"Typeface name":"Wingdings 3","Dingbat dec":"103","Dingbat hex":"67","Unicode dec":"129106","Unicode hex":"1F852"},{"Typeface name":"Wingdings 3","Dingbat dec":"104","Dingbat hex":"68","Unicode dec":"129105","Unicode hex":"1F851"},{"Typeface name":"Wingdings 3","Dingbat dec":"105","Dingbat hex":"69","Unicode dec":"129107","Unicode hex":"1F853"},{"Typeface name":"Wingdings 3","Dingbat dec":"106","Dingbat hex":"6A","Unicode dec":"129108","Unicode hex":"1F854"},{"Typeface name":"Wingdings 3","Dingbat dec":"107","Dingbat hex":"6B","Unicode dec":"129109","Unicode hex":"1F855"},{"Typeface name":"Wingdings 3","Dingbat dec":"108","Dingbat hex":"6C","Unicode dec":"129111","Unicode hex":"1F857"},{"Typeface name":"Wingdings 3","Dingbat dec":"109","Dingbat hex":"6D","Unicode dec":"129110","Unicode hex":"1F856"},{"Typeface name":"Wingdings 3","Dingbat dec":"110","Dingbat hex":"6E","Unicode dec":"129112","Unicode hex":"1F858"},{"Typeface name":"Wingdings 3","Dingbat dec":"111","Dingbat hex":"6F","Unicode dec":"129113","Unicode hex":"1F859"},{"Typeface name":"Wingdings 3","Dingbat dec":"112","Dingbat hex":"70","Unicode dec":"9650","Unicode hex":"25B2"},{"Typeface name":"Wingdings 3","Dingbat dec":"113","Dingbat hex":"71","Unicode dec":"9660","Unicode hex":"25BC"},{"Typeface name":"Wingdings 3","Dingbat dec":"114","Dingbat hex":"72","Unicode dec":"9651","Unicode hex":"25B3"},{"Typeface name":"Wingdings 3","Dingbat dec":"115","Dingbat hex":"73","Unicode dec":"9661","Unicode hex":"25BD"},{"Typeface name":"Wingdings 3","Dingbat dec":"116","Dingbat hex":"74","Unicode dec":"9664","Unicode hex":"25C0"},{"Typeface name":"Wingdings 3","Dingbat dec":"117","Dingbat hex":"75","Unicode dec":"9654","Unicode hex":"25B6"},{"Typeface name":"Wingdings 3","Dingbat dec":"118","Dingbat hex":"76","Unicode dec":"9665","Unicode hex":"25C1"},{"Typeface name":"Wingdings 3","Dingbat dec":"119","Dingbat hex":"77","Unicode dec":"9655","Unicode hex":"25B7"},{"Typeface name":"Wingdings 3","Dingbat dec":"120","Dingbat hex":"78","Unicode dec":"9699","Unicode hex":"25E3"},{"Typeface name":"Wingdings 3","Dingbat dec":"121","Dingbat hex":"79","Unicode dec":"9698","Unicode hex":"25E2"},{"Typeface name":"Wingdings 3","Dingbat dec":"122","Dingbat hex":"7A","Unicode dec":"9700","Unicode hex":"25E4"},{"Typeface name":"Wingdings 3","Dingbat dec":"123","Dingbat hex":"7B","Unicode dec":"9701","Unicode hex":"25E5"},{"Typeface name":"Wingdings 3","Dingbat dec":"124","Dingbat hex":"7C","Unicode dec":"128896","Unicode hex":"1F780"},{"Typeface name":"Wingdings 3","Dingbat dec":"125","Dingbat hex":"7D","Unicode dec":"128898","Unicode hex":"1F782"},{"Typeface name":"Wingdings 3","Dingbat dec":"126","Dingbat hex":"7E","Unicode dec":"128897","Unicode hex":"1F781"},{"Typeface name":"Wingdings 3","Dingbat dec":"128","Dingbat hex":"80","Unicode dec":"128899","Unicode hex":"1F783"},{"Typeface name":"Wingdings 3","Dingbat dec":"129","Dingbat hex":"81","Unicode dec":"11205","Unicode hex":"2BC5"},{"Typeface name":"Wingdings 3","Dingbat dec":"130","Dingbat hex":"82","Unicode dec":"11206","Unicode hex":"2BC6"},{"Typeface name":"Wingdings 3","Dingbat dec":"131","Dingbat hex":"83","Unicode dec":"11207","Unicode hex":"2BC7"},{"Typeface name":"Wingdings 3","Dingbat dec":"132","Dingbat hex":"84","Unicode dec":"11208","Unicode hex":"2BC8"},{"Typeface name":"Wingdings 3","Dingbat dec":"133","Dingbat hex":"85","Unicode dec":"11164","Unicode hex":"2B9C"},{"Typeface name":"Wingdings 3","Dingbat dec":"134","Dingbat hex":"86","Unicode dec":"11166","Unicode hex":"2B9E"},{"Typeface name":"Wingdings 3","Dingbat dec":"135","Dingbat hex":"87","Unicode dec":"11165","Unicode hex":"2B9D"},{"Typeface name":"Wingdings 3","Dingbat dec":"136","Dingbat hex":"88","Unicode dec":"11167","Unicode hex":"2B9F"},{"Typeface name":"Wingdings 3","Dingbat dec":"137","Dingbat hex":"89","Unicode dec":"129040","Unicode hex":"1F810"},{"Typeface name":"Wingdings 3","Dingbat dec":"138","Dingbat hex":"8A","Unicode dec":"129042","Unicode hex":"1F812"},{"Typeface name":"Wingdings 3","Dingbat dec":"139","Dingbat hex":"8B","Unicode dec":"129041","Unicode hex":"1F811"},{"Typeface name":"Wingdings 3","Dingbat dec":"140","Dingbat hex":"8C","Unicode dec":"129043","Unicode hex":"1F813"},{"Typeface name":"Wingdings 3","Dingbat dec":"141","Dingbat hex":"8D","Unicode dec":"129044","Unicode hex":"1F814"},{"Typeface name":"Wingdings 3","Dingbat dec":"142","Dingbat hex":"8E","Unicode dec":"129046","Unicode hex":"1F816"},{"Typeface name":"Wingdings 3","Dingbat dec":"143","Dingbat hex":"8F","Unicode dec":"129045","Unicode hex":"1F815"},{"Typeface name":"Wingdings 3","Dingbat dec":"144","Dingbat hex":"90","Unicode dec":"129047","Unicode hex":"1F817"},{"Typeface name":"Wingdings 3","Dingbat dec":"145","Dingbat hex":"91","Unicode dec":"129048","Unicode hex":"1F818"},{"Typeface name":"Wingdings 3","Dingbat dec":"146","Dingbat hex":"92","Unicode dec":"129050","Unicode hex":"1F81A"},{"Typeface name":"Wingdings 3","Dingbat dec":"147","Dingbat hex":"93","Unicode dec":"129049","Unicode hex":"1F819"},{"Typeface name":"Wingdings 3","Dingbat dec":"148","Dingbat hex":"94","Unicode dec":"129051","Unicode hex":"1F81B"},{"Typeface name":"Wingdings 3","Dingbat dec":"149","Dingbat hex":"95","Unicode dec":"129052","Unicode hex":"1F81C"},{"Typeface name":"Wingdings 3","Dingbat dec":"150","Dingbat hex":"96","Unicode dec":"129054","Unicode hex":"1F81E"},{"Typeface name":"Wingdings 3","Dingbat dec":"151","Dingbat hex":"97","Unicode dec":"129053","Unicode hex":"1F81D"},{"Typeface name":"Wingdings 3","Dingbat dec":"152","Dingbat hex":"98","Unicode dec":"129055","Unicode hex":"1F81F"},{"Typeface name":"Wingdings 3","Dingbat dec":"153","Dingbat hex":"99","Unicode dec":"129024","Unicode hex":"1F800"},{"Typeface name":"Wingdings 3","Dingbat dec":"154","Dingbat hex":"9A","Unicode dec":"129026","Unicode hex":"1F802"},{"Typeface name":"Wingdings 3","Dingbat dec":"155","Dingbat hex":"9B","Unicode dec":"129025","Unicode hex":"1F801"},{"Typeface name":"Wingdings 3","Dingbat dec":"156","Dingbat hex":"9C","Unicode dec":"129027","Unicode hex":"1F803"},{"Typeface name":"Wingdings 3","Dingbat dec":"157","Dingbat hex":"9D","Unicode dec":"129028","Unicode hex":"1F804"},{"Typeface name":"Wingdings 3","Dingbat dec":"158","Dingbat hex":"9E","Unicode dec":"129030","Unicode hex":"1F806"},{"Typeface name":"Wingdings 3","Dingbat dec":"159","Dingbat hex":"9F","Unicode dec":"129029","Unicode hex":"1F805"},{"Typeface name":"Wingdings 3","Dingbat dec":"160","Dingbat hex":"A0","Unicode dec":"129031","Unicode hex":"1F807"},{"Typeface name":"Wingdings 3","Dingbat dec":"161","Dingbat hex":"A1","Unicode dec":"129032","Unicode hex":"1F808"},{"Typeface name":"Wingdings 3","Dingbat dec":"162","Dingbat hex":"A2","Unicode dec":"129034","Unicode hex":"1F80A"},{"Typeface name":"Wingdings 3","Dingbat dec":"163","Dingbat hex":"A3","Unicode dec":"129033","Unicode hex":"1F809"},{"Typeface name":"Wingdings 3","Dingbat dec":"164","Dingbat hex":"A4","Unicode dec":"129035","Unicode hex":"1F80B"},{"Typeface name":"Wingdings 3","Dingbat dec":"165","Dingbat hex":"A5","Unicode dec":"129056","Unicode hex":"1F820"},{"Typeface name":"Wingdings 3","Dingbat dec":"166","Dingbat hex":"A6","Unicode dec":"129058","Unicode hex":"1F822"},{"Typeface name":"Wingdings 3","Dingbat dec":"167","Dingbat hex":"A7","Unicode dec":"129060","Unicode hex":"1F824"},{"Typeface name":"Wingdings 3","Dingbat dec":"168","Dingbat hex":"A8","Unicode dec":"129062","Unicode hex":"1F826"},{"Typeface name":"Wingdings 3","Dingbat dec":"169","Dingbat hex":"A9","Unicode dec":"129064","Unicode hex":"1F828"},{"Typeface name":"Wingdings 3","Dingbat dec":"170","Dingbat hex":"AA","Unicode dec":"129066","Unicode hex":"1F82A"},{"Typeface name":"Wingdings 3","Dingbat dec":"171","Dingbat hex":"AB","Unicode dec":"129068","Unicode hex":"1F82C"},{"Typeface name":"Wingdings 3","Dingbat dec":"172","Dingbat hex":"AC","Unicode dec":"129180","Unicode hex":"1F89C"},{"Typeface name":"Wingdings 3","Dingbat dec":"173","Dingbat hex":"AD","Unicode dec":"129181","Unicode hex":"1F89D"},{"Typeface name":"Wingdings 3","Dingbat dec":"174","Dingbat hex":"AE","Unicode dec":"129182","Unicode hex":"1F89E"},{"Typeface name":"Wingdings 3","Dingbat dec":"175","Dingbat hex":"AF","Unicode dec":"129183","Unicode hex":"1F89F"},{"Typeface name":"Wingdings 3","Dingbat dec":"176","Dingbat hex":"B0","Unicode dec":"129070","Unicode hex":"1F82E"},{"Typeface name":"Wingdings 3","Dingbat dec":"177","Dingbat hex":"B1","Unicode dec":"129072","Unicode hex":"1F830"},{"Typeface name":"Wingdings 3","Dingbat dec":"178","Dingbat hex":"B2","Unicode dec":"129074","Unicode hex":"1F832"},{"Typeface name":"Wingdings 3","Dingbat dec":"179","Dingbat hex":"B3","Unicode dec":"129076","Unicode hex":"1F834"},{"Typeface name":"Wingdings 3","Dingbat dec":"180","Dingbat hex":"B4","Unicode dec":"129078","Unicode hex":"1F836"},{"Typeface name":"Wingdings 3","Dingbat dec":"181","Dingbat hex":"B5","Unicode dec":"129080","Unicode hex":"1F838"},{"Typeface name":"Wingdings 3","Dingbat dec":"182","Dingbat hex":"B6","Unicode dec":"129082","Unicode hex":"1F83A"},{"Typeface name":"Wingdings 3","Dingbat dec":"183","Dingbat hex":"B7","Unicode dec":"129081","Unicode hex":"1F839"},{"Typeface name":"Wingdings 3","Dingbat dec":"184","Dingbat hex":"B8","Unicode dec":"129083","Unicode hex":"1F83B"},{"Typeface name":"Wingdings 3","Dingbat dec":"185","Dingbat hex":"B9","Unicode dec":"129176","Unicode hex":"1F898"},{"Typeface name":"Wingdings 3","Dingbat dec":"186","Dingbat hex":"BA","Unicode dec":"129178","Unicode hex":"1F89A"},{"Typeface name":"Wingdings 3","Dingbat dec":"187","Dingbat hex":"BB","Unicode dec":"129177","Unicode hex":"1F899"},{"Typeface name":"Wingdings 3","Dingbat dec":"188","Dingbat hex":"BC","Unicode dec":"129179","Unicode hex":"1F89B"},{"Typeface name":"Wingdings 3","Dingbat dec":"189","Dingbat hex":"BD","Unicode dec":"129084","Unicode hex":"1F83C"},{"Typeface name":"Wingdings 3","Dingbat dec":"190","Dingbat hex":"BE","Unicode dec":"129086","Unicode hex":"1F83E"},{"Typeface name":"Wingdings 3","Dingbat dec":"191","Dingbat hex":"BF","Unicode dec":"129085","Unicode hex":"1F83D"},{"Typeface name":"Wingdings 3","Dingbat dec":"192","Dingbat hex":"C0","Unicode dec":"129087","Unicode hex":"1F83F"},{"Typeface name":"Wingdings 3","Dingbat dec":"193","Dingbat hex":"C1","Unicode dec":"129088","Unicode hex":"1F840"},{"Typeface name":"Wingdings 3","Dingbat dec":"194","Dingbat hex":"C2","Unicode dec":"129090","Unicode hex":"1F842"},{"Typeface name":"Wingdings 3","Dingbat dec":"195","Dingbat hex":"C3","Unicode dec":"129089","Unicode hex":"1F841"},{"Typeface name":"Wingdings 3","Dingbat dec":"196","Dingbat hex":"C4","Unicode dec":"129091","Unicode hex":"1F843"},{"Typeface name":"Wingdings 3","Dingbat dec":"197","Dingbat hex":"C5","Unicode dec":"129092","Unicode hex":"1F844"},{"Typeface name":"Wingdings 3","Dingbat dec":"198","Dingbat hex":"C6","Unicode dec":"129094","Unicode hex":"1F846"},{"Typeface name":"Wingdings 3","Dingbat dec":"199","Dingbat hex":"C7","Unicode dec":"129093","Unicode hex":"1F845"},{"Typeface name":"Wingdings 3","Dingbat dec":"200","Dingbat hex":"C8","Unicode dec":"129095","Unicode hex":"1F847"},{"Typeface name":"Wingdings 3","Dingbat dec":"201","Dingbat hex":"C9","Unicode dec":"11176","Unicode hex":"2BA8"},{"Typeface name":"Wingdings 3","Dingbat dec":"202","Dingbat hex":"CA","Unicode dec":"11177","Unicode hex":"2BA9"},{"Typeface name":"Wingdings 3","Dingbat dec":"203","Dingbat hex":"CB","Unicode dec":"11178","Unicode hex":"2BAA"},{"Typeface name":"Wingdings 3","Dingbat dec":"204","Dingbat hex":"CC","Unicode dec":"11179","Unicode hex":"2BAB"},{"Typeface name":"Wingdings 3","Dingbat dec":"205","Dingbat hex":"CD","Unicode dec":"11180","Unicode hex":"2BAC"},{"Typeface name":"Wingdings 3","Dingbat dec":"206","Dingbat hex":"CE","Unicode dec":"11181","Unicode hex":"2BAD"},{"Typeface name":"Wingdings 3","Dingbat dec":"207","Dingbat hex":"CF","Unicode dec":"11182","Unicode hex":"2BAE"},{"Typeface name":"Wingdings 3","Dingbat dec":"208","Dingbat hex":"D0","Unicode dec":"11183","Unicode hex":"2BAF"},{"Typeface name":"Wingdings 3","Dingbat dec":"209","Dingbat hex":"D1","Unicode dec":"129120","Unicode hex":"1F860"},{"Typeface name":"Wingdings 3","Dingbat dec":"210","Dingbat hex":"D2","Unicode dec":"129122","Unicode hex":"1F862"},{"Typeface name":"Wingdings 3","Dingbat dec":"211","Dingbat hex":"D3","Unicode dec":"129121","Unicode hex":"1F861"},{"Typeface name":"Wingdings 3","Dingbat dec":"212","Dingbat hex":"D4","Unicode dec":"129123","Unicode hex":"1F863"},{"Typeface name":"Wingdings 3","Dingbat dec":"213","Dingbat hex":"D5","Unicode dec":"129124","Unicode hex":"1F864"},{"Typeface name":"Wingdings 3","Dingbat dec":"214","Dingbat hex":"D6","Unicode dec":"129125","Unicode hex":"1F865"},{"Typeface name":"Wingdings 3","Dingbat dec":"215","Dingbat hex":"D7","Unicode dec":"129127","Unicode hex":"1F867"},{"Typeface name":"Wingdings 3","Dingbat dec":"216","Dingbat hex":"D8","Unicode dec":"129126","Unicode hex":"1F866"},{"Typeface name":"Wingdings 3","Dingbat dec":"217","Dingbat hex":"D9","Unicode dec":"129136","Unicode hex":"1F870"},{"Typeface name":"Wingdings 3","Dingbat dec":"218","Dingbat hex":"DA","Unicode dec":"129138","Unicode hex":"1F872"},{"Typeface name":"Wingdings 3","Dingbat dec":"219","Dingbat hex":"DB","Unicode dec":"129137","Unicode hex":"1F871"},{"Typeface name":"Wingdings 3","Dingbat dec":"220","Dingbat hex":"DC","Unicode dec":"129139","Unicode hex":"1F873"},{"Typeface name":"Wingdings 3","Dingbat dec":"221","Dingbat hex":"DD","Unicode dec":"129140","Unicode hex":"1F874"},{"Typeface name":"Wingdings 3","Dingbat dec":"222","Dingbat hex":"DE","Unicode dec":"129141","Unicode hex":"1F875"},{"Typeface name":"Wingdings 3","Dingbat dec":"223","Dingbat hex":"DF","Unicode dec":"129143","Unicode hex":"1F877"},{"Typeface name":"Wingdings 3","Dingbat dec":"224","Dingbat hex":"E0","Unicode dec":"129142","Unicode hex":"1F876"},{"Typeface name":"Wingdings 3","Dingbat dec":"225","Dingbat hex":"E1","Unicode dec":"129152","Unicode hex":"1F880"},{"Typeface name":"Wingdings 3","Dingbat dec":"226","Dingbat hex":"E2","Unicode dec":"129154","Unicode hex":"1F882"},{"Typeface name":"Wingdings 3","Dingbat dec":"227","Dingbat hex":"E3","Unicode dec":"129153","Unicode hex":"1F881"},{"Typeface name":"Wingdings 3","Dingbat dec":"228","Dingbat hex":"E4","Unicode dec":"129155","Unicode hex":"1F883"},{"Typeface name":"Wingdings 3","Dingbat dec":"229","Dingbat hex":"E5","Unicode dec":"129156","Unicode hex":"1F884"},{"Typeface name":"Wingdings 3","Dingbat dec":"230","Dingbat hex":"E6","Unicode dec":"129157","Unicode hex":"1F885"},{"Typeface name":"Wingdings 3","Dingbat dec":"231","Dingbat hex":"E7","Unicode dec":"129159","Unicode hex":"1F887"},{"Typeface name":"Wingdings 3","Dingbat dec":"232","Dingbat hex":"E8","Unicode dec":"129158","Unicode hex":"1F886"},{"Typeface name":"Wingdings 3","Dingbat dec":"233","Dingbat hex":"E9","Unicode dec":"129168","Unicode hex":"1F890"},{"Typeface name":"Wingdings 3","Dingbat dec":"234","Dingbat hex":"EA","Unicode dec":"129170","Unicode hex":"1F892"},{"Typeface name":"Wingdings 3","Dingbat dec":"235","Dingbat hex":"EB","Unicode dec":"129169","Unicode hex":"1F891"},{"Typeface name":"Wingdings 3","Dingbat dec":"236","Dingbat hex":"EC","Unicode dec":"129171","Unicode hex":"1F893"},{"Typeface name":"Wingdings 3","Dingbat dec":"237","Dingbat hex":"ED","Unicode dec":"129172","Unicode hex":"1F894"},{"Typeface name":"Wingdings 3","Dingbat dec":"238","Dingbat hex":"EE","Unicode dec":"129174","Unicode hex":"1F896"},{"Typeface name":"Wingdings 3","Dingbat dec":"239","Dingbat hex":"EF","Unicode dec":"129173","Unicode hex":"1F895"},{"Typeface name":"Wingdings 3","Dingbat dec":"240","Dingbat hex":"F0","Unicode dec":"129175","Unicode hex":"1F897"}]},7673(e,t,n){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hex=t.dec=t.codePoint=void 0;for(var r=a(n(7945)),o={},i=String.fromCodePoint?String.fromCodePoint:function(e){if(e<=65535)return String.fromCharCode(e);var t=Math.floor((e-65536)/1024)+55296,n=(e-65536)%1024+56320;return String.fromCharCode(t,n)},s=0,l=r.default;s<l.length;s++){var c=l[s],d=parseInt(c["Unicode dec"],10),m={codePoint:d,string:i(d)};o[c["Typeface name"].toUpperCase()+"_"+c["Dingbat dec"]]=m}function p(e,t){return o[e.toUpperCase()+"_"+t]}t.codePoint=p,t.dec=function(e,t){return p(e,parseInt(t,10))},t.hex=function(e,t){return p(e,parseInt(t,16))}},1710(e,t,n){e.exports=function e(t,n,a){function r(i,s){if(!n[i]){if(!t[i]){if(o)return o(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[i]={exports:{}};t[i][0].call(c.exports,function(e){return r(t[i][1][e]||e)},c,c.exports,e,t,n,a)}return n[i].exports}for(var o=void 0,i=0;i<a.length;i++)r(a[i]);return r}({1:[function(e,t,n){"use strict";var a=e("./utils"),r=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(e){for(var t,n,r,i,s,l,c,d=[],m=0,p=e.length,u=p,g="string"!==a.getTypeOf(e);m<e.length;)u=p-m,r=g?(t=e[m++],n=m<p?e[m++]:0,m<p?e[m++]:0):(t=e.charCodeAt(m++),n=m<p?e.charCodeAt(m++):0,m<p?e.charCodeAt(m++):0),i=t>>2,s=(3&t)<<4|n>>4,l=1<u?(15&n)<<2|r>>6:64,c=2<u?63&r:64,d.push(o.charAt(i)+o.charAt(s)+o.charAt(l)+o.charAt(c));return d.join("")},n.decode=function(e){var t,n,a,i,s,l,c=0,d=0,m="data:";if(e.substr(0,m.length)===m)throw new Error("Invalid base64 input, it looks like a data url.");var p,u=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&u--,e.charAt(e.length-2)===o.charAt(64)&&u--,u%1!=0)throw new Error("Invalid base64 input, bad content length.");for(p=r.uint8array?new Uint8Array(0|u):new Array(0|u);c<e.length;)t=o.indexOf(e.charAt(c++))<<2|(i=o.indexOf(e.charAt(c++)))>>4,n=(15&i)<<4|(s=o.indexOf(e.charAt(c++)))>>2,a=(3&s)<<6|(l=o.indexOf(e.charAt(c++))),p[d++]=t,64!==s&&(p[d++]=n),64!==l&&(p[d++]=a);return p}},{"./support":30,"./utils":32}],2:[function(e,t,n){"use strict";var a=e("./external"),r=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),i=e("./stream/DataLengthProbe");function s(e,t,n,a,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=a,this.compressedContent=r}s.prototype={getContentWorker:function(){var e=new r(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new i("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new r(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new o).pipe(new i("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new i("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var a=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){"use strict";var a=e("./utils"),r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==a.getTypeOf(e)?function(e,t,n,a){var o=r,i=a+n;e^=-1;for(var s=a;s<i;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):function(e,t,n,a){var o=r,i=a+n;e^=-1;for(var s=a;s<i;s++)e=e>>>8^o[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){"use strict";n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){"use strict";var a=null;a="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:a}},{lie:37}],7:[function(e,t,n){"use strict";var a="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=e("pako"),o=e("./utils"),i=e("./stream/GenericWorker"),s=a?"uint8array":"array";function l(e,t){i.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",o.inherits(l,i),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},l.prototype.flush=function(){i.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new l("Deflate",e)},n.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){"use strict";function a(e,t){var n,a="";for(n=0;n<t;n++)a+=String.fromCharCode(255&e),e>>>=8;return a}function r(e,t,n,r,i,d){var m,p,u=e.file,g=e.compression,h=d!==s.utf8encode,b=o.transformTo("string",d(u.name)),f=o.transformTo("string",s.utf8encode(u.name)),v=u.comment,y=o.transformTo("string",d(v)),x=o.transformTo("string",s.utf8encode(v)),w=f.length!==u.name.length,k=x.length!==v.length,E="",S="",C="",T=u.dir,A=u.date,D={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(D.crc32=e.crc32,D.compressedSize=e.compressedSize,D.uncompressedSize=e.uncompressedSize);var _=0;t&&(_|=8),h||!w&&!k||(_|=2048);var N=0,M=0;T&&(N|=16),"UNIX"===i?(M=798,N|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(u.unixPermissions,T)):(M=20,N|=function(e){return 63&(e||0)}(u.dosPermissions)),m=A.getUTCHours(),m<<=6,m|=A.getUTCMinutes(),m<<=5,m|=A.getUTCSeconds()/2,p=A.getUTCFullYear()-1980,p<<=4,p|=A.getUTCMonth()+1,p<<=5,p|=A.getUTCDate(),w&&(S=a(1,1)+a(l(b),4)+f,E+="up"+a(S.length,2)+S),k&&(C=a(1,1)+a(l(y),4)+x,E+="uc"+a(C.length,2)+C);var I="";return I+="\n\0",I+=a(_,2),I+=g.magic,I+=a(m,2),I+=a(p,2),I+=a(D.crc32,4),I+=a(D.compressedSize,4),I+=a(D.uncompressedSize,4),I+=a(b.length,2),I+=a(E.length,2),{fileRecord:c.LOCAL_FILE_HEADER+I+b+E,dirRecord:c.CENTRAL_FILE_HEADER+a(M,2)+I+a(y.length,2)+"\0\0\0\0"+a(N,4)+a(r,4)+b+E+y}}var o=e("../utils"),i=e("../stream/GenericWorker"),s=e("../utf8"),l=e("../crc32"),c=e("../signature");function d(e,t,n,a){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=a,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(d,i),d.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,a=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,i.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-a-1))/n:100}}))},d.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=r(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=r(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return c.DATA_DESCRIPTOR+a(e.crc32,4)+a(e.compressedSize,4)+a(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var n=this.bytesWritten-e,r=function(e,t,n,r,i){var s=o.transformTo("string",i(r));return c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+a(e,2)+a(e,2)+a(t,4)+a(n,4)+a(s.length,2)+s}(this.dirRecords.length,n,e,this.zipComment,this.encodeFileName);this.push({data:r,meta:{percent:100}})},d.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},d.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(e){t.error(e)}),this},d.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},d.prototype.error=function(e){var t=this._sources;if(!i.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch(e){}return!0},d.prototype.lock=function(){i.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=d},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,n){"use strict";var a=e("../compressions"),r=e("./ZipFileWorker");n.generateWorker=function(e,t,n){var o=new r(t.streamFiles,n,t.platform,t.encodeFileName),i=0;try{e.forEach(function(e,n){i++;var r=function(e,t){var n=e||t,r=a[n];if(!r)throw new Error(n+" is not a valid compression method !");return r}(n.options.compression,t.compression),s=n.options.compressionOptions||t.compressionOptions||{},l=n.dir,c=n.date;n._compressWorker(r,s).withStreamInfo("file",{name:e,dir:l,date:c,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(o)}),o.entriesCount=i}catch(e){o.error(e)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,n){"use strict";function a(){if(!(this instanceof a))return new a;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new a;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(a.prototype=e("./object")).loadAsync=e("./load"),a.support=e("./support"),a.defaults=e("./defaults"),a.version="3.10.1",a.loadAsync=function(e,t){return(new a).loadAsync(e,t)},a.external=e("./external"),t.exports=a},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,n){"use strict";var a=e("./utils"),r=e("./external"),o=e("./utf8"),i=e("./zipEntries"),s=e("./stream/Crc32Probe"),l=e("./nodejsUtils");function c(e){return new r.Promise(function(t,n){var a=e.decompressed.getContentWorker().pipe(new s);a.on("error",function(e){n(e)}).on("end",function(){a.streamInfo.crc32!==e.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}t.exports=function(e,t){var n=this;return t=a.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),l.isNode&&l.isStream(e)?r.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):a.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(e){var n=new i(t);return n.load(e),n}).then(function(e){var n=[r.Promise.resolve(e)],a=e.files;if(t.checkCRC32)for(var o=0;o<a.length;o++)n.push(c(a[o]));return r.Promise.all(n)}).then(function(e){for(var r=e.shift(),o=r.files,i=0;i<o.length;i++){var s=o[i],l=s.fileNameStr,c=a.resolve(s.fileNameStr);n.file(c,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders}),s.dir||(n.file(c).unsafeOriginalName=l)}return r.zipComment.length&&(n.comment=r.zipComment),n})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,n){"use strict";var a=e("../utils"),r=e("../stream/GenericWorker");function o(e,t){r.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}a.inherits(o,r),o.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",function(e){t.push({data:e,meta:{percent:0}})}).on("error",function(e){t.isPaused?this.generatedError=e:t.error(e)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})},o.prototype.pause=function(){return!!r.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,n){"use strict";var a=e("readable-stream").Readable;function r(e,t,n){a.call(this,t),this._helper=e;var r=this;e.on("data",function(e,t){r.push(e)||r._helper.pause(),n&&n(t)}).on("error",function(e){r.emit("error",e)}).on("end",function(){r.push(null)})}e("../utils").inherits(r,a),r.prototype._read=function(){this._helper.resume()},t.exports=r},{"../utils":32,"readable-stream":16}],14:[function(e,t,n){"use strict";t.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,n){"use strict";function a(e,t,n){var a,r=o.getTypeOf(t),s=o.extend(n||{},l);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=h(e)),s.createFolders&&(a=g(e))&&b.call(this,a,!0);var m="string"===r&&!1===s.binary&&!1===s.base64;n&&void 0!==n.binary||(s.binary=!m),(t instanceof c&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",r="string");var f=null;f=t instanceof c||t instanceof i?t:p.isNode&&p.isStream(t)?new u(e,t):o.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var v=new d(e,f,s);this.files[e]=v}var r=e("./utf8"),o=e("./utils"),i=e("./stream/GenericWorker"),s=e("./stream/StreamHelper"),l=e("./defaults"),c=e("./compressedObject"),d=e("./zipObject"),m=e("./generate"),p=e("./nodejsUtils"),u=e("./nodejs/NodejsStreamInputAdapter"),g=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},h=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},b=function(e,t){return t=void 0!==t?t:l.createFolders,e=h(e),this.files[e]||a.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function f(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var v={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,a;for(t in this.files)a=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,a)},filter:function(e){var t=[];return this.forEach(function(n,a){e(n,a)&&t.push(a)}),t},file:function(e,t,n){if(1!==arguments.length)return e=this.root+e,a.call(this,e,t,n),this;if(f(e)){var r=e;return this.filter(function(e,t){return!t.dir&&r.test(e)})}var o=this.files[this.root+e];return o&&!o.dir?o:null},folder:function(e){if(!e)return this;if(f(e))return this.filter(function(t,n){return n.dir&&e.test(t)});var t=this.root+e,n=b.call(this,t),a=this.clone();return a.root=n.name,a},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter(function(t,n){return n.name.slice(0,e.length)===e}),a=0;a<n.length;a++)delete this.files[n[a].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,n={};try{if((n=o.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:r.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");o.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS");var a=n.comment||this.comment||"";t=m.generateWorker(this,n,a)}catch(e){(t=new i("error")).error(e)}return new s(t,n.type||"string",n.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=v},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,n){"use strict";t.exports=e("stream")},{stream:void 0}],17:[function(e,t,n){"use strict";var a=e("./DataReader");function r(e){a.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(r,a),r.prototype.byteAt=function(e){return this.data[this.zero+e]},r.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),n=e.charCodeAt(1),a=e.charCodeAt(2),r=e.charCodeAt(3),o=this.length-4;0<=o;--o)if(this.data[o]===t&&this.data[o+1]===n&&this.data[o+2]===a&&this.data[o+3]===r)return o-this.zero;return-1},r.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),a=e.charCodeAt(2),r=e.charCodeAt(3),o=this.readData(4);return t===o[0]&&n===o[1]&&a===o[2]&&r===o[3]},r.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./DataReader":18}],18:[function(e,t,n){"use strict";var a=e("../utils");function r(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}r.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,n=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return a.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=r},{"../utils":32}],19:[function(e,t,n){"use strict";var a=e("./Uint8ArrayReader");function r(e){a.call(this,e)}e("../utils").inherits(r,a),r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){"use strict";var a=e("./DataReader");function r(e){a.call(this,e)}e("../utils").inherits(r,a),r.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},r.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},r.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},r.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){"use strict";var a=e("./ArrayReader");function r(e){a.call(this,e)}e("../utils").inherits(r,a),r.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){"use strict";var a=e("../utils"),r=e("../support"),o=e("./ArrayReader"),i=e("./StringReader"),s=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=a.getTypeOf(e);return a.checkSupport(t),"string"!==t||r.uint8array?"nodebuffer"===t?new s(e):r.uint8array?new l(a.transformTo("uint8array",e)):new o(a.transformTo("array",e)):new i(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){"use strict";n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,n){"use strict";var a=e("./GenericWorker"),r=e("../utils");function o(e){a.call(this,"ConvertWorker to "+e),this.destType=e}r.inherits(o,a),o.prototype.processChunk=function(e){this.push({data:r.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){"use strict";var a=e("./GenericWorker"),r=e("../crc32");function o(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,a),o.prototype.processChunk=function(e){this.streamInfo.crc32=r(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){"use strict";var a=e("../utils"),r=e("./GenericWorker");function o(e){r.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}a.inherits(o,r),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}r.prototype.processChunk.call(this,e)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){"use strict";var a=e("../utils"),r=e("./GenericWorker");function o(e){r.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=a.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}a.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){"use strict";function a(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}a.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.end()}),e.on("error",function(e){t.error(e)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=a},{}],29:[function(e,t,n){"use strict";var a=e("../utils"),r=e("./ConvertWorker"),o=e("./GenericWorker"),i=e("../base64"),s=e("../support"),l=e("../external"),c=null;if(s.nodestream)try{c=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function d(e,t){return new l.Promise(function(n,r){var o=[],s=e._internalType,l=e._outputType,c=e._mimeType;e.on("data",function(e,n){o.push(e),t&&t(n)}).on("error",function(e){o=[],r(e)}).on("end",function(){try{var e=function(e,t,n){switch(e){case"blob":return a.newBlob(a.transformTo("arraybuffer",t),n);case"base64":return i.encode(t);default:return a.transformTo(e,t)}}(l,function(e,t){var n,a=0,r=null,o=0;for(n=0;n<t.length;n++)o+=t[n].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(r=new Uint8Array(o),n=0;n<t.length;n++)r.set(t[n],a),a+=t[n].length;return r;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(s,o),c);n(e)}catch(e){r(e)}o=[]}).resume()})}function m(e,t,n){var i=t;switch(t){case"blob":case"arraybuffer":i="uint8array";break;case"base64":i="string"}try{this._internalType=i,this._outputType=t,this._mimeType=n,a.checkSupport(i),this._worker=e.pipe(new r(i)),e.lock()}catch(e){this._worker=new o("error"),this._worker.error(e)}}m.prototype={accumulate:function(e){return d(this,e)},on:function(e,t){var n=this;return"data"===e?this._worker.on(e,function(e){t.call(n,e.data,e.meta)}):this._worker.on(e,function(){a.delay(t,arguments,n)}),this},resume:function(){return a.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(a.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=m},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,n){"use strict";if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer="undefined"!=typeof Buffer,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var a=new ArrayBuffer(0);try{n.blob=0===new Blob([a],{type:"application/zip"}).size}catch(e){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(a),n.blob=0===r.getBlob("application/zip").size}catch(e){n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch(e){n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){"use strict";for(var a=e("./utils"),r=e("./support"),o=e("./nodejsUtils"),i=e("./stream/GenericWorker"),s=new Array(256),l=0;l<256;l++)s[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function c(){i.call(this,"utf-8 decode"),this.leftOver=null}function d(){i.call(this,"utf-8 encode")}s[254]=s[254]=1,n.utf8encode=function(e){return r.nodebuffer?o.newBufferFrom(e,"utf-8"):function(e){var t,n,a,o,i,s=e.length,l=0;for(o=0;o<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(a=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(a-56320),o++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=r.uint8array?new Uint8Array(l):new Array(l),o=i=0;i<l;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(a=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(a-56320),o++),n<128?t[i++]=n:(n<2048?t[i++]=192|n>>>6:(n<65536?t[i++]=224|n>>>12:(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63),t[i++]=128|n>>>6&63),t[i++]=128|63&n);return t}(e)},n.utf8decode=function(e){return r.nodebuffer?a.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,r,o,i=e.length,l=new Array(2*i);for(t=n=0;t<i;)if((r=e[t++])<128)l[n++]=r;else if(4<(o=s[r]))l[n++]=65533,t+=o-1;else{for(r&=2===o?31:3===o?15:7;1<o&&t<i;)r=r<<6|63&e[t++],o--;1<o?l[n++]=65533:r<65536?l[n++]=r:(r-=65536,l[n++]=55296|r>>10&1023,l[n++]=56320|1023&r)}return l.length!==n&&(l.subarray?l=l.subarray(0,n):l.length=n),a.applyFromCharCode(l)}(e=a.transformTo(r.uint8array?"uint8array":"array",e))},a.inherits(c,i),c.prototype.processChunk=function(e){var t=a.transformTo(r.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var o=t;(t=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),t.set(o,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var i=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+s[e[n]]>t?n:t}(t),l=t;i!==t.length&&(r.uint8array?(l=t.subarray(0,i),this.leftOver=t.subarray(i,t.length)):(l=t.slice(0,i),this.leftOver=t.slice(i,t.length))),this.push({data:n.utf8decode(l),meta:e.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=c,a.inherits(d,i),d.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){"use strict";var a=e("./support"),r=e("./base64"),o=e("./nodejsUtils"),i=e("./external");function s(e){return e}function l(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}e("setimmediate"),n.newBlob=function(e,t){n.checkSupport("blob");try{return new Blob([e],{type:t})}catch(n){try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return a.append(e),a.getBlob(t)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var c={stringifyByChunk:function(e,t,n){var a=[],r=0,o=e.length;if(o<=n)return String.fromCharCode.apply(null,e);for(;r<o;)"array"===t||"nodebuffer"===t?a.push(String.fromCharCode.apply(null,e.slice(r,Math.min(r+n,o)))):a.push(String.fromCharCode.apply(null,e.subarray(r,Math.min(r+n,o)))),r+=n;return a.join("")},stringifyByChar:function(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},applyCanBeUsed:{uint8array:function(){try{return a.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return a.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch(e){return!1}}()}};function d(e){var t=65536,a=n.getTypeOf(e),r=!0;if("uint8array"===a?r=c.applyCanBeUsed.uint8array:"nodebuffer"===a&&(r=c.applyCanBeUsed.nodebuffer),r)for(;1<t;)try{return c.stringifyByChunk(e,a,t)}catch(e){t=Math.floor(t/2)}return c.stringifyByChar(e)}function m(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}n.applyFromCharCode=d;var p={};p.string={string:s,array:function(e){return l(e,new Array(e.length))},arraybuffer:function(e){return p.string.uint8array(e).buffer},uint8array:function(e){return l(e,new Uint8Array(e.length))},nodebuffer:function(e){return l(e,o.allocBuffer(e.length))}},p.array={string:d,array:s,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(e)}},p.arraybuffer={string:function(e){return d(new Uint8Array(e))},array:function(e){return m(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:s,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(new Uint8Array(e))}},p.uint8array={string:d,array:function(e){return m(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:s,nodebuffer:function(e){return o.newBufferFrom(e)}},p.nodebuffer={string:d,array:function(e){return m(e,new Array(e.length))},arraybuffer:function(e){return p.nodebuffer.uint8array(e).buffer},uint8array:function(e){return m(e,new Uint8Array(e.length))},nodebuffer:s},n.transformTo=function(e,t){if(t=t||"",!e)return t;n.checkSupport(e);var a=n.getTypeOf(t);return p[a][e](t)},n.resolve=function(e){for(var t=e.split("/"),n=[],a=0;a<t.length;a++){var r=t[a];"."===r||""===r&&0!==a&&a!==t.length-1||(".."===r?n.pop():n.push(r))}return n.join("/")},n.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":a.nodebuffer&&o.isBuffer(e)?"nodebuffer":a.uint8array&&e instanceof Uint8Array?"uint8array":a.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(e){if(!a[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,n,a="";for(n=0;n<(e||"").length;n++)a+="\\x"+((t=e.charCodeAt(n))<16?"0":"")+t.toString(16).toUpperCase();return a},n.delay=function(e,t,n){setImmediate(function(){e.apply(n||null,t||[])})},n.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.extend=function(){var e,t,n={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===n[t]&&(n[t]=arguments[e][t]);return n},n.prepareContent=function(e,t,o,s,c){return i.Promise.resolve(t).then(function(e){return a.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new i.Promise(function(t,n){var a=new FileReader;a.onload=function(e){t(e.target.result)},a.onerror=function(e){n(e.target.error)},a.readAsArrayBuffer(e)}):e}).then(function(t){var d=n.getTypeOf(t);return d?("arraybuffer"===d?t=n.transformTo("uint8array",t):"string"===d&&(c?t=r.decode(t):o&&!0!==s&&(t=function(e){return l(e,a.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):i.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,n){"use strict";var a=e("./reader/readerFor"),r=e("./utils"),o=e("./signature"),i=e("./zipEntry"),s=e("./support");function l(e){this.files=[],this.loadOptions=e}l.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+r.pretty(t)+", expected "+r.pretty(e)+")")}},isSignature:function(e,t){var n=this.reader.index;this.reader.setIndex(e);var a=this.reader.readString(4)===t;return this.reader.setIndex(n),a},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?"uint8array":"array",n=r.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,n,a=this.zip64EndOfCentralSize-44;0<a;)e=this.reader.readInt(2),t=this.reader.readInt(4),n=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(e=new i({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===r.MAX_VALUE_16BITS||this.diskWithCentralDirStart===r.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===r.MAX_VALUE_16BITS||this.centralDirRecords===r.MAX_VALUE_16BITS||this.centralDirSize===r.MAX_VALUE_32BITS||this.centralDirOffset===r.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var a=t-n;if(0<a)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=a);else if(a<0)throw new Error("Corrupted zip: missing "+Math.abs(a)+" bytes.")},prepareReader:function(e){this.reader=a(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,n){"use strict";var a=e("./reader/readerFor"),r=e("./utils"),o=e("./compressedObject"),i=e("./crc32"),s=e("./utf8"),l=e("./compressions"),c=e("./support");function d(e,t){this.options=e,this.loadOptions=t}d.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in l)if(Object.prototype.hasOwnProperty.call(l,t)&&l[t].magic===e)return l[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=a(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,a,r=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<r;)t=e.readInt(2),n=e.readInt(2),a=e.readData(n),this.extraFields[t]={id:t,length:n,value:a};e.setIndex(r)},handleUTF8:function(){var e=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var n=r.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var a=this.findExtraFieldUnicodeComment();if(null!==a)this.fileCommentStr=a;else{var o=r.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=a(e.value);return 1!==t.readInt(1)||i(this.fileName)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=a(e.value);return 1!==t.readInt(1)||i(this.fileComment)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null}},t.exports=d},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,n){"use strict";function a(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var r=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),i=e("./utf8"),s=e("./compressedObject"),l=e("./stream/GenericWorker");a.prototype={internalStream:function(e){var t=null,n="string";try{if(!e)throw new Error("No output type specified.");var a="string"===(n=e.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),t=this._decompressWorker();var o=!this._dataBinary;o&&!a&&(t=t.pipe(new i.Utf8EncodeWorker)),!o&&a&&(t=t.pipe(new i.Utf8DecodeWorker))}catch(e){(t=new l("error")).error(e)}return new r(t,n,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new i.Utf8EncodeWorker)),s.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof l?this._data:new o(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],d=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},m=0;m<c.length;m++)a.prototype[c[m]]=d;t.exports=a},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,a){(function(e){"use strict";var n,a,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var o=0,i=new r(d),s=e.document.createTextNode("");i.observe(s,{characterData:!0}),n=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){d(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(d,0)};else{var l=new e.MessageChannel;l.port1.onmessage=d,n=function(){l.port2.postMessage(0)}}var c=[];function d(){var e,t;a=!0;for(var n=c.length;n;){for(t=c,c=[],e=-1;++e<n;)t[e]();n=c.length}a=!1}t.exports=function(e){1!==c.push(e)||a||n()}}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,n){"use strict";var a=e("immediate");function r(){}var o={},i=["REJECTED"],s=["FULFILLED"],l=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==r&&u(this,e)}function d(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function m(e,t,n){a(function(){var a;try{a=t(n)}catch(a){return o.reject(e,a)}a===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,a)})}function p(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function u(e,t){var n=!1;function a(t){n||(n=!0,o.reject(e,t))}function r(t){n||(n=!0,o.resolve(e,t))}var i=g(function(){t(r,a)});"error"===i.status&&a(i.value)}function g(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}(t.exports=c).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})},c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===i)return this;var n=new this.constructor(r);return this.state!==l?m(n,this.state===s?e:t,this.outcome):this.queue.push(new d(n,e,t)),n},d.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},d.prototype.otherCallFulfilled=function(e){m(this.promise,this.onFulfilled,e)},d.prototype.callRejected=function(e){o.reject(this.promise,e)},d.prototype.otherCallRejected=function(e){m(this.promise,this.onRejected,e)},o.resolve=function(e,t){var n=g(p,t);if("error"===n.status)return o.reject(e,n.value);var a=n.value;if(a)u(e,a);else{e.state=s,e.outcome=t;for(var r=-1,i=e.queue.length;++r<i;)e.queue[r].callFulfilled(t)}return e},o.reject=function(e,t){e.state=i,e.outcome=t;for(var n=-1,a=e.queue.length;++n<a;)e.queue[n].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:o.resolve(new this(r),e)},c.reject=function(e){var t=new this(r);return o.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,a=!1;if(!n)return this.resolve([]);for(var i=new Array(n),s=0,l=-1,c=new this(r);++l<n;)d(e[l],l);return c;function d(e,r){t.resolve(e).then(function(e){i[r]=e,++s!==n||a||(a=!0,o.resolve(c,i))},function(e){a||(a=!0,o.reject(c,e))})}},c.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,a=!1;if(!n)return this.resolve([]);for(var i,s=-1,l=new this(r);++s<n;)i=e[s],t.resolve(i).then(function(e){a||(a=!0,o.resolve(l,e))},function(e){a||(a=!0,o.reject(l,e))});return l}},{immediate:36}],38:[function(e,t,n){"use strict";var a={};(0,e("./lib/utils/common").assign)(a,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=a},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,n){"use strict";var a=e("./zlib/deflate"),r=e("./utils/common"),o=e("./utils/strings"),i=e("./zlib/messages"),s=e("./zlib/zstream"),l=Object.prototype.toString,c=0,d=-1,m=0,p=8;function u(e){if(!(this instanceof u))return new u(e);this.options=r.assign({level:d,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:m,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==c)throw new Error(i[n]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){var g;if(g="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(n=a.deflateSetDictionary(this.strm,g))!==c)throw new Error(i[n]);this._dict_set=!0}}function g(e,t){var n=new u(t);if(n.push(e,!0),n.err)throw n.msg||i[n.err];return n.result}u.prototype.push=function(e,t){var n,i,s=this.strm,d=this.options.chunkSize;if(this.ended)return!1;i=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=o.string2buf(e):"[object ArrayBuffer]"===l.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new r.Buf8(d),s.next_out=0,s.avail_out=d),1!==(n=a.deflate(s,i))&&n!==c)return this.onEnd(n),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==i&&2!==i)||("string"===this.options.to?this.onData(o.buf2binstring(r.shrinkBuf(s.output,s.next_out))):this.onData(r.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==n);return 4===i?(n=a.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===c):2!==i||(this.onEnd(c),!(s.avail_out=0))},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){e===c&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=u,n.deflate=g,n.deflateRaw=function(e,t){return(t=t||{}).raw=!0,g(e,t)},n.gzip=function(e,t){return(t=t||{}).gzip=!0,g(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){"use strict";var a=e("./zlib/inflate"),r=e("./utils/common"),o=e("./utils/strings"),i=e("./zlib/constants"),s=e("./zlib/messages"),l=e("./zlib/zstream"),c=e("./zlib/gzheader"),d=Object.prototype.toString;function m(e){if(!(this instanceof m))return new m(e);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var n=a.inflateInit2(this.strm,t.windowBits);if(n!==i.Z_OK)throw new Error(s[n]);this.header=new c,a.inflateGetHeader(this.strm,this.header)}function p(e,t){var n=new m(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}m.prototype.push=function(e,t){var n,s,l,c,m,p,u=this.strm,g=this.options.chunkSize,h=this.options.dictionary,b=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?i.Z_FINISH:i.Z_NO_FLUSH,"string"==typeof e?u.input=o.binstring2buf(e):"[object ArrayBuffer]"===d.call(e)?u.input=new Uint8Array(e):u.input=e,u.next_in=0,u.avail_in=u.input.length;do{if(0===u.avail_out&&(u.output=new r.Buf8(g),u.next_out=0,u.avail_out=g),(n=a.inflate(u,i.Z_NO_FLUSH))===i.Z_NEED_DICT&&h&&(p="string"==typeof h?o.string2buf(h):"[object ArrayBuffer]"===d.call(h)?new Uint8Array(h):h,n=a.inflateSetDictionary(this.strm,p)),n===i.Z_BUF_ERROR&&!0===b&&(n=i.Z_OK,b=!1),n!==i.Z_STREAM_END&&n!==i.Z_OK)return this.onEnd(n),!(this.ended=!0);u.next_out&&(0!==u.avail_out&&n!==i.Z_STREAM_END&&(0!==u.avail_in||s!==i.Z_FINISH&&s!==i.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(u.output,u.next_out),c=u.next_out-l,m=o.buf2string(u.output,l),u.next_out=c,u.avail_out=g-c,c&&r.arraySet(u.output,u.output,l,c,0),this.onData(m)):this.onData(r.shrinkBuf(u.output,u.next_out)))),0===u.avail_in&&0===u.avail_out&&(b=!0)}while((0<u.avail_in||0===u.avail_out)&&n!==i.Z_STREAM_END);return n===i.Z_STREAM_END&&(s=i.Z_FINISH),s===i.Z_FINISH?(n=a.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===i.Z_OK):s!==i.Z_SYNC_FLUSH||(this.onEnd(i.Z_OK),!(u.avail_out=0))},m.prototype.onData=function(e){this.chunks.push(e)},m.prototype.onEnd=function(e){e===i.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=m,n.inflate=p,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},n.ungzip=p},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){"use strict";var a="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var a in n)n.hasOwnProperty(a)&&(e[a]=n[a])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,n,a,r){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+a),r);else for(var o=0;o<a;o++)e[r+o]=t[n+o]},flattenChunks:function(e){var t,n,a,r,o,i;for(t=a=0,n=e.length;t<n;t++)a+=e[t].length;for(i=new Uint8Array(a),t=r=0,n=e.length;t<n;t++)o=e[t],i.set(o,r),r+=o.length;return i}},o={arraySet:function(e,t,n,a,r){for(var o=0;o<a;o++)e[r+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,r)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(a)},{}],42:[function(e,t,n){"use strict";var a=e("./common"),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var i=new a.Buf8(256),s=0;s<256;s++)i[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function l(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&r))return String.fromCharCode.apply(null,a.shrinkBuf(e,t));for(var n="",i=0;i<t;i++)n+=String.fromCharCode(e[i]);return n}i[254]=i[254]=1,n.string2buf=function(e){var t,n,r,o,i,s=e.length,l=0;for(o=0;o<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),l+=n<128?1:n<2048?2:n<65536?3:4;for(t=new a.Buf8(l),o=i=0;i<l;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),n<128?t[i++]=n:(n<2048?t[i++]=192|n>>>6:(n<65536?t[i++]=224|n>>>12:(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63),t[i++]=128|n>>>6&63),t[i++]=128|63&n);return t},n.buf2binstring=function(e){return l(e,e.length)},n.binstring2buf=function(e){for(var t=new a.Buf8(e.length),n=0,r=t.length;n<r;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,a,r,o,s=t||e.length,c=new Array(2*s);for(n=a=0;n<s;)if((r=e[n++])<128)c[a++]=r;else if(4<(o=i[r]))c[a++]=65533,n+=o-1;else{for(r&=2===o?31:3===o?15:7;1<o&&n<s;)r=r<<6|63&e[n++],o--;1<o?c[a++]=65533:r<65536?c[a++]=r:(r-=65536,c[a++]=55296|r>>10&1023,c[a++]=56320|1023&r)}return l(c,a)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+i[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){"use strict";t.exports=function(e,t,n,a){for(var r=65535&e,o=e>>>16&65535,i=0;0!==n;){for(n-=i=2e3<n?2e3:n;o=o+(r=r+t[a++]|0)|0,--i;);r%=65521,o%=65521}return r|o<<16}},{}],44:[function(e,t,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,n){"use strict";var a=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,r){var o=a,i=r+n;e^=-1;for(var s=r;s<i;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){"use strict";var a,r=e("../utils/common"),o=e("./trees"),i=e("./adler32"),s=e("./crc32"),l=e("./messages"),c=0,d=4,m=0,p=-2,u=-1,g=4,h=2,b=8,f=9,v=286,y=30,x=19,w=2*v+1,k=15,E=3,S=258,C=S+E+1,T=42,A=113,D=1,_=2,N=3,M=4;function I(e,t){return e.msg=l[t],t}function R(e){return(e<<1)-(4<e?9:0)}function B(e){for(var t=e.length;0<=--t;)e[t]=0}function P(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(r.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function L(e,t){o._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,P(e.strm)}function U(e,t){e.pending_buf[e.pending++]=t}function F(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function z(e,t){var n,a,r=e.max_chain_length,o=e.strstart,i=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-C?e.strstart-(e.w_size-C):0,c=e.window,d=e.w_mask,m=e.prev,p=e.strstart+S,u=c[o+i-1],g=c[o+i];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(n=t)+i]===g&&c[n+i-1]===u&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do{}while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&o<p);if(a=S-(p-o),o=p-S,i<a){if(e.match_start=t,s<=(i=a))break;u=c[o+i-1],g=c[o+i]}}}while((t=m[t&d])>l&&0!=--r);return i<=e.lookahead?i:e.lookahead}function O(e){var t,n,a,o,l,c,d,m,p,u,g=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=g+(g-C)){for(r.arraySet(e.window,e.window,g,g,0),e.match_start-=g,e.strstart-=g,e.block_start-=g,t=n=e.hash_size;a=e.head[--t],e.head[t]=g<=a?a-g:0,--n;);for(t=n=g;a=e.prev[--t],e.prev[t]=g<=a?a-g:0,--n;);o+=g}if(0===e.strm.avail_in)break;if(c=e.strm,d=e.window,m=e.strstart+e.lookahead,u=void 0,(p=o)<(u=c.avail_in)&&(u=p),n=0===u?0:(c.avail_in-=u,r.arraySet(d,c.input,c.next_in,u,m),1===c.state.wrap?c.adler=i(c.adler,d,u,m):2===c.state.wrap&&(c.adler=s(c.adler,d,u,m)),c.next_in+=u,c.total_in+=u,u),e.lookahead+=n,e.lookahead+e.insert>=E)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+E-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<E)););}while(e.lookahead<C&&0!==e.strm.avail_in)}function W(e,t){for(var n,a;;){if(e.lookahead<C){if(O(e),e.lookahead<C&&t===c)return D;if(0===e.lookahead)break}if(n=0,e.lookahead>=E&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+E-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-C&&(e.match_length=z(e,n)),e.match_length>=E)if(a=o._tr_tally(e,e.strstart-e.match_start,e.match_length-E),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=E){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+E-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else a=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(a&&(L(e,!1),0===e.strm.avail_out))return D}return e.insert=e.strstart<E-1?e.strstart:E-1,t===d?(L(e,!0),0===e.strm.avail_out?N:M):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?D:_}function q(e,t){for(var n,a,r;;){if(e.lookahead<C){if(O(e),e.lookahead<C&&t===c)return D;if(0===e.lookahead)break}if(n=0,e.lookahead>=E&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+E-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=E-1,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-C&&(e.match_length=z(e,n),e.match_length<=5&&(1===e.strategy||e.match_length===E&&4096<e.strstart-e.match_start)&&(e.match_length=E-1)),e.prev_length>=E&&e.match_length<=e.prev_length){for(r=e.strstart+e.lookahead-E,a=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-E),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=r&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+E-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=E-1,e.strstart++,a&&(L(e,!1),0===e.strm.avail_out))return D}else if(e.match_available){if((a=o._tr_tally(e,0,e.window[e.strstart-1]))&&L(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return D}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(a=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<E-1?e.strstart:E-1,t===d?(L(e,!0),0===e.strm.avail_out?N:M):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?D:_}function H(e,t,n,a,r){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=a,this.func=r}function j(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=b,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(2*w),this.dyn_dtree=new r.Buf16(2*(2*y+1)),this.bl_tree=new r.Buf16(2*(2*x+1)),B(this.dyn_ltree),B(this.dyn_dtree),B(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(k+1),this.heap=new r.Buf16(2*v+1),B(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*v+1),B(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function V(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=h,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?T:A,e.adler=2===t.wrap?0:1,t.last_flush=c,o._tr_init(t),m):I(e,p)}function G(e){var t=V(e);return t===m&&function(e){e.window_size=2*e.w_size,B(e.head),e.max_lazy_match=a[e.level].max_lazy,e.good_match=a[e.level].good_length,e.nice_match=a[e.level].nice_length,e.max_chain_length=a[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=E-1,e.match_available=0,e.ins_h=0}(e.state),t}function K(e,t,n,a,o,i){if(!e)return p;var s=1;if(t===u&&(t=6),a<0?(s=0,a=-a):15<a&&(s=2,a-=16),o<1||f<o||n!==b||a<8||15<a||t<0||9<t||i<0||g<i)return I(e,p);8===a&&(a=9);var l=new j;return(e.state=l).strm=e,l.wrap=s,l.gzhead=null,l.w_bits=a,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=o+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+E-1)/E),l.window=new r.Buf8(2*l.w_size),l.head=new r.Buf16(l.hash_size),l.prev=new r.Buf16(l.w_size),l.lit_bufsize=1<<o+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new r.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=i,l.method=n,G(e)}a=[new H(0,0,0,0,function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(O(e),0===e.lookahead&&t===c)return D;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var a=e.block_start+n;if((0===e.strstart||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,L(e,!1),0===e.strm.avail_out))return D;if(e.strstart-e.block_start>=e.w_size-C&&(L(e,!1),0===e.strm.avail_out))return D}return e.insert=0,t===d?(L(e,!0),0===e.strm.avail_out?N:M):(e.strstart>e.block_start&&(L(e,!1),e.strm.avail_out),D)}),new H(4,4,8,4,W),new H(4,5,16,8,W),new H(4,6,32,32,W),new H(4,4,16,16,q),new H(8,16,32,32,q),new H(8,16,128,128,q),new H(8,32,128,256,q),new H(32,128,258,1024,q),new H(32,258,258,4096,q)],n.deflateInit=function(e,t){return K(e,t,b,15,8,0)},n.deflateInit2=K,n.deflateReset=G,n.deflateResetKeep=V,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?p:(e.state.gzhead=t,m):p},n.deflate=function(e,t){var n,r,i,l;if(!e||!e.state||5<t||t<0)return e?I(e,p):p;if(r=e.state,!e.output||!e.input&&0!==e.avail_in||666===r.status&&t!==d)return I(e,0===e.avail_out?-5:p);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===T)if(2===r.wrap)e.adler=0,U(r,31),U(r,139),U(r,8),r.gzhead?(U(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),U(r,255&r.gzhead.time),U(r,r.gzhead.time>>8&255),U(r,r.gzhead.time>>16&255),U(r,r.gzhead.time>>24&255),U(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),U(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(U(r,255&r.gzhead.extra.length),U(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=s(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(U(r,0),U(r,0),U(r,0),U(r,0),U(r,0),U(r,9===r.level?2:2<=r.strategy||r.level<2?4:0),U(r,3),r.status=A);else{var u=b+(r.w_bits-8<<4)<<8;u|=(2<=r.strategy||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(u|=32),u+=31-u%31,r.status=A,F(r,u),0!==r.strstart&&(F(r,e.adler>>>16),F(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>i&&(e.adler=s(e.adler,r.pending_buf,r.pending-i,i)),P(e),i=r.pending,r.pending!==r.pending_buf_size));)U(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=s(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=s(e.adler,r.pending_buf,r.pending-i,i)),P(e),i=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,U(r,l)}while(0!==l);r.gzhead.hcrc&&r.pending>i&&(e.adler=s(e.adler,r.pending_buf,r.pending-i,i)),0===l&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=s(e.adler,r.pending_buf,r.pending-i,i)),P(e),i=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,U(r,l)}while(0!==l);r.gzhead.hcrc&&r.pending>i&&(e.adler=s(e.adler,r.pending_buf,r.pending-i,i)),0===l&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&P(e),r.pending+2<=r.pending_buf_size&&(U(r,255&e.adler),U(r,e.adler>>8&255),e.adler=0,r.status=A)):r.status=A),0!==r.pending){if(P(e),0===e.avail_out)return r.last_flush=-1,m}else if(0===e.avail_in&&R(t)<=R(n)&&t!==d)return I(e,-5);if(666===r.status&&0!==e.avail_in)return I(e,-5);if(0!==e.avail_in||0!==r.lookahead||t!==c&&666!==r.status){var g=2===r.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(O(e),0===e.lookahead)){if(t===c)return D;break}if(e.match_length=0,n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(L(e,!1),0===e.strm.avail_out))return D}return e.insert=0,t===d?(L(e,!0),0===e.strm.avail_out?N:M):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?D:_}(r,t):3===r.strategy?function(e,t){for(var n,a,r,i,s=e.window;;){if(e.lookahead<=S){if(O(e),e.lookahead<=S&&t===c)return D;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=E&&0<e.strstart&&(a=s[r=e.strstart-1])===s[++r]&&a===s[++r]&&a===s[++r]){i=e.strstart+S;do{}while(a===s[++r]&&a===s[++r]&&a===s[++r]&&a===s[++r]&&a===s[++r]&&a===s[++r]&&a===s[++r]&&a===s[++r]&&r<i);e.match_length=S-(i-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=E?(n=o._tr_tally(e,1,e.match_length-E),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(L(e,!1),0===e.strm.avail_out))return D}return e.insert=0,t===d?(L(e,!0),0===e.strm.avail_out?N:M):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?D:_}(r,t):a[r.level].func(r,t);if(g!==N&&g!==M||(r.status=666),g===D||g===N)return 0===e.avail_out&&(r.last_flush=-1),m;if(g===_&&(1===t?o._tr_align(r):5!==t&&(o._tr_stored_block(r,0,0,!1),3===t&&(B(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),P(e),0===e.avail_out))return r.last_flush=-1,m}return t!==d?m:r.wrap<=0?1:(2===r.wrap?(U(r,255&e.adler),U(r,e.adler>>8&255),U(r,e.adler>>16&255),U(r,e.adler>>24&255),U(r,255&e.total_in),U(r,e.total_in>>8&255),U(r,e.total_in>>16&255),U(r,e.total_in>>24&255)):(F(r,e.adler>>>16),F(r,65535&e.adler)),P(e),0<r.wrap&&(r.wrap=-r.wrap),0!==r.pending?m:1)},n.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==T&&69!==t&&73!==t&&91!==t&&103!==t&&t!==A&&666!==t?I(e,p):(e.state=null,t===A?I(e,-3):m):p},n.deflateSetDictionary=function(e,t){var n,a,o,s,l,c,d,u,g=t.length;if(!e||!e.state)return p;if(2===(s=(n=e.state).wrap)||1===s&&n.status!==T||n.lookahead)return p;for(1===s&&(e.adler=i(e.adler,t,g,0)),n.wrap=0,g>=n.w_size&&(0===s&&(B(n.head),n.strstart=0,n.block_start=0,n.insert=0),u=new r.Buf8(n.w_size),r.arraySet(u,t,g-n.w_size,n.w_size,0),t=u,g=n.w_size),l=e.avail_in,c=e.next_in,d=e.input,e.avail_in=g,e.next_in=0,e.input=t,O(n);n.lookahead>=E;){for(a=n.strstart,o=n.lookahead-(E-1);n.ins_h=(n.ins_h<<n.hash_shift^n.window[a+E-1])&n.hash_mask,n.prev[a&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=a,a++,--o;);n.strstart=a,n.lookahead=E-1,O(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=E-1,n.match_available=0,e.next_in=c,e.input=d,e.avail_in=l,n.wrap=s,m},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,n){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,n){"use strict";t.exports=function(e,t){var n,a,r,o,i,s,l,c,d,m,p,u,g,h,b,f,v,y,x,w,k,E,S,C,T;n=e.state,a=e.next_in,C=e.input,r=a+(e.avail_in-5),o=e.next_out,T=e.output,i=o-(t-e.avail_out),s=o+(e.avail_out-257),l=n.dmax,c=n.wsize,d=n.whave,m=n.wnext,p=n.window,u=n.hold,g=n.bits,h=n.lencode,b=n.distcode,f=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;e:do{g<15&&(u+=C[a++]<<g,g+=8,u+=C[a++]<<g,g+=8),y=h[u&f];t:for(;;){if(u>>>=x=y>>>24,g-=x,0==(x=y>>>16&255))T[o++]=65535&y;else{if(!(16&x)){if(!(64&x)){y=h[(65535&y)+(u&(1<<x)-1)];continue t}if(32&x){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}w=65535&y,(x&=15)&&(g<x&&(u+=C[a++]<<g,g+=8),w+=u&(1<<x)-1,u>>>=x,g-=x),g<15&&(u+=C[a++]<<g,g+=8,u+=C[a++]<<g,g+=8),y=b[u&v];n:for(;;){if(u>>>=x=y>>>24,g-=x,!(16&(x=y>>>16&255))){if(!(64&x)){y=b[(65535&y)+(u&(1<<x)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(k=65535&y,g<(x&=15)&&(u+=C[a++]<<g,(g+=8)<x&&(u+=C[a++]<<g,g+=8)),l<(k+=u&(1<<x)-1)){e.msg="invalid distance too far back",n.mode=30;break e}if(u>>>=x,g-=x,(x=o-i)<k){if(d<(x=k-x)&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(S=p,(E=0)===m){if(E+=c-x,x<w){for(w-=x;T[o++]=p[E++],--x;);E=o-k,S=T}}else if(m<x){if(E+=c+m-x,(x-=m)<w){for(w-=x;T[o++]=p[E++],--x;);if(E=0,m<w){for(w-=x=m;T[o++]=p[E++],--x;);E=o-k,S=T}}}else if(E+=m-x,x<w){for(w-=x;T[o++]=p[E++],--x;);E=o-k,S=T}for(;2<w;)T[o++]=S[E++],T[o++]=S[E++],T[o++]=S[E++],w-=3;w&&(T[o++]=S[E++],1<w&&(T[o++]=S[E++]))}else{for(E=o-k;T[o++]=T[E++],T[o++]=T[E++],T[o++]=T[E++],2<(w-=3););w&&(T[o++]=T[E++],1<w&&(T[o++]=T[E++]))}break}}break}}while(a<r&&o<s);a-=w=g>>3,u&=(1<<(g-=w<<3))-1,e.next_in=a,e.next_out=o,e.avail_in=a<r?r-a+5:5-(a-r),e.avail_out=o<s?s-o+257:257-(o-s),n.hold=u,n.bits=g}},{}],49:[function(e,t,n){"use strict";var a=e("../utils/common"),r=e("./adler32"),o=e("./crc32"),i=e("./inffast"),s=e("./inftrees"),l=1,c=2,d=0,m=-2,p=1,u=852,g=592;function h(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=p,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new a.Buf32(u),t.distcode=t.distdyn=new a.Buf32(g),t.sane=1,t.back=-1,d):m}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,f(e)):m}function y(e,t){var n,a;return e&&e.state?(a=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?m:(null!==a.window&&a.wbits!==t&&(a.window=null),a.wrap=n,a.wbits=t,v(e))):m}function x(e,t){var n,a;return e?(a=new b,(e.state=a).window=null,(n=y(e,t))!==d&&(e.state=null),n):m}var w,k,E=!0;function S(e){if(E){var t;for(w=new a.Buf32(512),k=new a.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(l,e.lens,0,288,w,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(c,e.lens,0,32,k,0,e.work,{bits:5}),E=!1}e.lencode=w,e.lenbits=9,e.distcode=k,e.distbits=5}function C(e,t,n,r){var o,i=e.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new a.Buf8(i.wsize)),r>=i.wsize?(a.arraySet(i.window,t,n-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(r<(o=i.wsize-i.wnext)&&(o=r),a.arraySet(i.window,t,n-r,o,i.wnext),(r-=o)?(a.arraySet(i.window,t,n-r,r,0),i.wnext=r,i.whave=i.wsize):(i.wnext+=o,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=o))),0}n.inflateReset=v,n.inflateReset2=y,n.inflateResetKeep=f,n.inflateInit=function(e){return x(e,15)},n.inflateInit2=x,n.inflate=function(e,t){var n,u,g,b,f,v,y,x,w,k,E,T,A,D,_,N,M,I,R,B,P,L,U,F,z=0,O=new a.Buf8(4),W=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return m;12===(n=e.state).mode&&(n.mode=13),f=e.next_out,g=e.output,y=e.avail_out,b=e.next_in,u=e.input,v=e.avail_in,x=n.hold,w=n.bits,k=v,E=y,L=d;e:for(;;)switch(n.mode){case p:if(0===n.wrap){n.mode=13;break}for(;w<16;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}if(2&n.wrap&&35615===x){O[n.check=0]=255&x,O[1]=x>>>8&255,n.check=o(n.check,O,2,0),w=x=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&x)<<8)+(x>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&x)){e.msg="unknown compression method",n.mode=30;break}if(w-=4,P=8+(15&(x>>>=4)),0===n.wbits)n.wbits=P;else if(P>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<P,e.adler=n.check=1,n.mode=512&x?10:12,w=x=0;break;case 2:for(;w<16;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}if(n.flags=x,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=x>>8&1),512&n.flags&&(O[0]=255&x,O[1]=x>>>8&255,n.check=o(n.check,O,2,0)),w=x=0,n.mode=3;case 3:for(;w<32;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}n.head&&(n.head.time=x),512&n.flags&&(O[0]=255&x,O[1]=x>>>8&255,O[2]=x>>>16&255,O[3]=x>>>24&255,n.check=o(n.check,O,4,0)),w=x=0,n.mode=4;case 4:for(;w<16;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}n.head&&(n.head.xflags=255&x,n.head.os=x>>8),512&n.flags&&(O[0]=255&x,O[1]=x>>>8&255,n.check=o(n.check,O,2,0)),w=x=0,n.mode=5;case 5:if(1024&n.flags){for(;w<16;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}n.length=x,n.head&&(n.head.extra_len=x),512&n.flags&&(O[0]=255&x,O[1]=x>>>8&255,n.check=o(n.check,O,2,0)),w=x=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(T=n.length)&&(T=v),T&&(n.head&&(P=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),a.arraySet(n.head.extra,u,b,T,P)),512&n.flags&&(n.check=o(n.check,u,T,b)),v-=T,b+=T,n.length-=T),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===v)break e;for(T=0;P=u[b+T++],n.head&&P&&n.length<65536&&(n.head.name+=String.fromCharCode(P)),P&&T<v;);if(512&n.flags&&(n.check=o(n.check,u,T,b)),v-=T,b+=T,P)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===v)break e;for(T=0;P=u[b+T++],n.head&&P&&n.length<65536&&(n.head.comment+=String.fromCharCode(P)),P&&T<v;);if(512&n.flags&&(n.check=o(n.check,u,T,b)),v-=T,b+=T,P)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;w<16;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}if(x!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}w=x=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;w<32;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}e.adler=n.check=h(x),w=x=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=f,e.avail_out=y,e.next_in=b,e.avail_in=v,n.hold=x,n.bits=w,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){x>>>=7&w,w-=7&w,n.mode=27;break}for(;w<3;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}switch(n.last=1&x,w-=1,3&(x>>>=1)){case 0:n.mode=14;break;case 1:if(S(n),n.mode=20,6!==t)break;x>>>=2,w-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}x>>>=2,w-=2;break;case 14:for(x>>>=7&w,w-=7&w;w<32;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}if((65535&x)!=(x>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&x,w=x=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(T=n.length){if(v<T&&(T=v),y<T&&(T=y),0===T)break e;a.arraySet(g,u,b,T,f),v-=T,b+=T,y-=T,f+=T,n.length-=T;break}n.mode=12;break;case 17:for(;w<14;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}if(n.nlen=257+(31&x),x>>>=5,w-=5,n.ndist=1+(31&x),x>>>=5,w-=5,n.ncode=4+(15&x),x>>>=4,w-=4,286<n.nlen||30<n.ndist){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;w<3;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}n.lens[W[n.have++]]=7&x,x>>>=3,w-=3}for(;n.have<19;)n.lens[W[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,U={bits:n.lenbits},L=s(0,n.lens,0,19,n.lencode,0,n.work,U),n.lenbits=U.bits,L){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;N=(z=n.lencode[x&(1<<n.lenbits)-1])>>>16&255,M=65535&z,!((_=z>>>24)<=w);){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}if(M<16)x>>>=_,w-=_,n.lens[n.have++]=M;else{if(16===M){for(F=_+2;w<F;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}if(x>>>=_,w-=_,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}P=n.lens[n.have-1],T=3+(3&x),x>>>=2,w-=2}else if(17===M){for(F=_+3;w<F;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}w-=_,P=0,T=3+(7&(x>>>=_)),x>>>=3,w-=3}else{for(F=_+7;w<F;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}w-=_,P=0,T=11+(127&(x>>>=_)),x>>>=7,w-=7}if(n.have+T>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;T--;)n.lens[n.have++]=P}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,U={bits:n.lenbits},L=s(l,n.lens,0,n.nlen,n.lencode,0,n.work,U),n.lenbits=U.bits,L){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,U={bits:n.distbits},L=s(c,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,U),n.distbits=U.bits,L){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=f,e.avail_out=y,e.next_in=b,e.avail_in=v,n.hold=x,n.bits=w,i(e,E),f=e.next_out,g=e.output,y=e.avail_out,b=e.next_in,u=e.input,v=e.avail_in,x=n.hold,w=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;N=(z=n.lencode[x&(1<<n.lenbits)-1])>>>16&255,M=65535&z,!((_=z>>>24)<=w);){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}if(N&&!(240&N)){for(I=_,R=N,B=M;N=(z=n.lencode[B+((x&(1<<I+R)-1)>>I)])>>>16&255,M=65535&z,!(I+(_=z>>>24)<=w);){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}x>>>=I,w-=I,n.back+=I}if(x>>>=_,w-=_,n.back+=_,n.length=M,0===N){n.mode=26;break}if(32&N){n.back=-1,n.mode=12;break}if(64&N){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&N,n.mode=22;case 22:if(n.extra){for(F=n.extra;w<F;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}n.length+=x&(1<<n.extra)-1,x>>>=n.extra,w-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;N=(z=n.distcode[x&(1<<n.distbits)-1])>>>16&255,M=65535&z,!((_=z>>>24)<=w);){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}if(!(240&N)){for(I=_,R=N,B=M;N=(z=n.distcode[B+((x&(1<<I+R)-1)>>I)])>>>16&255,M=65535&z,!(I+(_=z>>>24)<=w);){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}x>>>=I,w-=I,n.back+=I}if(x>>>=_,w-=_,n.back+=_,64&N){e.msg="invalid distance code",n.mode=30;break}n.offset=M,n.extra=15&N,n.mode=24;case 24:if(n.extra){for(F=n.extra;w<F;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}n.offset+=x&(1<<n.extra)-1,x>>>=n.extra,w-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===y)break e;if(T=E-y,n.offset>T){if((T=n.offset-T)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}A=T>n.wnext?(T-=n.wnext,n.wsize-T):n.wnext-T,T>n.length&&(T=n.length),D=n.window}else D=g,A=f-n.offset,T=n.length;for(y<T&&(T=y),y-=T,n.length-=T;g[f++]=D[A++],--T;);0===n.length&&(n.mode=21);break;case 26:if(0===y)break e;g[f++]=n.length,y--,n.mode=21;break;case 27:if(n.wrap){for(;w<32;){if(0===v)break e;v--,x|=u[b++]<<w,w+=8}if(E-=y,e.total_out+=E,n.total+=E,E&&(e.adler=n.check=n.flags?o(n.check,g,E,f-E):r(n.check,g,E,f-E)),E=y,(n.flags?x:h(x))!==n.check){e.msg="incorrect data check",n.mode=30;break}w=x=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;w<32;){if(0===v)break e;v--,x+=u[b++]<<w,w+=8}if(x!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}w=x=0}n.mode=29;case 29:L=1;break e;case 30:L=-3;break e;case 31:return-4;default:return m}return e.next_out=f,e.avail_out=y,e.next_in=b,e.avail_in=v,n.hold=x,n.bits=w,(n.wsize||E!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&C(e,e.output,e.next_out,E-e.avail_out)?(n.mode=31,-4):(k-=e.avail_in,E-=e.avail_out,e.total_in+=k,e.total_out+=E,n.total+=E,n.wrap&&E&&(e.adler=n.check=n.flags?o(n.check,g,E,e.next_out-E):r(n.check,g,E,e.next_out-E)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==k&&0===E||4===t)&&L===d&&(L=-5),L)},n.inflateEnd=function(e){if(!e||!e.state)return m;var t=e.state;return t.window&&(t.window=null),e.state=null,d},n.inflateGetHeader=function(e,t){var n;return e&&e.state&&2&(n=e.state).wrap?((n.head=t).done=!1,d):m},n.inflateSetDictionary=function(e,t){var n,a=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?m:11===n.mode&&r(1,t,a,0)!==n.check?-3:C(e,t,a,a)?(n.mode=31,-4):(n.havedict=1,d):m},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,n){"use strict";var a=e("../utils/common"),r=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],i=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,l,c,d,m,p){var u,g,h,b,f,v,y,x,w,k=p.bits,E=0,S=0,C=0,T=0,A=0,D=0,_=0,N=0,M=0,I=0,R=null,B=0,P=new a.Buf16(16),L=new a.Buf16(16),U=null,F=0;for(E=0;E<=15;E++)P[E]=0;for(S=0;S<l;S++)P[t[n+S]]++;for(A=k,T=15;1<=T&&0===P[T];T--);if(T<A&&(A=T),0===T)return c[d++]=20971520,c[d++]=20971520,p.bits=1,0;for(C=1;C<T&&0===P[C];C++);for(A<C&&(A=C),E=N=1;E<=15;E++)if(N<<=1,(N-=P[E])<0)return-1;if(0<N&&(0===e||1!==T))return-1;for(L[1]=0,E=1;E<15;E++)L[E+1]=L[E]+P[E];for(S=0;S<l;S++)0!==t[n+S]&&(m[L[t[n+S]]++]=S);if(v=0===e?(R=U=m,19):1===e?(R=r,B-=257,U=o,F-=257,256):(R=i,U=s,-1),E=C,f=d,_=S=I=0,h=-1,b=(M=1<<(D=A))-1,1===e&&852<M||2===e&&592<M)return 1;for(;;){for(y=E-_,w=m[S]<v?(x=0,m[S]):m[S]>v?(x=U[F+m[S]],R[B+m[S]]):(x=96,0),u=1<<E-_,C=g=1<<D;c[f+(I>>_)+(g-=u)]=y<<24|x<<16|w,0!==g;);for(u=1<<E-1;I&u;)u>>=1;if(0!==u?(I&=u-1,I+=u):I=0,S++,0==--P[E]){if(E===T)break;E=t[n+m[S]]}if(A<E&&(I&b)!==h){for(0===_&&(_=A),f+=C,N=1<<(D=E-_);D+_<T&&!((N-=P[D+_])<=0);)D++,N<<=1;if(M+=1<<D,1===e&&852<M||2===e&&592<M)return 1;c[h=I&b]=A<<24|D<<16|f-d}}return 0!==I&&(c[f+I]=E-_<<24|64<<16),p.bits=A,0}},{"../utils/common":41}],51:[function(e,t,n){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,n){"use strict";var a=e("../utils/common"),r=0,o=1;function i(e){for(var t=e.length;0<=--t;)e[t]=0}var s=0,l=29,c=256,d=c+1+l,m=30,p=19,u=2*d+1,g=15,h=16,b=7,f=256,v=16,y=17,x=18,w=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],k=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],S=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],C=new Array(2*(d+2));i(C);var T=new Array(2*m);i(T);var A=new Array(512);i(A);var D=new Array(256);i(D);var _=new Array(l);i(_);var N,M,I,R=new Array(m);function B(e,t,n,a,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=a,this.max_length=r,this.has_stree=e&&e.length}function P(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function L(e){return e<256?A[e]:A[256+(e>>>7)]}function U(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function F(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<<e.bi_valid&65535,U(e,e.bi_buf),e.bi_buf=t>>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function z(e,t,n){F(e,n[2*t],n[2*t+1])}function O(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function W(e,t,n){var a,r,o=new Array(g+1),i=0;for(a=1;a<=g;a++)o[a]=i=i+n[a-1]<<1;for(r=0;r<=t;r++){var s=e[2*r+1];0!==s&&(e[2*r]=O(o[s]++,s))}}function q(e){var t;for(t=0;t<d;t++)e.dyn_ltree[2*t]=0;for(t=0;t<m;t++)e.dyn_dtree[2*t]=0;for(t=0;t<p;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*f]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function H(e){8<e.bi_valid?U(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function j(e,t,n,a){var r=2*t,o=2*n;return e[r]<e[o]||e[r]===e[o]&&a[t]<=a[n]}function V(e,t,n){for(var a=e.heap[n],r=n<<1;r<=e.heap_len&&(r<e.heap_len&&j(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!j(t,a,e.heap[r],e.depth));)e.heap[n]=e.heap[r],n=r,r<<=1;e.heap[n]=a}function G(e,t,n){var a,r,o,i,s=0;if(0!==e.last_lit)for(;a=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],r=e.pending_buf[e.l_buf+s],s++,0===a?z(e,r,t):(z(e,(o=D[r])+c+1,t),0!==(i=w[o])&&F(e,r-=_[o],i),z(e,o=L(--a),n),0!==(i=k[o])&&F(e,a-=R[o],i)),s<e.last_lit;);z(e,f,t)}function K(e,t){var n,a,r,o=t.dyn_tree,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,l=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=u,n=0;n<l;n++)0!==o[2*n]?(e.heap[++e.heap_len]=c=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(r=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[r]=0,e.opt_len--,s&&(e.static_len-=i[2*r+1]);for(t.max_code=c,n=e.heap_len>>1;1<=n;n--)V(e,o,n);for(r=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],V(e,o,1),a=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=a,o[2*r]=o[2*n]+o[2*a],e.depth[r]=(e.depth[n]>=e.depth[a]?e.depth[n]:e.depth[a])+1,o[2*n+1]=o[2*a+1]=r,e.heap[1]=r++,V(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,a,r,o,i,s,l=t.dyn_tree,c=t.max_code,d=t.stat_desc.static_tree,m=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,b=t.stat_desc.max_length,f=0;for(o=0;o<=g;o++)e.bl_count[o]=0;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<u;n++)b<(o=l[2*l[2*(a=e.heap[n])+1]+1]+1)&&(o=b,f++),l[2*a+1]=o,c<a||(e.bl_count[o]++,i=0,h<=a&&(i=p[a-h]),s=l[2*a],e.opt_len+=s*(o+i),m&&(e.static_len+=s*(d[2*a+1]+i)));if(0!==f){do{for(o=b-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[b]--,f-=2}while(0<f);for(o=b;0!==o;o--)for(a=e.bl_count[o];0!==a;)c<(r=e.heap[--n])||(l[2*r+1]!==o&&(e.opt_len+=(o-l[2*r+1])*l[2*r],l[2*r+1]=o),a--)}}(e,t),W(o,c,e.bl_count)}function $(e,t,n){var a,r,o=-1,i=t[1],s=0,l=7,c=4;for(0===i&&(l=138,c=3),t[2*(n+1)+1]=65535,a=0;a<=n;a++)r=i,i=t[2*(a+1)+1],++s<l&&r===i||(s<c?e.bl_tree[2*r]+=s:0!==r?(r!==o&&e.bl_tree[2*r]++,e.bl_tree[2*v]++):s<=10?e.bl_tree[2*y]++:e.bl_tree[2*x]++,o=r,c=(s=0)===i?(l=138,3):r===i?(l=6,3):(l=7,4))}function Y(e,t,n){var a,r,o=-1,i=t[1],s=0,l=7,c=4;for(0===i&&(l=138,c=3),a=0;a<=n;a++)if(r=i,i=t[2*(a+1)+1],!(++s<l&&r===i)){if(s<c)for(;z(e,r,e.bl_tree),0!=--s;);else 0!==r?(r!==o&&(z(e,r,e.bl_tree),s--),z(e,v,e.bl_tree),F(e,s-3,2)):s<=10?(z(e,y,e.bl_tree),F(e,s-3,3)):(z(e,x,e.bl_tree),F(e,s-11,7));o=r,c=(s=0)===i?(l=138,3):r===i?(l=6,3):(l=7,4)}}i(R);var X=!1;function J(e,t,n,r){F(e,(s<<1)+(r?1:0),3),function(e,t,n,r){H(e),r&&(U(e,n),U(e,~n)),a.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}n._tr_init=function(e){X||(function(){var e,t,n,a,r,o=new Array(g+1);for(a=n=0;a<l-1;a++)for(_[a]=n,e=0;e<1<<w[a];e++)D[n++]=a;for(D[n-1]=a,a=r=0;a<16;a++)for(R[a]=r,e=0;e<1<<k[a];e++)A[r++]=a;for(r>>=7;a<m;a++)for(R[a]=r<<7,e=0;e<1<<k[a]-7;e++)A[256+r++]=a;for(t=0;t<=g;t++)o[t]=0;for(e=0;e<=143;)C[2*e+1]=8,e++,o[8]++;for(;e<=255;)C[2*e+1]=9,e++,o[9]++;for(;e<=279;)C[2*e+1]=7,e++,o[7]++;for(;e<=287;)C[2*e+1]=8,e++,o[8]++;for(W(C,d+1,o),e=0;e<m;e++)T[2*e+1]=5,T[2*e]=O(e,5);N=new B(C,w,c+1,d,g),M=new B(T,k,0,m,g),I=new B(new Array(0),E,0,p,b)}(),X=!0),e.l_desc=new P(e.dyn_ltree,N),e.d_desc=new P(e.dyn_dtree,M),e.bl_desc=new P(e.bl_tree,I),e.bi_buf=0,e.bi_valid=0,q(e)},n._tr_stored_block=J,n._tr_flush_block=function(e,t,n,a){var i,s,l=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return r;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return o;for(t=32;t<c;t++)if(0!==e.dyn_ltree[2*t])return o;return r}(e)),K(e,e.l_desc),K(e,e.d_desc),l=function(e){var t;for($(e,e.dyn_ltree,e.l_desc.max_code),$(e,e.dyn_dtree,e.d_desc.max_code),K(e,e.bl_desc),t=p-1;3<=t&&0===e.bl_tree[2*S[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==t?J(e,t,n,a):4===e.strategy||s===i?(F(e,2+(a?1:0),3),G(e,C,T)):(F(e,4+(a?1:0),3),function(e,t,n,a){var r;for(F(e,t-257,5),F(e,n-1,5),F(e,a-4,4),r=0;r<a;r++)F(e,e.bl_tree[2*S[r]+1],3);Y(e,e.dyn_ltree,t-1),Y(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),G(e,e.dyn_ltree,e.dyn_dtree)),q(e),a&&H(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(D[n]+c+1)]++,e.dyn_dtree[2*L(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){F(e,2,3),z(e,f,C),function(e){16===e.bi_valid?(U(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,a){(function(e){!function(e,t){"use strict";if(!e.setImmediate){var n,a,r,o,i=1,s={},l=!1,c=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,n="[object process]"==={}.toString.call(e.process)?function(e){process.nextTick(function(){p(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(o="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),function(t){e.postMessage(o+t,"*")}):e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){p(e.data)},function(e){r.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(a=c.documentElement,function(e){var t=c.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):function(e){setTimeout(p,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),a=0;a<t.length;a++)t[a]=arguments[a+1];var r={callback:e,args:t};return s[i]=r,n(i),i++},d.clearImmediate=m}function m(e){delete s[e]}function p(e){if(l)setTimeout(p,0,e);else{var n=s[e];if(n){l=!0;try{!function(e){var n=e.callback,a=e.args;switch(a.length){case 0:n();break;case 1:n(a[0]);break;case 2:n(a[0],a[1]);break;case 3:n(a[0],a[1],a[2]);break;default:n.apply(t,a)}}(n)}finally{m(e),l=!1}}}}function u(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,void 0!==n.g?n.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},6324(e,t,n){t.Parser=n(405).Parser,t.rules=n(8815),t.errors=n(3649),t.results=n(315),t.StringSource=n(894),t.Token=n(2013),t.bottomUp=n(351),t.RegexTokeniser=n(6192).RegexTokeniser,t.rule=function(e){var t;return function(n){return t||(t=e()),t(n)}}},894(e){e.exports=function(e,n){return{asString:function(){return e},range:function(a,r){return new t(e,n,a,r)}}};var t=function(e,t,n,a){this._string=e,this._description=t,this._startIndex=n,this._endIndex=a};t.prototype.to=function(e){return new t(this._string,this._description,this._startIndex,e._endIndex)},t.prototype.describe=function(){var e=this._position();return(this._description?this._description+"\n":"")+"Line number: "+e.lineNumber+"\nCharacter number: "+e.characterNumber},t.prototype.lineNumber=function(){return this._position().lineNumber},t.prototype.characterNumber=function(){return this._position().characterNumber},t.prototype._position=function(){for(var e=this,t=0,n=function(){return e._string.indexOf("\n",t)},a=1;-1!==n()&&n()<this._startIndex;)t=n()+1,a+=1;return{lineNumber:a,characterNumber:this._startIndex-t+1}}},2013(e){e.exports=function(e,t,n){this.name=e,this.value=t,n&&(this.source=n)}},3999(e){var t=e.exports=function(e,t){this._tokens=e,this._startIndex=t||0};t.prototype.head=function(){return this._tokens[this._startIndex]},t.prototype.tail=function(e){return new t(this._tokens,this._startIndex+1)},t.prototype.toArray=function(){return this._tokens.slice(this._startIndex)},t.prototype.end=function(){return this._tokens[this._tokens.length-1]},t.prototype.to=function(e){var t=this.head().source,n=e.head()||e.end();return t.to(n.source)}},351(e,t,n){var a=n(8815),r=n(315);function o(e){function t(){return e.map(function(e){return e.name})}function n(t){return a.firstOf("infix",e.map(function(e){return e.rule}))(t)}return{apply:function(e){for(var t,a;;){if(!(t=n(e.remaining())).isSuccess())return t.isFailure()?e:t;a=e.source().to(t.source()),e=r.success(t.value()(e.value(),a),t.remaining(),a)}},untilExclusive:function(n){return new o(e.slice(0,t().indexOf(n)))},untilInclusive:function(n){return new o(e.slice(0,t().indexOf(n)+1))}}}t.parser=function(e,t,n){var r={rule:function(){return c(s)},leftAssociative:function(e){return c(s.untilExclusive(e))},rightAssociative:function(e){return c(s.untilInclusive(e))}},s=new o(n.map(function(e){return{name:e.name,rule:i(e.ruleBuilder.bind(null,r))}})),l=a.firstOf(e,t);function c(e){return d.bind(null,e)}function d(e,t){var n=l(t);return n.isSuccess()?e.apply(n):n}return r},t.infix=function(e,n){return{name:e,ruleBuilder:n,map:function(a){return t.infix(e,function(e){var t=n(e);return function(e){return t(e).map(function(e){return function(t,n){return a(t,e,n)}})}})}}};var i=function(e){var t;return function(n){return t||(t=e()),t(n)}}},3649(e,t){t.error=function(e){return new n(e)};var n=function(e){this.expected=e.expected,this.actual=e.actual,this._location=e.location};n.prototype.describe=function(){return(this._location?this._location.describe()+":\n":"")+"Expected "+this.expected+"\nbut got "+this.actual},n.prototype.lineNumber=function(){return this._location.lineNumber()},n.prototype.characterNumber=function(){return this._location.characterNumber()}},5758(e,t){t.fromArray=function(e){var t=0,a=function(){return t<e.length};return new n({hasNext:a,next:function(){if(a())return e[t++];throw new Error("No more elements")}})};var n=function(e){this._iterator=e};n.prototype.map=function(e){var t=this._iterator;return new n({hasNext:function(){return t.hasNext()},next:function(){return e(t.next())}})},n.prototype.filter=function(e){var t,a=this._iterator,r=!1,o=!1,i=function(){if(!r)for(r=!0,o=!1;a.hasNext()&&!o;)t=a.next(),o=e(t)};return new n({hasNext:function(){return i(),o},next:function(){return i(),r=!1,t}})},n.prototype.first=function(){var e=this._iterator;return this._iterator.hasNext()?e.next():null},n.prototype.toArray=function(){for(var e=[];this._iterator.hasNext();)e.push(this._iterator.next());return e}},405(e,t,n){var a=n(3999);t.Parser=function(e){return{parseTokens:function(e,t){return e(new a(t))}}}},315(e){e.exports={failure:function(e,n){if(e.length<1)throw new Error("Failure must have errors");return new t({status:"failure",remaining:n,errors:e})},error:function(e,n){if(e.length<1)throw new Error("Failure must have errors");return new t({status:"error",remaining:n,errors:e})},success:function(e,n,a){return new t({status:"success",value:e,source:a,remaining:n,errors:[]})},cut:function(e){return new t({status:"cut",remaining:e,errors:[]})}};var t=function(e){this._value=e.value,this._status=e.status,this._hasValue=void 0!==e.value,this._remaining=e.remaining,this._source=e.source,this._errors=e.errors};t.prototype.map=function(e){return this._hasValue?new t({value:e(this._value,this._source),status:this._status,remaining:this._remaining,source:this._source,errors:this._errors}):this},t.prototype.changeRemaining=function(e){return new t({value:this._value,status:this._status,remaining:e,source:this._source,errors:this._errors})},t.prototype.isSuccess=function(){return"success"===this._status||"cut"===this._status},t.prototype.isFailure=function(){return"failure"===this._status},t.prototype.isError=function(){return"error"===this._status},t.prototype.isCut=function(){return"cut"===this._status},t.prototype.value=function(){return this._value},t.prototype.remaining=function(){return this._remaining},t.prototype.source=function(){return this._source},t.prototype.errors=function(){return this._errors}},6192(e,t,n){var a=n(2013),r=n(894);t.RegexTokeniser=function(e){function t(t,n,r){for(var o=0;o<e.length;o++){var i=e[o].regex;i.lastIndex=n;var s=i.exec(t);if(s){var l=n+s[0].length;if(s.index===n&&l>n){var c=s[1];return{token:new a(e[o].name,c,r.range(n,l)),endIndex:l}}}}l=n+1;return{token:new a("unrecognisedCharacter",t.substring(n,l),r.range(n,l)),endIndex:l}}function n(e,t){return new a("end",null,t.range(e.length,e.length))}return e=e.map(function(e){return{name:e.name,regex:new RegExp(e.regex.source,"g")}}),{tokenise:function(e,a){var o=new r(e,a),i=0,s=[];for(;i<e.length;){var l=t(e,i,o);i=l.endIndex,s.push(l.token)}return s.push(n(e,o)),s}}}},8815(e,t,n){var a=n(4523),r=n(9228),o=n(315),i=n(3649),s=n(5758);t.token=function(e,t){var n=void 0!==t;return function(a){var r=a.head();return!r||r.name!==e||n&&r.value!==t?u(a,p({name:e,value:t})):o.success(r.value,a.tail(),r.source)}},t.tokenOfType=function(e){return t.token(e)},t.firstOf=function(e,t){return a.isArray(t)||(t=Array.prototype.slice.call(arguments,1)),function(n){return s.fromArray(t).map(function(e){return e(n)}).filter(function(e){return e.isSuccess()||e.isError()}).first()||u(n,e)}},t.then=function(e,t){return function(n){var a=e(n);return a.map,a.map(t)}},t.sequence=function(){var e=Array.prototype.slice.call(arguments,0),n=function(n){var r=a.foldl(e,function(e,t){var a=e.result,r=e.hasCut;if(!a.isSuccess())return{result:a,hasCut:r};var i=t(a.remaining());if(i.isCut())return{result:a,hasCut:!0};if(i.isSuccess()){var s;s=t.isCaptured?a.value().withValue(t,i.value()):a.value();var l=i.remaining(),c=n.to(l);return{result:o.success(s,l,c),hasCut:r}}return r?{result:o.error(i.errors(),i.remaining()),hasCut:r}:{result:i,hasCut:r}},{result:o.success(new l,n),hasCut:!1}).result,i=n.to(r.remaining());return r.map(function(e){return e.withValue(t.sequence.source,i)})};function r(e){return e.isCaptured}return n.head=function(){var o=a.find(e,r);return t.then(n,t.sequence.extract(o))},n.map=function(e){return t.then(n,function(t){return e.apply(this,t.toArray())})},n};var l=function(e,t){this._values=e||{},this._valuesArray=t||[]};l.prototype.withValue=function(e,t){if(e.captureName&&e.captureName in this._values)throw new Error('Cannot add second value for capture "'+e.captureName+'"');var n=a.clone(this._values);n[e.captureName]=t;var r=this._valuesArray.concat([t]);return new l(n,r)},l.prototype.get=function(e){if(e.captureName in this._values)return this._values[e.captureName];throw new Error('No value for capture "'+e.captureName+'"')},l.prototype.toArray=function(){return this._valuesArray},t.sequence.capture=function(e,t){var n=function(){return e.apply(this,arguments)};return n.captureName=t,n.isCaptured=!0,n},t.sequence.extract=function(e){return function(t){return t.get(e)}},t.sequence.applyValues=function(e){var t=Array.prototype.slice.call(arguments,1);return function(n){var a=t.map(function(e){return n.get(e)});return e.apply(this,a)}},t.sequence.source={captureName:"☃source☃"},t.sequence.cut=function(){return function(e){return o.cut(e)}},t.optional=function(e){return function(t){var n=e(t);return n.isSuccess()?n.map(r.some):n.isFailure()?o.success(r.none,t):n}},t.zeroOrMoreWithSeparator=function(e,t){return m(e,t,!1)},t.oneOrMoreWithSeparator=function(e,t){return m(e,t,!0)};var c=t.zeroOrMore=function(e){return function(t){for(var n,a=[];(n=e(t))&&n.isSuccess();)t=n.remaining(),a.push(n.value());return n.isError()?n:o.success(a,t)}};function d(e){return o.success(null,e)}t.oneOrMore=function(e){return t.oneOrMoreWithSeparator(e,d)};var m=function(e,n,a){return function(r){var i=e(r);if(i.isSuccess()){var s=t.sequence.capture(e,"main"),l=c(t.then(t.sequence(n,s),t.sequence.extract(s)))(i.remaining());return o.success([i.value()].concat(l.value()),l.remaining())}return a||i.isError()?i:o.success([],r)}};t.leftAssociative=function(e,n,a){var r;r=(r=a?[{func:a,rule:n}]:n).map(function(e){return t.then(e.rule,function(t){return function(n,a){return e.func(n,t,a)}})});var i=t.firstOf.apply(null,["rules"].concat(r));return function(t){var n=t,a=e(t);if(!a.isSuccess())return a;for(var r=i(a.remaining());r.isSuccess();){var s=r.remaining(),l=n.to(r.remaining()),c=r.value();a=o.success(c(a.value(),l),s,l),r=i(a.remaining())}return r.isError()?r:a}},t.leftAssociative.firstOf=function(){return Array.prototype.slice.call(arguments,0)},t.nonConsuming=function(e){return function(t){return e(t).changeRemaining(t)}};var p=function(e){return e.value?e.name+' "'+e.value+'"':e.name};function u(e,t){var n,a=e.head();return n=a?i.error({expected:t,actual:p(a),location:a.source}):i.error({expected:t,actual:"end of tokens"}),o.failure([n],e)}},1719(e,t,n){var a=n(5818);t.s=function(){return{read:function(e){return a.reject(new Error("could not open external image: '"+e+"'\ncannot open linked files from a web browser"))}}}},2051(e,t,n){var a=n(5818),r=n(7227);t.openZip=function(e){return e.arrayBuffer?a.resolve(r.openArrayBuffer(e.arrayBuffer)):a.reject(new Error("Could not find file in options"))}},8154(e,t,n){var a=n(4523),r=n(5818),o=n(6364),i=n(2761),s=n(376),l=n(1842),c=n(1754),d=n(7357);function m(e,t){var n=1,m=[],f=[],v=void 0===(e=a.extend({ignoreEmptyParagraphs:!0},e)).idPrefix?"":e.idPrefix,y=e.ignoreEmptyParagraphs,x=i.topLevelElement("p"),w=e.styleMap||[];function k(e,t,n){return g(e,function(e){return E(e,t,n)})}function E(e,t,n){if(!n)throw new Error("options not set");var a=L[e.type];return a?a(e,t,n):[]}function S(e,t){var n=C({type:e});return n||(t?i.element(t,{},{fresh:!1}):i.empty)}function C(e,t){var n=T(e);return n?n.to:t}function T(e){for(var t=0;t<w.length;t++)if(w[t].from.matches(e))return w[t]}function A(e){return _(e.noteType,e.noteId)}function D(e){return N(e.noteType,e.noteId)}function _(e,t){return M(e+"-"+t)}function N(e,t){return M(e+"-ref-"+t)}function M(e){return v+e}var I=i.elements([i.element("table",{},{fresh:!0})]);function R(e,t,n){var a=e.label,r=e.comment,o=k(r.body,t,n).concat([c.nonFreshElement("p",{},[c.text(" "),c.freshElement("a",{href:"#"+N("comment",r.commentId)},[c.text("↑")])])]);return[c.freshElement("dt",{id:_("comment",r.commentId)},[c.text("Comment "+a)]),c.freshElement("dd",{},o)]}var B,P,L={document:function(e,t,n){var a=k(e.children,t,n),r=k(m.map(function(t){return e.notes.resolve(t)}),t,n);return a.concat([c.freshElement("ol",{},r),c.freshElement("dl",{},g(f,function(e){return R(e,t,n)}))])},paragraph:function(e,t,n){return function(e,t){var n=T(e);return n?n.to:(e.styleId&&t.push(u("paragraph",e)),x)}(e,t).wrap(function(){var a=k(e.children,t,n);return y?a:[c.forceWrite].concat(a)})},run:function(e,t,n){var a=function(){return k(e.children,t,n)},r=[];if(null!==e.highlight){var s=C({type:"highlight",color:e.highlight});s&&r.push(s)}e.isSmallCaps&&r.push(S("smallCaps")),e.isAllCaps&&r.push(S("allCaps")),e.isStrikethrough&&r.push(S("strikethrough","s")),e.isUnderline&&r.push(S("underline")),e.verticalAlignment===o.verticalAlignment.subscript&&r.push(i.element("sub",{},{fresh:!1})),e.verticalAlignment===o.verticalAlignment.superscript&&r.push(i.element("sup",{},{fresh:!1})),e.isItalic&&r.push(S("italic","em")),e.isBold&&r.push(S("bold","strong"));var l=i.empty,c=T(e);return c?l=c.to:e.styleId&&t.push(u("run",e)),r.push(l),r.forEach(function(e){a=e.wrap.bind(e,a)}),a()},text:function(e,t,n){return[c.text(e.value)]},tab:function(e,t,n){return[c.text("\t")]},hyperlink:function(e,t,n){var a={href:e.anchor?"#"+M(e.anchor):e.href};null!=e.targetFrame&&(a.target=e.targetFrame);var r=k(e.children,t,n);return[c.nonFreshElement("a",a,r)]},checkbox:function(e){var t={type:"checkbox"};return e.checked&&(t.checked="checked"),[c.freshElement("input",t)]},bookmarkStart:function(e,t,n){return[c.freshElement("a",{id:M(e.name)},[c.forceWrite])]},noteReference:function(e,t,a){m.push(e);var r=c.freshElement("a",{href:"#"+A(e),id:D(e)},[c.text("["+n+++"]")]);return[c.freshElement("sup",{},[r])]},note:function(e,t,n){var a=k(e.body,t,n),r=c.elementWithTag(i.element("p",{},{fresh:!1}),[c.text(" "),c.freshElement("a",{href:"#"+D(e)},[c.text("↑")])]),o=a.concat([r]);return c.freshElement("li",{id:A(e)},o)},commentReference:function(e,n,a){return C(e,i.ignore).wrap(function(){var n=t[e.commentId],a=f.length+1,r="["+b(n)+a+"]";return f.push({label:r,comment:n}),[c.freshElement("a",{href:"#"+_("comment",e.commentId),id:N("comment",e.commentId)},[c.text(r)])]})},comment:R,image:(P=e.convertImage||l.dataUri,B=function(e,t){return r.attempt(function(){return P(e,t)}).caught(function(e){return t.push(s.error(e)),[]})},function(e,t,n){return[{type:"deferred",id:p++,value:function(){return B(e,t,n)}}]}),table:function(e,t,n){return C(e,I).wrap(function(){return function(e,t,n){var r,i=a.findIndex(e.children,function(e){return!e.type===o.types.tableRow||!e.isHeader});-1===i&&(i=e.children.length);if(0===i)r=k(e.children,t,a.extend({},n,{isTableHeader:!1}));else{var s=k(e.children.slice(0,i),t,a.extend({},n,{isTableHeader:!0})),l=k(e.children.slice(i),t,a.extend({},n,{isTableHeader:!1}));r=[c.freshElement("thead",{},s),c.freshElement("tbody",{},l)]}return[c.forceWrite].concat(r)}(e,t,n)})},tableRow:function(e,t,n){var a=k(e.children,t,n);return[c.freshElement("tr",{},[c.forceWrite].concat(a))]},tableCell:function(e,t,n){var a=n.isTableHeader?"th":"td",r=k(e.children,t,n),o={};return 1!==e.colSpan&&(o.colspan=e.colSpan.toString()),1!==e.rowSpan&&(o.rowspan=e.rowSpan.toString()),[c.freshElement(a,o,[c.forceWrite].concat(r))]},break:function(e,t,n){return function(e){var t=T(e);return t?t.to:"line"===e.breakType?i.topLevelElement("br"):i.empty}(e).wrap(function(){return[]})}};return{convertToHtml:function(t){var n=[],o=E(t,n,{}),i=[];h(o,function(e){"deferred"===e.type&&i.push(e)});var l={};return r.mapSeries(i,function(e){return e.value().then(function(t){l[e.id]=t})}).then(function(){var t=d.writer({prettyPrint:e.prettyPrint,outputFormat:e.outputFormat});return c.write(t,c.simplify(function e(t){return g(t,function(t){return"deferred"===t.type?l[t.id]:t.children?[a.extend({},t,{children:e(t.children)})]:[t]})}(o))),new s.Result(t.asString(),n)})}}}t.w=function(e){return{convertToHtml:function(t){var n=a.indexBy(t.type===o.types.document?t.comments:[],"commentId");return new m(e,n).convertToHtml(t)}}};var p=1;function u(e,t){return s.warning("Unrecognised "+e+" style: '"+t.styleName+"' (Style ID: "+t.styleId+")")}function g(e,t){return a.flatten(e.map(t),!0)}function h(e,t){e.forEach(function(e){t(e),e.children&&h(e.children,t)})}var b=function(e){return e.authorInitials||""}},6364(e,t,n){var a=n(4523),r=t.types={document:"document",paragraph:"paragraph",run:"run",text:"text",tab:"tab",checkbox:"checkbox",hyperlink:"hyperlink",noteReference:"noteReference",image:"image",note:"note",commentReference:"commentReference",comment:"comment",table:"table",tableRow:"tableRow",tableCell:"tableCell",break:"break",bookmarkStart:"bookmarkStart"};var o={baseline:"baseline",superscript:"superscript",subscript:"subscript"};function i(e){this._notes=a.indexBy(e,function(e){return s(e.noteType,e.noteId)})}function s(e,t){return e+"-"+t}function l(e){return{type:r.break,breakType:e}}i.prototype.resolve=function(e){return this.findNoteByKey(s(e.noteType,e.noteId))},i.prototype.findNoteByKey=function(e){return this._notes[e]||null},t.document=t.Document=function(e,t){return{type:r.document,children:e,notes:(t=t||{}).notes||new i({}),comments:t.comments||[]}},t.paragraph=t.Paragraph=function(e,t){var n=(t=t||{}).indent||{};return{type:r.paragraph,children:e,styleId:t.styleId||null,styleName:t.styleName||null,numbering:t.numbering||null,alignment:t.alignment||null,indent:{start:n.start||null,end:n.end||null,firstLine:n.firstLine||null,hanging:n.hanging||null}}},t.run=t.Run=function(e,t){return{type:r.run,children:e,styleId:(t=t||{}).styleId||null,styleName:t.styleName||null,isBold:!!t.isBold,isUnderline:!!t.isUnderline,isItalic:!!t.isItalic,isStrikethrough:!!t.isStrikethrough,isAllCaps:!!t.isAllCaps,isSmallCaps:!!t.isSmallCaps,verticalAlignment:t.verticalAlignment||o.baseline,font:t.font||null,fontSize:t.fontSize||null,highlight:t.highlight||null}},t.text=t.Text=function(e){return{type:r.text,value:e}},t.tab=t.Tab=function(){return{type:r.tab}},t.checkbox=t.Checkbox=function(e){return{type:r.checkbox,checked:e.checked}},t.Hyperlink=function(e,t){return{type:r.hyperlink,children:e,href:t.href,anchor:t.anchor,targetFrame:t.targetFrame}},t.noteReference=t.NoteReference=function(e){return{type:r.noteReference,noteType:e.noteType,noteId:e.noteId}},t.Notes=i,t.Note=function(e){return{type:r.note,noteType:e.noteType,noteId:e.noteId,body:e.body}},t.commentReference=function(e){return{type:r.commentReference,commentId:e.commentId}},t.comment=function(e){return{type:r.comment,commentId:e.commentId,body:e.body,authorName:e.authorName,authorInitials:e.authorInitials}},t.Image=function(e){return{type:r.image,read:function(t){return t?e.readImage(t):e.readImage().then(function(e){return Buffer.from(e)})},readAsArrayBuffer:function(){return e.readImage()},readAsBase64String:function(){return e.readImage("base64")},readAsBuffer:function(){return e.readImage().then(function(e){return Buffer.from(e)})},altText:e.altText,contentType:e.contentType}},t.Table=function(e,t){return{type:r.table,children:e,styleId:(t=t||{}).styleId||null,styleName:t.styleName||null}},t.TableRow=function(e,t){return{type:r.tableRow,children:e,isHeader:(t=t||{}).isHeader||!1}},t.TableCell=function(e,t){return{type:r.tableCell,children:e,colSpan:null==(t=t||{}).colSpan?1:t.colSpan,rowSpan:null==t.rowSpan?1:t.rowSpan}},t.lineBreak=l("line"),t.pageBreak=l("page"),t.columnBreak=l("column"),t.BookmarkStart=function(e){return{type:r.bookmarkStart,name:e.name}},t.verticalAlignment=o},2105(e,t,n){t.M=function(e){return{readXmlElement:function(t){return new m(e).readXmlElement(t)},readXmlElements:function(t){return new m(e).readXmlElements(t)}}};var a=n(7673),r=n(4523),o=n(6364),i=n(376).Result,s=n(376).warning,l=n(8648),c=n(4397),d=n(1442);function m(e){var t=[],n=[],i=[],m=e.relationships,w=e.contentTypes,k=e.docxFile,E=e.files,S=e.numbering,C=e.styles;function T(e){return x(e.map(A))}function A(e){if("element"===e.type){var t=F[e.name];if(t)return t(e);if(!Object.prototype.hasOwnProperty.call(g,e.name))return h([s("An unrecognised element was ignored: "+e.name)])}return b()}function D(e){return function(e){return B(e,"w:pStyle","Paragraph",C.findParagraphStyleById)}(e).map(function(t){return{type:"paragraphProperties",styleId:t.styleId,styleName:t.name,alignment:e.firstOrEmpty("w:jc").attributes["w:val"],numbering:p(t.styleId,e.firstOrEmpty("w:numPr"),S),indent:_(e.firstOrEmpty("w:ind"))}})}function _(e){return{start:e.attributes["w:start"]||e.attributes["w:left"],end:e.attributes["w:end"]||e.attributes["w:right"],firstLine:e.attributes["w:firstLine"],hanging:e.attributes["w:hanging"]}}function N(e){return function(e){return B(e,"w:rStyle","Run",C.findCharacterStyleById)}(e).map(function(t){var n=e.firstOrEmpty("w:sz").attributes["w:val"],a=/^[0-9]+$/.test(n)?parseInt(n,10)/2:null;return{type:"runProperties",styleId:t.styleId,styleName:t.name,verticalAlignment:e.firstOrEmpty("w:vertAlign").attributes["w:val"],font:e.firstOrEmpty("w:rFonts").attributes["w:ascii"],fontSize:a,isBold:I(e.first("w:b")),isUnderline:M(e.first("w:u")),isItalic:I(e.first("w:i")),isStrikethrough:I(e.first("w:strike")),isAllCaps:I(e.first("w:caps")),isSmallCaps:I(e.first("w:smallCaps")),highlight:R(e.firstOrEmpty("w:highlight").attributes["w:val"])}})}function M(e){if(e){var t=e.attributes["w:val"];return void 0!==t&&"false"!==t&&"0"!==t&&"none"!==t}return!1}function I(e){if(e){var t=e.attributes["w:val"];return"false"!==t&&"0"!==t}return!1}function R(e){return e&&"none"!==e?e:null}function B(e,t,n,a){var r=[],o=e.first(t),i=null,l=null;if(o&&(i=o.attributes["w:val"])){var c=a(i);c?l=c.name:r.push(function(e,t){return s(e+" style with ID "+t+" was referenced but not defined in the document")}(n,i))}return v({styleId:i,name:l},r)}function P(e){return function(e,t){var n=/^\s*HYPERLINK\s+(\\l\s+)?(?:"(.*)"|([^\\]\S*))/.exec(e);if(n){var a=void 0===n[2]?n[3]:n[2];return{type:"hyperlink",options:void 0===n[1]?{href:a}:{anchor:a}}}if(/\s*FORMCHECKBOX\s*/.exec(e)){var r=t.firstOrEmpty("w:ffData").firstOrEmpty("w:checkBox"),o=r.first("w:checked");return{type:"checkbox",checked:I(null==o?r.first("w:default"):o)}}return{type:"unknown"}}(n.join(""),"begin"===e.type?e.fldChar:l.emptyElement)}function L(e){return function(t){var n=t.attributes["w:id"];return f(new o.NoteReference({noteType:e,noteId:n}))}}function U(e){return T(e.children)}var F={"w:p":function(e){var t=e.firstOrEmpty("w:pPr");if(!!t.firstOrEmpty("w:rPr").first("w:del"))return e.children.forEach(function(e){i.push(e)}),b();var n=e.children;return i.length>0&&(n=i.concat(n),i=[]),y.map(D(t),T(n),function(e,t){return new o.Paragraph(t,e)}).insertExtra()},"w:r":function(e){return y.map(N(e.firstOrEmpty("w:rPr")),T(e.children),function(e,n){var a,i=(a=r.last(t.filter(function(e){return"hyperlink"===e.type})))?a.options:null;return null!==i&&(n=[new o.Hyperlink(n,i)]),new o.Run(n,e)})},"w:fldChar":function(e){var a=e.attributes["w:fldCharType"];if("begin"===a)t.push({type:"begin",fldChar:e}),n=[];else if("end"===a){var r=t.pop();if("begin"===r.type&&(r=P(r)),"checkbox"===r.type)return f(o.checkbox({checked:r.checked}))}else if("separate"===a){var i=P(t.pop());t.push(i)}return b()},"w:instrText":function(e){return n.push(e.text()),b()},"w:t":function(e){return f(new o.Text(e.text()))},"w:tab":function(e){return f(new o.Tab)},"w:noBreakHyphen":function(){return f(new o.Text("‑"))},"w:softHyphen":function(e){return f(new o.Text("­"))},"w:sym":function(e){var t=e.attributes["w:font"],n=e.attributes["w:char"],r=a.hex(t,n);return null==r&&/^F0..$/.test(n)&&(r=a.hex(t,n.substring(2))),null==r?h([s("A w:sym element with an unsupported character was ignored: char "+n+" in font "+t)]):f(new o.Text(r.string))},"w:hyperlink":function(e){var t=e.attributes["r:id"],n=e.attributes["w:anchor"];return T(e.children).map(function(a){function i(t){var n=e.attributes["w:tgtFrame"]||null;return new o.Hyperlink(a,r.extend({targetFrame:n},t))}if(t){var s=m.findTargetByRelationshipId(t);return n&&(s=d.replaceFragment(s,n)),i({href:s})}return n?i({anchor:n}):a})},"w:tbl":function(e){var t=function(e){return function(e){return B(e,"w:tblStyle","Table",C.findTableStyleById)}(e).map(function(e){return{styleId:e.styleId,styleName:e.name}})}(e.firstOrEmpty("w:tblPr"));return T(e.children).flatMap(z).flatMap(function(e){return t.map(function(t){return o.Table(e,t)})})},"w:tr":function(e){var t=e.firstOrEmpty("w:trPr");if(t.first("w:del"))return b();var n=!!t.first("w:tblHeader");return T(e.children).map(function(e){return o.TableRow(e,{isHeader:n})})},"w:tc":function(e){return T(e.children).map(function(t){var n=e.firstOrEmpty("w:tcPr"),a=n.firstOrEmpty("w:gridSpan").attributes["w:val"],r=a?parseInt(a,10):1,i=o.TableCell(t,{colSpan:r});return i._vMerge=function(e){var t=e.first("w:vMerge");if(t){var n=t.attributes["w:val"];return"continue"===n||!n}return null}(n),i})},"w:footnoteReference":L("footnote"),"w:endnoteReference":L("endnote"),"w:commentReference":function(e){return f(o.commentReference({commentId:e.attributes["w:id"]}))},"w:br":function(e){var t=e.attributes["w:type"];return null==t||"textWrapping"===t?f(o.lineBreak):"page"===t?f(o.pageBreak):"column"===t?f(o.columnBreak):h([s("Unsupported break type: "+t)])},"w:bookmarkStart":function(e){var t=e.attributes["w:name"];return"_GoBack"===t?b():f(new o.BookmarkStart({name:t}))},"mc:AlternateContent":function(e){return U(e.firstOrEmpty("mc:Fallback"))},"w:sdt":function(e){return T(e.firstOrEmpty("w:sdtContent").children).map(function(t){var n,a=e.firstOrEmpty("w:sdtPr").first("wordml:checkbox");if(a){var r=a.first("wordml:checked"),i=!!r&&("false"!==(n=r.attributes["wordml:val"])&&"0"!==n),s=o.checkbox({checked:i}),l=!1,d=t.map(c._elementsOfType(o.types.text,function(e){return e.value.length>0&&!l?(l=!0,s):e}));return l?d:s}return t})},"w:ins":U,"w:object":U,"w:smartTag":U,"w:drawing":U,"w:pict":function(e){return U(e).toExtra()},"v:roundrect":U,"v:shape":U,"v:textbox":U,"w:txbxContent":U,"wp:inline":W,"wp:anchor":W,"v:imagedata":function(e){var t=e.attributes["r:id"];return t?j(H(t),e.attributes["o:title"]):h([s("A v:imagedata element without a relationship ID was ignored")])},"v:group":U,"v:rect":U};return{readXmlElement:A,readXmlElements:T};function z(e){if(r.any(e,function(e){return e.type!==o.types.tableRow}))return O(e),v(e,[s("unexpected non-row element in table, cell merging may be incorrect")]);if(r.any(e,function(e){return r.any(e.children,function(e){return e.type!==o.types.tableCell})}))return O(e),v(e,[s("unexpected non-cell element in table row, cell merging may be incorrect")]);var t={};return e.forEach(function(e){var n=0;e.children.forEach(function(e){e._vMerge&&t[n]?t[n].rowSpan++:(t[n]=e,e._vMerge=!1),n+=e.colSpan})}),e.forEach(function(e){e.children=e.children.filter(function(e){return!e._vMerge}),e.children.forEach(function(e){delete e._vMerge})}),f(e)}function O(e){e.forEach(function(e){c.getDescendantsOfType(e,o.types.tableCell).forEach(function(e){delete e._vMerge})})}function W(e){return x(e.getElementsByTagName("a:graphic").getElementsByTagName("a:graphicData").getElementsByTagName("pic:pic").getElementsByTagName("pic:blipFill").getElementsByTagName("a:blip").map(q.bind(null,e)))}function q(e,t){var n,a=e.firstOrEmpty("wp:docPr"),r=a.attributes,i=null==(n=r.descr)||/^\s*$/.test(n)?r.title:r.descr,l=function(e){var t=e.attributes["r:embed"],n=e.attributes["r:link"];if(t)return H(t);if(n){var a=m.findTargetByRelationshipId(n);return{path:a,read:E.read.bind(E,a)}}return null}(t);return null===l?h([s("Could not find image file for a:blip element")]):j(l,i).map(function(e){var t=a.firstOrEmpty("a:hlinkClick").attributes["r:id"];if(t){var n=m.findTargetByRelationshipId(t);return new o.Hyperlink([e],{href:n})}return e})}function H(e){var t=d.uriToZipEntryName("word",m.findTargetByRelationshipId(e));return{path:t,read:k.read.bind(k,t)}}function j(e,t){var n=w.findContentType(e.path);return v(o.Image({readImage:e.read,altText:t,contentType:n}),u[n]?[]:s("Image of type "+n+" is unlikely to display in web browsers"))}}function p(e,t,n){var a=t.firstOrEmpty("w:ilvl").attributes["w:val"],r=t.firstOrEmpty("w:numId").attributes["w:val"];if(void 0!==a&&void 0!==r)return n.findLevel(r,a);if(null!=e){var o=n.findLevelByParagraphStyleId(e);if(null!=o)return o}return void 0!==r?n.findLevel(r,"0"):null}var u={"image/png":!0,"image/gif":!0,"image/jpeg":!0,"image/svg+xml":!0,"image/tiff":!0},g={"office-word:wrap":!0,"v:shadow":!0,"v:shapetype":!0,"w:annotationRef":!0,"w:bookmarkEnd":!0,"w:sectPr":!0,"w:proofErr":!0,"w:lastRenderedPageBreak":!0,"w:commentRangeStart":!0,"w:commentRangeEnd":!0,"w:del":!0,"w:footnoteRef":!0,"w:endnoteRef":!0,"w:pPr":!0,"w:rPr":!0,"w:tblPr":!0,"w:tblGrid":!0,"w:trPr":!0,"w:tcPr":!0};function h(e){return new y(null,null,e)}function b(){return new y(null)}function f(e){return new y(e)}function v(e,t){return new y(e,null,t)}function y(e,t,n){this.value=e||[],this.extra=t||[],this._result=new i({element:this.value,extra:t},n),this.messages=this._result.messages}function x(e){var t=i.combine(r.pluck(e,"_result"));return new y(r.flatten(r.pluck(t.value,"element")),r.filter(r.flatten(r.pluck(t.value,"extra")),k),t.messages)}function w(e,t){return r.flatten([e,t])}function k(e){return e}y.prototype.toExtra=function(){return new y(null,w(this.extra,this.value),this.messages)},y.prototype.insertExtra=function(){var e=this.extra;return e&&e.length?new y(w(this.value,e),null,this.messages):this},y.prototype.map=function(e){var t=this._result.map(function(t){return e(t.element)});return new y(t.value,this.extra,t.messages)},y.prototype.flatMap=function(e){var t=this._result.flatMap(function(t){return e(t.element)._result});return new y(t.value.element,w(this.extra,t.value.extra),t.messages)},y.map=function(e,t,n){return new y(n(e.value,t.value),w(e.extra,t.extra),e.messages.concat(t.messages))}},1687(e,t,n){var a=n(6364),r=n(376).Result;t.createCommentsReader=function(e){function t(t){var n=t.attributes["w:id"];function r(e){return(t.attributes[e]||"").trim()||null}return e.readXmlElements(t.children).map(function(e){return a.comment({commentId:n,body:e,authorName:r("w:author"),authorInitials:r("w:initials")})})}return function(e){return r.combine(e.getElementsByTagName("w:comment").map(t))}}},578(e,t){t.readContentTypesFromXml=function(e){var t={},n={};return e.children.forEach(function(e){if("content-types:Default"===e.name&&(t[e.attributes.Extension]=e.attributes.ContentType),"content-types:Override"===e.name){var a=e.attributes.PartName;"/"===a.charAt(0)&&(a=a.substring(1)),n[a]=e.attributes.ContentType}}),a(n,t)};var n={png:"png",gif:"gif",jpeg:"jpeg",jpg:"jpeg",tif:"tiff",tiff:"tiff",bmp:"bmp"};function a(e,t){return{findContentType:function(a){var r=e[a];if(r)return r;var o=a.split("."),i=o[o.length-1];if(t.hasOwnProperty(i))return t[i];var s=n[i.toLowerCase()];return s?"image/"+s:null}}}t.defaultContentTypes=a({},{})},1386(e,t,n){t.O=function(e){var t=e.bodyReader;return{convertXmlToDocument:function(n){var o=n.first("w:body");if(null==o)throw new Error("Could not find the body element: are you sure this is a docx file?");var i=t.readXmlElements(o.children).map(function(t){return new a.Document(t,{notes:e.notes,comments:e.comments})});return new r(i.value,i.messages)}}};var a=n(6364),r=n(376).Result},175(e,t,n){t.read=function(e,t,n){t=t||{};var i=new b({externalFileAccess:(n=n||{}).externalFileAccess,relativeToFile:t.path});return a.props({contentTypes:k(e),partPaths:f(e),docxFile:e,files:i}).also(function(t){return{styles:(n=e,a=t.partPaths.styles,y({filename:a,readElement:u.readStylesXml,defaultValue:u.defaultStyles})(n))};var n,a}).also(function(t){return{numbering:(n=e,a=t.partPaths.numbering,r=t.styles,y({filename:a,readElement:function(e){return p.readNumberingXml(e,{styles:r})},defaultValue:p.defaultNumbering})(n))};var n,a,r}).also(function(e){return{footnotes:x(e.partPaths.footnotes,e,function(e,t){return t?g.createFootnotesReader(e)(t):new o([])}),endnotes:x(e.partPaths.endnotes,e,function(e,t){return t?g.createEndnotesReader(e)(t):new o([])}),comments:x(e.partPaths.comments,e,function(e,t){return t?h.createCommentsReader(e)(t):new o([])})}}).also(function(e){return{notes:e.footnotes.flatMap(function(t){return e.endnotes.map(function(e){return new r.Notes(t.concat(e))})})}}).then(function(e){return x(e.partPaths.mainDocument,e,function(t,n){return e.notes.flatMap(function(a){return e.comments.flatMap(function(e){return new c({bodyReader:t,notes:a,comments:e}).convertXmlToDocument(n)})})})})},t._findPartPaths=f;var a=n(5818),r=n(6364),o=n(376).Result,i=n(7227),s=n(433).V,l=n(2105).M,c=n(1386).O,d=n(7e3),m=n(578),p=n(4794),u=n(1343),g=n(3686),h=n(1687),b=n(1719).s;function f(e){return E(e).then(function(t){var n=v({docxFile:e,relationships:t,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",basePath:"",fallbackPath:"word/document.xml"});if(!e.exists(n))throw new Error("Could not find main document part. Are you sure this is a valid .docx file?");return y({filename:w(n),readElement:d.readRelationships,defaultValue:d.defaultValue})(e).then(function(t){function a(a){return v({docxFile:e,relationships:t,relationshipType:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/"+a,basePath:i.splitPath(n).dirname,fallbackPath:"word/"+a+".xml"})}return{mainDocument:n,comments:a("comments"),endnotes:a("endnotes"),footnotes:a("footnotes"),numbering:a("numbering"),styles:a("styles")}})})}function v(e){var t=e.docxFile,n=e.relationships,a=e.relationshipType,r=e.basePath,o=e.fallbackPath,s=n.findTargetsByType(a).map(function(e){return t=i.joinPath(r,e),n="/",t.substring(0,n.length)===n?t.substring(n.length):t;var t,n}).filter(function(e){return t.exists(e)});return 0===s.length?o:s[0]}function y(e){return function(t){return s(t,e.filename).then(function(t){return t?e.readElement(t):e.defaultValue})}}function x(e,t,n){return y({filename:w(e),readElement:d.readRelationships,defaultValue:d.defaultValue})(t.docxFile).then(function(a){var r=new l({relationships:a,contentTypes:t.contentTypes,docxFile:t.docxFile,numbering:t.numbering,styles:t.styles,files:t.files});return s(t.docxFile,e).then(function(e){return n(r,e)})})}function w(e){var t=i.splitPath(e);return i.joinPath(t.dirname,"_rels",t.basename+".rels")}var k=y({filename:"[Content_Types].xml",readElement:m.readContentTypesFromXml,defaultValue:m.defaultContentTypes});var E=y({filename:"_rels/.rels",readElement:d.readRelationships,defaultValue:d.defaultValue})},3686(e,t,n){var a=n(6364),r=n(376).Result;function o(e,t){function n(e){var t=e.attributes["w:type"];return"continuationSeparator"!==t&&"separator"!==t}function o(n){var r=n.attributes["w:id"];return t.readXmlElements(n.children).map(function(t){return a.Note({noteType:e,noteId:r,body:t})})}return function(t){return r.combine(t.getElementsByTagName("w:"+e).filter(n).map(o))}}t.createFootnotesReader=o.bind(this,"footnote"),t.createEndnotesReader=o.bind(this,"endnote")},4794(e,t,n){var a=n(4523);function r(e,t,n){var r=a.flatten(a.values(t).map(function(e){return a.values(e.levels)})),o=a.indexBy(r.filter(function(e){return null!=e.paragraphStyleId}),"paragraphStyleId");return{findLevel:function a(r,o){var i=e[r];if(i){var s=t[i.abstractNumId];return s?null==s.numStyleLink?t[i.abstractNumId].levels[o]:a(n.findNumberingStyleById(s.numStyleLink).numId,o):null}return null},findLevelByParagraphStyleId:function(e){return o[e]||null}}}t.readNumberingXml=function(e,t){if(!t||!t.styles)throw new Error("styles is missing");var n=function(e){var t={};return e.getElementsByTagName("w:abstractNum").forEach(function(e){var n=e.attributes["w:abstractNumId"];t[n]=function(e){var t={},n=null;e.getElementsByTagName("w:lvl").forEach(function(e){var a=e.attributes["w:ilvl"],r="bullet"!==e.firstOrEmpty("w:numFmt").attributes["w:val"],o=e.firstOrEmpty("w:pStyle").attributes["w:val"];void 0===a?n={isOrdered:r,level:"0",paragraphStyleId:o}:t[a]={isOrdered:r,level:a,paragraphStyleId:o}}),null!==n&&void 0===t[n.level]&&(t[n.level]=n);var a=e.firstOrEmpty("w:numStyleLink").attributes["w:val"];return{levels:t,numStyleLink:a}}(e)}),t}(e);return new r(function(e){var t={};return e.getElementsByTagName("w:num").forEach(function(e){var n=e.attributes["w:numId"],a=e.first("w:abstractNumId").attributes["w:val"];t[n]={abstractNumId:a}}),t}(e),n,t.styles)},t.Numbering=r,t.defaultNumbering=new r({},{})},433(e,t,n){var a=n(4523),r=n(5818),o=n(8648);t.V=function(e,t){return e.exists(t)?e.read(t,"utf-8").then(l).then(s):r.resolve(null)};var i={"http://schemas.openxmlformats.org/wordprocessingml/2006/main":"w","http://schemas.openxmlformats.org/officeDocument/2006/relationships":"r","http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing":"wp","http://schemas.openxmlformats.org/drawingml/2006/main":"a","http://schemas.openxmlformats.org/drawingml/2006/picture":"pic","http://purl.oclc.org/ooxml/wordprocessingml/main":"w","http://purl.oclc.org/ooxml/officeDocument/relationships":"r","http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing":"wp","http://purl.oclc.org/ooxml/drawingml/main":"a","http://purl.oclc.org/ooxml/drawingml/picture":"pic","http://schemas.openxmlformats.org/package/2006/content-types":"content-types","http://schemas.openxmlformats.org/package/2006/relationships":"relationships","http://schemas.openxmlformats.org/markup-compatibility/2006":"mc","urn:schemas-microsoft-com:vml":"v","urn:schemas-microsoft-com:office:word":"office-word","http://schemas.microsoft.com/office/word/2010/wordml":"wordml"};function s(e){return o.readString(e,i).then(function(e){return c(e)[0]})}function l(e){return e.replace(/^\uFEFF/g,"")}function c(e){return"element"===e.type?"mc:AlternateContent"===e.name?e.firstOrEmpty("mc:Fallback").children:(e.children=a.flatten(e.children.map(c,!0)),[e]):[e]}},7e3(e,t){function n(e){var t={};e.forEach(function(e){t[e.relationshipId]=e.target});var n={};return e.forEach(function(e){n[e.type]||(n[e.type]=[]),n[e.type].push(e.target)}),{findTargetByRelationshipId:function(e){return t[e]},findTargetsByType:function(e){return n[e]||[]}}}t.readRelationships=function(e){var t=[];return e.children.forEach(function(e){if("relationships:Relationship"===e.name){var n={relationshipId:e.attributes.Id,target:e.attributes.Target,type:e.attributes.Type};t.push(n)}}),new n(t)},t.defaultValue=new n([]),t.Relationships=n},5331(e,t,n){var a=n(4523),r=n(5818),o=n(8648);t.writeStyleMap=function(e,t){return e.write(i,t),function(e){var t="word/_rels/document.xml.rels",n="http://schemas.openxmlformats.org/package/2006/relationships",a="{"+n+"}Relationship";return e.read(t,"utf8").then(o.readString).then(function(r){l(r.children,a,"Id",{Id:"rMammothStyleMap",Type:"http://schemas.zwobble.org/mammoth/style-map",Target:s});var i={"":n};return e.write(t,o.writeString(r,i))})}(e).then(function(){return function(e){var t="[Content_Types].xml",n="http://schemas.openxmlformats.org/package/2006/content-types",a="{"+n+"}Override";return e.read(t,"utf8").then(o.readString).then(function(r){l(r.children,a,"PartName",{PartName:s,ContentType:"text/prs.mammoth.style-map"});var i={"":n};return e.write(t,o.writeString(r,i))})}(e)})},t.readStyleMap=function(e){return e.exists(i)?e.read(i,"utf8"):r.resolve(null)};var i="mammoth/style-map",s="/"+i;function l(e,t,n,r){var i=a.find(e,function(e){return e.name===t&&e.attributes[n]===r[n]});i?i.attributes=r:e.push(o.element(t,r))}},1343(e,t){function n(e,t,n,a){return{findParagraphStyleById:function(t){return e[t]},findCharacterStyleById:function(e){return t[e]},findTableStyleById:function(e){return n[e]},findNumberingStyleById:function(e){return a[e]}}}function a(e){return e.attributes["w:styleId"]}t.readStylesXml=function(e){var t={},r={},o={},i={},s={paragraph:t,character:r,table:o,numbering:i};return e.getElementsByTagName("w:style").forEach(function(e){var t=function(e){var t=e.attributes["w:type"];if("numbering"===t)return function(e,t){var n=a(t),r=t.firstOrEmpty("w:pPr").firstOrEmpty("w:numPr").firstOrEmpty("w:numId").attributes["w:val"];return{type:e,numId:r,styleId:n}}(t,e);var n=a(e),r=function(e){var t=e.first("w:name");return t?t.attributes["w:val"]:null}(e);return{type:t,styleId:n,name:r}}(e),n=s[t.type];n&&void 0===n[t.styleId]&&(n[t.styleId]=t)}),new n(t,r,o,i)},t.Styles=n,t.defaultStyles=new n({},{}),n.EMPTY=new n({},{},{},{})},1442(e,t){t.uriToZipEntryName=function(e,t){return"/"===t.charAt(0)?t.substr(1):e+"/"+t},t.replaceFragment=function(e,t){var n=e.indexOf("#");-1!==n&&(e=e.substring(0,n));return e+"#"+t}},6514(e,t,n){var a=n(2761);function r(e,t){return{type:"element",tag:e,children:t||[]}}t.freshElement=function(e,t,n){return r(a.element(e,t,{fresh:!0}),n)},t.nonFreshElement=function(e,t,n){return r(a.element(e,t,{fresh:!1}),n)},t.elementWithTag=r,t.text=function(e){return{type:"text",value:e}},t.forceWrite={type:"forceWrite"};var o={br:!0,hr:!0,img:!0,input:!0};t.isVoidElement=function(e){return 0===e.children.length&&o[e.tag.tagName]}},1754(e,t,n){var a=n(6514);function r(e,t){t.forEach(function(t){!function(e,t){o[t.type](e,t)}(e,t)})}t.freshElement=a.freshElement,t.nonFreshElement=a.nonFreshElement,t.elementWithTag=a.elementWithTag,t.text=a.text,t.forceWrite=a.forceWrite,t.simplify=n(5695);var o={element:function(e,t){a.isVoidElement(t)?e.selfClosing(t.tag.tagName,t.tag.attributes):(e.open(t.tag.tagName,t.tag.attributes),r(e,t.children),e.close(t.tag.tagName))},text:function(e,t){e.text(t.value)},forceWrite:function(){}};t.write=r},5695(e,t,n){var a=n(4523),r=n(6514);function o(e){var t=[];return e.map(i).forEach(function(e){c(t,e)}),t}function i(e){return s[e.type](e)}var s={element:function(e){return r.elementWithTag(e.tag,o(e.children))},text:l,forceWrite:l};function l(e){return e}function c(e,t){var n=e[e.length-1];"element"===t.type&&!t.tag.fresh&&n&&"element"===n.type&&t.tag.matchesElement(n.tag)?(t.tag.separator&&c(n.children,r.text(t.tag.separator)),t.children.forEach(function(e){c(n.children,e)})):e.push(t)}function d(e){return t=e,n=function(e){return m[e.type](e)},a.flatten(a.map(t,n),!0);var t,n}var m={element:function(e){var t=d(e.children);return 0!==t.length||r.isVoidElement(e)?[r.elementWithTag(e.tag,t)]:[]},text:function(e){return 0===e.value.length?[]:[e]},forceWrite:function(e){return[e]}};e.exports=function(e){return o(d(e))}},1842(e,t,n){var a=n(4523),r=n(5818),o=n(1754);function i(e){return function(t,n){return r.when(e(t)).then(function(e){var n={};return t.altText&&(n.alt=t.altText),a.extend(n,e),[o.freshElement("img",n)]})}}t.imgElement=i,t.inline=t.imgElement,t.dataUri=i(function(e){return e.readAsBase64String().then(function(t){return{src:"data:"+e.contentType+";base64,"+t}})})},306(e,t,n){var a=n(4523),r=n(175),o=n(5331),i=n(8154).w,s=n(6802).w,l=n(5203)._T,c=n(8986).Tt,d=n(2051),m=n(376).Result;function p(e,t){return t=c(t),d.openZip(e).tap(function(e){return o.readStyleMap(e).then(function(e){t.embeddedStyleMap=e})}).then(function(n){return r.read(n,e,t).then(function(e){return e.map(t.transformDocument)}).then(function(e){return function(e,t){var n=(s=t.readStyleMap(),m.combine((s||[]).map(l)).map(function(e){return e.filter(function(e){return!!e})})),r=a.extend({},t,{styleMap:n.value}),o=new i(r);var s;return e.flatMapThen(function(e){return n.flatMapThen(function(t){return o.convertToHtml(e)})})}(e,t)})})}t.convertToHtml=function(e,t){return p(e,t)},t.convertToMarkdown=function(e,t){var n=Object.create(t||{});return n.outputFormat="markdown",p(e,n)},t.convert=p,t.extractRawText=function(e){return d.openZip(e).then(r.read).then(function(e){return e.map(s)})},t.images=n(1842),t.transforms=n(4397),t.underline=n(374),t.embedStyleMap=function(e,t){return d.openZip(e).tap(function(e){return o.writeStyleMap(e,t)}).then(function(e){return e.toArrayBuffer()}).then(function(e){return{toArrayBuffer:function(){return e},toBuffer:function(){return Buffer.from(e)}}})},t.readEmbeddedStyleMap=function(e){return d.openZip(e).then(o.readStyleMap)},t.styleMapping=function(){throw new Error("Use a raw string instead of mammoth.styleMapping e.g. \"p[style-name='Title'] => h1\" instead of mammoth.styleMapping(\"p[style-name='Title'] => h1\")")}},8986(e,t,n){t.Tt=function(e){return e=e||{},a.extend({},o,e,{customStyleMap:i(e.styleMap),readStyleMap:function(){var e=this.customStyleMap;return this.includeEmbeddedStyleMap&&(e=e.concat(i(this.embeddedStyleMap))),this.includeDefaultStyleMap&&(e=e.concat(r)),e}})};var a=n(4523),r=["p.Heading1 => h1:fresh","p.Heading2 => h2:fresh","p.Heading3 => h3:fresh","p.Heading4 => h4:fresh","p.Heading5 => h5:fresh","p.Heading6 => h6:fresh","p[style-name='Heading 1'] => h1:fresh","p[style-name='Heading 2'] => h2:fresh","p[style-name='Heading 3'] => h3:fresh","p[style-name='Heading 4'] => h4:fresh","p[style-name='Heading 5'] => h5:fresh","p[style-name='Heading 6'] => h6:fresh","p[style-name='heading 1'] => h1:fresh","p[style-name='heading 2'] => h2:fresh","p[style-name='heading 3'] => h3:fresh","p[style-name='heading 4'] => h4:fresh","p[style-name='heading 5'] => h5:fresh","p[style-name='heading 6'] => h6:fresh","p.Heading => h1:fresh","p[style-name='Heading'] => h1:fresh","r[style-name='Strong'] => strong","p[style-name='footnote text'] => p:fresh","r[style-name='footnote reference'] =>","p[style-name='endnote text'] => p:fresh","r[style-name='endnote reference'] =>","p[style-name='annotation text'] => p:fresh","r[style-name='annotation reference'] =>","p[style-name='Footnote'] => p:fresh","r[style-name='Footnote anchor'] =>","p[style-name='Endnote'] => p:fresh","r[style-name='Endnote anchor'] =>","p:unordered-list(1) => ul > li:fresh","p:unordered-list(2) => ul|ol > li > ul > li:fresh","p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh","p:ordered-list(1) => ol > li:fresh","p:ordered-list(2) => ul|ol > li > ol > li:fresh","p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh","r[style-name='Hyperlink'] =>","p[style-name='Normal'] => p:fresh","p.Body => p:fresh","p[style-name='Body'] => p:fresh"],o={externalFileAccess:!1,transformDocument:function(e){return e},includeDefaultStyleMap:!0,includeEmbeddedStyleMap:!0};function i(e){return e?a.isString(e)?e.split("\n").map(function(e){return e.trim()}).filter(function(e){return""!==e&&"#"!==e.charAt(0)}):e:[]}},5818(e,t,n){var a=n(4523),r=n(9979)();t.defer=function(){var e,t,n=new r.Promise(function(n,a){e=n,t=a});return{resolve:e,reject:t,promise:n}},t.when=r.resolve,t.resolve=r.resolve,t.all=r.all,t.props=r.props,t.reject=r.reject,t.promisify=r.promisify,t.mapSeries=r.mapSeries,t.attempt=r.attempt,t.nfcall=function(e){var t=Array.prototype.slice.call(arguments,1);return r.promisify(e).apply(null,t)},r.prototype.fail=r.prototype.caught,r.prototype.also=function(e){return this.then(function(t){var n=a.extend({},t,e(t));return r.props(n)})}},6802(e,t,n){var a=n(6364);t.w=function e(t){if("text"===t.type)return t.value;if(t.type===a.types.tab)return"\t";var n="paragraph"===t.type?"\n\n":"";return(t.children||[]).map(e).join("")+n}},376(e,t,n){var a=n(4523);function r(e,t){this.value=e,this.messages=t||[]}function o(e){var t=[];return a.flatten(a.pluck(e,"messages"),!0).forEach(function(e){(function(e,t){return void 0!==a.find(e,i.bind(null,t))})(t,e)||t.push(e)}),t}function i(e,t){return e.type===t.type&&e.message===t.message}t.Result=r,t.success=function(e){return new r(e,[])},t.warning=function(e){return{type:"warning",message:e}},t.error=function(e){return{type:"error",message:e.message,error:e}},r.prototype.map=function(e){return new r(e(this.value),this.messages)},r.prototype.flatMap=function(e){var t=e(this.value);return new r(t.value,o([this,t]))},r.prototype.flatMapThen=function(e){var t=this;return e(this.value).then(function(e){return new r(e.value,o([t,e]))})},r.combine=function(e){return new r(a.flatten(a.pluck(e,"value")),o(e))}},5203(e,t,n){var a=n(4523),r=n(6324),o=n(7730),i=n(2761),s=n(6039).t,l=n(376);function c(){var e=r.rules.sequence,t=function(e,t){return r.rules.then(r.rules.token("identifier",e),function(){return t})},n=t("p",o.paragraph),i=t("r",o.run),s=r.rules.firstOf("p or r or table",n,i),l=r.rules.sequence(r.rules.tokenOfType("dot"),r.rules.sequence.cut(),r.rules.sequence.capture(m)).map(function(e){return{styleId:e}}),c=r.rules.firstOf("style name matcher",r.rules.then(r.rules.sequence(r.rules.tokenOfType("equals"),r.rules.sequence.cut(),r.rules.sequence.capture(u)).head(),function(e){return{styleName:o.equalTo(e)}}),r.rules.then(r.rules.sequence(r.rules.tokenOfType("startsWith"),r.rules.sequence.cut(),r.rules.sequence.capture(u)).head(),function(e){return{styleName:o.startsWith(e)}})),d=r.rules.sequence(r.rules.tokenOfType("open-square-bracket"),r.rules.sequence.cut(),r.rules.token("identifier","style-name"),r.rules.sequence.capture(c),r.rules.tokenOfType("close-square-bracket")).head(),g=r.rules.firstOf("list type",t("ordered-list",{isOrdered:!0}),t("unordered-list",{isOrdered:!1})),h=e(r.rules.tokenOfType("colon"),e.capture(g),e.cut(),r.rules.tokenOfType("open-paren"),e.capture(p),r.rules.tokenOfType("close-paren")).map(function(e,t){return{list:{isOrdered:e.isOrdered,levelIndex:t-1}}});function b(e){var t=r.rules.firstOf.apply(r.rules.firstOf,["matcher suffix"].concat(e)),n=r.rules.zeroOrMore(t);return r.rules.then(n,function(e){var t={};return e.forEach(function(e){a.extend(t,e)}),t})}var f=e(e.capture(s),e.capture(b([l,d,h]))).map(function(e,t){return e(t)}),v=e(r.rules.token("identifier","table"),e.capture(b([l,d]))).map(function(e){return o.table(e)}),y=t("b",o.bold),x=t("i",o.italic),w=t("u",o.underline),k=t("strike",o.strikethrough),E=t("all-caps",o.allCaps),S=t("small-caps",o.smallCaps),C=e(r.rules.token("identifier","highlight"),r.rules.sequence.capture(r.rules.optional(r.rules.sequence(r.rules.tokenOfType("open-square-bracket"),r.rules.sequence.cut(),r.rules.token("identifier","color"),r.rules.tokenOfType("equals"),r.rules.sequence.capture(u),r.rules.tokenOfType("close-square-bracket")).head()))).map(function(e){return o.highlight({color:e.valueOrElse(void 0)})}),T=t("comment-reference",o.commentReference),A=e(r.rules.token("identifier","br"),e.cut(),r.rules.tokenOfType("open-square-bracket"),r.rules.token("identifier","type"),r.rules.tokenOfType("equals"),e.capture(u),r.rules.tokenOfType("close-square-bracket")).map(function(e){switch(e){case"line":return o.lineBreak;case"page":return o.pageBreak;case"column":return o.columnBreak}});return r.rules.firstOf("element type",f,v,y,x,w,k,E,S,C,T,A)}function d(){var e=r.rules.sequence.capture,t=r.rules.tokenOfType("whitespace"),n=r.rules.then(r.rules.optional(r.rules.sequence(r.rules.tokenOfType("colon"),r.rules.token("identifier","fresh"))),function(e){return e.map(function(){return!0}).valueOrElse(!1)}),a=r.rules.then(r.rules.optional(r.rules.sequence(r.rules.tokenOfType("colon"),r.rules.token("identifier","separator"),r.rules.tokenOfType("open-paren"),e(u),r.rules.tokenOfType("close-paren")).head()),function(e){return e.valueOrElse("")}),o=r.rules.oneOrMoreWithSeparator(m,r.rules.tokenOfType("choice")),s=r.rules.sequence(e(o),e(r.rules.zeroOrMore(v)),e(n),e(a)).map(function(e,t,n,a){var r={},o={};return t.forEach(function(e){e.append&&r[e.name]?r[e.name]+=" "+e.value:r[e.name]=e.value}),n&&(o.fresh=!0),a&&(o.separator=a),i.element(e,r,o)});return r.rules.firstOf("html path",r.rules.then(r.rules.tokenOfType("bang"),function(){return i.ignore}),r.rules.then(r.rules.zeroOrMoreWithSeparator(s,r.rules.sequence(t,r.rules.tokenOfType("gt"),t)),i.elements))}t._T=function(e){return y(k,e)};var m=r.rules.then(r.rules.tokenOfType("identifier"),h),p=r.rules.tokenOfType("integer"),u=r.rules.then(r.rules.tokenOfType("string"),h),g={n:"\n",r:"\r",t:"\t"};function h(e){return e.replace(/\\(.)/g,function(e,t){return g[t]||t})}var b=r.rules.sequence(r.rules.tokenOfType("open-square-bracket"),r.rules.sequence.cut(),r.rules.sequence.capture(m),r.rules.tokenOfType("equals"),r.rules.sequence.capture(u),r.rules.tokenOfType("close-square-bracket")).map(function(e,t){return{name:e,value:t,append:!1}}),f=r.rules.sequence(r.rules.tokenOfType("dot"),r.rules.sequence.cut(),r.rules.sequence.capture(m)).map(function(e){return{name:"class",value:e,append:!0}}),v=r.rules.firstOf("attribute or class",b,f);function y(e,t){var n=s(t),a=r.Parser().parseTokens(e,n);return a.isSuccess()?l.success(a.value()):new l.Result(null,[l.warning(x(t,a))])}function x(e,t){return"Did not understand this style mapping, so ignored it: "+e+"\n"+t.errors().map(w).join("\n")}function w(e){return"Error was at character number "+e.characterNumber()+": Expected "+e.expected+" but got "+e.actual}var k=r.rules.sequence(r.rules.sequence.capture(c()),r.rules.tokenOfType("whitespace"),r.rules.tokenOfType("arrow"),r.rules.sequence.capture(r.rules.optional(r.rules.sequence(r.rules.tokenOfType("whitespace"),r.rules.sequence.capture(d())).head())),r.rules.tokenOfType("end")).map(function(e,t){return{from:e,to:t.valueOrElse(i.empty)}})},7730(e,t){function n(e,t){t=t||{},this._elementType=e,this._styleId=t.styleId,this._styleName=t.styleName,t.list&&(this._listIndex=t.list.levelIndex,this._listIsOrdered=t.list.isOrdered)}function a(e){e=e||{},this._color=e.color}function r(e){e=e||{},this._breakType=e.breakType}function o(e,t){return e.toUpperCase()===t.toUpperCase()}function i(e,t){return 0===t.toUpperCase().indexOf(e.toUpperCase())}t.paragraph=function(e){return new n("paragraph",e)},t.run=function(e){return new n("run",e)},t.table=function(e){return new n("table",e)},t.bold=new n("bold"),t.italic=new n("italic"),t.underline=new n("underline"),t.strikethrough=new n("strikethrough"),t.allCaps=new n("allCaps"),t.smallCaps=new n("smallCaps"),t.highlight=function(e){return new a(e)},t.commentReference=new n("commentReference"),t.lineBreak=new r({breakType:"line"}),t.pageBreak=new r({breakType:"page"}),t.columnBreak=new r({breakType:"column"}),t.equalTo=function(e){return{operator:o,operand:e}},t.startsWith=function(e){return{operator:i,operand:e}},n.prototype.matches=function(e){return e.type===this._elementType&&(void 0===this._styleId||e.styleId===this._styleId)&&(void 0===this._styleName||e.styleName&&this._styleName.operator(this._styleName.operand,e.styleName))&&(void 0===this._listIndex||function(e,t,n){return e.numbering&&e.numbering.level==t&&e.numbering.isOrdered==n}(e,this._listIndex,this._listIsOrdered))&&(void 0===this._breakType||this._breakType===e.breakType)},a.prototype.matches=function(e){return"highlight"===e.type&&(void 0===this._color||e.color===this._color)},r.prototype.matches=function(e){return"break"===e.type&&(void 0===this._breakType||e.breakType===this._breakType)}},2761(e,t,n){var a=n(4523),r=n(1754);function o(e){return new i(e.map(function(e){return a.isString(e)?s(e):e}))}function i(e){this._elements=e}function s(e,t,n){return new l(e,t,n=n||{})}function l(e,t,n){var r={};a.isArray(e)?(e.forEach(function(e){r[e]=!0}),e=e[0]):r[e]=!0,this.tagName=e,this.tagNames=r,this.attributes=t||{},this.fresh=n.fresh,this.separator=n.separator}t.topLevelElement=function(e,t){return o([s(e,t,{fresh:!0})])},t.elements=o,t.element=s,i.prototype.wrap=function(e){for(var t=e(),n=this._elements.length-1;n>=0;n--)t=this._elements[n].wrapNodes(t);return t},l.prototype.matchesElement=function(e){return this.tagNames[e.tagName]&&a.isEqual(this.attributes||{},e.attributes||{})},l.prototype.wrap=function(e){return this.wrapNodes(e())},l.prototype.wrapNodes=function(e){return[r.elementWithTag(this,e)]},t.empty=o([]),t.ignore={wrap:function(){return[]}}},6039(e,t,n){var a=n(6324).RegexTokeniser;t.t=function(e){var t="(?:[a-zA-Z\\-_]|\\\\.)";return new a([{name:"identifier",regex:new RegExp("("+t+"(?:"+t+"|[0-9])*)")},{name:"dot",regex:/\./},{name:"colon",regex:/:/},{name:"gt",regex:/>/},{name:"whitespace",regex:/\s+/},{name:"arrow",regex:/=>/},{name:"equals",regex:/=/},{name:"startsWith",regex:/\^=/},{name:"open-paren",regex:/\(/},{name:"close-paren",regex:/\)/},{name:"open-square-bracket",regex:/\[/},{name:"close-square-bracket",regex:/\]/},{name:"string",regex:new RegExp(r+"'")},{name:"unterminated-string",regex:new RegExp(r)},{name:"integer",regex:/([0-9]+)/},{name:"choice",regex:/\|/},{name:"bang",regex:/(!)/}]).tokenise(e)};var r="'((?:\\\\.|[^'])*)"},4397(e,t,n){var a=n(4523);function r(e,t){return o(function(n){return n.type===e?t(n):n})}function o(e){return function t(n){if(n.children){var r=a.map(n.children,t);n=a.extend(n,{children:r})}return e(n)}}function i(e){var t=[];return s(e,function(e){t.push(e)}),t}function s(e,t){e.children&&e.children.forEach(function(e){s(e,t),t(e)})}t.paragraph=function(e){return r("paragraph",e)},t.run=function(e){return r("run",e)},t._elements=o,t._elementsOfType=r,t.getDescendantsOfType=function(e,t){return i(e).filter(function(e){return e.type===t})},t.getDescendants=i},374(e,t,n){var a=n(2761),r=n(1754);t.element=function(e){return function(t){return r.elementWithTag(a.element(e),[t])}}},4270(e,t,n){var a=n(4523);t.writer=function(e){return(e=e||{}).prettyPrint?function(){var e=0,t="  ",n=[],i=!0,s=!1,l=o();function c(t,a){r[t]&&h(),n.push(t),l.open(t,a),r[t]&&e++,i=!1}function d(t){r[t]&&(e--,h()),n.pop(),l.close(t)}function m(e){g();var n=b()?e:e.replace("\n","\n"+t);l.text(n)}function p(e,t){h(),l.selfClosing(e,t)}function u(){return 0===n.length||r[n[n.length-1]]}function g(){s||(h(),s=!0)}function h(){if(s=!1,!i&&u()&&!b()){l._append("\n");for(var n=0;n<e;n++)l._append(t)}}function b(){return a.some(n,function(e){return"pre"===e})}return{asString:l.asString,open:c,close:d,text:m,selfClosing:p}}():o()};var r={div:!0,p:!0,ul:!0,li:!0};function o(){var e=[];function t(e){return a.map(e,function(e,t){return" "+t+'="'+function(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}(e)+'"'}).join("")}return{asString:function(){return e.join("")},open:function(n,a){var r=t(a);e.push("<"+n+r+">")},close:function(t){e.push("</"+t+">")},text:function(t){e.push(function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}(t))},selfClosing:function(n,a){var r=t(a);e.push("<"+n+r+" />")},_append:function(t){e.push(t)}}}},7357(e,t,n){var a=n(4270),r=n(9622);t.writer=function(e){return"markdown"===(e=e||{}).outputFormat?r.writer():a.writer(e)}},9622(e,t,n){var a=n(4523);function r(e){return o(e,e)}function o(e,t){return function(){return{start:e,end:t}}}function i(e){return function(t,n){return{start:n?"\n":"",end:n?"":"\n",list:{isOrdered:e.isOrdered,indent:n?n.indent+1:0,count:0}}}}var s={p:o("","\n\n"),br:o("","  \n"),ul:i({isOrdered:!1}),ol:i({isOrdered:!0}),li:function(e,t,n){(t=t||{indent:0,isOrdered:!1,count:0}).count++,n.hasClosed=!1;var a=t.isOrdered?t.count+".":"-";return{start:l("\t",t.indent)+a+" ",end:function(){if(!n.hasClosed)return n.hasClosed=!0,"\n"}}},strong:r("__"),em:r("*"),a:function(e){var t=e.href||"";return t?{start:"[",end:"]("+t+")",anchorPosition:"before"}:{}},img:function(e){var t=e.src||"",n=e.alt||"";return t||n?{start:"!["+n+"]("+t+")"}:{}}};function l(e,t){return new Array(t+1).join(e)}!function(){for(var e=1;e<=6;e++)s["h"+e]=o(l("#",e)+" ","\n\n")}(),t.writer=function(){var e=[],t=[],n=null,r={};function o(a,o){o=o||{};var l=(s[a]||function(){return{}})(o,n,r);t.push({end:l.end,list:n}),l.list&&(n=l.list);var c="before"===l.anchorPosition;c&&i(o),e.push(l.start||""),c||i(o)}function i(t){t.id&&e.push('<a id="'+t.id+'"></a>')}function l(r){var o=t.pop();n=o.list;var i=a.isFunction(o.end)?o.end():o.end;e.push(i||"")}return{asString:function(){return e.join("")},open:o,close:l,text:function(t){e.push(function(e){return e.replace(/\\/g,"\\\\").replace(/([\`\*_\{\}\[\]\(\)\#\+\-\.\!])/g,"\\$1")}(t))},selfClosing:function(e,t){o(e,t),l()}}}},8648(e,t,n){var a=n(5581);t.Element=a.Element,t.element=a.element,t.emptyElement=a.emptyElement,t.text=a.text,t.readString=n(4513).readString,t.writeString=n(5533).writeString},5581(e,t,n){var a=n(4523);t.Element=o,t.element=function(e,t,n){return new o(e,t,n)},t.text=function(e){return{type:"text",value:e}};var r=t.emptyElement={first:function(){return null},firstOrEmpty:function(){return r},attributes:{},children:[]};function o(e,t,n){this.type="element",this.name=e,this.attributes=t||{},this.children=n||[]}o.prototype.first=function(e){return a.find(this.children,function(t){return t.name===e})},o.prototype.firstOrEmpty=function(e){return this.first(e)||r},o.prototype.getElementsByTagName=function(e){return s(a.filter(this.children,function(t){return t.name===e}))},o.prototype.text=function(){if(0===this.children.length)return"";if(1!==this.children.length||"text"!==this.children[0].type)throw new Error("Not implemented");return this.children[0].value};var i={getElementsByTagName:function(e){return s(a.flatten(this.map(function(t){return t.getElementsByTagName(e)},!0)))}};function s(e){return a.extend(e,i)}},4513(e,t,n){var a=n(5818),r=n(4523),o=n(9525),i=n(5581),s=i.Element;t.readString=function(e,t){t=t||{};try{var n=o.parseFromString(e,"text/xml")}catch(e){return a.reject(e)}if("parsererror"===n.documentElement.tagName)return a.resolve(new Error(n.documentElement.textContent));function c(e){switch(e.nodeType){case l.ELEMENT_NODE:return function(e){var t=d(e),n=[];r.forEach(e.childNodes,function(e){var t=c(e);t&&n.push(t)});var a={};return r.forEach(e.attributes,function(e){a[d(e)]=e.value}),new s(t,a,n)}(e);case l.TEXT_NODE:return i.text(e.nodeValue)}}function d(e){if(e.namespaceURI){var n=t[e.namespaceURI];return(n?n+":":"{"+e.namespaceURI+"}")+e.localName}return e.localName}return a.resolve(c(n.documentElement))};var l=o.Node},5533(e,t,n){var a=n(4523),r=n(9665);function o(e,t){e.text(t.value)}t.writeString=function(e,t){var n=a.invert(t),i={element:function(e,t){var n=e.element(l(t.name),t.attributes);t.children.forEach(function(e){s(n,e)})},text:o};function s(e,t){return i[t.type](e,t)}function l(e){var t=/^\{(.*)\}(.*)$/.exec(e);if(t){var a=n[t[1]];return a+(""===a?"":":")+t[2]}return e}return function(e){var n=r.create(l(e.name),{version:"1.0",encoding:"UTF-8",standalone:!0});return a.forEach(t,function(e,t){var a="xmlns"+(""===t?"":":"+t);n.attribute(a,e)}),e.children.forEach(function(e){s(n,e)}),n.end()}(e)}},9525(e,t,n){var a=n(8978),r=n(4722);t.parseFromString=function(e){var t=null,n=new a.DOMParser({errorHandler:function(e,n){t={level:e,message:n}}}).parseFromString(e);if(null===t)return n;throw new Error(t.level+": "+t.message)},t.Node=r.Node},7227(e,t,n){var a=n(7526),r=n(1710);t.openArrayBuffer=function(e){return r.loadAsync(e).then(function(e){return{exists:function(t){return null!==e.file(t)},read:function(t,n){return e.file(t).async("uint8array").then(function(e){return"base64"===n?a.fromByteArray(e):n?new TextDecoder(n).decode(e):e})},write:function(t,n){e.file(t,n)},toArrayBuffer:function(){return e.generateAsync({type:"arraybuffer"})}}})},t.splitPath=function(e){var t=e.lastIndexOf("/");return-1===t?{dirname:"",basename:e}:{dirname:e.substring(0,t),basename:e.substring(t+1)}},t.joinPath=function(){var e=Array.prototype.filter.call(arguments,function(e){return e}),t=[];return e.forEach(function(e){/^\//.test(e)?t=[e]:t.push(e)}),t.join("/")}},9228(e,t){function n(e){return"function"==typeof e?e():e}t.none=Object.create({value:function(){throw new Error("Called value on none")},isNone:function(){return!0},isSome:function(){return!1},map:function(){return t.none},flatMap:function(){return t.none},filter:function(){return t.none},toArray:function(){return[]},orElse:n,valueOrElse:n}),t.some=function(e){return new a(e)};var a=function(e){this._value=e};a.prototype.value=function(){return this._value},a.prototype.isNone=function(){return!1},a.prototype.isSome=function(){return!0},a.prototype.map=function(e){return new a(e(this._value))},a.prototype.flatMap=function(e){return e(this._value)},a.prototype.filter=function(e){return e(this._value)?this:t.none},a.prototype.toArray=function(){return[this._value]},a.prototype.orElse=function(e){return this},a.prototype.valueOrElse=function(e){return this._value},t.isOption=function(e){return e===t.none||e instanceof a},t.fromNullable=function(e){return null==e?t.none:new a(e)}},2551(e,t,n){"use strict";var a=n(6540),r=n(9982);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,s={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(s[e]=t,e=0;e<t.length;e++)i.add(t[e])}var d=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),m=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,u={},g={};function h(e,t,n,a,r,o,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=a,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new h(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];b[t]=new h(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new h(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new h(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new h(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new h(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new h(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new h(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new h(e,5,!1,e.toLowerCase(),null,!1,!1)});var f=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function y(e,t,n,a){var r=b.hasOwnProperty(t)?b[t]:null;(null!==r?0!==r.type:a||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,a){if(null==t||function(e,t,n,a){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!a&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,a))return!0;if(a)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,r,a)&&(n=null),a||null===r?function(e){return!!m.call(g,e)||!m.call(u,e)&&(p.test(e)?g[e]=!0:(u[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=null===n?3!==r.type&&"":n:(t=r.attributeName,a=r.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(r=r.type)||4===r&&!0===n?"":""+n,a?e.setAttributeNS(a,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(f,v);b[t]=new h(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(f,v);b[t]=new h(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(f,v);b[t]=new h(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new h(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new h("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new h(e,1,!1,e.toLowerCase(),null,!0,!0)});var x=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for("react.element"),k=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),A=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),I=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var R=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var B=Symbol.iterator;function P(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=B&&e[B]||e["@@iterator"])?e:null}var L,U=Object.assign;function F(e){if(void 0===L)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);L=t&&t[1]||""}return"\n"+L+e}var z=!1;function O(e,t){if(!e||z)return"";z=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var a=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){a=e}e.call(t.prototype)}else{try{throw Error()}catch(e){a=e}e()}}catch(t){if(t&&a&&"string"==typeof t.stack){for(var r=t.stack.split("\n"),o=a.stack.split("\n"),i=r.length-1,s=o.length-1;1<=i&&0<=s&&r[i]!==o[s];)s--;for(;1<=i&&0<=s;i--,s--)if(r[i]!==o[s]){if(1!==i||1!==s)do{if(i--,0>--s||r[i]!==o[s]){var l="\n"+r[i].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=i&&0<=s);break}}}finally{z=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?F(e):""}function W(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=O(e.type,!1);case 11:return e=O(e.type.render,!1);case 1:return e=O(e.type,!0);default:return""}}function q(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case E:return"Fragment";case k:return"Portal";case C:return"Profiler";case S:return"StrictMode";case _:return"Suspense";case N:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case A:return(e.displayName||"Context")+".Consumer";case T:return(e._context.displayName||"Context")+".Provider";case D:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case M:return null!==(t=e.displayName||null)?t:q(e.type)||"Memo";case I:t=e._payload,e=e._init;try{return q(e(t))}catch(e){}}return null}function H(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return q(t);case 8:return t===S?"StrictMode":"Modo";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function j(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function V(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function G(e){e._valueTracker||(e._valueTracker=function(e){var t=V(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var r=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(e){a=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(e){a=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function K(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=V(e)?e.checked?"true":"false":e.value),(e=a)!==n&&(t.setValue(e),!0)}function $(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Y(e,t){var n=t.checked;return U({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function X(e,t){var n=null==t.defaultValue?"":t.defaultValue,a=null!=t.checked?t.checked:t.defaultChecked;n=j(null!=t.value?t.value:n),e._wrapperState={initialChecked:a,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function J(e,t){null!=(t=t.checked)&&y(e,"checked",t,!1)}function Q(e,t){J(e,t);var n=j(t.value),a=t.type;if(null!=n)"number"===a?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===a||"reset"===a)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,n):t.hasOwnProperty("defaultValue")&&ee(e,t.type,j(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Z(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var a=t.type;if(!("submit"!==a&&"reset"!==a||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ee(e,t,n){"number"===t&&$(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var te=Array.isArray;function ne(e,t,n,a){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&a&&(e[n].defaultSelected=!0)}else{for(n=""+j(n),t=null,r=0;r<e.length;r++){if(e[r].value===n)return e[r].selected=!0,void(a&&(e[r].defaultSelected=!0));null!==t||e[r].disabled||(t=e[r])}null!==t&&(t.selected=!0)}}function ae(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return U({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function re(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(te(n)){if(1<n.length)throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:j(n)}}function oe(e,t){var n=j(t.value),a=j(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=a&&(e.defaultValue=""+a)}function ie(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function se(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function le(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?se(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,de,me=(de=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,a){MSApp.execUnsafeLocalFunction(function(){return de(e,t)})}:de);function pe(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var ue={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ge=["Webkit","ms","Moz","O"];function he(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ue.hasOwnProperty(e)&&ue[e]?(""+t).trim():t+"px"}function be(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var a=0===n.indexOf("--"),r=he(n,t[n],a);"float"===n&&(n="cssFloat"),a?e.setProperty(n,r):e[n]=r}}Object.keys(ue).forEach(function(e){ge.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ue[t]=ue[e]})});var fe=U({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ve(e,t){if(t){if(fe[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(o(62))}}function ye(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xe=null;function we(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var ke=null,Ee=null,Se=null;function Ce(e){if(e=yr(e)){if("function"!=typeof ke)throw Error(o(280));var t=e.stateNode;t&&(t=wr(t),ke(e.stateNode,e.type,t))}}function Te(e){Ee?Se?Se.push(e):Se=[e]:Ee=e}function Ae(){if(Ee){var e=Ee,t=Se;if(Se=Ee=null,Ce(e),t)for(e=0;e<t.length;e++)Ce(t[e])}}function De(e,t){return e(t)}function _e(){}var Ne=!1;function Me(e,t,n){if(Ne)return e(t,n);Ne=!0;try{return De(e,t,n)}finally{Ne=!1,(null!==Ee||null!==Se)&&(_e(),Ae())}}function Ie(e,t){var n=e.stateNode;if(null===n)return null;var a=wr(n);if(null===a)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(a=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!a;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(o(231,t,typeof n));return n}var Re=!1;if(d)try{var Be={};Object.defineProperty(Be,"passive",{get:function(){Re=!0}}),window.addEventListener("test",Be,Be),window.removeEventListener("test",Be,Be)}catch(de){Re=!1}function Pe(e,t,n,a,r,o,i,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}var Le=!1,Ue=null,Fe=!1,ze=null,Oe={onError:function(e){Le=!0,Ue=e}};function We(e,t,n,a,r,o,i,s,l){Le=!1,Ue=null,Pe.apply(Oe,arguments)}function qe(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function He(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function je(e){if(qe(e)!==e)throw Error(o(188))}function Ve(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=qe(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,a=t;;){var r=n.return;if(null===r)break;var i=r.alternate;if(null===i){if(null!==(a=r.return)){n=a;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return je(r),e;if(i===a)return je(r),t;i=i.sibling}throw Error(o(188))}if(n.return!==a.return)n=r,a=i;else{for(var s=!1,l=r.child;l;){if(l===n){s=!0,n=r,a=i;break}if(l===a){s=!0,a=r,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,a=r;break}if(l===a){s=!0,a=i,n=r;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==a)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(e))?Ge(e):null}function Ge(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Ge(e);if(null!==t)return t;e=e.sibling}return null}var Ke=r.unstable_scheduleCallback,$e=r.unstable_cancelCallback,Ye=r.unstable_shouldYield,Xe=r.unstable_requestPaint,Je=r.unstable_now,Qe=r.unstable_getCurrentPriorityLevel,Ze=r.unstable_ImmediatePriority,et=r.unstable_UserBlockingPriority,tt=r.unstable_NormalPriority,nt=r.unstable_LowPriority,at=r.unstable_IdlePriority,rt=null,ot=null;var it=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(st(e)/lt|0)|0},st=Math.log,lt=Math.LN2;var ct=64,dt=4194304;function mt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pt(e,t){var n=e.pendingLanes;if(0===n)return 0;var a=0,r=e.suspendedLanes,o=e.pingedLanes,i=268435455&n;if(0!==i){var s=i&~r;0!==s?a=mt(s):0!==(o&=i)&&(a=mt(o))}else 0!==(i=n&~r)?a=mt(i):0!==o&&(a=mt(o));if(0===a)return 0;if(0!==t&&t!==a&&0===(t&r)&&((r=a&-a)>=(o=t&-t)||16===r&&4194240&o))return t;if(4&a&&(a|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=a;0<t;)r=1<<(n=31-it(t)),a|=e[n],t&=~r;return a}function ut(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function gt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function ht(){var e=ct;return!(4194240&(ct<<=1))&&(ct=64),e}function bt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ft(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-it(t)]=n}function vt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-it(n),r=1<<a;r&t|e[a]&t&&(e[a]|=t),n&=~r}}var yt=0;function xt(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var wt,kt,Et,St,Ct,Tt=!1,At=[],Dt=null,_t=null,Nt=null,Mt=new Map,It=new Map,Rt=[],Bt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Pt(e,t){switch(e){case"focusin":case"focusout":Dt=null;break;case"dragenter":case"dragleave":_t=null;break;case"mouseover":case"mouseout":Nt=null;break;case"pointerover":case"pointerout":Mt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":It.delete(t.pointerId)}}function Lt(e,t,n,a,r,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:o,targetContainers:[r]},null!==t&&(null!==(t=yr(t))&&kt(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,null!==r&&-1===t.indexOf(r)&&t.push(r),e)}function Ut(e){var t=vr(e.target);if(null!==t){var n=qe(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=He(n)))return e.blockedOn=t,void Ct(e.priority,function(){Et(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Ft(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Yt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=yr(n))&&kt(t),e.blockedOn=n,!1;var a=new(n=e.nativeEvent).constructor(n.type,n);xe=a,n.target.dispatchEvent(a),xe=null,t.shift()}return!0}function zt(e,t,n){Ft(e)&&n.delete(t)}function Ot(){Tt=!1,null!==Dt&&Ft(Dt)&&(Dt=null),null!==_t&&Ft(_t)&&(_t=null),null!==Nt&&Ft(Nt)&&(Nt=null),Mt.forEach(zt),It.forEach(zt)}function Wt(e,t){e.blockedOn===t&&(e.blockedOn=null,Tt||(Tt=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ot)))}function qt(e){function t(t){return Wt(t,e)}if(0<At.length){Wt(At[0],e);for(var n=1;n<At.length;n++){var a=At[n];a.blockedOn===e&&(a.blockedOn=null)}}for(null!==Dt&&Wt(Dt,e),null!==_t&&Wt(_t,e),null!==Nt&&Wt(Nt,e),Mt.forEach(t),It.forEach(t),n=0;n<Rt.length;n++)(a=Rt[n]).blockedOn===e&&(a.blockedOn=null);for(;0<Rt.length&&null===(n=Rt[0]).blockedOn;)Ut(n),null===n.blockedOn&&Rt.shift()}var Ht=x.ReactCurrentBatchConfig,jt=!0;function Vt(e,t,n,a){var r=yt,o=Ht.transition;Ht.transition=null;try{yt=1,Kt(e,t,n,a)}finally{yt=r,Ht.transition=o}}function Gt(e,t,n,a){var r=yt,o=Ht.transition;Ht.transition=null;try{yt=4,Kt(e,t,n,a)}finally{yt=r,Ht.transition=o}}function Kt(e,t,n,a){if(jt){var r=Yt(e,t,n,a);if(null===r)ja(e,t,a,$t,n),Pt(e,a);else if(function(e,t,n,a,r){switch(t){case"focusin":return Dt=Lt(Dt,e,t,n,a,r),!0;case"dragenter":return _t=Lt(_t,e,t,n,a,r),!0;case"mouseover":return Nt=Lt(Nt,e,t,n,a,r),!0;case"pointerover":var o=r.pointerId;return Mt.set(o,Lt(Mt.get(o)||null,e,t,n,a,r)),!0;case"gotpointercapture":return o=r.pointerId,It.set(o,Lt(It.get(o)||null,e,t,n,a,r)),!0}return!1}(r,e,t,n,a))a.stopPropagation();else if(Pt(e,a),4&t&&-1<Bt.indexOf(e)){for(;null!==r;){var o=yr(r);if(null!==o&&wt(o),null===(o=Yt(e,t,n,a))&&ja(e,t,a,$t,n),o===r)break;r=o}null!==r&&a.stopPropagation()}else ja(e,t,a,null,n)}}var $t=null;function Yt(e,t,n,a){if($t=null,null!==(e=vr(e=we(a))))if(null===(t=qe(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=He(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return $t=e,null}function Xt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qe()){case Ze:return 1;case et:return 4;case tt:case nt:return 16;case at:return 536870912;default:return 16}default:return 16}}var Jt=null,Qt=null,Zt=null;function en(){if(Zt)return Zt;var e,t,n=Qt,a=n.length,r="value"in Jt?Jt.value:Jt.textContent,o=r.length;for(e=0;e<a&&n[e]===r[e];e++);var i=a-e;for(t=1;t<=i&&n[a-t]===r[o-t];t++);return Zt=r.slice(e,1<t?1-t:void 0)}function tn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function nn(){return!0}function an(){return!1}function rn(e){function t(t,n,a,r,o){for(var i in this._reactName=t,this._targetInst=a,this.type=n,this.nativeEvent=r,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(r):r[i]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?nn:an,this.isPropagationStopped=an,this}return U(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var on,sn,ln,cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dn=rn(cn),mn=U({},cn,{view:0,detail:0}),pn=rn(mn),un=U({},mn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ln&&(ln&&"mousemove"===e.type?(on=e.screenX-ln.screenX,sn=e.screenY-ln.screenY):sn=on=0,ln=e),on)},movementY:function(e){return"movementY"in e?e.movementY:sn}}),gn=rn(un),hn=rn(U({},un,{dataTransfer:0})),bn=rn(U({},mn,{relatedTarget:0})),fn=rn(U({},cn,{animationName:0,elapsedTime:0,pseudoElement:0})),vn=U({},cn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yn=rn(vn),xn=rn(U({},cn,{data:0})),wn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pausa",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},En={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=En[e])&&!!t[e]}function Cn(){return Sn}var Tn=U({},mn,{key:function(e){if(e.key){var t=wn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?kn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cn,charCode:function(e){return"keypress"===e.type?tn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),An=rn(Tn),Dn=rn(U({},un,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),_n=rn(U({},mn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cn})),Nn=rn(U({},cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Mn=U({},un,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),In=rn(Mn),Rn=[9,13,27,32],Bn=d&&"CompositionEvent"in window,Pn=null;d&&"documentMode"in document&&(Pn=document.documentMode);var Ln=d&&"TextEvent"in window&&!Pn,Un=d&&(!Bn||Pn&&8<Pn&&11>=Pn),Fn=String.fromCharCode(32),zn=!1;function On(e,t){switch(e){case"keyup":return-1!==Rn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var qn=!1;var Hn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Hn[e.type]:"textarea"===t}function Vn(e,t,n,a){Te(a),0<(t=Ga(t,"onChange")).length&&(n=new dn("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Gn=null,Kn=null;function $n(e){Fa(e,0)}function Yn(e){if(K(xr(e)))return e}function Xn(e,t){if("change"===e)return t}var Jn=!1;if(d){var Qn;if(d){var Zn="oninput"in document;if(!Zn){var ea=document.createElement("div");ea.setAttribute("oninput","return;"),Zn="function"==typeof ea.oninput}Qn=Zn}else Qn=!1;Jn=Qn&&(!document.documentMode||9<document.documentMode)}function ta(){Gn&&(Gn.detachEvent("onpropertychange",na),Kn=Gn=null)}function na(e){if("value"===e.propertyName&&Yn(Kn)){var t=[];Vn(t,Kn,e,we(e)),Me($n,t)}}function aa(e,t,n){"focusin"===e?(ta(),Kn=n,(Gn=t).attachEvent("onpropertychange",na)):"focusout"===e&&ta()}function ra(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Yn(Kn)}function oa(e,t){if("click"===e)return Yn(t)}function ia(e,t){if("input"===e||"change"===e)return Yn(t)}var sa="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function la(e,t){if(sa(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var r=n[a];if(!m.call(t,r)||!sa(e[r],t[r]))return!1}return!0}function ca(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function da(e,t){var n,a=ca(e);for(e=0;a;){if(3===a.nodeType){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ca(a)}}function ma(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ma(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function pa(){for(var e=window,t=$();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=$((e=t.contentWindow).document)}return t}function ua(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function ga(e){var t=pa(),n=e.focusedElem,a=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ma(n.ownerDocument.documentElement,n)){if(null!==a&&ua(n))if(t=a.start,void 0===(e=a.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var r=n.textContent.length,o=Math.min(a.start,r);a=void 0===a.end?o:Math.min(a.end,r),!e.extend&&o>a&&(r=a,a=o,o=r),r=da(n,o);var i=da(n,a);r&&i&&(1!==e.rangeCount||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&((t=t.createRange()).setStart(r.node,r.offset),e.removeAllRanges(),o>a?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ha=d&&"documentMode"in document&&11>=document.documentMode,ba=null,fa=null,va=null,ya=!1;function xa(e,t,n){var a=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;ya||null==ba||ba!==$(a)||("selectionStart"in(a=ba)&&ua(a)?a={start:a.selectionStart,end:a.selectionEnd}:a={anchorNode:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset},va&&la(va,a)||(va=a,0<(a=Ga(fa,"onSelect")).length&&(t=new dn("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=ba)))}function wa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ka={animationend:wa("Animation","AnimationEnd"),animationiteration:wa("Animation","AnimationIteration"),animationstart:wa("Animation","AnimationStart"),transitionend:wa("Transition","TransitionEnd")},Ea={},Sa={};function Ca(e){if(Ea[e])return Ea[e];if(!ka[e])return e;var t,n=ka[e];for(t in n)if(n.hasOwnProperty(t)&&t in Sa)return Ea[e]=n[t];return e}d&&(Sa=document.createElement("div").style,"AnimationEvent"in window||(delete ka.animationend.animation,delete ka.animationiteration.animation,delete ka.animationstart.animation),"TransitionEvent"in window||delete ka.transitionend.transition);var Ta=Ca("animationend"),Aa=Ca("animationiteration"),Da=Ca("animationstart"),_a=Ca("transitionend"),Na=new Map,Ma="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ia(e,t){Na.set(e,t),l(t,[e])}for(var Ra=0;Ra<Ma.length;Ra++){var Ba=Ma[Ra];Ia(Ba.toLowerCase(),"on"+(Ba[0].toUpperCase()+Ba.slice(1)))}Ia(Ta,"onAnimationEnd"),Ia(Aa,"onAnimationIteration"),Ia(Da,"onAnimationStart"),Ia("dblclick","onDoubleClick"),Ia("focusin","onFocus"),Ia("focusout","onBlur"),Ia(_a,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),La=new Set("cancel close invalid load scroll toggle".split(" ").concat(Pa));function Ua(e,t,n){var a=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,a,r,i,s,l,c){if(We.apply(this,arguments),Le){if(!Le)throw Error(o(198));var d=Ue;Le=!1,Ue=null,Fe||(Fe=!0,ze=d)}}(a,t,void 0,e),e.currentTarget=null}function Fa(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var a=e[n],r=a.event;a=a.listeners;e:{var o=void 0;if(t)for(var i=a.length-1;0<=i;i--){var s=a[i],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&r.isPropagationStopped())break e;Ua(r,s,c),o=l}else for(i=0;i<a.length;i++){if(l=(s=a[i]).instance,c=s.currentTarget,s=s.listener,l!==o&&r.isPropagationStopped())break e;Ua(r,s,c),o=l}}}if(Fe)throw e=ze,Fe=!1,ze=null,e}function za(e,t){var n=t[hr];void 0===n&&(n=t[hr]=new Set);var a=e+"__bubble";n.has(a)||(Ha(t,e,2,!1),n.add(a))}function Oa(e,t,n){var a=0;t&&(a|=4),Ha(n,e,a,t)}var Wa="_reactListening"+Math.random().toString(36).slice(2);function qa(e){if(!e[Wa]){e[Wa]=!0,i.forEach(function(t){"selectionchange"!==t&&(La.has(t)||Oa(t,!1,e),Oa(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Wa]||(t[Wa]=!0,Oa("selectionchange",!1,t))}}function Ha(e,t,n,a){switch(Xt(t)){case 1:var r=Vt;break;case 4:r=Gt;break;default:r=Kt}n=r.bind(null,t,n,e),r=void 0,!Re||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(r=!0),a?void 0!==r?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):void 0!==r?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function ja(e,t,n,a,r){var o=a;if(!(1&t||2&t||null===a))e:for(;;){if(null===a)return;var i=a.tag;if(3===i||4===i){var s=a.stateNode.containerInfo;if(s===r||8===s.nodeType&&s.parentNode===r)break;if(4===i)for(i=a.return;null!==i;){var l=i.tag;if((3===l||4===l)&&((l=i.stateNode.containerInfo)===r||8===l.nodeType&&l.parentNode===r))return;i=i.return}for(;null!==s;){if(null===(i=vr(s)))return;if(5===(l=i.tag)||6===l){a=o=i;continue e}s=s.parentNode}}a=a.return}Me(function(){var a=o,r=we(n),i=[];e:{var s=Na.get(e);if(void 0!==s){var l=dn,c=e;switch(e){case"keypress":if(0===tn(n))break e;case"keydown":case"keyup":l=An;break;case"focusin":c="focus",l=bn;break;case"focusout":c="blur",l=bn;break;case"beforeblur":case"afterblur":l=bn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=gn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=hn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=_n;break;case Ta:case Aa:case Da:l=fn;break;case _a:l=Nn;break;case"scroll":l=pn;break;case"wheel":l=In;break;case"copy":case"cut":case"paste":l=yn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=Dn}var d=!!(4&t),m=!d&&"scroll"===e,p=d?null!==s?s+"Capture":null:s;d=[];for(var u,g=a;null!==g;){var h=(u=g).stateNode;if(5===u.tag&&null!==h&&(u=h,null!==p&&(null!=(h=Ie(g,p))&&d.push(Va(g,h,u)))),m)break;g=g.return}0<d.length&&(s=new l(s,c,null,n,r),i.push({event:s,listeners:d}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===xe||!(c=n.relatedTarget||n.fromElement)||!vr(c)&&!c[gr])&&(l||s)&&(s=r.window===r?r:(s=r.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=a,null!==(c=(c=n.relatedTarget||n.toElement)?vr(c):null)&&(c!==(m=qe(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=a),l!==c)){if(d=gn,h="onMouseLeave",p="onMouseEnter",g="mouse","pointerout"!==e&&"pointerover"!==e||(d=Dn,h="onPointerLeave",p="onPointerEnter",g="pointer"),m=null==l?s:xr(l),u=null==c?s:xr(c),(s=new d(h,g+"leave",l,n,r)).target=m,s.relatedTarget=u,h=null,vr(r)===a&&((d=new d(p,g+"enter",c,n,r)).target=u,d.relatedTarget=m,h=d),m=h,l&&c)e:{for(p=c,g=0,u=d=l;u;u=Ka(u))g++;for(u=0,h=p;h;h=Ka(h))u++;for(;0<g-u;)d=Ka(d),g--;for(;0<u-g;)p=Ka(p),u--;for(;g--;){if(d===p||null!==p&&d===p.alternate)break e;d=Ka(d),p=Ka(p)}d=null}else d=null;null!==l&&$a(i,s,l,d,!1),null!==c&&null!==m&&$a(i,m,c,d,!0)}if("select"===(l=(s=a?xr(a):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var b=Xn;else if(jn(s))if(Jn)b=ia;else{b=ra;var f=aa}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(b=oa);switch(b&&(b=b(e,a))?Vn(i,b,n,r):(f&&f(e,s,a),"focusout"===e&&(f=s._wrapperState)&&f.controlled&&"number"===s.type&&ee(s,"number",s.value)),f=a?xr(a):window,e){case"focusin":(jn(f)||"true"===f.contentEditable)&&(ba=f,fa=a,va=null);break;case"focusout":va=fa=ba=null;break;case"mousedown":ya=!0;break;case"contextmenu":case"mouseup":case"dragend":ya=!1,xa(i,n,r);break;case"selectionchange":if(ha)break;case"keydown":case"keyup":xa(i,n,r)}var v;if(Bn)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else qn?On(e,n)&&(y="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(y="onCompositionStart");y&&(Un&&"ko"!==n.locale&&(qn||"onCompositionStart"!==y?"onCompositionEnd"===y&&qn&&(v=en()):(Qt="value"in(Jt=r)?Jt.value:Jt.textContent,qn=!0)),0<(f=Ga(a,y)).length&&(y=new xn(y,e,null,n,r),i.push({event:y,listeners:f}),v?y.data=v:null!==(v=Wn(n))&&(y.data=v))),(v=Ln?function(e,t){switch(e){case"compositionend":return Wn(t);case"keypress":return 32!==t.which?null:(zn=!0,Fn);case"textInput":return(e=t.data)===Fn&&zn?null:e;default:return null}}(e,n):function(e,t){if(qn)return"compositionend"===e||!Bn&&On(e,t)?(e=en(),Zt=Qt=Jt=null,qn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Un&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(a=Ga(a,"onBeforeInput")).length&&(r=new xn("onBeforeInput","beforeinput",null,n,r),i.push({event:r,listeners:a}),r.data=v))}Fa(i,t)})}function Va(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ga(e,t){for(var n=t+"Capture",a=[];null!==e;){var r=e,o=r.stateNode;5===r.tag&&null!==o&&(r=o,null!=(o=Ie(e,n))&&a.unshift(Va(e,o,r)),null!=(o=Ie(e,t))&&a.push(Va(e,o,r))),e=e.return}return a}function Ka(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function $a(e,t,n,a,r){for(var o=t._reactName,i=[];null!==n&&n!==a;){var s=n,l=s.alternate,c=s.stateNode;if(null!==l&&l===a)break;5===s.tag&&null!==c&&(s=c,r?null!=(l=Ie(n,o))&&i.unshift(Va(n,l,s)):r||null!=(l=Ie(n,o))&&i.push(Va(n,l,s))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}var Ya=/\r\n?/g,Xa=/\u0000|\uFFFD/g;function Ja(e){return("string"==typeof e?e:""+e).replace(Ya,"\n").replace(Xa,"")}function Qa(e,t,n){if(t=Ja(t),Ja(e)!==t&&n)throw Error(o(425))}function Za(){}var er=null,tr=null;function nr(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ar="function"==typeof setTimeout?setTimeout:void 0,rr="function"==typeof clearTimeout?clearTimeout:void 0,or="function"==typeof Promise?Promise:void 0,ir="function"==typeof queueMicrotask?queueMicrotask:void 0!==or?function(e){return or.resolve(null).then(e).catch(sr)}:ar;function sr(e){setTimeout(function(){throw e})}function lr(e,t){var n=t,a=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&8===r.nodeType)if("/$"===(n=r.data)){if(0===a)return e.removeChild(r),void qt(t);a--}else"$"!==n&&"$?"!==n&&"$!"!==n||a++;n=r}while(n);qt(t)}function cr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function dr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var mr=Math.random().toString(36).slice(2),pr="__reactFiber$"+mr,ur="__reactProps$"+mr,gr="__reactContainer$"+mr,hr="__reactEvents$"+mr,br="__reactListeners$"+mr,fr="__reactHandles$"+mr;function vr(e){var t=e[pr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[gr]||n[pr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=dr(e);null!==e;){if(n=e[pr])return n;e=dr(e)}return t}n=(e=n).parentNode}return null}function yr(e){return!(e=e[pr]||e[gr])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function xr(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function wr(e){return e[ur]||null}var kr=[],Er=-1;function Sr(e){return{current:e}}function Cr(e){0>Er||(e.current=kr[Er],kr[Er]=null,Er--)}function Tr(e,t){Er++,kr[Er]=e.current,e.current=t}var Ar={},Dr=Sr(Ar),_r=Sr(!1),Nr=Ar;function Mr(e,t){var n=e.type.contextTypes;if(!n)return Ar;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var r,o={};for(r in n)o[r]=t[r];return a&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ir(e){return null!=(e=e.childContextTypes)}function Rr(){Cr(_r),Cr(Dr)}function Br(e,t,n){if(Dr.current!==Ar)throw Error(o(168));Tr(Dr,t),Tr(_r,n)}function Pr(e,t,n){var a=e.stateNode;if(t=t.childContextTypes,"function"!=typeof a.getChildContext)return n;for(var r in a=a.getChildContext())if(!(r in t))throw Error(o(108,H(e)||"Unknown",r));return U({},n,a)}function Lr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ar,Nr=Dr.current,Tr(Dr,e),Tr(_r,_r.current),!0}function Ur(e,t,n){var a=e.stateNode;if(!a)throw Error(o(169));n?(e=Pr(e,t,Nr),a.__reactInternalMemoizedMergedChildContext=e,Cr(_r),Cr(Dr),Tr(Dr,e)):Cr(_r),Tr(_r,n)}var Fr=null,zr=!1,Or=!1;function Wr(e){null===Fr?Fr=[e]:Fr.push(e)}function qr(){if(!Or&&null!==Fr){Or=!0;var e=0,t=yt;try{var n=Fr;for(yt=1;e<n.length;e++){var a=n[e];do{a=a(!0)}while(null!==a)}Fr=null,zr=!1}catch(t){throw null!==Fr&&(Fr=Fr.slice(e+1)),Ke(Ze,qr),t}finally{yt=t,Or=!1}}return null}var Hr=[],jr=0,Vr=null,Gr=0,Kr=[],$r=0,Yr=null,Xr=1,Jr="";function Qr(e,t){Hr[jr++]=Gr,Hr[jr++]=Vr,Vr=e,Gr=t}function Zr(e,t,n){Kr[$r++]=Xr,Kr[$r++]=Jr,Kr[$r++]=Yr,Yr=e;var a=Xr;e=Jr;var r=32-it(a)-1;a&=~(1<<r),n+=1;var o=32-it(t)+r;if(30<o){var i=r-r%5;o=(a&(1<<i)-1).toString(32),a>>=i,r-=i,Xr=1<<32-it(t)+r|n<<r|a,Jr=o+e}else Xr=1<<o|n<<r|a,Jr=e}function eo(e){null!==e.return&&(Qr(e,1),Zr(e,1,0))}function to(e){for(;e===Vr;)Vr=Hr[--jr],Hr[jr]=null,Gr=Hr[--jr],Hr[jr]=null;for(;e===Yr;)Yr=Kr[--$r],Kr[$r]=null,Jr=Kr[--$r],Kr[$r]=null,Xr=Kr[--$r],Kr[$r]=null}var no=null,ao=null,ro=!1,oo=null;function io(e,t){var n=_c(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function so(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,no=e,ao=cr(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,no=e,ao=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Yr?{id:Xr,overflow:Jr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=_c(18,null,null,0)).stateNode=t,n.return=e,e.child=n,no=e,ao=null,!0);default:return!1}}function lo(e){return!(!(1&e.mode)||128&e.flags)}function co(e){if(ro){var t=ao;if(t){var n=t;if(!so(e,t)){if(lo(e))throw Error(o(418));t=cr(n.nextSibling);var a=no;t&&so(e,t)?io(a,n):(e.flags=-4097&e.flags|2,ro=!1,no=e)}}else{if(lo(e))throw Error(o(418));e.flags=-4097&e.flags|2,ro=!1,no=e}}}function mo(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;no=e}function po(e){if(e!==no)return!1;if(!ro)return mo(e),ro=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!nr(e.type,e.memoizedProps)),t&&(t=ao)){if(lo(e))throw uo(),Error(o(418));for(;t;)io(e,t),t=cr(t.nextSibling)}if(mo(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){ao=cr(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}ao=null}}else ao=no?cr(e.stateNode.nextSibling):null;return!0}function uo(){for(var e=ao;e;)e=cr(e.nextSibling)}function go(){ao=no=null,ro=!1}function ho(e){null===oo?oo=[e]:oo.push(e)}var bo=x.ReactCurrentBatchConfig;function fo(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var a=n.stateNode}if(!a)throw Error(o(147,e));var r=a,i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=r.refs;null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!=typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function vo(e,t){throw e=Object.prototype.toString.call(t),Error(o(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function yo(e){return(0,e._init)(e._payload)}function xo(e){function t(t,n){if(e){var a=t.deletions;null===a?(t.deletions=[n],t.flags|=16):a.push(n)}}function n(n,a){if(!e)return null;for(;null!==a;)t(n,a),a=a.sibling;return null}function a(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function r(e,t){return(e=Mc(e,t)).index=0,e.sibling=null,e}function i(t,n,a){return t.index=a,e?null!==(a=t.alternate)?(a=a.index)<n?(t.flags|=2,n):a:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,a){return null===t||6!==t.tag?((t=Pc(n,e.mode,a)).return=e,t):((t=r(t,n)).return=e,t)}function c(e,t,n,a){var o=n.type;return o===E?m(e,t,n.props.children,a,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===I&&yo(o)===t.type)?((a=r(t,n.props)).ref=fo(e,t,n),a.return=e,a):((a=Ic(n.type,n.key,n.props,null,e.mode,a)).ref=fo(e,t,n),a.return=e,a)}function d(e,t,n,a){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Lc(n,e.mode,a)).return=e,t):((t=r(t,n.children||[])).return=e,t)}function m(e,t,n,a,o){return null===t||7!==t.tag?((t=Rc(n,e.mode,a,o)).return=e,t):((t=r(t,n)).return=e,t)}function p(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Pc(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case w:return(n=Ic(t.type,t.key,t.props,null,e.mode,n)).ref=fo(e,null,t),n.return=e,n;case k:return(t=Lc(t,e.mode,n)).return=e,t;case I:return p(e,(0,t._init)(t._payload),n)}if(te(t)||P(t))return(t=Rc(t,e.mode,n,null)).return=e,t;vo(e,t)}return null}function u(e,t,n,a){var r=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==r?null:l(e,t,""+n,a);if("object"==typeof n&&null!==n){switch(n.$$typeof){case w:return n.key===r?c(e,t,n,a):null;case k:return n.key===r?d(e,t,n,a):null;case I:return u(e,t,(r=n._init)(n._payload),a)}if(te(n)||P(n))return null!==r?null:m(e,t,n,a,null);vo(e,n)}return null}function g(e,t,n,a,r){if("string"==typeof a&&""!==a||"number"==typeof a)return l(t,e=e.get(n)||null,""+a,r);if("object"==typeof a&&null!==a){switch(a.$$typeof){case w:return c(t,e=e.get(null===a.key?n:a.key)||null,a,r);case k:return d(t,e=e.get(null===a.key?n:a.key)||null,a,r);case I:return g(e,t,n,(0,a._init)(a._payload),r)}if(te(a)||P(a))return m(t,e=e.get(n)||null,a,r,null);vo(t,a)}return null}function h(r,o,s,l){for(var c=null,d=null,m=o,h=o=0,b=null;null!==m&&h<s.length;h++){m.index>h?(b=m,m=null):b=m.sibling;var f=u(r,m,s[h],l);if(null===f){null===m&&(m=b);break}e&&m&&null===f.alternate&&t(r,m),o=i(f,o,h),null===d?c=f:d.sibling=f,d=f,m=b}if(h===s.length)return n(r,m),ro&&Qr(r,h),c;if(null===m){for(;h<s.length;h++)null!==(m=p(r,s[h],l))&&(o=i(m,o,h),null===d?c=m:d.sibling=m,d=m);return ro&&Qr(r,h),c}for(m=a(r,m);h<s.length;h++)null!==(b=g(m,r,h,s[h],l))&&(e&&null!==b.alternate&&m.delete(null===b.key?h:b.key),o=i(b,o,h),null===d?c=b:d.sibling=b,d=b);return e&&m.forEach(function(e){return t(r,e)}),ro&&Qr(r,h),c}function b(r,s,l,c){var d=P(l);if("function"!=typeof d)throw Error(o(150));if(null==(l=d.call(l)))throw Error(o(151));for(var m=d=null,h=s,b=s=0,f=null,v=l.next();null!==h&&!v.done;b++,v=l.next()){h.index>b?(f=h,h=null):f=h.sibling;var y=u(r,h,v.value,c);if(null===y){null===h&&(h=f);break}e&&h&&null===y.alternate&&t(r,h),s=i(y,s,b),null===m?d=y:m.sibling=y,m=y,h=f}if(v.done)return n(r,h),ro&&Qr(r,b),d;if(null===h){for(;!v.done;b++,v=l.next())null!==(v=p(r,v.value,c))&&(s=i(v,s,b),null===m?d=v:m.sibling=v,m=v);return ro&&Qr(r,b),d}for(h=a(r,h);!v.done;b++,v=l.next())null!==(v=g(h,r,b,v.value,c))&&(e&&null!==v.alternate&&h.delete(null===v.key?b:v.key),s=i(v,s,b),null===m?d=v:m.sibling=v,m=v);return e&&h.forEach(function(e){return t(r,e)}),ro&&Qr(r,b),d}return function e(a,o,i,l){if("object"==typeof i&&null!==i&&i.type===E&&null===i.key&&(i=i.props.children),"object"==typeof i&&null!==i){switch(i.$$typeof){case w:e:{for(var c=i.key,d=o;null!==d;){if(d.key===c){if((c=i.type)===E){if(7===d.tag){n(a,d.sibling),(o=r(d,i.props.children)).return=a,a=o;break e}}else if(d.elementType===c||"object"==typeof c&&null!==c&&c.$$typeof===I&&yo(c)===d.type){n(a,d.sibling),(o=r(d,i.props)).ref=fo(a,d,i),o.return=a,a=o;break e}n(a,d);break}t(a,d),d=d.sibling}i.type===E?((o=Rc(i.props.children,a.mode,l,i.key)).return=a,a=o):((l=Ic(i.type,i.key,i.props,null,a.mode,l)).ref=fo(a,o,i),l.return=a,a=l)}return s(a);case k:e:{for(d=i.key;null!==o;){if(o.key===d){if(4===o.tag&&o.stateNode.containerInfo===i.containerInfo&&o.stateNode.implementation===i.implementation){n(a,o.sibling),(o=r(o,i.children||[])).return=a,a=o;break e}n(a,o);break}t(a,o),o=o.sibling}(o=Lc(i,a.mode,l)).return=a,a=o}return s(a);case I:return e(a,o,(d=i._init)(i._payload),l)}if(te(i))return h(a,o,i,l);if(P(i))return b(a,o,i,l);vo(a,i)}return"string"==typeof i&&""!==i||"number"==typeof i?(i=""+i,null!==o&&6===o.tag?(n(a,o.sibling),(o=r(o,i)).return=a,a=o):(n(a,o),(o=Pc(i,a.mode,l)).return=a,a=o),s(a)):n(a,o)}}var wo=xo(!0),ko=xo(!1),Eo=Sr(null),So=null,Co=null,To=null;function Ao(){To=Co=So=null}function Do(e){var t=Eo.current;Cr(Eo),e._currentValue=t}function _o(e,t,n){for(;null!==e;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==a&&(a.childLanes|=t)):null!==a&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function No(e,t){So=e,To=Co=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(vs=!0),e.firstContext=null)}function Mo(e){var t=e._currentValue;if(To!==e)if(e={context:e,memoizedValue:t,next:null},null===Co){if(null===So)throw Error(o(308));Co=e,So.dependencies={lanes:0,firstContext:e}}else Co=Co.next=e;return t}var Io=null;function Ro(e){null===Io?Io=[e]:Io.push(e)}function Bo(e,t,n,a){var r=t.interleaved;return null===r?(n.next=n,Ro(t)):(n.next=r.next,r.next=n),t.interleaved=n,Po(e,a)}function Po(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Lo=!1;function Uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function zo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Oo(e,t,n){var a=e.updateQueue;if(null===a)return null;if(a=a.shared,2&Tl){var r=a.pending;return null===r?t.next=t:(t.next=r.next,r.next=t),a.pending=t,Po(e,n)}return null===(r=a.interleaved)?(t.next=t,Ro(a)):(t.next=r.next,r.next=t),a.interleaved=t,Po(e,n)}function Wo(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var a=t.lanes;n|=a&=e.pendingLanes,t.lanes=n,vt(e,n)}}function qo(e,t){var n=e.updateQueue,a=e.alternate;if(null!==a&&n===(a=a.updateQueue)){var r=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?r=o=i:o=o.next=i,n=n.next}while(null!==n);null===o?r=o=t:o=o.next=t}else r=o=t;return n={baseState:a.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:a.shared,effects:a.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ho(e,t,n,a){var r=e.updateQueue;Lo=!1;var o=r.firstBaseUpdate,i=r.lastBaseUpdate,s=r.shared.pending;if(null!==s){r.shared.pending=null;var l=s,c=l.next;l.next=null,null===i?o=c:i.next=c,i=l;var d=e.alternate;null!==d&&((s=(d=d.updateQueue).lastBaseUpdate)!==i&&(null===s?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=l))}if(null!==o){var m=r.baseState;for(i=0,d=c=l=null,s=o;;){var p=s.lane,u=s.eventTime;if((a&p)===p){null!==d&&(d=d.next={eventTime:u,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,h=s;switch(p=t,u=n,h.tag){case 1:if("function"==typeof(g=h.payload)){m=g.call(u,m,p);break e}m=g;break e;case 3:g.flags=-65537&g.flags|128;case 0:if(null==(p="function"==typeof(g=h.payload)?g.call(u,m,p):g))break e;m=U({},m,p);break e;case 2:Lo=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(p=r.effects)?r.effects=[s]:p.push(s))}else u={eventTime:u,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===d?(c=d=u,l=m):d=d.next=u,i|=p;if(null===(s=s.next)){if(null===(s=r.shared.pending))break;s=(p=s).next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}if(null===d&&(l=m),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=d,null!==(t=r.shared.interleaved)){r=t;do{i|=r.lane,r=r.next}while(r!==t)}else null===o&&(r.shared.lanes=0);Bl|=i,e.lanes=i,e.memoizedState=m}}function jo(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var a=e[t],r=a.callback;if(null!==r){if(a.callback=null,a=n,"function"!=typeof r)throw Error(o(191,r));r.call(a)}}}var Vo={},Go=Sr(Vo),Ko=Sr(Vo),$o=Sr(Vo);function Yo(e){if(e===Vo)throw Error(o(174));return e}function Xo(e,t){switch(Tr($o,t),Tr(Ko,e),Tr(Go,Vo),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:t=le(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Cr(Go),Tr(Go,t)}function Jo(){Cr(Go),Cr(Ko),Cr($o)}function Qo(e){Yo($o.current);var t=Yo(Go.current),n=le(t,e.type);t!==n&&(Tr(Ko,e),Tr(Go,n))}function Zo(e){Ko.current===e&&(Cr(Go),Cr(Ko))}var ei=Sr(0);function ti(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ni=[];function ai(){for(var e=0;e<ni.length;e++)ni[e]._workInProgressVersionPrimary=null;ni.length=0}var ri=x.ReactCurrentDispatcher,oi=x.ReactCurrentBatchConfig,ii=0,si=null,li=null,ci=null,di=!1,mi=!1,pi=0,ui=0;function gi(){throw Error(o(321))}function hi(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!sa(e[n],t[n]))return!1;return!0}function bi(e,t,n,a,r,i){if(ii=i,si=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ri.current=null===e||null===e.memoizedState?Zi:es,e=n(a,r),mi){i=0;do{if(mi=!1,pi=0,25<=i)throw Error(o(301));i+=1,ci=li=null,t.updateQueue=null,ri.current=ts,e=n(a,r)}while(mi)}if(ri.current=Qi,t=null!==li&&null!==li.next,ii=0,ci=li=si=null,di=!1,t)throw Error(o(300));return e}function fi(){var e=0!==pi;return pi=0,e}function vi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ci?si.memoizedState=ci=e:ci=ci.next=e,ci}function yi(){if(null===li){var e=si.alternate;e=null!==e?e.memoizedState:null}else e=li.next;var t=null===ci?si.memoizedState:ci.next;if(null!==t)ci=t,li=e;else{if(null===e)throw Error(o(310));e={memoizedState:(li=e).memoizedState,baseState:li.baseState,baseQueue:li.baseQueue,queue:li.queue,next:null},null===ci?si.memoizedState=ci=e:ci=ci.next=e}return ci}function xi(e,t){return"function"==typeof t?t(e):t}function wi(e){var t=yi(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var a=li,r=a.baseQueue,i=n.pending;if(null!==i){if(null!==r){var s=r.next;r.next=i.next,i.next=s}a.baseQueue=r=i,n.pending=null}if(null!==r){i=r.next,a=a.baseState;var l=s=null,c=null,d=i;do{var m=d.lane;if((ii&m)===m)null!==c&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),a=d.hasEagerState?d.eagerState:e(a,d.action);else{var p={lane:m,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};null===c?(l=c=p,s=a):c=c.next=p,si.lanes|=m,Bl|=m}d=d.next}while(null!==d&&d!==i);null===c?s=a:c.next=l,sa(a,t.memoizedState)||(vs=!0),t.memoizedState=a,t.baseState=s,t.baseQueue=c,n.lastRenderedState=a}if(null!==(e=n.interleaved)){r=e;do{i=r.lane,si.lanes|=i,Bl|=i,r=r.next}while(r!==e)}else null===r&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ki(e){var t=yi(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var a=n.dispatch,r=n.pending,i=t.memoizedState;if(null!==r){n.pending=null;var s=r=r.next;do{i=e(i,s.action),s=s.next}while(s!==r);sa(i,t.memoizedState)||(vs=!0),t.memoizedState=i,null===t.baseQueue&&(t.baseState=i),n.lastRenderedState=i}return[i,a]}function Ei(){}function Si(e,t){var n=si,a=yi(),r=t(),i=!sa(a.memoizedState,r);if(i&&(a.memoizedState=r,vs=!0),a=a.queue,Li(Ai.bind(null,n,a,e),[e]),a.getSnapshot!==t||i||null!==ci&&1&ci.memoizedState.tag){if(n.flags|=2048,Mi(9,Ti.bind(null,n,a,r,t),void 0,null),null===Al)throw Error(o(349));30&ii||Ci(n,t,r)}return r}function Ci(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=si.updateQueue)?(t={lastEffect:null,stores:null},si.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ti(e,t,n,a){t.value=n,t.getSnapshot=a,Di(t)&&_i(e)}function Ai(e,t,n){return n(function(){Di(t)&&_i(e)})}function Di(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!sa(e,n)}catch(e){return!0}}function _i(e){var t=Po(e,1);null!==t&&ec(t,e,1,-1)}function Ni(e){var t=vi();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:e},t.queue=e,e=e.dispatch=$i.bind(null,si,e),[t.memoizedState,e]}function Mi(e,t,n,a){return e={tag:e,create:t,destroy:n,deps:a,next:null},null===(t=si.updateQueue)?(t={lastEffect:null,stores:null},si.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Ii(){return yi().memoizedState}function Ri(e,t,n,a){var r=vi();si.flags|=e,r.memoizedState=Mi(1|t,n,void 0,void 0===a?null:a)}function Bi(e,t,n,a){var r=yi();a=void 0===a?null:a;var o=void 0;if(null!==li){var i=li.memoizedState;if(o=i.destroy,null!==a&&hi(a,i.deps))return void(r.memoizedState=Mi(t,n,o,a))}si.flags|=e,r.memoizedState=Mi(1|t,n,o,a)}function Pi(e,t){return Ri(8390656,8,e,t)}function Li(e,t){return Bi(2048,8,e,t)}function Ui(e,t){return Bi(4,2,e,t)}function Fi(e,t){return Bi(4,4,e,t)}function zi(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Oi(e,t,n){return n=null!=n?n.concat([e]):null,Bi(4,4,zi.bind(null,t,e),n)}function Wi(){}function qi(e,t){var n=yi();t=void 0===t?null:t;var a=n.memoizedState;return null!==a&&null!==t&&hi(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Hi(e,t){var n=yi();t=void 0===t?null:t;var a=n.memoizedState;return null!==a&&null!==t&&hi(t,a[1])?a[0]:(e=e(),n.memoizedState=[e,t],e)}function ji(e,t,n){return 21&ii?(sa(n,t)||(n=ht(),si.lanes|=n,Bl|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,vs=!0),e.memoizedState=n)}function Vi(e,t){var n=yt;yt=0!==n&&4>n?n:4,e(!0);var a=oi.transition;oi.transition={};try{e(!1),t()}finally{yt=n,oi.transition=a}}function Gi(){return yi().memoizedState}function Ki(e,t,n){var a=Zl(e);if(n={lane:a,action:n,hasEagerState:!1,eagerState:null,next:null},Yi(e))Xi(t,n);else if(null!==(n=Bo(e,t,n,a))){ec(n,e,a,Ql()),Ji(n,t,a)}}function $i(e,t,n){var a=Zl(e),r={lane:a,action:n,hasEagerState:!1,eagerState:null,next:null};if(Yi(e))Xi(t,r);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var i=t.lastRenderedState,s=o(i,n);if(r.hasEagerState=!0,r.eagerState=s,sa(s,i)){var l=t.interleaved;return null===l?(r.next=r,Ro(t)):(r.next=l.next,l.next=r),void(t.interleaved=r)}}catch(e){}null!==(n=Bo(e,t,r,a))&&(ec(n,e,a,r=Ql()),Ji(n,t,a))}}function Yi(e){var t=e.alternate;return e===si||null!==t&&t===si}function Xi(e,t){mi=di=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ji(e,t,n){if(4194240&n){var a=t.lanes;n|=a&=e.pendingLanes,t.lanes=n,vt(e,n)}}var Qi={readContext:Mo,useCallback:gi,useContext:gi,useEffect:gi,useImperativeHandle:gi,useInsertionEffect:gi,useLayoutEffect:gi,useMemo:gi,useReducer:gi,useRef:gi,useState:gi,useDebugValue:gi,useDeferredValue:gi,useTransition:gi,useMutableSource:gi,useSyncExternalStore:gi,useId:gi,unstable_isNewReconciler:!1},Zi={readContext:Mo,useCallback:function(e,t){return vi().memoizedState=[e,void 0===t?null:t],e},useContext:Mo,useEffect:Pi,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Ri(4194308,4,zi.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ri(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ri(4,2,e,t)},useMemo:function(e,t){var n=vi();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var a=vi();return t=void 0!==n?n(t):t,a.memoizedState=a.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},a.queue=e,e=e.dispatch=Ki.bind(null,si,e),[a.memoizedState,e]},useRef:function(e){return e={current:e},vi().memoizedState=e},useState:Ni,useDebugValue:Wi,useDeferredValue:function(e){return vi().memoizedState=e},useTransition:function(){var e=Ni(!1),t=e[0];return e=Vi.bind(null,e[1]),vi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var a=si,r=vi();if(ro){if(void 0===n)throw Error(o(407));n=n()}else{if(n=t(),null===Al)throw Error(o(349));30&ii||Ci(a,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,Pi(Ai.bind(null,a,i,e),[e]),a.flags|=2048,Mi(9,Ti.bind(null,a,i,n,t),void 0,null),n},useId:function(){var e=vi(),t=Al.identifierPrefix;if(ro){var n=Jr;t=":"+t+"R"+(n=(Xr&~(1<<32-it(Xr)-1)).toString(32)+n),0<(n=pi++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ui++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},es={readContext:Mo,useCallback:qi,useContext:Mo,useEffect:Li,useImperativeHandle:Oi,useInsertionEffect:Ui,useLayoutEffect:Fi,useMemo:Hi,useReducer:wi,useRef:Ii,useState:function(){return wi(xi)},useDebugValue:Wi,useDeferredValue:function(e){return ji(yi(),li.memoizedState,e)},useTransition:function(){return[wi(xi)[0],yi().memoizedState]},useMutableSource:Ei,useSyncExternalStore:Si,useId:Gi,unstable_isNewReconciler:!1},ts={readContext:Mo,useCallback:qi,useContext:Mo,useEffect:Li,useImperativeHandle:Oi,useInsertionEffect:Ui,useLayoutEffect:Fi,useMemo:Hi,useReducer:ki,useRef:Ii,useState:function(){return ki(xi)},useDebugValue:Wi,useDeferredValue:function(e){var t=yi();return null===li?t.memoizedState=e:ji(t,li.memoizedState,e)},useTransition:function(){return[ki(xi)[0],yi().memoizedState]},useMutableSource:Ei,useSyncExternalStore:Si,useId:Gi,unstable_isNewReconciler:!1};function ns(e,t){if(e&&e.defaultProps){for(var n in t=U({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function as(e,t,n,a){n=null==(n=n(a,t=e.memoizedState))?t:U({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var rs={isMounted:function(e){return!!(e=e._reactInternals)&&qe(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Ql(),r=Zl(e),o=zo(a,r);o.payload=t,null!=n&&(o.callback=n),null!==(t=Oo(e,o,r))&&(ec(t,e,r,a),Wo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Ql(),r=Zl(e),o=zo(a,r);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=Oo(e,o,r))&&(ec(t,e,r,a),Wo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ql(),a=Zl(e),r=zo(n,a);r.tag=2,null!=t&&(r.callback=t),null!==(t=Oo(e,r,a))&&(ec(t,e,a,n),Wo(t,e,a))}};function os(e,t,n,a,r,o,i){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(a,o,i):!t.prototype||!t.prototype.isPureReactComponent||(!la(n,a)||!la(r,o))}function is(e,t,n){var a=!1,r=Ar,o=t.contextType;return"object"==typeof o&&null!==o?o=Mo(o):(r=Ir(t)?Nr:Dr.current,o=(a=null!=(a=t.contextTypes))?Mr(e,r):Ar),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=rs,e.stateNode=t,t._reactInternals=e,a&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=o),t}function ss(e,t,n,a){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,a),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&rs.enqueueReplaceState(t,t.state,null)}function ls(e,t,n,a){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Uo(e);var o=t.contextType;"object"==typeof o&&null!==o?r.context=Mo(o):(o=Ir(t)?Nr:Dr.current,r.context=Mr(e,o)),r.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(as(e,t,o,n),r.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof r.getSnapshotBeforeUpdate||"function"!=typeof r.UNSAFE_componentWillMount&&"function"!=typeof r.componentWillMount||(t=r.state,"function"==typeof r.componentWillMount&&r.componentWillMount(),"function"==typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),t!==r.state&&rs.enqueueReplaceState(r,r.state,null),Ho(e,n,r,a),r.state=e.memoizedState),"function"==typeof r.componentDidMount&&(e.flags|=4194308)}function cs(e,t){try{var n="",a=t;do{n+=W(a),a=a.return}while(a);var r=n}catch(e){r="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:r,digest:null}}function ds(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}var ms="function"==typeof WeakMap?WeakMap:Map;function ps(e,t,n){(n=zo(-1,n)).tag=3,n.payload={element:null};var a=t.value;return n.callback=function(){ql||(ql=!0,Hl=a)},n}function us(e,t,n){(n=zo(-1,n)).tag=3;var a=e.type.getDerivedStateFromError;if("function"==typeof a){var r=t.value;n.payload=function(){return a(r)},n.callback=function(){}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){"function"!=typeof a&&(null===jl?jl=new Set([this]):jl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function gs(e,t,n){var a=e.pingCache;if(null===a){a=e.pingCache=new ms;var r=new Set;a.set(t,r)}else void 0===(r=a.get(t))&&(r=new Set,a.set(t,r));r.has(n)||(r.add(n),e=Ec.bind(null,e,t,n),t.then(e,e))}function hs(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function bs(e,t,n,a,r){return 1&e.mode?(e.flags|=65536,e.lanes=r,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=zo(-1,1)).tag=2,Oo(n,t,1))),n.lanes|=1),e)}var fs=x.ReactCurrentOwner,vs=!1;function ys(e,t,n,a){t.child=null===e?ko(t,null,n,a):wo(t,e.child,n,a)}function xs(e,t,n,a,r){n=n.render;var o=t.ref;return No(t,r),a=bi(e,t,n,a,o,r),n=fi(),null===e||vs?(ro&&n&&eo(t),t.flags|=1,ys(e,t,a,r),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,qs(e,t,r))}function ws(e,t,n,a,r){if(null===e){var o=n.type;return"function"!=typeof o||Nc(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Ic(n.type,null,a,t,t.mode,r)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,ks(e,t,o,a,r))}if(o=e.child,0===(e.lanes&r)){var i=o.memoizedProps;if((n=null!==(n=n.compare)?n:la)(i,a)&&e.ref===t.ref)return qs(e,t,r)}return t.flags|=1,(e=Mc(o,a)).ref=t.ref,e.return=t,t.child=e}function ks(e,t,n,a,r){if(null!==e){var o=e.memoizedProps;if(la(o,a)&&e.ref===t.ref){if(vs=!1,t.pendingProps=a=o,0===(e.lanes&r))return t.lanes=e.lanes,qs(e,t,r);131072&e.flags&&(vs=!0)}}return Cs(e,t,n,a,r)}function Es(e,t,n){var a=t.pendingProps,r=a.children,o=null!==e?e.memoizedState:null;if("hidden"===a.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Tr(Ml,Nl),Nl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=null!==o?o.baseLanes:n,Tr(Ml,Nl),Nl|=a}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tr(Ml,Nl),Nl|=n;else null!==o?(a=o.baseLanes|n,t.memoizedState=null):a=n,Tr(Ml,Nl),Nl|=a;return ys(e,t,r,n),t.child}function Ss(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Cs(e,t,n,a,r){var o=Ir(n)?Nr:Dr.current;return o=Mr(t,o),No(t,r),n=bi(e,t,n,a,o,r),a=fi(),null===e||vs?(ro&&a&&eo(t),t.flags|=1,ys(e,t,n,r),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,qs(e,t,r))}function Ts(e,t,n,a,r){if(Ir(n)){var o=!0;Lr(t)}else o=!1;if(No(t,r),null===t.stateNode)Ws(e,t),is(t,n,a),ls(t,n,a,r),a=!0;else if(null===e){var i=t.stateNode,s=t.memoizedProps;i.props=s;var l=i.context,c=n.contextType;"object"==typeof c&&null!==c?c=Mo(c):c=Mr(t,c=Ir(n)?Nr:Dr.current);var d=n.getDerivedStateFromProps,m="function"==typeof d||"function"==typeof i.getSnapshotBeforeUpdate;m||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s!==a||l!==c)&&ss(t,i,a,c),Lo=!1;var p=t.memoizedState;i.state=p,Ho(t,a,i,r),l=t.memoizedState,s!==a||p!==l||_r.current||Lo?("function"==typeof d&&(as(t,n,d,a),l=t.memoizedState),(s=Lo||os(t,n,s,a,p,l,c))?(m||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||("function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount()),"function"==typeof i.componentDidMount&&(t.flags|=4194308)):("function"==typeof i.componentDidMount&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=l),i.props=a,i.state=l,i.context=c,a=s):("function"==typeof i.componentDidMount&&(t.flags|=4194308),a=!1)}else{i=t.stateNode,Fo(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:ns(t.type,s),i.props=c,m=t.pendingProps,p=i.context,"object"==typeof(l=n.contextType)&&null!==l?l=Mo(l):l=Mr(t,l=Ir(n)?Nr:Dr.current);var u=n.getDerivedStateFromProps;(d="function"==typeof u||"function"==typeof i.getSnapshotBeforeUpdate)||"function"!=typeof i.UNSAFE_componentWillReceiveProps&&"function"!=typeof i.componentWillReceiveProps||(s!==m||p!==l)&&ss(t,i,a,l),Lo=!1,p=t.memoizedState,i.state=p,Ho(t,a,i,r);var g=t.memoizedState;s!==m||p!==g||_r.current||Lo?("function"==typeof u&&(as(t,n,u,a),g=t.memoizedState),(c=Lo||os(t,n,c,a,p,g,l)||!1)?(d||"function"!=typeof i.UNSAFE_componentWillUpdate&&"function"!=typeof i.componentWillUpdate||("function"==typeof i.componentWillUpdate&&i.componentWillUpdate(a,g,l),"function"==typeof i.UNSAFE_componentWillUpdate&&i.UNSAFE_componentWillUpdate(a,g,l)),"function"==typeof i.componentDidUpdate&&(t.flags|=4),"function"==typeof i.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof i.componentDidUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=g),i.props=a,i.state=g,i.context=l,a=c):("function"!=typeof i.componentDidUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof i.getSnapshotBeforeUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),a=!1)}return As(e,t,n,a,o,r)}function As(e,t,n,a,r,o){Ss(e,t);var i=!!(128&t.flags);if(!a&&!i)return r&&Ur(t,n,!1),qs(e,t,o);a=t.stateNode,fs.current=t;var s=i&&"function"!=typeof n.getDerivedStateFromError?null:a.render();return t.flags|=1,null!==e&&i?(t.child=wo(t,e.child,null,o),t.child=wo(t,null,s,o)):ys(e,t,s,o),t.memoizedState=a.state,r&&Ur(t,n,!0),t.child}function Ds(e){var t=e.stateNode;t.pendingContext?Br(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Br(0,t.context,!1),Xo(e,t.containerInfo)}function _s(e,t,n,a,r){return go(),ho(r),t.flags|=256,ys(e,t,n,a),t.child}var Ns,Ms,Is,Rs={dehydrated:null,treeContext:null,retryLane:0};function Bs(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ps(e,t,n){var a,r=t.pendingProps,i=ei.current,s=!1,l=!!(128&t.flags);if((a=l)||(a=(null===e||null!==e.memoizedState)&&!!(2&i)),a?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(i|=1),Tr(ei,1&i),null===e)return co(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,s?(r=t.mode,s=t.child,l={mode:"hidden",children:l},1&r||null===s?s=Bc(l,r,0,null):(s.childLanes=0,s.pendingProps=l),e=Rc(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Bs(n),t.memoizedState=Rs,e):Ls(t,l));if(null!==(i=e.memoizedState)&&null!==(a=i.dehydrated))return function(e,t,n,a,r,i,s){if(n)return 256&t.flags?(t.flags&=-257,Us(e,t,s,a=ds(Error(o(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(i=a.fallback,r=t.mode,a=Bc({mode:"visible",children:a.children},r,0,null),(i=Rc(i,r,s,null)).flags|=2,a.return=t,i.return=t,a.sibling=i,t.child=a,1&t.mode&&wo(t,e.child,null,s),t.child.memoizedState=Bs(s),t.memoizedState=Rs,i);if(!(1&t.mode))return Us(e,t,s,null);if("$!"===r.data){if(a=r.nextSibling&&r.nextSibling.dataset)var l=a.dgst;return a=l,Us(e,t,s,a=ds(i=Error(o(419)),a,void 0))}if(l=0!==(s&e.childLanes),vs||l){if(null!==(a=Al)){switch(s&-s){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}0!==(r=0!==(r&(a.suspendedLanes|s))?0:r)&&r!==i.retryLane&&(i.retryLane=r,Po(e,r),ec(a,e,r,-1))}return uc(),Us(e,t,s,a=ds(Error(o(421))))}return"$?"===r.data?(t.flags|=128,t.child=e.child,t=Cc.bind(null,e),r._reactRetry=t,null):(e=i.treeContext,ao=cr(r.nextSibling),no=t,ro=!0,oo=null,null!==e&&(Kr[$r++]=Xr,Kr[$r++]=Jr,Kr[$r++]=Yr,Xr=e.id,Jr=e.overflow,Yr=t),t=Ls(t,a.children),t.flags|=4096,t)}(e,t,l,r,a,i,n);if(s){s=r.fallback,l=t.mode,a=(i=e.child).sibling;var c={mode:"hidden",children:r.children};return 1&l||t.child===i?(r=Mc(i,c)).subtreeFlags=14680064&i.subtreeFlags:((r=t.child).childLanes=0,r.pendingProps=c,t.deletions=null),null!==a?s=Mc(a,s):(s=Rc(s,l,n,null)).flags|=2,s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,l=null===(l=e.child.memoizedState)?Bs(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~n,t.memoizedState=Rs,r}return e=(s=e.child).sibling,r=Mc(s,{mode:"visible",children:r.children}),!(1&t.mode)&&(r.lanes=n),r.return=t,r.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ls(e,t){return(t=Bc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Us(e,t,n,a){return null!==a&&ho(a),wo(t,e.child,null,n),(e=Ls(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Fs(e,t,n){e.lanes|=t;var a=e.alternate;null!==a&&(a.lanes|=t),_o(e.return,t,n)}function zs(e,t,n,a,r){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:r}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=a,o.tail=n,o.tailMode=r)}function Os(e,t,n){var a=t.pendingProps,r=a.revealOrder,o=a.tail;if(ys(e,t,a.children,n),2&(a=ei.current))a=1&a|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Fs(e,n,t);else if(19===e.tag)Fs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}a&=1}if(Tr(ei,a),1&t.mode)switch(r){case"forwards":for(n=t.child,r=null;null!==n;)null!==(e=n.alternate)&&null===ti(e)&&(r=n),n=n.sibling;null===(n=r)?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),zs(t,!1,r,n,o);break;case"backwards":for(n=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===ti(e)){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}zs(t,!0,n,null,o);break;case"together":zs(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function Ws(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function qs(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Bl|=t.lanes,0===(n&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Mc(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Mc(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Hs(e,t){if(!ro)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;null!==n;)null!==n.alternate&&(a=n),n=n.sibling;null===a?t||null===e.tail?e.tail=null:e.tail.sibling=null:a.sibling=null}}function js(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,a=0;if(t)for(var r=e.child;null!==r;)n|=r.lanes|r.childLanes,a|=14680064&r.subtreeFlags,a|=14680064&r.flags,r.return=e,r=r.sibling;else for(r=e.child;null!==r;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags,a|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function Vs(e,t,n){var a=t.pendingProps;switch(to(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return js(t),null;case 1:case 17:return Ir(t.type)&&Rr(),js(t),null;case 3:return a=t.stateNode,Jo(),Cr(_r),Cr(Dr),ai(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),null!==e&&null!==e.child||(po(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==oo&&(rc(oo),oo=null))),js(t),null;case 5:Zo(t);var r=Yo($o.current);if(n=t.type,null!==e&&null!=t.stateNode)Ms(e,t,n,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!a){if(null===t.stateNode)throw Error(o(166));return js(t),null}if(e=Yo(Go.current),po(t)){a=t.stateNode,n=t.type;var i=t.memoizedProps;switch(a[pr]=t,a[ur]=i,e=!!(1&t.mode),n){case"dialog":za("cancel",a),za("close",a);break;case"iframe":case"object":case"embed":za("load",a);break;case"video":case"audio":for(r=0;r<Pa.length;r++)za(Pa[r],a);break;case"source":za("error",a);break;case"img":case"image":case"link":za("error",a),za("load",a);break;case"details":za("toggle",a);break;case"input":X(a,i),za("invalid",a);break;case"select":a._wrapperState={wasMultiple:!!i.multiple},za("invalid",a);break;case"textarea":re(a,i),za("invalid",a)}for(var l in ve(n,i),r=null,i)if(i.hasOwnProperty(l)){var c=i[l];"children"===l?"string"==typeof c?a.textContent!==c&&(!0!==i.suppressHydrationWarning&&Qa(a.textContent,c,e),r=["children",c]):"number"==typeof c&&a.textContent!==""+c&&(!0!==i.suppressHydrationWarning&&Qa(a.textContent,c,e),r=["children",""+c]):s.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&za("scroll",a)}switch(n){case"input":G(a),Z(a,i,!0);break;case"textarea":G(a),ie(a);break;case"select":case"option":break;default:"function"==typeof i.onClick&&(a.onclick=Za)}a=r,t.updateQueue=a,null!==a&&(t.flags|=4)}else{l=9===r.nodeType?r:r.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=se(n)),"http://www.w3.org/1999/xhtml"===e?"script"===n?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof a.is?e=l.createElement(n,{is:a.is}):(e=l.createElement(n),"select"===n&&(l=e,a.multiple?l.multiple=!0:a.size&&(l.size=a.size))):e=l.createElementNS(e,n),e[pr]=t,e[ur]=a,Ns(e,t),t.stateNode=e;e:{switch(l=ye(n,a),n){case"dialog":za("cancel",e),za("close",e),r=a;break;case"iframe":case"object":case"embed":za("load",e),r=a;break;case"video":case"audio":for(r=0;r<Pa.length;r++)za(Pa[r],e);r=a;break;case"source":za("error",e),r=a;break;case"img":case"image":case"link":za("error",e),za("load",e),r=a;break;case"details":za("toggle",e),r=a;break;case"input":X(e,a),r=Y(e,a),za("invalid",e);break;case"option":default:r=a;break;case"select":e._wrapperState={wasMultiple:!!a.multiple},r=U({},a,{value:void 0}),za("invalid",e);break;case"textarea":re(e,a),r=ae(e,a),za("invalid",e)}for(i in ve(n,r),c=r)if(c.hasOwnProperty(i)){var d=c[i];"style"===i?be(e,d):"dangerouslySetInnerHTML"===i?null!=(d=d?d.__html:void 0)&&me(e,d):"children"===i?"string"==typeof d?("textarea"!==n||""!==d)&&pe(e,d):"number"==typeof d&&pe(e,""+d):"suppressContentEditableWarning"!==i&&"suppressHydrationWarning"!==i&&"autoFocus"!==i&&(s.hasOwnProperty(i)?null!=d&&"onScroll"===i&&za("scroll",e):null!=d&&y(e,i,d,l))}switch(n){case"input":G(e),Z(e,a,!1);break;case"textarea":G(e),ie(e);break;case"option":null!=a.value&&e.setAttribute("value",""+j(a.value));break;case"select":e.multiple=!!a.multiple,null!=(i=a.value)?ne(e,!!a.multiple,i,!1):null!=a.defaultValue&&ne(e,!!a.multiple,a.defaultValue,!0);break;default:"function"==typeof r.onClick&&(e.onclick=Za)}switch(n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}}a&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return js(t),null;case 6:if(e&&null!=t.stateNode)Is(0,t,e.memoizedProps,a);else{if("string"!=typeof a&&null===t.stateNode)throw Error(o(166));if(n=Yo($o.current),Yo(Go.current),po(t)){if(a=t.stateNode,n=t.memoizedProps,a[pr]=t,(i=a.nodeValue!==n)&&null!==(e=no))switch(e.tag){case 3:Qa(a.nodeValue,n,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Qa(a.nodeValue,n,!!(1&e.mode))}i&&(t.flags|=4)}else(a=(9===n.nodeType?n:n.ownerDocument).createTextNode(a))[pr]=t,t.stateNode=a}return js(t),null;case 13:if(Cr(ei),a=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ro&&null!==ao&&1&t.mode&&!(128&t.flags))uo(),go(),t.flags|=98560,i=!1;else if(i=po(t),null!==a&&null!==a.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[pr]=t}else go(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;js(t),i=!1}else null!==oo&&(rc(oo),oo=null),i=!0;if(!i)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=n,t):((a=null!==a)!==(null!==e&&null!==e.memoizedState)&&a&&(t.child.flags|=8192,1&t.mode&&(null===e||1&ei.current?0===Il&&(Il=3):uc())),null!==t.updateQueue&&(t.flags|=4),js(t),null);case 4:return Jo(),null===e&&qa(t.stateNode.containerInfo),js(t),null;case 10:return Do(t.type._context),js(t),null;case 19:if(Cr(ei),null===(i=t.memoizedState))return js(t),null;if(a=!!(128&t.flags),null===(l=i.rendering))if(a)Hs(i,!1);else{if(0!==Il||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(l=ti(e))){for(t.flags|=128,Hs(i,!1),null!==(a=l.updateQueue)&&(t.updateQueue=a,t.flags|=4),t.subtreeFlags=0,a=n,n=t.child;null!==n;)e=a,(i=n).flags&=14680066,null===(l=i.alternate)?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,e=l.dependencies,i.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Tr(ei,1&ei.current|2),t.child}e=e.sibling}null!==i.tail&&Je()>Ol&&(t.flags|=128,a=!0,Hs(i,!1),t.lanes=4194304)}else{if(!a)if(null!==(e=ti(l))){if(t.flags|=128,a=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Hs(i,!0),null===i.tail&&"hidden"===i.tailMode&&!l.alternate&&!ro)return js(t),null}else 2*Je()-i.renderingStartTime>Ol&&1073741824!==n&&(t.flags|=128,a=!0,Hs(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(null!==(n=i.last)?n.sibling=l:t.child=l,i.last=l)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Je(),t.sibling=null,n=ei.current,Tr(ei,a?1&n|2:1&n),t):(js(t),null);case 22:case 23:return cc(),a=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==a&&(t.flags|=8192),a&&1&t.mode?!!(1073741824&Nl)&&(js(t),6&t.subtreeFlags&&(t.flags|=8192)):js(t),null;case 24:case 25:return null}throw Error(o(156,t.tag))}function Gs(e,t){switch(to(t),t.tag){case 1:return Ir(t.type)&&Rr(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Jo(),Cr(_r),Cr(Dr),ai(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Zo(t),null;case 13:if(Cr(ei),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));go()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Cr(ei),null;case 4:return Jo(),null;case 10:return Do(t.type._context),null;case 22:case 23:return cc(),null;default:return null}}Ns=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ms=function(e,t,n,a){var r=e.memoizedProps;if(r!==a){e=t.stateNode,Yo(Go.current);var o,i=null;switch(n){case"input":r=Y(e,r),a=Y(e,a),i=[];break;case"select":r=U({},r,{value:void 0}),a=U({},a,{value:void 0}),i=[];break;case"textarea":r=ae(e,r),a=ae(e,a),i=[];break;default:"function"!=typeof r.onClick&&"function"==typeof a.onClick&&(e.onclick=Za)}for(d in ve(n,a),n=null,r)if(!a.hasOwnProperty(d)&&r.hasOwnProperty(d)&&null!=r[d])if("style"===d){var l=r[d];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else"dangerouslySetInnerHTML"!==d&&"children"!==d&&"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&"autoFocus"!==d&&(s.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in a){var c=a[d];if(l=null!=r?r[d]:void 0,a.hasOwnProperty(d)&&c!==l&&(null!=c||null!=l))if("style"===d)if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(d,n)),n=c;else"dangerouslySetInnerHTML"===d?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(i=i||[]).push(d,c)):"children"===d?"string"!=typeof c&&"number"!=typeof c||(i=i||[]).push(d,""+c):"suppressContentEditableWarning"!==d&&"suppressHydrationWarning"!==d&&(s.hasOwnProperty(d)?(null!=c&&"onScroll"===d&&za("scroll",e),i||l===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}},Is=function(e,t,n,a){n!==a&&(t.flags|=4)};var Ks=!1,$s=!1,Ys="function"==typeof WeakSet?WeakSet:Set,Xs=null;function Js(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){kc(e,t,n)}else n.current=null}function Qs(e,t,n){try{n()}catch(n){kc(e,t,n)}}var Zs=!1;function el(e,t,n){var a=t.updateQueue;if(null!==(a=null!==a?a.lastEffect:null)){var r=a=a.next;do{if((r.tag&e)===e){var o=r.destroy;r.destroy=void 0,void 0!==o&&Qs(t,n,o)}r=r.next}while(r!==a)}}function tl(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var a=n.create;n.destroy=a()}n=n.next}while(n!==t)}}function nl(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function al(e){var t=e.alternate;null!==t&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[pr],delete t[ur],delete t[hr],delete t[br],delete t[fr])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function rl(e){return 5===e.tag||3===e.tag||4===e.tag}function ol(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||rl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function il(e,t,n){var a=e.tag;if(5===a||6===a)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Za));else if(4!==a&&null!==(e=e.child))for(il(e,t,n),e=e.sibling;null!==e;)il(e,t,n),e=e.sibling}function sl(e,t,n){var a=e.tag;if(5===a||6===a)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==a&&null!==(e=e.child))for(sl(e,t,n),e=e.sibling;null!==e;)sl(e,t,n),e=e.sibling}var ll=null,cl=!1;function dl(e,t,n){for(n=n.child;null!==n;)ml(e,t,n),n=n.sibling}function ml(e,t,n){if(ot&&"function"==typeof ot.onCommitFiberUnmount)try{ot.onCommitFiberUnmount(rt,n)}catch(e){}switch(n.tag){case 5:$s||Js(n,t);case 6:var a=ll,r=cl;ll=null,dl(e,t,n),cl=r,null!==(ll=a)&&(cl?(e=ll,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):ll.removeChild(n.stateNode));break;case 18:null!==ll&&(cl?(e=ll,n=n.stateNode,8===e.nodeType?lr(e.parentNode,n):1===e.nodeType&&lr(e,n),qt(e)):lr(ll,n.stateNode));break;case 4:a=ll,r=cl,ll=n.stateNode.containerInfo,cl=!0,dl(e,t,n),ll=a,cl=r;break;case 0:case 11:case 14:case 15:if(!$s&&(null!==(a=n.updateQueue)&&null!==(a=a.lastEffect))){r=a=a.next;do{var o=r,i=o.destroy;o=o.tag,void 0!==i&&(2&o||4&o)&&Qs(n,t,i),r=r.next}while(r!==a)}dl(e,t,n);break;case 1:if(!$s&&(Js(n,t),"function"==typeof(a=n.stateNode).componentWillUnmount))try{a.props=n.memoizedProps,a.state=n.memoizedState,a.componentWillUnmount()}catch(e){kc(n,t,e)}dl(e,t,n);break;case 21:dl(e,t,n);break;case 22:1&n.mode?($s=(a=$s)||null!==n.memoizedState,dl(e,t,n),$s=a):dl(e,t,n);break;default:dl(e,t,n)}}function pl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Ys),t.forEach(function(t){var a=Tc.bind(null,e,t);n.has(t)||(n.add(t),t.then(a,a))})}}function ul(e,t){var n=t.deletions;if(null!==n)for(var a=0;a<n.length;a++){var r=n[a];try{var i=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 5:ll=l.stateNode,cl=!1;break e;case 3:case 4:ll=l.stateNode.containerInfo,cl=!0;break e}l=l.return}if(null===ll)throw Error(o(160));ml(i,s,r),ll=null,cl=!1;var c=r.alternate;null!==c&&(c.return=null),r.return=null}catch(e){kc(r,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)gl(t,e),t=t.sibling}function gl(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ul(t,e),hl(e),4&a){try{el(3,e,e.return),tl(3,e)}catch(t){kc(e,e.return,t)}try{el(5,e,e.return)}catch(t){kc(e,e.return,t)}}break;case 1:ul(t,e),hl(e),512&a&&null!==n&&Js(n,n.return);break;case 5:if(ul(t,e),hl(e),512&a&&null!==n&&Js(n,n.return),32&e.flags){var r=e.stateNode;try{pe(r,"")}catch(t){kc(e,e.return,t)}}if(4&a&&null!=(r=e.stateNode)){var i=e.memoizedProps,s=null!==n?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===i.type&&null!=i.name&&J(r,i),ye(l,s);var d=ye(l,i);for(s=0;s<c.length;s+=2){var m=c[s],p=c[s+1];"style"===m?be(r,p):"dangerouslySetInnerHTML"===m?me(r,p):"children"===m?pe(r,p):y(r,m,p,d)}switch(l){case"input":Q(r,i);break;case"textarea":oe(r,i);break;case"select":var u=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var g=i.value;null!=g?ne(r,!!i.multiple,g,!1):u!==!!i.multiple&&(null!=i.defaultValue?ne(r,!!i.multiple,i.defaultValue,!0):ne(r,!!i.multiple,i.multiple?[]:"",!1))}r[ur]=i}catch(t){kc(e,e.return,t)}}break;case 6:if(ul(t,e),hl(e),4&a){if(null===e.stateNode)throw Error(o(162));r=e.stateNode,i=e.memoizedProps;try{r.nodeValue=i}catch(t){kc(e,e.return,t)}}break;case 3:if(ul(t,e),hl(e),4&a&&null!==n&&n.memoizedState.isDehydrated)try{qt(t.containerInfo)}catch(t){kc(e,e.return,t)}break;case 4:default:ul(t,e),hl(e);break;case 13:ul(t,e),hl(e),8192&(r=e.child).flags&&(i=null!==r.memoizedState,r.stateNode.isHidden=i,!i||null!==r.alternate&&null!==r.alternate.memoizedState||(zl=Je())),4&a&&pl(e);break;case 22:if(m=null!==n&&null!==n.memoizedState,1&e.mode?($s=(d=$s)||m,ul(t,e),$s=d):ul(t,e),hl(e),8192&a){if(d=null!==e.memoizedState,(e.stateNode.isHidden=d)&&!m&&1&e.mode)for(Xs=e,m=e.child;null!==m;){for(p=Xs=m;null!==Xs;){switch(g=(u=Xs).child,u.tag){case 0:case 11:case 14:case 15:el(4,u,u.return);break;case 1:Js(u,u.return);var h=u.stateNode;if("function"==typeof h.componentWillUnmount){a=u,n=u.return;try{t=a,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){kc(a,n,e)}}break;case 5:Js(u,u.return);break;case 22:if(null!==u.memoizedState){yl(p);continue}}null!==g?(g.return=u,Xs=g):yl(p)}m=m.sibling}e:for(m=null,p=e;;){if(5===p.tag){if(null===m){m=p;try{r=p.stateNode,d?"function"==typeof(i=r.style).setProperty?i.setProperty("display","none","important"):i.display="none":(l=p.stateNode,s=null!=(c=p.memoizedProps.style)&&c.hasOwnProperty("display")?c.display:null,l.style.display=he("display",s))}catch(t){kc(e,e.return,t)}}}else if(6===p.tag){if(null===m)try{p.stateNode.nodeValue=d?"":p.memoizedProps}catch(t){kc(e,e.return,t)}}else if((22!==p.tag&&23!==p.tag||null===p.memoizedState||p===e)&&null!==p.child){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;null===p.sibling;){if(null===p.return||p.return===e)break e;m===p&&(m=null),p=p.return}m===p&&(m=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:ul(t,e),hl(e),4&a&&pl(e);case 21:}}function hl(e){var t=e.flags;if(2&t){try{e:{for(var n=e.return;null!==n;){if(rl(n)){var a=n;break e}n=n.return}throw Error(o(160))}switch(a.tag){case 5:var r=a.stateNode;32&a.flags&&(pe(r,""),a.flags&=-33),sl(e,ol(e),r);break;case 3:case 4:var i=a.stateNode.containerInfo;il(e,ol(e),i);break;default:throw Error(o(161))}}catch(t){kc(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function bl(e,t,n){Xs=e,fl(e,t,n)}function fl(e,t,n){for(var a=!!(1&e.mode);null!==Xs;){var r=Xs,o=r.child;if(22===r.tag&&a){var i=null!==r.memoizedState||Ks;if(!i){var s=r.alternate,l=null!==s&&null!==s.memoizedState||$s;s=Ks;var c=$s;if(Ks=i,($s=l)&&!c)for(Xs=r;null!==Xs;)l=(i=Xs).child,22===i.tag&&null!==i.memoizedState?xl(r):null!==l?(l.return=i,Xs=l):xl(r);for(;null!==o;)Xs=o,fl(o,t,n),o=o.sibling;Xs=r,Ks=s,$s=c}vl(e)}else 8772&r.subtreeFlags&&null!==o?(o.return=r,Xs=o):vl(e)}}function vl(e){for(;null!==Xs;){var t=Xs;if(8772&t.flags){var n=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:$s||tl(5,t);break;case 1:var a=t.stateNode;if(4&t.flags&&!$s)if(null===n)a.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:ns(t.type,n.memoizedProps);a.componentDidUpdate(r,n.memoizedState,a.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;null!==i&&jo(t,i,a);break;case 3:var s=t.updateQueue;if(null!==s){if(n=null,null!==t.child)switch(t.child.tag){case 5:case 1:n=t.child.stateNode}jo(t,s,n)}break;case 5:var l=t.stateNode;if(null===n&&4&t.flags){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var d=t.alternate;if(null!==d){var m=d.memoizedState;if(null!==m){var p=m.dehydrated;null!==p&&qt(p)}}}break;default:throw Error(o(163))}$s||512&t.flags&&nl(t)}catch(e){kc(t,t.return,e)}}if(t===e){Xs=null;break}if(null!==(n=t.sibling)){n.return=t.return,Xs=n;break}Xs=t.return}}function yl(e){for(;null!==Xs;){var t=Xs;if(t===e){Xs=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Xs=n;break}Xs=t.return}}function xl(e){for(;null!==Xs;){var t=Xs;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{tl(4,t)}catch(e){kc(t,n,e)}break;case 1:var a=t.stateNode;if("function"==typeof a.componentDidMount){var r=t.return;try{a.componentDidMount()}catch(e){kc(t,r,e)}}var o=t.return;try{nl(t)}catch(e){kc(t,o,e)}break;case 5:var i=t.return;try{nl(t)}catch(e){kc(t,i,e)}}}catch(e){kc(t,t.return,e)}if(t===e){Xs=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Xs=s;break}Xs=t.return}}var wl,kl=Math.ceil,El=x.ReactCurrentDispatcher,Sl=x.ReactCurrentOwner,Cl=x.ReactCurrentBatchConfig,Tl=0,Al=null,Dl=null,_l=0,Nl=0,Ml=Sr(0),Il=0,Rl=null,Bl=0,Pl=0,Ll=0,Ul=null,Fl=null,zl=0,Ol=1/0,Wl=null,ql=!1,Hl=null,jl=null,Vl=!1,Gl=null,Kl=0,$l=0,Yl=null,Xl=-1,Jl=0;function Ql(){return 6&Tl?Je():-1!==Xl?Xl:Xl=Je()}function Zl(e){return 1&e.mode?2&Tl&&0!==_l?_l&-_l:null!==bo.transition?(0===Jl&&(Jl=ht()),Jl):0!==(e=yt)?e:e=void 0===(e=window.event)?16:Xt(e.type):1}function ec(e,t,n,a){if(50<$l)throw $l=0,Yl=null,Error(o(185));ft(e,n,a),2&Tl&&e===Al||(e===Al&&(!(2&Tl)&&(Pl|=n),4===Il&&oc(e,_l)),tc(e,a),1===n&&0===Tl&&!(1&t.mode)&&(Ol=Je()+500,zr&&qr()))}function tc(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-it(o),s=1<<i,l=r[i];-1===l?0!==(s&n)&&0===(s&a)||(r[i]=ut(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}}(e,t);var a=pt(e,e===Al?_l:0);if(0===a)null!==n&&$e(n),e.callbackNode=null,e.callbackPriority=0;else if(t=a&-a,e.callbackPriority!==t){if(null!=n&&$e(n),1===t)0===e.tag?function(e){zr=!0,Wr(e)}(ic.bind(null,e)):Wr(ic.bind(null,e)),ir(function(){!(6&Tl)&&qr()}),n=null;else{switch(xt(a)){case 1:n=Ze;break;case 4:n=et;break;case 16:default:n=tt;break;case 536870912:n=at}n=Ac(n,nc.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function nc(e,t){if(Xl=-1,Jl=0,6&Tl)throw Error(o(327));var n=e.callbackNode;if(xc()&&e.callbackNode!==n)return null;var a=pt(e,e===Al?_l:0);if(0===a)return null;if(30&a||0!==(a&e.expiredLanes)||t)t=gc(e,a);else{t=a;var r=Tl;Tl|=2;var i=pc();for(Al===e&&_l===t||(Wl=null,Ol=Je()+500,dc(e,t));;)try{bc();break}catch(t){mc(e,t)}Ao(),El.current=i,Tl=r,null!==Dl?t=0:(Al=null,_l=0,t=Il)}if(0!==t){if(2===t&&(0!==(r=gt(e))&&(a=r,t=ac(e,r))),1===t)throw n=Rl,dc(e,0),oc(e,a),tc(e,Je()),n;if(6===t)oc(e,a);else{if(r=e.current.alternate,!(30&a||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var a=0;a<n.length;a++){var r=n[a],o=r.getSnapshot;r=r.value;try{if(!sa(o(),r))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(r)||(t=gc(e,a),2===t&&(i=gt(e),0!==i&&(a=i,t=ac(e,i))),1!==t)))throw n=Rl,dc(e,0),oc(e,a),tc(e,Je()),n;switch(e.finishedWork=r,e.finishedLanes=a,t){case 0:case 1:throw Error(o(345));case 2:case 5:yc(e,Fl,Wl);break;case 3:if(oc(e,a),(130023424&a)===a&&10<(t=zl+500-Je())){if(0!==pt(e,0))break;if(((r=e.suspendedLanes)&a)!==a){Ql(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=ar(yc.bind(null,e,Fl,Wl),t);break}yc(e,Fl,Wl);break;case 4:if(oc(e,a),(4194240&a)===a)break;for(t=e.eventTimes,r=-1;0<a;){var s=31-it(a);i=1<<s,(s=t[s])>r&&(r=s),a&=~i}if(a=r,10<(a=(120>(a=Je()-a)?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*kl(a/1960))-a)){e.timeoutHandle=ar(yc.bind(null,e,Fl,Wl),a);break}yc(e,Fl,Wl);break;default:throw Error(o(329))}}}return tc(e,Je()),e.callbackNode===n?nc.bind(null,e):null}function ac(e,t){var n=Ul;return e.current.memoizedState.isDehydrated&&(dc(e,t).flags|=256),2!==(e=gc(e,t))&&(t=Fl,Fl=n,null!==t&&rc(t)),e}function rc(e){null===Fl?Fl=e:Fl.push.apply(Fl,e)}function oc(e,t){for(t&=~Ll,t&=~Pl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-it(t),a=1<<n;e[n]=-1,t&=~a}}function ic(e){if(6&Tl)throw Error(o(327));xc();var t=pt(e,0);if(!(1&t))return tc(e,Je()),null;var n=gc(e,t);if(0!==e.tag&&2===n){var a=gt(e);0!==a&&(t=a,n=ac(e,a))}if(1===n)throw n=Rl,dc(e,0),oc(e,t),tc(e,Je()),n;if(6===n)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,yc(e,Fl,Wl),tc(e,Je()),null}function sc(e,t){var n=Tl;Tl|=1;try{return e(t)}finally{0===(Tl=n)&&(Ol=Je()+500,zr&&qr())}}function lc(e){null!==Gl&&0===Gl.tag&&!(6&Tl)&&xc();var t=Tl;Tl|=1;var n=Cl.transition,a=yt;try{if(Cl.transition=null,yt=1,e)return e()}finally{yt=a,Cl.transition=n,!(6&(Tl=t))&&qr()}}function cc(){Nl=Ml.current,Cr(Ml)}function dc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,rr(n)),null!==Dl)for(n=Dl.return;null!==n;){var a=n;switch(to(a),a.tag){case 1:null!=(a=a.type.childContextTypes)&&Rr();break;case 3:Jo(),Cr(_r),Cr(Dr),ai();break;case 5:Zo(a);break;case 4:Jo();break;case 13:case 19:Cr(ei);break;case 10:Do(a.type._context);break;case 22:case 23:cc()}n=n.return}if(Al=e,Dl=e=Mc(e.current,null),_l=Nl=t,Il=0,Rl=null,Ll=Pl=Bl=0,Fl=Ul=null,null!==Io){for(t=0;t<Io.length;t++)if(null!==(a=(n=Io[t]).interleaved)){n.interleaved=null;var r=a.next,o=n.pending;if(null!==o){var i=o.next;o.next=r,a.next=i}n.pending=a}Io=null}return e}function mc(e,t){for(;;){var n=Dl;try{if(Ao(),ri.current=Qi,di){for(var a=si.memoizedState;null!==a;){var r=a.queue;null!==r&&(r.pending=null),a=a.next}di=!1}if(ii=0,ci=li=si=null,mi=!1,pi=0,Sl.current=null,null===n||null===n.return){Il=1,Rl=t,Dl=null;break}e:{var i=e,s=n.return,l=n,c=t;if(t=_l,l.flags|=32768,null!==c&&"object"==typeof c&&"function"==typeof c.then){var d=c,m=l,p=m.tag;if(!(1&m.mode||0!==p&&11!==p&&15!==p)){var u=m.alternate;u?(m.updateQueue=u.updateQueue,m.memoizedState=u.memoizedState,m.lanes=u.lanes):(m.updateQueue=null,m.memoizedState=null)}var g=hs(s);if(null!==g){g.flags&=-257,bs(g,s,l,0,t),1&g.mode&&gs(i,d,t),c=d;var h=(t=g).updateQueue;if(null===h){var b=new Set;b.add(c),t.updateQueue=b}else h.add(c);break e}if(!(1&t)){gs(i,d,t),uc();break e}c=Error(o(426))}else if(ro&&1&l.mode){var f=hs(s);if(null!==f){!(65536&f.flags)&&(f.flags|=256),bs(f,s,l,0,t),ho(cs(c,l));break e}}i=c=cs(c,l),4!==Il&&(Il=2),null===Ul?Ul=[i]:Ul.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t,qo(i,ps(0,c,t));break e;case 1:l=c;var v=i.type,y=i.stateNode;if(!(128&i.flags||"function"!=typeof v.getDerivedStateFromError&&(null===y||"function"!=typeof y.componentDidCatch||null!==jl&&jl.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t,qo(i,us(i,l,t));break e}}i=i.return}while(null!==i)}vc(n)}catch(e){t=e,Dl===n&&null!==n&&(Dl=n=n.return);continue}break}}function pc(){var e=El.current;return El.current=Qi,null===e?Qi:e}function uc(){0!==Il&&3!==Il&&2!==Il||(Il=4),null===Al||!(268435455&Bl)&&!(268435455&Pl)||oc(Al,_l)}function gc(e,t){var n=Tl;Tl|=2;var a=pc();for(Al===e&&_l===t||(Wl=null,dc(e,t));;)try{hc();break}catch(t){mc(e,t)}if(Ao(),Tl=n,El.current=a,null!==Dl)throw Error(o(261));return Al=null,_l=0,Il}function hc(){for(;null!==Dl;)fc(Dl)}function bc(){for(;null!==Dl&&!Ye();)fc(Dl)}function fc(e){var t=wl(e.alternate,e,Nl);e.memoizedProps=e.pendingProps,null===t?vc(e):Dl=t,Sl.current=null}function vc(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=Gs(n,t)))return n.flags&=32767,void(Dl=n);if(null===e)return Il=6,void(Dl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=Vs(n,t,Nl)))return void(Dl=n);if(null!==(t=t.sibling))return void(Dl=t);Dl=t=e}while(null!==t);0===Il&&(Il=5)}function yc(e,t,n){var a=yt,r=Cl.transition;try{Cl.transition=null,yt=1,function(e,t,n,a){do{xc()}while(null!==Gl);if(6&Tl)throw Error(o(327));n=e.finishedWork;var r=e.finishedLanes;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var a=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-it(n),o=1<<r;t[r]=0,a[r]=-1,e[r]=-1,n&=~o}}(e,i),e===Al&&(Dl=Al=null,_l=0),!(2064&n.subtreeFlags)&&!(2064&n.flags)||Vl||(Vl=!0,Ac(tt,function(){return xc(),null})),i=!!(15990&n.flags),!!(15990&n.subtreeFlags)||i){i=Cl.transition,Cl.transition=null;var s=yt;yt=1;var l=Tl;Tl|=4,Sl.current=null,function(e,t){if(er=jt,ua(e=pa())){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var a=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(a&&0!==a.rangeCount){n=a.anchorNode;var r=a.anchorOffset,i=a.focusNode;a=a.focusOffset;try{n.nodeType,i.nodeType}catch(e){n=null;break e}var s=0,l=-1,c=-1,d=0,m=0,p=e,u=null;t:for(;;){for(var g;p!==n||0!==r&&3!==p.nodeType||(l=s+r),p!==i||0!==a&&3!==p.nodeType||(c=s+a),3===p.nodeType&&(s+=p.nodeValue.length),null!==(g=p.firstChild);)u=p,p=g;for(;;){if(p===e)break t;if(u===n&&++d===r&&(l=s),u===i&&++m===a&&(c=s),null!==(g=p.nextSibling))break;u=(p=u).parentNode}p=g}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(tr={focusedElem:e,selectionRange:n},jt=!1,Xs=t;null!==Xs;)if(e=(t=Xs).child,1028&t.subtreeFlags&&null!==e)e.return=t,Xs=e;else for(;null!==Xs;){t=Xs;try{var h=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==h){var b=h.memoizedProps,f=h.memoizedState,v=t.stateNode,y=v.getSnapshotBeforeUpdate(t.elementType===t.type?b:ns(t.type,b),f);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;1===x.nodeType?x.textContent="":9===x.nodeType&&x.documentElement&&x.removeChild(x.documentElement);break;default:throw Error(o(163))}}catch(e){kc(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,Xs=e;break}Xs=t.return}h=Zs,Zs=!1}(e,n),gl(n,e),ga(tr),jt=!!er,tr=er=null,e.current=n,bl(n,e,r),Xe(),Tl=l,yt=s,Cl.transition=i}else e.current=n;if(Vl&&(Vl=!1,Gl=e,Kl=r),i=e.pendingLanes,0===i&&(jl=null),function(e){if(ot&&"function"==typeof ot.onCommitFiberRoot)try{ot.onCommitFiberRoot(rt,e,void 0,!(128&~e.current.flags))}catch(e){}}(n.stateNode),tc(e,Je()),null!==t)for(a=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],a(r.value,{componentStack:r.stack,digest:r.digest});if(ql)throw ql=!1,e=Hl,Hl=null,e;!!(1&Kl)&&0!==e.tag&&xc(),i=e.pendingLanes,1&i?e===Yl?$l++:($l=0,Yl=e):$l=0,qr()}(e,t,n,a)}finally{Cl.transition=r,yt=a}return null}function xc(){if(null!==Gl){var e=xt(Kl),t=Cl.transition,n=yt;try{if(Cl.transition=null,yt=16>e?16:e,null===Gl)var a=!1;else{if(e=Gl,Gl=null,Kl=0,6&Tl)throw Error(o(331));var r=Tl;for(Tl|=4,Xs=e.current;null!==Xs;){var i=Xs,s=i.child;if(16&Xs.flags){var l=i.deletions;if(null!==l){for(var c=0;c<l.length;c++){var d=l[c];for(Xs=d;null!==Xs;){var m=Xs;switch(m.tag){case 0:case 11:case 15:el(8,m,i)}var p=m.child;if(null!==p)p.return=m,Xs=p;else for(;null!==Xs;){var u=(m=Xs).sibling,g=m.return;if(al(m),m===d){Xs=null;break}if(null!==u){u.return=g,Xs=u;break}Xs=g}}}var h=i.alternate;if(null!==h){var b=h.child;if(null!==b){h.child=null;do{var f=b.sibling;b.sibling=null,b=f}while(null!==b)}}Xs=i}}if(2064&i.subtreeFlags&&null!==s)s.return=i,Xs=s;else e:for(;null!==Xs;){if(2048&(i=Xs).flags)switch(i.tag){case 0:case 11:case 15:el(9,i,i.return)}var v=i.sibling;if(null!==v){v.return=i.return,Xs=v;break e}Xs=i.return}}var y=e.current;for(Xs=y;null!==Xs;){var x=(s=Xs).child;if(2064&s.subtreeFlags&&null!==x)x.return=s,Xs=x;else e:for(s=y;null!==Xs;){if(2048&(l=Xs).flags)try{switch(l.tag){case 0:case 11:case 15:tl(9,l)}}catch(e){kc(l,l.return,e)}if(l===s){Xs=null;break e}var w=l.sibling;if(null!==w){w.return=l.return,Xs=w;break e}Xs=l.return}}if(Tl=r,qr(),ot&&"function"==typeof ot.onPostCommitFiberRoot)try{ot.onPostCommitFiberRoot(rt,e)}catch(e){}a=!0}return a}finally{yt=n,Cl.transition=t}}return!1}function wc(e,t,n){e=Oo(e,t=ps(0,t=cs(n,t),1),1),t=Ql(),null!==e&&(ft(e,1,t),tc(e,t))}function kc(e,t,n){if(3===e.tag)wc(e,e,n);else for(;null!==t;){if(3===t.tag){wc(t,e,n);break}if(1===t.tag){var a=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof a.componentDidCatch&&(null===jl||!jl.has(a))){t=Oo(t,e=us(t,e=cs(n,e),1),1),e=Ql(),null!==t&&(ft(t,1,e),tc(t,e));break}}t=t.return}}function Ec(e,t,n){var a=e.pingCache;null!==a&&a.delete(t),t=Ql(),e.pingedLanes|=e.suspendedLanes&n,Al===e&&(_l&n)===n&&(4===Il||3===Il&&(130023424&_l)===_l&&500>Je()-zl?dc(e,0):Ll|=n),tc(e,t)}function Sc(e,t){0===t&&(1&e.mode?(t=dt,!(130023424&(dt<<=1))&&(dt=4194304)):t=1);var n=Ql();null!==(e=Po(e,t))&&(ft(e,t,n),tc(e,n))}function Cc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Sc(e,n)}function Tc(e,t){var n=0;switch(e.tag){case 13:var a=e.stateNode,r=e.memoizedState;null!==r&&(n=r.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(o(314))}null!==a&&a.delete(t),Sc(e,n)}function Ac(e,t){return Ke(e,t)}function Dc(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _c(e,t,n,a){return new Dc(e,t,n,a)}function Nc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Mc(e,t){var n=e.alternate;return null===n?((n=_c(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ic(e,t,n,a,r,i){var s=2;if(a=e,"function"==typeof e)Nc(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case E:return Rc(n.children,r,i,t);case S:s=8,r|=8;break;case C:return(e=_c(12,n,t,2|r)).elementType=C,e.lanes=i,e;case _:return(e=_c(13,n,t,r)).elementType=_,e.lanes=i,e;case N:return(e=_c(19,n,t,r)).elementType=N,e.lanes=i,e;case R:return Bc(n,r,i,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case T:s=10;break e;case A:s=9;break e;case D:s=11;break e;case M:s=14;break e;case I:s=16,a=null;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=_c(s,n,t,r)).elementType=e,t.type=a,t.lanes=i,t}function Rc(e,t,n,a){return(e=_c(7,e,a,t)).lanes=n,e}function Bc(e,t,n,a){return(e=_c(22,e,a,t)).elementType=R,e.lanes=n,e.stateNode={isHidden:!1},e}function Pc(e,t,n){return(e=_c(6,e,null,t)).lanes=n,e}function Lc(e,t,n){return(t=_c(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Uc(e,t,n,a,r){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=bt(0),this.expirationTimes=bt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bt(0),this.identifierPrefix=a,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Fc(e,t,n,a,r,o,i,s,l){return e=new Uc(e,t,n,s,l),1===t?(t=1,!0===o&&(t|=8)):t=0,o=_c(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:a,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Uo(o),e}function zc(e){if(!e)return Ar;e:{if(qe(e=e._reactInternals)!==e||1!==e.tag)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ir(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(o(171))}if(1===e.tag){var n=e.type;if(Ir(n))return Pr(e,n,t)}return t}function Oc(e,t,n,a,r,o,i,s,l){return(e=Fc(n,a,!0,e,0,o,0,s,l)).context=zc(null),n=e.current,(o=zo(a=Ql(),r=Zl(n))).callback=null!=t?t:null,Oo(n,o,r),e.current.lanes=r,ft(e,r,a),tc(e,a),e}function Wc(e,t,n,a){var r=t.current,o=Ql(),i=Zl(r);return n=zc(n),null===t.context?t.context=n:t.pendingContext=n,(t=zo(o,i)).payload={element:e},null!==(a=void 0===a?null:a)&&(t.callback=a),null!==(e=Oo(r,t,i))&&(ec(e,r,i,o),Wo(e,r,i)),i}function qc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Hc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function jc(e,t){Hc(e,t),(e=e.alternate)&&Hc(e,t)}wl=function(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps||_r.current)vs=!0;else{if(0===(e.lanes&n)&&!(128&t.flags))return vs=!1,function(e,t,n){switch(t.tag){case 3:Ds(t),go();break;case 5:Qo(t);break;case 1:Ir(t.type)&&Lr(t);break;case 4:Xo(t,t.stateNode.containerInfo);break;case 10:var a=t.type._context,r=t.memoizedProps.value;Tr(Eo,a._currentValue),a._currentValue=r;break;case 13:if(null!==(a=t.memoizedState))return null!==a.dehydrated?(Tr(ei,1&ei.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Ps(e,t,n):(Tr(ei,1&ei.current),null!==(e=qs(e,t,n))?e.sibling:null);Tr(ei,1&ei.current);break;case 19:if(a=0!==(n&t.childLanes),128&e.flags){if(a)return Os(e,t,n);t.flags|=128}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null,r.lastEffect=null),Tr(ei,ei.current),a)break;return null;case 22:case 23:return t.lanes=0,Es(e,t,n)}return qs(e,t,n)}(e,t,n);vs=!!(131072&e.flags)}else vs=!1,ro&&1048576&t.flags&&Zr(t,Gr,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;Ws(e,t),e=t.pendingProps;var r=Mr(t,Dr.current);No(t,n),r=bi(null,t,a,e,r,n);var i=fi();return t.flags|=1,"object"==typeof r&&null!==r&&"function"==typeof r.render&&void 0===r.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ir(a)?(i=!0,Lr(t)):i=!1,t.memoizedState=null!==r.state&&void 0!==r.state?r.state:null,Uo(t),r.updater=rs,t.stateNode=r,r._reactInternals=t,ls(t,a,e,n),t=As(null,t,a,!0,i,n)):(t.tag=0,ro&&i&&eo(t),ys(null,t,r,n),t=t.child),t;case 16:a=t.elementType;e:{switch(Ws(e,t),e=t.pendingProps,a=(r=a._init)(a._payload),t.type=a,r=t.tag=function(e){if("function"==typeof e)return Nc(e)?1:0;if(null!=e){if((e=e.$$typeof)===D)return 11;if(e===M)return 14}return 2}(a),e=ns(a,e),r){case 0:t=Cs(null,t,a,e,n);break e;case 1:t=Ts(null,t,a,e,n);break e;case 11:t=xs(null,t,a,e,n);break e;case 14:t=ws(null,t,a,ns(a.type,e),n);break e}throw Error(o(306,a,""))}return t;case 0:return a=t.type,r=t.pendingProps,Cs(e,t,a,r=t.elementType===a?r:ns(a,r),n);case 1:return a=t.type,r=t.pendingProps,Ts(e,t,a,r=t.elementType===a?r:ns(a,r),n);case 3:e:{if(Ds(t),null===e)throw Error(o(387));a=t.pendingProps,r=(i=t.memoizedState).element,Fo(e,t),Ho(t,a,null,n);var s=t.memoizedState;if(a=s.element,i.isDehydrated){if(i={element:a,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,256&t.flags){t=_s(e,t,a,n,r=cs(Error(o(423)),t));break e}if(a!==r){t=_s(e,t,a,n,r=cs(Error(o(424)),t));break e}for(ao=cr(t.stateNode.containerInfo.firstChild),no=t,ro=!0,oo=null,n=ko(t,null,a,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(go(),a===r){t=qs(e,t,n);break e}ys(e,t,a,n)}t=t.child}return t;case 5:return Qo(t),null===e&&co(t),a=t.type,r=t.pendingProps,i=null!==e?e.memoizedProps:null,s=r.children,nr(a,r)?s=null:null!==i&&nr(a,i)&&(t.flags|=32),Ss(e,t),ys(e,t,s,n),t.child;case 6:return null===e&&co(t),null;case 13:return Ps(e,t,n);case 4:return Xo(t,t.stateNode.containerInfo),a=t.pendingProps,null===e?t.child=wo(t,null,a,n):ys(e,t,a,n),t.child;case 11:return a=t.type,r=t.pendingProps,xs(e,t,a,r=t.elementType===a?r:ns(a,r),n);case 7:return ys(e,t,t.pendingProps,n),t.child;case 8:case 12:return ys(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(a=t.type._context,r=t.pendingProps,i=t.memoizedProps,s=r.value,Tr(Eo,a._currentValue),a._currentValue=s,null!==i)if(sa(i.value,s)){if(i.children===r.children&&!_r.current){t=qs(e,t,n);break e}}else for(null!==(i=t.child)&&(i.return=t);null!==i;){var l=i.dependencies;if(null!==l){s=i.child;for(var c=l.firstContext;null!==c;){if(c.context===a){if(1===i.tag){(c=zo(-1,n&-n)).tag=2;var d=i.updateQueue;if(null!==d){var m=(d=d.shared).pending;null===m?c.next=c:(c.next=m.next,m.next=c),d.pending=c}}i.lanes|=n,null!==(c=i.alternate)&&(c.lanes|=n),_o(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(10===i.tag)s=i.type===t.type?null:i.child;else if(18===i.tag){if(null===(s=i.return))throw Error(o(341));s.lanes|=n,null!==(l=s.alternate)&&(l.lanes|=n),_o(s,n,t),s=i.sibling}else s=i.child;if(null!==s)s.return=i;else for(s=i;null!==s;){if(s===t){s=null;break}if(null!==(i=s.sibling)){i.return=s.return,s=i;break}s=s.return}i=s}ys(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,a=t.pendingProps.children,No(t,n),a=a(r=Mo(r)),t.flags|=1,ys(e,t,a,n),t.child;case 14:return r=ns(a=t.type,t.pendingProps),ws(e,t,a,r=ns(a.type,r),n);case 15:return ks(e,t,t.type,t.pendingProps,n);case 17:return a=t.type,r=t.pendingProps,r=t.elementType===a?r:ns(a,r),Ws(e,t),t.tag=1,Ir(a)?(e=!0,Lr(t)):e=!1,No(t,n),is(t,a,r),ls(t,a,r,n),As(null,t,a,!0,e,n);case 19:return Os(e,t,n);case 22:return Es(e,t,n)}throw Error(o(156,t.tag))};var Vc="function"==typeof reportError?reportError:function(e){};function Gc(e){this._internalRoot=e}function Kc(e){this._internalRoot=e}function $c(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Yc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Xc(){}function Jc(e,t,n,a,r){var o=n._reactRootContainer;if(o){var i=o;if("function"==typeof r){var s=r;r=function(){var e=qc(i);s.call(e)}}Wc(t,i,e,r)}else i=function(e,t,n,a,r){if(r){if("function"==typeof a){var o=a;a=function(){var e=qc(i);o.call(e)}}var i=Oc(t,a,e,0,null,!1,0,"",Xc);return e._reactRootContainer=i,e[gr]=i.current,qa(8===e.nodeType?e.parentNode:e),lc(),i}for(;r=e.lastChild;)e.removeChild(r);if("function"==typeof a){var s=a;a=function(){var e=qc(l);s.call(e)}}var l=Fc(e,0,!1,null,0,!1,0,"",Xc);return e._reactRootContainer=l,e[gr]=l.current,qa(8===e.nodeType?e.parentNode:e),lc(function(){Wc(t,l,n,a)}),l}(n,t,e,r,a);return qc(i)}Kc.prototype.render=Gc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(o(409));Wc(e,t,null,null)},Kc.prototype.unmount=Gc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;lc(function(){Wc(null,e,null,null)}),t[gr]=null}},Kc.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rt.length&&0!==t&&t<Rt[n].priority;n++);Rt.splice(n,0,e),0===n&&Ut(e)}},wt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=mt(t.pendingLanes);0!==n&&(vt(t,1|n),tc(t,Je()),!(6&Tl)&&(Ol=Je()+500,qr()))}break;case 13:lc(function(){var t=Po(e,1);if(null!==t){var n=Ql();ec(t,e,1,n)}}),jc(e,1)}},kt=function(e){if(13===e.tag){var t=Po(e,134217728);if(null!==t)ec(t,e,134217728,Ql());jc(e,134217728)}},Et=function(e){if(13===e.tag){var t=Zl(e),n=Po(e,t);if(null!==n)ec(n,e,t,Ql());jc(e,t)}},St=function(){return yt},Ct=function(e,t){var n=yt;try{return yt=e,t()}finally{yt=n}},ke=function(e,t,n){switch(t){case"input":if(Q(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var r=wr(a);if(!r)throw Error(o(90));K(a),Q(a,r)}}}break;case"textarea":oe(e,n);break;case"select":null!=(t=n.value)&&ne(e,!!n.multiple,t,!1)}},De=sc,_e=lc;var Qc={usingClientEntryPoint:!1,Events:[yr,xr,wr,Te,Ae,sc]},Zc={findFiberByHostInstance:vr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ed={bundleType:Zc.bundleType,version:Zc.version,rendererPackageName:Zc.rendererPackageName,rendererConfig:Zc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:x.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ve(e))?null:e.stateNode},findFiberByHostInstance:Zc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var td=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!td.isDisabled&&td.supportsFiber)try{rt=td.inject(ed),ot=td}catch(de){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Qc,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!$c(t))throw Error(o(200));return function(e,t,n){var a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:k,key:null==a?null:""+a,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.createRoot=function(e,t){if(!$c(e))throw Error(o(299));var n=!1,a="",r=Vc;return null!=t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(a=t.identifierPrefix),void 0!==t.onRecoverableError&&(r=t.onRecoverableError)),t=Fc(e,1,!1,null,0,n,0,a,r),e[gr]=t.current,qa(8===e.nodeType?e.parentNode:e),new Gc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(o(188));throw e=Object.keys(e).join(","),Error(o(268,e))}return e=null===(e=Ve(t))?null:e.stateNode},t.flushSync=function(e){return lc(e)},t.hydrate=function(e,t,n){if(!Yc(t))throw Error(o(200));return Jc(null,e,t,!0,n)},t.hydrateRoot=function(e,t,n){if(!$c(e))throw Error(o(405));var a=null!=n&&n.hydratedSources||null,r=!1,i="",s=Vc;if(null!=n&&(!0===n.unstable_strictMode&&(r=!0),void 0!==n.identifierPrefix&&(i=n.identifierPrefix),void 0!==n.onRecoverableError&&(s=n.onRecoverableError)),t=Oc(t,null,e,1,null!=n?n:null,r,0,i,s),e[gr]=t.current,qa(e),a)for(e=0;e<a.length;e++)r=(r=(n=a[e])._getVersion)(n._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new Kc(t)},t.render=function(e,t,n){if(!Yc(t))throw Error(o(200));return Jc(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!Yc(e))throw Error(o(40));return!!e._reactRootContainer&&(lc(function(){Jc(null,null,e,!1,function(){e._reactRootContainer=null,e[gr]=null})}),!0)},t.unstable_batchedUpdates=sc,t.unstable_renderSubtreeIntoContainer=function(e,t,n,a){if(!Yc(n))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return Jc(e,t,n,!1,a)},t.version="18.3.1-next-f1338f8080-20240426"},5338(e,t,n){"use strict";var a=n(961);t.createRoot=a.createRoot,t.hydrateRoot=a.hydrateRoot},961(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){}}(),e.exports=n(2551)},5287(e,t){"use strict";var n=Symbol.for("react.element"),a=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),u=Symbol.iterator;var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,b={};function f(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||g}function v(){}function y(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||g}f.prototype.isReactComponent={},f.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},f.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=f.prototype;var x=y.prototype=new v;x.constructor=y,h(x,f.prototype),x.isPureReactComponent=!0;var w=Array.isArray,k=Object.prototype.hasOwnProperty,E={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,a){var r,o={},i=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(i=""+t.key),t)k.call(t,r)&&!S.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(1===l)o.children=a;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];o.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===o[r]&&(o[r]=l[r]);return{$$typeof:n,type:e,key:i,ref:s,props:o,_owner:E.current}}function T(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var A=/\/+/g;function D(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function _(e,t,r,o,i){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case a:l=!0}}if(l)return i=i(l=e),e=""===o?"."+D(l,0):o,w(i)?(r="",null!=e&&(r=e.replace(A,"$&/")+"/"),_(i,t,r,"",function(e){return e})):null!=i&&(T(i)&&(i=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,r+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(A,"$&/")+"/")+e)),t.push(i)),1;if(l=0,o=""===o?".":o+":",w(e))for(var c=0;c<e.length;c++){var d=o+D(s=e[c],c);l+=_(s,t,r,d,i)}else if(d=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=u&&e[u]||e["@@iterator"])?e:null}(e),"function"==typeof d)for(e=d.call(e),c=0;!(s=e.next()).done;)l+=_(s=s.value,t,r,d=o+D(s,c++),i);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function N(e,t,n){if(null==e)return e;var a=[],r=0;return _(e,a,"","",function(e){return t.call(n,e,r++)}),a}function M(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var I={current:null},R={transition:null},B={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:R,ReactCurrentOwner:E};function P(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:N,forEach:function(e,t,n){N(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return N(e,function(){t++}),t},toArray:function(e){return N(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=f,t.Fragment=r,t.Profiler=i,t.PureComponent=y,t.StrictMode=o,t.Suspense=d,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B,t.act=P,t.cloneElement=function(e,t,a){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=h({},e.props),o=e.key,i=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,s=E.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)k.call(t,c)&&!S.hasOwnProperty(c)&&(r[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)r.children=a;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];r.children=l}return{$$typeof:n,type:e.type,key:o,ref:i,props:r,_owner:s}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=C,t.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=T,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:M}},t.memo=function(e,t){return{$$typeof:m,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=R.transition;R.transition={};try{e()}finally{R.transition=t}},t.unstable_act=P,t.useCallback=function(e,t){return I.current.useCallback(e,t)},t.useContext=function(e){return I.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return I.current.useDeferredValue(e)},t.useEffect=function(e,t){return I.current.useEffect(e,t)},t.useId=function(){return I.current.useId()},t.useImperativeHandle=function(e,t,n){return I.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return I.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return I.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return I.current.useMemo(e,t)},t.useReducer=function(e,t,n){return I.current.useReducer(e,t,n)},t.useRef=function(e){return I.current.useRef(e)},t.useState=function(e){return I.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return I.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return I.current.useTransition()},t.version="18.3.1"},6540(e,t,n){"use strict";e.exports=n(5287)},7463(e,t){"use strict";function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var a=n-1>>>1,r=e[a];if(!(0<o(r,t)))break e;e[a]=t,e[n]=r,n=a}}function a(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var a=0,r=e.length,i=r>>>1;a<i;){var s=2*(a+1)-1,l=e[s],c=s+1,d=e[c];if(0>o(l,n))c<r&&0>o(d,l)?(e[a]=d,e[c]=n,a=c):(e[a]=l,e[s]=n,a=s);else{if(!(c<r&&0>o(d,n)))break e;e[a]=d,e[c]=n,a=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var c=[],d=[],m=1,p=null,u=3,g=!1,h=!1,b=!1,f="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function x(e){for(var t=a(d);null!==t;){if(null===t.callback)r(d);else{if(!(t.startTime<=e))break;r(d),t.sortIndex=t.expirationTime,n(c,t)}t=a(d)}}function w(e){if(b=!1,x(e),!h)if(null!==a(c))h=!0,R(k);else{var t=a(d);null!==t&&B(w,t.startTime-e)}}function k(e,n){h=!1,b&&(b=!1,v(T),T=-1),g=!0;var o=u;try{for(x(n),p=a(c);null!==p&&(!(p.expirationTime>n)||e&&!_());){var i=p.callback;if("function"==typeof i){p.callback=null,u=p.priorityLevel;var s=i(p.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?p.callback=s:p===a(c)&&r(c),x(n)}else r(c);p=a(c)}if(null!==p)var l=!0;else{var m=a(d);null!==m&&B(w,m.startTime-n),l=!1}return l}finally{p=null,u=o,g=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var E,S=!1,C=null,T=-1,A=5,D=-1;function _(){return!(t.unstable_now()-D<A)}function N(){if(null!==C){var e=t.unstable_now();D=e;var n=!0;try{n=C(!0,e)}finally{n?E():(S=!1,C=null)}}else S=!1}if("function"==typeof y)E=function(){y(N)};else if("undefined"!=typeof MessageChannel){var M=new MessageChannel,I=M.port2;M.port1.onmessage=N,E=function(){I.postMessage(null)}}else E=function(){f(N,0)};function R(e){C=e,S||(S=!0,E())}function B(e,n){T=f(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){h||g||(h=!0,R(k))},t.unstable_forceFrameRate=function(e){0>e||125<e||(A=0<e?Math.floor(1e3/e):5)},t.unstable_getCurrentPriorityLevel=function(){return u},t.unstable_getFirstCallbackNode=function(){return a(c)},t.unstable_next=function(e){switch(u){case 1:case 2:case 3:var t=3;break;default:t=u}var n=u;u=t;try{return e()}finally{u=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=u;u=e;try{return t()}finally{u=n}},t.unstable_scheduleCallback=function(e,r,o){var i=t.unstable_now();switch("object"==typeof o&&null!==o?o="number"==typeof(o=o.delay)&&0<o?i+o:i:o=i,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:m++,callback:r,priorityLevel:e,startTime:o,expirationTime:s=o+s,sortIndex:-1},o>i?(e.sortIndex=o,n(d,e),null===a(c)&&e===a(d)&&(b?(v(T),T=-1):b=!0,B(w,o-i))):(e.sortIndex=s,n(c,e),h||g||(h=!0,R(k))),e},t.unstable_shouldYield=_,t.unstable_wrapCallback=function(e){var t=u;return function(){var n=u;u=t;try{return e.apply(this,arguments)}finally{u=n}}}},9982(e,t,n){"use strict";e.exports=n(7463)},5180(e,t,n){"use strict";n.d(t,{ChatFilter:()=>r,H:()=>o});var a=n(6839);class r{constructor(){this.activeTabId=null,this.observer=null,this.styleElement=null,this.isWhatsAppFilterActive=!1,this.nativeFilterObserver=null,this.isFiltering=!1,this.oneToOneDebounceTimer=null,this.activeCRMStage=null,this.isCRMStageFilterActive=!1,this.crmStageObserver=null,this.useNativeFilterForCRM=!1,this.crmFilterDebounceTimer=null,this.currentCustomTabChatIds=new Set,this.isCustomTabFilterActive=!1,this.hiddenChatsMap=new Map,this.init(),this.injectFilterStyles()}static getInstance(){return r.instance||(r.instance=new r),r.instance}async getGroupsByMembers(e){return new Promise(t=>{const n=setTimeout(()=>{t([])},5e3),a=e=>{clearTimeout(n),document.removeEventListener("getGroupsByMembersResponse",a);const{success:r,groups:o,error:i}=e.detail||{};t(r&&o?o:[])};document.addEventListener("getGroupsByMembersResponse",a),document.dispatchEvent(new CustomEvent("getGroupsByMembers",{detail:{memberIds:e}}))})}injectFilterStyles(){this.styleElement||(this.styleElement=document.createElement("style"),this.styleElement.id="wa-chat-filter-styles",this.styleElement.textContent='\n        /* Backup CSS rule for filtered chats */\n        [data-wa-custom-filtered="true"] { display: none !important; }\n\n        /* NOTE: #app padding is now controlled ONLY by licenseHeader.tsx dynamically */\n        /* This prevents gray space appearing before header is rendered */\n        /* licenseHeader.tsx sets inline padding-top: 0px/56px/96px based on view mode */\n\n        /* Compact list container we control */\n        #wa-compact-list {\n          display: none;\n          overflow-y: auto;\n          overflow-x: hidden;\n          max-height: 100%;\n          height: 100%;\n          width: 100%;\n          position: relative;\n          z-index: 1;\n          background: var(--lion-bg-primary);\n        }\n        #wa-compact-list.wa-compact-active {\n          display: block !important;\n        }\n        /* Normalize moved chat rows (remove virtualization transforms) */\n        #wa-compact-list > * {\n          transform: none !important;\n          position: relative !important;\n          top: auto !important; left: auto !important; right: auto !important; bottom: auto !important;\n          height: auto !important; min-height: 72px;\n          margin: 0 !important; padding: 0 !important;\n          opacity: 1 !important; visibility: visible !important;\n        }\n      ',document.head.appendChild(this.styleElement))}removeFilterStyles(){this.styleElement&&this.styleElement.parentNode&&(this.styleElement.parentNode.removeChild(this.styleElement),this.styleElement=null)}init(){window.addEventListener("wa-tab-changed",e=>{const{tabId:t}=e.detail;this.activeTabId=t,this.isWhatsAppFilterActive=!1,this.clearWhatsAppFilterState();const n=t?a.TabsStorage.getTab(t):null;n&&n.id!==a.EB?n.id===a.al?(this.stopObserver(),this.filterIndividualChatsOnly()):n.id===a.bu?(this.stopObserver(),this.filterGroupsOnly()):n.id===a.ky?(this.stopObserver(),this.filterUnreadOnly()):n.id===a.R$?(this.stopObserver(),this.filterUnsavedOnly()):(this.resumeObserver(),this.applyFilter()):(this.stopObserver(),this.resetToNativeChatList(),document.dispatchEvent(new CustomEvent("resetChatListFilter")))}),document.addEventListener("wa-tab-data-updated",e=>{const{tabId:t,action:n,chatId:a}=e.detail;this.activeTabId===t&&this.applyFilter()});const e=a.TabsStorage.getActiveTabId();if(e){this.activeTabId=e;const t=a.TabsStorage.getTab(e);t&&t.id&&t.id!==a.EB&&this.watchChatList(),setTimeout(()=>{t?.id===a.al?this.filterIndividualChatsOnly():t?.id===a.bu?this.filterGroupsOnly():t?.id===a.ky?this.filterUnreadOnly():t?.id===a.R$?this.filterUnsavedOnly():t?.id!==a.EB&&t&&this.applyFilter()},100)}this.setupNativeFilterDetection(),window.addEventListener("wa-crm-stage-filter",e=>{const{stageId:t,stageName:n,crmId:a,labelId:r,customTabId:o}=e.detail;this.activeCRMStage={stageId:t,stageName:n,crmId:a,labelId:r,customTabId:o},this.isCRMStageFilterActive=!0,this.activeTabId=null,this.isWhatsAppFilterActive=!1,this.stopObserver(),this.applyCRMStageFilter(),this.startCRMStageObserver()}),this.setupStorageChangeListener()}setupStorageChangeListener(){Promise.resolve().then(n.t.bind(n,6815,23)).then(e=>{e.default.storage.onChanged.addListener((e,t)=>{"local"===t&&e.wa_kanban_crm_data_sync&&this.isCRMStageFilterActive&&this.activeCRMStage&&setTimeout(()=>{this.applyCRMStageFilter()},100)})}).catch(e=>{})}setupNativeFilterDetection(){const e=()=>{let e=0;return['button[aria-label*="All"]','button[aria-label*="Unread"]','button[aria-label*="Favourites"]','button[aria-label*="Groups"]','button[title*="All"]','button[title*="Unread"]','button[title*="Favourites"]','button[title*="Groups"]','div[role="button"][aria-label*="All"]','div[role="button"][aria-label*="Unread"]','div[role="button"][aria-label*="Favourites"]','div[role="button"][aria-label*="Groups"]','[data-testid*="filter"]','[data-tab*="ALL"]','[data-tab*="UNREAD"]','[data-tab*="GROUPS"]'].forEach(t=>{document.querySelectorAll(t).forEach(t=>{t.__waFilterListenerAttached||(t.addEventListener("click",()=>{this.handleWhatsAppFilterClick()}),t.__waFilterListenerAttached=!0,e++)})}),e>0};e()||(setTimeout(e,2e3),setTimeout(e,5e3)),this.nativeFilterObserver=new MutationObserver(()=>{e()});const t=document.body||document.documentElement;this.nativeFilterObserver.observe(t,{childList:!0,subtree:!0})}handleWhatsAppFilterClick(){this.isWhatsAppFilterActive=!0,window.dispatchEvent(new CustomEvent("wa-tab-changed",{detail:{tabId:"all"}}))}clearWhatsAppFilterState(){if(!this.isWhatsAppFilterActive)return;const e=document.querySelectorAll('button[aria-label*="All"], button[title*="All"], [data-tab*="ALL"]');let t=!1;e.forEach(e=>{!t&&e instanceof HTMLElement&&(e.click(),t=!0)})}watchChatList(){const e=()=>{const t=this.getChatListContainer();t?this.startObserver(t):setTimeout(e,1e3)};e()}startObserver(e){this.observer&&this.observer.disconnect(),this.observer=new MutationObserver(()=>{if(this.isFiltering)return;a.TabsStorage.getState().activeTabId===a.al?(this.oneToOneDebounceTimer&&clearTimeout(this.oneToOneDebounceTimer),this.oneToOneDebounceTimer=setTimeout(()=>{this.filterIndividualChatsOnly()},300)):this.applyFilter()}),this.observer.observe(e,{childList:!0,subtree:!0})}stopObserver(){this.observer&&(this.observer.disconnect(),this.observer=null)}resumeObserver(){if(!this.observer){const e=this.getChatListContainer();e&&this.startObserver(e)}}startCRMStageObserver(){this.stopCRMStageObserver();const e=this.getChatListContainer();e?(this.crmStageObserver=new MutationObserver(()=>{this.useNativeFilterForCRM||this.isCRMStageFilterActive&&this.activeCRMStage&&this.activeCRMStage.stageName}),this.crmStageObserver.observe(e,{childList:!0,subtree:!0})):setTimeout(()=>this.startCRMStageObserver(),1e3)}stopCRMStageObserver(){this.crmStageObserver&&(this.crmStageObserver.disconnect(),this.crmStageObserver=null),this.crmFilterDebounceTimer&&(clearTimeout(this.crmFilterDebounceTimer),this.crmFilterDebounceTimer=null)}getChatListContainer(){const e=['[data-testid="chat-list"]',"#pane-side",'div[aria-label*="Chat list"]','div[role="grid"]'];for(const t of e){const e=document.querySelector(t);if(e)return e}return null}resetToNativeChatList(){this.stopCRMStageObserver(),this.disableCompactMode(),this.showAllChats(),this.isCRMStageFilterActive=!1,this.useNativeFilterForCRM=!1,this.activeCRMStage=null}async applyCRMStageFilter(){if(!this.activeCRMStage)return;if("INBOX"===this.activeCRMStage.stageName)return this.disableCompactMode(),this.showAllChats(),void document.dispatchEvent(new CustomEvent("applyChatListFilter",{detail:{filterType:"all"}}));if(this.activeCRMStage.labelId)return void await this.displayChatsByWhatsAppLabel(this.activeCRMStage.labelId);const{KanbanStorage:e}=await Promise.resolve().then(n.bind(n,3538)),t=(await e.getStateAsync()).assignments.filter(e=>e.stageId===this.activeCRMStage.stageId&&e.crmId===this.activeCRMStage.crmId).map(e=>e.chatId);0!==t.length?await this.displayCRMStageChats(t):this.displayCRMStageChats([])}async displayChatsByWhatsAppLabel(e){this.disableCompactMode();const t=a=>{document.removeEventListener("chatListFilterResponse",t),clearTimeout(n);const r=a,{success:o,usedNativeFilter:i,stats:s}=r.detail||{};o&&(this.useNativeFilterForCRM=!0,window.dispatchEvent(new CustomEvent("wa-tab-filter-stats",{detail:{tabId:this.activeCRMStage?.stageId||"label-"+e,activeChats:s?.filtered||0,totalRequested:s?.total||0,missingChats:0}})))},n=setTimeout(()=>{document.removeEventListener("chatListFilterResponse",t)},5e3);document.addEventListener("chatListFilterResponse",t),document.dispatchEvent(new CustomEvent("applyChatListFilter",{detail:{filterType:"labels",labelId:e}}))}renderLabeledChatsInContainer(e,t){const n=this.ensureCompactContainer();if(n)if(0!==e.length){e.sort((e,t)=>(t.timestamp||0)-(e.timestamp||0)),n.innerHTML="";for(const t of e){const e=this.createChatElement(t);n.appendChild(e)}window.dispatchEvent(new CustomEvent("wa-tab-filter-stats",{detail:{tabId:this.activeCRMStage?.stageId||"label-"+t,activeChats:e.length,totalRequested:e.length,missingChats:0}}))}else n.innerHTML='<div class="empty" style="padding: 20px; text-align: center; color: #667781;">No chats with this label</div>'}async displayLabeledChatsCompactFallback(e){const t=this.ensureCompactContainer();if(t){t.innerHTML='<div class="loading" style="padding: 20px; text-align: center; color: #667781;">Loading labeled chats...</div>';try{const n=await this.getChatsByLabel(e);if(t.innerHTML="",0===n.length)return void(t.innerHTML='<div class="empty" style="padding: 20px; text-align: center; color: #667781;">No chats with this label</div>');n.sort((e,t)=>(t.timestamp||0)-(e.timestamp||0));for(const e of n){const n=this.createChatElement(e);t.appendChild(n)}}catch(e){t.innerHTML='<div class="error" style="padding: 20px; text-align: center; color: #d93025;">Error loading labeled chats</div>'}}}getChatsByLabel(e){return new Promise(t=>{const n=setTimeout(()=>{document.removeEventListener("kanbanFetchChatsByLabelResponse",a),t([])},1e4),a=r=>{const o=r,{success:i,chats:s,error:l,requestLabelId:c}=o.detail||{};if(c===e)if(clearTimeout(n),document.removeEventListener("kanbanFetchChatsByLabelResponse",a),i&&s){const e=s.map(e=>({id:e.id,name:e.name,phoneNumber:e.phoneNumber,profilePic:e.profilePic,lastMessage:e.lastMessage,timestamp:e.lastMessageTime,lastMessageType:e.lastMessageType,unreadCount:e.unreadCount,isGroup:e.isGroup,isPinned:e.isPinned}));t(e)}else t([])};document.addEventListener("kanbanFetchChatsByLabelResponse",a),document.dispatchEvent(new CustomEvent("kanbanFetchChatsByLabelRequest",{detail:{labelId:e}}))})}async displayCRMStageChats(e){const t=[];try{const a=await Promise.resolve().then(n.t.bind(n,6815,23)),r=(await a.default.storage.local.get(["kanban_chats"])).kanban_chats||[];e.forEach(e=>{const n=r.find(t=>t.id===e);n?.name&&t.push(n.name)})}catch(e){}if(t.length,0===e.length){this.enableCompactMode();const e=this.ensureCompactContainer();return void(e&&(e.innerHTML='<div style="padding: 20px; text-align: center; color: #667781;">No chats in this stage</div>'))}const a=t=>{document.removeEventListener("chatListFilterResponse",a),clearTimeout(r);const n=t,{success:o,stats:i}=n.detail||{};o&&window.dispatchEvent(new CustomEvent("wa-tab-filter-stats",{detail:{tabId:this.activeCRMStage?.stageId||"crm-stage",activeChats:i?.filtered||e.length,totalRequested:e.length,missingChats:0}}))},r=setTimeout(()=>{document.removeEventListener("chatListFilterResponse",a)},2e3);document.addEventListener("chatListFilterResponse",a),document.dispatchEvent(new CustomEvent("applyChatListFilter",{detail:{filterType:"custom",chatIds:e}})),this.useNativeFilterForCRM=!0,this.isCustomTabFilterActive=!0,this.currentCustomTabChatIds=new Set(e.map(e=>e.toLowerCase())),this.applyDOMFilter(e,"custom",t)}filterChatsByNames(e,t){const n=this.getChatListContainer();if(!n)return;const a=n.querySelector('[role="grid"], [role="list"]')||n.querySelector("div > div")||n,r=a?.querySelectorAll('[role="row"]');if(!r||0===r.length)return void setTimeout(()=>this.filterChatsByNames(e,t),500);for(const n of Array.from(r)){const a=n,r=this.getChatNameFromElement(a),o=r?.toLowerCase()||"",i=e.some(e=>o===e||o.includes(e)||e.includes(o));let s;s=t?!i:i,s?(a.style.display="",a.removeAttribute("data-wa-custom-filtered")):(a.style.display="none",a.setAttribute("data-wa-custom-filtered","true"))}}getTopRowContainer(){const e=this.getChatListContainer();return e?e.querySelector('[role="grid"]')||e.querySelector('[role="list"]')||e.querySelector("div > div")||e:null}ensureCompactContainer(){const e=this.getTopRowContainer();if(!e)return null;const t=e.parentElement||e;let n=document.getElementById("wa-compact-list");return n?n.parentElement!==t&&t.appendChild(n):(n=document.createElement("div"),n.id="wa-compact-list",t.appendChild(n)),n}enableCompactMode(){const e=this.getTopRowContainer(),t=this.ensureCompactContainer();e&&t&&(e.style.display="none",t.classList.add("wa-compact-active"),t.style.setProperty("display","block","important"))}disableCompactMode(){const e=this.getTopRowContainer(),t=document.getElementById("wa-compact-list");this.isCustomTabFilterActive&&this.resetCustomTabDOMFilter(),t&&(t.classList.remove("wa-compact-active"),t.style.cssText="",t.style.setProperty("display","none","important"),t.offsetHeight,t.innerHTML="",t.offsetHeight),e&&(e.style.display="")}resetCustomTabDOMFilter(){if(!this.isCustomTabFilterActive)return;document.querySelectorAll('[data-wa-custom-filtered="true"]').forEach(e=>{e instanceof HTMLElement&&(e.style.display="",e.removeAttribute("data-wa-custom-filtered"))}),this.currentCustomTabChatIds.clear(),this.isCustomTabFilterActive=!1}getChatItems(){const e=document.querySelector('[aria-label*="Chat list"]')||document.querySelector('[data-testid="chat-list"]')||document.querySelector('[role="grid"]')||document.querySelector("#pane-side");if(e){let t=e.querySelectorAll('[role="row"]');if(t.length>0)return t;const n=e.querySelectorAll(":scope > div");if(n.length>0)return n}let t=document.querySelectorAll('[role="row"]');if(t.length>0)return t;const n=document.querySelectorAll('[data-testid="cell-frame-container"], div[data-testid^="cell-frame"]');if(n.length>0){const e=[],t=new Set;return n.forEach(n=>{const a=n.closest('[role="row"]')||n.parentElement||n;a&&!t.has(a)&&(t.add(a),e.push(a))}),document.querySelectorAll('[role="row"]')}return document.querySelectorAll("")}getChatNameFromElement(e){const t=e.querySelector("span[title]");if(t){const e=t.getAttribute("title");if(e&&e.trim())return e.trim()}const n=e.getAttribute("aria-label");if(n){const e=n.match(/(?:Chat with |)(.+?)(?:\s+\d|$)/);if(e&&e[1])return e[1].trim()}const a=e.querySelector('[dir="auto"][title]');if(a){const e=a.getAttribute("title");if(e&&e.trim())return e.trim()}const r=e.querySelectorAll('span[dir="auto"]');for(const e of Array.from(r)){const t=e.textContent;if(t&&t.trim()&&t.length>2&&!t.includes(":")&&!t.match(/^\d+$/))return t.trim()}return null}getChatPhoneFromElement(e){const t=e.getAttribute("aria-label");if(t){const e=t.match(/\+?\d{10,}/);if(e)return e[0]}return null}getChatIdByName(e){return new Promise(t=>{const n=setTimeout(()=>{document.removeEventListener("getChatIdByNameResponse",a),t(null)},2e3),a=r=>{const o=r;o.detail.chatName===e&&(clearTimeout(n),document.removeEventListener("getChatIdByNameResponse",a),t(o.detail.chatId||null))};document.addEventListener("getChatIdByNameResponse",a),document.dispatchEvent(new CustomEvent("getChatIdByName",{detail:{chatName:e}}))})}getMultipleChats(e){return new Promise(t=>{const n=setTimeout(()=>{document.removeEventListener("getMultipleChatsResponse",a),t([])},5e3),a=e=>{const r=e;clearTimeout(n),document.removeEventListener("getMultipleChatsResponse",a),t(r.detail.chats||[])};document.addEventListener("getMultipleChatsResponse",a),document.dispatchEvent(new CustomEvent("getMultipleChats",{detail:{chatIds:e}}))})}createChatElement(e){const t=document.createElement("div");t.className="custom-chat-item",t.dataset.chatId=e.id,t.style.cssText="\n      display: flex;\n      align-items: center;\n      padding: 8px 16px;\n      min-height: 72px;\n      cursor: pointer;\n      border-bottom: 1px solid #e9edef;\n      transition: background-color 0.2s;\n      box-sizing: border-box;\n    ";const n=document.createElement("div");n.className="chat-avatar-container",n.style.cssText="\n      flex-shrink: 0;\n      padding-right: 15px;\n    ";const a=document.createElement("img");a.className="chat-avatar",a.src=e.profilePicUrl||this.getDefaultProfilePic(),a.alt=e.name,a.style.cssText="\n      width: 49px;\n      height: 49px;\n      border-radius: 50%;\n      object-fit: cover;\n      display: block;\n      background: #dfe5e7;\n    ",a.onerror=()=>{a.src=this.getDefaultProfilePic()},n.appendChild(a);const r=n,o=document.createElement("div");o.className="chat-info",o.style.cssText="\n      flex: 1;\n      min-width: 0;\n    ";const i=document.createElement("div");i.className="chat-header",i.style.cssText="\n      display: flex;\n      justify-content: space-between;\n      align-items: center;\n      margin-bottom: 2px;\n    ";const s=document.createElement("span");s.className="chat-name",s.textContent=e.name,s.style.cssText="\n      font-weight: 400;\n      font-size: 17px;\n      line-height: 21px;\n      color: #111b21;\n      overflow: hidden;\n      text-overflow: ellipsis;\n      white-space: nowrap;\n    ";const l=document.createElement("span");l.className="chat-time",l.textContent=this.formatTimestamp(e.timestamp),l.style.cssText="\n      font-size: 12px;\n      line-height: 20px;\n      color: #667781;\n      margin-left: 6px;\n      flex-shrink: 0;\n    ",i.appendChild(s),i.appendChild(l);const c=document.createElement("div");c.className="chat-footer",c.style.cssText="\n      display: flex;\n      justify-content: space-between;\n      align-items: center;\n      gap: 8px;\n    ";const d=document.createElement("span");d.className="last-message";const m=e.lastMessage?e.lastMessage.body||"📎 Media":"No messages";if(d.textContent=m,d.style.cssText="\n      font-size: 13px;\n      line-height: 20px;\n      color: #667781;\n      overflow: hidden;\n      text-overflow: ellipsis;\n      white-space: nowrap;\n      max-width: 250px;\n      flex-shrink: 1;\n      display: block;\n    ",c.appendChild(d),e.unreadCount&&e.unreadCount>0){const t=document.createElement("span");t.className="unread-badge",t.textContent=e.unreadCount.toString(),t.style.cssText="\n        background-color: var(--lion-primary);\n        color: white;\n        border-radius: 10px;\n        padding: 2px 6px;\n        font-size: 12px;\n        margin-left: 8px;\n      ",c.appendChild(t)}return o.appendChild(i),o.appendChild(c),t.appendChild(r),t.appendChild(o),t.addEventListener("mouseenter",()=>{t.style.backgroundColor="#f5f6f6"}),t.addEventListener("mouseleave",()=>{t.style.backgroundColor=""}),t.addEventListener("click",()=>{document.dispatchEvent(new CustomEvent("openChat",{detail:{chatId:e.id}}))}),t}getDefaultProfilePic(){return'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 212 212"%3E%3Cpath fill="%23DFE5E7" d="M106.251.5C164.653.5 212 47.846 212 106.25S164.653 212 106.25 212C47.846 212 .5 164.654.5 106.25S47.846.5 106.251.5z"/%3E%3Cpath fill="%23FFF" d="M173.561 171.615a62.767 62.767 0 0 0-2.065-2.955 67.7 67.7 0 0 0-2.608-3.299 70.112 70.112 0 0 0-3.184-3.527 71.097 71.097 0 0 0-5.924-5.47 72.458 72.458 0 0 0-10.204-7.026 75.2 75.2 0 0 0-5.98-3.055c-.062-.028-.118-.059-.18-.087-9.792-4.44-22.106-7.529-37.416-7.529s-27.624 3.089-37.416 7.529c-.338.153-.653.318-.985.474a75.37 75.37 0 0 0-6.229 3.298 72.589 72.589 0 0 0-9.15 6.395 71.243 71.243 0 0 0-5.924 5.47 70.064 70.064 0 0 0-3.184 3.527 67.142 67.142 0 0 0-2.609 3.299 63.292 63.292 0 0 0-2.065 2.955 56.33 56.33 0 0 0-1.447 2.324c-.033.056-.073.119-.104.174a47.92 47.92 0 0 0-1.07 1.926c-.559 1.068-.818 1.678-.818 1.678v.398c18.285 17.927 43.322 28.985 70.945 28.985 27.678 0 52.761-11.103 71.055-29.095v-.289s-.619-1.45-1.992-3.778a58.346 58.346 0 0 0-1.446-2.322zM106.002 125.5c2.645 0 5.212-.253 7.68-.737a38.272 38.272 0 0 0 3.624-.896 37.124 37.124 0 0 0 5.12-1.958 36.307 36.307 0 0 0 6.15-3.67 35.923 35.923 0 0 0 9.489-10.48 36.558 36.558 0 0 0 2.422-4.84 37.051 37.051 0 0 0 1.716-5.25c.299-1.208.542-2.443.725-3.701.275-1.887.417-3.827.417-5.811s-.142-3.925-.417-5.811a38.734 38.734 0 0 0-1.215-5.494 36.68 36.68 0 0 0-3.648-8.298 35.923 35.923 0 0 0-9.489-10.48 36.347 36.347 0 0 0-6.15-3.67 37.124 37.124 0 0 0-5.12-1.958 37.67 37.67 0 0 0-3.624-.896 39.875 39.875 0 0 0-7.68-.737c-21.162 0-37.345 16.183-37.345 37.345 0 21.159 16.183 37.342 37.345 37.342z"/%3E%3C/svg%3E'}createAvatarPlaceholder(e){const t=document.createElement("div");t.className="chat-avatar-placeholder";const n=e.split(" ").map(e=>e[0]).filter(Boolean).slice(0,2).join("").toUpperCase()||e.substring(0,2).toUpperCase(),a=["#00a884","#0088cc","#fa5833","#8b3dff","#ff5e5e","#00af9c","#38bdf8","#1fa7ff"],r=a[e.split("").reduce((e,t)=>e+t.charCodeAt(0),0)%a.length];return t.textContent=n,t.style.cssText=`\n      width: 48px;\n      height: 48px;\n      border-radius: 50%;\n      margin-right: 12px;\n      background-color: ${r};\n      color: white;\n      display: flex;\n      align-items: center;\n      justify-content: center;\n      font-size: 18px;\n      font-weight: 500;\n      flex-shrink: 0;\n      user-select: none;\n    `,t}formatTimestamp(e){if(!e)return"";const t=new Date(1e3*e),n=(new Date).getTime()-t.getTime(),a=Math.floor(n/864e5);return 0===a?t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}):1===a?"Yesterday":a<7?t.toLocaleDateString("en-US",{weekday:"short"}):t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}async displayOnlySelectedChats(e){const t=[],n=[];if((e.chats||[]).forEach(e=>{"string"==typeof e?t.push(e):(t.push(e.id),e.name&&n.push(e.name))}),0===t.length)return;const a=n,r=n=>{document.removeEventListener("chatListFilterResponse",r),clearTimeout(o);const a=n,{success:i,usedNativeFilter:s,stats:l}=a.detail||{};i&&window.dispatchEvent(new CustomEvent("wa-tab-filter-stats",{detail:{tabId:e.id,activeChats:l?.filtered||t.length,totalRequested:t.length,missingChats:0}}))},o=setTimeout(()=>{document.removeEventListener("chatListFilterResponse",r)},2e3);document.addEventListener("chatListFilterResponse",r),document.dispatchEvent(new CustomEvent("applyChatListFilter",{detail:{filterType:"custom",chatIds:t}})),this.useNativeFilterForCRM=!0,this.isCustomTabFilterActive=!0,this.currentCustomTabChatIds=new Set(t.map(e=>e.toLowerCase())),this.applyDOMFilter(t,"custom",a)}extractChatIdFromElement(e){try{const t=e.getAttribute("data-id")||e.getAttribute("data-chat-id")||e.querySelector("[data-id]")?.getAttribute("data-id");if(t)return t;const n=e.getAttribute("title")||e.getAttribute("aria-label")||e.querySelector("[title]")?.getAttribute("title");if(n){if(n.match(/^\+?[\d\s-]+$/))return n.replace(/[\s-]/g,"")}const a=e.querySelector('[data-testid="cell-frame-title"]');if(a){const e=a.querySelector("span")?.textContent;if(e&&/^\+?[\d\s-]+$/.test(e.trim()))return e.replace(/[\s-]/g,"")}const r=e.querySelector('a[href*="chat"]');if(r){const e=(r.getAttribute("href")||"").match(/(\d+@[cg]\.us)/);if(e)return e[1]}return null}catch(e){return null}}isGroupChat(e){this.getChatNameFromElement(e);try{const e=null;if(e){const t=window.WPP;if(t&&t.chat&&t.chat.get){const n=t.chat.get(e);if(n){if(n.isGroup||"group"===n.kind||"group"===n.type)return!0}}if(e&&e.includes("@g.us"))return!0;if(e&&e.includes("@c.us"))return!1}}catch(e){}if(e.querySelector('img[src*="default-group"], img[src*="group"], img[alt*="Group"]'))return!0;if(e.querySelector('[data-icon="group"]')||e.querySelector('[data-icon="default-group"]')||e.querySelector('[data-icon="community"]')||e.querySelector('svg[data-icon="group"]')||e.querySelector('[aria-label*="group" i]')||e.querySelector('[title*="group" i]'))return!0;const t=e.querySelector('[data-testid="cell-frame-container"]')||e.querySelector('[role="gridcell"]')||e.querySelector('div[style*="border-radius"]');if(t){if(t.querySelectorAll("circle, ellipse").length>=3)return!0}const n=e.textContent||"";if(n.match(/\d+\s+(participants?|members?)/i))return!0;if(n.includes("Group")||n.includes("ग्रुप")||n.includes("समूह"))return!0;const a=e.getAttribute("data-id");if(a){if(a.includes("@g.us"))return!0;if(a.includes("@c.us"))return!1}return!1}async getChatIdFromElement(e){const t=this.getChatNameFromElement(e);if(t)try{const e=await this.getChatIdByName(t);if(e)return e}catch(e){}const n=e.getAttribute("data-id");if(n)return n;const a=e.querySelector("[data-id]");if(a){const e=a.getAttribute("data-id");if(e)return e}const r=e.getAttribute("aria-label");if(r){const e=r.match(/(\+?\d{10,15})@(c\.us|g\.us)/);if(e){return e[0]}}let o=e.parentElement,i=0;for(;o&&i<5;){const e=o.getAttribute("data-id");if(e)return e;o=o.parentElement,i++}try{const t=Object.keys(e).filter(e=>e.startsWith("__reactProps")||e.startsWith("__reactFiber")||e.startsWith("__react"));for(const n of t){const t=e[n];if(t?.data?.id){return t.data.id._serialized||t.data.id}if(t?.children?.props?.data?.id){return t.children.props.data.id._serialized||t.children.props.data.id}if(t?.memoizedProps?.data?.id){return t.memoizedProps.data.id._serialized||t.memoizedProps.data.id}if(t?.return?.memoizedProps?.data?.id){return t.return.memoizedProps.data.id._serialized||t.return.memoizedProps.data.id}}}catch(e){}const s=e.querySelectorAll("a");for(const e of Array.from(s)){const t=e.getAttribute("href");if(t&&t.includes("chat")){const e=t.match(/chat\/([^\/\?]+)/);if(e&&e[1]){return decodeURIComponent(e[1])}}}try{const t=this.getChatNameFromElement(e);if(t){const e=window.WPP;if(e&&e.chat&&e.chat.find){const n=e.chat.find(e=>e.name===t||e.formattedTitle===t);if(n&&n.id){return n.id._serialized||n.id.toString()}}}}catch(e){}return null}async applyFilter(){if(this.isFiltering)return;this.isFiltering=!0;const e=null!==this.observer;e&&this.observer?.disconnect();if(!(document.querySelector('[data-testid="chat-list"]')||document.querySelector("#pane-side")||document.querySelector('[role="grid"]')))return this.isFiltering=!1,e&&this.resumeObserver(),void setTimeout(()=>this.applyFilter(),500);if(this.isWhatsAppFilterActive)return this.isFiltering=!1,void(e&&this.resumeObserver());if(!this.activeTabId)return this.resetToNativeChatList(),this.isFiltering=!1,void(e&&this.resumeObserver());const t=a.TabsStorage.getTab(this.activeTabId);if(!t)return this.resetToNativeChatList(),this.isFiltering=!1,void(e&&this.resumeObserver());if("all"===t.id)return this.resetToNativeChatList(),this.isFiltering=!1,void(e&&this.resumeObserver());if(t.id===a.al){this.isFiltering=!1;this.filterIndividualChatsOnly();return;}if(t.id===a.bu){this.isFiltering=!1;this.filterGroupsOnly();return;}if(t.id===a.ky){this.isFiltering=!1;this.filterUnreadOnly();return;}if(t.id===a.R$){this.isFiltering=!1;this.filterUnsavedOnly();return;}if(0===(t.chats||[]).length)return this.resetToNativeChatList(),this.isFiltering=!1,void(e&&this.resumeObserver());this.resetToNativeChatList(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const n=document.querySelector('[data-testid="chat-list"]')||document.querySelector("#pane-side");if(!n)return;const a=n.querySelector('[role="grid"], [role="list"]')||n.querySelector("div > div")||n,r=a?.querySelectorAll('[role="row"]');r&&0!==r.length?(this.filterBySelectedChats(t),setTimeout(()=>{this.isFiltering=!1,e&&this.resumeObserver()},100)):setTimeout(()=>{this.filterBySelectedChats(t)},500)})})}triggerWhatsAppGroupsFilter(){const e=["#group-filter",'div[role="tab"]#group-filter','[data-tab="GROUPS"]','div[role="tab"]:has-text("Groups")'];let t=null;for(const n of e)try{if(t=document.querySelector(n),t)break}catch(e){}if(!t){t=Array.from(document.querySelectorAll('div[role="tab"]')).find(e=>{const t=e.textContent?.toLowerCase()||"";return t.includes("groups")||t.includes("group")||t.includes("ग्रुप")})}if(t)t.click(),this.isWhatsAppFilterActive=!0;else{this.restoreChatsFromStorage();const e=a.TabsStorage.getTab(this.activeTabId);e&&this.filterBySelectedChats(e)}}restoreChatsFromStorage(){const e=document.getElementById("wa-filter-storage");if(e&&e.children.length>0){const t=document.querySelector('[data-testid="chat-list"]')||document.querySelector("#pane-side");if(t){const n=t.querySelector('[role="grid"], [role="list"]')||t.querySelector("div > div")||t;Array.from(e.children).forEach(e=>{const t=e;n.appendChild(t)})}}}showAllChats(){const e=document.getElementById("wa-filter-storage");if(e&&e.children.length>0){const t=document.querySelector('[data-testid="chat-list"]')||document.querySelector("#pane-side");if(t){const n=t.querySelector('[role="grid"], [role="list"]')||t.querySelector("div > div")||t;Array.from(e.children).forEach(e=>{const t=e;t.removeAttribute("data-wa-custom-filtered"),t.removeAttribute("data-wa-parent-id"),t.removeAttribute("data-wa-parent-class"),t.removeAttribute("data-wa-position"),n.appendChild(t)})}}const t=document.querySelectorAll('[data-wa-custom-filtered="true"]');t.length>0&&t.forEach(e=>{const t=e,n=t.getAttribute("data-original-display")||"";t.style.display=n,t.removeAttribute("data-wa-custom-filtered"),t.removeAttribute("data-original-display")}),!e?.children.length&&t.length}filterIndividualChatsOnly(){this.applySystemFilter("onetoone","one-to-one")}filterGroupsOnly(){this.applySystemFilter("groups","groups")}filterUnreadOnly(){this.applySystemFilter("unread","unread")}filterUnsavedOnly(){this.applySystemFilter("unsaved","unsaved")}applySystemFilter(e,t){if(this.isFiltering)return;this.isFiltering=!0;const n=Date.now().toString(36)+Math.random().toString(36).substr(2,5);this.disableCompactMode();const a=n=>{const o=n.detail||{};if(o.filterType!==e)return;document.removeEventListener("chatListFilterResponse",a),clearTimeout(r);const{success:i,usedNativeFilter:s,stats:l,chatIds:c,chats:d}=o;i&&("all"===e?this.removeDOMFilter():s||this.applyDOMFilter(c,e,d.map(e=>e.name)),window.dispatchEvent(new CustomEvent("wa-tab-filter-stats",{detail:{tabId:t,activeChats:l?.filtered||0,totalRequested:l?.total||0,missingChats:0}}))),this.isFiltering=!1},r=setTimeout(()=>{document.removeEventListener("chatListFilterResponse",a),this.isFiltering=!1},5e3);document.addEventListener("chatListFilterResponse",a),document.dispatchEvent(new CustomEvent("applyChatListFilter",{detail:{filterType:e,requestId:n}}))}hideGroupChatsFromDOM(){const e=document.querySelector('#pane-side [role="grid"]')||document.querySelector('#pane-side [data-testid="chat-list"]')||document.querySelector("#pane-side");if(!e)return;const t=e.querySelectorAll('[data-testid="cell-frame-container"], [role="listitem"], [role="row"]');t.forEach(e=>{this.isGroupChatByDOM(e)?(e.style.display="none",e.setAttribute("data-wa-custom-filtered","true")):(e.style.display="",e.removeAttribute("data-wa-custom-filtered"))})}applyDOMFilter(e,t,n){const a=new Set,r=new Map;e.forEach(e=>{const t=e.toLowerCase();a.add(t),r.set(t,e);const n=t.match(/^(\d+)@/);n&&(a.add(n[1]),r.set(n[1],e))});const o=new Set,i=new Map;n&&n.length>0&&n.forEach((t,n)=>{if(t){const a=t.toLowerCase().trim();o.add(a),e[n]&&i.set(a,e[n])}});const s=document.querySelector("#pane-side");if(!s)return;const l=this.ensureCompactContainer();if(!l)return;l.innerHTML="";const c=s.querySelectorAll('[role="listitem"], [role="row"], [data-testid="list-item-container"]');if(0===c.length){s.querySelectorAll('div > div > div[style*="transform"]')}const d=[],m=new Set,p=new Set;if(c.forEach((e,n)=>{if(e.textContent?.includes("Archived"))return;const s=this.extractChatIdFromRow(e);let l=!1;if(s){const e=s.toLowerCase(),t=e.match(/^(\d+)/),n=t?t[1]:"";if(a.has(e)){l=!0,m.add(e);const t=r.get(e);t&&m.add(t.toLowerCase())}else if(a.has(n)){l=!0,m.add(n);const e=r.get(n);e&&m.add(e.toLowerCase())}}else if("custom"===t&&o.size>0){const t=this.getChatNameFromElement(e);if(t){const e=t.toLowerCase().trim();if(o.has(e)){l=!0,p.add(e);const t=i.get(e);t&&m.add(t.toLowerCase())}else for(const t of o)if(e.includes(t)||t.includes(e)){l=!0,p.add(t);const e=i.get(t);e&&m.add(e.toLowerCase());break}}}else if("onetoone"===t){if(l=!this.isGroupChatByDOM(e),!l&&n<10){e.querySelector('[data-testid="cell-frame-title"]')}}l&&d.push(e)}),this.enableCompactMode(),d.forEach(e=>{const t=e.cloneNode(!0);t.style.transform="none",t.style.position="relative",t.style.top="auto",t.style.left="auto",t.style.height="auto",t.style.minHeight="72px",t.removeAttribute("data-wa-custom-filtered");const n=this.getChatNameFromElement(e)||"";t.style.cursor="pointer",t.onclick=e=>{e.preventDefault(),e.stopPropagation(),n&&document.dispatchEvent(new CustomEvent("openChatByName",{detail:{chatName:n}}))},l.appendChild(t)}),d.length,"custom"===t){const t=e.filter(e=>{const t=e.toLowerCase(),n=t.match(/^(\d+)@/),a=n?n[1]:"";return!m.has(t)&&!m.has(a)});t.length>0&&this.fetchAndRenderMissingChats(t,l)}0===d.length&&"custom"!==t&&(l.innerHTML='<div style="padding: 20px; text-align: center; color: #667781;">No matching chats found</div>')}fetchAndRenderMissingChats(e,t){const n=e=>{document.removeEventListener("getMultipleChatsResponse",n);const a=e,{chats:r,error:o}=a.detail||{};o||(r&&r.length>0&&r.forEach(e=>{const n=this.createChatElement(e);t.appendChild(n)}),0===t.children.length&&(t.innerHTML='<div style="padding: 20px; text-align: center; color: #667781;">No matching chats found</div>'))};document.addEventListener("getMultipleChatsResponse",n),document.dispatchEvent(new CustomEvent("getMultipleChats",{detail:{chatIds:e}})),setTimeout(()=>{document.removeEventListener("getMultipleChatsResponse",n)},5e3)}removeDOMFilter(){this.disableCompactMode();const e=document.getElementById("wa-compact-list");e&&(e.innerHTML="");document.querySelectorAll('[data-wa-custom-filtered="true"]').forEach(e=>{const t=e;t.style.display="",t.style.height="",t.style.minHeight="",t.style.maxHeight="",t.style.overflow="",t.style.visibility="",t.style.opacity="",t.style.position="",t.style.pointerEvents="",t.removeAttribute("data-wa-custom-filtered")})}extractChatIdFromRow(e){const t=e.getAttribute("data-id")||e.getAttribute("data-testid")||e.querySelector("[data-id]")?.getAttribute("data-id");if(t&&(t.includes("@c.us")||t.includes("@g.us")))return t;e.getAttribute("aria-label")||e.querySelector("[aria-label]")?.getAttribute("aria-label");const n=e.querySelector('a[href*="/send"]');if(n){const e=(n.getAttribute("href")||"").match(/phone=(\d+)/);if(e)return e[1]+"@c.us"}return null}isGroupChatByDOM(e){const t=e.textContent||"";if(e.querySelector('[data-icon="group"]')||e.querySelector('[data-icon="default-group"]')||e.querySelector('[data-icon="community"]')||e.querySelector('[data-icon="default-user-group"]')||e.querySelector('span[data-icon="group"]')||e.querySelector('span[data-icon="community"]'))return!0;const n=e.querySelector("img");if(n){const e=n.getAttribute("src")||"",t=n.getAttribute("alt")||"";if(e.includes("default-group")||e.includes("group")||e.includes("community")||t.toLowerCase().includes("group"))return!0}const a=e.querySelector('[data-testid="cell-frame-title"]')||e.querySelector("span[title]");if(a){const e=a.textContent||a.getAttribute("title")||"";if(/\[G\d*\]/.test(e)||/\[C\d*\]/.test(e))return!0}const r=e.querySelector('[data-testid="cell-frame-secondary"]')||e.querySelector('[data-testid="last-msg-status"]')?.closest("div");if(r){const e=r.textContent||"";if(e.includes("~ ")||e.startsWith("~"))return!0}if(t.includes("~ ")&&!t.includes("You:")){if(/\d{1,2}:\d{2}\s*(am|pm)?/i.test(t)){const e=t.split(/\d{1,2}:\d{2}\s*(am|pm)?/i);if(e.length>1){if(e[e.length-1].includes("~ "))return!0}}}if(e.querySelector('[data-testid="group-icon"]')||e.querySelector('[data-testid="default-group"]')||e.querySelector('[data-testid="community"]'))return!0;const o=e.closest("[data-id]")||e.querySelector("[data-id]");if(o){if((o.getAttribute("data-id")||"").includes("@g.us"))return!0}return!1}renderChatsInContainer(e,t){const n=this.ensureCompactContainer();if(n){if(e.sort((e,t)=>(t.timestamp||0)-(e.timestamp||0)),n.innerHTML="",e.length>0)for(const t of e){const e=this.createChatElement(t);n.appendChild(e)}else n.innerHTML='<div class="empty" style="padding: 20px; text-align: center; color: #667781;">No chats found</div>';window.dispatchEvent(new CustomEvent("wa-tab-filter-stats",{detail:{tabId:t,activeChats:e.length,totalRequested:e.length,missingChats:0}}))}}async displayIndividualChatsOnlyFallback(){const e=this.ensureCompactContainer();if(e){e.innerHTML='<div class="loading" style="padding: 20px; text-align: center; color: #667781;">Loading individual chats...</div>';try{const t=await this.getOnlyUserChats();if(t.sort((e,t)=>(t.timestamp||0)-(e.timestamp||0)),e.innerHTML="",t.length>0)for(const n of t){const t=this.createChatElement(n);e.appendChild(t)}else e.innerHTML='<div class="empty" style="padding: 20px; text-align: center; color: #667781;">No individual chats found</div>';window.dispatchEvent(new CustomEvent("wa-tab-filter-stats",{detail:{tabId:"one-to-one",activeChats:t.length,totalRequested:t.length,missingChats:0}}))}catch(t){e.innerHTML='<div class="error" style="padding: 20px; text-align: center; color: #d93025;">Error loading individual chats</div>'}}}getOnlyUserChats(){return new Promise((e,t)=>{const n=setTimeout(()=>{document.removeEventListener("onlyUserChatsResponse",a),t(new Error("Timeout waiting for individual chats"))},5e3),a=r=>{clearTimeout(n),document.removeEventListener("onlyUserChatsResponse",a);const o=r,{success:i,chats:s,error:l}=o.detail;i?e(s||[]):t(new Error(l||"Failed to get individual chats"))};document.addEventListener("onlyUserChatsResponse",a),document.dispatchEvent(new CustomEvent("getOnlyUserChats"))})}isGroupChatSync(e){if(e.querySelector('[data-icon="default-group"]'))return!0;if(e.querySelector('[data-icon="community"]'))return!0;if(e.querySelector('[data-icon="newsletter"]'))return!0;const t=e.querySelector('span[data-testid="cell-frame-secondary"]');if(t){if(t.querySelectorAll("img").length>1)return!0}if(e.querySelector('[data-testid*="group"], [data-testid*="community"]'))return!0;e.querySelector('[data-icon="default-user"]');return!1}hideChat(e){if(!e.hasAttribute("data-wa-custom-filtered")){e.setAttribute("data-wa-custom-filtered","true");const t=e.parentElement;e.nextSibling;if(t){e.setAttribute("data-wa-parent-id",t.id||""),e.setAttribute("data-wa-parent-class",t.className||"");const n=Array.from(t.children).indexOf(e);if(e.setAttribute("data-wa-position",n.toString()),t.removeChild(e),!document.getElementById("wa-filter-storage")){const e=document.createElement("div");e.id="wa-filter-storage",e.style.display="none",document.body.appendChild(e)}const a=document.getElementById("wa-filter-storage");a&&a.appendChild(e)}}}showChat(e){if(e.hasAttribute("data-wa-custom-filtered")){const t=document.getElementById("wa-filter-storage");if(t&&t.contains(e)){const n=document.querySelector('[data-testid="chat-list"]')||document.querySelector("#pane-side");if(n){const a=n.querySelector('[role="grid"], [role="list"]')||n.querySelector("div > div")||n;a&&(t.removeChild(e),a.appendChild(e))}}e.removeAttribute("data-wa-custom-filtered"),e.removeAttribute("data-wa-parent-id"),e.removeAttribute("data-wa-parent-class"),e.removeAttribute("data-wa-position")}}getIndividualChatsFromPage(){return new Promise((e,t)=>{const n=setTimeout(()=>{document.removeEventListener("individualChatsResponse",a),t(new Error("Timeout waiting for individual chats response"))},5e3),a=r=>{clearTimeout(n),document.removeEventListener("individualChatsResponse",a);const o=r,{success:i,chatIds:s,chatNames:l,error:c}=o.detail;i?e({chatIds:s||[],chatNames:l||[]}):t(new Error(c||"Failed to get individual chats"))};document.addEventListener("individualChatsResponse",a),document.dispatchEvent(new CustomEvent("getIndividualChats"))})}getActiveChatIds(){return new Promise((e,t)=>{const n=setTimeout(()=>{document.removeEventListener("activeChatIdsResponse",a),t(new Error("Timeout waiting for active chat IDs"))},5e3),a=r=>{clearTimeout(n),document.removeEventListener("activeChatIdsResponse",a);const o=r,{success:i,chatIds:s,error:l}=o.detail;i?e(s||[]):t(new Error(l||"Failed to get active chat IDs"))};document.addEventListener("activeChatIdsResponse",a),document.dispatchEvent(new CustomEvent("getActiveChatIds"))})}async filterBySelectedChats(e){if("all"===e.id||e.isPermanent)return;const t=this.getChatItems();e.chats&&Array.isArray(e.chats)||(e.chats=[]),e.chats=e.chats.map(e=>"string"==typeof e?{id:e,name:e.replace("@c.us","").replace("@g.us",""),type:e.includes("@g.us")?"group":"individual"}:(e.name||(e.name=e.id?e.id.replace("@c.us","").replace("@g.us",""):"Unknown"),e.type||(e.type=e.id&&e.id.includes("@g.us")?"group":"individual"),e));e.chats.map(e=>(e.name||"").toLowerCase());const n=e.chats.filter(e=>"individual"===e.type),a=e.chats.filter(e=>"group"===e.type),r=e.chats.filter(e=>"label"===e.type);if(0===r.length&&(n.length>0||a.length>0))return void await this.displayOnlySelectedChats(e);n.map(e=>e.id&&e.id.includes("@c.us")?e.id.replace("@c.us",""):null).filter(e=>null!==e);const o=a.map(e=>e.id);r.map(e=>e.id);e.chats.forEach((e,t)=>{});const i=e.chats.filter(e=>"individual"===e.type).map(e=>e.id);if(i.length>0)try{const t=await this.getGroupsByMembers(i);t&&t.length>0&&t.forEach(t=>{e.chats.some(e=>e.id===t.id)||e.chats.push(t)})}catch(e){}let s=[];try{s=await this.getActiveChatIds()||[]}catch(e){}let l=0;const c=e.chats.length,d=i.length;let m=0;for(const i of Array.from(t)){const t=this.getChatNameFromElement(i),c=this.getChatPhoneFromElement(i),d=await this.getChatIdFromElement(i);if(m<3){d&&e.chats.some(e=>e.id===d),t&&e.chats.some(e=>e.name.toLowerCase()===t.toLowerCase());m++}let p=!1;const u=null!==d&&d.includes("@g.us");if(a.length>0&&u&&(d&&o.includes(d)&&(p=!0),!p&&t)){const e=t.toLowerCase();for(const t of a){const n=t.name.toLowerCase();if(e===n||e.includes(n)||n.includes(e)){p=!0;break}}}if(!p&&n.length>0&&!u){if(d)for(const e of n)if(e.id===d){p=!0;break}if(!p&&c){const e=c.replace(/[\s\+\-\(\)]/g,"");for(const t of n)if(t.id&&t.id.includes("@c.us")){const n=t.id.replace("@c.us","").replace(/[\s\+\-\(\)]/g,"");if(e===n||e.includes(n)||n.includes(e)){p=!0;break}}}if(!p&&t){const e=t.toLowerCase();for(const t of n){const n=t.name.toLowerCase();if(e===n||e.includes(n)||n.includes(e)){p=!0;break}}}}if(!p&&!d&&e.chats.length>0)try{const n=window.WPP;if(t&&n?.chat){const a=n.chat.getAll().find(e=>e.name===t||e.formattedTitle===t||e.contact?.pushname===t);if(a&&a.id&&a.id._serialized){const t=a.id._serialized;for(const n of e.chats)if(n.id===t){p=!0;break}if(!p&&a.isGroup)try{const t=a.groupMetadata?.participants||[];for(const n of e.chats){if(t.some(e=>e.id&&e.id._serialized===n.id)){p=!0;break}}}catch(e){}}}}catch(e){}if(!p&&e.chats.length>0){if(d)for(const t of e.chats)if(t.id===d){p=!0;break}if(!p&&t){const n=t.replace(/[\s\+\-\(\)]/g,"");for(const t of e.chats)if(t.id&&t.id.includes("@c.us")){const e=t.id.replace("@c.us","").replace(/[\s\+\-\(\)]/g,"");if(n.includes(e)||e.includes(n)){p=!0;break}}}if(!p&&t){const n=t.toLowerCase();for(const t of e.chats){if(n===t.name.toLowerCase()){p=!0;break}}}}const g=r.length>0;p&&g&&s.length>0&&d&&(s.includes(d)||(p=!1));const h=i;p?(l++,this.showChatCompact(h)):this.hideChat(h)}const p=c-l;if(p>0&&0===r.length){const n=new Set;for(const e of Array.from(t)){const t=await this.getChatIdFromElement(e);t&&n.add(t)}const a=e.chats.filter(e=>!n.has(e.id));a.length>0&&a.forEach((e,t)=>{})}window.dispatchEvent(new CustomEvent("wa-tab-filter-stats",{detail:{tabId:e.id,activeChats:l,totalRequested:c,originalIndividuals:d,missingChats:p}}))}refreshFilter(){this.applyFilter()}getActiveTabId(){return this.activeTabId}setActiveTabId(e){this.activeTabId=e}showChatCompact(e){const t=this.ensureCompactContainer();if(!t)return;if(e.hasAttribute("data-wa-custom-filtered")){const t=document.getElementById("wa-filter-storage");t&&t.contains(e)&&t.removeChild(e),e.removeAttribute("data-wa-custom-filtered"),e.removeAttribute("data-wa-parent-id"),e.removeAttribute("data-wa-parent-class"),e.removeAttribute("data-wa-position")}else{const t=e.parentElement;t&&"wa-compact-list"!==t.id&&t.removeChild(e)}e.style.removeProperty("transform"),e.style.removeProperty("position");e.querySelectorAll("img").forEach(e=>{e.dataset.src&&!e.src&&(e.src=e.dataset.src),e.complete||(e.loading="eager");const t=e.getAttribute("src");t&&t!==e.src&&(e.src=t)}),t.appendChild(e),e.offsetHeight}}function o(){const e=()=>{document.querySelector('[data-testid="chat-list"]')||document.querySelector("#pane-side")?r.getInstance():setTimeout(e,1e3)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}},9066(e,t,n){"use strict";n.d(t,{$q:()=>i,CQ:()=>s,CS:()=>r,Gv:()=>a,Jg:()=>o,vj:()=>l});const a=["#7C3AED","#3b82f6","#22c55e","#a855f7","#ec4899","#0ea5e9","#06b6d4","#ef4444","#7C3AED","#14b8a6"],r=["📁","🛒","📞","💬","🎯","📊","🔧","⚡","🎨","📱","🚀","💡","🔔","📝","🏷️","📌","🎪","💼","🌟","✨","🤖","💰","🎁","📦","🔒","🌐","📧","🎓","🏠","❤️"],o={anyMessage:!1,keywords:[],firstMessageDay:!1,firstMessageEver:!1},i={allowGroups:!1,scheduleEnabled:!1,dontRespondIfOpen:!1,customSignatureEnabled:!1,disableSignature:!1,simulateTyping:!1,dontRespondIfInCRM:!1,dontRespondToCRMs:[],respondOnlyToCRMs:[],dontRespondIfTagged:!1,dontRespondToTags:[],respondOnlyToTags:[],dontRespondIfInCustomTab:!1,dontRespondToCustomTabs:[],respondOnlyToCustomTabs:[],pauseEnabled:!1,pauseClientKeywords:[],pauseServerKeywords:[],pauseDurationMinutes:30},s={awayMessage:"",awayWaitingTime:5,awayWaitingUnit:"minutes",blockInterval:2,blockIntervalUnit:"seconds"};function l(e){const t=crypto.randomUUID(),n=Date.now();return{id:t,name:e,isActive:!1,createdAt:n,updatedAt:n,triggers:{...o},reactivationInterval:0,reactivationUnit:"minutes",rules:{...i},nodes:[{id:"start",type:"start",position:{x:400,y:200},data:{label:"Start"}}],edges:[]}}},3861(e,t,n){"use strict";n.d(t,{Bl:()=>i,CS:()=>r,Gv:()=>a,Mb:()=>g,Ok:()=>l,dv:()=>u,fO:()=>s,gh:()=>o,m2:()=>m,tp:()=>d,yV:()=>p});const a=["#7C3AED","#3b82f6","#10b981","#7C3AED","#ec4899","#0ea5e9","#06b6d4","#7C3AED","#ef4444","#84cc16"],r=["📢","💬","💰","📁","⚡","🎯","📊","🔔","📝","💼","🛒","🎉","📌","⭐","🚀","💡","🔧","📞","🎨","🏷️","📋","🗂️","💎","🔥"],o={ALL:"cat_all",UNCATEGORIZED:"cat_uncategorized",QUICK_REPLY:"cat_quick_reply"},i=[{id:o.ALL,name:"All Templates",color:"#64748b",icon:"📋",order:0,createdAt:0},{id:o.QUICK_REPLY,name:"Quick Reply",color:"#7C3AED",icon:"⚡",order:1,createdAt:0},{id:o.UNCATEGORIZED,name:"Uncategorized",color:"#94a3b8",icon:"📁",order:999,createdAt:0}],s=()=>`cat_${Date.now()}_${Math.random().toString(36).substring(2,7)}`,l=()=>Math.random().toString(36).substring(2,11),c={id:l(),message:"",attachmentType:"none",attachments:[],pollData:null,listData:null,selectedContact:[],selectedProducts:[],buttonsData:null,delay:{min:3,max:5}},d=()=>({...c,id:l()}),m={templeteName:"",message:"",templeteType:"personalized",messageType:"individual",dynamicValueCount:1,dynamicValueData:["@variable1"],sendAttachment:!1,sendAttachmentType:"none",attachemnt:[],selectedContact:[],buttonsData:null,pollData:null,listData:null,selectedProducts:[],quickReplyData:null,messages:[d()],categoryId:o.UNCATEGORIZED,isActive:!0},p={isQuickReply:!0,settings:{pinToShortcut:!1,editBeforeSend:!1,sendConfirmation:!0,shuffleMessages:!1,mentionAll:!1},messages:[{id:Math.random().toString(36).substring(2,11),message:"",delay:{min:3,max:5},attachmentType:"none",attachments:[]}],postActions:{groupActionsEnabled:!1,addToGroups:[],removeFromGroups:[],tabActionsEnabled:!1,addToTabs:[],removeFromTabs:[],labelsActionsEnabled:!1,addLabels:[],removeLabels:[],kanbanActionsEnabled:!1,addToKanban:null,removeFromKanban:null}},u=["@firstname","@lastname","@contactname","@whatsappname"],g={MAX_BUTTONS:3,MAX_POLL_OPTIONS:12,MIN_POLL_OPTIONS:2,MAX_LIST_SECTIONS:10,MAX_LIST_ROWS_PER_SECTION:10,MAX_LIST_TOTAL_ROWS:10,MAX_DYNAMIC_VARIABLES:10,MAX_TEMPLATE_NAME_LENGTH:100,MAX_MESSAGE_LENGTH:4096}},5773(e,t,n){"use strict";n.d(t,{FluxoStorage:()=>p});var a=n(6815),r=n.n(a),o=n(9066);const i="wa_chatbot_flows",s="fluxo_global_settings",l="wa_fluxo_conversation_states",c="wa_fluxo_first_message_tracker",d="wa_chatbot_flow_categories",m="wa_fluxo_onboarding_completed";class p{static getFlows(){try{const e=localStorage.getItem(i);return e?JSON.parse(e):[]}catch(e){return[]}}static getFlow(e){return this.getFlows().find(t=>t.id===e)||null}static getActiveFlows(){return this.getFlows().filter(e=>e.isActive)}static async saveFlow(e){try{const t=this.getFlows(),n=t.findIndex(t=>t.id===e.id);e.updatedAt=Date.now(),n>=0?t[n]=e:t.push(e);e.nodes.filter(e=>e.data?.mediaBase64).length;const a=JSON.stringify(t);localStorage.setItem(i,a),await this.syncToBrowserStorage()}catch(e){throw"QuotaExceededError"===e.name||e.message?.includes("quota"),e}}static async deleteFlow(e){try{const t=this.getFlows().filter(t=>t.id!==e);localStorage.setItem(i,JSON.stringify(t)),await this.syncToBrowserStorage()}catch(e){throw e}}static duplicateFlow(e){const t=this.getFlow(e);if(!t)return null;const n={...JSON.parse(JSON.stringify(t)),id:crypto.randomUUID(),name:`${t.name} (Copy)`,isActive:!1,createdAt:Date.now(),updatedAt:Date.now()};return this.saveFlow(n),n}static toggleFlowActive(e,t){const n=this.getFlow(e);n&&(n.isActive=t,this.saveFlow(n))}static async createFlow(e){const t=(0,o.vj)(e),n=this.getFlowsByCategory(null);return t.sortOrder=n.length,await this.saveFlow(t),t}static getCategories(){try{const e=localStorage.getItem(d);return e?JSON.parse(e):[]}catch(e){return[]}}static getCategory(e){return this.getCategories().find(t=>t.id===e)||null}static async saveCategory(e){try{const t=this.getCategories(),n=t.findIndex(t=>t.id===e.id);n>=0?t[n]=e:(void 0===e.sortOrder&&(e.sortOrder=t.length),t.push(e)),localStorage.setItem(d,JSON.stringify(t)),await this.syncToBrowserStorage()}catch(e){throw e}}static async deleteCategory(e){try{const t=this.getCategories().filter(t=>t.id!==e);localStorage.setItem(d,JSON.stringify(t));const n=this.getFlows();let a=!1;n.forEach(t=>{t.categoryId===e&&(t.categoryId=void 0,a=!0)}),a&&localStorage.setItem(i,JSON.stringify(n)),await this.syncToBrowserStorage()}catch(e){throw e}}static async reorderCategories(e){try{const t=this.getCategories();e.forEach((e,n)=>{const a=t.find(t=>t.id===e);a&&(a.sortOrder=n)}),t.sort((e,t)=>e.sortOrder-t.sortOrder),localStorage.setItem(d,JSON.stringify(t)),await this.syncToBrowserStorage()}catch(e){throw e}}static async moveFlowToCategory(e,t){try{const n=this.getFlow(e);if(n){n.categoryId=t||void 0;const e=this.getFlowsByCategory(t);n.sortOrder=e.length,await this.saveFlow(n)}}catch(e){throw e}}static async reorderFlow(e,t,n=!0){try{const a=this.getFlows(),r=a.find(t=>t.id===e),o=a.find(e=>e.id===t);if(!r||!o)return;const s=e=>e||null,l=s(r.categoryId),c=s(o.categoryId);if(l!==c)return;const d=a.filter(e=>s(e.categoryId)===l).sort((e,t)=>(e.sortOrder??999)-(t.sortOrder??999)),m=d.findIndex(t=>t.id===e);m>-1&&d.splice(m,1);let p=d.findIndex(e=>e.id===t);-1===p?d.push(r):(n||p++,d.splice(p,0,r)),d.forEach((e,t)=>{const n=a.find(t=>t.id===e.id);n&&(n.sortOrder=t)}),localStorage.setItem(i,JSON.stringify(a)),await this.syncToBrowserStorage()}catch(e){throw e}}static async reorderCategoryBefore(e,t,n=!0){try{const a=this.getCategories(),r=a.find(t=>t.id===e),o=a.find(e=>e.id===t);if(!r||!o)return;a.sort((e,t)=>e.sortOrder-t.sortOrder);const i=a.findIndex(t=>t.id===e);i>-1&&a.splice(i,1);let s=a.findIndex(e=>e.id===t);-1===s?a.push(r):(n||s++,a.splice(s,0,r)),a.forEach((e,t)=>{e.sortOrder=t}),localStorage.setItem(d,JSON.stringify(a)),await this.syncToBrowserStorage()}catch(e){throw e}}static getFlowsByCategory(e){const t=this.getFlows();return(null===e?t.filter(e=>!e.categoryId):t.filter(t=>t.categoryId===e)).sort((e,t)=>(e.sortOrder??0)-(t.sortOrder??0))}static createCategory(e,t,n){const a=this.getCategories(),r={id:crypto.randomUUID(),name:e,icon:t||o.CS[a.length%o.CS.length],color:n||o.Gv[a.length%o.Gv.length],sortOrder:a.length,isExpanded:!0,createdAt:Date.now()};return this.saveCategory(r),r}static async toggleCategoryExpanded(e,t){const n=this.getCategory(e);n&&(n.isExpanded=void 0!==t?t:!n.isExpanded,await this.saveCategory(n))}static isOnboardingCompleted(){try{return"true"===localStorage.getItem(m)}catch{return!1}}static async setOnboardingCompleted(e){try{localStorage.setItem(m,e?"true":"false"),await this.syncToBrowserStorage()}catch(e){}}static getGlobalSettings(){try{const e=localStorage.getItem(s);return e?{...o.CQ,...JSON.parse(e)}:{...o.CQ}}catch(e){return{...o.CQ}}}static async saveGlobalSettings(e){try{localStorage.setItem(s,JSON.stringify(e)),await this.syncToBrowserStorage()}catch(e){throw e}}static getConversationStates(){try{const e=localStorage.getItem(l);return e?JSON.parse(e):[]}catch(e){return[]}}static getConversationState(e){return this.getConversationStates().find(t=>t.chatId===e)||null}static updateConversationState(e){try{const t=this.getConversationStates(),n=t.findIndex(t=>t.chatId===e.chatId);n>=0?t[n]=e:t.push(e),localStorage.setItem(l,JSON.stringify(t))}catch(e){}}static clearConversationState(e){try{const t=this.getConversationStates().filter(t=>t.chatId!==e);localStorage.setItem(l,JSON.stringify(t))}catch(e){}}static cleanupExpiredStates(){try{const e=Date.now(),t=864e5,n=this.getConversationStates().filter(n=>e-n.lastActivityAt<t);localStorage.setItem(l,JSON.stringify(n))}catch(e){}}static getFirstMessageTracker(){try{const e=localStorage.getItem(c);return e?JSON.parse(e):{}}catch(e){return{}}}static isFirstMessageEver(e){const t=this.getFirstMessageTracker();return!t[e]?.firstEver}static isFirstMessageToday(e){const t=this.getFirstMessageTracker(),n=(new Date).toISOString().split("T")[0];return t[e]?.lastDay!==n}static markMessageReceived(e){try{const t=this.getFirstMessageTracker(),n=(new Date).toISOString().split("T")[0];t[e]?t[e].lastDay=n:t[e]={firstEver:Date.now(),lastDay:n},localStorage.setItem(c,JSON.stringify(t))}catch(e){}}static canReactivateFlow(e,t,n){if(0===n)return!0;const a=this.getConversationStates().find(n=>n.chatId===t&&n.flowId===e);if(!a)return!0;return Date.now()-a.lastActivityAt>=60*n*1e3}static async syncToBrowserStorage(){try{const e=this.getFlows(),t=this.getGlobalSettings(),n=this.getCategories(),a=this.isOnboardingCompleted();(JSON.stringify(e).length/1024/1024).toFixed(2);e.flatMap(e=>e.nodes?.filter(e=>e.data?.mediaBase64)||[]).length,await r().storage.local.set({[i]:e,[s]:t,[d]:n,[m]:a})}catch(e){e.message?.includes("quota")||e.message?.includes("QUOTA")}}static async restoreFromBrowserStorage(){try{const e=await r().storage.local.get([i,s,d,m]);if(e[i]){const t=e[i],n=JSON.stringify(t);t.flatMap(e=>e.nodes?.filter(e=>e.data?.mediaBase64)||[]).length,localStorage.setItem(i,n)}e[s]&&localStorage.setItem(s,JSON.stringify(e[s])),e[d]&&localStorage.setItem(d,JSON.stringify(e[d])),void 0!==e[m]&&localStorage.setItem(m,e[m]?"true":"false")}catch(e){}}static replaceVariables(e,t,n){let a=e;Object.entries(t).forEach(([e,t])=>{a=a.replace(new RegExp(`\\{${e}\\}`,"g"),t)}),n?.name&&(a=a.replace(/\{name\}/g,n.name)),n?.phone&&(a=a.replace(/\{phone\}/g,n.phone));const r=new Date;return a=a.replace(/\{date\}/g,r.toLocaleDateString()),a=a.replace(/\{time\}/g,r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})),a}}},600(e,t,n){"use strict";n.d(t,{Fc:()=>s,LE:()=>l,UK:()=>m,t:()=>d,v2:()=>p});var a=n(6815),r=n.n(a);const o={en:{"common.loading":"Loading...","common.close":"Close","common.cancel":"Cancel","common.save":"Save","common.copy":"Copy","common.copied":"Copied!","common.choose":"Choose","common.add":"Add","common.edit":"Edit","common.delete":"Delete","common.back":"Back","quickReply.title":"Quick Reply","quickReply.addButton":"+ Add","quickReply.allCategories":"All Categories","quickReply.postActions":"Post Actions","quickReply.groupActions":"Group Actions","quickReply.customTabActions":"Custom Tab Actions","quickReply.labelsActions":"Labels Actions","quickReply.kanbanBoardActions":"Kanban Board Actions","quickReply.addToGroups":"Add to Groups","quickReply.removeFromGroups":"Remove from Groups","quickReply.addToTabs":"Add to Tabs","quickReply.removeFromTabs":"Remove from Tabs","quickReply.addLabels":"Add Labels","quickReply.removeLabels":"Remove Labels","quickReply.addToStage":"Add to Stage","quickReply.removeFromStage":"Remove from Stage","quickReply.selectGroups":"Select groups...","quickReply.selectTabs":"Select tabs...","quickReply.selectLabels":"Select labels...","quickReply.selectCrmStage":"Select CRM & Stage...","quickReply.noGroupsAvailable":"No groups available","quickReply.noTabsAvailable":"No tabs available","quickReply.noLabelsAvailable":"No labels available","quickReply.noKanbanAvailable":"No Kanban CRMs available","quickReply.editBeforeSending":"Edit before sending","quickReply.editBeforeSendingDesc":"Allow editing message before sending","actionSidebar.title":"Quick Actions","actionSidebar.quickReply":"Quick Reply","actionSidebar.flow":"Flow","actionSidebar.search":"Search...","actionSidebar.filter":"Filter","actionSidebar.all":"All","actionSidebar.byType":"By Type","actionSidebar.noCategory":"No Category","actionSidebar.byCategory":"By Category","actionSidebar.mostUsed":"Most Used","actionSidebar.send":"Send","actionSidebar.trigger":"Trigger","actionSidebar.noItemsFound":"No items found","actionSidebar.selectChatFirst":"Select a chat first","actionSidebar.uncategorized":"Uncategorized","actionSidebar.editAndSend":"Edit & Send","actionSidebar.clickToCancel":"Click to cancel","actionSidebar.cancel":"Cancel","actionSidebar.sending":"Sending...","header.activateLicense":"Activate License",broadcastTitle:"Bulk Message",kanbanTitle:"Open Kanban CRM","profile.title":"Profile","profile.deviceName":"Device Name","profile.expires":"Expires","profile.manageLicenseKey":"Manage License Key","profile.settings":"Settings","profile.watchTutorial":"Watch tutorial","profile.language":"Language","profile.privacyPolicy":"Privacy policy","profile.contactUs":"Contact Us","profile.website":"Website","profile.premium":"Premium","profile.notActivated":"Not Activated","profile.activateToContinue":"Activate License","settings.menuFeatures":"Menu Features","settings.menuFeaturesDesc":"Enable or disable features below as needed","settings.interfaceOptions":"Interface Options","settings.featureDockLabel":"Left-Side Feature Dock","settings.featureDockDesc":"Show a left-edge shortcut bar whenever a popup is open","feature.tabs":"Tab Management","feature.templates":"Templates","feature.quickReply":"Quick Reply","feature.kanban":"Kanban CRM","feature.chatbotFlow":"Chatbot Flow","feature.followUp":"Follow Up","feature.broadcast":"Mass Sending","feature.schedule":"Scheduled Messages","feature.calendar":"Scheduling Center","feature.status":"Status","feature.validator":"Validator","feature.webhook":"Webhook","feature.api":"API","feature.aiBot":"AI Bot","feature.open":"Open","license.activateTitle":"Activate Your License","license.licenseKey":"License Key","license.phoneNumber":"Phone Number","license.phoneDetected":"Detected Phone Number","license.planName":"Plan Name","license.endDate":"End Date","license.expiresIn":"Expires In","license.days":"days","license.daysLeft":"d left","license.status":"Status","license.deactivateLicense":"Deactivate License","license.deactivateConfirm":"Are you sure you want to deactivate your license?","license.activateLicenseBtn":"Activate License","license.validating":"Validating...","license.pasteLicenseHere":"Cole sua chave de licença aqui...","license.completeLicenseKey":"Cole a chave de licença completa que você recebeu por e-mail","trial.starting":"Iniciando seu teste gratuito de 7 dias...","trial.activated":"Teste gratuito de 7 dias ativado!","trial.daysRemaining":"{0} dias restantes no teste","trial.expired":"O teste expirou. Por favor, adquira uma licença.","trial.alreadyUsed":"O teste já foi utilizado para este número. Insira uma chave de licença para continuar.","license.waitForWhatsApp":"Por favor, aguarde o WhatsApp carregar completamente","license.securityFooter":"Protegido por validação criptográfica WebAssembly","planDetails.title":"Detalhes do plano","planDetails.licenceKey":"Chave de licença","planDetails.planName":"Nome do plano","planDetails.endDate":"Data de término","planDetails.removeKey":"Remover chave","planDetails.changeKey":"Alterar chave","features.enabledFeatures":"Recursos habilitados","languages.en":"English (Inglês)","languages.zh":"中文 (Chinese)","languages.hi":"हिंदी (Hindi)","languages.es":"Español (Spanish)","languages.fr":"Français (French)","languages.ar":"العربية (Arabic)","languages.bn":"বাংলা (Bengali)","languages.pt":"Português (Portuguese)","languages.ru":"Русский (Russian)","languages.ur":"اردو (Urdu)","licenseInfo.title":"Informações da licença","licenseInfo.phoneNumber":"Número de telefone","licenseInfo.expiresIn":"Expira em","licenseInfo.status":"Status","errors.invalidFormat":"Formato de chave de licença inválido ou falha na validação","errors.serverError":"Ocorreu um erro no servidor","errors.networkError":"Erro de rede. Por favor, verifique sua conexão","errors.extensionUpdated":"Extension was updated. Please refresh the page and try again","tabs.tabs":"Abas","tabs.manageTabs":"Gerenciar Abas","tabs.addTab":"Adicionar Aba","tabs.editTab":"Editar Aba","tabs.deleteTab":"Excluir Aba","tabs.tabTitle":"Título da Aba","tabs.tabDetails":"Detalhes da Aba","tabs.enterTabTitle":"Digite o Título da Aba","tabs.enterTabDetails":"Digite os Detalhes da Aba","tabs.chooseFrom":"Escolher de","tabs.chat":"Chat","tabs.groups":"Grupos","tabs.label":"Etiqueta","tabs.searchHere":"Pesquisar aqui","tabs.selectAll":"Selecionar Tudo","tabs.clearAll":"Limpar Tudo","tabs.selected":"Selecionado","tabs.allChats":"Todos os chats","tabs.chats":"chats","tabs.noFilterApplied":"Nenhum filtro aplicado","tabs.view":"Ver","tabs.edit":"Editar","tabs.delete":"Excluir","tabs.hideFromTabBar":"Ocultar da Barra de Abas","tabs.showInTabBar":"Mostrar na Barra de Abas","tabs.sort":"Ordenar","tabs.title":"Título","tabs.details":"Detalhes","tabs.action":"Ação","tabs.selectLabel":"Selecionar Etiqueta","tabs.chooseALabel":"-- Escolha uma Etiqueta --","tabs.selectedLabel":"Etiqueta Selecionada","tabs.change":"Alterar","tabs.pleaseSelectLabel":"Por favor, selecione uma etiqueta do menu suspenso acima","tabs.areYouSureDeleteTab":"Tem certeza de que deseja excluir esta aba?","tabs.tabDeletedSuccessfully":"Aba excluída com sucesso","tabs.cancel":"Cancelar","tabs.save":"Salvar","tabs.all":"Todos","tabs.oneToOne":"1:1","tabs.individualChats":"Apenas conversas individuais","tabs.groupChats":"Apenas conversas em grupo","tabs.unread":"Não lidos","tabs.unreadChats":"Apenas conversas não lidas","tabs.unsaved":"Não salvos","tabs.unsavedContacts":"Apenas contatos não salvos","templates.title":"Modelos de Mensagens","templates.manageTemplates":"Gerenciar Modelos","templates.newTemplate":"Novo Modelo","templates.editTemplate":"Editar Modelo","templates.sendTemplate":"Enviar Modelo","templates.deleteTemplate":"Excluir Modelo","templates.duplicateTemplate":"Duplicar Modelo","templates.activateTemplate":"Ativar","templates.deactivateTemplate":"Desativar","templates.total":"Total","templates.active":"Ativos","templates.inactive":"Inativos","templates.filterAll":"Todos","templates.filterActive":"Apenas Ativos","templates.filterInactive":"Apenas Inativos","templates.filterAllTypes":"Todos os Tipos","templates.templates":"modelos","templates.searchPlaceholder":"Pesquisar modelos...","templates.noTemplates":"Nenhum modelo encontrado","templates.createFirst":"Crie seu primeiro modelo","templates.edit":"Editar","templates.copy":"Copiar","templates.msgs":"mensagens","templates.noMessageContent":"Sem conteúdo de mensagem","templates.form.templateName":"Nome do Modelo","templates.form.templateNamePlaceholder":"Digite o nome do modelo","templates.form.templateFor":"Modelo Para","templates.form.message":"Mensagem","templates.form.messagePlaceholder":"Digite sua mensagem aqui...","templates.form.insertVariable":"Clique para inserir variável:","templates.form.personalizeValue":"Valor de Personalização","templates.form.personalizeValueHint":"Transmita para seus indivíduos selecionados com valores personalizados como @variable1, @variable2, etc.","templates.form.templatesType":"Tipo de Modelos","templates.form.templateType":"Tipo de Modelo","templates.form.templateStatus":"Status do Modelo","templates.form.statusOn":"Ligado","templates.form.statusOff":"Desligado","templates.form.statusHint":"When the template status is 'on,' it is available to use. Conversely, when the template status is 'off,' it is in a saved state.","templates.form.on":"Ativado","templates.form.off":"Desativado","templates.form.save":"Salvar","templates.form.cancel":"Cancelar","templates.form.selectProducts":"Selecionar Produtos","templates.form.selectContacts":"Selecionar Contatos","templates.form.addProduct":"Adicionar Produto","templates.form.addContact":"Adicionar Contato","templates.form.buttons":"Botões","templates.form.addButton":"Adicionar Botão","templates.form.buttonsHint":"Máximo de 3 botões permitidos","templates.form.selectFromContacts":"Selecionar dos Contatos","templates.form.addManually":"Adicionar Manualmente","templates.form.productHint":"Produtos do seu catálogo do WhatsApp Business","templates.form.attachImages":"Anexar Imagens/Vídeos","templates.form.attachAudio":"Anexar Áudio","templates.form.attachDocuments":"Anexar Documentos","templates.form.chooseFile":"Escolher Arquivo","templates.form.maxFileSize":"Tamanho máximo do arquivo: 16MB (limite do WhatsApp)","templates.form.uploading":"Enviando...","templates.errors.uploadFailed":"Falha ao enviar o arquivo. Tente novamente.","templates.errors.fileTooLarge":"O arquivo é muito grande. Tamanho máximo: 16MB (limite do WhatsApp).","templates.form.listButtonText":"Texto do Botão","templates.form.listButtonTextPlaceholder":"Digite o texto do botão","templates.form.listDescription":"Descrição","templates.form.listDescriptionPlaceholder":"Digite a descrição","templates.form.listSections":"Seções","templates.form.pollQuestion":"Pergunta da Enquete","templates.form.pollQuestionPlaceholder":"Digite sua pergunta da enquete","templates.form.allowMultipleAnswers":"Permitir Múltiplas Respostas","templates.form.allowMultipleAnswersHint":"Os usuários podem selecionar várias opções","templates.form.pollOptions":"Opções da Enquete","templates.form.addOption":"+ Adicionar Opção","templates.form.pollOptionsHint":"Mínimo 2, máximo 12 opções","templates.messageType.individual":"Um a Um","templates.messageType.tab":"Aba","templates.messageType.group":"Grupo","templates.messageType.label":"Etiqueta","templates.messageType.kanban":"Kanban","templates.messageType.quickReply":"⚡ Quick Reply","templates.attachmentType.none":"Apenas Mensagem","templates.attachmentType.imageVideo":"Mensagem + Imagens/Vídeos","templates.attachmentType.document":"Mensagem + Documentos","templates.attachmentType.audio":"Mensagem + Áudio","templates.attachmentType.contact":"Mensagem + Contatos","templates.attachmentType.poll":"Mensagem + Enquete","templates.attachmentType.list":"Mensagem + Lista","templates.attachmentType.product":"Mensagem + Produtos","templates.attachmentType.buttons":"Mensagem + Botões","templates.messages":"Mensagens","templates.addMessage":"Adicionar Mensagem","templates.deleteMessage":"Excluir Mensagem","templates.messageNumber":"Mensagem {number}","templates.delayBetweenMessages":"Atraso antes da próxima mensagem","templates.delayMin":"Mín (seg)","templates.delayMax":"Máx (seg)","templates.collapseMessage":"Recolher","templates.expandMessage":"Expandir","crm.button":"CRM","crm.openCRM":"Abrir CRM","crm.profile":"Perfil","crm.tabs":"Abas","crm.notes":"Notas","crm.reminder":"Lembrete","crm.appointment":"Compromisso","crm.income":"Receita","crm.expense":"Despesa","crm.scheduleTab":"Agendar","crm.deletedMessagesTab":"Mensagens Apagadas","crm.antiRevokeEnabled":"Anti-Revoke está LIGADO","crm.antiRevokeDisabled":"Anti-Revoke está DESLIGADO","crm.antiRevokeDescription":"Salva cópias locais das mensagens recebidas para que você possa vê-las mesmo se o remetente apagá-las.","crm.antiRevokeNotEnabledHint":"Ative o Anti-Revoke acima para começar a salvar as mensagens recebidas.","crm.noDeletedMessages":"No deleted messages recovered yet. We’re watching — if anyone deletes a message, we’ll keep a copy here.","crm.onlyThisContact":"Apenas este contato","crm.allContacts":"Todos os contatos","crm.clearHistory":"Limpar histórico","crm.exportCSV":"Exportar CSV","crm.revokedAt":"Apagada em","crm.copyMessage":"Copiar","crm.lionRecovered":"{brand} recuperou","crm.clickToShowOriginal":"Clique para mostrar o original","crm.antiRevokeChatTip":"Dica: você também pode clicar no ícone de recuperação diretamente sobre uma mensagem apagada no chat para vê-la rapidamente.","crm.searchMessages":"Search messages…","crm.recoveredCount":"{count} mensagem(ns) recuperada(s)","crm.confirmClearChatHistory":"Limpar mensagens recuperadas deste contato?","crm.confirmClearAllHistory":"Limpar TODAS as mensagens recuperadas de todas as conversas?","crm.noTextContent":"(no text — media message)","crm.group":"Grupo","crm.enable":"Ativar","crm.disable":"Desativar","crm.addScheduleMessage":"Adicionar Agendamento","crm.noScheduledMessages":"Sem Mensagens Agendadas","crm.noScheduledMessagesDesc":"Agende mensagens para este contato.","crm.userDetails":"Detalhes do usuário","crm.addCustomAttribute":"+ Adicionar atributo","crm.edit":"Editar","crm.cancel":"Cancelar","crm.save":"Salvar","crm.signature":"Assinatura","crm.signatureDesc":"Digite seu nome para enviar mensagens assinadas ou para mostrar aos outros agentes que você está em serviço no chat específico.","crm.enterYourName":"Digite seu nome","crm.activateSignature":"Ativar assinatura","crm.signatureAs":"Assinando como","crm.signatureNotSet":"Defina seu nome de assinatura nas configurações da extensão do WhatsApp Web.","crm.delete":"Excluir","crm.deleteConnection":"Excluir Conexão?","crm.deleteConnectionConfirm":"Tem certeza de que deseja excluir esta conexão entre os nós?","crm.fullName":"Nome completo","crm.phoneNumber":"Número de telefone","crm.email":"E-mail","crm.gender":"Gênero","crm.dateOfBirth":"Data de nascimento","crm.details":"Detalhes","crm.address":"Endereço","crm.language":"Idioma","crm.male":"Masculino","crm.female":"Feminino","crm.other":"Outro","crm.select":"- Selecionar -","crm.customAttributes":"Atributos personalizados","crm.addField":"Adicionar campo","crm.fieldLabel":"Rótulo do campo","crm.fieldValue":"Valor do campo","crm.noCustomFields":"Nenhum campo personalizado","crm.deleteFieldConfirm":"Tem certeza que deseja excluir este campo?","crm.contactTabs":"Abas do contato","crm.addToTab":"Adicionar à aba","crm.removeFromTab":"Remover da aba","crm.noTabs":"Nenhuma aba criada","crm.createTab":"Criar aba","crm.tabName":"Nome da aba","crm.contacts":"contatos","crm.addToLabel":"Adicionar ao rótulo","crm.selectLabel":"Selecionar rótulo","crm.noLabelsAvailable":"Sem rótulos. Crie uma aba primeiro.","crm.labelsAndStages":"Rótulos e Etapas","crm.whatsappLabels":"Rótulos do WhatsApp","crm.customTabs":"Abas Personalizadas","team.button":"Equipe","team.shareWith":"Compartilhar com Equipe","team.settings":"Configurações da Equipe","team.addMember":"Adicionar Membro","team.editMember":"Editar Membro","team.deleteMember":"Excluir","team.memberName":"Nome do Membro","team.memberPhone":"Número de Telefone","team.department":"Departamento","team.departmentPlaceholder":"ex., Vendas, Finanças, Suporte","team.template":"Modelo de Mensagem","team.templatePlaceholder":"Digite a mensagem com variáveis...","team.noMembers":"Nenhum membro configurado","team.clickToAdd":"Clique em + para adicionar membros","team.sending":"Enviando...","team.insertVariable":"Inserir Variável","team.preview":"Visualizar Mensagem","team.deleteConfirm":"Tem certeza de que deseja excluir este membro?","team.phonePlaceholder":"ex., +5511999999999","team.namePlaceholder":"ex., Vendas - João","team.variableHint":"Use {{name}}, {{phone}}, {{labels}} etc. para conteúdo dinâmico","team.save":"Salvar","team.cancel":"Cancelar","team.editTemplate":"Editar Modelo","team.saveAndSend":"Salvar e Enviar","team.sendOnce":"Enviar Uma Vez","team.send":"Enviar","team.selectContact":"Selecionar Contato","team.clickToSelectContact":"Clique para selecionar um contato do WhatsApp","team.searchContact":"Pesquisar contatos...","team.loadingContacts":"Carregando contatos...","team.noContactsFound":"Nenhum contato encontrado","team.noSearchResults":"Sem resultados","team.phoneHint":"Digite o número com código do país ou clique no ícone para selecionar","team.popupTitle":"Compartilhar com Equipe","team.popupSubtitle":"Enviar detalhes do contato instantaneamente","team.noTeamMembers":"Sem Membros","team.noTeamMembersDesc":"Adicione membros da equipe para compartilhar rapidamente detalhes de contato via WhatsApp","crm.addNote":"+ Adicionar nota","crm.searchNotes":"Pesquisar notas...","crm.noNotes":"Nenhuma nota","crm.addFirstNote":"Adicione sua primeira nota","crm.topic":"Tópico","crm.content":"Conteúdo","crm.editNote":"Editar nota","crm.deleteNote":"Excluir nota","crm.deleteNoteConfirm":"Tem certeza que deseja excluir esta nota?","crm.addReminder":"+ Adicionar lembrete","crm.noReminders":"Nenhum lembrete","crm.addFirstReminder":"Adicione seu primeiro lembrete","crm.reminderTopic":"Tópico do lembrete","crm.dateTime":"Data e hora","crm.repeatInterval":"Intervalo de repetição","crm.noRepeat":"Sem repetição","crm.every5Min":"A cada 5 minutos","crm.every10Min":"A cada 10 minutos","crm.every15Min":"A cada 15 minutos","crm.every30Min":"A cada 30 minutos","crm.every1Hour":"A cada hora","crm.status":"Status","crm.pending":"Pendente","crm.completed":"Concluído","crm.dismissed":"Dispensado","crm.stopped":"Parado","crm.snoozed":"Adiado","crm.due":"Vencido","crm.editReminder":"Editar lembrete","crm.deleteReminder":"Excluir lembrete","crm.markComplete":"Marcar como concluído","crm.snooze":"Adiar","crm.stop":"Parar","crm.addAppointment":"+ Adicionar compromisso","crm.noAppointments":"Nenhum compromisso","crm.addFirstAppointment":"Adicione seu primeiro compromisso","crm.appointmentTitle":"Título do compromisso","crm.attendee":"Participante","crm.googleMeetLink":"Link do Google Meet","crm.generateLink":"Gerar link","crm.messageTemplate":"Modelo de mensagem","crm.reminderBefore":"Lembrar antes","crm.sendMessageNow":"Enviar mensagem agora","crm.scheduled":"Agendado","crm.cancelled":"Cancelado","crm.missed":"Perdido","crm.editAppointment":"Editar compromisso","crm.deleteAppointment":"Excluir compromisso","crm.joinMeeting":"Entrar na reunião","crm.before5Min":"5 minutos antes","crm.before10Min":"10 minutos antes","crm.before15Min":"15 minutos antes","crm.before30Min":"30 minutos antes","crm.before1Hour":"1 hora antes","crm.before2Hours":"2 horas antes","crm.before1Day":"1 dia antes","crm.titleLabel":"Título","crm.scheduleDateTime":"Agendar Data e Hora","crm.pasteGoogleMeetLink":"Cole seu link do Google Meet aqui","crm.generateLinkHint":"Clique em 'Gerar Link' para abrir o Google Meet, depois cole o link da reunião aqui","crm.chooseTemplate":"Escolher Modelo","crm.selectTemplate":"-- Selecionar um modelo --","crm.messageTemplatePlaceholder":"Digite o modelo de mensagem...","crm.useSameMessage":"Usar a mesma mensagem no início da reunião","crm.meetingStartMessageLabel":"Mensagem de Início da Reunião","crm.meetingStartPlaceholder":"Digite a mensagem para enviar no início da reunião...","crm.meetingStartHint":"Esta mensagem será enviada quando a reunião realmente começar.","crm.sendReminderLabel":"Enviar Lembrete","crm.reminderTimeHint":"A mensagem será enviada aos participantes neste momento antes da reunião. Você também receberá uma notificação sonora.","crm.sendMessageNowTo":"Enviar mensagem agora para","crm.sendNowHint":"Marque para enviar a mensagem do compromisso imediatamente após salvar","crm.discard":"Descartar","crm.saveAndSend":"Salvar e Enviar","crm.sending":"Enviando...","crm.noAppointmentsFound":"Nenhum compromisso encontrado","crm.searchAppointments":"Pesquisar compromissos","crm.productDemoCall":"ex., Chamada de demonstração do produto","crm.reminderMessageHint":"Esta mensagem será enviada no horário do lembrete (antes da reunião).","crm.joinMeet":"Entrar no Meet","crm.appointmentTemplates":"Modelos de Compromissos","crm.savedTemplates":"Modelos Salvos","crm.noTemplatesYet":"Ainda não há modelos. Crie seu primeiro modelo!","crm.newTemplate":"+ Novo Modelo","crm.editTemplateTitle":"Editar Modelo","crm.newTemplateTitle":"Novo Modelo","crm.templateName":"Nome do Modelo","crm.templateNamePlaceholder":"ex., Lembrete de Reunião","crm.meetLinkOptional":"Link do Google Meet (Opcional)","crm.updateTemplate":"Atualizar Modelo","crm.saveTemplate":"Salvar Modelo","crm.pleaseEnterTitle":"Por favor, insira um título","crm.pleaseSelectFutureDate":"Por favor, selecione uma data e hora futura","crm.deleteAppointmentConfirm":"Tem certeza de que deseja excluir este compromisso?","crm.pleaseEnterTemplateName":"Por favor, insira um nome de modelo","crm.pleaseEnterMessageTemplate":"Por favor, insira um modelo de mensagem","crm.deleteTemplateConfirm":"Tem certeza de que deseja excluir este modelo?","crm.addIncome":"+ Adicionar receita","crm.totalIncome":"Receita total","crm.pendingIncome":"Pendente","crm.filteredTotal":"Total filtrado","crm.noIncome":"Nenhum registro de receita","crm.addFirstIncome":"Adicione sua primeira receita","crm.amount":"Valor","crm.category":"Categoria","crm.paymentMethod":"Método de pagamento","crm.description":"Descrição","crm.reference":"Referência","crm.date":"Data","crm.paymentReceived":"Pagamento recebido","crm.sale":"Venda","crm.serviceFee":"Taxa de serviço","crm.commission":"Comissão","crm.refundReceived":"Reembolso recebido","crm.cash":"Dinheiro","crm.bankTransfer":"Transferência bancária","crm.upi":"UPI","crm.pix":"PIX","crm.card":"Cartão","crm.cheque":"Cheque","crm.addCustomPaymentMethod":"Adicionar método personalizado","crm.editIncome":"Editar receita","crm.deleteIncome":"Excluir receita","crm.addExpense":"+ Adicionar despesa","crm.totalExpense":"Despesa total","crm.pendingExpense":"Pendente","crm.noExpense":"Nenhum registro de despesa","crm.addFirstExpense":"Adicione sua primeira despesa","crm.purchase":"Compra","crm.serviceCost":"Custo de serviço","crm.travel":"Viagem","crm.marketing":"Marketing","crm.commissionPaid":"Comissão paga","crm.refundGiven":"Reembolso dado","crm.editExpense":"Editar despesa","crm.deleteExpense":"Excluir despesa","crm.search":"Pesquisar...","crm.all":"Todos","crm.today":"Hoje","crm.thisWeek":"Esta semana","crm.thisMonth":"Este mês","crm.thisYear":"Este ano","crm.filterByCategory":"Filtrar por categoria","crm.filterByStatus":"Filtrar por status","crm.filterByDate":"Filtrar por data","crm.allStatus":"Todos os status","crm.allCategories":"Todas as categorias","crm.none":"Nenhum","crm.ref":"Ref","crm.tableTabName":"Nome da aba","crm.tableContactsInTab":"Contatos na aba","crm.tableAction":"Ação","crm.tableName":"Nome","crm.tableModifiedDate":"Data de modificação","crm.tableTopic":"Tópico","crm.tableReminderDate":"Data do lembrete","crm.tableRepeatSnooze":"Repetir/Adiar","crm.tableStatus":"Status","crm.tableTitle":"Título","crm.tableDateTime":"Data e hora","crm.tableAttendee":"Participante","crm.tableMeetLink":"Link do Meet","crm.tableDescription":"Descrição","crm.tableCategory":"Categoria","crm.tableAmount":"Valor","crm.tablePayment":"Pagamento","crm.tableDate":"Data","crm.addIncomeTitle":"Adicionar receita","crm.editIncomeTitle":"Editar receita","crm.addExpenseTitle":"Adicionar despesa","crm.editExpenseTitle":"Editar despesa","crm.enterAmount":"Digite o valor","crm.validAmountRequired":"Por favor, digite um valor válido","crm.descriptionRequired":"Por favor, digite uma descrição","crm.referenceInvoice":"Referência / Nº da Fatura","crm.referenceBill":"Referência / Nº do Recibo","crm.invoicePlaceholder":"ex. FAT-001","crm.billPlaceholder":"ex. REC-001","crm.paymentDescription":"ex. Pagamento por serviços","crm.expenseDescription":"ex. Material de escritório","crm.update":"Atualizar","crm.addIncomeBtn":"Adicionar receita","crm.addExpenseBtn":"Adicionar despesa","crm.recurringTransaction":"Transação Recorrente","crm.repeatEvery":"Repetir a cada","crm.neverEnds":"Sem fim","crm.endDate":"Data de término","crm.daily":"Diário","crm.weekly":"Semanal","crm.monthly":"Mensal","crm.quarterly":"Trimestral (3 meses)","crm.yearly":"Anual","crm.currencySettings":"Configurações de moeda","crm.searchCurrency":"Buscar moeda...","crm.noCurrenciesFound":"Nenhuma moeda encontrada","crm.noIncomeRecords":"Nenhum registro de receita encontrado","crm.noExpenseRecords":"Nenhum registro de despesa encontrado","crm.deleteIncomeConfirm":"Tem certeza que deseja excluir este registro de receita?","crm.deleteExpenseConfirm":"Tem certeza que deseja excluir este registro de despesa?","crm.addCategory":"Adicionar Categoria","crm.categoryName":"Nome da Categoria","crm.enterCategoryName":"Digite o nome da categoria","crm.customCategories":"Categorias Personalizadas","crm.addCustomCategory":"Adicionar Categoria Personalizada","crm.existingCustomCategories":"Categorias Personalizadas Existentes","crm.addStatus":"Adicionar Status","crm.statusName":"Nome do Status","crm.enterStatusName":"Digite o nome do status","crm.customStatuses":"Status Personalizados","crm.addCustomStatus":"Adicionar Status Personalizado","crm.existingCustomStatuses":"Status Personalizados Existentes","crm.add":"Adicionar","crm.loading":"Carregando...","crm.dismiss":"Dispensar","crm.yesterday":"Ontem","agent.agentMode":"Modo Agente","agent.identifyAsAgent":"Identificar como Agente","agent.agentName":"Nome do Agente","agent.namePlaceholder":"ex., João, Equipe de Suporte 1","agent.agentNamePlaceholder":"Digite o nome do seu agente","agent.viewTransferHistory":"Ver Histórico de Transferências","agent.transferToAgent":"Transferir para Agente","agent.transferSuccess":"Chat transferido com sucesso","agent.noAgentsOnline":"Nenhum agente disponível online","agent.selectAgent":"Selecionar Agente","agent.chooseAgent":"-- Escolha um Agente --","agent.reason":"Motivo","agent.reasonPlaceholder":"Por que você está transferindo este chat?","agent.priority":"Prioridade","agent.priorityLow":"Baixa","agent.priorityMedium":"Média","agent.priorityHigh":"Alta","agent.priorityUrgent":"Urgente","agent.transfer":"Transferir","agent.incomingTransfer":"Transferência Recebida","agent.fromAgent":"Do Agente","agent.toAgent":"Para o Agente","agent.chat":"Chat","agent.startService":"Iniciar Atendimento","agent.endService":"Encerrar Atendimento","agent.activeService":"Atendimento Ativo","agent.from":"De","agent.to":"Para","agent.duration":"Duração","agent.transferHistory":"Histórico de Transferências","agent.sent":"Enviadas","agent.received":"Recebidas","agent.status":"Status","agent.all":"Todos","agent.statusPending":"Pendente","agent.statusAccepted":"Aceito","agent.statusInService":"Em Atendimento","agent.statusCompleted":"Concluído","agent.statusDeclined":"Recusado","agent.statusExpired":"Expirado","agent.noTransfers":"Nenhuma transferência encontrada","agent.serviceQueue":"Fila de Atendimento","agent.pendingTransfers":"Transferências Pendentes","agent.activeServices":"Atendimentos Ativos","agent.sentTransfers":"Transferências Enviadas","agent.noActiveServices":"Nenhum atendimento ativo ou transferência pendente","agent.serviceEnded":"Atendimento encerrado com sucesso","agent.accept":"Aceitar","agent.decline":"Recusar","agent.notRegistered":"Agente não registrado. Por favor, ative o modo agente primeiro.","agent.statusCancelled":"Cancelado","agent.started":"Iniciado","chatTools.suggest":"Sugerir","chatTools.spelling":"Ortografia","chatTools.translate":"Traduzir","chatTools.summarize":"Resumir","chatTools.enlarge":"Expandir","chatTools.friendly":"Amigável","chatTools.formal":"Formal","chatTools.send":"Enviar","chatTools.copy":"Copiar","chatTools.use":"Usar","chatTools.aiResult":"Resultado IA","chatTools.suggestTitle":"Sugestão IA","chatTools.spellingTitle":"Corrigir ortografia e gramática","chatTools.translateTitle":"Traduzir para","chatTools.summarizeTitle":"Resumir texto","chatTools.enlargeTitle":"Expandir texto","chatTools.friendlyTitle":"Tornar amigável","chatTools.formalTitle":"Tornar formal","chatTools.conversationSummary":"Resumo do chat","chatTools.conversationSummaryTitle":"Resumir esta conversa","chatTools.conversationSummarizing":"Summarizing chat…","chatTools.conversationSummaryEmpty":"Nenhuma mensagem para resumir neste chat","chatTools.conversationSummaryNoChat":"Abra um chat para resumi-lo","chatTools.conversationSummaryFailed":"Falha ao obter as mensagens do chat","chatTools.conversationSummaryResultTitle":"Resumo da conversa","chatTools.sendTitle":"Enviar mensagem","chatTools.selectTextFirst":"Selecione o texto primeiro ou digite na caixa de entrada","chatTools.searchLanguage":"Pesquisar idioma...","aiSettings.title":"Inserir chave API de IA","aiSettings.platformType":"Tipo de plataforma de IA","aiSettings.geminiAI":"GEMINI AI","aiSettings.chatgpt":"CHATGPT","aiSettings.deepseek":"DEEPSEEK","aiSettings.apiKey":"Chave API de IA","aiSettings.enterApiKey":"Por favor, insira sua chave API de IA","aiSettings.validate":"Validar","aiSettings.validKey":"Chave API válida!","aiSettings.invalidKey":"Chave API inválida. Por favor, verifique e tente novamente.","aiSettings.note":"Nota:","aiSettings.geminiNote":"Obtenha sua chave API Gemini no Google AI Studio (aistudio.google.com)","aiSettings.chatgptNote":"Obtenha sua chave API OpenAI em platform.openai.com/api-keys","aiSettings.deepseekNote":"Obtenha sua chave API DeepSeek em platform.deepseek.com","aiSettings.enableAITools":"Ativar ferramentas de IA","aiSettings.close":"Fechar","aiSettings.save":"Salvar","aiSettings.configureAI":"Configure seu provedor de IA e chave API para recursos alimentados por IA","settings.title":"Configurações","settings.yourLanguage":"Seu Idioma","settings.selectLanguage":"Selecionar Idioma","settings.chooseLanguage":"Escolha seu idioma preferido para a interface da extensão","settings.whatLanguageSpeak":"Que Idioma Você Fala","settings.translateMessages":"Traduzir mensagens recebidas","settings.selectSpokenLanguage":"Selecione Seu Idioma","settings.spokenLanguageHint":"As mensagens serão traduzidas para este idioma quando você clicar no ícone de tradução nas mensagens recebidas.","settings.blurSettings":"Configurações de Desfoque","settings.blurDescription":"Desfocando informações privadas da tela.","settings.blurMessages":"Desfocar mensagens","settings.blurProfileNames":"Desfocar nomes de perfil","settings.blurDisplayPhotos":"Desfocar fotos de perfil","settings.blurConversation":"Desfocar conversa","settings.displayOnHover":"Exibir conversa ao passar o mouse","settings.theme":"Tema","settings.themeDescription":"Escolha seu esquema de cores preferido","settings.lightMode":"Modo Claro","settings.lightModeDesc":"Aparência clara clássica","settings.darkMode":"Modo Escuro","settings.darkModeDesc":"Agradável aos olhos com pouca luz","settings.systemMode":"Sistema","settings.systemModeHint":"Segue o tema do WhatsApp","settings.currentTheme":"Tema atual","signature.title":"Assinatura","signature.enableSignature":"Ativar assinatura","signature.yourSignature":"Sua assinatura","signature.placeholder":"ex., - João Silva","signature.preview":"Pré-visualização","signature.save":"Salvar","backup.title":"Backup e restauração","backup.export":"Exportar","backup.import":"Importar","backup.importHint":"Envie um arquivo JSON de backup do {brand} para restaurar seus dados. Você pode selecionar quais recursos importar.","backup.kanbanCRM":"Dados do Kanban CRM","backup.customTabs":"Abas personalizadas","backup.templatesQuickReplies":"Modelos e respostas rápidas","backup.broadcastHistory":"Histórico de transmissão","backup.settings":"Configurações","backup.crmProfileData":"Dados do Perfil CRM","backup.calendarData":"Calendário (Lembretes e Compromissos)","backup.statusData":"Status","backup.webhookSettings":"Configurações de Webhook","backup.aiBotSettings":"Configurações do Bot de IA","backup.aiApiSettings":"Configurações de API de IA","backup.spokenLanguage":"Idioma Falado","backup.chatbotFlows":"Fluxos de Chatbot (Fluxo)","backup.followupData":"Sequências de acompanhamento","backup.scheduledMessages":"Mensagens agendadas","backup.scheduledBroadcasts":"Transmissões agendadas","backup.fluxoAdvanced":"Configurações avançadas do Fluxo","backup.conversationStates":"Estados de conversa","backup.bulkValidatorData":"Dados do validador em massa","backup.quickReplies":"Respostas rápidas","backup.crmTodos":"Listas de tarefas CRM","backup.signatureSettings":"Configurações de assinatura","backup.teamSettings":"Configurações de equipe","backup.blurSettings":"Configurações de desfoque","backup.featureVisibility":"Visibilidade de recursos","backup.themeSettings":"Configurações de tema","backup.uiStateSettings":"Configurações de estado da interface","backup.apiPollingSettings":"Configurações de polling de API","backup.agentSettings":"Configurações de agente","backup.autoBackup":"Backup automático","backup.autoBackupInfo":"Um backup automático será criado quando o WhatsApp Web for carregado em uma nova data","backup.autoBackupDestination":"Destino do backup","backup.autoBackupWhatsApp":"Enviar para mensagens salvas do WhatsApp","backup.autoBackupDownload":"Baixar para o computador","backup.exportNow":"Exportar agora","backup.importNow":"Importar agora","backup.selectFile":"Selecione o arquivo de backup para importar","backup.importSuccess":"Dados importados com sucesso!","backup.importError":"Erro ao importar dados. Por favor, verifique o formato do arquivo.","backup.exportSuccess":"Dados exportados com sucesso!","backup.noDataSelected":"Por favor, selecione pelo menos um tipo de dados para exportar/importar","backup.cheetahDetected":"Cheetah CRM Detectado","backup.fileLoaded":"Arquivo carregado com sucesso","backup.cheetahImportDesc":"Este backup contém dados do Cheetah CRM. Todas as funcionalidades compatíveis serão importadas e mescladas com seus dados existentes do CRM.","backup.dataToImport":"Dados a importar:","backup.mergeWarning":"Importante:","backup.mergeWarningDesc":"Os dados serão mesclados com os dados existentes do CRM. Seus dados atuais NÃO serão sobrescritos - apenas novos dados serão adicionados.","backup.importing":"Importando...","backup.importCheetah":"Importar Backup do Cheetah CRM","missedSchedule.title":"Campanha agendada perdida","missedSchedule.description":"Uma campanha agendada foi perdida porque o WhatsApp Web não estava aberto no horário programado.","missedSchedule.sendNow":"Enviar agora","missedSchedule.cancelDiscard":"Cancelar e descartar","missedSchedule.dismiss":"Lembrar mais tarde","calendar.title":"Calendário","calendar.goToToday":"Ir para hoje","calendar.reminders":"Lembretes","calendar.appointments":"Compromissos","calendar.remindersFor":"Lembretes para","calendar.appointmentsFor":"Compromissos para","calendar.noReminders":"Sem lembretes para esta data","calendar.noAppointments":"Sem compromissos para esta data","calendar.selectDate":"Selecione uma data com lembretes ou compromissos","calendar.deleteReminder":"Excluir lembrete","calendar.deleteAppointment":"Excluir compromisso","calendar.confirmDeleteReminder":"Tem certeza de que deseja excluir este lembrete?","calendar.confirmDeleteAppointment":"Tem certeza de que deseja excluir este compromisso?","calendar.everyMin":"A cada {min} min","calendar.everyHour":"A cada hora","calendar.weekdays.sun":"DOM","calendar.weekdays.mon":"SEG","calendar.weekdays.tue":"TER","calendar.weekdays.wed":"QUA","calendar.weekdays.thu":"QUI","calendar.weekdays.fri":"SEX","calendar.weekdays.sat":"SÁB","calendar.months.january":"Janeiro","calendar.months.february":"Fevereiro","calendar.months.march":"Março","calendar.months.april":"Abril","calendar.months.may":"Maio","calendar.months.june":"Junho","calendar.months.july":"Julho","calendar.months.august":"Agosto","calendar.months.september":"Setembro","calendar.months.october":"Outubro","calendar.months.november":"Novembro","calendar.months.december":"Dezembro","calendar.status.pending":"Pendente","calendar.status.completed":"Concluído","calendar.status.dismissed":"Dispensado","calendar.status.snoozed":"Adiado","calendar.status.stopped":"Parado","calendar.status.scheduled":"Agendado","calendar.status.cancelled":"Cancelado","calendar.status.missed":"Perdido","calendar.todos":"Tarefas","calendar.todosFor":"Tarefas para","calendar.noTodos":"Nenhuma tarefa encontrada","calendar.addTodo":"Adicionar Tarefa","calendar.editTodo":"Editar Tarefa","calendar.deleteTodo":"Excluir Tarefa","calendar.confirmDeleteTodo":"Tem certeza de que deseja excluir esta tarefa?","todo.title":"Título","todo.titlePlaceholder":"Digite o título da tarefa","todo.description":"Descrição","todo.descriptionPlaceholder":"Adicionar detalhes (opcional)","todo.dueDate":"Data de Vencimento","todo.dueTime":"Hora de Vencimento","todo.priority":"Prioridade","todo.priorityHigh":"Alta","todo.priorityMedium":"Média","todo.priorityLow":"Baixa","todo.category":"Categoria","todo.noCategory":"Sem Categoria","todo.categoryWork":"Trabalho","todo.categoryPersonal":"Pessoal","todo.categoryUrgent":"Urgente","todo.categoryShopping":"Compras","todo.categoryHealth":"Saúde","todo.subtasks":"Subtarefas","todo.addSubtask":"Adicionar","todo.subtaskPlaceholder":"Digite a subtarefa","todo.recurring":"Recorrente","todo.repeatEvery":"Repetir","todo.endDate":"Data Final","todo.recurringDaily":"Diariamente","todo.recurringWeekly":"Semanalmente","todo.recurringMonthly":"Mensalmente","todo.recurringYearly":"Anualmente","todo.reminder":"Lembrete","todo.reminderDate":"Data do Lembrete","todo.reminderTime":"Hora do Lembrete","todo.browserNotification":"Notificação do Navegador","todo.whatsappSelfMessage":"Enviar lembrete WhatsApp para mim","todo.whatsappSelfMessageHint":"Você receberá uma mensagem do WhatsApp no vencimento","todo.save":"Salvar Tarefa","todo.update":"Atualizar Tarefa","todo.cancel":"Cancelar","todo.addTodo":"Adicionar Tarefa","todo.editTodo":"Editar Tarefa","todo.statusPending":"Pendente","todo.statusInProgress":"Em Andamento","todo.statusCompleted":"Concluído","todo.statusCancelled":"Cancelado","todo.filterAll":"Todas as Tarefas","todo.filterToday":"Hoje","todo.filterThisWeek":"Esta Semana","todo.filterOverdue":"Atrasadas","todo.filterCompleted":"Concluídas","todo.today":"Hoje","todo.tomorrow":"Amanhã","todo.overdue":"Atrasado","todo.snoozeTime":"Tempo de Adiamento","todo.minutes":"minutos","todo.hour":"hora","todo.hours":"horas","todo.day":"dia","todo.taskReminder":"Lembrete de Tarefa","todo.highPriority":"Alta Prioridade","todo.mediumPriority":"Prioridade Média","todo.lowPriority":"Baixa Prioridade","todo.subtasksCount":"subtarefas","todo.snooze":"Adiar","todo.markDone":"Marcar como Feito","todo.dismiss":"Dispensar","todo.task":"Tarefa","todo.changeColor":"Clique para mudar a cor","todo.selectCategoryFirst":"Selecione uma categoria primeiro","todo.linkedContacts":"Contatos Vinculados","todo.optional":"Opcional","todo.selectContacts":"Selecionar Contatos","todo.searchContacts":"Pesquisar contatos...","todo.noContactsFound":"Nenhum contato encontrado","todo.selected":"selecionados","todo.contacts":"contatos","status.title":"Status","status.activeStatus":"Status Ativo","status.createStatus":"Criar Status","status.loading":"Carregando status...","status.noStatusFound":"Nenhum status encontrado","status.noStatusDescription":"Parece que você ainda não criou nenhum status. Clique no botão abaixo para adicionar um novo.","status.add":"Adicionar","status.statusName":"Nome do Status (opcional)","status.statusNamePlaceholder":"Criar um nome para o status","status.chooseType":"Escolha um tipo","status.type.text":"TEXTO","status.type.image":"IMAGEM","status.type.video":"VÍDEO","status.type.audio":"ÁUDIO","status.typeText":"Digite o texto","status.backgroundColor":"Escolha uma cor de fundo","status.clickToChange":"Clique para alterar","status.import":"Importar","status.dragHere":"Arraste o arquivo aqui","status.caption":"Legenda","status.captionPlaceholder":"Adicionar legenda...","status.scheduleStatus":"Agendar o status","status.autoRepost24h":"Republicar o status a cada 24 horas","status.autoRepost":"Republicar Auto","status.postNow":"Publicar Agora","status.posting":"Publicando...","status.create":"Criar","status.edit":"Editar","status.delete":"Excluir","status.emoji":"Emoji","status.status.pending":"Pendente","status.status.posted":"Publicado","status.status.scheduled":"Agendado","status.status.failed":"Falhou","ai.regenerate":"Reescrever","ai.regenerating":"Reescrevendo...","ai.regenerateWithAI":"Reescrever com IA","ai.notEnabled":"A IA não está habilitada. Por favor, configure as configurações de IA.","ai.failedToRegenerate":"Falha ao reescrever","ai.failedToRegenerateMessage":"Falha ao reescrever a mensagem","templates.attachmentType.imagevideo":"Mensagem + Imagens/Vídeos","templates.attachmentType.fluxo":"Fluxo Chatbot","broadcast.title":"Mensagens em Massa","broadcast.newCampaign":"Nova Campanha","broadcast.reports":"Relatórios","broadcast.close":"Fechar","broadcast.sending":"Enviando...","broadcast.paused":"Pausado","broadcast.completed":"Concluído","broadcast.clearHistory":"Limpar Histórico","broadcast.createCampaign":"Criar Campanha","broadcast.createCampaignSubtitle":"Enviar mensagens personalizadas para múltiplos contatos","broadcast.scheduledCampaigns":"Campanhas Agendadas","broadcast.campaignReports":"Relatórios de Campanha","broadcast.viewManageCampaigns":"Visualizar e gerenciar suas campanhas","broadcast.recipients":"Destinatários","broadcast.selected":"selecionados","broadcast.contacts":"Contatos","broadcast.groups":"Grupos","broadcast.phone":"Telefone","broadcast.phonePlaceholder":"Números de telefone com código do país","broadcast.clearAll":"Limpar Tudo","broadcast.contactsUploaded":"contatos carregados","broadcast.noGroupsSelected":'No groups selected. Click "Add Groups" to select.',"broadcast.addGroups":"Adicionar Grupos","broadcast.groupsSelected":"grupo(s) selecionado(s)","broadcast.upload":"Carregar","broadcast.select":"Selecionar","broadcast.download":"Baixar","broadcast.groupsContacts":"Contatos do Grupo","broadcast.tabsContacts":"Contatos da Aba","broadcast.kanbanBoard":"Quadro Kanban","broadcast.labelsContacts":"Contatos da Etiqueta","broadcast.allowRepeat":"Permitir Números Repetidos","broadcast.enableLinkPreview":"Ativar Pré-visualização de Link","broadcast.groupActions":"Ações de Grupo","broadcast.customTabActions":"Ações de Aba Personalizada","broadcast.labelsActions":"Ações de Etiquetas","broadcast.kanbanBoardActions":"Ações do Quadro Kanban","broadcast.skipBulkMessage":"Pular Mensagem em Massa","broadcast.skipBulkMessageInfo":"O envio de mensagens será pulado. Apenas ações (Grupos, Abas, Etiquetas, Kanban) serão realizadas nos contatos.","broadcast.appendSignature":"Adicionar Assinatura","broadcast.signaturePreview":"Visualização","broadcast.groupActionsNote":"Nota: Você deve ser administrador dos grupos para realizar as ações abaixo.","broadcast.addIntoGroups":"Adicionar aos Grupos","broadcast.removeFromGroups":"Remover dos Grupos","broadcast.selectGroups":"Selecionar Grupos","broadcast.addIntoTabs":"Adicionar às Abas Personalizadas","broadcast.removeFromTabs":"Remover das Abas Personalizadas","broadcast.selectTabs":"Selecionar Abas","broadcast.addToLabels":"Adicionar às Etiquetas","broadcast.removeFromLabels":"Remover das Etiquetas","broadcast.selectLabels":"Selecionar Etiquetas","broadcast.addToKanban":"Adicionar ao Estágio Kanban","broadcast.removeFromKanban":"Remover do Estágio Kanban","broadcast.selectCRMStage":"Selecionar CRM e Estágio","broadcast.sendRandomMessage":"Enviar mensagem aleatória para cada contato","broadcast.addMessage":"Adicionar Mensagem","broadcast.pauseSetting":"Configuração de Pausa","broadcast.pauseAfterXSends":"Pausar (após cada X envios):","broadcast.pauseTimeInSeconds":"Tempo de pausa (s):","broadcast.second":"Segundo","broadcast.message":"Mensagem","broadcast.moveUp":"Mover para Cima","broadcast.moveDown":"Mover para Baixo","broadcast.deleteMessage":"Excluir Mensagem","broadcast.templateType":"Tipo de Modelo","broadcast.messageOnly":"Apenas Mensagem","broadcast.enterMessageText":"Por favor, insira o texto da mensagem","broadcast.variable":"Variável","broadcast.phoneNumber":"Número de Telefone","broadcast.contactName":"Nome do Contato","broadcast.uploadCSVHint":"Carregue CSV com colunas adicionais para adicionar mais variáveis","broadcast.selectTemplates":"Selecionar Modelos","broadcast.noTemplates":"Nenhum modelo disponível","broadcast.sendingDelay":"Atraso de Envio","broadcast.minimumSecond":"Segundo Mínimo","broadcast.maximumSecond":"Segundo Máximo","broadcast.delayHint":"Cada mensagem será enviada com um atraso aleatório entre {min}-{max} segundos","broadcast.scheduleMessage":"Agendar Mensagem","broadcast.date":"Data","broadcast.time":"Hora","broadcast.autoSendIfMissed":"Envio automático se o horário agendado passou","broadcast.recurring":"Recorrente","broadcast.repeatInterval":"Repetir","broadcast.daily":"Diário","broadcast.weekly":"Semanal","broadcast.monthly":"Mensal","broadcast.yearly":"Anual","broadcast.selectDays":"Selecionar Dias","broadcast.sun":"Dom","broadcast.mon":"Seg","broadcast.tue":"Ter","broadcast.wed":"Qua","broadcast.thu":"Qui","broadcast.fri":"Sex","broadcast.sat":"Sáb","broadcast.ends":"Termina","broadcast.endNever":"Nunca","broadcast.endOnDate":"Na Data","broadcast.recurringHowToUse":"Como usar Recorrente","broadcast.recurringTip1":"Ative recorrente para repetir automaticamente este envio","broadcast.recurringTip2":"Escolha a frequência: Diário, Semanal, Mensal ou Anual","broadcast.recurringTip3":"Para Semanal: Selecione dias específicos (Seg, Ter, etc.)","broadcast.recurringTip4":'Set end date or choose "Never" to run indefinitely',"broadcast.recurringTip5":"Após cada envio, o próximo é agendado automaticamente","broadcast.selectDates":"Selecionar Datas","broadcast.selectMonths":"Selecionar Meses","broadcast.calendarSelectInfo":"Selecione datas específicas no calendário. Navegue entre os meses usando as setas.","broadcast.datesSelected":"datas selecionadas","broadcast.jan":"Jan","broadcast.feb":"Fev","broadcast.mar":"Mar","broadcast.apr":"Abr","broadcast.may":"Mai","broadcast.jun":"Jun","broadcast.jul":"Jul","broadcast.aug":"Ago","broadcast.sep":"Set","broadcast.oct":"Out","broadcast.nov":"Nov","broadcast.dec":"Dez","broadcast.quickStart":"Início Rápido","broadcast.previewStart":"Pré-visualizar e Iniciar","broadcast.scheduleBroadcast":"Agendar Transmissão","broadcast.sent":"Enviados","broadcast.failed":"Falharam","broadcast.resume":"Retomar","broadcast.pause":"Pausar","broadcast.stop":"Parar","broadcast.resumeCampaign":"Retomar Campanha?","broadcast.campaignInterrupted":"Uma campanha foi interrompida. Deseja retomar?","broadcast.remaining":"Restantes","broadcast.contactsProcessed":"contatos processados","broadcast.resumeCampaignBtn":"Retomar Campanha","broadcast.cancelDiscard":"Cancelar e Descartar","broadcast.dismissRemindLater":"Ignorar (Lembrar Depois)","broadcast.broadcastScheduled":"Transmissão Agendada!","broadcast.campaignPreview":"Pré-visualização da Campanha","broadcast.messages":"Mensagens","broadcast.stepSettings":"Configurações","broadcast.stepActions":"Ações","broadcast.stepReview":"Revisar","broadcast.delayRange":"Intervalo de Atraso","broadcast.pauseAfterDuration":"Pausar Após / Duração","broadcast.checkConsole":"Verifique o console do navegador para configuração detalhada","broadcast.sendingQueue":"Fila de Envio","broadcast.broadcastReports":"Relatórios de Transmissão","broadcast.campaignHistory":"Histórico de Campanhas","broadcast.noHistoryYet":"Ainda não há histórico de transmissão","broadcast.historyDescription":"Suas transmissões concluídas e agendadas aparecerão aqui","broadcast.noCampaignsYet":"Ainda não há campanhas concluídas","broadcast.dateTime":"Data e Hora","broadcast.status":"Status","broadcast.scheduled":"Agendado","broadcast.cancel":"Cancelar","broadcast.running":"Em Execução","broadcast.cancelled":"Cancelado","broadcast.downloadAllContacts":"Baixar Todos os Contatos","broadcast.downloadSentContacts":"Baixar Contatos Enviados","broadcast.downloadFailedContacts":"Baixar Contatos com Falha","broadcast.selectGroupsToAdd":"Selecionar Grupos para Adicionar Contatos","broadcast.selectGroupsToRemove":"Selecionar Grupos para Remover Contatos","broadcast.selectTabsToAdd":"Selecionar Abas para Adicionar Contatos","broadcast.selectTabsToRemove":"Selecionar Abas para Remover Contatos","broadcast.selectLabelsToAdd":"Selecionar Etiquetas para Adicionar Contatos","broadcast.selectLabelsToRemove":"Selecionar Etiquetas para Remover Contatos","broadcast.selectCRM":"Selecionar CRM","broadcast.selectStage":"Selecionar Estágio","broadcast.backToCRMs":"Voltar aos CRMs","broadcast.loadingGroups":"Carregando grupos...","broadcast.loadingTabs":"Carregando abas...","broadcast.loadingLabels":"Carregando etiquetas...","broadcast.noGroupsFound":"Nenhum grupo encontrado onde você é administrador","broadcast.noTabsFound":"Nenhuma aba personalizada encontrada. Crie abas primeiro.","broadcast.noLabelsFound":"Nenhuma etiqueta encontrada. Crie etiquetas no WhatsApp primeiro.","broadcast.noCRMsFound":"Nenhum CRM encontrado. Crie um CRM primeiro.","broadcast.noStagesFound":"Nenhum estágio encontrado neste CRM.","broadcast.tabsSelected":"abas selecionadas","broadcast.labelsSelected":"etiquetas selecionadas","broadcast.confirmSelection":"Confirmar Seleção","broadcast.availableVariables":"Variáveis disponíveis","broadcast.of":"de","broadcast.chats":"conversas","broadcast.remove":"Remover","broadcast.allScheduledCampaigns":"Todas as Campanhas Agendadas","broadcast.noScheduledCampaigns":"Nenhuma campanha agendada","broadcast.scheduleFirstCampaign":"Agende sua primeira campanha para vê-la aqui","broadcast.createNewCampaign":"Criar Nova Campanha","broadcast.oneTime":"Uma vez","broadcast.nextRun":"Próxima execução","broadcast.runNow":"Executar Agora","broadcast.pauseCampaign":"Pausar","broadcast.editCampaign":"Editar","broadcast.deleteCampaign":"Excluir","broadcast.confirmDeleteScheduled":"Tem certeza de que deseja excluir esta campanha agendada?","broadcast.campaignStarting":"A campanha começará em breve","broadcast.skipNext":"Pular Próxima","broadcast.unskipNext":"Não Pular","broadcast.skippingNext":"Pulando próxima","broadcast.lastRun":"Última execução","broadcast.runs":"execuções","broadcast.successRate":"sucesso","broadcast.justNow":"agora mesmo","broadcast.inAMoment":"em um momento","broadcast.ago":"atrás","broadcast.in":"em","broadcast.uploadContacts":"Carregar Contatos","broadcast.stepSelect":"Selecionar","broadcast.stepMap":"Mapear","broadcast.stepUpload":"Carregar","broadcast.uploadCSVImport":"Carregue um arquivo CSV para importar contatos","broadcast.uploadCSVOnly":"Apenas arquivos CSV (formato .csv)","broadcast.downloadSampleFile":"Baixar arquivo de exemplo","broadcast.phoneNumberLabel":"Número de Telefone:","broadcast.mapColumnHint":"mapeie a coluna com dados de 'Número de Telefone'","broadcast.chooseExtraColumns":"Escolha colunas extras para mensagens personalizadas.","broadcast.all":"Todos","broadcast.none":"Nenhum","broadcast.previous":"Anterior","broadcast.next":"Próximo","broadcast.removeUnwantedRows":"Remover Linhas Indesejadas","broadcast.totalContacts":"Total de Contatos","broadcast.startUpload":"Iniciar Upload","broadcast.rows":"linhas","broadcast.selectGroupsTitle":"Selecionar Grupos","broadcast.searchGroups":"Pesquisar grupos...","broadcast.members":"membros","broadcast.groupsSelectedCount":"grupos selecionados","broadcast.addGroupsBtn":"Adicionar Grupos","broadcast.tooltipBold":"Negrito","broadcast.tooltipItalic":"Itálico","broadcast.tooltipStrikethrough":"Tachado","broadcast.tooltipAddMedia":"Adicionar mídia","broadcast.tooltipRefresh":"Atualizar","broadcast.noCompletedCampaigns":"Nenhuma campanha concluída ainda","kanban.title":"CRM KANBAN","kanban.user":"Usuário","kanban.darkMode":"Modo Escuro","kanban.lightMode":"Modo Claro","kanban.menu":"Menu","kanban.createCRM":"Criar CRM","kanban.addStage":"Adicionar Etapa","kanban.analytics":"Análises","kanban.sync":"Sincronizar","kanban.cannotAddStages":"Não é possível adicionar etapas ao CRM de Etiquetas do WhatsApp","kanban.inbox":"CAIXA","kanban.unread":"Não lidos","kanban.pinned":"Fixados","kanban.groups":"Grupos","kanban.stages":"etapas","kanban.chats":"chats","kanban.searchInbox":"Pesquisar na caixa de entrada...","kanban.searchContacts":"Pesquisar...","kanban.stageOptions":"Opções da etapa","kanban.renameStage":"Renomear","kanban.clearSearch":"Limpar pesquisa","kanban.noChatsMatch":"Nenhum chat corresponde","kanban.noChatsYet":"Ainda não há chats","kanban.filterUnread":"Filtrar chats não lidos","kanban.filterPinned":"Filtrar chats fixados","kanban.filterGroups":"Filtrar chats de grupo","kanban.addNewStage":"Adicionar nova etapa","kanban.noCRMsFound":"Nenhum CRM encontrado","kanban.selectCRM":"Selecione um CRM no menu","kanban.loading":"Carregando Kanban CRM...","kanban.syncingLabels":"Sincronizando Etiquetas do WhatsApp e Abas...","kanban.switchCRM":"Trocar CRM","kanban.createNewCRM":"Criar Novo CRM","kanban.enterCRMName":"Digite o nome do CRM...","kanban.addNewStageTitle":"Adicionar Nova Etapa","kanban.enterStageName":"Digite o nome da etapa...","kanban.editStage":"Editar Etapa","kanban.editStageName":"Editar nome da etapa","kanban.deleteStage":"Excluir etapa","kanban.editCRM":"Editar CRM","kanban.deleteCRM":"Excluir CRM","kanban.confirmDeleteStage":"Tem certeza? Os chats serão movidos para a caixa de entrada.","kanban.cannotDeleteInbox":"Não é possível excluir a etapa da caixa de entrada.","kanban.cannotAddStagesLabels":"Não é possível adicionar etapas ao CRM de Etiquetas. As etiquetas são sincronizadas do WhatsApp.","kanban.chatsLoadedSuccess":"Chats carregados com sucesso!","kanban.failedLoadChats":"Falha ao carregar chats. Certifique-se de estar no WhatsApp Web.","kanban.noAvailableChats":"Nenhum chat disponível.","kanban.enterNewCRMName":"Digite o novo nome do CRM:","kanban.name":"Nome","kanban.phone":"Telefone","kanban.lastMessage":"Última Mensagem","kanban.noMessages":"Sem mensagens","kanban.unreadCount":"Não lidos","kanban.type":"Tipo","kanban.groupChat":"Chat de Grupo","kanban.individualChat":"Chat Individual","kanban.status":"Status","kanban.dealValue":"Valor do Negócio (R$)","kanban.enterDealValue":"Digite o valor","kanban.notes":"Notas","kanban.addNotes":"Adicionar notas sobre este chat...","kanban.justNow":"Agora","kanban.group":"Grupo","kanban.muted":"Silenciado","kanban.save":"Salvar","kanban.cancel":"Cancelar","kanban.close":"Fechar","kanban.analyticsTitle":"Painel de Análises","kanban.analyticsSubtitle":"Métricas de desempenho do pipeline","kanban.exportCSV":"Exportar CSV","kanban.exportPDF":"Exportar PDF","kanban.noAnalyticsData":"Nenhum dado de análise","kanban.from":"De:","kanban.to":"Até:","kanban.totalChats":"Total de Chats","kanban.pipelineValue":"Valor do Pipeline","kanban.activeStages":"Etapas ativas do pipeline","kanban.stagePerformance":"Desempenho por Etapa","kanban.stage":"Etapa","kanban.value":"Valor","kanban.avgTime":"Tempo Méd.","kanban.conversion":"Conversão","kanban.chatDistribution":"Distribuição de Chats","kanban.allTime":"Todo o período","kanban.today":"Hoje","kanban.last7Days":"Últimos 7 dias","kanban.last30Days":"Últimos 30 dias","kanban.allowPopups":"Por favor, permita popups para exportar PDF","kanban.addSampleChat":"Adicionar Chat de Exemplo","kanban.crmName":"Nome do CRM","kanban.stageName":"Nome da Etapa","kanban.saveChanges":"Salvar Alterações","kanban.createFirstCRM":"Crie seu primeiro CRM para começar a organizar seus chats do WhatsApp.","kanban.noStagesFound":"Nenhuma etapa encontrada neste CRM.","kanban.syncOrAddStages":"Sincronize dados do WhatsApp ou adicione etapas personalizadas.","kanban.chatDetails":"Detalhes do Chat","kanban.notAvailable":"N/D","kanban.addNotesPlaceholder":"Adicionar notas sobre este chat...","kanban.thisWeek":"esta semana","kanban.avg":"Méd","kanban.stagesLabel":"Etapas","kanban.activePipelineStages":"Etapas do pipeline ativas","kanban.customRange":"Intervalo Personalizado","kanban.dateRange":"Intervalo de Datas","kanban.confirmDeleteCrm":"Tem certeza de que deseja excluir este CRM? Todas as etapas e chats serão removidos.","kanban.openInWhatsApp":"Abrir no WhatsApp","kanban.removeFromStage":"Remover da etapa","kanban.openCRM":"Abrir CRM","kanban.addNote":"Adicionar Nota","kanban.scheduleMessage":"Agendar Mensagem","kanban.addIncome":"Adicionar Renda","kanban.whatsappNotOpen":"WhatsApp Web não está aberto. Por favor, abra o WhatsApp Web primeiro.","kanban.failedToOpenChat":"Falha ao abrir chat no WhatsApp","kanban.removeFromStageConfirm":"Tem certeza de que deseja remover este chat da etapa atual?","kanban.failedToRemove":"Falha ao remover chat da etapa","kanban.failedToOpenCRM":"Falha ao abrir CRM","kanban.chatPopup":"Chat","kanban.typeMessage":"Digite uma mensagem...","kanban.sendMessage":"Enviar","kanban.loadingMessages":"Carregando mensagens...","kanban.failedToLoadMessages":"Falha ao carregar mensagens","kanban.failedToSendMessage":"Falha ao enviar mensagem","kanban.yesterday":"Ontem","kanban.refresh":"Atualizar","kanban.loadingMedia":"Carregando...","kanban.clickToLoad":"Clique para carregar","kanban.addToStage":"Adicionar ao Estágio CRM","kanban.selectCrmStage":"Selecionar CRM e Estágio","kanban.retry":"Tentar novamente","kanban.attach":"Anexar arquivo","kanban.addCaption":"Adicionar legenda...","kanban.audioMessage":"Mensagem de áudio","kanban.document":"Documento","kanban.location":"Localização","kanban.contact":"Contato","kanban.quickReply":"Resposta Rápida","kanban.fluxo":"Fluxo","kanban.more":"mais","kanban.showLess":"Mostrar menos","kanban.noQuickReplies":"Sem respostas rápidas","kanban.noFluxos":"Sem fluxos ativos","kanban.users":"Usuários","kanban.usersBreakdown":"Detalhamento por Usuário","kanban.searchUsers":"Pesquisar usuários por nome ou número...","kanban.noUsersFound":"Nenhum usuário encontrado","kanban.tryDifferentSearch":"Tente um termo de pesquisa diferente","kanban.crm":"CRM","kanban.tabs":"Abas","kanban.labels":"Etiquetas","kanban.crmBreakdown":"Detalhamento por Etapa CRM","kanban.tabsBreakdown":"Detalhamento por Abas","kanban.labelsBreakdown":"Detalhamento por Etiquetas","kanban.noDataFound":"Nenhum dado encontrado","kanban.addDataToSeeAnalytics":"Adicione dados de receita/despesa aos contatos para ver análises","kanban.incomeVsExpense":"Receita vs Despesa por","kanban.contacts":"contatos","kanban.netProfit":"LUCRO LÍQUIDO","kanban.crmProfit":"Lucro CRM","kanban.tabsProfit":"Lucro Abas","kanban.labelsProfit":"Lucro Etiquetas","kanban.profitDistribution":"Distribuição de Lucros","kanban.sourceComparison":"Comparação de Fontes","kanban.totalContacts":"Contatos Totais","kanban.avgPerSource":"Média por Fonte","kanban.loadingMore":"Carregando mais...","kanban.allChatsLoaded":"Todos os chats carregados","kanban.dragToReorder":"Arraste para reordenar","crm.categoryBreakdown":"Detalhamento por Categoria","crm.incomeByCategory":"Receita por Categoria","crm.expenseByCategory":"Despesa por Categoria","crm.paymentMethodBreakdown":"Detalhamento por Método de Pagamento","crm.incomeByPayment":"Receita por Método de Pagamento","crm.expenseByPayment":"Despesa por Método de Pagamento","crm.userWiseBreakdown":"Detalhamento por Usuário","crm.net":"Líquido","crm.transactions":"Transações","crm.margin":"Margem","crm.netProfit":"Lucro Líquido","chart.income":"Receita","chart.expense":"Despesa","chart.profit":"Lucro","chart.noDataAvailable":"Nenhum dado disponível","chart.noProfitData":"Nenhum dado de lucro disponível","chart.noTrendData":"Nenhum dado de tendência disponível","bulkValidator.title":"Validador de Números em Massa","bulkValidator.subtitle":"Valide números do WhatsApp em massa com campanhas","bulkValidator.menu":"Menu","bulkValidator.activeCampaigns":"Campanhas Ativas","bulkValidator.completed":"Concluídas","bulkValidator.noActiveCampaigns":"Nenhuma campanha ativa. Inicie uma nova para validar números.","bulkValidator.noCompleted":"Ainda não há campanhas concluídas.","bulkValidator.createHint":"Envie um CSV de números e inicie uma validação.","bulkValidator.newCampaign":"Nova Campanha de Validação","bulkValidator.createCampaign":"Criar Nova Campanha","bulkValidator.campaignName":"Nome da Campanha","bulkValidator.enterCampaignName":"Digite o nome da campanha","bulkValidator.countryCode":"Código do País","bulkValidator.countryCodeHint":"Selecione o código do país para números sem prefixo","bulkValidator.uploadCSV":"Carregar Arquivo CSV","bulkValidator.csvHint":"Arquivo CSV com números de telefone (um por linha ou separados por vírgula)","bulkValidator.numbersFound":"números encontrados","bulkValidator.enterNameAndUpload":"Por favor, digite o nome da campanha e carregue os números","bulkValidator.createAndStart":"Criar Campanha","bulkValidator.campaigns":"Campanhas","bulkValidator.noCampaigns":"Nenhuma campanha ainda. Crie uma para começar a validar números.","bulkValidator.confirmDelete":"Tem certeza de que deseja excluir esta campanha?","bulkValidator.valid":"Válido","bulkValidator.invalid":"Inválido","bulkValidator.pending":"Pendente","bulkValidator.start":"Iniciar","bulkValidator.pause":"Pausar","bulkValidator.downloadValid":"Baixar Números Válidos","bulkValidator.downloadInvalid":"Baixar Números Inválidos","bulkValidator.downloadAll":"Baixar Todos","bulkValidator.all":"Todos","tools.allTools":"Todas as Ferramentas","tools.subtitle":"Click to open • Drag to header to pin","tools.featureSettings":"Configurações de Recursos","tools.pinnedTooltip":"Fixado no cabeçalho (arraste para Ferramentas para desafixar)","tools.itemTooltip":"{name} — clique para abrir ou arraste para o cabeçalho para fixar","tools.category.communication":"Comunicação","tools.category.management":"Gerenciamento","tools.category.automation":"Automação","tools.category.validation":"Validação","webhook.title":"Webhooks","webhook.subtitle":"Enviar dados de contato para outro aplicativo após a execução de eventos registrados","webhook.events":"eventos","webhook.quickResponses":"Respostas Rápidas","webhook.appointment":"Agendamento","webhook.reminder":"Lembrete","webhook.contactProfile":"Perfil de Contato","webhook.notes":"Notas","webhook.income":"Receita","webhook.expense":"Despesa","webhook.kanban":"Kanban","webhook.labels":"Etiquetas","webhook.customTabs":"Abas Personalizadas","webhook.messages":"Mensagens","webhook.todos":"Lista de Tarefas","webhook.webhookData":"Dados do WebHook","webhook.webhookUrl":"URL do WebHook","webhook.enterUrl":"Digite a URL de destino aqui","webhook.active":"Ativo","webhook.dataToSend":"Dados para enviar","webhook.lastUploads":"Últimos envios (máximo 30 visualizações)","webhook.noUploads":"Nenhum envio ainda","webhook.close":"Fechar","webhook.save":"Salvar","webhook.saving":"Salvando...","webhook.field.eventDetails":"Detalhes do Evento","webhook.field.number":"Número","webhook.field.name":"Nome","webhook.field.picture":"Foto","webhook.field.labels":"Etiquetas","webhook.field.contactProfile":"Perfil de Contato","webhook.field.appointmentTime":"Horário do Agendamento","webhook.field.meetingLink":"Link da Reunião","webhook.field.reminderTopic":"Tópico do Lembrete","webhook.field.reminderTime":"Horário do Lembrete","webhook.field.reminderDetails":"Detalhes do Lembrete","webhook.field.email":"E-mail","webhook.field.gender":"Gênero","webhook.field.dateOfBirth":"Data de Nascimento","webhook.field.address":"Endereço","webhook.field.details":"Detalhes","webhook.field.customFields":"Campos Personalizados","webhook.field.noteTopic":"Tópico da Nota","webhook.field.noteContent":"Conteúdo da Nota","webhook.field.noteTimestamp":"Carimbo de Data/Hora da Nota","webhook.field.amount":"Valor","webhook.field.category":"Categoria","webhook.field.paymentMethod":"Método de Pagamento","webhook.field.description":"Descrição","webhook.field.reference":"Referência/Fatura","webhook.field.referenceBill":"Referência/Conta","webhook.field.transactionDate":"Data da Transação","webhook.field.status":"Status","webhook.field.cardTitle":"Título do Cartão","webhook.field.columnName":"Coluna/Estágio","webhook.field.cardDescription":"Descrição do Cartão","webhook.field.labelId":"ID da Etiqueta","webhook.field.labelName":"Nome da Etiqueta","webhook.field.labelColor":"Cor da Etiqueta","webhook.field.allLabels":"Todas as Etiquetas do Contato","webhook.field.tabId":"ID da Aba","webhook.field.tabName":"Nome da Aba","webhook.field.tabColor":"Cor da Aba","webhook.field.allTabs":"Todas as Abas do Contato","webhook.field.direction":"Direção (entrada/saída)","webhook.field.messageContent":"Conteúdo da Mensagem","webhook.field.messageType":"Tipo de Mensagem","webhook.field.messageId":"ID da Mensagem","webhook.field.mediaUrl":"URL da Mídia","webhook.field.quotedMessage":"Mensagem Citada","webhook.field.timestamp":"Carimbo de Data/Hora","webhook.field.ctwaData":"Dados de Meta Ads (CTWA)","webhook.field.todoTitle":"Título da Tarefa","webhook.field.todoDescription":"Descrição da Tarefa","webhook.field.todoDueDate":"Data de Vencimento","webhook.field.todoPriority":"Prioridade","webhook.field.todoCategory":"Categoria","webhook.field.todoStatus":"Status","webhook.field.todoSubtasks":"Subtarefas","api.configureAPI":"Configurar API","api.manageToken":"Gerencie seu token de API e configurações","api.apiToken":"Token de API","api.generateToken":"Gerar Token","api.regenerate":"Regenerar","api.generating":"Gerando...","api.copyToken":"Copiar token","api.tokenWarning":"Mantenha este token em segredo. Qualquer pessoa com acesso pode enviar mensagens em seu nome.","api.enableAPI":"Habilitar API","api.apiIsEnabled":"API está atualmente habilitada","api.apiIsDisabled":"API está atualmente desabilitada","api.openDocumentation":"Abrir Documentação","api.queuePolling":"Sondagem de Fila","api.pollingActive":"Verificando mensagens na fila a cada 5 minutos","api.pollingInactive":"Habilitar para processar mensagens API recebidas","audioTranscribe.title":"Transcrição","audioTranscribe.transcribeAudio":"Transcrever áudio","audioTranscribe.copy":"Copiar","audioTranscribe.copied":"Copiado!","audioTranscribe.translate":"Traduzir","audioTranscribe.translating":"Traduzindo...","audioTranscribe.translated":"Traduzido!","audioTranscribe.original":"Original:","audioTranscribe.translatedLabel":"Traduzido","audioTranscribe.close":"Fechar","audioTranscribe.requiresChatGPT":"A transcrição de áudio requer chave API do ChatGPT. Configure o ChatGPT como seu provedor de IA nas configurações.","audioTranscribe.audioNotFound":"Não foi possível encontrar a URL do áudio. O áudio pode não estar disponível.","audioTranscribe.transcriptionFailed":"Falha na transcrição","audioTranscribe.configureAI":"Configure primeiro as configurações de IA para usar a tradução.","audioTranscribe.translationFailed":"Falha na tradução","audioTranscribe.translationTimeout":"Tempo limite de tradução esgotado. Tente novamente.","aiBot.title":"Bot de IA","aiBot.tab.testChat":"Chat de teste","aiBot.tab.qaPairs":"Pares de Perguntas e Respostas","aiBot.tab.aiBehavior":"Comportamento da IA","aiBot.tab.trainingData":"Dados de treinamento","aiBot.tab.escalation":"Escalonamento","aiBot.tab.dataPreview":"Visualização de dados","aiBot.tab.trainingDataComingSoon":"Upload de documentos, scraping de URL e fontes de texto simples chegarão na próxima atualização.","aiBot.tab.escalationComingSoon":"A transferência automática para um humano após um número configurável de mensagens não respondidas chegará na próxima atualização.","aiBot.tab.dataPreviewComingSoon":"Uma visão somente leitura de cada par de Perguntas e Respostas, fonte e fragmento ao qual a IA tem acesso.","aiBot.comingSoon":"Em breve","aiBot.qa.addPair":"Adicionar par","aiBot.qa.editPair":"Editar par","aiBot.qa.questionLabel":"Pergunta","aiBot.qa.questionPlaceholder":"What customers might ask…","aiBot.qa.answerLabel":"Resposta","aiBot.qa.answerPlaceholder":"How the AI should reply…","aiBot.qa.categoryLabel":"Categoria (opcional)","aiBot.qa.categoryPlaceholder":"ex. Preços, Suporte, Onboarding","aiBot.qa.existingPairs":"Pares existentes","aiBot.qa.empty":"Ainda sem pares. Adicione o primeiro acima.","aiBot.qa.cancel":"Cancelar","aiBot.qa.update":"Atualizar","aiBot.qa.delete":"Excluir","aiBot.qa.edit":"Editar","aiBot.qa.enabled":"Ativado","aiBot.qa.disabled":"Desativado","aiBot.qa.on":"Lig.","aiBot.qa.off":"Desl.","aiBot.qa.deleteConfirm":"Excluir este par?","aiBot.qa.itemSingular":"par","aiBot.qa.itemPlural":"pares","aiBot.behavior.triggerWords":"Palavras-gatilho","aiBot.behavior.triggerWordsPlaceholder":"suporte, ajuda, demo (separadas por vírgulas)","aiBot.behavior.triggerWordsHelp":"Quando definidas, o bot responde apenas a mensagens que contenham pelo menos uma destas palavras. Deixe vazio para responder a tudo.","aiBot.behavior.responseSettings":"Configurações de resposta","aiBot.behavior.responseTone":"Tom da resposta","aiBot.behavior.maxResponseLength":"Comprimento máximo da resposta","aiBot.behavior.temperature":"Temperatura","aiBot.behavior.temperatureHelp":"Mais baixa = mais focada. Mais alta = mais criativa.","aiBot.behavior.maxTokens":"Tokens máx.","aiBot.behavior.maxTokensHelp":"Limita o tamanho da resposta da IA.","aiBot.behavior.systemPrompt":"Contexto comercial / Prompt do sistema","aiBot.behavior.systemPromptPlaceholder":"Tell the AI about your business, products, and how it should represent you…","aiBot.behavior.systemPromptHelp":"Usado como instrução fundamental para cada resposta da IA.","aiBot.behavior.fallbackMessage":"Mensagem de fallback","aiBot.behavior.fallbackMessageHelp":"Enviada quando a IA não tem um par de Perguntas e Respostas, fonte ou conhecimento geral relevante para responder.","aiBot.behavior.saved":"✓ Saved","aiBot.behavior.saveBehavior":"Salvar comportamento","aiBot.behavior.tone_friendly":"Amigável","aiBot.behavior.tone_professional":"Profissional","aiBot.behavior.tone_casual":"Casual","aiBot.behavior.tone_formal":"Formal","aiBot.behavior.tone_empathetic":"Empático","aiBot.behavior.length_short":"Curta (~50 palavras)","aiBot.behavior.length_medium":"Média (~200 palavras)","aiBot.behavior.length_long":"Longa (~400 palavras)","aiBot.kb.urlTitle":"Adicionar URL do site","aiBot.kb.urlPlaceholder":"https://exemplo.com/sobre","aiBot.kb.addUrl":"Adicionar URL","aiBot.kb.scraping":"Scraping…","aiBot.kb.urlHelp":"We fetch the page and extract its visible text. Single-page only — JS-rendered SPAs may return little content.","aiBot.kb.errorEmpty":"Nenhum texto legível encontrado nessa URL.","aiBot.kb.errorBlocked":'Could not reach that URL. The site may block automated requests, require login, or be JS-rendered. Try copying the text into "Paste Plain Text" below.',"aiBot.kb.blockedChromeStore":'Chrome Web Store blocks automated requests. Open the listing in your browser, copy the description text, and paste it into "Paste Plain Text" below.',"aiBot.kb.blockedGoogle":"Páginas do Google Docs / Drive / Sheets exigem login e não podem ser extraídas. Exporte para PDF/DOCX/TXT e faça o upload.","aiBot.kb.blockedSocial":'Social networks block automated requests. Copy the relevant text and paste it into "Paste Plain Text" below.',"aiBot.kb.blockedNotion":"Páginas do Notion são renderizadas em JS e retornam pouco texto. Exporte a página como Markdown/PDF e faça o upload.","aiBot.kb.plainTextTitle":"Colar texto simples","aiBot.kb.textTitlePlaceholder":'Title (optional, e.g. "Refund Policy")',"aiBot.kb.textBodyPlaceholder":"Paste any text the AI should know about — pricing, FAQs, policies, instructions…","aiBot.kb.charsLabel":"caracteres","aiBot.kb.saveText":"Salvar texto","aiBot.kb.saving":"Saving…","aiBot.kb.trainingSources":"Fontes de treinamento","aiBot.kb.sourceSingular":"fonte","aiBot.kb.sourcePlural":"fontes","aiBot.kb.chunkSingular":"fragmento","aiBot.kb.chunkPlural":"fragmentos","aiBot.kb.empty":"Ainda sem fontes de treinamento. Adicione uma URL ou cole texto simples acima.","aiBot.kb.deleteConfirm":"Excluir esta fonte?","aiBot.esc.enableAuto":"Ativar escalonamento automático","aiBot.esc.enableAutoDesc":"Transferir automaticamente para um humano quando a IA não puder ajudar ou o cliente pedir.","aiBot.esc.maxAttempts":"Máx. de tentativas falhadas","aiBot.esc.maxAttemptsHelp":"Transferir após este número de respostas de fallback consecutivas (janela de 24h).","aiBot.esc.triggerPhrases":"Frases-gatilho (uma por linha)","aiBot.esc.triggerPhrasesHelp":"Quando qualquer uma destas frases aparece numa mensagem recebida, o bot escalona imediatamente. Correspondência de subcadeia sem distinção de maiúsculas.","aiBot.esc.message":"Mensagem de escalonamento","aiBot.esc.messageHelp":"Enviada ao cliente logo antes de o bot parar de responder para que um humano possa assumir.","aiBot.esc.saveRules":"Salvar regras de escalonamento","aiBot.esc.statusOn":"Ativado","aiBot.esc.statusOff":"Desativado","aiBot.preview.qaPairsLabel":"Pares de Perguntas e Respostas","aiBot.preview.sourcesLabel":"Fontes","aiBot.preview.chunksLabel":"Fragmentos","aiBot.preview.helpText":"Isto é exatamente ao que a IA tem acesso agora. Itens desativados não são usados.","aiBot.preview.escalationSummary":"Escalonamento","aiBot.preview.escStatus":"Status","aiBot.preview.escThreshold":"Após","aiBot.preview.escFailed":"respostas de fallback consecutivas","aiBot.preview.escPhrases":"Frases-gatilho","aiBot.preview.escNoPhrases":"nenhuma","aiBot.preview.qaPairsTitle":"Pares de Perguntas e Respostas","aiBot.preview.sourcesTitle":"Fontes de treinamento","aiBot.preview.noQa":"Sem pares ativados.","aiBot.preview.noSources":"Sem fontes ativadas.","aiBot.kb.uploadTitle":"Carregar documentos","aiBot.kb.uploadPrompt":"Clique para escolher um arquivo, ou arraste e solte aqui","aiBot.kb.uploadFormats":"PDF, DOCX, TXT, CSV, MD","aiBot.kb.uploadMaxSize":"Máx. 10 MB por arquivo","aiBot.kb.parsing":"Parsing…","aiBot.kb.parsingFile":"Processando","aiBot.behavior.providerConfig":"Provedor de IA","aiBot.behavior.provider":"Provedor","aiBot.behavior.model":"Modelo","aiBot.behavior.apiActive":"API ativa","aiBot.behavior.noApiKey":"Sem chave de API","aiBot.behavior.apiKeyHint":"Adicione sua chave de API nas configurações de Ferramentas de IA para ativar o bot.","aiBot.tab.actionPrompts":"Prompts de ação","aiBot.tab.scheduleTiming":"Horário e tempo","aiBot.fallbackMoved":"A resposta de fallback foi movida para a aba Comportamento da IA. Sua mensagem existente é preservada automaticamente.","aiBot.businessPromptMoved":"Business Prompt has moved to the AI Behavior tab. Edit it there — your existing prompt is preserved.","aiBot.generalKnowledgeMoved":'"Allow AI to use General Knowledge" toggle has moved to the AI Behavior tab.',"aiBot.stopKeywordsRecommend":"For new setups we recommend the Escalation tab — it adds an attempt counter and trigger phrases on top of keyword stops. This section still works for keyword-only stops.","aiBot.subtitle":"Configurar respostas automáticas de IA","aiBot.menu":"Menu","aiBot.enableBot":"Ativar Bot de IA","aiBot.enableBotDesc":"Responder automaticamente a mensagens recebidas","aiBot.replyInGroups":"Responder em Grupos","aiBot.replyInGroupsDesc":"Permitir que o Bot de IA responda em chats de grupo (desativado por padrão)","aiBot.allowGeneralKnowledge":"Permitir IA usar Conhecimento Geral","aiBot.allowGeneralKnowledgeDesc":"Quando DESLIGADO, a IA responde apenas com base no seu prompt de negócio. Quando LIGADO, a IA também pode usar seu conhecimento geral.","aiBot.fallbackReply":"Resposta de Reserva","aiBot.fallbackReplyDesc":"Quando a IA não tem informação no seu prompt de negócio, enviará esta resposta em vez de inventar respostas.","aiBot.fallbackReplyPlaceholder":"Exemplo: Obrigado pela sua pergunta! Não tenho informações específicas sobre isso no momento. Nossa equipe entrará em contato em breve.","aiBot.smartDetection":"Detecção Inteligente","aiBot.smartDetectionDesc":"A IA detecta automaticamente frustração ou pedidos de assistência humana","aiBot.monday":"Segunda-feira","aiBot.tuesday":"Terça-feira","aiBot.wednesday":"Quarta-feira","aiBot.thursday":"Quinta-feira","aiBot.friday":"Sexta-feira","aiBot.saturday":"Sábado","aiBot.sunday":"Domingo","aiBot.enableWeekdays":"Ativar dias úteis","aiBot.disableWeekdays":"Desativar dias úteis","aiBot.enableWeekends":"Ativar fins de semana","aiBot.disableWeekends":"Desativar fins de semana","aiBot.applyToAll":"Aplicar a todos:","aiBot.apply":"Aplicar","aiBot.day":"Dia","aiBot.active":"Ativo","aiBot.currentStatus":"Status atual:","aiBot.botOffToday":"Bot está DESLIGADO hoje","aiBot.businessPrompt":"Prompt de Negócio","aiBot.businessPromptDesc":"Personalize como a IA responde. Descreva seu negócio, tom e diretrizes.","aiBot.businessPromptPlaceholder":"Exemplo: Você é um representante de atendimento ao cliente da [Nome da Empresa]. Vendemos [produto/serviço]. Seja amigável e profissional.","aiBot.schedule":"Horário do Bot","aiBot.scheduleEnabled":"Ativar agendamento","aiBot.scheduleEnabledDesc":"Bot responde apenas durante dias e horários definidos","aiBot.startTime":"Hora de início","aiBot.endTime":"Hora de término","aiBot.to":"até","aiBot.timezone":"Fuso horário","aiBot.replyTiming":"Tempo de resposta","aiBot.replyTimingDesc":"Atraso aleatório antes da resposta da IA","aiBot.minDelay":"Atraso mín. (seg.)","aiBot.maxDelay":"Atraso máx. (seg.)","aiBot.enabledActions":"Ações ativadas","aiBot.enabledActionsDesc":"Escolha quais ações a IA pode executar","aiBot.actionNormalReply":"Enviar resposta","aiBot.actionNormalReplyDesc":"IA envia mensagens de texto","aiBot.actionKanban":"Atualizar Kanban","aiBot.actionKanbanDesc":"Mover contatos entre estágios Kanban","aiBot.actionLabels":"Atualizar etiquetas","aiBot.actionLabelsDesc":"Adicionar/remover etiquetas do WhatsApp","aiBot.actionTabs":"Atualizar abas","aiBot.actionTabsDesc":"Adicionar/remover de abas personalizadas","aiBot.actionAppointment":"Criar compromisso","aiBot.actionAppointmentDesc":"Agendar compromissos a partir de conversas","aiBot.tabsPromptLabel":"Instruções personalizadas para gerenciamento de abas:","aiBot.tabsPromptPlaceholder":'E.g., If user asks about SEO services, add to "SEO Leads" tab. If user mentions web development, add to "Web Dev Leads" tab.',"aiBot.meetingLinkLabel":"Link do Google Meet:","aiBot.meetingLinkPlaceholder":"https://meet.google.com/xxx-xxxx-xxx","aiBot.meetingLinkDesc":"Este link será usado para todos os compromissos criados pela IA","aiBot.messageTemplateLabel":"Modelo de mensagem:","aiBot.messageTemplateDesc":"Esta mensagem será enviada como lembrete de compromisso","aiBot.varName":"Nome","aiBot.varDate":"Data","aiBot.varTime":"Hora","aiBot.varLink":"Link","aiBot.messageTemplatePlaceholder":"Olá {name}, seu compromisso está agendado para {date} às {time}. Entre aqui: {link}","aiBot.officeHoursLabel":"Horário comercial (Horários de compromisso):","aiBot.officeHoursDesc":"A IA só agendará compromissos dentro desses horários","aiBot.sendMessageNow":"Enviar mensagem imediatamente","aiBot.sendMessageNowDesc":"Enviar mensagem do compromisso logo após criar","aiBot.appointmentPromptLabel":"Instruções personalizadas da IA:","aiBot.appointmentPromptPlaceholder":"Ex: Ao agendar compromissos, sempre sugerir horários entre 10h - 18h...","aiBot.actionProfile":"Atualizar perfil","aiBot.actionProfileDesc":"Extrair e salvar informações de contato","aiBot.contextMessages":"Mensagens de contexto","aiBot.contextMessagesDesc":"Número de mensagens anteriores para contexto da IA","aiBot.settingsTab":"Configurações","aiBot.promptSettings":"Config. de Prompt","aiBot.actionPrompts":"Prompts de Ações","aiBot.actionPromptsDesc":"Configure prompts personalizados para diferentes ações de IA","aiBot.talkToAI":"Falar com IA","aiBot.testYourBot":"Teste seu Bot de IA","aiBot.testDescription":"As mensagens usam as configurações atuais (incluindo alterações não salvas)","aiBot.clearChat":"Limpar Chat","aiBot.typeTestMessage":"Digite uma mensagem de teste...","aiBot.aiTyping":"IA está digitando...","aiBot.noMessages":"Digite uma mensagem para testar como seu Bot de IA responderá","aiBot.send":"Enviar","aiBot.copy":"Copiar","aiBot.copied":"Copiado!","aiBot.select":"Selecionar","aiBot.aiNotConfigured":"IA não configurada. Configure a chave API de IA primeiro.","aiBot.noResponse":"Sem resposta da IA","aiBot.stopKeywords":"Palavras de Parada","aiBot.stopKeywordsInfo":"Quando o cliente envia qualquer uma dessas palavras, o Bot de IA parará de responder e o colocará na lista negra.","aiBot.enableStopKeywords":"Habilitar Palavras de Parada","aiBot.enableStopKeywordsDesc":"Parar automaticamente o Bot de IA quando o cliente solicitar assistência humana","aiBot.keywords":"Palavras-chave","aiBot.noKeywords":"Nenhuma palavra-chave adicionada ainda","aiBot.enterKeyword":"Digite a palavra-chave...","aiBot.add":"+ Adicionar","aiBot.stopMessage":"Mensagem de Parada","aiBot.stopMessagePlaceholder":"Mensagem enviada quando palavra de parada é detectada...","aiBot.stopMessageHint":"Esta mensagem será enviada ao cliente quando uma palavra de parada for detectada.","aiBot.responseMode":"Modo de Resposta:","aiBot.aiBotPrompt":"Prompt do Bot IA","aiBot.globalChatGPT":"ChatGPT Global","aiBot.newChat":"Nova Conversa","aiBot.clearAll":"Limpar Tudo","aiBot.searchChats":"Pesquisar conversas...","aiBot.noSearchResults":"Nenhuma conversa encontrada","aiBot.noChatsYet":"Ainda não há histórico de conversas","aiBot.deleteChat":"Excluir conversa","aiBot.chatsStored":"conversas salvas","aiBot.clearAllTitle":"Limpar Todas as Conversas?","aiBot.clearAllDesc":"Isso excluirá permanentemente todo o seu histórico de conversas. Esta ação não pode ser desfeita.","aiBot.messages":"mensagens","aiBot.today":"Hoje","aiBot.yesterday":"Ontem","crm.aiBotBlacklist":"Bot de IA","crm.aiBotEnabled":"Ativado para este contato","crm.aiBotDisabled":"Desativado para este contato","common.saved":"Salvo","crm.chatbotFlow":"Fluxo de Chatbot","crm.chatbotFlowDesc":"Crie bots de resposta automática por palavras-chave","crm.createNewFlow":"Criar novo fluxo","crm.noFlowsYet":"Nenhum fluxo ainda","crm.createFirstFlow":"Crie seu primeiro fluxo de chatbot","crm.active":"Ativo","crm.inactive":"Inativo","crm.flowName":"Nome do Fluxo","crm.untitledFlow":"Fluxo sem título","crm.duplicate":"Duplicar","crm.triggers":"Gatilhos","crm.actions":"Ações","crm.rules":"Regras","crm.anyMessage":"Qualquer mensagem","crm.keywords":"Palavras-chave","crm.addKeyword":"Adicionar palavra-chave","crm.firstMessageOfDay":"Primeira mensagem do dia","crm.firstMessageEver":"Primeira mensagem de sempre","crm.sendText":"Enviar Texto","crm.sendTextDesc":"Enviar uma mensagem de texto.","crm.sendImage":"Enviar Imagem","crm.sendImageDesc":"Enviar uma imagem com legenda.","crm.sendVideo":"Enviar Vídeo","crm.sendVideoDesc":"Enviar um vídeo com legenda.","crm.sendAudio":"Enviar Áudio","crm.sendAudioDesc":"Enviar um arquivo de áudio.","crm.sendDocument":"Enviar Documento","crm.sendDocumentDesc":"Enviar um arquivo de documento.","crm.responses":"Respostas","crm.responsesDesc":"Aguardar resposta do usuário e ramificar o fluxo.","crm.sendList":"Enviar Lista","crm.sendListDesc":"Enviar uma mensagem de lista interativa.","fluxo.waitInput":"Aguardar Entrada","fluxo.waitInputDesc":"Aguardar resposta validada do usuário","fluxo.promptMessage":"Mensagem de Solicitação","fluxo.enterPromptMessage":"Digite a solicitação para pedir entrada do usuário...","fluxo.inputType":"Tipo de Entrada (Validação)","fluxo.inputTypeString":"Texto (Qualquer)","fluxo.inputTypePhone":"Número de Telefone","fluxo.inputTypeNumber":"Número","fluxo.inputTypeEmail":"E-mail","fluxo.inputTypeUrl":"URL","fluxo.inputTypeDatetime":"Data/Hora","fluxo.phoneHint":"Formato: +5511987654321 (com código do país)","fluxo.emailHint":"Formato: user@example.com","fluxo.numberHint":"Aceita inteiros e decimais","fluxo.urlHint":"Formato: https://example.com","fluxo.datetimeHint":"Formato: AAAA-MM-DD ou AAAA-MM-DDTHH:MM","fluxo.stringHint":"Aceita qualquer entrada de texto","fluxo.saveResponseAs":"Salvar Resposta como Variável","fluxo.variableName":"userInput","fluxo.useVariableHint":"Use {variableName} em mensagens posteriores","fluxo.errorMessage":"Mensagem de Erro (em entrada inválida)","fluxo.invalidInputDefault":"Entrada inválida. Por favor, tente novamente.","fluxo.timeout":"Tempo Limite","fluxo.seconds":"Segundos","fluxo.minutes":"Minutos","fluxo.hours":"Horas","fluxo.timeoutHint":"Se nenhuma resposta válida neste tempo, o ramo de timeout será executado.","fluxo.customRegex":"Regex Personalizado (Opcional)","fluxo.regexPlaceholder":"^[A-Z]{2}[0-9]{4}$","fluxo.customRegexHint":"Substitui validação do tipo de entrada com padrão personalizado","fluxo.outputConnections":"Conexões de Saída","fluxo.response":"resposta","fluxo.validInputReceived":"Quando entrada válida é recebida","fluxo.noResponseTimeout":"Quando o timeout expira sem resposta válida","fluxo.validResponse":"Resposta Válida","fluxo.onInvalidInput":"Se inválido:","fluxo.responseTimeout":"Response timeout (minutes):","fluxo.responseTimeoutHint":'When both "Call next block" and "When responding" are connected, how long to wait for user response. Default: 5 minutes',"fluxo.promptMessageInfo":"A mensagem enviada ao usuário solicitando sua entrada. Será exibida antes de aguardar a resposta.","fluxo.inputTypeInfo":"Selecione o tipo de entrada esperado. O sistema validará a resposta do usuário conforme este formato.","fluxo.saveResponseAsInfo":"O nome da variável para armazenar a resposta válida do usuário. Use {nomeVariavel} em mensagens posteriores para exibir este valor.","fluxo.errorMessageInfo":"Mensagem enviada ao usuário quando sua entrada não corresponde ao formato esperado. Será solicitado que tente novamente.","fluxo.timeoutInfo":"Tempo máximo de espera por uma resposta válida. Se excedido, o ramo de timeout é executado em vez do ramo de resposta.","fluxo.customRegexInfo":"Avançado: Forneça um padrão regex personalizado para validar a entrada. Isto substitui a validação do tipo de entrada selecionado.","fluxo.delayInfo":"Tempo de espera em segundos antes de enviar a mensagem de solicitação. Útil para um fluxo de conversa natural.","crm.groupAction":"Ação de Grupo","crm.tabAction":"Ação de Aba","crm.labelAction":"Ação de Rótulo","crm.crmAction":"Ação CRM","crm.smartWait":"Espera Inteligente","crm.smartWaitDesc":"Aguardar um tempo aleatório entre mensagens","crm.typingIndicator":"Indicador de Digitação","crm.typingIndicatorDesc":"Mostrar bolha de digitação antes de enviar","crm.waitDuration":"Duração da Espera:","crm.typingDuration":"Duração da Digitação:","crm.randomDelay":"Atraso Aleatório:","crm.randomDelayBetween":"Atraso aleatório entre","crm.randomBetween":"Atraso aleatório entre","crm.showsTypingFor":"Mostra indicador de digitação por","crm.showsTyping":"Mostra digitação por","crm.typingPreview":"É assim que o indicador de digitação aparece para o contato","crm.addFluxo":"Adicionar Fluxo","crm.addFluxoDesc":"Executar outro fluxo","crm.selectFlowToCall":"Selecionar fluxo para executar:","crm.noFlowSelected":"Nenhum fluxo selecionado","crm.passVariables":"Passar variáveis para o fluxo chamado","crm.passVariablesHint":"Variáveis do fluxo atual estarão disponíveis no fluxo chamado","crm.passVariablesUseCase":'💡 Use Case: Main flow has {name}="Rahul" → Sub-flow message "Hi {name}!" → Shows "Hi Rahul!". Turn OFF for sub-flow to start fresh without variables.',"crm.passVariablesShort":"Passar vars","crm.continueAfterFlow":"Continuar após o término do fluxo chamado","crm.continueAfterFlowHint":"Desmarque para encerrar a conversa quando o fluxo chamado terminar","crm.continueAfterFlowUseCase":"💡 Use Case: ON = Welcome sub-flow ends → returns to main flow and continues. OFF = Sub-flow ends = conversation ends (like Order Complete flow).","crm.continueAfterShort":"Continuar depois","crm.circularWarning":"Aviso: Referência circular detectada!","crm.circularWarningHint":"O fluxo selecionado contém um nó 'Adicionar Fluxo' apontando para este fluxo. Isso pode causar loops infinitos.","crm.selectFlowPlaceholder":"Selecionar um fluxo...","crm.noOtherFlows":"Nenhum outro fluxo disponível. Crie outro fluxo primeiro.","crm.delayBeforeCalling":"Atraso antes de chamar (segundos):","crm.executionSummary":"Resumo da Execução:","crm.variablesWillBe":"As variáveis serão","crm.passed":"passadas","crm.notPassed":"não passadas","crm.executeFlow":"Executar","crm.continueToNext":"Continuar para o próximo nó","crm.endConversation":"Encerrar conversa","crm.selectedFlow":"Fluxo Selecionado:","crm.addToGroups":"Adicionar a Grupos","crm.removeFromGroups":"Remover de Grupos","crm.addToTabs":"Adicionar a Abas","crm.removeFromTabs":"Remover de Abas","crm.addLabels":"Adicionar Rótulos","crm.removeLabels":"Remover Rótulos","crm.addToCrmStage":"Adicionar a Etapa CRM","crm.removeFromCrm":"Remover do CRM","crm.actionType":"Tipo de Ação:","crm.selectGroups":"Selecionar Grupos:","crm.loadGroups":"Carregar Grupos","crm.loadGroupsFromWhatsApp":"Carregar grupos do WhatsApp Web","crm.selectTabs":"Selecionar Abas:","crm.selectLabels":"Selecionar Rótulos:","crm.syncLabels":"Sincronizar Rótulos","crm.searchLabels":"Pesquisar rótulos...","crm.searchTabs":"Pesquisar abas...","crm.searchGroups":"Pesquisar grupos...","crm.selectCrm":"Selecionar CRM:","crm.selectStage":"Selecionar Etapa:","crm.selectCrmPlaceholder":"Selecionar CRM...","crm.selectStagePlaceholder":"Selecionar etapa...","crm.noGroupsSelected":"Nenhum grupo selecionado","crm.noTabsSelected":"Nenhuma aba selecionada","crm.noLabelsSelected":"Nenhum rótulo selecionado","crm.noCrmSelected":"Nenhum CRM/etapa selecionado","crm.noGroupsAvailable":"Nenhum grupo disponível.","crm.noTabsAvailable":"Nenhuma aba personalizada disponível.","crm.noCrmsAvailable":"Nenhum CRM disponível.","crm.noStagesAvailable":"Nenhuma etapa neste CRM.","crm.delay":"Atraso (segundos):","crm.selectedGroups":"Grupos:","crm.selectedTabs":"Abas:","crm.selectedLabels":"Rótulos:","crm.targetCrmStage":"Target CRM → Stage:","crm.targetCrm":"CRM alvo:","crm.schedule":"Agenda","crm.enableSchedule":"Ativar agenda","crm.startTime":"Hora de início","crm.endTime":"Hora de término","crm.crmRules":"Regras CRM","crm.enableCrmRules":"Ativar regras de abas CRM","crm.selectCrmTabs":"Selecionar abas CRM","crm.tagRules":"Regras de Tags","crm.labelRules":"Regras de etiquetas:","crm.dontRespondIfLabeled":"Não responder se o contato tiver etiqueta","crm.dontRespondToLabels":"Não responder a estas etiquetas","crm.respondOnlyToLabels":"Responder apenas a estas etiquetas","crm.selectLabelsNotToReply":"Selecionar etiquetas para não responder:","crm.selectLabelsToReply":"Selecionar etiquetas para responder:","crm.clickToSelect":"Clique para selecionar","crm.labelsNotReplied":"Etiquetas que não serão respondidas:","crm.labelsToReply":"Etiquetas que serão respondidas:","crm.customTabRules":"Regras de abas personalizadas:","crm.dontRespondIfInCustomTab":"Não responder se o contato estiver em aba personalizada","crm.dontRespondToCustomTabs":"Não responder a estas abas personalizadas","crm.respondOnlyToCustomTabs":"Responder apenas a estas abas personalizadas","crm.selectCustomTabsNotToReply":"Selecionar abas personalizadas para não responder:","crm.selectCustomTabsToReply":"Selecionar abas personalizadas para responder:","crm.customTabsNotReplied":"Abas personalizadas que não serão respondidas:","crm.customTabsToReply":"Abas personalizadas que serão respondidas:","crm.noCustomTabsAvailable":"Nenhuma aba personalizada disponível. Crie uma primeiro.","crm.pauseRules":"Regras de pausa:","crm.enablePause":"Ativar pausa","crm.pauseClientKeywords":"Palavras-chave de pausa do cliente","crm.pauseClientPlaceholder":"Pausar o chatbot se o destinatário...","crm.pauseServerKeywords":"Palavras-chave de pausa do servidor","crm.pauseServerPlaceholder":"Pausar quando o bot enviar...","crm.pauseDuration":"Tempo de Intervalo (HH:MM)","crm.tipPauseTitle":"Regras de Pausa","crm.tipPauseDesc":"Pausar o chatbot quando palavras-chave específicas forem detectadas. Use palavras-chave do cliente para permitir que os clientes pausem o bot, ou palavras-chave do servidor para pausar automaticamente após enviar certas mensagens.","crm.tipPauseEx1":"Customer says 'stop' → Bot pauses","crm.tipPauseEx2":"Customer says 'human' → Transfer to agent","crm.tipPauseEx3":"Bot sends 'connecting...' → Auto-pause","crm.tipPauseClientTitle":"Palavras-chave de Pausa do Cliente","crm.tipPauseClientDesc":"Palavras-chave que quando enviadas pelo cliente pausarão o chatbot para este chat. Útil para cenários de transferência para humanos.","crm.tipPauseClientEx1":"Cliente digita 'parar' ou 'stop'","crm.tipPauseClientEx2":"Cliente digita 'humano' ou 'atendente'","crm.tipPauseClientEx3":"Bot para de responder pelo tempo definido","crm.tipPauseServerTitle":"Palavras-chave de Pausa do Servidor","crm.tipPauseServerDesc":"Palavras-chave que quando enviadas pelo bot pausarão automaticamente o chatbot. Útil ao transferir para atendentes humanos.","crm.tipPauseServerEx1":"Bot envia 'Conectando você a um atendente...'","crm.tipPauseServerEx2":"Bot envia 'Por favor aguarde, transferindo...'","crm.tipPauseServerEx3":"Fluxo pausa automaticamente após esta mensagem","crm.tipPauseDurationTitle":"Tempo de Intervalo","crm.tipPauseDurationDesc":"Define quanto tempo o chatbot permanecerá pausado após detectar uma palavra-chave de pausa. Formato: Horas:Minutos (ex., 00:30 = 30 minutos).","crm.tipPauseDurationEx1":"00:30 = 30 minutos de pausa","crm.tipPauseDurationEx2":"01:00 = 1 hora de pausa","crm.tipPauseDurationEx3":"Após a duração, permanece pausado até novo gatilho","crm.enableTagRules":"Ativar regras de etiquetas do WhatsApp","crm.editBlock":"Editar bloco:","crm.close":"Fechar","crm.startNode":"Início","crm.startNodeInfo":"Este é o ponto de partida do seu fluxo. Conecte-o a outros blocos para construir seu chatbot.","crm.editTextMessage":"Editar mensagem de texto:","crm.typeTheText":"Digite o Texto","crm.saveResponseInVariable":"Salvar resposta na variável:","crm.typeVariableName":"Digite o nome da variável","crm.variableHint":"A variável armazenará a resposta do cliente do bloco atual e poderá ser usada nos blocos seguintes","crm.insertImage":"Inserir uma imagem:","crm.clickToUpload":"Clique para enviar ou arraste os arquivos aqui","crm.imageFormats":"Imagem: PNG, JPG, JPEG, GIF (máx 16MB - limite do WhatsApp)","crm.imageCaption":"Legenda da imagem (opcional)","crm.insertVideo":"Inserir um vídeo:","crm.insertAudio":"Inserir um áudio:","crm.insertDocument":"Inserir um documento:","crm.caption":"Legenda:","crm.captionOptional":"Legenda (opcional)","crm.questionMessage":"Mensagem de pergunta:","crm.typeQuestion":"Digite sua pergunta...","crm.responseOptions":"Opções de resposta:","crm.addOption":"Adicionar opção","crm.buttonText":"Texto do botão:","crm.title":"Título:","crm.listTitleOptional":"Título da lista (opcional)","crm.listDescOptional":"Descrição (opcional)","crm.listSectionsHint":"Configure seções e itens da lista nas configurações avançadas.","crm.globalSettings":"Configurações globais:","crm.editAwayMessage":"Editar mensagem de ausência:","crm.awayMessagePlaceholder":"Digite a mensagem que será enviada quando o usuário não responder...","crm.waitingTime":"Tempo de espera:","crm.waitingTimeWarning":"Quando a página do WhatsApp for recarregada, esta configuração será perdida para conversas aguardando resposta","crm.minutes":"Minutos","crm.hours":"Horas","crm.seconds":"Segundos","crm.awayMessageInfo":"Esta mensagem será enviada automaticamente quando o usuário não responder dentro do tempo especificado.","crm.blockInterval":"Intervalo de bloco:","crm.blockIntervalInfo":"Defina o intervalo padrão entre o envio de blocos do fluxo.","crm.chatSimulator":"Simulador de chat","crm.startConversation":"Inicie uma conversa enviando uma mensagem","crm.typeMessageHere":"Digite sua mensagem aqui...","crm.callNextBlock":"Chamar próximo bloco","crm.whenItemSelected":"Quando item selecionado","crm.defaultNext":"Padrão (sem correspondência)","crm.message":"Mensagem:","crm.listButton":"Texto do botão:","crm.items":"itens","crm.listItems":"Itens da lista:","crm.addItem":"Adicionar item","crm.insertVariable":"Inserir Variável","crm.contactName":"Nome do Contato","crm.currentDate":"Data Atual","crm.currentTime":"Hora Atual","crm.defaultOption1":"Opção 1","crm.defaultOption2":"Opção 2","crm.noListItems":"Sem itens. Clique em editar para adicionar.","crm.chatbotFlows":"Fluxos de chatbot","crm.exportFlows":"Exportar","crm.importFlows":"Importar","crm.exportAll":"Exportar tudo","crm.exportSelected":"Exportar selecionados","crm.selectFlowsToExport":"Selecione os fluxos para exportar","crm.importSuccess":"Fluxos importados com sucesso!","crm.importError":"Erro ao importar fluxos","crm.invalidFlowFile":"Formato de arquivo de fluxo inválido","crm.duplicateFlowFound":"Fluxo duplicado encontrado","crm.flowAlreadyExists":"'{name}' já existe. O que você gostaria de fazer?","crm.replaceFlow":"Substituir","crm.skipFlow":"Pular","crm.renameAndAdd":"Renomear e adicionar","crm.noFlowsSelected":"Por favor, selecione pelo menos um fluxo","crm.noFlowsToExport":"Nenhum fluxo para exportar","crm.flowsExported":"{count} fluxo(s) exportado(s)","crm.flowsImported":"{count} fluxo(s) importado(s)","crm.selected":"selecionado(s)","crm.enabled":"Ativado","crm.allFlows":"Todos","crm.byCategory":"Categorias","crm.viewAllFlows":"Ver todos os fluxos","crm.viewByCategory":"Ver por categoria","crm.addFluxoCategory":"Adicionar categoria","crm.manageCategories":"Gerenciar categorias","crm.editCategory":"Editar categoria","crm.createCategory":"Criar categoria","crm.createCategoryBtn":"Criar categoria","crm.fluxoCategoryName":"Nome","crm.categoryIcon":"Ícone","crm.categoryColor":"Cor","crm.preview":"Prévia","crm.custom":"Personalizado","crm.enterFluxoCategoryName":"Digite o nome da categoria","crm.fluxoCategoryNameRequired":"Nome da categoria é obrigatório","crm.fluxoCategoryNameExists":"Uma categoria com este nome já existe","crm.confirmDeleteCategory":"Excluir esta categoria? Os fluxos serão movidos para Sem categoria.","crm.uncategorized":"Sem categoria","crm.noFlowsInCategory":"Nenhum fluxo nesta categoria","crm.dragFlowsHere":"Arraste fluxos aqui para organizar","crm.dropHere":"Solte aqui","crm.dragToMove":"Arraste para mover","crm.noCategoriesYet":"Nenhuma categoria ainda","crm.createCategoryHint":"Crie uma categoria para organizar seus fluxos","crm.createFirstCategory":"Criar primeira categoria","crm.tourViewToggleTitle":"Alternar visualização","crm.tourViewToggleContent":"Alterne entre a visualização de Todos os Fluxos e por Categoria para organizar seus chatbots.","crm.tourCategoryViewTitle":"Visualização por categoria","crm.tourCategoryViewContent":"Clique aqui para ver seus fluxos organizados por categorias.","crm.tourAddCategoryTitle":"Criar categorias","crm.tourAddCategoryContent":"Clique aqui para criar uma nova categoria com nome, ícone e cor personalizados.","crm.tourDragDropTitle":"Arrastar e soltar","crm.tourDragDropContent":"Arraste qualquer cartão de fluxo e solte-o em uma categoria para organizar seus fluxos.","crm.tourCategorySectionTitle":"Seções de categoria","crm.tourCategorySectionContent":"Clique para expandir ou recolher categorias. Edite ou exclua categorias usando os botões.","crm.skipTour":"Pular","crm.finishTour":"Entendi!","crm.next":"Próximo","crm.previous":"Anterior","crm.start":"Iniciar","crm.allFollowUps":"Todos os Follow-Ups","crm.addFollowUpCategory":"Adicionar categoria","crm.editFollowUpCategory":"Editar categoria","crm.createFollowUpCategory":"Criar categoria","crm.followUpCategoryName":"Nome","crm.enterFollowUpCategoryName":"Digite o nome da categoria","crm.followUpCategoryNameRequired":"Nome da categoria é obrigatório","crm.followUpCategoryNameExists":"Uma categoria com este nome já existe","crm.confirmDeleteFollowUpCategory":"Excluir esta categoria? Os follow-ups serão movidos para Sem categoria.","crm.noFollowUpsInCategory":"Nenhum follow-up nesta categoria","crm.simulateFlow":"Simular fluxo","crm.whenAnyMessage":"Quando qualquer mensagem é recebida.","crm.whenKeywordMatch":"Quando a mensagem contém palavras-chave.","crm.byKeywordInMessage":"Por palavra-chave na mensagem","crm.firstMessageDay":"Primeira mensagem do cliente do dia.","crm.reactivationInterval":"Intervalo de reativação:","crm.actionBlocks":"Blocos de ação","crm.generalRules":"Regras gerais:","crm.allowGroups":"Permitir responder a grupos","crm.scheduleEnabled":"Permitir respostas apenas em dias e horários específicos","crm.dontRespondIfOpen":"Não responder se a conversa estiver aberta","crm.customSignature":"Personalizar ou desativar a assinatura","crm.simulateTyping":"Simular digitação ou gravação de áudio","crm.dontRespondIfInCRM":"Não responder se o contato estiver em um CRM","crm.dontRespondToCRMs":"Não responder a CRMs","crm.respondOnlyToCRMs":"Responder apenas a CRMs","crm.dontRespondIfTagged":"Do not respond if the contact is tagged","crm.dontRespondToTags":"Do not respond to tags","crm.respondOnlyToTags":"Respond only to tags","crm.whenResponding":"Ao responder","crm.image":"Image:","crm.editToInsertImage":"[Edit to insert the image]","crm.send_text":"Enviar Texto","crm.send_image":"Enviar Imagem","crm.send_video":"Enviar Vídeo","crm.send_audio":"Enviar Áudio","crm.send_document":"Enviar Documento","crm.send_list":"Enviar Lista","crm.group_action":"Ação de Grupo","crm.tab_action":"Ação de Aba","crm.label_action":"Ação de Etiqueta","crm.crm_action":"Ação CRM","crm.wait_input":"Aguardar Entrada","crm.smart_wait":"Espera Inteligente","crm.typing_indicator":"Indicador de Digitação","crm.add_fluxo":"Adicionar Fluxo","crm.timezone":"Fuso horário:","crm.day":"Dia","crm.sunday":"Domingo","crm.monday":"Segunda-feira","crm.tuesday":"Terça-feira","crm.wednesday":"Quarta-feira","crm.thursday":"Quinta-feira","crm.friday":"Sexta-feira","crm.saturday":"Sábado","crm.disableSignature":"Desativar assinatura","crm.customizeSignatureName":"Personalizar o nome da assinatura","crm.enterCustomSignature":"Digite o nome da assinatura personalizada","crm.tipAnyMsgTitle":"Gatilho de Qualquer Mensagem","crm.tipAnyMsgDesc":"O fluxo será iniciado sempre que QUALQUER mensagem for recebida de um cliente, independentemente do conteúdo.","crm.tipAnyMsgEx1":"Resposta automática geral para todas as mensagens","crm.tipAnyMsgEx2":"Mensagem de ausência quando não disponível","crm.tipAnyMsgEx3":"Pode disparar com muita frequência - use com intervalo de reativação","crm.tipKeywordTitle":"Gatilho por Palavra-chave","crm.tipKeywordDesc":"O fluxo inicia APENAS quando a mensagem contém uma das palavras-chave especificadas.","crm.tipKeywordEx1":'"price" - triggers on "What is the price?"',"crm.tipKeywordEx2":'"menu" - triggers on "Show me menu"',"crm.tipKeywordEx3":'"help" - triggers on "I need help"',"crm.tipFirstDayTitle":"Primeira Mensagem do Dia","crm.tipFirstDayDesc":"O fluxo é disparado APENAS na primeira mensagem recebida a cada dia de cada contato.","crm.tipFirstDayEx1":'Daily greeting: "Good morning! How can I help?"',"crm.tipFirstDayEx2":"Promoção especial diária para cada contato","crm.tipFirstDayEx3":"Reinicia à meia-noite com base no fuso horário","crm.tipFirstEverTitle":"Primeira Mensagem de Sempre","crm.tipFirstEverDesc":"O fluxo é disparado APENAS na primeira vez que um contato envia uma mensagem.","crm.tipFirstEverEx1":"Mensagem de boas-vindas para novos contatos","crm.tipFirstEverEx2":"Sequência de integração para novos clientes","crm.tipFirstEverEx3":"Atribuição inicial de CRM para novos leads","crm.tipReactivationTitle":"Intervalo de Reativação","crm.tipReactivationDesc":"Tempo mínimo antes que o mesmo fluxo possa disparar novamente para o mesmo contato.","crm.tipReactivationEx1":"3600s = Aguardar 1 hora antes de re-disparar","crm.tipReactivationEx2":"Previne spam de respostas automáticas","crm.tipReactivationEx3":"Use 0 para permitir disparos ilimitados","crm.tipReactivationEx4":"24 hours = Welcome message once per day","crm.tipAllowGroupsTitle":"Permitir Grupos","crm.tipAllowGroupsDesc":"Quando ativado, o chatbot também responderá em chats de grupo. Desativado, apenas chats privados acionam o fluxo.","crm.tipAllowGroupsEx1":"ON: Responder em grupos e privado","crm.tipAllowGroupsEx2":"OFF: Responder apenas em privado","crm.tipScheduleTitle":"Agendar Respostas","crm.tipScheduleDesc":"Restringir o chatbot a horários/dias específicos. Configure o agendamento abaixo.","crm.tipScheduleEx1":"Apenas horário comercial (9h - 18h)","crm.tipScheduleEx2":"Apenas dias úteis (Seg-Sex)","crm.tipScheduleEx3":"Resposta auto fora do horário","crm.tipDontRespondOpenTitle":"Não Responder se Aberto","crm.tipDontRespondOpenDesc":"Impede o chatbot de enviar mensagens se você já tem essa conversa aberta no WhatsApp Web.","crm.tipDontRespondOpenEx1":"Útil quando você está conversando ativamente","crm.tipDontRespondOpenEx2":"Impede o bot de interromper sua conversa","crm.tipSimulateTypingTitle":"Simular Digitação","crm.tipSimulateTypingDesc":"Mostra o indicador 'digitando...' antes de enviar, fazendo as respostas parecerem mais humanas.","crm.tipSimulateTypingEx1":'Shows "typing..." for text messages',"crm.tipSimulateTypingEx2":'Shows "recording..." for audio',"crm.tipSimulateTypingEx3":"Faz o bot parecer mais natural","crm.tipSkipCRMTitle":"Pular Contatos do CRM","crm.tipSkipCRMDesc":"O chatbot não responderá a contatos já adicionados ao seu CRM. Útil para clientes existentes.","crm.tipSkipCRMEx1":"Resposta auto apenas para novos contatos","crm.tipSkipCRMEx2":"Pular contatos CRM existentes","crm.tipExcludeCRMTitle":"Excluir Etapas CRM Específicas","crm.tipExcludeCRMDesc":"Selecione etapas Kanban CRM específicas para excluir. Contatos nessas etapas não receberão mensagens do chatbot.","crm.tipExcludeCRMEx1":'Exclude "VIP Customers" stage',"crm.tipExcludeCRMEx2":'Exclude "Do Not Disturb" stage',"crm.tipIncludeCRMTitle":"Incluir Apenas Etapas CRM Específicas","crm.tipIncludeCRMDesc":"O chatbot responderá APENAS a contatos nas etapas Kanban CRM selecionadas. Todos os outros são ignorados.","crm.tipIncludeCRMEx1":'Only respond to "Leads" stage',"crm.tipIncludeCRMEx2":'Only respond to "Active Deals" stage',"crm.tipSkipLabeledTitle":"Pular Contatos Etiquetados","crm.tipSkipLabeledDesc":"O chatbot não responderá a nenhum contato que tenha uma etiqueta do WhatsApp atribuída.","crm.tipSkipLabeledEx1":"Qualquer contato etiquetado é pulado","crm.tipSkipLabeledEx2":"Apenas contatos sem etiqueta recebem respostas","crm.tipExcludeLabelTitle":"Excluir Etiquetas Específicas","crm.tipExcludeLabelDesc":"Selecione etiquetas WhatsApp específicas para excluir. Contatos com essas etiquetas não receberão mensagens do chatbot.","crm.tipExcludeLabelEx1":'Exclude "Spam" labeled contacts',"crm.tipExcludeLabelEx2":'Exclude "Blocked" labeled contacts',"crm.tipIncludeLabelTitle":"Incluir Apenas Etiquetas Específicas","crm.tipIncludeLabelDesc":"O chatbot responderá APENAS a contatos com as etiquetas WhatsApp selecionadas. Todos os outros são ignorados.","crm.tipIncludeLabelEx1":'Only respond to "VIP" labeled',"crm.tipIncludeLabelEx2":'Only respond to "Priority" labeled',"crm.tipSkipCustomTabTitle":"Pular Contatos de Abas Personalizadas","crm.tipSkipCustomTabDesc":"O chatbot não responderá a nenhum contato atribuído a uma aba personalizada.","crm.tipSkipCustomTabEx1":'Contact in "VIP Customers" tab → No response',"crm.tipSkipCustomTabEx2":"Contact not in any tab → Bot responds","crm.tipExcludeCustomTabTitle":"Excluir Abas Personalizadas Específicas","crm.tipExcludeCustomTabDesc":"Selecione abas personalizadas específicas para excluir. Contatos nessas abas não receberão mensagens do chatbot.","crm.tipExcludeCustomTabEx1":'Exclude "Blocked" tab contacts',"crm.tipExcludeCustomTabEx2":'Exclude "Handled" tab contacts',"crm.tipIncludeCustomTabTitle":"Incluir Apenas Abas Personalizadas Específicas","crm.tipIncludeCustomTabDesc":"O chatbot responderá APENAS a contatos nas abas personalizadas selecionadas. Todos os outros são ignorados.","crm.tipIncludeCustomTabEx1":'Only respond to "Active Leads" tab',"crm.tipIncludeCustomTabEx2":'Only respond to "VIP" tab',"templates.addCategory":"Adicionar Categoria","templates.editCategory":"Editar Categoria","templates.deleteCategory":"Excluir Categoria","templates.manageCategories":"Gerenciar","templates.categoryName":"Nome da Categoria","templates.categoryIcon":"Ícone","templates.categoryColor":"Cor","templates.update":"Atualizar","templates.form.category":"Categoria","templates.form.categoryHint":"Organize modelos em categorias para acesso mais fácil","templates.allTemplates":"Todos os Modelos","templates.quickReplyCategory":"Resposta Rápida","templates.uncategorized":"Sem Categoria","templates.sortNewest":"Mais Recentes","templates.sortOldest":"Mais Antigos","templates.sortNameAZ":"Nome A-Z","templates.sortNameZA":"Nome Z-A","templates.confirmDeleteCategory":"Tem certeza de que deseja excluir esta categoria? Os modelos serão movidos para Sem Categoria.","templates.confirmDeleteTemplate":"Tem certeza de que deseja excluir este modelo?","templates.noCategoriesYet":"Nenhuma categoria ainda","templates.createCategoryDescription":"Crie categorias para organizar seus modelos","templates.done":"Concluído","templates.deleteCategoryWarning":"Os modelos desta categoria ficarão sem categoria.","templates.delete":"Excluir","templates.noTemplatesInCategory":"Não há modelos nesta categoria","templates.createFirstDescription":"Crie seu primeiro modelo para começar","followUp.title":"Acompanhamento","followUp.newFollowUp":"Novo Acompanhamento","followUp.confirmDelete":"Tem certeza de que deseja excluir este acompanhamento?","followUp.emptyTitle":"Nenhum Acompanhamento Selecionado","followUp.emptyText":"Selecione um acompanhamento da lista ou crie um novo para começar com sequências de mensagens automatizadas.","followUp.createNew":"Criar Novo","followUp.loading":"Carregando...","followUp.noFollowUps":"Nenhum acompanhamento ainda","followUp.createFirst":"Crie sua primeira sequência de acompanhamento","followUp.active":"Ativo","followUp.paused":"Pausado","followUp.labels":"Etiquetas","followUp.customTabs":"Abas Personalizadas","followUp.groups":"Grupos","followUp.kanban":"Kanban","followUp.onEnter":"Ao Entrar","followUp.onLeave":"Ao Sair","followUp.afterTime":"Após Tempo","followUp.steps":"passos","followUp.pause":"Pausar","followUp.activate":"Ativar","followUp.duplicate":"Duplicar","followUp.delete":"Excluir","followUp.name":"Nome do Acompanhamento","followUp.namePlaceholder":"Digite o nome do acompanhamento...","followUp.nameRequired":"Por favor, insira um nome para o acompanhamento","followUp.funnelRequired":"Por favor, selecione pelo menos um item do funil","followUp.stepsRequired":"Por favor, adicione pelo menos um passo","followUp.funnelSettings":"Configurações do Funil","followUp.selectFunnelItems":"Selecione itens para acionar este acompanhamento","followUp.comingSoon":"Seletor em breve","followUp.triggerSettings":"Gatilho de Acompanhamento","followUp.onEnterDesc":"Acionar quando o contato entrar no funil","followUp.onLeaveDesc":"Acionar quando o contato sair do funil","followUp.afterTimeDesc":"Acionar após um período específico","followUp.days":"Dias","followUp.day":"Dia","followUp.hours":"Horas","followUp.minutes":"Minutos","followUp.value":"Valor","followUp.unit":"Unidade","followUp.time":"Hora","followUp.scheduleConfiguration":"Configuração de Agendamento","followUp.enableSchedule":"Habilitar Agendamento Avançado","followUp.enableScheduleDesc":"(Enviar apenas em dias/datas específicas)","followUp.scheduleDisabledInfo":"Habilite o Agendamento Avançado acima para configurar dias/datas específicas para envio de mensagens.","followUp.tooltip.scheduleTitle":"Configuração de Agendamento - Quando enviar?","followUp.tooltip.scheduleContent":"Configure dias/datas específicas quando o acompanhamento deve ser executado. Use diário para selecionar dias da semana, semanal para semanas específicas, ou mensal para datas do mês.","followUp.tooltip.scheduleExample":"Defina agendamento Semanal para Seg, Qua, Sex para enviar mensagens apenas nesses dias.","followUp.messagesConfiguredInSchedule":"Mensagens Configuradas no Agendamento","followUp.messagesConfiguredInScheduleDesc":'You have enabled "Different Message per Day" in the Schedule Configuration section above. Messages are configured there for each selected day.',"followUp.stepsTitle":"Passos de Acompanhamento","followUp.step":"Passo","followUp.actions":"ações","followUp.addStep":"Adicionar Passo","followUp.rulesTitle":"Regras de Ativação","followUp.cancelOnReply":"Cancelar se o cliente responder","followUp.allowGroups":"Permitir responder em grupos","followUp.customSignature":"Personalizar assinatura","followUp.signatureText":"Texto da Assinatura","followUp.signaturePlaceholder":"Digite sua assinatura...","followUp.maxExecutions":"Máximo de vezes por contato","followUp.cooldownDays":"Período de espera (dias)","followUp.cancel":"Cancelar","followUp.create":"Criar Acompanhamento","followUp.save":"Salvar Alterações","followUp.saving":"Salvando...","followUp.saved":"Salvo!","followUp.back":"← Back","followUp.next":"Next →","followUp.backToList":"← Back to List","followUp.wizardStep1":"Configuração","followUp.wizardStep2":"Mensagens","followUp.wizardStep3":"Agendamento","followUp.wizardStep4":"Ações","followUp.wizardStep5":"Regras","followUp.followUps":"Acompanhamentos","followUp.stepName":"Nome do Passo (Opcional)","followUp.stepNamePlaceholder":"ex., Contato Inicial, Acompanhamento 1...","followUp.timing":"Tempo","followUp.mode":"Modo","followUp.relative":"Relativo","followUp.specific":"Específico","followUp.type":"Tipo","followUp.daily":"Diário","followUp.weekly":"Semanal","followUp.monthly":"Mensal","followUp.condition":"Condição","followUp.conditionAlways":"Sempre","followUp.conditionIfReplied":"Se Respondeu","followUp.conditionIfNotReplied":"Se Não Respondeu","followUp.conditionIfKeyword":"Se Palavra-chave","followUp.conditionIfNotKeyword":"Se Não Palavra-chave","followUp.conditionIfInFunnel":"Se No Funil","followUp.conditionIfNotInFunnel":"Se Saiu do Funil","followUp.keywords":"Palavras-chave (separadas por vírgula)","followUp.keywordsPlaceholder":"sim, ok, interessado...","followUp.actionsTitle":"Ações","followUp.actionsRequired":"Por favor adicione pelo menos uma ação","followUp.addAction":"+ Adicionar Ação","followUp.messagesTitle":"Messages","followUp.postActionsTitle":"Ações Posteriores","followUp.groupActions":"Ações de Grupo","followUp.addToGroups":"Adicionar aos Grupos","followUp.removeFromGroups":"Remover dos Grupos","followUp.customTabActions":"Ações de Aba Personalizada","followUp.addToTabs":"Adicionar às Abas","followUp.removeFromTabs":"Remover das Abas","followUp.labelsActions":"Ações de Etiquetas","followUp.addLabels":"Adicionar Etiquetas","followUp.removeLabels":"Remover Etiquetas","followUp.kanbanBoardActions":"Ações do Quadro Kanban","followUp.addToKanban":"Adicionar ao Estágio","followUp.removeFromKanban":"Remover do Estágio","followUp.selectStage":"Selecionar Estágio...","followUp.noGroupsAvailable":"Nenhum grupo disponível","followUp.noTabsAvailable":"Nenhuma aba disponível","followUp.noLabelsAvailable":"Nenhuma etiqueta disponível","followUp.noKanbanAvailable":"Nenhum quadro Kanban disponível","followUp.moveUp":"Mover Acima","followUp.moveDown":"Mover Abaixo","followUp.removeStep":"Remover Passo","followUp.message":"Mensagem","followUp.messagePlaceholder":"Digite sua mensagem aqui...","followUp.messageText":"Mensagem","followUp.templatesType":"Tipo de Modelo","followUp.clickToInsert":"Clique para inserir:","followUp.variables":"Variáveis","followUp.minDelay":"Atraso Mín (seg)","followUp.maxDelay":"Atraso Máx (seg)","followUp.addMessage":"Adicionar Mensagem","followUp.selectLabels":"Selecionar etiquetas...","followUp.selectTabs":"Selecionar abas...","followUp.selectKanbanStage":"Selecionar CRM Kanban e estágio...","followUp.selectGroups":"Selecionar grupos do WhatsApp...","followUp.selectorComingSoon":"Seletor em breve","followUp.webhookUrl":"URL do Webhook","followUp.includeContactData":"Incluir dados do contato no payload","followUp.search":"Buscar...","followUp.noLabels":"Nenhuma etiqueta encontrada. Crie etiquetas no WhatsApp primeiro.","followUp.noTabs":"Nenhuma aba personalizada encontrada. Crie abas na barra de abas.","followUp.noGroups":"Nenhum grupo do WhatsApp encontrado.","followUp.noStages":"Nenhuma etapa Kanban encontrada. Crie um CRM e etapas primeiro.","followUp.fluxoCategory":"Categoria","followUp.allCategories":"Todas as Categorias","followUp.uncategorized":"Sem Categoria","followUp.selectFluxo":"Selecionar Fluxo","followUp.chooseFluxo":"-- Escolha um Fluxo --","followUp.fluxoInfo":"O fluxo de chatbot selecionado será acionado quando este follow-up for executado.","followUp.tooltip.nameTitle":"Nome do Acompanhamento","followUp.tooltip.nameContent":"Dê um nome descritivo para identificar esta sequência de acompanhamento. Use nomes claros que descrevam o propósito.","followUp.tooltip.nameExample":"Exemplo: 'Boas-vindas Novo Lead', 'Lembrete de Pagamento', 'Solicitação de Feedback'","followUp.tooltip.categoryTitle":"Categoria","followUp.tooltip.categoryContent":"Organize seus acompanhamentos em categorias para melhor gerenciamento. Selecione uma categoria ou deixe como Sem Categoria.","followUp.tooltip.funnelTitle":"Configurações do Funil - Onde acionar?","followUp.tooltip.funnelContent":"Selecione quais Etiquetas, Abas Personalizadas, Grupos ou estágios Kanban acionarão esta sequência de acompanhamento. Quando um contato entra no funil selecionado, o acompanhamento começará.","followUp.tooltip.funnelExample":"Example: Select 'New Lead' label → When any contact gets this label, follow-up starts automatically.","followUp.tooltip.triggerTitle":"Gatilho de Acompanhamento - Quando começar?","followUp.tooltip.triggerContent":"Decide QUANDO a sequência de acompanhamento COMEÇARÁ após o evento do funil. Ao Entrar: imediatamente quando o contato entra. Ao Sair: quando o contato sai. Após Tempo: esperar X tempo antes de começar.","followUp.tooltip.triggerExample":"Exemplo: 'Após Tempo' + 2 horas = O acompanhamento começa 2 horas após o contato entrar no funil.","followUp.tooltip.actionsTitle":"Ações - O que fazer?","followUp.tooltip.actionsContent":"Defina o que acontece quando o acompanhamento é acionado. Todas as ações são executadas no momento do disparo. Adicione mensagens, mude etiquetas, mova para estágios Kanban, ou acione webhooks.","followUp.tooltip.actionsExample":"Example: Send welcome message → Add 'Contacted' label → Move to 'In Progress' stage.","followUp.tooltip.messagesTitle":"Messages - What to send?","followUp.tooltip.messagesContent":"Define the messages to send when the follow-up triggers. You can add multiple messages with different attachment types and delays between them.","followUp.tooltip.messagesHowToUse":"Click '+ Add Message' to add messages. Each message can have text, images/videos, documents, polls, and more.","followUp.tooltip.postActionsTitle":"Post Actions - CRM actions after messages","followUp.tooltip.postActionsContent":"Configure CRM actions to execute AFTER all messages are sent. Add or remove contacts from Groups, Custom Tabs, WhatsApp Labels, or Kanban board stages.","followUp.tooltip.postActionsHowToUse":"Enable an action category with the toggle, then select which groups/tabs/labels/stages to add or remove the contact from.","followUp.tooltip.rulesTitle":"Regras de Acionamento - Controlar comportamento","followUp.tooltip.rulesContent":"Configure como o acompanhamento se comporta. Cancelar se responder para a sequência se o cliente responder. Permitir grupos habilita o envio em chats de grupo. Assinatura personalizada adiciona seu texto no final das mensagens.","followUp.tooltip.rulesExample":"Boa Prática: Habilite 'Cancelar se responder' para evitar spam aos clientes que já responderam.","followUp.tooltip.cancelOnReplyTitle":"Cancelar se o Cliente Responder","followUp.tooltip.cancelOnReplyContent":"Para automaticamente todas as mensagens de acompanhamento pendentes para um contato quando ele envia qualquer mensagem. Isso evita enviar acompanhamentos desnecessários para clientes que já responderam.","followUp.tooltip.cancelOnReplyExample":"• Enable: Follow-up stops if customer replies before it sends\n• Disable: Follow-up sends regardless of customer messages","followUp.tooltip.allowGroupsTitle":"Permitir Responder em Grupos","followUp.tooltip.allowGroupsContent":"Controla se este acompanhamento pode enviar mensagens para grupos do WhatsApp. Por padrão, acompanhamentos funcionam apenas para contatos individuais (chats 1-a-1).","followUp.tooltip.allowGroupsExample":"• Enable: Follow-up works for both individual chats AND groups\n• Disable: Follow-up only works for individual contacts","followUp.tooltip.signatureTitle":"Personalizar Assinatura","followUp.tooltip.signatureContent":"Adiciona uma assinatura personalizada no final de cada mensagem de acompanhamento. Útil para branding ou identificar mensagens automatizadas.","followUp.tooltip.signatureExample":"Exemplo: Sua mensagem 'Olá, só verificando!' vira 'Olá, só verificando!\\n\\n~ Equipe CRM'","followUp.tooltip.maxExecutionsTitle":"Execuções Máximas - Quantas vezes?","followUp.tooltip.maxExecutionsContent":"Controla quantas vezes este acompanhamento pode enviar mensagens para o MESMO contato. Uma vez que um contato atinge este limite, não receberá mais este acompanhamento.","followUp.tooltip.maxExecutionsExample":"• Set 0 = Unlimited (no limit)\n• Set 1 = Only once per contact\n• Set 3 = Contact receives max 3 times","followUp.tooltip.cooldownTitle":"Período de Espera - Esperar antes de reacionar","followUp.tooltip.cooldownContent":"Depois que um contato recebe este acompanhamento, quantos dias esperar antes que possa receber novamente. Isso evita spam repetido ao mesmo contato.","followUp.tooltip.cooldownExample":"• Set 0 = No waiting (can trigger again immediately)\n• Set 7 = Wait 7 days before re-triggering","followUp.tooltip.exampleLabel":"Exemplo:","followUp.tooltip.howToUseLabel":"Como usar:","followUp.tooltip.bestPracticeLabel":"Boa Prática:","followUp.scheduleWizard.title":"Schedule Configuration","followUp.scheduleWizard.step1":"Step 1: Schedule Type","followUp.scheduleWizard.step2":"Step 2: Select Days","followUp.scheduleWizard.step3":"Step 3: Time & Messages","followUp.scheduleWizard.next":"Avançar","followUp.scheduleWizard.back":"Voltar","followUp.scheduleWizard.done":"Concluir","followUp.schedule.daily":"Daily","followUp.schedule.dailyDesc":"Send on specific dates of month","followUp.schedule.weekly":"Weekly","followUp.schedule.weeklyDesc":"Send on selected weekdays","followUp.schedule.monthly":"Monthly","followUp.schedule.monthlyDesc":"Send on specific dates each month","followUp.schedule.yearly":"Yearly","followUp.schedule.yearlyDesc":"Send on specific dates each year","followUp.weekday.mon":"Mon","followUp.weekday.tue":"Tue","followUp.weekday.wed":"Wed","followUp.weekday.thu":"Thu","followUp.weekday.fri":"Fri","followUp.weekday.sat":"Sat","followUp.weekday.sun":"Sun","followUp.weekday.monday":"Monday","followUp.weekday.tuesday":"Tuesday","followUp.weekday.wednesday":"Wednesday","followUp.weekday.thursday":"Thursday","followUp.weekday.friday":"Friday","followUp.weekday.saturday":"Saturday","followUp.weekday.sunday":"Sunday","followUp.month.jan":"January","followUp.month.feb":"February","followUp.month.mar":"March","followUp.month.apr":"April","followUp.month.may":"May","followUp.month.jun":"June","followUp.month.jul":"July","followUp.month.aug":"August","followUp.month.sep":"September","followUp.month.oct":"October","followUp.month.nov":"November","followUp.month.dec":"December","followUp.selectWeekdays":"Select Weekdays","followUp.selectDates":"Select Dates","followUp.selectYearlyDates":"Select Yearly Dates","followUp.selectedDays":"Selected","followUp.noSelection":"No selection","followUp.addDate":"Add Date","followUp.removeDate":"Remove","followUp.selectMonth":"Select Month","followUp.selectDay":"Select Day","followUp.monthlySelectInfo":"Select dates that will repeat every month","followUp.dailySelectInfo":"Select specific dates for this schedule","followUp.calendarSelectInfo":"Select specific dates from the calendar. Navigate months using arrows.","followUp.messageMode":"Message Mode","followUp.sameMessage":"Same Message for All Days","followUp.sameMessageDesc":"Use the same message configuration for every selected day","followUp.differentMessages":"Different Message per Day","followUp.differentMessagesDesc":"Configure separate messages for each selected day","followUp.messageFor":"Message for","followUp.sendTime":"Send Time","followUp.selectTime":"Select time to send","schedule.title":"Mensagens Agendadas","schedule.addSchedule":"Adicionar Agendamento","schedule.editSchedule":"Editar Agendamento","schedule.schedulesCount":"Agendamentos","schedule.noSchedules":"Sem Mensagens Agendadas","schedule.noSchedulesDesc":"Crie sua primeira mensagem agendada para começar.","schedule.confirmDelete":"Tem certeza que deseja excluir este agendamento?","schedule.inactive":"Inativo","schedule.once":"Uma vez","schedule.repeated":"Repetido","schedule.scheduleFor":"Agendar Para","schedule.selectTarget":"Selecionar Contato ou Grupo","schedule.searchContacts":"Pesquisar contatos e grupos...","schedule.groups":"Grupos","schedule.contacts":"Contatos","schedule.templateType":"Tipo de Modelo","schedule.templateType_message":"Message","schedule.templateType_message_image_video":"Message + Images/Videos","schedule.templateType_message_document":"Message + Documents","schedule.templateType_message_audio":"Message + Audio","schedule.templateType_message_contacts":"Message + Contacts","schedule.templateType_message_buttons":"Message + Buttons","schedule.templateType_message_poll":"Message + Poll","schedule.templateType_message_list":"Message + List","schedule.templateType_message_product":"Message + Product","schedule.templateType_fluxo_flow":"Active Fluxo Flows","schedule.selectFlow":"Select Flow","schedule.selectFluxoFlow":"Select a Fluxo Flow","schedule.message":"Mensagem","schedule.enterMessage":"Digite sua mensagem...","schedule.selectTemplates":"Select Templates","schedule.scheduleDateTime":"Data e Hora do Agendamento","schedule.selectDateTime":"Por favor selecione data e hora","schedule.repeatedType":"Tipo de Repetição","schedule.repeatedType_minute":"Minuto","schedule.repeatedType_hour":"Hora","schedule.repeatedType_daily":"Diário","schedule.repeatedType_weekly":"Semanal","schedule.repeatedType_monthly":"Mensal","schedule.repeatedType_yearly":"Anual","schedule.everyMinutes":"A cada X Minutos","schedule.everyHours":"A cada X Horas","schedule.scheduleTime":"Horários Agendados","schedule.addTime":"Adicionar Hora","schedule.startAndEndTime":"Hora de início e fim","schedule.runAnytime":"Executar a qualquer momento","schedule.runBetween":"Executar entre período de tempo","schedule.endSchedule":"Terminar Repetição do Agendamento em","schedule.never":"Nunca","schedule.afterCount":"Número de vezes repetindo","schedule.completeOnDate":"Completar na Data","schedule.weekday_mon":"Segunda-feira","schedule.weekday_tue":"Terça-feira","schedule.weekday_wed":"Quarta-feira","schedule.weekday_thu":"Quinta-feira","schedule.weekday_fri":"Sexta-feira","schedule.weekday_sat":"Sábado","schedule.weekday_sun":"Domingo","schedule.month_jan":"Janeiro","schedule.month_feb":"Fevereiro","schedule.month_mar":"Março","schedule.month_apr":"Abril","schedule.month_may":"Maio","schedule.month_jun":"Junho","schedule.month_jul":"Julho","schedule.month_aug":"Agosto","schedule.month_sep":"Setembro","schedule.month_oct":"Outubro","schedule.month_nov":"Novembro","schedule.month_dec":"Dezembro","schedule.postActions":"Ações Posteriores","schedule.groupActions":"Ações de Grupo","schedule.customTabActions":"Ações de Aba Personalizada","schedule.labelsActions":"Ações de Etiquetas","schedule.kanbanActions":"Ações Kanban","schedule.replyReceived":"Reply Received Actions","schedule.additionalOptions":"Additional Options","schedule.archiveChat":"Archive chat","schedule.blockChat":"Block chat","schedule.autoSendIfMissed":"Automatic send if schedule time has gone","schedule.webhookExecution":"Webhook Execution","schedule.tooltip.scheduleFor":"Selecione um contato ou grupo para enviar a mensagem agendada.","schedule.tooltip.templateType":"اختر نوع الرسالة: نص فقط، مع وسائط، استطلاع، قائمة، أو تشغيل تدفق Fluxo.","schedule.tooltip.message":"اكتب رسالتك. استخدم متغيرات مثل {{name}} أو {{phone}} للتخصيص.","schedule.tooltip.dateTime":"حدد موعد إرسال الرسالة. للجداول المتكررة، هذا هو تاريخ/وقت البداية.","schedule.tooltip.repeatedType":"اختر تكرار: كل X دقيقة/ساعة، يومي، أسبوعي، شهري، أو سنوي.","schedule.tooltip.scheduleTimes":"أضف أوقات إرسال متعددة. انقر على + لإضافة المزيد.","schedule.tooltip.runBetween":"قصر الرسائل على ساعات محددة. مثال: إرسال فقط بين 9 صباحاً - 6 مساءً.","schedule.tooltip.endSchedule":"اختر متى تتوقف: أبداً، بعد X مرات، أو في تاريخ محدد.","schedule.tooltip.postActions":"إجراءات بعد الإرسال: إضافة/إزالة من المجموعات، التبويبات، التصنيفات، أو مراحل كانبان.","gmaps.featureTitle":"مستخرج خرائط G","feature.gmapsExtractor":"مستخرج خرائط G","gmaps.panelHeader":"مستخرج خرائط G","gmaps.status.idle":"جاهز","gmaps.status.running":"جارٍ الاستخراج...","gmaps.status.stopped":"متوقف","gmaps.status.complete":"اكتمل","gmaps.status.error":"متوقف","gmaps.statusLabel":"الحالة","gmaps.leadsFound":"العملاء: {{count}}","gmaps.leadsShort":"عملاء","gmaps.settings":"الإعدادات","gmaps.exportGroup":"تصدير وإرسال","gmaps.noPhone":"لا يوجد هاتف","gmaps.showPanel":"إظهار اللوحة","gmaps.hidePanel":"إخفاء اللوحة","gmaps.maxResults":"الحد الأقصى","gmaps.unlimited":"غير محدود","gmaps.fetchEmails":"جلب الإيميلات","gmaps.fetchEmailsTooltip":"لكل عميل لديه موقع ويب، يفتحه في الخلفية ويستخرج أول بريد إلكتروني يجده. يضيف حوالي 3 ثوانٍ لكل عميل. إذا لم يحتوِ الموقع على بريد إلكتروني ظاهر أو فشل التحميل، يبقى حقل البريد فارغاً.","gmaps.startBtn":"بدء الاستخراج","gmaps.stopBtn":"إيقاف","gmaps.clearBtn":"مسح","gmaps.exportCsv":"تصدير CSV","gmaps.exportXlsx":"تصدير XLSX","gmaps.sendToBroadcast":"إرسال للبث","gmaps.previewTitle":"معاينة","gmaps.moreRows":"المزيد","gmaps.expand":"توسيع","gmaps.expandView":"عرض كامل","gmaps.clickExpand":"انقر توسيع لعرض التفاصيل الكاملة","gmaps.clickExpandToSee":"انقر توسيع لعرض الكل","gmaps.col.name":"الاسم","gmaps.col.phone":"الهاتف","gmaps.col.website":"الموقع","gmaps.col.address":"العنوان","gmaps.col.category":"الفئة","gmaps.col.rating":"التقييم","gmaps.noLeadsYet":"No leads yet — search on Google Maps and click Start","gmaps.stopReason.userStop":"توقف بواسطة المستخدم","gmaps.stopReason.endOfResults":"تم الوصول إلى نهاية نتائج خرائط جوجل","gmaps.stopReason.captcha":"Google captcha detected — solve it and click Start again","gmaps.stopReason.noFeed":"No Google Maps search results found — please run a search first","gmaps.stopReason.noNewResults":"لا توجد نتائج جديدة (توقفت جوجل عن إرسال البيانات)","gmaps.stopReason.maxReached":"تم الوصول للحد الأقصى للنتائج","gmaps.stopReason.tabClosed":"تم إغلاق علامة التبويب","gmaps.stopReason.error":"خطأ","gmaps.toast.searchFirst":"الرجاء إجراء بحث في خرائط جوجل أولاً، ثم اضغط بدء.","gmaps.toast.csvReady":"تم تنزيل CSV","gmaps.toast.xlsxReady":"تم تنزيل ملف Excel","gmaps.toast.noPhones":"No valid phone numbers — nothing sent.","gmaps.toast.sentPartial":"{{sent}} contacts sent to Broadcast · {{dropped}} skipped (no phone)","gmaps.toast.sentAll":"تم إرسال {{sent}} جهة اتصال إلى البث","gmaps.toast.broadcastFail":"فشل الإرسال إلى البث. راجع وحدة التحكم.","gmaps.toast.draftRestored":"تم استعادة الجلسة السابقة","gmaps.toast.draftRestoredN":"تم استعادة {{n}} عميل من الجلسة السابقة"},es:{"common.loading":"Carregando...","common.close":"Fechar","common.cancel":"Cancelar","common.save":"Salvar","common.copy":"Copiar","common.copied":"¡Copiado!","common.choose":"Escolher","common.add":"Adicionar","common.edit":"Editar","common.delete":"Excluir","common.back":"Voltar","quickReply.title":"Respuesta Rápida","quickReply.addButton":"+ Adicionar","quickReply.allCategories":"Todas las Categorías","quickReply.postActions":"Ações Pós-Envio","quickReply.groupActions":"Ações de Grupo","quickReply.customTabActions":"Acciones de Pestaña","quickReply.labelsActions":"Ações de Etiquetas","quickReply.kanbanBoardActions":"Ações Kanban","quickReply.addToGroups":"Adicionar aos Grupos","quickReply.removeFromGroups":"Remover dos Grupos","quickReply.addToTabs":"Agregar a Pestañas","quickReply.removeFromTabs":"Eliminar de Pestañas","quickReply.addLabels":"Adicionar Etiquetas","quickReply.removeLabels":"Remover Etiquetas","quickReply.addToStage":"Adicionar ao Estágio","quickReply.removeFromStage":"Remover do Estágio","quickReply.selectGroups":"Selecionar grupos...","quickReply.selectTabs":"Seleccionar pestañas...","quickReply.selectLabels":"Selecionar etiquetas...","quickReply.selectCrmStage":"Selecionar CRM e Estágio...","quickReply.noGroupsAvailable":"Nenhum grupo disponível","quickReply.noTabsAvailable":"No hay pestañas disponibles","quickReply.noLabelsAvailable":"Nenhuma etiqueta disponível","quickReply.noKanbanAvailable":"Nenhum CRM Kanban disponível","quickReply.editBeforeSending":"Editar antes de enviar","quickReply.editBeforeSendingDesc":"Permitir editar a mensagem antes de enviar","actionSidebar.title":"Acciones Rápidas","actionSidebar.quickReply":"Respuesta Rápida","actionSidebar.flow":"Fluxo","actionSidebar.search":"Pesquisar...","actionSidebar.filter":"Filtrar","actionSidebar.all":"Todos","actionSidebar.byType":"Por Tipo","actionSidebar.noCategory":"Sin Categoría","actionSidebar.byCategory":"Por Categoría","actionSidebar.mostUsed":"Más Usados","actionSidebar.send":"Enviar","actionSidebar.trigger":"Acionar","actionSidebar.noItemsFound":"Nenhum item encontrado","actionSidebar.selectChatFirst":"Selecione um chat primeiro","actionSidebar.uncategorized":"Sin Categoría","actionSidebar.editAndSend":"Editar e Enviar","actionSidebar.clickToCancel":"Clique para cancelar","actionSidebar.cancel":"Cancelar","actionSidebar.sending":"Enviando...","header.activateLicense":"Ativar Licença",broadcastTitle:"Mensaje Masivo",kanbanTitle:"Abrir Kanban CRM","profile.title":"Perfil","profile.deviceName":"Nome do dispositivo","profile.expires":"Expira","profile.manageLicenseKey":"Gerenciar chave de licença","profile.settings":"Configurações","profile.watchTutorial":"Assistir tutorial","profile.language":"Idioma","profile.privacyPolicy":"Política de privacidad","profile.contactUs":"Contáctenos","profile.website":"Site","profile.premium":"Premium","profile.notActivated":"Não Ativado","profile.activateToContinue":"Ativar Licença","settings.menuFeatures":"Funciones del Menú","settings.menuFeaturesDesc":"Activa o desactiva las funciones según sea necesario","settings.interfaceOptions":"Opções de Interface","settings.featureDockLabel":"Barra Lateral Esquerda","settings.featureDockDesc":"Mostrar uma barra de atalhos na borda esquerda quando um popup estiver aberto","feature.tabs":"Gestión de Pestañas","feature.templates":"Modelos","feature.quickReply":"Respuesta Rápida","feature.kanban":"Kanban CRM","feature.chatbotFlow":"Fluxo do Chatbot","feature.followUp":"Acompanhamento","feature.broadcast":"Envío Masivo","feature.schedule":"Mensajes Programados","feature.calendar":"Centro de Programación","feature.status":"Status","feature.validator":"Validador","feature.webhook":"Webhook","feature.api":"API","feature.aiBot":"Bot de IA","feature.open":"Abrir","license.activateTitle":"Ative sua licença","license.licenseKey":"Chave de licença","license.phoneNumber":"Número de teléfono","license.phoneDetected":"Número de teléfono detectado","license.planName":"Nome do plano","license.endDate":"Fecha de finalización","license.expiresIn":"Expira em","license.days":"días","license.daysLeft":"días restantes","license.status":"Status","license.deactivateLicense":"Desativar licença","license.deactivateConfirm":"¿Estás seguro de que quieres desactivar tu licencia?","license.activateLicenseBtn":"Ativar Licença","license.validating":"Validando...","license.pasteLicenseHere":"Pega tu clave de licencia aquí...","license.completeLicenseKey":"Pega la clave de licencia completa que recibiste por correo electrónico","trial.starting":"Iniciando tu prueba gratuita de 7 dias...","trial.activated":"Prueba gratuita de 7 dias activada!","trial.daysRemaining":"{0} dias restantes de prueba","trial.expired":"La prueba ha expirado. Por favor, compra una licencia.","trial.alreadyUsed":"La prueba ya fue utilizada para este numero. Ingresa una clave de licencia para continuar.","license.waitForWhatsApp":"Espera a que WhatsApp se cargue completamente","license.securityFooter":"Protegido por validación criptográfica WebAssembly","planDetails.title":"Detalles del plan","planDetails.licenceKey":"Clave de licencia","planDetails.planName":"Nombre del plan","planDetails.endDate":"Fecha de finalización","planDetails.removeKey":"Eliminar clave","planDetails.changeKey":"Cambiar clave","features.enabledFeatures":"Funciones habilitadas","languages.en":"English (Inglés)","languages.zh":"中文 (Chino)","languages.hi":"हिंदी (Hindi)","languages.es":"Español","languages.fr":"Français (Francés)","languages.ar":"العربية (Árabe)","languages.bn":"বাংলা (Bengalí)","languages.pt":"Português (Portugués)","languages.ru":"Русский (Ruso)","languages.ur":"اردو (Urdu)","licenseInfo.title":"Información de licencia","licenseInfo.phoneNumber":"Número de teléfono","licenseInfo.expiresIn":"Expira en","licenseInfo.status":"Estado","errors.invalidFormat":"Formato de clave de licencia no válido o validación fallida","errors.serverError":"Ocurrió un error en el servidor","errors.networkError":"Error de red. Por favor verifica tu conexión","errors.extensionUpdated":"La extensión se actualizó. Por favor actualiza la página e intenta de nuevo","tabs.tabs":"Pestañas","tabs.manageTabs":"Administrar Pestañas","tabs.addTab":"Agregar Pestaña","tabs.editTab":"Editar Pestaña","tabs.deleteTab":"Eliminar Pestaña","tabs.tabTitle":"Título de Pestaña","tabs.tabDetails":"Detalles de Pestaña","tabs.enterTabTitle":"Ingrese Título de Pestaña","tabs.enterTabDetails":"Ingrese Detalles de Pestaña","tabs.chooseFrom":"Elegir de","tabs.chat":"Chat","tabs.groups":"Grupos","tabs.label":"Etiqueta","tabs.searchHere":"Buscar aquí","tabs.selectAll":"Seleccionar Todo","tabs.clearAll":"Limpiar Todo","tabs.selected":"Seleccionado","tabs.allChats":"Todos los chats","tabs.chats":"chats","tabs.noFilterApplied":"Sin filtro aplicado","tabs.view":"Ver","tabs.edit":"Editar","tabs.delete":"Eliminar","tabs.hideFromTabBar":"Ocultar de la Barra de Pestañas","tabs.showInTabBar":"Mostrar en la Barra de Pestañas","tabs.sort":"Ordenar","tabs.title":"Título","tabs.details":"Detalles","tabs.action":"Acción","tabs.selectLabel":"Seleccionar Etiqueta","tabs.chooseALabel":"-- Elige una Etiqueta --","tabs.selectedLabel":"Etiqueta Seleccionada","tabs.change":"Cambiar","tabs.pleaseSelectLabel":"Por favor seleccione una etiqueta del menú desplegable","tabs.areYouSureDeleteTab":"¿Estás seguro de que quieres eliminar esta pestaña?","tabs.tabDeletedSuccessfully":"Pestaña eliminada exitosamente","tabs.cancel":"Cancelar","tabs.save":"Guardar","tabs.all":"Todos","tabs.oneToOne":"1:1","tabs.individualChats":"Solo chats individuales","tabs.groupChats":"Solo chats de grupo","tabs.unread":"No leídos","tabs.unreadChats":"Solo chats no leídos","tabs.unsaved":"No guardados","tabs.unsavedContacts":"Solo contactos no guardados","templates.title":"Plantillas de Mensajes","templates.manageTemplates":"Administrar Plantillas","templates.newTemplate":"Nueva Plantilla","templates.editTemplate":"Editar Plantilla","templates.sendTemplate":"Enviar Plantilla","templates.deleteTemplate":"Eliminar Plantilla","templates.duplicateTemplate":"Duplicar Plantilla","templates.activateTemplate":"Activar","templates.deactivateTemplate":"Desactivar","templates.total":"Total","templates.active":"Activas","templates.inactive":"Inactivas","templates.filterAll":"Todas","templates.filterActive":"Solo Activas","templates.filterInactive":"Solo Inactivas","templates.filterAllTypes":"Todos los Tipos","templates.templates":"plantillas","templates.searchPlaceholder":"Buscar plantillas...","templates.noTemplates":"No se encontraron plantillas","templates.createFirst":"Crea tu primera plantilla","templates.edit":"Editar","templates.copy":"Copiar","templates.msgs":"mensajes","templates.noMessageContent":"Sin contenido de mensaje","templates.form.templateName":"Nombre de Plantilla","templates.form.templateNamePlaceholder":"Ingrese nombre de plantilla","templates.form.templateFor":"Plantilla Para","templates.form.message":"Mensaje","templates.form.messagePlaceholder":"Escriba su mensaje aquí...","templates.form.insertVariable":"Haga clic para insertar variable:","templates.form.personalizeValue":"Valor de Personalización","templates.form.personalizeValueHint":"Transmita a sus individuos seleccionados con valores personalizados como @variable1, @variable2, etc.","templates.form.templatesType":"Tipo de Plantillas","templates.form.templateType":"Tipo de Plantillas","templates.form.templateStatus":"Estado de Plantilla","templates.form.statusOn":"Activo","templates.form.statusOff":"Inactivo","templates.form.statusHint":"Cuando el estado de la plantilla es 'activo', está disponible para usar. Por el contrario, cuando el estado de la plantilla es 'inactivo', está en un estado guardado.","templates.form.on":"Activo","templates.form.off":"Inactivo","templates.form.save":"Guardar","templates.form.cancel":"Cancelar","templates.form.selectProducts":"Seleccionar Productos","templates.form.selectContacts":"Seleccionar Contactos","templates.form.addProduct":"Agregar Producto","templates.form.addContact":"Agregar Contacto","templates.form.buttons":"Botones","templates.form.addButton":"Agregar Botón","templates.form.buttonsHint":"Máximo 3 botones permitidos","templates.form.selectFromContacts":"Seleccionar de Contactos","templates.form.addManually":"Agregar Manualmente","templates.form.productHint":"Productos de tu catálogo de WhatsApp Business","templates.form.attachImages":"Adjuntar Imágenes/Videos","templates.form.attachAudio":"Adjuntar Audio","templates.form.attachDocuments":"Adjuntar Documentos","templates.form.chooseFile":"Elegir Archivo","templates.form.maxFileSize":"Tamaño máximo de archivo: 16MB (límite de WhatsApp)","templates.form.uploading":"Subiendo...","templates.errors.uploadFailed":"Error al subir el archivo. Inténtelo de nuevo.","templates.errors.fileTooLarge":"El archivo es demasiado grande. Tamaño máximo: 16MB (límite de WhatsApp).","templates.form.listButtonText":"Texto del Botón","templates.form.listButtonTextPlaceholder":"Ingrese texto del botón","templates.form.listDescription":"Descripción","templates.form.listDescriptionPlaceholder":"Ingrese descripción","templates.form.listSections":"Secciones","templates.form.pollQuestion":"Pregunta de Encuesta","templates.form.pollQuestionPlaceholder":"Ingrese su pregunta de encuesta","templates.form.allowMultipleAnswers":"Permitir Múltiples Respuestas","templates.form.allowMultipleAnswersHint":"Los usuarios pueden seleccionar múltiples opciones","templates.form.pollOptions":"Opciones de Encuesta","templates.form.addOption":"+ Agregar Opción","templates.form.pollOptionsHint":"Mínimo 2, máximo 12 opciones","templates.messageType.individual":"Uno a Uno","templates.messageType.tab":"Pestaña","templates.messageType.group":"Grupo","templates.messageType.label":"Etiqueta","templates.messageType.kanban":"Kanban","templates.messageType.quickReply":"⚡ Respuesta Rápida","templates.attachmentType.none":"Solo Mensaje","templates.attachmentType.imageVideo":"Mensaje + Imágenes/Videos","templates.attachmentType.document":"Mensaje + Documentos","templates.attachmentType.audio":"Mensaje + Audio","templates.attachmentType.contact":"Mensaje + Contactos","templates.attachmentType.poll":"Mensaje + Encuesta","templates.attachmentType.list":"Mensaje + Lista","templates.attachmentType.product":"Mensaje + Productos","templates.attachmentType.buttons":"Mensaje + Botones","templates.messages":"Mensajes","templates.addMessage":"Agregar Mensaje","templates.deleteMessage":"Eliminar Mensaje","templates.messageNumber":"Mensaje {number}","templates.delayBetweenMessages":"Retraso antes del siguiente mensaje","templates.delayMin":"Mín (seg)","templates.delayMax":"Máx (seg)","templates.collapseMessage":"Colapsar","templates.expandMessage":"Expandir","crm.button":"CRM","crm.openCRM":"Abrir CRM","crm.profile":"Perfil","crm.tabs":"Pestañas","crm.notes":"Notas","crm.reminder":"Recordatorio","crm.appointment":"Cita","crm.income":"Ingresos","crm.expense":"Gastos","crm.scheduleTab":"Programar","crm.deletedMessagesTab":"Mensajes Eliminados","crm.antiRevokeEnabled":"Anti-Revoke está ACTIVO","crm.antiRevokeDisabled":"Anti-Revoke está INACTIVO","crm.antiRevokeDescription":"Guarda copias locales de los mensajes entrantes para que puedas verlos aunque el remitente los elimine.","crm.antiRevokeNotEnabledHint":"Activa Anti-Revoke arriba para empezar a guardar los mensajes entrantes.","crm.noDeletedMessages":"Aún no se han recuperado mensajes eliminados. Estamos vigilando — si alguien borra un mensaje, guardaremos una copia aquí.","crm.onlyThisContact":"Solo este contacto","crm.allContacts":"Todos los contactos","crm.clearHistory":"Limpiar historial","crm.exportCSV":"Exportar CSV","crm.revokedAt":"Eliminado el","crm.copyMessage":"Copiar","crm.lionRecovered":"{brand} recuperó","crm.clickToShowOriginal":"Haz clic para mostrar el original","crm.antiRevokeChatTip":"Consejo: también puedes hacer clic en el icono de recuperación directamente sobre un mensaje eliminado en el chat para verlo rápidamente.","crm.searchMessages":"Buscar mensajes…","crm.recoveredCount":"{count} mensaje(s) recuperado(s)","crm.confirmClearChatHistory":"¿Limpiar los mensajes recuperados de este contacto?","crm.confirmClearAllHistory":"¿Limpiar TODOS los mensajes recuperados de todos los chats?","crm.noTextContent":"(sin texto — mensaje multimedia)","crm.group":"Grupo","crm.enable":"Activar","crm.disable":"Desactivar","crm.addScheduleMessage":"Agregar Programación","crm.noScheduledMessages":"Sin Mensajes Programados","crm.noScheduledMessagesDesc":"Programa mensajes para este contacto.","crm.userDetails":"Detalles del usuario","crm.addCustomAttribute":"+ Agregar Atributo","crm.edit":"Editar","crm.cancel":"Cancelar","crm.save":"Guardar","crm.signature":"Firma","crm.signatureDesc":"Ingresa tu nombre para enviar mensajes firmados o para mostrar que estás en servicio en el chat específico a otros agentes.","crm.enterYourName":"Ingresa tu nombre","crm.activateSignature":"Activar firma","crm.signatureAs":"Firmando como","crm.signatureNotSet":"Configura tu nombre de firma en la configuración de la extensión de WhatsApp Web.","crm.delete":"Eliminar","crm.deleteConnection":"¿Eliminar Conexión?","crm.deleteConnectionConfirm":"¿Estás seguro de que deseas eliminar esta conexión entre nodos?","crm.fullName":"Nombre Completo","crm.phoneNumber":"Número de Teléfono","crm.email":"Correo Electrónico","crm.gender":"Género","crm.dateOfBirth":"Fecha de Nacimiento","crm.details":"Detalles","crm.address":"Dirección","crm.language":"Idioma","crm.male":"Masculino","crm.female":"Femenino","crm.other":"Otro","crm.select":"- Seleccionar -","crm.customAttributes":"Atributos Personalizados","crm.addField":"Agregar Campo","crm.fieldLabel":"Etiqueta del Campo","crm.fieldValue":"Valor del Campo","crm.noCustomFields":"No hay campos personalizados","crm.deleteFieldConfirm":"¿Está seguro de eliminar este campo?","crm.contactTabs":"Pestañas del Contacto","crm.addToTab":"Agregar a Pestaña","crm.removeFromTab":"Quitar de Pestaña","crm.noTabs":"No hay pestañas creadas","crm.createTab":"Crear Pestaña","crm.tabName":"Nombre de Pestaña","crm.contacts":"contactos","crm.addToLabel":"Agregar a Etiqueta","crm.selectLabel":"Seleccionar Etiqueta","crm.noLabelsAvailable":"No hay etiquetas. Crea una pestaña primero.","crm.labelsAndStages":"Etiquetas y Etapas","crm.whatsappLabels":"Etiquetas de WhatsApp","crm.customTabs":"Pestañas Personalizadas","team.button":"Equipo","team.shareWith":"Compartir con Equipo","team.settings":"Configuración del Equipo","team.addMember":"Agregar Miembro","team.editMember":"Editar Miembro","team.deleteMember":"Eliminar","team.memberName":"Nombre del Miembro","team.memberPhone":"Número de Teléfono","team.department":"Departamento","team.departmentPlaceholder":"ej., Ventas, Finanzas, Soporte","team.template":"Plantilla de Mensaje","team.templatePlaceholder":"Ingrese mensaje con variables...","team.noMembers":"No hay miembros configurados","team.clickToAdd":"Haga clic en + para agregar miembros","team.sending":"Enviando...","team.insertVariable":"Insertar Variable","team.preview":"Vista Previa","team.deleteConfirm":"¿Está seguro de que desea eliminar este miembro?","team.phonePlaceholder":"ej., +5511999999999","team.namePlaceholder":"ej., Ventas - Juan","team.variableHint":"Use {{name}}, {{phone}}, {{labels}} etc. para contenido dinámico","team.save":"Guardar","team.cancel":"Cancelar","team.editTemplate":"Editar Plantilla","team.saveAndSend":"Guardar y Enviar","team.sendOnce":"Enviar Una Vez","team.send":"Enviar","team.selectContact":"Seleccionar Contacto","team.clickToSelectContact":"Haga clic para seleccionar un contacto de WhatsApp","team.searchContact":"Buscar contactos...","team.loadingContacts":"Cargando contactos...","team.noContactsFound":"No se encontraron contactos","team.noSearchResults":"Sin resultados","team.phoneHint":"Ingrese número con código de país o haga clic en el icono para seleccionar","team.popupTitle":"Compartir con Equipo","team.popupSubtitle":"Enviar detalles del contacto al instante","team.noTeamMembers":"Sin Miembros","team.noTeamMembersDesc":"Agregue miembros del equipo para compartir rápidamente detalles de contacto vía WhatsApp","crm.addNote":"+ Agregar Nota","crm.searchNotes":"Buscar notas...","crm.noNotes":"Sin notas","crm.addFirstNote":"Agregue su primera nota","crm.topic":"Tema","crm.content":"Contenido","crm.editNote":"Editar Nota","crm.deleteNote":"Eliminar Nota","crm.deleteNoteConfirm":"¿Está seguro de eliminar esta nota?","crm.addReminder":"+ Agregar Recordatorio","crm.noReminders":"Sin recordatorios","crm.addFirstReminder":"Agregue su primer recordatorio","crm.reminderTopic":"Tema del Recordatorio","crm.dateTime":"Fecha y Hora","crm.repeatInterval":"Intervalo de Repetición","crm.noRepeat":"Sin repetir","crm.every5Min":"Cada 5 minutos","crm.every10Min":"Cada 10 minutos","crm.every15Min":"Cada 15 minutos","crm.every30Min":"Cada 30 minutos","crm.every1Hour":"Cada 1 hora","crm.status":"Estado","crm.pending":"Pendiente","crm.completed":"Completado","crm.dismissed":"Descartado","crm.stopped":"Detenido","crm.snoozed":"Pospuesto","crm.due":"Vencido","crm.editReminder":"Editar Recordatorio","crm.deleteReminder":"Eliminar Recordatorio","crm.markComplete":"Marcar Completo","crm.snooze":"Posponer","crm.stop":"Detener","crm.addAppointment":"+ Agregar Cita","crm.noAppointments":"Sin citas","crm.addFirstAppointment":"Agregue su primera cita","crm.appointmentTitle":"Título de la Cita","crm.attendee":"Asistente","crm.googleMeetLink":"Enlace de Google Meet","crm.generateLink":"Generar Enlace","crm.messageTemplate":"Plantilla de Mensaje","crm.reminderBefore":"Recordatorio Antes","crm.sendMessageNow":"Enviar mensaje ahora","crm.scheduled":"Programado","crm.cancelled":"Cancelado","crm.missed":"Perdido","crm.editAppointment":"Editar Cita","crm.deleteAppointment":"Eliminar Cita","crm.joinMeeting":"Unirse a la Reunión","crm.before5Min":"5 minutos antes","crm.before10Min":"10 minutos antes","crm.before15Min":"15 minutos antes","crm.before30Min":"30 minutos antes","crm.before1Hour":"1 hora antes","crm.before2Hours":"2 horas antes","crm.before1Day":"1 día antes","crm.titleLabel":"Título","crm.scheduleDateTime":"Programar Fecha y Hora","crm.pasteGoogleMeetLink":"Pegue su enlace de Google Meet aquí","crm.generateLinkHint":"Haga clic en 'Generar Enlace' para abrir Google Meet, luego pegue el enlace de la reunión aquí","crm.chooseTemplate":"Elegir Plantilla","crm.selectTemplate":"-- Seleccionar una plantilla --","crm.messageTemplatePlaceholder":"Ingrese plantilla de mensaje...","crm.useSameMessage":"Usar el mismo mensaje al inicio de la reunión","crm.meetingStartMessageLabel":"Mensaje de Inicio de Reunión","crm.meetingStartPlaceholder":"Ingrese el mensaje a enviar al inicio de la reunión...","crm.meetingStartHint":"Este mensaje se enviará cuando la reunión realmente comience.","crm.sendReminderLabel":"Enviar Recordatorio","crm.reminderTimeHint":"El mensaje se enviará a los asistentes en este momento antes de la reunión. También recibirá una notificación de sonido.","crm.sendMessageNowTo":"Enviar mensaje ahora a","crm.sendNowHint":"Marque esto para enviar el mensaje de la cita inmediatamente después de guardar","crm.discard":"Descartar","crm.saveAndSend":"Guardar y Enviar","crm.sending":"Enviando...","crm.noAppointmentsFound":"No se encontraron citas","crm.searchAppointments":"Buscar citas","crm.productDemoCall":"ej., Llamada de demostración del producto","crm.reminderMessageHint":"Este mensaje se enviará en el momento del recordatorio (antes de la reunión).","crm.joinMeet":"Unirse a Meet","crm.appointmentTemplates":"Plantillas de Citas","crm.savedTemplates":"Plantillas Guardadas","crm.noTemplatesYet":"Aún no hay plantillas. ¡Cree su primera plantilla!","crm.newTemplate":"+ Nueva Plantilla","crm.editTemplateTitle":"Editar Plantilla","crm.newTemplateTitle":"Nueva Plantilla","crm.templateName":"Nombre de la Plantilla","crm.templateNamePlaceholder":"ej., Recordatorio de Reunión","crm.meetLinkOptional":"Enlace de Google Meet (Opcional)","crm.updateTemplate":"Actualizar Plantilla","crm.saveTemplate":"Guardar Plantilla","crm.pleaseEnterTitle":"Por favor ingrese un título","crm.pleaseSelectFutureDate":"Por favor seleccione una fecha y hora futura","crm.deleteAppointmentConfirm":"¿Está seguro de que desea eliminar esta cita?","crm.pleaseEnterTemplateName":"Por favor ingrese un nombre de plantilla","crm.pleaseEnterMessageTemplate":"Por favor ingrese una plantilla de mensaje","crm.deleteTemplateConfirm":"¿Está seguro de que desea eliminar esta plantilla?","crm.addIncome":"+ Agregar Ingreso","crm.totalIncome":"Ingreso Total","crm.pendingIncome":"Pendiente","crm.filteredTotal":"Total Filtrado","crm.noIncome":"Sin registros de ingresos","crm.addFirstIncome":"Agregue su primer ingreso","crm.amount":"Monto","crm.category":"Categoría","crm.paymentMethod":"Método de Pago","crm.description":"Descripción","crm.reference":"Referencia","crm.date":"Fecha","crm.paymentReceived":"Pago Recibido","crm.sale":"Venta","crm.serviceFee":"Tarifa de Servicio","crm.commission":"Comisión","crm.refundReceived":"Reembolso Recibido","crm.cash":"Efectivo","crm.bankTransfer":"Transferencia Bancaria","crm.upi":"UPI","crm.pix":"PIX","crm.card":"Tarjeta","crm.cheque":"Cheque","crm.addCustomPaymentMethod":"Agregar Método Personalizado","crm.editIncome":"Editar Ingreso","crm.deleteIncome":"Eliminar Ingreso","crm.addExpense":"+ Agregar Gasto","crm.totalExpense":"Gasto Total","crm.pendingExpense":"Pendiente","crm.noExpense":"Sin registros de gastos","crm.addFirstExpense":"Agregue su primer gasto","crm.purchase":"Compra","crm.serviceCost":"Costo de Servicio","crm.travel":"Viaje","crm.marketing":"Marketing","crm.commissionPaid":"Comisión Pagada","crm.refundGiven":"Reembolso Dado","crm.editExpense":"Editar Gasto","crm.deleteExpense":"Eliminar Gasto","crm.search":"Buscar...","crm.all":"Todos","crm.today":"Hoy","crm.thisWeek":"Esta Semana","crm.thisMonth":"Este Mes","crm.thisYear":"Este Año","crm.filterByCategory":"Filtrar por categoría","crm.filterByStatus":"Filtrar por estado","crm.filterByDate":"Filtrar por fecha","crm.allStatus":"Todos los Estados","crm.allCategories":"Todas las Categorías","crm.none":"Ninguno","crm.ref":"Ref","crm.tableTabName":"Nombre de Pestaña","crm.tableContactsInTab":"Contactos en Pestaña","crm.tableAction":"Acción","crm.tableName":"Nombre","crm.tableModifiedDate":"Fecha Modificada","crm.tableTopic":"Tema","crm.tableReminderDate":"Fecha de Recordatorio","crm.tableRepeatSnooze":"Repetir/Posponer","crm.tableStatus":"Estado","crm.tableTitle":"Título","crm.tableDateTime":"Fecha y Hora","crm.tableAttendee":"Asistente","crm.tableMeetLink":"Enlace Meet","crm.tableDescription":"Descripción","crm.tableCategory":"Categoría","crm.tableAmount":"Monto","crm.tablePayment":"Pago","crm.tableDate":"Fecha","crm.addIncomeTitle":"Agregar Ingreso","crm.editIncomeTitle":"Editar Ingreso","crm.addExpenseTitle":"Agregar Gasto","crm.editExpenseTitle":"Editar Gasto","crm.enterAmount":"Ingrese monto","crm.validAmountRequired":"Por favor ingrese un monto válido","crm.descriptionRequired":"Por favor ingrese una descripción","crm.referenceInvoice":"Referencia / Nº de Factura","crm.referenceBill":"Referencia / Nº de Recibo","crm.invoicePlaceholder":"ej., FAC-001","crm.billPlaceholder":"ej., REC-001","crm.paymentDescription":"ej., Pago por servicios","crm.expenseDescription":"ej., Suministros de oficina","crm.update":"Actualizar","crm.addIncomeBtn":"Agregar Ingreso","crm.addExpenseBtn":"Agregar Gasto","crm.recurringTransaction":"Transacción Recurrente","crm.repeatEvery":"Repetir Cada","crm.neverEnds":"Sin fecha límite","crm.endDate":"Fecha de Fin","crm.daily":"Diario","crm.weekly":"Semanal","crm.monthly":"Mensual","crm.quarterly":"Trimestral (3 meses)","crm.yearly":"Anual","crm.currencySettings":"Configuración de Moneda","crm.searchCurrency":"Buscar moneda...","crm.noCurrenciesFound":"No se encontraron monedas","crm.noIncomeRecords":"No se encontraron registros de ingresos","crm.noExpenseRecords":"No se encontraron registros de gastos","crm.deleteIncomeConfirm":"¿Está seguro de que desea eliminar este registro de ingreso?","crm.deleteExpenseConfirm":"¿Está seguro de que desea eliminar este registro de gasto?","crm.addCategory":"Agregar Categoría","crm.categoryName":"Nombre de Categoría","crm.enterCategoryName":"Ingrese nombre de categoría","crm.customCategories":"Categorías Personalizadas","crm.addCustomCategory":"Agregar Categoría Personalizada","crm.existingCustomCategories":"Categorías Personalizadas Existentes","crm.addStatus":"Agregar Estado","crm.statusName":"Nombre de Estado","crm.enterStatusName":"Ingrese nombre de estado","crm.customStatuses":"Estados Personalizados","crm.addCustomStatus":"Agregar Estado Personalizado","crm.existingCustomStatuses":"Estados Personalizados Existentes","crm.add":"Agregar","crm.loading":"Cargando...","crm.dismiss":"Descartar","crm.yesterday":"Ayer","agent.agentMode":"Modo Agente","agent.identifyAsAgent":"Identificarse como Agente","agent.agentName":"Nombre del Agente","agent.namePlaceholder":"ej., Ram, Equipo de Soporte 1","agent.agentNamePlaceholder":"Ingrese su nombre de agente","agent.viewTransferHistory":"Ver Historial de Transferencias","agent.transferToAgent":"Transferir a Agente","agent.transferSuccess":"Chat transferido exitosamente","agent.noAgentsOnline":"No hay agentes disponibles en línea","agent.selectAgent":"Seleccionar Agente","agent.chooseAgent":"-- Elegir un Agente --","agent.reason":"Razón","agent.reasonPlaceholder":"¿Por qué está transfiriendo este chat?","agent.priority":"Prioridad","agent.priorityLow":"Baja","agent.priorityMedium":"Media","agent.priorityHigh":"Alta","agent.priorityUrgent":"Urgente","agent.transfer":"Transferir","agent.incomingTransfer":"Transferencia Entrante","agent.fromAgent":"Del Agente","agent.toAgent":"Al Agente","agent.chat":"Chat","agent.startService":"Iniciar Servicio","agent.endService":"Finalizar Servicio","agent.activeService":"Servicio Activo","agent.from":"De","agent.to":"A","agent.duration":"Duración","agent.transferHistory":"Historial de Transferencias","agent.sent":"Enviadas","agent.received":"Recibidas","agent.status":"Estado","agent.all":"Todos","agent.statusPending":"Pendiente","agent.statusAccepted":"Aceptado","agent.statusInService":"En Servicio","agent.statusCompleted":"Completado","agent.statusDeclined":"Rechazado","agent.statusExpired":"Expirado","agent.noTransfers":"No se encontraron transferencias","agent.serviceQueue":"Cola de Servicio","agent.pendingTransfers":"Transferencias Pendientes","agent.activeServices":"Servicios Activos","agent.sentTransfers":"Transferencias Enviadas","agent.noActiveServices":"No hay servicios activos ni transferencias pendientes","agent.serviceEnded":"Servicio finalizado exitosamente","agent.accept":"Aceptar","agent.decline":"Rechazar","agent.notRegistered":"Agente no registrado. Por favor, active el modo agente primero.","agent.statusCancelled":"Cancelado","agent.started":"Iniciado","chatTools.suggest":"Sugerir","chatTools.spelling":"Ortografía","chatTools.translate":"Traducir","chatTools.summarize":"Resumir","chatTools.enlarge":"Ampliar","chatTools.friendly":"Amigable","chatTools.formal":"Formal","chatTools.send":"Enviar","chatTools.copy":"Copiar","chatTools.use":"Usar","chatTools.aiResult":"Resultado IA","chatTools.suggestTitle":"Sugerencia IA","chatTools.spellingTitle":"Corregir ortografía y gramática","chatTools.translateTitle":"Traducir a","chatTools.summarizeTitle":"Resumir texto","chatTools.enlargeTitle":"Expandir texto","chatTools.friendlyTitle":"Hacer amigable","chatTools.formalTitle":"Hacer formal","chatTools.conversationSummary":"Resumen del chat","chatTools.conversationSummaryTitle":"Resumir esta conversación","chatTools.conversationSummarizing":"Resumiendo chat…","chatTools.conversationSummaryEmpty":"No hay mensajes para resumir en este chat","chatTools.conversationSummaryNoChat":"Abre un chat para resumirlo","chatTools.conversationSummaryFailed":"Error al obtener los mensajes del chat","chatTools.conversationSummaryResultTitle":"Resumen de la conversación","chatTools.sendTitle":"Enviar mensaje","chatTools.selectTextFirst":"Seleccione texto o escriba en el cuadro de entrada primero","chatTools.searchLanguage":"Buscar idioma...","aiSettings.title":"Insertar clave API de IA","aiSettings.platformType":"Tipo de plataforma de IA","aiSettings.geminiAI":"GEMINI AI","aiSettings.chatgpt":"CHATGPT","aiSettings.deepseek":"DEEPSEEK","aiSettings.apiKey":"Clave API de IA","aiSettings.enterApiKey":"Por favor ingrese su clave API de IA","aiSettings.validate":"Validar","aiSettings.validKey":"¡La clave API es válida!","aiSettings.invalidKey":"Clave API inválida. Por favor verifique e intente de nuevo.","aiSettings.note":"Nota:","aiSettings.geminiNote":"Obtenga su clave API de Gemini en Google AI Studio (aistudio.google.com)","aiSettings.chatgptNote":"Obtenga su clave API de OpenAI en platform.openai.com/api-keys","aiSettings.deepseekNote":"Obtenga su clave API de DeepSeek en platform.deepseek.com","aiSettings.enableAITools":"Habilitar herramientas de IA","aiSettings.close":"Cerrar","aiSettings.save":"Guardar","aiSettings.configureAI":"Configure su proveedor de IA y clave API para funciones impulsadas por IA","settings.title":"Configuración","settings.yourLanguage":"Tu Idioma","settings.selectLanguage":"Seleccionar Idioma","settings.chooseLanguage":"Elija su idioma preferido para la interfaz de la extensión","settings.whatLanguageSpeak":"Qué Idioma Hablas","settings.translateMessages":"Traducir mensajes entrantes","settings.selectSpokenLanguage":"Selecciona Tu Idioma","settings.spokenLanguageHint":"Los mensajes se traducirán a este idioma cuando hagas clic en el icono de traducción en los mensajes entrantes.","settings.blurSettings":"Configuración de Desenfoque","settings.blurDescription":"Difuminar información privada de la pantalla.","settings.blurMessages":"Difuminar mensajes","settings.blurProfileNames":"Difuminar nombres de perfil","settings.blurDisplayPhotos":"Difuminar fotos de perfil (DP)","settings.blurConversation":"Difuminar conversación","settings.displayOnHover":"Mostrar conversación al pasar el cursor","settings.theme":"Tema","settings.themeDescription":"Elige tu esquema de colores preferido","settings.lightMode":"Modo Claro","settings.lightModeDesc":"Apariencia clara clásica","settings.darkMode":"Modo Oscuro","settings.darkModeDesc":"Fácil para los ojos con poca luz","settings.systemMode":"Sistema","settings.systemModeHint":"Sigue el tema de WhatsApp","settings.currentTheme":"Tema actual","signature.title":"Firma","signature.enableSignature":"Habilitar firma","signature.yourSignature":"Tu firma","signature.placeholder":"ej., - Juan Pérez","signature.preview":"Vista previa","signature.save":"Guardar","backup.title":"Copia de seguridad y restauración","backup.export":"Exportar","backup.import":"Importar","backup.importHint":"Sube un archivo JSON de respaldo de {brand} para restaurar tus datos. Puedes seleccionar qué funciones importar.","backup.kanbanCRM":"Datos de Kanban CRM","backup.customTabs":"Pestañas personalizadas","backup.templatesQuickReplies":"Plantillas y respuestas rápidas","backup.broadcastHistory":"Historial de difusión","backup.settings":"Configuración","backup.crmProfileData":"Datos del perfil CRM","backup.calendarData":"Calendario (Recordatorios y Citas)","backup.statusData":"Estado","backup.webhookSettings":"Configuración de Webhook","backup.aiBotSettings":"Configuración del Bot de IA","backup.aiApiSettings":"Configuración de API de IA","backup.spokenLanguage":"Idioma hablado","backup.chatbotFlows":"Flujos de Chatbot (Fluxo)","backup.followupData":"Secuencias de seguimiento","backup.scheduledMessages":"Mensajes programados","backup.scheduledBroadcasts":"Difusiones programadas","backup.fluxoAdvanced":"Configuración avanzada de Fluxo","backup.conversationStates":"Estados de conversación","backup.bulkValidatorData":"Datos del validador masivo","backup.quickReplies":"Respuestas rápidas","backup.crmTodos":"Listas de tareas CRM","backup.signatureSettings":"Configuración de firma","backup.teamSettings":"Configuración del equipo","backup.blurSettings":"Configuración de desenfoque","backup.featureVisibility":"Visibilidad de funciones","backup.themeSettings":"Configuración del tema","backup.uiStateSettings":"Configuración del estado de UI","backup.apiPollingSettings":"Configuración de sondeo API","backup.agentSettings":"Configuración del agente","backup.autoBackup":"Copia de seguridad automática","backup.autoBackupInfo":"Se creará una copia de seguridad automática cuando WhatsApp Web se cargue en una nueva fecha","backup.autoBackupDestination":"Destino de la copia de seguridad","backup.autoBackupWhatsApp":"Enviar a mensajes guardados de WhatsApp","backup.autoBackupDownload":"Descargar a la computadora","backup.exportNow":"Exportar ahora","backup.importNow":"Importar ahora","backup.selectFile":"Seleccione el archivo de respaldo para importar","backup.importSuccess":"¡Datos importados exitosamente!","backup.importError":"Error al importar datos. Por favor verifique el formato del archivo.","backup.exportSuccess":"¡Datos exportados exitosamente!","backup.noDataSelected":"Por favor seleccione al menos un tipo de datos para exportar/importar","backup.cheetahDetected":"Cheetah CRM Detectado","backup.fileLoaded":"Archivo cargado exitosamente","backup.cheetahImportDesc":"Esta copia de seguridad contiene datos de Cheetah CRM. Todas las funciones compatibles se importarán y fusionarán con sus datos existentes de CRM.","backup.dataToImport":"Datos a importar:","backup.mergeWarning":"Importante:","backup.mergeWarningDesc":"Los datos se fusionarán con los datos existentes de CRM. Sus datos actuales NO serán sobrescritos - solo se agregarán datos nuevos.","backup.importing":"Importando...","backup.importCheetah":"Importar Copia de Cheetah CRM","missedSchedule.title":"Campaña programada perdida","missedSchedule.description":"Se perdió una campaña programada porque WhatsApp Web no estaba abierto en el horario programado.","missedSchedule.sendNow":"Enviar ahora","missedSchedule.cancelDiscard":"Cancelar y descartar","missedSchedule.dismiss":"Descartar (Recordar más tarde)","calendar.title":"Calendario","calendar.goToToday":"Ir a hoy","calendar.reminders":"Recordatorios","calendar.appointments":"Citas","calendar.remindersFor":"Recordatorios para","calendar.appointmentsFor":"Citas para","calendar.noReminders":"No hay recordatorios para esta fecha","calendar.noAppointments":"No hay citas para esta fecha","calendar.selectDate":"Seleccione una fecha con recordatorios o citas para ver detalles","calendar.deleteReminder":"Eliminar recordatorio","calendar.deleteAppointment":"Eliminar cita","calendar.confirmDeleteReminder":"¿Está seguro de que desea eliminar este recordatorio?","calendar.confirmDeleteAppointment":"¿Está seguro de que desea eliminar esta cita?","calendar.everyMin":"Cada {min} min","calendar.everyHour":"Cada hora","calendar.weekdays.sun":"DOM","calendar.weekdays.mon":"LUN","calendar.weekdays.tue":"MAR","calendar.weekdays.wed":"MIÉ","calendar.weekdays.thu":"JUE","calendar.weekdays.fri":"VIE","calendar.weekdays.sat":"SÁB","calendar.months.january":"Enero","calendar.months.february":"Febrero","calendar.months.march":"Marzo","calendar.months.april":"Abril","calendar.months.may":"Mayo","calendar.months.june":"Junio","calendar.months.july":"Julio","calendar.months.august":"Agosto","calendar.months.september":"Septiembre","calendar.months.october":"Octubre","calendar.months.november":"Noviembre","calendar.months.december":"Diciembre","calendar.status.pending":"Pendiente","calendar.status.completed":"Completado","calendar.status.dismissed":"Descartado","calendar.status.snoozed":"Pospuesto","calendar.status.stopped":"Detenido","calendar.status.scheduled":"Programado","calendar.status.cancelled":"Cancelado","calendar.status.missed":"Perdido","calendar.todos":"Tareas","calendar.todosFor":"Tareas para","calendar.noTodos":"No se encontraron tareas","calendar.addTodo":"Agregar Tarea","calendar.editTodo":"Editar Tarea","calendar.deleteTodo":"Eliminar Tarea","calendar.confirmDeleteTodo":"¿Está seguro de que desea eliminar esta tarea?","todo.title":"Título","todo.titlePlaceholder":"Ingrese título de la tarea","todo.description":"Descripción","todo.descriptionPlaceholder":"Agregar detalles (opcional)","todo.dueDate":"Fecha de Vencimiento","todo.dueTime":"Hora de Vencimiento","todo.priority":"Prioridad","todo.priorityHigh":"Alta","todo.priorityMedium":"Media","todo.priorityLow":"Baja","todo.category":"Categoría","todo.noCategory":"Sin Categoría","todo.categoryWork":"Trabajo","todo.categoryPersonal":"Personal","todo.categoryUrgent":"Urgente","todo.categoryShopping":"Compras","todo.categoryHealth":"Salud","todo.subtasks":"Subtareas","todo.addSubtask":"Agregar","todo.subtaskPlaceholder":"Ingrese subtarea","todo.recurring":"Recurrente","todo.repeatEvery":"Repetir","todo.endDate":"Fecha de Fin","todo.recurringDaily":"Diario","todo.recurringWeekly":"Semanal","todo.recurringMonthly":"Mensual","todo.recurringYearly":"Anual","todo.reminder":"Recordatorio","todo.reminderDate":"Fecha de Recordatorio","todo.reminderTime":"Hora de Recordatorio","todo.browserNotification":"Notificación del Navegador","todo.whatsappSelfMessage":"Enviar recordatorio WhatsApp a mí mismo","todo.whatsappSelfMessageHint":"Recibirá un mensaje de WhatsApp cuando venza la tarea","todo.save":"Guardar Tarea","todo.update":"Actualizar Tarea","todo.cancel":"Cancelar","todo.addTodo":"Agregar Tarea","todo.editTodo":"Editar Tarea","todo.statusPending":"Pendiente","todo.statusInProgress":"En Progreso","todo.statusCompleted":"Completada","todo.statusCancelled":"Cancelada","todo.filterAll":"Todas las Tareas","todo.filterToday":"Hoy","todo.filterThisWeek":"Esta Semana","todo.filterOverdue":"Vencidas","todo.filterCompleted":"Completadas","todo.today":"Hoy","todo.tomorrow":"Mañana","todo.overdue":"Vencida","todo.snoozeTime":"Tiempo de Posponer","todo.minutes":"minutos","todo.hour":"hora","todo.hours":"horas","todo.day":"día","todo.taskReminder":"Recordatorio de Tarea","todo.highPriority":"Alta Prioridad","todo.mediumPriority":"Prioridad Media","todo.lowPriority":"Baja Prioridad","todo.subtasksCount":"subtareas","todo.snooze":"Posponer","todo.markDone":"Marcar Completada","todo.dismiss":"Descartar","todo.task":"Tarea","todo.changeColor":"Clic para cambiar color","todo.selectCategoryFirst":"Seleccione categoría primero","todo.linkedContacts":"Contactos Vinculados","todo.optional":"Opcional","todo.selectContacts":"Seleccionar Contactos","todo.searchContacts":"Buscar contactos...","todo.noContactsFound":"No se encontraron contactos","todo.selected":"seleccionados","todo.contacts":"contactos","status.title":"Estado","status.activeStatus":"Estado Activo","status.createStatus":"Crear Estado","status.loading":"Cargando estados...","status.noStatusFound":"No se encontró estado","status.noStatusDescription":"Parece que aún no has creado ningún estado. Haz clic en el botón de abajo para agregar uno nuevo.","status.add":"Agregar","status.statusName":"Nombre del Estado (opcional)","status.statusNamePlaceholder":"Crear un nombre para el estado","status.chooseType":"Elige un tipo","status.type.text":"TEXTO","status.type.image":"IMAGEN","status.type.video":"VIDEO","status.type.audio":"AUDIO","status.typeText":"Escribe el texto","status.backgroundColor":"Elige un color de fondo","status.clickToChange":"Haz clic para cambiar color","status.import":"Importar","status.dragHere":"Arrastra el archivo aquí","status.caption":"Leyenda (Opcional)","status.captionPlaceholder":"Agrega una leyenda a tu estado...","status.scheduleStatus":"Programar el estado","status.autoRepost24h":"Republicar el estado cada 24 horas","status.autoRepost":"Republicar Auto","status.postNow":"Publicar Ahora","status.posting":"Publicando...","status.create":"Crear","status.edit":"Editar","status.delete":"Eliminar","status.emoji":"Emoji","status.status.pending":"Pendiente","status.status.posted":"Publicado","status.status.scheduled":"Programado","status.status.failed":"Fallido","ai.regenerate":"Regenerar","ai.regenerating":"Regenerando...","ai.regenerateWithAI":"Regenerar con IA","ai.notEnabled":"La IA no está habilitada. Por favor configure los ajustes de IA.","ai.failedToRegenerate":"Error al regenerar","ai.failedToRegenerateMessage":"Error al regenerar el mensaje","broadcast.title":"Mensajes Masivos","broadcast.newCampaign":"Nueva Campaña","broadcast.reports":"Informes","broadcast.close":"Cerrar","broadcast.sending":"Enviando...","broadcast.paused":"Pausado","broadcast.completed":"Completado","broadcast.clearHistory":"Borrar Historial","broadcast.createCampaign":"Crear Campaña","broadcast.createCampaignSubtitle":"Enviar mensajes personalizados a múltiples contactos","broadcast.scheduledCampaigns":"Campañas Programadas","broadcast.campaignReports":"Informes de Campaña","broadcast.viewManageCampaigns":"Ver y gestionar tus campañas","broadcast.recipients":"Destinatarios","broadcast.selected":"seleccionados","broadcast.contacts":"Contactos","broadcast.groups":"Grupos","broadcast.phone":"Teléfono","broadcast.phonePlaceholder":"Números de teléfono con código de país","broadcast.clearAll":"Borrar Todo","broadcast.contactsUploaded":"contactos cargados","broadcast.noGroupsSelected":'No hay grupos seleccionados. Haga clic en "Agregar Grupos" para seleccionar.',"broadcast.addGroups":"Agregar Grupos","broadcast.groupsSelected":"grupo(s) seleccionado(s)","broadcast.upload":"Cargar","broadcast.select":"Seleccionar","broadcast.download":"Descargar","broadcast.groupsContacts":"Contactos del Grupo","broadcast.tabsContacts":"Contactos de Pestaña","broadcast.kanbanBoard":"Tablero Kanban","broadcast.labelsContacts":"Contactos de Etiqueta","broadcast.allowRepeat":"Permitir Números Repetidos","broadcast.enableLinkPreview":"Habilitar Vista Previa de Enlaces","broadcast.groupActions":"Acciones de Grupo","broadcast.customTabActions":"Acciones de Pestañas","broadcast.labelsActions":"Acciones de Etiquetas","broadcast.kanbanBoardActions":"Acciones de Tablero Kanban","broadcast.skipBulkMessage":"Omitir Mensaje Masivo","broadcast.skipBulkMessageInfo":"Se omitirá el envío de mensajes. Solo se realizarán acciones (Grupos, Pestañas, Etiquetas, Kanban) en los contactos.","broadcast.appendSignature":"Agregar Firma","broadcast.signaturePreview":"Vista previa","broadcast.groupActionsNote":"Nota: Debe ser administrador de los grupos para realizar las acciones siguientes.","broadcast.addIntoGroups":"Agregar a Grupos","broadcast.removeFromGroups":"Eliminar de Grupos","broadcast.selectGroups":"Seleccionar Grupos","broadcast.addIntoTabs":"Agregar a Pestañas","broadcast.removeFromTabs":"Eliminar de Pestañas","broadcast.selectTabs":"Seleccionar Pestañas","broadcast.addToLabels":"Agregar a Etiquetas","broadcast.removeFromLabels":"Eliminar de Etiquetas","broadcast.selectLabels":"Seleccionar Etiquetas","broadcast.addToKanban":"Agregar a Etapa Kanban","broadcast.removeFromKanban":"Eliminar de Etapa Kanban","broadcast.selectCRMStage":"Seleccionar CRM y Etapa","broadcast.sendRandomMessage":"Enviar un mensaje aleatorio a cada contacto","broadcast.addMessage":"Agregar Mensaje","broadcast.pauseSetting":"Configuración de Pausa","broadcast.pauseAfterXSends":"Pausar (después de cada X envíos):","broadcast.pauseTimeInSeconds":"Tiempo de pausa (s):","broadcast.second":"Segundo","broadcast.message":"Mensaje","broadcast.moveUp":"Mover Arriba","broadcast.moveDown":"Mover Abajo","broadcast.deleteMessage":"Eliminar Mensaje","broadcast.templateType":"Tipo de Plantilla","broadcast.messageOnly":"Solo Mensaje","broadcast.enterMessageText":"Por favor ingrese el texto del mensaje","broadcast.variable":"Variable","broadcast.phoneNumber":"Número de Teléfono","broadcast.contactName":"Nombre del Contacto","broadcast.uploadCSVHint":"Cargue CSV con columnas adicionales para agregar más variables","broadcast.selectTemplates":"Seleccionar Plantillas","broadcast.noTemplates":"No hay plantillas disponibles","broadcast.sendingDelay":"Retraso de Envío","broadcast.minimumSecond":"Segundo Mínimo","broadcast.maximumSecond":"Segundo Máximo","broadcast.delayHint":"Cada mensaje se enviará con un retraso aleatorio entre {min}-{max} segundos","broadcast.scheduleMessage":"Programar Mensaje","broadcast.date":"Fecha","broadcast.time":"Hora","broadcast.autoSendIfMissed":"Envío automático si pasó la hora programada","broadcast.recurring":"Recurrente","broadcast.repeatInterval":"Repetir","broadcast.daily":"Diario","broadcast.weekly":"Semanal","broadcast.monthly":"Mensual","broadcast.yearly":"Anual","broadcast.selectDays":"Seleccionar Días","broadcast.sun":"Dom","broadcast.mon":"Lun","broadcast.tue":"Mar","broadcast.wed":"Mié","broadcast.thu":"Jue","broadcast.fri":"Vie","broadcast.sat":"Sáb","broadcast.ends":"Termina","broadcast.endNever":"Nunca","broadcast.endOnDate":"En Fecha","broadcast.recurringHowToUse":"Cómo usar Recurrente","broadcast.recurringTip1":"Habilita recurrente para repetir automáticamente este envío","broadcast.recurringTip2":"Elige frecuencia: Diario, Semanal, Mensual o Anual","broadcast.recurringTip3":"Para Semanal: Selecciona días específicos (Lun, Mar, etc.)","broadcast.recurringTip4":'Establece fecha de fin o elige "Nunca" para ejecutar indefinidamente',"broadcast.recurringTip5":"Después de cada envío, el siguiente se programa automáticamente","broadcast.selectDates":"Seleccionar Fechas","broadcast.selectMonths":"Seleccionar Meses","broadcast.calendarSelectInfo":"Selecciona fechas específicas del calendario. Navega entre meses con las flechas.","broadcast.datesSelected":"fechas seleccionadas","broadcast.jan":"Ene","broadcast.feb":"Feb","broadcast.mar":"Mar","broadcast.apr":"Abr","broadcast.may":"May","broadcast.jun":"Jun","broadcast.jul":"Jul","broadcast.aug":"Ago","broadcast.sep":"Sep","broadcast.oct":"Oct","broadcast.nov":"Nov","broadcast.dec":"Dic","broadcast.quickStart":"Inicio Rápido","broadcast.previewStart":"Vista Previa e Inicio","broadcast.scheduleBroadcast":"Programar Difusión","broadcast.sent":"Enviados","broadcast.failed":"Fallidos","broadcast.resume":"Reanudar","broadcast.pause":"Pausar","broadcast.stop":"Detener","broadcast.resumeCampaign":"¿Reanudar Campaña?","broadcast.campaignInterrupted":"Una campaña fue interrumpida. ¿Desea reanudarla?","broadcast.remaining":"Restantes","broadcast.contactsProcessed":"contactos procesados","broadcast.resumeCampaignBtn":"Reanudar Campaña","broadcast.cancelDiscard":"Cancelar y Descartar","broadcast.dismissRemindLater":"Descartar (Recordar Después)","broadcast.broadcastScheduled":"¡Difusión Programada!","broadcast.campaignPreview":"Vista Previa de Campaña","broadcast.messages":"Mensajes","broadcast.stepSettings":"Configuración","broadcast.stepActions":"Acciones","broadcast.stepReview":"Revisar","broadcast.delayRange":"Rango de Retraso","broadcast.pauseAfterDuration":"Pausar Después / Duración","broadcast.checkConsole":"Revise la consola del navegador para configuración detallada","broadcast.sendingQueue":"Cola de Envío","broadcast.broadcastReports":"Informes de Difusión","broadcast.campaignHistory":"Historial de Campañas","broadcast.noHistoryYet":"Aún no hay historial de difusiones","broadcast.historyDescription":"Sus difusiones completadas y programadas aparecerán aquí","broadcast.noCampaignsYet":"Aún no hay campañas completadas","broadcast.dateTime":"Fecha y Hora","broadcast.status":"Estado","broadcast.scheduled":"Programado","broadcast.cancel":"Cancelar","broadcast.running":"En Ejecución","broadcast.cancelled":"Cancelado","broadcast.downloadAllContacts":"Descargar Todos los Contactos","broadcast.downloadSentContacts":"Descargar Contactos Enviados","broadcast.downloadFailedContacts":"Descargar Contactos Fallidos","broadcast.selectGroupsToAdd":"Seleccionar Grupos para Agregar Contactos","broadcast.selectGroupsToRemove":"Seleccionar Grupos para Eliminar Contactos","broadcast.selectTabsToAdd":"Seleccionar Pestañas para Agregar Contactos","broadcast.selectTabsToRemove":"Seleccionar Pestañas para Eliminar Contactos","broadcast.selectLabelsToAdd":"Seleccionar Etiquetas para Agregar Contactos","broadcast.selectLabelsToRemove":"Seleccionar Etiquetas para Eliminar Contactos","broadcast.selectCRM":"Seleccionar CRM","broadcast.selectStage":"Seleccionar Etapa","broadcast.backToCRMs":"Volver a CRMs","broadcast.loadingGroups":"Cargando grupos...","broadcast.loadingTabs":"Cargando pestañas...","broadcast.loadingLabels":"Cargando etiquetas...","broadcast.noGroupsFound":"No se encontraron grupos donde sea administrador","broadcast.noTabsFound":"No se encontraron pestañas. Cree pestañas primero.","broadcast.noLabelsFound":"No se encontraron etiquetas. Cree etiquetas en WhatsApp primero.","broadcast.noCRMsFound":"No se encontraron CRMs. Cree un CRM primero.","broadcast.noStagesFound":"No se encontraron etapas en este CRM.","broadcast.tabsSelected":"pestañas seleccionadas","broadcast.labelsSelected":"etiquetas seleccionadas","broadcast.confirmSelection":"Confirmar Selección","broadcast.availableVariables":"Variables disponibles","broadcast.of":"de","broadcast.chats":"chats","broadcast.remove":"Eliminar","broadcast.allScheduledCampaigns":"Todas las Campañas Programadas","broadcast.noScheduledCampaigns":"No hay campañas programadas","broadcast.scheduleFirstCampaign":"Programe su primera campaña para verla aquí","broadcast.createNewCampaign":"Crear Nueva Campaña","broadcast.oneTime":"Una vez","broadcast.nextRun":"Próxima ejecución","broadcast.runNow":"Ejecutar Ahora","broadcast.pauseCampaign":"Pausar","broadcast.editCampaign":"Editar","broadcast.deleteCampaign":"Eliminar","broadcast.confirmDeleteScheduled":"¿Está seguro de que desea eliminar esta campaña programada?","broadcast.campaignStarting":"La campaña comenzará en breve","broadcast.skipNext":"Saltar Siguiente","broadcast.unskipNext":"No Saltar","broadcast.skippingNext":"Saltando siguiente","broadcast.lastRun":"Última ejecución","broadcast.runs":"ejecuciones","broadcast.successRate":"éxito","broadcast.justNow":"ahora mismo","broadcast.inAMoment":"en un momento","broadcast.ago":"hace","broadcast.in":"en","broadcast.uploadContacts":"Subir Contactos","broadcast.stepSelect":"Seleccionar","broadcast.stepMap":"Mapear","broadcast.stepUpload":"Subir","broadcast.uploadCSVImport":"Sube un archivo CSV para importar contactos","broadcast.uploadCSVOnly":"Solo archivos CSV (.csv)","broadcast.downloadSampleFile":"Descargar archivo de muestra","broadcast.phoneNumberLabel":"Número de Teléfono:","broadcast.mapColumnHint":"mapea la columna con datos de 'Número de Teléfono'","broadcast.chooseExtraColumns":"Elige columnas adicionales para mensajes personalizados.","broadcast.all":"Todos","broadcast.none":"Ninguno","broadcast.previous":"Anterior","broadcast.next":"Siguiente","broadcast.removeUnwantedRows":"Eliminar Filas No Deseadas","broadcast.totalContacts":"Total de Contactos","broadcast.startUpload":"Iniciar Carga","broadcast.rows":"filas","broadcast.selectGroupsTitle":"Seleccionar Grupos","broadcast.searchGroups":"Buscar grupos...","broadcast.members":"miembros","broadcast.groupsSelectedCount":"grupos seleccionados","broadcast.addGroupsBtn":"Agregar Grupos","broadcast.tooltipBold":"Negrita","broadcast.tooltipItalic":"Cursiva","broadcast.tooltipStrikethrough":"Tachado","broadcast.tooltipAddMedia":"Agregar media","broadcast.tooltipRefresh":"Actualizar","broadcast.noCompletedCampaigns":"Aún no hay campañas completadas","kanban.title":"CRM KANBAN","kanban.user":"Usuario","kanban.darkMode":"Modo Oscuro","kanban.lightMode":"Modo Claro","kanban.menu":"Menú","kanban.createCRM":"Crear CRM","kanban.addStage":"Agregar Etapa","kanban.analytics":"Analíticas","kanban.sync":"Sincronizar","kanban.cannotAddStages":"No se pueden agregar etapas al CRM de Etiquetas de WhatsApp","kanban.inbox":"BANDEJA","kanban.unread":"No leídos","kanban.pinned":"Fijados","kanban.groups":"Grupos","kanban.stages":"etapas","kanban.chats":"chats","kanban.searchInbox":"Buscar chats en BANDEJA...","kanban.searchContacts":"Buscar...","kanban.stageOptions":"Opciones de etapa","kanban.renameStage":"Renombrar","kanban.clearSearch":"Limpiar búsqueda","kanban.noChatsMatch":"No hay chats que coincidan","kanban.noChatsYet":"Aún no hay chats","kanban.filterUnread":"Filtrar chats no leídos","kanban.filterPinned":"Filtrar chats fijados","kanban.filterGroups":"Filtrar chats de grupo","kanban.addNewStage":"Agregar nueva etapa","kanban.noCRMsFound":"No se encontraron CRMs","kanban.selectCRM":"Seleccione un CRM del menú","kanban.loading":"Cargando Kanban CRM...","kanban.syncingLabels":"Sincronizando Etiquetas de WhatsApp y Pestañas...","kanban.switchCRM":"Cambiar CRM","kanban.createNewCRM":"Crear Nuevo CRM","kanban.enterCRMName":"Ingrese nombre del CRM...","kanban.addNewStageTitle":"Agregar Nueva Etapa","kanban.enterStageName":"Ingrese nombre de etapa...","kanban.editStage":"Editar Etapa","kanban.editStageName":"Editar nombre de etapa","kanban.deleteStage":"Eliminar etapa","kanban.editCRM":"Editar CRM","kanban.deleteCRM":"Eliminar CRM","kanban.confirmDeleteStage":"¿Está seguro? Los chats se moverán a BANDEJA.","kanban.cannotDeleteInbox":"No se puede eliminar la etapa BANDEJA.","kanban.cannotAddStagesLabels":"No se pueden agregar etapas al CRM de Etiquetas. Las etiquetas se sincronizan desde WhatsApp.","kanban.chatsLoadedSuccess":"¡Chats cargados exitosamente!","kanban.failedLoadChats":"Error al cargar chats. Asegúrese de estar en WhatsApp Web.","kanban.noAvailableChats":"No hay chats disponibles.","kanban.enterNewCRMName":"Ingrese nuevo nombre del CRM:","kanban.name":"Nombre","kanban.phone":"Teléfono","kanban.lastMessage":"Último Mensaje","kanban.noMessages":"Sin mensajes","kanban.unreadCount":"No leídos","kanban.type":"Tipo","kanban.groupChat":"Chat de Grupo","kanban.individualChat":"Chat Individual","kanban.status":"Estado","kanban.dealValue":"Valor del Trato (EUR)","kanban.enterDealValue":"Ingrese valor","kanban.notes":"Notas","kanban.addNotes":"Agregar notas sobre este chat...","kanban.justNow":"Ahora","kanban.group":"Grupo","kanban.muted":"Silenciado","kanban.save":"Guardar","kanban.cancel":"Cancelar","kanban.close":"Cerrar","kanban.analyticsTitle":"Panel de Analíticas","kanban.analyticsSubtitle":"Métricas e información de rendimiento","kanban.exportCSV":"Exportar a CSV","kanban.exportPDF":"Exportar a PDF","kanban.noAnalyticsData":"No hay datos de analíticas","kanban.from":"Desde:","kanban.to":"Hasta:","kanban.totalChats":"Total de Chats","kanban.pipelineValue":"Valor del Pipeline","kanban.activeStages":"Etapas activas","kanban.stagePerformance":"Rendimiento por Etapa","kanban.stage":"Etapa","kanban.value":"Valor","kanban.avgTime":"Tiempo Prom.","kanban.conversion":"Conversión","kanban.chatDistribution":"Distribución de Chats","kanban.allTime":"Todo el tiempo","kanban.today":"Hoy","kanban.last7Days":"Últimos 7 días","kanban.last30Days":"Últimos 30 días","kanban.allowPopups":"Por favor permita popups para exportar PDF","kanban.addSampleChat":"Agregar Chat de Ejemplo","kanban.crmName":"Nombre del CRM","kanban.stageName":"Nombre de la Etapa","kanban.saveChanges":"Guardar Cambios","kanban.createFirstCRM":"Crea tu primer CRM para organizar tus chats de WhatsApp.","kanban.noStagesFound":"No se encontraron etapas en este CRM.","kanban.syncOrAddStages":"Sincroniza datos de WhatsApp o agrega etapas personalizadas.","kanban.chatDetails":"Detalles del Chat","kanban.notAvailable":"N/D","kanban.addNotesPlaceholder":"Agregar notas sobre este chat...","kanban.thisWeek":"esta semana","kanban.avg":"Prom","kanban.stagesLabel":"Etapas","kanban.activePipelineStages":"Etapas activas del pipeline","kanban.customRange":"Rango Personalizado","kanban.dateRange":"Rango de Fechas","kanban.confirmDeleteCrm":"¿Estás seguro de que deseas eliminar este CRM? Esto eliminará todas las etapas y chats.","kanban.openInWhatsApp":"Abrir en WhatsApp","kanban.removeFromStage":"Eliminar de la etapa","kanban.openCRM":"Abrir CRM","kanban.addNote":"Agregar Nota","kanban.scheduleMessage":"Programar Mensaje","kanban.addIncome":"Agregar Ingreso","kanban.whatsappNotOpen":"WhatsApp Web no está abierto. Por favor, abre WhatsApp Web primero.","kanban.failedToOpenChat":"Error al abrir el chat en WhatsApp","kanban.removeFromStageConfirm":"¿Estás seguro de que quieres eliminar este chat de la etapa actual?","kanban.failedToRemove":"Error al eliminar el chat de la etapa","kanban.failedToOpenCRM":"Error al abrir CRM","kanban.chatPopup":"Chat","kanban.typeMessage":"Escribe un mensaje...","kanban.sendMessage":"Enviar","kanban.loadingMessages":"Cargando mensajes...","kanban.failedToLoadMessages":"Error al cargar mensajes","kanban.failedToSendMessage":"Error al enviar mensaje","kanban.yesterday":"Ayer","kanban.refresh":"Actualizar","kanban.loadingMedia":"Cargando...","kanban.clickToLoad":"Clic para cargar","kanban.addToStage":"Añadir a Etapa CRM","kanban.selectCrmStage":"Seleccionar CRM y Etapa","kanban.retry":"Reintentar","kanban.attach":"Adjuntar archivo","kanban.addCaption":"Añadir un título...","kanban.audioMessage":"Mensaje de audio","kanban.document":"Documento","kanban.location":"Ubicación","kanban.contact":"Contacto","kanban.quickReply":"Respuesta Rápida","kanban.fluxo":"Fluxo","kanban.more":"más","kanban.showLess":"Mostrar menos","kanban.noQuickReplies":"Sin respuestas rápidas","kanban.noFluxos":"Sin flujos activos","kanban.users":"Usuarios","kanban.usersBreakdown":"Desglose por Usuario","kanban.searchUsers":"Buscar usuarios por nombre o número...","kanban.noUsersFound":"No se encontraron usuarios","kanban.tryDifferentSearch":"Intenta con un término diferente","kanban.crm":"CRM","kanban.tabs":"Pestañas","kanban.labels":"Etiquetas","kanban.crmBreakdown":"Desglose por Etapa CRM","kanban.tabsBreakdown":"Desglose por Pestañas","kanban.labelsBreakdown":"Desglose por Etiquetas","kanban.noDataFound":"No se encontraron datos","kanban.addDataToSeeAnalytics":"Agregue datos de ingresos/gastos a los contactos para ver análisis","kanban.incomeVsExpense":"Ingresos vs Gastos por","kanban.contacts":"contactos","kanban.netProfit":"GANANCIA NETA","kanban.crmProfit":"Ganancia CRM","kanban.tabsProfit":"Ganancia Pestañas","kanban.labelsProfit":"Ganancia Etiquetas","kanban.profitDistribution":"Distribución de Ganancias","kanban.sourceComparison":"Comparación de Fuentes","kanban.totalContacts":"Contactos Totales","kanban.avgPerSource":"Promedio por Fuente","kanban.loadingMore":"Cargando más...","kanban.allChatsLoaded":"Todos los chats cargados","kanban.dragToReorder":"Arrastra para reordenar","crm.categoryBreakdown":"Desglose por Categoría","crm.incomeByCategory":"Ingresos por Categoría","crm.expenseByCategory":"Gastos por Categoría","crm.paymentMethodBreakdown":"Desglose por Método de Pago","crm.incomeByPayment":"Ingresos por Método de Pago","crm.expenseByPayment":"Gastos por Método de Pago","crm.userWiseBreakdown":"Desglose por Usuario","crm.net":"Neto","crm.transactions":"Transacciones","crm.margin":"Margen","crm.netProfit":"Ganancia Neta","chart.income":"Ingresos","chart.expense":"Gastos","chart.profit":"Ganancia","chart.noDataAvailable":"No hay datos disponibles","chart.noProfitData":"No hay datos de ganancias disponibles","chart.noTrendData":"No hay datos de tendencias disponibles","bulkValidator.title":"Validador de Números Masivo","bulkValidator.subtitle":"Valida números de WhatsApp en masa con campañas","bulkValidator.menu":"Menú","bulkValidator.activeCampaigns":"Campañas Activas","bulkValidator.completed":"Completadas","bulkValidator.noActiveCampaigns":"No hay campañas activas. Inicia una nueva para validar números.","bulkValidator.noCompleted":"Aún no hay campañas completadas.","bulkValidator.createHint":"Sube un CSV de números e inicia una validación.","bulkValidator.newCampaign":"Nueva Campaña de Validación","bulkValidator.createCampaign":"Crear Nueva Campaña","bulkValidator.campaignName":"Nombre de la Campaña","bulkValidator.enterCampaignName":"Ingrese el nombre de la campaña","bulkValidator.countryCode":"Código de País","bulkValidator.countryCodeHint":"Seleccione el código de país para números sin prefijo","bulkValidator.uploadCSV":"Subir Archivo CSV","bulkValidator.csvHint":"Archivo CSV con números telefónicos (uno por línea o separados por comas)","bulkValidator.numbersFound":"números encontrados","bulkValidator.enterNameAndUpload":"Por favor ingrese el nombre de la campaña y suba los números","bulkValidator.createAndStart":"Crear Campaña","bulkValidator.campaigns":"Campañas","bulkValidator.noCampaigns":"Aún no hay campañas. Cree una para comenzar a validar números.","bulkValidator.confirmDelete":"¿Está seguro de que desea eliminar esta campaña?","bulkValidator.valid":"Válido","bulkValidator.invalid":"Inválido","bulkValidator.pending":"Pendiente","bulkValidator.start":"Iniciar","bulkValidator.pause":"Pausar","bulkValidator.downloadValid":"Descargar Números Válidos","bulkValidator.downloadInvalid":"Descargar Números Inválidos","bulkValidator.downloadAll":"Descargar Todos","bulkValidator.all":"Todos","tools.allTools":"Todas las Herramientas","tools.subtitle":"Haz clic para abrir • Arrastra al encabezado para fijar","tools.featureSettings":"Configuración de Funciones","tools.pinnedTooltip":"Fijado en el encabezado (arrastre a Herramientas para soltar)","tools.itemTooltip":"{name} — haz clic para abrir o arrastra al encabezado para fijar","tools.category.communication":"Comunicación","tools.category.management":"Gestión","tools.category.automation":"Automatización","tools.category.validation":"Validación","webhook.title":"Webhooks","webhook.subtitle":"Enviar datos de contacto a otra aplicación después de la ejecución de eventos registrados","webhook.events":"eventos","webhook.quickResponses":"Respuestas Rápidas","webhook.appointment":"Cita","webhook.reminder":"Recordatorio","webhook.contactProfile":"Perfil de Contacto","webhook.notes":"Notas","webhook.income":"Ingresos","webhook.expense":"Gastos","webhook.kanban":"Kanban","webhook.labels":"Etiquetas","webhook.customTabs":"Pestañas Personalizadas","webhook.messages":"Mensajes","webhook.todos":"Lista de Tareas","webhook.webhookData":"Datos de WebHook","webhook.webhookUrl":"URL de WebHook","webhook.enterUrl":"Ingrese la URL de destino aquí","webhook.active":"Activo","webhook.dataToSend":"Datos a enviar","webhook.lastUploads":"Últimas cargas (máximo 30 vistas)","webhook.noUploads":"Sin cargas aún","webhook.close":"Cerrar","webhook.save":"Guardar","webhook.saving":"Guardando...","webhook.field.eventDetails":"Detalles del Evento","webhook.field.number":"Número","webhook.field.name":"Nombre","webhook.field.picture":"Foto","webhook.field.labels":"Etiquetas","webhook.field.contactProfile":"Perfil de Contacto","webhook.field.appointmentTime":"Hora de la Cita","webhook.field.meetingLink":"Enlace de Reunión","webhook.field.reminderTopic":"Tema del Recordatorio","webhook.field.reminderTime":"Hora del Recordatorio","webhook.field.reminderDetails":"Detalles del Recordatorio","webhook.field.email":"Correo Electrónico","webhook.field.gender":"Género","webhook.field.dateOfBirth":"Fecha de Nacimiento","webhook.field.address":"Dirección","webhook.field.details":"Detalles","webhook.field.customFields":"Campos Personalizados","webhook.field.noteTopic":"Tema de la Nota","webhook.field.noteContent":"Contenido de la Nota","webhook.field.noteTimestamp":"Marca de Tiempo de la Nota","webhook.field.amount":"Cantidad","webhook.field.category":"Categoría","webhook.field.paymentMethod":"Método de Pago","webhook.field.description":"Descripción","webhook.field.reference":"Referencia/Factura","webhook.field.referenceBill":"Referencia/Recibo","webhook.field.transactionDate":"Fecha de Transacción","webhook.field.status":"Estado","webhook.field.cardTitle":"Título de la Tarjeta","webhook.field.columnName":"Columna/Etapa","webhook.field.cardDescription":"Descripción de la Tarjeta","webhook.field.labelId":"ID de Etiqueta","webhook.field.labelName":"Nombre de Etiqueta","webhook.field.labelColor":"Color de Etiqueta","webhook.field.allLabels":"Todas las Etiquetas del Contacto","webhook.field.tabId":"ID de Pestaña","webhook.field.tabName":"Nombre de Pestaña","webhook.field.tabColor":"Color de Pestaña","webhook.field.allTabs":"Todas las Pestañas del Contacto","webhook.field.direction":"Dirección (entrante/saliente)","webhook.field.messageContent":"Contenido del Mensaje","webhook.field.messageType":"Tipo de Mensaje","webhook.field.messageId":"ID del Mensaje","webhook.field.mediaUrl":"URL del Medio","webhook.field.quotedMessage":"Mensaje Citado","webhook.field.timestamp":"Marca de Tiempo","webhook.field.ctwaData":"Datos de Meta Ads (CTWA)","webhook.field.todoTitle":"Título de Tarea","webhook.field.todoDescription":"Descripción de Tarea","webhook.field.todoDueDate":"Fecha de Vencimiento","webhook.field.todoPriority":"Prioridad","webhook.field.todoCategory":"Categoría","webhook.field.todoStatus":"Estado","webhook.field.todoSubtasks":"Subtareas","api.configureAPI":"Configurar API","api.manageToken":"Gestiona tu token de API y configuración","api.apiToken":"Token de API","api.generateToken":"Generar Token","api.regenerate":"Regenerar","api.generating":"Generando...","api.copyToken":"Copiar token","api.tokenWarning":"Mantén este token en secreto. Cualquiera con acceso puede enviar mensajes en tu nombre.","api.enableAPI":"Habilitar API","api.apiIsEnabled":"API está actualmente habilitada","api.apiIsDisabled":"API está actualmente deshabilitada","api.openDocumentation":"Abrir Documentación","api.queuePolling":"Sondeo de Cola","api.pollingActive":"Verificando mensajes en cola cada 5 minutos","api.pollingInactive":"Habilitar para procesar mensajes API entrantes","audioTranscribe.title":"Transcripción","audioTranscribe.transcribeAudio":"Transcribir audio","audioTranscribe.copy":"Copiar","audioTranscribe.copied":"¡Copiado!","audioTranscribe.translate":"Traducir","audioTranscribe.translating":"Traduciendo...","audioTranscribe.translated":"¡Traducido!","audioTranscribe.original":"Original:","audioTranscribe.translatedLabel":"Traducido","audioTranscribe.close":"Cerrar","audioTranscribe.requiresChatGPT":"La transcripción de audio requiere clave API de ChatGPT. Configure ChatGPT como su proveedor de IA en configuración.","audioTranscribe.audioNotFound":"No se pudo encontrar la URL del audio. El audio puede no estar disponible.","audioTranscribe.transcriptionFailed":"Falló la transcripción","audioTranscribe.configureAI":"Configure primero los ajustes de IA para usar la traducción.","audioTranscribe.translationFailed":"Falló la traducción","audioTranscribe.translationTimeout":"Tiempo de espera agotado. Inténtelo de nuevo.","aiBot.title":"Bot de IA","aiBot.tab.testChat":"Chat de prueba","aiBot.tab.qaPairs":"Pares de Preguntas y Respuestas","aiBot.tab.aiBehavior":"Comportamiento de IA","aiBot.tab.trainingData":"Datos de entrenamiento","aiBot.tab.escalation":"Escalación","aiBot.tab.dataPreview":"Vista previa de datos","aiBot.tab.actionPrompts":"Indicaciones de acción","aiBot.tab.scheduleTiming":"Horario y temporización","aiBot.tab.trainingDataComingSoon":"La carga de documentos, el rastreo de URL y las fuentes de texto sin formato llegarán en la próxima actualización.","aiBot.tab.escalationComingSoon":"La transferencia automática a un humano después de un número configurable de mensajes sin respuesta llegará en la próxima actualización.","aiBot.tab.dataPreviewComingSoon":"Una vista de solo lectura de cada par de Preguntas y Respuestas, fuente y fragmento al que tiene acceso la IA.","aiBot.comingSoon":"Próximamente","aiBot.qa.addPair":"Agregar par","aiBot.qa.editPair":"Editar par","aiBot.qa.questionLabel":"Pregunta","aiBot.qa.questionPlaceholder":"Lo que los clientes podrían preguntar…","aiBot.qa.answerLabel":"Respuesta","aiBot.qa.answerPlaceholder":"Cómo debe responder la IA…","aiBot.qa.categoryLabel":"Categoría (opcional)","aiBot.qa.categoryPlaceholder":"ej. Precios, Soporte, Incorporación","aiBot.qa.existingPairs":"Pares existentes","aiBot.qa.empty":"Aún no hay pares. Agrega el primero arriba.","aiBot.qa.cancel":"Cancelar","aiBot.qa.update":"Actualizar","aiBot.qa.delete":"Eliminar","aiBot.qa.edit":"Editar","aiBot.qa.enabled":"Activado","aiBot.qa.disabled":"Desactivado","aiBot.qa.on":"Sí","aiBot.qa.off":"No","aiBot.qa.deleteConfirm":"¿Eliminar este par de Preguntas y Respuestas?","aiBot.qa.itemSingular":"par","aiBot.qa.itemPlural":"pares","aiBot.behavior.providerConfig":"Proveedor de IA","aiBot.behavior.provider":"Proveedor","aiBot.behavior.model":"Modelo","aiBot.behavior.apiActive":"API activa","aiBot.behavior.noApiKey":"Sin clave API","aiBot.behavior.apiKeyHint":"Agrega tu clave API en la configuración de Herramientas IA para activar el bot.","aiBot.behavior.triggerWords":"Palabras de activación","aiBot.behavior.triggerWordsPlaceholder":"soporte, ayuda, demo (separadas por comas)","aiBot.behavior.triggerWordsHelp":"Cuando se establecen, el bot solo responde a mensajes que contengan al menos una de estas palabras. Déjalo vacío para responder a todo.","aiBot.behavior.responseSettings":"Ajustes de respuesta","aiBot.behavior.responseTone":"Tono de respuesta","aiBot.behavior.maxResponseLength":"Longitud máxima de respuesta","aiBot.behavior.temperature":"Temperatura","aiBot.behavior.temperatureHelp":"Más baja = más enfocada. Más alta = más creativa.","aiBot.behavior.maxTokens":"Tokens máximos","aiBot.behavior.maxTokensHelp":"Limita el tamaño de la respuesta de IA.","aiBot.behavior.systemPrompt":"Contexto empresarial / Indicación del sistema","aiBot.behavior.systemPromptPlaceholder":"Cuéntale a la IA sobre tu negocio, productos y cómo debería representarte…","aiBot.behavior.systemPromptHelp":"Se utiliza como instrucción base para cada respuesta de la IA.","aiBot.behavior.fallbackMessage":"Mensaje de respaldo","aiBot.behavior.fallbackMessageHelp":"Se envía cuando la IA no tiene un par, fuente o conocimiento general relevante para responder.","aiBot.behavior.saved":"✓ Guardado","aiBot.behavior.saveBehavior":"Guardar comportamiento","aiBot.behavior.tone_friendly":"Amigable","aiBot.behavior.tone_professional":"Profesional","aiBot.behavior.tone_casual":"Casual","aiBot.behavior.tone_formal":"Formal","aiBot.behavior.tone_empathetic":"Empático","aiBot.behavior.length_short":"Corto (~50 palabras)","aiBot.behavior.length_medium":"Medio (~200 palabras)","aiBot.behavior.length_long":"Largo (~400 palabras)","aiBot.kb.urlTitle":"Agregar URL de sitio web","aiBot.kb.urlPlaceholder":"https://ejemplo.com/acerca-de","aiBot.kb.addUrl":"Agregar URL","aiBot.kb.scraping":"Extrayendo…","aiBot.kb.urlHelp":"Obtenemos la página y extraemos su texto visible. Solo de una página: las SPA renderizadas con JS pueden devolver poco contenido.","aiBot.kb.errorEmpty":"No se encontró texto legible en esa URL.","aiBot.kb.errorBlocked":'No se pudo acceder a esa URL. El sitio puede bloquear las solicitudes automatizadas, requerir inicio de sesión o ser renderizado por JS. Intenta copiar el texto en "Pegar texto sin formato" abajo.',"aiBot.kb.blockedChromeStore":'Chrome Web Store bloquea las solicitudes automatizadas. Abre el listado en tu navegador, copia la descripción y pégala en "Pegar texto sin formato" abajo.',"aiBot.kb.blockedGoogle":"Las páginas de Google Docs / Drive / Sheets requieren inicio de sesión y no se pueden extraer. Exporta a PDF/DOCX/TXT y súbelo en su lugar.","aiBot.kb.blockedSocial":'Las redes sociales bloquean las solicitudes automatizadas. Copia el texto relevante y pégalo en "Pegar texto sin formato" abajo.',"aiBot.kb.blockedNotion":"Las páginas de Notion se renderizan con JS y devuelven poco texto. Exporta la página como Markdown/PDF y súbela en su lugar.","aiBot.kb.plainTextTitle":"Pegar texto sin formato","aiBot.kb.textTitlePlaceholder":'Título (opcional, ej. "Política de reembolso")',"aiBot.kb.textBodyPlaceholder":"Pega cualquier texto que la IA deba conocer: precios, FAQs, políticas, instrucciones…","aiBot.kb.charsLabel":"caracteres","aiBot.kb.saveText":"Guardar texto","aiBot.kb.saving":"Guardando…","aiBot.kb.trainingSources":"Fuentes de entrenamiento","aiBot.kb.sourceSingular":"fuente","aiBot.kb.sourcePlural":"fuentes","aiBot.kb.chunkSingular":"fragmento","aiBot.kb.chunkPlural":"fragmentos","aiBot.kb.empty":"Aún no hay fuentes de entrenamiento. Agrega una URL o pega texto sin formato arriba.","aiBot.kb.deleteConfirm":"¿Eliminar esta fuente?","aiBot.kb.uploadTitle":"Subir documentos","aiBot.kb.uploadPrompt":"Haz clic para elegir un archivo, o arrastra y suelta aquí","aiBot.kb.uploadFormats":"PDF, DOCX, TXT, CSV, MD","aiBot.kb.uploadMaxSize":"Máx. 10 MB por archivo","aiBot.kb.parsing":"Procesando…","aiBot.kb.parsingFile":"Procesando","aiBot.esc.enableAuto":"Activar escalación automática","aiBot.esc.enableAutoDesc":"Transfiere automáticamente a un humano cuando la IA no puede ayudar o el cliente lo pide.","aiBot.esc.maxAttempts":"Máx. intentos fallidos","aiBot.esc.maxAttemptsHelp":"Transfiere después de tantas respuestas de respaldo consecutivas (ventana de 24h).","aiBot.esc.triggerPhrases":"Frases activadoras (una por línea)","aiBot.esc.triggerPhrasesHelp":"Cuando alguna de estas frases aparece en un mensaje entrante, el bot escala de inmediato. Coincidencia de subcadena sin distinción de mayúsculas.","aiBot.esc.message":"Mensaje de escalación","aiBot.esc.messageHelp":"Se envía al cliente justo antes de que el bot deje de responder para que un humano pueda hacerse cargo.","aiBot.esc.saveRules":"Guardar reglas de escalación","aiBot.esc.statusOn":"Activado","aiBot.esc.statusOff":"Desactivado","aiBot.preview.qaPairsLabel":"Pares de Preguntas y Respuestas","aiBot.preview.sourcesLabel":"Fuentes","aiBot.preview.chunksLabel":"Fragmentos","aiBot.preview.helpText":"Esto es exactamente a lo que la IA tiene acceso ahora. Los elementos desactivados no se utilizan.","aiBot.preview.escalationSummary":"Escalación","aiBot.preview.escStatus":"Estado","aiBot.preview.escThreshold":"Después de","aiBot.preview.escFailed":"respuestas de respaldo consecutivas","aiBot.preview.escPhrases":"Frases activadoras","aiBot.preview.escNoPhrases":"ninguna","aiBot.preview.qaPairsTitle":"Pares de Preguntas y Respuestas","aiBot.preview.sourcesTitle":"Fuentes de entrenamiento","aiBot.preview.noQa":"No hay pares activados.","aiBot.preview.noSources":"No hay fuentes activadas.","aiBot.fallbackMoved":"La Respuesta de respaldo se ha movido a la pestaña Comportamiento de IA. Tu mensaje existente se conserva automáticamente.","aiBot.businessPromptMoved":"La Indicación empresarial se ha movido a la pestaña Comportamiento de IA. Edítala allí — tu indicación existente se conserva.","aiBot.generalKnowledgeMoved":'El interruptor "Permitir conocimiento general" se ha movido a la pestaña Comportamiento de IA.',"aiBot.stopKeywordsRecommend":"Para nuevas configuraciones recomendamos la pestaña Escalación: añade un contador de intentos y frases activadoras además de los stops por palabra clave. Esta sección sigue funcionando solo para stops por palabra clave.","aiBot.subtitle":"Configurar respuestas automáticas de IA","aiBot.menu":"Menú","aiBot.enableBot":"Habilitar Bot de IA","aiBot.enableBotDesc":"Responder automáticamente a mensajes entrantes","aiBot.replyInGroups":"Responder en Grupos","aiBot.replyInGroupsDesc":"Permitir que el Bot de IA responda en chats grupales (deshabilitado por defecto)","aiBot.allowGeneralKnowledge":"Permitir que IA use Conocimiento General","aiBot.allowGeneralKnowledgeDesc":"Cuando está APAGADO, la IA solo responde según tu prompt de negocio. Cuando está ENCENDIDO, la IA también puede usar su conocimiento general.","aiBot.fallbackReply":"Respuesta de Reserva","aiBot.fallbackReplyDesc":"Cuando la IA no tiene información en tu prompt de negocio, enviará esta respuesta en lugar de inventar respuestas.","aiBot.fallbackReplyPlaceholder":"Ejemplo: ¡Gracias por tu pregunta! No tengo información específica sobre eso ahora mismo. Nuestro equipo te contactará pronto.","aiBot.smartDetection":"Detección Inteligente","aiBot.smartDetectionDesc":"La IA detecta automáticamente frustración o solicitudes de asistencia humana","aiBot.monday":"Lunes","aiBot.tuesday":"Martes","aiBot.wednesday":"Miércoles","aiBot.thursday":"Jueves","aiBot.friday":"Viernes","aiBot.saturday":"Sábado","aiBot.sunday":"Domingo","aiBot.enableWeekdays":"Habilitar días laborales","aiBot.disableWeekdays":"Deshabilitar días laborales","aiBot.enableWeekends":"Habilitar fines de semana","aiBot.disableWeekends":"Deshabilitar fines de semana","aiBot.applyToAll":"Aplicar a todos:","aiBot.apply":"Aplicar","aiBot.day":"Día","aiBot.active":"Activo","aiBot.currentStatus":"Estado actual:","aiBot.botOffToday":"Bot está APAGADO hoy","aiBot.businessPrompt":"Mensaje de Negocio","aiBot.businessPromptDesc":"Personaliza cómo responde la IA. Describe tu negocio, tono y pautas.","aiBot.businessPromptPlaceholder":"Ejemplo: Eres un representante de servicio al cliente de [Nombre del Negocio]. Vendemos [productos/servicios]. Sé amable y profesional.","aiBot.schedule":"Horario del Bot","aiBot.scheduleEnabled":"Habilitar Horario","aiBot.scheduleEnabledDesc":"El bot solo responde durante las horas especificadas","aiBot.startTime":"Hora de Inicio","aiBot.endTime":"Hora de Fin","aiBot.to":"a","aiBot.timezone":"Zona Horaria","aiBot.replyTiming":"Tiempo de Respuesta","aiBot.replyTimingDesc":"Retraso aleatorio antes de que responda la IA","aiBot.minDelay":"Retraso Mínimo (segundos)","aiBot.maxDelay":"Retraso Máximo (segundos)","aiBot.enabledActions":"Acciones Habilitadas","aiBot.enabledActionsDesc":"Elige qué acciones puede realizar la IA","aiBot.actionNormalReply":"Enviar Respuestas","aiBot.actionNormalReplyDesc":"La IA puede enviar mensajes de texto","aiBot.actionKanban":"Actualizar Kanban","aiBot.actionKanbanDesc":"Mover contactos entre etapas de Kanban","aiBot.actionLabels":"Actualizar Etiquetas","aiBot.actionLabelsDesc":"Agregar/quitar etiquetas de WhatsApp","aiBot.actionTabs":"Actualizar Pestañas","aiBot.actionTabsDesc":"Agregar/quitar de pestañas personalizadas","aiBot.actionAppointment":"Crear Citas","aiBot.actionAppointmentDesc":"Programar citas desde la conversación","aiBot.tabsPromptLabel":"Instrucciones personalizadas para gestión de pestañas:","aiBot.tabsPromptPlaceholder":'Ej., Si el usuario pregunta sobre servicios SEO, agregar a pestaña "SEO Leads". Si menciona desarrollo web, agregar a "Web Dev Leads".',"aiBot.meetingLinkLabel":"Enlace de Google Meet:","aiBot.meetingLinkPlaceholder":"https://meet.google.com/xxx-xxxx-xxx","aiBot.meetingLinkDesc":"Este enlace se usará para todas las citas creadas por IA","aiBot.messageTemplateLabel":"Plantilla de Mensaje:","aiBot.messageTemplateDesc":"Este mensaje se enviará como recordatorio de cita","aiBot.varName":"Nombre","aiBot.varDate":"Fecha","aiBot.varTime":"Hora","aiBot.varLink":"Enlace","aiBot.messageTemplatePlaceholder":"Hola {name}, tu cita está programada para el {date} a las {time}. Únete aquí: {link}","aiBot.officeHoursLabel":"Horario de Oficina (Horario de Citas):","aiBot.officeHoursDesc":"La IA solo programará citas dentro de estas horas","aiBot.sendMessageNow":"Enviar mensaje inmediatamente","aiBot.sendMessageNowDesc":"Enviar mensaje de cita justo después de crearla","aiBot.appointmentPromptLabel":"Instrucciones personalizadas para IA:","aiBot.appointmentPromptPlaceholder":"Ej., Al programar citas, siempre sugerir horarios entre 10 AM - 6 PM. Aviso mínimo: 24 horas.","aiBot.actionProfile":"Actualizar Perfil","aiBot.actionProfileDesc":"Extraer y guardar información del contacto","aiBot.contextMessages":"Mensajes de Contexto","aiBot.contextMessagesDesc":"Número de mensajes anteriores para contexto de IA","aiBot.settingsTab":"Configuración","aiBot.promptSettings":"Config. de Prompt","aiBot.actionPrompts":"Prompts de Acciones","aiBot.actionPromptsDesc":"Configura prompts personalizados para diferentes acciones de IA","aiBot.talkToAI":"Hablar con IA","aiBot.testYourBot":"Prueba tu Bot de IA","aiBot.testDescription":"Los mensajes usan la configuración actual (incluidos cambios no guardados)","aiBot.clearChat":"Limpiar Chat","aiBot.typeTestMessage":"Escribe un mensaje de prueba...","aiBot.aiTyping":"IA está escribiendo...","aiBot.noMessages":"Escribe un mensaje para probar cómo responderá tu Bot de IA","aiBot.send":"Enviar","aiBot.copy":"Copiar","aiBot.copied":"¡Copiado!","aiBot.select":"Seleccionar","aiBot.aiNotConfigured":"IA no configurada. Por favor, configura la clave API de IA primero.","aiBot.noResponse":"Sin respuesta de la IA","aiBot.stopKeywords":"Palabras de Parada","aiBot.stopKeywordsInfo":"Cuando el cliente envía alguna de estas palabras, el Bot de IA dejará de responder y lo pondrá en lista negra.","aiBot.enableStopKeywords":"Habilitar Palabras de Parada","aiBot.enableStopKeywordsDesc":"Detener automáticamente el Bot de IA cuando el cliente solicite asistencia humana","aiBot.keywords":"Palabras Clave","aiBot.noKeywords":"No hay palabras clave agregadas","aiBot.enterKeyword":"Ingresa palabra clave...","aiBot.add":"+ Agregar","aiBot.stopMessage":"Mensaje de Parada","aiBot.stopMessagePlaceholder":"Mensaje enviado cuando se detecta palabra de parada...","aiBot.stopMessageHint":"Este mensaje se enviará al cliente cuando se detecte una palabra de parada.","aiBot.responseMode":"Modo de Respuesta:","aiBot.aiBotPrompt":"Prompt del Bot IA","aiBot.globalChatGPT":"ChatGPT Global","aiBot.newChat":"Nuevo Chat","aiBot.clearAll":"Borrar Todo","aiBot.searchChats":"Buscar chats...","aiBot.noSearchResults":"No se encontraron chats","aiBot.noChatsYet":"Aún no hay historial de chat","aiBot.deleteChat":"Eliminar chat","aiBot.chatsStored":"chats guardados","aiBot.clearAllTitle":"¿Borrar Todos los Chats?","aiBot.clearAllDesc":"Esto eliminará permanentemente todo tu historial de chat. Esta acción no se puede deshacer.","aiBot.messages":"mensajes","aiBot.today":"Hoy","aiBot.yesterday":"Ayer","crm.aiBotBlacklist":"Bot de IA","crm.aiBotEnabled":"Habilitado para este contacto","crm.aiBotDisabled":"Deshabilitado para este contacto","common.saved":"Guardado","crm.chatbotFlow":"Flujo de Chatbot","crm.chatbotFlowDesc":"Crear bots de respuesta automática por palabras clave","crm.createNewFlow":"Crear nuevo flujo","crm.noFlowsYet":"Aún no hay flujos","crm.createFirstFlow":"Crea tu primer flujo de chatbot","crm.active":"Activo","crm.inactive":"Inactivo","crm.flowName":"Nombre del Flujo","crm.untitledFlow":"Flujo sin título","crm.duplicate":"Duplicar","crm.triggers":"Disparadores","crm.actions":"Acciones","crm.rules":"Reglas","crm.chatbotFlows":"Flujos de chatbot","crm.exportFlows":"Exportar","crm.importFlows":"Importar","crm.exportAll":"Exportar todo","crm.exportSelected":"Exportar seleccionados","crm.selectFlowsToExport":"Seleccionar flujos para exportar","crm.importSuccess":"¡Flujos importados exitosamente!","crm.importError":"Error al importar flujos","crm.invalidFlowFile":"Formato de archivo de flujo inválido","crm.duplicateFlowFound":"Flujo duplicado encontrado","crm.flowAlreadyExists":"'{name}' ya existe. ¿Qué te gustaría hacer?","crm.replaceFlow":"Reemplazar","crm.skipFlow":"Omitir","crm.renameAndAdd":"Renombrar y agregar","crm.noFlowsSelected":"Por favor selecciona al menos un flujo","crm.noFlowsToExport":"No hay flujos para exportar","crm.flowsExported":"{count} flujo(s) exportado(s)","crm.flowsImported":"{count} flujo(s) importado(s)","crm.selected":"seleccionado(s)","crm.enabled":"Habilitado","crm.allFlows":"Todos","crm.byCategory":"Categorías","crm.viewAllFlows":"Ver todos los flujos","crm.viewByCategory":"Ver por categoría","crm.addFluxoCategory":"Agregar categoría","crm.manageCategories":"Gestionar categorías","crm.editCategory":"Editar categoría","crm.createCategory":"Crear categoría","crm.createCategoryBtn":"Crear categoría","crm.fluxoCategoryName":"Nombre","crm.categoryIcon":"Icono","crm.categoryColor":"Color","crm.preview":"Vista previa","crm.custom":"Personalizado","crm.enterFluxoCategoryName":"Ingrese nombre de categoría","crm.fluxoCategoryNameRequired":"El nombre de categoría es obligatorio","crm.fluxoCategoryNameExists":"Ya existe una categoría con este nombre","crm.confirmDeleteCategory":"¿Eliminar esta categoría? Los flujos se moverán a Sin categorizar.","crm.uncategorized":"Sin categorizar","crm.noFlowsInCategory":"No hay flujos en esta categoría","crm.dragFlowsHere":"Arrastra flujos aquí para organizar","crm.dropHere":"Soltar aquí","crm.dragToMove":"Arrastrar para mover","crm.noCategoriesYet":"Aún no hay categorías","crm.createCategoryHint":"Crea una categoría para organizar tus flujos","crm.createFirstCategory":"Crear primera categoría","crm.tourViewToggleTitle":"Cambiar vista","crm.tourViewToggleContent":"Cambia entre vista de todos los flujos y vista por categorías para organizar tus chatbots.","crm.tourCategoryViewTitle":"Vista de categorías","crm.tourCategoryViewContent":"Haz clic aquí para ver tus flujos organizados por categorías.","crm.tourAddCategoryTitle":"Crear categorías","crm.tourAddCategoryContent":"Haz clic aquí para crear una nueva categoría con nombre, icono y color personalizados.","crm.tourDragDropTitle":"Arrastrar y soltar","crm.tourDragDropContent":"Arrastra cualquier tarjeta de flujo y suéltala en una categoría para organizar tus flujos.","crm.tourCategorySectionTitle":"Secciones de categoría","crm.tourCategorySectionContent":"Haz clic para expandir o contraer categorías. Edita o elimina categorías usando los botones.","crm.skipTour":"Omitir","crm.finishTour":"¡Entendido!","crm.next":"Siguiente","crm.previous":"Anterior","crm.allFollowUps":"Todos los Follow-Ups","crm.addFollowUpCategory":"Agregar categoría","crm.editFollowUpCategory":"Editar categoría","crm.createFollowUpCategory":"Crear categoría","crm.followUpCategoryName":"Nombre","crm.enterFollowUpCategoryName":"Ingrese nombre de categoría","crm.followUpCategoryNameRequired":"El nombre de categoría es obligatorio","crm.followUpCategoryNameExists":"Ya existe una categoría con este nombre","crm.confirmDeleteFollowUpCategory":"¿Eliminar esta categoría? Los follow-ups se moverán a Sin categorizar.","crm.noFollowUpsInCategory":"No hay follow-ups en esta categoría","crm.simulateFlow":"Simular flujo","crm.start":"Iniciar","crm.actionBlocks":"Bloques de acción","crm.anyMessage":"Cualquier mensaje","crm.keywords":"Palabras clave","crm.addKeyword":"Agregar palabra clave","crm.firstMessageOfDay":"Primer mensaje del día","crm.firstMessageEver":"Primer mensaje de siempre","crm.sendText":"Enviar Texto","crm.sendTextDesc":"Enviar un mensaje de texto.","crm.sendImage":"Enviar Imagen","crm.sendImageDesc":"Enviar una imagen con descripción.","crm.sendVideo":"Enviar Video","crm.sendVideoDesc":"Enviar un video con descripción.","crm.sendAudio":"Enviar Audio","crm.sendAudioDesc":"Enviar un archivo de audio.","crm.sendDocument":"Enviar Documento","crm.sendDocumentDesc":"Enviar un archivo de documento.","crm.responses":"Respuestas","crm.responsesDesc":"Esperar respuesta del usuario y ramificar el flujo.","crm.sendList":"Enviar Lista","crm.sendListDesc":"Enviar un mensaje de lista interactiva.","fluxo.waitInput":"Esperar Entrada","fluxo.waitInputDesc":"Esperar respuesta validada del usuario","fluxo.promptMessage":"Mensaje de Solicitud","fluxo.enterPromptMessage":"Ingrese el mensaje para pedir entrada al usuario...","fluxo.inputType":"Tipo de Entrada (Validación)","fluxo.inputTypeString":"Texto (Cualquiera)","fluxo.inputTypePhone":"Número de Teléfono","fluxo.inputTypeNumber":"Número","fluxo.inputTypeEmail":"Correo Electrónico","fluxo.inputTypeUrl":"URL","fluxo.inputTypeDatetime":"Fecha/Hora","fluxo.phoneHint":"Formato: +5511999999999 (con código de país)","fluxo.emailHint":"Formato: usuario@ejemplo.com","fluxo.numberHint":"Acepta enteros y decimales","fluxo.urlHint":"Formato: https://ejemplo.com","fluxo.datetimeHint":"Formato: AAAA-MM-DD o AAAA-MM-DDTHH:MM","fluxo.stringHint":"Acepta cualquier texto","fluxo.saveResponseAs":"Guardar Respuesta Como Variable","fluxo.variableName":"entradaUsuario","fluxo.useVariableHint":"Usa {nombreVariable} en mensajes posteriores","fluxo.errorMessage":"Mensaje de Error (entrada inválida)","fluxo.invalidInputDefault":"Entrada inválida. Por favor, inténtelo de nuevo.","fluxo.timeout":"Tiempo de Espera","fluxo.seconds":"Segundos","fluxo.minutes":"Minutos","fluxo.hours":"Horas","fluxo.timeoutHint":"Si no hay respuesta válida en este tiempo, se ejecutará la rama de timeout.","fluxo.customRegex":"Regex Personalizado (Opcional)","fluxo.regexPlaceholder":"^[A-Z]{2}[0-9]{4}$","fluxo.customRegexHint":"Anula la validación del tipo de entrada con un patrón personalizado","fluxo.outputConnections":"Conexiones de Salida","fluxo.response":"respuesta","fluxo.validInputReceived":"Cuando se recibe entrada válida","fluxo.noResponseTimeout":"Cuando expira el tiempo sin respuesta válida","fluxo.validResponse":"Respuesta Válida","fluxo.onInvalidInput":"Si es inválido:","fluxo.promptMessageInfo":"El mensaje enviado al usuario pidiendo su entrada. Se mostrará antes de esperar su respuesta.","fluxo.inputTypeInfo":"Seleccione el tipo de entrada que espera. El sistema validará la respuesta del usuario contra este formato.","fluxo.saveResponseAsInfo":"El nombre de variable para guardar la respuesta válida del usuario. Use {nombreVariable} en mensajes posteriores para mostrar este valor.","fluxo.errorMessageInfo":"Mensaje enviado al usuario cuando su entrada no coincide con el formato esperado. Se le pedirá que intente de nuevo.","fluxo.timeoutInfo":"Tiempo máximo para esperar una respuesta válida. Si se excede, se ejecuta la rama de tiempo de espera en lugar de la rama de respuesta.","fluxo.customRegexInfo":"Avanzado: Proporcione un patrón de expresión regular personalizado para validar la entrada. Esto anula la validación del tipo de entrada seleccionado.","fluxo.delayInfo":"Tiempo de espera en segundos antes de enviar el mensaje de solicitud. Útil para un flujo de conversación natural.","crm.groupAction":"Acción de Grupo","crm.tabAction":"Acción de Pestaña","crm.labelAction":"Acción de Etiqueta","crm.crmAction":"Acción CRM","crm.smartWait":"Espera Inteligente","crm.smartWaitDesc":"Esperar un tiempo aleatorio entre mensajes","crm.typingIndicator":"Indicador de Escritura","crm.typingIndicatorDesc":"Mostrar burbuja de escritura antes de enviar","crm.waitDuration":"Duración de Espera:","crm.typingDuration":"Duración de Escritura:","crm.randomDelay":"Retraso Aleatorio:","crm.randomDelayBetween":"Retraso aleatorio entre","crm.randomBetween":"Retraso aleatorio entre","crm.showsTypingFor":"Muestra indicador de escritura por","crm.showsTyping":"Muestra escritura por","crm.typingPreview":"Así aparece el indicador de escritura al contacto","crm.addFluxo":"Agregar Fluxo","crm.addFluxoDesc":"Ejecutar otro flujo","crm.selectFlowToCall":"Seleccionar flujo a ejecutar:","crm.noFlowSelected":"Ningún flujo seleccionado","crm.passVariables":"Pasar variables al flujo llamado","crm.passVariablesHint":"Las variables del flujo actual estarán disponibles en el flujo llamado","crm.passVariablesUseCase":'💡 Ejemplo: Flujo principal tiene {name}="Juan" → Sub-flujo mensaje "¡Hola {name}!" → Muestra "¡Hola Juan!". Desactivar para iniciar sub-flujo sin variables.',"crm.passVariablesShort":"Pasar vars","crm.continueAfterFlow":"Continuar después de que termine el flujo llamado","crm.continueAfterFlowHint":"Desmarcar para terminar la conversación cuando el flujo llamado complete","crm.continueAfterFlowUseCase":"💡 Ejemplo: ON = Sub-flujo de bienvenida termina → vuelve al flujo principal. OFF = Sub-flujo termina = conversación termina (como flujo de Pedido Completo).","crm.continueAfterShort":"Continuar después","crm.circularWarning":"¡Advertencia: Referencia circular detectada!","crm.circularWarningHint":"El flujo seleccionado contiene un nodo 'Agregar Fluxo' que apunta a este flujo. Esto puede causar bucles infinitos.","crm.selectFlowPlaceholder":"Seleccionar un flujo...","crm.noOtherFlows":"No hay otros flujos disponibles. Crea otro flujo primero.","crm.delayBeforeCalling":"Retraso antes de llamar (segundos):","crm.executionSummary":"Resumen de Ejecución:","crm.variablesWillBe":"Las variables serán","crm.passed":"pasadas","crm.notPassed":"no pasadas","crm.executeFlow":"Ejecutar","crm.continueToNext":"Continuar al siguiente nodo","crm.endConversation":"Terminar conversación","crm.selectedFlow":"Flujo Seleccionado:","crm.addToGroups":"Agregar a Grupos","crm.removeFromGroups":"Eliminar de Grupos","crm.addToTabs":"Agregar a Pestañas","crm.removeFromTabs":"Eliminar de Pestañas","crm.addLabels":"Agregar Etiquetas","crm.removeLabels":"Eliminar Etiquetas","crm.addToCrmStage":"Agregar a Etapa CRM","crm.removeFromCrm":"Eliminar de CRM","crm.actionType":"Tipo de Acción:","crm.selectGroups":"Seleccionar Grupos:","crm.loadGroups":"Cargar Grupos","crm.loadGroupsFromWhatsApp":"Cargar grupos desde WhatsApp Web","crm.selectTabs":"Seleccionar Pestañas:","crm.selectLabels":"Seleccionar Etiquetas:","crm.syncLabels":"Sincronizar Etiquetas","crm.searchLabels":"Buscar etiquetas...","crm.searchTabs":"Buscar pestañas...","crm.searchGroups":"Buscar grupos...","crm.selectCrm":"Seleccionar CRM:","crm.selectStage":"Seleccionar Etapa:","crm.selectCrmPlaceholder":"Seleccionar CRM...","crm.selectStagePlaceholder":"Seleccionar etapa...","crm.noGroupsSelected":"Ningún grupo seleccionado","crm.noTabsSelected":"Ninguna pestaña seleccionada","crm.noLabelsSelected":"Ninguna etiqueta seleccionada","crm.noCrmSelected":"Ningún CRM/Etapa seleccionado","crm.noGroupsAvailable":"No hay grupos disponibles.","crm.noTabsAvailable":"No hay pestañas disponibles.","crm.noCrmsAvailable":"No hay CRMs disponibles.","crm.noStagesAvailable":"No hay etapas en este CRM.","crm.delay":"Retraso (segundos):","crm.selectedGroups":"Grupos:","crm.selectedTabs":"Pestañas:","crm.selectedLabels":"Etiquetas:","crm.targetCrmStage":"CRM → Etapa:","crm.targetCrm":"CRM objetivo:","crm.schedule":"Horario","crm.enableSchedule":"Habilitar horario","crm.startTime":"Hora de inicio","crm.endTime":"Hora de fin","crm.crmRules":"Reglas CRM","crm.whenAnyMessage":"Cuando se recibe cualquier mensaje.","crm.whenKeywordMatch":"Cuando el mensaje contiene palabras clave.","crm.byKeywordInMessage":"Por palabra clave en el mensaje","crm.firstMessageDay":"Primer mensaje del cliente del día.","crm.reactivationInterval":"Intervalo de reactivación:","crm.generalRules":"Reglas generales:","crm.allowGroups":"Permitir responder a grupos","crm.scheduleEnabled":"Permitir respuestas solo en días y horarios específicos","crm.dontRespondIfOpen":"No responder si la conversación está abierta","crm.customSignature":"Personalizar o desactivar la firma","crm.simulateTyping":"Simular escritura o grabación de audio","crm.dontRespondIfInCRM":"No responder si el contacto está en un CRM","crm.dontRespondToCRMs":"No responder a CRMs","crm.respondOnlyToCRMs":"Responder solo a CRMs","crm.enableCrmRules":"Habilitar reglas de pestañas CRM","crm.selectCrmTabs":"Seleccionar pestañas CRM","crm.tagRules":"Reglas de Etiquetas","crm.labelRules":"Reglas de etiquetas:","crm.dontRespondIfLabeled":"No responder si el contacto tiene etiqueta","crm.dontRespondToLabels":"No responder a etiquetas","crm.respondOnlyToLabels":"Responder solo a etiquetas","crm.selectLabelsNotToReply":"Seleccionar etiquetas para no responder:","crm.selectLabelsToReply":"Seleccionar etiquetas para responder:","crm.clickToSelect":"Haz clic para seleccionar","crm.labelsNotReplied":"Etiquetas que no se responderán:","crm.labelsToReply":"Etiquetas que se responderán:","crm.customTabRules":"Reglas de pestañas personalizadas:","crm.dontRespondIfInCustomTab":"No responder si el contacto está en pestaña personalizada","crm.dontRespondToCustomTabs":"No responder a pestañas personalizadas","crm.respondOnlyToCustomTabs":"Responder solo a pestañas personalizadas","crm.selectCustomTabsNotToReply":"Seleccionar pestañas para no responder:","crm.selectCustomTabsToReply":"Seleccionar pestañas para responder:","crm.customTabsNotReplied":"Pestañas que no se responderán:","crm.customTabsToReply":"Pestañas que se responderán:","crm.noCustomTabsAvailable":"No hay pestañas personalizadas. Crea una primero.","crm.pauseRules":"Reglas de pausa:","crm.enablePause":"Habilitar pausa","crm.pauseClientKeywords":"Palabras clave de pausa del cliente","crm.pauseClientPlaceholder":"Pausar el chatbot si el destinatario...","crm.pauseServerKeywords":"Palabras clave de pausa del servidor","crm.pauseServerPlaceholder":"Pausar cuando el bot envíe...","crm.pauseDuration":"Duración de la pausa (HH:MM)","crm.tipPauseTitle":"Reglas de Pausa","crm.tipPauseDesc":"Pausa el chatbot cuando se detecten palabras clave específicas. Usa palabras clave del cliente para permitir que los clientes pausa el bot, o palabras clave del servidor para pausar automáticamente después de enviar ciertos mensajes.","crm.tipPauseEx1":"Cliente dice 'parar' → Bot se pausa","crm.tipPauseEx2":"Cliente dice 'humano' → Transferir a agente","crm.tipPauseEx3":"Bot envía 'conectando...' → Pausa automática","crm.tipPauseClientTitle":"Palabras Clave de Pausa del Cliente","crm.tipPauseClientDesc":"Palabras clave que cuando son enviadas por el cliente pausarán el chatbot para este chat. Útil para transferir a agentes humanos.","crm.tipPauseClientEx1":"Cliente escribe 'parar' o 'stop'","crm.tipPauseClientEx2":"Cliente escribe 'humano' o 'atendente'","crm.tipPauseClientEx3":"Bot deja de responder durante el tiempo establecido","crm.tipPauseServerTitle":"Palabras Clave de Pausa del Servidor","crm.tipPauseServerDesc":"Palabras clave que cuando son enviadas por el bot pausarán automáticamente el chatbot. Útil al transferir a agentes humanos.","crm.tipPauseServerEx1":"Bot envía 'Conectándote con un agente...'","crm.tipPauseServerEx2":"Bot envía 'Por favor espera, transfiriendo...'","crm.tipPauseServerEx3":"El flujo se pausa automáticamente después de este mensaje","crm.tipPauseDurationTitle":"Duración de la Pausa","crm.tipPauseDurationDesc":"Establece cuánto tiempo permanecerá pausado el chatbot después de detectar una palabra clave de pausa. Formato: Horas:Minutos (ej., 00:30 = 30 minutos).","crm.tipPauseDurationEx1":"00:30 = 30 minutos de pausa","crm.tipPauseDurationEx2":"01:00 = 1 hora de pausa","crm.tipPauseDurationEx3":"Después de la duración, permanece pausado hasta nuevo disparador","crm.enableTagRules":"Habilitar reglas de etiquetas de WhatsApp","crm.editBlock":"Editar bloque:","crm.close":"Cerrar","crm.startNode":"Inicio","crm.startNodeInfo":"Este es el punto de inicio de tu flujo. Conéctalo a otros bloques para construir tu chatbot.","crm.editTextMessage":"Editar mensaje de texto:","crm.typeTheText":"Escribe el Texto","crm.saveResponseInVariable":"Guardar la respuesta en la variable:","crm.typeVariableName":"Escribe el nombre de la variable","crm.variableHint":"La variable almacenará la respuesta del cliente del bloque actual, y puede ser usada en los siguientes bloques del flujo","crm.insertImage":"Insertar una imagen:","crm.clickToUpload":"Haz clic para enviar o arrastra los archivos aquí","crm.imageFormats":"Imagen: PNG, JPG, JPEG, GIF (máx 16MB - límite de WhatsApp)","crm.imageCaption":"Descripción de imagen (opcional)","crm.insertVideo":"Insertar un video:","crm.insertAudio":"Insertar un audio:","crm.insertDocument":"Insertar un documento:","crm.caption":"Descripción:","crm.captionOptional":"Descripción (opcional)","crm.questionMessage":"Mensaje de pregunta:","crm.typeQuestion":"Escribe tu pregunta...","crm.responseOptions":"Opciones de respuesta:","crm.addOption":"Agregar opción","crm.buttonText":"Texto del botón:","crm.title":"Título:","crm.listTitleOptional":"Título de lista (opcional)","crm.listDescOptional":"Descripción (opcional)","crm.listSectionsHint":"Configura las secciones y elementos de la lista en ajustes avanzados.","crm.globalSettings":"Configuración global:","crm.editAwayMessage":"Editar mensaje de ausencia:","crm.awayMessagePlaceholder":"Escribe el mensaje que se enviará cuando el usuario no responda...","crm.waitingTime":"Tiempo de espera:","crm.waitingTimeWarning":"Cuando se recarga la página de WhatsApp, esta configuración se perderá para las conversaciones que esperan respuesta","crm.minutes":"Minutos","crm.hours":"Horas","crm.seconds":"Segundos","crm.awayMessageInfo":"Este mensaje se enviará automáticamente cuando el usuario no responda dentro del tiempo especificado.","crm.blockInterval":"Intervalo de bloque:","crm.blockIntervalInfo":"Define el intervalo predeterminado entre el envío de bloques del flujo.","crm.chatSimulator":"Simulador de chat","crm.startConversation":"Inicia una conversación enviando un mensaje","crm.typeMessageHere":"Escribe tu mensaje aquí...","crm.callNextBlock":"Llamar siguiente bloque","crm.whenItemSelected":"Cuando se seleccione un elemento","crm.whenResponding":"Al responder","crm.defaultNext":"Predeterminado (sin coincidencia)","crm.message":"Mensaje:","crm.listButton":"Texto del botón:","crm.items":"elementos","crm.listItems":"Elementos de lista:","crm.addItem":"Agregar elemento","crm.insertVariable":"Insertar Variable","crm.contactName":"Nombre del Contacto","crm.currentDate":"Fecha Actual","crm.currentTime":"Hora Actual","crm.defaultOption1":"Opción 1","crm.defaultOption2":"Opción 2","crm.noListItems":"No hay elementos. Haz clic en editar para agregar.","crm.send_text":"Enviar Texto","crm.send_image":"Enviar Imagen","crm.send_video":"Enviar Video","crm.send_audio":"Enviar Audio","crm.send_document":"Enviar Documento","crm.send_list":"Enviar Lista","crm.group_action":"Acción de Grupo","crm.tab_action":"Acción de Pestaña","crm.label_action":"Acción de Etiqueta","crm.crm_action":"Acción CRM","crm.wait_input":"Esperar Entrada","crm.smart_wait":"Espera Inteligente","crm.typing_indicator":"Indicador de Escritura","crm.add_fluxo":"Agregar Fluxo","crm.timezone":"Zona horaria:","crm.day":"Día","crm.sunday":"Domingo","crm.monday":"Lunes","crm.tuesday":"Martes","crm.wednesday":"Miércoles","crm.thursday":"Jueves","crm.friday":"Viernes","crm.saturday":"Sábado","crm.disableSignature":"Desactivar firma","crm.customizeSignatureName":"Personalizar el nombre de la firma","crm.enterCustomSignature":"Ingrese nombre de firma personalizada","crm.tipAnyMsgTitle":"Disparador de Cualquier Mensaje","crm.tipAnyMsgDesc":"El flujo se iniciará cuando se reciba CUALQUIER mensaje de un cliente, sin importar el contenido.","crm.tipAnyMsgEx1":"Respuesta automática general para todos los mensajes","crm.tipAnyMsgEx2":"Mensaje de ausencia cuando no está disponible","crm.tipAnyMsgEx3":"Puede dispararse con demasiada frecuencia - usar con intervalo de reactivación","crm.tipKeywordTitle":"Disparador por Palabras Clave","crm.tipKeywordDesc":"El flujo se inicia SOLO cuando el mensaje contiene una de las palabras clave especificadas.","crm.tipKeywordEx1":"'hola' dispara flujo de bienvenida","crm.tipKeywordEx2":"'precio' dispara información de producto","crm.tipKeywordEx3":"'ayuda' dispara menú de soporte","crm.tipFirstDayTitle":"Primer Mensaje del Día","crm.tipFirstDayDesc":"El flujo se dispara SOLO en el primer mensaje recibido cada día de cada contacto.","crm.tipFirstDayEx1":"Saludo de 'Buenos días' solo una vez al día","crm.tipFirstDayEx2":"Promoción diaria especial a cada contacto","crm.tipFirstDayEx3":"Se reinicia a medianoche según la zona horaria","crm.tipFirstEverTitle":"Primer Mensaje de Siempre","crm.tipFirstEverDesc":"El flujo se dispara SOLO la primera vez que un contacto envía un mensaje.","crm.tipFirstEverEx1":"Mensaje de bienvenida para nuevos contactos","crm.tipFirstEverEx2":"Secuencia de incorporación para clientes nuevos","crm.tipFirstEverEx3":"Asignación de CRM inicial para nuevos leads","crm.tipReactivationTitle":"Intervalo de Reactivación","crm.tipReactivationDesc":"Tiempo mínimo antes de que el mismo flujo pueda dispararse de nuevo para el mismo contacto.","crm.tipReactivationEx1":"3600s = Esperar 1 hora antes de re-disparar","crm.tipReactivationEx2":"Previene spam de respuestas automáticas","crm.tipReactivationEx3":"Usar 0 para permitir disparos ilimitados","crm.tipSendTextTitle":"Enviar Mensaje de Texto","crm.tipSendTextDesc":"Envía un mensaje de texto plano al contacto. Soporta variables como {name}, {phone}.","crm.tipSendTextEx1":"Mensajes de bienvenida personalizados","crm.tipSendTextEx2":"Confirmaciones de pedidos","crm.tipSendImageTitle":"Enviar Imagen","crm.tipSendImageDesc":"Envía un archivo de imagen con descripción opcional. Soporta PNG, JPG, GIF.","crm.tipSendImageEx1":"Imágenes de productos","crm.tipSendImageEx2":"Materiales promocionales","crm.tipSendVideoTitle":"Enviar Video","crm.tipSendVideoDesc":"Envía un archivo de video con descripción opcional. Soporta MP4, MOV.","crm.tipSendVideoEx1":"Demostraciones de productos","crm.tipSendVideoEx2":"Videos tutoriales","crm.tipSendAudioTitle":"Enviar Audio","crm.tipSendAudioDesc":"Envía un archivo de audio o nota de voz. Soporta MP3, OGG, WAV.","crm.tipSendAudioEx1":"Mensajes de voz pregrabados","crm.tipSendAudioEx2":"Anuncios de audio","crm.tipSendDocTitle":"Enviar Documento","crm.tipSendDocDesc":"Envía cualquier tipo de archivo como documento. Soporta PDF, DOC, XLS, etc.","crm.tipSendDocEx1":"Catálogos de precios","crm.tipSendDocEx2":"Contratos y acuerdos","crm.tipSendListTitle":"Enviar Mensaje de Lista","crm.tipSendListDesc":"Envía una lista interactiva con secciones y elementos seleccionables.","crm.tipSendListEx1":"Menús de productos por categoría","crm.tipSendListEx2":"Opciones de servicios","crm.tipGroupActionTitle":"Acción de Grupo de WhatsApp","crm.tipGroupActionDesc":"Agregar o eliminar el contacto actual de grupos de WhatsApp.","crm.tipGroupActionEx1":"Agregar clientes VIP al grupo exclusivo","crm.tipGroupActionEx2":"Eliminar de grupo de soporte después de resolución","crm.tipTabActionTitle":"Acción de Pestaña Personalizada","crm.tipTabActionDesc":"Agregar o eliminar el contacto actual de pestañas personalizadas de CRM.","crm.tipTabActionEx1":"Mover lead a pestaña 'Calificado'","crm.tipTabActionEx2":"Eliminar de pestaña 'Nueva Consulta'","crm.tipLabelActionTitle":"Acción de Etiqueta de WhatsApp","crm.tipLabelActionDesc":"Agregar o eliminar etiquetas de WhatsApp del contacto actual.","crm.tipLabelActionEx1":"Agregar etiqueta 'Respondido'","crm.tipLabelActionEx2":"Eliminar etiqueta 'Pendiente'","crm.tipCrmActionTitle":"Acción de Etapa CRM","crm.tipCrmActionDesc":"Mover el contacto actual a una etapa específica del CRM Kanban.","crm.tipCrmActionEx1":"Mover a etapa 'Negociación'","crm.tipCrmActionEx2":"Mover a etapa 'Cerrado Ganado'","crm.tipSmartWaitTitle":"Espera Inteligente","crm.tipSmartWaitDesc":"Agregar un retraso aleatorio entre acciones para parecer más humano.","crm.tipSmartWaitEx1":"Esperar 2-5 segundos entre mensajes","crm.tipSmartWaitEx2":"Simular tiempo natural de lectura","crm.tipTypingTitle":"Indicador de Escritura","crm.tipTypingDesc":"Mostrar burbuja de 'escribiendo...' antes de enviar mensaje para parecer más humano.","crm.tipTypingEx1":"Mostrar escribiendo por 3 segundos antes del mensaje","crm.tipTypingEx2":"Hace que las respuestas parezcan más naturales","crm.tipAllowGroupsTitle":"Permitir Grupos","crm.tipAllowGroupsDesc":"Cuando está habilitado, el chatbot también responderá en chats grupales. Cuando está deshabilitado, solo los chats privados activan el flujo.","crm.tipAllowGroupsEx1":"ON: Responder en grupos y privados","crm.tipAllowGroupsEx2":"OFF: Solo responder en chats privados","crm.tipScheduleTitle":"Programar Respuestas","crm.tipScheduleDesc":"Restringir el chatbot para que funcione solo durante horas/días específicos. Configura el horario abajo.","crm.tipScheduleEx1":"Solo horario laboral (9 AM - 6 PM)","crm.tipScheduleEx2":"Solo días laborables (Lun-Vie)","crm.tipScheduleEx3":"Respuesta automática fuera de horario","crm.tipDontRespondOpenTitle":"No Responder si Está Abierto","crm.tipDontRespondOpenDesc":"Evita que el chatbot envíe mensajes si ya tienes esa conversación abierta en WhatsApp Web.","crm.tipDontRespondOpenEx1":"Útil cuando estás chateando activamente","crm.tipDontRespondOpenEx2":"Evita que el bot interrumpa tu conversación","crm.tipSimulateTypingTitle":"Simular Escritura","crm.tipSimulateTypingDesc":"Muestra el indicador 'escribiendo...' antes de enviar mensajes, haciendo que las respuestas se sientan más humanas.","crm.tipSimulateTypingEx1":'Muestra "escribiendo..." para mensajes de texto',"crm.tipSimulateTypingEx2":'Muestra "grabando..." para audio',"crm.tipSimulateTypingEx3":"Hace que el bot se sienta más natural","crm.tipSkipCRMTitle":"Omitir Contactos CRM","crm.tipSkipCRMDesc":"El chatbot no responderá a contactos que ya están agregados a tu CRM. Útil para clientes existentes.","crm.tipSkipCRMEx1":"Respuesta automática solo a nuevos contactos","crm.tipSkipCRMEx2":"Omitir contactos CRM existentes","crm.tipExcludeCRMTitle":"Excluir Etapas CRM Específicas","crm.tipExcludeCRMDesc":"Selecciona etapas específicas del CRM Kanban para excluir. Los contactos en esas etapas no recibirán mensajes del chatbot.","crm.tipExcludeCRMEx1":'Excluir etapa "Clientes VIP"',"crm.tipExcludeCRMEx2":'Excluir etapa "No Molestar"',"crm.tipIncludeCRMTitle":"Incluir Solo Etapas CRM Específicas","crm.tipIncludeCRMDesc":"El chatbot SOLO responderá a contactos en las etapas CRM Kanban seleccionadas. Todos los demás son ignorados.","crm.tipIncludeCRMEx1":'Solo responder a etapa "Leads"',"crm.tipIncludeCRMEx2":'Solo responder a etapa "Tratos Activos"',"crm.tipSkipLabeledTitle":"Omitir Contactos Etiquetados","crm.tipSkipLabeledDesc":"El chatbot no responderá a ningún contacto que tenga una etiqueta de WhatsApp asignada.","crm.tipSkipLabeledEx1":"Cualquier contacto etiquetado es omitido","crm.tipSkipLabeledEx2":"Solo contactos sin etiquetar reciben respuestas","crm.tipExcludeLabelTitle":"Excluir Etiquetas Específicas","crm.tipExcludeLabelDesc":"Selecciona etiquetas específicas de WhatsApp para excluir. Los contactos con esas etiquetas no recibirán mensajes del chatbot.","crm.tipExcludeLabelEx1":'Excluir contactos etiquetados como "Spam"',"crm.tipExcludeLabelEx2":'Excluir contactos etiquetados como "Bloqueado"',"crm.tipIncludeLabelTitle":"Incluir Solo Etiquetas Específicas","crm.tipIncludeLabelDesc":"El chatbot SOLO responderá a contactos con las etiquetas de WhatsApp seleccionadas. Todos los demás son ignorados.","crm.tipIncludeLabelEx1":'Solo responder a etiquetados "VIP"',"crm.tipIncludeLabelEx2":'Solo responder a etiquetados "Prioridad"',"crm.tipSkipCustomTabTitle":"Omitir Contactos en Pestañas Personalizadas","crm.tipSkipCustomTabDesc":"El chatbot no responderá a ningún contacto que esté asignado a una pestaña personalizada.","crm.tipSkipCustomTabEx1":'Contacto en pestaña "Clientes VIP" → Sin respuesta',"crm.tipSkipCustomTabEx2":"Contacto no en ninguna pestaña → Bot responde","crm.tipExcludeCustomTabTitle":"Excluir Pestañas Personalizadas Específicas","crm.tipExcludeCustomTabDesc":"Selecciona pestañas personalizadas específicas para excluir. Los contactos en esas pestañas no recibirán mensajes del chatbot.","crm.tipExcludeCustomTabEx1":'Excluir contactos en pestaña "Bloqueados"',"crm.tipExcludeCustomTabEx2":'Excluir contactos en pestaña "Atendidos"',"crm.tipIncludeCustomTabTitle":"Incluir Solo Pestañas Personalizadas Específicas","crm.tipIncludeCustomTabDesc":"El chatbot SOLO responderá a contactos en las pestañas personalizadas seleccionadas. Todos los demás son ignorados.","crm.tipIncludeCustomTabEx1":'Solo responder a pestaña "Leads Activos"',"crm.tipIncludeCustomTabEx2":'Solo responder a pestaña "VIP"',"templates.addCategory":"Agregar Categoría","templates.editCategory":"Editar Categoría","templates.deleteCategory":"Eliminar Categoría","templates.manageCategories":"Gestionar","templates.categoryName":"Nombre de Categoría","templates.categoryIcon":"Icono","templates.categoryColor":"Color","templates.update":"Actualizar","templates.form.category":"Categoría","templates.form.categoryHint":"Organiza plantillas en categorías para facilitar el acceso","templates.allTemplates":"Todas las Plantillas","templates.quickReplyCategory":"Respuesta Rápida","templates.uncategorized":"Sin Categoría","templates.sortNewest":"Más Recientes","templates.sortOldest":"Más Antiguos","templates.sortNameAZ":"Nombre A-Z","templates.sortNameZA":"Nombre Z-A","templates.confirmDeleteCategory":"¿Estás seguro de que deseas eliminar esta categoría? Las plantillas se moverán a Sin Categoría.","templates.confirmDeleteTemplate":"¿Estás seguro de que deseas eliminar esta plantilla?","templates.noCategoriesYet":"Aún no hay categorías","templates.createCategoryDescription":"Crea categorías para organizar tus plantillas","templates.done":"Hecho","templates.deleteCategoryWarning":"Las plantillas de esta categoría quedarán sin categorizar.","templates.delete":"Eliminar","templates.noTemplatesInCategory":"No hay plantillas en esta categoría","templates.createFirstDescription":"Crea tu primera plantilla para comenzar","followUp.title":"Seguimiento","followUp.newFollowUp":"Nuevo Seguimiento","followUp.confirmDelete":"¿Estás seguro de que deseas eliminar este seguimiento?","followUp.emptyTitle":"Ningún Seguimiento Seleccionado","followUp.emptyText":"Selecciona un seguimiento de la lista o crea uno nuevo para comenzar con secuencias de mensajes automatizadas.","followUp.createNew":"Crear Nuevo","followUp.loading":"Cargando...","followUp.noFollowUps":"Aún no hay seguimientos","followUp.createFirst":"Crea tu primera secuencia de seguimiento","followUp.active":"Activo","followUp.paused":"Pausado","followUp.labels":"Etiquetas","followUp.customTabs":"Pestañas Personalizadas","followUp.groups":"Grupos","followUp.kanban":"Kanban","followUp.onEnter":"Al Entrar","followUp.onLeave":"Al Salir","followUp.afterTime":"Después de Tiempo","followUp.steps":"pasos","followUp.pause":"Pausar","followUp.activate":"Activar","followUp.duplicate":"Duplicar","followUp.delete":"Eliminar","followUp.name":"Nombre del Seguimiento","followUp.namePlaceholder":"Ingresa el nombre del seguimiento...","followUp.nameRequired":"Por favor ingresa un nombre para el seguimiento","followUp.funnelRequired":"Por favor selecciona al menos un elemento del embudo","followUp.stepsRequired":"Por favor agrega al menos un paso","followUp.funnelSettings":"Configuración del Embudo","followUp.selectFunnelItems":"Selecciona elementos para activar este seguimiento","followUp.comingSoon":"Selector próximamente","followUp.triggerSettings":"Disparador de Seguimiento","followUp.onEnterDesc":"Activar cuando el contacto entre al embudo","followUp.onLeaveDesc":"Activar cuando el contacto salga del embudo","followUp.afterTimeDesc":"Activar después de un período específico","followUp.days":"Días","followUp.day":"Día","followUp.hours":"Horas","followUp.minutes":"Minutos","followUp.value":"Valor","followUp.unit":"Unidad","followUp.time":"Hora","followUp.scheduleConfiguration":"Configuración de Horario","followUp.enableSchedule":"Habilitar Horario Avanzado","followUp.enableScheduleDesc":"(Enviar solo en días/fechas específicas)","followUp.scheduleDisabledInfo":"Habilita Horario Avanzado arriba para configurar días/fechas específicas para enviar mensajes.","followUp.tooltip.scheduleTitle":"Configuración de Horario - ¿Cuándo enviar?","followUp.tooltip.scheduleContent":"Configura días/fechas específicas cuando se debe ejecutar el seguimiento. Funciona con cualquier tipo de disparador. Elige horarios Diarios, Semanales, Mensuales o Anuales.","followUp.tooltip.scheduleExample":"Configura un horario Semanal para Lun, Mié, Vie para enviar mensajes solo esos días.","followUp.messagesConfiguredInSchedule":"Mensajes Configurados en Horario","followUp.messagesConfiguredInScheduleDesc":'Has habilitado "Mensaje Diferente por Día" en la sección de Configuración de Horario arriba. Los mensajes se configuran allí para cada día seleccionado.',"followUp.stepsTitle":"Pasos de Seguimiento","followUp.step":"Paso","followUp.actions":"acciones","followUp.addStep":"Agregar Paso de Seguimiento","followUp.rulesTitle":"Reglas de Activación","followUp.cancelOnReply":"Cancelar si el cliente responde","followUp.allowGroups":"Permitir responder en grupos","followUp.customSignature":"Personalizar firma","followUp.signatureText":"Texto de Firma","followUp.signaturePlaceholder":"Ingresa tu firma...","followUp.maxExecutions":"Máximo de veces por contacto","followUp.cooldownDays":"Período de espera (días)","followUp.cancel":"Cancelar","followUp.create":"Crear Seguimiento","followUp.save":"Guardar Cambios","followUp.saving":"Guardando...","followUp.saved":"¡Guardado!","followUp.back":"← Atrás","followUp.next":"Siguiente →","followUp.backToList":"← Volver a la Lista","followUp.wizardStep1":"Configuración","followUp.wizardStep2":"Mensajes","followUp.wizardStep3":"Programación","followUp.wizardStep4":"Acciones","followUp.wizardStep5":"Reglas","followUp.followUps":"Seguimientos","followUp.stepName":"Nombre del Paso (Opcional)","followUp.stepNamePlaceholder":"ej., Contacto Inicial, Seguimiento 1...","followUp.timing":"Tiempo","followUp.mode":"Modo","followUp.relative":"Relativo","followUp.specific":"Específico","followUp.type":"Tipo","followUp.daily":"Diario","followUp.weekly":"Semanal","followUp.monthly":"Mensual","followUp.condition":"Condición","followUp.conditionAlways":"Siempre","followUp.conditionIfReplied":"Si Respondió","followUp.conditionIfNotReplied":"Si No Respondió","followUp.conditionIfKeyword":"Si Palabra Clave","followUp.conditionIfNotKeyword":"Si No Palabra Clave","followUp.conditionIfInFunnel":"Si En Embudo","followUp.conditionIfNotInFunnel":"Si Salió del Embudo","followUp.keywords":"Palabras clave (separadas por coma)","followUp.keywordsPlaceholder":"sí, ok, interesado...","followUp.actionsTitle":"Acciones","followUp.actionsRequired":"Por favor agrega al menos una acción","followUp.addAction":"+ Agregar Acción","followUp.messagesTitle":"Mensajes","followUp.postActionsTitle":"Acciones Post","followUp.groupActions":"Acciones de Grupo","followUp.addToGroups":"Agregar a Grupos","followUp.removeFromGroups":"Eliminar de Grupos","followUp.customTabActions":"Acciones de Pestañas","followUp.addToTabs":"Agregar a Pestañas","followUp.removeFromTabs":"Eliminar de Pestañas","followUp.labelsActions":"Acciones de Etiquetas","followUp.addLabels":"Agregar Etiquetas","followUp.removeLabels":"Eliminar Etiquetas","followUp.kanbanBoardActions":"Acciones de Kanban","followUp.addToKanban":"Agregar a Etapa","followUp.removeFromKanban":"Eliminar de Etapa","followUp.selectStage":"Seleccionar Etapa...","followUp.noGroupsAvailable":"No hay grupos disponibles","followUp.noTabsAvailable":"No hay pestañas disponibles","followUp.noLabelsAvailable":"No hay etiquetas disponibles","followUp.noKanbanAvailable":"No hay tableros Kanban disponibles","followUp.moveUp":"Mover Arriba","followUp.moveDown":"Mover Abajo","followUp.removeStep":"Eliminar Paso","followUp.message":"Mensaje","followUp.messagePlaceholder":"Escribe tu mensaje aquí...","followUp.messageText":"Mensaje","followUp.templatesType":"Tipo de Plantilla","followUp.clickToInsert":"Haz clic para insertar:","followUp.variables":"Variables","followUp.minDelay":"Retraso Mín (seg)","followUp.maxDelay":"Retraso Máx (seg)","followUp.addMessage":"Agregar Mensaje","followUp.selectLabels":"Seleccionar etiquetas...","followUp.selectTabs":"Seleccionar pestañas...","followUp.selectKanbanStage":"Seleccionar CRM Kanban y etapa...","followUp.selectGroups":"Seleccionar grupos de WhatsApp...","followUp.selectorComingSoon":"Selector próximamente","followUp.webhookUrl":"URL del Webhook","followUp.includeContactData":"Incluir datos del contacto en la carga","followUp.search":"Buscar...","followUp.noLabels":"No se encontraron etiquetas. Crea etiquetas en WhatsApp primero.","followUp.noTabs":"No se encontraron pestañas personalizadas. Crea pestañas desde la barra.","followUp.noGroups":"No se encontraron grupos de WhatsApp.","followUp.noStages":"No se encontraron etapas Kanban. Crea un CRM y etapas primero.","followUp.fluxoCategory":"Categoría","followUp.allCategories":"Todas las Categorías","followUp.uncategorized":"Sin Categoría","followUp.selectFluxo":"Seleccionar Fluxo","followUp.chooseFluxo":"-- Elegir un Fluxo --","followUp.fluxoInfo":"El flujo de chatbot seleccionado se activará cuando se ejecute este follow-up.","followUp.tooltip.nameTitle":"Nombre del Seguimiento","followUp.tooltip.nameContent":"Proporcione un nombre descriptivo para identificar esta secuencia de seguimiento. Use nombres claros que describan el propósito.","followUp.tooltip.nameExample":"Ejemplo: 'Bienvenida Nuevo Lead', 'Recordatorio de Pago', 'Solicitud de Feedback'","followUp.tooltip.categoryTitle":"Categoría","followUp.tooltip.categoryContent":"Organice sus seguimientos en categorías para una mejor gestión. Seleccione una categoría o déjelo como Sin Categoría.","followUp.tooltip.funnelTitle":"Configuración del Embudo - ¿Dónde activar?","followUp.tooltip.funnelContent":"Seleccione qué Etiquetas, Pestañas Personalizadas, Grupos o etapas Kanban activarán esta secuencia de seguimiento. Cuando un contacto entre al embudo seleccionado, el seguimiento comenzará.","followUp.tooltip.funnelExample":"Ejemplo: Seleccione etiqueta 'Nuevo Lead' → Cuando cualquier contacto reciba esta etiqueta, el seguimiento inicia automáticamente.","followUp.tooltip.triggerTitle":"Disparador de Seguimiento - ¿Cuándo iniciar?","followUp.tooltip.triggerContent":"Decide CUÁNDO comenzará la secuencia de seguimiento después del evento del embudo. Al Entrar: inmediatamente cuando el contacto entra. Al Salir: cuando el contacto sale. Después de Tiempo: esperar X tiempo antes de iniciar.","followUp.tooltip.triggerExample":"Ejemplo: 'Después de Tiempo' + 2 horas = El seguimiento inicia 2 horas después de que el contacto entre al embudo.","followUp.tooltip.actionsTitle":"Acciones - ¿Qué hacer?","followUp.tooltip.actionsContent":"Defina qué sucede cuando se activa el seguimiento. Todas las acciones se ejecutan al momento del disparo. Agregue mensajes, cambie etiquetas, mueva a etapas Kanban o active webhooks.","followUp.tooltip.actionsExample":"Ejemplo: Enviar mensaje de bienvenida → Agregar etiqueta 'Contactado' → Mover a etapa 'En Progreso'.","followUp.tooltip.rulesTitle":"Reglas de Activación - Controlar comportamiento","followUp.tooltip.rulesContent":"Configure cómo se comporta el seguimiento. Cancelar si responde detiene la secuencia si el cliente responde. Permitir grupos habilita el envío en chats grupales. Firma personalizada agrega su texto al final de los mensajes.","followUp.tooltip.rulesExample":"Mejor Práctica: Habilite 'Cancelar si responde' para evitar enviar spam a clientes que ya le respondieron.","followUp.tooltip.cancelOnReplyTitle":"Cancelar si el Cliente Responde","followUp.tooltip.cancelOnReplyContent":"Detiene automáticamente todos los mensajes de seguimiento pendientes para un contacto cuando le envían cualquier mensaje. Esto evita enviar seguimientos innecesarios a clientes que ya respondieron.","followUp.tooltip.cancelOnReplyExample":"• Habilitar: El seguimiento se detiene si el cliente responde antes de que se envíe\n• Deshabilitar: El seguimiento se envía sin importar los mensajes del cliente","followUp.tooltip.allowGroupsTitle":"Permitir Responder en Grupos","followUp.tooltip.allowGroupsContent":"Controla si este seguimiento puede enviar mensajes a grupos de WhatsApp. Por defecto, los seguimientos solo funcionan para contactos individuales (chats 1-a-1).","followUp.tooltip.allowGroupsExample":"• Habilitar: El seguimiento funciona para chats individuales Y grupos\n• Deshabilitar: El seguimiento solo funciona para contactos individuales","followUp.tooltip.signatureTitle":"Personalizar Firma","followUp.tooltip.signatureContent":"Agrega una firma personalizada al final de cada mensaje de seguimiento. Útil para branding o identificar mensajes automatizados.","followUp.tooltip.signatureExample":"Ejemplo: Su mensaje '¡Hola, solo verificando!' se convierte en '¡Hola, solo verificando!\\n\\n~ Equipo CRM'","followUp.tooltip.maxExecutionsTitle":"Ejecuciones Máximas - ¿Cuántas veces?","followUp.tooltip.maxExecutionsContent":"Controla cuántas veces este seguimiento puede enviar mensajes al MISMO contacto. Una vez que un contacto alcanza este límite, no recibirá este seguimiento de nuevo.","followUp.tooltip.maxExecutionsExample":"• Poner 0 = Ilimitado (sin límite)\n• Poner 1 = Solo una vez por contacto\n• Poner 3 = El contacto recibe máximo 3 veces","followUp.tooltip.cooldownTitle":"Período de Espera - Esperar antes de reactivar","followUp.tooltip.cooldownContent":"Después de que un contacto recibe este seguimiento, cuántos días esperar antes de que pueda recibirlo de nuevo. Esto evita enviar spam al mismo contacto repetidamente.","followUp.tooltip.cooldownExample":"• Poner 0 = Sin espera (puede activarse de nuevo inmediatamente)\n• Poner 7 = Esperar 7 días antes de reactivar","followUp.tooltip.exampleLabel":"Ejemplo:","followUp.tooltip.howToUseLabel":"Cómo usar:","followUp.tooltip.bestPracticeLabel":"Mejor Práctica:","followUp.scheduleWizard.title":"Configuración de Horario","followUp.scheduleWizard.step1":"Paso 1: Tipo de Horario","followUp.scheduleWizard.step2":"Paso 2: Seleccionar Días","followUp.scheduleWizard.step3":"Paso 3: Hora y Mensajes","followUp.scheduleWizard.next":"Siguiente","followUp.scheduleWizard.back":"Atrás","followUp.scheduleWizard.done":"Listo","followUp.schedule.daily":"Diario","followUp.schedule.dailyDesc":"Enviar en fechas específicas del mes","followUp.schedule.weekly":"Semanal","followUp.schedule.weeklyDesc":"Enviar en días de la semana seleccionados","followUp.schedule.monthly":"Mensual","followUp.schedule.monthlyDesc":"Enviar en fechas específicas cada mes","followUp.schedule.yearly":"Anual","followUp.schedule.yearlyDesc":"Enviar en fechas específicas cada año","followUp.weekday.mon":"Lun","followUp.weekday.tue":"Mar","followUp.weekday.wed":"Mié","followUp.weekday.thu":"Jue","followUp.weekday.fri":"Vie","followUp.weekday.sat":"Sáb","followUp.weekday.sun":"Dom","followUp.weekday.monday":"Lunes","followUp.weekday.tuesday":"Martes","followUp.weekday.wednesday":"Miércoles","followUp.weekday.thursday":"Jueves","followUp.weekday.friday":"Viernes","followUp.weekday.saturday":"Sábado","followUp.weekday.sunday":"Domingo","followUp.month.jan":"Enero","followUp.month.feb":"Febrero","followUp.month.mar":"Marzo","followUp.month.apr":"Abril","followUp.month.may":"Mayo","followUp.month.jun":"Junio","followUp.month.jul":"Julio","followUp.month.aug":"Agosto","followUp.month.sep":"Septiembre","followUp.month.oct":"Octubre","followUp.month.nov":"Noviembre","followUp.month.dec":"Diciembre","followUp.selectWeekdays":"Seleccionar Días de la Semana","followUp.selectDates":"Seleccionar Fechas","followUp.selectYearlyDates":"Seleccionar Fechas Anuales","followUp.selectedDays":"Seleccionados","followUp.noSelection":"Sin selección","followUp.addDate":"Agregar Fecha","followUp.removeDate":"Eliminar","followUp.selectMonth":"Seleccionar Mes","followUp.selectDay":"Seleccionar Día","followUp.monthlySelectInfo":"Selecciona fechas que se repetirán cada mes","followUp.dailySelectInfo":"Selecciona fechas específicas para este horario","followUp.calendarSelectInfo":"Selecciona fechas específicas del calendario. Navega entre meses usando las flechas.","followUp.messageMode":"Modo de Mensaje","followUp.sameMessage":"Mismo Mensaje para Todos los Días","followUp.sameMessageDesc":"Usar la misma configuración de mensaje para cada día seleccionado","followUp.differentMessages":"Mensaje Diferente por Día","followUp.differentMessagesDesc":"Configurar mensajes separados para cada día seleccionado","followUp.messageFor":"Mensaje para","followUp.sendTime":"Hora de Envío","followUp.selectTime":"Seleccionar hora de envío","schedule.title":"Mensajes Programados","schedule.addSchedule":"Agregar Programación","schedule.editSchedule":"Editar Programación","schedule.schedulesCount":"Programaciones","schedule.noSchedules":"Sin Mensajes Programados","schedule.noSchedulesDesc":"Crea tu primer mensaje programado para comenzar.","schedule.confirmDelete":"¿Estás seguro de que quieres eliminar esta programación?","schedule.inactive":"Inactivo","schedule.once":"Una vez","schedule.repeated":"Repetido","schedule.scheduleFor":"Programar Para","schedule.selectTarget":"Seleccionar Contacto o Grupo","schedule.searchContacts":"Buscar contactos y grupos...","schedule.groups":"Grupos","schedule.contacts":"Contactos","schedule.templateType":"Tipo de Plantilla","schedule.message":"Mensaje","schedule.enterMessage":"Ingresa tu mensaje...","schedule.scheduleDateTime":"Fecha y Hora de Programación","schedule.selectDateTime":"Por favor selecciona fecha y hora","schedule.repeatedType":"Tipo de Repetición","schedule.repeatedType_minute":"Minuto","schedule.repeatedType_hour":"Hora","schedule.repeatedType_daily":"Diario","schedule.repeatedType_weekly":"Semanal","schedule.repeatedType_monthly":"Mensual","schedule.repeatedType_yearly":"Anual","schedule.everyMinutes":"Cada X Minutos","schedule.everyHours":"Cada X Horas","schedule.scheduleTime":"Horarios Programados","schedule.addTime":"Agregar Hora","schedule.startAndEndTime":"Hora de inicio y fin","schedule.runAnytime":"Ejecutar en cualquier momento","schedule.runBetween":"Ejecutar entre período de tiempo","schedule.endSchedule":"Finalizar Repetición de Programación en","schedule.never":"Nunca","schedule.afterCount":"Número de veces de repetición","schedule.completeOnDate":"Completar en Fecha","schedule.weekday_mon":"Lunes","schedule.weekday_tue":"Martes","schedule.weekday_wed":"Miércoles","schedule.weekday_thu":"Jueves","schedule.weekday_fri":"Viernes","schedule.weekday_sat":"Sábado","schedule.weekday_sun":"Domingo","schedule.month_jan":"Enero","schedule.month_feb":"Febrero","schedule.month_mar":"Marzo","schedule.month_apr":"Abril","schedule.month_may":"Mayo","schedule.month_jun":"Junio","schedule.month_jul":"Julio","schedule.month_aug":"Agosto","schedule.month_sep":"Septiembre","schedule.month_oct":"Octubre","schedule.month_nov":"Noviembre","schedule.month_dec":"Diciembre","schedule.postActions":"Acciones Posteriores","schedule.groupActions":"Acciones de Grupo","schedule.customTabActions":"Acciones de Pestaña Personalizada","schedule.labelsActions":"Acciones de Etiquetas","schedule.kanbanActions":"Acciones de Tablero Kanban","schedule.members":"miembros","schedule.noContactsFound":"No se encontraron contactos","schedule.noGroupsFound":"No se encontraron grupos","schedule.loadingContacts":"Cargando contactos...","schedule.loadingGroups":"Cargando grupos...","schedule.selected":"Seleccionado","schedule.tooltip.scheduleFor":"Selecciona un contacto o grupo para enviar el mensaje programado.","schedule.tooltip.templateType":"Elige el tipo de mensaje: solo texto, con medios, encuesta, lista, o activar un flujo Fluxo.","schedule.tooltip.message":"Escribe tu mensaje. Usa variables como {{name}} o {{phone}} para personalización.","schedule.tooltip.dateTime":"Establece cuándo se debe enviar el mensaje. Para programaciones repetidas, esta es la fecha/hora de inicio.","schedule.tooltip.repeatedType":"Elige con qué frecuencia repetir: cada X minutos/horas, diario, semanal, mensual o anual.","schedule.tooltip.scheduleTimes":"Agrega múltiples horarios para enviar el mensaje. Haz clic en + para añadir más.","schedule.tooltip.runBetween":"Restringe los mensajes a horas específicas. ej., enviar solo entre 9 AM - 6 PM.","schedule.tooltip.endSchedule":"Elige cuándo dejar de repetir: Nunca, después de X veces, o en una fecha específica.","schedule.tooltip.postActions":"Acciones a realizar después de enviar: agregar/eliminar de grupos, pestañas, etiquetas o etapas Kanban.","gmaps.featureTitle":"Extractor de G Maps","feature.gmapsExtractor":"Extractor de G Maps","gmaps.panelHeader":"Extractor de G Maps","gmaps.status.idle":"Inactivo","gmaps.status.running":"Extrayendo...","gmaps.status.stopped":"Detenido","gmaps.status.complete":"Completado","gmaps.status.error":"Detenido","gmaps.statusLabel":"Estado","gmaps.leadsFound":"Leads: {{count}}","gmaps.leadsShort":"leads","gmaps.settings":"Ajustes","gmaps.exportGroup":"Exportar y Enviar","gmaps.noPhone":"sin teléfono","gmaps.showPanel":"Mostrar panel","gmaps.hidePanel":"Ocultar panel","gmaps.maxResults":"Resultados máx.","gmaps.unlimited":"Ilimitado","gmaps.fetchEmails":"Buscar correos","gmaps.fetchEmailsTooltip":"Para cada lead con sitio web, lo abre en segundo plano y extrae el primer correo electrónico encontrado. Añade unos 3 segundos por lead y consume más ancho de banda. Si el sitio no tiene correo visible o falla la carga, ese campo de correo queda vacío.","gmaps.startBtn":"Iniciar Extracción","gmaps.stopBtn":"Detener","gmaps.clearBtn":"Limpiar","gmaps.exportCsv":"Exportar CSV","gmaps.exportXlsx":"Exportar XLSX","gmaps.sendToBroadcast":"Enviar a Difusión","gmaps.previewTitle":"Vista previa","gmaps.moreRows":"más","gmaps.expand":"Expandir","gmaps.expandView":"Vista completa","gmaps.clickExpand":"Haz clic en Expandir para ver detalles","gmaps.clickExpandToSee":"haz clic en Expandir para ver todo","gmaps.col.name":"Nombre","gmaps.col.phone":"Teléfono","gmaps.col.website":"Sitio web","gmaps.col.address":"Dirección","gmaps.col.category":"Categoría","gmaps.col.rating":"Calificación","gmaps.noLeadsYet":"Aún no hay leads — busca en Google Maps y haz clic en Iniciar","gmaps.stopReason.userStop":"Detenido por el usuario","gmaps.stopReason.endOfResults":"Se alcanzó el final de los resultados de Google Maps","gmaps.stopReason.captcha":"Captcha de Google detectado — resuélvelo y haz clic en Iniciar otra vez","gmaps.stopReason.noFeed":"No se encontraron resultados de búsqueda en Google Maps — primero ejecuta una búsqueda","gmaps.stopReason.noNewResults":"No se cargan nuevos resultados (Google dejó de devolver datos)","gmaps.stopReason.maxReached":"Se alcanzó el límite máximo de resultados","gmaps.stopReason.tabClosed":"La pestaña fue cerrada","gmaps.stopReason.error":"Error","gmaps.toast.searchFirst":"Por favor, ejecuta una búsqueda en Google Maps primero, luego haz clic en Iniciar.","gmaps.toast.csvReady":"CSV descargado","gmaps.toast.xlsxReady":"Archivo Excel descargado","gmaps.toast.noPhones":"No hay números de teléfono válidos — no se envió nada.","gmaps.toast.sentPartial":"{{sent}} contactos enviados a Difusión · {{dropped}} omitidos (sin teléfono)","gmaps.toast.sentAll":"{{sent}} contactos enviados a Difusión","gmaps.toast.broadcastFail":"Error al enviar a Difusión. Revisa la consola.","gmaps.toast.draftRestored":"Sesión anterior restaurada","gmaps.toast.draftRestoredN":"Se restauraron {{n}} leads de la sesión anterior"},zh:{"common.loading":"加载中...","common.close":"关闭","common.cancel":"取消","common.save":"保存","common.copy":"复制","common.copied":"已复制！","common.choose":"选择","common.add":"添加","common.edit":"编辑","common.delete":"删除","common.back":"返回","quickReply.title":"快速回复","quickReply.addButton":"+ 添加","quickReply.allCategories":"所有类别","quickReply.postActions":"后续操作","quickReply.groupActions":"群组操作","quickReply.customTabActions":"自定义标签操作","quickReply.labelsActions":"标签操作","quickReply.kanbanBoardActions":"看板操作","quickReply.addToGroups":"添加到群组","quickReply.removeFromGroups":"从群组移除","quickReply.addToTabs":"添加到标签页","quickReply.removeFromTabs":"从标签页移除","quickReply.addLabels":"添加标签","quickReply.removeLabels":"移除标签","quickReply.addToStage":"添加到阶段","quickReply.removeFromStage":"从阶段移除","quickReply.selectGroups":"选择群组...","quickReply.selectTabs":"选择标签页...","quickReply.selectLabels":"选择标签...","quickReply.selectCrmStage":"选择CRM和阶段...","quickReply.noGroupsAvailable":"没有可用的群组","quickReply.noTabsAvailable":"没有可用的标签页","quickReply.noLabelsAvailable":"没有可用的标签","quickReply.noKanbanAvailable":"没有可用的看板CRM","quickReply.editBeforeSending":"发送前编辑","quickReply.editBeforeSendingDesc":"允许在发送前编辑消息","actionSidebar.title":"快捷操作","actionSidebar.quickReply":"快捷回复","actionSidebar.flow":"流程","actionSidebar.search":"搜索...","actionSidebar.filter":"筛选","actionSidebar.all":"全部","actionSidebar.byType":"按类型","actionSidebar.noCategory":"无分类","actionSidebar.byCategory":"按分类","actionSidebar.mostUsed":"常用","actionSidebar.send":"发送","actionSidebar.trigger":"触发","actionSidebar.noItemsFound":"未找到项目","actionSidebar.selectChatFirst":"请先选择聊天","actionSidebar.uncategorized":"未分类","actionSidebar.editAndSend":"编辑并发送","actionSidebar.clickToCancel":"点击取消","actionSidebar.cancel":"取消","actionSidebar.sending":"发送中...","header.activateLicense":"激活许可证",broadcastTitle:"群发消息",kanbanTitle:"打开看板CRM","profile.title":"个人资料","profile.deviceName":"设备名称","profile.expires":"到期","profile.manageLicenseKey":"管理许可证密钥","profile.settings":"设置","profile.watchTutorial":"观看教程","profile.language":"语言","profile.privacyPolicy":"隐私政策","profile.contactUs":"联系我们","profile.website":"网站","profile.premium":"高级","profile.notActivated":"未激活","profile.activateToContinue":"激活许可证","settings.menuFeatures":"菜单功能","settings.menuFeaturesDesc":"根据需要启用或禁用以下功能","settings.interfaceOptions":"界面选项","settings.featureDockLabel":"左侧功能停靠栏","settings.featureDockDesc":"打开弹窗时在左边缘显示快捷栏","feature.tabs":"标签管理","feature.templates":"模板","feature.quickReply":"快捷回复","feature.kanban":"看板CRM","feature.chatbotFlow":"聊天机器人流程","feature.followUp":"跟进","feature.broadcast":"群发","feature.calendar":"日程中心","feature.status":"状态","feature.validator":"验证器","feature.webhook":"Webhook","feature.api":"API","feature.aiBot":"AI机器人","feature.open":"打开","license.activateTitle":"激活您的许可证","license.licenseKey":"许可证密钥","license.phoneNumber":"电话号码","license.phoneDetected":"检测到的电话号码","license.planName":"计划名称","license.endDate":"结束日期","license.expiresIn":"到期时间","license.days":"天","license.daysLeft":"天剩余","license.status":"状态","license.deactivateLicense":"停用许可证","license.deactivateConfirm":"您确定要停用许可证吗？","license.activateLicenseBtn":"激活许可证","license.validating":"验证中...","license.pasteLicenseHere":"在此粘贴您的许可证密钥...","license.completeLicenseKey":"粘贴您通过电子邮件收到的完整许可证密钥","trial.starting":"正在启动您的7天免费试用...","trial.activated":"7天免费试用已激活!","trial.daysRemaining":"试用剩余{0}天","trial.expired":"试用已过期。请购买许可证。","trial.alreadyUsed":"此号码的试用已使用。请输入许可证密钥继续。","license.waitForWhatsApp":"请等待 WhatsApp 完全加载","license.securityFooter":"受 WebAssembly 加密验证保护","planDetails.title":"计划详情","planDetails.licenceKey":"许可证密钥","planDetails.planName":"计划名称","planDetails.endDate":"结束日期","planDetails.removeKey":"删除密钥","planDetails.changeKey":"更改密钥","features.enabledFeatures":"已启用功能","languages.en":"English (英语)","languages.zh":"中文","languages.hi":"हिंदी (印地语)","languages.es":"Español (西班牙语)","languages.fr":"Français (法语)","languages.ar":"العربية (阿拉伯语)","languages.bn":"বাংলা (孟加拉语)","languages.pt":"Português (葡萄牙语)","languages.ru":"Русский (俄语)","languages.ur":"اردو (乌尔都语)","licenseInfo.title":"许可证信息","licenseInfo.phoneNumber":"电话号码","licenseInfo.expiresIn":"到期时间","licenseInfo.status":"状态","errors.invalidFormat":"许可证密钥格式无效或验证失败","errors.serverError":"服务器错误","errors.networkError":"网络错误。请检查您的连接","tabs.tabs":"标签","tabs.manageTabs":"管理标签","tabs.addTab":"添加标签","tabs.editTab":"编辑标签","tabs.deleteTab":"删除标签","tabs.tabTitle":"标签标题","tabs.tabDetails":"标签详情","tabs.enterTabTitle":"输入标签标题","tabs.enterTabDetails":"输入标签详情","tabs.chooseFrom":"选择来源","tabs.chat":"聊天","tabs.groups":"群组","tabs.label":"标签","tabs.searchHere":"在此搜索","tabs.selectAll":"全选","tabs.clearAll":"清除全部","tabs.selected":"已选择","tabs.allChats":"所有聊天","tabs.chats":"聊天","tabs.noFilterApplied":"未应用筛选器","tabs.view":"查看","tabs.edit":"编辑","tabs.delete":"删除","tabs.hideFromTabBar":"从标签栏隐藏","tabs.showInTabBar":"在标签栏显示","tabs.sort":"排序","tabs.title":"标题","tabs.details":"详情","tabs.action":"操作","tabs.selectLabel":"选择标签","tabs.chooseALabel":"-- 选择一个标签 --","tabs.selectedLabel":"已选标签","tabs.change":"更改","tabs.pleaseSelectLabel":"请从上方下拉菜单中选择标签","tabs.areYouSureDeleteTab":"您确定要删除此标签吗？","tabs.tabDeletedSuccessfully":"标签已成功删除","tabs.cancel":"取消","tabs.save":"保存","tabs.all":"全部","tabs.oneToOne":"1:1","tabs.individualChats":"仅个人聊天","tabs.groupChats":"仅群组聊天","tabs.unread":"未读","tabs.unreadChats":"仅未读聊天","tabs.unsaved":"未保存","tabs.unsavedContacts":"仅未保存联系人","templates.title":"消息模板","templates.manageTemplates":"管理模板","templates.newTemplate":"新建模板","templates.editTemplate":"编辑模板","templates.sendTemplate":"发送模板","templates.deleteTemplate":"删除模板","templates.duplicateTemplate":"复制模板","templates.activateTemplate":"激活","templates.deactivateTemplate":"停用","templates.total":"总计","templates.active":"活跃","templates.inactive":"未活跃","templates.filterAll":"全部","templates.filterActive":"仅活跃","templates.filterInactive":"仅未活跃","templates.filterAllTypes":"所有类型","templates.templates":"个模板","templates.searchPlaceholder":"搜索模板...","templates.noTemplates":"未找到模板","templates.createFirst":"创建您的第一个模板","templates.edit":"编辑","templates.copy":"复制","templates.msgs":"条消息","templates.noMessageContent":"无消息内容","templates.form.templateName":"模板名称","templates.form.templateNamePlaceholder":"输入模板名称","templates.form.templateFor":"模板用于","templates.form.message":"消息","templates.form.messagePlaceholder":"在此输入您的消息...","templates.form.insertVariable":"点击插入变量：","templates.form.personalizeValue":"个性化值","templates.form.personalizeValueHint":"使用个性化值（如@variable1、@variable2等）向您选择的个人广播","templates.form.templatesType":"模板类型","templates.form.templateType":"模板类型","templates.form.templateStatus":"模板状态","templates.form.statusOn":"开","templates.form.statusOff":"关","templates.form.statusHint":"当模板状态为'开'时，可以使用。相反，当模板状态为'关'时，它处于保存状态。","templates.form.on":"开","templates.form.off":"关","templates.form.save":"保存","templates.form.cancel":"取消","templates.form.selectProducts":"选择产品","templates.form.selectContacts":"选择联系人","templates.form.addProduct":"添加产品","templates.form.addContact":"添加联系人","templates.form.buttons":"按钮","templates.form.addButton":"添加按钮","templates.form.buttonsHint":"最多允许3个按钮","templates.form.selectFromContacts":"从联系人中选择","templates.form.addManually":"手动添加","templates.form.productHint":"来自您的WhatsApp商业目录的产品","templates.form.attachImages":"附加图片/视频","templates.form.attachAudio":"附加音频","templates.form.attachDocuments":"附加文档","templates.form.chooseFile":"选择文件","templates.form.maxFileSize":"最大文件大小：16MB（WhatsApp限制）","templates.form.uploading":"上传中...","templates.errors.uploadFailed":"文件上传失败，请重试。","templates.errors.fileTooLarge":"文件太大。最大大小：16MB（WhatsApp限制）。","templates.form.listButtonText":"按钮文字","templates.form.listButtonTextPlaceholder":"输入按钮文字","templates.form.listDescription":"描述","templates.form.listDescriptionPlaceholder":"输入描述","templates.form.listSections":"部分","templates.form.pollQuestion":"投票问题","templates.form.pollQuestionPlaceholder":"输入您的投票问题","templates.form.allowMultipleAnswers":"允许多选","templates.form.allowMultipleAnswersHint":"用户可以选择多个选项","templates.form.pollOptions":"投票选项","templates.form.addOption":"+ 添加选项","templates.form.pollOptionsHint":"最少2个，最多12个选项","templates.messageType.individual":"一对一","templates.messageType.tab":"标签","templates.messageType.group":"群组","templates.messageType.label":"标签","templates.messageType.kanban":"看板","templates.messageType.quickReply":"⚡ 快速回复","templates.attachmentType.none":"仅消息","templates.attachmentType.imageVideo":"消息 + 图片/视频","templates.attachmentType.document":"消息 + 文档","templates.attachmentType.audio":"消息 + 音频","templates.attachmentType.contact":"消息 + 联系人","templates.attachmentType.poll":"消息 + 投票","templates.attachmentType.list":"消息 + 列表","templates.attachmentType.product":"消息 + 产品","templates.attachmentType.buttons":"消息 + 按钮","templates.messages":"消息","templates.addMessage":"添加消息","templates.deleteMessage":"删除消息","templates.messageNumber":"消息 {number}","templates.delayBetweenMessages":"下一条消息前的延迟","templates.delayMin":"最小（秒）","templates.delayMax":"最大（秒）","templates.collapseMessage":"折叠","templates.expandMessage":"展开","crm.button":"客户管理","crm.openCRM":"打开客户管理","crm.profile":"个人资料","crm.tabs":"标签","crm.notes":"备注","crm.reminder":"提醒","crm.appointment":"预约","crm.income":"收入","crm.expense":"支出","crm.scheduleTab":"定时发送","crm.deletedMessagesTab":"已删除的消息","crm.antiRevokeEnabled":"防撤回已开启","crm.antiRevokeDisabled":"防撤回已关闭","crm.antiRevokeDescription":"本地保存收到的消息，即使对方撤回你也能看到。","crm.antiRevokeNotEnabledHint":"请先在上方开启防撤回，才能开始保存收到的消息。","crm.noDeletedMessages":"目前还没有已恢复的撤回消息。我们正在监听，一旦有人撤回消息，就会在这里保留一份副本。","crm.onlyThisContact":"仅此联系人","crm.allContacts":"所有联系人","crm.clearHistory":"清空历史","crm.exportCSV":"导出 CSV","crm.revokedAt":"撤回时间","crm.copyMessage":"复制","crm.lionRecovered":"{brand} 已恢复","crm.clickToShowOriginal":"点击显示原始消息","crm.antiRevokeChatTip":"小提示：你也可以直接在聊天中点击已删除消息上的恢复图标，快速查看原文。","crm.searchMessages":"搜索消息…","crm.recoveredCount":"已恢复 {count} 条消息","crm.confirmClearChatHistory":"清空此联系人的已恢复消息？","crm.confirmClearAllHistory":"清空所有聊天中的全部已恢复消息？","crm.noTextContent":"（无文字 — 媒体消息）","crm.group":"群组","crm.enable":"开启","crm.disable":"关闭","crm.addScheduleMessage":"添加定时","crm.noScheduledMessages":"没有定时消息","crm.noScheduledMessagesDesc":"为此联系人安排消息。","crm.userDetails":"用户详情","crm.addCustomAttribute":"+ 添加属性","crm.edit":"编辑","crm.cancel":"取消","crm.save":"保存","crm.signature":"签名","crm.signatureDesc":"输入您的姓名以发送签名消息，或向其他代理显示您正在特定聊天中服务。","crm.enterYourName":"输入您的姓名","crm.activateSignature":"激活签名","crm.signatureAs":"签名为","crm.signatureNotSet":"在WhatsApp Web扩展设置中设置您的签名名称。","crm.delete":"删除","crm.deleteConnection":"删除连接？","crm.deleteConnectionConfirm":"您确定要删除节点之间的此连接吗？","crm.fullName":"全名","crm.phoneNumber":"电话号码","crm.email":"电子邮件","crm.gender":"性别","crm.dateOfBirth":"出生日期","crm.details":"详情","crm.address":"地址","crm.language":"语言","crm.male":"男","crm.female":"女","crm.other":"其他","crm.select":"- 选择 -","crm.customAttributes":"自定义属性","crm.addField":"添加字段","crm.fieldLabel":"字段标签","crm.fieldValue":"字段值","crm.noCustomFields":"暂无自定义字段","crm.deleteFieldConfirm":"确定要删除此字段吗？","crm.contactTabs":"联系人标签","crm.addToTab":"添加到标签","crm.removeFromTab":"从标签移除","crm.noTabs":"暂无标签","crm.createTab":"创建标签","crm.tabName":"标签名称","crm.contacts":"个联系人","crm.addToLabel":"添加到标签","crm.selectLabel":"选择标签","crm.noLabelsAvailable":"暂无标签。请先创建标签。","crm.labelsAndStages":"标签和阶段","crm.whatsappLabels":"WhatsApp 标签","crm.customTabs":"自定义标签页","team.button":"团队","team.shareWith":"分享给团队","team.settings":"团队设置","team.addMember":"添加成员","team.editMember":"编辑成员","team.deleteMember":"删除","team.memberName":"成员姓名","team.memberPhone":"电话号码","team.department":"部门","team.departmentPlaceholder":"例如：销售、财务、支持","team.template":"消息模板","team.templatePlaceholder":"输入带变量的消息...","team.noMembers":"暂无团队成员","team.clickToAdd":"点击 + 添加团队成员","team.sending":"发送中...","team.insertVariable":"插入变量","team.preview":"预览消息","team.deleteConfirm":"确定要删除此团队成员吗？","team.phonePlaceholder":"例如：+5511999999999","team.namePlaceholder":"例如：销售主管 - 张三","team.variableHint":"使用 {{name}}、{{phone}}、{{labels}} 等动态内容","team.save":"保存","team.cancel":"取消","team.editTemplate":"编辑模板","team.saveAndSend":"保存并发送","team.sendOnce":"仅发送一次","team.send":"发送","team.selectContact":"选择联系人","team.clickToSelectContact":"点击从WhatsApp中选择联系人","team.searchContact":"搜索联系人...","team.loadingContacts":"加载联系人中...","team.noContactsFound":"未找到联系人","team.noSearchResults":"无匹配结果","team.phoneHint":"输入带国家代码的号码或点击图标选择联系人","team.popupTitle":"分享给团队","team.popupSubtitle":"即时发送联系人详情","team.noTeamMembers":"暂无团队成员","team.noTeamMembersDesc":"添加团队成员以快速通过WhatsApp分享联系人详情","crm.addNote":"+ 添加备注","crm.searchNotes":"搜索备注...","crm.noNotes":"暂无备注","crm.addFirstNote":"添加您的第一条备注","crm.topic":"主题","crm.content":"内容","crm.editNote":"编辑备注","crm.deleteNote":"删除备注","crm.deleteNoteConfirm":"确定要删除此备注吗？","crm.addReminder":"+ 添加提醒","crm.noReminders":"暂无提醒","crm.addFirstReminder":"添加您的第一个提醒","crm.reminderTopic":"提醒主题","crm.dateTime":"日期和时间","crm.repeatInterval":"重复间隔","crm.noRepeat":"不重复","crm.every5Min":"每5分钟","crm.every10Min":"每10分钟","crm.every15Min":"每15分钟","crm.every30Min":"每30分钟","crm.every1Hour":"每1小时","crm.status":"状态","crm.pending":"待处理","crm.completed":"已完成","crm.dismissed":"已忽略","crm.stopped":"已停止","crm.snoozed":"已暂停","crm.due":"到期","crm.editReminder":"编辑提醒","crm.deleteReminder":"删除提醒","crm.markComplete":"标记完成","crm.snooze":"暂停","crm.stop":"停止","crm.addAppointment":"+ 添加预约","crm.noAppointments":"暂无预约","crm.addFirstAppointment":"添加您的第一个预约","crm.appointmentTitle":"预约标题","crm.attendee":"参与者","crm.googleMeetLink":"Google Meet链接","crm.generateLink":"生成链接","crm.messageTemplate":"消息模板","crm.reminderBefore":"提前提醒","crm.sendMessageNow":"立即发送消息","crm.scheduled":"已安排","crm.cancelled":"已取消","crm.missed":"已错过","crm.editAppointment":"编辑预约","crm.deleteAppointment":"删除预约","crm.joinMeeting":"加入会议","crm.before5Min":"提前5分钟","crm.before10Min":"提前10分钟","crm.before15Min":"提前15分钟","crm.before30Min":"提前30分钟","crm.before1Hour":"提前1小时","crm.before2Hours":"提前2小时","crm.before1Day":"提前1天","crm.titleLabel":"标题","crm.scheduleDateTime":"安排日期和时间","crm.pasteGoogleMeetLink":"在此粘贴您的Google Meet链接","crm.generateLinkHint":"点击'生成链接'打开Google Meet，然后在此粘贴会议链接","crm.chooseTemplate":"选择模板","crm.selectTemplate":"-- 选择一个模板 --","crm.messageTemplatePlaceholder":"输入消息模板...","crm.useSameMessage":"会议开始时使用相同消息","crm.meetingStartMessageLabel":"会议开始消息","crm.meetingStartPlaceholder":"输入会议开始时要发送的消息...","crm.meetingStartHint":"此消息将在会议实际开始时发送。","crm.sendReminderLabel":"发送提醒","crm.reminderTimeHint":"消息将在会议前的此时间发送给参与者。您也会收到声音通知。","crm.sendMessageNowTo":"立即发送消息给","crm.sendNowHint":"勾选此项以在保存后立即发送预约消息","crm.discard":"放弃","crm.saveAndSend":"保存并发送","crm.sending":"发送中...","crm.noAppointmentsFound":"未找到预约","crm.searchAppointments":"搜索预约","crm.productDemoCall":"例如，产品演示电话","crm.reminderMessageHint":"此消息将在提醒时间（会议前）发送。","crm.joinMeet":"加入Meet","crm.appointmentTemplates":"预约模板","crm.savedTemplates":"已保存的模板","crm.noTemplatesYet":"暂无模板。创建您的第一个模板！","crm.newTemplate":"+ 新建模板","crm.editTemplateTitle":"编辑模板","crm.newTemplateTitle":"新建模板","crm.templateName":"模板名称","crm.templateNamePlaceholder":"例如，会议提醒","crm.meetLinkOptional":"Google Meet链接（可选）","crm.updateTemplate":"更新模板","crm.saveTemplate":"保存模板","crm.pleaseEnterTitle":"请输入标题","crm.pleaseSelectFutureDate":"请选择未来的日期和时间","crm.deleteAppointmentConfirm":"确定要删除此预约吗？","crm.pleaseEnterTemplateName":"请输入模板名称","crm.pleaseEnterMessageTemplate":"请输入消息模板","crm.deleteTemplateConfirm":"确定要删除此模板吗？","crm.addIncome":"+ 添加收入","crm.totalIncome":"总收入","crm.pendingIncome":"待处理","crm.filteredTotal":"筛选总计","crm.noIncome":"暂无收入记录","crm.addFirstIncome":"添加您的第一笔收入","crm.amount":"金额","crm.category":"类别","crm.paymentMethod":"付款方式","crm.description":"描述","crm.reference":"参考","crm.date":"日期","crm.paymentReceived":"收到付款","crm.sale":"销售","crm.serviceFee":"服务费","crm.commission":"佣金","crm.refundReceived":"收到退款","crm.cash":"现金","crm.bankTransfer":"银行转账","crm.upi":"UPI","crm.pix":"PIX","crm.card":"银行卡","crm.cheque":"支票","crm.addCustomPaymentMethod":"添加自定义方式","crm.editIncome":"编辑收入","crm.deleteIncome":"删除收入","crm.addExpense":"+ 添加支出","crm.totalExpense":"总支出","crm.pendingExpense":"待处理","crm.noExpense":"暂无支出记录","crm.addFirstExpense":"添加您的第一笔支出","crm.purchase":"采购","crm.serviceCost":"服务成本","crm.travel":"差旅","crm.marketing":"营销","crm.commissionPaid":"已付佣金","crm.refundGiven":"已退款","crm.editExpense":"编辑支出","crm.deleteExpense":"删除支出","crm.search":"搜索...","crm.all":"全部","crm.today":"今天","crm.thisWeek":"本周","crm.thisMonth":"本月","crm.thisYear":"今年","crm.filterByCategory":"按类别筛选","crm.filterByStatus":"按状态筛选","crm.filterByDate":"按日期筛选","crm.allStatus":"所有状态","crm.allCategories":"所有类别","crm.none":"无","crm.ref":"参考","crm.tableTabName":"标签名称","crm.tableContactsInTab":"标签中的联系人","crm.tableAction":"操作","crm.tableName":"名称","crm.tableModifiedDate":"修改日期","crm.tableTopic":"主题","crm.tableReminderDate":"提醒日期","crm.tableRepeatSnooze":"重复/延迟","crm.tableStatus":"状态","crm.tableTitle":"标题","crm.tableDateTime":"日期和时间","crm.tableAttendee":"参与者","crm.tableMeetLink":"会议链接","crm.tableDescription":"描述","crm.tableCategory":"类别","crm.tableAmount":"金额","crm.tablePayment":"支付","crm.tableDate":"日期","crm.addIncomeTitle":"添加收入","crm.editIncomeTitle":"编辑收入","crm.addExpenseTitle":"添加支出","crm.editExpenseTitle":"编辑支出","crm.enterAmount":"输入金额","crm.validAmountRequired":"请输入有效金额","crm.descriptionRequired":"请输入描述","crm.referenceInvoice":"参考 / 发票号","crm.referenceBill":"参考 / 账单号","crm.invoicePlaceholder":"例如 INV-001","crm.billPlaceholder":"例如 BILL-001","crm.paymentDescription":"例如 服务付款","crm.expenseDescription":"例如 办公用品","crm.update":"更新","crm.addIncomeBtn":"添加收入","crm.addExpenseBtn":"添加支出","crm.recurringTransaction":"定期交易","crm.repeatEvery":"重复周期","crm.neverEnds":"永不结束","crm.endDate":"结束日期","crm.daily":"每天","crm.weekly":"每周","crm.monthly":"每月","crm.quarterly":"每季度（3个月）","crm.yearly":"每年","crm.currencySettings":"货币设置","crm.searchCurrency":"搜索货币...","crm.noCurrenciesFound":"未找到货币","crm.noIncomeRecords":"未找到收入记录","crm.noExpenseRecords":"未找到支出记录","crm.deleteIncomeConfirm":"确定要删除此收入记录吗？","crm.deleteExpenseConfirm":"确定要删除此支出记录吗？","crm.addCategory":"添加类别","crm.categoryName":"类别名称","crm.enterCategoryName":"输入类别名称","crm.customCategories":"自定义类别","crm.addCustomCategory":"添加自定义类别","crm.existingCustomCategories":"现有自定义类别","crm.addStatus":"添加状态","crm.statusName":"状态名称","crm.enterStatusName":"输入状态名称","crm.customStatuses":"自定义状态","crm.addCustomStatus":"添加自定义状态","crm.existingCustomStatuses":"现有自定义状态","crm.add":"添加","crm.loading":"加载中...","crm.dismiss":"关闭","crm.yesterday":"昨天","agent.agentMode":"客服模式","agent.identifyAsAgent":"标识为客服","agent.agentName":"客服名称","agent.namePlaceholder":"例如：小明、客服组1","agent.agentNamePlaceholder":"输入您的客服名称","agent.viewTransferHistory":"查看转接历史","agent.transferToAgent":"转接给客服","agent.transferSuccess":"聊天转接成功","agent.noAgentsOnline":"没有在线客服","agent.selectAgent":"选择客服","agent.chooseAgent":"-- 选择一个客服 --","agent.reason":"原因","agent.reasonPlaceholder":"为什么要转接这个聊天？","agent.priority":"优先级","agent.priorityLow":"低","agent.priorityMedium":"中","agent.priorityHigh":"高","agent.priorityUrgent":"紧急","agent.transfer":"转接","agent.incomingTransfer":"接收转接","agent.fromAgent":"来自客服","agent.toAgent":"转给客服","agent.chat":"聊天","agent.startService":"开始服务","agent.endService":"结束服务","agent.activeService":"活动服务","agent.from":"来自","agent.to":"转给","agent.duration":"时长","agent.transferHistory":"转接历史","agent.sent":"已发送","agent.received":"已接收","agent.status":"状态","agent.all":"全部","agent.statusPending":"待处理","agent.statusAccepted":"已接受","agent.statusInService":"服务中","agent.statusCompleted":"已完成","agent.statusDeclined":"已拒绝","agent.statusExpired":"已过期","agent.noTransfers":"没有找到转接记录","agent.serviceQueue":"服务队列","agent.pendingTransfers":"待处理转接","agent.activeServices":"活动服务","agent.sentTransfers":"已发送转接","agent.noActiveServices":"没有活动服务或待处理转接","agent.serviceEnded":"服务已成功结束","agent.accept":"接受","agent.decline":"拒绝","agent.notRegistered":"客服未注册。请先启用客服模式。","agent.statusCancelled":"已取消","agent.started":"已开始","chatTools.suggest":"建议","chatTools.spelling":"拼写","chatTools.translate":"翻译","chatTools.summarize":"总结","chatTools.enlarge":"扩展","chatTools.friendly":"友好","chatTools.formal":"正式","chatTools.send":"发送","chatTools.copy":"复制","chatTools.use":"使用","chatTools.aiResult":"AI 结果","chatTools.suggestTitle":"AI 建议","chatTools.spellingTitle":"修正拼写和语法","chatTools.translateTitle":"翻译为","chatTools.summarizeTitle":"总结文本","chatTools.enlargeTitle":"扩展文本","chatTools.friendlyTitle":"使其友好","chatTools.formalTitle":"使其正式","chatTools.conversationSummary":"聊天摘要","chatTools.conversationSummaryTitle":"总结这段对话","chatTools.conversationSummarizing":"正在总结聊天…","chatTools.conversationSummaryEmpty":"此聊天中没有可总结的消息","chatTools.conversationSummaryNoChat":"请先打开一个聊天","chatTools.conversationSummaryFailed":"获取聊天消息失败","chatTools.conversationSummaryResultTitle":"对话摘要","chatTools.sendTitle":"发送消息","chatTools.selectTextFirst":"请先选择文本或在输入框中输入","chatTools.searchLanguage":"搜索语言...","aiSettings.title":"输入AI API密钥","aiSettings.platformType":"AI平台类型","aiSettings.geminiAI":"GEMINI AI","aiSettings.chatgpt":"CHATGPT","aiSettings.deepseek":"DEEPSEEK","aiSettings.apiKey":"AI API密钥","aiSettings.enterApiKey":"请输入您的AI API密钥","aiSettings.validate":"验证","aiSettings.validKey":"API密钥有效！","aiSettings.invalidKey":"API密钥无效，请检查后重试。","aiSettings.note":"注意：","aiSettings.geminiNote":"在Google AI Studio获取您的Gemini API密钥 (aistudio.google.com)","aiSettings.chatgptNote":"在platform.openai.com/api-keys获取您的OpenAI API密钥","aiSettings.deepseekNote":"在platform.deepseek.com获取您的DeepSeek API密钥","aiSettings.enableAITools":"启用AI工具","aiSettings.close":"关闭","aiSettings.save":"保存","aiSettings.configureAI":"配置您的AI提供商和API密钥以使用AI功能","settings.title":"设置","settings.yourLanguage":"您的语言","settings.selectLanguage":"选择语言","settings.chooseLanguage":"选择您偏好的扩展界面语言","settings.whatLanguageSpeak":"您说什么语言","settings.translateMessages":"翻译收到的消息","settings.selectSpokenLanguage":"选择您的语言","settings.spokenLanguageHint":"当您点击收到消息上的翻译图标时，消息将被翻译成此语言。","settings.blurSettings":"模糊设置","settings.blurDescription":"模糊屏幕上的私人信息。","settings.blurMessages":"模糊消息","settings.blurProfileNames":"模糊个人资料名称","settings.blurDisplayPhotos":"模糊头像照片","settings.blurConversation":"模糊对话","settings.displayOnHover":"悬停时显示对话","settings.theme":"主题","settings.themeDescription":"选择您喜欢的配色方案","settings.lightMode":"浅色模式","settings.lightModeDesc":"经典浅色外观","settings.darkMode":"深色模式","settings.darkModeDesc":"在弱光下更护眼","settings.systemMode":"系统","settings.systemModeHint":"跟随 WhatsApp 主题","settings.currentTheme":"当前主题","signature.title":"签名","signature.enableSignature":"启用签名","signature.yourSignature":"您的签名","signature.placeholder":"例如，- 张三","signature.preview":"预览","signature.save":"保存","backup.title":"备份和恢复","backup.export":"导出","backup.import":"导入","backup.importHint":"上传 {brand} 备份 JSON 文件以恢复您的数据。您可以选择要导入的功能。","backup.kanbanCRM":"看板CRM数据","backup.customTabs":"自定义标签","backup.templatesQuickReplies":"模板和快捷回复","backup.broadcastHistory":"广播历史","backup.settings":"设置","backup.crmProfileData":"CRM个人资料数据","backup.calendarData":"日历（提醒和预约）","backup.statusData":"状态","backup.webhookSettings":"Webhook设置","backup.aiBotSettings":"AI机器人设置","backup.aiApiSettings":"AI API设置","backup.spokenLanguage":"使用的语言","backup.chatbotFlows":"聊天机器人流程 (Fluxo)","backup.followupData":"跟进序列","backup.scheduledMessages":"定时消息","backup.scheduledBroadcasts":"定时广播","backup.fluxoAdvanced":"Fluxo高级设置","backup.conversationStates":"对话状态","backup.bulkValidatorData":"批量验证器数据","backup.quickReplies":"快捷回复","backup.crmTodos":"CRM待办事项列表","backup.signatureSettings":"签名设置","backup.teamSettings":"团队设置","backup.blurSettings":"模糊设置","backup.featureVisibility":"功能可见性","backup.themeSettings":"主题设置","backup.uiStateSettings":"界面状态设置","backup.apiPollingSettings":"API轮询设置","backup.agentSettings":"代理设置","backup.autoBackup":"自动备份","backup.autoBackupInfo":"当WhatsApp Web在新日期加载时，将自动创建备份","backup.autoBackupDestination":"备份目标","backup.autoBackupWhatsApp":"发送到WhatsApp已保存消息","backup.autoBackupDownload":"下载到电脑","backup.exportNow":"立即导出","backup.importNow":"立即导入","backup.selectFile":"选择要导入的备份文件","backup.importSuccess":"数据导入成功！","backup.importError":"导入数据时出错，请检查文件格式。","backup.exportSuccess":"数据导出成功！","backup.noDataSelected":"请至少选择一种数据类型进行导出/导入","backup.cheetahDetected":"检测到Cheetah CRM","backup.fileLoaded":"文件加载成功","backup.cheetahImportDesc":"此备份包含Cheetah CRM数据。所有兼容功能将被导入并与您现有的CRM数据合并。","backup.dataToImport":"要导入的数据：","backup.mergeWarning":"重要提示：","backup.mergeWarningDesc":"数据将与现有CRM数据合并。您当前的数据不会被覆盖 - 只会添加新数据。","backup.importing":"导入中...","backup.importCheetah":"导入Cheetah CRM备份","missedSchedule.title":"计划活动已错过","missedSchedule.description":"由于WhatsApp Web在计划时间未打开，计划活动已错过。","missedSchedule.sendNow":"立即发送","missedSchedule.cancelDiscard":"取消并丢弃","missedSchedule.dismiss":"稍后提醒","calendar.title":"日历","calendar.goToToday":"转到今天","calendar.reminders":"提醒","calendar.appointments":"预约","calendar.remindersFor":"提醒日期","calendar.appointmentsFor":"预约日期","calendar.noReminders":"此日期没有提醒","calendar.noAppointments":"此日期没有预约","calendar.selectDate":"选择有提醒或预约的日期查看详情","calendar.deleteReminder":"删除提醒","calendar.deleteAppointment":"删除预约","calendar.confirmDeleteReminder":"确定要删除此提醒吗？","calendar.confirmDeleteAppointment":"确定要删除此预约吗？","calendar.everyMin":"每 {min} 分钟","calendar.everyHour":"每小时","calendar.weekdays.sun":"日","calendar.weekdays.mon":"一","calendar.weekdays.tue":"二","calendar.weekdays.wed":"三","calendar.weekdays.thu":"四","calendar.weekdays.fri":"五","calendar.weekdays.sat":"六","calendar.months.january":"一月","calendar.months.february":"二月","calendar.months.march":"三月","calendar.months.april":"四月","calendar.months.may":"五月","calendar.months.june":"六月","calendar.months.july":"七月","calendar.months.august":"八月","calendar.months.september":"九月","calendar.months.october":"十月","calendar.months.november":"十一月","calendar.months.december":"十二月","calendar.status.pending":"待处理","calendar.status.completed":"已完成","calendar.status.dismissed":"已取消","calendar.status.snoozed":"已暂停","calendar.status.stopped":"已停止","calendar.status.scheduled":"已安排","calendar.status.cancelled":"已取消","calendar.status.missed":"已错过","calendar.todos":"待办事项","calendar.todosFor":"待办事项","calendar.noTodos":"未找到待办事项","calendar.addTodo":"添加待办","calendar.editTodo":"编辑待办","calendar.deleteTodo":"删除待办","calendar.confirmDeleteTodo":"确定要删除此待办事项吗？","todo.title":"标题","todo.titlePlaceholder":"输入任务标题","todo.description":"描述","todo.descriptionPlaceholder":"添加详情（可选）","todo.dueDate":"截止日期","todo.dueTime":"截止时间","todo.priority":"优先级","todo.priorityHigh":"高","todo.priorityMedium":"中","todo.priorityLow":"低","todo.category":"分类","todo.noCategory":"无分类","todo.categoryWork":"工作","todo.categoryPersonal":"个人","todo.categoryUrgent":"紧急","todo.categoryShopping":"购物","todo.categoryHealth":"健康","todo.subtasks":"子任务","todo.addSubtask":"添加","todo.subtaskPlaceholder":"输入子任务","todo.recurring":"重复","todo.repeatEvery":"重复","todo.endDate":"结束日期","todo.recurringDaily":"每天","todo.recurringWeekly":"每周","todo.recurringMonthly":"每月","todo.recurringYearly":"每年","todo.reminder":"提醒","todo.reminderDate":"提醒日期","todo.reminderTime":"提醒时间","todo.browserNotification":"浏览器通知","todo.whatsappSelfMessage":"发送WhatsApp提醒给自己","todo.whatsappSelfMessageHint":"任务到期时您将收到WhatsApp消息","todo.save":"保存任务","todo.update":"更新任务","todo.cancel":"取消","todo.addTodo":"添加任务","todo.editTodo":"编辑任务","todo.statusPending":"待处理","todo.statusInProgress":"进行中","todo.statusCompleted":"已完成","todo.statusCancelled":"已取消","todo.filterAll":"所有任务","todo.filterToday":"今天","todo.filterThisWeek":"本周","todo.filterOverdue":"已逾期","todo.filterCompleted":"已完成","todo.today":"今天","todo.tomorrow":"明天","todo.overdue":"已逾期","todo.snoozeTime":"延后时间","todo.minutes":"分钟","todo.hour":"小时","todo.hours":"小时","todo.day":"天","todo.taskReminder":"任务提醒","todo.highPriority":"高优先级","todo.mediumPriority":"中优先级","todo.lowPriority":"低优先级","todo.subtasksCount":"个子任务","todo.snooze":"延后","todo.markDone":"标记完成","todo.dismiss":"忽略","todo.task":"任务","todo.changeColor":"点击更改颜色","todo.selectCategoryFirst":"请先选择分类","todo.linkedContacts":"关联联系人","todo.optional":"可选","todo.selectContacts":"选择联系人","todo.searchContacts":"搜索联系人...","todo.noContactsFound":"未找到联系人","todo.selected":"已选择","todo.contacts":"联系人","status.title":"状态","status.activeStatus":"活动状态","status.createStatus":"创建状态","status.loading":"正在加载状态...","status.noStatusFound":"未找到状态","status.noStatusDescription":"您似乎还没有创建任何状态。点击下方按钮添加新状态。","status.add":"添加","status.statusName":"状态名称（可选）","status.statusNamePlaceholder":"为状态创建名称","status.chooseType":"选择类型","status.type.text":"文字","status.type.image":"图片","status.type.video":"视频","status.type.audio":"音频","status.typeText":"输入文字","status.backgroundColor":"选择背景颜色","status.clickToChange":"点击更换颜色","status.import":"导入","status.dragHere":"将文件拖到这里","status.caption":"标题（可选）","status.captionPlaceholder":"为您的状态添加标题...","status.scheduleStatus":"定时发布状态","status.autoRepost24h":"每24小时自动重发状态","status.autoRepost":"自动重发","status.postNow":"立即发布","status.posting":"发布中...","status.create":"创建","status.edit":"编辑","status.delete":"删除","status.emoji":"表情","status.status.pending":"待发布","status.status.posted":"已发布","status.status.scheduled":"已安排","status.status.failed":"失败","ai.regenerate":"重新生成","ai.regenerating":"正在重新生成...","ai.regenerateWithAI":"使用AI重新生成","ai.notEnabled":"AI未启用。请配置AI设置。","ai.failedToRegenerate":"重新生成失败","ai.failedToRegenerateMessage":"消息重新生成失败","broadcast.title":"群发消息","broadcast.newCampaign":"新建活动","broadcast.reports":"报告","broadcast.close":"关闭","broadcast.sending":"发送中...","broadcast.paused":"已暂停","broadcast.completed":"已完成","broadcast.clearHistory":"清除历史记录","broadcast.createCampaign":"创建活动","broadcast.createCampaignSubtitle":"向多个联系人发送个性化消息","broadcast.scheduledCampaigns":"计划中的活动","broadcast.campaignReports":"活动报告","broadcast.viewManageCampaigns":"查看和管理您的活动","broadcast.recipients":"收件人","broadcast.selected":"已选择","broadcast.contacts":"联系人","broadcast.groups":"群组","broadcast.phone":"电话","broadcast.phonePlaceholder":"带国家代码的电话号码","broadcast.clearAll":"清除全部","broadcast.contactsUploaded":"个联系人已上传","broadcast.noGroupsSelected":'未选择群组。点击"添加群组"进行选择。',"broadcast.addGroups":"添加群组","broadcast.groupsSelected":"个群组已选择","broadcast.upload":"上传","broadcast.select":"选择","broadcast.download":"下载","broadcast.groupsContacts":"群组联系人","broadcast.tabsContacts":"标签联系人","broadcast.kanbanBoard":"看板","broadcast.labelsContacts":"标签联系人","broadcast.allowRepeat":"允许重复号码","broadcast.enableLinkPreview":"启用链接预览","broadcast.groupActions":"群组操作","broadcast.customTabActions":"自定义标签操作","broadcast.labelsActions":"标签操作","broadcast.kanbanBoardActions":"看板操作","broadcast.skipBulkMessage":"跳过群发消息","broadcast.skipBulkMessageInfo":"将跳过消息发送。仅对联系人执行操作（群组、标签页、标签、看板）。","broadcast.appendSignature":"添加签名","broadcast.signaturePreview":"预览","broadcast.groupActionsNote":"注意：您必须是群组管理员才能执行以下操作。","broadcast.addIntoGroups":"添加到群组","broadcast.removeFromGroups":"从群组移除","broadcast.selectGroups":"选择群组","broadcast.addIntoTabs":"添加到自定义标签","broadcast.removeFromTabs":"从自定义标签移除","broadcast.selectTabs":"选择标签","broadcast.addToLabels":"添加到标签","broadcast.removeFromLabels":"从标签移除","broadcast.selectLabels":"选择标签","broadcast.addToKanban":"添加到看板阶段","broadcast.removeFromKanban":"从看板阶段移除","broadcast.selectCRMStage":"选择CRM和阶段","broadcast.sendRandomMessage":"向每个联系人发送随机消息","broadcast.addMessage":"添加消息","broadcast.pauseSetting":"暂停设置","broadcast.pauseAfterXSends":"暂停（每发送X条后）：","broadcast.pauseTimeInSeconds":"暂停时间（秒）：","broadcast.second":"秒","broadcast.message":"消息","broadcast.moveUp":"上移","broadcast.moveDown":"下移","broadcast.deleteMessage":"删除消息","broadcast.templateType":"模板类型","broadcast.messageOnly":"仅消息","broadcast.enterMessageText":"请输入消息内容","broadcast.variable":"变量","broadcast.phoneNumber":"电话号码","broadcast.contactName":"联系人姓名","broadcast.uploadCSVHint":"上传带有额外列的CSV以添加更多变量","broadcast.selectTemplates":"选择模板","broadcast.noTemplates":"没有可用的模板","broadcast.sendingDelay":"发送延迟","broadcast.minimumSecond":"最小秒数","broadcast.maximumSecond":"最大秒数","broadcast.delayHint":"每条消息将在{min}-{max}秒之间随机延迟发送","broadcast.scheduleMessage":"定时消息","broadcast.date":"日期","broadcast.time":"时间","broadcast.autoSendIfMissed":"如果错过预定时间自动发送","broadcast.recurring":"重复","broadcast.repeatInterval":"重复","broadcast.daily":"每天","broadcast.weekly":"每周","broadcast.monthly":"每月","broadcast.yearly":"每年","broadcast.selectDays":"选择日期","broadcast.sun":"日","broadcast.mon":"一","broadcast.tue":"二","broadcast.wed":"三","broadcast.thu":"四","broadcast.fri":"五","broadcast.sat":"六","broadcast.ends":"结束","broadcast.endNever":"永不","broadcast.endOnDate":"在日期","broadcast.recurringHowToUse":"如何使用定期发送","broadcast.recurringTip1":"启用定期以自动重复此广播","broadcast.recurringTip2":"选择频率：每日、每周、每月或每年","broadcast.recurringTip3":"对于每周：选择特定日期（周一、周二等）","broadcast.recurringTip4":'设置结束日期或选择"永不"以无限期运行',"broadcast.recurringTip5":"每次广播后，下一次会自动安排","broadcast.selectDates":"选择日期","broadcast.selectMonths":"选择月份","broadcast.calendarSelectInfo":"从日历中选择特定日期。使用箭头导航月份。","broadcast.datesSelected":"个日期已选","broadcast.jan":"1月","broadcast.feb":"2月","broadcast.mar":"3月","broadcast.apr":"4月","broadcast.may":"5月","broadcast.jun":"6月","broadcast.jul":"7月","broadcast.aug":"8月","broadcast.sep":"9月","broadcast.oct":"10月","broadcast.nov":"11月","broadcast.dec":"12月","broadcast.quickStart":"快速开始","broadcast.previewStart":"预览并开始","broadcast.scheduleBroadcast":"计划群发","broadcast.sent":"已发送","broadcast.failed":"失败","broadcast.resume":"继续","broadcast.pause":"暂停","broadcast.stop":"停止","broadcast.resumeCampaign":"继续活动？","broadcast.campaignInterrupted":"活动已中断。您要继续吗？","broadcast.remaining":"剩余","broadcast.contactsProcessed":"个联系人已处理","broadcast.resumeCampaignBtn":"继续活动","broadcast.cancelDiscard":"取消并丢弃","broadcast.dismissRemindLater":"忽略（稍后提醒）","broadcast.broadcastScheduled":"群发已计划！","broadcast.campaignPreview":"活动预览","broadcast.messages":"消息","broadcast.stepSettings":"设置","broadcast.stepActions":"操作","broadcast.stepReview":"审核","broadcast.delayRange":"延迟范围","broadcast.pauseAfterDuration":"暂停后/持续时间","broadcast.checkConsole":"查看浏览器控制台获取详细配置","broadcast.sendingQueue":"发送队列","broadcast.broadcastReports":"群发报告","broadcast.campaignHistory":"活动历史","broadcast.noHistoryYet":"暂无群发历史","broadcast.historyDescription":"您完成和计划的群发将显示在这里","broadcast.noCampaignsYet":"暂无已完成的活动","broadcast.dateTime":"日期和时间","broadcast.status":"状态","broadcast.scheduled":"已计划","broadcast.cancel":"取消","broadcast.running":"运行中","broadcast.cancelled":"已取消","broadcast.downloadAllContacts":"下载所有联系人","broadcast.downloadSentContacts":"下载已发送联系人","broadcast.downloadFailedContacts":"下载失败联系人","broadcast.selectGroupsToAdd":"选择要添加联系人的群组","broadcast.selectGroupsToRemove":"选择要移除联系人的群组","broadcast.selectTabsToAdd":"选择要添加联系人的标签","broadcast.selectTabsToRemove":"选择要移除联系人的标签","broadcast.selectLabelsToAdd":"选择要添加联系人的标签","broadcast.selectLabelsToRemove":"选择要移除联系人的标签","broadcast.selectCRM":"选择CRM","broadcast.selectStage":"选择阶段","broadcast.backToCRMs":"返回CRM列表","broadcast.loadingGroups":"加载群组中...","broadcast.loadingTabs":"加载标签中...","broadcast.loadingLabels":"加载标签中...","broadcast.noGroupsFound":"未找到您是管理员的群组","broadcast.noTabsFound":"未找到自定义标签。请先创建标签。","broadcast.noLabelsFound":"未找到标签。请先在WhatsApp中创建标签。","broadcast.noCRMsFound":"未找到CRM。请先创建CRM。","broadcast.noStagesFound":"此CRM中未找到阶段。","broadcast.tabsSelected":"个标签已选择","broadcast.labelsSelected":"个标签已选择","broadcast.confirmSelection":"确认选择","broadcast.availableVariables":"可用变量","broadcast.of":"/","broadcast.chats":"个聊天","broadcast.remove":"移除","broadcast.allScheduledCampaigns":"所有定时活动","broadcast.noScheduledCampaigns":"没有定时活动","broadcast.scheduleFirstCampaign":"安排您的第一个活动以在此处查看","broadcast.createNewCampaign":"创建新活动","broadcast.oneTime":"一次性","broadcast.nextRun":"下次执行","broadcast.runNow":"立即执行","broadcast.pauseCampaign":"暂停","broadcast.editCampaign":"编辑","broadcast.deleteCampaign":"删除","broadcast.confirmDeleteScheduled":"确定要删除此定时活动吗？","broadcast.campaignStarting":"活动即将开始","broadcast.skipNext":"跳过下次","broadcast.unskipNext":"不跳过","broadcast.skippingNext":"跳过下次","broadcast.lastRun":"上次执行","broadcast.runs":"次执行","broadcast.successRate":"成功率","broadcast.justNow":"刚刚","broadcast.inAMoment":"即将","broadcast.ago":"前","broadcast.in":"后","broadcast.uploadContacts":"上传联系人","broadcast.stepSelect":"选择","broadcast.stepMap":"映射","broadcast.stepUpload":"上传","broadcast.uploadCSVImport":"上传CSV文件导入联系人","broadcast.uploadCSVOnly":"仅支持CSV文件格式","broadcast.downloadSampleFile":"下载示例文件","broadcast.phoneNumberLabel":"电话号码：","broadcast.mapColumnHint":"映射包含'电话号码'数据的列","broadcast.chooseExtraColumns":"选择用于个性化消息的额外列。","broadcast.all":"全选","broadcast.none":"全不选","broadcast.previous":"上一步","broadcast.next":"下一步","broadcast.removeUnwantedRows":"移除不需要的行","broadcast.totalContacts":"总联系人","broadcast.startUpload":"开始上传","broadcast.rows":"行","broadcast.selectGroupsTitle":"选择群组","broadcast.searchGroups":"搜索群组...","broadcast.members":"成员","broadcast.groupsSelectedCount":"个群组已选择","broadcast.addGroupsBtn":"添加群组","broadcast.tooltipBold":"粗体","broadcast.tooltipItalic":"斜体","broadcast.tooltipStrikethrough":"删除线","broadcast.tooltipAddMedia":"添加媒体","broadcast.tooltipRefresh":"刷新","broadcast.noCompletedCampaigns":"暂无已完成的活动","kanban.title":"CRM看板","kanban.user":"用户","kanban.darkMode":"深色模式","kanban.lightMode":"浅色模式","kanban.menu":"菜单","kanban.createCRM":"创建CRM","kanban.addStage":"添加阶段","kanban.analytics":"分析","kanban.sync":"同步","kanban.cannotAddStages":"无法向WhatsApp标签CRM添加阶段","kanban.inbox":"收件箱","kanban.unread":"未读","kanban.pinned":"已置顶","kanban.groups":"群组","kanban.stages":"阶段","kanban.chats":"聊天","kanban.searchInbox":"在收件箱中搜索...","kanban.searchContacts":"搜索...","kanban.stageOptions":"阶段选项","kanban.renameStage":"重命名","kanban.clearSearch":"清除搜索","kanban.noChatsMatch":"没有匹配的聊天","kanban.noChatsYet":"暂无聊天","kanban.filterUnread":"筛选未读聊天","kanban.filterPinned":"筛选置顶聊天","kanban.filterGroups":"筛选群聊","kanban.addNewStage":"添加新阶段","kanban.noCRMsFound":"未找到CRM","kanban.selectCRM":"从下拉菜单中选择CRM","kanban.loading":"正在加载看板CRM...","kanban.syncingLabels":"正在同步WhatsApp标签和自定义标签...","kanban.switchCRM":"切换CRM","kanban.createNewCRM":"创建新CRM","kanban.enterCRMName":"输入CRM名称...","kanban.addNewStageTitle":"添加新阶段","kanban.enterStageName":"输入阶段名称...","kanban.editStage":"编辑阶段","kanban.editStageName":"编辑阶段名称","kanban.deleteStage":"删除阶段","kanban.editCRM":"编辑CRM","kanban.deleteCRM":"删除CRM","kanban.confirmDeleteStage":"确定吗？聊天将移至收件箱。","kanban.cannotDeleteInbox":"无法删除收件箱阶段。","kanban.cannotAddStagesLabels":"无法向标签CRM添加阶段。标签从WhatsApp同步。","kanban.chatsLoadedSuccess":"聊天加载成功！","kanban.failedLoadChats":"加载聊天失败。请确保您在WhatsApp Web上。","kanban.noAvailableChats":"没有可用的聊天。","kanban.enterNewCRMName":"输入新的CRM名称：","kanban.name":"名称","kanban.phone":"电话","kanban.lastMessage":"最后消息","kanban.noMessages":"无消息","kanban.unreadCount":"未读数","kanban.type":"类型","kanban.groupChat":"群聊","kanban.individualChat":"个人聊天","kanban.status":"状态","kanban.dealValue":"交易价值 (CNY)","kanban.enterDealValue":"输入交易价值","kanban.notes":"备注","kanban.addNotes":"添加关于此聊天的备注...","kanban.justNow":"刚刚","kanban.group":"群组","kanban.muted":"已静音","kanban.save":"保存","kanban.cancel":"取消","kanban.close":"关闭","kanban.analyticsTitle":"分析仪表板","kanban.analyticsSubtitle":"管道的性能洞察和指标","kanban.exportCSV":"导出CSV","kanban.exportPDF":"导出PDF","kanban.noAnalyticsData":"无分析数据","kanban.from":"从：","kanban.to":"到：","kanban.totalChats":"总聊天数","kanban.pipelineValue":"管道价值","kanban.activeStages":"活跃管道阶段","kanban.stagePerformance":"阶段表现","kanban.stage":"阶段","kanban.value":"价值","kanban.avgTime":"平均时间","kanban.conversion":"转化率","kanban.chatDistribution":"聊天分布","kanban.allTime":"全部时间","kanban.today":"今天","kanban.last7Days":"最近7天","kanban.last30Days":"最近30天","kanban.allowPopups":"请允许弹出窗口以导出PDF","kanban.addSampleChat":"添加示例聊天","kanban.crmName":"CRM名称","kanban.stageName":"阶段名称","kanban.saveChanges":"保存更改","kanban.createFirstCRM":"创建您的第一个CRM来组织WhatsApp聊天。","kanban.noStagesFound":"此CRM中未找到阶段。","kanban.syncOrAddStages":"从WhatsApp同步数据或添加自定义阶段。","kanban.chatDetails":"聊天详情","kanban.notAvailable":"不适用","kanban.addNotesPlaceholder":"添加关于此聊天的备注...","kanban.thisWeek":"本周","kanban.avg":"平均","kanban.stagesLabel":"阶段","kanban.activePipelineStages":"活跃的管道阶段","kanban.customRange":"自定义范围","kanban.dateRange":"日期范围","kanban.confirmDeleteCrm":"确定要删除此CRM吗？这将删除所有阶段和聊天。","kanban.openInWhatsApp":"在WhatsApp中打开","kanban.removeFromStage":"从阶段中移除","kanban.openCRM":"打开CRM","kanban.addNote":"添加备注","kanban.scheduleMessage":"定时消息","kanban.addIncome":"添加收入","kanban.whatsappNotOpen":"WhatsApp Web未打开。请先打开WhatsApp Web。","kanban.failedToOpenChat":"无法在WhatsApp中打开聊天","kanban.removeFromStageConfirm":"确定要从当前阶段移除此聊天吗？","kanban.failedToRemove":"无法从阶段中移除聊天","kanban.failedToOpenCRM":"无法打开CRM","kanban.chatPopup":"聊天","kanban.typeMessage":"输入消息...","kanban.sendMessage":"发送","kanban.loadingMessages":"加载消息中...","kanban.failedToLoadMessages":"加载消息失败","kanban.failedToSendMessage":"发送消息失败","kanban.yesterday":"昨天","kanban.refresh":"刷新","kanban.loadingMedia":"加载中...","kanban.clickToLoad":"点击加载","kanban.addToStage":"添加到CRM阶段","kanban.selectCrmStage":"选择CRM和阶段","kanban.retry":"重试","kanban.attach":"附加文件","kanban.addCaption":"添加说明...","kanban.audioMessage":"语音消息","kanban.document":"文档","kanban.location":"位置","kanban.contact":"联系人","kanban.quickReply":"快捷回复","kanban.fluxo":"流程","kanban.more":"更多","kanban.showLess":"收起","kanban.noQuickReplies":"无快捷回复","kanban.noFluxos":"无活跃流程","kanban.users":"用户","kanban.usersBreakdown":"用户明细","kanban.searchUsers":"按姓名或号码搜索用户...","kanban.noUsersFound":"未找到用户","kanban.tryDifferentSearch":"尝试不同的搜索词","kanban.crm":"CRM","kanban.tabs":"标签页","kanban.labels":"标签","kanban.crmBreakdown":"CRM阶段明细","kanban.tabsBreakdown":"标签页明细","kanban.labelsBreakdown":"标签明细","kanban.noDataFound":"未找到数据","kanban.addDataToSeeAnalytics":"为联系人添加收入/支出数据以查看分析","kanban.incomeVsExpense":"收入与支出按","kanban.contacts":"联系人","kanban.netProfit":"净利润","kanban.crmProfit":"CRM利润","kanban.tabsProfit":"标签页利润","kanban.labelsProfit":"标签利润","kanban.profitDistribution":"利润分布","kanban.sourceComparison":"来源比较","kanban.totalContacts":"联系人总数","kanban.avgPerSource":"每来源平均","kanban.loadingMore":"加载更多...","kanban.allChatsLoaded":"所有聊天已加载","kanban.dragToReorder":"拖动以重新排序","crm.categoryBreakdown":"类别明细","crm.incomeByCategory":"按类别收入","crm.expenseByCategory":"按类别支出","crm.paymentMethodBreakdown":"支付方式明细","crm.incomeByPayment":"按支付方式收入","crm.expenseByPayment":"按支付方式支出","crm.userWiseBreakdown":"用户明细","crm.net":"净额","crm.transactions":"交易","crm.margin":"利润率","crm.netProfit":"净利润","chart.income":"收入","chart.expense":"支出","chart.profit":"利润","chart.noDataAvailable":"暂无数据","chart.noProfitData":"暂无利润数据","chart.noTrendData":"暂无趋势数据","bulkValidator.title":"批量号码验证器","bulkValidator.subtitle":"通过活动批量验证 WhatsApp 号码","bulkValidator.menu":"菜单","bulkValidator.activeCampaigns":"活动中","bulkValidator.completed":"已完成","bulkValidator.noActiveCampaigns":"没有进行中的活动。新建一个以开始验证号码。","bulkValidator.noCompleted":"尚无已完成的活动。","bulkValidator.createHint":"上传号码 CSV 并开始验证运行。","bulkValidator.newCampaign":"新验证活动","bulkValidator.createCampaign":"创建新活动","bulkValidator.campaignName":"活动名称","bulkValidator.enterCampaignName":"输入活动名称","bulkValidator.countryCode":"国家代码","bulkValidator.countryCodeHint":"为没有前缀的号码选择国家代码","bulkValidator.uploadCSV":"上传CSV文件","bulkValidator.csvHint":"包含电话号码的CSV文件（每行一个或逗号分隔）","bulkValidator.numbersFound":"找到号码","bulkValidator.enterNameAndUpload":"请输入活动名称并上传号码","bulkValidator.createAndStart":"创建活动","bulkValidator.campaigns":"活动","bulkValidator.noCampaigns":"暂无活动。创建一个以开始验证号码。","bulkValidator.confirmDelete":"确定要删除此活动吗？","bulkValidator.valid":"有效","bulkValidator.invalid":"无效","bulkValidator.pending":"待处理","bulkValidator.start":"开始","bulkValidator.pause":"暂停","bulkValidator.downloadValid":"下载有效号码","bulkValidator.downloadInvalid":"下载无效号码","bulkValidator.downloadAll":"下载全部","bulkValidator.all":"全部","tools.allTools":"全部工具","tools.subtitle":"点击打开 • 拖动到顶部栏以固定","tools.featureSettings":"功能设置","tools.pinnedTooltip":"已固定在顶部栏（拖回到“工具”以取消固定）","tools.itemTooltip":"{name} — 点击打开，或拖动到顶部栏以固定","tools.category.communication":"通讯","tools.category.management":"管理","tools.category.automation":"自动化","tools.category.validation":"验证","webhook.title":"Webhook 钩子","webhook.subtitle":"在注册事件执行后将联系人数据发送到另一个应用程序","webhook.events":"事件","webhook.quickResponses":"快速回复","webhook.appointment":"预约","webhook.reminder":"提醒","webhook.contactProfile":"联系人资料","webhook.notes":"笔记","webhook.income":"收入","webhook.expense":"支出","webhook.kanban":"看板","webhook.labels":"标签","webhook.customTabs":"自定义标签页","webhook.messages":"消息","webhook.todos":"待办事项","webhook.webhookData":"WebHook数据","webhook.webhookUrl":"WebHook URL","webhook.enterUrl":"在此输入目标URL","webhook.active":"激活","webhook.dataToSend":"要发送的数据","webhook.lastUploads":"最近上传（最多30条）","webhook.noUploads":"暂无上传","webhook.close":"关闭","webhook.save":"保存","webhook.saving":"保存中...","webhook.field.eventDetails":"事件详情","webhook.field.number":"号码","webhook.field.name":"姓名","webhook.field.picture":"照片","webhook.field.labels":"标签","webhook.field.contactProfile":"联系人资料","webhook.field.appointmentTime":"预约时间","webhook.field.meetingLink":"会议链接","webhook.field.reminderTopic":"提醒主题","webhook.field.reminderTime":"提醒时间","webhook.field.reminderDetails":"提醒详情","webhook.field.email":"电子邮件","webhook.field.gender":"性别","webhook.field.dateOfBirth":"出生日期","webhook.field.address":"地址","webhook.field.details":"详情","webhook.field.customFields":"自定义字段","webhook.field.noteTopic":"笔记主题","webhook.field.noteContent":"笔记内容","webhook.field.noteTimestamp":"笔记时间戳","webhook.field.amount":"金额","webhook.field.category":"类别","webhook.field.paymentMethod":"付款方式","webhook.field.description":"描述","webhook.field.reference":"参考/发票","webhook.field.referenceBill":"参考/账单","webhook.field.transactionDate":"交易日期","webhook.field.status":"状态","webhook.field.cardTitle":"卡片标题","webhook.field.columnName":"列/阶段","webhook.field.cardDescription":"卡片描述","webhook.field.labelId":"标签ID","webhook.field.labelName":"标签名称","webhook.field.labelColor":"标签颜色","webhook.field.allLabels":"所有联系人标签","webhook.field.tabId":"标签页ID","webhook.field.tabName":"标签页名称","webhook.field.tabColor":"标签页颜色","webhook.field.allTabs":"所有联系人标签页","webhook.field.direction":"方向（传入/传出）","webhook.field.messageContent":"消息内容","webhook.field.messageType":"消息类型","webhook.field.messageId":"消息ID","webhook.field.mediaUrl":"媒体URL","webhook.field.quotedMessage":"引用消息","webhook.field.timestamp":"时间戳","webhook.field.ctwaData":"Meta广告数据 (CTWA)","webhook.field.todoTitle":"任务标题","webhook.field.todoDescription":"任务描述","webhook.field.todoDueDate":"截止日期","webhook.field.todoPriority":"优先级","webhook.field.todoCategory":"分类","webhook.field.todoStatus":"状态","webhook.field.todoSubtasks":"子任务","api.configureAPI":"配置API","api.manageToken":"管理您的API令牌和设置","api.apiToken":"API令牌","api.generateToken":"生成令牌","api.regenerate":"重新生成","api.generating":"生成中...","api.copyToken":"复制令牌","api.tokenWarning":"请保密此令牌。任何拥有此令牌的人都可以代表您发送消息。","api.enableAPI":"启用API","api.apiIsEnabled":"API当前已启用","api.apiIsDisabled":"API当前已禁用","api.openDocumentation":"打开文档","api.queuePolling":"队列轮询","api.pollingActive":"每5分钟检查队列消息","api.pollingInactive":"启用以处理传入的API消息","audioTranscribe.title":"转录","audioTranscribe.transcribeAudio":"转录音频","audioTranscribe.copy":"复制","audioTranscribe.copied":"已复制！","audioTranscribe.translate":"翻译","audioTranscribe.translating":"翻译中...","audioTranscribe.translated":"已翻译！","audioTranscribe.original":"原文：","audioTranscribe.translatedLabel":"译文","audioTranscribe.close":"关闭","audioTranscribe.requiresChatGPT":"音频转录需要ChatGPT API密钥。请在设置中将ChatGPT配置为您的AI提供商。","audioTranscribe.audioNotFound":"找不到音频URL。音频可能不可用。","audioTranscribe.transcriptionFailed":"转录失败","audioTranscribe.configureAI":"请先配置AI设置以使用翻译功能。","audioTranscribe.translationFailed":"翻译失败","audioTranscribe.translationTimeout":"翻译超时。请重试。","aiBot.title":"AI机器人","aiBot.tab.testChat":"测试聊天","aiBot.tab.qaPairs":"问答对","aiBot.tab.aiBehavior":"AI行为","aiBot.tab.trainingData":"训练数据","aiBot.tab.escalation":"升级","aiBot.tab.dataPreview":"数据预览","aiBot.tab.actionPrompts":"操作提示","aiBot.tab.scheduleTiming":"排程与时间","aiBot.tab.trainingDataComingSoon":"文档上传、URL抓取和纯文本训练源将在下次更新中推出。","aiBot.tab.escalationComingSoon":"在可配置数量的未回复消息后自动转交人工将在下次更新中推出。","aiBot.tab.dataPreviewComingSoon":"AI可访问的每个问答对、来源和片段的只读概览。","aiBot.comingSoon":"即将推出","aiBot.qa.addPair":"添加问答对","aiBot.qa.editPair":"编辑问答对","aiBot.qa.questionLabel":"问题","aiBot.qa.questionPlaceholder":"客户可能会问的内容…","aiBot.qa.answerLabel":"回答","aiBot.qa.answerPlaceholder":"AI应如何回复…","aiBot.qa.categoryLabel":"类别(可选)","aiBot.qa.categoryPlaceholder":"例如:定价、支持、入门","aiBot.qa.existingPairs":"现有问答对","aiBot.qa.empty":"尚无问答对。请在上方添加第一个。","aiBot.qa.cancel":"取消","aiBot.qa.update":"更新","aiBot.qa.delete":"删除","aiBot.qa.edit":"编辑","aiBot.qa.enabled":"已启用","aiBot.qa.disabled":"已禁用","aiBot.qa.on":"开","aiBot.qa.off":"关","aiBot.qa.deleteConfirm":"删除此问答对?","aiBot.qa.itemSingular":"对","aiBot.qa.itemPlural":"对","aiBot.behavior.providerConfig":"AI提供商","aiBot.behavior.provider":"提供商","aiBot.behavior.model":"模型","aiBot.behavior.apiActive":"API活动中","aiBot.behavior.noApiKey":"无API密钥","aiBot.behavior.apiKeyHint":"在AI工具设置中添加您的API密钥以激活机器人。","aiBot.behavior.triggerWords":"触发词","aiBot.behavior.triggerWordsPlaceholder":"支持, 帮助, 演示 (用逗号分隔)","aiBot.behavior.triggerWordsHelp":"设置后,机器人仅回复至少包含其中一个词的消息。留空以回复所有内容。","aiBot.behavior.responseSettings":"回复设置","aiBot.behavior.responseTone":"回复语气","aiBot.behavior.maxResponseLength":"最大回复长度","aiBot.behavior.temperature":"温度","aiBot.behavior.temperatureHelp":"较低 = 更聚焦。较高 = 更具创造力。","aiBot.behavior.maxTokens":"最大令牌数","aiBot.behavior.maxTokensHelp":"限制AI回复的大小。","aiBot.behavior.systemPrompt":"业务上下文 / 系统提示","aiBot.behavior.systemPromptPlaceholder":"告诉AI您的业务、产品以及它应如何代表您…","aiBot.behavior.systemPromptHelp":"用作每个AI回复的基础指令。","aiBot.behavior.fallbackMessage":"回退消息","aiBot.behavior.fallbackMessageHelp":"当AI没有相关的问答对、来源或常识可回答时发送。","aiBot.behavior.saved":"✓ 已保存","aiBot.behavior.saveBehavior":"保存行为","aiBot.behavior.tone_friendly":"友好","aiBot.behavior.tone_professional":"专业","aiBot.behavior.tone_casual":"随意","aiBot.behavior.tone_formal":"正式","aiBot.behavior.tone_empathetic":"共情","aiBot.behavior.length_short":"短 (~50字)","aiBot.behavior.length_medium":"中 (~200字)","aiBot.behavior.length_long":"长 (~400字)","aiBot.kb.urlTitle":"添加网站URL","aiBot.kb.urlPlaceholder":"https://example.com/about","aiBot.kb.addUrl":"添加URL","aiBot.kb.scraping":"正在抓取…","aiBot.kb.urlHelp":"我们获取页面并提取其可见文本。仅支持单页 — JS渲染的SPA可能返回很少的内容。","aiBot.kb.errorEmpty":"在该URL未找到可读文本。","aiBot.kb.errorBlocked":'无法访问该URL。该网站可能阻止自动请求、需要登录或使用JS渲染。请尝试将文本复制到下方的"粘贴纯文本"中。',"aiBot.kb.blockedChromeStore":'Chrome网上应用店阻止自动请求。请在浏览器中打开该列表,复制描述文本,然后粘贴到下方的"粘贴纯文本"中。',"aiBot.kb.blockedGoogle":"Google Docs / Drive / Sheets页面需要登录,无法抓取。请导出为PDF/DOCX/TXT并上传。","aiBot.kb.blockedSocial":'社交网络阻止自动请求。请复制相关文本并粘贴到下方的"粘贴纯文本"中。',"aiBot.kb.blockedNotion":"Notion页面使用JS渲染,返回很少的文本。请将页面导出为Markdown/PDF并上传。","aiBot.kb.plainTextTitle":"粘贴纯文本","aiBot.kb.textTitlePlaceholder":'标题(可选,例如"退款政策")',"aiBot.kb.textBodyPlaceholder":"粘贴AI应了解的任何文本 — 定价、常见问题、政策、说明…","aiBot.kb.charsLabel":"字符","aiBot.kb.saveText":"保存文本","aiBot.kb.saving":"正在保存…","aiBot.kb.trainingSources":"训练源","aiBot.kb.sourceSingular":"源","aiBot.kb.sourcePlural":"源","aiBot.kb.chunkSingular":"片段","aiBot.kb.chunkPlural":"片段","aiBot.kb.empty":"尚无训练源。请在上方添加URL或粘贴纯文本。","aiBot.kb.deleteConfirm":"删除此源?","aiBot.kb.uploadTitle":"上传文档","aiBot.kb.uploadPrompt":"点击选择文件,或拖放到此处","aiBot.kb.uploadFormats":"PDF, DOCX, TXT, CSV, MD","aiBot.kb.uploadMaxSize":"每个文件最大10 MB","aiBot.kb.parsing":"正在解析…","aiBot.kb.parsingFile":"正在解析","aiBot.esc.enableAuto":"启用自动升级","aiBot.esc.enableAutoDesc":"当AI无法提供帮助或客户要求时,自动转交人工。","aiBot.esc.maxAttempts":"最大失败次数","aiBot.esc.maxAttemptsHelp":"在此数量的连续回退回复后转交(24小时窗口)。","aiBot.esc.triggerPhrases":"触发短语(每行一个)","aiBot.esc.triggerPhrasesHelp":"当传入消息中出现任何这些短语时,机器人会立即升级。不区分大小写的子字符串匹配。","aiBot.esc.message":"升级消息","aiBot.esc.messageHelp":"在机器人停止回复之前发送给客户,以便人工接管。","aiBot.esc.saveRules":"保存升级规则","aiBot.esc.statusOn":"开启","aiBot.esc.statusOff":"关闭","aiBot.preview.qaPairsLabel":"问答对","aiBot.preview.sourcesLabel":"源","aiBot.preview.chunksLabel":"片段","aiBot.preview.helpText":"这正是AI现在可以访问的内容。已禁用的项目不会使用。","aiBot.preview.escalationSummary":"升级","aiBot.preview.escStatus":"状态","aiBot.preview.escThreshold":"在","aiBot.preview.escFailed":"次连续回退回复后","aiBot.preview.escPhrases":"触发短语","aiBot.preview.escNoPhrases":"无","aiBot.preview.qaPairsTitle":"问答对","aiBot.preview.sourcesTitle":"训练源","aiBot.preview.noQa":"没有已启用的问答对。","aiBot.preview.noSources":"没有已启用的源。","aiBot.fallbackMoved":"回退回复已移至AI行为标签页。您现有的消息将自动保留。","aiBot.businessPromptMoved":"业务提示已移至AI行为标签页。请在那里编辑 — 您现有的提示将被保留。","aiBot.generalKnowledgeMoved":'"允许AI使用常识"开关已移至AI行为标签页。',"aiBot.stopKeywordsRecommend":"对于新设置,我们推荐使用升级标签页 — 它在关键字停止之上增加了尝试计数器和触发短语。此部分仍适用于仅关键字停止。","aiBot.subtitle":"配置自动AI回复","aiBot.menu":"菜单","aiBot.enableBot":"启用AI机器人","aiBot.enableBotDesc":"自动回复收到的消息","aiBot.replyInGroups":"在群组中回复","aiBot.replyInGroupsDesc":"允许AI机器人在群聊中回复（默认禁用）","aiBot.allowGeneralKnowledge":"允许AI使用通用知识","aiBot.allowGeneralKnowledgeDesc":"关闭时，AI仅根据您的业务提示回复。开启时，AI也可以使用其通用知识回答问题。","aiBot.fallbackReply":"备用回复","aiBot.fallbackReplyDesc":"当AI在您的业务提示中没有相关信息时，将发送此回复而不是编造答案。","aiBot.fallbackReplyPlaceholder":"示例：感谢您的提问！我目前没有关于此的具体信息。我们的团队会尽快与您联系。","aiBot.smartDetection":"智能检测","aiBot.smartDetectionDesc":"AI自动检测用户沮丧或请求人工协助","aiBot.monday":"星期一","aiBot.tuesday":"星期二","aiBot.wednesday":"星期三","aiBot.thursday":"星期四","aiBot.friday":"星期五","aiBot.saturday":"星期六","aiBot.sunday":"星期日","aiBot.enableWeekdays":"启用工作日","aiBot.disableWeekdays":"禁用工作日","aiBot.enableWeekends":"启用周末","aiBot.disableWeekends":"禁用周末","aiBot.applyToAll":"应用到全部:","aiBot.apply":"应用","aiBot.day":"日期","aiBot.active":"启用","aiBot.currentStatus":"当前状态:","aiBot.botOffToday":"机器人今天已关闭","aiBot.businessPrompt":"业务提示","aiBot.businessPromptDesc":"自定义AI如何回复。描述您的业务、语气和指南。","aiBot.businessPromptPlaceholder":"示例：您是[公司名称]的客服代表。我们销售[产品/服务]。请友好、专业地帮助客户。","aiBot.schedule":"机器人工作时间","aiBot.scheduleEnabled":"启用时间表","aiBot.scheduleEnabledDesc":"机器人仅在指定日期和时间内回复","aiBot.startTime":"开始时间","aiBot.endTime":"结束时间","aiBot.to":"至","aiBot.timezone":"时区","aiBot.replyTiming":"回复时间","aiBot.replyTimingDesc":"AI回复前的随机延迟","aiBot.minDelay":"最小延迟（秒）","aiBot.maxDelay":"最大延迟（秒）","aiBot.enabledActions":"启用的操作","aiBot.enabledActionsDesc":"选择AI可以执行的操作","aiBot.actionNormalReply":"发送回复","aiBot.actionNormalReplyDesc":"AI可以发送文本消息","aiBot.actionKanban":"更新看板","aiBot.actionKanbanDesc":"在看板阶段之间移动联系人","aiBot.actionLabels":"更新标签","aiBot.actionLabelsDesc":"添加/删除WhatsApp标签","aiBot.actionTabs":"更新标签页","aiBot.actionTabsDesc":"添加/删除自定义标签页","aiBot.actionAppointment":"创建预约","aiBot.actionAppointmentDesc":"从对话中安排预约","aiBot.tabsPromptLabel":"标签页管理的自定义指令：","aiBot.tabsPromptPlaceholder":"例如，如果用户询问SEO服务，添加到「SEO潜在客户」标签...","aiBot.meetingLinkLabel":"Google Meet 链接：","aiBot.meetingLinkPlaceholder":"https://meet.google.com/xxx-xxxx-xxx","aiBot.meetingLinkDesc":"此链接将用于所有AI创建的预约","aiBot.messageTemplateLabel":"消息模板：","aiBot.messageTemplateDesc":"此消息将作为预约提醒发送","aiBot.varName":"姓名","aiBot.varDate":"日期","aiBot.varTime":"时间","aiBot.varLink":"链接","aiBot.messageTemplatePlaceholder":"您好 {name}，您的预约已安排在 {date} {time}。点此加入：{link}","aiBot.officeHoursLabel":"办公时间（预约时间）：","aiBot.officeHoursDesc":"AI只会在这些时间内安排预约","aiBot.sendMessageNow":"立即发送消息","aiBot.sendMessageNowDesc":"创建后立即发送预约消息","aiBot.appointmentPromptLabel":"自定义AI指令：","aiBot.appointmentPromptPlaceholder":"例如，安排预约时，始终建议上午10点至下午6点之间的时段。最少提前24小时通知。","aiBot.actionProfile":"更新资料","aiBot.actionProfileDesc":"提取并保存联系人信息","aiBot.contextMessages":"上下文消息","aiBot.contextMessagesDesc":"AI上下文包含的历史消息数量","aiBot.settingsTab":"设置","aiBot.promptSettings":"提示词设置","aiBot.actionPrompts":"动作提示词","aiBot.actionPromptsDesc":"为不同AI动作配置自定义提示词","aiBot.talkToAI":"与AI对话","aiBot.testYourBot":"测试您的AI机器人","aiBot.testDescription":"消息使用当前设置（包括未保存的更改）","aiBot.clearChat":"清除聊天","aiBot.typeTestMessage":"输入测试消息...","aiBot.aiTyping":"AI正在输入...","aiBot.noMessages":"输入消息以测试您的AI机器人的响应","aiBot.send":"发送","aiBot.copy":"复制","aiBot.copied":"已复制！","aiBot.select":"选择","aiBot.aiNotConfigured":"AI未配置。请先设置AI API密钥。","aiBot.noResponse":"AI无响应","aiBot.stopKeywords":"停止关键词","aiBot.stopKeywordsInfo":"当客户发送这些关键词时，AI机器人将停止响应并将其列入黑名单。","aiBot.enableStopKeywords":"启用停止关键词","aiBot.enableStopKeywordsDesc":"当客户请求人工协助时自动停止AI机器人","aiBot.keywords":"关键词","aiBot.noKeywords":"尚未添加关键词","aiBot.enterKeyword":"输入关键词...","aiBot.add":"+ 添加","aiBot.stopMessage":"停止消息","aiBot.stopMessagePlaceholder":"检测到停止关键词时发送的消息...","aiBot.stopMessageHint":"当检测到停止关键词时，此消息将发送给客户。","aiBot.responseMode":"响应模式:","aiBot.aiBotPrompt":"AI机器人提示词","aiBot.globalChatGPT":"全局ChatGPT","aiBot.newChat":"新对话","aiBot.clearAll":"清除全部","aiBot.searchChats":"搜索对话...","aiBot.noSearchResults":"未找到对话","aiBot.noChatsYet":"暂无对话历史","aiBot.deleteChat":"删除对话","aiBot.chatsStored":"个对话已保存","aiBot.clearAllTitle":"清除所有对话？","aiBot.clearAllDesc":"这将永久删除您的所有对话历史。此操作无法撤销。","aiBot.messages":"条消息","aiBot.today":"今天","aiBot.yesterday":"昨天","crm.aiBotBlacklist":"AI机器人","crm.aiBotEnabled":"已为此联系人启用","crm.aiBotDisabled":"已为此联系人禁用","common.saved":"已保存","crm.chatbotFlow":"聊天机器人流程","crm.chatbotFlowDesc":"创建基于关键词的自动回复机器人","crm.createNewFlow":"创建新流程","crm.noFlowsYet":"暂无流程","crm.createFirstFlow":"创建您的第一个聊天机器人流程","crm.active":"活跃","crm.inactive":"未激活","crm.flowName":"流程名称","crm.untitledFlow":"无标题流程","crm.duplicate":"复制","crm.triggers":"触发器","crm.actions":"操作","crm.rules":"规则","crm.chatbotFlows":"聊天机器人流程","crm.exportFlows":"导出","crm.importFlows":"导入","crm.exportAll":"导出全部","crm.exportSelected":"导出选中","crm.selectFlowsToExport":"选择要导出的流程","crm.importSuccess":"流程导入成功！","crm.importError":"导入流程时出错","crm.invalidFlowFile":"流程文件格式无效","crm.duplicateFlowFound":"发现重复流程","crm.flowAlreadyExists":"'{name}' 已存在。您想如何处理？","crm.replaceFlow":"替换","crm.skipFlow":"跳过","crm.renameAndAdd":"重命名并添加","crm.noFlowsSelected":"请至少选择一个流程","crm.noFlowsToExport":"没有可导出的流程","crm.flowsExported":"已导出 {count} 个流程","crm.flowsImported":"已导入 {count} 个流程","crm.selected":"已选择","crm.enabled":"已启用","crm.allFlows":"全部","crm.byCategory":"分类","crm.viewAllFlows":"查看所有流程","crm.viewByCategory":"按分类查看","crm.addFluxoCategory":"添加分类","crm.manageCategories":"管理分类","crm.editCategory":"编辑分类","crm.createCategory":"创建分类","crm.createCategoryBtn":"创建分类","crm.fluxoCategoryName":"名称","crm.categoryIcon":"图标","crm.categoryColor":"颜色","crm.preview":"预览","crm.custom":"自定义","crm.enterFluxoCategoryName":"输入分类名称","crm.fluxoCategoryNameRequired":"分类名称是必填项","crm.fluxoCategoryNameExists":"该名称的分类已存在","crm.confirmDeleteCategory":"删除此分类？流程将移至未分类。","crm.uncategorized":"未分类","crm.noFlowsInCategory":"此分类中没有流程","crm.dragFlowsHere":"拖动流程到此处进行整理","crm.dropHere":"放置于此","crm.dragToMove":"拖动移动","crm.noCategoriesYet":"暂无分类","crm.createCategoryHint":"创建一个分类来整理您的流程","crm.createFirstCategory":"创建第一个分类","crm.tourViewToggleTitle":"视图切换","crm.tourViewToggleContent":"在全部流程视图和分类视图之间切换，以整理您的聊天机器人流程。","crm.tourCategoryViewTitle":"分类视图","crm.tourCategoryViewContent":"点击此处查看按分类整理的流程。","crm.tourAddCategoryTitle":"创建分类","crm.tourAddCategoryContent":"点击此处创建具有自定义名称、图标和颜色的新分类。","crm.tourDragDropTitle":"拖放操作","crm.tourDragDropContent":"拖动任何流程卡片并放入分类中以整理您的流程。","crm.tourCategorySectionTitle":"分类区域","crm.tourCategorySectionContent":"点击展开或折叠分类。使用按钮编辑或删除分类。","crm.skipTour":"跳过","crm.finishTour":"明白了！","crm.next":"下一步","crm.previous":"上一步","crm.simulateFlow":"模拟流程","crm.start":"开始","crm.actionBlocks":"操作块","crm.anyMessage":"任何消息","crm.keywords":"关键词","crm.addKeyword":"添加关键词","crm.firstMessageOfDay":"当天第一条消息","crm.firstMessageEver":"首次消息","crm.sendText":"发送文本","crm.sendTextDesc":"发送文本消息。","crm.sendImage":"发送图片","crm.sendImageDesc":"发送带说明的图片。","crm.sendVideo":"发送视频","crm.sendVideoDesc":"发送带说明的视频。","crm.sendAudio":"发送音频","crm.sendAudioDesc":"发送音频文件。","crm.sendDocument":"发送文档","crm.sendDocumentDesc":"发送文档文件。","crm.responses":"回复选项","crm.responsesDesc":"等待用户回复并分支流程。","crm.sendList":"发送列表","crm.sendListDesc":"发送交互式列表消息。","fluxo.waitInput":"等待输入","fluxo.waitInputDesc":"等待经过验证的用户响应","fluxo.promptMessage":"提示消息","fluxo.enterPromptMessage":"输入提示消息以获取用户输入...","fluxo.inputType":"输入类型（验证）","fluxo.inputTypeString":"文本（任意）","fluxo.inputTypePhone":"电话号码","fluxo.inputTypeNumber":"数字","fluxo.inputTypeEmail":"电子邮件","fluxo.inputTypeUrl":"网址","fluxo.inputTypeDatetime":"日期/时间","fluxo.phoneHint":"格式：+5511999999999（带国家代码）","fluxo.emailHint":"格式：user@example.com","fluxo.numberHint":"接受整数和小数","fluxo.urlHint":"格式：https://example.com","fluxo.datetimeHint":"格式：YYYY-MM-DD 或 YYYY-MM-DDTHH:MM","fluxo.stringHint":"接受任何文本输入","fluxo.saveResponseAs":"将响应保存为变量","fluxo.variableName":"userInput","fluxo.useVariableHint":"在后续消息中使用 {variableName}","fluxo.errorMessage":"错误消息（输入无效时）","fluxo.invalidInputDefault":"输入无效。请重试。","fluxo.timeout":"超时","fluxo.seconds":"秒","fluxo.minutes":"分钟","fluxo.hours":"小时","fluxo.timeoutHint":"如果在此时间内没有有效响应，将执行超时分支。","fluxo.customRegex":"自定义正则表达式（可选）","fluxo.regexPlaceholder":"^[A-Z]{2}[0-9]{4}$","fluxo.customRegexHint":"使用自定义模式覆盖输入类型验证","fluxo.outputConnections":"输出连接","fluxo.response":"响应","fluxo.validInputReceived":"收到有效输入时","fluxo.noResponseTimeout":"超时未收到有效响应时","fluxo.validResponse":"有效响应","fluxo.onInvalidInput":"输入无效时：","fluxo.promptMessageInfo":"发送给用户的消息，询问他们的输入。这将在等待他们的响应之前显示。","fluxo.inputTypeInfo":"选择您期望的输入类型。系统将根据此格式验证用户的响应。","fluxo.saveResponseAsInfo":"用于存储用户有效响应的变量名。在后续消息中使用 {变量名} 来显示此值。","fluxo.errorMessageInfo":"当用户输入不符合预期格式时发送的消息。系统会要求他们重试。","fluxo.timeoutInfo":"等待有效响应的最长时间。如果超时，将执行超时分支而不是响应分支。","fluxo.customRegexInfo":"高级：提供自定义正则表达式模式来验证输入。这将覆盖所选输入类型的验证。","fluxo.delayInfo":"发送提示消息前的等待时间（秒）。有助于自然的对话流程。","crm.groupAction":"群组操作","crm.tabAction":"标签操作","crm.labelAction":"标签操作","crm.crmAction":"CRM操作","crm.smartWait":"智能等待","crm.smartWaitDesc":"消息之间随机等待时间","crm.typingIndicator":"输入指示器","crm.typingIndicatorDesc":"发送前显示输入气泡","crm.waitDuration":"等待时长：","crm.typingDuration":"输入时长：","crm.randomDelay":"随机延迟：","crm.randomDelayBetween":"随机延迟在","crm.randomBetween":"随机延迟在","crm.showsTypingFor":"显示输入指示器","crm.showsTyping":"显示输入","crm.typingPreview":"这是输入指示器对联系人的显示方式","crm.addFluxo":"添加流程","crm.addFluxoDesc":"执行另一个流程","crm.selectFlowToCall":"选择要执行的流程：","crm.noFlowSelected":"未选择流程","crm.passVariables":"将变量传递给被调用的流程","crm.passVariablesHint":"当前流程的变量将在被调用的流程中可用","crm.passVariablesUseCase":'💡 示例：主流程有 {name}="小明" → 子流程消息 "你好 {name}!" → 显示 "你好 小明!"。关闭后子流程将不带变量开始。',"crm.passVariablesShort":"传递变量","crm.continueAfterFlow":"被调用流程结束后继续","crm.continueAfterFlowHint":"取消选中以在被调用流程完成时结束对话","crm.continueAfterFlowUseCase":"💡 示例：开启 = 欢迎子流程结束 → 返回主流程继续。关闭 = 子流程结束 = 对话结束（如订单完成流程）。","crm.continueAfterShort":"之后继续","crm.circularWarning":"警告：检测到循环引用！","crm.circularWarningHint":"所选流程包含指向此流程的'添加流程'节点。这可能导致无限循环。","crm.selectFlowPlaceholder":"选择流程...","crm.noOtherFlows":"没有其他可用流程。请先创建另一个流程。","crm.delayBeforeCalling":"调用前延迟（秒）：","crm.executionSummary":"执行摘要：","crm.variablesWillBe":"变量将","crm.passed":"被传递","crm.notPassed":"不被传递","crm.executeFlow":"执行","crm.continueToNext":"继续到下一个节点","crm.endConversation":"结束对话","crm.selectedFlow":"已选流程：","crm.addToGroups":"添加到群组","crm.removeFromGroups":"从群组移除","crm.addToTabs":"添加到标签","crm.removeFromTabs":"从标签移除","crm.addLabels":"添加标签","crm.removeLabels":"移除标签","crm.addToCrmStage":"添加到CRM阶段","crm.removeFromCrm":"从CRM移除","crm.actionType":"操作类型：","crm.selectGroups":"选择群组：","crm.loadGroups":"加载群组","crm.loadGroupsFromWhatsApp":"从WhatsApp Web加载群组","crm.selectTabs":"选择自定义标签：","crm.selectLabels":"选择WhatsApp标签：","crm.syncLabels":"同步标签","crm.searchLabels":"搜索标签...","crm.searchTabs":"搜索标签页...","crm.searchGroups":"搜索群组...","crm.selectCrm":"选择CRM：","crm.selectStage":"选择阶段：","crm.selectCrmPlaceholder":"选择CRM...","crm.selectStagePlaceholder":"选择阶段...","crm.noGroupsSelected":"未选择群组","crm.noTabsSelected":"未选择标签","crm.noLabelsSelected":"未选择标签","crm.noCrmSelected":"未选择CRM/阶段","crm.noGroupsAvailable":"没有可用的群组。","crm.noTabsAvailable":"没有可用的自定义标签。","crm.noCrmsAvailable":"没有可用的CRM。","crm.noStagesAvailable":"此CRM中没有阶段。","crm.delay":"延迟（秒）：","crm.selectedGroups":"群组：","crm.selectedTabs":"标签：","crm.selectedLabels":"标签：","crm.targetCrmStage":"目标CRM → 阶段：","crm.targetCrm":"目标CRM：","crm.schedule":"时间表","crm.enableSchedule":"启用时间表","crm.startTime":"开始时间","crm.endTime":"结束时间","crm.crmRules":"CRM规则","crm.whenAnyMessage":"收到任何消息时。","crm.whenKeywordMatch":"当消息包含关键词时。","crm.byKeywordInMessage":"按消息中的关键词","crm.firstMessageDay":"客户当天的第一条消息。","crm.reactivationInterval":"重新激活间隔：","crm.generalRules":"一般规则：","crm.allowGroups":"允许回复群组","crm.scheduleEnabled":"仅在特定日期和时间允许回复","crm.dontRespondIfOpen":"如果对话已打开则不回复","crm.customSignature":"自定义或禁用签名","crm.simulateTyping":"模拟输入或录制音频","crm.dontRespondIfInCRM":"如果联系人在CRM中则不回复","crm.dontRespondToCRMs":"不回复CRM","crm.respondOnlyToCRMs":"仅回复CRM","crm.enableCrmRules":"启用CRM标签规则","crm.selectCrmTabs":"选择CRM标签","crm.tagRules":"标签规则","crm.labelRules":"标签规则：","crm.dontRespondIfLabeled":"如果联系人有标签则不回复","crm.dontRespondToLabels":"不回复这些标签","crm.respondOnlyToLabels":"仅回复这些标签","crm.selectLabelsNotToReply":"选择不回复的标签：","crm.selectLabelsToReply":"选择要回复的标签：","crm.clickToSelect":"点击选择","crm.labelsNotReplied":"将不被回复的标签：","crm.labelsToReply":"将被回复的标签：","crm.customTabRules":"自定义标签规则：","crm.dontRespondIfInCustomTab":"如果联系人在自定义标签中则不回复","crm.dontRespondToCustomTabs":"不回复这些自定义标签","crm.respondOnlyToCustomTabs":"仅回复这些自定义标签","crm.selectCustomTabsNotToReply":"选择不回复的自定义标签：","crm.selectCustomTabsToReply":"选择要回复的自定义标签：","crm.customTabsNotReplied":"将不被回复的自定义标签：","crm.customTabsToReply":"将被回复的自定义标签：","crm.noCustomTabsAvailable":"没有自定义标签。请先创建一个。","crm.pauseRules":"暂停规则：","crm.enablePause":"启用暂停","crm.pauseClientKeywords":"客户暂停关键词","crm.pauseClientPlaceholder":"如果收件人发送了关键词则暂停聊天机器人...","crm.pauseServerKeywords":"服务器暂停关键词","crm.pauseServerPlaceholder":"当机器人发送时暂停...","crm.pauseDuration":"暂停时长 (时:分)","crm.tipPauseTitle":"暂停规则","crm.tipPauseDesc":"当检测到特定关键词时暂停聊天机器人。使用客户关键词让客户暂停机器人，或使用服务器关键词在发送某些消息后自动暂停。","crm.tipPauseEx1":"客户说'停止' → 机器人暂停","crm.tipPauseEx2":"客户说'人工' → 转人工","crm.tipPauseEx3":"机器人发送'正在连接...' → 自动暂停","crm.tipPauseClientTitle":"客户暂停关键词","crm.tipPauseClientDesc":"当客户发送这些关键词时，将暂停该聊天的机器人。适用于转人工场景。","crm.tipPauseClientEx1":"客户输入'停止'或'stop'","crm.tipPauseClientEx2":"客户输入'人工'或'转人工'","crm.tipPauseClientEx3":"机器人在设定时间内停止响应","crm.tipPauseServerTitle":"服务器暂停关键词","crm.tipPauseServerDesc":"当机器人发送包含这些关键词的消息时，将自动暂停机器人。适用于转接人工客服。","crm.tipPauseServerEx1":"机器人发送'正在为您连接客服...'","crm.tipPauseServerEx2":"机器人发送'请稍等，正在转接...'","crm.tipPauseServerEx3":"发送此消息后流程自动暂停","crm.tipPauseDurationTitle":"暂停时长","crm.tipPauseDurationDesc":"设置检测到暂停关键词后机器人暂停的时间。格式：时:分（例如，00:30 = 30分钟）。","crm.tipPauseDurationEx1":"00:30 = 暂停30分钟","crm.tipPauseDurationEx2":"01:00 = 暂停1小时","crm.tipPauseDurationEx3":"时长结束后，保持暂停直到新触发器","crm.enableTagRules":"启用WhatsApp标签规则","crm.editBlock":"编辑块：","crm.close":"关闭","crm.startNode":"开始","crm.startNodeInfo":"这是流程的起点。将其连接到其他块以构建您的聊天机器人。","crm.editTextMessage":"编辑文本消息：","crm.typeTheText":"输入文本","crm.saveResponseInVariable":"将回复保存到变量：","crm.typeVariableName":"输入变量名","crm.variableHint":"该变量将存储当前块的客户回复，可在后续块中使用","crm.insertImage":"插入图片：","crm.clickToUpload":"点击发送或拖拽文件到此处","crm.imageFormats":"图片：PNG、JPG、JPEG、GIF（最大16MB - WhatsApp限制）","crm.imageCaption":"图片说明（可选）","crm.insertVideo":"插入视频：","crm.insertAudio":"插入音频：","crm.insertDocument":"插入文档：","crm.caption":"说明：","crm.captionOptional":"说明（可选）","crm.questionMessage":"问题消息：","crm.typeQuestion":"输入您的问题...","crm.responseOptions":"回复选项：","crm.addOption":"添加选项","crm.buttonText":"按钮文本：","crm.title":"标题：","crm.listTitleOptional":"列表标题（可选）","crm.listDescOptional":"描述（可选）","crm.listSectionsHint":"在高级设置中配置列表分区和项目。","crm.globalSettings":"全局设置：","crm.editAwayMessage":"编辑离开消息：","crm.awayMessagePlaceholder":"输入用户不回复时发送的消息...","crm.waitingTime":"等待时间：","crm.waitingTimeWarning":"当WhatsApp页面重新加载时，等待回复的对话将丢失此设置","crm.minutes":"分钟","crm.hours":"小时","crm.seconds":"秒","crm.awayMessageInfo":"当用户在指定时间内未回复时，将自动发送此消息。","crm.blockInterval":"块间隔：","crm.blockIntervalInfo":"定义发送流程块之间的默认间隔。","crm.chatSimulator":"聊天模拟器","crm.startConversation":"发送消息开始对话","crm.typeMessageHere":"在此输入您的消息...","crm.callNextBlock":"调用下一个块","crm.whenItemSelected":"当项目被选中时","crm.whenResponding":"回复时","crm.defaultNext":"默认（无匹配）","crm.message":"消息：","crm.listButton":"按钮文本：","crm.items":"项","crm.listItems":"列表项：","crm.addItem":"添加项目","crm.insertVariable":"插入变量","crm.contactName":"联系人姓名","crm.currentDate":"当前日期","crm.currentTime":"当前时间","crm.defaultOption1":"选项 1","crm.defaultOption2":"选项 2","crm.noListItems":"没有项目。点击编辑添加项目。","crm.send_text":"发送文本","crm.send_image":"发送图片","crm.send_video":"发送视频","crm.send_audio":"发送音频","crm.send_document":"发送文档","crm.send_list":"发送列表","crm.group_action":"群组操作","crm.tab_action":"标签页操作","crm.label_action":"标签操作","crm.crm_action":"CRM操作","crm.wait_input":"等待输入","crm.smart_wait":"智能等待","crm.typing_indicator":"输入指示器","crm.add_fluxo":"添加流程","crm.timezone":"时区：","crm.day":"日期","crm.sunday":"星期日","crm.monday":"星期一","crm.tuesday":"星期二","crm.wednesday":"星期三","crm.thursday":"星期四","crm.friday":"星期五","crm.saturday":"星期六","crm.disableSignature":"禁用签名","crm.customizeSignatureName":"自定义签名名称","crm.enterCustomSignature":"输入自定义签名名称","crm.tipAnyMsgTitle":"任意消息触发器","crm.tipAnyMsgDesc":"当收到客户的任何消息时，无论内容如何，流程都将启动。","crm.tipAnyMsgEx1":"所有消息的通用自动回复","crm.tipAnyMsgEx2":"不在时的离开消息","crm.tipAnyMsgEx3":"可能触发过于频繁 - 请配合重新激活间隔使用","crm.tipKeywordTitle":"关键词触发器","crm.tipKeywordDesc":"仅当消息包含指定关键词之一时，流程才会启动。","crm.tipKeywordEx1":"'你好'触发欢迎流程","crm.tipKeywordEx2":"'价格'触发产品信息","crm.tipKeywordEx3":"'帮助'触发支持菜单","crm.tipFirstDayTitle":"每日首条消息","crm.tipFirstDayDesc":"仅在每个联系人每天收到的第一条消息时触发流程。","crm.tipFirstDayEx1":"每天只发送一次'早上好'问候","crm.tipFirstDayEx2":"每日特别促销给每个联系人","crm.tipFirstDayEx3":"根据时区在午夜重置","crm.tipFirstEverTitle":"首次消息","crm.tipFirstEverDesc":"仅在联系人首次发送消息时触发流程。","crm.tipFirstEverEx1":"新联系人的欢迎消息","crm.tipFirstEverEx2":"新客户的入门序列","crm.tipFirstEverEx3":"新线索的初始CRM分配","crm.tipReactivationTitle":"重新激活间隔","crm.tipReactivationDesc":"同一流程可以再次为同一联系人触发之前的最短等待时间。","crm.tipReactivationEx1":"3600秒 = 等待1小时后再次触发","crm.tipReactivationEx2":"防止自动回复垃圾信息","crm.tipReactivationEx3":"使用0允许无限触发","crm.tipSendTextTitle":"发送文本消息","crm.tipSendTextDesc":"向联系人发送纯文本消息。支持{name}、{phone}等变量。","crm.tipSendTextEx1":"个性化欢迎消息","crm.tipSendTextEx2":"订单确认","crm.tipSendImageTitle":"发送图片","crm.tipSendImageDesc":"发送带有可选描述的图片文件。支持PNG、JPG、GIF。","crm.tipSendImageEx1":"产品图片","crm.tipSendImageEx2":"促销材料","crm.tipSendVideoTitle":"发送视频","crm.tipSendVideoDesc":"发送带有可选描述的视频文件。支持MP4、MOV。","crm.tipSendVideoEx1":"产品演示","crm.tipSendVideoEx2":"教程视频","crm.tipSendAudioTitle":"发送音频","crm.tipSendAudioDesc":"发送音频文件或语音备忘录。支持MP3、OGG、WAV。","crm.tipSendAudioEx1":"预录语音消息","crm.tipSendAudioEx2":"音频公告","crm.tipSendDocTitle":"发送文档","crm.tipSendDocDesc":"发送任何类型的文件作为文档。支持PDF、DOC、XLS等。","crm.tipSendDocEx1":"价格目录","crm.tipSendDocEx2":"合同和协议","crm.tipSendListTitle":"发送列表消息","crm.tipSendListDesc":"发送带有分区和可选项目的交互式列表。","crm.tipSendListEx1":"按类别分类的产品菜单","crm.tipSendListEx2":"服务选项","crm.tipGroupActionTitle":"WhatsApp群组操作","crm.tipGroupActionDesc":"将当前联系人添加到WhatsApp群组或从中移除。","crm.tipGroupActionEx1":"将VIP客户添加到专属群组","crm.tipGroupActionEx2":"解决后从支持群组移除","crm.tipTabActionTitle":"自定义标签页操作","crm.tipTabActionDesc":"将当前联系人添加到CRM自定义标签页或从中移除。","crm.tipTabActionEx1":"将线索移至'已合格'标签页","crm.tipTabActionEx2":"从'新咨询'标签页移除","crm.tipLabelActionTitle":"WhatsApp标签操作","crm.tipLabelActionDesc":"为当前联系人添加或移除WhatsApp标签。","crm.tipLabelActionEx1":"添加'已回复'标签","crm.tipLabelActionEx2":"移除'待处理'标签","crm.tipCrmActionTitle":"CRM阶段操作","crm.tipCrmActionDesc":"将当前联系人移至CRM看板中的特定阶段。","crm.tipCrmActionEx1":"移至'谈判'阶段","crm.tipCrmActionEx2":"移至'已成交'阶段","crm.tipSmartWaitTitle":"智能等待","crm.tipSmartWaitDesc":"在操作之间添加随机延迟，使其看起来更像人类。","crm.tipSmartWaitEx1":"消息之间等待2-5秒","crm.tipSmartWaitEx2":"模拟自然阅读时间","crm.tipTypingTitle":"输入指示器","crm.tipTypingDesc":"在发送消息前显示'正在输入...'气泡，使其看起来更像人类。","crm.tipTypingEx1":"消息前显示3秒输入状态","crm.tipTypingEx2":"使回复看起来更自然","crm.tipAllowGroupsTitle":"允许群组","crm.tipAllowGroupsDesc":"启用后，聊天机器人也会在群聊中回复。禁用时，只有私聊会触发流程。","crm.tipAllowGroupsEx1":"ON: 在群组和私聊中都回复","crm.tipAllowGroupsEx2":"OFF: 仅在私聊中回复","crm.tipScheduleTitle":"定时回复","crm.tipScheduleDesc":"限制聊天机器人仅在特定时间/日期工作。在下方配置时间表。","crm.tipScheduleEx1":"仅工作时间（上午9点 - 下午6点）","crm.tipScheduleEx2":"仅工作日（周一至周五）","crm.tipScheduleEx3":"下班后自动回复","crm.tipDontRespondOpenTitle":"打开时不回复","crm.tipDontRespondOpenDesc":"如果您已在WhatsApp Web中打开该对话，则阻止聊天机器人发送消息。","crm.tipDontRespondOpenEx1":"当您正在主动聊天时很有用","crm.tipDontRespondOpenEx2":"阻止机器人打断您的对话","crm.tipSimulateTypingTitle":"模拟输入","crm.tipSimulateTypingDesc":"在发送消息前显示'正在输入...'指示器，使回复感觉更像人类。","crm.tipSimulateTypingEx1":'文本消息显示"正在输入..."',"crm.tipSimulateTypingEx2":'音频显示"正在录制..."',"crm.tipSimulateTypingEx3":"使机器人感觉更自然","crm.tipSkipCRMTitle":"跳过CRM联系人","crm.tipSkipCRMDesc":"聊天机器人不会回复已添加到您CRM的联系人。适用于现有客户。","crm.tipSkipCRMEx1":"仅自动回复新联系人","crm.tipSkipCRMEx2":"跳过现有CRM联系人","crm.tipExcludeCRMTitle":"排除特定CRM阶段","crm.tipExcludeCRMDesc":"选择要排除的特定看板CRM阶段。处于这些阶段的联系人不会收到聊天机器人消息。","crm.tipExcludeCRMEx1":'排除"VIP客户"阶段',"crm.tipExcludeCRMEx2":'排除"请勿打扰"阶段',"crm.tipIncludeCRMTitle":"仅包含特定CRM阶段","crm.tipIncludeCRMDesc":"聊天机器人仅回复选定看板CRM阶段中的联系人。其他所有人被忽略。","crm.tipIncludeCRMEx1":'仅回复"线索"阶段',"crm.tipIncludeCRMEx2":'仅回复"活跃交易"阶段',"crm.tipSkipLabeledTitle":"跳过已标记联系人","crm.tipSkipLabeledDesc":"聊天机器人不会回复任何已分配WhatsApp标签的联系人。","crm.tipSkipLabeledEx1":"任何已标记的联系人都被跳过","crm.tipSkipLabeledEx2":"只有未标记的联系人会收到回复","crm.tipExcludeLabelTitle":"排除特定标签","crm.tipExcludeLabelDesc":"选择要排除的特定WhatsApp标签。带有这些标签的联系人不会收到聊天机器人消息。","crm.tipExcludeLabelEx1":'排除标记为"垃圾邮件"的联系人',"crm.tipExcludeLabelEx2":'排除标记为"已屏蔽"的联系人',"crm.tipIncludeLabelTitle":"仅包含特定标签","crm.tipIncludeLabelDesc":"聊天机器人仅回复带有选定WhatsApp标签的联系人。其他所有人被忽略。","crm.tipIncludeLabelEx1":'仅回复"VIP"标记的联系人',"crm.tipIncludeLabelEx2":'仅回复"优先"标记的联系人',"crm.tipSkipCustomTabTitle":"跳过自定义标签页联系人","crm.tipSkipCustomTabDesc":"聊天机器人不会回复任何已分配到自定义标签页的联系人。","crm.tipSkipCustomTabEx1":'"VIP客户"标签页中的联系人 → 不回复',"crm.tipSkipCustomTabEx2":"不在任何标签页中的联系人 → 机器人回复","crm.tipExcludeCustomTabTitle":"排除特定自定义标签页","crm.tipExcludeCustomTabDesc":"选择要排除的特定自定义标签页。这些标签页中的联系人不会收到聊天机器人消息。","crm.tipExcludeCustomTabEx1":'排除"已屏蔽"标签页中的联系人',"crm.tipExcludeCustomTabEx2":'排除"已处理"标签页中的联系人',"crm.tipIncludeCustomTabTitle":"仅包含特定自定义标签页","crm.tipIncludeCustomTabDesc":"聊天机器人仅回复选定自定义标签页中的联系人。其他所有人被忽略。","crm.tipIncludeCustomTabEx1":'仅回复"活跃线索"标签页',"crm.tipIncludeCustomTabEx2":'仅回复"VIP"标签页',"templates.addCategory":"添加分类","templates.editCategory":"编辑分类","templates.deleteCategory":"删除分类","templates.manageCategories":"管理","templates.categoryName":"分类名称","templates.categoryIcon":"图标","templates.categoryColor":"颜色","templates.update":"更新","templates.form.category":"分类","templates.form.categoryHint":"将模板整理到分类中以便访问","templates.allTemplates":"所有模板","templates.quickReplyCategory":"快速回复","templates.uncategorized":"未分类","templates.sortNewest":"最新","templates.sortOldest":"最旧","templates.sortNameAZ":"名称 A-Z","templates.sortNameZA":"名称 Z-A","templates.confirmDeleteCategory":"确定要删除此分类吗？模板将移至未分类。","templates.confirmDeleteTemplate":"确定要删除此模板吗？","templates.noCategoriesYet":"暂无分类","templates.createCategoryDescription":"创建分类来整理你的模板","templates.done":"完成","templates.deleteCategoryWarning":"此分类中的模板将变为未分类。","templates.delete":"删除","templates.noTemplatesInCategory":"此分类中没有模板","templates.createFirstDescription":"创建您的第一个模板开始使用","followUp.title":"跟进","followUp.newFollowUp":"新建跟进","followUp.confirmDelete":"确定要删除这个跟进吗？","followUp.emptyTitle":"未选择跟进","followUp.emptyText":"从列表中选择一个跟进或创建新的跟进，开始自动消息序列。","followUp.createNew":"创建新的","followUp.loading":"加载中...","followUp.noFollowUps":"暂无跟进","followUp.createFirst":"创建您的第一个跟进序列","followUp.active":"活跃","followUp.paused":"已暂停","followUp.labels":"标签","followUp.customTabs":"自定义标签页","followUp.groups":"群组","followUp.kanban":"看板","followUp.onEnter":"进入时","followUp.onLeave":"离开时","followUp.afterTime":"延时后","followUp.steps":"步骤","followUp.pause":"暂停","followUp.activate":"激活","followUp.duplicate":"复制","followUp.delete":"删除","followUp.name":"跟进名称","followUp.namePlaceholder":"输入跟进名称...","followUp.nameRequired":"请输入跟进名称","followUp.funnelRequired":"请至少选择一个漏斗项目","followUp.stepsRequired":"请至少添加一个步骤","followUp.funnelSettings":"漏斗设置","followUp.selectFunnelItems":"选择触发此跟进的项目","followUp.comingSoon":"选择器即将推出","followUp.triggerSettings":"跟进触发器","followUp.onEnterDesc":"联系人进入漏斗时触发","followUp.onLeaveDesc":"联系人离开漏斗时触发","followUp.afterTimeDesc":"在特定时间后触发","followUp.days":"天","followUp.day":"天","followUp.hours":"小时","followUp.minutes":"分钟","followUp.value":"值","followUp.unit":"单位","followUp.time":"时间","followUp.scheduleConfiguration":"计划配置","followUp.enableSchedule":"启用高级计划","followUp.enableScheduleDesc":"（仅在特定日期/时间发送）","followUp.scheduleDisabledInfo":"启用上方的高级计划以配置发送消息的特定日期/时间。","followUp.tooltip.scheduleTitle":"计划配置 - 何时发送？","followUp.tooltip.scheduleContent":"配置跟进执行的特定日期/时间。适用于任何触发类型。选择每日、每周、每月或每年计划。","followUp.tooltip.scheduleExample":"设置每周计划为周一、周三、周五，仅在这些天发送消息。","followUp.messagesConfiguredInSchedule":"消息已在计划中配置","followUp.messagesConfiguredInScheduleDesc":"您已在上方的计划配置部分启用「每天不同消息」。消息在那里为每个选定的日期进行配置。","followUp.stepsTitle":"跟进步骤","followUp.step":"步骤","followUp.actions":"操作","followUp.addStep":"添加跟进步骤","followUp.rulesTitle":"触发规则","followUp.cancelOnReply":"客户回复时取消","followUp.allowGroups":"允许在群组中回复","followUp.customSignature":"自定义签名","followUp.signatureText":"签名文本","followUp.signaturePlaceholder":"输入您的签名...","followUp.maxExecutions":"每个联系人最大次数","followUp.cooldownDays":"冷却期（天）","followUp.cancel":"取消","followUp.create":"创建跟进","followUp.save":"保存更改","followUp.saving":"保存中...","followUp.saved":"已保存！","followUp.back":"← 返回","followUp.next":"下一步 →","followUp.backToList":"← 返回列表","followUp.wizardStep1":"设置","followUp.wizardStep2":"消息","followUp.wizardStep3":"日程","followUp.wizardStep4":"操作","followUp.wizardStep5":"规则","followUp.followUps":"跟进","followUp.stepName":"步骤名称（可选）","followUp.stepNamePlaceholder":"例如：初次联系、跟进1...","followUp.timing":"时间设置","followUp.mode":"模式","followUp.relative":"相对","followUp.specific":"特定","followUp.type":"类型","followUp.daily":"每天","followUp.weekly":"每周","followUp.monthly":"每月","followUp.condition":"条件","followUp.conditionAlways":"始终","followUp.conditionIfReplied":"如果已回复","followUp.conditionIfNotReplied":"如果未回复","followUp.conditionIfKeyword":"如果有关键词","followUp.conditionIfNotKeyword":"如果无关键词","followUp.conditionIfInFunnel":"如果在漏斗中","followUp.conditionIfNotInFunnel":"如果离开漏斗","followUp.keywords":"关键词（逗号分隔）","followUp.keywordsPlaceholder":"是的, 好的, 感兴趣...","followUp.actionsTitle":"操作","followUp.actionsRequired":"请至少添加一个操作","followUp.addAction":"+ 添加操作","followUp.postActionsTitle":"后续操作","followUp.groupActions":"群组操作","followUp.addToGroups":"添加到群组","followUp.removeFromGroups":"从群组移除","followUp.customTabActions":"自定义标签操作","followUp.addToTabs":"添加到标签","followUp.removeFromTabs":"从标签移除","followUp.labelsActions":"标签操作","followUp.addLabels":"添加标签","followUp.removeLabels":"移除标签","followUp.kanbanBoardActions":"看板操作","followUp.addToKanban":"添加到阶段","followUp.removeFromKanban":"从阶段移除","followUp.selectStage":"选择阶段...","followUp.noGroupsAvailable":"没有可用的群组","followUp.noTabsAvailable":"没有可用的标签","followUp.noLabelsAvailable":"没有可用的标签","followUp.noKanbanAvailable":"没有可用的看板","followUp.moveUp":"上移","followUp.moveDown":"下移","followUp.removeStep":"删除步骤","followUp.message":"消息","followUp.messagePlaceholder":"在此输入您的消息...","followUp.variables":"变量","followUp.clickToInsert":"点击插入变量：","followUp.minDelay":"最小延迟（秒）","followUp.maxDelay":"最大延迟（秒）","followUp.addMessage":"添加消息","followUp.removeMessage":"删除消息","followUp.selectLabels":"选择标签...","followUp.selectTabs":"选择自定义标签页...","followUp.selectKanbanStage":"选择看板CRM和阶段...","followUp.selectGroups":"选择WhatsApp群组...","followUp.selectorComingSoon":"选择器即将推出","followUp.webhookUrl":"Webhook URL","followUp.includeContactData":"在负载中包含联系人数据","followUp.search":"搜索...","followUp.noLabels":"未找到标签。请先在WhatsApp中创建标签。","followUp.noTabs":"未找到自定义标签页。请从标签栏创建标签页。","followUp.noGroups":"未找到WhatsApp群组。","followUp.noStages":"未找到看板阶段。请先创建CRM和阶段。","followUp.fluxoCategory":"类别","followUp.allCategories":"所有类别","followUp.uncategorized":"未分类","followUp.selectFluxo":"选择Fluxo","followUp.chooseFluxo":"-- 选择一个Fluxo --","followUp.fluxoInfo":"选定的聊天机器人流程将在此跟进执行时触发。","followUp.messageText":"消息文本","followUp.templatesType":"模板类型","followUp.tooltip.nameTitle":"跟进名称","followUp.tooltip.nameContent":"为此跟进序列提供一个描述性名称。使用清晰的名称来描述目的。","followUp.tooltip.nameExample":"示例：'新潜在客户欢迎'、'付款提醒'、'反馈请求'","followUp.tooltip.categoryTitle":"类别","followUp.tooltip.categoryContent":"将跟进组织到类别中以便更好地管理。选择一个类别或保持未分类。","followUp.tooltip.funnelTitle":"漏斗设置 - 在哪里触发？","followUp.tooltip.funnelContent":"选择哪些标签、自定义标签页、群组或看板阶段将触发此跟进序列。当联系人进入所选漏斗时，跟进将开始。","followUp.tooltip.funnelExample":"示例：选择'新潜在客户'标签 → 当任何联系人获得此标签时，跟进自动开始。","followUp.tooltip.triggerTitle":"跟进触发器 - 何时开始？","followUp.tooltip.triggerContent":"决定漏斗事件后跟进序列何时开始。进入时：联系人进入时立即触发。离开时：联系人离开时触发。延时后：等待X时间后开始。","followUp.tooltip.triggerExample":"示例：'延时后' + 2小时 = 跟进在联系人进入漏斗2小时后开始。","followUp.tooltip.actionsTitle":"操作 - 做什么？","followUp.tooltip.actionsContent":"定义触发跟进时发生什么。所有操作在触发时执行。添加消息、更改标签、移动到看板阶段或触发webhook。","followUp.tooltip.actionsExample":"示例：发送欢迎消息 → 添加'已联系'标签 → 移动到'进行中'阶段。","followUp.tooltip.rulesTitle":"触发规则 - 控制行为","followUp.tooltip.rulesContent":"配置跟进的行为方式。客户回复时取消会在客户回复时停止序列。允许群组启用在群聊中发送。自定义签名在消息末尾添加您的文本。","followUp.tooltip.rulesExample":"最佳实践：启用'客户回复时取消'以避免向已回复的客户发送垃圾邮件。","followUp.tooltip.cancelOnReplyTitle":"客户回复时取消","followUp.tooltip.cancelOnReplyContent":"当联系人向您发送任何消息时，自动停止该联系人的所有待处理跟进消息。这可以防止向已经回复的客户发送不必要的跟进。","followUp.tooltip.cancelOnReplyExample":"• 启用：如果客户在发送前回复，跟进停止\n• 禁用：无论客户消息如何，跟进都会发送","followUp.tooltip.allowGroupsTitle":"允许在群组中回复","followUp.tooltip.allowGroupsContent":"控制此跟进是否可以向WhatsApp群组发送消息。默认情况下，跟进仅适用于个人联系人（一对一聊天）。","followUp.tooltip.allowGroupsExample":"• 启用：跟进适用于个人聊天和群组\n• 禁用：跟进仅适用于个人联系人","followUp.tooltip.signatureTitle":"自定义签名","followUp.tooltip.signatureContent":"在每条跟进消息的末尾添加个性化签名。用于品牌推广或识别自动化消息。","followUp.tooltip.signatureExample":"示例：您的消息'嗨，只是来看看！'变成'嗨，只是来看看！\\n\\n~ CRM团队'","followUp.tooltip.maxExecutionsTitle":"最大执行次数 - 多少次？","followUp.tooltip.maxExecutionsContent":"控制此跟进可以向同一联系人发送多少次消息。一旦联系人达到此限制，他们将不再收到此跟进。","followUp.tooltip.maxExecutionsExample":"• 设置0 = 无限制（没有限制）\n• 设置1 = 每个联系人仅一次\n• 设置3 = 联系人最多收到3次","followUp.tooltip.cooldownTitle":"冷却期 - 重新触发前等待","followUp.tooltip.cooldownContent":"联系人收到此跟进后，在他们可以再次收到之前需要等待多少天。这可以防止重复向同一联系人发送垃圾邮件。","followUp.tooltip.cooldownExample":"• 设置0 = 无需等待（可以立即再次触发）\n• 设置7 = 重新触发前等待7天","followUp.tooltip.exampleLabel":"示例：","followUp.tooltip.howToUseLabel":"如何使用：","followUp.tooltip.bestPracticeLabel":"最佳实践：","schedule.title":"定时消息","schedule.addSchedule":"添加定时","schedule.editSchedule":"编辑定时","schedule.schedulesCount":"定时任务","schedule.noSchedules":"无定时消息","schedule.noSchedulesDesc":"创建您的第一个定时消息以开始。","schedule.confirmDelete":"您确定要删除此定时任务吗？","schedule.inactive":"未激活","schedule.once":"一次","schedule.repeated":"重复","schedule.scheduleFor":"定时发送给","schedule.selectTarget":"选择联系人或群组","schedule.searchContacts":"搜索联系人和群组...","schedule.groups":"群组","schedule.contacts":"联系人","schedule.templateType":"模板类型","schedule.message":"消息","schedule.enterMessage":"输入您的消息...","schedule.scheduleDateTime":"定时日期和时间","schedule.selectDateTime":"请选择日期和时间","schedule.repeatedType":"重复类型","schedule.repeatedType_minute":"分钟","schedule.repeatedType_hour":"小时","schedule.repeatedType_daily":"每天","schedule.repeatedType_weekly":"每周","schedule.repeatedType_monthly":"每月","schedule.repeatedType_yearly":"每年","schedule.everyMinutes":"每X分钟","schedule.everyHours":"每X小时","schedule.scheduleTime":"定时时间","schedule.addTime":"添加时间","schedule.startAndEndTime":"开始和结束时间","schedule.runAnytime":"随时运行","schedule.runBetween":"在时间段内运行","schedule.endSchedule":"结束定时重复于","schedule.never":"永不","schedule.afterCount":"重复次数","schedule.completeOnDate":"在指定日期完成","schedule.weekday_mon":"星期一","schedule.weekday_tue":"星期二","schedule.weekday_wed":"星期三","schedule.weekday_thu":"星期四","schedule.weekday_fri":"星期五","schedule.weekday_sat":"星期六","schedule.weekday_sun":"星期日","schedule.month_jan":"一月","schedule.month_feb":"二月","schedule.month_mar":"三月","schedule.month_apr":"四月","schedule.month_may":"五月","schedule.month_jun":"六月","schedule.month_jul":"七月","schedule.month_aug":"八月","schedule.month_sep":"九月","schedule.month_oct":"十月","schedule.month_nov":"十一月","schedule.month_dec":"十二月","schedule.postActions":"后续操作","schedule.groupActions":"群组操作","schedule.customTabActions":"自定义标签操作","schedule.labelsActions":"标签操作","schedule.kanbanActions":"看板操作","schedule.members":"成员","schedule.noContactsFound":"未找到联系人","schedule.noGroupsFound":"未找到群组","schedule.loadingContacts":"加载联系人中...","schedule.loadingGroups":"加载群组中...","schedule.selected":"已选择","schedule.tooltip.scheduleFor":"选择要发送定时消息的联系人或群组。","schedule.tooltip.templateType":"选择消息类型：纯文本、带媒体、投票、列表或触发Fluxo聊天机器人流程。","schedule.tooltip.message":"输入您的消息。使用{{name}}或{{phone}}等变量进行个性化。","schedule.tooltip.dateTime":"设置消息发送时间。对于重复计划，这是开始日期/时间。","schedule.tooltip.repeatedType":"选择重复频率：每X分钟/小时、每天、每周、每月或每年。","schedule.tooltip.scheduleTimes":"添加多个发送时间。点击+添加更多时间段。","schedule.tooltip.runBetween":"限制在特定时间段发送。例如，仅在上午9点至下午6点之间发送。","schedule.tooltip.endSchedule":"选择何时停止重复：永不、X次后或在特定日期。","schedule.tooltip.postActions":"发送后执行的操作：添加/移除群组、标签页、标签或看板阶段。","gmaps.featureTitle":"G 地图提取器","feature.gmapsExtractor":"G 地图提取器","gmaps.panelHeader":"G 地图提取器","gmaps.status.idle":"空闲","gmaps.status.running":"提取中...","gmaps.status.stopped":"已停止","gmaps.status.complete":"已完成","gmaps.status.error":"已停止","gmaps.statusLabel":"状态","gmaps.leadsFound":"线索：{{count}}","gmaps.leadsShort":"线索","gmaps.settings":"设置","gmaps.exportGroup":"导出与发送","gmaps.noPhone":"无电话","gmaps.showPanel":"显示面板","gmaps.hidePanel":"隐藏面板","gmaps.maxResults":"最大结果数","gmaps.unlimited":"无限制","gmaps.fetchEmails":"抓取邮箱","gmaps.fetchEmailsTooltip":"对每条带有网站的线索，会在后台打开并提取找到的第一个邮箱地址。每条线索约增加 3 秒并消耗额外流量。如果网站上没有可见邮箱或加载失败，该线索的邮箱字段将保持为空。","gmaps.startBtn":"开始提取","gmaps.stopBtn":"停止","gmaps.clearBtn":"清除","gmaps.exportCsv":"导出 CSV","gmaps.exportXlsx":"导出 XLSX","gmaps.sendToBroadcast":"发送到群发","gmaps.previewTitle":"预览","gmaps.moreRows":"更多","gmaps.expand":"展开","gmaps.expandView":"展开为完整视图","gmaps.clickExpand":"点击展开查看完整详情","gmaps.clickExpandToSee":"点击展开查看全部","gmaps.col.name":"名称","gmaps.col.phone":"电话","gmaps.col.website":"网站","gmaps.col.address":"地址","gmaps.col.category":"类别","gmaps.col.rating":"评分","gmaps.noLeadsYet":"暂无线索 — 请在 Google 地图中搜索后点击开始","gmaps.stopReason.userStop":"用户已停止","gmaps.stopReason.endOfResults":"已到达 Google 地图结果末尾","gmaps.stopReason.captcha":"检测到 Google 验证码 — 请完成验证后再次点击开始","gmaps.stopReason.noFeed":"未找到 Google 地图搜索结果 — 请先执行搜索","gmaps.stopReason.noNewResults":"没有新结果加载（Google 已停止返回数据）","gmaps.stopReason.maxReached":"已达到最大结果数限制","gmaps.stopReason.tabClosed":"标签页已关闭","gmaps.stopReason.error":"错误","gmaps.toast.searchFirst":"请先在 Google 地图中执行搜索，然后点击开始。","gmaps.toast.csvReady":"CSV 已下载","gmaps.toast.xlsxReady":"Excel 文件已下载","gmaps.toast.noPhones":"没有有效的电话号码 — 未发送任何内容。","gmaps.toast.sentPartial":"已将 {{sent}} 个联系人发送到群发 · 跳过 {{dropped}}（无电话）","gmaps.toast.sentAll":"已将 {{sent}} 个联系人发送到群发","gmaps.toast.broadcastFail":"发送到群发失败。请查看控制台。","gmaps.toast.draftRestored":"已恢复上一次会话","gmaps.toast.draftRestoredN":"已从上一次会话恢复 {{n}} 条线索"},ja:{"common.loading":"読み込み中...","common.close":"閉じる","common.cancel":"キャンセル","common.save":"保存","common.copy":"コピー","common.copied":"コピーしました！","common.choose":"選択","common.add":"追加","common.edit":"編集","common.delete":"削除","common.back":"戻る","quickReply.title":"クイック返信","quickReply.addButton":"+ 追加","quickReply.allCategories":"すべてのカテゴリ","quickReply.postActions":"送信後のアクション","quickReply.groupActions":"グループアクション","quickReply.customTabActions":"カスタムタブアクション","quickReply.labelsActions":"ラベルアクション","quickReply.kanbanBoardActions":"カンバンアクション","quickReply.addToGroups":"グループに追加","quickReply.removeFromGroups":"グループから削除","quickReply.addToTabs":"タブに追加","quickReply.removeFromTabs":"タブから削除","quickReply.addLabels":"ラベルを追加","quickReply.removeLabels":"ラベルを削除","quickReply.addToStage":"ステージに追加","quickReply.removeFromStage":"ステージから削除","quickReply.selectGroups":"グループを選択...","quickReply.selectTabs":"タブを選択...","quickReply.selectLabels":"ラベルを選択...","quickReply.selectCrmStage":"CRMとステージを選択...","quickReply.noGroupsAvailable":"利用可能なグループがありません","quickReply.noTabsAvailable":"利用可能なタブがありません","quickReply.noLabelsAvailable":"利用可能なラベルがありません","quickReply.noKanbanAvailable":"利用可能なカンバンCRMがありません","quickReply.editBeforeSending":"送信前に編集","quickReply.editBeforeSendingDesc":"送信前にメッセージを編集できます","actionSidebar.title":"クイックアクション","actionSidebar.quickReply":"クイック返信","actionSidebar.flow":"フロー","actionSidebar.search":"検索...","actionSidebar.filter":"フィルター","actionSidebar.all":"すべて","actionSidebar.byType":"タイプ別","actionSidebar.noCategory":"カテゴリなし","actionSidebar.byCategory":"カテゴリ別","actionSidebar.mostUsed":"よく使う","actionSidebar.send":"送信","actionSidebar.trigger":"実行","actionSidebar.noItemsFound":"項目が見つかりません","actionSidebar.selectChatFirst":"先にチャットを選択してください","actionSidebar.uncategorized":"未分類","actionSidebar.editAndSend":"編集して送信","actionSidebar.clickToCancel":"クリックでキャンセル","actionSidebar.cancel":"キャンセル","actionSidebar.sending":"送信中...","header.activateLicense":"ライセンスを有効化",broadcastTitle:"一斉送信",kanbanTitle:"カンバンCRMを開く","profile.title":"プロフィール","profile.deviceName":"デバイス名","profile.expires":"有効期限","profile.manageLicenseKey":"ライセンスキーを管理","profile.settings":"設定","profile.watchTutorial":"チュートリアルを見る","profile.language":"言語","profile.privacyPolicy":"プライバシーポリシー","profile.contactUs":"お問い合わせ","profile.website":"ウェブサイト","profile.premium":"プレミアム","profile.notActivated":"未アクティブ化","profile.activateToContinue":"ライセンスを有効化","settings.menuFeatures":"メニュー機能","settings.menuFeaturesDesc":"必要に応じて機能を有効または無効にします","settings.interfaceOptions":"インターフェースオプション","settings.featureDockLabel":"左側フィーチャードック","settings.featureDockDesc":"ポップアップが開いているときに左端にショートカットバーを表示","feature.tabs":"タブ管理","feature.templates":"テンプレート","feature.quickReply":"クイック返信","feature.kanban":"カンバンCRM","feature.chatbotFlow":"チャットボットフロー","feature.followUp":"フォローアップ","feature.broadcast":"一斉送信","feature.calendar":"スケジュールセンター","feature.status":"ステータス","feature.validator":"バリデーター","feature.webhook":"Webhook","feature.api":"API","feature.aiBot":"AIボット","feature.open":"開く","license.activateTitle":"ライセンスを有効化","license.licenseKey":"ライセンスキー","license.phoneNumber":"電話番号","license.phoneDetected":"検出された電話番号","license.planName":"プラン名","license.endDate":"終了日","license.expiresIn":"有効期限","license.days":"日","license.daysLeft":"日残り","license.status":"ステータス","license.deactivateLicense":"ライセンスを無効化","license.deactivateConfirm":"本当にライセンスを無効化しますか？","license.activateLicenseBtn":"ライセンスを有効化","license.validating":"検証中...","license.pasteLicenseHere":"ライセンスキーをここに貼り付けてください...","license.completeLicenseKey":"メールで受け取った完全なライセンスキーを貼り付けてください","trial.starting":"7日間の無料トライアルを開始しています...","trial.activated":"7日間の無料トライアルが有効になりました!","trial.daysRemaining":"トライアル残り{0}日","trial.expired":"トライアルが期限切れです。ライセンスを購入してください。","trial.alreadyUsed":"この番号のトライアルは既に使用済みです。ライセンスキーを入力してください。","license.waitForWhatsApp":"WhatsAppが完全に読み込まれるまでお待ちください","license.securityFooter":"WebAssembly暗号化検証により保護されています","planDetails.title":"プランの詳細","planDetails.licenceKey":"ライセンスキー","planDetails.planName":"プラン名","planDetails.endDate":"終了日","planDetails.removeKey":"キーを削除","planDetails.changeKey":"キーを変更","features.enabledFeatures":"有効な機能","languages.en":"English (英語)","languages.zh":"中文 (中国語)","languages.es":"Español (スペイン語)","languages.fr":"Français (フランス語)","languages.ar":"العربية (アラビア語)","languages.pt":"Português (ポルトガル語)","languages.ru":"Русский (ロシア語)","languages.ja":"日本語","languages.de":"Deutsch (ドイツ語)","licenseInfo.title":"ライセンス情報","licenseInfo.phoneNumber":"電話番号","licenseInfo.expiresIn":"有効期限","licenseInfo.status":"ステータス","errors.invalidFormat":"無効なライセンスキー形式または検証に失敗しました","errors.serverError":"サーバーエラーが発生しました","errors.networkError":"ネットワークエラー。接続を確認してください","tabs.tabs":"タブ","tabs.manageTabs":"タブを管理","tabs.addTab":"タブを追加","tabs.editTab":"タブを編集","tabs.deleteTab":"タブを削除","tabs.tabTitle":"タブタイトル","tabs.tabDetails":"タブ詳細","tabs.enterTabTitle":"タブタイトルを入力","tabs.enterTabDetails":"タブ詳細を入力","tabs.chooseFrom":"選択元","tabs.chat":"チャット","tabs.groups":"グループ","tabs.label":"ラベル","tabs.searchHere":"ここで検索","tabs.selectAll":"すべて選択","tabs.clearAll":"すべてクリア","tabs.selected":"選択済み","tabs.allChats":"すべてのチャット","tabs.chats":"チャット","tabs.noFilterApplied":"フィルターが適用されていません","tabs.view":"表示","tabs.edit":"編集","tabs.delete":"削除","tabs.hideFromTabBar":"タブバーから非表示","tabs.showInTabBar":"タブバーに表示","tabs.sort":"並べ替え","tabs.title":"タイトル","tabs.details":"詳細","tabs.action":"アクション","tabs.selectLabel":"ラベルを選択","tabs.chooseALabel":"-- ラベルを選択 --","tabs.selectedLabel":"選択されたラベル","tabs.change":"変更","tabs.pleaseSelectLabel":"上のドロップダウンからラベルを選択してください","tabs.areYouSureDeleteTab":"このタブを削除してもよろしいですか？","tabs.tabDeletedSuccessfully":"タブが正常に削除されました","tabs.cancel":"キャンセル","tabs.save":"保存","tabs.all":"すべて","tabs.oneToOne":"1:1","tabs.individualChats":"個人チャットのみ","tabs.groupChats":"グループチャットのみ","tabs.unread":"未読","tabs.unreadChats":"未読チャットのみ","tabs.unsaved":"未保存","tabs.unsavedContacts":"未保存の連絡先のみ","templates.title":"メッセージテンプレート","templates.manageTemplates":"テンプレートを管理","templates.newTemplate":"新しいテンプレート","templates.editTemplate":"テンプレートを編集","templates.sendTemplate":"テンプレートを送信","templates.deleteTemplate":"テンプレートを削除","templates.duplicateTemplate":"テンプレートを複製","templates.activateTemplate":"有効化","templates.deactivateTemplate":"無効化","templates.total":"合計","templates.active":"アクティブ","templates.inactive":"非アクティブ","templates.filterAll":"すべて","templates.filterActive":"アクティブのみ","templates.filterInactive":"非アクティブのみ","templates.filterAllTypes":"すべてのタイプ","templates.templates":"件のテンプレート","templates.searchPlaceholder":"テンプレートを検索...","templates.noTemplates":"テンプレートが見つかりません","templates.createFirst":"最初のテンプレートを作成","templates.edit":"編集","templates.copy":"コピー","templates.msgs":"件","templates.noMessageContent":"メッセージ内容なし","templates.form.templateName":"テンプレート名","templates.form.templateNamePlaceholder":"テンプレート名を入力","templates.form.templateFor":"テンプレート対象","templates.form.message":"メッセージ","templates.form.messagePlaceholder":"ここにメッセージを入力してください...","templates.form.insertVariable":"変数を挿入するにはクリック：","templates.form.personalizeValue":"パーソナライズ値","templates.form.personalizeValueHint":"@variable1、@variable2などのパーソナライズ値で選択した個人にブロードキャストします","templates.form.templatesType":"テンプレートタイプ","templates.form.templateType":"テンプレートタイプ","templates.form.templateStatus":"テンプレートステータス","templates.form.statusOn":"オン","templates.form.statusOff":"オフ","templates.form.statusHint":"テンプレートステータスが「オン」の場合、使用可能です。逆に、テンプレートステータスが「オフ」の場合、保存状態にあります。","templates.form.on":"オン","templates.form.off":"オフ","templates.form.save":"保存","templates.form.cancel":"キャンセル","templates.form.selectProducts":"製品を選択","templates.form.selectContacts":"連絡先を選択","templates.form.addProduct":"製品を追加","templates.form.addContact":"連絡先を追加","templates.form.buttons":"ボタン","templates.form.addButton":"ボタンを追加","templates.form.buttonsHint":"最大3つのボタンが許可されています","templates.form.selectFromContacts":"連絡先から選択","templates.form.addManually":"手動で追加","templates.form.productHint":"WhatsAppビジネスカタログからの製品","templates.form.attachImages":"画像/動画を添付","templates.form.attachAudio":"音声を添付","templates.form.attachDocuments":"ドキュメントを添付","templates.form.chooseFile":"ファイルを選択","templates.form.maxFileSize":"最大ファイルサイズ: 16MB（WhatsApp制限）","templates.form.uploading":"アップロード中...","templates.errors.uploadFailed":"ファイルのアップロードに失敗しました。もう一度お試しください。","templates.errors.fileTooLarge":"ファイルが大きすぎます。最大サイズ：16MB（WhatsApp制限）。","templates.form.listButtonText":"ボタンテキスト","templates.form.listButtonTextPlaceholder":"ボタンテキストを入力","templates.form.listDescription":"説明","templates.form.listDescriptionPlaceholder":"説明を入力","templates.form.listSections":"セクション","templates.form.pollQuestion":"アンケートの質問","templates.form.pollQuestionPlaceholder":"アンケートの質問を入力","templates.form.allowMultipleAnswers":"複数回答を許可","templates.form.allowMultipleAnswersHint":"ユーザーは複数のオプションを選択できます","templates.form.pollOptions":"アンケートオプション","templates.form.addOption":"+ オプションを追加","templates.form.pollOptionsHint":"最小2、最大12オプション","templates.messageType.individual":"1対1","templates.messageType.tab":"タブ","templates.messageType.group":"グループ","templates.messageType.label":"ラベル","templates.messageType.kanban":"カンバン","templates.messageType.quickReply":"⚡ クイック返信","templates.attachmentType.none":"メッセージのみ","templates.attachmentType.imageVideo":"メッセージ + 画像/動画","templates.attachmentType.document":"メッセージ + ドキュメント","templates.attachmentType.audio":"メッセージ + オーディオ","templates.attachmentType.contact":"メッセージ + 連絡先","templates.attachmentType.poll":"メッセージ + 投票","templates.attachmentType.list":"メッセージ + リスト","templates.attachmentType.product":"メッセージ + 製品","templates.attachmentType.buttons":"メッセージ + ボタン","crm.button":"顧客管理","crm.openCRM":"顧客管理を開く","crm.profile":"プロフィール","crm.tabs":"タブ","crm.notes":"メモ","crm.reminder":"リマインダー","crm.appointment":"予約","crm.income":"収入","crm.expense":"支出","crm.scheduleTab":"スケジュール","crm.deletedMessagesTab":"削除されたメッセージ","crm.antiRevokeEnabled":"Anti-Revoke：オン","crm.antiRevokeDisabled":"Anti-Revoke：オフ","crm.antiRevokeDescription":"受信メッセージのコピーをローカルに保存し、送信者が削除しても確認できるようにします。","crm.antiRevokeNotEnabledHint":"上の Anti-Revoke を有効にすると受信メッセージの保存が始まります。","crm.noDeletedMessages":"復元された削除メッセージはまだありません。監視中です。誰かがメッセージを削除すると、ここにコピーが保存されます。","crm.onlyThisContact":"この連絡先のみ","crm.allContacts":"すべての連絡先","crm.clearHistory":"履歴を消去","crm.exportCSV":"CSV エクスポート","crm.revokedAt":"削除日時","crm.copyMessage":"コピー","crm.lionRecovered":"{brand} が復元","crm.clickToShowOriginal":"元のメッセージを表示","crm.antiRevokeChatTip":"ヒント：チャット内の削除されたメッセージにある復元アイコンを直接クリックすれば、その場ですばやく内容を確認できます。","crm.searchMessages":"メッセージを検索…","crm.recoveredCount":"{count} 件のメッセージを復元","crm.confirmClearChatHistory":"この連絡先の復元済みメッセージを消去しますか？","crm.confirmClearAllHistory":"すべてのチャットの復元済みメッセージを消去しますか？","crm.noTextContent":"（本文なし — メディアメッセージ）","crm.group":"グループ","crm.enable":"有効化","crm.disable":"無効化","crm.addScheduleMessage":"スケジュール追加","crm.noScheduledMessages":"予約メッセージなし","crm.noScheduledMessagesDesc":"この連絡先のメッセージをスケジュールします。","crm.userDetails":"ユーザー詳細","crm.addCustomAttribute":"+ 属性追加","crm.edit":"編集","crm.cancel":"キャンセル","crm.save":"保存","crm.signature":"署名","crm.signatureDesc":"署名付きメッセージを送信するか、特定のチャットで他のエージェントにサービス中であることを表示するために名前を入力してください。","crm.enterYourName":"名前を入力","crm.activateSignature":"署名を有効化","crm.signatureAs":"署名者","crm.signatureNotSet":"WhatsApp Web拡張機能の設定で署名名を設定してください。","crm.delete":"削除","crm.deleteConnection":"接続を削除しますか？","crm.deleteConnectionConfirm":"ノード間のこの接続を削除してもよろしいですか？","crm.fullName":"フルネーム","crm.phoneNumber":"電話番号","crm.email":"メール","crm.gender":"性別","crm.dateOfBirth":"生年月日","crm.details":"詳細","crm.address":"住所","crm.language":"言語","crm.male":"男性","crm.female":"女性","crm.other":"その他","crm.select":"- 選択 -","crm.customAttributes":"カスタム属性","crm.addField":"フィールド追加","crm.fieldLabel":"フィールドラベル","crm.fieldValue":"フィールド値","crm.noCustomFields":"カスタムフィールドなし","crm.deleteFieldConfirm":"このフィールドを削除しますか？","crm.contactTabs":"連絡先タブ","crm.addToTab":"タブに追加","crm.removeFromTab":"タブから削除","crm.noTabs":"タブなし","crm.createTab":"タブ作成","crm.tabName":"タブ名","crm.contacts":"件の連絡先","crm.addToLabel":"ラベルに追加","crm.selectLabel":"ラベルを選択","crm.noLabelsAvailable":"ラベルがありません。タブを作成してください。","crm.labelsAndStages":"ラベルとステージ","crm.whatsappLabels":"WhatsApp ラベル","crm.customTabs":"カスタムタブ","team.button":"チーム","team.shareWith":"チームと共有","team.settings":"チーム設定","team.addMember":"メンバー追加","team.editMember":"メンバー編集","team.deleteMember":"削除","team.memberName":"メンバー名","team.memberPhone":"電話番号","team.department":"部署","team.departmentPlaceholder":"例: 営業、財務、サポート","team.template":"メッセージテンプレート","team.templatePlaceholder":"変数を使ってメッセージを入力...","team.noMembers":"チームメンバーが設定されていません","team.clickToAdd":"+をクリックしてメンバーを追加","team.sending":"送信中...","team.insertVariable":"変数を挿入","team.preview":"メッセージプレビュー","team.deleteConfirm":"このメンバーを削除しますか？","team.phonePlaceholder":"例: +819876543210","team.namePlaceholder":"例: 営業担当 - 田中","team.variableHint":"{{name}}, {{phone}}, {{labels}}などを動的コンテンツに使用","team.save":"保存","team.cancel":"キャンセル","team.editTemplate":"テンプレート編集","team.saveAndSend":"保存して送信","team.sendOnce":"1回だけ送信","team.send":"送信","team.popupTitle":"チームと共有","team.popupSubtitle":"連絡先情報を即座に送信","team.noTeamMembers":"メンバーなし","team.noTeamMembersDesc":"チームメンバーを追加して、WhatsAppで連絡先を素早く共有","crm.addNote":"+ メモ追加","crm.searchNotes":"メモを検索...","crm.noNotes":"メモなし","crm.addFirstNote":"最初のメモを追加","crm.topic":"トピック","crm.content":"内容","crm.editNote":"メモ編集","crm.deleteNote":"メモ削除","crm.deleteNoteConfirm":"このメモを削除しますか？","crm.addReminder":"+ リマインダー追加","crm.noReminders":"リマインダーなし","crm.addFirstReminder":"最初のリマインダーを追加","crm.reminderTopic":"リマインダートピック","crm.dateTime":"日時","crm.repeatInterval":"繰り返し間隔","crm.noRepeat":"繰り返しなし","crm.every5Min":"5分ごと","crm.every10Min":"10分ごと","crm.every15Min":"15分ごと","crm.every30Min":"30分ごと","crm.every1Hour":"1時間ごと","crm.status":"ステータス","crm.pending":"保留中","crm.completed":"完了","crm.dismissed":"却下","crm.stopped":"停止","crm.snoozed":"スヌーズ","crm.due":"期限","crm.editReminder":"リマインダー編集","crm.deleteReminder":"リマインダー削除","crm.markComplete":"完了にする","crm.snooze":"スヌーズ","crm.stop":"停止","crm.addAppointment":"+ 予約追加","crm.noAppointments":"予約なし","crm.addFirstAppointment":"最初の予約を追加","crm.appointmentTitle":"予約タイトル","crm.attendee":"参加者","crm.googleMeetLink":"Google Meetリンク","crm.generateLink":"リンク生成","crm.messageTemplate":"メッセージテンプレート","crm.reminderBefore":"事前リマインダー","crm.sendMessageNow":"今すぐ送信","crm.scheduled":"予定","crm.cancelled":"キャンセル","crm.missed":"不在","crm.editAppointment":"予約編集","crm.deleteAppointment":"予約削除","crm.joinMeeting":"会議に参加","crm.before5Min":"5分前","crm.before10Min":"10分前","crm.before15Min":"15分前","crm.before30Min":"30分前","crm.before1Hour":"1時間前","crm.before2Hours":"2時間前","crm.before1Day":"1日前","crm.titleLabel":"タイトル","crm.scheduleDateTime":"日時を設定","crm.pasteGoogleMeetLink":"Google Meetリンクをここに貼り付け","crm.generateLinkHint":"「リンク生成」をクリックしてGoogle Meetを開き、会議リンクをここに貼り付けてください","crm.chooseTemplate":"テンプレートを選択","crm.selectTemplate":"-- テンプレートを選択 --","crm.messageTemplatePlaceholder":"メッセージテンプレートを入力...","crm.useSameMessage":"会議開始時に同じメッセージを使用","crm.meetingStartMessageLabel":"会議開始メッセージ","crm.meetingStartPlaceholder":"会議開始時に送信するメッセージを入力...","crm.meetingStartHint":"このメッセージは会議が実際に始まるときに送信されます。","crm.sendReminderLabel":"リマインダーを送信","crm.reminderTimeHint":"会議前のこの時間に参加者にメッセージが送信されます。音声通知も届きます。","crm.sendMessageNowTo":"今すぐメッセージを送信","crm.sendNowHint":"保存後すぐに予約メッセージを送信する場合はチェック","crm.discard":"破棄","crm.saveAndSend":"保存して送信","crm.sending":"送信中...","crm.noAppointmentsFound":"予約が見つかりません","crm.searchAppointments":"予約を検索","crm.productDemoCall":"例：製品デモコール","crm.reminderMessageHint":"このメッセージはリマインダー時間（会議前）に送信されます。","crm.joinMeet":"Meetに参加","crm.appointmentTemplates":"予約テンプレート","crm.savedTemplates":"保存済みテンプレート","crm.noTemplatesYet":"テンプレートがまだありません。最初のテンプレートを作成してください！","crm.newTemplate":"+ 新規テンプレート","crm.editTemplateTitle":"テンプレートを編集","crm.newTemplateTitle":"新規テンプレート","crm.templateName":"テンプレート名","crm.templateNamePlaceholder":"例：会議リマインダー","crm.meetLinkOptional":"Google Meetリンク（オプション）","crm.updateTemplate":"テンプレートを更新","crm.saveTemplate":"テンプレートを保存","crm.pleaseEnterTitle":"タイトルを入力してください","crm.pleaseSelectFutureDate":"未来の日時を選択してください","crm.deleteAppointmentConfirm":"この予約を削除してもよろしいですか？","crm.pleaseEnterTemplateName":"テンプレート名を入力してください","crm.pleaseEnterMessageTemplate":"メッセージテンプレートを入力してください","crm.deleteTemplateConfirm":"このテンプレートを削除してもよろしいですか？","crm.addIncome":"+ 収入追加","crm.totalIncome":"総収入","crm.pendingIncome":"保留中","crm.filteredTotal":"フィルター合計","crm.noIncome":"収入記録なし","crm.addFirstIncome":"最初の収入を追加","crm.amount":"金額","crm.category":"カテゴリ","crm.paymentMethod":"支払方法","crm.description":"説明","crm.reference":"参照","crm.date":"日付","crm.paymentReceived":"受取済","crm.sale":"販売","crm.serviceFee":"サービス料","crm.commission":"手数料","crm.refundReceived":"返金受取","crm.cash":"現金","crm.bankTransfer":"銀行振込","crm.upi":"UPI","crm.pix":"PIX","crm.card":"カード","crm.cheque":"小切手","crm.addCustomPaymentMethod":"カスタム方法追加","crm.editIncome":"収入編集","crm.deleteIncome":"収入削除","crm.addExpense":"+ 支出追加","crm.totalExpense":"総支出","crm.pendingExpense":"保留中","crm.noExpense":"支出記録なし","crm.addFirstExpense":"最初の支出を追加","crm.purchase":"購入","crm.serviceCost":"サービス費用","crm.travel":"旅費","crm.marketing":"マーケティング","crm.commissionPaid":"支払手数料","crm.refundGiven":"返金済","crm.editExpense":"支出編集","crm.deleteExpense":"支出削除","crm.search":"検索...","crm.all":"すべて","crm.today":"今日","crm.thisWeek":"今週","crm.thisMonth":"今月","crm.thisYear":"今年","crm.filterByCategory":"カテゴリでフィルター","crm.filterByStatus":"ステータスでフィルター","crm.filterByDate":"日付でフィルター","crm.allStatus":"すべてのステータス","crm.allCategories":"すべてのカテゴリ","crm.none":"なし","crm.ref":"参照","crm.tableTabName":"タブ名","crm.tableContactsInTab":"タブ内の連絡先","crm.tableAction":"アクション","crm.tableName":"名前","crm.tableModifiedDate":"更新日","crm.tableTopic":"トピック","crm.tableReminderDate":"リマインダー日","crm.tableRepeatSnooze":"繰り返し/スヌーズ","crm.tableStatus":"ステータス","crm.tableTitle":"タイトル","crm.tableDateTime":"日時","crm.tableAttendee":"参加者","crm.tableMeetLink":"ミートリンク","crm.tableDescription":"説明","crm.tableCategory":"カテゴリ","crm.tableAmount":"金額","crm.tablePayment":"支払い","crm.tableDate":"日付","crm.addIncomeTitle":"収入追加","crm.editIncomeTitle":"収入編集","crm.addExpenseTitle":"支出追加","crm.editExpenseTitle":"支出編集","crm.enterAmount":"金額を入力","crm.validAmountRequired":"有効な金額を入力してください","crm.descriptionRequired":"説明を入力してください","crm.referenceInvoice":"参照 / 請求書番号","crm.referenceBill":"参照 / 領収書番号","crm.invoicePlaceholder":"例: INV-001","crm.billPlaceholder":"例: BILL-001","crm.paymentDescription":"例: サービス料金","crm.expenseDescription":"例: 事務用品","crm.update":"更新","crm.addIncomeBtn":"収入追加","crm.addExpenseBtn":"支出追加","crm.recurringTransaction":"定期取引","crm.repeatEvery":"繰り返し","crm.neverEnds":"終了日なし","crm.endDate":"終了日","crm.daily":"毎日","crm.weekly":"毎週","crm.monthly":"毎月","crm.quarterly":"四半期（3ヶ月）","crm.yearly":"毎年","crm.currencySettings":"通貨設定","crm.searchCurrency":"通貨を検索...","crm.noCurrenciesFound":"通貨が見つかりません","crm.noIncomeRecords":"収入記録がありません","crm.noExpenseRecords":"支出記録がありません","crm.deleteIncomeConfirm":"この収入記録を削除してもよろしいですか？","crm.deleteExpenseConfirm":"この支出記録を削除してもよろしいですか？","crm.addCategory":"カテゴリを追加","crm.categoryName":"カテゴリ名","crm.enterCategoryName":"カテゴリ名を入力","crm.customCategories":"カスタムカテゴリ","crm.addCustomCategory":"カスタムカテゴリを追加","crm.existingCustomCategories":"既存のカスタムカテゴリ","crm.addStatus":"ステータスを追加","crm.statusName":"ステータス名","crm.enterStatusName":"ステータス名を入力","crm.customStatuses":"カスタムステータス","crm.addCustomStatus":"カスタムステータスを追加","crm.existingCustomStatuses":"既存のカスタムステータス","crm.add":"追加","crm.loading":"読み込み中...","crm.dismiss":"閉じる","crm.yesterday":"昨日","agent.agentMode":"エージェントモード","agent.identifyAsAgent":"エージェントとして識別","agent.agentName":"エージェント名","agent.namePlaceholder":"例：太郎、サポートチーム1","agent.agentNamePlaceholder":"エージェント名を入力","agent.viewTransferHistory":"転送履歴を表示","agent.transferToAgent":"エージェントに転送","agent.transferSuccess":"チャットの転送に成功しました","agent.noAgentsOnline":"オンラインのエージェントがいません","agent.selectAgent":"エージェントを選択","agent.chooseAgent":"-- エージェントを選択 --","agent.reason":"理由","agent.reasonPlaceholder":"なぜこのチャットを転送しますか？","agent.priority":"優先度","agent.priorityLow":"低","agent.priorityMedium":"中","agent.priorityHigh":"高","agent.priorityUrgent":"緊急","agent.transfer":"転送","agent.incomingTransfer":"受信転送","agent.fromAgent":"送信元エージェント","agent.toAgent":"送信先エージェント","agent.chat":"チャット","agent.startService":"サービス開始","agent.endService":"サービス終了","agent.activeService":"アクティブサービス","agent.from":"送信元","agent.to":"送信先","agent.duration":"時間","agent.transferHistory":"転送履歴","agent.sent":"送信済み","agent.received":"受信済み","agent.status":"ステータス","agent.all":"すべて","agent.statusPending":"保留中","agent.statusAccepted":"承認済み","agent.statusInService":"サービス中","agent.statusCompleted":"完了","agent.statusDeclined":"拒否","agent.statusExpired":"期限切れ","agent.noTransfers":"転送が見つかりません","agent.serviceQueue":"サービスキュー","agent.pendingTransfers":"保留中の転送","agent.activeServices":"アクティブサービス","agent.sentTransfers":"送信済み転送","agent.noActiveServices":"アクティブサービスまたは保留中の転送はありません","agent.serviceEnded":"サービスが正常に終了しました","agent.accept":"承認","agent.decline":"拒否","agent.notRegistered":"エージェントが登録されていません。まずエージェントモードを有効にしてください。","agent.statusCancelled":"キャンセル","agent.started":"開始","chatTools.suggest":"提案","chatTools.spelling":"スペル","chatTools.translate":"翻訳","chatTools.summarize":"要約","chatTools.enlarge":"拡大","chatTools.friendly":"フレンドリー","chatTools.formal":"フォーマル","chatTools.send":"送信","chatTools.copy":"コピー","chatTools.use":"使用","chatTools.aiResult":"AI結果","chatTools.suggestTitle":"AI提案","chatTools.spellingTitle":"スペルと文法を修正","chatTools.translateTitle":"翻訳先","chatTools.summarizeTitle":"テキストを要約","chatTools.enlargeTitle":"テキストを拡大","chatTools.friendlyTitle":"フレンドリーにする","chatTools.formalTitle":"フォーマルにする","chatTools.conversationSummary":"チャット要約","chatTools.conversationSummaryTitle":"この会話を要約する","chatTools.conversationSummarizing":"チャットを要約中…","chatTools.conversationSummaryEmpty":"このチャットには要約するメッセージがありません","chatTools.conversationSummaryNoChat":"要約するチャットを開いてください","chatTools.conversationSummaryFailed":"チャットメッセージの取得に失敗しました","chatTools.conversationSummaryResultTitle":"会話の要約","chatTools.sendTitle":"メッセージを送信","chatTools.selectTextFirst":"最初にテキストを選択するか、入力ボックスに入力してください","chatTools.searchLanguage":"言語を検索...","aiSettings.title":"AI APIキーを入力","aiSettings.platformType":"AIプラットフォームタイプ","aiSettings.geminiAI":"GEMINI AI","aiSettings.chatgpt":"CHATGPT","aiSettings.deepseek":"DEEPSEEK","aiSettings.apiKey":"AI APIキー","aiSettings.enterApiKey":"AI APIキーを入力してください","aiSettings.validate":"検証","aiSettings.validKey":"APIキーは有効です！","aiSettings.invalidKey":"APIキーが無効です。確認して再度お試しください。","aiSettings.note":"注意：","aiSettings.geminiNote":"Google AI StudioでGemini APIキーを取得 (aistudio.google.com)","aiSettings.chatgptNote":"platform.openai.com/api-keysでOpenAI APIキーを取得","aiSettings.deepseekNote":"platform.deepseek.comでDeepSeek APIキーを取得","aiSettings.enableAITools":"AIツールを有効化","aiSettings.close":"閉じる","aiSettings.save":"保存","aiSettings.configureAI":"AI機能のためにAIプロバイダーとAPIキーを設定してください","settings.title":"設定","settings.yourLanguage":"言語","settings.selectLanguage":"言語を選択","settings.chooseLanguage":"拡張機能のインターフェース言語を選択してください","settings.whatLanguageSpeak":"話す言語","settings.translateMessages":"受信メッセージを翻訳","settings.selectSpokenLanguage":"言語を選択","settings.spokenLanguageHint":"受信メッセージの翻訳アイコンをクリックすると、この言語に翻訳されます。","settings.blurSettings":"ぼかし設定","settings.blurDescription":"画面上の個人情報をぼかします。","settings.blurMessages":"メッセージをぼかす","settings.blurProfileNames":"プロフィール名をぼかす","settings.blurDisplayPhotos":"プロフィール写真をぼかす","settings.blurConversation":"会話をぼかす","settings.displayOnHover":"ホバー時に会話を表示","settings.theme":"テーマ","settings.themeDescription":"お好みの配色を選択してください","settings.lightMode":"ライトモード","settings.lightModeDesc":"クラシックな明るい外観","settings.darkMode":"ダークモード","settings.darkModeDesc":"暗い環境で目に優しい","settings.systemMode":"システム","settings.systemModeHint":"WhatsAppのテーマに従う","settings.currentTheme":"現在のテーマ","signature.title":"署名","signature.enableSignature":"署名を有効化","signature.yourSignature":"あなたの署名","signature.placeholder":"例：- 山田太郎","signature.preview":"プレビュー","signature.save":"保存","backup.title":"バックアップと復元","backup.export":"エクスポート","backup.import":"インポート","backup.importHint":"{brand} のバックアップ JSON ファイルをアップロードしてデータを復元します。インポートする機能を選択できます。","backup.kanbanCRM":"カンバンCRMデータ","backup.customTabs":"カスタムタブ","backup.templatesQuickReplies":"テンプレートとクイック返信","backup.broadcastHistory":"ブロードキャスト履歴","backup.settings":"設定","backup.crmProfileData":"CRMプロフィールデータ","backup.calendarData":"カレンダー（リマインダーと予約）","backup.statusData":"ステータス","backup.webhookSettings":"Webhook設定","backup.aiBotSettings":"AIボット設定","backup.aiApiSettings":"AI API設定","backup.spokenLanguage":"使用言語","backup.chatbotFlows":"チャットボットフロー (Fluxo)","backup.followupData":"フォローアップシーケンス","backup.scheduledMessages":"スケジュールされたメッセージ","backup.scheduledBroadcasts":"スケジュールされたブロードキャスト","backup.fluxoAdvanced":"Fluxo詳細設定","backup.conversationStates":"会話状態","backup.bulkValidatorData":"一括バリデーターデータ","backup.quickReplies":"クイック返信","backup.crmTodos":"CRMタスクリスト","backup.signatureSettings":"署名設定","backup.teamSettings":"チーム設定","backup.blurSettings":"ぼかし設定","backup.featureVisibility":"機能の表示設定","backup.themeSettings":"テーマ設定","backup.uiStateSettings":"UI状態設定","backup.apiPollingSettings":"APIポーリング設定","backup.agentSettings":"エージェント設定","backup.autoBackup":"自動バックアップ","backup.autoBackupInfo":"新しい日付でWhatsApp Webが読み込まれると、自動バックアップが作成されます","backup.autoBackupDestination":"バックアップ先","backup.autoBackupWhatsApp":"WhatsApp保存済みメッセージに送信","backup.autoBackupDownload":"コンピューターにダウンロード","backup.exportNow":"今すぐエクスポート","backup.importNow":"今すぐインポート","backup.selectFile":"インポートするバックアップファイルを選択","backup.importSuccess":"データのインポートに成功しました！","backup.importError":"データのインポートエラー。ファイル形式を確認してください。","backup.exportSuccess":"データのエクスポートに成功しました！","backup.noDataSelected":"エクスポート/インポートするデータタイプを少なくとも1つ選択してください","backup.cheetahDetected":"Cheetah CRMが検出されました","backup.fileLoaded":"ファイルの読み込みに成功しました","backup.cheetahImportDesc":"このバックアップにはCheetah CRMデータが含まれています。すべての互換機能がインポートされ、既存のCRMデータとマージされます。","backup.dataToImport":"インポートするデータ：","backup.mergeWarning":"重要：","backup.mergeWarningDesc":"データは既存のCRMデータとマージされます。現在のデータは上書きされません - 新しいデータのみが追加されます。","backup.importing":"インポート中...","backup.importCheetah":"Cheetah CRMバックアップをインポート","missedSchedule.title":"スケジュールされたキャンペーンを逃しました","missedSchedule.description":"スケジュールされた時間にWhatsApp Webが開いていなかったため、スケジュールされたキャンペーンを逃しました。","missedSchedule.sendNow":"今すぐ送信","missedSchedule.cancelDiscard":"キャンセルして破棄","missedSchedule.dismiss":"後で通知","calendar.title":"カレンダー","calendar.goToToday":"今日に移動","calendar.reminders":"リマインダー","calendar.appointments":"予約","calendar.remindersFor":"リマインダー","calendar.appointmentsFor":"予約","calendar.noReminders":"この日のリマインダーはありません","calendar.noAppointments":"この日の予約はありません","calendar.selectDate":"リマインダーまたは予約のある日付を選択して詳細を表示","calendar.deleteReminder":"リマインダーを削除","calendar.deleteAppointment":"予約を削除","calendar.confirmDeleteReminder":"このリマインダーを削除してもよろしいですか？","calendar.confirmDeleteAppointment":"この予約を削除してもよろしいですか？","calendar.everyMin":"{min}分ごと","calendar.everyHour":"1時間ごと","calendar.weekdays.sun":"日","calendar.weekdays.mon":"月","calendar.weekdays.tue":"火","calendar.weekdays.wed":"水","calendar.weekdays.thu":"木","calendar.weekdays.fri":"金","calendar.weekdays.sat":"土","calendar.months.january":"1月","calendar.months.february":"2月","calendar.months.march":"3月","calendar.months.april":"4月","calendar.months.may":"5月","calendar.months.june":"6月","calendar.months.july":"7月","calendar.months.august":"8月","calendar.months.september":"9月","calendar.months.october":"10月","calendar.months.november":"11月","calendar.months.december":"12月","calendar.status.pending":"保留中","calendar.status.completed":"完了","calendar.status.dismissed":"却下","calendar.status.snoozed":"スヌーズ","calendar.status.stopped":"停止","calendar.status.scheduled":"予定済み","calendar.status.cancelled":"キャンセル","calendar.status.missed":"未対応","calendar.todos":"タスク","calendar.todosFor":"タスク","calendar.noTodos":"タスクが見つかりません","calendar.addTodo":"タスク追加","calendar.editTodo":"タスク編集","calendar.deleteTodo":"タスク削除","calendar.confirmDeleteTodo":"このタスクを削除してもよろしいですか？","todo.title":"タイトル","todo.titlePlaceholder":"タスクのタイトルを入力","todo.description":"説明","todo.descriptionPlaceholder":"詳細を追加（任意）","todo.dueDate":"期限日","todo.dueTime":"期限時間","todo.priority":"優先度","todo.priorityHigh":"高","todo.priorityMedium":"中","todo.priorityLow":"低","todo.category":"カテゴリ","todo.noCategory":"カテゴリなし","todo.categoryWork":"仕事","todo.categoryPersonal":"個人","todo.categoryUrgent":"緊急","todo.categoryShopping":"買い物","todo.categoryHealth":"健康","todo.subtasks":"サブタスク","todo.addSubtask":"追加","todo.subtaskPlaceholder":"サブタスクを入力","todo.recurring":"繰り返し","todo.repeatEvery":"繰り返し","todo.endDate":"終了日","todo.recurringDaily":"毎日","todo.recurringWeekly":"毎週","todo.recurringMonthly":"毎月","todo.recurringYearly":"毎年","todo.reminder":"リマインダー","todo.reminderDate":"リマインダー日","todo.reminderTime":"リマインダー時間","todo.browserNotification":"ブラウザ通知","todo.whatsappSelfMessage":"WhatsAppでリマインダーを自分に送信","todo.whatsappSelfMessageHint":"タスク期限時にWhatsAppメッセージを受け取ります","todo.save":"タスク保存","todo.update":"タスク更新","todo.cancel":"キャンセル","todo.addTodo":"タスク追加","todo.editTodo":"タスク編集","todo.statusPending":"保留中","todo.statusInProgress":"進行中","todo.statusCompleted":"完了","todo.statusCancelled":"キャンセル","todo.filterAll":"すべてのタスク","todo.filterToday":"今日","todo.filterThisWeek":"今週","todo.filterOverdue":"期限切れ","todo.filterCompleted":"完了済み","todo.today":"今日","todo.tomorrow":"明日","todo.overdue":"期限切れ","todo.snoozeTime":"スヌーズ時間","todo.minutes":"分","todo.hour":"時間","todo.hours":"時間","todo.day":"日","todo.taskReminder":"タスクリマインダー","todo.highPriority":"高優先度","todo.mediumPriority":"中優先度","todo.lowPriority":"低優先度","todo.subtasksCount":"サブタスク","todo.snooze":"スヌーズ","todo.markDone":"完了にする","todo.dismiss":"閉じる","todo.task":"タスク","todo.changeColor":"クリックして色を変更","todo.selectCategoryFirst":"先にカテゴリを選択","todo.linkedContacts":"関連連絡先","todo.optional":"任意","todo.selectContacts":"連絡先を選択","todo.searchContacts":"連絡先を検索...","todo.noContactsFound":"連絡先が見つかりません","todo.selected":"選択済み","todo.contacts":"連絡先","status.title":"ステータス","status.activeStatus":"アクティブステータス","status.createStatus":"ステータス作成","status.loading":"ステータスを読み込み中...","status.noStatusFound":"ステータスが見つかりません","status.noStatusDescription":"まだステータスを作成していないようです。下のボタンをクリックして新しいステータスを追加してください。","status.add":"追加","status.statusName":"ステータス名（任意）","status.statusNamePlaceholder":"ステータスの名前を作成","status.chooseType":"タイプを選択","status.type.text":"テキスト","status.type.image":"画像","status.type.video":"動画","status.type.audio":"音声","status.typeText":"テキストを入力","status.backgroundColor":"背景色を選択","status.clickToChange":"クリックして色を変更","status.import":"インポート","status.dragHere":"ここにファイルをドラッグ","status.caption":"キャプション（任意）","status.captionPlaceholder":"ステータスにキャプションを追加...","status.scheduleStatus":"ステータスをスケジュール","status.autoRepost24h":"24時間ごとに再投稿","status.autoRepost":"自動再投稿","status.postNow":"今すぐ投稿","status.posting":"投稿中...","status.create":"作成","status.edit":"編集","status.delete":"削除","status.emoji":"絵文字","status.status.pending":"保留中","status.status.posted":"投稿済み","status.status.scheduled":"予定済み","status.status.failed":"失敗","ai.regenerate":"再生成","ai.regenerating":"再生成中...","ai.regenerateWithAI":"AIで再生成","ai.notEnabled":"AIが有効になっていません。AI設定を構成してください。","ai.failedToRegenerate":"再生成に失敗しました","ai.failedToRegenerateMessage":"メッセージの再生成に失敗しました","broadcast.title":"一括メッセージ","broadcast.newCampaign":"新規キャンペーン","broadcast.reports":"レポート","broadcast.close":"閉じる","broadcast.sending":"送信中...","broadcast.paused":"一時停止","broadcast.completed":"完了","broadcast.clearHistory":"履歴をクリア","broadcast.createCampaign":"キャンペーン作成","broadcast.createCampaignSubtitle":"複数の連絡先にパーソナライズされたメッセージを送信","broadcast.scheduledCampaigns":"予定されたキャンペーン","broadcast.campaignReports":"キャンペーンレポート","broadcast.viewManageCampaigns":"キャンペーンの表示と管理","broadcast.recipients":"受信者","broadcast.selected":"選択済み","broadcast.contacts":"連絡先","broadcast.groups":"グループ","broadcast.phone":"電話","broadcast.phonePlaceholder":"国コード付き電話番号","broadcast.clearAll":"すべてクリア","broadcast.contactsUploaded":"件の連絡先をアップロード済み","broadcast.noGroupsSelected":"グループが選択されていません。「グループ追加」をクリックして選択してください。","broadcast.addGroups":"グループ追加","broadcast.groupsSelected":"グループ選択済み","broadcast.upload":"アップロード","broadcast.select":"選択","broadcast.download":"ダウンロード","broadcast.groupsContacts":"グループの連絡先","broadcast.tabsContacts":"タブの連絡先","broadcast.kanbanBoard":"カンバンボード","broadcast.labelsContacts":"ラベルの連絡先","broadcast.allowRepeat":"重複番号を許可","broadcast.enableLinkPreview":"リンクプレビューを有効","broadcast.groupActions":"グループアクション","broadcast.customTabActions":"カスタムタブアクション","broadcast.labelsActions":"ラベルアクション","broadcast.kanbanBoardActions":"カンバンボードアクション","broadcast.skipBulkMessage":"一括メッセージをスキップ","broadcast.skipBulkMessageInfo":"メッセージ送信はスキップされます。連絡先に対してアクション（グループ、タブ、ラベル、カンバン）のみが実行されます。","broadcast.appendSignature":"署名を追加","broadcast.signaturePreview":"プレビュー","broadcast.groupActionsNote":"注：以下のアクションを実行するには、グループの管理者である必要があります。","broadcast.addIntoGroups":"グループに追加","broadcast.removeFromGroups":"グループから削除","broadcast.selectGroups":"グループを選択","broadcast.addIntoTabs":"カスタムタブに追加","broadcast.removeFromTabs":"カスタムタブから削除","broadcast.selectTabs":"タブを選択","broadcast.addToLabels":"ラベルに追加","broadcast.removeFromLabels":"ラベルから削除","broadcast.selectLabels":"ラベルを選択","broadcast.addToKanban":"カンバンステージに追加","broadcast.removeFromKanban":"カンバンステージから削除","broadcast.selectCRMStage":"CRMとステージを選択","broadcast.sendRandomMessage":"各連絡先にランダムメッセージを送信","broadcast.addMessage":"メッセージ追加","broadcast.pauseSetting":"一時停止設定","broadcast.pauseAfterXSends":"一時停止（X件送信後）：","broadcast.pauseTimeInSeconds":"一時停止時間（秒）：","broadcast.second":"秒","broadcast.message":"メッセージ","broadcast.moveUp":"上へ移動","broadcast.moveDown":"下へ移動","broadcast.deleteMessage":"メッセージ削除","broadcast.templateType":"テンプレートタイプ","broadcast.messageOnly":"メッセージのみ","broadcast.enterMessageText":"メッセージテキストを入力してください","broadcast.variable":"変数","broadcast.phoneNumber":"電話番号","broadcast.contactName":"連絡先名","broadcast.uploadCSVHint":"追加変数を使用するには、追加列付きCSVをアップロード","broadcast.selectTemplates":"テンプレート選択","broadcast.noTemplates":"利用可能なテンプレートがありません","broadcast.sendingDelay":"送信遅延","broadcast.minimumSecond":"最小秒数","broadcast.maximumSecond":"最大秒数","broadcast.delayHint":"各メッセージは{min}〜{max}秒のランダム遅延で送信されます","broadcast.scheduleMessage":"メッセージをスケジュール","broadcast.date":"日付","broadcast.time":"時間","broadcast.autoSendIfMissed":"予定時刻を過ぎた場合は自動送信","broadcast.recurring":"繰り返し","broadcast.repeatInterval":"繰り返し","broadcast.daily":"毎日","broadcast.weekly":"毎週","broadcast.monthly":"毎月","broadcast.yearly":"毎年","broadcast.selectDays":"曜日を選択","broadcast.sun":"日","broadcast.mon":"月","broadcast.tue":"火","broadcast.wed":"水","broadcast.thu":"木","broadcast.fri":"金","broadcast.sat":"土","broadcast.ends":"終了","broadcast.endNever":"なし","broadcast.endOnDate":"日付指定","broadcast.recurringHowToUse":"定期送信の使い方","broadcast.recurringTip1":"定期送信を有効にして、このブロードキャストを自動的に繰り返します","broadcast.recurringTip2":"頻度を選択：毎日、毎週、毎月、または毎年","broadcast.recurringTip3":"毎週の場合：特定の曜日を選択（月、火など）","broadcast.recurringTip4":"終了日を設定するか、「なし」を選択して無期限に実行","broadcast.recurringTip5":"各ブロードキャスト後、次回は自動的にスケジュールされます","broadcast.selectDates":"日付を選択","broadcast.selectMonths":"月を選択","broadcast.calendarSelectInfo":"カレンダーから特定の日付を選択します。矢印で月を移動します。","broadcast.datesSelected":"件の日付を選択","broadcast.jan":"1月","broadcast.feb":"2月","broadcast.mar":"3月","broadcast.apr":"4月","broadcast.may":"5月","broadcast.jun":"6月","broadcast.jul":"7月","broadcast.aug":"8月","broadcast.sep":"9月","broadcast.oct":"10月","broadcast.nov":"11月","broadcast.dec":"12月","broadcast.quickStart":"クイックスタート","broadcast.previewStart":"プレビューして開始","broadcast.scheduleBroadcast":"配信をスケジュール","broadcast.sent":"送信済み","broadcast.failed":"失敗","broadcast.resume":"再開","broadcast.pause":"一時停止","broadcast.stop":"停止","broadcast.resumeCampaign":"キャンペーンを再開しますか？","broadcast.campaignInterrupted":"キャンペーンが中断されました。再開しますか？","broadcast.remaining":"残り","broadcast.contactsProcessed":"件の連絡先を処理済み","broadcast.resumeCampaignBtn":"キャンペーン再開","broadcast.cancelDiscard":"キャンセルして破棄","broadcast.dismissRemindLater":"無視（後で通知）","broadcast.broadcastScheduled":"配信がスケジュールされました！","broadcast.campaignPreview":"キャンペーンプレビュー","broadcast.messages":"メッセージ","broadcast.stepSettings":"設定","broadcast.stepActions":"アクション","broadcast.stepReview":"確認","broadcast.delayRange":"遅延範囲","broadcast.pauseAfterDuration":"一時停止後/期間","broadcast.checkConsole":"詳細設定はブラウザコンソールを確認","broadcast.sendingQueue":"送信キュー","broadcast.broadcastReports":"配信レポート","broadcast.campaignHistory":"キャンペーン履歴","broadcast.noHistoryYet":"配信履歴はまだありません","broadcast.historyDescription":"完了およびスケジュールされた配信はここに表示されます","broadcast.noCampaignsYet":"完了したキャンペーンはまだありません","broadcast.dateTime":"日時","broadcast.status":"ステータス","broadcast.scheduled":"予定済み","broadcast.cancel":"キャンセル","broadcast.running":"実行中","broadcast.cancelled":"キャンセル済み","broadcast.downloadAllContacts":"すべての連絡先をダウンロード","broadcast.downloadSentContacts":"送信済み連絡先をダウンロード","broadcast.downloadFailedContacts":"失敗した連絡先をダウンロード","broadcast.selectGroupsToAdd":"連絡先を追加するグループを選択","broadcast.selectGroupsToRemove":"連絡先を削除するグループを選択","broadcast.selectTabsToAdd":"連絡先を追加するタブを選択","broadcast.selectTabsToRemove":"連絡先を削除するタブを選択","broadcast.selectLabelsToAdd":"連絡先を追加するラベルを選択","broadcast.selectLabelsToRemove":"連絡先を削除するラベルを選択","broadcast.selectCRM":"CRMを選択","broadcast.selectStage":"ステージを選択","broadcast.backToCRMs":"CRM一覧に戻る","broadcast.loadingGroups":"グループを読み込み中...","broadcast.loadingTabs":"タブを読み込み中...","broadcast.loadingLabels":"ラベルを読み込み中...","broadcast.noGroupsFound":"管理者であるグループが見つかりません","broadcast.noTabsFound":"カスタムタブが見つかりません。先にタブを作成してください。","broadcast.noLabelsFound":"ラベルが見つかりません。先にWhatsAppでラベルを作成してください。","broadcast.noCRMsFound":"CRMが見つかりません。先にCRMを作成してください。","broadcast.noStagesFound":"このCRMにステージが見つかりません。","broadcast.tabsSelected":"タブ選択済み","broadcast.labelsSelected":"ラベル選択済み","broadcast.confirmSelection":"選択を確認","broadcast.availableVariables":"利用可能な変数","broadcast.of":"/","broadcast.chats":"チャット","broadcast.remove":"削除","broadcast.allScheduledCampaigns":"すべてのスケジュール済みキャンペーン","broadcast.noScheduledCampaigns":"スケジュール済みキャンペーンなし","broadcast.scheduleFirstCampaign":"最初のキャンペーンをスケジュールして表示","broadcast.createNewCampaign":"新規キャンペーン作成","broadcast.oneTime":"1回のみ","broadcast.nextRun":"次回実行","broadcast.runNow":"今すぐ実行","broadcast.pauseCampaign":"一時停止","broadcast.editCampaign":"編集","broadcast.deleteCampaign":"削除","broadcast.confirmDeleteScheduled":"このスケジュール済みキャンペーンを削除してもよろしいですか？","broadcast.campaignStarting":"キャンペーンはまもなく開始されます","broadcast.skipNext":"次回をスキップ","broadcast.unskipNext":"スキップしない","broadcast.skippingNext":"次回スキップ中","broadcast.lastRun":"前回実行","broadcast.runs":"回実行","broadcast.successRate":"成功","broadcast.justNow":"たった今","broadcast.inAMoment":"まもなく","broadcast.ago":"前","broadcast.in":"後","broadcast.uploadContacts":"連絡先をアップロード","broadcast.stepSelect":"選択","broadcast.stepMap":"マッピング","broadcast.stepUpload":"アップロード","broadcast.uploadCSVImport":"CSVファイルをアップロードして連絡先をインポート","broadcast.uploadCSVOnly":"CSVファイルのみ対応（.csv形式）","broadcast.downloadSampleFile":"サンプルファイルをダウンロード","broadcast.phoneNumberLabel":"電話番号：","broadcast.mapColumnHint":"「電話番号」データを含む列をマッピング","broadcast.chooseExtraColumns":"パーソナライズされたメッセージ用の追加列を選択。","broadcast.all":"すべて","broadcast.none":"なし","broadcast.previous":"前へ","broadcast.next":"次へ","broadcast.removeUnwantedRows":"不要な行を削除","broadcast.totalContacts":"連絡先の合計","broadcast.startUpload":"アップロード開始","broadcast.rows":"行","broadcast.selectGroupsTitle":"グループを選択","broadcast.searchGroups":"グループを検索...","broadcast.members":"メンバー","broadcast.groupsSelectedCount":"グループ選択済み","broadcast.addGroupsBtn":"グループを追加","broadcast.tooltipBold":"太字","broadcast.tooltipItalic":"斜体","broadcast.tooltipStrikethrough":"取り消し線","broadcast.tooltipAddMedia":"メディアを追加","broadcast.tooltipRefresh":"更新","broadcast.noCompletedCampaigns":"完了したキャンペーンはまだありません","kanban.title":"CRMカンバン","kanban.user":"ユーザー","kanban.darkMode":"ダークモード","kanban.lightMode":"ライトモード","kanban.menu":"メニュー","kanban.createCRM":"CRM作成","kanban.addStage":"ステージ追加","kanban.analytics":"分析","kanban.sync":"同期","kanban.cannotAddStages":"WhatsAppラベルCRMにステージを追加できません","kanban.inbox":"受信トレイ","kanban.unread":"未読","kanban.pinned":"固定済み","kanban.groups":"グループ","kanban.stages":"ステージ","kanban.chats":"チャット","kanban.searchInbox":"受信トレイで検索...","kanban.searchContacts":"検索...","kanban.stageOptions":"ステージオプション","kanban.renameStage":"名前変更","kanban.clearSearch":"検索をクリア","kanban.noChatsMatch":"一致するチャットがありません","kanban.noChatsYet":"チャットがまだありません","kanban.filterUnread":"未読チャットをフィルター","kanban.filterPinned":"固定チャットをフィルター","kanban.filterGroups":"グループチャットをフィルター","kanban.addNewStage":"新しいステージを追加","kanban.noCRMsFound":"CRMが見つかりません","kanban.selectCRM":"ドロップダウンからCRMを選択","kanban.loading":"カンバンCRMを読み込み中...","kanban.syncingLabels":"WhatsAppラベルとカスタムタブを同期中...","kanban.switchCRM":"CRM切替","kanban.createNewCRM":"新しいCRM作成","kanban.enterCRMName":"CRM名を入力...","kanban.addNewStageTitle":"新しいステージを追加","kanban.enterStageName":"ステージ名を入力...","kanban.editStage":"ステージ編集","kanban.editStageName":"ステージ名を編集","kanban.deleteStage":"ステージを削除","kanban.editCRM":"CRM編集","kanban.deleteCRM":"CRM削除","kanban.confirmDeleteStage":"よろしいですか？チャットは受信トレイに移動されます。","kanban.cannotDeleteInbox":"受信トレイステージは削除できません。","kanban.cannotAddStagesLabels":"ラベルCRMにステージを追加できません。ラベルはWhatsAppから同期されます。","kanban.chatsLoadedSuccess":"チャットの読み込みに成功しました！","kanban.failedLoadChats":"チャットの読み込みに失敗しました。WhatsApp Webを確認してください。","kanban.noAvailableChats":"利用可能なチャットがありません。","kanban.enterNewCRMName":"新しいCRM名を入力：","kanban.name":"名前","kanban.phone":"電話","kanban.lastMessage":"最後のメッセージ","kanban.noMessages":"メッセージなし","kanban.unreadCount":"未読数","kanban.type":"タイプ","kanban.groupChat":"グループチャット","kanban.individualChat":"個人チャット","kanban.status":"ステータス","kanban.dealValue":"取引価値 (JPY)","kanban.enterDealValue":"取引価値を入力","kanban.notes":"メモ","kanban.addNotes":"このチャットについてメモを追加...","kanban.justNow":"たった今","kanban.group":"グループ","kanban.muted":"ミュート","kanban.save":"保存","kanban.cancel":"キャンセル","kanban.close":"閉じる","kanban.analyticsTitle":"分析ダッシュボード","kanban.analyticsSubtitle":"パイプラインのパフォーマンス指標","kanban.exportCSV":"CSVエクスポート","kanban.exportPDF":"PDFエクスポート","kanban.noAnalyticsData":"分析データがありません","kanban.from":"開始：","kanban.to":"終了：","kanban.totalChats":"チャット合計","kanban.pipelineValue":"パイプライン価値","kanban.activeStages":"アクティブなパイプラインステージ","kanban.stagePerformance":"ステージパフォーマンス","kanban.stage":"ステージ","kanban.value":"価値","kanban.avgTime":"平均時間","kanban.conversion":"コンバージョン","kanban.chatDistribution":"チャット分布","kanban.allTime":"全期間","kanban.today":"今日","kanban.last7Days":"過去7日間","kanban.last30Days":"過去30日間","kanban.allowPopups":"PDFをエクスポートするにはポップアップを許可してください","kanban.addSampleChat":"サンプルチャットを追加","kanban.crmName":"CRM名","kanban.stageName":"ステージ名","kanban.saveChanges":"変更を保存","kanban.createFirstCRM":"最初のCRMを作成してWhatsAppチャットを整理しましょう。","kanban.noStagesFound":"このCRMにステージが見つかりません。","kanban.syncOrAddStages":"WhatsAppからデータを同期するか、カスタムステージを追加してください。","kanban.chatDetails":"チャット詳細","kanban.notAvailable":"該当なし","kanban.addNotesPlaceholder":"このチャットについてのメモを追加...","kanban.thisWeek":"今週","kanban.avg":"平均","kanban.stagesLabel":"ステージ","kanban.activePipelineStages":"アクティブなパイプラインステージ","kanban.customRange":"カスタム範囲","kanban.dateRange":"日付範囲","kanban.confirmDeleteCrm":"このCRMを削除してもよろしいですか？すべてのステージとチャットが削除されます。","kanban.openInWhatsApp":"WhatsAppで開く","kanban.removeFromStage":"ステージから削除","kanban.openCRM":"CRMを開く","kanban.addNote":"メモを追加","kanban.scheduleMessage":"メッセージを予約","kanban.addIncome":"収入を追加","kanban.whatsappNotOpen":"WhatsApp Webが開いていません。まずWhatsApp Webを開いてください。","kanban.failedToOpenChat":"WhatsAppでチャットを開けませんでした","kanban.removeFromStageConfirm":"このチャットを現在のステージから削除してもよろしいですか？","kanban.failedToRemove":"ステージからチャットを削除できませんでした","kanban.failedToOpenCRM":"CRMを開けませんでした","kanban.chatPopup":"チャット","kanban.typeMessage":"メッセージを入力...","kanban.sendMessage":"送信","kanban.loadingMessages":"メッセージを読み込み中...","kanban.failedToLoadMessages":"メッセージの読み込みに失敗しました","kanban.failedToSendMessage":"メッセージの送信に失敗しました","kanban.yesterday":"昨日","kanban.refresh":"更新","kanban.loadingMedia":"読み込み中...","kanban.clickToLoad":"クリックして読み込む","kanban.addToStage":"CRMステージに追加","kanban.selectCrmStage":"CRMとステージを選択","kanban.retry":"再試行","kanban.attach":"ファイルを添付","kanban.addCaption":"キャプションを追加...","kanban.audioMessage":"音声メッセージ","kanban.document":"ドキュメント","kanban.location":"場所","kanban.contact":"連絡先","kanban.quickReply":"クイック返信","kanban.fluxo":"フロー","kanban.more":"もっと見る","kanban.showLess":"表示を減らす","kanban.noQuickReplies":"クイック返信がありません","kanban.noFluxos":"アクティブなフローがありません","kanban.users":"ユーザー","kanban.usersBreakdown":"ユーザー別内訳","kanban.searchUsers":"名前または番号でユーザーを検索...","kanban.noUsersFound":"ユーザーが見つかりません","kanban.tryDifferentSearch":"別の検索語をお試しください","kanban.crm":"CRM","kanban.tabs":"タブ","kanban.labels":"ラベル","kanban.crmBreakdown":"CRMステージ内訳","kanban.tabsBreakdown":"タブ内訳","kanban.labelsBreakdown":"ラベル内訳","kanban.noDataFound":"データが見つかりません","kanban.addDataToSeeAnalytics":"分析を表示するには連絡先に収入/支出データを追加してください","kanban.incomeVsExpense":"収入対支出","kanban.contacts":"連絡先","kanban.netProfit":"純利益","kanban.crmProfit":"CRM利益","kanban.tabsProfit":"タブ利益","kanban.labelsProfit":"ラベル利益","kanban.profitDistribution":"利益配分","kanban.sourceComparison":"ソース比較","kanban.totalContacts":"連絡先合計","kanban.avgPerSource":"ソース平均","kanban.loadingMore":"読み込み中...","kanban.allChatsLoaded":"すべてのチャットを読み込みました","kanban.dragToReorder":"ドラッグして並べ替え","crm.categoryBreakdown":"カテゴリ内訳","crm.incomeByCategory":"カテゴリ別収入","crm.expenseByCategory":"カテゴリ別支出","crm.paymentMethodBreakdown":"支払方法内訳","crm.incomeByPayment":"支払方法別収入","crm.expenseByPayment":"支払方法別支出","crm.userWiseBreakdown":"ユーザー別内訳","crm.net":"純額","crm.transactions":"取引","crm.margin":"マージン","crm.netProfit":"純利益","chart.income":"収入","chart.expense":"支出","chart.profit":"利益","chart.noDataAvailable":"データがありません","chart.noProfitData":"利益データがありません","chart.noTrendData":"トレンドデータがありません","bulkValidator.title":"一括番号検証","bulkValidator.subtitle":"キャンペーンで WhatsApp 番号を一括検証","bulkValidator.menu":"メニュー","bulkValidator.activeCampaigns":"アクティブなキャンペーン","bulkValidator.completed":"完了","bulkValidator.noActiveCampaigns":"アクティブなキャンペーンはありません。新規作成して番号を検証してください。","bulkValidator.noCompleted":"完了したキャンペーンはまだありません。","bulkValidator.createHint":"番号の CSV をアップロードして検証を開始します。","bulkValidator.newCampaign":"新しい検証キャンペーン","bulkValidator.createCampaign":"新しいキャンペーンを作成","bulkValidator.campaignName":"キャンペーン名","bulkValidator.enterCampaignName":"キャンペーン名を入力","bulkValidator.countryCode":"国コード","bulkValidator.countryCodeHint":"プレフィックスのない番号の国コードを選択","bulkValidator.uploadCSV":"CSVファイルをアップロード","bulkValidator.csvHint":"電話番号を含むCSVファイル（1行に1つまたはカンマ区切り）","bulkValidator.numbersFound":"件の番号が見つかりました","bulkValidator.enterNameAndUpload":"キャンペーン名を入力し、番号をアップロードしてください","bulkValidator.createAndStart":"キャンペーンを作成","bulkValidator.campaigns":"キャンペーン","bulkValidator.noCampaigns":"まだキャンペーンがありません。番号の検証を開始するには作成してください。","bulkValidator.confirmDelete":"このキャンペーンを削除してもよろしいですか？","bulkValidator.valid":"有効","bulkValidator.invalid":"無効","bulkValidator.pending":"保留中","bulkValidator.start":"開始","bulkValidator.pause":"一時停止","bulkValidator.downloadValid":"有効な番号をダウンロード","bulkValidator.downloadInvalid":"無効な番号をダウンロード","bulkValidator.downloadAll":"すべてダウンロード","bulkValidator.all":"すべて","tools.allTools":"すべてのツール","tools.subtitle":"クリックで開く • ヘッダーへドラッグしてピン留め","tools.featureSettings":"機能設定","tools.pinnedTooltip":"ヘッダーに固定中（ツールへドラッグして解除）","tools.itemTooltip":"{name} — クリックで開く、またはヘッダーへドラッグしてピン留め","tools.category.communication":"コミュニケーション","tools.category.management":"管理","tools.category.automation":"自動化","tools.category.validation":"検証","webhook.title":"ウェブフック","webhook.subtitle":"登録されたイベントの実行後に連絡先データを別のアプリケーションに送信","webhook.events":"イベント","webhook.quickResponses":"クイック返信","webhook.appointment":"予約","webhook.reminder":"リマインダー","webhook.contactProfile":"連絡先プロフィール","webhook.notes":"ノート","webhook.income":"収入","webhook.expense":"支出","webhook.kanban":"カンバン","webhook.labels":"ラベル","webhook.customTabs":"カスタムタブ","webhook.messages":"メッセージ","webhook.todos":"タスクリスト","webhook.webhookData":"WebHookデータ","webhook.webhookUrl":"WebHook URL","webhook.enterUrl":"ここに宛先URLを入力","webhook.active":"アクティブ","webhook.dataToSend":"送信するデータ","webhook.lastUploads":"最近のアップロード（最大30件）","webhook.noUploads":"アップロードはまだありません","webhook.close":"閉じる","webhook.save":"保存","webhook.saving":"保存中...","webhook.field.eventDetails":"イベント詳細","webhook.field.number":"番号","webhook.field.name":"名前","webhook.field.picture":"写真","webhook.field.labels":"ラベル","webhook.field.contactProfile":"連絡先プロフィール","webhook.field.appointmentTime":"予約時間","webhook.field.meetingLink":"ミーティングリンク","webhook.field.reminderTopic":"リマインダートピック","webhook.field.reminderTime":"リマインダー時間","webhook.field.reminderDetails":"リマインダー詳細","webhook.field.email":"メールアドレス","webhook.field.gender":"性別","webhook.field.dateOfBirth":"生年月日","webhook.field.address":"住所","webhook.field.details":"詳細","webhook.field.customFields":"カスタムフィールド","webhook.field.noteTopic":"ノートトピック","webhook.field.noteContent":"ノート内容","webhook.field.noteTimestamp":"ノートタイムスタンプ","webhook.field.amount":"金額","webhook.field.category":"カテゴリー","webhook.field.paymentMethod":"支払い方法","webhook.field.description":"説明","webhook.field.reference":"参照/請求書","webhook.field.referenceBill":"参照/明細書","webhook.field.transactionDate":"取引日","webhook.field.status":"ステータス","webhook.field.cardTitle":"カードタイトル","webhook.field.columnName":"列/ステージ","webhook.field.cardDescription":"カード説明","webhook.field.labelId":"ラベルID","webhook.field.labelName":"ラベル名","webhook.field.labelColor":"ラベル色","webhook.field.allLabels":"すべての連絡先ラベル","webhook.field.tabId":"タブID","webhook.field.tabName":"タブ名","webhook.field.tabColor":"タブ色","webhook.field.allTabs":"すべての連絡先タブ","webhook.field.direction":"方向（受信/送信）","webhook.field.messageContent":"メッセージ内容","webhook.field.messageType":"メッセージタイプ","webhook.field.messageId":"メッセージID","webhook.field.mediaUrl":"メディアURL","webhook.field.quotedMessage":"引用メッセージ","webhook.field.timestamp":"タイムスタンプ","webhook.field.ctwaData":"Meta広告データ (CTWA)","webhook.field.todoTitle":"タスクタイトル","webhook.field.todoDescription":"タスク説明","webhook.field.todoDueDate":"期限日","webhook.field.todoPriority":"優先度","webhook.field.todoCategory":"カテゴリー","webhook.field.todoStatus":"ステータス","webhook.field.todoSubtasks":"サブタスク","api.configureAPI":"API設定","api.manageToken":"APIトークンと設定を管理","api.apiToken":"APIトークン","api.generateToken":"トークン生成","api.regenerate":"再生成","api.generating":"生成中...","api.copyToken":"トークンをコピー","api.tokenWarning":"このトークンは秘密にしてください。アクセスできる人は誰でもあなたに代わってメッセージを送信できます。","api.enableAPI":"APIを有効化","api.apiIsEnabled":"APIは現在有効です","api.apiIsDisabled":"APIは現在無効です","api.openDocumentation":"ドキュメントを開く","api.queuePolling":"キューポーリング","api.pollingActive":"5分ごとにキューメッセージを確認中","api.pollingInactive":"有効にして受信APIメッセージを処理","audioTranscribe.title":"文字起こし","audioTranscribe.transcribeAudio":"音声を文字起こし","audioTranscribe.copy":"コピー","audioTranscribe.copied":"コピーしました！","audioTranscribe.translate":"翻訳","audioTranscribe.translating":"翻訳中...","audioTranscribe.translated":"翻訳しました！","audioTranscribe.original":"原文：","audioTranscribe.translatedLabel":"翻訳文","audioTranscribe.close":"閉じる","audioTranscribe.requiresChatGPT":"音声文字起こしにはChatGPT APIキーが必要です。設定でChatGPTをAIプロバイダーとして設定してください。","audioTranscribe.audioNotFound":"音声URLが見つかりません。音声が利用できない可能性があります。","audioTranscribe.transcriptionFailed":"文字起こし失敗","audioTranscribe.configureAI":"翻訳を使用するには、まずAI設定を行ってください。","audioTranscribe.translationFailed":"翻訳失敗","audioTranscribe.translationTimeout":"翻訳がタイムアウトしました。もう一度お試しください。","aiBot.title":"AIボット","aiBot.tab.testChat":"テストチャット","aiBot.tab.qaPairs":"Q&Aペア","aiBot.tab.aiBehavior":"AI動作","aiBot.tab.trainingData":"トレーニングデータ","aiBot.tab.escalation":"エスカレーション","aiBot.tab.dataPreview":"データプレビュー","aiBot.tab.actionPrompts":"アクションプロンプト","aiBot.tab.scheduleTiming":"スケジュールとタイミング","aiBot.tab.trainingDataComingSoon":"ドキュメントアップロード、URLスクレイピング、プレーンテキストのトレーニングソースは次のアップデートで提供されます。","aiBot.tab.escalationComingSoon":"設定可能な未回答メッセージ数の後に人間に自動引き継ぎする機能は次のアップデートで提供されます。","aiBot.tab.dataPreviewComingSoon":"AIがアクセスできるすべてのQ&Aペア、ソース、チャンクの読み取り専用概要。","aiBot.comingSoon":"近日公開","aiBot.qa.addPair":"Q&Aペアを追加","aiBot.qa.editPair":"Q&Aペアを編集","aiBot.qa.questionLabel":"質問","aiBot.qa.questionPlaceholder":"顧客が尋ねそうな内容…","aiBot.qa.answerLabel":"回答","aiBot.qa.answerPlaceholder":"AIがどのように回答すべきか…","aiBot.qa.categoryLabel":"カテゴリ(任意)","aiBot.qa.categoryPlaceholder":"例:価格、サポート、オンボーディング","aiBot.qa.existingPairs":"既存のペア","aiBot.qa.empty":"Q&Aペアがまだありません。上で最初のペアを追加してください。","aiBot.qa.cancel":"キャンセル","aiBot.qa.update":"更新","aiBot.qa.delete":"削除","aiBot.qa.edit":"編集","aiBot.qa.enabled":"有効","aiBot.qa.disabled":"無効","aiBot.qa.on":"オン","aiBot.qa.off":"オフ","aiBot.qa.deleteConfirm":"このQ&Aペアを削除しますか?","aiBot.qa.itemSingular":"ペア","aiBot.qa.itemPlural":"ペア","aiBot.behavior.providerConfig":"AIプロバイダー","aiBot.behavior.provider":"プロバイダー","aiBot.behavior.model":"モデル","aiBot.behavior.apiActive":"APIアクティブ","aiBot.behavior.noApiKey":"APIキーなし","aiBot.behavior.apiKeyHint":"AIツール設定でAPIキーを追加してボットを有効化してください。","aiBot.behavior.triggerWords":"トリガーワード","aiBot.behavior.triggerWordsPlaceholder":"サポート, ヘルプ, デモ (カンマ区切り)","aiBot.behavior.triggerWordsHelp":"設定すると、これらの単語が少なくとも1つ含まれるメッセージにのみボットが返信します。空のままにするとすべてに返信します。","aiBot.behavior.responseSettings":"返信設定","aiBot.behavior.responseTone":"返信トーン","aiBot.behavior.maxResponseLength":"最大返信長","aiBot.behavior.temperature":"温度","aiBot.behavior.temperatureHelp":"低い = より集中的。高い = より創造的。","aiBot.behavior.maxTokens":"最大トークン数","aiBot.behavior.maxTokensHelp":"AI返信のサイズを制限します。","aiBot.behavior.systemPrompt":"ビジネスコンテキスト / システムプロンプト","aiBot.behavior.systemPromptPlaceholder":"AIにあなたのビジネス、製品、どのように代表すべきかを伝えてください…","aiBot.behavior.systemPromptHelp":"すべてのAI返信の基礎となる指示として使用されます。","aiBot.behavior.fallbackMessage":"フォールバックメッセージ","aiBot.behavior.fallbackMessageHelp":"AIに関連するQ&Aペア、ソース、または一般的な知識がない場合に送信されます。","aiBot.behavior.saved":"✓ 保存済み","aiBot.behavior.saveBehavior":"動作を保存","aiBot.behavior.tone_friendly":"フレンドリー","aiBot.behavior.tone_professional":"プロフェッショナル","aiBot.behavior.tone_casual":"カジュアル","aiBot.behavior.tone_formal":"フォーマル","aiBot.behavior.tone_empathetic":"共感的","aiBot.behavior.length_short":"短い (~50語)","aiBot.behavior.length_medium":"中 (~200語)","aiBot.behavior.length_long":"長い (~400語)","aiBot.kb.urlTitle":"ウェブサイトURLを追加","aiBot.kb.urlPlaceholder":"https://example.com/about","aiBot.kb.addUrl":"URLを追加","aiBot.kb.scraping":"取得中…","aiBot.kb.urlHelp":"ページを取得して可視テキストを抽出します。単一ページのみ — JSレンダリングのSPAはほとんどコンテンツを返さない場合があります。","aiBot.kb.errorEmpty":"そのURLで読み取れるテキストが見つかりませんでした。","aiBot.kb.errorBlocked":"そのURLにアクセスできませんでした。サイトが自動リクエストをブロックしているか、ログインが必要か、JSでレンダリングされている可能性があります。下の「プレーンテキストを貼り付け」にテキストをコピーしてみてください。","aiBot.kb.blockedChromeStore":"Chromeウェブストアは自動リクエストをブロックします。ブラウザでリストを開き、説明文をコピーして下の「プレーンテキストを貼り付け」に貼り付けてください。","aiBot.kb.blockedGoogle":"Google Docs / Drive / Sheetsページはサインインが必要でスクレイピングできません。代わりにPDF/DOCX/TXTにエクスポートしてアップロードしてください。","aiBot.kb.blockedSocial":"ソーシャルネットワークは自動リクエストをブロックします。関連するテキストをコピーして下の「プレーンテキストを貼り付け」に貼り付けてください。","aiBot.kb.blockedNotion":"NotionページはJSレンダリングされ、ほとんどテキストを返しません。代わりにページをMarkdown/PDFとしてエクスポートしてアップロードしてください。","aiBot.kb.plainTextTitle":"プレーンテキストを貼り付け","aiBot.kb.textTitlePlaceholder":"タイトル(任意、例:「返金ポリシー」)","aiBot.kb.textBodyPlaceholder":"AIが知っておくべきテキストを貼り付けてください — 価格、FAQ、ポリシー、指示…","aiBot.kb.charsLabel":"文字","aiBot.kb.saveText":"テキストを保存","aiBot.kb.saving":"保存中…","aiBot.kb.trainingSources":"トレーニングソース","aiBot.kb.sourceSingular":"ソース","aiBot.kb.sourcePlural":"ソース","aiBot.kb.chunkSingular":"チャンク","aiBot.kb.chunkPlural":"チャンク","aiBot.kb.empty":"トレーニングソースがまだありません。上にURLを追加するかプレーンテキストを貼り付けてください。","aiBot.kb.deleteConfirm":"このソースを削除しますか?","aiBot.kb.uploadTitle":"ドキュメントをアップロード","aiBot.kb.uploadPrompt":"クリックしてファイルを選択するか、ここにドラッグ&ドロップ","aiBot.kb.uploadFormats":"PDF, DOCX, TXT, CSV, MD","aiBot.kb.uploadMaxSize":"ファイルあたり最大10 MB","aiBot.kb.parsing":"解析中…","aiBot.kb.parsingFile":"解析中","aiBot.esc.enableAuto":"自動エスカレーションを有効化","aiBot.esc.enableAutoDesc":"AIが対応できないか顧客が要求した場合、自動的に人間に引き継ぎます。","aiBot.esc.maxAttempts":"最大失敗回数","aiBot.esc.maxAttemptsHelp":"この回数の連続フォールバック返信後に引き継ぎます(24時間ウィンドウ)。","aiBot.esc.triggerPhrases":"トリガーフレーズ(1行に1つ)","aiBot.esc.triggerPhrasesHelp":"受信メッセージにこれらのフレーズのいずれかが現れると、ボットは即座にエスカレートします。大文字小文字を区別しない部分文字列マッチング。","aiBot.esc.message":"エスカレーションメッセージ","aiBot.esc.messageHelp":"ボットが返信を停止する直前に顧客に送信され、人間が引き継ぎできるようにします。","aiBot.esc.saveRules":"エスカレーションルールを保存","aiBot.esc.statusOn":"オン","aiBot.esc.statusOff":"オフ","aiBot.preview.qaPairsLabel":"Q&Aペア","aiBot.preview.sourcesLabel":"ソース","aiBot.preview.chunksLabel":"チャンク","aiBot.preview.helpText":"これは現在AIがアクセスできる内容です。無効な項目は使用されません。","aiBot.preview.escalationSummary":"エスカレーション","aiBot.preview.escStatus":"ステータス","aiBot.preview.escThreshold":"後","aiBot.preview.escFailed":"回連続のフォールバック返信","aiBot.preview.escPhrases":"トリガーフレーズ","aiBot.preview.escNoPhrases":"なし","aiBot.preview.qaPairsTitle":"Q&Aペア","aiBot.preview.sourcesTitle":"トレーニングソース","aiBot.preview.noQa":"有効なQ&Aペアがありません。","aiBot.preview.noSources":"有効なソースがありません。","aiBot.fallbackMoved":"フォールバック返信はAI動作タブに移動しました。既存のメッセージは自動的に保持されます。","aiBot.businessPromptMoved":"ビジネスプロンプトはAI動作タブに移動しました。そこで編集してください — 既存のプロンプトは保持されます。","aiBot.generalKnowledgeMoved":"「AIが一般知識を使用することを許可する」トグルはAI動作タブに移動しました。","aiBot.stopKeywordsRecommend":"新規セットアップではエスカレーションタブをお勧めします — キーワード停止に加えて試行回数カウンターとトリガーフレーズが追加されます。このセクションはキーワードのみの停止には引き続き機能します。","aiBot.subtitle":"自動AI応答を設定","aiBot.menu":"メニュー","aiBot.enableBot":"AIボットを有効化","aiBot.enableBotDesc":"受信メッセージに自動返信","aiBot.replyInGroups":"グループで返信","aiBot.replyInGroupsDesc":"AIボットがグループチャットで返信することを許可（デフォルトは無効）","aiBot.allowGeneralKnowledge":"AIの一般知識の使用を許可","aiBot.allowGeneralKnowledgeDesc":"オフの場合、AIはビジネスプロンプトに基づいてのみ返信します。オンの場合、AIは一般知識も使用して質問に回答できます。","aiBot.fallbackReply":"フォールバック返信","aiBot.fallbackReplyDesc":"AIがビジネスプロンプトに情報がない場合、回答を作り上げる代わりにこの返信を送信します。","aiBot.fallbackReplyPlaceholder":"例：ご質問ありがとうございます！現時点ではその件に関する具体的な情報がありません。担当者が後ほどご連絡いたします。","aiBot.smartDetection":"スマート検出","aiBot.smartDetectionDesc":"AIがユーザーの不満や人間のサポートリクエストを自動的に検出","aiBot.monday":"月曜日","aiBot.tuesday":"火曜日","aiBot.wednesday":"水曜日","aiBot.thursday":"木曜日","aiBot.friday":"金曜日","aiBot.saturday":"土曜日","aiBot.sunday":"日曜日","aiBot.enableWeekdays":"平日を有効化","aiBot.disableWeekdays":"平日を無効化","aiBot.enableWeekends":"週末を有効化","aiBot.disableWeekends":"週末を無効化","aiBot.applyToAll":"全日に適用:","aiBot.apply":"適用","aiBot.day":"曜日","aiBot.active":"有効","aiBot.currentStatus":"現在の状態:","aiBot.botOffToday":"ボットは今日オフです","aiBot.businessPrompt":"ビジネスプロンプト","aiBot.businessPromptDesc":"AIの応答方法をカスタマイズ。ビジネス、トーン、ガイドラインを説明。","aiBot.businessPromptPlaceholder":"例：あなたは[会社名]のカスタマーサービス担当者です。[製品/サービス]を販売しています。親切でプロフェッショナルな対応をお願いします。","aiBot.schedule":"ボット稼働時間","aiBot.scheduleEnabled":"スケジュールを有効化","aiBot.scheduleEnabledDesc":"指定された曜日と時間内のみボットが応答","aiBot.startTime":"開始時間","aiBot.endTime":"終了時間","aiBot.to":"から","aiBot.timezone":"タイムゾーン","aiBot.replyTiming":"返信タイミング","aiBot.replyTimingDesc":"AI応答前のランダム遅延","aiBot.minDelay":"最小遅延（秒）","aiBot.maxDelay":"最大遅延（秒）","aiBot.enabledActions":"有効なアクション","aiBot.enabledActionsDesc":"AIが実行できるアクションを選択","aiBot.actionNormalReply":"返信を送信","aiBot.actionNormalReplyDesc":"AIがテキストメッセージを送信","aiBot.actionKanban":"カンバンを更新","aiBot.actionKanbanDesc":"連絡先をカンバンステージ間で移動","aiBot.actionLabels":"ラベルを更新","aiBot.actionLabelsDesc":"WhatsAppラベルを追加/削除","aiBot.actionTabs":"タブを更新","aiBot.actionTabsDesc":"カスタムタブに追加/削除","aiBot.actionAppointment":"予約を作成","aiBot.actionAppointmentDesc":"会話から予約をスケジュール","aiBot.tabsPromptLabel":"タブ管理のカスタム指示：","aiBot.tabsPromptPlaceholder":"例：ユーザーがSEOサービスについて質問した場合、「SEOリード」タブに追加。Web開発に言及した場合、「Web開発リード」タブに追加。","aiBot.meetingLinkLabel":"Google Meetリンク：","aiBot.meetingLinkPlaceholder":"https://meet.google.com/xxx-xxxx-xxx","aiBot.meetingLinkDesc":"このリンクはAIが作成するすべての予約に使用されます","aiBot.messageTemplateLabel":"メッセージテンプレート：","aiBot.messageTemplateDesc":"このメッセージは予約リマインダーとして送信されます","aiBot.varName":"名前","aiBot.varDate":"日付","aiBot.varTime":"時間","aiBot.varLink":"リンク","aiBot.messageTemplatePlaceholder":"こんにちは {name}さん、{date} {time}に予約が入っています。こちらから参加：{link}","aiBot.officeHoursLabel":"営業時間（予約時間）：","aiBot.officeHoursDesc":"AIはこの時間内でのみ予約をスケジュールします","aiBot.sendMessageNow":"すぐにメッセージを送信","aiBot.sendMessageNowDesc":"作成直後に予約メッセージを送信","aiBot.appointmentPromptLabel":"カスタムAI指示：","aiBot.appointmentPromptPlaceholder":"例：予約をスケジュールする際は、常に午前10時〜午後6時の時間帯を提案。最低24時間前の通知。","aiBot.actionProfile":"プロフィールを更新","aiBot.actionProfileDesc":"連絡先情報を抽出して保存","aiBot.contextMessages":"コンテキストメッセージ","aiBot.contextMessagesDesc":"AIコンテキストに含める過去メッセージ数","aiBot.settingsTab":"設定","aiBot.promptSettings":"プロンプト設定","aiBot.actionPrompts":"アクションプロンプト","aiBot.actionPromptsDesc":"異なるAIアクションのカスタムプロンプトを設定","aiBot.talkToAI":"AIと話す","aiBot.testYourBot":"AIボットをテスト","aiBot.testDescription":"メッセージは現在の設定を使用します（未保存の変更を含む）","aiBot.clearChat":"チャットをクリア","aiBot.typeTestMessage":"テストメッセージを入力...","aiBot.aiTyping":"AIが入力中...","aiBot.noMessages":"AIボットの応答をテストするメッセージを入力してください","aiBot.send":"送信","aiBot.copy":"コピー","aiBot.copied":"コピーしました！","aiBot.select":"選択","aiBot.aiNotConfigured":"AIが設定されていません。AI APIキーを設定してください。","aiBot.noResponse":"AIからの応答がありません","aiBot.stopKeywords":"停止キーワード","aiBot.stopKeywordsInfo":"顧客がこれらのキーワードを送信すると、AIボットは応答を停止しブラックリストに追加します。","aiBot.enableStopKeywords":"停止キーワードを有効にする","aiBot.enableStopKeywordsDesc":"顧客が人間のサポートを要求したときにAIボットを自動停止","aiBot.keywords":"キーワード","aiBot.noKeywords":"キーワードがまだ追加されていません","aiBot.enterKeyword":"キーワードを入力...","aiBot.add":"+ 追加","aiBot.stopMessage":"停止メッセージ","aiBot.stopMessagePlaceholder":"停止キーワード検出時に送信されるメッセージ...","aiBot.stopMessageHint":"停止キーワードが検出されると、このメッセージが顧客に送信されます。","aiBot.responseMode":"応答モード:","aiBot.aiBotPrompt":"AIボットプロンプト","aiBot.globalChatGPT":"グローバルChatGPT","aiBot.newChat":"新しいチャット","aiBot.clearAll":"すべてクリア","aiBot.searchChats":"チャットを検索...","aiBot.noSearchResults":"チャットが見つかりません","aiBot.noChatsYet":"チャット履歴はまだありません","aiBot.deleteChat":"チャットを削除","aiBot.chatsStored":"件のチャットを保存","aiBot.clearAllTitle":"すべてのチャットをクリアしますか？","aiBot.clearAllDesc":"すべてのチャット履歴が完全に削除されます。この操作は取り消せません。","aiBot.messages":"件のメッセージ","aiBot.today":"今日","aiBot.yesterday":"昨日","crm.aiBotBlacklist":"AIボット","crm.aiBotEnabled":"この連絡先で有効","crm.aiBotDisabled":"この連絡先で無効","common.saved":"保存しました","crm.chatbotFlow":"チャットボットフロー","crm.chatbotFlowDesc":"キーワードベースの自動応答ボットを作成","crm.createNewFlow":"新しいフローを作成","crm.noFlowsYet":"フローがありません","crm.createFirstFlow":"最初のチャットボットフローを作成","crm.active":"アクティブ","crm.inactive":"非アクティブ","crm.flowName":"フロー名","crm.untitledFlow":"無題のフロー","crm.duplicate":"複製","crm.triggers":"トリガー","crm.actions":"アクション","crm.rules":"ルール","crm.chatbotFlows":"チャットボットフロー","crm.exportFlows":"エクスポート","crm.importFlows":"インポート","crm.exportAll":"すべてエクスポート","crm.exportSelected":"選択をエクスポート","crm.selectFlowsToExport":"エクスポートするフローを選択","crm.importSuccess":"フローが正常にインポートされました！","crm.importError":"フローのインポート中にエラーが発生しました","crm.invalidFlowFile":"無効なフローファイル形式","crm.duplicateFlowFound":"重複するフローが見つかりました","crm.flowAlreadyExists":"'{name}' は既に存在します。どうしますか？","crm.replaceFlow":"置換","crm.skipFlow":"スキップ","crm.renameAndAdd":"名前を変更して追加","crm.noFlowsSelected":"少なくとも1つのフローを選択してください","crm.noFlowsToExport":"エクスポートするフローがありません","crm.flowsExported":"{count}件のフローをエクスポートしました","crm.flowsImported":"{count}件のフローをインポートしました","crm.selected":"選択済み","crm.enabled":"有効","crm.allFlows":"すべて","crm.byCategory":"カテゴリ","crm.viewAllFlows":"すべてのフローを表示","crm.viewByCategory":"カテゴリ別に表示","crm.addFluxoCategory":"カテゴリを追加","crm.manageCategories":"カテゴリを管理","crm.editCategory":"カテゴリを編集","crm.createCategory":"カテゴリを作成","crm.createCategoryBtn":"カテゴリを作成","crm.fluxoCategoryName":"名前","crm.categoryIcon":"アイコン","crm.categoryColor":"色","crm.preview":"プレビュー","crm.custom":"カスタム","crm.enterFluxoCategoryName":"カテゴリ名を入力","crm.fluxoCategoryNameRequired":"カテゴリ名は必須です","crm.fluxoCategoryNameExists":"この名前のカテゴリは既に存在します","crm.confirmDeleteCategory":"このカテゴリを削除しますか？フローは未分類に移動されます。","crm.uncategorized":"未分類","crm.noFlowsInCategory":"このカテゴリにフローがありません","crm.dragFlowsHere":"フローをここにドラッグして整理","crm.dropHere":"ここにドロップ","crm.dragToMove":"ドラッグして移動","crm.noCategoriesYet":"カテゴリがありません","crm.createCategoryHint":"フローを整理するカテゴリを作成","crm.createFirstCategory":"最初のカテゴリを作成","crm.tourViewToggleTitle":"表示切替","crm.tourViewToggleContent":"すべてのフロー表示とカテゴリ表示を切り替えて、チャットボットフローを整理できます。","crm.tourCategoryViewTitle":"カテゴリ表示","crm.tourCategoryViewContent":"ここをクリックしてカテゴリ別に整理されたフローを表示。","crm.tourAddCategoryTitle":"カテゴリ作成","crm.tourAddCategoryContent":"ここをクリックしてカスタム名、アイコン、色で新しいカテゴリを作成。","crm.tourDragDropTitle":"ドラッグ＆ドロップ","crm.tourDragDropContent":"フローカードをドラッグしてカテゴリにドロップしてフローを整理。","crm.tourCategorySectionTitle":"カテゴリセクション","crm.tourCategorySectionContent":"クリックしてカテゴリを展開または折りたたみ。ボタンでカテゴリを編集または削除。","crm.skipTour":"スキップ","crm.finishTour":"了解！","crm.next":"次へ","crm.previous":"前へ","crm.simulateFlow":"フローをシミュレート","crm.start":"開始","crm.actionBlocks":"アクションブロック","crm.anyMessage":"任意のメッセージ","crm.keywords":"キーワード","crm.addKeyword":"キーワードを追加","crm.firstMessageOfDay":"その日の最初のメッセージ","crm.firstMessageEver":"初めてのメッセージ","crm.sendText":"テキスト送信","crm.sendTextDesc":"テキストメッセージを送信します。","crm.sendImage":"画像送信","crm.sendImageDesc":"キャプション付きの画像を送信します。","crm.sendVideo":"動画送信","crm.sendVideoDesc":"キャプション付きの動画を送信します。","crm.sendAudio":"音声送信","crm.sendAudioDesc":"音声ファイルを送信します。","crm.sendDocument":"ドキュメント送信","crm.sendDocumentDesc":"ドキュメントファイルを送信します。","crm.responses":"応答","crm.responsesDesc":"ユーザーの応答を待ってフローを分岐させます。","crm.sendList":"リスト送信","crm.sendListDesc":"インタラクティブなリストメッセージを送信します。","fluxo.waitInput":"入力待機","fluxo.waitInputDesc":"検証済みユーザー応答を待機","fluxo.promptMessage":"プロンプトメッセージ","fluxo.enterPromptMessage":"ユーザー入力を求めるプロンプトを入力...","fluxo.inputType":"入力タイプ（検証）","fluxo.inputTypeString":"テキスト（任意）","fluxo.inputTypePhone":"電話番号","fluxo.inputTypeNumber":"数値","fluxo.inputTypeEmail":"メール","fluxo.inputTypeUrl":"URL","fluxo.inputTypeDatetime":"日付/時刻","fluxo.phoneHint":"形式：+819012345678（国番号付き）","fluxo.emailHint":"形式：user@example.com","fluxo.numberHint":"整数と小数を受け付けます","fluxo.urlHint":"形式：https://example.com","fluxo.datetimeHint":"形式：YYYY-MM-DD または YYYY-MM-DDTHH:MM","fluxo.stringHint":"任意のテキスト入力を受け付けます","fluxo.saveResponseAs":"応答を変数として保存","fluxo.variableName":"userInput","fluxo.useVariableHint":"後のメッセージで {variableName} を使用","fluxo.errorMessage":"エラーメッセージ（無効な入力時）","fluxo.invalidInputDefault":"無効な入力です。もう一度お試しください。","fluxo.timeout":"タイムアウト","fluxo.seconds":"秒","fluxo.minutes":"分","fluxo.hours":"時間","fluxo.timeoutHint":"この時間内に有効な応答がない場合、タイムアウト分岐が実行されます。","fluxo.customRegex":"カスタム正規表現（オプション）","fluxo.regexPlaceholder":"^[A-Z]{2}[0-9]{4}$","fluxo.customRegexHint":"入力タイプ検証をカスタムパターンで上書き","fluxo.outputConnections":"出力接続","fluxo.response":"応答","fluxo.validInputReceived":"有効な入力を受信した場合","fluxo.noResponseTimeout":"有効な応答なしでタイムアウトした場合","fluxo.validResponse":"有効な応答","fluxo.onInvalidInput":"無効時：","fluxo.promptMessageInfo":"ユーザーに入力を求めるメッセージ。応答を待つ前に表示されます。","fluxo.inputTypeInfo":"期待する入力タイプを選択。システムはこの形式に対してユーザーの応答を検証します。","fluxo.saveResponseAsInfo":"ユーザーの有効な応答を保存する変数名。後続のメッセージで {変数名} を使用して値を表示できます。","fluxo.errorMessageInfo":"ユーザーの入力が期待された形式と一致しない場合に送信されるメッセージ。再試行を求めます。","fluxo.timeoutInfo":"有効な応答を待つ最大時間。超過した場合、応答分岐ではなくタイムアウト分岐が実行されます。","fluxo.customRegexInfo":"上級：入力を検証するカスタム正規表現パターン。選択した入力タイプの検証を上書きします。","fluxo.delayInfo":"プロンプトメッセージを送信する前の待機時間（秒）。自然な会話の流れに役立ちます。","crm.groupAction":"グループアクション","crm.tabAction":"タブアクション","crm.labelAction":"ラベルアクション","crm.crmAction":"CRMアクション","crm.smartWait":"スマート待機","crm.smartWaitDesc":"メッセージ間のランダム待機時間","crm.typingIndicator":"入力インジケーター","crm.typingIndicatorDesc":"送信前に入力バブルを表示","crm.waitDuration":"待機時間：","crm.typingDuration":"入力時間：","crm.randomDelay":"ランダム遅延：","crm.randomDelayBetween":"ランダム遅延","crm.randomBetween":"ランダム遅延","crm.showsTypingFor":"入力インジケーターを表示","crm.showsTyping":"入力を表示","crm.typingPreview":"連絡先に表示される入力インジケーター","crm.addFluxo":"フロー追加","crm.addFluxoDesc":"別のフローを実行","crm.selectFlowToCall":"実行するフローを選択：","crm.noFlowSelected":"フローが選択されていません","crm.passVariables":"呼び出されたフローに変数を渡す","crm.passVariablesHint":"現在のフローの変数が呼び出されたフローで使用可能になります","crm.passVariablesUseCase":'💡 例：メインフローに {name}="太郎" → サブフロー「こんにちは {name}!」→「こんにちは 太郎!」と表示。OFFにするとサブフローは変数なしで開始。',"crm.passVariablesShort":"変数を渡す","crm.continueAfterFlow":"呼び出されたフローの終了後に続行","crm.continueAfterFlowHint":"呼び出されたフローが完了したら会話を終了するにはチェックを外す","crm.continueAfterFlowUseCase":"💡 例：ON = ウェルカムサブフロー終了 → メインフローに戻り続行。OFF = サブフロー終了 = 会話終了（注文完了フローなど）。","crm.continueAfterShort":"後に続行","crm.circularWarning":"警告：循環参照が検出されました！","crm.circularWarningHint":"選択したフローには、このフローを指す「フロー追加」ノードが含まれています。無限ループを引き起こす可能性があります。","crm.selectFlowPlaceholder":"フローを選択...","crm.noOtherFlows":"他のフローがありません。まず別のフローを作成してください。","crm.delayBeforeCalling":"呼び出し前の遅延（秒）：","crm.executionSummary":"実行概要：","crm.variablesWillBe":"変数は","crm.passed":"渡される","crm.notPassed":"渡されない","crm.executeFlow":"実行","crm.continueToNext":"次のノードに続行","crm.endConversation":"会話を終了","crm.selectedFlow":"選択したフロー：","crm.addToGroups":"グループに追加","crm.removeFromGroups":"グループから削除","crm.addToTabs":"タブに追加","crm.removeFromTabs":"タブから削除","crm.addLabels":"ラベルを追加","crm.removeLabels":"ラベルを削除","crm.addToCrmStage":"CRMステージに追加","crm.removeFromCrm":"CRMから削除","crm.actionType":"アクションタイプ：","crm.selectGroups":"グループを選択：","crm.loadGroups":"グループを読み込む","crm.loadGroupsFromWhatsApp":"WhatsApp Webからグループを読み込む","crm.selectTabs":"カスタムタブを選択：","crm.selectLabels":"WhatsAppラベルを選択：","crm.syncLabels":"ラベルを同期","crm.searchLabels":"ラベルを検索...","crm.searchTabs":"タブを検索...","crm.searchGroups":"グループを検索...","crm.selectCrm":"CRMを選択：","crm.selectStage":"ステージを選択：","crm.selectCrmPlaceholder":"CRMを選択...","crm.selectStagePlaceholder":"ステージを選択...","crm.noGroupsSelected":"グループが選択されていません","crm.noTabsSelected":"タブが選択されていません","crm.noLabelsSelected":"ラベルが選択されていません","crm.noCrmSelected":"CRM/ステージが選択されていません","crm.noGroupsAvailable":"利用可能なグループがありません。","crm.noTabsAvailable":"利用可能なタブがありません。","crm.noCrmsAvailable":"利用可能なCRMがありません。","crm.noStagesAvailable":"このCRMにステージがありません。","crm.delay":"遅延（秒）：","crm.selectedGroups":"グループ：","crm.selectedTabs":"タブ：","crm.selectedLabels":"ラベル：","crm.targetCrmStage":"ターゲットCRM → ステージ：","crm.targetCrm":"ターゲットCRM：","crm.schedule":"スケジュール","crm.enableSchedule":"スケジュールを有効化","crm.startTime":"開始時間","crm.endTime":"終了時間","crm.crmRules":"CRMルール","crm.whenAnyMessage":"任意のメッセージを受信したとき。","crm.whenKeywordMatch":"メッセージにキーワードが含まれている場合。","crm.byKeywordInMessage":"メッセージ内のキーワードで","crm.firstMessageDay":"顧客からのその日の最初のメッセージ。","crm.reactivationInterval":"再アクティベーション間隔：","crm.generalRules":"一般ルール：","crm.allowGroups":"グループへの返信を許可","crm.scheduleEnabled":"特定の曜日と時間のみ返信を許可","crm.dontRespondIfOpen":"会話が開いている場合は返信しない","crm.customSignature":"署名をカスタマイズまたは無効化","crm.simulateTyping":"タイピングまたは音声録音をシミュレート","crm.dontRespondIfInCRM":"連絡先がCRMにいる場合は返信しない","crm.dontRespondToCRMs":"CRMに返信しない","crm.respondOnlyToCRMs":"CRMにのみ返信","crm.enableCrmRules":"CRMタブルールを有効化","crm.selectCrmTabs":"CRMタブを選択","crm.tagRules":"タグルール","crm.labelRules":"ラベルルール：","crm.dontRespondIfLabeled":"連絡先にラベルがある場合は返信しない","crm.dontRespondToLabels":"これらのラベルには返信しない","crm.respondOnlyToLabels":"これらのラベルにのみ返信","crm.selectLabelsNotToReply":"返信しないラベルを選択：","crm.selectLabelsToReply":"返信するラベルを選択：","crm.clickToSelect":"クリックして選択","crm.labelsNotReplied":"返信しないラベル：","crm.labelsToReply":"返信するラベル：","crm.customTabRules":"カスタムタブルール：","crm.dontRespondIfInCustomTab":"連絡先がカスタムタブにいる場合は返信しない","crm.dontRespondToCustomTabs":"これらのカスタムタブには返信しない","crm.respondOnlyToCustomTabs":"これらのカスタムタブにのみ返信","crm.selectCustomTabsNotToReply":"返信しないカスタムタブを選択：","crm.selectCustomTabsToReply":"返信するカスタムタブを選択：","crm.customTabsNotReplied":"返信しないカスタムタブ：","crm.customTabsToReply":"返信するカスタムタブ：","crm.noCustomTabsAvailable":"カスタムタブがありません。先に作成してください。","crm.pauseRules":"一時停止ルール：","crm.enablePause":"一時停止を有効化","crm.pauseClientKeywords":"クライアント一時停止キーワード","crm.pauseClientPlaceholder":"受信者がキーワードを送信した場合、チャットボットを一時停止...","crm.pauseServerKeywords":"サーバー一時停止キーワード","crm.pauseServerPlaceholder":"ボットが送信したときに一時停止...","crm.pauseDuration":"一時停止時間 (時:分)","crm.tipPauseTitle":"一時停止ルール","crm.tipPauseDesc":"特定のキーワードが検出されたときにチャットボットを一時停止します。クライアントキーワードを使用して顧客がボットを一時停止できるようにするか、サーバーキーワードを使用して特定のメッセージを送信した後に自動一時停止します。","crm.tipPauseEx1":"顧客が「停止」と言う → ボットが一時停止","crm.tipPauseEx2":"顧客が「人間」と言う → エージェントに転送","crm.tipPauseEx3":"ボットが「接続中...」と送信 → 自動一時停止","crm.tipPauseClientTitle":"クライアント一時停止キーワード","crm.tipPauseClientDesc":"顧客がこれらのキーワードを送信すると、このチャットのチャットボットが一時停止します。人間への引き継ぎシナリオに便利です。","crm.tipPauseClientEx1":"顧客が「停止」または「stop」と入力","crm.tipPauseClientEx2":"顧客が「人間」または「オペレーター」と入力","crm.tipPauseClientEx3":"ボットは設定された期間応答を停止","crm.tipPauseServerTitle":"サーバー一時停止キーワード","crm.tipPauseServerDesc":"ボットがこれらのキーワードを含むメッセージを送信すると、チャットボットが自動的に一時停止します。人間のエージェントへの転送時に便利です。","crm.tipPauseServerEx1":"ボットが「エージェントに接続中...」と送信","crm.tipPauseServerEx2":"ボットが「お待ちください、転送中...」と送信","crm.tipPauseServerEx3":"このメッセージの後、フローが自動一時停止","crm.tipPauseDurationTitle":"一時停止時間","crm.tipPauseDurationDesc":"一時停止キーワードが検出された後、チャットボットが一時停止する時間を設定します。形式：時:分（例：00:30 = 30分）。","crm.tipPauseDurationEx1":"00:30 = 30分間一時停止","crm.tipPauseDurationEx2":"01:00 = 1時間一時停止","crm.tipPauseDurationEx3":"期間終了後、新しいトリガーまで一時停止を維持","crm.enableTagRules":"WhatsAppラベルルールを有効化","crm.editBlock":"ブロックを編集：","crm.close":"閉じる","crm.startNode":"開始","crm.startNodeInfo":"これはフローの開始点です。他のブロックに接続してチャットボットを構築してください。","crm.editTextMessage":"テキストメッセージを編集：","crm.typeTheText":"テキストを入力","crm.saveResponseInVariable":"応答を変数に保存：","crm.typeVariableName":"変数名を入力","crm.variableHint":"変数には現在のブロックからの顧客の応答が保存され、後続のブロックで使用できます","crm.insertImage":"画像を挿入：","crm.clickToUpload":"クリックして送信またはファイルをここにドラッグ","crm.imageFormats":"画像：PNG、JPG、JPEG、GIF（最大16MB - WhatsApp制限）","crm.imageCaption":"画像キャプション（オプション）","crm.insertVideo":"動画を挿入：","crm.insertAudio":"音声を挿入：","crm.insertDocument":"ドキュメントを挿入：","crm.caption":"キャプション：","crm.captionOptional":"キャプション（オプション）","crm.questionMessage":"質問メッセージ：","crm.typeQuestion":"質問を入力...","crm.responseOptions":"応答オプション：","crm.addOption":"オプションを追加","crm.buttonText":"ボタンテキスト：","crm.title":"タイトル：","crm.listTitleOptional":"リストタイトル（オプション）","crm.listDescOptional":"説明（オプション）","crm.listSectionsHint":"詳細設定でリストセクションと項目を設定します。","crm.globalSettings":"グローバル設定：","crm.editAwayMessage":"不在メッセージを編集：","crm.awayMessagePlaceholder":"ユーザーが応答しない場合に送信されるメッセージを入力...","crm.waitingTime":"待機時間：","crm.waitingTimeWarning":"WhatsAppページが再読み込みされると、応答待ちの会話ではこの設定が失われます","crm.minutes":"分","crm.hours":"時間","crm.seconds":"秒","crm.awayMessageInfo":"指定時間内にユーザーが応答しない場合、このメッセージが自動的に送信されます。","crm.blockInterval":"ブロック間隔：","crm.blockIntervalInfo":"フローブロック間のデフォルト間隔を定義します。","crm.chatSimulator":"チャットシミュレーター","crm.startConversation":"メッセージを送信して会話を開始","crm.typeMessageHere":"ここにメッセージを入力...","crm.callNextBlock":"次のブロックを呼び出す","crm.whenItemSelected":"項目が選択されたとき","crm.whenResponding":"応答時","crm.defaultNext":"デフォルト（一致なし）","crm.message":"メッセージ：","crm.listButton":"ボタンテキスト：","crm.items":"項目","crm.listItems":"リスト項目：","crm.addItem":"項目を追加","crm.insertVariable":"変数を挿入","crm.contactName":"連絡先名","crm.currentDate":"現在の日付","crm.currentTime":"現在の時刻","crm.defaultOption1":"オプション 1","crm.defaultOption2":"オプション 2","crm.noListItems":"項目がありません。編集をクリックして追加してください。","crm.send_text":"テキストを送信","crm.send_image":"画像を送信","crm.send_video":"動画を送信","crm.send_audio":"音声を送信","crm.send_document":"ドキュメントを送信","crm.send_list":"リストを送信","crm.group_action":"グループアクション","crm.tab_action":"タブアクション","crm.label_action":"ラベルアクション","crm.crm_action":"CRMアクション","crm.wait_input":"入力待機","crm.smart_wait":"スマート待機","crm.typing_indicator":"入力インジケーター","crm.add_fluxo":"フロー追加","crm.timezone":"タイムゾーン：","crm.day":"曜日","crm.sunday":"日曜日","crm.monday":"月曜日","crm.tuesday":"火曜日","crm.wednesday":"水曜日","crm.thursday":"木曜日","crm.friday":"金曜日","crm.saturday":"土曜日","crm.disableSignature":"署名を無効にする","crm.customizeSignatureName":"署名の名前をカスタマイズ","crm.enterCustomSignature":"カスタム署名名を入力","crm.tipAnyMsgTitle":"任意メッセージトリガー","crm.tipAnyMsgDesc":"顧客から任意のメッセージを受信すると、内容に関係なくフローが開始されます。","crm.tipAnyMsgEx1":"すべてのメッセージへの一般的な自動返信","crm.tipAnyMsgEx2":"不在時の離席メッセージ","crm.tipAnyMsgEx3":"トリガーが頻繁すぎる可能性 - 再アクティベーション間隔と併用","crm.tipKeywordTitle":"キーワードトリガー","crm.tipKeywordDesc":"メッセージに指定されたキーワードのいずれかが含まれている場合にのみフローが開始されます。","crm.tipKeywordEx1":"「こんにちは」でウェルカムフローをトリガー","crm.tipKeywordEx2":"「価格」で商品情報をトリガー","crm.tipKeywordEx3":"「ヘルプ」でサポートメニューをトリガー","crm.tipFirstDayTitle":"その日の最初のメッセージ","crm.tipFirstDayDesc":"各連絡先から毎日受信する最初のメッセージでのみフローがトリガーされます。","crm.tipFirstDayEx1":"1日1回だけの「おはよう」挨拶","crm.tipFirstDayEx2":"各連絡先への毎日の特別プロモーション","crm.tipFirstDayEx3":"タイムゾーンに基づいて深夜にリセット","crm.tipFirstEverTitle":"初めてのメッセージ","crm.tipFirstEverDesc":"連絡先が初めてメッセージを送信したときにのみフローがトリガーされます。","crm.tipFirstEverEx1":"新規連絡先へのウェルカムメッセージ","crm.tipFirstEverEx2":"新規顧客のオンボーディングシーケンス","crm.tipFirstEverEx3":"新規リードへの初期CRM割り当て","crm.tipReactivationTitle":"再アクティベーション間隔","crm.tipReactivationDesc":"同じフローが同じ連絡先に再度トリガーされるまでの最小待機時間。","crm.tipReactivationEx1":"3600秒 = 再トリガーまで1時間待機","crm.tipReactivationEx2":"自動返信のスパムを防止","crm.tipReactivationEx3":"0を使用して無制限のトリガーを許可","crm.tipSendTextTitle":"テキストメッセージを送信","crm.tipSendTextDesc":"連絡先にプレーンテキストメッセージを送信します。{name}、{phone}などの変数をサポート。","crm.tipSendTextEx1":"パーソナライズされたウェルカムメッセージ","crm.tipSendTextEx2":"注文確認","crm.tipSendImageTitle":"画像を送信","crm.tipSendImageDesc":"オプションのキャプション付きで画像ファイルを送信します。PNG、JPG、GIFをサポート。","crm.tipSendImageEx1":"商品画像","crm.tipSendImageEx2":"プロモーション素材","crm.tipSendVideoTitle":"動画を送信","crm.tipSendVideoDesc":"オプションのキャプション付きで動画ファイルを送信します。MP4、MOVをサポート。","crm.tipSendVideoEx1":"商品デモ","crm.tipSendVideoEx2":"チュートリアル動画","crm.tipSendAudioTitle":"音声を送信","crm.tipSendAudioDesc":"音声ファイルまたはボイスメモを送信します。MP3、OGG、WAVをサポート。","crm.tipSendAudioEx1":"事前録音された音声メッセージ","crm.tipSendAudioEx2":"音声アナウンス","crm.tipSendDocTitle":"ドキュメントを送信","crm.tipSendDocDesc":"任意のファイルタイプをドキュメントとして送信します。PDF、DOC、XLSなどをサポート。","crm.tipSendDocEx1":"価格カタログ","crm.tipSendDocEx2":"契約書と合意書","crm.tipSendListTitle":"リストメッセージを送信","crm.tipSendListDesc":"セクションと選択可能なアイテムを持つインタラクティブリストを送信します。","crm.tipSendListEx1":"カテゴリ別の商品メニュー","crm.tipSendListEx2":"サービスオプション","crm.tipGroupActionTitle":"WhatsAppグループアクション","crm.tipGroupActionDesc":"現在の連絡先をWhatsAppグループに追加または削除します。","crm.tipGroupActionEx1":"VIP顧客を専用グループに追加","crm.tipGroupActionEx2":"解決後にサポートグループから削除","crm.tipTabActionTitle":"カスタムタブアクション","crm.tipTabActionDesc":"現在の連絡先をCRMカスタムタブに追加または削除します。","crm.tipTabActionEx1":"リードを「有資格」タブに移動","crm.tipTabActionEx2":"「新規お問い合わせ」タブから削除","crm.tipLabelActionTitle":"WhatsAppラベルアクション","crm.tipLabelActionDesc":"現在の連絡先のWhatsAppラベルを追加または削除します。","crm.tipLabelActionEx1":"「返信済み」ラベルを追加","crm.tipLabelActionEx2":"「保留中」ラベルを削除","crm.tipCrmActionTitle":"CRMステージアクション","crm.tipCrmActionDesc":"現在の連絡先をCRMカンバンの特定のステージに移動します。","crm.tipCrmActionEx1":"「交渉中」ステージに移動","crm.tipCrmActionEx2":"「成約」ステージに移動","crm.tipSmartWaitTitle":"スマート待機","crm.tipSmartWaitDesc":"アクション間にランダムな遅延を追加し、より人間らしく見せます。","crm.tipSmartWaitEx1":"メッセージ間に2〜5秒待機","crm.tipSmartWaitEx2":"自然な読み取り時間をシミュレート","crm.tipTypingTitle":"入力インジケーター","crm.tipTypingDesc":"メッセージを送信する前に「入力中...」バブルを表示し、より人間らしく見せます。","crm.tipTypingEx1":"メッセージ前に3秒間入力を表示","crm.tipTypingEx2":"返信がより自然に見える","crm.tipAllowGroupsTitle":"グループを許可","crm.tipAllowGroupsDesc":"有効にすると、チャットボットはグループチャットでも返信します。無効にすると、プライベートチャットのみがフローをトリガーします。","crm.tipAllowGroupsEx1":"ON: グループとプライベートの両方で返信","crm.tipAllowGroupsEx2":"OFF: プライベートチャットのみで返信","crm.tipScheduleTitle":"返信のスケジュール","crm.tipScheduleDesc":"チャットボットを特定の時間/曜日のみに制限します。以下でスケジュールを設定。","crm.tipScheduleEx1":"営業時間のみ（午前9時〜午後6時）","crm.tipScheduleEx2":"平日のみ（月〜金）","crm.tipScheduleEx3":"営業時間外の自動返信","crm.tipDontRespondOpenTitle":"開いている場合は返信しない","crm.tipDontRespondOpenDesc":"WhatsApp Webでその会話を既に開いている場合、チャットボットがメッセージを送信するのを防ぎます。","crm.tipDontRespondOpenEx1":"アクティブにチャットしているときに便利","crm.tipDontRespondOpenEx2":"ボットが会話を中断するのを防ぐ","crm.tipSimulateTypingTitle":"入力をシミュレート","crm.tipSimulateTypingDesc":"メッセージを送信する前に「入力中...」インジケーターを表示し、より人間らしい返信にします。","crm.tipSimulateTypingEx1":"テキストメッセージで「入力中...」を表示","crm.tipSimulateTypingEx2":"音声で「録音中...」を表示","crm.tipSimulateTypingEx3":"ボットをより自然に感じさせる","crm.tipSkipCRMTitle":"CRM連絡先をスキップ","crm.tipSkipCRMDesc":"チャットボットは既にCRMに追加されている連絡先には返信しません。既存の顧客に便利。","crm.tipSkipCRMEx1":"新しい連絡先にのみ自動返信","crm.tipSkipCRMEx2":"既存のCRM連絡先をスキップ","crm.tipExcludeCRMTitle":"特定のCRMステージを除外","crm.tipExcludeCRMDesc":"除外する特定のカンバンCRMステージを選択。それらのステージの連絡先はチャットボットメッセージを受け取りません。","crm.tipExcludeCRMEx1":"「VIP顧客」ステージを除外","crm.tipExcludeCRMEx2":"「邪魔しないで」ステージを除外","crm.tipIncludeCRMTitle":"特定のCRMステージのみを含める","crm.tipIncludeCRMDesc":"チャットボットは選択したカンバンCRMステージの連絡先にのみ返信します。他はすべて無視されます。","crm.tipIncludeCRMEx1":"「リード」ステージにのみ返信","crm.tipIncludeCRMEx2":"「アクティブな取引」ステージにのみ返信","crm.tipSkipLabeledTitle":"ラベル付き連絡先をスキップ","crm.tipSkipLabeledDesc":"チャットボットはWhatsAppラベルが割り当てられた連絡先には返信しません。","crm.tipSkipLabeledEx1":"ラベル付きの連絡先はスキップされます","crm.tipSkipLabeledEx2":"ラベルなしの連絡先のみが返信を受け取ります","crm.tipExcludeLabelTitle":"特定のラベルを除外","crm.tipExcludeLabelDesc":"除外する特定のWhatsAppラベルを選択。それらのラベルを持つ連絡先はチャットボットメッセージを受け取りません。","crm.tipExcludeLabelEx1":"「スパム」ラベル付き連絡先を除外","crm.tipExcludeLabelEx2":"「ブロック済み」ラベル付き連絡先を除外","crm.tipIncludeLabelTitle":"特定のラベルのみを含める","crm.tipIncludeLabelDesc":"チャットボットは選択したWhatsAppラベルを持つ連絡先にのみ返信します。他はすべて無視されます。","crm.tipIncludeLabelEx1":"「VIP」ラベル付きにのみ返信","crm.tipIncludeLabelEx2":"「優先」ラベル付きにのみ返信","crm.tipSkipCustomTabTitle":"カスタムタブ連絡先をスキップ","crm.tipSkipCustomTabDesc":"チャットボットはカスタムタブに割り当てられた連絡先には返信しません。","crm.tipSkipCustomTabEx1":"「VIP顧客」タブの連絡先 → 返信なし","crm.tipSkipCustomTabEx2":"どのタブにもない連絡先 → ボットが返信","crm.tipExcludeCustomTabTitle":"特定のカスタムタブを除外","crm.tipExcludeCustomTabDesc":"除外する特定のカスタムタブを選択。それらのタブの連絡先はチャットボットメッセージを受け取りません。","crm.tipExcludeCustomTabEx1":"「ブロック済み」タブの連絡先を除外","crm.tipExcludeCustomTabEx2":"「対応済み」タブの連絡先を除外","crm.tipIncludeCustomTabTitle":"特定のカスタムタブのみを含める","crm.tipIncludeCustomTabDesc":"チャットボットは選択したカスタムタブの連絡先にのみ返信します。他はすべて無視されます。","crm.tipIncludeCustomTabEx1":"「アクティブリード」タブにのみ返信","crm.tipIncludeCustomTabEx2":"「VIP」タブにのみ返信","templates.addCategory":"カテゴリを追加","templates.editCategory":"カテゴリを編集","templates.deleteCategory":"カテゴリを削除","templates.manageCategories":"管理","templates.categoryName":"カテゴリ名","templates.categoryIcon":"アイコン","templates.categoryColor":"色","templates.update":"更新","templates.form.category":"カテゴリ","templates.form.categoryHint":"テンプレートをカテゴリに整理してアクセスしやすくする","templates.allTemplates":"すべてのテンプレート","templates.quickReplyCategory":"クイック返信","templates.uncategorized":"未分類","templates.sortNewest":"最新","templates.sortOldest":"最古","templates.sortNameAZ":"名前 A-Z","templates.sortNameZA":"名前 Z-A","templates.confirmDeleteCategory":"このカテゴリを削除してもよろしいですか？テンプレートは未分類に移動されます。","templates.confirmDeleteTemplate":"このテンプレートを削除してもよろしいですか？","templates.noCategoriesYet":"カテゴリがまだありません","templates.createCategoryDescription":"カテゴリを作成してテンプレートを整理しましょう","templates.done":"完了","templates.deleteCategoryWarning":"このカテゴリのテンプレートは未分類になります。","templates.delete":"削除","templates.noTemplatesInCategory":"このカテゴリにはテンプレートがありません","templates.createFirstDescription":"最初のテンプレートを作成して始めましょう","followUp.title":"フォローアップ","followUp.newFollowUp":"新規フォローアップ","followUp.confirmDelete":"このフォローアップを削除してもよろしいですか？","followUp.emptyTitle":"フォローアップが選択されていません","followUp.emptyText":"リストからフォローアップを選択するか、新しいものを作成して自動メッセージシーケンスを開始しましょう。","followUp.createNew":"新規作成","followUp.loading":"読み込み中...","followUp.noFollowUps":"フォローアップはまだありません","followUp.createFirst":"最初のフォローアップシーケンスを作成","followUp.active":"アクティブ","followUp.paused":"一時停止","followUp.labels":"ラベル","followUp.customTabs":"カスタムタブ","followUp.groups":"グループ","followUp.kanban":"カンバン","followUp.onEnter":"入場時","followUp.onLeave":"退場時","followUp.afterTime":"時間後","followUp.steps":"ステップ","followUp.pause":"一時停止","followUp.activate":"アクティブ化","followUp.duplicate":"複製","followUp.delete":"削除","followUp.name":"フォローアップ名","followUp.namePlaceholder":"フォローアップ名を入力...","followUp.nameRequired":"フォローアップの名前を入力してください","followUp.funnelRequired":"少なくとも1つのファネル項目を選択してください","followUp.stepsRequired":"少なくとも1つのステップを追加してください","followUp.funnelSettings":"ファネル設定","followUp.selectFunnelItems":"このフォローアップをトリガーする項目を選択","followUp.comingSoon":"セレクター近日公開","followUp.triggerSettings":"フォローアップトリガー","followUp.onEnterDesc":"連絡先がファネルに入ったときにトリガー","followUp.onLeaveDesc":"連絡先がファネルを離れたときにトリガー","followUp.afterTimeDesc":"特定の時間が経過した後にトリガー","followUp.days":"日","followUp.day":"日","followUp.hours":"時間","followUp.minutes":"分","followUp.value":"値","followUp.unit":"単位","followUp.time":"時間","followUp.scheduleConfiguration":"スケジュール設定","followUp.enableSchedule":"高度なスケジュールを有効にする","followUp.enableScheduleDesc":"（特定の日/日付にのみ送信）","followUp.scheduleDisabledInfo":"メッセージを送信する特定の日/日付を設定するには、上の高度なスケジュールを有効にしてください。","followUp.tooltip.scheduleTitle":"スケジュール設定 - いつ送信しますか？","followUp.tooltip.scheduleContent":"フォローアップを実行する特定の日/日付を設定します。すべてのトリガータイプで機能します。日次、週次、月次、または年次スケジュールを選択します。","followUp.tooltip.scheduleExample":"週次スケジュールを月、水、金に設定して、それらの日のみメッセージを送信します。","followUp.messagesConfiguredInSchedule":"メッセージはスケジュールで設定済み","followUp.messagesConfiguredInScheduleDesc":"上のスケジュール設定セクションで「日ごとに異なるメッセージ」を有効にしました。メッセージは選択した各日に対してそこで設定されています。","followUp.stepsTitle":"フォローアップステップ","followUp.step":"ステップ","followUp.actions":"アクション","followUp.addStep":"フォローアップステップを追加","followUp.rulesTitle":"トリガールール","followUp.cancelOnReply":"クライアントが返信したらキャンセル","followUp.allowGroups":"グループでの返信を許可","followUp.customSignature":"署名をカスタマイズ","followUp.signatureText":"署名テキスト","followUp.signaturePlaceholder":"署名を入力...","followUp.maxExecutions":"連絡先あたりの最大回数","followUp.cooldownDays":"クールダウン（日）","followUp.cancel":"キャンセル","followUp.create":"フォローアップを作成","followUp.save":"変更を保存","followUp.saving":"保存中...","followUp.saved":"保存しました！","followUp.back":"← 戻る","followUp.next":"次へ →","followUp.backToList":"← リストに戻る","followUp.wizardStep1":"設定","followUp.wizardStep2":"メッセージ","followUp.wizardStep3":"スケジュール","followUp.wizardStep4":"アクション","followUp.wizardStep5":"ルール","followUp.followUps":"フォローアップ","followUp.stepName":"ステップ名（オプション）","followUp.stepNamePlaceholder":"例：初回コンタクト、フォローアップ1...","followUp.timing":"タイミング","followUp.mode":"モード","followUp.relative":"相対","followUp.specific":"特定","followUp.type":"タイプ","followUp.daily":"毎日","followUp.weekly":"毎週","followUp.monthly":"毎月","followUp.condition":"条件","followUp.conditionAlways":"常に","followUp.conditionIfReplied":"返信あり","followUp.conditionIfNotReplied":"返信なし","followUp.conditionIfKeyword":"キーワードあり","followUp.conditionIfNotKeyword":"キーワードなし","followUp.conditionIfInFunnel":"ファネル内","followUp.conditionIfNotInFunnel":"ファネル離脱","followUp.keywords":"キーワード（カンマ区切り）","followUp.keywordsPlaceholder":"はい, OK, 興味あり...","followUp.actionsTitle":"アクション","followUp.actionsRequired":"少なくとも1つのアクションを追加してください","followUp.addAction":"+ アクションを追加","followUp.postActionsTitle":"アクション後","followUp.groupActions":"グループアクション","followUp.addToGroups":"グループに追加","followUp.removeFromGroups":"グループから削除","followUp.customTabActions":"カスタムタブアクション","followUp.addToTabs":"タブに追加","followUp.removeFromTabs":"タブから削除","followUp.labelsActions":"ラベルアクション","followUp.addLabels":"ラベルを追加","followUp.removeLabels":"ラベルを削除","followUp.kanbanBoardActions":"カンバンアクション","followUp.addToKanban":"ステージに追加","followUp.removeFromKanban":"ステージから削除","followUp.selectStage":"ステージを選択...","followUp.noGroupsAvailable":"利用可能なグループがありません","followUp.noTabsAvailable":"利用可能なタブがありません","followUp.noLabelsAvailable":"利用可能なラベルがありません","followUp.noKanbanAvailable":"利用可能なカンバンがありません","followUp.moveUp":"上へ移動","followUp.moveDown":"下へ移動","followUp.removeStep":"ステップを削除","followUp.message":"メッセージ","followUp.messagePlaceholder":"メッセージを入力...","followUp.variables":"変数","followUp.clickToInsert":"クリックして変数を挿入：","followUp.minDelay":"最小遅延（秒）","followUp.maxDelay":"最大遅延（秒）","followUp.addMessage":"メッセージを追加","followUp.removeMessage":"メッセージを削除","followUp.selectLabels":"ラベルを選択...","followUp.selectTabs":"カスタムタブを選択...","followUp.selectKanbanStage":"カンバンCRMとステージを選択...","followUp.selectGroups":"WhatsAppグループを選択...","followUp.selectorComingSoon":"セレクター近日公開","followUp.webhookUrl":"Webhook URL","followUp.includeContactData":"ペイロードに連絡先データを含める","followUp.search":"検索...","followUp.noLabels":"ラベルが見つかりません。まずWhatsAppでラベルを作成してください。","followUp.noTabs":"カスタムタブが見つかりません。タブバーからタブを作成してください。","followUp.noGroups":"WhatsAppグループが見つかりません。","followUp.noStages":"カンバンステージが見つかりません。まずCRMとステージを作成してください。","followUp.fluxoCategory":"カテゴリ","followUp.allCategories":"すべてのカテゴリ","followUp.uncategorized":"未分類","followUp.selectFluxo":"Fluxoを選択","followUp.chooseFluxo":"-- Fluxoを選択 --","followUp.fluxoInfo":"選択したチャットボットフローは、このフォローアップが実行されたときにトリガーされます。","followUp.messageText":"メッセージテキスト","followUp.templatesType":"テンプレートタイプ","followUp.tooltip.nameTitle":"フォローアップ名","followUp.tooltip.nameContent":"このフォローアップシーケンスを識別するための説明的な名前を付けてください。目的を説明する明確な名前を使用してください。","followUp.tooltip.nameExample":"例：「新規リード歓迎」、「支払いリマインダー」、「フィードバック依頼」","followUp.tooltip.categoryTitle":"カテゴリ","followUp.tooltip.categoryContent":"フォローアップをカテゴリに整理して、より良く管理できます。カテゴリを選択するか、未分類のままにしてください。","followUp.tooltip.funnelTitle":"ファネル設定 - どこでトリガーする？","followUp.tooltip.funnelContent":"このフォローアップシーケンスをトリガーするラベル、カスタムタブ、グループ、またはカンバンステージを選択します。連絡先が選択したファネルに入ると、フォローアップが開始されます。","followUp.tooltip.funnelExample":"例：「新規リード」ラベルを選択 → 連絡先がこのラベルを取得すると、フォローアップが自動的に開始されます。","followUp.tooltip.triggerTitle":"フォローアップトリガー - いつ開始する？","followUp.tooltip.triggerContent":"ファネルイベント後にフォローアップシーケンスがいつ開始するかを決定します。入場時：連絡先が入った時すぐに。退場時：連絡先が出た時。時間後：X時間待ってから開始。","followUp.tooltip.triggerExample":"例：「時間後」+ 2時間 = 連絡先がファネルに入ってから2時間後にフォローアップが開始されます。","followUp.tooltip.actionsTitle":"アクション - 何をする？","followUp.tooltip.actionsContent":"フォローアップがトリガーされた時に何が起こるかを定義します。すべてのアクションはトリガー時に実行されます。メッセージを追加、ラベルを変更、カンバンステージに移動、またはWebhookをトリガーします。","followUp.tooltip.actionsExample":"例：ウェルカムメッセージを送信 → 「連絡済み」ラベルを追加 → 「進行中」ステージに移動。","followUp.tooltip.rulesTitle":"トリガールール - 動作を制御","followUp.tooltip.rulesContent":"フォローアップの動作を設定します。返信時キャンセルはクライアントが返信すると停止します。グループを許可はグループチャットでの送信を有効にします。カスタム署名はメッセージの末尾にテキストを追加します。","followUp.tooltip.rulesExample":"ベストプラクティス：既に返信したクライアントへのスパムを避けるため、「返信時キャンセル」を有効にしてください。","followUp.tooltip.cancelOnReplyTitle":"クライアントが返信したらキャンセル","followUp.tooltip.cancelOnReplyContent":"連絡先がメッセージを送信すると、その連絡先の保留中のフォローアップメッセージをすべて自動的に停止します。これにより、既に返信した顧客への不要なフォローアップを防ぎます。","followUp.tooltip.cancelOnReplyExample":"• 有効：顧客が送信前に返信するとフォローアップが停止\n• 無効：顧客のメッセージに関係なくフォローアップが送信される","followUp.tooltip.allowGroupsTitle":"グループでの返信を許可","followUp.tooltip.allowGroupsContent":"このフォローアップがWhatsAppグループにメッセージを送信できるかどうかを制御します。デフォルトでは、フォローアップは個人の連絡先（1対1チャット）のみで機能します。","followUp.tooltip.allowGroupsExample":"• 有効：フォローアップは個人チャットとグループの両方で機能\n• 無効：フォローアップは個人の連絡先のみで機能","followUp.tooltip.signatureTitle":"署名をカスタマイズ","followUp.tooltip.signatureContent":"すべてのフォローアップメッセージの末尾にパーソナライズされた署名を追加します。ブランディングや自動化されたメッセージの識別に便利です。","followUp.tooltip.signatureExample":"例：「こんにちは、確認です！」が「こんにちは、確認です！\\n\\n~ CRMチーム」になります","followUp.tooltip.maxExecutionsTitle":"最大実行回数 - 何回？","followUp.tooltip.maxExecutionsContent":"このフォローアップが同じ連絡先にメッセージを送信できる回数を制御します。連絡先がこの制限に達すると、このフォローアップを再び受け取りません。","followUp.tooltip.maxExecutionsExample":"• 0に設定 = 無制限（制限なし）\n• 1に設定 = 連絡先ごとに1回のみ\n• 3に設定 = 連絡先は最大3回受信","followUp.tooltip.cooldownTitle":"クールダウン期間 - 再トリガー前の待機","followUp.tooltip.cooldownContent":"連絡先がこのフォローアップを受け取った後、再び受け取れるまでに何日待つか。これにより、同じ連絡先への繰り返しスパムを防ぎます。","followUp.tooltip.cooldownExample":"• 0に設定 = 待機なし（すぐに再トリガー可能）\n• 7に設定 = 再トリガーまで7日待機","followUp.tooltip.exampleLabel":"例：","followUp.tooltip.howToUseLabel":"使い方：","followUp.tooltip.bestPracticeLabel":"ベストプラクティス：","schedule.title":"予約メッセージ","schedule.addSchedule":"スケジュール追加","schedule.editSchedule":"スケジュール編集","schedule.schedulesCount":"スケジュール","schedule.noSchedules":"予約メッセージなし","schedule.noSchedulesDesc":"最初の予約メッセージを作成して始めましょう。","schedule.confirmDelete":"このスケジュールを削除してもよろしいですか？","schedule.inactive":"非アクティブ","schedule.once":"一回","schedule.repeated":"繰り返し","schedule.scheduleFor":"スケジュール対象","schedule.selectTarget":"連絡先またはグループを選択","schedule.searchContacts":"連絡先とグループを検索...","schedule.groups":"グループ","schedule.contacts":"連絡先","schedule.templateType":"テンプレートタイプ","schedule.message":"メッセージ","schedule.enterMessage":"メッセージを入力...","schedule.scheduleDateTime":"スケジュール日時","schedule.selectDateTime":"日時を選択してください","schedule.repeatedType":"繰り返しタイプ","schedule.repeatedType_minute":"分","schedule.repeatedType_hour":"時間","schedule.repeatedType_daily":"毎日","schedule.repeatedType_weekly":"毎週","schedule.repeatedType_monthly":"毎月","schedule.repeatedType_yearly":"毎年","schedule.everyMinutes":"X分ごと","schedule.everyHours":"X時間ごと","schedule.scheduleTime":"スケジュール時間","schedule.addTime":"時間を追加","schedule.startAndEndTime":"開始と終了時間","schedule.runAnytime":"いつでも実行","schedule.runBetween":"時間帯内で実行","schedule.endSchedule":"スケジュール繰り返し終了","schedule.never":"なし","schedule.afterCount":"繰り返し回数","schedule.completeOnDate":"指定日に完了","schedule.weekday_mon":"月曜日","schedule.weekday_tue":"火曜日","schedule.weekday_wed":"水曜日","schedule.weekday_thu":"木曜日","schedule.weekday_fri":"金曜日","schedule.weekday_sat":"土曜日","schedule.weekday_sun":"日曜日","schedule.month_jan":"1月","schedule.month_feb":"2月","schedule.month_mar":"3月","schedule.month_apr":"4月","schedule.month_may":"5月","schedule.month_jun":"6月","schedule.month_jul":"7月","schedule.month_aug":"8月","schedule.month_sep":"9月","schedule.month_oct":"10月","schedule.month_nov":"11月","schedule.month_dec":"12月","schedule.postActions":"アクション後","schedule.groupActions":"グループアクション","schedule.customTabActions":"カスタムタブアクション","schedule.labelsActions":"ラベルアクション","schedule.kanbanActions":"カンバンアクション","schedule.members":"メンバー","schedule.noContactsFound":"連絡先が見つかりません","schedule.noGroupsFound":"グループが見つかりません","schedule.loadingContacts":"連絡先を読み込み中...","schedule.loadingGroups":"グループを読み込み中...","schedule.selected":"選択済み","schedule.tooltip.scheduleFor":"予約メッセージを送信する連絡先またはグループを選択します。","schedule.tooltip.templateType":"メッセージの種類を選択：テキストのみ、メディア付き、投票、リスト、またはFluxoチャットボットフローをトリガー。","schedule.tooltip.message":"メッセージを入力します。{{name}}や{{phone}}などの変数でパーソナライズできます。","schedule.tooltip.dateTime":"メッセージの送信日時を設定します。繰り返しスケジュールの場合、これが開始日時です。","schedule.tooltip.repeatedType":"繰り返し頻度を選択：X分/時間ごと、毎日、毎週、毎月、または毎年。","schedule.tooltip.scheduleTimes":"複数の送信時間を追加します。+をクリックしてタイムスロットを追加。","schedule.tooltip.runBetween":"特定の時間帯に制限します。例：午前9時〜午後6時の間のみ送信。","schedule.tooltip.endSchedule":"繰り返しを停止するタイミングを選択：停止しない、X回後、または特定の日付。","schedule.tooltip.postActions":"送信後のアクション：グループ、タブ、ラベル、またはカンバンステージへの追加/削除。","gmaps.featureTitle":"G マップ抽出ツール","feature.gmapsExtractor":"G マップ抽出ツール","gmaps.panelHeader":"G マップ抽出ツール","gmaps.status.idle":"待機中","gmaps.status.running":"抽出中...","gmaps.status.stopped":"停止しました","gmaps.status.complete":"完了","gmaps.status.error":"停止しました","gmaps.statusLabel":"ステータス","gmaps.leadsFound":"リード：{{count}}","gmaps.leadsShort":"リード","gmaps.settings":"設定","gmaps.exportGroup":"エクスポートと送信","gmaps.noPhone":"電話なし","gmaps.showPanel":"パネルを表示","gmaps.hidePanel":"パネルを隠す","gmaps.maxResults":"最大件数","gmaps.unlimited":"無制限","gmaps.fetchEmails":"メールを取得","gmaps.fetchEmailsTooltip":"ウェブサイトのある各リードについて、バックグラウンドで開き、最初に見つかったメールアドレスを抽出します。1 件あたり約 3 秒追加され、帯域幅も多く使います。表示可能なメールがない、または読み込みに失敗した場合、そのリードのメール欄は空のままです。","gmaps.startBtn":"抽出を開始","gmaps.stopBtn":"停止","gmaps.clearBtn":"クリア","gmaps.exportCsv":"CSV エクスポート","gmaps.exportXlsx":"XLSX エクスポート","gmaps.sendToBroadcast":"ブロードキャストに送信","gmaps.previewTitle":"プレビュー","gmaps.moreRows":"さらに","gmaps.expand":"展開","gmaps.expandView":"全画面で表示","gmaps.clickExpand":"「展開」をクリックして詳細を表示","gmaps.clickExpandToSee":"「展開」をクリックしてすべて表示","gmaps.col.name":"名前","gmaps.col.phone":"電話","gmaps.col.website":"ウェブサイト","gmaps.col.address":"住所","gmaps.col.category":"カテゴリ","gmaps.col.rating":"評価","gmaps.noLeadsYet":"まだリードはありません — Google マップで検索してから「開始」をクリックしてください","gmaps.stopReason.userStop":"ユーザーによって停止","gmaps.stopReason.endOfResults":"Google マップの結果の末尾に到達","gmaps.stopReason.captcha":"Google の認証コードが検出されました — 解決してから再度「開始」をクリックしてください","gmaps.stopReason.noFeed":"Google マップの検索結果が見つかりません — 先に検索を実行してください","gmaps.stopReason.noNewResults":"新しい結果が読み込まれません（Google がデータの返却を停止しました）","gmaps.stopReason.maxReached":"最大件数の上限に達しました","gmaps.stopReason.tabClosed":"タブが閉じられました","gmaps.stopReason.error":"エラー","gmaps.toast.searchFirst":"先に Google マップで検索を実行してから「開始」をクリックしてください。","gmaps.toast.csvReady":"CSV をダウンロードしました","gmaps.toast.xlsxReady":"Excel ファイルをダウンロードしました","gmaps.toast.noPhones":"有効な電話番号がありません — 何も送信されませんでした。","gmaps.toast.sentPartial":"{{sent}} 件の連絡先をブロードキャストに送信 · {{dropped}} 件をスキップ（電話なし）","gmaps.toast.sentAll":"{{sent}} 件の連絡先をブロードキャストに送信しました","gmaps.toast.broadcastFail":"ブロードキャストへの送信に失敗しました。コンソールを確認してください。","gmaps.toast.draftRestored":"前回のセッションを復元しました","gmaps.toast.draftRestoredN":"前回のセッションから {{n}} 件のリードを復元しました"},de:{"common.loading":"Laden...","common.close":"Schließen","common.cancel":"Abbrechen","common.save":"Speichern","common.copy":"Kopieren","common.copied":"Kopiert!","common.choose":"Wählen","common.add":"Hinzufügen","common.edit":"Bearbeiten","common.delete":"Löschen","common.back":"Zurück","quickReply.title":"Schnellantwort","quickReply.addButton":"+ Hinzufügen","quickReply.allCategories":"Alle Kategorien","quickReply.postActions":"Nachfolgende Aktionen","quickReply.groupActions":"Gruppenaktionen","quickReply.customTabActions":"Tab-Aktionen","quickReply.labelsActions":"Label-Aktionen","quickReply.kanbanBoardActions":"Kanban-Aktionen","quickReply.addToGroups":"Zu Gruppen hinzufügen","quickReply.removeFromGroups":"Aus Gruppen entfernen","quickReply.addToTabs":"Zu Tabs hinzufügen","quickReply.removeFromTabs":"Aus Tabs entfernen","quickReply.addLabels":"Labels hinzufügen","quickReply.removeLabels":"Labels entfernen","quickReply.addToStage":"Zur Stufe hinzufügen","quickReply.removeFromStage":"Von Stufe entfernen","quickReply.selectGroups":"Gruppen auswählen...","quickReply.selectTabs":"Tabs auswählen...","quickReply.selectLabels":"Labels auswählen...","quickReply.selectCrmStage":"CRM & Stufe auswählen...","quickReply.noGroupsAvailable":"Keine Gruppen verfügbar","quickReply.noTabsAvailable":"Keine Tabs verfügbar","quickReply.noLabelsAvailable":"Keine Labels verfügbar","quickReply.noKanbanAvailable":"Keine Kanban-CRMs verfügbar","quickReply.editBeforeSending":"Vor dem Senden bearbeiten","quickReply.editBeforeSendingDesc":"Nachricht vor dem Senden bearbeiten","actionSidebar.title":"Schnellaktionen","actionSidebar.quickReply":"Schnellantwort","actionSidebar.flow":"Flow","actionSidebar.search":"Suchen...","actionSidebar.filter":"Filter","actionSidebar.all":"Alle","actionSidebar.byType":"Nach Typ","actionSidebar.noCategory":"Keine Kategorie","actionSidebar.byCategory":"Nach Kategorie","actionSidebar.mostUsed":"Häufig verwendet","actionSidebar.send":"Senden","actionSidebar.trigger":"Auslösen","actionSidebar.noItemsFound":"Keine Elemente gefunden","actionSidebar.selectChatFirst":"Wähle zuerst einen Chat","actionSidebar.uncategorized":"Unkategorisiert","actionSidebar.editAndSend":"Bearbeiten & Senden","actionSidebar.clickToCancel":"Klicken zum Abbrechen","actionSidebar.cancel":"Abbrechen","actionSidebar.sending":"Senden...","header.activateLicense":"Lizenz aktivieren",broadcastTitle:"Massennachricht",kanbanTitle:"Kanban CRM öffnen","profile.title":"Profil","profile.deviceName":"Gerätename","profile.expires":"Läuft ab","profile.manageLicenseKey":"Lizenzschlüssel verwalten","profile.settings":"Einstellungen","profile.watchTutorial":"Tutorial ansehen","profile.language":"Sprache","profile.privacyPolicy":"Datenschutzrichtlinie","profile.contactUs":"Kontaktieren Sie uns","profile.website":"Webseite","profile.premium":"Premium","profile.notActivated":"Nicht aktiviert","profile.activateToContinue":"Lizenz aktivieren","settings.menuFeatures":"Menüfunktionen","settings.menuFeaturesDesc":"Aktivieren oder deaktivieren Sie Funktionen nach Bedarf","settings.interfaceOptions":"Oberflächenoptionen","settings.featureDockLabel":"Linke Funktionsleiste","settings.featureDockDesc":"Am linken Rand eine Verknüpfungsleiste anzeigen, wenn ein Popup geöffnet ist","feature.tabs":"Tab-Verwaltung","feature.templates":"Vorlagen","feature.quickReply":"Schnellantwort","feature.kanban":"Kanban CRM","feature.chatbotFlow":"Chatbot-Flow","feature.followUp":"Nachverfolgung","feature.broadcast":"Massenversand","feature.calendar":"Planungszentrum","feature.status":"Status","feature.validator":"Validator","feature.webhook":"Webhook","feature.api":"API","feature.aiBot":"KI-Bot","feature.open":"Öffnen","license.activateTitle":"Aktivieren Sie Ihre Lizenz","license.licenseKey":"Lizenzschlüssel","license.phoneNumber":"Telefonnummer","license.phoneDetected":"Erkannte Telefonnummer","license.planName":"Planname","license.endDate":"Enddatum","license.expiresIn":"Läuft ab in","license.days":"Tage","license.daysLeft":"Tage übrig","license.status":"Status","license.deactivateLicense":"Lizenz deaktivieren","license.deactivateConfirm":"Möchten Sie Ihre Lizenz wirklich deaktivieren?","license.activateLicenseBtn":"Lizenz aktivieren","license.validating":"Validierung...","license.pasteLicenseHere":"Fügen Sie Ihren Lizenzschlüssel hier ein...","license.completeLicenseKey":"Fügen Sie den vollständigen Lizenzschlüssel ein, den Sie per E-Mail erhalten haben","trial.starting":"Ihre 7-tägige kostenlose Testversion wird gestartet...","trial.activated":"7-tägige kostenlose Testversion aktiviert!","trial.daysRemaining":"{0} Tage verbleibend in der Testversion","trial.expired":"Testversion abgelaufen. Bitte kaufen Sie eine Lizenz.","trial.alreadyUsed":"Testversion für diese Nummer bereits verwendet. Geben Sie einen Lizenzschlüssel ein, um fortzufahren.","license.waitForWhatsApp":"Bitte warten Sie, bis WhatsApp vollständig geladen ist","license.securityFooter":"Geschützt durch WebAssembly-Kryptographie-Validierung","planDetails.title":"Plandetails","planDetails.licenceKey":"Lizenzschlüssel","planDetails.planName":"Planname","planDetails.endDate":"Enddatum","planDetails.removeKey":"Schlüssel entfernen","planDetails.changeKey":"Schlüssel ändern","features.enabledFeatures":"Aktivierte Funktionen","languages.en":"English (Englisch)","languages.zh":"中文 (Chinesisch)","languages.es":"Español (Spanisch)","languages.fr":"Français (Französisch)","languages.ar":"العربية (Arabisch)","languages.pt":"Português (Portugiesisch)","languages.ru":"Русский (Russisch)","languages.ja":"日本語 (Japanisch)","languages.de":"Deutsch","licenseInfo.title":"Lizenzinformationen","licenseInfo.phoneNumber":"Telefonnummer","licenseInfo.expiresIn":"Läuft ab in","licenseInfo.status":"Status","errors.invalidFormat":"Ungültiges Lizenzschlüsselformat oder Validierung fehlgeschlagen","errors.serverError":"Serverfehler aufgetreten","errors.networkError":"Netzwerkfehler. Bitte überprüfen Sie Ihre Verbindung","tabs.tabs":"Tabs","tabs.manageTabs":"Tabs verwalten","tabs.addTab":"Tab hinzufügen","tabs.editTab":"Tab bearbeiten","tabs.deleteTab":"Tab löschen","tabs.tabTitle":"Tab-Titel","tabs.tabDetails":"Tab-Details","tabs.enterTabTitle":"Tab-Titel eingeben","tabs.enterTabDetails":"Tab-Details eingeben","tabs.chooseFrom":"Auswählen von","tabs.chat":"Chat","tabs.groups":"Gruppen","tabs.label":"Label","tabs.searchHere":"Hier suchen","tabs.selectAll":"Alle auswählen","tabs.clearAll":"Alle löschen","tabs.selected":"Ausgewählt","tabs.allChats":"Alle Chats","tabs.chats":"Chats","tabs.noFilterApplied":"Kein Filter angewendet","tabs.view":"Ansehen","tabs.edit":"Bearbeiten","tabs.delete":"Löschen","tabs.hideFromTabBar":"Aus Tab-Leiste ausblenden","tabs.showInTabBar":"In Tab-Leiste anzeigen","tabs.sort":"Sortieren","tabs.title":"Titel","tabs.details":"Details","tabs.action":"Aktion","tabs.selectLabel":"Label auswählen","tabs.chooseALabel":"-- Wählen Sie ein Label --","tabs.selectedLabel":"Ausgewähltes Label","tabs.change":"Ändern","tabs.pleaseSelectLabel":"Bitte wählen Sie ein Label aus der Dropdown-Liste oben","tabs.areYouSureDeleteTab":"Möchten Sie diesen Tab wirklich löschen?","tabs.tabDeletedSuccessfully":"Tab erfolgreich gelöscht","tabs.cancel":"Abbrechen","tabs.save":"Speichern","tabs.all":"Alle","tabs.oneToOne":"1:1","tabs.individualChats":"Nur Einzelchats","tabs.groupChats":"Nur Gruppenchats","tabs.unread":"Ungelesen","tabs.unreadChats":"Nur ungelesene Chats","tabs.unsaved":"Nicht gespeichert","tabs.unsavedContacts":"Nur nicht gespeicherte Kontakte","templates.title":"Nachrichtenvorlagen","templates.manageTemplates":"Vorlagen verwalten","templates.newTemplate":"Neue Vorlage","templates.editTemplate":"Vorlage bearbeiten","templates.sendTemplate":"Vorlage senden","templates.deleteTemplate":"Vorlage löschen","templates.duplicateTemplate":"Vorlage duplizieren","templates.activateTemplate":"Aktivieren","templates.deactivateTemplate":"Deaktivieren","templates.total":"Gesamt","templates.active":"Aktiv","templates.inactive":"Inaktiv","templates.filterAll":"Alle","templates.filterActive":"Nur Aktive","templates.filterInactive":"Nur Inaktive","templates.filterAllTypes":"Alle Typen","templates.templates":"Vorlagen","templates.searchPlaceholder":"Vorlagen suchen...","templates.noTemplates":"Keine Vorlagen gefunden","templates.createFirst":"Erstellen Sie Ihre erste Vorlage","templates.edit":"Bearbeiten","templates.copy":"Kopieren","templates.msgs":"Nachrichten","templates.noMessageContent":"Kein Nachrichteninhalt","templates.form.templateName":"Vorlagenname","templates.form.templateNamePlaceholder":"Vorlagennamen eingeben","templates.form.templateFor":"Vorlage für","templates.form.message":"Nachricht","templates.form.messagePlaceholder":"Geben Sie hier Ihre Nachricht ein...","templates.form.insertVariable":"Klicken Sie, um Variable einzufügen:","templates.form.personalizeValue":"Personalisierungswert","templates.form.personalizeValueHint":"Senden Sie an Ihre ausgewählten Personen mit personalisierten Werten wie @variable1, @variable2 usw.","templates.form.templatesType":"Vorlagentyp","templates.form.templateType":"Vorlagentyp","templates.form.templateStatus":"Vorlagenstatus","templates.form.statusOn":"An","templates.form.statusOff":"Aus","templates.form.statusHint":'Wenn der Vorlagenstatus "an" ist, ist sie verfügbar. Umgekehrt, wenn der Vorlagenstatus "aus" ist, befindet sie sich in einem gespeicherten Zustand.',"templates.form.on":"Ein","templates.form.off":"Aus","templates.form.save":"Speichern","templates.form.cancel":"Abbrechen","templates.form.selectProducts":"Produkte auswählen","templates.form.selectContacts":"Kontakte auswählen","templates.form.addProduct":"Produkt hinzufügen","templates.form.addContact":"Kontakt hinzufügen","templates.form.buttons":"Schaltflächen","templates.form.addButton":"Schaltfläche hinzufügen","templates.form.buttonsHint":"Maximal 3 Schaltflächen erlaubt","templates.form.selectFromContacts":"Aus Kontakten auswählen","templates.form.addManually":"Manuell hinzufügen","templates.form.productHint":"Produkte aus Ihrem WhatsApp Business-Katalog","templates.form.attachImages":"Bilder/Videos anhängen","templates.form.attachAudio":"Audio anhängen","templates.form.attachDocuments":"Dokumente anhängen","templates.form.chooseFile":"Datei auswählen","templates.form.maxFileSize":"Maximale Dateigröße: 16MB (WhatsApp-Limit)","templates.form.uploading":"Wird hochgeladen...","templates.errors.uploadFailed":"Datei-Upload fehlgeschlagen. Bitte erneut versuchen.","templates.errors.fileTooLarge":"Die Datei ist zu groß. Maximale Größe: 16MB (WhatsApp-Limit).","templates.form.listButtonText":"Schaltflächentext","templates.form.listButtonTextPlaceholder":"Schaltflächentext eingeben","templates.form.listDescription":"Beschreibung","templates.form.listDescriptionPlaceholder":"Beschreibung eingeben","templates.form.listSections":"Abschnitte","templates.form.pollQuestion":"Umfragefrage","templates.form.pollQuestionPlaceholder":"Geben Sie Ihre Umfragefrage ein","templates.form.allowMultipleAnswers":"Mehrfachantworten erlauben","templates.form.allowMultipleAnswersHint":"Benutzer können mehrere Optionen auswählen","templates.form.pollOptions":"Umfrageoptionen","templates.form.addOption":"+ Option hinzufügen","templates.form.pollOptionsHint":"Minimum 2, Maximum 12 Optionen","templates.messageType.individual":"Eins zu Eins","templates.messageType.tab":"Tab","templates.messageType.group":"Gruppe","templates.messageType.label":"Label","templates.messageType.kanban":"Kanban","templates.messageType.quickReply":"⚡ Schnellantwort","templates.attachmentType.none":"Nur Nachricht","templates.attachmentType.imageVideo":"Nachricht + Bilder/Videos","templates.attachmentType.document":"Nachricht + Dokumente","templates.attachmentType.audio":"Nachricht + Audio","templates.attachmentType.contact":"Nachricht + Kontakte","templates.attachmentType.poll":"Nachricht + Umfrage","templates.attachmentType.list":"Nachricht + Liste","templates.attachmentType.product":"Nachricht + Produkte","templates.attachmentType.buttons":"Nachricht + Schaltflächen","crm.button":"CRM","crm.openCRM":"CRM öffnen","crm.profile":"Profil","crm.tabs":"Registerkarten","crm.notes":"Notizen","crm.reminder":"Erinnerung","crm.appointment":"Termin","crm.income":"Einnahmen","crm.expense":"Ausgaben","crm.scheduleTab":"Zeitplan","crm.deletedMessagesTab":"Gelöschte Nachrichten","crm.antiRevokeEnabled":"Anti-Revoke ist AN","crm.antiRevokeDisabled":"Anti-Revoke ist AUS","crm.antiRevokeDescription":"Speichert eingehende Nachrichten lokal, damit du sie auch dann sehen kannst, wenn der Absender sie löscht.","crm.antiRevokeNotEnabledHint":"Aktiviere Anti-Revoke oben, um eingehende Nachrichten zu speichern.","crm.noDeletedMessages":"Noch keine gelöschten Nachrichten wiederhergestellt. Wir beobachten — sobald jemand eine Nachricht löscht, speichern wir hier eine Kopie.","crm.onlyThisContact":"Nur dieser Kontakt","crm.allContacts":"Alle Kontakte","crm.clearHistory":"Verlauf löschen","crm.exportCSV":"CSV exportieren","crm.revokedAt":"Gelöscht am","crm.copyMessage":"Kopieren","crm.lionRecovered":"Von {brand} wiederhergestellt","crm.clickToShowOriginal":"Klicken, um das Original anzuzeigen","crm.antiRevokeChatTip":"Tipp: Du kannst auch direkt im Chat auf das Wiederherstellen-Symbol einer gelöschten Nachricht klicken, um sie schnell anzuzeigen.","crm.searchMessages":"Nachrichten suchen…","crm.recoveredCount":"{count} wiederhergestellte Nachricht(en)","crm.confirmClearChatHistory":"Wiederhergestellte Nachrichten für diesen Kontakt löschen?","crm.confirmClearAllHistory":"ALLE wiederhergestellten Nachrichten aus sämtlichen Chats löschen?","crm.noTextContent":"(kein Text — Mediennachricht)","crm.group":"Gruppe","crm.enable":"Aktivieren","crm.disable":"Deaktivieren","crm.addScheduleMessage":"Zeitplan hinzufügen","crm.noScheduledMessages":"Keine geplanten Nachrichten","crm.noScheduledMessagesDesc":"Planen Sie Nachrichten für diesen Kontakt.","crm.userDetails":"Benutzerdetails","crm.addCustomAttribute":"+ Attribut hinzufügen","crm.edit":"Bearbeiten","crm.cancel":"Abbrechen","crm.save":"Speichern","crm.signature":"Signatur","crm.signatureDesc":"Geben Sie Ihren Namen ein, um signierte Nachrichten zu senden oder anderen Agenten anzuzeigen, dass Sie im spezifischen Chat im Dienst sind.","crm.enterYourName":"Geben Sie Ihren Namen ein","crm.activateSignature":"Signatur aktivieren","crm.signatureAs":"Signiert als","crm.signatureNotSet":"Legen Sie Ihren Signaturnamen in den WhatsApp Web-Erweiterungseinstellungen fest.","crm.delete":"Löschen","crm.deleteConnection":"Verbindung löschen?","crm.deleteConnectionConfirm":"Sind Sie sicher, dass Sie diese Verbindung zwischen Knoten löschen möchten?","crm.fullName":"Vollständiger Name","crm.phoneNumber":"Telefonnummer","crm.email":"E-Mail","crm.gender":"Geschlecht","crm.dateOfBirth":"Geburtsdatum","crm.details":"Details","crm.address":"Adresse","crm.language":"Sprache","crm.male":"Männlich","crm.female":"Weiblich","crm.other":"Andere","crm.select":"- Auswählen -","crm.customAttributes":"Benutzerdefinierte Attribute","crm.addField":"Feld hinzufügen","crm.fieldLabel":"Feldbezeichnung","crm.fieldValue":"Feldwert","crm.noCustomFields":"Keine benutzerdefinierten Felder","crm.deleteFieldConfirm":"Möchten Sie dieses Feld wirklich löschen?","crm.contactTabs":"Kontakt-Registerkarten","crm.addToTab":"Zur Registerkarte hinzufügen","crm.removeFromTab":"Von Registerkarte entfernen","crm.noTabs":"Keine Registerkarten erstellt","crm.createTab":"Registerkarte erstellen","crm.tabName":"Registerkartenname","crm.contacts":"Kontakte","crm.addToLabel":"Zum Label hinzufügen","crm.selectLabel":"Label auswählen","crm.noLabelsAvailable":"Keine Labels verfügbar. Erstellen Sie zuerst eine Registerkarte.","crm.labelsAndStages":"Labels & Stufen","crm.whatsappLabels":"WhatsApp Labels","crm.customTabs":"Benutzerdefinierte Tabs","team.button":"Team","team.shareWith":"Mit Team teilen","team.settings":"Team-Einstellungen","team.addMember":"Mitglied hinzufügen","team.editMember":"Mitglied bearbeiten","team.deleteMember":"Löschen","team.memberName":"Mitgliedsname","team.memberPhone":"Telefonnummer","team.department":"Abteilung","team.departmentPlaceholder":"z.B. Vertrieb, Finanzen, Support","team.template":"Nachrichtenvorlage","team.templatePlaceholder":"Nachricht mit Variablen eingeben...","team.noMembers":"Keine Teammitglieder konfiguriert","team.clickToAdd":"Klicken Sie auf +, um Mitglieder hinzuzufügen","team.sending":"Senden...","team.insertVariable":"Variable einfügen","team.preview":"Nachricht Vorschau","team.deleteConfirm":"Möchten Sie dieses Teammitglied wirklich löschen?","team.phonePlaceholder":"z.B. +499876543210","team.namePlaceholder":"z.B. Vertrieb - Max","team.variableHint":"Verwenden Sie {{name}}, {{phone}}, {{labels}} usw. für dynamischen Inhalt","team.save":"Speichern","team.cancel":"Abbrechen","team.editTemplate":"Vorlage bearbeiten","team.saveAndSend":"Speichern & Senden","team.sendOnce":"Einmal senden","team.send":"Senden","team.popupTitle":"Mit Team teilen","team.popupSubtitle":"Kontaktdaten sofort senden","team.noTeamMembers":"Keine Mitglieder","team.noTeamMembersDesc":"Fügen Sie Teammitglieder hinzu, um Kontakte schnell über WhatsApp zu teilen","crm.addNote":"+ Notiz hinzufügen","crm.searchNotes":"Notizen suchen...","crm.noNotes":"Keine Notizen","crm.addFirstNote":"Erste Notiz hinzufügen","crm.topic":"Thema","crm.content":"Inhalt","crm.editNote":"Notiz bearbeiten","crm.deleteNote":"Notiz löschen","crm.deleteNoteConfirm":"Möchten Sie diese Notiz wirklich löschen?","crm.addReminder":"+ Erinnerung hinzufügen","crm.noReminders":"Keine Erinnerungen","crm.addFirstReminder":"Erste Erinnerung hinzufügen","crm.reminderTopic":"Erinnerungsthema","crm.dateTime":"Datum & Uhrzeit","crm.repeatInterval":"Wiederholungsintervall","crm.noRepeat":"Keine Wiederholung","crm.every5Min":"Alle 5 Minuten","crm.every10Min":"Alle 10 Minuten","crm.every15Min":"Alle 15 Minuten","crm.every30Min":"Alle 30 Minuten","crm.every1Hour":"Jede Stunde","crm.status":"Status","crm.pending":"Ausstehend","crm.completed":"Abgeschlossen","crm.dismissed":"Verworfen","crm.stopped":"Gestoppt","crm.snoozed":"Schlummern","crm.due":"Fällig","crm.editReminder":"Erinnerung bearbeiten","crm.deleteReminder":"Erinnerung löschen","crm.markComplete":"Als erledigt markieren","crm.snooze":"Schlummern","crm.stop":"Stoppen","crm.addAppointment":"+ Termin hinzufügen","crm.noAppointments":"Keine Termine","crm.addFirstAppointment":"Ersten Termin hinzufügen","crm.appointmentTitle":"Termintitel","crm.attendee":"Teilnehmer","crm.googleMeetLink":"Google Meet Link","crm.generateLink":"Link generieren","crm.messageTemplate":"Nachrichtenvorlage","crm.reminderBefore":"Erinnerung vorher","crm.sendMessageNow":"Nachricht jetzt senden","crm.scheduled":"Geplant","crm.cancelled":"Abgesagt","crm.missed":"Verpasst","crm.editAppointment":"Termin bearbeiten","crm.deleteAppointment":"Termin löschen","crm.joinMeeting":"Meeting beitreten","crm.before5Min":"5 Minuten vorher","crm.before10Min":"10 Minuten vorher","crm.before15Min":"15 Minuten vorher","crm.before30Min":"30 Minuten vorher","crm.before1Hour":"1 Stunde vorher","crm.before2Hours":"2 Stunden vorher","crm.before1Day":"1 Tag vorher","crm.titleLabel":"Titel","crm.scheduleDateTime":"Datum & Uhrzeit planen","crm.pasteGoogleMeetLink":"Google Meet-Link hier einfügen","crm.generateLinkHint":"Klicken Sie auf 'Link generieren', um Google Meet zu öffnen, und fügen Sie dann den Meeting-Link hier ein","crm.chooseTemplate":"Vorlage auswählen","crm.selectTemplate":"-- Vorlage auswählen --","crm.messageTemplatePlaceholder":"Nachrichtenvorlage eingeben...","crm.useSameMessage":"Gleiche Nachricht bei Meeting-Beginn verwenden","crm.meetingStartMessageLabel":"Meeting-Start-Nachricht","crm.meetingStartPlaceholder":"Nachricht für Meeting-Beginn eingeben...","crm.meetingStartHint":"Diese Nachricht wird gesendet, wenn das Meeting tatsächlich beginnt.","crm.sendReminderLabel":"Erinnerung senden","crm.reminderTimeHint":"Die Nachricht wird zu diesem Zeitpunkt vor dem Meeting an die Teilnehmer gesendet. Sie erhalten auch eine Tonbenachrichtigung.","crm.sendMessageNowTo":"Nachricht jetzt senden an","crm.sendNowHint":"Aktivieren Sie dies, um die Terminnachricht sofort nach dem Speichern zu senden","crm.discard":"Verwerfen","crm.saveAndSend":"Speichern & Senden","crm.sending":"Wird gesendet...","crm.noAppointmentsFound":"Keine Termine gefunden","crm.searchAppointments":"Termine suchen","crm.productDemoCall":"z.B. Produktdemo-Anruf","crm.reminderMessageHint":"Diese Nachricht wird zur Erinnerungszeit (vor dem Meeting) gesendet.","crm.joinMeet":"Meet beitreten","crm.appointmentTemplates":"Terminvorlagen","crm.savedTemplates":"Gespeicherte Vorlagen","crm.noTemplatesYet":"Noch keine Vorlagen. Erstellen Sie Ihre erste Vorlage!","crm.newTemplate":"+ Neue Vorlage","crm.editTemplateTitle":"Vorlage bearbeiten","crm.newTemplateTitle":"Neue Vorlage","crm.templateName":"Vorlagenname","crm.templateNamePlaceholder":"z.B. Meeting-Erinnerung","crm.meetLinkOptional":"Google Meet-Link (Optional)","crm.updateTemplate":"Vorlage aktualisieren","crm.saveTemplate":"Vorlage speichern","crm.pleaseEnterTitle":"Bitte geben Sie einen Titel ein","crm.pleaseSelectFutureDate":"Bitte wählen Sie ein zukünftiges Datum und Uhrzeit","crm.deleteAppointmentConfirm":"Sind Sie sicher, dass Sie diesen Termin löschen möchten?","crm.pleaseEnterTemplateName":"Bitte geben Sie einen Vorlagennamen ein","crm.pleaseEnterMessageTemplate":"Bitte geben Sie eine Nachrichtenvorlage ein","crm.deleteTemplateConfirm":"Sind Sie sicher, dass Sie diese Vorlage löschen möchten?","crm.addIncome":"+ Einnahme hinzufügen","crm.totalIncome":"Gesamteinnahmen","crm.pendingIncome":"Ausstehend","crm.filteredTotal":"Gefilterte Summe","crm.noIncome":"Keine Einnahmen","crm.addFirstIncome":"Erste Einnahme hinzufügen","crm.amount":"Betrag","crm.category":"Kategorie","crm.paymentMethod":"Zahlungsmethode","crm.description":"Beschreibung","crm.reference":"Referenz","crm.date":"Datum","crm.paymentReceived":"Zahlung erhalten","crm.sale":"Verkauf","crm.serviceFee":"Servicegebühr","crm.commission":"Provision","crm.refundReceived":"Erstattung erhalten","crm.cash":"Bargeld","crm.bankTransfer":"Banküberweisung","crm.upi":"UPI","crm.pix":"PIX","crm.card":"Karte","crm.cheque":"Scheck","crm.addCustomPaymentMethod":"Eigene Methode hinzufügen","crm.editIncome":"Einnahme bearbeiten","crm.deleteIncome":"Einnahme löschen","crm.addExpense":"+ Ausgabe hinzufügen","crm.totalExpense":"Gesamtausgaben","crm.pendingExpense":"Ausstehend","crm.noExpense":"Keine Ausgaben","crm.addFirstExpense":"Erste Ausgabe hinzufügen","crm.purchase":"Einkauf","crm.serviceCost":"Servicekosten","crm.travel":"Reise","crm.marketing":"Marketing","crm.commissionPaid":"Provision bezahlt","crm.refundGiven":"Erstattung gegeben","crm.editExpense":"Ausgabe bearbeiten","crm.deleteExpense":"Ausgabe löschen","crm.search":"Suchen...","crm.all":"Alle","crm.today":"Heute","crm.thisWeek":"Diese Woche","crm.thisMonth":"Diesen Monat","crm.thisYear":"Dieses Jahr","crm.filterByCategory":"Nach Kategorie filtern","crm.filterByStatus":"Nach Status filtern","crm.filterByDate":"Nach Datum filtern","crm.allStatus":"Alle Status","crm.allCategories":"Alle Kategorien","crm.none":"Keine","crm.ref":"Ref","crm.tableTabName":"Tab-Name","crm.tableContactsInTab":"Kontakte im Tab","crm.tableAction":"Aktion","crm.tableName":"Name","crm.tableModifiedDate":"Änderungsdatum","crm.tableTopic":"Thema","crm.tableReminderDate":"Erinnerungsdatum","crm.tableRepeatSnooze":"Wiederholen/Schlummern","crm.tableStatus":"Status","crm.tableTitle":"Titel","crm.tableDateTime":"Datum & Zeit","crm.tableAttendee":"Teilnehmer","crm.tableMeetLink":"Meet-Link","crm.tableDescription":"Beschreibung","crm.tableCategory":"Kategorie","crm.tableAmount":"Betrag","crm.tablePayment":"Zahlung","crm.tableDate":"Datum","crm.addIncomeTitle":"Einnahme hinzufügen","crm.editIncomeTitle":"Einnahme bearbeiten","crm.addExpenseTitle":"Ausgabe hinzufügen","crm.editExpenseTitle":"Ausgabe bearbeiten","crm.enterAmount":"Betrag eingeben","crm.validAmountRequired":"Bitte geben Sie einen gültigen Betrag ein","crm.descriptionRequired":"Bitte geben Sie eine Beschreibung ein","crm.referenceInvoice":"Referenz / Rechnungs-Nr.","crm.referenceBill":"Referenz / Beleg-Nr.","crm.invoicePlaceholder":"z.B. INV-001","crm.billPlaceholder":"z.B. BILL-001","crm.paymentDescription":"z.B. Zahlung für Dienstleistungen","crm.expenseDescription":"z.B. Bürobedarf","crm.update":"Aktualisieren","crm.addIncomeBtn":"Einnahme hinzufügen","crm.addExpenseBtn":"Ausgabe hinzufügen","crm.recurringTransaction":"Wiederkehrende Transaktion","crm.repeatEvery":"Wiederholen alle","crm.neverEnds":"Endet nie","crm.endDate":"Enddatum","crm.daily":"Täglich","crm.weekly":"Wöchentlich","crm.monthly":"Monatlich","crm.quarterly":"Vierteljährlich (3 Monate)","crm.yearly":"Jährlich","crm.currencySettings":"Währungseinstellungen","crm.searchCurrency":"Währung suchen...","crm.noCurrenciesFound":"Keine Währungen gefunden","crm.noIncomeRecords":"Keine Einnahmen gefunden","crm.noExpenseRecords":"Keine Ausgaben gefunden","crm.deleteIncomeConfirm":"Sind Sie sicher, dass Sie diesen Einnahmeeintrag löschen möchten?","crm.deleteExpenseConfirm":"Sind Sie sicher, dass Sie diesen Ausgabeneintrag löschen möchten?","crm.addCategory":"Kategorie hinzufügen","crm.categoryName":"Kategoriename","crm.enterCategoryName":"Kategoriename eingeben","crm.customCategories":"Benutzerdefinierte Kategorien","crm.addCustomCategory":"Benutzerdefinierte Kategorie hinzufügen","crm.existingCustomCategories":"Vorhandene benutzerdefinierte Kategorien","crm.addStatus":"Status hinzufügen","crm.statusName":"Statusname","crm.enterStatusName":"Statusname eingeben","crm.customStatuses":"Benutzerdefinierte Status","crm.addCustomStatus":"Benutzerdefinierten Status hinzufügen","crm.existingCustomStatuses":"Vorhandene benutzerdefinierte Status","crm.add":"Hinzufügen","crm.loading":"Laden...","crm.dismiss":"Verwerfen","crm.yesterday":"Gestern","agent.agentMode":"Agentenmodus","agent.identifyAsAgent":"Als Agent identifizieren","agent.agentName":"Agentenname","agent.namePlaceholder":"z.B. Max, Support-Team 1","agent.agentNamePlaceholder":"Geben Sie Ihren Agentennamen ein","agent.viewTransferHistory":"Übertragungsverlauf anzeigen","agent.transferToAgent":"An Agent übertragen","agent.transferSuccess":"Chat erfolgreich übertragen","agent.noAgentsOnline":"Keine Agenten online verfügbar","agent.selectAgent":"Agent auswählen","agent.chooseAgent":"-- Wählen Sie einen Agenten --","agent.reason":"Grund","agent.reasonPlaceholder":"Warum übertragen Sie diesen Chat?","agent.priority":"Priorität","agent.priorityLow":"Niedrig","agent.priorityMedium":"Mittel","agent.priorityHigh":"Hoch","agent.priorityUrgent":"Dringend","agent.transfer":"Übertragen","agent.incomingTransfer":"Eingehende Übertragung","agent.fromAgent":"Von Agent","agent.toAgent":"An Agent","agent.chat":"Chat","agent.startService":"Service starten","agent.endService":"Service beenden","agent.activeService":"Aktiver Service","agent.from":"Von","agent.to":"An","agent.duration":"Dauer","agent.transferHistory":"Übertragungsverlauf","agent.sent":"Gesendet","agent.received":"Empfangen","agent.status":"Status","agent.all":"Alle","agent.statusPending":"Ausstehend","agent.statusAccepted":"Akzeptiert","agent.statusInService":"Im Service","agent.statusCompleted":"Abgeschlossen","agent.statusDeclined":"Abgelehnt","agent.statusExpired":"Abgelaufen","agent.noTransfers":"Keine Übertragungen gefunden","agent.serviceQueue":"Service-Warteschlange","agent.pendingTransfers":"Ausstehende Übertragungen","agent.activeServices":"Aktive Services","agent.sentTransfers":"Gesendete Übertragungen","agent.noActiveServices":"Keine aktiven Services oder ausstehenden Übertragungen","agent.serviceEnded":"Service erfolgreich beendet","agent.accept":"Akzeptieren","agent.decline":"Ablehnen","agent.notRegistered":"Agent nicht registriert. Bitte aktivieren Sie zuerst den Agentenmodus.","agent.statusCancelled":"Abgebrochen","agent.started":"Gestartet","chatTools.suggest":"Vorschlagen","chatTools.spelling":"Rechtschreibung","chatTools.translate":"Übersetzen","chatTools.summarize":"Zusammenfassen","chatTools.enlarge":"Erweitern","chatTools.friendly":"Freundlich","chatTools.formal":"Formell","chatTools.send":"Senden","chatTools.copy":"Kopieren","chatTools.use":"Verwenden","chatTools.aiResult":"KI-Ergebnis","chatTools.suggestTitle":"KI-Vorschlag","chatTools.spellingTitle":"Rechtschreibung und Grammatik korrigieren","chatTools.translateTitle":"Übersetzen in","chatTools.summarizeTitle":"Text zusammenfassen","chatTools.enlargeTitle":"Text erweitern","chatTools.friendlyTitle":"Freundlich machen","chatTools.formalTitle":"Formell machen","chatTools.conversationSummary":"Chat-Zusammenfassung","chatTools.conversationSummaryTitle":"Diese Unterhaltung zusammenfassen","chatTools.conversationSummarizing":"Chat wird zusammengefasst…","chatTools.conversationSummaryEmpty":"Keine Nachrichten zum Zusammenfassen in diesem Chat","chatTools.conversationSummaryNoChat":"Öffne einen Chat, um ihn zusammenzufassen","chatTools.conversationSummaryFailed":"Fehler beim Abrufen der Chat-Nachrichten","chatTools.conversationSummaryResultTitle":"Zusammenfassung der Unterhaltung","chatTools.sendTitle":"Nachricht senden","chatTools.selectTextFirst":"Wählen Sie zuerst Text aus oder geben Sie in das Eingabefeld ein","chatTools.searchLanguage":"Sprache suchen...","aiSettings.title":"AI API-Schlüssel eingeben","aiSettings.platformType":"AI-Plattformtyp","aiSettings.geminiAI":"GEMINI AI","aiSettings.chatgpt":"CHATGPT","aiSettings.deepseek":"DEEPSEEK","aiSettings.apiKey":"AI API-Schlüssel","aiSettings.enterApiKey":"Bitte geben Sie Ihren AI API-Schlüssel ein","aiSettings.validate":"Validieren","aiSettings.validKey":"API-Schlüssel ist gültig!","aiSettings.invalidKey":"Ungültiger API-Schlüssel. Bitte überprüfen und erneut versuchen.","aiSettings.note":"Hinweis:","aiSettings.geminiNote":"Holen Sie sich Ihren Gemini API-Schlüssel von Google AI Studio (aistudio.google.com)","aiSettings.chatgptNote":"Holen Sie sich Ihren OpenAI API-Schlüssel von platform.openai.com/api-keys","aiSettings.deepseekNote":"Holen Sie sich Ihren DeepSeek API-Schlüssel von platform.deepseek.com","aiSettings.enableAITools":"AI-Tools aktivieren","aiSettings.close":"Schließen","aiSettings.save":"Speichern","aiSettings.configureAI":"Konfigurieren Sie Ihren AI-Anbieter und API-Schlüssel für AI-gestützte Funktionen","settings.title":"Einstellungen","settings.yourLanguage":"Ihre Sprache","settings.selectLanguage":"Sprache auswählen","settings.chooseLanguage":"Wählen Sie Ihre bevorzugte Sprache für die Erweiterungsoberfläche","settings.whatLanguageSpeak":"Welche Sprache sprechen Sie","settings.translateMessages":"Eingehende Nachrichten übersetzen","settings.selectSpokenLanguage":"Wählen Sie Ihre Sprache","settings.spokenLanguageHint":"Nachrichten werden in diese Sprache übersetzt, wenn Sie auf das Übersetzungssymbol bei eingehenden Nachrichten klicken.","settings.blurSettings":"Unschärfe-Einstellungen","settings.blurDescription":"Private Informationen auf dem Bildschirm unscharf machen.","settings.blurMessages":"Nachrichten unscharf machen","settings.blurProfileNames":"Profilnamen unscharf machen","settings.blurDisplayPhotos":"Profilfotos unscharf machen","settings.blurConversation":"Konversation unscharf machen","settings.displayOnHover":"Konversation beim Hover anzeigen","settings.theme":"Design","settings.themeDescription":"Wählen Sie Ihr bevorzugtes Farbschema","settings.lightMode":"Heller Modus","settings.lightModeDesc":"Klassisches helles Erscheinungsbild","settings.darkMode":"Dunkler Modus","settings.darkModeDesc":"Augenschonend bei schwachem Licht","settings.systemMode":"System","settings.systemModeHint":"Folgt dem WhatsApp-Design","settings.currentTheme":"Aktuelles Design","signature.title":"Signatur","signature.enableSignature":"Signatur aktivieren","signature.yourSignature":"Ihre Signatur","signature.placeholder":"z.B., - Max Mustermann","signature.preview":"Vorschau","signature.save":"Speichern","backup.title":"Sicherung und Wiederherstellung","backup.export":"Exportieren","backup.import":"Importieren","backup.importHint":"Laden Sie eine {brand}-Backup-JSON-Datei hoch, um Ihre Daten wiederherzustellen. Sie können auswählen, welche Funktionen importiert werden sollen.","backup.kanbanCRM":"Kanban CRM-Daten","backup.customTabs":"Benutzerdefinierte Tabs","backup.templatesQuickReplies":"Vorlagen und Schnellantworten","backup.broadcastHistory":"Broadcast-Verlauf","backup.settings":"Einstellungen","backup.crmProfileData":"CRM-Profildaten","backup.calendarData":"Kalender (Erinnerungen & Termine)","backup.statusData":"Status","backup.webhookSettings":"Webhook-Einstellungen","backup.aiBotSettings":"KI-Bot-Einstellungen","backup.aiApiSettings":"KI-API-Einstellungen","backup.spokenLanguage":"Gesprochene Sprache","backup.chatbotFlows":"Chatbot-Abläufe (Fluxo)","backup.followupData":"Follow-up-Sequenzen","backup.scheduledMessages":"Geplante Nachrichten","backup.scheduledBroadcasts":"Geplante Broadcasts","backup.fluxoAdvanced":"Fluxo Erweiterte Einstellungen","backup.conversationStates":"Gesprächszustände","backup.bulkValidatorData":"Massenvalidierungsdaten","backup.quickReplies":"Schnelle Antworten","backup.crmTodos":"CRM-Aufgabenlisten","backup.signatureSettings":"Signatureinstellungen","backup.teamSettings":"Teameinstellungen","backup.blurSettings":"Unschärfeeinstellungen","backup.featureVisibility":"Funktionssichtbarkeit","backup.themeSettings":"Designeinstellungen","backup.uiStateSettings":"UI-Zustandseinstellungen","backup.apiPollingSettings":"API-Polling-Einstellungen","backup.agentSettings":"Agenteneinstellungen","backup.autoBackup":"Automatische Sicherung","backup.autoBackupInfo":"Eine automatische Sicherung wird erstellt, wenn WhatsApp Web an einem neuen Datum geladen wird","backup.autoBackupDestination":"Sicherungsziel","backup.autoBackupWhatsApp":"An WhatsApp gespeicherte Nachrichten senden","backup.autoBackupDownload":"Auf Computer herunterladen","backup.exportNow":"Jetzt exportieren","backup.importNow":"Jetzt importieren","backup.selectFile":"Sicherungsdatei zum Importieren auswählen","backup.importSuccess":"Daten erfolgreich importiert!","backup.importError":"Fehler beim Importieren der Daten. Bitte überprüfen Sie das Dateiformat.","backup.exportSuccess":"Daten erfolgreich exportiert!","backup.noDataSelected":"Bitte wählen Sie mindestens einen Datentyp zum Exportieren/Importieren aus","backup.cheetahDetected":"Cheetah CRM erkannt","backup.fileLoaded":"Datei erfolgreich geladen","backup.cheetahImportDesc":"Dieses Backup enthält Cheetah CRM-Daten. Alle kompatiblen Funktionen werden importiert und mit Ihren vorhandenen CRM-Daten zusammengeführt.","backup.dataToImport":"Zu importierende Daten:","backup.mergeWarning":"Wichtig:","backup.mergeWarningDesc":"Daten werden mit vorhandenen CRM-Daten zusammengeführt. Ihre aktuellen Daten werden NICHT überschrieben - nur neue Daten werden hinzugefügt.","backup.importing":"Importieren...","backup.importCheetah":"Cheetah CRM-Backup importieren","missedSchedule.title":"Geplante Kampagne verpasst","missedSchedule.description":"Eine geplante Kampagne wurde verpasst, da WhatsApp Web zum geplanten Zeitpunkt nicht geöffnet war.","missedSchedule.sendNow":"Jetzt senden","missedSchedule.cancelDiscard":"Abbrechen und verwerfen","missedSchedule.dismiss":"Später erinnern","calendar.title":"Kalender","calendar.goToToday":"Zu heute gehen","calendar.reminders":"Erinnerungen","calendar.appointments":"Termine","calendar.remindersFor":"Erinnerungen für","calendar.appointmentsFor":"Termine für","calendar.noReminders":"Keine Erinnerungen für dieses Datum","calendar.noAppointments":"Keine Termine für dieses Datum","calendar.selectDate":"Wählen Sie ein Datum mit Erinnerungen oder Terminen aus","calendar.deleteReminder":"Erinnerung löschen","calendar.deleteAppointment":"Termin löschen","calendar.confirmDeleteReminder":"Sind Sie sicher, dass Sie diese Erinnerung löschen möchten?","calendar.confirmDeleteAppointment":"Sind Sie sicher, dass Sie diesen Termin löschen möchten?","calendar.everyMin":"Alle {min} Min","calendar.everyHour":"Jede Stunde","calendar.weekdays.sun":"SO","calendar.weekdays.mon":"MO","calendar.weekdays.tue":"DI","calendar.weekdays.wed":"MI","calendar.weekdays.thu":"DO","calendar.weekdays.fri":"FR","calendar.weekdays.sat":"SA","calendar.months.january":"Januar","calendar.months.february":"Februar","calendar.months.march":"März","calendar.months.april":"April","calendar.months.may":"Mai","calendar.months.june":"Juni","calendar.months.july":"Juli","calendar.months.august":"August","calendar.months.september":"September","calendar.months.october":"Oktober","calendar.months.november":"November","calendar.months.december":"Dezember","calendar.status.pending":"Ausstehend","calendar.status.completed":"Erledigt","calendar.status.dismissed":"Verworfen","calendar.status.snoozed":"Schlummern","calendar.status.stopped":"Gestoppt","calendar.status.scheduled":"Geplant","calendar.status.cancelled":"Abgesagt","calendar.status.missed":"Verpasst","calendar.todos":"Aufgaben","calendar.todosFor":"Aufgaben für","calendar.noTodos":"Keine Aufgaben gefunden","calendar.addTodo":"Aufgabe hinzufügen","calendar.editTodo":"Aufgabe bearbeiten","calendar.deleteTodo":"Aufgabe löschen","calendar.confirmDeleteTodo":"Möchten Sie diese Aufgabe wirklich löschen?","todo.title":"Titel","todo.titlePlaceholder":"Aufgabentitel eingeben","todo.description":"Beschreibung","todo.descriptionPlaceholder":"Details hinzufügen (optional)","todo.dueDate":"Fälligkeitsdatum","todo.dueTime":"Fälligkeitszeit","todo.priority":"Priorität","todo.priorityHigh":"Hoch","todo.priorityMedium":"Mittel","todo.priorityLow":"Niedrig","todo.category":"Kategorie","todo.noCategory":"Keine Kategorie","todo.categoryWork":"Arbeit","todo.categoryPersonal":"Persönlich","todo.categoryUrgent":"Dringend","todo.categoryShopping":"Einkaufen","todo.categoryHealth":"Gesundheit","todo.subtasks":"Unteraufgaben","todo.addSubtask":"Hinzufügen","todo.subtaskPlaceholder":"Unteraufgabe eingeben","todo.recurring":"Wiederkehrend","todo.repeatEvery":"Wiederholen","todo.endDate":"Enddatum","todo.recurringDaily":"Täglich","todo.recurringWeekly":"Wöchentlich","todo.recurringMonthly":"Monatlich","todo.recurringYearly":"Jährlich","todo.reminder":"Erinnerung","todo.reminderDate":"Erinnerungsdatum","todo.reminderTime":"Erinnerungszeit","todo.browserNotification":"Browser-Benachrichtigung","todo.whatsappSelfMessage":"WhatsApp-Erinnerung an mich senden","todo.whatsappSelfMessageHint":"Sie erhalten eine WhatsApp-Nachricht bei Fälligkeit","todo.save":"Aufgabe speichern","todo.update":"Aufgabe aktualisieren","todo.cancel":"Abbrechen","todo.addTodo":"Aufgabe hinzufügen","todo.editTodo":"Aufgabe bearbeiten","todo.statusPending":"Ausstehend","todo.statusInProgress":"In Bearbeitung","todo.statusCompleted":"Erledigt","todo.statusCancelled":"Abgebrochen","todo.filterAll":"Alle Aufgaben","todo.filterToday":"Heute","todo.filterThisWeek":"Diese Woche","todo.filterOverdue":"Überfällig","todo.filterCompleted":"Erledigt","todo.today":"Heute","todo.tomorrow":"Morgen","todo.overdue":"Überfällig","todo.snoozeTime":"Schlummerzeit","todo.minutes":"Minuten","todo.hour":"Stunde","todo.hours":"Stunden","todo.day":"Tag","todo.taskReminder":"Aufgabenerinnerung","todo.highPriority":"Hohe Priorität","todo.mediumPriority":"Mittlere Priorität","todo.lowPriority":"Niedrige Priorität","todo.subtasksCount":"Unteraufgaben","todo.snooze":"Schlummern","todo.markDone":"Als erledigt markieren","todo.dismiss":"Verwerfen","todo.task":"Aufgabe","todo.changeColor":"Klicken zum Ändern der Farbe","todo.selectCategoryFirst":"Zuerst Kategorie auswählen","todo.linkedContacts":"Verknüpfte Kontakte","todo.optional":"Optional","todo.selectContacts":"Kontakte auswählen","todo.searchContacts":"Kontakte suchen...","todo.noContactsFound":"Keine Kontakte gefunden","todo.selected":"ausgewählt","todo.contacts":"Kontakte","status.title":"Status","status.activeStatus":"Aktiver Status","status.createStatus":"Status erstellen","status.loading":"Status wird geladen...","status.noStatusFound":"Kein Status gefunden","status.noStatusDescription":"Sie haben noch keinen Status erstellt. Klicken Sie auf die Schaltfläche unten, um einen neuen hinzuzufügen.","status.add":"Hinzufügen","status.statusName":"Statusname (optional)","status.statusNamePlaceholder":"Namen für den Status erstellen","status.chooseType":"Typ auswählen","status.type.text":"TEXT","status.type.image":"BILD","status.type.video":"VIDEO","status.type.audio":"AUDIO","status.typeText":"Text eingeben","status.backgroundColor":"Hintergrundfarbe wählen","status.clickToChange":"Klicken zum Ändern","status.import":"Importieren","status.dragHere":"Datei hierher ziehen","status.scheduleStatus":"Status planen","status.autoRepost24h":"Status alle 24 Stunden erneut posten","status.autoRepost":"Auto-Repost","status.postNow":"Jetzt posten","status.posting":"Wird gepostet...","status.create":"Erstellen","status.delete":"Löschen","status.emoji":"Emoji","status.status.pending":"Ausstehend","status.status.posted":"Gepostet","status.status.scheduled":"Geplant","status.status.failed":"Fehlgeschlagen","status.caption":"Bildunterschrift","status.captionPlaceholder":"Bildunterschrift hinzufügen...","status.edit":"Bearbeiten","ai.regenerate":"Regenerieren","ai.regenerating":"Regeneriert...","ai.regenerateWithAI":"Mit KI regenerieren","ai.notEnabled":"KI ist nicht aktiviert. Bitte konfigurieren Sie die KI-Einstellungen.","ai.failedToRegenerate":"Regenerierung fehlgeschlagen","ai.failedToRegenerateMessage":"Nachricht konnte nicht regeneriert werden","broadcast.title":"Massennachrichten","broadcast.newCampaign":"Neue Kampagne","broadcast.reports":"Berichte","broadcast.close":"Schließen","broadcast.sending":"Wird gesendet...","broadcast.paused":"Pausiert","broadcast.completed":"Abgeschlossen","broadcast.clearHistory":"Verlauf löschen","broadcast.createCampaign":"Kampagne erstellen","broadcast.createCampaignSubtitle":"Personalisierte Nachrichten an mehrere Kontakte senden","broadcast.scheduledCampaigns":"Geplante Kampagnen","broadcast.campaignReports":"Kampagnenberichte","broadcast.viewManageCampaigns":"Kampagnen anzeigen und verwalten","broadcast.recipients":"Empfänger","broadcast.selected":"ausgewählt","broadcast.contacts":"Kontakte","broadcast.groups":"Gruppen","broadcast.phone":"Telefon","broadcast.phonePlaceholder":"Telefonnummern mit Ländervorwahl","broadcast.clearAll":"Alles löschen","broadcast.contactsUploaded":"Kontakte hochgeladen","broadcast.noGroupsSelected":'Keine Gruppen ausgewählt. Klicken Sie auf "Gruppen hinzufügen" zur Auswahl.',"broadcast.addGroups":"Gruppen hinzufügen","broadcast.groupsSelected":"Gruppe(n) ausgewählt","broadcast.upload":"Hochladen","broadcast.select":"Auswählen","broadcast.download":"Herunterladen","broadcast.groupsContacts":"Gruppenkontakte","broadcast.tabsContacts":"Tab-Kontakte","broadcast.kanbanBoard":"Kanban-Board","broadcast.labelsContacts":"Label-Kontakte","broadcast.allowRepeat":"Wiederholte Nummern erlauben","broadcast.enableLinkPreview":"Linkvorschau aktivieren","broadcast.groupActions":"Gruppenaktionen","broadcast.customTabActions":"Benutzerdefinierte Tab-Aktionen","broadcast.labelsActions":"Label-Aktionen","broadcast.kanbanBoardActions":"Kanban-Board-Aktionen","broadcast.skipBulkMessage":"Massennachricht überspringen","broadcast.skipBulkMessageInfo":"Nachrichtenversand wird übersprungen. Nur Aktionen (Gruppen, Tabs, Labels, Kanban) werden für Kontakte ausgeführt.","broadcast.appendSignature":"Signatur anhängen","broadcast.signaturePreview":"Vorschau","broadcast.groupActionsNote":"Hinweis: Sie müssen Administrator der Gruppen sein, um folgende Aktionen durchzuführen.","broadcast.addIntoGroups":"Zu Gruppen hinzufügen","broadcast.removeFromGroups":"Aus Gruppen entfernen","broadcast.selectGroups":"Gruppen auswählen","broadcast.addIntoTabs":"Zu benutzerdefinierten Tabs hinzufügen","broadcast.removeFromTabs":"Aus benutzerdefinierten Tabs entfernen","broadcast.selectTabs":"Tabs auswählen","broadcast.addToLabels":"Zu Labels hinzufügen","broadcast.removeFromLabels":"Aus Labels entfernen","broadcast.selectLabels":"Labels auswählen","broadcast.addToKanban":"Zu Kanban-Stufe hinzufügen","broadcast.removeFromKanban":"Aus Kanban-Stufe entfernen","broadcast.selectCRMStage":"CRM und Stufe auswählen","broadcast.sendRandomMessage":"Zufällige Nachricht an jeden Kontakt senden","broadcast.addMessage":"Nachricht hinzufügen","broadcast.pauseSetting":"Pauseneinstellung","broadcast.pauseAfterXSends":"Pause (nach X Sendungen):","broadcast.pauseTimeInSeconds":"Pausenzeit (s):","broadcast.second":"Sekunde","broadcast.message":"Nachricht","broadcast.moveUp":"Nach oben","broadcast.moveDown":"Nach unten","broadcast.deleteMessage":"Nachricht löschen","broadcast.templateType":"Vorlagentyp","broadcast.messageOnly":"Nur Nachricht","broadcast.enterMessageText":"Bitte Nachrichtentext eingeben","broadcast.variable":"Variable","broadcast.phoneNumber":"Telefonnummer","broadcast.contactName":"Kontaktname","broadcast.uploadCSVHint":"CSV mit zusätzlichen Spalten hochladen, um mehr Variablen hinzuzufügen","broadcast.selectTemplates":"Vorlagen auswählen","broadcast.noTemplates":"Keine Vorlagen verfügbar","broadcast.sendingDelay":"Sendeverzögerung","broadcast.minimumSecond":"Minimum Sekunden","broadcast.maximumSecond":"Maximum Sekunden","broadcast.delayHint":"Jede Nachricht wird mit einer zufälligen Verzögerung zwischen {min}-{max} Sekunden gesendet","broadcast.scheduleMessage":"Nachricht planen","broadcast.date":"Datum","broadcast.time":"Zeit","broadcast.autoSendIfMissed":"Automatisch senden, wenn geplante Zeit verstrichen","broadcast.recurring":"Wiederkehrend","broadcast.repeatInterval":"Wiederholen","broadcast.daily":"Täglich","broadcast.weekly":"Wöchentlich","broadcast.monthly":"Monatlich","broadcast.yearly":"Jährlich","broadcast.selectDays":"Tage auswählen","broadcast.sun":"So","broadcast.mon":"Mo","broadcast.tue":"Di","broadcast.wed":"Mi","broadcast.thu":"Do","broadcast.fri":"Fr","broadcast.sat":"Sa","broadcast.ends":"Endet","broadcast.endNever":"Nie","broadcast.endOnDate":"Am Datum","broadcast.recurringHowToUse":"Wiederkehrend verwenden","broadcast.recurringTip1":"Aktivieren Sie wiederkehrend, um diesen Broadcast automatisch zu wiederholen","broadcast.recurringTip2":"Wählen Sie die Häufigkeit: Täglich, Wöchentlich, Monatlich oder Jährlich","broadcast.recurringTip3":"Für Wöchentlich: Bestimmte Tage auswählen (Mo, Di usw.)","broadcast.recurringTip4":'Enddatum festlegen oder "Nie" wählen für unbegrenzte Ausführung',"broadcast.recurringTip5":"Nach jedem Broadcast wird der nächste automatisch geplant","broadcast.selectDates":"Datum auswählen","broadcast.selectMonths":"Monate auswählen","broadcast.calendarSelectInfo":"Wählen Sie bestimmte Daten aus dem Kalender. Navigieren Sie mit den Pfeilen durch die Monate.","broadcast.datesSelected":"Daten ausgewählt","broadcast.jan":"Jan","broadcast.feb":"Feb","broadcast.mar":"Mär","broadcast.apr":"Apr","broadcast.may":"Mai","broadcast.jun":"Jun","broadcast.jul":"Jul","broadcast.aug":"Aug","broadcast.sep":"Sep","broadcast.oct":"Okt","broadcast.nov":"Nov","broadcast.dec":"Dez","broadcast.quickStart":"Schnellstart","broadcast.previewStart":"Vorschau & Start","broadcast.scheduleBroadcast":"Broadcast planen","broadcast.sent":"Gesendet","broadcast.failed":"Fehlgeschlagen","broadcast.resume":"Fortsetzen","broadcast.pause":"Pausieren","broadcast.stop":"Stoppen","broadcast.resumeCampaign":"Kampagne fortsetzen?","broadcast.campaignInterrupted":"Eine Kampagne wurde unterbrochen. Möchten Sie fortsetzen?","broadcast.remaining":"Verbleibend","broadcast.contactsProcessed":"Kontakte verarbeitet","broadcast.resumeCampaignBtn":"Kampagne fortsetzen","broadcast.cancelDiscard":"Abbrechen & Verwerfen","broadcast.dismissRemindLater":"Ignorieren (Später erinnern)","broadcast.broadcastScheduled":"Broadcast geplant!","broadcast.campaignPreview":"Kampagnenvorschau","broadcast.messages":"Nachrichten","broadcast.stepSettings":"Einstellungen","broadcast.stepActions":"Aktionen","broadcast.stepReview":"Überprüfen","broadcast.delayRange":"Verzögerungsbereich","broadcast.pauseAfterDuration":"Pause nach / Dauer","broadcast.checkConsole":"Überprüfen Sie die Browser-Konsole für detaillierte Konfiguration","broadcast.sendingQueue":"Sendewarteschlange","broadcast.broadcastReports":"Broadcast-Berichte","broadcast.campaignHistory":"Kampagnenverlauf","broadcast.noHistoryYet":"Noch kein Broadcast-Verlauf","broadcast.historyDescription":"Ihre abgeschlossenen und geplanten Broadcasts erscheinen hier","broadcast.noCampaignsYet":"Noch keine abgeschlossenen Kampagnen","broadcast.dateTime":"Datum & Zeit","broadcast.status":"Status","broadcast.scheduled":"Geplant","broadcast.cancel":"Abbrechen","broadcast.running":"Läuft","broadcast.cancelled":"Abgebrochen","broadcast.downloadAllContacts":"Alle Kontakte herunterladen","broadcast.downloadSentContacts":"Gesendete Kontakte herunterladen","broadcast.downloadFailedContacts":"Fehlgeschlagene Kontakte herunterladen","broadcast.selectGroupsToAdd":"Gruppen zum Hinzufügen von Kontakten auswählen","broadcast.selectGroupsToRemove":"Gruppen zum Entfernen von Kontakten auswählen","broadcast.selectTabsToAdd":"Tabs zum Hinzufügen von Kontakten auswählen","broadcast.selectTabsToRemove":"Tabs zum Entfernen von Kontakten auswählen","broadcast.selectLabelsToAdd":"Labels zum Hinzufügen von Kontakten auswählen","broadcast.selectLabelsToRemove":"Labels zum Entfernen von Kontakten auswählen","broadcast.selectCRM":"CRM auswählen","broadcast.selectStage":"Stufe auswählen","broadcast.backToCRMs":"Zurück zu CRMs","broadcast.loadingGroups":"Gruppen werden geladen...","broadcast.loadingTabs":"Tabs werden geladen...","broadcast.loadingLabels":"Labels werden geladen...","broadcast.noGroupsFound":"Keine Gruppen gefunden, bei denen Sie Administrator sind","broadcast.noTabsFound":"Keine benutzerdefinierten Tabs gefunden. Erstellen Sie zuerst Tabs.","broadcast.noLabelsFound":"Keine Labels gefunden. Erstellen Sie zuerst Labels in WhatsApp.","broadcast.noCRMsFound":"Keine CRMs gefunden. Erstellen Sie zuerst ein CRM.","broadcast.noStagesFound":"Keine Stufen in diesem CRM gefunden.","broadcast.tabsSelected":"Tabs ausgewählt","broadcast.labelsSelected":"Labels ausgewählt","broadcast.confirmSelection":"Auswahl bestätigen","broadcast.availableVariables":"Verfügbare Variablen","broadcast.of":"von","broadcast.chats":"Chats","broadcast.remove":"Entfernen","broadcast.allScheduledCampaigns":"Alle geplanten Kampagnen","broadcast.noScheduledCampaigns":"Keine geplanten Kampagnen","broadcast.scheduleFirstCampaign":"Planen Sie Ihre erste Kampagne, um sie hier zu sehen","broadcast.createNewCampaign":"Neue Kampagne erstellen","broadcast.oneTime":"Einmalig","broadcast.nextRun":"Nächste Ausführung","broadcast.runNow":"Jetzt ausführen","broadcast.pauseCampaign":"Pause","broadcast.editCampaign":"Bearbeiten","broadcast.deleteCampaign":"Löschen","broadcast.confirmDeleteScheduled":"Sind Sie sicher, dass Sie diese geplante Kampagne löschen möchten?","broadcast.campaignStarting":"Kampagne startet in Kürze","broadcast.skipNext":"Nächste überspringen","broadcast.unskipNext":"Nicht überspringen","broadcast.skippingNext":"Überspringe nächste","broadcast.lastRun":"Letzte Ausführung","broadcast.runs":"Ausführungen","broadcast.successRate":"Erfolg","broadcast.justNow":"gerade eben","broadcast.inAMoment":"gleich","broadcast.ago":"vor","broadcast.in":"in","broadcast.uploadContacts":"Kontakte hochladen","broadcast.stepSelect":"Auswählen","broadcast.stepMap":"Zuordnen","broadcast.stepUpload":"Hochladen","broadcast.uploadCSVImport":"CSV-Datei hochladen, um Kontakte zu importieren","broadcast.uploadCSVOnly":"Nur CSV-Dateien (.csv Format)","broadcast.downloadSampleFile":"Beispieldatei herunterladen","broadcast.phoneNumberLabel":"Telefonnummer:","broadcast.mapColumnHint":"Ordnen Sie die Spalte mit 'Telefonnummer'-Daten zu","broadcast.chooseExtraColumns":"Wählen Sie zusätzliche Spalten für personalisierte Nachrichten.","broadcast.all":"Alle","broadcast.none":"Keine","broadcast.previous":"Zurück","broadcast.next":"Weiter","broadcast.removeUnwantedRows":"Unerwünschte Zeilen entfernen","broadcast.totalContacts":"Kontakte insgesamt","broadcast.startUpload":"Upload starten","broadcast.rows":"Zeilen","broadcast.selectGroupsTitle":"Gruppen auswählen","broadcast.searchGroups":"Gruppen suchen...","broadcast.members":"Mitglieder","broadcast.groupsSelectedCount":"Gruppen ausgewählt","broadcast.addGroupsBtn":"Gruppen hinzufügen","broadcast.tooltipBold":"Fett","broadcast.tooltipItalic":"Kursiv","broadcast.tooltipStrikethrough":"Durchgestrichen","broadcast.tooltipAddMedia":"Medien hinzufügen","broadcast.tooltipRefresh":"Aktualisieren","broadcast.noCompletedCampaigns":"Noch keine abgeschlossenen Kampagnen","kanban.title":"CRM KANBAN","kanban.user":"Benutzer","kanban.darkMode":"Dunkelmodus","kanban.lightMode":"Hellmodus","kanban.menu":"Menü","kanban.createCRM":"CRM erstellen","kanban.addStage":"Stufe hinzufügen","kanban.analytics":"Analysen","kanban.sync":"Synchronisieren","kanban.cannotAddStages":"Stufen können nicht zum WhatsApp-Labels-CRM hinzugefügt werden","kanban.inbox":"POSTEINGANG","kanban.unread":"Ungelesen","kanban.pinned":"Angeheftet","kanban.groups":"Gruppen","kanban.stages":"Stufen","kanban.chats":"Chats","kanban.searchInbox":"Im Posteingang suchen...","kanban.searchContacts":"Suchen...","kanban.stageOptions":"Stufenoptionen","kanban.renameStage":"Umbenennen","kanban.clearSearch":"Suche löschen","kanban.noChatsMatch":"Keine passenden Chats","kanban.noChatsYet":"Noch keine Chats","kanban.filterUnread":"Ungelesene Chats filtern","kanban.filterPinned":"Angeheftete Chats filtern","kanban.filterGroups":"Gruppenchats filtern","kanban.addNewStage":"Neue Stufe hinzufügen","kanban.noCRMsFound":"Keine CRMs gefunden","kanban.selectCRM":"CRM aus Dropdown auswählen","kanban.loading":"Kanban CRM wird geladen...","kanban.syncingLabels":"WhatsApp-Labels und Tabs werden synchronisiert...","kanban.switchCRM":"CRM wechseln","kanban.createNewCRM":"Neues CRM erstellen","kanban.enterCRMName":"CRM-Name eingeben...","kanban.addNewStageTitle":"Neue Stufe hinzufügen","kanban.enterStageName":"Stufenname eingeben...","kanban.editStage":"Stufe bearbeiten","kanban.editStageName":"Stufenname bearbeiten","kanban.deleteStage":"Stufe löschen","kanban.editCRM":"CRM bearbeiten","kanban.deleteCRM":"CRM löschen","kanban.confirmDeleteStage":"Sind Sie sicher? Chats werden in den Posteingang verschoben.","kanban.cannotDeleteInbox":"Posteingang-Stufe kann nicht gelöscht werden.","kanban.cannotAddStagesLabels":"Stufen können nicht zum Labels-CRM hinzugefügt werden. Labels werden von WhatsApp synchronisiert.","kanban.chatsLoadedSuccess":"Chats erfolgreich geladen!","kanban.failedLoadChats":"Chats konnten nicht geladen werden. Stellen Sie sicher, dass Sie auf WhatsApp Web sind.","kanban.noAvailableChats":"Keine verfügbaren Chats.","kanban.enterNewCRMName":"Neuen CRM-Namen eingeben:","kanban.name":"Name","kanban.phone":"Telefon","kanban.lastMessage":"Letzte Nachricht","kanban.noMessages":"Keine Nachrichten","kanban.unreadCount":"Ungelesen","kanban.type":"Typ","kanban.groupChat":"Gruppenchat","kanban.individualChat":"Einzelchat","kanban.status":"Status","kanban.dealValue":"Geschäftswert (EUR)","kanban.enterDealValue":"Geschäftswert eingeben","kanban.notes":"Notizen","kanban.addNotes":"Notizen zu diesem Chat hinzufügen...","kanban.justNow":"Gerade eben","kanban.group":"Gruppe","kanban.muted":"Stumm","kanban.save":"Speichern","kanban.cancel":"Abbrechen","kanban.close":"Schließen","kanban.analyticsTitle":"Analyse-Dashboard","kanban.analyticsSubtitle":"Leistungsmetriken für Ihre Pipeline","kanban.exportCSV":"Als CSV exportieren","kanban.exportPDF":"Als PDF exportieren","kanban.noAnalyticsData":"Keine Analysedaten verfügbar","kanban.from":"Von:","kanban.to":"Bis:","kanban.totalChats":"Gesamte Chats","kanban.pipelineValue":"Pipeline-Wert","kanban.activeStages":"Aktive Pipeline-Stufen","kanban.stagePerformance":"Stufenleistung","kanban.stage":"Stufe","kanban.value":"Wert","kanban.avgTime":"Durchschn. Zeit","kanban.conversion":"Konversion","kanban.chatDistribution":"Chat-Verteilung","kanban.allTime":"Gesamte Zeit","kanban.today":"Heute","kanban.last7Days":"Letzte 7 Tage","kanban.last30Days":"Letzte 30 Tage","kanban.allowPopups":"Bitte erlauben Sie Popups für PDF-Export","kanban.addSampleChat":"Beispiel-Chat hinzufügen","kanban.crmName":"CRM-Name","kanban.stageName":"Stufenname","kanban.saveChanges":"Änderungen speichern","kanban.createFirstCRM":"Erstellen Sie Ihr erstes CRM, um Ihre WhatsApp-Chats zu organisieren.","kanban.noStagesFound":"Keine Stufen in diesem CRM gefunden.","kanban.syncOrAddStages":"Synchronisieren Sie Daten von WhatsApp oder fügen Sie benutzerdefinierte Stufen hinzu.","kanban.chatDetails":"Chat-Details","kanban.notAvailable":"K.A.","kanban.addNotesPlaceholder":"Notizen zu diesem Chat hinzufügen...","kanban.thisWeek":"diese Woche","kanban.avg":"Durchschn.","kanban.stagesLabel":"Stufen","kanban.activePipelineStages":"Aktive Pipeline-Stufen","kanban.customRange":"Benutzerdefinierter Bereich","kanban.dateRange":"Datumsbereich","kanban.confirmDeleteCrm":"Sind Sie sicher, dass Sie dieses CRM löschen möchten? Alle Stufen und Chats werden entfernt.","kanban.openInWhatsApp":"In WhatsApp öffnen","kanban.removeFromStage":"Aus Stufe entfernen","kanban.openCRM":"CRM öffnen","kanban.addNote":"Notiz hinzufügen","kanban.scheduleMessage":"Nachricht planen","kanban.addIncome":"Einkommen hinzufügen","kanban.whatsappNotOpen":"WhatsApp Web ist nicht geöffnet. Bitte öffnen Sie zuerst WhatsApp Web.","kanban.failedToOpenChat":"Chat konnte nicht in WhatsApp geöffnet werden","kanban.removeFromStageConfirm":"Sind Sie sicher, dass Sie diesen Chat aus der aktuellen Stufe entfernen möchten?","kanban.failedToRemove":"Chat konnte nicht aus Stufe entfernt werden","kanban.failedToOpenCRM":"CRM konnte nicht geöffnet werden","kanban.chatPopup":"Chat","kanban.typeMessage":"Nachricht eingeben...","kanban.sendMessage":"Senden","kanban.loadingMessages":"Nachrichten werden geladen...","kanban.failedToLoadMessages":"Nachrichten konnten nicht geladen werden","kanban.failedToSendMessage":"Nachricht konnte nicht gesendet werden","kanban.yesterday":"Gestern","kanban.refresh":"Aktualisieren","kanban.loadingMedia":"Wird geladen...","kanban.clickToLoad":"Klicken zum Laden","kanban.addToStage":"Zu CRM-Phase hinzufügen","kanban.selectCrmStage":"CRM und Phase auswählen","kanban.retry":"Wiederholen","kanban.attach":"Datei anhängen","kanban.addCaption":"Beschriftung hinzufügen...","kanban.audioMessage":"Sprachnachricht","kanban.document":"Dokument","kanban.location":"Standort","kanban.contact":"Kontakt","kanban.quickReply":"Schnellantwort","kanban.fluxo":"Fluxo","kanban.more":"mehr","kanban.showLess":"Weniger anzeigen","kanban.noQuickReplies":"Keine Schnellantworten","kanban.noFluxos":"Keine aktiven Flows","kanban.users":"Benutzer","kanban.usersBreakdown":"Benutzeraufschlüsselung","kanban.searchUsers":"Benutzer nach Name oder Nummer suchen...","kanban.noUsersFound":"Keine Benutzer gefunden","kanban.tryDifferentSearch":"Versuchen Sie einen anderen Suchbegriff","kanban.crm":"CRM","kanban.tabs":"Tabs","kanban.labels":"Labels","kanban.crmBreakdown":"CRM-Stufenaufschlüsselung","kanban.tabsBreakdown":"Tab-Aufschlüsselung","kanban.labelsBreakdown":"Label-Aufschlüsselung","kanban.noDataFound":"Keine Daten gefunden","kanban.addDataToSeeAnalytics":"Fügen Sie Einnahmen/Ausgaben zu Kontakten hinzu, um Analysen zu sehen","kanban.incomeVsExpense":"Einnahmen vs Ausgaben nach","kanban.contacts":"Kontakte","kanban.netProfit":"NETTOGEWINN","kanban.crmProfit":"CRM-Gewinn","kanban.tabsProfit":"Tab-Gewinn","kanban.labelsProfit":"Label-Gewinn","kanban.profitDistribution":"Gewinnverteilung","kanban.sourceComparison":"Quellenvergleich","kanban.totalContacts":"Kontakte Gesamt","kanban.avgPerSource":"Durchschnitt pro Quelle","kanban.loadingMore":"Mehr laden...","kanban.allChatsLoaded":"Alle Chats geladen","kanban.dragToReorder":"Ziehen zum Neuordnen","crm.categoryBreakdown":"Kategorieaufschlüsselung","crm.incomeByCategory":"Einnahmen nach Kategorie","crm.expenseByCategory":"Ausgaben nach Kategorie","crm.paymentMethodBreakdown":"Zahlungsmethodenaufschlüsselung","crm.incomeByPayment":"Einnahmen nach Zahlungsmethode","crm.expenseByPayment":"Ausgaben nach Zahlungsmethode","crm.userWiseBreakdown":"Benutzeraufschlüsselung","crm.net":"Netto","crm.transactions":"Transaktionen","crm.margin":"Marge","crm.netProfit":"Nettogewinn","chart.income":"Einnahmen","chart.expense":"Ausgaben","chart.profit":"Gewinn","chart.noDataAvailable":"Keine Daten verfügbar","chart.noProfitData":"Keine Gewinndaten verfügbar","chart.noTrendData":"Keine Trenddaten verfügbar","bulkValidator.title":"Massen-Nummernprüfer","bulkValidator.subtitle":"Validieren Sie WhatsApp-Nummern in Massen mit Kampagnen","bulkValidator.menu":"Menü","bulkValidator.activeCampaigns":"Aktive Kampagnen","bulkValidator.completed":"Abgeschlossen","bulkValidator.noActiveCampaigns":"Keine aktiven Kampagnen. Starten Sie eine neue, um Nummern zu validieren.","bulkValidator.noCompleted":"Noch keine abgeschlossenen Kampagnen.","bulkValidator.createHint":"Laden Sie eine CSV mit Nummern hoch und starten Sie die Validierung.","bulkValidator.newCampaign":"Neue Validierungskampagne","bulkValidator.createCampaign":"Neue Kampagne erstellen","bulkValidator.campaignName":"Kampagnenname","bulkValidator.enterCampaignName":"Kampagnennamen eingeben","bulkValidator.countryCode":"Landesvorwahl","bulkValidator.countryCodeHint":"Landesvorwahl für Nummern ohne Präfix auswählen","bulkValidator.uploadCSV":"CSV-Datei hochladen","bulkValidator.csvHint":"CSV-Datei mit Telefonnummern (eine pro Zeile oder durch Kommas getrennt)","bulkValidator.numbersFound":"Nummern gefunden","bulkValidator.enterNameAndUpload":"Bitte geben Sie den Kampagnennamen ein und laden Sie Nummern hoch","bulkValidator.createAndStart":"Kampagne erstellen","bulkValidator.campaigns":"Kampagnen","bulkValidator.noCampaigns":"Noch keine Kampagnen. Erstellen Sie eine, um mit der Validierung von Nummern zu beginnen.","bulkValidator.confirmDelete":"Sind Sie sicher, dass Sie diese Kampagne löschen möchten?","bulkValidator.valid":"Gültig","bulkValidator.invalid":"Ungültig","bulkValidator.pending":"Ausstehend","bulkValidator.start":"Start","bulkValidator.pause":"Pause","bulkValidator.downloadValid":"Gültige Nummern herunterladen","bulkValidator.downloadInvalid":"Ungültige Nummern herunterladen","bulkValidator.downloadAll":"Alle herunterladen","bulkValidator.all":"Alle","tools.allTools":"Alle Werkzeuge","tools.subtitle":"Klicken zum Öffnen • In die Kopfzeile ziehen, um anzuheften","tools.featureSettings":"Funktionseinstellungen","tools.pinnedTooltip":"In Kopfzeile angeheftet (zu Werkzeugen ziehen, um zu lösen)","tools.itemTooltip":"{name} — klicken zum Öffnen oder in die Kopfzeile ziehen, um anzuheften","tools.category.communication":"Kommunikation","tools.category.management":"Verwaltung","tools.category.automation":"Automatisierung","tools.category.validation":"Validierung","webhook.title":"Webhooks","webhook.subtitle":"Senden Sie Kontaktdaten nach der Ausführung registrierter Ereignisse an eine andere Anwendung","webhook.events":"Ereignisse","webhook.quickResponses":"Schnellantworten","webhook.appointment":"Termin","webhook.reminder":"Erinnerung","webhook.contactProfile":"Kontaktprofil","webhook.notes":"Notizen","webhook.income":"Einkommen","webhook.expense":"Ausgaben","webhook.kanban":"Kanban","webhook.labels":"Labels","webhook.customTabs":"Benutzerdefinierte Tabs","webhook.messages":"Nachrichten","webhook.todos":"Aufgabenliste","webhook.webhookData":"WebHook-Daten","webhook.webhookUrl":"WebHook-URL","webhook.enterUrl":"Geben Sie hier die Ziel-URL ein","webhook.active":"Aktiv","webhook.dataToSend":"Zu sendende Daten","webhook.lastUploads":"Letzte Uploads (maximal 30 Ansichten)","webhook.noUploads":"Noch keine Uploads","webhook.close":"Schließen","webhook.save":"Speichern","webhook.saving":"Speichern...","webhook.field.eventDetails":"Ereignisdetails","webhook.field.number":"Nummer","webhook.field.name":"Name","webhook.field.picture":"Bild","webhook.field.labels":"Labels","webhook.field.contactProfile":"Kontaktprofil","webhook.field.appointmentTime":"Terminzeit","webhook.field.meetingLink":"Besprechungslink","webhook.field.reminderTopic":"Erinnerungsthema","webhook.field.reminderTime":"Erinnerungszeit","webhook.field.reminderDetails":"Erinnerungsdetails","webhook.field.email":"E-Mail","webhook.field.gender":"Geschlecht","webhook.field.dateOfBirth":"Geburtsdatum","webhook.field.address":"Adresse","webhook.field.details":"Details","webhook.field.customFields":"Benutzerdefinierte Felder","webhook.field.noteTopic":"Notizthema","webhook.field.noteContent":"Notizinhalt","webhook.field.noteTimestamp":"Notiz-Zeitstempel","webhook.field.amount":"Betrag","webhook.field.category":"Kategorie","webhook.field.paymentMethod":"Zahlungsmethode","webhook.field.description":"Beschreibung","webhook.field.reference":"Referenz/Rechnung","webhook.field.referenceBill":"Referenz/Beleg","webhook.field.transactionDate":"Transaktionsdatum","webhook.field.status":"Status","webhook.field.cardTitle":"Kartentitel","webhook.field.columnName":"Spalte/Phase","webhook.field.cardDescription":"Kartenbeschreibung","webhook.field.labelId":"Label-ID","webhook.field.labelName":"Label-Name","webhook.field.labelColor":"Label-Farbe","webhook.field.allLabels":"Alle Kontakt-Labels","webhook.field.tabId":"Tab-ID","webhook.field.tabName":"Tab-Name","webhook.field.tabColor":"Tab-Farbe","webhook.field.allTabs":"Alle Kontakt-Tabs","webhook.field.direction":"Richtung (eingehend/ausgehend)","webhook.field.messageContent":"Nachrichteninhalt","webhook.field.messageType":"Nachrichtentyp","webhook.field.messageId":"Nachrichten-ID","webhook.field.mediaUrl":"Medien-URL","webhook.field.quotedMessage":"Zitierte Nachricht","webhook.field.timestamp":"Zeitstempel","webhook.field.ctwaData":"Meta Ads Daten (CTWA)","webhook.field.todoTitle":"Aufgabentitel","webhook.field.todoDescription":"Aufgabenbeschreibung","webhook.field.todoDueDate":"Fälligkeitsdatum","webhook.field.todoPriority":"Priorität","webhook.field.todoCategory":"Kategorie","webhook.field.todoStatus":"Status","webhook.field.todoSubtasks":"Unteraufgaben","api.configureAPI":"API konfigurieren","api.manageToken":"Verwalten Sie Ihr API-Token und Einstellungen","api.apiToken":"API-Token","api.generateToken":"Token generieren","api.regenerate":"Neu generieren","api.generating":"Generiere...","api.copyToken":"Token kopieren","api.tokenWarning":"Halten Sie dieses Token geheim. Jeder mit Zugang kann in Ihrem Namen Nachrichten senden.","api.enableAPI":"API aktivieren","api.apiIsEnabled":"API ist derzeit aktiviert","api.apiIsDisabled":"API ist derzeit deaktiviert","api.openDocumentation":"Dokumentation öffnen","api.queuePolling":"Warteschlangen-Polling","api.pollingActive":"Überprüfung auf Nachrichten in der Warteschlange alle 5 Minuten","api.pollingInactive":"Aktivieren, um eingehende API-Nachrichten zu verarbeiten","audioTranscribe.title":"Transkription","audioTranscribe.transcribeAudio":"Audio transkribieren","audioTranscribe.copy":"Kopieren","audioTranscribe.copied":"Kopiert!","audioTranscribe.translate":"Übersetzen","audioTranscribe.translating":"Übersetzen...","audioTranscribe.translated":"Übersetzt!","audioTranscribe.original":"Original:","audioTranscribe.translatedLabel":"Übersetzt","audioTranscribe.close":"Schließen","audioTranscribe.requiresChatGPT":"Audio-Transkription erfordert ChatGPT API-Schlüssel. Bitte konfigurieren Sie ChatGPT als Ihren KI-Anbieter in den Einstellungen.","audioTranscribe.audioNotFound":"Audio-URL konnte nicht gefunden werden. Das Audio ist möglicherweise nicht verfügbar.","audioTranscribe.transcriptionFailed":"Transkription fehlgeschlagen","audioTranscribe.configureAI":"Bitte konfigurieren Sie zuerst die KI-Einstellungen, um die Übersetzung zu verwenden.","audioTranscribe.translationFailed":"Übersetzung fehlgeschlagen","audioTranscribe.translationTimeout":"Übersetzungs-Timeout. Bitte versuchen Sie es erneut.","aiBot.title":"KI-Bot","aiBot.tab.testChat":"Test-Chat","aiBot.tab.qaPairs":"Q&A-Paare","aiBot.tab.aiBehavior":"KI-Verhalten","aiBot.tab.trainingData":"Trainingsdaten","aiBot.tab.escalation":"Eskalation","aiBot.tab.dataPreview":"Datenvorschau","aiBot.tab.actionPrompts":"Aktions-Prompts","aiBot.tab.scheduleTiming":"Zeitplan & Timing","aiBot.tab.trainingDataComingSoon":"Dokumenten-Upload, URL-Scraping und reine Textquellen kommen im nächsten Update.","aiBot.tab.escalationComingSoon":"Automatische Übergabe an einen Menschen nach einer konfigurierbaren Anzahl unbeantworteter Nachrichten kommt im nächsten Update.","aiBot.tab.dataPreviewComingSoon":"Eine schreibgeschützte Übersicht aller Q&A-Paare, Quellen und Chunks, auf die die KI Zugriff hat.","aiBot.comingSoon":"Demnächst","aiBot.qa.addPair":"Paar hinzufügen","aiBot.qa.editPair":"Paar bearbeiten","aiBot.qa.questionLabel":"Frage","aiBot.qa.questionPlaceholder":"Was Kunden fragen könnten…","aiBot.qa.answerLabel":"Antwort","aiBot.qa.answerPlaceholder":"Wie die KI antworten soll…","aiBot.qa.categoryLabel":"Kategorie (optional)","aiBot.qa.categoryPlaceholder":"z.B. Preise, Support, Onboarding","aiBot.qa.existingPairs":"Vorhandene Paare","aiBot.qa.empty":"Noch keine Q&A-Paare. Fügen Sie oben das erste hinzu.","aiBot.qa.cancel":"Abbrechen","aiBot.qa.update":"Aktualisieren","aiBot.qa.delete":"Löschen","aiBot.qa.edit":"Bearbeiten","aiBot.qa.enabled":"Aktiviert","aiBot.qa.disabled":"Deaktiviert","aiBot.qa.on":"Ein","aiBot.qa.off":"Aus","aiBot.qa.deleteConfirm":"Dieses Q&A-Paar löschen?","aiBot.qa.itemSingular":"Paar","aiBot.qa.itemPlural":"Paare","aiBot.behavior.providerConfig":"KI-Anbieter","aiBot.behavior.provider":"Anbieter","aiBot.behavior.model":"Modell","aiBot.behavior.apiActive":"API aktiv","aiBot.behavior.noApiKey":"Kein API-Schlüssel","aiBot.behavior.apiKeyHint":"Fügen Sie Ihren API-Schlüssel in den KI-Tools-Einstellungen hinzu, um den Bot zu aktivieren.","aiBot.behavior.triggerWords":"Trigger-Wörter","aiBot.behavior.triggerWordsPlaceholder":"support, hilfe, demo (kommagetrennt)","aiBot.behavior.triggerWordsHelp":"Wenn gesetzt, antwortet der Bot nur auf Nachrichten, die mindestens eines dieser Wörter enthalten. Leer lassen, um auf alles zu antworten.","aiBot.behavior.responseSettings":"Antworteinstellungen","aiBot.behavior.responseTone":"Antwortton","aiBot.behavior.maxResponseLength":"Maximale Antwortlänge","aiBot.behavior.temperature":"Temperatur","aiBot.behavior.temperatureHelp":"Niedriger = fokussierter. Höher = kreativer.","aiBot.behavior.maxTokens":"Max. Tokens","aiBot.behavior.maxTokensHelp":"Begrenzt die Größe der KI-Antwort.","aiBot.behavior.systemPrompt":"Geschäftskontext / System-Prompt","aiBot.behavior.systemPromptPlaceholder":"Erzählen Sie der KI von Ihrem Unternehmen, Produkten und wie sie Sie repräsentieren soll…","aiBot.behavior.systemPromptHelp":"Wird als grundlegende Anweisung für jede KI-Antwort verwendet.","aiBot.behavior.fallbackMessage":"Fallback-Nachricht","aiBot.behavior.fallbackMessageHelp":"Wird gesendet, wenn die KI kein passendes Q&A-Paar, keine Quelle oder kein Allgemeinwissen zur Antwort hat.","aiBot.behavior.saved":"✓ Gespeichert","aiBot.behavior.saveBehavior":"Verhalten speichern","aiBot.behavior.tone_friendly":"Freundlich","aiBot.behavior.tone_professional":"Professionell","aiBot.behavior.tone_casual":"Locker","aiBot.behavior.tone_formal":"Formell","aiBot.behavior.tone_empathetic":"Empathisch","aiBot.behavior.length_short":"Kurz (~50 Wörter)","aiBot.behavior.length_medium":"Mittel (~200 Wörter)","aiBot.behavior.length_long":"Lang (~400 Wörter)","aiBot.kb.urlTitle":"Website-URL hinzufügen","aiBot.kb.urlPlaceholder":"https://beispiel.de/ueber-uns","aiBot.kb.addUrl":"URL hinzufügen","aiBot.kb.scraping":"Wird abgerufen…","aiBot.kb.urlHelp":"Wir rufen die Seite ab und extrahieren ihren sichtbaren Text. Nur einzelne Seite — JS-gerenderte SPAs liefern möglicherweise wenig Inhalt.","aiBot.kb.errorEmpty":"Kein lesbarer Text unter dieser URL gefunden.","aiBot.kb.errorBlocked":'Diese URL konnte nicht erreicht werden. Die Website blockiert möglicherweise automatisierte Anfragen, erfordert eine Anmeldung oder wird mit JS gerendert. Versuchen Sie, den Text unten in "Reinen Text einfügen" zu kopieren.',"aiBot.kb.blockedChromeStore":'Chrome Web Store blockiert automatisierte Anfragen. Öffnen Sie den Eintrag in Ihrem Browser, kopieren Sie den Beschreibungstext und fügen Sie ihn unten in "Reinen Text einfügen" ein.',"aiBot.kb.blockedGoogle":"Google Docs / Drive / Sheets-Seiten erfordern eine Anmeldung und können nicht abgerufen werden. Exportieren Sie als PDF/DOCX/TXT und laden Sie es stattdessen hoch.","aiBot.kb.blockedSocial":'Soziale Netzwerke blockieren automatisierte Anfragen. Kopieren Sie den relevanten Text und fügen Sie ihn unten in "Reinen Text einfügen" ein.',"aiBot.kb.blockedNotion":"Notion-Seiten werden mit JS gerendert und liefern wenig Text. Exportieren Sie die Seite als Markdown/PDF und laden Sie sie stattdessen hoch.","aiBot.kb.plainTextTitle":"Reinen Text einfügen","aiBot.kb.textTitlePlaceholder":'Titel (optional, z.B. "Rückerstattungsrichtlinie")',"aiBot.kb.textBodyPlaceholder":"Fügen Sie beliebigen Text ein, den die KI kennen sollte — Preise, FAQs, Richtlinien, Anweisungen…","aiBot.kb.charsLabel":"Zeichen","aiBot.kb.saveText":"Text speichern","aiBot.kb.saving":"Wird gespeichert…","aiBot.kb.trainingSources":"Trainingsquellen","aiBot.kb.sourceSingular":"Quelle","aiBot.kb.sourcePlural":"Quellen","aiBot.kb.chunkSingular":"Chunk","aiBot.kb.chunkPlural":"Chunks","aiBot.kb.empty":"Noch keine Trainingsquellen. Fügen Sie oben eine URL hinzu oder fügen Sie reinen Text ein.","aiBot.kb.deleteConfirm":"Diese Quelle löschen?","aiBot.kb.uploadTitle":"Dokumente hochladen","aiBot.kb.uploadPrompt":"Klicken Sie zum Auswählen einer Datei oder ziehen Sie sie hierher","aiBot.kb.uploadFormats":"PDF, DOCX, TXT, CSV, MD","aiBot.kb.uploadMaxSize":"Max. 10 MB pro Datei","aiBot.kb.parsing":"Wird verarbeitet…","aiBot.kb.parsingFile":"Verarbeitet","aiBot.esc.enableAuto":"Auto-Eskalation aktivieren","aiBot.esc.enableAutoDesc":"Automatisch an einen Menschen übergeben, wenn die KI nicht helfen kann oder der Kunde danach fragt.","aiBot.esc.maxAttempts":"Max. fehlgeschlagene Versuche","aiBot.esc.maxAttemptsHelp":"Übergabe nach so vielen aufeinanderfolgenden Fallback-Antworten (24h-Fenster).","aiBot.esc.triggerPhrases":"Trigger-Phrasen (eine pro Zeile)","aiBot.esc.triggerPhrasesHelp":"Wenn eine dieser Phrasen in einer eingehenden Nachricht erscheint, eskaliert der Bot sofort. Groß-/Kleinschreibung wird ignoriert, Substring-Match.","aiBot.esc.message":"Eskalations-Nachricht","aiBot.esc.messageHelp":"Wird an den Kunden gesendet, kurz bevor der Bot aufhört zu antworten, damit ein Mensch übernehmen kann.","aiBot.esc.saveRules":"Eskalationsregeln speichern","aiBot.esc.statusOn":"Ein","aiBot.esc.statusOff":"Aus","aiBot.preview.qaPairsLabel":"Q&A-Paare","aiBot.preview.sourcesLabel":"Quellen","aiBot.preview.chunksLabel":"Chunks","aiBot.preview.helpText":"Genau darauf hat die KI gerade Zugriff. Deaktivierte Elemente werden nicht verwendet.","aiBot.preview.escalationSummary":"Eskalation","aiBot.preview.escStatus":"Status","aiBot.preview.escThreshold":"Nach","aiBot.preview.escFailed":"aufeinanderfolgenden Fallback-Antworten","aiBot.preview.escPhrases":"Trigger-Phrasen","aiBot.preview.escNoPhrases":"keine","aiBot.preview.qaPairsTitle":"Q&A-Paare","aiBot.preview.sourcesTitle":"Trainingsquellen","aiBot.preview.noQa":"Keine aktivierten Q&A-Paare.","aiBot.preview.noSources":"Keine aktivierten Quellen.","aiBot.fallbackMoved":"Die Fallback-Antwort wurde in den KI-Verhalten-Tab verschoben. Ihre vorhandene Nachricht wird automatisch beibehalten.","aiBot.businessPromptMoved":"Der Geschäfts-Prompt wurde in den KI-Verhalten-Tab verschoben. Bearbeiten Sie ihn dort — Ihr vorhandener Prompt wird beibehalten.","aiBot.generalKnowledgeMoved":'Der Schalter "KI darf Allgemeinwissen verwenden" wurde in den KI-Verhalten-Tab verschoben.',"aiBot.stopKeywordsRecommend":"Für neue Setups empfehlen wir den Eskalations-Tab — er fügt einen Versuchszähler und Trigger-Phrasen zusätzlich zu Keyword-Stopps hinzu. Dieser Abschnitt funktioniert weiterhin nur für Keyword-Stopps.","aiBot.subtitle":"Automatische KI-Antworten konfigurieren","aiBot.menu":"Menü","aiBot.enableBot":"KI-Bot aktivieren","aiBot.enableBotDesc":"Automatisch auf eingehende Nachrichten antworten","aiBot.replyInGroups":"In Gruppen antworten","aiBot.replyInGroupsDesc":"KI-Bot erlauben, in Gruppenchats zu antworten (standardmäßig deaktiviert)","aiBot.allowGeneralKnowledge":"KI-Allgemeinwissen erlauben","aiBot.allowGeneralKnowledgeDesc":"Wenn AUS, antwortet KI nur basierend auf Ihrem Geschäfts-Prompt. Wenn AN, kann KI auch sein Allgemeinwissen nutzen.","aiBot.fallbackReply":"Ersatzantwort","aiBot.fallbackReplyDesc":"Wenn die KI keine Informationen in Ihrem Geschäfts-Prompt hat, wird diese Antwort gesendet, anstatt Antworten zu erfinden.","aiBot.fallbackReplyPlaceholder":"Beispiel: Vielen Dank für Ihre Frage! Ich habe derzeit keine spezifischen Informationen dazu. Unser Team wird sich bald bei Ihnen melden.","aiBot.smartDetection":"Intelligente Erkennung","aiBot.smartDetectionDesc":"KI erkennt automatisch Frustration oder Anfragen nach menschlicher Unterstützung","aiBot.monday":"Montag","aiBot.tuesday":"Dienstag","aiBot.wednesday":"Mittwoch","aiBot.thursday":"Donnerstag","aiBot.friday":"Freitag","aiBot.saturday":"Samstag","aiBot.sunday":"Sonntag","aiBot.enableWeekdays":"Wochentage aktivieren","aiBot.disableWeekdays":"Wochentage deaktivieren","aiBot.enableWeekends":"Wochenenden aktivieren","aiBot.disableWeekends":"Wochenenden deaktivieren","aiBot.applyToAll":"Auf alle anwenden:","aiBot.apply":"Anwenden","aiBot.day":"Tag","aiBot.active":"Aktiv","aiBot.currentStatus":"Aktueller Status:","aiBot.botOffToday":"Bot ist heute AUS","aiBot.businessPrompt":"Geschäfts-Prompt","aiBot.businessPromptDesc":"Passen Sie an, wie die KI antwortet. Beschreiben Sie Ihr Geschäft, Ton und Richtlinien.","aiBot.businessPromptPlaceholder":"Beispiel: Sie sind Kundenservice-Mitarbeiter für [Firmenname]. Wir verkaufen [Produkt/Dienstleistung]. Seien Sie freundlich und professionell.","aiBot.schedule":"Bot-Zeiten","aiBot.scheduleEnabled":"Zeitplan aktivieren","aiBot.scheduleEnabledDesc":"Bot antwortet nur während festgelegter Tage und Zeiten","aiBot.startTime":"Startzeit","aiBot.endTime":"Endzeit","aiBot.to":"bis","aiBot.timezone":"Zeitzone","aiBot.replyTiming":"Antwort-Timing","aiBot.replyTimingDesc":"Zufällige Verzögerung vor KI-Antwort","aiBot.minDelay":"Min. Verzögerung (Sek.)","aiBot.maxDelay":"Max. Verzögerung (Sek.)","aiBot.enabledActions":"Aktivierte Aktionen","aiBot.enabledActionsDesc":"Wählen Sie, welche Aktionen die KI ausführen kann","aiBot.actionNormalReply":"Antwort senden","aiBot.actionNormalReplyDesc":"KI sendet Textnachrichten","aiBot.actionKanban":"Kanban aktualisieren","aiBot.actionKanbanDesc":"Kontakte zwischen Kanban-Stufen verschieben","aiBot.actionLabels":"Labels aktualisieren","aiBot.actionLabelsDesc":"WhatsApp-Labels hinzufügen/entfernen","aiBot.actionTabs":"Tabs aktualisieren","aiBot.actionTabsDesc":"Zu benutzerdefinierten Tabs hinzufügen/entfernen","aiBot.actionAppointment":"Termin erstellen","aiBot.actionAppointmentDesc":"Termine aus Gesprächen planen","aiBot.tabsPromptLabel":"Benutzerdefinierte Anweisungen für Tab-Verwaltung:","aiBot.tabsPromptPlaceholder":'Z.B. Wenn Benutzer nach SEO-Diensten fragt, zu "SEO Leads" Tab hinzufügen...',"aiBot.meetingLinkLabel":"Google Meet Link:","aiBot.meetingLinkPlaceholder":"https://meet.google.com/xxx-xxxx-xxx","aiBot.meetingLinkDesc":"Dieser Link wird für alle KI-erstellten Termine verwendet","aiBot.messageTemplateLabel":"Nachrichtenvorlage:","aiBot.messageTemplateDesc":"Diese Nachricht wird als Terminerinnerung gesendet","aiBot.varName":"Name","aiBot.varDate":"Datum","aiBot.varTime":"Zeit","aiBot.varLink":"Link","aiBot.messageTemplatePlaceholder":"Hallo {name}, Ihr Termin ist für {date} um {time} geplant. Hier beitreten: {link}","aiBot.officeHoursLabel":"Bürozeiten (Terminzeiten):","aiBot.officeHoursDesc":"KI plant nur Termine innerhalb dieser Zeiten","aiBot.sendMessageNow":"Nachricht sofort senden","aiBot.sendMessageNowDesc":"Terminnachricht direkt nach Erstellung senden","aiBot.appointmentPromptLabel":"Benutzerdefinierte KI-Anweisungen:","aiBot.appointmentPromptPlaceholder":"Z.B. Bei Terminplanung immer Zeitfenster zwischen 10-18 Uhr vorschlagen...","aiBot.actionProfile":"Profil aktualisieren","aiBot.actionProfileDesc":"Kontaktinformationen extrahieren und speichern","aiBot.contextMessages":"Kontext-Nachrichten","aiBot.contextMessagesDesc":"Anzahl vergangener Nachrichten für KI-Kontext","aiBot.settingsTab":"Einstellungen","aiBot.promptSettings":"Prompt-Einstellungen","aiBot.actionPrompts":"Aktions-Prompts","aiBot.actionPromptsDesc":"Benutzerdefinierte Prompts für verschiedene KI-Aktionen konfigurieren","aiBot.talkToAI":"Mit KI sprechen","aiBot.testYourBot":"Testen Sie Ihren KI-Bot","aiBot.testDescription":"Nachrichten verwenden aktuelle Einstellungen (inkl. ungespeicherter Änderungen)","aiBot.clearChat":"Chat löschen","aiBot.typeTestMessage":"Testnachricht eingeben...","aiBot.aiTyping":"KI schreibt...","aiBot.noMessages":"Geben Sie eine Nachricht ein, um die Antwort Ihres KI-Bots zu testen","aiBot.send":"Senden","aiBot.copy":"Kopieren","aiBot.copied":"Kopiert!","aiBot.select":"Auswählen","aiBot.aiNotConfigured":"KI nicht konfiguriert. Bitte richten Sie zuerst den KI-API-Schlüssel ein.","aiBot.noResponse":"Keine Antwort von der KI","aiBot.stopKeywords":"Stopp-Schlüsselwörter","aiBot.stopKeywordsInfo":"Wenn der Kunde eines dieser Schlüsselwörter sendet, stoppt der KI-Bot die Antworten und setzt ihn auf die schwarze Liste.","aiBot.enableStopKeywords":"Stopp-Schlüsselwörter aktivieren","aiBot.enableStopKeywordsDesc":"KI-Bot automatisch stoppen, wenn der Kunde menschliche Unterstützung anfordert","aiBot.keywords":"Schlüsselwörter","aiBot.noKeywords":"Noch keine Schlüsselwörter hinzugefügt","aiBot.enterKeyword":"Schlüsselwort eingeben...","aiBot.add":"+ Hinzufügen","aiBot.stopMessage":"Stopp-Nachricht","aiBot.stopMessagePlaceholder":"Nachricht, die bei Erkennung eines Stopp-Schlüsselworts gesendet wird...","aiBot.stopMessageHint":"Diese Nachricht wird an den Kunden gesendet, wenn ein Stopp-Schlüsselwort erkannt wird.","aiBot.responseMode":"Antwortmodus:","aiBot.aiBotPrompt":"KI-Bot Prompt","aiBot.globalChatGPT":"Globales ChatGPT","aiBot.newChat":"Neuer Chat","aiBot.clearAll":"Alle löschen","aiBot.searchChats":"Chats suchen...","aiBot.noSearchResults":"Keine Chats gefunden","aiBot.noChatsYet":"Noch kein Chatverlauf","aiBot.deleteChat":"Chat löschen","aiBot.chatsStored":"Chats gespeichert","aiBot.clearAllTitle":"Alle Chats löschen?","aiBot.clearAllDesc":"Dies löscht dauerhaft Ihren gesamten Chatverlauf. Diese Aktion kann nicht rückgängig gemacht werden.","aiBot.messages":"Nachrichten","aiBot.today":"Heute","aiBot.yesterday":"Gestern","crm.aiBotBlacklist":"KI-Bot","crm.aiBotEnabled":"Für diesen Kontakt aktiviert","crm.aiBotDisabled":"Für diesen Kontakt deaktiviert","common.saved":"Gespeichert","crm.chatbotFlow":"Chatbot-Flow","crm.chatbotFlowDesc":"Erstellen Sie keyword-basierte Auto-Reply-Bots","crm.createNewFlow":"Neuen Flow erstellen","crm.noFlowsYet":"Noch keine Flows","crm.createFirstFlow":"Erstellen Sie Ihren ersten Chatbot-Flow","crm.active":"Aktiv","crm.inactive":"Inaktiv","crm.flowName":"Flow-Name","crm.untitledFlow":"Unbenannter Flow","crm.duplicate":"Duplizieren","crm.triggers":"Auslöser","crm.actions":"Aktionen","crm.rules":"Regeln","crm.chatbotFlows":"Chatbot-Flows","crm.exportFlows":"Exportieren","crm.importFlows":"Importieren","crm.exportAll":"Alle exportieren","crm.exportSelected":"Ausgewählte exportieren","crm.selectFlowsToExport":"Flows zum Exportieren auswählen","crm.importSuccess":"Flows erfolgreich importiert!","crm.importError":"Fehler beim Importieren der Flows","crm.invalidFlowFile":"Ungültiges Flow-Dateiformat","crm.duplicateFlowFound":"Doppelter Flow gefunden","crm.flowAlreadyExists":"'{name}' existiert bereits. Was möchten Sie tun?","crm.replaceFlow":"Ersetzen","crm.skipFlow":"Überspringen","crm.renameAndAdd":"Umbenennen und hinzufügen","crm.noFlowsSelected":"Bitte wählen Sie mindestens einen Flow aus","crm.noFlowsToExport":"Keine Flows zum Exportieren","crm.flowsExported":"{count} Flow(s) exportiert","crm.flowsImported":"{count} Flow(s) importiert","crm.selected":"ausgewählt","crm.enabled":"Aktiviert","crm.allFlows":"Alle","crm.byCategory":"Kategorien","crm.viewAllFlows":"Alle Flows anzeigen","crm.viewByCategory":"Nach Kategorie anzeigen","crm.addFluxoCategory":"Kategorie hinzufügen","crm.manageCategories":"Kategorien verwalten","crm.editCategory":"Kategorie bearbeiten","crm.createCategory":"Kategorie erstellen","crm.createCategoryBtn":"Kategorie erstellen","crm.fluxoCategoryName":"Name","crm.categoryIcon":"Symbol","crm.categoryColor":"Farbe","crm.preview":"Vorschau","crm.custom":"Benutzerdefiniert","crm.enterFluxoCategoryName":"Kategorienamen eingeben","crm.fluxoCategoryNameRequired":"Kategoriename ist erforderlich","crm.fluxoCategoryNameExists":"Eine Kategorie mit diesem Namen existiert bereits","crm.confirmDeleteCategory":"Diese Kategorie löschen? Flows werden zu Unkategorisiert verschoben.","crm.uncategorized":"Unkategorisiert","crm.noFlowsInCategory":"Keine Flows in dieser Kategorie","crm.dragFlowsHere":"Flows hierher ziehen zum Organisieren","crm.dropHere":"Hier ablegen","crm.dragToMove":"Ziehen zum Verschieben","crm.noCategoriesYet":"Noch keine Kategorien","crm.createCategoryHint":"Erstellen Sie eine Kategorie, um Ihre Flows zu organisieren","crm.createFirstCategory":"Erste Kategorie erstellen","crm.tourViewToggleTitle":"Ansicht wechseln","crm.tourViewToggleContent":"Wechseln Sie zwischen Alle Flows und Kategorie-Ansicht, um Ihre Chatbot-Flows zu organisieren.","crm.tourCategoryViewTitle":"Kategorie-Ansicht","crm.tourCategoryViewContent":"Klicken Sie hier, um Ihre Flows nach Kategorien organisiert zu sehen.","crm.tourAddCategoryTitle":"Kategorien erstellen","crm.tourAddCategoryContent":"Klicken Sie hier, um eine neue Kategorie mit benutzerdefiniertem Namen, Symbol und Farbe zu erstellen.","crm.tourDragDropTitle":"Drag & Drop","crm.tourDragDropContent":"Ziehen Sie eine Flow-Karte und legen Sie sie in einer Kategorie ab, um Ihre Flows zu organisieren.","crm.tourCategorySectionTitle":"Kategorie-Abschnitte","crm.tourCategorySectionContent":"Klicken Sie, um Kategorien zu erweitern oder zu reduzieren. Bearbeiten oder löschen Sie Kategorien mit den Schaltflächen.","crm.skipTour":"Überspringen","crm.finishTour":"Verstanden!","crm.next":"Weiter","crm.previous":"Zurück","crm.simulateFlow":"Flow simulieren","crm.start":"Starten","crm.actionBlocks":"Aktionsblöcke","crm.anyMessage":"Jede Nachricht","crm.keywords":"Schlüsselwörter","crm.addKeyword":"Schlüsselwort hinzufügen","crm.firstMessageOfDay":"Erste Nachricht des Tages","crm.firstMessageEver":"Allererste Nachricht","crm.sendText":"Text senden","crm.sendTextDesc":"Eine Textnachricht senden.","crm.sendImage":"Bild senden","crm.sendImageDesc":"Ein Bild mit Beschriftung senden.","crm.sendVideo":"Video senden","crm.sendVideoDesc":"Ein Video mit Beschriftung senden.","crm.sendAudio":"Audio senden","crm.sendAudioDesc":"Eine Audiodatei senden.","crm.sendDocument":"Dokument senden","crm.sendDocumentDesc":"Eine Dokumentdatei senden.","crm.responses":"Antworten","crm.responsesDesc":"Auf Benutzerantwort warten und Flow verzweigen.","crm.sendList":"Liste senden","crm.sendListDesc":"Eine interaktive Listennachricht senden.","fluxo.waitInput":"Auf Eingabe warten","fluxo.waitInputDesc":"Auf validierte Benutzerantwort warten","fluxo.promptMessage":"Eingabeaufforderung","fluxo.enterPromptMessage":"Eingabeaufforderung für Benutzereingabe eingeben...","fluxo.inputType":"Eingabetyp (Validierung)","fluxo.inputTypeString":"Text (Beliebig)","fluxo.inputTypePhone":"Telefonnummer","fluxo.inputTypeNumber":"Zahl","fluxo.inputTypeEmail":"E-Mail","fluxo.inputTypeUrl":"URL","fluxo.inputTypeDatetime":"Datum/Zeit","fluxo.phoneHint":"Format: +491234567890 (mit Ländervorwahl)","fluxo.emailHint":"Format: user@example.com","fluxo.numberHint":"Akzeptiert Ganzzahlen und Dezimalzahlen","fluxo.urlHint":"Format: https://example.com","fluxo.datetimeHint":"Format: YYYY-MM-DD oder YYYY-MM-DDTHH:MM","fluxo.stringHint":"Akzeptiert beliebige Texteingabe","fluxo.saveResponseAs":"Antwort als Variable speichern","fluxo.variableName":"userInput","fluxo.useVariableHint":"{variableName} in späteren Nachrichten verwenden","fluxo.errorMessage":"Fehlermeldung (bei ungültiger Eingabe)","fluxo.invalidInputDefault":"Ungültige Eingabe. Bitte versuchen Sie es erneut.","fluxo.timeout":"Timeout","fluxo.seconds":"Sekunden","fluxo.minutes":"Minuten","fluxo.hours":"Stunden","fluxo.timeoutHint":"Wenn keine gültige Antwort innerhalb dieser Zeit erfolgt, wird der Timeout-Zweig ausgeführt.","fluxo.customRegex":"Benutzerdefinierter Regex (Optional)","fluxo.regexPlaceholder":"^[A-Z]{2}[0-9]{4}$","fluxo.customRegexHint":"Überschreibt Eingabetyp-Validierung mit benutzerdefiniertem Muster","fluxo.outputConnections":"Ausgangsverbindungen","fluxo.response":"Antwort","fluxo.validInputReceived":"Wenn gültige Eingabe empfangen wird","fluxo.noResponseTimeout":"Wenn Timeout ohne gültige Antwort abläuft","fluxo.validResponse":"Gültige Antwort","fluxo.onInvalidInput":"Bei ungültiger Eingabe:","fluxo.promptMessageInfo":"Die Nachricht, die an den Benutzer gesendet wird und um Eingabe bittet. Diese wird vor dem Warten auf die Antwort angezeigt.","fluxo.inputTypeInfo":"Wählen Sie den erwarteten Eingabetyp. Das System validiert die Benutzerantwort gegen dieses Format.","fluxo.saveResponseAsInfo":"Der Variablenname zum Speichern der gültigen Benutzerantwort. Verwenden Sie {variablenName} in späteren Nachrichten, um diesen Wert anzuzeigen.","fluxo.errorMessageInfo":"Nachricht, die gesendet wird, wenn die Eingabe nicht dem erwarteten Format entspricht. Der Benutzer wird gebeten, es erneut zu versuchen.","fluxo.timeoutInfo":"Maximale Wartezeit auf eine gültige Antwort. Bei Überschreitung wird der Timeout-Zweig statt des Antwort-Zweigs ausgeführt.","fluxo.customRegexInfo":"Erweitert: Geben Sie ein benutzerdefiniertes Regex-Muster zur Eingabevalidierung an. Dies überschreibt die Validierung des ausgewählten Eingabetyps.","fluxo.delayInfo":"Wartezeit in Sekunden vor dem Senden der Eingabeaufforderung. Nützlich für einen natürlichen Gesprächsfluss.","crm.groupAction":"Gruppenaktion","crm.tabAction":"Tab-Aktion","crm.labelAction":"Label-Aktion","crm.crmAction":"CRM-Aktion","crm.smartWait":"Smart Warten","crm.smartWaitDesc":"Zufällige Wartezeit zwischen Nachrichten","crm.typingIndicator":"Tipp-Anzeige","crm.typingIndicatorDesc":"Tipp-Blase vor dem Senden anzeigen","crm.waitDuration":"Wartezeit:","crm.typingDuration":"Tipp-Dauer:","crm.randomDelay":"Zufällige Verzögerung:","crm.randomDelayBetween":"Zufällige Verzögerung zwischen","crm.randomBetween":"Zufällige Verzögerung zwischen","crm.showsTypingFor":"Zeigt Tipp-Anzeige für","crm.showsTyping":"Zeigt Tippen für","crm.typingPreview":"So erscheint die Tipp-Anzeige beim Kontakt","crm.addFluxo":"Fluxo hinzufügen","crm.addFluxoDesc":"Einen anderen Flow ausführen","crm.selectFlowToCall":"Flow zum Ausführen auswählen:","crm.noFlowSelected":"Kein Flow ausgewählt","crm.passVariables":"Variablen an aufgerufenen Flow übergeben","crm.passVariablesHint":"Variablen des aktuellen Flows sind im aufgerufenen Flow verfügbar","crm.passVariablesUseCase":'💡 Beispiel: Hauptflow hat {name}="Max" → Sub-Flow Nachricht "Hallo {name}!" → Zeigt "Hallo Max!". AUS = Sub-Flow startet ohne Variablen.',"crm.passVariablesShort":"Vars übergeben","crm.continueAfterFlow":"Nach Ende des aufgerufenen Flows fortfahren","crm.continueAfterFlowHint":"Deaktivieren, um Konversation zu beenden, wenn aufgerufener Flow abgeschlossen ist","crm.continueAfterFlowUseCase":"💡 Beispiel: AN = Willkommen-Sub-Flow endet → zurück zum Hauptflow. AUS = Sub-Flow endet = Gespräch endet (wie Bestellung-Abgeschlossen-Flow).","crm.continueAfterShort":"Danach fortfahren","crm.circularWarning":"Warnung: Zirkuläre Referenz erkannt!","crm.circularWarningHint":"Der ausgewählte Flow enthält einen 'Fluxo hinzufügen'-Knoten, der auf diesen Flow verweist. Dies kann zu Endlosschleifen führen.","crm.selectFlowPlaceholder":"Flow auswählen...","crm.noOtherFlows":"Keine anderen Flows verfügbar. Erstellen Sie zuerst einen anderen Flow.","crm.delayBeforeCalling":"Verzögerung vor Aufruf (Sekunden):","crm.executionSummary":"Ausführungsübersicht:","crm.variablesWillBe":"Variablen werden","crm.passed":"übergeben","crm.notPassed":"nicht übergeben","crm.executeFlow":"Ausführen","crm.continueToNext":"Zum nächsten Knoten fortfahren","crm.endConversation":"Konversation beenden","crm.selectedFlow":"Ausgewählter Flow:","crm.addToGroups":"Zu Gruppen hinzufügen","crm.removeFromGroups":"Aus Gruppen entfernen","crm.addToTabs":"Zu Tabs hinzufügen","crm.removeFromTabs":"Aus Tabs entfernen","crm.addLabels":"Labels hinzufügen","crm.removeLabels":"Labels entfernen","crm.addToCrmStage":"Zu CRM-Phase hinzufügen","crm.removeFromCrm":"Aus CRM entfernen","crm.actionType":"Aktionstyp:","crm.selectGroups":"Gruppen auswählen:","crm.loadGroups":"Gruppen laden","crm.loadGroupsFromWhatsApp":"Gruppen aus WhatsApp Web laden","crm.selectTabs":"Benutzerdefinierte Tabs auswählen:","crm.selectLabels":"WhatsApp-Labels auswählen:","crm.syncLabels":"Labels synchronisieren","crm.searchLabels":"Labels suchen...","crm.searchTabs":"Tabs suchen...","crm.searchGroups":"Gruppen suchen...","crm.selectCrm":"CRM auswählen:","crm.selectStage":"Phase auswählen:","crm.selectCrmPlaceholder":"CRM auswählen...","crm.selectStagePlaceholder":"Phase auswählen...","crm.noGroupsSelected":"Keine Gruppen ausgewählt","crm.noTabsSelected":"Keine Tabs ausgewählt","crm.noLabelsSelected":"Keine Labels ausgewählt","crm.noCrmSelected":"Kein CRM/Phase ausgewählt","crm.noGroupsAvailable":"Keine Gruppen verfügbar.","crm.noTabsAvailable":"Keine benutzerdefinierten Tabs verfügbar.","crm.noCrmsAvailable":"Keine CRMs verfügbar.","crm.noStagesAvailable":"Keine Phasen in diesem CRM.","crm.delay":"Verzögerung (Sekunden):","crm.selectedGroups":"Gruppen:","crm.selectedTabs":"Tabs:","crm.selectedLabels":"Labels:","crm.targetCrmStage":"Ziel-CRM → Phase:","crm.targetCrm":"Ziel-CRM:","crm.schedule":"Zeitplan","crm.enableSchedule":"Zeitplan aktivieren","crm.startTime":"Startzeit","crm.endTime":"Endzeit","crm.crmRules":"CRM-Regeln","crm.whenAnyMessage":"Wenn eine beliebige Nachricht empfangen wird.","crm.whenKeywordMatch":"Wenn die Nachricht Schlüsselwörter enthält.","crm.byKeywordInMessage":"Nach Schlüsselwort in der Nachricht","crm.firstMessageDay":"Erste Nachricht des Kunden am Tag.","crm.reactivationInterval":"Reaktivierungsintervall:","crm.generalRules":"Allgemeine Regeln:","crm.allowGroups":"Antworten auf Gruppen erlauben","crm.scheduleEnabled":"Antworten nur an bestimmten Tagen und Zeiten erlauben","crm.dontRespondIfOpen":"Nicht antworten, wenn die Konversation geöffnet ist","crm.customSignature":"Signatur anpassen oder deaktivieren","crm.simulateTyping":"Tippen oder Audioaufnahme simulieren","crm.dontRespondIfInCRM":"Nicht antworten, wenn der Kontakt in einem CRM ist","crm.dontRespondToCRMs":"Nicht auf CRMs antworten","crm.respondOnlyToCRMs":"Nur auf CRMs antworten","crm.enableCrmRules":"CRM-Tab-Regeln aktivieren","crm.selectCrmTabs":"CRM-Tabs auswählen","crm.tagRules":"Tag-Regeln","crm.labelRules":"Label-Regeln:","crm.dontRespondIfLabeled":"Nicht antworten, wenn der Kontakt ein Label hat","crm.dontRespondToLabels":"Nicht auf diese Labels antworten","crm.respondOnlyToLabels":"Nur auf diese Labels antworten","crm.selectLabelsNotToReply":"Labels auswählen, auf die nicht geantwortet wird:","crm.selectLabelsToReply":"Labels auswählen, auf die geantwortet wird:","crm.clickToSelect":"Klicken zum Auswählen","crm.labelsNotReplied":"Labels, die nicht beantwortet werden:","crm.labelsToReply":"Labels, die beantwortet werden:","crm.customTabRules":"Benutzerdefinierte Tab-Regeln:","crm.dontRespondIfInCustomTab":"Nicht antworten, wenn der Kontakt in einem benutzerdefinierten Tab ist","crm.dontRespondToCustomTabs":"Nicht auf diese benutzerdefinierten Tabs antworten","crm.respondOnlyToCustomTabs":"Nur auf diese benutzerdefinierten Tabs antworten","crm.selectCustomTabsNotToReply":"Benutzerdefinierte Tabs auswählen, auf die nicht geantwortet wird:","crm.selectCustomTabsToReply":"Benutzerdefinierte Tabs auswählen, auf die geantwortet wird:","crm.customTabsNotReplied":"Benutzerdefinierte Tabs, die nicht beantwortet werden:","crm.customTabsToReply":"Benutzerdefinierte Tabs, die beantwortet werden:","crm.noCustomTabsAvailable":"Keine benutzerdefinierten Tabs verfügbar. Erstellen Sie zuerst einen.","crm.pauseRules":"Pausenregeln:","crm.enablePause":"Pause aktivieren","crm.pauseClientKeywords":"Kunden-Pause-Schlüsselwörter","crm.pauseClientPlaceholder":"Chatbot pausieren, wenn der Empfänger...","crm.pauseServerKeywords":"Server-Pause-Schlüsselwörter","crm.pauseServerPlaceholder":"Pausieren, wenn Bot sendet...","crm.pauseDuration":"Pausendauer (SS:MM)","crm.tipPauseTitle":"Pausenregeln","crm.tipPauseDesc":"Chatbot pausieren, wenn bestimmte Schlüsselwörter erkannt werden. Verwenden Sie Kunden-Schlüsselwörter, damit Kunden den Bot pausieren können, oder Server-Schlüsselwörter für automatisches Pausieren nach bestimmten Nachrichten.","crm.tipPauseEx1":"Kunde sagt 'stop' → Bot pausiert","crm.tipPauseEx2":"Kunde sagt 'mensch' → An Mitarbeiter weiterleiten","crm.tipPauseEx3":"Bot sendet 'verbinde...' → Automatische Pause","crm.tipPauseClientTitle":"Kunden-Pause-Schlüsselwörter","crm.tipPauseClientDesc":"Schlüsselwörter, die wenn vom Kunden gesendet, den Chatbot für diesen Chat pausieren. Nützlich für die Übergabe an Menschen.","crm.tipPauseClientEx1":"Kunde tippt 'stop' oder 'pause'","crm.tipPauseClientEx2":"Kunde tippt 'mensch' oder 'mitarbeiter'","crm.tipPauseClientEx3":"Bot reagiert für die eingestellte Dauer nicht mehr","crm.tipPauseServerTitle":"Server-Pause-Schlüsselwörter","crm.tipPauseServerDesc":"Schlüsselwörter, die wenn vom Bot gesendet, den Chatbot automatisch pausieren. Nützlich bei der Weiterleitung an menschliche Agenten.","crm.tipPauseServerEx1":"Bot sendet 'Verbinde Sie mit einem Agenten...'","crm.tipPauseServerEx2":"Bot sendet 'Bitte warten, leite weiter...'","crm.tipPauseServerEx3":"Flow pausiert automatisch nach dieser Nachricht","crm.tipPauseDurationTitle":"Pausendauer","crm.tipPauseDurationDesc":"Legen Sie fest, wie lange der Chatbot nach Erkennung eines Pause-Schlüsselworts pausiert bleibt. Format: Stunden:Minuten (z.B. 00:30 = 30 Minuten).","crm.tipPauseDurationEx1":"00:30 = 30 Minuten Pause","crm.tipPauseDurationEx2":"01:00 = 1 Stunde Pause","crm.tipPauseDurationEx3":"Nach Ablauf bleibt pausiert bis neuer Auslöser","crm.enableTagRules":"WhatsApp-Label-Regeln aktivieren","crm.editBlock":"Block bearbeiten:","crm.close":"Schließen","crm.startNode":"Start","crm.startNodeInfo":"Dies ist der Startpunkt Ihres Flows. Verbinden Sie ihn mit anderen Blöcken, um Ihren Chatbot zu erstellen.","crm.editTextMessage":"Textnachricht bearbeiten:","crm.typeTheText":"Text eingeben","crm.saveResponseInVariable":"Antwort in Variable speichern:","crm.typeVariableName":"Variablenname eingeben","crm.variableHint":"Die Variable speichert die Kundenantwort vom aktuellen Block und kann in nachfolgenden Blöcken verwendet werden","crm.insertImage":"Bild einfügen:","crm.clickToUpload":"Klicken zum Senden oder Dateien hierher ziehen","crm.imageFormats":"Bild: PNG, JPG, JPEG, GIF (max 16MB - WhatsApp-Limit)","crm.imageCaption":"Bildbeschreibung (optional)","crm.insertVideo":"Video einfügen:","crm.insertAudio":"Audio einfügen:","crm.insertDocument":"Dokument einfügen:","crm.caption":"Beschreibung:","crm.captionOptional":"Beschreibung (optional)","crm.questionMessage":"Fragenachricht:","crm.typeQuestion":"Ihre Frage eingeben...","crm.responseOptions":"Antwortoptionen:","crm.addOption":"Option hinzufügen","crm.buttonText":"Buttontext:","crm.title":"Titel:","crm.listTitleOptional":"Listentitel (optional)","crm.listDescOptional":"Beschreibung (optional)","crm.listSectionsHint":"Listenabschnitte und Elemente in den erweiterten Einstellungen konfigurieren.","crm.globalSettings":"Globale Einstellungen:","crm.editAwayMessage":"Abwesenheitsnachricht bearbeiten:","crm.awayMessagePlaceholder":"Nachricht eingeben, die gesendet wird, wenn der Benutzer nicht antwortet...","crm.waitingTime":"Wartezeit:","crm.waitingTimeWarning":"Wenn die WhatsApp-Seite neu geladen wird, geht diese Einstellung für wartende Konversationen verloren","crm.minutes":"Minuten","crm.hours":"Stunden","crm.seconds":"Sekunden","crm.awayMessageInfo":"Diese Nachricht wird automatisch gesendet, wenn der Benutzer nicht innerhalb der angegebenen Zeit antwortet.","crm.blockInterval":"Block-Intervall:","crm.blockIntervalInfo":"Definieren Sie das Standardintervall zwischen dem Senden von Flow-Blöcken.","crm.chatSimulator":"Chat-Simulator","crm.startConversation":"Konversation durch Senden einer Nachricht starten","crm.typeMessageHere":"Ihre Nachricht hier eingeben...","crm.callNextBlock":"Nächsten Block aufrufen","crm.whenItemSelected":"Wenn Element ausgewählt","crm.whenResponding":"Beim Antworten","crm.defaultNext":"Standard (keine Übereinstimmung)","crm.message":"Nachricht:","crm.listButton":"Buttontext:","crm.items":"Elemente","crm.listItems":"Listenelemente:","crm.addItem":"Element hinzufügen","crm.insertVariable":"Variable einfügen","crm.contactName":"Kontaktname","crm.currentDate":"Aktuelles Datum","crm.currentTime":"Aktuelle Uhrzeit","crm.defaultOption1":"Option 1","crm.defaultOption2":"Option 2","crm.noListItems":"Keine Elemente. Klicken Sie auf Bearbeiten, um Elemente hinzuzufügen.","crm.send_text":"Text senden","crm.send_image":"Bild senden","crm.send_video":"Video senden","crm.send_audio":"Audio senden","crm.send_document":"Dokument senden","crm.send_list":"Liste senden","crm.group_action":"Gruppenaktion","crm.tab_action":"Tab-Aktion","crm.label_action":"Label-Aktion","crm.crm_action":"CRM-Aktion","crm.wait_input":"Auf Eingabe warten","crm.smart_wait":"Intelligente Wartezeit","crm.typing_indicator":"Tippanzeige","crm.add_fluxo":"Fluxo hinzufügen","crm.timezone":"Zeitzone:","crm.day":"Tag","crm.sunday":"Sonntag","crm.monday":"Montag","crm.tuesday":"Dienstag","crm.wednesday":"Mittwoch","crm.thursday":"Donnerstag","crm.friday":"Freitag","crm.saturday":"Samstag","crm.disableSignature":"Signatur deaktivieren","crm.customizeSignatureName":"Namen der Signatur anpassen","crm.enterCustomSignature":"Benutzerdefinierten Signaturnamen eingeben","crm.tipAnyMsgTitle":"Beliebiger Nachrichten-Trigger","crm.tipAnyMsgDesc":"Der Flow wird gestartet, wenn IRGENDEINE Nachricht von einem Kunden empfangen wird, unabhängig vom Inhalt.","crm.tipAnyMsgEx1":"Allgemeine automatische Antwort für alle Nachrichten","crm.tipAnyMsgEx2":"Abwesenheitsnachricht wenn nicht verfügbar","crm.tipAnyMsgEx3":"Kann zu häufig auslösen - mit Reaktivierungsintervall verwenden","crm.tipKeywordTitle":"Schlüsselwort-Trigger","crm.tipKeywordDesc":"Der Flow wird NUR gestartet, wenn die Nachricht eines der angegebenen Schlüsselwörter enthält.","crm.tipKeywordEx1":"'hallo' löst Begrüßungs-Flow aus","crm.tipKeywordEx2":"'preis' löst Produktinfo aus","crm.tipKeywordEx3":"'hilfe' löst Support-Menü aus","crm.tipFirstDayTitle":"Erste Nachricht des Tages","crm.tipFirstDayDesc":"Der Flow wird NUR bei der ersten täglich empfangenen Nachricht jedes Kontakts ausgelöst.","crm.tipFirstDayEx1":"'Guten Morgen' Gruß nur einmal am Tag","crm.tipFirstDayEx2":"Tägliche Sonderaktion für jeden Kontakt","crm.tipFirstDayEx3":"Setzt um Mitternacht basierend auf Zeitzone zurück","crm.tipFirstEverTitle":"Allererste Nachricht","crm.tipFirstEverDesc":"Der Flow wird NUR ausgelöst, wenn ein Kontakt zum ersten Mal eine Nachricht sendet.","crm.tipFirstEverEx1":"Willkommensnachricht für neue Kontakte","crm.tipFirstEverEx2":"Onboarding-Sequenz für Neukunden","crm.tipFirstEverEx3":"Initiale CRM-Zuweisung für neue Leads","crm.tipReactivationTitle":"Reaktivierungsintervall","crm.tipReactivationDesc":"Mindestzeit bevor derselbe Flow erneut für denselben Kontakt ausgelöst werden kann.","crm.tipReactivationEx1":"3600s = 1 Stunde vor erneutem Auslösen warten","crm.tipReactivationEx2":"Verhindert Auto-Antwort-Spam","crm.tipReactivationEx3":"0 verwenden für unbegrenztes Auslösen","crm.tipSendTextTitle":"Textnachricht senden","crm.tipSendTextDesc":"Sendet eine reine Textnachricht an den Kontakt. Unterstützt Variablen wie {name}, {phone}.","crm.tipSendTextEx1":"Personalisierte Willkommensnachrichten","crm.tipSendTextEx2":"Bestellbestätigungen","crm.tipSendImageTitle":"Bild senden","crm.tipSendImageDesc":"Sendet eine Bilddatei mit optionaler Beschriftung. Unterstützt PNG, JPG, GIF.","crm.tipSendImageEx1":"Produktbilder","crm.tipSendImageEx2":"Werbematerialien","crm.tipSendVideoTitle":"Video senden","crm.tipSendVideoDesc":"Sendet eine Videodatei mit optionaler Beschriftung. Unterstützt MP4, MOV.","crm.tipSendVideoEx1":"Produktdemos","crm.tipSendVideoEx2":"Tutorial-Videos","crm.tipSendAudioTitle":"Audio senden","crm.tipSendAudioDesc":"Sendet eine Audiodatei oder Sprachnotiz. Unterstützt MP3, OGG, WAV.","crm.tipSendAudioEx1":"Voraufgezeichnete Sprachnachrichten","crm.tipSendAudioEx2":"Audio-Ankündigungen","crm.tipSendDocTitle":"Dokument senden","crm.tipSendDocDesc":"Sendet jeden Dateityp als Dokument. Unterstützt PDF, DOC, XLS, etc.","crm.tipSendDocEx1":"Preiskataloge","crm.tipSendDocEx2":"Verträge und Vereinbarungen","crm.tipSendListTitle":"Listennachricht senden","crm.tipSendListDesc":"Sendet eine interaktive Liste mit Abschnitten und auswählbaren Elementen.","crm.tipSendListEx1":"Produktmenüs nach Kategorie","crm.tipSendListEx2":"Service-Optionen","crm.tipGroupActionTitle":"WhatsApp-Gruppenaktion","crm.tipGroupActionDesc":"Fügt den aktuellen Kontakt zu WhatsApp-Gruppen hinzu oder entfernt ihn.","crm.tipGroupActionEx1":"VIP-Kunden zur exklusiven Gruppe hinzufügen","crm.tipGroupActionEx2":"Nach Lösung aus Support-Gruppe entfernen","crm.tipTabActionTitle":"Benutzerdefinierte Tab-Aktion","crm.tipTabActionDesc":"Fügt den aktuellen Kontakt zu CRM-benutzerdefinierten Tabs hinzu oder entfernt ihn.","crm.tipTabActionEx1":"Lead zu 'Qualifiziert'-Tab verschieben","crm.tipTabActionEx2":"Aus 'Neue Anfrage'-Tab entfernen","crm.tipLabelActionTitle":"WhatsApp-Label-Aktion","crm.tipLabelActionDesc":"Fügt WhatsApp-Labels zum aktuellen Kontakt hinzu oder entfernt sie.","crm.tipLabelActionEx1":"'Beantwortet'-Label hinzufügen","crm.tipLabelActionEx2":"'Ausstehend'-Label entfernen","crm.tipCrmActionTitle":"CRM-Stufen-Aktion","crm.tipCrmActionDesc":"Verschiebt den aktuellen Kontakt zu einer bestimmten Stufe im CRM-Kanban.","crm.tipCrmActionEx1":"Zu 'Verhandlung'-Stufe verschieben","crm.tipCrmActionEx2":"Zu 'Abgeschlossen Gewonnen'-Stufe verschieben","crm.tipSmartWaitTitle":"Intelligente Wartezeit","crm.tipSmartWaitDesc":"Fügt zufällige Verzögerung zwischen Aktionen hinzu, um menschlicher zu wirken.","crm.tipSmartWaitEx1":"2-5 Sekunden zwischen Nachrichten warten","crm.tipSmartWaitEx2":"Natürliche Lesezeit simulieren","crm.tipTypingTitle":"Tippanzeige","crm.tipTypingDesc":"Zeigt 'tippt...'-Blase vor dem Senden der Nachricht an, um menschlicher zu wirken.","crm.tipTypingEx1":"3 Sekunden tippen vor Nachricht anzeigen","crm.tipTypingEx2":"Lässt Antworten natürlicher erscheinen","crm.tipAllowGroupsTitle":"Gruppen erlauben","crm.tipAllowGroupsDesc":"Wenn aktiviert, antwortet der Chatbot auch in Gruppenchats. Wenn deaktiviert, lösen nur private Chats den Flow aus.","crm.tipAllowGroupsEx1":"AN: In Gruppen und privat antworten","crm.tipAllowGroupsEx2":"AUS: Nur in privaten Chats antworten","crm.tipScheduleTitle":"Antworten planen","crm.tipScheduleDesc":"Beschränkt den Chatbot auf bestimmte Zeiten/Tage. Konfigurieren Sie den Zeitplan unten.","crm.tipScheduleEx1":"Nur Geschäftszeiten (9-18 Uhr)","crm.tipScheduleEx2":"Nur Werktage (Mo-Fr)","crm.tipScheduleEx3":"Automatische Antwort außerhalb der Zeiten","crm.tipDontRespondOpenTitle":"Nicht antworten wenn geöffnet","crm.tipDontRespondOpenDesc":"Verhindert, dass der Chatbot Nachrichten sendet, wenn Sie diese Konversation bereits in WhatsApp Web geöffnet haben.","crm.tipDontRespondOpenEx1":"Nützlich, wenn Sie aktiv chatten","crm.tipDontRespondOpenEx2":"Verhindert Bot-Unterbrechungen","crm.tipSimulateTypingTitle":"Tippen simulieren","crm.tipSimulateTypingDesc":"Zeigt 'tippt...'-Anzeige vor dem Senden an, damit Antworten menschlicher wirken.","crm.tipSimulateTypingEx1":'Zeigt "tippt..." bei Textnachrichten',"crm.tipSimulateTypingEx2":'Zeigt "nimmt auf..." bei Audio',"crm.tipSimulateTypingEx3":"Lässt Bot natürlicher wirken","crm.tipSkipCRMTitle":"CRM-Kontakte überspringen","crm.tipSkipCRMDesc":"Chatbot antwortet nicht auf Kontakte, die bereits zu Ihrem CRM hinzugefügt wurden. Nützlich für Bestandskunden.","crm.tipSkipCRMEx1":"Auto-Antwort nur für neue Kontakte","crm.tipSkipCRMEx2":"Bestehende CRM-Kontakte überspringen","crm.tipExcludeCRMTitle":"Bestimmte CRM-Stufen ausschließen","crm.tipExcludeCRMDesc":"Wählen Sie bestimmte Kanban-CRM-Stufen aus. Kontakte in diesen Stufen erhalten keine Chatbot-Nachrichten.","crm.tipExcludeCRMEx1":'"VIP-Kunden"-Stufe ausschließen',"crm.tipExcludeCRMEx2":'"Nicht stören"-Stufe ausschließen',"crm.tipIncludeCRMTitle":"Nur bestimmte CRM-Stufen einschließen","crm.tipIncludeCRMDesc":"Chatbot antwortet NUR auf Kontakte in ausgewählten Kanban-CRM-Stufen. Alle anderen werden ignoriert.","crm.tipIncludeCRMEx1":'Nur auf "Leads"-Stufe antworten',"crm.tipIncludeCRMEx2":'Nur auf "Aktive Deals"-Stufe antworten',"crm.tipSkipLabeledTitle":"Markierte Kontakte überspringen","crm.tipSkipLabeledDesc":"Chatbot antwortet nicht auf Kontakte mit WhatsApp-Labels.","crm.tipSkipLabeledEx1":"Alle markierten Kontakte werden übersprungen","crm.tipSkipLabeledEx2":"Nur unmarkierte Kontakte erhalten Antworten","crm.tipExcludeLabelTitle":"Bestimmte Labels ausschließen","crm.tipExcludeLabelDesc":"Wählen Sie bestimmte WhatsApp-Labels aus. Kontakte mit diesen Labels erhalten keine Chatbot-Nachrichten.","crm.tipExcludeLabelEx1":'"Spam"-markierte Kontakte ausschließen',"crm.tipExcludeLabelEx2":'"Blockiert"-markierte Kontakte ausschließen',"crm.tipIncludeLabelTitle":"Nur bestimmte Labels einschließen","crm.tipIncludeLabelDesc":"Chatbot antwortet NUR auf Kontakte mit ausgewählten WhatsApp-Labels. Alle anderen werden ignoriert.","crm.tipIncludeLabelEx1":'Nur auf "VIP"-markierte antworten',"crm.tipIncludeLabelEx2":'Nur auf "Priorität"-markierte antworten',"crm.tipSkipCustomTabTitle":"Benutzerdefinierte Tab-Kontakte überspringen","crm.tipSkipCustomTabDesc":"Chatbot antwortet nicht auf Kontakte in benutzerdefinierten Tabs.","crm.tipSkipCustomTabEx1":'Kontakt in "VIP-Kunden"-Tab → Keine Antwort',"crm.tipSkipCustomTabEx2":"Kontakt in keinem Tab → Bot antwortet","crm.tipExcludeCustomTabTitle":"Bestimmte benutzerdefinierte Tabs ausschließen","crm.tipExcludeCustomTabDesc":"Wählen Sie bestimmte benutzerdefinierte Tabs aus. Kontakte in diesen Tabs erhalten keine Chatbot-Nachrichten.","crm.tipExcludeCustomTabEx1":'"Blockiert"-Tab-Kontakte ausschließen',"crm.tipExcludeCustomTabEx2":'"Erledigt"-Tab-Kontakte ausschließen',"crm.tipIncludeCustomTabTitle":"Nur bestimmte benutzerdefinierte Tabs einschließen","crm.tipIncludeCustomTabDesc":"Chatbot antwortet NUR auf Kontakte in ausgewählten benutzerdefinierten Tabs. Alle anderen werden ignoriert.","crm.tipIncludeCustomTabEx1":'Nur auf "Aktive Leads"-Tab antworten',"crm.tipIncludeCustomTabEx2":'Nur auf "VIP"-Tab antworten',"templates.addCategory":"Kategorie hinzufügen","templates.editCategory":"Kategorie bearbeiten","templates.deleteCategory":"Kategorie löschen","templates.manageCategories":"Verwalten","templates.categoryName":"Kategoriename","templates.categoryIcon":"Symbol","templates.categoryColor":"Farbe","templates.update":"Aktualisieren","templates.form.category":"Kategorie","templates.form.categoryHint":"Vorlagen in Kategorien organisieren für einfacheren Zugriff","templates.allTemplates":"Alle Vorlagen","templates.quickReplyCategory":"Schnellantwort","templates.uncategorized":"Nicht kategorisiert","templates.sortNewest":"Neueste","templates.sortOldest":"Älteste","templates.sortNameAZ":"Name A-Z","templates.sortNameZA":"Name Z-A","templates.confirmDeleteCategory":"Sind Sie sicher, dass Sie diese Kategorie löschen möchten? Vorlagen werden in Nicht kategorisiert verschoben.","templates.confirmDeleteTemplate":"Sind Sie sicher, dass Sie diese Vorlage löschen möchten?","templates.noCategoriesYet":"Noch keine Kategorien","templates.createCategoryDescription":"Erstellen Sie Kategorien, um Ihre Vorlagen zu organisieren","templates.done":"Fertig","templates.deleteCategoryWarning":"Vorlagen in dieser Kategorie werden nicht kategorisiert.","templates.delete":"Löschen","templates.noTemplatesInCategory":"Keine Vorlagen in dieser Kategorie","templates.createFirstDescription":"Erstellen Sie Ihre erste Vorlage, um loszulegen","followUp.title":"Nachfassen","followUp.newFollowUp":"Neues Nachfassen","followUp.confirmDelete":"Sind Sie sicher, dass Sie dieses Nachfassen löschen möchten?","followUp.emptyTitle":"Kein Nachfassen ausgewählt","followUp.emptyText":"Wählen Sie ein Nachfassen aus der Liste oder erstellen Sie ein neues, um mit automatisierten Nachrichtensequenzen zu beginnen.","followUp.createNew":"Neu erstellen","followUp.loading":"Laden...","followUp.noFollowUps":"Noch keine Nachfassen","followUp.createFirst":"Erstellen Sie Ihre erste Nachfass-Sequenz","followUp.active":"Aktiv","followUp.paused":"Pausiert","followUp.labels":"Labels","followUp.customTabs":"Benutzerdefinierte Tabs","followUp.groups":"Gruppen","followUp.kanban":"Kanban","followUp.onEnter":"Bei Eintritt","followUp.onLeave":"Bei Verlassen","followUp.afterTime":"Nach Zeit","followUp.steps":"Schritte","followUp.pause":"Pausieren","followUp.activate":"Aktivieren","followUp.duplicate":"Duplizieren","followUp.delete":"Löschen","followUp.name":"Nachfassen-Name","followUp.namePlaceholder":"Nachfassen-Name eingeben...","followUp.nameRequired":"Bitte geben Sie einen Namen für das Nachfassen ein","followUp.funnelRequired":"Bitte wählen Sie mindestens einen Trichter-Eintrag","followUp.stepsRequired":"Bitte fügen Sie mindestens einen Schritt hinzu","followUp.funnelSettings":"Trichter-Einstellungen","followUp.selectFunnelItems":"Wählen Sie Einträge, um dieses Nachfassen auszulösen","followUp.comingSoon":"Selektor kommt bald","followUp.triggerSettings":"Nachfassen-Auslöser","followUp.onEnterDesc":"Auslösen, wenn Kontakt den Trichter betritt","followUp.onLeaveDesc":"Auslösen, wenn Kontakt den Trichter verlässt","followUp.afterTimeDesc":"Nach einer bestimmten Zeit auslösen","followUp.days":"Tage","followUp.day":"Tag","followUp.hours":"Stunden","followUp.minutes":"Minuten","followUp.value":"Wert","followUp.unit":"Einheit","followUp.time":"Zeit","followUp.scheduleConfiguration":"Zeitplan-Konfiguration","followUp.enableSchedule":"Erweiterten Zeitplan aktivieren","followUp.enableScheduleDesc":"(Nur an bestimmten Tagen/Daten senden)","followUp.scheduleDisabledInfo":"Aktivieren Sie oben den erweiterten Zeitplan, um bestimmte Tage/Daten für den Nachrichtenversand zu konfigurieren.","followUp.tooltip.scheduleTitle":"Zeitplan-Konfiguration - Wann senden?","followUp.tooltip.scheduleContent":"Konfigurieren Sie bestimmte Tage/Daten, an denen das Nachfassen ausgeführt werden soll. Funktioniert mit jedem Auslösertyp. Wählen Sie tägliche, wöchentliche, monatliche oder jährliche Zeitpläne.","followUp.tooltip.scheduleExample":"Setzen Sie einen wöchentlichen Zeitplan für Mo, Mi, Fr, um Nachrichten nur an diesen Tagen zu senden.","followUp.messagesConfiguredInSchedule":"Nachrichten im Zeitplan konfiguriert","followUp.messagesConfiguredInScheduleDesc":'Sie haben "Unterschiedliche Nachricht pro Tag" im Zeitplan-Konfigurationsabschnitt oben aktiviert. Nachrichten werden dort für jeden ausgewählten Tag konfiguriert.',"followUp.stepsTitle":"Nachfassen-Schritte","followUp.step":"Schritt","followUp.actions":"Aktionen","followUp.addStep":"Nachfassen-Schritt hinzufügen","followUp.rulesTitle":"Auslöser-Regeln","followUp.cancelOnReply":"Abbrechen bei Kundenantwort","followUp.allowGroups":"Antworten in Gruppen erlauben","followUp.customSignature":"Signatur anpassen","followUp.signatureText":"Signatur-Text","followUp.signaturePlaceholder":"Ihre Signatur eingeben...","followUp.maxExecutions":"Maximale Ausführungen pro Kontakt","followUp.cooldownDays":"Abklingzeit (Tage)","followUp.cancel":"Abbrechen","followUp.create":"Nachfassen erstellen","followUp.save":"Änderungen speichern","followUp.saving":"Speichern...","followUp.saved":"Gespeichert!","followUp.back":"← Zurück","followUp.next":"Weiter →","followUp.backToList":"← Zur Liste","followUp.wizardStep1":"Einrichtung","followUp.wizardStep2":"Nachrichten","followUp.wizardStep3":"Zeitplan","followUp.wizardStep4":"Aktionen","followUp.wizardStep5":"Regeln","followUp.followUps":"Nachfassaktionen","followUp.stepName":"Schritt-Name (Optional)","followUp.stepNamePlaceholder":"z.B., Erstkontakt, Nachfassen 1...","followUp.timing":"Zeitplanung","followUp.mode":"Modus","followUp.relative":"Relativ","followUp.specific":"Spezifisch","followUp.type":"Typ","followUp.daily":"Täglich","followUp.weekly":"Wöchentlich","followUp.monthly":"Monatlich","followUp.condition":"Bedingung","followUp.conditionAlways":"Immer","followUp.conditionIfReplied":"Wenn geantwortet","followUp.conditionIfNotReplied":"Wenn nicht geantwortet","followUp.conditionIfKeyword":"Wenn Schlüsselwort","followUp.conditionIfNotKeyword":"Wenn kein Schlüsselwort","followUp.conditionIfInFunnel":"Wenn im Trichter","followUp.conditionIfNotInFunnel":"Wenn Trichter verlassen","followUp.keywords":"Schlüsselwörter (kommagetrennt)","followUp.keywordsPlaceholder":"ja, ok, interessiert...","followUp.actionsTitle":"Aktionen","followUp.actionsRequired":"Bitte fügen Sie mindestens eine Aktion hinzu","followUp.addAction":"+ Aktion hinzufügen","followUp.postActionsTitle":"Nachfolgende Aktionen","followUp.groupActions":"Gruppenaktionen","followUp.addToGroups":"Zu Gruppen hinzufügen","followUp.removeFromGroups":"Aus Gruppen entfernen","followUp.customTabActions":"Benutzerdefinierte Tab-Aktionen","followUp.addToTabs":"Zu Tabs hinzufügen","followUp.removeFromTabs":"Aus Tabs entfernen","followUp.labelsActions":"Label-Aktionen","followUp.addLabels":"Labels hinzufügen","followUp.removeLabels":"Labels entfernen","followUp.kanbanBoardActions":"Kanban-Aktionen","followUp.addToKanban":"Zur Stufe hinzufügen","followUp.removeFromKanban":"Von Stufe entfernen","followUp.selectStage":"Stufe auswählen...","followUp.noGroupsAvailable":"Keine Gruppen verfügbar","followUp.noTabsAvailable":"Keine Tabs verfügbar","followUp.noLabelsAvailable":"Keine Labels verfügbar","followUp.noKanbanAvailable":"Keine Kanban-Boards verfügbar","followUp.moveUp":"Nach oben","followUp.moveDown":"Nach unten","followUp.removeStep":"Schritt entfernen","followUp.message":"Nachricht","followUp.messagePlaceholder":"Ihre Nachricht hier eingeben...","followUp.variables":"Variablen","followUp.clickToInsert":"Klicken zum Einfügen einer Variable:","followUp.minDelay":"Min. Verzögerung (Sek.)","followUp.maxDelay":"Max. Verzögerung (Sek.)","followUp.addMessage":"Nachricht hinzufügen","followUp.removeMessage":"Nachricht entfernen","followUp.selectLabels":"Labels auswählen...","followUp.selectTabs":"Benutzerdefinierte Tabs auswählen...","followUp.selectKanbanStage":"Kanban-CRM und Stufe auswählen...","followUp.selectGroups":"WhatsApp-Gruppen auswählen...","followUp.selectorComingSoon":"Selektor kommt bald","followUp.webhookUrl":"Webhook URL","followUp.includeContactData":"Kontaktdaten in Payload einschließen","followUp.search":"Suchen...","followUp.noLabels":"Keine Labels gefunden. Erstellen Sie zuerst Labels in WhatsApp.","followUp.noTabs":"Keine benutzerdefinierten Tabs gefunden. Erstellen Sie Tabs über die Tab-Leiste.","followUp.noGroups":"Keine WhatsApp-Gruppen gefunden.","followUp.noStages":"Keine Kanban-Stufen gefunden. Erstellen Sie zuerst ein CRM und Stufen.","followUp.fluxoCategory":"Kategorie","followUp.allCategories":"Alle Kategorien","followUp.uncategorized":"Nicht kategorisiert","followUp.selectFluxo":"Fluxo auswählen","followUp.chooseFluxo":"-- Fluxo wählen --","followUp.fluxoInfo":"Der ausgewählte Chatbot-Flow wird ausgelöst, wenn dieses Nachfassen ausgeführt wird.","followUp.messageText":"Nachrichtentext","followUp.templatesType":"Vorlagentyp","followUp.tooltip.nameTitle":"Nachfassen-Name","followUp.tooltip.nameContent":"Geben Sie einen beschreibenden Namen an, um diese Nachfass-Sequenz zu identifizieren. Verwenden Sie klare Namen, die den Zweck beschreiben.","followUp.tooltip.nameExample":"Beispiel: 'Neuer Lead Willkommen', 'Zahlungserinnerung', 'Feedback-Anfrage'","followUp.tooltip.categoryTitle":"Kategorie","followUp.tooltip.categoryContent":"Organisieren Sie Ihre Nachfassen in Kategorien für bessere Verwaltung. Wählen Sie eine Kategorie oder lassen Sie es als Nicht kategorisiert.","followUp.tooltip.funnelTitle":"Trichter-Einstellungen - Wo auslösen?","followUp.tooltip.funnelContent":"Wählen Sie, welche Labels, Benutzerdefinierte Tabs, Gruppen oder Kanban-Stufen diese Nachfass-Sequenz auslösen. Wenn ein Kontakt in den ausgewählten Trichter eintritt, beginnt das Nachfassen.","followUp.tooltip.funnelExample":"Beispiel: 'Neuer Lead' Label auswählen → Wenn ein Kontakt dieses Label erhält, startet das Nachfassen automatisch.","followUp.tooltip.triggerTitle":"Nachfassen-Auslöser - Wann starten?","followUp.tooltip.triggerContent":"Entscheidet, WANN die Nachfass-Sequenz nach dem Trichter-Ereignis STARTET. Bei Eintritt: sofort wenn Kontakt eintritt. Bei Verlassen: wenn Kontakt geht. Nach Zeit: X Zeit warten vor Start.","followUp.tooltip.triggerExample":"Beispiel: 'Nach Zeit' + 2 Stunden = Nachfassen startet 2 Stunden nachdem der Kontakt den Trichter betreten hat.","followUp.tooltip.actionsTitle":"Aktionen - Was tun?","followUp.tooltip.actionsContent":"Definieren Sie, was passiert, wenn das Nachfassen ausgelöst wird. Alle Aktionen werden zum Auslösezeitpunkt ausgeführt. Fügen Sie Nachrichten hinzu, ändern Sie Labels, verschieben Sie zu Kanban-Stufen oder lösen Sie Webhooks aus.","followUp.tooltip.actionsExample":"Beispiel: Willkommensnachricht senden → 'Kontaktiert' Label hinzufügen → In 'In Bearbeitung' Stufe verschieben.","followUp.tooltip.rulesTitle":"Auslöser-Regeln - Verhalten steuern","followUp.tooltip.rulesContent":"Konfigurieren Sie das Verhalten des Nachfassens. Bei Antwort abbrechen stoppt die Sequenz wenn der Kunde antwortet. Gruppen erlauben ermöglicht das Senden in Gruppenchats. Benutzerdefinierte Signatur fügt Ihren Text am Ende von Nachrichten hinzu.","followUp.tooltip.rulesExample":"Best Practice: Aktivieren Sie 'Bei Antwort abbrechen', um Spam an Kunden zu vermeiden, die bereits geantwortet haben.","followUp.tooltip.cancelOnReplyTitle":"Abbrechen bei Kundenantwort","followUp.tooltip.cancelOnReplyContent":"Stoppt automatisch alle ausstehenden Nachfass-Nachrichten für einen Kontakt, wenn dieser Ihnen eine Nachricht sendet. Dies verhindert unnötige Nachfassen an Kunden, die bereits geantwortet haben.","followUp.tooltip.cancelOnReplyExample":"• Aktiviert: Nachfassen stoppt wenn Kunde vor dem Senden antwortet\n• Deaktiviert: Nachfassen wird unabhängig von Kundennachrichten gesendet","followUp.tooltip.allowGroupsTitle":"Antworten in Gruppen erlauben","followUp.tooltip.allowGroupsContent":"Steuert, ob dieses Nachfassen Nachrichten an WhatsApp-Gruppen senden kann. Standardmäßig funktionieren Nachfassen nur für einzelne Kontakte (1-zu-1 Chats).","followUp.tooltip.allowGroupsExample":"• Aktiviert: Nachfassen funktioniert für Einzelchats UND Gruppen\n• Deaktiviert: Nachfassen funktioniert nur für einzelne Kontakte","followUp.tooltip.signatureTitle":"Signatur anpassen","followUp.tooltip.signatureContent":"Fügt eine personalisierte Signatur am Ende jeder Nachfass-Nachricht hinzu. Nützlich für Branding oder zur Kennzeichnung automatisierter Nachrichten.","followUp.tooltip.signatureExample":"Beispiel: Ihre Nachricht 'Hallo, nur kurz nachfragen!' wird zu 'Hallo, nur kurz nachfragen!\\n\\n~ Team CRM'","followUp.tooltip.maxExecutionsTitle":"Maximale Ausführungen - Wie oft?","followUp.tooltip.maxExecutionsContent":"Steuert, wie oft dieses Nachfassen Nachrichten an DENSELBEN Kontakt senden kann. Sobald ein Kontakt dieses Limit erreicht, erhält er dieses Nachfassen nicht mehr.","followUp.tooltip.maxExecutionsExample":"• 0 setzen = Unbegrenzt (kein Limit)\n• 1 setzen = Nur einmal pro Kontakt\n• 3 setzen = Kontakt erhält maximal 3 mal","followUp.tooltip.cooldownTitle":"Abklingzeit - Warten vor erneutem Auslösen","followUp.tooltip.cooldownContent":"Nachdem ein Kontakt dieses Nachfassen erhalten hat, wie viele Tage warten, bevor er es wieder erhalten kann. Dies verhindert wiederholtes Spammen desselben Kontakts.","followUp.tooltip.cooldownExample":"• 0 setzen = Keine Wartezeit (kann sofort wieder ausgelöst werden)\n• 7 setzen = 7 Tage warten vor erneutem Auslösen","followUp.tooltip.exampleLabel":"Beispiel:","followUp.tooltip.howToUseLabel":"Verwendung:","followUp.tooltip.bestPracticeLabel":"Best Practice:","schedule.title":"Geplante Nachrichten","schedule.addSchedule":"Zeitplan hinzufügen","schedule.editSchedule":"Zeitplan bearbeiten","schedule.schedulesCount":"Zeitpläne","schedule.noSchedules":"Keine geplanten Nachrichten","schedule.noSchedulesDesc":"Erstellen Sie Ihre erste geplante Nachricht.","schedule.confirmDelete":"Möchten Sie diesen Zeitplan wirklich löschen?","schedule.inactive":"Inaktiv","schedule.once":"Einmal","schedule.repeated":"Wiederholt","schedule.scheduleFor":"Planen für","schedule.selectTarget":"Kontakt oder Gruppe auswählen","schedule.searchContacts":"Kontakte und Gruppen suchen...","schedule.groups":"Gruppen","schedule.contacts":"Kontakte","schedule.templateType":"Vorlagentyp","schedule.message":"Nachricht","schedule.enterMessage":"Nachricht eingeben...","schedule.scheduleDateTime":"Geplantes Datum und Uhrzeit","schedule.selectDateTime":"Bitte wählen Sie Datum und Uhrzeit","schedule.repeatedType":"Wiederholungstyp","schedule.repeatedType_minute":"Minute","schedule.repeatedType_hour":"Stunde","schedule.repeatedType_daily":"Täglich","schedule.repeatedType_weekly":"Wöchentlich","schedule.repeatedType_monthly":"Monatlich","schedule.repeatedType_yearly":"Jährlich","schedule.everyMinutes":"Alle X Minuten","schedule.everyHours":"Alle X Stunden","schedule.scheduleTime":"Geplante Zeiten","schedule.addTime":"Zeit hinzufügen","schedule.startAndEndTime":"Start- und Endzeit","schedule.runAnytime":"Jederzeit ausführen","schedule.runBetween":"Zwischen Zeitraum ausführen","schedule.endSchedule":"Zeitplan-Wiederholung beenden am","schedule.never":"Nie","schedule.afterCount":"Anzahl der Wiederholungen","schedule.completeOnDate":"Am Datum abschließen","schedule.weekday_mon":"Montag","schedule.weekday_tue":"Dienstag","schedule.weekday_wed":"Mittwoch","schedule.weekday_thu":"Donnerstag","schedule.weekday_fri":"Freitag","schedule.weekday_sat":"Samstag","schedule.weekday_sun":"Sonntag","schedule.month_jan":"Januar","schedule.month_feb":"Februar","schedule.month_mar":"März","schedule.month_apr":"April","schedule.month_may":"Mai","schedule.month_jun":"Juni","schedule.month_jul":"Juli","schedule.month_aug":"August","schedule.month_sep":"September","schedule.month_oct":"Oktober","schedule.month_nov":"November","schedule.month_dec":"Dezember","schedule.postActions":"Nachfolgende Aktionen","schedule.groupActions":"Gruppenaktionen","schedule.customTabActions":"Benutzerdefinierte Tab-Aktionen","schedule.labelsActions":"Label-Aktionen","schedule.kanbanActions":"Kanban-Aktionen","schedule.members":"Mitglieder","schedule.noContactsFound":"Keine Kontakte gefunden","schedule.noGroupsFound":"Keine Gruppen gefunden","schedule.loadingContacts":"Kontakte werden geladen...","schedule.loadingGroups":"Gruppen werden geladen...","schedule.selected":"Ausgewählt","schedule.tooltip.scheduleFor":"Wählen Sie einen Kontakt oder eine Gruppe aus, an den/die die geplante Nachricht gesendet werden soll.","schedule.tooltip.templateType":"Wählen Sie den Nachrichtentyp: nur Text, mit Medien, Umfrage, Liste oder Fluxo-Chatbot-Flow auslösen.","schedule.tooltip.message":"Geben Sie Ihre Nachricht ein. Verwenden Sie Variablen wie {{name}} oder {{phone}} zur Personalisierung.","schedule.tooltip.dateTime":"Legen Sie fest, wann die Nachricht gesendet werden soll. Bei wiederholten Zeitplänen ist dies das Startdatum/-zeit.","schedule.tooltip.repeatedType":"Wählen Sie die Wiederholungshäufigkeit: alle X Minuten/Stunden, täglich, wöchentlich, monatlich oder jährlich.","schedule.tooltip.scheduleTimes":"Fügen Sie mehrere Sendezeiten hinzu. Klicken Sie auf +, um weitere Zeitfenster hinzuzufügen.","schedule.tooltip.runBetween":"Beschränken Sie Nachrichten auf bestimmte Stunden. z.B. nur zwischen 9 und 18 Uhr senden.","schedule.tooltip.endSchedule":"Wählen Sie, wann die Wiederholung enden soll: Nie, nach X Mal oder an einem bestimmten Datum.","schedule.tooltip.postActions":"Aktionen nach dem Senden: zu Gruppen, Tabs, Labels oder Kanban-Stufen hinzufügen/entfernen.","gmaps.featureTitle":"G Maps Extraktor","feature.gmapsExtractor":"G Maps Extraktor","gmaps.panelHeader":"G Maps Extraktor","gmaps.status.idle":"Bereit","gmaps.status.running":"Extrahiere...","gmaps.status.stopped":"Gestoppt","gmaps.status.complete":"Abgeschlossen","gmaps.status.error":"Gestoppt","gmaps.statusLabel":"Status","gmaps.leadsFound":"Leads: {{count}}","gmaps.leadsShort":"Leads","gmaps.settings":"Einstellungen","gmaps.exportGroup":"Exportieren & Senden","gmaps.noPhone":"kein Telefon","gmaps.showPanel":"Panel anzeigen","gmaps.hidePanel":"Panel ausblenden","gmaps.maxResults":"Max. Ergebnisse","gmaps.unlimited":"Unbegrenzt","gmaps.fetchEmails":"E-Mails abrufen","gmaps.fetchEmailsTooltip":"Für jeden Lead mit Website wird diese im Hintergrund geöffnet und die erste gefundene E-Mail-Adresse extrahiert. Fügt etwa 3 Sekunden pro Lead hinzu und verbraucht zusätzliche Bandbreite. Wenn die Seite keine sichtbare E-Mail enthält oder nicht lädt, bleibt das E-Mail-Feld leer.","gmaps.startBtn":"Extraktion starten","gmaps.stopBtn":"Stopp","gmaps.clearBtn":"Leeren","gmaps.exportCsv":"CSV exportieren","gmaps.exportXlsx":"XLSX exportieren","gmaps.sendToBroadcast":"An Broadcast senden","gmaps.previewTitle":"Vorschau","gmaps.moreRows":"weitere","gmaps.expand":"Erweitern","gmaps.expandView":"Vollansicht öffnen","gmaps.clickExpand":"Klicken Sie auf Erweitern für vollständige Details","gmaps.clickExpandToSee":"auf Erweitern klicken, um alle anzuzeigen","gmaps.col.name":"Name","gmaps.col.phone":"Telefon","gmaps.col.website":"Website","gmaps.col.address":"Adresse","gmaps.col.category":"Kategorie","gmaps.col.rating":"Bewertung","gmaps.noLeadsYet":"Noch keine Leads — suchen Sie auf Google Maps und klicken Sie auf Start","gmaps.stopReason.userStop":"Vom Benutzer gestoppt","gmaps.stopReason.endOfResults":"Ende der Google-Maps-Ergebnisse erreicht","gmaps.stopReason.captcha":"Google-Captcha erkannt — lösen Sie es und klicken Sie erneut auf Start","gmaps.stopReason.noFeed":"Keine Google-Maps-Suchergebnisse gefunden — bitte zuerst eine Suche ausführen","gmaps.stopReason.noNewResults":"Es werden keine neuen Ergebnisse geladen (Google liefert keine Daten mehr)","gmaps.stopReason.maxReached":"Maximale Ergebnisanzahl erreicht","gmaps.stopReason.tabClosed":"Tab wurde geschlossen","gmaps.stopReason.error":"Fehler","gmaps.toast.searchFirst":"Bitte führen Sie zuerst eine Suche auf Google Maps aus und klicken Sie dann auf Start.","gmaps.toast.csvReady":"CSV heruntergeladen","gmaps.toast.xlsxReady":"Excel-Datei heruntergeladen","gmaps.toast.noPhones":"Keine gültigen Telefonnummern — es wurde nichts gesendet.","gmaps.toast.sentPartial":"{{sent}} Kontakte an Broadcast gesendet · {{dropped}} übersprungen (kein Telefon)","gmaps.toast.sentAll":"{{sent}} Kontakte an Broadcast gesendet","gmaps.toast.broadcastFail":"Senden an Broadcast fehlgeschlagen. Siehe Konsole.","gmaps.toast.draftRestored":"Vorherige Sitzung wiederhergestellt","gmaps.toast.draftRestoredN":"{{n}} Leads aus vorheriger Sitzung wiederhergestellt"},fr:{"common.loading":"Chargement...","common.close":"Fermer","common.cancel":"Annuler","common.save":"Enregistrer","common.copy":"Copier","common.copied":"Copié !","common.choose":"Choisir","common.add":"Ajouter","common.edit":"Modifier","common.delete":"Supprimer","common.back":"Retour","quickReply.title":"Réponse rapide","quickReply.addButton":"+ Ajouter","quickReply.allCategories":"Toutes les Catégories","quickReply.postActions":"Actions après envoi","quickReply.groupActions":"Actions de groupe","quickReply.customTabActions":"Actions d'onglet","quickReply.labelsActions":"Actions d'étiquettes","quickReply.kanbanBoardActions":"Actions Kanban","quickReply.addToGroups":"Ajouter aux groupes","quickReply.removeFromGroups":"Retirer des groupes","quickReply.addToTabs":"Ajouter aux onglets","quickReply.removeFromTabs":"Retirer des onglets","quickReply.addLabels":"Ajouter des étiquettes","quickReply.removeLabels":"Retirer des étiquettes","quickReply.addToStage":"Ajouter à l'étape","quickReply.removeFromStage":"Retirer de l'étape","quickReply.selectGroups":"Sélectionner les groupes...","quickReply.selectTabs":"Sélectionner les onglets...","quickReply.selectLabels":"Sélectionner les étiquettes...","quickReply.selectCrmStage":"Sélectionner CRM et étape...","quickReply.noGroupsAvailable":"Aucun groupe disponible","quickReply.noTabsAvailable":"Aucun onglet disponible","quickReply.noLabelsAvailable":"Aucune étiquette disponible","quickReply.noKanbanAvailable":"Aucun CRM Kanban disponible","quickReply.editBeforeSending":"Modifier avant envoi","quickReply.editBeforeSendingDesc":"Permet de modifier le message avant l'envoi","actionSidebar.title":"Actions rapides","actionSidebar.quickReply":"Réponse rapide","actionSidebar.flow":"Flow","actionSidebar.search":"Rechercher...","actionSidebar.filter":"Filtrer","actionSidebar.all":"Tout","actionSidebar.byType":"Par type","actionSidebar.noCategory":"Sans catégorie","actionSidebar.byCategory":"Par catégorie","actionSidebar.mostUsed":"Plus utilisés","actionSidebar.send":"Envoyer","actionSidebar.trigger":"Déclencher","actionSidebar.noItemsFound":"Aucun élément trouvé","actionSidebar.selectChatFirst":"Sélectionnez d'abord une conversation","actionSidebar.uncategorized":"Non catégorisé","actionSidebar.editAndSend":"Modifier et envoyer","actionSidebar.clickToCancel":"Cliquez pour annuler","actionSidebar.cancel":"Annuler","actionSidebar.sending":"Envoi en cours...","header.activateLicense":"Activer la licence",broadcastTitle:"Message groupé",kanbanTitle:"Ouvrir Kanban CRM","profile.title":"Profil","profile.deviceName":"Nom de l'appareil","profile.expires":"Expire","profile.manageLicenseKey":"Gérer la clé de licence","profile.settings":"Paramètres","profile.watchTutorial":"Regarder le tutoriel","profile.language":"Langue","profile.privacyPolicy":"Politique de confidentialité","profile.contactUs":"Contactez-nous","profile.website":"Site web","profile.premium":"Premium","profile.notActivated":"Non activé","profile.activateToContinue":"Activer la licence","settings.menuFeatures":"Fonctionnalités du Menu","settings.menuFeaturesDesc":"Activez ou désactivez les fonctionnalités selon vos besoins","settings.interfaceOptions":"Options d'Interface","settings.featureDockLabel":"Barre de Fonctionnalités à Gauche","settings.featureDockDesc":"Afficher une barre de raccourcis à gauche lorsqu'une popup est ouverte","feature.tabs":"Gestion des Onglets","feature.templates":"Modèles","feature.quickReply":"Réponse Rapide","feature.kanban":"Kanban CRM","feature.chatbotFlow":"Flux Chatbot","feature.followUp":"Suivi","feature.broadcast":"Envoi en Masse","feature.calendar":"Centre de Planification","feature.status":"Statut","feature.validator":"Validateur","feature.webhook":"Webhook","feature.api":"API","feature.aiBot":"Bot IA","feature.open":"Ouvrir","license.activateTitle":"Activez votre licence","license.licenseKey":"Clé de licence","license.phoneNumber":"Numéro de téléphone","license.phoneDetected":"Numéro de téléphone détecté","license.planName":"Nom du plan","license.endDate":"Date de fin","license.expiresIn":"Expire dans","license.days":"jours","license.daysLeft":"jours restants","license.status":"Statut","license.deactivateLicense":"Désactiver la licence","license.deactivateConfirm":"Êtes-vous sûr de vouloir désactiver votre licence ?","license.activateLicenseBtn":"Activer la licence","license.validating":"Validation en cours...","license.pasteLicenseHere":"Collez votre clé de licence ici...","license.completeLicenseKey":"Collez la clé de licence complète que vous avez reçue par e-mail","trial.starting":"Démarrage de votre essai gratuit de 7 jours...","trial.activated":"Essai gratuit de 7 jours activé !","trial.daysRemaining":"{0} jours restants dans l'essai","trial.expired":"L'essai a expiré. Veuillez acheter une licence.","trial.alreadyUsed":"L'essai a déjà été utilisé pour ce numéro. Entrez une clé de licence pour continuer.","license.waitForWhatsApp":"Veuillez attendre que WhatsApp se charge complètement","license.securityFooter":"Protégé par validation cryptographique WebAssembly","planDetails.title":"Détails du plan","planDetails.licenceKey":"Clé de licence","planDetails.planName":"Nom du plan","planDetails.endDate":"Date de fin","planDetails.removeKey":"Supprimer la clé","planDetails.changeKey":"Changer la clé","features.enabledFeatures":"Fonctionnalités activées","licenseInfo.title":"Informations sur la licence","licenseInfo.phoneNumber":"Numéro de téléphone","licenseInfo.expiresIn":"Expire dans","licenseInfo.status":"Statut","languages.en":"English (Anglais)","languages.zh":"中文 (Chinois)","languages.es":"Español (Espagnol)","languages.fr":"Français","languages.ar":"العربية (Arabe)","languages.pt":"Português (Portugais)","languages.ru":"Русский (Russe)","languages.ja":"日本語 (Japonais)","languages.de":"Deutsch (Allemand)","errors.invalidFormat":"Format de clé de licence invalide ou échec de validation","errors.serverError":"Erreur du serveur","errors.networkError":"Erreur réseau. Veuillez vérifier votre connexion","tabs.tabs":"Onglets","tabs.manageTabs":"Gérer les onglets","tabs.addTab":"Ajouter un onglet","tabs.editTab":"Modifier l'onglet","tabs.deleteTab":"Supprimer l'onglet","tabs.tabTitle":"Titre de l'onglet","tabs.tabDetails":"Détails de l'onglet","tabs.enterTabTitle":"Entrer le titre de l'onglet","tabs.enterTabDetails":"Entrer les détails de l'onglet","tabs.chooseFrom":"Choisir parmi","tabs.chat":"Chat","tabs.groups":"Groupes","tabs.label":"Étiquette","tabs.searchHere":"Rechercher ici","tabs.selectAll":"Tout sélectionner","tabs.clearAll":"Tout effacer","tabs.selected":"Sélectionné","tabs.allChats":"Tous les chats","tabs.chats":"chats","tabs.noFilterApplied":"Aucun filtre appliqué","tabs.view":"Voir","tabs.edit":"Modifier","tabs.delete":"Supprimer","tabs.hideFromTabBar":"Masquer de la barre d'onglets","tabs.showInTabBar":"Afficher dans la barre d'onglets","tabs.sort":"Trier","tabs.title":"Titre","tabs.details":"Détails","tabs.action":"Action","tabs.selectLabel":"Sélectionner une étiquette","tabs.chooseALabel":"-- Choisissez une étiquette --","tabs.selectedLabel":"Étiquette sélectionnée","tabs.change":"Changer","tabs.pleaseSelectLabel":"Veuillez sélectionner une étiquette dans la liste déroulante ci-dessus","tabs.areYouSureDeleteTab":"Êtes-vous sûr de vouloir supprimer cet onglet ?","tabs.tabDeletedSuccessfully":"Onglet supprimé avec succès","tabs.cancel":"Annuler","tabs.save":"Enregistrer","tabs.all":"Tous","tabs.oneToOne":"1:1","tabs.individualChats":"Chats individuels uniquement","tabs.groupChats":"Chats de groupe uniquement","tabs.unread":"Non lus","tabs.unreadChats":"Chats non lus uniquement","tabs.unsaved":"Non enregistrés","tabs.unsavedContacts":"Contacts non enregistrés uniquement","templates.title":"Modèles de messages","templates.manageTemplates":"Gérer les modèles","templates.newTemplate":"Nouveau modèle","templates.editTemplate":"Modifier le modèle","templates.sendTemplate":"Envoyer le modèle","templates.deleteTemplate":"Supprimer le modèle","templates.duplicateTemplate":"Dupliquer le modèle","templates.activateTemplate":"Activer","templates.deactivateTemplate":"Désactiver","templates.total":"Total","templates.active":"Actifs","templates.inactive":"Inactifs","templates.filterAll":"Tous","templates.filterActive":"Actifs uniquement","templates.filterInactive":"Inactifs uniquement","templates.filterAllTypes":"Tous les Types","templates.templates":"modèles","templates.searchPlaceholder":"Rechercher des modèles...","templates.noTemplates":"Aucun modèle trouvé","templates.createFirst":"Créez votre premier modèle","templates.edit":"Modifier","templates.copy":"Copier","templates.msgs":"messages","templates.noMessageContent":"Aucun contenu de message","templates.form.templateName":"Nom du modèle","templates.form.templateNamePlaceholder":"Entrez le nom du modèle","templates.form.templateFor":"Modèle pour","templates.form.message":"Message","templates.form.messagePlaceholder":"Tapez votre message ici...","templates.form.insertVariable":"Cliquez pour insérer une variable :","templates.form.personalizeValue":"Valeur de personnalisation","templates.form.personalizeValueHint":"Diffusez à vos personnes sélectionnées avec des valeurs personnalisées comme @variable1, @variable2, etc.","templates.form.templatesType":"Type de modèles","templates.form.templateType":"Type de modèle","templates.form.templateStatus":"Statut du modèle","templates.form.statusOn":"Activé","templates.form.statusOff":"Désactivé","templates.form.statusHint":'Lorsque le statut du modèle est "activé", il est disponible. À l\'inverse, lorsque le statut du modèle est "désactivé", il est dans un état sauvegardé.',"templates.form.on":"Activé","templates.form.off":"Désactivé","templates.form.save":"Enregistrer","templates.form.cancel":"Annuler","templates.form.selectProducts":"Sélectionner des produits","templates.form.selectContacts":"Sélectionner des contacts","templates.form.addProduct":"Ajouter un produit","templates.form.addContact":"Ajouter un contact","templates.form.buttons":"Boutons","templates.form.addButton":"Ajouter un bouton","templates.form.buttonsHint":"Maximum 3 boutons autorisés","templates.form.selectFromContacts":"Sélectionner parmi les contacts","templates.form.addManually":"Ajouter manuellement","templates.form.productHint":"Produits de votre catalogue WhatsApp Business","templates.form.attachImages":"Joindre Images/Vidéos","templates.form.attachAudio":"Joindre Audio","templates.form.attachDocuments":"Joindre Documents","templates.form.chooseFile":"Choisir un fichier","templates.form.maxFileSize":"Taille maximale du fichier : 16 Mo (limite WhatsApp)","templates.form.uploading":"Téléchargement en cours...","templates.errors.uploadFailed":"Échec du téléchargement du fichier. Veuillez réessayer.","templates.errors.fileTooLarge":"Le fichier est trop volumineux. Taille maximale : 16 Mo (limite WhatsApp).","templates.form.listButtonText":"Texte du bouton","templates.form.listButtonTextPlaceholder":"Entrez le texte du bouton","templates.form.listDescription":"Description","templates.form.listDescriptionPlaceholder":"Entrez la description","templates.form.listSections":"Sections","templates.form.pollQuestion":"Question du sondage","templates.form.pollQuestionPlaceholder":"Entrez votre question de sondage","templates.form.allowMultipleAnswers":"Autoriser les réponses multiples","templates.form.allowMultipleAnswersHint":"Les utilisateurs peuvent sélectionner plusieurs options","templates.form.pollOptions":"Options du sondage","templates.form.addOption":"+ Ajouter une option","templates.form.pollOptionsHint":"Minimum 2, maximum 12 options","templates.messageType.individual":"Un à un","templates.messageType.tab":"Onglet","templates.messageType.group":"Groupe","templates.messageType.label":"Étiquette","templates.messageType.kanban":"Kanban","templates.messageType.quickReply":"⚡ Réponse rapide","templates.attachmentType.none":"Message uniquement","templates.attachmentType.imageVideo":"Message + Images/Vidéos","templates.attachmentType.document":"Message + Documents","templates.attachmentType.audio":"Message + Audio","templates.attachmentType.contact":"Message + Contacts","templates.attachmentType.poll":"Message + Sondage","templates.attachmentType.list":"Message + Liste","templates.attachmentType.product":"Message + Produits","templates.attachmentType.buttons":"Message + Boutons","templates.messages":"Messages","templates.addMessage":"Ajouter un Message","templates.deleteMessage":"Supprimer le Message","templates.messageNumber":"Message {number}","templates.delayBetweenMessages":"Délai avant le prochain message","templates.delayMin":"Min (sec)","templates.delayMax":"Max (sec)","templates.collapseMessage":"Réduire","templates.expandMessage":"Développer","crm.button":"CRM","crm.openCRM":"Ouvrir CRM","crm.profile":"Profil","crm.tabs":"Onglets","crm.notes":"Notes","crm.reminder":"Rappel","crm.appointment":"Rendez-vous","crm.income":"Revenus","crm.expense":"Dépenses","crm.scheduleTab":"Planifier","crm.deletedMessagesTab":"Messages supprimés","crm.antiRevokeEnabled":"Anti-Revoke est ACTIVÉ","crm.antiRevokeDisabled":"Anti-Revoke est DÉSACTIVÉ","crm.antiRevokeDescription":"Enregistre localement les copies des messages entrants afin que vous puissiez les voir même si l’expéditeur les supprime.","crm.antiRevokeNotEnabledHint":"Activez Anti-Revoke ci-dessus pour commencer à enregistrer les messages entrants.","crm.noDeletedMessages":"Aucun message supprimé récupéré pour le moment. Nous veillons — si quelqu’un supprime un message, nous en garderons une copie ici.","crm.onlyThisContact":"Uniquement ce contact","crm.allContacts":"Tous les contacts","crm.clearHistory":"Effacer l’historique","crm.exportCSV":"Exporter CSV","crm.revokedAt":"Supprimé le","crm.copyMessage":"Copier","crm.lionRecovered":"{brand} a récupéré","crm.clickToShowOriginal":"Cliquer pour afficher l’original","crm.antiRevokeChatTip":"Astuce : vous pouvez aussi cliquer sur l’icône de récupération directement sur un message supprimé dans le chat pour l’afficher rapidement.","crm.searchMessages":"Rechercher des messages…","crm.recoveredCount":"{count} message(s) récupéré(s)","crm.confirmClearChatHistory":"Effacer les messages récupérés pour ce contact ?","crm.confirmClearAllHistory":"Effacer TOUS les messages récupérés dans toutes les conversations ?","crm.noTextContent":"(pas de texte — message média)","crm.group":"Groupe","crm.enable":"Activer","crm.disable":"Désactiver","crm.addScheduleMessage":"Ajouter planification","crm.noScheduledMessages":"Pas de messages planifiés","crm.noScheduledMessagesDesc":"Planifiez des messages pour ce contact.","crm.userDetails":"Détails utilisateur","crm.addCustomAttribute":"+ Ajouter attribut","crm.edit":"Modifier","crm.cancel":"Annuler","crm.save":"Enregistrer","crm.signature":"Signature","crm.signatureDesc":"Entrez votre nom pour envoyer des messages signés ou pour montrer aux autres agents que vous êtes en service dans le chat spécifique.","crm.enterYourName":"Entrez votre nom","crm.activateSignature":"Activer la signature","crm.signatureAs":"Signature en tant que","crm.signatureNotSet":"Définissez votre nom de signature dans les paramètres de l'extension WhatsApp Web.","crm.delete":"Supprimer","crm.deleteConnection":"Supprimer la connexion ?","crm.deleteConnectionConfirm":"Êtes-vous sûr de vouloir supprimer cette connexion entre les nœuds ?","crm.fullName":"Nom complet","crm.phoneNumber":"Numéro de téléphone","crm.email":"E-mail","crm.gender":"Genre","crm.dateOfBirth":"Date de naissance","crm.details":"Détails","crm.address":"Adresse","crm.language":"Langue","crm.male":"Homme","crm.female":"Femme","crm.other":"Autre","crm.select":"- Sélectionner -","crm.customAttributes":"Attributs personnalisés","crm.addField":"Ajouter champ","crm.fieldLabel":"Libellé du champ","crm.fieldValue":"Valeur du champ","crm.noCustomFields":"Aucun champ personnalisé","crm.deleteFieldConfirm":"Voulez-vous vraiment supprimer ce champ?","crm.contactTabs":"Onglets contact","crm.addToTab":"Ajouter à l'onglet","crm.removeFromTab":"Retirer de l'onglet","crm.noTabs":"Aucun onglet créé","crm.createTab":"Créer un onglet","crm.tabName":"Nom de l'onglet","crm.contacts":"contacts","crm.addToLabel":"Ajouter à l'étiquette","crm.selectLabel":"Sélectionner étiquette","crm.noLabelsAvailable":"Aucune étiquette. Créez d'abord un onglet.","crm.labelsAndStages":"Étiquettes et Étapes","crm.whatsappLabels":"Étiquettes WhatsApp","crm.customTabs":"Onglets personnalisés","team.button":"Équipe","team.shareWith":"Partager avec l'équipe","team.settings":"Paramètres de l'équipe","team.addMember":"Ajouter un membre","team.editMember":"Modifier le membre","team.deleteMember":"Supprimer","team.memberName":"Nom du membre","team.memberPhone":"Numéro de téléphone","team.department":"Département","team.departmentPlaceholder":"ex., Ventes, Finance, Support","team.template":"Modèle de message","team.templatePlaceholder":"Entrez le message avec des variables...","team.noMembers":"Aucun membre configuré","team.clickToAdd":"Cliquez sur + pour ajouter des membres","team.sending":"Envoi en cours...","team.insertVariable":"Insérer une variable","team.preview":"Aperçu du message","team.deleteConfirm":"Êtes-vous sûr de vouloir supprimer ce membre ?","team.phonePlaceholder":"ex., +5511999999999","team.namePlaceholder":"ex., Commercial - Jean","team.variableHint":"Utilisez {{name}}, {{phone}}, {{labels}} etc. pour le contenu dynamique","team.save":"Enregistrer","team.cancel":"Annuler","team.editTemplate":"Modifier le modèle","team.saveAndSend":"Enregistrer et envoyer","team.sendOnce":"Envoyer une fois","team.send":"Envoyer","team.selectContact":"Sélectionner Contact","team.clickToSelectContact":"Cliquez pour sélectionner un contact WhatsApp","team.searchContact":"Rechercher contacts...","team.loadingContacts":"Chargement des contacts...","team.noContactsFound":"Aucun contact trouvé","team.noSearchResults":"Aucun résultat","team.phoneHint":"Entrez le numéro avec l'indicatif ou cliquez sur l'icône pour sélectionner","team.popupTitle":"Partager avec l'équipe","team.popupSubtitle":"Envoyer les coordonnées instantanément","team.noTeamMembers":"Aucun membre","team.noTeamMembersDesc":"Ajoutez des membres pour partager rapidement les contacts via WhatsApp","crm.addNote":"+ Ajouter note","crm.searchNotes":"Rechercher notes...","crm.noNotes":"Aucune note","crm.addFirstNote":"Ajoutez votre première note","crm.topic":"Sujet","crm.content":"Contenu","crm.editNote":"Modifier note","crm.deleteNote":"Supprimer note","crm.deleteNoteConfirm":"Voulez-vous vraiment supprimer cette note?","crm.addReminder":"+ Ajouter rappel","crm.noReminders":"Aucun rappel","crm.addFirstReminder":"Ajoutez votre premier rappel","crm.reminderTopic":"Sujet du rappel","crm.dateTime":"Date et heure","crm.repeatInterval":"Intervalle de répétition","crm.noRepeat":"Sans répétition","crm.every5Min":"Toutes les 5 minutes","crm.every10Min":"Toutes les 10 minutes","crm.every15Min":"Toutes les 15 minutes","crm.every30Min":"Toutes les 30 minutes","crm.every1Hour":"Toutes les heures","crm.status":"Statut","crm.pending":"En attente","crm.completed":"Terminé","crm.dismissed":"Ignoré","crm.stopped":"Arrêté","crm.snoozed":"Reporté","crm.due":"Dû","crm.editReminder":"Modifier rappel","crm.deleteReminder":"Supprimer rappel","crm.markComplete":"Marquer terminé","crm.snooze":"Reporter","crm.stop":"Arrêter","crm.addAppointment":"+ Ajouter rendez-vous","crm.noAppointments":"Aucun rendez-vous","crm.addFirstAppointment":"Ajoutez votre premier rendez-vous","crm.appointmentTitle":"Titre du rendez-vous","crm.attendee":"Participant","crm.googleMeetLink":"Lien Google Meet","crm.generateLink":"Générer lien","crm.messageTemplate":"Modèle de message","crm.reminderBefore":"Rappel avant","crm.sendMessageNow":"Envoyer maintenant","crm.scheduled":"Planifié","crm.cancelled":"Annulé","crm.missed":"Manqué","crm.editAppointment":"Modifier rendez-vous","crm.deleteAppointment":"Supprimer rendez-vous","crm.joinMeeting":"Rejoindre la réunion","crm.before5Min":"5 minutes avant","crm.before10Min":"10 minutes avant","crm.before15Min":"15 minutes avant","crm.before30Min":"30 minutes avant","crm.before1Hour":"1 heure avant","crm.before2Hours":"2 heures avant","crm.before1Day":"1 jour avant","crm.titleLabel":"Titre","crm.scheduleDateTime":"Planifier Date & Heure","crm.pasteGoogleMeetLink":"Collez votre lien Google Meet ici","crm.generateLinkHint":"Cliquez sur 'Générer le lien' pour ouvrir Google Meet, puis collez le lien de la réunion ici","crm.chooseTemplate":"Choisir un modèle","crm.selectTemplate":"-- Sélectionner un modèle --","crm.messageTemplatePlaceholder":"Entrez le modèle de message...","crm.useSameMessage":"Utiliser le même message au début de la réunion","crm.meetingStartMessageLabel":"Message de début de réunion","crm.meetingStartPlaceholder":"Entrez le message à envoyer au début de la réunion...","crm.meetingStartHint":"Ce message sera envoyé au début effectif de la réunion.","crm.sendReminderLabel":"Envoyer un rappel","crm.reminderTimeHint":"Le message sera envoyé aux participants à ce moment avant la réunion. Vous recevrez également une notification sonore.","crm.sendMessageNowTo":"Envoyer le message maintenant à","crm.sendNowHint":"Cochez pour envoyer le message de rendez-vous immédiatement après l'enregistrement","crm.discard":"Annuler","crm.saveAndSend":"Enregistrer et Envoyer","crm.sending":"Envoi en cours...","crm.noAppointmentsFound":"Aucun rendez-vous trouvé","crm.searchAppointments":"Rechercher des rendez-vous","crm.productDemoCall":"ex., Appel démo produit","crm.reminderMessageHint":"Ce message sera envoyé au moment du rappel (avant la réunion).","crm.joinMeet":"Rejoindre Meet","crm.appointmentTemplates":"Modèles de rendez-vous","crm.savedTemplates":"Modèles enregistrés","crm.noTemplatesYet":"Pas encore de modèles. Créez votre premier modèle!","crm.newTemplate":"+ Nouveau modèle","crm.editTemplateTitle":"Modifier le modèle","crm.newTemplateTitle":"Nouveau modèle","crm.templateName":"Nom du modèle","crm.templateNamePlaceholder":"ex., Rappel de réunion","crm.meetLinkOptional":"Lien Google Meet (Optionnel)","crm.updateTemplate":"Mettre à jour le modèle","crm.saveTemplate":"Enregistrer le modèle","crm.pleaseEnterTitle":"Veuillez entrer un titre","crm.pleaseSelectFutureDate":"Veuillez sélectionner une date et heure future","crm.deleteAppointmentConfirm":"Êtes-vous sûr de vouloir supprimer ce rendez-vous?","crm.pleaseEnterTemplateName":"Veuillez entrer un nom de modèle","crm.pleaseEnterMessageTemplate":"Veuillez entrer un modèle de message","crm.deleteTemplateConfirm":"Êtes-vous sûr de vouloir supprimer ce modèle?","crm.addIncome":"+ Ajouter revenu","crm.totalIncome":"Revenu total","crm.pendingIncome":"En attente","crm.filteredTotal":"Total filtré","crm.noIncome":"Aucun revenu","crm.addFirstIncome":"Ajoutez votre premier revenu","crm.amount":"Montant","crm.category":"Catégorie","crm.paymentMethod":"Mode de paiement","crm.description":"Description","crm.reference":"Référence","crm.date":"Date","crm.paymentReceived":"Paiement reçu","crm.sale":"Vente","crm.serviceFee":"Frais de service","crm.commission":"Commission","crm.refundReceived":"Remboursement reçu","crm.cash":"Espèces","crm.bankTransfer":"Virement bancaire","crm.upi":"UPI","crm.pix":"PIX","crm.card":"Carte","crm.cheque":"Chèque","crm.addCustomPaymentMethod":"Ajouter méthode perso","crm.editIncome":"Modifier revenu","crm.deleteIncome":"Supprimer revenu","crm.addExpense":"+ Ajouter dépense","crm.totalExpense":"Dépense totale","crm.pendingExpense":"En attente","crm.noExpense":"Aucune dépense","crm.addFirstExpense":"Ajoutez votre première dépense","crm.purchase":"Achat","crm.serviceCost":"Coût de service","crm.travel":"Voyage","crm.marketing":"Marketing","crm.commissionPaid":"Commission payée","crm.refundGiven":"Remboursement donné","crm.editExpense":"Modifier dépense","crm.deleteExpense":"Supprimer dépense","crm.search":"Rechercher...","crm.all":"Tous","crm.today":"Aujourd'hui","crm.thisWeek":"Cette semaine","crm.thisMonth":"Ce mois","crm.thisYear":"Cette année","crm.filterByCategory":"Filtrer par catégorie","crm.filterByStatus":"Filtrer par statut","crm.filterByDate":"Filtrer par date","crm.allStatus":"Tous les statuts","crm.allCategories":"Toutes les catégories","crm.none":"Aucun","crm.ref":"Réf","crm.tableTabName":"Nom de l'onglet","crm.tableContactsInTab":"Contacts dans l'onglet","crm.tableAction":"Action","crm.tableName":"Nom","crm.tableModifiedDate":"Date de modification","crm.tableTopic":"Sujet","crm.tableReminderDate":"Date de rappel","crm.tableRepeatSnooze":"Répéter/Reporter","crm.tableStatus":"Statut","crm.tableTitle":"Titre","crm.tableDateTime":"Date et heure","crm.tableAttendee":"Participant","crm.tableMeetLink":"Lien Meet","crm.tableDescription":"Description","crm.tableCategory":"Catégorie","crm.tableAmount":"Montant","crm.tablePayment":"Paiement","crm.tableDate":"Date","crm.addIncomeTitle":"Ajouter revenu","crm.editIncomeTitle":"Modifier revenu","crm.addExpenseTitle":"Ajouter dépense","crm.editExpenseTitle":"Modifier dépense","crm.enterAmount":"Saisir le montant","crm.validAmountRequired":"Veuillez saisir un montant valide","crm.descriptionRequired":"Veuillez saisir une description","crm.referenceInvoice":"Référence / N° de facture","crm.referenceBill":"Référence / N° de reçu","crm.invoicePlaceholder":"ex. FAC-001","crm.billPlaceholder":"ex. REC-001","crm.paymentDescription":"ex. Paiement pour services","crm.expenseDescription":"ex. Fournitures de bureau","crm.update":"Mettre à jour","crm.addIncomeBtn":"Ajouter revenu","crm.addExpenseBtn":"Ajouter dépense","crm.recurringTransaction":"Transaction récurrente","crm.repeatEvery":"Répéter tous les","crm.neverEnds":"Sans fin","crm.endDate":"Date de fin","crm.daily":"Quotidien","crm.weekly":"Hebdomadaire","crm.monthly":"Mensuel","crm.quarterly":"Trimestriel (3 mois)","crm.yearly":"Annuel","crm.currencySettings":"Paramètres de devise","crm.searchCurrency":"Rechercher devise...","crm.noCurrenciesFound":"Aucune devise trouvée","crm.noIncomeRecords":"Aucun enregistrement de revenu trouvé","crm.noExpenseRecords":"Aucun enregistrement de dépense trouvé","crm.deleteIncomeConfirm":"Êtes-vous sûr de vouloir supprimer cet enregistrement de revenu ?","crm.deleteExpenseConfirm":"Êtes-vous sûr de vouloir supprimer cet enregistrement de dépense ?","crm.addCategory":"Ajouter une catégorie","crm.categoryName":"Nom de la catégorie","crm.enterCategoryName":"Entrez le nom de la catégorie","crm.customCategories":"Catégories personnalisées","crm.addCustomCategory":"Ajouter une catégorie personnalisée","crm.existingCustomCategories":"Catégories personnalisées existantes","crm.addStatus":"Ajouter un statut","crm.statusName":"Nom du statut","crm.enterStatusName":"Entrez le nom du statut","crm.customStatuses":"Statuts personnalisés","crm.addCustomStatus":"Ajouter un statut personnalisé","crm.existingCustomStatuses":"Statuts personnalisés existants","crm.add":"Ajouter","crm.loading":"Chargement...","crm.dismiss":"Ignorer","crm.yesterday":"Hier","agent.agentMode":"Mode Agent","agent.identifyAsAgent":"S'identifier comme agent","agent.agentName":"Nom de l'agent","agent.namePlaceholder":"ex., Jean, Équipe Support 1","agent.agentNamePlaceholder":"Entrez votre nom d'agent","agent.viewTransferHistory":"Voir l'historique des transferts","agent.transferToAgent":"Transférer à un agent","agent.transferSuccess":"Chat transféré avec succès","agent.noAgentsOnline":"Aucun agent disponible en ligne","agent.selectAgent":"Sélectionner un agent","agent.chooseAgent":"-- Choisir un agent --","agent.reason":"Raison","agent.reasonPlaceholder":"Pourquoi transférez-vous ce chat ?","agent.priority":"Priorité","agent.priorityLow":"Faible","agent.priorityMedium":"Moyenne","agent.priorityHigh":"Haute","agent.priorityUrgent":"Urgente","agent.transfer":"Transférer","agent.incomingTransfer":"Transfert entrant","agent.fromAgent":"De l'agent","agent.toAgent":"Vers l'agent","agent.chat":"Chat","agent.startService":"Démarrer le service","agent.endService":"Terminer le service","agent.activeService":"Service actif","agent.from":"De","agent.to":"À","agent.duration":"Durée","agent.transferHistory":"Historique des transferts","agent.sent":"Envoyés","agent.received":"Reçus","agent.status":"Statut","agent.all":"Tous","agent.statusPending":"En attente","agent.statusAccepted":"Accepté","agent.statusInService":"En service","agent.statusCompleted":"Terminé","agent.statusDeclined":"Refusé","agent.statusExpired":"Expiré","agent.noTransfers":"Aucun transfert trouvé","agent.serviceQueue":"File d'attente de service","agent.pendingTransfers":"Transferts en attente","agent.activeServices":"Services actifs","agent.sentTransfers":"Transferts envoyés","agent.noActiveServices":"Aucun service actif ni transfert en attente","agent.serviceEnded":"Service terminé avec succès","agent.accept":"Accepter","agent.decline":"Refuser","agent.notRegistered":"Agent non enregistré. Veuillez d'abord activer le mode agent.","agent.statusCancelled":"Annulé","agent.started":"Commencé","chatTools.suggest":"Suggérer","chatTools.spelling":"Orthographe","chatTools.translate":"Traduire","chatTools.summarize":"Résumer","chatTools.enlarge":"Agrandir","chatTools.friendly":"Amical","chatTools.formal":"Formel","chatTools.send":"Envoyer","chatTools.copy":"Copier","chatTools.use":"Utiliser","chatTools.aiResult":"Résultat IA","chatTools.suggestTitle":"Suggestion IA","chatTools.spellingTitle":"Corriger l'orthographe et la grammaire","chatTools.translateTitle":"Traduire en","chatTools.summarizeTitle":"Résumer le texte","chatTools.enlargeTitle":"Développer le texte","chatTools.friendlyTitle":"Rendre amical","chatTools.formalTitle":"Rendre formel","chatTools.conversationSummary":"Résumé du chat","chatTools.conversationSummaryTitle":"Résumer cette conversation","chatTools.conversationSummarizing":"Résumé du chat en cours…","chatTools.conversationSummaryEmpty":"Aucun message à résumer dans ce chat","chatTools.conversationSummaryNoChat":"Ouvrez un chat pour le résumer","chatTools.conversationSummaryFailed":"Échec de la récupération des messages du chat","chatTools.conversationSummaryResultTitle":"Résumé de la conversation","chatTools.sendTitle":"Envoyer le message","chatTools.selectTextFirst":"Sélectionnez d'abord le texte ou tapez dans la zone de saisie","chatTools.searchLanguage":"Rechercher une langue...","aiSettings.title":"Insérer la clé API AI","aiSettings.platformType":"Type de plateforme AI","aiSettings.geminiAI":"GEMINI AI","aiSettings.chatgpt":"CHATGPT","aiSettings.deepseek":"DEEPSEEK","aiSettings.apiKey":"Clé API AI","aiSettings.enterApiKey":"Veuillez entrer votre clé API AI","aiSettings.validate":"Valider","aiSettings.validKey":"La clé API est valide !","aiSettings.invalidKey":"Clé API invalide. Veuillez vérifier et réessayer.","aiSettings.note":"Note :","aiSettings.geminiNote":"Obtenez votre clé API Gemini sur Google AI Studio (aistudio.google.com)","aiSettings.chatgptNote":"Obtenez votre clé API OpenAI sur platform.openai.com/api-keys","aiSettings.deepseekNote":"Obtenez votre clé API DeepSeek sur platform.deepseek.com","aiSettings.enableAITools":"Activer les outils AI","aiSettings.close":"Fermer","aiSettings.save":"Enregistrer","aiSettings.configureAI":"Configurez votre fournisseur AI et votre clé API pour les fonctionnalités alimentées par l'IA","settings.title":"Paramètres","settings.yourLanguage":"Votre Langue","settings.selectLanguage":"Sélectionner la Langue","settings.chooseLanguage":"Choisissez votre langue préférée pour l'interface de l'extension","settings.whatLanguageSpeak":"Quelle Langue Parlez-vous","settings.translateMessages":"Traduire les messages entrants","settings.selectSpokenLanguage":"Sélectionnez Votre Langue","settings.spokenLanguageHint":"Les messages seront traduits dans cette langue lorsque vous cliquerez sur l'icône de traduction sur les messages entrants.","settings.blurSettings":"Paramètres de flou","settings.blurDescription":"Flouter les informations privées à l'écran.","settings.blurMessages":"Flouter les messages","settings.blurProfileNames":"Flouter les noms de profil","settings.blurDisplayPhotos":"Flouter les photos de profil","settings.blurConversation":"Flouter la conversation","settings.displayOnHover":"Afficher la conversation au survol","settings.theme":"Thème","settings.themeDescription":"Choisissez votre palette de couleurs préférée","settings.lightMode":"Mode Clair","settings.lightModeDesc":"Apparence claire classique","settings.darkMode":"Mode Sombre","settings.darkModeDesc":"Agréable pour les yeux en faible luminosité","settings.systemMode":"Système","settings.systemModeHint":"Suit le thème de WhatsApp","settings.currentTheme":"Thème actuel","signature.title":"Signature","signature.enableSignature":"Activer la signature","signature.yourSignature":"Votre signature","signature.placeholder":"ex., - Jean Dupont","signature.preview":"Aperçu","signature.save":"Enregistrer","backup.title":"Sauvegarde et restauration","backup.export":"Exporter","backup.import":"Importer","backup.importHint":"Téléchargez un fichier JSON de sauvegarde {brand} pour restaurer vos données. Vous pouvez sélectionner les fonctionnalités à importer.","backup.kanbanCRM":"Données Kanban CRM","backup.customTabs":"Onglets personnalisés","backup.templatesQuickReplies":"Modèles et réponses rapides","backup.broadcastHistory":"Historique des diffusions","backup.settings":"Paramètres","backup.crmProfileData":"Données de profil CRM","backup.calendarData":"Calendrier (Rappels et Rendez-vous)","backup.statusData":"Statut","backup.webhookSettings":"Paramètres Webhook","backup.aiBotSettings":"Paramètres du Bot IA","backup.aiApiSettings":"Paramètres API IA","backup.spokenLanguage":"Langue parlée","backup.chatbotFlows":"Flux de Chatbot (Fluxo)","backup.followupData":"Séquences de suivi","backup.scheduledMessages":"Messages programmés","backup.scheduledBroadcasts":"Diffusions programmées","backup.fluxoAdvanced":"Paramètres avancés Fluxo","backup.conversationStates":"États de conversation","backup.bulkValidatorData":"Données du validateur en masse","backup.quickReplies":"Réponses rapides","backup.crmTodos":"Listes de tâches CRM","backup.signatureSettings":"Paramètres de signature","backup.teamSettings":"Paramètres d'équipe","backup.blurSettings":"Paramètres de flou","backup.featureVisibility":"Visibilité des fonctionnalités","backup.themeSettings":"Paramètres du thème","backup.uiStateSettings":"Paramètres d'état de l'interface","backup.apiPollingSettings":"Paramètres de sondage API","backup.agentSettings":"Paramètres d'agent","backup.autoBackup":"Sauvegarde automatique","backup.autoBackupInfo":"Une sauvegarde automatique sera créée lorsque WhatsApp Web se chargera à une nouvelle date","backup.autoBackupDestination":"Destination de la sauvegarde","backup.autoBackupWhatsApp":"Envoyer aux messages WhatsApp sauvegardés","backup.autoBackupDownload":"Télécharger sur l'ordinateur","backup.exportNow":"Exporter maintenant","backup.importNow":"Importer maintenant","backup.selectFile":"Sélectionnez le fichier de sauvegarde à importer","backup.importSuccess":"Données importées avec succès !","backup.importError":"Erreur lors de l'importation des données. Veuillez vérifier le format du fichier.","backup.exportSuccess":"Données exportées avec succès !","backup.noDataSelected":"Veuillez sélectionner au moins un type de données à exporter/importer","backup.cheetahDetected":"Cheetah CRM détecté","backup.fileLoaded":"Fichier chargé avec succès","backup.cheetahImportDesc":"Cette sauvegarde contient des données Cheetah CRM. Toutes les fonctionnalités compatibles seront importées et fusionnées avec vos données CRM existantes.","backup.dataToImport":"Données à importer :","backup.mergeWarning":"Important :","backup.mergeWarningDesc":"Les données seront fusionnées avec les données CRM existantes. Vos données actuelles NE seront PAS écrasées - seules les nouvelles données seront ajoutées.","backup.importing":"Importation...","backup.importCheetah":"Importer la sauvegarde Cheetah CRM","missedSchedule.title":"Campagne programmée manquée","missedSchedule.description":"Une campagne programmée a été manquée car WhatsApp Web n'était pas ouvert à l'heure programmée.","missedSchedule.sendNow":"Envoyer maintenant","missedSchedule.cancelDiscard":"Annuler et supprimer","missedSchedule.dismiss":"Rappeler plus tard","calendar.title":"Calendrier","calendar.goToToday":"Aller à aujourd'hui","calendar.reminders":"Rappels","calendar.appointments":"Rendez-vous","calendar.remindersFor":"Rappels pour","calendar.appointmentsFor":"Rendez-vous pour","calendar.noReminders":"Pas de rappels pour cette date","calendar.noAppointments":"Pas de rendez-vous pour cette date","calendar.selectDate":"Sélectionnez une date avec des rappels ou des rendez-vous","calendar.deleteReminder":"Supprimer le rappel","calendar.deleteAppointment":"Supprimer le rendez-vous","calendar.confirmDeleteReminder":"Êtes-vous sûr de vouloir supprimer ce rappel ?","calendar.confirmDeleteAppointment":"Êtes-vous sûr de vouloir supprimer ce rendez-vous ?","calendar.everyMin":"Toutes les {min} min","calendar.everyHour":"Toutes les heures","calendar.weekdays.sun":"DIM","calendar.weekdays.mon":"LUN","calendar.weekdays.tue":"MAR","calendar.weekdays.wed":"MER","calendar.weekdays.thu":"JEU","calendar.weekdays.fri":"VEN","calendar.weekdays.sat":"SAM","calendar.months.january":"Janvier","calendar.months.february":"Février","calendar.months.march":"Mars","calendar.months.april":"Avril","calendar.months.may":"Mai","calendar.months.june":"Juin","calendar.months.july":"Juillet","calendar.months.august":"Août","calendar.months.september":"Septembre","calendar.months.october":"Octobre","calendar.months.november":"Novembre","calendar.months.december":"Décembre","calendar.status.pending":"En attente","calendar.status.completed":"Terminé","calendar.status.dismissed":"Rejeté","calendar.status.snoozed":"Reporté","calendar.status.stopped":"Arrêté","calendar.status.scheduled":"Planifié","calendar.status.cancelled":"Annulé","calendar.status.missed":"Manqué","calendar.todos":"Tâches","calendar.todosFor":"Tâches pour","calendar.noTodos":"Aucune tâche trouvée","calendar.addTodo":"Ajouter une tâche","calendar.editTodo":"Modifier la tâche","calendar.deleteTodo":"Supprimer la tâche","calendar.confirmDeleteTodo":"Êtes-vous sûr de vouloir supprimer cette tâche?","todo.title":"Titre","todo.titlePlaceholder":"Entrez le titre de la tâche","todo.description":"Description","todo.descriptionPlaceholder":"Ajouter des détails (optionnel)","todo.dueDate":"Date d'échéance","todo.dueTime":"Heure d'échéance","todo.priority":"Priorité","todo.priorityHigh":"Haute","todo.priorityMedium":"Moyenne","todo.priorityLow":"Basse","todo.category":"Catégorie","todo.noCategory":"Sans catégorie","todo.categoryWork":"Travail","todo.categoryPersonal":"Personnel","todo.categoryUrgent":"Urgent","todo.categoryShopping":"Achats","todo.categoryHealth":"Santé","todo.subtasks":"Sous-tâches","todo.addSubtask":"Ajouter","todo.subtaskPlaceholder":"Entrez la sous-tâche","todo.recurring":"Récurrent","todo.repeatEvery":"Répéter","todo.endDate":"Date de fin","todo.recurringDaily":"Quotidien","todo.recurringWeekly":"Hebdomadaire","todo.recurringMonthly":"Mensuel","todo.recurringYearly":"Annuel","todo.reminder":"Rappel","todo.reminderDate":"Date de rappel","todo.reminderTime":"Heure de rappel","todo.browserNotification":"Notification navigateur","todo.whatsappSelfMessage":"Envoyer un rappel WhatsApp à moi-même","todo.whatsappSelfMessageHint":"Vous recevrez un message WhatsApp à l'échéance","todo.save":"Enregistrer la tâche","todo.update":"Mettre à jour la tâche","todo.cancel":"Annuler","todo.addTodo":"Ajouter une tâche","todo.editTodo":"Modifier la tâche","todo.statusPending":"En attente","todo.statusInProgress":"En cours","todo.statusCompleted":"Terminé","todo.statusCancelled":"Annulé","todo.filterAll":"Toutes les tâches","todo.filterToday":"Aujourd'hui","todo.filterThisWeek":"Cette semaine","todo.filterOverdue":"En retard","todo.filterCompleted":"Terminées","todo.today":"Aujourd'hui","todo.tomorrow":"Demain","todo.overdue":"En retard","todo.snoozeTime":"Durée du report","todo.minutes":"minutes","todo.hour":"heure","todo.hours":"heures","todo.day":"jour","todo.taskReminder":"Rappel de tâche","todo.highPriority":"Haute priorité","todo.mediumPriority":"Priorité moyenne","todo.lowPriority":"Basse priorité","todo.subtasksCount":"sous-tâches","todo.snooze":"Reporter","todo.markDone":"Marquer comme fait","todo.dismiss":"Ignorer","todo.task":"Tâche","todo.changeColor":"Cliquez pour changer la couleur","todo.selectCategoryFirst":"Sélectionnez d'abord une catégorie","todo.linkedContacts":"Contacts liés","todo.optional":"Optionnel","todo.selectContacts":"Sélectionner des contacts","todo.searchContacts":"Rechercher des contacts...","todo.noContactsFound":"Aucun contact trouvé","todo.selected":"sélectionnés","todo.contacts":"contacts","status.title":"Statut","status.activeStatus":"Statut Actif","status.createStatus":"Créer un Statut","status.loading":"Chargement des statuts...","status.noStatusFound":"Aucun statut trouvé","status.noStatusDescription":"Il semble que vous n'ayez pas encore créé de statut. Cliquez sur le bouton ci-dessous pour en ajouter un.","status.add":"Ajouter","status.statusName":"Nom du statut (optionnel)","status.statusNamePlaceholder":"Créer un nom pour le statut","status.chooseType":"Choisir un type","status.type.text":"TEXTE","status.type.image":"IMAGE","status.type.video":"VIDÉO","status.type.audio":"AUDIO","status.typeText":"Tapez le texte","status.backgroundColor":"Choisir une couleur de fond","status.clickToChange":"Cliquez pour changer","status.import":"Importer","status.dragHere":"Glissez le fichier ici","status.scheduleStatus":"Programmer le statut","status.autoRepost24h":"Republier le statut toutes les 24 heures","status.autoRepost":"Auto-Republier","status.postNow":"Publier maintenant","status.posting":"Publication...","status.create":"Créer","status.delete":"Supprimer","status.emoji":"Emoji","status.status.pending":"En attente","status.status.posted":"Publié","status.status.scheduled":"Planifié","status.status.failed":"Échoué","status.caption":"Légende","status.captionPlaceholder":"Ajouter une légende...","status.edit":"Modifier","ai.regenerate":"Régénérer","ai.regenerating":"Régénération...","ai.regenerateWithAI":"Régénérer avec l'IA","ai.notEnabled":"L'IA n'est pas activée. Veuillez configurer les paramètres de l'IA.","ai.failedToRegenerate":"Échec de la régénération","ai.failedToRegenerateMessage":"Échec de la régénération du message","broadcast.title":"Messages en masse","broadcast.newCampaign":"Nouvelle campagne","broadcast.reports":"Rapports","broadcast.close":"Fermer","broadcast.sending":"Envoi en cours...","broadcast.paused":"En pause","broadcast.completed":"Terminé","broadcast.clearHistory":"Effacer l'historique","broadcast.createCampaign":"Créer une campagne","broadcast.createCampaignSubtitle":"Envoyer des messages personnalisés à plusieurs contacts","broadcast.scheduledCampaigns":"Campagnes planifiées","broadcast.campaignReports":"Rapports de campagne","broadcast.viewManageCampaigns":"Afficher et gérer vos campagnes","broadcast.recipients":"Destinataires","broadcast.selected":"sélectionnés","broadcast.contacts":"Contacts","broadcast.groups":"Groupes","broadcast.phone":"Téléphone","broadcast.phonePlaceholder":"Numéros de téléphone avec indicatif","broadcast.clearAll":"Tout effacer","broadcast.contactsUploaded":"contacts téléchargés","broadcast.noGroupsSelected":'Aucun groupe sélectionné. Cliquez sur "Ajouter des groupes" pour sélectionner.',"broadcast.addGroups":"Ajouter des groupes","broadcast.groupsSelected":"groupe(s) sélectionné(s)","broadcast.upload":"Télécharger","broadcast.select":"Sélectionner","broadcast.download":"Télécharger","broadcast.groupsContacts":"Contacts du groupe","broadcast.tabsContacts":"Contacts de l'onglet","broadcast.kanbanBoard":"Tableau Kanban","broadcast.labelsContacts":"Contacts du label","broadcast.allowRepeat":"Autoriser les numéros en double","broadcast.enableLinkPreview":"Activer l'aperçu du lien","broadcast.groupActions":"Actions de groupe","broadcast.customTabActions":"Actions d'onglet personnalisé","broadcast.labelsActions":"Actions de labels","broadcast.kanbanBoardActions":"Actions du tableau Kanban","broadcast.skipBulkMessage":"Ignorer l'envoi en masse","broadcast.skipBulkMessageInfo":"L'envoi de messages sera ignoré. Seules les actions (Groupes, Onglets, Labels, Kanban) seront effectuées sur les contacts.","broadcast.appendSignature":"Ajouter la signature","broadcast.signaturePreview":"Aperçu","broadcast.groupActionsNote":"Remarque: Vous devez être administrateur des groupes pour effectuer les actions ci-dessous.","broadcast.addIntoGroups":"Ajouter aux groupes","broadcast.removeFromGroups":"Retirer des groupes","broadcast.selectGroups":"Sélectionner des groupes","broadcast.addIntoTabs":"Ajouter aux onglets personnalisés","broadcast.removeFromTabs":"Retirer des onglets personnalisés","broadcast.selectTabs":"Sélectionner des onglets","broadcast.addToLabels":"Ajouter aux labels","broadcast.removeFromLabels":"Retirer des labels","broadcast.selectLabels":"Sélectionner des labels","broadcast.addToKanban":"Ajouter à l'étape Kanban","broadcast.removeFromKanban":"Retirer de l'étape Kanban","broadcast.selectCRMStage":"Sélectionner CRM et étape","broadcast.sendRandomMessage":"Envoyer un message aléatoire à chaque contact","broadcast.addMessage":"Ajouter un message","broadcast.pauseSetting":"Paramètre de pause","broadcast.pauseAfterXSends":"Pause (après X envois):","broadcast.pauseTimeInSeconds":"Temps de pause (s):","broadcast.second":"Seconde","broadcast.message":"Message","broadcast.moveUp":"Monter","broadcast.moveDown":"Descendre","broadcast.deleteMessage":"Supprimer le message","broadcast.templateType":"Type de modèle","broadcast.messageOnly":"Message uniquement","broadcast.enterMessageText":"Veuillez entrer le texte du message","broadcast.variable":"Variable","broadcast.phoneNumber":"Numéro de téléphone","broadcast.contactName":"Nom du contact","broadcast.uploadCSVHint":"Téléchargez un CSV avec des colonnes supplémentaires pour ajouter plus de variables","broadcast.selectTemplates":"Sélectionner des modèles","broadcast.noTemplates":"Aucun modèle disponible","broadcast.sendingDelay":"Délai d'envoi","broadcast.minimumSecond":"Seconde minimum","broadcast.maximumSecond":"Seconde maximum","broadcast.delayHint":"Chaque message sera envoyé avec un délai aléatoire entre {min}-{max} secondes","broadcast.scheduleMessage":"Planifier le message","broadcast.date":"Date","broadcast.time":"Heure","broadcast.autoSendIfMissed":"Envoi automatique si l'heure prévue est passée","broadcast.recurring":"Récurrent","broadcast.repeatInterval":"Répéter","broadcast.daily":"Quotidien","broadcast.weekly":"Hebdomadaire","broadcast.monthly":"Mensuel","broadcast.yearly":"Annuel","broadcast.selectDays":"Sélectionner les jours","broadcast.sun":"Dim","broadcast.mon":"Lun","broadcast.tue":"Mar","broadcast.wed":"Mer","broadcast.thu":"Jeu","broadcast.fri":"Ven","broadcast.sat":"Sam","broadcast.ends":"Se termine","broadcast.endNever":"Jamais","broadcast.endOnDate":"Le","broadcast.recurringHowToUse":"Comment utiliser Récurrent","broadcast.recurringTip1":"Activez récurrent pour répéter automatiquement cette diffusion","broadcast.recurringTip2":"Choisissez la fréquence: Quotidien, Hebdomadaire, Mensuel ou Annuel","broadcast.recurringTip3":"Pour Hebdomadaire: Sélectionnez des jours spécifiques (Lun, Mar, etc.)","broadcast.recurringTip4":'Définissez une date de fin ou choisissez "Jamais" pour une exécution indéfinie',"broadcast.recurringTip5":"Après chaque diffusion, la suivante est programmée automatiquement","broadcast.selectDates":"Sélectionner les dates","broadcast.selectMonths":"Sélectionner les mois","broadcast.calendarSelectInfo":"Sélectionnez des dates spécifiques dans le calendrier. Naviguez entre les mois avec les flèches.","broadcast.datesSelected":"dates sélectionnées","broadcast.jan":"Jan","broadcast.feb":"Fév","broadcast.mar":"Mar","broadcast.apr":"Avr","broadcast.may":"Mai","broadcast.jun":"Juin","broadcast.jul":"Juil","broadcast.aug":"Août","broadcast.sep":"Sep","broadcast.oct":"Oct","broadcast.nov":"Nov","broadcast.dec":"Déc","broadcast.quickStart":"Démarrage rapide","broadcast.previewStart":"Aperçu et démarrage","broadcast.scheduleBroadcast":"Planifier la diffusion","broadcast.sent":"Envoyés","broadcast.failed":"Échoués","broadcast.resume":"Reprendre","broadcast.pause":"Pause","broadcast.stop":"Arrêter","broadcast.resumeCampaign":"Reprendre la campagne?","broadcast.campaignInterrupted":"Une campagne a été interrompue. Voulez-vous reprendre?","broadcast.remaining":"Restants","broadcast.contactsProcessed":"contacts traités","broadcast.resumeCampaignBtn":"Reprendre la campagne","broadcast.cancelDiscard":"Annuler et supprimer","broadcast.dismissRemindLater":"Ignorer (Rappeler plus tard)","broadcast.broadcastScheduled":"Diffusion planifiée!","broadcast.campaignPreview":"Aperçu de la campagne","broadcast.messages":"Messages","broadcast.stepSettings":"Paramètres","broadcast.stepActions":"Actions","broadcast.stepReview":"Vérifier","broadcast.delayRange":"Plage de délai","broadcast.pauseAfterDuration":"Pause après / Durée","broadcast.checkConsole":"Vérifiez la console du navigateur pour la configuration détaillée","broadcast.sendingQueue":"File d'envoi","broadcast.broadcastReports":"Rapports de diffusion","broadcast.campaignHistory":"Historique des campagnes","broadcast.noHistoryYet":"Pas encore d'historique de diffusion","broadcast.historyDescription":"Vos diffusions terminées et planifiées apparaîtront ici","broadcast.noCampaignsYet":"Pas encore de campagnes terminées","broadcast.dateTime":"Date et heure","broadcast.status":"Statut","broadcast.scheduled":"Planifié","broadcast.cancel":"Annuler","broadcast.running":"En cours","broadcast.cancelled":"Annulé","broadcast.downloadAllContacts":"Télécharger tous les contacts","broadcast.downloadSentContacts":"Télécharger les contacts envoyés","broadcast.downloadFailedContacts":"Télécharger les contacts échoués","broadcast.selectGroupsToAdd":"Sélectionner des groupes pour ajouter des contacts","broadcast.selectGroupsToRemove":"Sélectionner des groupes pour retirer des contacts","broadcast.selectTabsToAdd":"Sélectionner des onglets pour ajouter des contacts","broadcast.selectTabsToRemove":"Sélectionner des onglets pour retirer des contacts","broadcast.selectLabelsToAdd":"Sélectionner des labels pour ajouter des contacts","broadcast.selectLabelsToRemove":"Sélectionner des labels pour retirer des contacts","broadcast.selectCRM":"Sélectionner CRM","broadcast.selectStage":"Sélectionner l'étape","broadcast.backToCRMs":"Retour aux CRMs","broadcast.loadingGroups":"Chargement des groupes...","broadcast.loadingTabs":"Chargement des onglets...","broadcast.loadingLabels":"Chargement des labels...","broadcast.noGroupsFound":"Aucun groupe trouvé où vous êtes administrateur","broadcast.noTabsFound":"Aucun onglet personnalisé trouvé. Créez d'abord des onglets.","broadcast.noLabelsFound":"Aucun label trouvé. Créez d'abord des labels dans WhatsApp.","broadcast.noCRMsFound":"Aucun CRM trouvé. Créez d'abord un CRM.","broadcast.noStagesFound":"Aucune étape trouvée dans ce CRM.","broadcast.tabsSelected":"onglets sélectionnés","broadcast.labelsSelected":"labels sélectionnés","broadcast.confirmSelection":"Confirmer la sélection","broadcast.availableVariables":"Variables disponibles","broadcast.of":"de","broadcast.chats":"discussions","broadcast.remove":"Retirer","broadcast.allScheduledCampaigns":"Toutes les Campagnes Planifiées","broadcast.noScheduledCampaigns":"Aucune campagne planifiée","broadcast.scheduleFirstCampaign":"Planifiez votre première campagne pour la voir ici","broadcast.createNewCampaign":"Créer une Nouvelle Campagne","broadcast.oneTime":"Une fois","broadcast.nextRun":"Prochaine exécution","broadcast.runNow":"Exécuter Maintenant","broadcast.pauseCampaign":"Pause","broadcast.editCampaign":"Modifier","broadcast.deleteCampaign":"Supprimer","broadcast.confirmDeleteScheduled":"Êtes-vous sûr de vouloir supprimer cette campagne planifiée?","broadcast.campaignStarting":"La campagne démarrera bientôt","broadcast.skipNext":"Ignorer la Prochaine","broadcast.unskipNext":"Ne pas Ignorer","broadcast.skippingNext":"Ignore la prochaine","broadcast.lastRun":"Dernière exécution","broadcast.runs":"exécutions","broadcast.successRate":"réussite","broadcast.justNow":"à l'instant","broadcast.inAMoment":"dans un instant","broadcast.ago":"il y a","broadcast.in":"dans","broadcast.uploadContacts":"Télécharger des contacts","broadcast.stepSelect":"Sélectionner","broadcast.stepMap":"Mapper","broadcast.stepUpload":"Télécharger","broadcast.uploadCSVImport":"Téléchargez un fichier CSV pour importer des contacts","broadcast.uploadCSVOnly":"Fichier CSV uniquement (format .csv)","broadcast.downloadSampleFile":"Télécharger le fichier exemple","broadcast.phoneNumberLabel":"Numéro de téléphone :","broadcast.mapColumnHint":"mappez la colonne avec les données 'Numéro de téléphone'","broadcast.chooseExtraColumns":"Choisissez des colonnes supplémentaires pour les messages personnalisés.","broadcast.all":"Tous","broadcast.none":"Aucun","broadcast.previous":"Précédent","broadcast.next":"Suivant","broadcast.removeUnwantedRows":"Supprimer les lignes indésirables","broadcast.totalContacts":"Total des contacts","broadcast.startUpload":"Démarrer le téléchargement","broadcast.rows":"lignes","broadcast.selectGroupsTitle":"Sélectionner des groupes","broadcast.searchGroups":"Rechercher des groupes...","broadcast.members":"membres","broadcast.groupsSelectedCount":"groupes sélectionnés","broadcast.addGroupsBtn":"Ajouter des groupes","broadcast.tooltipBold":"Gras","broadcast.tooltipItalic":"Italique","broadcast.tooltipStrikethrough":"Barré","broadcast.tooltipAddMedia":"Ajouter un média","broadcast.tooltipRefresh":"Actualiser","broadcast.noCompletedCampaigns":"Aucune campagne terminée pour l'instant","kanban.title":"CRM KANBAN","kanban.user":"Utilisateur","kanban.darkMode":"Mode sombre","kanban.lightMode":"Mode clair","kanban.menu":"Menu","kanban.createCRM":"Créer CRM","kanban.addStage":"Ajouter étape","kanban.analytics":"Analytique","kanban.sync":"Synchroniser","kanban.cannotAddStages":"Impossible d'ajouter des étapes au CRM Labels WhatsApp","kanban.inbox":"BOÎTE","kanban.unread":"Non lus","kanban.pinned":"Épinglés","kanban.groups":"Groupes","kanban.stages":"étapes","kanban.chats":"chats","kanban.searchInbox":"Rechercher dans la boîte...","kanban.searchContacts":"Rechercher...","kanban.stageOptions":"Options d'étape","kanban.renameStage":"Renommer","kanban.clearSearch":"Effacer recherche","kanban.noChatsMatch":"Aucun chat correspondant","kanban.noChatsYet":"Pas encore de chats","kanban.filterUnread":"Filtrer chats non lus","kanban.filterPinned":"Filtrer chats épinglés","kanban.filterGroups":"Filtrer chats de groupe","kanban.addNewStage":"Ajouter nouvelle étape","kanban.noCRMsFound":"Aucun CRM trouvé","kanban.selectCRM":"Sélectionnez un CRM dans le menu","kanban.loading":"Chargement Kanban CRM...","kanban.syncingLabels":"Synchronisation des labels WhatsApp et onglets...","kanban.switchCRM":"Changer CRM","kanban.createNewCRM":"Créer nouveau CRM","kanban.enterCRMName":"Entrez le nom du CRM...","kanban.addNewStageTitle":"Ajouter nouvelle étape","kanban.enterStageName":"Entrez le nom de l'étape...","kanban.editStage":"Modifier étape","kanban.editStageName":"Modifier nom de l'étape","kanban.deleteStage":"Supprimer étape","kanban.editCRM":"Modifier CRM","kanban.deleteCRM":"Supprimer CRM","kanban.confirmDeleteStage":"Êtes-vous sûr? Les chats seront déplacés vers la boîte.","kanban.cannotDeleteInbox":"Impossible de supprimer l'étape boîte de réception.","kanban.cannotAddStagesLabels":"Impossible d'ajouter des étapes au CRM Labels. Les labels sont synchronisés depuis WhatsApp.","kanban.chatsLoadedSuccess":"Chats chargés avec succès!","kanban.failedLoadChats":"Échec du chargement des chats. Assurez-vous d'être sur WhatsApp Web.","kanban.noAvailableChats":"Aucun chat disponible.","kanban.enterNewCRMName":"Entrez le nouveau nom du CRM:","kanban.name":"Nom","kanban.phone":"Téléphone","kanban.lastMessage":"Dernier message","kanban.noMessages":"Aucun message","kanban.unreadCount":"Non lus","kanban.type":"Type","kanban.groupChat":"Chat de groupe","kanban.individualChat":"Chat individuel","kanban.status":"Statut","kanban.dealValue":"Valeur (EUR)","kanban.enterDealValue":"Entrez la valeur","kanban.notes":"Notes","kanban.addNotes":"Ajouter des notes sur ce chat...","kanban.justNow":"À l'instant","kanban.group":"Groupe","kanban.muted":"Muet","kanban.save":"Enregistrer","kanban.cancel":"Annuler","kanban.close":"Fermer","kanban.analyticsTitle":"Tableau de bord analytique","kanban.analyticsSubtitle":"Métriques de performance du pipeline","kanban.exportCSV":"Exporter en CSV","kanban.exportPDF":"Exporter en PDF","kanban.noAnalyticsData":"Aucune donnée analytique","kanban.from":"De:","kanban.to":"À:","kanban.totalChats":"Total des chats","kanban.pipelineValue":"Valeur du pipeline","kanban.activeStages":"Étapes actives du pipeline","kanban.stagePerformance":"Performance par étape","kanban.stage":"Étape","kanban.value":"Valeur","kanban.avgTime":"Temps moy.","kanban.conversion":"Conversion","kanban.chatDistribution":"Distribution des chats","kanban.allTime":"Tout le temps","kanban.today":"Aujourd'hui","kanban.last7Days":"7 derniers jours","kanban.last30Days":"30 derniers jours","kanban.allowPopups":"Veuillez autoriser les popups pour exporter en PDF","kanban.addSampleChat":"Ajouter un chat exemple","kanban.crmName":"Nom du CRM","kanban.stageName":"Nom de l'étape","kanban.saveChanges":"Enregistrer les modifications","kanban.createFirstCRM":"Créez votre premier CRM pour organiser vos chats WhatsApp.","kanban.noStagesFound":"Aucune étape trouvée dans ce CRM.","kanban.syncOrAddStages":"Synchronisez les données de WhatsApp ou ajoutez des étapes personnalisées.","kanban.chatDetails":"Détails du chat","kanban.notAvailable":"N/D","kanban.addNotesPlaceholder":"Ajouter des notes sur ce chat...","kanban.thisWeek":"cette semaine","kanban.avg":"Moy.","kanban.stagesLabel":"Étapes","kanban.activePipelineStages":"Étapes actives du pipeline","kanban.customRange":"Plage personnalisée","kanban.dateRange":"Plage de dates","kanban.confirmDeleteCrm":"Êtes-vous sûr de vouloir supprimer ce CRM ? Toutes les étapes et chats seront supprimés.","kanban.openInWhatsApp":"Ouvrir dans WhatsApp","kanban.removeFromStage":"Retirer de l'étape","kanban.openCRM":"Ouvrir CRM","kanban.addNote":"Ajouter une note","kanban.scheduleMessage":"Programmer un message","kanban.addIncome":"Ajouter un revenu","kanban.whatsappNotOpen":"WhatsApp Web n'est pas ouvert. Veuillez d'abord ouvrir WhatsApp Web.","kanban.failedToOpenChat":"Impossible d'ouvrir le chat dans WhatsApp","kanban.removeFromStageConfirm":"Êtes-vous sûr de vouloir retirer ce chat de l'étape actuelle ?","kanban.failedToRemove":"Impossible de retirer le chat de l'étape","kanban.failedToOpenCRM":"Impossible d'ouvrir le CRM","kanban.chatPopup":"Chat","kanban.typeMessage":"Tapez un message...","kanban.sendMessage":"Envoyer","kanban.loadingMessages":"Chargement des messages...","kanban.failedToLoadMessages":"Impossible de charger les messages","kanban.failedToSendMessage":"Impossible d'envoyer le message","kanban.yesterday":"Hier","kanban.refresh":"Actualiser","kanban.loadingMedia":"Chargement...","kanban.clickToLoad":"Cliquez pour charger","kanban.addToStage":"Ajouter à l'étape CRM","kanban.selectCrmStage":"Sélectionner CRM et Étape","kanban.retry":"Réessayer","kanban.attach":"Joindre un fichier","kanban.addCaption":"Ajouter une légende...","kanban.audioMessage":"Message audio","kanban.document":"Document","kanban.location":"Localisation","kanban.contact":"Contact","kanban.quickReply":"Réponse Rapide","kanban.fluxo":"Fluxo","kanban.more":"plus","kanban.showLess":"Afficher moins","kanban.noQuickReplies":"Aucune réponse rapide","kanban.noFluxos":"Aucun flux actif","kanban.users":"Utilisateurs","kanban.usersBreakdown":"Répartition par Utilisateur","kanban.searchUsers":"Rechercher des utilisateurs par nom ou numéro...","kanban.noUsersFound":"Aucun utilisateur trouvé","kanban.tryDifferentSearch":"Essayez un autre terme de recherche","kanban.crm":"CRM","kanban.tabs":"Onglets","kanban.labels":"Étiquettes","kanban.crmBreakdown":"Répartition par Étape CRM","kanban.tabsBreakdown":"Répartition par Onglets","kanban.labelsBreakdown":"Répartition par Étiquettes","kanban.noDataFound":"Aucune donnée trouvée","kanban.addDataToSeeAnalytics":"Ajoutez des données de revenus/dépenses aux contacts pour voir les analyses","kanban.incomeVsExpense":"Revenus vs Dépenses par","kanban.contacts":"contacts","kanban.netProfit":"BÉNÉFICE NET","kanban.crmProfit":"Profit CRM","kanban.tabsProfit":"Profit Onglets","kanban.labelsProfit":"Profit Étiquettes","kanban.profitDistribution":"Distribution des Profits","kanban.sourceComparison":"Comparaison des Sources","kanban.totalContacts":"Contacts Totaux","kanban.avgPerSource":"Moyenne par Source","kanban.loadingMore":"Chargement...","kanban.allChatsLoaded":"Tous les chats chargés","kanban.dragToReorder":"Glisser pour réorganiser","crm.categoryBreakdown":"Répartition par Catégorie","crm.incomeByCategory":"Revenus par Catégorie","crm.expenseByCategory":"Dépenses par Catégorie","crm.paymentMethodBreakdown":"Répartition par Mode de Paiement","crm.incomeByPayment":"Revenus par Mode de Paiement","crm.expenseByPayment":"Dépenses par Mode de Paiement","crm.userWiseBreakdown":"Répartition par Utilisateur","crm.net":"Net","crm.transactions":"Transactions","crm.margin":"Marge","crm.netProfit":"Bénéfice Net","chart.income":"Revenus","chart.expense":"Dépenses","chart.profit":"Profit","chart.noDataAvailable":"Aucune donnée disponible","chart.noProfitData":"Aucune donnée de profit disponible","chart.noTrendData":"Aucune donnée de tendance disponible","bulkValidator.title":"Validateur de Numéros en Masse","bulkValidator.subtitle":"Validez les numéros WhatsApp en masse avec des campagnes","bulkValidator.menu":"Menu","bulkValidator.activeCampaigns":"Campagnes Actives","bulkValidator.completed":"Terminées","bulkValidator.noActiveCampaigns":"Aucune campagne active. Lancez-en une pour valider des numéros.","bulkValidator.noCompleted":"Aucune campagne terminée pour l'instant.","bulkValidator.createHint":"Téléversez un CSV de numéros et lancez une validation.","bulkValidator.newCampaign":"Nouvelle Campagne de Validation","bulkValidator.createCampaign":"Créer une Nouvelle Campagne","bulkValidator.campaignName":"Nom de la Campagne","bulkValidator.enterCampaignName":"Entrez le nom de la campagne","bulkValidator.countryCode":"Code du Pays","bulkValidator.countryCodeHint":"Sélectionnez le code du pays pour les numéros sans préfixe","bulkValidator.uploadCSV":"Télécharger un Fichier CSV","bulkValidator.csvHint":"Fichier CSV avec des numéros de téléphone (un par ligne ou séparés par des virgules)","bulkValidator.numbersFound":"numéros trouvés","bulkValidator.enterNameAndUpload":"Veuillez entrer le nom de la campagne et télécharger les numéros","bulkValidator.createAndStart":"Créer la Campagne","bulkValidator.campaigns":"Campagnes","bulkValidator.noCampaigns":"Aucune campagne pour le moment. Créez-en une pour commencer à valider les numéros.","bulkValidator.confirmDelete":"Êtes-vous sûr de vouloir supprimer cette campagne ?","bulkValidator.valid":"Valide","bulkValidator.invalid":"Invalide","bulkValidator.pending":"En Attente","bulkValidator.start":"Démarrer","bulkValidator.pause":"Pause","bulkValidator.downloadValid":"Télécharger les Numéros Valides","bulkValidator.downloadInvalid":"Télécharger les Numéros Invalides","bulkValidator.downloadAll":"Télécharger Tout","bulkValidator.all":"Tout","tools.allTools":"Tous les outils","tools.subtitle":"Cliquez pour ouvrir • Glissez vers l'en-tête pour épingler","tools.featureSettings":"Paramètres des fonctionnalités","tools.pinnedTooltip":"Épinglé dans l'en-tête (glissez vers Outils pour désépingler)","tools.itemTooltip":"{name} — cliquez pour ouvrir ou glissez vers l'en-tête pour épingler","tools.category.communication":"Communication","tools.category.management":"Gestion","tools.category.automation":"Automatisation","tools.category.validation":"Validation","webhook.title":"Webhooks","webhook.subtitle":"Envoyer les données de contact vers une autre application après l'exécution des événements enregistrés","webhook.events":"événements","webhook.quickResponses":"Réponses Rapides","webhook.appointment":"Rendez-vous","webhook.reminder":"Rappel","webhook.contactProfile":"Profil de Contact","webhook.notes":"Notes","webhook.income":"Revenu","webhook.expense":"Dépense","webhook.kanban":"Kanban","webhook.labels":"Étiquettes","webhook.customTabs":"Onglets Personnalisés","webhook.messages":"Messages","webhook.todos":"Liste de Tâches","webhook.webhookData":"Données WebHook","webhook.webhookUrl":"URL WebHook","webhook.enterUrl":"Entrez l'URL de destination ici","webhook.active":"Actif","webhook.dataToSend":"Données à envoyer","webhook.lastUploads":"Derniers envois (maximum 30 vues)","webhook.noUploads":"Aucun envoi pour le moment","webhook.close":"Fermer","webhook.save":"Enregistrer","webhook.saving":"Enregistrement...","webhook.field.eventDetails":"Détails de l'événement","webhook.field.number":"Numéro","webhook.field.name":"Nom","webhook.field.picture":"Photo","webhook.field.labels":"Étiquettes","webhook.field.contactProfile":"Profil de Contact","webhook.field.appointmentTime":"Heure du Rendez-vous","webhook.field.meetingLink":"Lien de Réunion","webhook.field.reminderTopic":"Sujet du Rappel","webhook.field.reminderTime":"Heure du Rappel","webhook.field.reminderDetails":"Détails du Rappel","webhook.field.email":"E-mail","webhook.field.gender":"Genre","webhook.field.dateOfBirth":"Date de Naissance","webhook.field.address":"Adresse","webhook.field.details":"Détails","webhook.field.customFields":"Champs Personnalisés","webhook.field.noteTopic":"Sujet de la Note","webhook.field.noteContent":"Contenu de la Note","webhook.field.noteTimestamp":"Horodatage de la Note","webhook.field.amount":"Montant","webhook.field.category":"Catégorie","webhook.field.paymentMethod":"Méthode de Paiement","webhook.field.description":"Description","webhook.field.reference":"Référence/Facture","webhook.field.referenceBill":"Référence/Note","webhook.field.transactionDate":"Date de Transaction","webhook.field.status":"Statut","webhook.field.cardTitle":"Titre de la Carte","webhook.field.columnName":"Colonne/Étape","webhook.field.cardDescription":"Description de la Carte","webhook.field.labelId":"ID d'Étiquette","webhook.field.labelName":"Nom d'Étiquette","webhook.field.labelColor":"Couleur d'Étiquette","webhook.field.allLabels":"Toutes les Étiquettes du Contact","webhook.field.tabId":"ID d'Onglet","webhook.field.tabName":"Nom d'Onglet","webhook.field.tabColor":"Couleur d'Onglet","webhook.field.allTabs":"Tous les Onglets du Contact","webhook.field.direction":"Direction (entrant/sortant)","webhook.field.messageContent":"Contenu du Message","webhook.field.messageType":"Type de Message","webhook.field.messageId":"ID du Message","webhook.field.mediaUrl":"URL du Média","webhook.field.quotedMessage":"Message Cité","webhook.field.timestamp":"Horodatage","webhook.field.ctwaData":"Données Meta Ads (CTWA)","webhook.field.todoTitle":"Titre de la Tâche","webhook.field.todoDescription":"Description de la Tâche","webhook.field.todoDueDate":"Date d'Échéance","webhook.field.todoPriority":"Priorité","webhook.field.todoCategory":"Catégorie","webhook.field.todoStatus":"Statut","webhook.field.todoSubtasks":"Sous-tâches","api.configureAPI":"Configurer l'API","api.manageToken":"Gérez votre jeton API et vos paramètres","api.apiToken":"Jeton API","api.generateToken":"Générer le jeton","api.regenerate":"Régénérer","api.generating":"Génération...","api.copyToken":"Copier le jeton","api.tokenWarning":"Gardez ce jeton secret. Toute personne y ayant accès peut envoyer des messages en votre nom.","api.enableAPI":"Activer l'API","api.apiIsEnabled":"L'API est actuellement activée","api.apiIsDisabled":"L'API est actuellement désactivée","api.openDocumentation":"Ouvrir la documentation","api.queuePolling":"Sondage de File d'Attente","api.pollingActive":"Vérification des messages en file d'attente toutes les 5 minutes","api.pollingInactive":"Activer pour traiter les messages API entrants","audioTranscribe.title":"Transcription","audioTranscribe.transcribeAudio":"Transcrire l'audio","audioTranscribe.copy":"Copier","audioTranscribe.copied":"Copié !","audioTranscribe.translate":"Traduire","audioTranscribe.translating":"Traduction...","audioTranscribe.translated":"Traduit !","audioTranscribe.original":"Original :","audioTranscribe.translatedLabel":"Traduit","audioTranscribe.close":"Fermer","audioTranscribe.requiresChatGPT":"La transcription audio nécessite une clé API ChatGPT. Veuillez configurer ChatGPT comme fournisseur IA dans les paramètres.","audioTranscribe.audioNotFound":"URL audio introuvable. L'audio peut ne pas être disponible.","audioTranscribe.transcriptionFailed":"Échec de la transcription","audioTranscribe.configureAI":"Veuillez d'abord configurer les paramètres IA pour utiliser la traduction.","audioTranscribe.translationFailed":"Échec de la traduction","audioTranscribe.translationTimeout":"Délai de traduction dépassé. Veuillez réessayer.","aiBot.title":"Bot IA","aiBot.tab.testChat":"Chat de test","aiBot.tab.qaPairs":"Paires Q&R","aiBot.tab.aiBehavior":"Comportement IA","aiBot.tab.trainingData":"Données d'entraînement","aiBot.tab.escalation":"Escalade","aiBot.tab.dataPreview":"Aperçu des données","aiBot.tab.actionPrompts":"Invites d'action","aiBot.tab.scheduleTiming":"Horaire et délais","aiBot.tab.trainingDataComingSoon":"Le téléversement de documents, le scraping d'URL et les sources de texte brut arriveront dans la prochaine mise à jour.","aiBot.tab.escalationComingSoon":"Le transfert automatique à un humain après un nombre configurable de messages sans réponse arrivera dans la prochaine mise à jour.","aiBot.tab.dataPreviewComingSoon":"Un aperçu en lecture seule de chaque paire Q&R, source et fragment auquel l'IA a accès.","aiBot.comingSoon":"Bientôt disponible","aiBot.qa.addPair":"Ajouter une paire","aiBot.qa.editPair":"Modifier la paire","aiBot.qa.questionLabel":"Question","aiBot.qa.questionPlaceholder":"Ce que les clients pourraient demander…","aiBot.qa.answerLabel":"Réponse","aiBot.qa.answerPlaceholder":"Comment l'IA doit répondre…","aiBot.qa.categoryLabel":"Catégorie (facultatif)","aiBot.qa.categoryPlaceholder":"ex. Tarifs, Support, Intégration","aiBot.qa.existingPairs":"Paires existantes","aiBot.qa.empty":"Aucune paire pour le moment. Ajoutez la première ci-dessus.","aiBot.qa.cancel":"Annuler","aiBot.qa.update":"Mettre à jour","aiBot.qa.delete":"Supprimer","aiBot.qa.edit":"Modifier","aiBot.qa.enabled":"Activé","aiBot.qa.disabled":"Désactivé","aiBot.qa.on":"Actif","aiBot.qa.off":"Inactif","aiBot.qa.deleteConfirm":"Supprimer cette paire Q&R ?","aiBot.qa.itemSingular":"paire","aiBot.qa.itemPlural":"paires","aiBot.behavior.providerConfig":"Fournisseur IA","aiBot.behavior.provider":"Fournisseur","aiBot.behavior.model":"Modèle","aiBot.behavior.apiActive":"API active","aiBot.behavior.noApiKey":"Pas de clé API","aiBot.behavior.apiKeyHint":"Ajoutez votre clé API dans les paramètres des outils IA pour activer le bot.","aiBot.behavior.triggerWords":"Mots déclencheurs","aiBot.behavior.triggerWordsPlaceholder":"support, aide, démo (séparés par des virgules)","aiBot.behavior.triggerWordsHelp":"Lorsqu'ils sont définis, le bot ne répond qu'aux messages contenant au moins un de ces mots. Laissez vide pour répondre à tout.","aiBot.behavior.responseSettings":"Paramètres de réponse","aiBot.behavior.responseTone":"Ton de la réponse","aiBot.behavior.maxResponseLength":"Longueur max. de réponse","aiBot.behavior.temperature":"Température","aiBot.behavior.temperatureHelp":"Plus bas = plus ciblé. Plus haut = plus créatif.","aiBot.behavior.maxTokens":"Tokens max.","aiBot.behavior.maxTokensHelp":"Limite la taille de la réponse de l'IA.","aiBot.behavior.systemPrompt":"Contexte commercial / Invite système","aiBot.behavior.systemPromptPlaceholder":"Parlez à l'IA de votre entreprise, de vos produits et de la façon dont elle doit vous représenter…","aiBot.behavior.systemPromptHelp":"Utilisé comme instruction de base pour chaque réponse de l'IA.","aiBot.behavior.fallbackMessage":"Message de repli","aiBot.behavior.fallbackMessageHelp":"Envoyé lorsque l'IA n'a pas de paire Q&R, de source ou de connaissance générale pertinente pour répondre.","aiBot.behavior.saved":"✓ Enregistré","aiBot.behavior.saveBehavior":"Enregistrer le comportement","aiBot.behavior.tone_friendly":"Amical","aiBot.behavior.tone_professional":"Professionnel","aiBot.behavior.tone_casual":"Décontracté","aiBot.behavior.tone_formal":"Formel","aiBot.behavior.tone_empathetic":"Empathique","aiBot.behavior.length_short":"Court (~50 mots)","aiBot.behavior.length_medium":"Moyen (~200 mots)","aiBot.behavior.length_long":"Long (~400 mots)","aiBot.kb.urlTitle":"Ajouter une URL de site web","aiBot.kb.urlPlaceholder":"https://exemple.com/a-propos","aiBot.kb.addUrl":"Ajouter URL","aiBot.kb.scraping":"Récupération…","aiBot.kb.urlHelp":"Nous récupérons la page et extrayons son texte visible. Une seule page — les SPA rendues en JS peuvent retourner peu de contenu.","aiBot.kb.errorEmpty":"Aucun texte lisible trouvé à cette URL.","aiBot.kb.errorBlocked":'Impossible d\'accéder à cette URL. Le site peut bloquer les requêtes automatisées, exiger une connexion ou être rendu en JS. Essayez de copier le texte dans "Coller du texte brut" ci-dessous.',"aiBot.kb.blockedChromeStore":'Le Chrome Web Store bloque les requêtes automatisées. Ouvrez la fiche dans votre navigateur, copiez la description et collez-la dans "Coller du texte brut" ci-dessous.',"aiBot.kb.blockedGoogle":"Les pages Google Docs / Drive / Sheets nécessitent une connexion et ne peuvent pas être extraites. Exportez en PDF/DOCX/TXT et téléversez-le.","aiBot.kb.blockedSocial":'Les réseaux sociaux bloquent les requêtes automatisées. Copiez le texte pertinent et collez-le dans "Coller du texte brut" ci-dessous.',"aiBot.kb.blockedNotion":"Les pages Notion sont rendues en JS et retournent peu de texte. Exportez la page en Markdown/PDF et téléversez-la.","aiBot.kb.plainTextTitle":"Coller du texte brut","aiBot.kb.textTitlePlaceholder":'Titre (facultatif, ex. "Politique de remboursement")',"aiBot.kb.textBodyPlaceholder":"Collez tout texte que l'IA devrait connaître — tarifs, FAQ, politiques, instructions…","aiBot.kb.charsLabel":"caractères","aiBot.kb.saveText":"Enregistrer le texte","aiBot.kb.saving":"Enregistrement…","aiBot.kb.trainingSources":"Sources d'entraînement","aiBot.kb.sourceSingular":"source","aiBot.kb.sourcePlural":"sources","aiBot.kb.chunkSingular":"fragment","aiBot.kb.chunkPlural":"fragments","aiBot.kb.empty":"Aucune source d'entraînement. Ajoutez une URL ou collez du texte brut ci-dessus.","aiBot.kb.deleteConfirm":"Supprimer cette source ?","aiBot.kb.uploadTitle":"Téléverser des documents","aiBot.kb.uploadPrompt":"Cliquez pour choisir un fichier, ou glissez-déposez ici","aiBot.kb.uploadFormats":"PDF, DOCX, TXT, CSV, MD","aiBot.kb.uploadMaxSize":"Max. 10 Mo par fichier","aiBot.kb.parsing":"Analyse en cours…","aiBot.kb.parsingFile":"Analyse","aiBot.esc.enableAuto":"Activer l'escalade automatique","aiBot.esc.enableAutoDesc":"Transférer automatiquement à un humain lorsque l'IA ne peut pas aider ou que le client le demande.","aiBot.esc.maxAttempts":"Tentatives échouées max.","aiBot.esc.maxAttemptsHelp":"Transfert après ce nombre de réponses de repli consécutives (fenêtre de 24h).","aiBot.esc.triggerPhrases":"Phrases déclencheuses (une par ligne)","aiBot.esc.triggerPhrasesHelp":"Lorsqu'une de ces phrases apparaît dans un message entrant, le bot escalade immédiatement. Correspondance de sous-chaîne insensible à la casse.","aiBot.esc.message":"Message d'escalade","aiBot.esc.messageHelp":"Envoyé au client juste avant que le bot cesse de répondre afin qu'un humain puisse prendre le relais.","aiBot.esc.saveRules":"Enregistrer les règles d'escalade","aiBot.esc.statusOn":"Activé","aiBot.esc.statusOff":"Désactivé","aiBot.preview.qaPairsLabel":"Paires Q&R","aiBot.preview.sourcesLabel":"Sources","aiBot.preview.chunksLabel":"Fragments","aiBot.preview.helpText":"C'est exactement ce à quoi l'IA a accès en ce moment. Les éléments désactivés ne sont pas utilisés.","aiBot.preview.escalationSummary":"Escalade","aiBot.preview.escStatus":"Statut","aiBot.preview.escThreshold":"Après","aiBot.preview.escFailed":"réponses de repli consécutives","aiBot.preview.escPhrases":"Phrases déclencheuses","aiBot.preview.escNoPhrases":"aucune","aiBot.preview.qaPairsTitle":"Paires Q&R","aiBot.preview.sourcesTitle":"Sources d'entraînement","aiBot.preview.noQa":"Aucune paire Q&R activée.","aiBot.preview.noSources":"Aucune source activée.","aiBot.fallbackMoved":"La réponse de repli a été déplacée vers l'onglet Comportement IA. Votre message existant est conservé automatiquement.","aiBot.businessPromptMoved":"L'invite commerciale a été déplacée vers l'onglet Comportement IA. Modifiez-la là-bas — votre invite existante est conservée.","aiBot.generalKnowledgeMoved":"L'interrupteur \"Autoriser l'IA à utiliser les connaissances générales\" a été déplacé vers l'onglet Comportement IA.","aiBot.stopKeywordsRecommend":"Pour les nouvelles configurations, nous recommandons l'onglet Escalade — il ajoute un compteur de tentatives et des phrases déclencheuses en plus des arrêts par mot-clé. Cette section fonctionne toujours pour les arrêts par mot-clé uniquement.","aiBot.subtitle":"Configurer les réponses IA automatiques","aiBot.menu":"Menu","aiBot.enableBot":"Activer le Bot IA","aiBot.enableBotDesc":"Répondre automatiquement aux messages entrants","aiBot.replyInGroups":"Répondre dans les groupes","aiBot.replyInGroupsDesc":"Autoriser le Bot IA à répondre dans les discussions de groupe (désactivé par défaut)","aiBot.allowGeneralKnowledge":"Autoriser l'IA à utiliser ses connaissances générales","aiBot.allowGeneralKnowledgeDesc":"Si DÉSACTIVÉ, l'IA répond uniquement selon votre prompt métier. Si ACTIVÉ, l'IA peut aussi utiliser ses connaissances générales.","aiBot.fallbackReply":"Réponse de secours","aiBot.fallbackReplyDesc":"Quand l'IA n'a pas d'information dans votre prompt métier, elle enverra cette réponse au lieu d'inventer des réponses.","aiBot.fallbackReplyPlaceholder":"Exemple : Merci pour votre question ! Je n'ai pas d'information spécifique à ce sujet pour le moment. Notre équipe vous contactera bientôt.","aiBot.smartDetection":"Détection Intelligente","aiBot.smartDetectionDesc":"L'IA détecte automatiquement la frustration ou les demandes d'assistance humaine","aiBot.monday":"Lundi","aiBot.tuesday":"Mardi","aiBot.wednesday":"Mercredi","aiBot.thursday":"Jeudi","aiBot.friday":"Vendredi","aiBot.saturday":"Samedi","aiBot.sunday":"Dimanche","aiBot.enableWeekdays":"Activer jours ouvrables","aiBot.disableWeekdays":"Désactiver jours ouvrables","aiBot.enableWeekends":"Activer week-ends","aiBot.disableWeekends":"Désactiver week-ends","aiBot.applyToAll":"Appliquer à tous:","aiBot.apply":"Appliquer","aiBot.day":"Jour","aiBot.active":"Actif","aiBot.currentStatus":"État actuel:","aiBot.botOffToday":"Bot est ÉTEINT aujourd'hui","aiBot.businessPrompt":"Prompt d'entreprise","aiBot.businessPromptDesc":"Personnalisez la façon dont l'IA répond. Décrivez votre entreprise, ton et directives.","aiBot.businessPromptPlaceholder":"Exemple : Vous êtes un représentant du service client pour [Nom de l'entreprise]. Nous vendons [produit/service]. Soyez amical et professionnel.","aiBot.schedule":"Heures du Bot","aiBot.scheduleEnabled":"Activer le planning","aiBot.scheduleEnabledDesc":"Le bot répond uniquement pendant les jours et heures définis","aiBot.startTime":"Heure de début","aiBot.endTime":"Heure de fin","aiBot.to":"à","aiBot.timezone":"Fuseau horaire","aiBot.replyTiming":"Timing de réponse","aiBot.replyTimingDesc":"Délai aléatoire avant la réponse IA","aiBot.minDelay":"Délai min (sec.)","aiBot.maxDelay":"Délai max (sec.)","aiBot.enabledActions":"Actions activées","aiBot.enabledActionsDesc":"Choisissez les actions que l'IA peut effectuer","aiBot.actionNormalReply":"Envoyer une réponse","aiBot.actionNormalReplyDesc":"L'IA envoie des messages texte","aiBot.actionKanban":"Mettre à jour Kanban","aiBot.actionKanbanDesc":"Déplacer les contacts entre les étapes Kanban","aiBot.actionLabels":"Mettre à jour les étiquettes","aiBot.actionLabelsDesc":"Ajouter/supprimer des étiquettes WhatsApp","aiBot.actionTabs":"Mettre à jour les onglets","aiBot.actionTabsDesc":"Ajouter/supprimer des onglets personnalisés","aiBot.actionAppointment":"Créer un rendez-vous","aiBot.actionAppointmentDesc":"Planifier des rendez-vous à partir de conversations","aiBot.tabsPromptLabel":"Instructions personnalisées pour la gestion des onglets :","aiBot.tabsPromptPlaceholder":"Ex: Si l'utilisateur demande des services SEO, ajouter à l'onglet \"Prospects SEO\"...","aiBot.meetingLinkLabel":"Lien Google Meet :","aiBot.meetingLinkPlaceholder":"https://meet.google.com/xxx-xxxx-xxx","aiBot.meetingLinkDesc":"Ce lien sera utilisé pour tous les RDV créés par l'IA","aiBot.messageTemplateLabel":"Modèle de message :","aiBot.messageTemplateDesc":"Ce message sera envoyé comme rappel de RDV","aiBot.varName":"Nom","aiBot.varDate":"Date","aiBot.varTime":"Heure","aiBot.varLink":"Lien","aiBot.messageTemplatePlaceholder":"Bonjour {name}, votre RDV est prévu le {date} à {time}. Rejoindre ici : {link}","aiBot.officeHoursLabel":"Heures de bureau (Horaires RDV) :","aiBot.officeHoursDesc":"L'IA ne planifiera des RDV que pendant ces heures","aiBot.sendMessageNow":"Envoyer le message immédiatement","aiBot.sendMessageNowDesc":"Envoyer le message de RDV juste après la création","aiBot.appointmentPromptLabel":"Instructions IA personnalisées :","aiBot.appointmentPromptPlaceholder":"Ex: Lors de la prise de RDV, toujours proposer des créneaux entre 10h et 18h...","aiBot.actionProfile":"Mettre à jour le profil","aiBot.actionProfileDesc":"Extraire et sauvegarder les infos de contact","aiBot.contextMessages":"Messages de contexte","aiBot.contextMessagesDesc":"Nombre de messages passés pour le contexte IA","aiBot.settingsTab":"Paramètres","aiBot.promptSettings":"Config. des Prompts","aiBot.actionPrompts":"Prompts d'Actions","aiBot.actionPromptsDesc":"Configurer des prompts personnalisés pour différentes actions IA","aiBot.talkToAI":"Parler à l'IA","aiBot.testYourBot":"Testez votre Bot IA","aiBot.testDescription":"Les messages utilisent les paramètres actuels (y compris les modifications non enregistrées)","aiBot.clearChat":"Effacer le chat","aiBot.typeTestMessage":"Tapez un message de test...","aiBot.aiTyping":"L'IA écrit...","aiBot.noMessages":"Tapez un message pour tester la réponse de votre Bot IA","aiBot.send":"Envoyer","aiBot.copy":"Copier","aiBot.copied":"Copié !","aiBot.select":"Sélectionner","aiBot.aiNotConfigured":"IA non configurée. Veuillez d'abord configurer la clé API IA.","aiBot.noResponse":"Aucune réponse de l'IA","aiBot.stopKeywords":"Mots-clés d'arrêt","aiBot.stopKeywordsInfo":"Lorsque le client envoie l'un de ces mots-clés, le Bot IA cessera de répondre et le mettra sur liste noire.","aiBot.enableStopKeywords":"Activer les mots-clés d'arrêt","aiBot.enableStopKeywordsDesc":"Arrêter automatiquement le Bot IA lorsque le client demande une assistance humaine","aiBot.keywords":"Mots-clés","aiBot.noKeywords":"Aucun mot-clé ajouté","aiBot.enterKeyword":"Entrez un mot-clé...","aiBot.add":"+ Ajouter","aiBot.stopMessage":"Message d'arrêt","aiBot.stopMessagePlaceholder":"Message envoyé lorsqu'un mot-clé d'arrêt est détecté...","aiBot.stopMessageHint":"Ce message sera envoyé au client lorsqu'un mot-clé d'arrêt est détecté.","aiBot.responseMode":"Mode de réponse :","aiBot.aiBotPrompt":"Prompt du Bot IA","aiBot.globalChatGPT":"ChatGPT Global","aiBot.newChat":"Nouvelle conversation","aiBot.clearAll":"Tout effacer","aiBot.searchChats":"Rechercher des conversations...","aiBot.noSearchResults":"Aucune conversation trouvée","aiBot.noChatsYet":"Pas encore d'historique","aiBot.deleteChat":"Supprimer la conversation","aiBot.chatsStored":"conversations enregistrées","aiBot.clearAllTitle":"Effacer toutes les conversations ?","aiBot.clearAllDesc":"Cela supprimera définitivement tout votre historique de conversation. Cette action est irréversible.","aiBot.messages":"messages","aiBot.today":"Aujourd'hui","aiBot.yesterday":"Hier","crm.aiBotBlacklist":"Bot IA","crm.aiBotEnabled":"Activé pour ce contact","crm.aiBotDisabled":"Désactivé pour ce contact","common.saved":"Enregistré","crm.chatbotFlow":"Flux Chatbot","crm.chatbotFlowDesc":"Créez des bots de réponse automatique par mots-clés","crm.createNewFlow":"Créer un nouveau flux","crm.noFlowsYet":"Aucun flux pour le moment","crm.createFirstFlow":"Créez votre premier flux chatbot","crm.active":"Actif","crm.inactive":"Inactif","crm.flowName":"Nom du flux","crm.untitledFlow":"Flux sans titre","crm.duplicate":"Dupliquer","crm.triggers":"Déclencheurs","crm.actions":"Actions","crm.rules":"Règles","crm.chatbotFlows":"Flux de chatbot","crm.exportFlows":"Exporter","crm.importFlows":"Importer","crm.exportAll":"Tout exporter","crm.exportSelected":"Exporter la sélection","crm.selectFlowsToExport":"Sélectionner les flux à exporter","crm.importSuccess":"Flux importés avec succès !","crm.importError":"Erreur lors de l'importation des flux","crm.invalidFlowFile":"Format de fichier de flux invalide","crm.duplicateFlowFound":"Flux en double trouvé","crm.flowAlreadyExists":"'{name}' existe déjà. Que souhaitez-vous faire ?","crm.replaceFlow":"Remplacer","crm.skipFlow":"Ignorer","crm.renameAndAdd":"Renommer et ajouter","crm.noFlowsSelected":"Veuillez sélectionner au moins un flux","crm.noFlowsToExport":"Aucun flux à exporter","crm.flowsExported":"{count} flux exporté(s)","crm.flowsImported":"{count} flux importé(s)","crm.selected":"sélectionné(s)","crm.enabled":"Activé","crm.allFlows":"Tous","crm.byCategory":"Catégories","crm.viewAllFlows":"Voir tous les flux","crm.viewByCategory":"Voir par catégorie","crm.addFluxoCategory":"Ajouter une catégorie","crm.manageCategories":"Gérer les catégories","crm.editCategory":"Modifier la catégorie","crm.createCategory":"Créer une catégorie","crm.createCategoryBtn":"Créer une catégorie","crm.fluxoCategoryName":"Nom","crm.categoryIcon":"Icône","crm.categoryColor":"Couleur","crm.preview":"Aperçu","crm.custom":"Personnalisé","crm.enterFluxoCategoryName":"Entrez le nom de la catégorie","crm.fluxoCategoryNameRequired":"Le nom de la catégorie est requis","crm.fluxoCategoryNameExists":"Une catégorie avec ce nom existe déjà","crm.confirmDeleteCategory":"Supprimer cette catégorie? Les flux seront déplacés vers Non classé.","crm.uncategorized":"Non classé","crm.noFlowsInCategory":"Aucun flux dans cette catégorie","crm.dragFlowsHere":"Glissez les flux ici pour organiser","crm.dropHere":"Déposer ici","crm.dragToMove":"Glisser pour déplacer","crm.noCategoriesYet":"Pas encore de catégories","crm.createCategoryHint":"Créez une catégorie pour organiser vos flux","crm.createFirstCategory":"Créer la première catégorie","crm.tourViewToggleTitle":"Changer de vue","crm.tourViewToggleContent":"Basculez entre la vue Tous les flux et la vue par Catégorie pour organiser vos chatbots.","crm.tourCategoryViewTitle":"Vue par catégorie","crm.tourCategoryViewContent":"Cliquez ici pour voir vos flux organisés par catégories.","crm.tourAddCategoryTitle":"Créer des catégories","crm.tourAddCategoryContent":"Cliquez ici pour créer une nouvelle catégorie avec un nom, icône et couleur personnalisés.","crm.tourDragDropTitle":"Glisser-déposer","crm.tourDragDropContent":"Faites glisser n'importe quelle carte de flux et déposez-la dans une catégorie pour organiser vos flux.","crm.tourCategorySectionTitle":"Sections de catégorie","crm.tourCategorySectionContent":"Cliquez pour développer ou réduire les catégories. Modifiez ou supprimez les catégories à l'aide des boutons.","crm.skipTour":"Ignorer","crm.finishTour":"Compris!","crm.next":"Suivant","crm.previous":"Précédent","crm.simulateFlow":"Simuler le flux","crm.start":"Démarrer","crm.actionBlocks":"Blocs d'action","crm.anyMessage":"Tout message","crm.keywords":"Mots-clés","crm.addKeyword":"Ajouter un mot-clé","crm.firstMessageOfDay":"Premier message du jour","crm.firstMessageEver":"Tout premier message","crm.sendText":"Envoyer Texte","crm.sendTextDesc":"Envoyer un message texte.","crm.sendImage":"Envoyer Image","crm.sendImageDesc":"Envoyer une image avec légende.","crm.sendVideo":"Envoyer Vidéo","crm.sendVideoDesc":"Envoyer une vidéo avec légende.","crm.sendAudio":"Envoyer Audio","crm.sendAudioDesc":"Envoyer un fichier audio.","crm.sendDocument":"Envoyer Document","crm.sendDocumentDesc":"Envoyer un fichier document.","crm.responses":"Réponses","crm.responsesDesc":"Attendre la réponse de l'utilisateur et créer des branches.","crm.sendList":"Envoyer Liste","crm.sendListDesc":"Envoyer un message de liste interactive.","fluxo.waitInput":"Attendre une Entrée","fluxo.waitInputDesc":"Attendre une réponse utilisateur validée","fluxo.promptMessage":"Message d'Invite","fluxo.enterPromptMessage":"Entrez l'invite pour demander une entrée utilisateur...","fluxo.inputType":"Type d'Entrée (Validation)","fluxo.inputTypeString":"Texte (Tout)","fluxo.inputTypePhone":"Numéro de Téléphone","fluxo.inputTypeNumber":"Nombre","fluxo.inputTypeEmail":"E-mail","fluxo.inputTypeUrl":"URL","fluxo.inputTypeDatetime":"Date/Heure","fluxo.phoneHint":"Format : +33612345678 (avec indicatif pays)","fluxo.emailHint":"Format : user@example.com","fluxo.numberHint":"Accepte les entiers et décimaux","fluxo.urlHint":"Format : https://example.com","fluxo.datetimeHint":"Format : AAAA-MM-JJ ou AAAA-MM-JJTHH:MM","fluxo.stringHint":"Accepte toute entrée texte","fluxo.saveResponseAs":"Enregistrer la Réponse comme Variable","fluxo.variableName":"userInput","fluxo.useVariableHint":"Utilisez {variableName} dans les messages suivants","fluxo.errorMessage":"Message d'Erreur (en cas d'entrée invalide)","fluxo.invalidInputDefault":"Entrée invalide. Veuillez réessayer.","fluxo.timeout":"Délai d'Attente","fluxo.seconds":"Secondes","fluxo.minutes":"Minutes","fluxo.hours":"Heures","fluxo.timeoutHint":"Si aucune réponse valide dans ce délai, la branche timeout s'exécutera.","fluxo.customRegex":"Regex Personnalisée (Optionnel)","fluxo.regexPlaceholder":"^[A-Z]{2}[0-9]{4}$","fluxo.customRegexHint":"Remplace la validation du type d'entrée par un motif personnalisé","fluxo.outputConnections":"Connexions de Sortie","fluxo.response":"réponse","fluxo.validInputReceived":"Quand une entrée valide est reçue","fluxo.noResponseTimeout":"Quand le délai expire sans réponse valide","fluxo.validResponse":"Réponse Valide","fluxo.onInvalidInput":"Si invalide :","fluxo.promptMessageInfo":"Le message envoyé à l'utilisateur demandant sa saisie. Il sera affiché avant d'attendre sa réponse.","fluxo.inputTypeInfo":"Sélectionnez le type de saisie attendu. Le système validera la réponse de l'utilisateur selon ce format.","fluxo.saveResponseAsInfo":"Le nom de variable pour stocker la réponse valide de l'utilisateur. Utilisez {nomVariable} dans les messages suivants pour afficher cette valeur.","fluxo.errorMessageInfo":"Message envoyé à l'utilisateur lorsque sa saisie ne correspond pas au format attendu. Il lui sera demandé de réessayer.","fluxo.timeoutInfo":"Temps maximum d'attente pour une réponse valide. En cas de dépassement, la branche timeout s'exécute au lieu de la branche réponse.","fluxo.customRegexInfo":"Avancé : Fournissez un motif regex personnalisé pour valider la saisie. Cela remplace la validation du type de saisie sélectionné.","fluxo.delayInfo":"Temps d'attente en secondes avant d'envoyer le message d'invite. Utile pour un flux de conversation naturel.","crm.groupAction":"Action de Groupe","crm.tabAction":"Action d'Onglet","crm.labelAction":"Action de Label","crm.crmAction":"Action CRM","crm.smartWait":"Attente Intelligente","crm.smartWaitDesc":"Attendre un temps aléatoire entre les messages","crm.typingIndicator":"Indicateur de Saisie","crm.typingIndicatorDesc":"Afficher la bulle de saisie avant l'envoi","crm.waitDuration":"Durée d'attente :","crm.typingDuration":"Durée de saisie :","crm.randomDelay":"Délai aléatoire :","crm.randomDelayBetween":"Délai aléatoire entre","crm.randomBetween":"Délai aléatoire entre","crm.showsTypingFor":"Affiche l'indicateur de saisie pendant","crm.showsTyping":"Affiche la saisie pendant","crm.typingPreview":"Voici comment l'indicateur de saisie apparaît au contact","crm.addFluxo":"Ajouter Fluxo","crm.addFluxoDesc":"Exécuter un autre flux","crm.selectFlowToCall":"Sélectionner le flux à exécuter :","crm.noFlowSelected":"Aucun flux sélectionné","crm.passVariables":"Passer les variables au flux appelé","crm.passVariablesHint":"Les variables du flux actuel seront disponibles dans le flux appelé","crm.passVariablesUseCase":'💡 Exemple : Flux principal a {name}="Jean" → Message du sous-flux "Bonjour {name}!" → Affiche "Bonjour Jean!". Désactiver pour démarrer le sous-flux sans variables.',"crm.passVariablesShort":"Passer vars","crm.continueAfterFlow":"Continuer après la fin du flux appelé","crm.continueAfterFlowHint":"Décocher pour terminer la conversation lorsque le flux appelé est terminé","crm.continueAfterFlowUseCase":"💡 Exemple : ON = Sous-flux de bienvenue terminé → retourne au flux principal. OFF = Sous-flux terminé = conversation terminée (comme flux Commande Complète).","crm.continueAfterShort":"Continuer après","crm.circularWarning":"Attention : Référence circulaire détectée !","crm.circularWarningHint":"Le flux sélectionné contient un nœud 'Ajouter Fluxo' pointant vers ce flux. Cela peut provoquer des boucles infinies.","crm.selectFlowPlaceholder":"Sélectionner un flux...","crm.noOtherFlows":"Aucun autre flux disponible. Créez d'abord un autre flux.","crm.delayBeforeCalling":"Délai avant appel (secondes) :","crm.executionSummary":"Résumé d'exécution :","crm.variablesWillBe":"Les variables seront","crm.passed":"passées","crm.notPassed":"non passées","crm.executeFlow":"Exécuter","crm.continueToNext":"Continuer au nœud suivant","crm.endConversation":"Terminer la conversation","crm.selectedFlow":"Flux sélectionné :","crm.addToGroups":"Ajouter aux Groupes","crm.removeFromGroups":"Retirer des Groupes","crm.addToTabs":"Ajouter aux Onglets","crm.removeFromTabs":"Retirer des Onglets","crm.addLabels":"Ajouter des Labels","crm.removeLabels":"Retirer des Labels","crm.addToCrmStage":"Ajouter à l'étape CRM","crm.removeFromCrm":"Retirer du CRM","crm.actionType":"Type d'action :","crm.selectGroups":"Sélectionner des groupes :","crm.loadGroups":"Charger les groupes","crm.loadGroupsFromWhatsApp":"Charger les groupes depuis WhatsApp Web","crm.selectTabs":"Sélectionner des onglets :","crm.selectLabels":"Sélectionner des labels :","crm.syncLabels":"Synchroniser les labels","crm.searchLabels":"Rechercher des labels...","crm.searchTabs":"Rechercher des onglets...","crm.searchGroups":"Rechercher des groupes...","crm.selectCrm":"Sélectionner CRM :","crm.selectStage":"Sélectionner l'étape :","crm.selectCrmPlaceholder":"Sélectionner un CRM...","crm.selectStagePlaceholder":"Sélectionner une étape...","crm.noGroupsSelected":"Aucun groupe sélectionné","crm.noTabsSelected":"Aucun onglet sélectionné","crm.noLabelsSelected":"Aucun label sélectionné","crm.noCrmSelected":"Aucun CRM/étape sélectionné","crm.noGroupsAvailable":"Aucun groupe disponible.","crm.noTabsAvailable":"Aucun onglet personnalisé disponible.","crm.noCrmsAvailable":"Aucun CRM disponible.","crm.noStagesAvailable":"Aucune étape dans ce CRM.","crm.delay":"Délai (secondes) :","crm.selectedGroups":"Groupes :","crm.selectedTabs":"Onglets :","crm.selectedLabels":"Labels :","crm.targetCrmStage":"CRM cible → Étape :","crm.targetCrm":"CRM cible :","crm.schedule":"Planification","crm.enableSchedule":"Activer la planification","crm.startTime":"Heure de début","crm.endTime":"Heure de fin","crm.crmRules":"Règles CRM","crm.whenAnyMessage":"Lorsqu'un message est reçu.","crm.whenKeywordMatch":"Lorsque le message contient des mots-clés.","crm.byKeywordInMessage":"Par mot-clé dans le message","crm.firstMessageDay":"Premier message du client de la journée.","crm.reactivationInterval":"Intervalle de réactivation :","crm.generalRules":"Règles générales :","crm.allowGroups":"Autoriser les réponses aux groupes","crm.scheduleEnabled":"Autoriser les réponses uniquement à certains jours et heures","crm.dontRespondIfOpen":"Ne pas répondre si la conversation est ouverte","crm.customSignature":"Personnaliser ou désactiver la signature","crm.simulateTyping":"Simuler la frappe ou l'enregistrement audio","crm.dontRespondIfInCRM":"Ne pas répondre si le contact est dans un CRM","crm.dontRespondToCRMs":"Ne pas répondre aux CRMs","crm.respondOnlyToCRMs":"Répondre uniquement aux CRMs","crm.enableCrmRules":"Activer les règles d'onglets CRM","crm.selectCrmTabs":"Sélectionner les onglets CRM","crm.tagRules":"Règles de tags","crm.labelRules":"Règles de labels :","crm.dontRespondIfLabeled":"Ne pas répondre si le contact a un label","crm.dontRespondToLabels":"Ne pas répondre à ces labels","crm.respondOnlyToLabels":"Répondre uniquement à ces labels","crm.selectLabelsNotToReply":"Sélectionner les labels à ne pas répondre :","crm.selectLabelsToReply":"Sélectionner les labels à répondre :","crm.clickToSelect":"Cliquez pour sélectionner","crm.labelsNotReplied":"Labels qui ne seront pas répondus :","crm.labelsToReply":"Labels qui seront répondus :","crm.customTabRules":"Règles des onglets personnalisés :","crm.dontRespondIfInCustomTab":"Ne pas répondre si le contact est dans un onglet personnalisé","crm.dontRespondToCustomTabs":"Ne pas répondre à ces onglets personnalisés","crm.respondOnlyToCustomTabs":"Répondre uniquement à ces onglets personnalisés","crm.selectCustomTabsNotToReply":"Sélectionner les onglets personnalisés à ne pas répondre :","crm.selectCustomTabsToReply":"Sélectionner les onglets personnalisés à répondre :","crm.customTabsNotReplied":"Onglets personnalisés qui ne seront pas répondus :","crm.customTabsToReply":"Onglets personnalisés qui seront répondus :","crm.noCustomTabsAvailable":"Aucun onglet personnalisé disponible. Créez-en un d'abord.","crm.pauseRules":"Règles de pause :","crm.enablePause":"Activer la pause","crm.pauseClientKeywords":"Mots-clés de pause client","crm.pauseClientPlaceholder":"Mettre en pause le chatbot si le destinataire...","crm.pauseServerKeywords":"Mots-clés de pause serveur","crm.pauseServerPlaceholder":"Pause quand le bot envoie...","crm.pauseDuration":"Durée de la pause (HH:MM)","crm.tipPauseTitle":"Règles de Pause","crm.tipPauseDesc":"Mettre en pause le chatbot lorsque des mots-clés spécifiques sont détectés. Utilisez les mots-clés client pour permettre aux clients de mettre en pause le bot, ou les mots-clés serveur pour une pause automatique après certains messages.","crm.tipPauseEx1":"Le client dit 'stop' → Le bot se met en pause","crm.tipPauseEx2":"Le client dit 'humain' → Transfert à un agent","crm.tipPauseEx3":"Le bot envoie 'connexion...' → Pause automatique","crm.tipPauseClientTitle":"Mots-clés de Pause Client","crm.tipPauseClientDesc":"Mots-clés qui, lorsqu'ils sont envoyés par le client, mettent en pause le chatbot pour cette conversation. Utile pour le transfert aux agents humains.","crm.tipPauseClientEx1":"Le client tape 'stop' ou 'arrêter'","crm.tipPauseClientEx2":"Le client tape 'humain' ou 'agent'","crm.tipPauseClientEx3":"Le bot cesse de répondre pendant la durée définie","crm.tipPauseServerTitle":"Mots-clés de Pause Serveur","crm.tipPauseServerDesc":"Mots-clés qui, lorsqu'ils sont envoyés par le bot, mettent automatiquement en pause le chatbot. Utile lors du transfert aux agents humains.","crm.tipPauseServerEx1":"Le bot envoie 'Connexion à un agent...'","crm.tipPauseServerEx2":"Le bot envoie 'Veuillez patienter, transfert...'","crm.tipPauseServerEx3":"Le flux se met en pause automatiquement après ce message","crm.tipPauseDurationTitle":"Durée de la Pause","crm.tipPauseDurationDesc":"Définissez combien de temps le chatbot restera en pause après la détection d'un mot-clé de pause. Format : Heures:Minutes (ex., 00:30 = 30 minutes).","crm.tipPauseDurationEx1":"00:30 = 30 minutes de pause","crm.tipPauseDurationEx2":"01:00 = 1 heure de pause","crm.tipPauseDurationEx3":"Après la durée, reste en pause jusqu'au nouveau déclencheur","crm.enableTagRules":"Activer les règles de labels WhatsApp","crm.editBlock":"Modifier le bloc :","crm.close":"Fermer","crm.startNode":"Démarrer","crm.startNodeInfo":"C'est le point de départ de votre flux. Connectez-le à d'autres blocs pour construire votre chatbot.","crm.editTextMessage":"Modifier le message texte :","crm.typeTheText":"Tapez le texte","crm.saveResponseInVariable":"Enregistrer la réponse dans la variable :","crm.typeVariableName":"Tapez le nom de la variable","crm.variableHint":"La variable stockera la réponse du client du bloc actuel et pourra être utilisée dans les blocs suivants","crm.insertImage":"Insérer une image :","crm.clickToUpload":"Cliquez pour envoyer ou glissez les fichiers ici","crm.imageFormats":"Image : PNG, JPG, JPEG, GIF (max 16Mo - limite WhatsApp)","crm.imageCaption":"Légende de l'image (optionnel)","crm.insertVideo":"Insérer une vidéo :","crm.insertAudio":"Insérer un audio :","crm.insertDocument":"Insérer un document :","crm.caption":"Légende :","crm.captionOptional":"Légende (optionnel)","crm.questionMessage":"Message de question :","crm.typeQuestion":"Tapez votre question...","crm.responseOptions":"Options de réponse :","crm.addOption":"Ajouter une option","crm.buttonText":"Texte du bouton :","crm.title":"Titre :","crm.listTitleOptional":"Titre de la liste (optionnel)","crm.listDescOptional":"Description (optionnel)","crm.listSectionsHint":"Configurez les sections et éléments de la liste dans les paramètres avancés.","crm.globalSettings":"Paramètres globaux :","crm.editAwayMessage":"Modifier le message d'absence :","crm.awayMessagePlaceholder":"Tapez le message qui sera envoyé quand l'utilisateur ne répond pas...","crm.waitingTime":"Temps d'attente :","crm.waitingTimeWarning":"Lorsque la page WhatsApp est rechargée, ce paramètre sera perdu pour les conversations en attente de réponse","crm.minutes":"Minutes","crm.hours":"Heures","crm.seconds":"Secondes","crm.awayMessageInfo":"Ce message sera envoyé automatiquement quand l'utilisateur ne répond pas dans le délai spécifié.","crm.blockInterval":"Intervalle de bloc :","crm.blockIntervalInfo":"Définir l'intervalle par défaut entre l'envoi des blocs du flux.","crm.chatSimulator":"Simulateur de chat","crm.startConversation":"Commencez une conversation en envoyant un message","crm.typeMessageHere":"Tapez votre message ici...","crm.callNextBlock":"Appeler le bloc suivant","crm.whenItemSelected":"Quand un élément est sélectionné","crm.whenResponding":"Lors de la réponse","crm.defaultNext":"Par défaut (aucune correspondance)","crm.message":"Message :","crm.listButton":"Texte du bouton :","crm.items":"éléments","crm.listItems":"Éléments de liste :","crm.addItem":"Ajouter un élément","crm.insertVariable":"Insérer une Variable","crm.contactName":"Nom du Contact","crm.currentDate":"Date Actuelle","crm.currentTime":"Heure Actuelle","crm.defaultOption1":"Option 1","crm.defaultOption2":"Option 2","crm.noListItems":"Aucun élément. Cliquez sur modifier pour ajouter.","crm.send_text":"Envoyer du texte","crm.send_image":"Envoyer une image","crm.send_video":"Envoyer une vidéo","crm.send_audio":"Envoyer un audio","crm.send_document":"Envoyer un document","crm.send_list":"Envoyer une liste","crm.group_action":"Action de groupe","crm.tab_action":"Action d'onglet","crm.label_action":"Action d'étiquette","crm.crm_action":"Action CRM","crm.wait_input":"Attendre une entrée","crm.smart_wait":"Attente intelligente","crm.typing_indicator":"Indicateur de saisie","crm.add_fluxo":"Ajouter Fluxo","crm.timezone":"Fuseau horaire :","crm.day":"Jour","crm.sunday":"Dimanche","crm.monday":"Lundi","crm.tuesday":"Mardi","crm.wednesday":"Mercredi","crm.thursday":"Jeudi","crm.friday":"Vendredi","crm.saturday":"Samedi","crm.disableSignature":"Désactiver la signature","crm.customizeSignatureName":"Personnaliser le nom de la signature","crm.enterCustomSignature":"Entrez le nom de signature personnalisé","crm.tipAnyMsgTitle":"Déclencheur Tout Message","crm.tipAnyMsgDesc":"Le flux se déclenchera lorsque N'IMPORTE QUEL message est reçu d'un client, quel que soit le contenu.","crm.tipAnyMsgEx1":"Réponse automatique générale pour tous les messages","crm.tipAnyMsgEx2":"Message d'absence quand non disponible","crm.tipAnyMsgEx3":"Peut se déclencher trop fréquemment - utiliser avec intervalle de réactivation","crm.tipKeywordTitle":"Déclencheur par Mot-clé","crm.tipKeywordDesc":"Le flux se déclenche UNIQUEMENT lorsque le message contient un des mots-clés spécifiés.","crm.tipKeywordEx1":"'bonjour' déclenche le flux de bienvenue","crm.tipKeywordEx2":"'prix' déclenche les informations produit","crm.tipKeywordEx3":"'aide' déclenche le menu support","crm.tipFirstDayTitle":"Premier Message du Jour","crm.tipFirstDayDesc":"Le flux se déclenche UNIQUEMENT sur le premier message reçu chaque jour de chaque contact.","crm.tipFirstDayEx1":"Salutation 'Bonjour' une seule fois par jour","crm.tipFirstDayEx2":"Promotion quotidienne spéciale pour chaque contact","crm.tipFirstDayEx3":"Se réinitialise à minuit selon le fuseau horaire","crm.tipFirstEverTitle":"Tout Premier Message","crm.tipFirstEverDesc":"Le flux se déclenche UNIQUEMENT la première fois qu'un contact envoie un message.","crm.tipFirstEverEx1":"Message de bienvenue pour nouveaux contacts","crm.tipFirstEverEx2":"Séquence d'intégration pour nouveaux clients","crm.tipFirstEverEx3":"Assignation CRM initiale pour nouveaux leads","crm.tipReactivationTitle":"Intervalle de Réactivation","crm.tipReactivationDesc":"Temps minimum avant que le même flux puisse se redéclencher pour le même contact.","crm.tipReactivationEx1":"3600s = Attendre 1 heure avant re-déclenchement","crm.tipReactivationEx2":"Empêche le spam de réponses automatiques","crm.tipReactivationEx3":"Utiliser 0 pour déclenchements illimités","crm.tipSendTextTitle":"Envoyer Message Texte","crm.tipSendTextDesc":"Envoie un message texte brut au contact. Supporte les variables comme {name}, {phone}.","crm.tipSendTextEx1":"Messages de bienvenue personnalisés","crm.tipSendTextEx2":"Confirmations de commande","crm.tipSendImageTitle":"Envoyer Image","crm.tipSendImageDesc":"Envoie un fichier image avec légende optionnelle. Supporte PNG, JPG, GIF.","crm.tipSendImageEx1":"Images de produits","crm.tipSendImageEx2":"Matériels promotionnels","crm.tipSendVideoTitle":"Envoyer Vidéo","crm.tipSendVideoDesc":"Envoie un fichier vidéo avec légende optionnelle. Supporte MP4, MOV.","crm.tipSendVideoEx1":"Démos de produits","crm.tipSendVideoEx2":"Vidéos tutorielles","crm.tipSendAudioTitle":"Envoyer Audio","crm.tipSendAudioDesc":"Envoie un fichier audio ou mémo vocal. Supporte MP3, OGG, WAV.","crm.tipSendAudioEx1":"Messages vocaux préenregistrés","crm.tipSendAudioEx2":"Annonces audio","crm.tipSendDocTitle":"Envoyer Document","crm.tipSendDocDesc":"Envoie n'importe quel type de fichier comme document. Supporte PDF, DOC, XLS, etc.","crm.tipSendDocEx1":"Catalogues de prix","crm.tipSendDocEx2":"Contrats et accords","crm.tipSendListTitle":"Envoyer Message Liste","crm.tipSendListDesc":"Envoie une liste interactive avec sections et éléments sélectionnables.","crm.tipSendListEx1":"Menus produits par catégorie","crm.tipSendListEx2":"Options de services","crm.tipGroupActionTitle":"Action Groupe WhatsApp","crm.tipGroupActionDesc":"Ajoute ou retire le contact actuel des groupes WhatsApp.","crm.tipGroupActionEx1":"Ajouter clients VIP au groupe exclusif","crm.tipGroupActionEx2":"Retirer du groupe support après résolution","crm.tipTabActionTitle":"Action Onglet Personnalisé","crm.tipTabActionDesc":"Ajoute ou retire le contact actuel des onglets personnalisés CRM.","crm.tipTabActionEx1":"Déplacer lead vers onglet 'Qualifié'","crm.tipTabActionEx2":"Retirer de l'onglet 'Nouvelle Demande'","crm.tipLabelActionTitle":"Action Étiquette WhatsApp","crm.tipLabelActionDesc":"Ajoute ou retire des étiquettes WhatsApp du contact actuel.","crm.tipLabelActionEx1":"Ajouter étiquette 'Répondu'","crm.tipLabelActionEx2":"Retirer étiquette 'En Attente'","crm.tipCrmActionTitle":"Action Étape CRM","crm.tipCrmActionDesc":"Déplace le contact actuel vers une étape spécifique dans le Kanban CRM.","crm.tipCrmActionEx1":"Déplacer vers étape 'Négociation'","crm.tipCrmActionEx2":"Déplacer vers étape 'Conclu Gagné'","crm.tipSmartWaitTitle":"Attente Intelligente","crm.tipSmartWaitDesc":"Ajoute un délai aléatoire entre les actions pour paraître plus humain.","crm.tipSmartWaitEx1":"Attendre 2-5 secondes entre messages","crm.tipSmartWaitEx2":"Simuler temps de lecture naturel","crm.tipTypingTitle":"Indicateur de Saisie","crm.tipTypingDesc":"Affiche la bulle 'en train d'écrire...' avant d'envoyer le message pour paraître plus humain.","crm.tipTypingEx1":"Afficher saisie 3 secondes avant message","crm.tipTypingEx2":"Rend les réponses plus naturelles","crm.tipAllowGroupsTitle":"Autoriser les Groupes","crm.tipAllowGroupsDesc":"Lorsqu'activé, le chatbot répondra aussi dans les conversations de groupe. Désactivé, seuls les chats privés déclenchent le flux.","crm.tipAllowGroupsEx1":"ON: Répondre dans les groupes et privé","crm.tipAllowGroupsEx2":"OFF: Répondre uniquement en privé","crm.tipScheduleTitle":"Planifier les Réponses","crm.tipScheduleDesc":"Restreindre le chatbot à des heures/jours spécifiques. Configurez l'horaire ci-dessous.","crm.tipScheduleEx1":"Heures de bureau uniquement (9h - 18h)","crm.tipScheduleEx2":"Jours ouvrables uniquement (Lun-Ven)","crm.tipScheduleEx3":"Réponse auto hors horaires","crm.tipDontRespondOpenTitle":"Ne Pas Répondre si Ouvert","crm.tipDontRespondOpenDesc":"Empêche le chatbot d'envoyer des messages si vous avez déjà cette conversation ouverte dans WhatsApp Web.","crm.tipDontRespondOpenEx1":"Utile quand vous chattez activement","crm.tipDontRespondOpenEx2":"Empêche le bot d'interrompre votre conversation","crm.tipSimulateTypingTitle":"Simuler la Saisie","crm.tipSimulateTypingDesc":"Affiche l'indicateur 'en train d'écrire...' avant d'envoyer, rendant les réponses plus humaines.","crm.tipSimulateTypingEx1":'Affiche "en train d\'écrire..." pour les textes',"crm.tipSimulateTypingEx2":'Affiche "enregistrement..." pour l\'audio',"crm.tipSimulateTypingEx3":"Rend le bot plus naturel","crm.tipSkipCRMTitle":"Ignorer les Contacts CRM","crm.tipSkipCRMDesc":"Le chatbot ne répondra pas aux contacts déjà ajoutés à votre CRM. Utile pour les clients existants.","crm.tipSkipCRMEx1":"Réponse auto uniquement aux nouveaux contacts","crm.tipSkipCRMEx2":"Ignorer les contacts CRM existants","crm.tipExcludeCRMTitle":"Exclure des Étapes CRM Spécifiques","crm.tipExcludeCRMDesc":"Sélectionnez des étapes Kanban CRM spécifiques à exclure. Les contacts dans ces étapes ne recevront pas de messages du chatbot.","crm.tipExcludeCRMEx1":'Exclure étape "Clients VIP"',"crm.tipExcludeCRMEx2":'Exclure étape "Ne Pas Déranger"',"crm.tipIncludeCRMTitle":"Inclure Uniquement des Étapes CRM Spécifiques","crm.tipIncludeCRMDesc":"Le chatbot répondra UNIQUEMENT aux contacts dans les étapes Kanban CRM sélectionnées. Tous les autres sont ignorés.","crm.tipIncludeCRMEx1":'Répondre uniquement à l\'étape "Leads"',"crm.tipIncludeCRMEx2":'Répondre uniquement à l\'étape "Affaires Actives"',"crm.tipSkipLabeledTitle":"Ignorer les Contacts Étiquetés","crm.tipSkipLabeledDesc":"Le chatbot ne répondra pas aux contacts ayant une étiquette WhatsApp assignée.","crm.tipSkipLabeledEx1":"Tout contact étiqueté est ignoré","crm.tipSkipLabeledEx2":"Seuls les contacts non étiquetés reçoivent des réponses","crm.tipExcludeLabelTitle":"Exclure des Étiquettes Spécifiques","crm.tipExcludeLabelDesc":"Sélectionnez des étiquettes WhatsApp spécifiques à exclure. Les contacts avec ces étiquettes ne recevront pas de messages du chatbot.","crm.tipExcludeLabelEx1":'Exclure contacts étiquetés "Spam"',"crm.tipExcludeLabelEx2":'Exclure contacts étiquetés "Bloqué"',"crm.tipIncludeLabelTitle":"Inclure Uniquement des Étiquettes Spécifiques","crm.tipIncludeLabelDesc":"Le chatbot répondra UNIQUEMENT aux contacts avec les étiquettes WhatsApp sélectionnées. Tous les autres sont ignorés.","crm.tipIncludeLabelEx1":'Répondre uniquement aux "VIP"',"crm.tipIncludeLabelEx2":'Répondre uniquement aux "Priorité"',"crm.tipSkipCustomTabTitle":"Ignorer les Contacts des Onglets Personnalisés","crm.tipSkipCustomTabDesc":"Le chatbot ne répondra pas aux contacts assignés à un onglet personnalisé.","crm.tipSkipCustomTabEx1":'Contact dans onglet "Clients VIP" → Pas de réponse',"crm.tipSkipCustomTabEx2":"Contact pas dans d'onglet → Bot répond","crm.tipExcludeCustomTabTitle":"Exclure des Onglets Personnalisés Spécifiques","crm.tipExcludeCustomTabDesc":"Sélectionnez des onglets personnalisés spécifiques à exclure. Les contacts dans ces onglets ne recevront pas de messages du chatbot.","crm.tipExcludeCustomTabEx1":'Exclure contacts de l\'onglet "Bloqués"',"crm.tipExcludeCustomTabEx2":'Exclure contacts de l\'onglet "Traités"',"crm.tipIncludeCustomTabTitle":"Inclure Uniquement des Onglets Personnalisés Spécifiques","crm.tipIncludeCustomTabDesc":"Le chatbot répondra UNIQUEMENT aux contacts dans les onglets personnalisés sélectionnés. Tous les autres sont ignorés.","crm.tipIncludeCustomTabEx1":'Répondre uniquement à l\'onglet "Leads Actifs"',"crm.tipIncludeCustomTabEx2":'Répondre uniquement à l\'onglet "VIP"',"templates.addCategory":"Ajouter une Catégorie","templates.editCategory":"Modifier la Catégorie","templates.deleteCategory":"Supprimer la Catégorie","templates.manageCategories":"Gérer","templates.categoryName":"Nom de la Catégorie","templates.categoryIcon":"Icône","templates.categoryColor":"Couleur","templates.update":"Mettre à jour","templates.form.category":"Catégorie","templates.form.categoryHint":"Organiser les modèles en catégories pour un accès plus facile","templates.allTemplates":"Tous les Modèles","templates.quickReplyCategory":"Réponse Rapide","templates.uncategorized":"Non Catégorisé","templates.sortNewest":"Plus Récents","templates.sortOldest":"Plus Anciens","templates.sortNameAZ":"Nom A-Z","templates.sortNameZA":"Nom Z-A","templates.confirmDeleteCategory":"Êtes-vous sûr de vouloir supprimer cette catégorie ? Les modèles seront déplacés vers Non Catégorisé.","templates.confirmDeleteTemplate":"Êtes-vous sûr de vouloir supprimer ce modèle ?","templates.noCategoriesYet":"Pas encore de catégories","templates.createCategoryDescription":"Créez des catégories pour organiser vos modèles","templates.done":"Terminé","templates.deleteCategoryWarning":"Les modèles de cette catégorie seront non catégorisés.","templates.delete":"Supprimer","templates.noTemplatesInCategory":"Aucun modèle dans cette catégorie","templates.createFirstDescription":"Créez votre premier modèle pour commencer","followUp.title":"Suivi","followUp.newFollowUp":"Nouveau Suivi","followUp.confirmDelete":"Êtes-vous sûr de vouloir supprimer ce suivi ?","followUp.emptyTitle":"Aucun Suivi Sélectionné","followUp.emptyText":"Sélectionnez un suivi dans la liste ou créez-en un nouveau pour commencer avec des séquences de messages automatisées.","followUp.createNew":"Créer Nouveau","followUp.loading":"Chargement...","followUp.noFollowUps":"Pas encore de suivis","followUp.createFirst":"Créez votre première séquence de suivi","followUp.active":"Actif","followUp.paused":"En Pause","followUp.labels":"Étiquettes","followUp.customTabs":"Onglets Personnalisés","followUp.groups":"Groupes","followUp.kanban":"Kanban","followUp.onEnter":"À l'Entrée","followUp.onLeave":"À la Sortie","followUp.afterTime":"Après Temps","followUp.steps":"étapes","followUp.pause":"Pause","followUp.activate":"Activer","followUp.duplicate":"Dupliquer","followUp.delete":"Supprimer","followUp.name":"Nom du Suivi","followUp.namePlaceholder":"Entrez le nom du suivi...","followUp.nameRequired":"Veuillez entrer un nom pour le suivi","followUp.funnelRequired":"Veuillez sélectionner au moins un élément d'entonnoir","followUp.stepsRequired":"Veuillez ajouter au moins une étape","followUp.funnelSettings":"Paramètres de l'Entonnoir","followUp.selectFunnelItems":"Sélectionnez les éléments pour déclencher ce suivi","followUp.comingSoon":"Sélecteur à venir","followUp.triggerSettings":"Déclencheur de Suivi","followUp.onEnterDesc":"Déclencher quand le contact entre dans l'entonnoir","followUp.onLeaveDesc":"Déclencher quand le contact quitte l'entonnoir","followUp.afterTimeDesc":"Déclencher après une période spécifique","followUp.days":"Jours","followUp.day":"Jour","followUp.hours":"Heures","followUp.minutes":"Minutes","followUp.value":"Valeur","followUp.unit":"Unité","followUp.time":"Heure","followUp.scheduleConfiguration":"Configuration du Calendrier","followUp.enableSchedule":"Activer le Calendrier Avancé","followUp.enableScheduleDesc":"(Envoyer uniquement à des jours/dates spécifiques)","followUp.scheduleDisabledInfo":"Activez le Calendrier Avancé ci-dessus pour configurer des jours/dates spécifiques pour l'envoi des messages.","followUp.tooltip.scheduleTitle":"Configuration du Calendrier - Quand envoyer?","followUp.tooltip.scheduleContent":"Configurez des jours/dates spécifiques pour l'exécution du suivi. Fonctionne avec tout type de déclencheur. Choisissez des calendriers quotidiens, hebdomadaires, mensuels ou annuels.","followUp.tooltip.scheduleExample":"Définissez un calendrier hebdomadaire pour Lun, Mer, Ven pour envoyer des messages uniquement ces jours-là.","followUp.messagesConfiguredInSchedule":"Messages Configurés dans le Calendrier","followUp.messagesConfiguredInScheduleDesc":'Vous avez activé "Message Différent par Jour" dans la section Configuration du Calendrier ci-dessus. Les messages sont configurés là-bas pour chaque jour sélectionné.',"followUp.stepsTitle":"Étapes de Suivi","followUp.step":"Étape","followUp.actions":"actions","followUp.addStep":"Ajouter Étape de Suivi","followUp.rulesTitle":"Règles de Déclenchement","followUp.cancelOnReply":"Annuler si le client répond","followUp.allowGroups":"Permettre les réponses dans les groupes","followUp.customSignature":"Personnaliser la signature","followUp.signatureText":"Texte de Signature","followUp.signaturePlaceholder":"Entrez votre signature...","followUp.maxExecutions":"Nombre max par contact","followUp.cooldownDays":"Période d'attente (jours)","followUp.cancel":"Annuler","followUp.create":"Créer Suivi","followUp.save":"Enregistrer","followUp.saving":"Enregistrement...","followUp.saved":"Enregistré !","followUp.back":"← Retour","followUp.next":"Suivant →","followUp.backToList":"← Retour à la liste","followUp.wizardStep1":"Configuration","followUp.wizardStep2":"Messages","followUp.wizardStep3":"Planification","followUp.wizardStep4":"Actions","followUp.wizardStep5":"Règles","followUp.followUps":"Suivis","followUp.stepName":"Nom de l'Étape (Optionnel)","followUp.stepNamePlaceholder":"ex., Contact Initial, Suivi 1...","followUp.timing":"Timing","followUp.mode":"Mode","followUp.relative":"Relatif","followUp.specific":"Spécifique","followUp.type":"Type","followUp.daily":"Quotidien","followUp.weekly":"Hebdomadaire","followUp.monthly":"Mensuel","followUp.condition":"Condition","followUp.conditionAlways":"Toujours","followUp.conditionIfReplied":"Si Répondu","followUp.conditionIfNotReplied":"Si Non Répondu","followUp.conditionIfKeyword":"Si Mot-clé","followUp.conditionIfNotKeyword":"Si Pas de Mot-clé","followUp.conditionIfInFunnel":"Si Dans l'Entonnoir","followUp.conditionIfNotInFunnel":"Si Sorti de l'Entonnoir","followUp.keywords":"Mots-clés (séparés par virgule)","followUp.keywordsPlaceholder":"oui, ok, intéressé...","followUp.actionsTitle":"Actions","followUp.actionsRequired":"Veuillez ajouter au moins une action","followUp.addAction":"+ Ajouter Action","followUp.postActionsTitle":"Actions Suivantes","followUp.groupActions":"Actions de Groupe","followUp.addToGroups":"Ajouter aux Groupes","followUp.removeFromGroups":"Retirer des Groupes","followUp.customTabActions":"Actions d'Onglet Personnalisé","followUp.addToTabs":"Ajouter aux Onglets","followUp.removeFromTabs":"Retirer des Onglets","followUp.labelsActions":"Actions d'Étiquettes","followUp.addLabels":"Ajouter Étiquettes","followUp.removeLabels":"Retirer Étiquettes","followUp.kanbanBoardActions":"Actions Kanban","followUp.addToKanban":"Ajouter à l'Étape","followUp.removeFromKanban":"Retirer de l'Étape","followUp.selectStage":"Sélectionner Étape...","followUp.noGroupsAvailable":"Aucun groupe disponible","followUp.noTabsAvailable":"Aucun onglet disponible","followUp.noLabelsAvailable":"Aucune étiquette disponible","followUp.noKanbanAvailable":"Aucun tableau Kanban disponible","followUp.moveUp":"Monter","followUp.moveDown":"Descendre","followUp.removeStep":"Supprimer Étape","followUp.message":"Message","followUp.messagePlaceholder":"Tapez votre message ici...","followUp.variables":"Variables","followUp.clickToInsert":"Cliquer pour insérer une variable :","followUp.minDelay":"Délai Min (sec)","followUp.maxDelay":"Délai Max (sec)","followUp.addMessage":"Ajouter Message","followUp.removeMessage":"Supprimer Message","followUp.selectLabels":"Sélectionner étiquettes...","followUp.selectTabs":"Sélectionner onglets personnalisés...","followUp.selectKanbanStage":"Sélectionner CRM Kanban et étape...","followUp.selectGroups":"Sélectionner groupes WhatsApp...","followUp.selectorComingSoon":"Sélecteur à venir","followUp.webhookUrl":"URL Webhook","followUp.includeContactData":"Inclure les données du contact","followUp.search":"Rechercher...","followUp.noLabels":"Aucune étiquette trouvée. Créez d'abord des étiquettes dans WhatsApp.","followUp.noTabs":"Aucun onglet personnalisé trouvé. Créez des onglets depuis la barre d'onglets.","followUp.noGroups":"Aucun groupe WhatsApp trouvé.","followUp.noStages":"Aucune étape Kanban trouvée. Créez d'abord un CRM et des étapes.","followUp.fluxoCategory":"Catégorie","followUp.allCategories":"Toutes les Catégories","followUp.uncategorized":"Non Catégorisé","followUp.selectFluxo":"Sélectionner Fluxo","followUp.chooseFluxo":"-- Choisir un Fluxo --","followUp.fluxoInfo":"Le flux chatbot sélectionné sera déclenché lors de l'exécution de ce suivi.","followUp.messageText":"Texte du Message","followUp.templatesType":"Type de Modèle","followUp.tooltip.nameTitle":"Nom du Suivi","followUp.tooltip.nameContent":"Donnez un nom descriptif pour identifier cette séquence de suivi. Utilisez des noms clairs qui décrivent l'objectif.","followUp.tooltip.nameExample":"Exemple : 'Bienvenue Nouveau Lead', 'Rappel de Paiement', 'Demande de Feedback'","followUp.tooltip.categoryTitle":"Catégorie","followUp.tooltip.categoryContent":"Organisez vos suivis en catégories pour une meilleure gestion. Sélectionnez une catégorie ou laissez comme Non Catégorisé.","followUp.tooltip.funnelTitle":"Paramètres de l'Entonnoir - Où déclencher ?","followUp.tooltip.funnelContent":"Sélectionnez quelles Étiquettes, Onglets Personnalisés, Groupes ou étapes Kanban déclencheront cette séquence de suivi. Quand un contact entre dans l'entonnoir sélectionné, le suivi commencera.","followUp.tooltip.funnelExample":"Exemple : Sélectionnez l'étiquette 'Nouveau Lead' → Quand un contact reçoit cette étiquette, le suivi démarre automatiquement.","followUp.tooltip.triggerTitle":"Déclencheur de Suivi - Quand commencer ?","followUp.tooltip.triggerContent":"Décide QUAND la séquence de suivi COMMENCERA après l'événement d'entonnoir. À l'Entrée : immédiatement quand le contact entre. À la Sortie : quand le contact sort. Après Temps : attendre X temps avant de commencer.","followUp.tooltip.triggerExample":"Exemple : 'Après Temps' + 2 heures = Le suivi commence 2 heures après que le contact entre dans l'entonnoir.","followUp.tooltip.actionsTitle":"Actions - Que faire ?","followUp.tooltip.actionsContent":"Définissez ce qui se passe quand le suivi se déclenche. Toutes les actions s'exécutent au moment du déclenchement. Ajoutez des messages, changez des étiquettes, déplacez vers des étapes Kanban, ou déclenchez des webhooks.","followUp.tooltip.actionsExample":"Exemple : Envoyer message de bienvenue → Ajouter étiquette 'Contacté' → Déplacer vers étape 'En Cours'.","followUp.tooltip.rulesTitle":"Règles de Déclenchement - Contrôler le comportement","followUp.tooltip.rulesContent":"Configurez le comportement du suivi. Annuler si réponse arrête la séquence si le client répond. Autoriser les groupes permet l'envoi dans les chats de groupe. Signature personnalisée ajoute votre texte à la fin des messages.","followUp.tooltip.rulesExample":"Bonne Pratique : Activez 'Annuler si réponse' pour éviter de spammer les clients qui ont déjà répondu.","followUp.tooltip.cancelOnReplyTitle":"Annuler si le Client Répond","followUp.tooltip.cancelOnReplyContent":"Arrête automatiquement tous les messages de suivi en attente pour un contact quand il vous envoie un message. Cela évite d'envoyer des suivis inutiles aux clients qui ont déjà répondu.","followUp.tooltip.cancelOnReplyExample":"• Activé : Le suivi s'arrête si le client répond avant l'envoi\n• Désactivé : Le suivi s'envoie peu importe les messages du client","followUp.tooltip.allowGroupsTitle":"Permettre les Réponses dans les Groupes","followUp.tooltip.allowGroupsContent":"Contrôle si ce suivi peut envoyer des messages aux groupes WhatsApp. Par défaut, les suivis fonctionnent uniquement pour les contacts individuels (chats 1-à-1).","followUp.tooltip.allowGroupsExample":"• Activé : Le suivi fonctionne pour les chats individuels ET les groupes\n• Désactivé : Le suivi fonctionne uniquement pour les contacts individuels","followUp.tooltip.signatureTitle":"Personnaliser la Signature","followUp.tooltip.signatureContent":"Ajoute une signature personnalisée à la fin de chaque message de suivi. Utile pour le branding ou l'identification des messages automatisés.","followUp.tooltip.signatureExample":"Exemple : Votre message 'Bonjour, je vérifie !' devient 'Bonjour, je vérifie !\\n\\n~ Équipe CRM'","followUp.tooltip.maxExecutionsTitle":"Exécutions Maximum - Combien de fois ?","followUp.tooltip.maxExecutionsContent":"Contrôle combien de fois ce suivi peut envoyer des messages au MÊME contact. Une fois qu'un contact atteint cette limite, il ne recevra plus ce suivi.","followUp.tooltip.maxExecutionsExample":"• Mettre 0 = Illimité (pas de limite)\n• Mettre 1 = Une seule fois par contact\n• Mettre 3 = Le contact reçoit maximum 3 fois","followUp.tooltip.cooldownTitle":"Période d'Attente - Attendre avant de re-déclencher","followUp.tooltip.cooldownContent":"Après qu'un contact reçoive ce suivi, combien de jours attendre avant qu'il puisse le recevoir à nouveau. Cela évite de spammer le même contact de manière répétée.","followUp.tooltip.cooldownExample":"• Mettre 0 = Pas d'attente (peut se re-déclencher immédiatement)\n• Mettre 7 = Attendre 7 jours avant de re-déclencher","followUp.tooltip.exampleLabel":"Exemple :","followUp.tooltip.howToUseLabel":"Comment utiliser :","followUp.tooltip.bestPracticeLabel":"Bonne Pratique :","schedule.title":"Messages programmés","schedule.addSchedule":"Ajouter une programmation","schedule.editSchedule":"Modifier la programmation","schedule.schedulesCount":"Programmations","schedule.noSchedules":"Aucun message programmé","schedule.noSchedulesDesc":"Créez votre premier message programmé pour commencer.","schedule.confirmDelete":"Êtes-vous sûr de vouloir supprimer cette programmation ?","schedule.inactive":"Inactif","schedule.once":"Une fois","schedule.repeated":"Répété","schedule.scheduleFor":"Programmer pour","schedule.selectTarget":"Sélectionner un contact ou un groupe","schedule.searchContacts":"Rechercher des contacts et des groupes...","schedule.groups":"Groupes","schedule.contacts":"Contacts","schedule.templateType":"Type de modèle","schedule.message":"Message","schedule.enterMessage":"Entrez votre message...","schedule.scheduleDateTime":"Date et heure programmées","schedule.selectDateTime":"Veuillez sélectionner la date et l'heure","schedule.repeatedType":"Type de répétition","schedule.repeatedType_minute":"Minute","schedule.repeatedType_hour":"Heure","schedule.repeatedType_daily":"Quotidien","schedule.repeatedType_weekly":"Hebdomadaire","schedule.repeatedType_monthly":"Mensuel","schedule.repeatedType_yearly":"Annuel","schedule.everyMinutes":"Toutes les X minutes","schedule.everyHours":"Toutes les X heures","schedule.scheduleTime":"Heures programmées","schedule.addTime":"Ajouter une heure","schedule.startAndEndTime":"Heure de début et de fin","schedule.runAnytime":"Exécuter à tout moment","schedule.runBetween":"Exécuter pendant une période","schedule.endSchedule":"Terminer la répétition de la programmation le","schedule.never":"Jamais","schedule.afterCount":"Nombre de répétitions","schedule.completeOnDate":"Terminer à la date","schedule.weekday_mon":"Lundi","schedule.weekday_tue":"Mardi","schedule.weekday_wed":"Mercredi","schedule.weekday_thu":"Jeudi","schedule.weekday_fri":"Vendredi","schedule.weekday_sat":"Samedi","schedule.weekday_sun":"Dimanche","schedule.month_jan":"Janvier","schedule.month_feb":"Février","schedule.month_mar":"Mars","schedule.month_apr":"Avril","schedule.month_may":"Mai","schedule.month_jun":"Juin","schedule.month_jul":"Juillet","schedule.month_aug":"Août","schedule.month_sep":"Septembre","schedule.month_oct":"Octobre","schedule.month_nov":"Novembre","schedule.month_dec":"Décembre","schedule.postActions":"Actions suivantes","schedule.groupActions":"Actions de groupe","schedule.customTabActions":"Actions d'onglet personnalisé","schedule.labelsActions":"Actions d'étiquettes","schedule.kanbanActions":"Actions Kanban","schedule.members":"membres","schedule.noContactsFound":"Aucun contact trouvé","schedule.noGroupsFound":"Aucun groupe trouvé","schedule.loadingContacts":"Chargement des contacts...","schedule.loadingGroups":"Chargement des groupes...","schedule.selected":"Sélectionné","schedule.tooltip.scheduleFor":"Sélectionnez un contact ou un groupe pour envoyer le message programmé.","schedule.tooltip.templateType":"Choisissez le type de message : texte seul, avec média, sondage, liste, ou déclencher un flux Fluxo.","schedule.tooltip.message":"Tapez votre message. Utilisez des variables comme {{name}} ou {{phone}} pour la personnalisation.","schedule.tooltip.dateTime":"Définissez quand le message doit être envoyé. Pour les programmations répétées, c'est la date/heure de début.","schedule.tooltip.repeatedType":"Choisissez la fréquence de répétition : toutes les X minutes/heures, quotidien, hebdomadaire, mensuel ou annuel.","schedule.tooltip.scheduleTimes":"Ajoutez plusieurs horaires d'envoi. Cliquez sur + pour ajouter des créneaux.","schedule.tooltip.runBetween":"Limitez les messages à des heures spécifiques. ex., envoyer uniquement entre 9h et 18h.","schedule.tooltip.endSchedule":"Choisissez quand arrêter la répétition : Jamais, après X fois, ou à une date spécifique.","schedule.tooltip.postActions":"Actions après l'envoi : ajouter/retirer des groupes, onglets, étiquettes ou étapes Kanban.","gmaps.featureTitle":"Extracteur G Maps","feature.gmapsExtractor":"Extracteur G Maps","gmaps.panelHeader":"Extracteur G Maps","gmaps.status.idle":"Inactif","gmaps.status.running":"Extraction en cours...","gmaps.status.stopped":"Arrêté","gmaps.status.complete":"Terminé","gmaps.status.error":"Arrêté","gmaps.statusLabel":"Statut","gmaps.leadsFound":"Leads : {{count}}","gmaps.leadsShort":"leads","gmaps.settings":"Paramètres","gmaps.exportGroup":"Exporter et envoyer","gmaps.noPhone":"aucun téléphone","gmaps.showPanel":"Afficher le panneau","gmaps.hidePanel":"Masquer le panneau","gmaps.maxResults":"Résultats max.","gmaps.unlimited":"Illimité","gmaps.fetchEmails":"Récupérer les e-mails","gmaps.fetchEmailsTooltip":"Pour chaque lead disposant d'un site web, l'ouvre en arrière-plan et extrait la première adresse e-mail trouvée. Ajoute environ 3 secondes par lead et consomme plus de bande passante. Si le site n'a pas d'e-mail visible ou ne se charge pas, le champ e-mail reste vide.","gmaps.startBtn":"Démarrer l'extraction","gmaps.stopBtn":"Arrêter","gmaps.clearBtn":"Effacer","gmaps.exportCsv":"Exporter CSV","gmaps.exportXlsx":"Exporter XLSX","gmaps.sendToBroadcast":"Envoyer à la diffusion","gmaps.previewTitle":"Aperçu","gmaps.moreRows":"de plus","gmaps.expand":"Agrandir","gmaps.expandView":"Vue complète","gmaps.clickExpand":"Cliquez sur Agrandir pour voir les détails","gmaps.clickExpandToSee":"cliquez sur Agrandir pour tout voir","gmaps.col.name":"Nom","gmaps.col.phone":"Téléphone","gmaps.col.website":"Site web","gmaps.col.address":"Adresse","gmaps.col.category":"Catégorie","gmaps.col.rating":"Note","gmaps.noLeadsYet":"Aucun lead pour le moment — recherchez sur Google Maps puis cliquez sur Démarrer","gmaps.stopReason.userStop":"Arrêté par l'utilisateur","gmaps.stopReason.endOfResults":"Fin des résultats Google Maps atteinte","gmaps.stopReason.captcha":"Captcha Google détecté — résolvez-le puis cliquez à nouveau sur Démarrer","gmaps.stopReason.noFeed":"Aucun résultat de recherche Google Maps trouvé — veuillez d'abord lancer une recherche","gmaps.stopReason.noNewResults":"Aucun nouveau résultat ne se charge (Google a cessé de renvoyer des données)","gmaps.stopReason.maxReached":"Limite max. de résultats atteinte","gmaps.stopReason.tabClosed":"L'onglet a été fermé","gmaps.stopReason.error":"Erreur","gmaps.toast.searchFirst":"Veuillez d'abord lancer une recherche sur Google Maps, puis cliquer sur Démarrer.","gmaps.toast.csvReady":"CSV téléchargé","gmaps.toast.xlsxReady":"Fichier Excel téléchargé","gmaps.toast.noPhones":"Aucun numéro de téléphone valide — rien n'a été envoyé.","gmaps.toast.sentPartial":"{{sent}} contacts envoyés à la diffusion · {{dropped}} ignorés (sans téléphone)","gmaps.toast.sentAll":"{{sent}} contacts envoyés à la diffusion","gmaps.toast.broadcastFail":"Échec de l'envoi à la diffusion. Voir la console.","gmaps.toast.draftRestored":"Session précédente restaurée","gmaps.toast.draftRestoredN":"{{n}} leads restaurés depuis la session précédente"},ar:{"common.loading":"جاري التحميل...","common.close":"إغلاق","common.cancel":"إلغاء","common.save":"حفظ","common.copy":"نسخ","common.copied":"تم النسخ!","common.choose":"اختر","common.add":"إضافة","common.edit":"تعديل","common.delete":"حذف","common.back":"رجوع","quickReply.title":"رد سريع","quickReply.addButton":"+ إضافة","quickReply.allCategories":"جميع الفئات","quickReply.postActions":"إجراءات ما بعد الإرسال","quickReply.groupActions":"إجراءات المجموعة","quickReply.customTabActions":"إجراءات التبويب","quickReply.labelsActions":"إجراءات التصنيفات","quickReply.kanbanBoardActions":"إجراءات كانبان","quickReply.addToGroups":"إضافة إلى المجموعات","quickReply.removeFromGroups":"إزالة من المجموعات","quickReply.addToTabs":"إضافة إلى التبويبات","quickReply.removeFromTabs":"إزالة من التبويبات","quickReply.addLabels":"إضافة تصنيفات","quickReply.removeLabels":"إزالة تصنيفات","quickReply.addToStage":"إضافة إلى المرحلة","quickReply.removeFromStage":"إزالة من المرحلة","quickReply.selectGroups":"اختر المجموعات...","quickReply.selectTabs":"اختر التبويبات...","quickReply.selectLabels":"اختر التصنيفات...","quickReply.selectCrmStage":"اختر CRM والمرحلة...","quickReply.noGroupsAvailable":"لا توجد مجموعات متاحة","quickReply.noTabsAvailable":"لا توجد تبويبات متاحة","quickReply.noLabelsAvailable":"لا توجد تصنيفات متاحة","quickReply.noKanbanAvailable":"لا توجد لوحات كانبان متاحة","quickReply.editBeforeSending":"تعديل قبل الإرسال","quickReply.editBeforeSendingDesc":"السماح بتعديل الرسالة قبل الإرسال","actionSidebar.title":"إجراءات سريعة","actionSidebar.quickReply":"رد سريع","actionSidebar.flow":"تدفق","actionSidebar.search":"بحث...","actionSidebar.filter":"تصفية","actionSidebar.all":"الكل","actionSidebar.byType":"حسب النوع","actionSidebar.noCategory":"بدون تصنيف","actionSidebar.byCategory":"حسب التصنيف","actionSidebar.mostUsed":"الأكثر استخداماً","actionSidebar.send":"إرسال","actionSidebar.trigger":"تشغيل","actionSidebar.noItemsFound":"لم يتم العثور على عناصر","actionSidebar.selectChatFirst":"اختر محادثة أولاً","actionSidebar.uncategorized":"غير مصنف","actionSidebar.editAndSend":"تعديل وإرسال","actionSidebar.clickToCancel":"انقر للإلغاء","actionSidebar.cancel":"إلغاء","actionSidebar.sending":"جاري الإرسال...","header.activateLicense":"تفعيل الترخيص",broadcastTitle:"رسالة جماعية",kanbanTitle:"فتح كانبان CRM","profile.title":"الملف الشخصي","profile.deviceName":"اسم الجهاز","profile.expires":"تنتهي","profile.manageLicenseKey":"إدارة مفتاح الترخيص","profile.settings":"الإعدادات","profile.watchTutorial":"مشاهدة البرنامج التعليمي","profile.language":"اللغة","profile.privacyPolicy":"سياسة الخصوصية","profile.contactUs":"اتصل بنا","profile.website":"الموقع الإلكتروني","profile.premium":"بريميوم","profile.notActivated":"غير مفعل","profile.activateToContinue":"تفعيل الترخيص","settings.menuFeatures":"ميزات القائمة","settings.menuFeaturesDesc":"قم بتفعيل أو تعطيل الميزات حسب الحاجة","settings.interfaceOptions":"خيارات الواجهة","settings.featureDockLabel":"شريط الميزات الأيسر","settings.featureDockDesc":"إظهار شريط اختصارات على الحافة اليسرى عند فتح نافذة منبثقة","feature.tabs":"إدارة التبويبات","feature.templates":"القوالب","feature.quickReply":"الرد السريع","feature.kanban":"كانبان CRM","feature.chatbotFlow":"تدفق روبوت الدردشة","feature.followUp":"المتابعة","feature.broadcast":"الإرسال الجماعي","feature.calendar":"مركز الجدولة","feature.status":"الحالة","feature.validator":"المدقق","feature.webhook":"Webhook","feature.api":"API","feature.aiBot":"روبوت الذكاء الاصطناعي","feature.open":"فتح","license.activateTitle":"قم بتفعيل الترخيص الخاص بك","license.licenseKey":"مفتاح الترخيص","license.phoneNumber":"رقم الهاتف","license.phoneDetected":"رقم الهاتف المكتشف","license.planName":"اسم الخطة","license.endDate":"تاريخ الانتهاء","license.expiresIn":"تنتهي في","license.days":"أيام","license.daysLeft":"أيام متبقية","license.status":"الحالة","license.deactivateLicense":"إلغاء تفعيل الترخيص","license.deactivateConfirm":"هل أنت متأكد أنك تريد إلغاء تفعيل الترخيص الخاص بك؟","license.activateLicenseBtn":"تفعيل الترخيص","license.validating":"جاري التحقق...","license.pasteLicenseHere":"الصق مفتاح الترخيص هنا...","license.completeLicenseKey":"الصق مفتاح الترخيص الكامل الذي تلقيته عبر البريد الإلكتروني","trial.starting":"جاري بدء الفترة التجريبية المجانية لمدة 7 أيام...","trial.activated":"تم تفعيل الفترة التجريبية المجانية لمدة 7 أيام!","trial.daysRemaining":"{0} أيام متبقية في الفترة التجريبية","trial.expired":"انتهت الفترة التجريبية. يرجى شراء ترخيص.","trial.alreadyUsed":"تم استخدام الفترة التجريبية لهذا الرقم بالفعل. أدخل مفتاح ترخيص للمتابعة.","license.waitForWhatsApp":"يرجى الانتظار حتى يتم تحميل واتساب بالكامل","license.securityFooter":"محمي بالتحقق التشفيري WebAssembly","planDetails.title":"تفاصيل الخطة","planDetails.licenceKey":"مفتاح الترخيص","planDetails.planName":"اسم الخطة","planDetails.endDate":"تاريخ الانتهاء","planDetails.removeKey":"إزالة المفتاح","planDetails.changeKey":"تغيير المفتاح","features.enabledFeatures":"الميزات المفعلة","licenseInfo.title":"معلومات الترخيص","licenseInfo.phoneNumber":"رقم الهاتف","licenseInfo.expiresIn":"تنتهي في","licenseInfo.status":"الحالة","languages.en":"English (الإنجليزية)","languages.zh":"中文 (الصينية)","languages.es":"Español (الإسبانية)","languages.fr":"Français (الفرنسية)","languages.ar":"العربية","languages.pt":"Português (البرتغالية)","languages.ru":"Русский (الروسية)","languages.ja":"日本語 (اليابانية)","languages.de":"Deutsch (الألمانية)","errors.invalidFormat":"تنسيق مفتاح الترخيص غير صالح أو فشل التحقق","errors.serverError":"حدث خطأ في الخادم","errors.networkError":"خطأ في الشبكة. يرجى التحقق من الاتصال الخاص بك","tabs.tabs":"علامات التبويب","tabs.manageTabs":"إدارة علامات التبويب","tabs.addTab":"إضافة علامة تبويب","tabs.editTab":"تحرير علامة التبويب","tabs.deleteTab":"حذف علامة التبويب","tabs.tabTitle":"عنوان علامة التبويب","tabs.tabDetails":"تفاصيل علامة التبويب","tabs.enterTabTitle":"أدخل عنوان علامة التبويب","tabs.enterTabDetails":"أدخل تفاصيل علامة التبويب","tabs.chooseFrom":"اختر من","tabs.chat":"محادثة","tabs.groups":"مجموعات","tabs.label":"تسمية","tabs.searchHere":"ابحث هنا","tabs.selectAll":"تحديد الكل","tabs.clearAll":"مسح الكل","tabs.selected":"محدد","tabs.allChats":"كل المحادثات","tabs.chats":"محادثات","tabs.noFilterApplied":"لم يتم تطبيق أي فلتر","tabs.view":"عرض","tabs.edit":"تحرير","tabs.delete":"حذف","tabs.hideFromTabBar":"إخفاء من شريط علامات التبويب","tabs.showInTabBar":"إظهار في شريط علامات التبويب","tabs.sort":"ترتيب","tabs.title":"العنوان","tabs.details":"التفاصيل","tabs.action":"الإجراء","tabs.selectLabel":"اختر تسمية","tabs.chooseALabel":"-- اختر تسمية --","tabs.selectedLabel":"التسمية المحددة","tabs.change":"تغيير","tabs.pleaseSelectLabel":"يرجى اختيار تسمية من القائمة المنسدلة أعلاه","tabs.areYouSureDeleteTab":"هل أنت متأكد أنك تريد حذف علامة التبويب هذه؟","tabs.tabDeletedSuccessfully":"تم حذف علامة التبويب بنجاح","tabs.cancel":"إلغاء","tabs.save":"حفظ","tabs.all":"الكل","tabs.oneToOne":"1:1","tabs.individualChats":"المحادثات الفردية فقط","tabs.groupChats":"محادثات المجموعات فقط","tabs.unread":"غير مقروء","tabs.unreadChats":"المحادثات غير المقروءة فقط","tabs.unsaved":"غير محفوظ","tabs.unsavedContacts":"جهات الاتصال غير المحفوظة فقط","templates.title":"قوالب الرسائل","templates.manageTemplates":"إدارة القوالب","templates.newTemplate":"قالب جديد","templates.editTemplate":"تحرير القالب","templates.sendTemplate":"إرسال القالب","templates.deleteTemplate":"حذف القالب","templates.duplicateTemplate":"تكرار القالب","templates.activateTemplate":"تفعيل","templates.deactivateTemplate":"إلغاء التفعيل","templates.total":"الإجمالي","templates.active":"نشط","templates.inactive":"غير نشط","templates.filterAll":"الكل","templates.filterActive":"النشطة فقط","templates.filterInactive":"غير النشطة فقط","templates.filterAllTypes":"جميع الأنواع","templates.templates":"قوالب","templates.searchPlaceholder":"البحث عن القوالب...","templates.noTemplates":"لم يتم العثور على قوالب","templates.createFirst":"قم بإنشاء القالب الأول الخاص بك","templates.edit":"تعديل","templates.copy":"نسخ","templates.msgs":"رسائل","templates.noMessageContent":"لا يوجد محتوى للرسالة","templates.form.templateName":"اسم القالب","templates.form.templateNamePlaceholder":"أدخل اسم القالب","templates.form.templateFor":"القالب لـ","templates.form.message":"الرسالة","templates.form.messagePlaceholder":"اكتب رسالتك هنا...","templates.form.insertVariable":"انقر لإدراج متغير:","templates.form.personalizeValue":"قيمة التخصيص","templates.form.personalizeValueHint":"البث إلى الأفراد المحددين بقيم مخصصة مثل @variable1، @variable2، إلخ","templates.form.templatesType":"نوع القوالب","templates.form.templateType":"نوع القالب","templates.form.templateStatus":"حالة القالب","templates.form.statusOn":"تشغيل","templates.form.statusOff":"إيقاف","templates.form.statusHint":'عندما تكون حالة القالب "تشغيل"، يكون متاحًا للاستخدام. على العكس، عندما تكون حالة القالب "إيقاف"، يكون في حالة محفوظة.',"templates.form.on":"مفعل","templates.form.off":"معطل","templates.form.save":"حفظ","templates.form.cancel":"إلغاء","templates.form.selectProducts":"اختر المنتجات","templates.form.selectContacts":"اختر جهات الاتصال","templates.form.addProduct":"إضافة منتج","templates.form.addContact":"إضافة جهة اتصال","templates.form.buttons":"أزرار","templates.form.addButton":"إضافة زر","templates.form.buttonsHint":"الحد الأقصى 3 أزرار مسموح بها","templates.form.selectFromContacts":"اختر من جهات الاتصال","templates.form.addManually":"إضافة يدوياً","templates.form.productHint":"المنتجات من كتالوج واتساب للأعمال الخاص بك","templates.form.attachImages":"إرفاق صور/فيديوهات","templates.form.attachAudio":"إرفاق صوت","templates.form.attachDocuments":"إرفاق مستندات","templates.form.chooseFile":"اختر ملف","templates.form.maxFileSize":"الحد الأقصى لحجم الملف: 16 ميجابايت (حد WhatsApp)","templates.form.uploading":"جارٍ التحميل...","templates.errors.uploadFailed":"فشل تحميل الملف. يرجى المحاولة مرة أخرى.","templates.errors.fileTooLarge":"الملف كبير جدًا. الحد الأقصى: 16 ميجابايت (حد WhatsApp).","templates.form.listButtonText":"نص الزر","templates.form.listButtonTextPlaceholder":"أدخل نص الزر","templates.form.listDescription":"الوصف","templates.form.listDescriptionPlaceholder":"أدخل الوصف","templates.form.listSections":"الأقسام","templates.form.pollQuestion":"سؤال الاستطلاع","templates.form.pollQuestionPlaceholder":"أدخل سؤال الاستطلاع","templates.form.allowMultipleAnswers":"السماح بإجابات متعددة","templates.form.allowMultipleAnswersHint":"يمكن للمستخدمين تحديد خيارات متعددة","templates.form.pollOptions":"خيارات الاستطلاع","templates.form.addOption":"+ إضافة خيار","templates.form.pollOptionsHint":"الحد الأدنى 2، الحد الأقصى 12 خياراً","templates.messageType.individual":"واحد لواحد","templates.messageType.tab":"علامة تبويب","templates.messageType.group":"مجموعة","templates.messageType.label":"تسمية","templates.messageType.kanban":"كانبان","templates.messageType.quickReply":"⚡ رد سريع","templates.attachmentType.none":"رسالة فقط","templates.attachmentType.imageVideo":"رسالة + صور/فيديوهات","templates.attachmentType.document":"رسالة + مستندات","templates.attachmentType.audio":"رسالة + صوت","templates.attachmentType.contact":"رسالة + جهات اتصال","templates.attachmentType.poll":"رسالة + استطلاع","templates.attachmentType.list":"رسالة + قائمة","templates.attachmentType.product":"رسالة + منتجات","templates.attachmentType.buttons":"رسالة + أزرار","crm.button":"إدارة العملاء","crm.openCRM":"فتح إدارة العملاء","crm.profile":"الملف الشخصي","crm.tabs":"علامات التبويب","crm.notes":"ملاحظات","crm.reminder":"تذكير","crm.appointment":"موعد","crm.income":"الدخل","crm.expense":"المصروفات","crm.scheduleTab":"جدولة","crm.deletedMessagesTab":"الرسائل المحذوفة","crm.antiRevokeEnabled":"ميزة منع الحذف مُفعّلة","crm.antiRevokeDisabled":"ميزة منع الحذف مُعطّلة","crm.antiRevokeDescription":"يحفظ نسخًا محليّة من الرسائل الواردة لتستطيع قراءتها حتى لو قام المرسل بحذفها.","crm.antiRevokeNotEnabledHint":"فعّل ميزة منع الحذف أعلاه لبدء حفظ الرسائل الواردة.","crm.noDeletedMessages":"لا توجد رسائل محذوفة مستردّة بعد. نحن نراقب — إذا حذف أحدهم رسالة سنحتفظ بنسخة هنا.","crm.onlyThisContact":"هذا الشخص فقط","crm.allContacts":"كل الأشخاص","crm.clearHistory":"مسح السجل","crm.exportCSV":"تصدير CSV","crm.revokedAt":"تاريخ الحذف","crm.copyMessage":"نسخ","crm.lionRecovered":"استرجع {brand}","crm.clickToShowOriginal":"انقر لعرض الرسالة الأصلية","crm.antiRevokeChatTip":"نصيحة: يمكنك أيضًا النقر على أيقونة الاسترجاع مباشرةً على الرسالة المحذوفة داخل المحادثة لعرضها بسرعة.","crm.searchMessages":"ابحث في الرسائل…","crm.recoveredCount":"{count} رسالة مُستردّة","crm.confirmClearChatHistory":"هل تريد مسح الرسائل المستردّة لهذا الشخص؟","crm.confirmClearAllHistory":"هل تريد مسح كل الرسائل المستردّة من جميع المحادثات؟","crm.noTextContent":"(بدون نص — رسالة وسائط)","crm.group":"مجموعة","crm.enable":"تفعيل","crm.disable":"تعطيل","crm.addScheduleMessage":"إضافة جدولة","crm.noScheduledMessages":"لا توجد رسائل مجدولة","crm.noScheduledMessagesDesc":"جدولة رسائل لهذا الاتصال.","crm.userDetails":"تفاصيل المستخدم","crm.addCustomAttribute":"+ إضافة سمة","crm.edit":"تعديل","crm.cancel":"إلغاء","crm.save":"حفظ","crm.signature":"التوقيع","crm.signatureDesc":"أدخل اسمك لإرسال رسائل موقعة أو لإظهار أنك في الخدمة في الدردشة المحددة للوكلاء الآخرين.","crm.enterYourName":"أدخل اسمك","crm.activateSignature":"تفعيل التوقيع","crm.signatureAs":"التوقيع باسم","crm.signatureNotSet":"قم بتعيين اسم التوقيع الخاص بك في إعدادات إضافة واتساب ويب.","crm.delete":"حذف","crm.deleteConnection":"حذف الاتصال؟","crm.deleteConnectionConfirm":"هل أنت متأكد من أنك تريد حذف هذا الاتصال بين العقد؟","crm.fullName":"الاسم الكامل","crm.phoneNumber":"رقم الهاتف","crm.email":"البريد الإلكتروني","crm.gender":"الجنس","crm.dateOfBirth":"تاريخ الميلاد","crm.details":"التفاصيل","crm.address":"العنوان","crm.language":"اللغة","crm.male":"ذكر","crm.female":"أنثى","crm.other":"آخر","crm.select":"- اختر -","crm.customAttributes":"السمات المخصصة","crm.addField":"إضافة حقل","crm.fieldLabel":"تسمية الحقل","crm.fieldValue":"قيمة الحقل","crm.noCustomFields":"لا توجد حقول مخصصة","crm.deleteFieldConfirm":"هل أنت متأكد من حذف هذا الحقل؟","crm.contactTabs":"علامات تبويب جهة الاتصال","crm.addToTab":"إضافة إلى علامة تبويب","crm.removeFromTab":"إزالة من علامة التبويب","crm.noTabs":"لا توجد علامات تبويب","crm.createTab":"إنشاء علامة تبويب","crm.tabName":"اسم علامة التبويب","crm.contacts":"جهات اتصال","crm.addToLabel":"إضافة إلى التسمية","crm.selectLabel":"اختر التسمية","crm.noLabelsAvailable":"لا توجد تسميات. أنشئ علامة تبويب أولاً.","crm.labelsAndStages":"التسميات والمراحل","crm.whatsappLabels":"تسميات واتساب","crm.customTabs":"علامات تبويب مخصصة","team.button":"الفريق","team.shareWith":"مشاركة مع الفريق","team.settings":"إعدادات الفريق","team.addMember":"إضافة عضو","team.editMember":"تعديل العضو","team.deleteMember":"حذف","team.memberName":"اسم العضو","team.memberPhone":"رقم الهاتف","team.department":"القسم","team.departmentPlaceholder":"مثال: المبيعات، المالية، الدعم","team.template":"قالب الرسالة","team.templatePlaceholder":"أدخل الرسالة مع المتغيرات...","team.noMembers":"لا يوجد أعضاء مُعدّين","team.clickToAdd":"انقر على + لإضافة أعضاء","team.sending":"جاري الإرسال...","team.insertVariable":"إدراج متغير","team.preview":"معاينة الرسالة","team.deleteConfirm":"هل أنت متأكد من حذف هذا العضو؟","team.phonePlaceholder":"مثال: +5511999999999","team.namePlaceholder":"مثال: مدير المبيعات - أحمد","team.variableHint":"استخدم {{name}}، {{phone}}، {{labels}} للمحتوى الديناميكي","team.save":"حفظ","team.cancel":"إلغاء","team.editTemplate":"تعديل القالب","team.saveAndSend":"حفظ وإرسال","team.sendOnce":"إرسال مرة واحدة","team.send":"إرسال","team.selectContact":"اختر جهة اتصال","team.clickToSelectContact":"انقر لاختيار جهة اتصال من واتساب","team.searchContact":"بحث في جهات الاتصال...","team.loadingContacts":"جاري تحميل جهات الاتصال...","team.noContactsFound":"لم يتم العثور على جهات اتصال","team.noSearchResults":"لا توجد نتائج","team.phoneHint":"أدخل الرقم مع رمز البلد أو انقر على الأيقونة للاختيار","team.popupTitle":"مشاركة مع الفريق","team.popupSubtitle":"إرسال تفاصيل الاتصال فوراً","team.noTeamMembers":"لا يوجد أعضاء","team.noTeamMembersDesc":"أضف أعضاء الفريق لمشاركة تفاصيل الاتصال بسرعة عبر واتساب","crm.addNote":"+ إضافة ملاحظة","crm.searchNotes":"بحث في الملاحظات...","crm.noNotes":"لا توجد ملاحظات","crm.addFirstNote":"أضف ملاحظتك الأولى","crm.topic":"الموضوع","crm.content":"المحتوى","crm.editNote":"تعديل الملاحظة","crm.deleteNote":"حذف الملاحظة","crm.deleteNoteConfirm":"هل أنت متأكد من حذف هذه الملاحظة؟","crm.addReminder":"+ إضافة تذكير","crm.noReminders":"لا توجد تذكيرات","crm.addFirstReminder":"أضف تذكيرك الأول","crm.reminderTopic":"موضوع التذكير","crm.dateTime":"التاريخ والوقت","crm.repeatInterval":"فترة التكرار","crm.noRepeat":"بدون تكرار","crm.every5Min":"كل 5 دقائق","crm.every10Min":"كل 10 دقائق","crm.every15Min":"كل 15 دقيقة","crm.every30Min":"كل 30 دقيقة","crm.every1Hour":"كل ساعة","crm.status":"الحالة","crm.pending":"قيد الانتظار","crm.completed":"مكتمل","crm.dismissed":"تم تجاهله","crm.stopped":"متوقف","crm.snoozed":"مؤجل","crm.due":"مستحق","crm.editReminder":"تعديل التذكير","crm.deleteReminder":"حذف التذكير","crm.markComplete":"تحديد كمكتمل","crm.snooze":"تأجيل","crm.stop":"إيقاف","crm.addAppointment":"+ إضافة موعد","crm.noAppointments":"لا توجد مواعيد","crm.addFirstAppointment":"أضف موعدك الأول","crm.appointmentTitle":"عنوان الموعد","crm.attendee":"الحضور","crm.googleMeetLink":"رابط Google Meet","crm.generateLink":"إنشاء رابط","crm.messageTemplate":"قالب الرسالة","crm.reminderBefore":"تذكير قبل","crm.sendMessageNow":"إرسال الرسالة الآن","crm.scheduled":"مجدول","crm.cancelled":"ملغي","crm.missed":"فائت","crm.editAppointment":"تعديل الموعد","crm.deleteAppointment":"حذف الموعد","crm.joinMeeting":"الانضمام للاجتماع","crm.before5Min":"قبل 5 دقائق","crm.before10Min":"قبل 10 دقائق","crm.before15Min":"قبل 15 دقيقة","crm.before30Min":"قبل 30 دقيقة","crm.before1Hour":"قبل ساعة","crm.before2Hours":"قبل ساعتين","crm.before1Day":"قبل يوم","crm.titleLabel":"العنوان","crm.scheduleDateTime":"جدولة التاريخ والوقت","crm.pasteGoogleMeetLink":"الصق رابط Google Meet هنا","crm.generateLinkHint":"انقر على 'إنشاء رابط' لفتح Google Meet، ثم الصق رابط الاجتماع هنا","crm.chooseTemplate":"اختر قالب","crm.selectTemplate":"-- اختر قالب --","crm.messageTemplatePlaceholder":"أدخل قالب الرسالة...","crm.useSameMessage":"استخدم نفس الرسالة عند بدء الاجتماع","crm.meetingStartMessageLabel":"رسالة بدء الاجتماع","crm.meetingStartPlaceholder":"أدخل الرسالة لإرسالها عند بدء الاجتماع...","crm.meetingStartHint":"سيتم إرسال هذه الرسالة عندما يبدأ الاجتماع فعلياً.","crm.sendReminderLabel":"إرسال تذكير","crm.reminderTimeHint":"سيتم إرسال الرسالة للحاضرين في هذا الوقت قبل الاجتماع. ستتلقى أيضاً إشعاراً صوتياً.","crm.sendMessageNowTo":"إرسال الرسالة الآن إلى","crm.sendNowHint":"حدد هذا لإرسال رسالة الموعد فوراً بعد الحفظ","crm.discard":"تجاهل","crm.saveAndSend":"حفظ وإرسال","crm.sending":"جارٍ الإرسال...","crm.noAppointmentsFound":"لم يتم العثور على مواعيد","crm.searchAppointments":"البحث في المواعيد","crm.productDemoCall":"مثال، مكالمة عرض المنتج","crm.reminderMessageHint":"سيتم إرسال هذه الرسالة في وقت التذكير (قبل الاجتماع).","crm.joinMeet":"الانضمام للاجتماع","crm.appointmentTemplates":"قوالب المواعيد","crm.savedTemplates":"القوالب المحفوظة","crm.noTemplatesYet":"لا توجد قوالب بعد. أنشئ قالبك الأول!","crm.newTemplate":"+ قالب جديد","crm.editTemplateTitle":"تعديل القالب","crm.newTemplateTitle":"قالب جديد","crm.templateName":"اسم القالب","crm.templateNamePlaceholder":"مثال، تذكير بالاجتماع","crm.meetLinkOptional":"رابط Google Meet (اختياري)","crm.updateTemplate":"تحديث القالب","crm.saveTemplate":"حفظ القالب","crm.pleaseEnterTitle":"الرجاء إدخال عنوان","crm.pleaseSelectFutureDate":"الرجاء اختيار تاريخ ووقت مستقبلي","crm.deleteAppointmentConfirm":"هل أنت متأكد من حذف هذا الموعد؟","crm.pleaseEnterTemplateName":"الرجاء إدخال اسم القالب","crm.pleaseEnterMessageTemplate":"الرجاء إدخال قالب الرسالة","crm.deleteTemplateConfirm":"هل أنت متأكد من حذف هذا القالب؟","crm.addIncome":"+ إضافة دخل","crm.totalIncome":"إجمالي الدخل","crm.pendingIncome":"قيد الانتظار","crm.filteredTotal":"الإجمالي المفلتر","crm.noIncome":"لا توجد سجلات دخل","crm.addFirstIncome":"أضف أول دخل لك","crm.amount":"المبلغ","crm.category":"الفئة","crm.paymentMethod":"طريقة الدفع","crm.description":"الوصف","crm.reference":"المرجع","crm.date":"التاريخ","crm.paymentReceived":"تم استلام الدفع","crm.sale":"بيع","crm.serviceFee":"رسوم الخدمة","crm.commission":"عمولة","crm.refundReceived":"تم استلام الاسترداد","crm.cash":"نقدي","crm.bankTransfer":"تحويل بنكي","crm.upi":"UPI","crm.pix":"PIX","crm.card":"بطاقة","crm.cheque":"شيك","crm.addCustomPaymentMethod":"إضافة طريقة مخصصة","crm.editIncome":"تعديل الدخل","crm.deleteIncome":"حذف الدخل","crm.addExpense":"+ إضافة مصروف","crm.totalExpense":"إجمالي المصروفات","crm.pendingExpense":"قيد الانتظار","crm.noExpense":"لا توجد سجلات مصروفات","crm.addFirstExpense":"أضف أول مصروف لك","crm.purchase":"شراء","crm.serviceCost":"تكلفة الخدمة","crm.travel":"سفر","crm.marketing":"تسويق","crm.commissionPaid":"عمولة مدفوعة","crm.refundGiven":"استرداد مقدم","crm.editExpense":"تعديل المصروف","crm.deleteExpense":"حذف المصروف","crm.search":"بحث...","crm.all":"الكل","crm.today":"اليوم","crm.thisWeek":"هذا الأسبوع","crm.thisMonth":"هذا الشهر","crm.thisYear":"هذا العام","crm.filterByCategory":"تصفية حسب الفئة","crm.filterByStatus":"تصفية حسب الحالة","crm.filterByDate":"تصفية حسب التاريخ","crm.allStatus":"كل الحالات","crm.allCategories":"كل الفئات","crm.none":"لا شيء","crm.ref":"المرجع","crm.tableTabName":"اسم التبويب","crm.tableContactsInTab":"جهات الاتصال في التبويب","crm.tableAction":"إجراء","crm.tableName":"الاسم","crm.tableModifiedDate":"تاريخ التعديل","crm.tableTopic":"الموضوع","crm.tableReminderDate":"تاريخ التذكير","crm.tableRepeatSnooze":"تكرار/تأجيل","crm.tableStatus":"الحالة","crm.tableTitle":"العنوان","crm.tableDateTime":"التاريخ والوقت","crm.tableAttendee":"المشارك","crm.tableMeetLink":"رابط الاجتماع","crm.tableDescription":"الوصف","crm.tableCategory":"الفئة","crm.tableAmount":"المبلغ","crm.tablePayment":"الدفع","crm.tableDate":"التاريخ","crm.addIncomeTitle":"إضافة دخل","crm.editIncomeTitle":"تعديل الدخل","crm.addExpenseTitle":"إضافة مصروف","crm.editExpenseTitle":"تعديل المصروف","crm.enterAmount":"أدخل المبلغ","crm.validAmountRequired":"يرجى إدخال مبلغ صالح","crm.descriptionRequired":"يرجى إدخال الوصف","crm.referenceInvoice":"المرجع / رقم الفاتورة","crm.referenceBill":"المرجع / رقم الإيصال","crm.invoicePlaceholder":"مثال: INV-001","crm.billPlaceholder":"مثال: BILL-001","crm.paymentDescription":"مثال: دفع مقابل الخدمات","crm.expenseDescription":"مثال: لوازم مكتبية","crm.update":"تحديث","crm.addIncomeBtn":"إضافة دخل","crm.addExpenseBtn":"إضافة مصروف","crm.recurringTransaction":"معاملة متكررة","crm.repeatEvery":"تكرار كل","crm.neverEnds":"بدون نهاية","crm.endDate":"تاريخ الانتهاء","crm.daily":"يومي","crm.weekly":"أسبوعي","crm.monthly":"شهري","crm.quarterly":"ربع سنوي (3 أشهر)","crm.yearly":"سنوي","crm.currencySettings":"إعدادات العملة","crm.searchCurrency":"بحث عن عملة...","crm.noCurrenciesFound":"لم يتم العثور على عملات","crm.noIncomeRecords":"لا توجد سجلات دخل","crm.noExpenseRecords":"لا توجد سجلات مصروفات","crm.deleteIncomeConfirm":"هل أنت متأكد من حذف سجل الدخل هذا؟","crm.deleteExpenseConfirm":"هل أنت متأكد من حذف سجل المصروف هذا؟","crm.addCategory":"إضافة فئة","crm.categoryName":"اسم الفئة","crm.enterCategoryName":"أدخل اسم الفئة","crm.customCategories":"فئات مخصصة","crm.addCustomCategory":"إضافة فئة مخصصة","crm.existingCustomCategories":"الفئات المخصصة الموجودة","crm.addStatus":"إضافة حالة","crm.statusName":"اسم الحالة","crm.enterStatusName":"أدخل اسم الحالة","crm.customStatuses":"حالات مخصصة","crm.addCustomStatus":"إضافة حالة مخصصة","crm.existingCustomStatuses":"الحالات المخصصة الموجودة","crm.add":"إضافة","crm.loading":"جاري التحميل...","crm.dismiss":"تجاهل","crm.yesterday":"أمس","agent.agentMode":"وضع الوكيل","agent.identifyAsAgent":"التعريف كوكيل","agent.agentName":"اسم الوكيل","agent.namePlaceholder":"مثال: أحمد، فريق الدعم 1","agent.agentNamePlaceholder":"أدخل اسم الوكيل الخاص بك","agent.viewTransferHistory":"عرض سجل التحويلات","agent.transferToAgent":"تحويل إلى وكيل","agent.transferSuccess":"تم تحويل المحادثة بنجاح","agent.noAgentsOnline":"لا يوجد وكلاء متاحين عبر الإنترنت","agent.selectAgent":"اختر وكيل","agent.chooseAgent":"-- اختر وكيلاً --","agent.reason":"السبب","agent.reasonPlaceholder":"لماذا تقوم بتحويل هذه المحادثة؟","agent.priority":"الأولوية","agent.priorityLow":"منخفضة","agent.priorityMedium":"متوسطة","agent.priorityHigh":"عالية","agent.priorityUrgent":"عاجلة","agent.transfer":"تحويل","agent.incomingTransfer":"تحويل وارد","agent.fromAgent":"من الوكيل","agent.toAgent":"إلى الوكيل","agent.chat":"محادثة","agent.startService":"بدء الخدمة","agent.endService":"إنهاء الخدمة","agent.activeService":"خدمة نشطة","agent.from":"من","agent.to":"إلى","agent.duration":"المدة","agent.transferHistory":"سجل التحويلات","agent.sent":"المرسلة","agent.received":"المستلمة","agent.status":"الحالة","agent.all":"الكل","agent.statusPending":"قيد الانتظار","agent.statusAccepted":"مقبول","agent.statusInService":"في الخدمة","agent.statusCompleted":"مكتمل","agent.statusDeclined":"مرفوض","agent.statusExpired":"منتهي الصلاحية","agent.noTransfers":"لم يتم العثور على تحويلات","agent.serviceQueue":"قائمة انتظار الخدمة","agent.pendingTransfers":"التحويلات المعلقة","agent.activeServices":"الخدمات النشطة","agent.sentTransfers":"التحويلات المرسلة","agent.noActiveServices":"لا توجد خدمات نشطة أو تحويلات معلقة","agent.serviceEnded":"تم إنهاء الخدمة بنجاح","agent.accept":"قبول","agent.decline":"رفض","agent.notRegistered":"الوكيل غير مسجل. يرجى تفعيل وضع الوكيل أولاً.","agent.statusCancelled":"ملغي","agent.started":"بدأ","chatTools.suggest":"اقتراح","chatTools.spelling":"إملاء","chatTools.translate":"ترجمة","chatTools.summarize":"تلخيص","chatTools.enlarge":"توسيع","chatTools.friendly":"ودي","chatTools.formal":"رسمي","chatTools.send":"إرسال","chatTools.copy":"نسخ","chatTools.use":"استخدام","chatTools.aiResult":"نتيجة الذكاء الاصطناعي","chatTools.suggestTitle":"اقتراح الذكاء الاصطناعي","chatTools.spellingTitle":"تصحيح الإملاء والقواعد","chatTools.translateTitle":"ترجمة إلى","chatTools.summarizeTitle":"تلخيص النص","chatTools.enlargeTitle":"توسيع النص","chatTools.friendlyTitle":"اجعله ودياً","chatTools.formalTitle":"اجعله رسمياً","chatTools.conversationSummary":"ملخص المحادثة","chatTools.conversationSummaryTitle":"تلخيص هذه المحادثة","chatTools.conversationSummarizing":"جارٍ تلخيص المحادثة…","chatTools.conversationSummaryEmpty":"لا توجد رسائل لتلخيصها في هذه المحادثة","chatTools.conversationSummaryNoChat":"افتح محادثة لتلخيصها","chatTools.conversationSummaryFailed":"تعذّر جلب رسائل المحادثة","chatTools.conversationSummaryResultTitle":"ملخص المحادثة","chatTools.sendTitle":"إرسال الرسالة","chatTools.selectTextFirst":"حدد النص أولاً أو اكتب في مربع الإدخال","chatTools.searchLanguage":"البحث عن لغة...","aiSettings.title":"إدخال مفتاح API للذكاء الاصطناعي","aiSettings.platformType":"نوع منصة الذكاء الاصطناعي","aiSettings.geminiAI":"GEMINI AI","aiSettings.chatgpt":"CHATGPT","aiSettings.deepseek":"DEEPSEEK","aiSettings.apiKey":"مفتاح API للذكاء الاصطناعي","aiSettings.enterApiKey":"يرجى إدخال مفتاح API للذكاء الاصطناعي","aiSettings.validate":"تحقق","aiSettings.validKey":"مفتاح API صالح!","aiSettings.invalidKey":"مفتاح API غير صالح. يرجى التحقق والمحاولة مرة أخرى.","aiSettings.note":"ملاحظة:","aiSettings.geminiNote":"احصل على مفتاح Gemini API من Google AI Studio (aistudio.google.com)","aiSettings.chatgptNote":"احصل على مفتاح OpenAI API من platform.openai.com/api-keys","aiSettings.deepseekNote":"احصل على مفتاح DeepSeek API من platform.deepseek.com","aiSettings.enableAITools":"تمكين أدوات الذكاء الاصطناعي","aiSettings.close":"إغلاق","aiSettings.save":"حفظ","aiSettings.configureAI":"قم بتكوين مزود الذكاء الاصطناعي ومفتاح API للميزات المدعومة بالذكاء الاصطناعي","settings.title":"الإعدادات","settings.yourLanguage":"لغتك","settings.selectLanguage":"اختر اللغة","settings.chooseLanguage":"اختر لغتك المفضلة لواجهة الإضافة","settings.whatLanguageSpeak":"ما هي اللغة التي تتحدثها","settings.translateMessages":"ترجمة الرسائل الواردة","settings.selectSpokenLanguage":"اختر لغتك","settings.spokenLanguageHint":"سيتم ترجمة الرسائل إلى هذه اللغة عند النقر على أيقونة الترجمة في الرسائل الواردة.","settings.blurSettings":"إعدادات التمويه","settings.blurDescription":"تمويه المعلومات الخاصة من الشاشة.","settings.blurMessages":"تمويه الرسائل","settings.blurProfileNames":"تمويه أسماء الملفات الشخصية","settings.blurDisplayPhotos":"تمويه صور الملفات الشخصية","settings.blurConversation":"تمويه المحادثة","settings.displayOnHover":"عرض المحادثة عند التمرير","settings.theme":"المظهر","settings.themeDescription":"اختر نظام الألوان المفضل لديك","settings.lightMode":"الوضع الفاتح","settings.lightModeDesc":"المظهر الفاتح الكلاسيكي","settings.darkMode":"الوضع الداكن","settings.darkModeDesc":"مريح للعين في الإضاءة المنخفضة","settings.systemMode":"النظام","settings.systemModeHint":"يتبع مظهر واتساب","settings.currentTheme":"المظهر الحالي","signature.title":"التوقيع","signature.enableSignature":"تفعيل التوقيع","signature.yourSignature":"توقيعك","signature.placeholder":"مثال، - محمد أحمد","signature.preview":"معاينة","signature.save":"حفظ","backup.title":"النسخ الاحتياطي والاستعادة","backup.export":"تصدير","backup.import":"استيراد","backup.importHint":"قم بتحميل ملف JSON للنسخ الاحتياطي من {brand} لاستعادة بياناتك. يمكنك تحديد الميزات التي تريد استيرادها.","backup.kanbanCRM":"بيانات Kanban CRM","backup.customTabs":"علامات التبويب المخصصة","backup.templatesQuickReplies":"القوالب والردود السريعة","backup.broadcastHistory":"سجل البث","backup.settings":"الإعدادات","backup.crmProfileData":"بيانات ملف CRM","backup.calendarData":"التقويم (التذكيرات والمواعيد)","backup.statusData":"الحالة","backup.webhookSettings":"إعدادات Webhook","backup.aiBotSettings":"إعدادات روبوت الذكاء الاصطناعي","backup.aiApiSettings":"إعدادات API الذكاء الاصطناعي","backup.spokenLanguage":"اللغة المنطوقة","backup.chatbotFlows":"تدفقات الشات بوت (Fluxo)","backup.followupData":"تسلسلات المتابعة","backup.scheduledMessages":"الرسائل المجدولة","backup.scheduledBroadcasts":"البث المجدول","backup.fluxoAdvanced":"إعدادات Fluxo المتقدمة","backup.conversationStates":"حالات المحادثة","backup.bulkValidatorData":"بيانات التحقق الجماعي","backup.quickReplies":"الردود السريعة","backup.crmTodos":"قوائم مهام CRM","backup.signatureSettings":"إعدادات التوقيع","backup.teamSettings":"إعدادات الفريق","backup.blurSettings":"إعدادات التمويه","backup.featureVisibility":"رؤية الميزات","backup.themeSettings":"إعدادات السمة","backup.uiStateSettings":"إعدادات حالة الواجهة","backup.apiPollingSettings":"إعدادات استطلاع API","backup.agentSettings":"إعدادات الوكيل","backup.autoBackup":"النسخ الاحتياطي التلقائي","backup.autoBackupInfo":"سيتم إنشاء نسخة احتياطية تلقائية عند تحميل WhatsApp Web في تاريخ جديد","backup.autoBackupDestination":"وجهة النسخ الاحتياطي","backup.autoBackupWhatsApp":"إرسال إلى رسائل WhatsApp المحفوظة","backup.autoBackupDownload":"تنزيل إلى الكمبيوتر","backup.exportNow":"تصدير الآن","backup.importNow":"استيراد الآن","backup.selectFile":"اختر ملف النسخ الاحتياطي للاستيراد","backup.importSuccess":"تم استيراد البيانات بنجاح!","backup.importError":"خطأ في استيراد البيانات. يرجى التحقق من تنسيق الملف.","backup.exportSuccess":"تم تصدير البيانات بنجاح!","backup.noDataSelected":"يرجى تحديد نوع بيانات واحد على الأقل للتصدير/الاستيراد","backup.cheetahDetected":"تم اكتشاف Cheetah CRM","backup.fileLoaded":"تم تحميل الملف بنجاح","backup.cheetahImportDesc":"تحتوي هذه النسخة الاحتياطية على بيانات Cheetah CRM. سيتم استيراد جميع الميزات المتوافقة ودمجها مع بيانات CRM الموجودة لديك.","backup.dataToImport":"البيانات المراد استيرادها:","backup.mergeWarning":"مهم:","backup.mergeWarningDesc":"سيتم دمج البيانات مع بيانات CRM الموجودة. لن يتم الكتابة فوق بياناتك الحالية - سيتم إضافة البيانات الجديدة فقط.","backup.importing":"جاري الاستيراد...","backup.importCheetah":"استيراد نسخة Cheetah CRM الاحتياطية","missedSchedule.title":"تم تفويت الحملة المجدولة","missedSchedule.description":"تم تفويت حملة مجدولة لأن WhatsApp Web لم يكن مفتوحاً في الوقت المحدد.","missedSchedule.sendNow":"أرسل الآن","missedSchedule.cancelDiscard":"إلغاء وتجاهل","missedSchedule.dismiss":"تذكير لاحقاً","calendar.title":"التقويم","calendar.goToToday":"الذهاب إلى اليوم","calendar.reminders":"التذكيرات","calendar.appointments":"المواعيد","calendar.remindersFor":"تذكيرات لـ","calendar.appointmentsFor":"مواعيد لـ","calendar.noReminders":"لا توجد تذكيرات لهذا التاريخ","calendar.noAppointments":"لا توجد مواعيد لهذا التاريخ","calendar.selectDate":"اختر تاريخاً مع تذكيرات أو مواعيد لعرض التفاصيل","calendar.deleteReminder":"حذف التذكير","calendar.deleteAppointment":"حذف الموعد","calendar.confirmDeleteReminder":"هل أنت متأكد من حذف هذا التذكير؟","calendar.confirmDeleteAppointment":"هل أنت متأكد من حذف هذا الموعد؟","calendar.everyMin":"كل {min} دقيقة","calendar.everyHour":"كل ساعة","calendar.weekdays.sun":"أحد","calendar.weekdays.mon":"إثن","calendar.weekdays.tue":"ثلا","calendar.weekdays.wed":"أرب","calendar.weekdays.thu":"خمي","calendar.weekdays.fri":"جمع","calendar.weekdays.sat":"سبت","calendar.months.january":"يناير","calendar.months.february":"فبراير","calendar.months.march":"مارس","calendar.months.april":"أبريل","calendar.months.may":"مايو","calendar.months.june":"يونيو","calendar.months.july":"يوليو","calendar.months.august":"أغسطس","calendar.months.september":"سبتمبر","calendar.months.october":"أكتوبر","calendar.months.november":"نوفمبر","calendar.months.december":"ديسمبر","calendar.status.pending":"قيد الانتظار","calendar.status.completed":"مكتمل","calendar.status.dismissed":"مرفوض","calendar.status.snoozed":"مؤجل","calendar.status.stopped":"متوقف","calendar.status.scheduled":"مجدول","calendar.status.cancelled":"ملغي","calendar.status.missed":"فائت","calendar.todos":"المهام","calendar.todosFor":"المهام لـ","calendar.noTodos":"لم يتم العثور على مهام","calendar.addTodo":"إضافة مهمة","calendar.editTodo":"تعديل المهمة","calendar.deleteTodo":"حذف المهمة","calendar.confirmDeleteTodo":"هل أنت متأكد أنك تريد حذف هذه المهمة؟","todo.title":"العنوان","todo.titlePlaceholder":"أدخل عنوان المهمة","todo.description":"الوصف","todo.descriptionPlaceholder":"إضافة تفاصيل (اختياري)","todo.dueDate":"تاريخ الاستحقاق","todo.dueTime":"وقت الاستحقاق","todo.priority":"الأولوية","todo.priorityHigh":"عالية","todo.priorityMedium":"متوسطة","todo.priorityLow":"منخفضة","todo.category":"الفئة","todo.noCategory":"بدون فئة","todo.categoryWork":"العمل","todo.categoryPersonal":"شخصي","todo.categoryUrgent":"عاجل","todo.categoryShopping":"تسوق","todo.categoryHealth":"الصحة","todo.subtasks":"المهام الفرعية","todo.addSubtask":"إضافة","todo.subtaskPlaceholder":"أدخل مهمة فرعية","todo.recurring":"متكرر","todo.repeatEvery":"تكرار","todo.endDate":"تاريخ الانتهاء","todo.recurringDaily":"يومياً","todo.recurringWeekly":"أسبوعياً","todo.recurringMonthly":"شهرياً","todo.recurringYearly":"سنوياً","todo.reminder":"تذكير","todo.reminderDate":"تاريخ التذكير","todo.reminderTime":"وقت التذكير","todo.browserNotification":"إشعار المتصفح","todo.whatsappSelfMessage":"إرسال تذكير واتساب لنفسي","todo.whatsappSelfMessageHint":"ستتلقى رسالة واتساب عند موعد المهمة","todo.save":"حفظ المهمة","todo.update":"تحديث المهمة","todo.cancel":"إلغاء","todo.addTodo":"إضافة مهمة","todo.editTodo":"تعديل المهمة","todo.statusPending":"قيد الانتظار","todo.statusInProgress":"قيد التنفيذ","todo.statusCompleted":"مكتمل","todo.statusCancelled":"ملغي","todo.filterAll":"جميع المهام","todo.filterToday":"اليوم","todo.filterThisWeek":"هذا الأسبوع","todo.filterOverdue":"متأخرة","todo.filterCompleted":"مكتملة","todo.today":"اليوم","todo.tomorrow":"غداً","todo.overdue":"متأخر","todo.snoozeTime":"وقت التأجيل","todo.minutes":"دقائق","todo.hour":"ساعة","todo.hours":"ساعات","todo.day":"يوم","todo.taskReminder":"تذكير المهمة","todo.highPriority":"أولوية عالية","todo.mediumPriority":"أولوية متوسطة","todo.lowPriority":"أولوية منخفضة","todo.subtasksCount":"مهام فرعية","todo.snooze":"تأجيل","todo.markDone":"تعليم كمكتمل","todo.dismiss":"تجاهل","todo.task":"مهمة","todo.changeColor":"انقر لتغيير اللون","todo.selectCategoryFirst":"اختر فئة أولاً","todo.linkedContacts":"جهات الاتصال المرتبطة","todo.optional":"اختياري","todo.selectContacts":"اختر جهات الاتصال","todo.searchContacts":"البحث عن جهات الاتصال...","todo.noContactsFound":"لم يتم العثور على جهات اتصال","todo.selected":"محدد","todo.contacts":"جهات الاتصال","status.title":"الحالة","status.activeStatus":"الحالة النشطة","status.createStatus":"إنشاء حالة","status.loading":"جاري تحميل الحالات...","status.noStatusFound":"لم يتم العثور على حالة","status.noStatusDescription":"يبدو أنك لم تنشئ أي حالة بعد. انقر على الزر أدناه لإضافة حالة جديدة.","status.add":"إضافة","status.statusName":"اسم الحالة (اختياري)","status.statusNamePlaceholder":"إنشاء اسم للحالة","status.chooseType":"اختر نوعاً","status.type.text":"نص","status.type.image":"صورة","status.type.video":"فيديو","status.type.audio":"صوت","status.typeText":"اكتب النص","status.backgroundColor":"اختر لون الخلفية","status.clickToChange":"انقر للتغيير","status.import":"استيراد","status.dragHere":"اسحب الملف هنا","status.scheduleStatus":"جدولة الحالة","status.autoRepost24h":"إعادة نشر الحالة كل 24 ساعة","status.autoRepost":"إعادة نشر تلقائي","status.postNow":"نشر الآن","status.posting":"جاري النشر...","status.create":"إنشاء","status.delete":"حذف","status.emoji":"رمز تعبيري","status.status.pending":"قيد الانتظار","status.status.posted":"تم النشر","status.status.scheduled":"مجدول","status.status.failed":"فشل","status.caption":"التسمية التوضيحية","status.captionPlaceholder":"إضافة تسمية توضيحية...","status.edit":"تحرير","ai.regenerate":"إعادة إنشاء","ai.regenerating":"جاري إعادة الإنشاء...","ai.regenerateWithAI":"إعادة الإنشاء بالذكاء الاصطناعي","ai.notEnabled":"الذكاء الاصطناعي غير مفعل. يرجى تكوين إعدادات الذكاء الاصطناعي.","ai.failedToRegenerate":"فشل إعادة الإنشاء","ai.failedToRegenerateMessage":"فشل إعادة إنشاء الرسالة","broadcast.title":"رسائل جماعية","broadcast.newCampaign":"حملة جديدة","broadcast.reports":"التقارير","broadcast.close":"إغلاق","broadcast.sending":"جاري الإرسال...","broadcast.paused":"متوقف مؤقتاً","broadcast.completed":"مكتمل","broadcast.clearHistory":"مسح السجل","broadcast.createCampaign":"إنشاء حملة","broadcast.createCampaignSubtitle":"إرسال رسائل مخصصة لعدة جهات اتصال","broadcast.scheduledCampaigns":"الحملات المجدولة","broadcast.campaignReports":"تقارير الحملة","broadcast.viewManageCampaigns":"عرض وإدارة حملاتك","broadcast.recipients":"المستلمون","broadcast.selected":"محدد","broadcast.contacts":"جهات الاتصال","broadcast.groups":"المجموعات","broadcast.phone":"الهاتف","broadcast.phonePlaceholder":"أرقام الهاتف مع رمز البلد","broadcast.clearAll":"مسح الكل","broadcast.contactsUploaded":"جهات اتصال تم رفعها","broadcast.noGroupsSelected":'لم يتم تحديد مجموعات. انقر على "إضافة مجموعات" للتحديد.',"broadcast.addGroups":"إضافة مجموعات","broadcast.groupsSelected":"مجموعة محددة","broadcast.upload":"رفع","broadcast.select":"تحديد","broadcast.download":"تحميل","broadcast.groupsContacts":"جهات اتصال المجموعة","broadcast.tabsContacts":"جهات اتصال التبويب","broadcast.kanbanBoard":"لوحة كانبان","broadcast.labelsContacts":"جهات اتصال التصنيف","broadcast.allowRepeat":"السماح بالأرقام المكررة","broadcast.enableLinkPreview":"تفعيل معاينة الرابط","broadcast.groupActions":"إجراءات المجموعة","broadcast.customTabActions":"إجراءات التبويب المخصص","broadcast.labelsActions":"إجراءات التصنيفات","broadcast.kanbanBoardActions":"إجراءات لوحة كانبان","broadcast.skipBulkMessage":"تخطي الرسائل الجماعية","broadcast.skipBulkMessageInfo":"سيتم تخطي إرسال الرسائل. سيتم تنفيذ الإجراءات فقط (المجموعات، التبويبات، التصنيفات، كانبان) على جهات الاتصال.","broadcast.appendSignature":"إضافة التوقيع","broadcast.signaturePreview":"معاينة","broadcast.groupActionsNote":"ملاحظة: يجب أن تكون مسؤولاً عن المجموعات لتنفيذ الإجراءات أدناه.","broadcast.addIntoGroups":"إضافة إلى المجموعات","broadcast.removeFromGroups":"إزالة من المجموعات","broadcast.selectGroups":"تحديد المجموعات","broadcast.addIntoTabs":"إضافة إلى التبويبات المخصصة","broadcast.removeFromTabs":"إزالة من التبويبات المخصصة","broadcast.selectTabs":"تحديد التبويبات","broadcast.addToLabels":"إضافة إلى التصنيفات","broadcast.removeFromLabels":"إزالة من التصنيفات","broadcast.selectLabels":"تحديد التصنيفات","broadcast.addToKanban":"إضافة إلى مرحلة كانبان","broadcast.removeFromKanban":"إزالة من مرحلة كانبان","broadcast.selectCRMStage":"تحديد CRM والمرحلة","broadcast.sendRandomMessage":"إرسال رسالة عشوائية لكل جهة اتصال","broadcast.addMessage":"إضافة رسالة","broadcast.pauseSetting":"إعداد الإيقاف المؤقت","broadcast.pauseAfterXSends":"إيقاف مؤقت (بعد كل X إرسالات):","broadcast.pauseTimeInSeconds":"وقت الإيقاف المؤقت (ثانية):","broadcast.second":"ثانية","broadcast.message":"رسالة","broadcast.moveUp":"تحريك لأعلى","broadcast.moveDown":"تحريك لأسفل","broadcast.deleteMessage":"حذف الرسالة","broadcast.templateType":"نوع القالب","broadcast.messageOnly":"رسالة فقط","broadcast.enterMessageText":"الرجاء إدخال نص الرسالة","broadcast.variable":"متغير","broadcast.phoneNumber":"رقم الهاتف","broadcast.contactName":"اسم جهة الاتصال","broadcast.uploadCSVHint":"رفع ملف CSV بأعمدة إضافية لإضافة المزيد من المتغيرات","broadcast.selectTemplates":"تحديد القوالب","broadcast.noTemplates":"لا توجد قوالب متاحة","broadcast.sendingDelay":"تأخير الإرسال","broadcast.minimumSecond":"الحد الأدنى بالثواني","broadcast.maximumSecond":"الحد الأقصى بالثواني","broadcast.delayHint":"سيتم إرسال كل رسالة بتأخير عشوائي بين {min}-{max} ثانية","broadcast.scheduleMessage":"جدولة الرسالة","broadcast.date":"التاريخ","broadcast.time":"الوقت","broadcast.autoSendIfMissed":"إرسال تلقائي إذا فات الوقت المحدد","broadcast.recurring":"متكرر","broadcast.repeatInterval":"تكرار","broadcast.daily":"يومي","broadcast.weekly":"أسبوعي","broadcast.monthly":"شهري","broadcast.yearly":"سنوي","broadcast.selectDays":"اختر الأيام","broadcast.sun":"أحد","broadcast.mon":"إثن","broadcast.tue":"ثلا","broadcast.wed":"أرب","broadcast.thu":"خمي","broadcast.fri":"جمع","broadcast.sat":"سبت","broadcast.ends":"ينتهي","broadcast.endNever":"أبداً","broadcast.endOnDate":"في تاريخ","broadcast.recurringHowToUse":"كيفية استخدام التكرار","broadcast.recurringTip1":"قم بتمكين التكرار لتكرار هذا البث تلقائياً","broadcast.recurringTip2":"اختر التكرار: يومياً، أسبوعياً، شهرياً أو سنوياً","broadcast.recurringTip3":"للأسبوعي: حدد أياماً معينة (الاثنين، الثلاثاء، إلخ)","broadcast.recurringTip4":'حدد تاريخ الانتهاء أو اختر "أبداً" للتشغيل إلى أجل غير مسمى',"broadcast.recurringTip5":"بعد كل بث، يتم جدولة البث التالي تلقائياً","broadcast.selectDates":"اختر التواريخ","broadcast.selectMonths":"اختر الأشهر","broadcast.calendarSelectInfo":"حدد تواريخ محددة من التقويم. تنقل بين الأشهر باستخدام الأسهم.","broadcast.datesSelected":"تواريخ محددة","broadcast.jan":"يناير","broadcast.feb":"فبراير","broadcast.mar":"مارس","broadcast.apr":"أبريل","broadcast.may":"مايو","broadcast.jun":"يونيو","broadcast.jul":"يوليو","broadcast.aug":"أغسطس","broadcast.sep":"سبتمبر","broadcast.oct":"أكتوبر","broadcast.nov":"نوفمبر","broadcast.dec":"ديسمبر","broadcast.quickStart":"بدء سريع","broadcast.previewStart":"معاينة وبدء","broadcast.scheduleBroadcast":"جدولة البث","broadcast.sent":"تم الإرسال","broadcast.failed":"فشل","broadcast.resume":"استئناف","broadcast.pause":"إيقاف مؤقت","broadcast.stop":"إيقاف","broadcast.resumeCampaign":"استئناف الحملة؟","broadcast.campaignInterrupted":"تم مقاطعة حملة. هل تريد الاستئناف؟","broadcast.remaining":"متبقي","broadcast.contactsProcessed":"جهات اتصال تمت معالجتها","broadcast.resumeCampaignBtn":"استئناف الحملة","broadcast.cancelDiscard":"إلغاء وحذف","broadcast.dismissRemindLater":"تجاهل (تذكير لاحقاً)","broadcast.broadcastScheduled":"تم جدولة البث!","broadcast.campaignPreview":"معاينة الحملة","broadcast.messages":"الرسائل","broadcast.stepSettings":"الإعدادات","broadcast.stepActions":"الإجراءات","broadcast.stepReview":"المراجعة","broadcast.delayRange":"نطاق التأخير","broadcast.pauseAfterDuration":"إيقاف مؤقت بعد / المدة","broadcast.checkConsole":"تحقق من وحدة تحكم المتصفح للتكوين التفصيلي","broadcast.sendingQueue":"قائمة الإرسال","broadcast.broadcastReports":"تقارير البث","broadcast.campaignHistory":"سجل الحملات","broadcast.noHistoryYet":"لا يوجد سجل بث بعد","broadcast.historyDescription":"ستظهر عمليات البث المكتملة والمجدولة هنا","broadcast.noCampaignsYet":"لا توجد حملات مكتملة بعد","broadcast.dateTime":"التاريخ والوقت","broadcast.status":"الحالة","broadcast.scheduled":"مجدول","broadcast.cancel":"إلغاء","broadcast.running":"قيد التشغيل","broadcast.cancelled":"ملغي","broadcast.downloadAllContacts":"تحميل جميع جهات الاتصال","broadcast.downloadSentContacts":"تحميل جهات الاتصال المرسلة","broadcast.downloadFailedContacts":"تحميل جهات الاتصال الفاشلة","broadcast.selectGroupsToAdd":"تحديد المجموعات لإضافة جهات الاتصال","broadcast.selectGroupsToRemove":"تحديد المجموعات لإزالة جهات الاتصال","broadcast.selectTabsToAdd":"تحديد التبويبات لإضافة جهات الاتصال","broadcast.selectTabsToRemove":"تحديد التبويبات لإزالة جهات الاتصال","broadcast.selectLabelsToAdd":"تحديد التصنيفات لإضافة جهات الاتصال","broadcast.selectLabelsToRemove":"تحديد التصنيفات لإزالة جهات الاتصال","broadcast.selectCRM":"تحديد CRM","broadcast.selectStage":"تحديد المرحلة","broadcast.backToCRMs":"العودة إلى CRMs","broadcast.loadingGroups":"جاري تحميل المجموعات...","broadcast.loadingTabs":"جاري تحميل التبويبات...","broadcast.loadingLabels":"جاري تحميل التصنيفات...","broadcast.noGroupsFound":"لم يتم العثور على مجموعات أنت مسؤول فيها","broadcast.noTabsFound":"لم يتم العثور على تبويبات مخصصة. قم بإنشاء تبويبات أولاً.","broadcast.noLabelsFound":"لم يتم العثور على تصنيفات. قم بإنشاء تصنيفات في واتساب أولاً.","broadcast.noCRMsFound":"لم يتم العثور على CRMs. قم بإنشاء CRM أولاً.","broadcast.noStagesFound":"لم يتم العثور على مراحل في هذا CRM.","broadcast.tabsSelected":"تبويبات محددة","broadcast.labelsSelected":"تصنيفات محددة","broadcast.confirmSelection":"تأكيد الاختيار","broadcast.availableVariables":"المتغيرات المتاحة","broadcast.of":"من","broadcast.chats":"محادثات","broadcast.remove":"إزالة","broadcast.allScheduledCampaigns":"جميع الحملات المجدولة","broadcast.noScheduledCampaigns":"لا توجد حملات مجدولة","broadcast.scheduleFirstCampaign":"جدول حملتك الأولى لتراها هنا","broadcast.createNewCampaign":"إنشاء حملة جديدة","broadcast.oneTime":"مرة واحدة","broadcast.nextRun":"التشغيل التالي","broadcast.runNow":"تشغيل الآن","broadcast.pauseCampaign":"إيقاف مؤقت","broadcast.editCampaign":"تعديل","broadcast.deleteCampaign":"حذف","broadcast.confirmDeleteScheduled":"هل أنت متأكد من حذف هذه الحملة المجدولة؟","broadcast.campaignStarting":"ستبدأ الحملة قريباً","broadcast.skipNext":"تخطي التالي","broadcast.unskipNext":"عدم التخطي","broadcast.skippingNext":"تخطي التالي","broadcast.lastRun":"آخر تشغيل","broadcast.runs":"عمليات تشغيل","broadcast.successRate":"نجاح","broadcast.justNow":"الآن","broadcast.inAMoment":"بعد لحظات","broadcast.ago":"منذ","broadcast.in":"في","broadcast.uploadContacts":"رفع جهات الاتصال","broadcast.stepSelect":"اختيار","broadcast.stepMap":"تعيين","broadcast.stepUpload":"رفع","broadcast.uploadCSVImport":"قم برفع ملف CSV لاستيراد جهات الاتصال","broadcast.uploadCSVOnly":"ملفات CSV فقط (تنسيق .csv)","broadcast.downloadSampleFile":"تحميل ملف نموذجي","broadcast.phoneNumberLabel":"رقم الهاتف:","broadcast.mapColumnHint":"حدد العمود الذي يحتوي على بيانات 'رقم الهاتف'","broadcast.chooseExtraColumns":"اختر أعمدة إضافية للرسائل المخصصة.","broadcast.all":"الكل","broadcast.none":"لا شيء","broadcast.previous":"السابق","broadcast.next":"التالي","broadcast.removeUnwantedRows":"إزالة الصفوف غير المرغوبة","broadcast.totalContacts":"إجمالي جهات الاتصال","broadcast.startUpload":"بدء الرفع","broadcast.rows":"صفوف","broadcast.selectGroupsTitle":"اختيار المجموعات","broadcast.searchGroups":"البحث في المجموعات...","broadcast.members":"أعضاء","broadcast.groupsSelectedCount":"مجموعات محددة","broadcast.addGroupsBtn":"إضافة مجموعات","broadcast.tooltipBold":"عريض","broadcast.tooltipItalic":"مائل","broadcast.tooltipStrikethrough":"يتوسطه خط","broadcast.tooltipAddMedia":"إضافة وسائط","broadcast.tooltipRefresh":"تحديث","broadcast.noCompletedCampaigns":"لا توجد حملات مكتملة حتى الآن","kanban.title":"كانبان CRM","kanban.user":"المستخدم","kanban.darkMode":"الوضع الداكن","kanban.lightMode":"الوضع الفاتح","kanban.menu":"القائمة","kanban.createCRM":"إنشاء CRM","kanban.addStage":"إضافة مرحلة","kanban.analytics":"التحليلات","kanban.sync":"مزامنة","kanban.cannotAddStages":"لا يمكن إضافة مراحل إلى تسميات واتساب CRM","kanban.inbox":"صندوق الوارد","kanban.unread":"غير مقروء","kanban.pinned":"مثبت","kanban.groups":"المجموعات","kanban.stages":"مراحل","kanban.chats":"محادثات","kanban.searchInbox":"البحث في صندوق الوارد...","kanban.searchContacts":"بحث...","kanban.stageOptions":"خيارات المرحلة","kanban.renameStage":"إعادة تسمية","kanban.clearSearch":"مسح البحث","kanban.noChatsMatch":"لا توجد محادثات مطابقة","kanban.noChatsYet":"لا توجد محادثات بعد","kanban.filterUnread":"تصفية المحادثات غير المقروءة","kanban.filterPinned":"تصفية المحادثات المثبتة","kanban.filterGroups":"تصفية محادثات المجموعات","kanban.addNewStage":"إضافة مرحلة جديدة","kanban.noCRMsFound":"لم يتم العثور على CRM","kanban.selectCRM":"اختر CRM من القائمة","kanban.loading":"جاري تحميل كانبان CRM...","kanban.syncingLabels":"جاري مزامنة تسميات واتساب والعلامات...","kanban.switchCRM":"تبديل CRM","kanban.createNewCRM":"إنشاء CRM جديد","kanban.enterCRMName":"أدخل اسم CRM...","kanban.addNewStageTitle":"إضافة مرحلة جديدة","kanban.enterStageName":"أدخل اسم المرحلة...","kanban.editStage":"تعديل المرحلة","kanban.editStageName":"تعديل اسم المرحلة","kanban.deleteStage":"حذف المرحلة","kanban.editCRM":"تعديل CRM","kanban.deleteCRM":"حذف CRM","kanban.confirmDeleteStage":"هل أنت متأكد؟ سيتم نقل المحادثات إلى صندوق الوارد.","kanban.cannotDeleteInbox":"لا يمكن حذف مرحلة صندوق الوارد.","kanban.cannotAddStagesLabels":"لا يمكن إضافة مراحل إلى CRM التسميات. يتم مزامنة التسميات من واتساب.","kanban.chatsLoadedSuccess":"تم تحميل المحادثات بنجاح!","kanban.failedLoadChats":"فشل تحميل المحادثات. تأكد من أنك على واتساب ويب.","kanban.noAvailableChats":"لا توجد محادثات متاحة.","kanban.enterNewCRMName":"أدخل اسم CRM الجديد:","kanban.name":"الاسم","kanban.phone":"الهاتف","kanban.lastMessage":"آخر رسالة","kanban.noMessages":"لا توجد رسائل","kanban.unreadCount":"غير مقروء","kanban.type":"النوع","kanban.groupChat":"محادثة جماعية","kanban.individualChat":"محادثة فردية","kanban.status":"الحالة","kanban.dealValue":"قيمة الصفقة (SAR)","kanban.enterDealValue":"أدخل قيمة الصفقة","kanban.notes":"ملاحظات","kanban.addNotes":"إضافة ملاحظات حول هذه المحادثة...","kanban.justNow":"الآن","kanban.group":"مجموعة","kanban.muted":"مكتوم","kanban.save":"حفظ","kanban.cancel":"إلغاء","kanban.close":"إغلاق","kanban.analyticsTitle":"لوحة التحليلات","kanban.analyticsSubtitle":"مقاييس الأداء لخط الأنابيب","kanban.exportCSV":"تصدير CSV","kanban.exportPDF":"تصدير PDF","kanban.noAnalyticsData":"لا توجد بيانات تحليلية","kanban.from":"من:","kanban.to":"إلى:","kanban.totalChats":"إجمالي المحادثات","kanban.pipelineValue":"قيمة خط الأنابيب","kanban.activeStages":"مراحل خط الأنابيب النشطة","kanban.stagePerformance":"أداء المراحل","kanban.stage":"المرحلة","kanban.value":"القيمة","kanban.avgTime":"متوسط الوقت","kanban.conversion":"التحويل","kanban.chatDistribution":"توزيع المحادثات","kanban.allTime":"كل الوقت","kanban.today":"اليوم","kanban.last7Days":"آخر 7 أيام","kanban.last30Days":"آخر 30 يوم","kanban.allowPopups":"يرجى السماح بالنوافذ المنبثقة لتصدير PDF","kanban.addSampleChat":"إضافة محادثة تجريبية","kanban.crmName":"اسم CRM","kanban.stageName":"اسم المرحلة","kanban.saveChanges":"حفظ التغييرات","kanban.createFirstCRM":"قم بإنشاء أول CRM لبدء تنظيم محادثات واتساب.","kanban.noStagesFound":"لم يتم العثور على مراحل في هذا CRM.","kanban.syncOrAddStages":"مزامنة البيانات من واتساب أو إضافة مراحل مخصصة.","kanban.chatDetails":"تفاصيل المحادثة","kanban.notAvailable":"غير متاح","kanban.addNotesPlaceholder":"أضف ملاحظات حول هذه المحادثة...","kanban.thisWeek":"هذا الأسبوع","kanban.avg":"متوسط","kanban.stagesLabel":"المراحل","kanban.activePipelineStages":"مراحل خط الأنابيب النشطة","kanban.customRange":"نطاق مخصص","kanban.dateRange":"نطاق التاريخ","kanban.confirmDeleteCrm":"هل أنت متأكد من حذف هذا CRM؟ سيتم إزالة جميع المراحل والمحادثات.","kanban.openInWhatsApp":"فتح في واتساب","kanban.removeFromStage":"إزالة من المرحلة","kanban.openCRM":"فتح CRM","kanban.addNote":"إضافة ملاحظة","kanban.scheduleMessage":"جدولة رسالة","kanban.addIncome":"إضافة دخل","kanban.whatsappNotOpen":"واتساب ويب غير مفتوح. يرجى فتح واتساب ويب أولاً.","kanban.failedToOpenChat":"فشل في فتح المحادثة في واتساب","kanban.removeFromStageConfirm":"هل أنت متأكد من إزالة هذه المحادثة من المرحلة الحالية؟","kanban.failedToRemove":"فشل في إزالة المحادثة من المرحلة","kanban.failedToOpenCRM":"فشل في فتح CRM","kanban.chatPopup":"محادثة","kanban.typeMessage":"اكتب رسالة...","kanban.sendMessage":"إرسال","kanban.loadingMessages":"جاري تحميل الرسائل...","kanban.failedToLoadMessages":"فشل في تحميل الرسائل","kanban.failedToSendMessage":"فشل في إرسال الرسالة","kanban.yesterday":"أمس","kanban.refresh":"تحديث","kanban.loadingMedia":"جاري التحميل...","kanban.clickToLoad":"انقر للتحميل","kanban.addToStage":"إضافة إلى مرحلة CRM","kanban.selectCrmStage":"اختر CRM والمرحلة","kanban.retry":"إعادة المحاولة","kanban.attach":"إرفاق ملف","kanban.addCaption":"إضافة تعليق...","kanban.audioMessage":"رسالة صوتية","kanban.document":"مستند","kanban.location":"موقع","kanban.contact":"جهة اتصال","kanban.quickReply":"رد سريع","kanban.fluxo":"فلوكسو","kanban.more":"المزيد","kanban.showLess":"عرض أقل","kanban.noQuickReplies":"لا توجد ردود سريعة","kanban.noFluxos":"لا توجد تدفقات نشطة","kanban.users":"المستخدمين","kanban.usersBreakdown":"تفاصيل المستخدمين","kanban.searchUsers":"البحث عن المستخدمين بالاسم أو الرقم...","kanban.noUsersFound":"لم يتم العثور على مستخدمين","kanban.tryDifferentSearch":"جرب كلمة بحث مختلفة","kanban.crm":"CRM","kanban.tabs":"التبويبات","kanban.labels":"التصنيفات","kanban.crmBreakdown":"تفاصيل مراحل CRM","kanban.tabsBreakdown":"تفاصيل التبويبات","kanban.labelsBreakdown":"تفاصيل التصنيفات","kanban.noDataFound":"لم يتم العثور على بيانات","kanban.addDataToSeeAnalytics":"أضف بيانات الدخل/المصروفات للاتصالات لعرض التحليلات","kanban.incomeVsExpense":"الدخل مقابل المصروفات حسب","kanban.contacts":"جهات الاتصال","kanban.netProfit":"صافي الربح","kanban.crmProfit":"ربح CRM","kanban.tabsProfit":"ربح التبويبات","kanban.labelsProfit":"ربح التصنيفات","kanban.profitDistribution":"توزيع الأرباح","kanban.sourceComparison":"مقارنة المصادر","kanban.totalContacts":"إجمالي جهات الاتصال","kanban.avgPerSource":"المتوسط لكل مصدر","kanban.loadingMore":"جاري التحميل...","kanban.allChatsLoaded":"تم تحميل جميع المحادثات","kanban.dragToReorder":"اسحب لإعادة الترتيب","crm.categoryBreakdown":"تفاصيل الفئات","crm.incomeByCategory":"الدخل حسب الفئة","crm.expenseByCategory":"المصروفات حسب الفئة","crm.paymentMethodBreakdown":"تفاصيل طريقة الدفع","crm.incomeByPayment":"الدخل حسب طريقة الدفع","crm.expenseByPayment":"المصروفات حسب طريقة الدفع","crm.userWiseBreakdown":"تفاصيل المستخدمين","crm.net":"صافي","crm.transactions":"المعاملات","crm.margin":"الهامش","crm.netProfit":"صافي الربح","chart.income":"الدخل","chart.expense":"المصروفات","chart.profit":"الربح","chart.noDataAvailable":"لا توجد بيانات متاحة","chart.noProfitData":"لا توجد بيانات أرباح متاحة","chart.noTrendData":"لا توجد بيانات اتجاهات متاحة","bulkValidator.title":"مدقق الأرقام الجماعي","bulkValidator.subtitle":"تحقق من أرقام واتساب بشكل جماعي باستخدام الحملات","bulkValidator.menu":"القائمة","bulkValidator.activeCampaigns":"الحملات النشطة","bulkValidator.completed":"مكتملة","bulkValidator.noActiveCampaigns":"لا توجد حملات نشطة. ابدأ حملة جديدة للتحقق من الأرقام.","bulkValidator.noCompleted":"لا توجد حملات مكتملة بعد.","bulkValidator.createHint":"قم بتحميل ملف CSV بالأرقام وابدأ عملية التحقق.","bulkValidator.newCampaign":"حملة تحقق جديدة","bulkValidator.createCampaign":"إنشاء حملة جديدة","bulkValidator.campaignName":"اسم الحملة","bulkValidator.enterCampaignName":"أدخل اسم الحملة","bulkValidator.countryCode":"رمز الدولة","bulkValidator.countryCodeHint":"اختر رمز الدولة للأرقام بدون بادئة","bulkValidator.uploadCSV":"تحميل ملف CSV","bulkValidator.csvHint":"ملف CSV يحتوي على أرقام هواتف (رقم واحد لكل سطر أو مفصول بفواصل)","bulkValidator.numbersFound":"أرقام تم العثور عليها","bulkValidator.enterNameAndUpload":"الرجاء إدخال اسم الحملة وتحميل الأرقام","bulkValidator.createAndStart":"إنشاء حملة","bulkValidator.campaigns":"الحملات","bulkValidator.noCampaigns":"لا توجد حملات حتى الآن. قم بإنشاء واحدة للبدء في التحقق من الأرقام.","bulkValidator.confirmDelete":"هل أنت متأكد من حذف هذه الحملة؟","bulkValidator.valid":"صالح","bulkValidator.invalid":"غير صالح","bulkValidator.pending":"قيد الانتظار","bulkValidator.start":"ابدأ","bulkValidator.pause":"إيقاف مؤقت","bulkValidator.downloadValid":"تنزيل الأرقام الصالحة","bulkValidator.downloadInvalid":"تنزيل الأرقام غير الصالحة","bulkValidator.downloadAll":"تنزيل الكل","bulkValidator.all":"الكل","tools.allTools":"كل الأدوات","tools.subtitle":"انقر للفتح • اسحب إلى الرأس للتثبيت","tools.featureSettings":"إعدادات الميزات","tools.pinnedTooltip":"مثبَّت في الرأس (اسحبه إلى الأدوات لإلغاء التثبيت)","tools.itemTooltip":"{name} — انقر للفتح أو اسحب إلى الرأس للتثبيت","tools.category.communication":"التواصل","tools.category.management":"الإدارة","tools.category.automation":"الأتمتة","tools.category.validation":"التحقق","webhook.title":"خطافات الويب","webhook.subtitle":"إرسال بيانات جهات الاتصال إلى تطبيق آخر بعد تنفيذ الأحداث المسجلة","webhook.events":"الأحداث","webhook.quickResponses":"الردود السريعة","webhook.appointment":"الموعد","webhook.reminder":"التذكير","webhook.contactProfile":"ملف الاتصال","webhook.notes":"الملاحظات","webhook.income":"الدخل","webhook.expense":"المصروفات","webhook.kanban":"كانبان","webhook.labels":"التصنيفات","webhook.customTabs":"التبويبات المخصصة","webhook.messages":"الرسائل","webhook.todos":"قائمة المهام","webhook.webhookData":"بيانات WebHook","webhook.webhookUrl":"رابط WebHook","webhook.enterUrl":"أدخل رابط الوجهة هنا","webhook.active":"نشط","webhook.dataToSend":"البيانات للإرسال","webhook.lastUploads":"آخر التحميلات (30 عرض كحد أقصى)","webhook.noUploads":"لا توجد تحميلات حتى الآن","webhook.close":"إغلاق","webhook.save":"حفظ","webhook.saving":"جاري الحفظ...","webhook.field.eventDetails":"تفاصيل الحدث","webhook.field.number":"الرقم","webhook.field.name":"الاسم","webhook.field.picture":"الصورة","webhook.field.labels":"التصنيفات","webhook.field.contactProfile":"ملف الاتصال","webhook.field.appointmentTime":"وقت الموعد","webhook.field.meetingLink":"رابط الاجتماع","webhook.field.reminderTopic":"موضوع التذكير","webhook.field.reminderTime":"وقت التذكير","webhook.field.reminderDetails":"تفاصيل التذكير","webhook.field.email":"البريد الإلكتروني","webhook.field.gender":"الجنس","webhook.field.dateOfBirth":"تاريخ الميلاد","webhook.field.address":"العنوان","webhook.field.details":"التفاصيل","webhook.field.customFields":"الحقول المخصصة","webhook.field.noteTopic":"موضوع الملاحظة","webhook.field.noteContent":"محتوى الملاحظة","webhook.field.noteTimestamp":"الطابع الزمني للملاحظة","webhook.field.amount":"المبلغ","webhook.field.category":"الفئة","webhook.field.paymentMethod":"طريقة الدفع","webhook.field.description":"الوصف","webhook.field.reference":"المرجع/الفاتورة","webhook.field.referenceBill":"المرجع/الفاتورة","webhook.field.transactionDate":"تاريخ المعاملة","webhook.field.status":"الحالة","webhook.field.cardTitle":"عنوان البطاقة","webhook.field.columnName":"العمود/المرحلة","webhook.field.cardDescription":"وصف البطاقة","webhook.field.labelId":"معرف التصنيف","webhook.field.labelName":"اسم التصنيف","webhook.field.labelColor":"لون التصنيف","webhook.field.allLabels":"جميع تصنيفات الاتصال","webhook.field.tabId":"معرف التبويب","webhook.field.tabName":"اسم التبويب","webhook.field.tabColor":"لون التبويب","webhook.field.allTabs":"جميع تبويبات الاتصال","webhook.field.direction":"الاتجاه (وارد/صادر)","webhook.field.messageContent":"محتوى الرسالة","webhook.field.messageType":"نوع الرسالة","webhook.field.messageId":"معرف الرسالة","webhook.field.mediaUrl":"رابط الوسائط","webhook.field.quotedMessage":"الرسالة المقتبسة","webhook.field.timestamp":"الطابع الزمني","webhook.field.ctwaData":"بيانات إعلانات ميتا (CTWA)","webhook.field.todoTitle":"عنوان المهمة","webhook.field.todoDescription":"وصف المهمة","webhook.field.todoDueDate":"تاريخ الاستحقاق","webhook.field.todoPriority":"الأولوية","webhook.field.todoCategory":"الفئة","webhook.field.todoStatus":"الحالة","webhook.field.todoSubtasks":"المهام الفرعية","api.configureAPI":"تكوين API","api.manageToken":"إدارة رمز API والإعدادات","api.apiToken":"رمز API","api.generateToken":"إنشاء رمز","api.regenerate":"إعادة الإنشاء","api.generating":"جاري الإنشاء...","api.copyToken":"نسخ الرمز","api.tokenWarning":"احتفظ بهذا الرمز سريًا. أي شخص لديه حق الوصول يمكنه إرسال رسائل نيابة عنك.","api.enableAPI":"تفعيل API","api.apiIsEnabled":"API مفعل حاليًا","api.apiIsDisabled":"API معطل حاليًا","api.openDocumentation":"فتح الوثائق","api.queuePolling":"استطلاع قائمة الانتظار","api.pollingActive":"التحقق من الرسائل في قائمة الانتظار كل 5 دقائق","api.pollingInactive":"تفعيل لمعالجة رسائل API الواردة","audioTranscribe.title":"النسخ","audioTranscribe.transcribeAudio":"نسخ الصوت","audioTranscribe.copy":"نسخ","audioTranscribe.copied":"تم النسخ!","audioTranscribe.translate":"ترجمة","audioTranscribe.translating":"جاري الترجمة...","audioTranscribe.translated":"تمت الترجمة!","audioTranscribe.original":"الأصلي:","audioTranscribe.translatedLabel":"مترجم","audioTranscribe.close":"إغلاق","audioTranscribe.requiresChatGPT":"يتطلب نسخ الصوت مفتاح ChatGPT API. يرجى تكوين ChatGPT كمزود AI في الإعدادات.","audioTranscribe.audioNotFound":"تعذر العثور على رابط الصوت. قد لا يكون الصوت متاحًا.","audioTranscribe.transcriptionFailed":"فشل النسخ","audioTranscribe.configureAI":"يرجى تكوين إعدادات AI أولاً لاستخدام الترجمة.","audioTranscribe.translationFailed":"فشلت الترجمة","audioTranscribe.translationTimeout":"انتهت مهلة الترجمة. يرجى المحاولة مرة أخرى.","aiBot.title":"بوت الذكاء الاصطناعي","aiBot.tab.testChat":"محادثة تجريبية","aiBot.tab.qaPairs":"أزواج الأسئلة والأجوبة","aiBot.tab.aiBehavior":"سلوك الذكاء الاصطناعي","aiBot.tab.trainingData":"بيانات التدريب","aiBot.tab.escalation":"التصعيد","aiBot.tab.dataPreview":"معاينة البيانات","aiBot.tab.actionPrompts":"تعليمات الإجراءات","aiBot.tab.scheduleTiming":"الجدول والتوقيت","aiBot.tab.trainingDataComingSoon":"ستصل ميزة تحميل المستندات وكشط الروابط ومصادر النصوص العادية في التحديث القادم.","aiBot.tab.escalationComingSoon":"ستصل ميزة التحويل التلقائي إلى إنسان بعد عدد قابل للضبط من الرسائل غير المُجاب عليها في التحديث القادم.","aiBot.tab.dataPreviewComingSoon":"نظرة عامة للقراءة فقط لكل زوج أسئلة وأجوبة ومصدر وجزء يمكن للذكاء الاصطناعي الوصول إليه.","aiBot.comingSoon":"قريباً","aiBot.qa.addPair":"إضافة زوج","aiBot.qa.editPair":"تعديل الزوج","aiBot.qa.questionLabel":"السؤال","aiBot.qa.questionPlaceholder":"ما قد يسأله العملاء…","aiBot.qa.answerLabel":"الإجابة","aiBot.qa.answerPlaceholder":"كيف يجب أن يرد الذكاء الاصطناعي…","aiBot.qa.categoryLabel":"الفئة (اختياري)","aiBot.qa.categoryPlaceholder":"مثال: التسعير، الدعم، التهيئة","aiBot.qa.existingPairs":"الأزواج الموجودة","aiBot.qa.empty":"لا توجد أزواج بعد. أضف الزوج الأول أعلاه.","aiBot.qa.cancel":"إلغاء","aiBot.qa.update":"تحديث","aiBot.qa.delete":"حذف","aiBot.qa.edit":"تعديل","aiBot.qa.enabled":"مفعّل","aiBot.qa.disabled":"معطّل","aiBot.qa.on":"تشغيل","aiBot.qa.off":"إيقاف","aiBot.qa.deleteConfirm":"حذف هذا الزوج؟","aiBot.qa.itemSingular":"زوج","aiBot.qa.itemPlural":"أزواج","aiBot.behavior.providerConfig":"مزود الذكاء الاصطناعي","aiBot.behavior.provider":"المزود","aiBot.behavior.model":"النموذج","aiBot.behavior.apiActive":"API نشط","aiBot.behavior.noApiKey":"لا يوجد مفتاح API","aiBot.behavior.apiKeyHint":"أضف مفتاح API الخاص بك في إعدادات أدوات الذكاء الاصطناعي لتفعيل البوت.","aiBot.behavior.triggerWords":"كلمات التشغيل","aiBot.behavior.triggerWordsPlaceholder":"دعم، مساعدة، عرض (مفصولة بفواصل)","aiBot.behavior.triggerWordsHelp":"عند تعيينها، يرد البوت فقط على الرسائل التي تحتوي على واحدة من هذه الكلمات على الأقل. اتركها فارغة للرد على كل شيء.","aiBot.behavior.responseSettings":"إعدادات الرد","aiBot.behavior.responseTone":"نبرة الرد","aiBot.behavior.maxResponseLength":"الحد الأقصى لطول الرد","aiBot.behavior.temperature":"درجة الحرارة","aiBot.behavior.temperatureHelp":"أقل = أكثر تركيزاً. أعلى = أكثر إبداعاً.","aiBot.behavior.maxTokens":"الحد الأقصى للرموز","aiBot.behavior.maxTokensHelp":"يحدد حجم رد الذكاء الاصطناعي.","aiBot.behavior.systemPrompt":"السياق التجاري / تعليمات النظام","aiBot.behavior.systemPromptPlaceholder":"أخبر الذكاء الاصطناعي عن عملك ومنتجاتك وكيف يجب أن يمثلك…","aiBot.behavior.systemPromptHelp":"تُستخدم كتعليمات أساسية لكل رد من الذكاء الاصطناعي.","aiBot.behavior.fallbackMessage":"رسالة احتياطية","aiBot.behavior.fallbackMessageHelp":"تُرسل عندما لا يكون لدى الذكاء الاصطناعي زوج أسئلة وأجوبة أو مصدر أو معرفة عامة ذات صلة للرد.","aiBot.behavior.saved":"✓ تم الحفظ","aiBot.behavior.saveBehavior":"حفظ السلوك","aiBot.behavior.tone_friendly":"ودود","aiBot.behavior.tone_professional":"مهني","aiBot.behavior.tone_casual":"غير رسمي","aiBot.behavior.tone_formal":"رسمي","aiBot.behavior.tone_empathetic":"متعاطف","aiBot.behavior.length_short":"قصير (~50 كلمة)","aiBot.behavior.length_medium":"متوسط (~200 كلمة)","aiBot.behavior.length_long":"طويل (~400 كلمة)","aiBot.kb.urlTitle":"إضافة رابط موقع","aiBot.kb.urlPlaceholder":"https://example.com/about","aiBot.kb.addUrl":"إضافة رابط","aiBot.kb.scraping":"جاري الكشط…","aiBot.kb.urlHelp":"نحضر الصفحة ونستخرج النص المرئي. صفحة واحدة فقط — قد تُرجع تطبيقات SPA المُعرَّضة بـ JS محتوى قليلاً.","aiBot.kb.errorEmpty":"لم يتم العثور على نص قابل للقراءة في هذا الرابط.","aiBot.kb.errorBlocked":'تعذر الوصول إلى هذا الرابط. قد يحظر الموقع الطلبات الآلية أو يتطلب تسجيل الدخول أو يكون مُعرَّضاً بـ JS. حاول نسخ النص إلى "لصق نص عادي" أدناه.',"aiBot.kb.blockedChromeStore":'متجر Chrome الإلكتروني يحظر الطلبات الآلية. افتح القائمة في متصفحك وانسخ النص الوصفي والصقه في "لصق نص عادي" أدناه.',"aiBot.kb.blockedGoogle":"صفحات Google Docs / Drive / Sheets تتطلب تسجيل الدخول ولا يمكن كشطها. صدّر إلى PDF/DOCX/TXT وحمّله بدلاً من ذلك.","aiBot.kb.blockedSocial":'تحظر الشبكات الاجتماعية الطلبات الآلية. انسخ النص ذي الصلة والصقه في "لصق نص عادي" أدناه.',"aiBot.kb.blockedNotion":"صفحات Notion مُعرَّضة بـ JS وتُرجع نصاً قليلاً. صدّر الصفحة كـ Markdown/PDF وحمّلها بدلاً من ذلك.","aiBot.kb.plainTextTitle":"لصق نص عادي","aiBot.kb.textTitlePlaceholder":'العنوان (اختياري، مثال "سياسة الاسترداد")',"aiBot.kb.textBodyPlaceholder":"الصق أي نص يجب أن يعرفه الذكاء الاصطناعي — التسعير، الأسئلة الشائعة، السياسات، التعليمات…","aiBot.kb.charsLabel":"حرف","aiBot.kb.saveText":"حفظ النص","aiBot.kb.saving":"جاري الحفظ…","aiBot.kb.trainingSources":"مصادر التدريب","aiBot.kb.sourceSingular":"مصدر","aiBot.kb.sourcePlural":"مصادر","aiBot.kb.chunkSingular":"جزء","aiBot.kb.chunkPlural":"أجزاء","aiBot.kb.empty":"لا توجد مصادر تدريب بعد. أضف رابطاً أو الصق نصاً عادياً أعلاه.","aiBot.kb.deleteConfirm":"حذف هذا المصدر؟","aiBot.kb.uploadTitle":"تحميل المستندات","aiBot.kb.uploadPrompt":"انقر لاختيار ملف، أو اسحب وأفلت هنا","aiBot.kb.uploadFormats":"PDF, DOCX, TXT, CSV, MD","aiBot.kb.uploadMaxSize":"الحد الأقصى 10 ميجابايت لكل ملف","aiBot.kb.parsing":"جاري التحليل…","aiBot.kb.parsingFile":"تحليل","aiBot.esc.enableAuto":"تفعيل التصعيد التلقائي","aiBot.esc.enableAutoDesc":"التحويل تلقائياً إلى إنسان عندما لا يستطيع الذكاء الاصطناعي المساعدة أو يطلب العميل ذلك.","aiBot.esc.maxAttempts":"الحد الأقصى للمحاولات الفاشلة","aiBot.esc.maxAttemptsHelp":"التحويل بعد هذا العدد من الردود الاحتياطية المتتالية (نافذة 24 ساعة).","aiBot.esc.triggerPhrases":"عبارات التشغيل (واحدة في كل سطر)","aiBot.esc.triggerPhrasesHelp":"عند ظهور أي من هذه العبارات في رسالة واردة، يصعّد البوت فوراً. مطابقة سلسلة فرعية غير حساسة لحالة الأحرف.","aiBot.esc.message":"رسالة التصعيد","aiBot.esc.messageHelp":"تُرسل إلى العميل قبل توقف البوت عن الرد مباشرة حتى يتمكن إنسان من الاستلام.","aiBot.esc.saveRules":"حفظ قواعد التصعيد","aiBot.esc.statusOn":"مُفعّل","aiBot.esc.statusOff":"مُعطّل","aiBot.preview.qaPairsLabel":"أزواج الأسئلة والأجوبة","aiBot.preview.sourcesLabel":"المصادر","aiBot.preview.chunksLabel":"الأجزاء","aiBot.preview.helpText":"هذا بالضبط ما يمكن للذكاء الاصطناعي الوصول إليه الآن. لا تُستخدم العناصر المعطّلة.","aiBot.preview.escalationSummary":"التصعيد","aiBot.preview.escStatus":"الحالة","aiBot.preview.escThreshold":"بعد","aiBot.preview.escFailed":"ردود احتياطية متتالية","aiBot.preview.escPhrases":"عبارات التشغيل","aiBot.preview.escNoPhrases":"لا شيء","aiBot.preview.qaPairsTitle":"أزواج الأسئلة والأجوبة","aiBot.preview.sourcesTitle":"مصادر التدريب","aiBot.preview.noQa":"لا توجد أزواج أسئلة وأجوبة مفعّلة.","aiBot.preview.noSources":"لا توجد مصادر مفعّلة.","aiBot.fallbackMoved":"تم نقل الرد الاحتياطي إلى علامة تبويب سلوك الذكاء الاصطناعي. يتم الاحتفاظ برسالتك الحالية تلقائياً.","aiBot.businessPromptMoved":"تم نقل المطالبة التجارية إلى علامة تبويب سلوك الذكاء الاصطناعي. حررها هناك — يتم الاحتفاظ بمطالبتك الحالية.","aiBot.generalKnowledgeMoved":'تم نقل مفتاح "السماح للذكاء الاصطناعي باستخدام المعرفة العامة" إلى علامة تبويب سلوك الذكاء الاصطناعي.',"aiBot.stopKeywordsRecommend":"للإعدادات الجديدة نوصي بعلامة تبويب التصعيد — تضيف عداد محاولات وعبارات تشغيل بالإضافة إلى إيقافات الكلمات الرئيسية. لا يزال هذا القسم يعمل لإيقافات الكلمات الرئيسية فقط.","aiBot.subtitle":"تكوين الردود التلقائية للذكاء الاصطناعي","aiBot.menu":"القائمة","aiBot.enableBot":"تفعيل بوت الذكاء الاصطناعي","aiBot.enableBotDesc":"الرد تلقائياً على الرسائل الواردة","aiBot.replyInGroups":"الرد في المجموعات","aiBot.replyInGroupsDesc":"السماح لبوت الذكاء الاصطناعي بالرد في الدردشات الجماعية (معطل افتراضياً)","aiBot.allowGeneralKnowledge":"السماح للذكاء الاصطناعي باستخدام المعرفة العامة","aiBot.allowGeneralKnowledgeDesc":"عند إيقاف التشغيل، يرد الذكاء الاصطناعي فقط بناءً على موجه العمل الخاص بك. عند التشغيل، يمكنه أيضاً استخدام معرفته العامة.","aiBot.fallbackReply":"الرد الاحتياطي","aiBot.fallbackReplyDesc":"عندما لا يكون لدى الذكاء الاصطناعي معلومات في موجه العمل الخاص بك، سيرسل هذا الرد بدلاً من اختلاق الإجابات.","aiBot.fallbackReplyPlaceholder":"مثال: شكراً على سؤالك! ليس لدي معلومات محددة حول ذلك الآن. سيتواصل معك فريقنا قريباً.","aiBot.smartDetection":"الكشف الذكي","aiBot.smartDetectionDesc":"يكشف الذكاء الاصطناعي تلقائياً عن الإحباط أو طلبات المساعدة البشرية","aiBot.monday":"الإثنين","aiBot.tuesday":"الثلاثاء","aiBot.wednesday":"الأربعاء","aiBot.thursday":"الخميس","aiBot.friday":"الجمعة","aiBot.saturday":"السبت","aiBot.sunday":"الأحد","aiBot.enableWeekdays":"تفعيل أيام العمل","aiBot.disableWeekdays":"تعطيل أيام العمل","aiBot.enableWeekends":"تفعيل عطلة نهاية الأسبوع","aiBot.disableWeekends":"تعطيل عطلة نهاية الأسبوع","aiBot.applyToAll":"تطبيق على الكل:","aiBot.apply":"تطبيق","aiBot.day":"اليوم","aiBot.active":"نشط","aiBot.currentStatus":"الحالة الحالية:","aiBot.botOffToday":"البوت مغلق اليوم","aiBot.businessPrompt":"موجه الأعمال","aiBot.businessPromptDesc":"خصص طريقة رد الذكاء الاصطناعي. صف عملك ونبرتك وإرشاداتك.","aiBot.businessPromptPlaceholder":"مثال: أنت ممثل خدمة عملاء لـ [اسم الشركة]. نحن نبيع [المنتج/الخدمة]. كن ودوداً ومحترفاً.","aiBot.schedule":"ساعات البوت","aiBot.scheduleEnabled":"تفعيل الجدول الزمني","aiBot.scheduleEnabledDesc":"البوت يرد فقط خلال الأيام والأوقات المحددة","aiBot.startTime":"وقت البدء","aiBot.endTime":"وقت الانتهاء","aiBot.to":"إلى","aiBot.timezone":"المنطقة الزمنية","aiBot.replyTiming":"توقيت الرد","aiBot.replyTimingDesc":"تأخير عشوائي قبل رد الذكاء الاصطناعي","aiBot.minDelay":"الحد الأدنى للتأخير (ثانية)","aiBot.maxDelay":"الحد الأقصى للتأخير (ثانية)","aiBot.enabledActions":"الإجراءات المفعلة","aiBot.enabledActionsDesc":"اختر الإجراءات التي يمكن للذكاء الاصطناعي تنفيذها","aiBot.actionNormalReply":"إرسال رد","aiBot.actionNormalReplyDesc":"الذكاء الاصطناعي يرسل رسائل نصية","aiBot.actionKanban":"تحديث كانبان","aiBot.actionKanbanDesc":"نقل جهات الاتصال بين مراحل كانبان","aiBot.actionLabels":"تحديث التصنيفات","aiBot.actionLabelsDesc":"إضافة/إزالة تصنيفات واتساب","aiBot.actionTabs":"تحديث علامات التبويب","aiBot.actionTabsDesc":"إضافة/إزالة من علامات التبويب المخصصة","aiBot.actionAppointment":"إنشاء موعد","aiBot.actionAppointmentDesc":"جدولة المواعيد من المحادثات","aiBot.tabsPromptLabel":"تعليمات مخصصة لإدارة علامات التبويب:","aiBot.tabsPromptPlaceholder":'مثال: إذا سأل المستخدم عن خدمات SEO، أضفه إلى علامة "عملاء SEO المحتملين"...',"aiBot.meetingLinkLabel":"رابط Google Meet:","aiBot.meetingLinkPlaceholder":"https://meet.google.com/xxx-xxxx-xxx","aiBot.meetingLinkDesc":"سيتم استخدام هذا الرابط لجميع المواعيد التي ينشئها الذكاء الاصطناعي","aiBot.messageTemplateLabel":"قالب الرسالة:","aiBot.messageTemplateDesc":"سيتم إرسال هذه الرسالة كتذكير بالموعد","aiBot.varName":"الاسم","aiBot.varDate":"التاريخ","aiBot.varTime":"الوقت","aiBot.varLink":"الرابط","aiBot.messageTemplatePlaceholder":"مرحباً {name}، موعدك مجدول في {date} الساعة {time}. انضم هنا: {link}","aiBot.officeHoursLabel":"ساعات العمل (توقيت المواعيد):","aiBot.officeHoursDesc":"سيقوم الذكاء الاصطناعي بجدولة المواعيد خلال هذه الساعات فقط","aiBot.sendMessageNow":"إرسال الرسالة فوراً","aiBot.sendMessageNowDesc":"إرسال رسالة الموعد مباشرة بعد الإنشاء","aiBot.appointmentPromptLabel":"تعليمات ذكاء اصطناعي مخصصة:","aiBot.appointmentPromptPlaceholder":"مثال: عند جدولة المواعيد، اقترح دائماً أوقات بين 10 صباحاً - 6 مساءً...","aiBot.actionProfile":"تحديث الملف الشخصي","aiBot.actionProfileDesc":"استخراج وحفظ معلومات جهة الاتصال","aiBot.contextMessages":"رسائل السياق","aiBot.contextMessagesDesc":"عدد الرسائل السابقة لسياق الذكاء الاصطناعي","aiBot.settingsTab":"الإعدادات","aiBot.promptSettings":"إعدادات البرومبت","aiBot.actionPrompts":"برومبت الإجراءات","aiBot.actionPromptsDesc":"تكوين برومبت مخصصة لإجراءات الذكاء الاصطناعي المختلفة","aiBot.talkToAI":"تحدث مع الذكاء الاصطناعي","aiBot.testYourBot":"اختبر بوت الذكاء الاصطناعي","aiBot.testDescription":"تستخدم الرسائل الإعدادات الحالية (بما في ذلك التغييرات غير المحفوظة)","aiBot.clearChat":"مسح الدردشة","aiBot.typeTestMessage":"اكتب رسالة اختبار...","aiBot.aiTyping":"الذكاء الاصطناعي يكتب...","aiBot.noMessages":"اكتب رسالة لاختبار استجابة بوت الذكاء الاصطناعي","aiBot.send":"إرسال","aiBot.copy":"نسخ","aiBot.copied":"تم النسخ!","aiBot.select":"تحديد","aiBot.aiNotConfigured":"الذكاء الاصطناعي غير مكوّن. يرجى إعداد مفتاح API أولاً.","aiBot.noResponse":"لا يوجد رد من الذكاء الاصطناعي","aiBot.stopKeywords":"كلمات الإيقاف","aiBot.stopKeywordsInfo":"عندما يرسل العميل أي من هذه الكلمات، سيتوقف بوت الذكاء الاصطناعي عن الرد ويضيفه للقائمة السوداء.","aiBot.enableStopKeywords":"تفعيل كلمات الإيقاف","aiBot.enableStopKeywordsDesc":"إيقاف بوت الذكاء الاصطناعي تلقائياً عندما يطلب العميل مساعدة بشرية","aiBot.keywords":"الكلمات المفتاحية","aiBot.noKeywords":"لم تتم إضافة كلمات مفتاحية بعد","aiBot.enterKeyword":"أدخل كلمة مفتاحية...","aiBot.add":"+ إضافة","aiBot.stopMessage":"رسالة الإيقاف","aiBot.stopMessagePlaceholder":"الرسالة المرسلة عند اكتشاف كلمة إيقاف...","aiBot.stopMessageHint":"سيتم إرسال هذه الرسالة للعميل عند اكتشاف كلمة إيقاف.","aiBot.responseMode":"وضع الاستجابة:","aiBot.aiBotPrompt":"موجه بوت الذكاء الاصطناعي","aiBot.globalChatGPT":"ChatGPT العالمي","aiBot.newChat":"محادثة جديدة","aiBot.clearAll":"مسح الكل","aiBot.searchChats":"البحث في المحادثات...","aiBot.noSearchResults":"لم يتم العثور على محادثات","aiBot.noChatsYet":"لا يوجد سجل محادثات بعد","aiBot.deleteChat":"حذف المحادثة","aiBot.chatsStored":"محادثات محفوظة","aiBot.clearAllTitle":"مسح جميع المحادثات؟","aiBot.clearAllDesc":"سيؤدي هذا إلى حذف سجل المحادثات بالكامل بشكل دائم. لا يمكن التراجع عن هذا الإجراء.","aiBot.messages":"رسائل","aiBot.today":"اليوم","aiBot.yesterday":"أمس","crm.aiBotBlacklist":"بوت الذكاء الاصطناعي","crm.aiBotEnabled":"مفعل لجهة الاتصال هذه","crm.aiBotDisabled":"معطل لجهة الاتصال هذه","common.saved":"تم الحفظ","crm.chatbotFlow":"تدفق الدردشة الآلية","crm.chatbotFlowDesc":"إنشاء بوتات رد تلقائي بالكلمات المفتاحية","crm.createNewFlow":"إنشاء تدفق جديد","crm.noFlowsYet":"لا توجد تدفقات بعد","crm.createFirstFlow":"أنشئ أول تدفق دردشة آلية","crm.active":"نشط","crm.inactive":"غير نشط","crm.flowName":"اسم التدفق","crm.untitledFlow":"تدفق بدون عنوان","crm.duplicate":"نسخ","crm.triggers":"المحفزات","crm.actions":"الإجراءات","crm.rules":"القواعد","crm.chatbotFlows":"تدفقات الدردشة الآلية","crm.exportFlows":"تصدير","crm.importFlows":"استيراد","crm.exportAll":"تصدير الكل","crm.exportSelected":"تصدير المحدد","crm.selectFlowsToExport":"اختر التدفقات للتصدير","crm.importSuccess":"تم استيراد التدفقات بنجاح!","crm.importError":"خطأ في استيراد التدفقات","crm.invalidFlowFile":"تنسيق ملف التدفق غير صالح","crm.duplicateFlowFound":"تم العثور على تدفق مكرر","crm.flowAlreadyExists":"'{name}' موجود بالفعل. ماذا تريد أن تفعل؟","crm.replaceFlow":"استبدال","crm.skipFlow":"تخطي","crm.renameAndAdd":"إعادة تسمية وإضافة","crm.noFlowsSelected":"يرجى تحديد تدفق واحد على الأقل","crm.noFlowsToExport":"لا توجد تدفقات للتصدير","crm.flowsExported":"تم تصدير {count} تدفق(ات)","crm.flowsImported":"تم استيراد {count} تدفق(ات)","crm.selected":"محدد","crm.enabled":"مُفعّل","crm.allFlows":"الكل","crm.byCategory":"الفئات","crm.viewAllFlows":"عرض جميع التدفقات","crm.viewByCategory":"عرض حسب الفئة","crm.addFluxoCategory":"إضافة فئة","crm.manageCategories":"إدارة الفئات","crm.editCategory":"تعديل الفئة","crm.createCategory":"إنشاء فئة","crm.createCategoryBtn":"إنشاء فئة","crm.fluxoCategoryName":"الاسم","crm.categoryIcon":"الأيقونة","crm.categoryColor":"اللون","crm.preview":"معاينة","crm.custom":"مخصص","crm.enterFluxoCategoryName":"أدخل اسم الفئة","crm.fluxoCategoryNameRequired":"اسم الفئة مطلوب","crm.fluxoCategoryNameExists":"فئة بهذا الاسم موجودة بالفعل","crm.confirmDeleteCategory":"حذف هذه الفئة؟ ستنتقل التدفقات إلى غير مصنف.","crm.uncategorized":"غير مصنف","crm.noFlowsInCategory":"لا توجد تدفقات في هذه الفئة","crm.dragFlowsHere":"اسحب التدفقات هنا للتنظيم","crm.dropHere":"أفلت هنا","crm.dragToMove":"اسحب للنقل","crm.noCategoriesYet":"لا توجد فئات بعد","crm.createCategoryHint":"أنشئ فئة لتنظيم تدفقاتك","crm.createFirstCategory":"إنشاء الفئة الأولى","crm.tourViewToggleTitle":"تبديل العرض","crm.tourViewToggleContent":"التبديل بين عرض جميع التدفقات وعرض الفئات لتنظيم روبوتات الدردشة.","crm.tourCategoryViewTitle":"عرض الفئات","crm.tourCategoryViewContent":"انقر هنا لرؤية تدفقاتك منظمة حسب الفئات.","crm.tourAddCategoryTitle":"إنشاء فئات","crm.tourAddCategoryContent":"انقر هنا لإنشاء فئة جديدة باسم وأيقونة ولون مخصص.","crm.tourDragDropTitle":"السحب والإفلات","crm.tourDragDropContent":"اسحب أي بطاقة تدفق وأفلتها في فئة لتنظيم تدفقاتك.","crm.tourCategorySectionTitle":"أقسام الفئات","crm.tourCategorySectionContent":"انقر لتوسيع أو طي الفئات. قم بتعديل أو حذف الفئات باستخدام الأزرار.","crm.skipTour":"تخطي","crm.finishTour":"فهمت!","crm.next":"التالي","crm.previous":"السابق","crm.simulateFlow":"محاكاة التدفق","crm.start":"بدء","crm.actionBlocks":"كتل الإجراءات","crm.anyMessage":"أي رسالة","crm.keywords":"الكلمات المفتاحية","crm.addKeyword":"إضافة كلمة مفتاحية","crm.firstMessageOfDay":"أول رسالة في اليوم","crm.firstMessageEver":"أول رسالة على الإطلاق","crm.sendText":"إرسال نص","crm.sendTextDesc":"إرسال رسالة نصية.","crm.sendImage":"إرسال صورة","crm.sendImageDesc":"إرسال صورة مع تعليق.","crm.sendVideo":"إرسال فيديو","crm.sendVideoDesc":"إرسال فيديو مع تعليق.","crm.sendAudio":"إرسال صوت","crm.sendAudioDesc":"إرسال ملف صوتي.","crm.sendDocument":"إرسال مستند","crm.sendDocumentDesc":"إرسال ملف مستند.","crm.responses":"الردود","crm.responsesDesc":"انتظار رد المستخدم وتفريع التدفق.","crm.sendList":"إرسال قائمة","crm.sendListDesc":"إرسال رسالة قائمة تفاعلية.","fluxo.waitInput":"انتظار الإدخال","fluxo.waitInputDesc":"انتظار استجابة مستخدم موثقة","fluxo.promptMessage":"رسالة المطالبة","fluxo.enterPromptMessage":"أدخل المطالبة لطلب إدخال المستخدم...","fluxo.inputType":"نوع الإدخال (التحقق)","fluxo.inputTypeString":"نص (أي)","fluxo.inputTypePhone":"رقم الهاتف","fluxo.inputTypeNumber":"رقم","fluxo.inputTypeEmail":"بريد إلكتروني","fluxo.inputTypeUrl":"رابط URL","fluxo.inputTypeDatetime":"تاريخ/وقت","fluxo.phoneHint":"الصيغة: +966501234567 (مع رمز البلد)","fluxo.emailHint":"الصيغة: user@example.com","fluxo.numberHint":"يقبل الأعداد الصحيحة والعشرية","fluxo.urlHint":"الصيغة: https://example.com","fluxo.datetimeHint":"الصيغة: YYYY-MM-DD أو YYYY-MM-DDTHH:MM","fluxo.stringHint":"يقبل أي إدخال نصي","fluxo.saveResponseAs":"حفظ الاستجابة كمتغير","fluxo.variableName":"userInput","fluxo.useVariableHint":"استخدم {variableName} في الرسائل اللاحقة","fluxo.errorMessage":"رسالة الخطأ (عند إدخال غير صالح)","fluxo.invalidInputDefault":"إدخال غير صالح. يرجى المحاولة مرة أخرى.","fluxo.timeout":"انتهاء المهلة","fluxo.seconds":"ثواني","fluxo.minutes":"دقائق","fluxo.hours":"ساعات","fluxo.timeoutHint":"إذا لم يتم تلقي استجابة صالحة خلال هذا الوقت، سيتم تنفيذ فرع انتهاء المهلة.","fluxo.customRegex":"تعبير عادي مخصص (اختياري)","fluxo.regexPlaceholder":"^[A-Z]{2}[0-9]{4}$","fluxo.customRegexHint":"يتجاوز التحقق من نوع الإدخال بنمط مخصص","fluxo.outputConnections":"اتصالات الإخراج","fluxo.response":"استجابة","fluxo.validInputReceived":"عند استلام إدخال صالح","fluxo.noResponseTimeout":"عند انتهاء المهلة بدون استجابة صالحة","fluxo.validResponse":"استجابة صالحة","fluxo.onInvalidInput":"عند الإدخال غير الصالح:","fluxo.promptMessageInfo":"الرسالة المرسلة للمستخدم لطلب إدخاله. ستظهر قبل انتظار استجابته.","fluxo.inputTypeInfo":"اختر نوع الإدخال المتوقع. سيتحقق النظام من استجابة المستخدم وفقًا لهذا التنسيق.","fluxo.saveResponseAsInfo":"اسم المتغير لتخزين استجابة المستخدم الصالحة. استخدم {اسم_المتغير} في الرسائل اللاحقة لعرض هذه القيمة.","fluxo.errorMessageInfo":"الرسالة المرسلة للمستخدم عندما لا يتطابق إدخاله مع التنسيق المتوقع. سيُطلب منه المحاولة مرة أخرى.","fluxo.timeoutInfo":"الحد الأقصى لوقت انتظار استجابة صالحة. عند التجاوز، يتم تنفيذ فرع انتهاء المهلة بدلاً من فرع الاستجابة.","fluxo.customRegexInfo":"متقدم: قدم نمط تعبير عادي مخصص للتحقق من الإدخال. هذا يتجاوز التحقق من نوع الإدخال المحدد.","fluxo.delayInfo":"وقت الانتظار بالثواني قبل إرسال رسالة المطالبة. مفيد لتدفق المحادثة الطبيعي.","crm.groupAction":"إجراء المجموعة","crm.tabAction":"إجراء التبويب","crm.labelAction":"إجراء الملصق","crm.crmAction":"إجراء CRM","crm.smartWait":"انتظار ذكي","crm.smartWaitDesc":"انتظر وقتًا عشوائيًا بين الرسائل","crm.typingIndicator":"مؤشر الكتابة","crm.typingIndicatorDesc":"إظهار فقاعة الكتابة قبل الإرسال","crm.waitDuration":"مدة الانتظار:","crm.typingDuration":"مدة الكتابة:","crm.randomDelay":"تأخير عشوائي:","crm.randomDelayBetween":"تأخير عشوائي بين","crm.randomBetween":"تأخير عشوائي بين","crm.showsTypingFor":"يظهر مؤشر الكتابة لمدة","crm.showsTyping":"يظهر الكتابة لمدة","crm.typingPreview":"هكذا يظهر مؤشر الكتابة للمتصل","crm.addFluxo":"إضافة تدفق","crm.addFluxoDesc":"تنفيذ تدفق آخر","crm.selectFlowToCall":"اختر التدفق للتنفيذ:","crm.noFlowSelected":"لم يتم اختيار تدفق","crm.passVariables":"تمرير المتغيرات للتدفق المستدعى","crm.passVariablesHint":"ستكون متغيرات التدفق الحالي متاحة في التدفق المستدعى","crm.passVariablesUseCase":'💡 مثال: التدفق الرئيسي يحتوي {name}="أحمد" → رسالة التدفق الفرعي "مرحباً {name}!" → يعرض "مرحباً أحمد!". إيقاف لبدء التدفق الفرعي بدون متغيرات.',"crm.passVariablesShort":"تمرير المتغيرات","crm.continueAfterFlow":"المتابعة بعد انتهاء التدفق المستدعى","crm.continueAfterFlowHint":"إلغاء التحديد لإنهاء المحادثة عند اكتمال التدفق المستدعى","crm.continueAfterFlowUseCase":"💡 مثال: تشغيل = ينتهي التدفق الفرعي الترحيبي → يعود للتدفق الرئيسي. إيقاف = انتهاء التدفق الفرعي = انتهاء المحادثة (مثل تدفق اكتمال الطلب).","crm.continueAfterShort":"المتابعة بعد","crm.circularWarning":"تحذير: تم اكتشاف مرجع دائري!","crm.circularWarningHint":"التدفق المحدد يحتوي على عقدة 'إضافة تدفق' تشير إلى هذا التدفق. قد يتسبب هذا في حلقات لا نهائية.","crm.selectFlowPlaceholder":"اختر تدفقًا...","crm.noOtherFlows":"لا توجد تدفقات أخرى متاحة. أنشئ تدفقًا آخر أولاً.","crm.delayBeforeCalling":"التأخير قبل الاستدعاء (ثواني):","crm.executionSummary":"ملخص التنفيذ:","crm.variablesWillBe":"المتغيرات ستكون","crm.passed":"ممررة","crm.notPassed":"غير ممررة","crm.executeFlow":"تنفيذ","crm.continueToNext":"المتابعة للعقدة التالية","crm.endConversation":"إنهاء المحادثة","crm.selectedFlow":"التدفق المحدد:","crm.addToGroups":"إضافة إلى المجموعات","crm.removeFromGroups":"إزالة من المجموعات","crm.addToTabs":"إضافة إلى التبويبات","crm.removeFromTabs":"إزالة من التبويبات","crm.addLabels":"إضافة ملصقات","crm.removeLabels":"إزالة ملصقات","crm.addToCrmStage":"إضافة إلى مرحلة CRM","crm.removeFromCrm":"إزالة من CRM","crm.actionType":"نوع الإجراء:","crm.selectGroups":"اختر المجموعات:","crm.loadGroups":"تحميل المجموعات","crm.loadGroupsFromWhatsApp":"تحميل المجموعات من WhatsApp Web","crm.selectTabs":"اختر التبويبات:","crm.selectLabels":"اختر الملصقات:","crm.syncLabels":"مزامنة الملصقات","crm.searchLabels":"ابحث عن الملصقات...","crm.searchTabs":"ابحث عن التبويبات...","crm.searchGroups":"ابحث عن المجموعات...","crm.selectCrm":"اختر CRM:","crm.selectStage":"اختر المرحلة:","crm.selectCrmPlaceholder":"اختر CRM...","crm.selectStagePlaceholder":"اختر مرحلة...","crm.noGroupsSelected":"لم يتم اختيار مجموعات","crm.noTabsSelected":"لم يتم اختيار تبويبات","crm.noLabelsSelected":"لم يتم اختيار ملصقات","crm.noCrmSelected":"لم يتم اختيار CRM/مرحلة","crm.noGroupsAvailable":"لا توجد مجموعات متاحة.","crm.noTabsAvailable":"لا توجد تبويبات متاحة.","crm.noCrmsAvailable":"لا توجد CRMs متاحة.","crm.noStagesAvailable":"لا توجد مراحل في هذا CRM.","crm.delay":"التأخير (ثواني):","crm.selectedGroups":"المجموعات:","crm.selectedTabs":"التبويبات:","crm.selectedLabels":"الملصقات:","crm.targetCrmStage":"CRM الهدف → المرحلة:","crm.targetCrm":"CRM الهدف:","crm.schedule":"الجدولة","crm.enableSchedule":"تفعيل الجدولة","crm.startTime":"وقت البدء","crm.endTime":"وقت الانتهاء","crm.crmRules":"قواعد CRM","crm.whenAnyMessage":"عند استلام أي رسالة.","crm.whenKeywordMatch":"عندما تحتوي الرسالة على كلمات مفتاحية.","crm.byKeywordInMessage":"بكلمة مفتاحية في الرسالة","crm.firstMessageDay":"أول رسالة من العميل في اليوم.","crm.reactivationInterval":"فاصل إعادة التنشيط:","crm.generalRules":"القواعد العامة:","crm.allowGroups":"السماح بالرد على المجموعات","crm.scheduleEnabled":"السماح بالردود فقط في أيام وأوقات محددة","crm.dontRespondIfOpen":"عدم الرد إذا كانت المحادثة مفتوحة","crm.customSignature":"تخصيص أو تعطيل التوقيع","crm.simulateTyping":"محاكاة الكتابة أو تسجيل الصوت","crm.dontRespondIfInCRM":"عدم الرد إذا كان جهة الاتصال في CRM","crm.dontRespondToCRMs":"عدم الرد على CRMs","crm.respondOnlyToCRMs":"الرد فقط على CRMs","crm.enableCrmRules":"تفعيل قواعد علامات CRM","crm.selectCrmTabs":"اختر علامات CRM","crm.tagRules":"قواعد العلامات","crm.labelRules":"قواعد الملصقات:","crm.dontRespondIfLabeled":"لا ترد إذا كان لدى جهة الاتصال ملصق","crm.dontRespondToLabels":"لا ترد على هذه الملصقات","crm.respondOnlyToLabels":"رد فقط على هذه الملصقات","crm.selectLabelsNotToReply":"اختر الملصقات لعدم الرد عليها:","crm.selectLabelsToReply":"اختر الملصقات للرد عليها:","crm.clickToSelect":"انقر للاختيار","crm.labelsNotReplied":"الملصقات التي لن يتم الرد عليها:","crm.labelsToReply":"الملصقات التي سيتم الرد عليها:","crm.customTabRules":"قواعد علامات التبويب المخصصة:","crm.dontRespondIfInCustomTab":"لا ترد إذا كانت جهة الاتصال في علامة تبويب مخصصة","crm.dontRespondToCustomTabs":"لا ترد على علامات التبويب المخصصة هذه","crm.respondOnlyToCustomTabs":"رد فقط على علامات التبويب المخصصة هذه","crm.selectCustomTabsNotToReply":"اختر علامات التبويب المخصصة لعدم الرد عليها:","crm.selectCustomTabsToReply":"اختر علامات التبويب المخصصة للرد عليها:","crm.customTabsNotReplied":"علامات التبويب المخصصة التي لن يتم الرد عليها:","crm.customTabsToReply":"علامات التبويب المخصصة التي سيتم الرد عليها:","crm.noCustomTabsAvailable":"لا توجد علامات تبويب مخصصة. أنشئ واحدة أولاً.","crm.pauseRules":"قواعد الإيقاف المؤقت:","crm.enablePause":"تفعيل الإيقاف المؤقت","crm.pauseClientKeywords":"كلمات إيقاف العميل","crm.pauseClientPlaceholder":"إيقاف الدردشة الآلية مؤقتاً إذا أرسل المستلم...","crm.pauseServerKeywords":"كلمات إيقاف الخادم","crm.pauseServerPlaceholder":"إيقاف مؤقت عندما يرسل البوت...","crm.pauseDuration":"مدة الإيقاف المؤقت (ساعة:دقيقة)","crm.tipPauseTitle":"قواعد الإيقاف المؤقت","crm.tipPauseDesc":"إيقاف الدردشة الآلية مؤقتاً عند اكتشاف كلمات مفتاحية محددة. استخدم كلمات العميل للسماح للعملاء بإيقاف البوت، أو كلمات الخادم للإيقاف التلقائي بعد إرسال رسائل معينة.","crm.tipPauseEx1":"العميل يقول 'توقف' ← البوت يتوقف مؤقتاً","crm.tipPauseEx2":"العميل يقول 'بشري' ← التحويل إلى وكيل","crm.tipPauseEx3":"البوت يرسل 'جاري الاتصال...' ← إيقاف تلقائي","crm.tipPauseClientTitle":"كلمات إيقاف العميل","crm.tipPauseClientDesc":"كلمات مفتاحية عندما يرسلها العميل ستوقف الدردشة الآلية مؤقتاً لهذه المحادثة. مفيد لسيناريوهات التحويل لموظف بشري.","crm.tipPauseClientEx1":"العميل يكتب 'توقف' أو 'stop'","crm.tipPauseClientEx2":"العميل يكتب 'بشري' أو 'موظف'","crm.tipPauseClientEx3":"البوت يتوقف عن الرد للمدة المحددة","crm.tipPauseServerTitle":"كلمات إيقاف الخادم","crm.tipPauseServerDesc":"كلمات مفتاحية عندما يرسلها البوت ستوقف الدردشة الآلية تلقائياً. مفيد عند التحويل لوكلاء بشريين.","crm.tipPauseServerEx1":"البوت يرسل 'جاري توصيلك بوكيل...'","crm.tipPauseServerEx2":"البوت يرسل 'يرجى الانتظار، جاري التحويل...'","crm.tipPauseServerEx3":"التدفق يتوقف تلقائياً بعد هذه الرسالة","crm.tipPauseDurationTitle":"مدة الإيقاف المؤقت","crm.tipPauseDurationDesc":"حدد المدة التي سيبقى فيها الدردشة الآلية متوقفة مؤقتاً بعد اكتشاف كلمة إيقاف. التنسيق: ساعات:دقائق (مثال، 00:30 = 30 دقيقة).","crm.tipPauseDurationEx1":"00:30 = إيقاف مؤقت 30 دقيقة","crm.tipPauseDurationEx2":"01:00 = إيقاف مؤقت ساعة واحدة","crm.tipPauseDurationEx3":"بعد انتهاء المدة، يبقى متوقفاً حتى محفز جديد","crm.enableTagRules":"تفعيل قواعد ملصقات WhatsApp","crm.editBlock":"تحرير الكتلة:","crm.close":"إغلاق","crm.startNode":"البداية","crm.startNodeInfo":"هذه هي نقطة بداية التدفق. قم بتوصيلها بكتل أخرى لبناء الدردشة الآلية.","crm.editTextMessage":"تحرير الرسالة النصية:","crm.typeTheText":"اكتب النص","crm.saveResponseInVariable":"حفظ الرد في المتغير:","crm.typeVariableName":"اكتب اسم المتغير","crm.variableHint":"سيخزن المتغير رد العميل من الكتلة الحالية، ويمكن استخدامه في الكتل التالية","crm.insertImage":"إدراج صورة:","crm.clickToUpload":"انقر للإرسال أو اسحب الملفات هنا","crm.imageFormats":"صورة: PNG، JPG، JPEG، GIF (الحد الأقصى 16MB - حد WhatsApp)","crm.imageCaption":"تعليق الصورة (اختياري)","crm.insertVideo":"إدراج فيديو:","crm.insertAudio":"إدراج صوت:","crm.insertDocument":"إدراج مستند:","crm.caption":"التعليق:","crm.captionOptional":"التعليق (اختياري)","crm.questionMessage":"رسالة السؤال:","crm.typeQuestion":"اكتب سؤالك...","crm.responseOptions":"خيارات الرد:","crm.addOption":"إضافة خيار","crm.buttonText":"نص الزر:","crm.title":"العنوان:","crm.listTitleOptional":"عنوان القائمة (اختياري)","crm.listDescOptional":"الوصف (اختياري)","crm.listSectionsHint":"قم بتكوين أقسام القائمة والعناصر في الإعدادات المتقدمة.","crm.globalSettings":"الإعدادات العامة:","crm.editAwayMessage":"تحرير رسالة الغياب:","crm.awayMessagePlaceholder":"اكتب الرسالة التي سترسل عندما لا يرد المستخدم...","crm.waitingTime":"وقت الانتظار:","crm.waitingTimeWarning":"عند إعادة تحميل صفحة WhatsApp، ستفقد هذه الإعدادات للمحادثات التي تنتظر الرد","crm.minutes":"دقائق","crm.hours":"ساعات","crm.seconds":"ثواني","crm.awayMessageInfo":"سترسل هذه الرسالة تلقائياً عندما لا يرد المستخدم في الوقت المحدد.","crm.blockInterval":"فترة الكتلة:","crm.blockIntervalInfo":"حدد الفترة الافتراضية بين إرسال كتل التدفق.","crm.chatSimulator":"محاكي الدردشة","crm.startConversation":"ابدأ محادثة بإرسال رسالة","crm.typeMessageHere":"اكتب رسالتك هنا...","crm.callNextBlock":"استدعاء الكتلة التالية","crm.whenItemSelected":"عند تحديد عنصر","crm.whenResponding":"عند الرد","crm.defaultNext":"افتراضي (لا تطابق)","crm.message":"الرسالة:","crm.listButton":"نص الزر:","crm.items":"عناصر","crm.listItems":"عناصر القائمة:","crm.addItem":"إضافة عنصر","crm.insertVariable":"إدراج متغير","crm.contactName":"اسم جهة الاتصال","crm.currentDate":"التاريخ الحالي","crm.currentTime":"الوقت الحالي","crm.defaultOption1":"الخيار 1","crm.defaultOption2":"الخيار 2","crm.noListItems":"لا توجد عناصر. انقر على تحرير للإضافة.","crm.send_text":"إرسال نص","crm.send_image":"إرسال صورة","crm.send_video":"إرسال فيديو","crm.send_audio":"إرسال صوت","crm.send_document":"إرسال مستند","crm.send_list":"إرسال قائمة","crm.group_action":"إجراء المجموعة","crm.tab_action":"إجراء التبويب","crm.label_action":"إجراء التصنيف","crm.crm_action":"إجراء CRM","crm.wait_input":"انتظار الإدخال","crm.smart_wait":"انتظار ذكي","crm.typing_indicator":"مؤشر الكتابة","crm.add_fluxo":"إضافة تدفق","crm.timezone":"المنطقة الزمنية:","crm.day":"اليوم","crm.sunday":"الأحد","crm.monday":"الإثنين","crm.tuesday":"الثلاثاء","crm.wednesday":"الأربعاء","crm.thursday":"الخميس","crm.friday":"الجمعة","crm.saturday":"السبت","crm.disableSignature":"تعطيل التوقيع","crm.customizeSignatureName":"تخصيص اسم التوقيع","crm.enterCustomSignature":"أدخل اسم التوقيع المخصص","crm.tipAnyMsgTitle":"مُشغِّل أي رسالة","crm.tipAnyMsgDesc":"سيبدأ التدفق عند استلام أي رسالة من العميل، بغض النظر عن المحتوى.","crm.tipAnyMsgEx1":"رد تلقائي عام لجميع الرسائل","crm.tipAnyMsgEx2":"رسالة غياب عند عدم التوفر","crm.tipAnyMsgEx3":"قد يُشغَّل بشكل متكرر جداً - استخدم مع فاصل إعادة التنشيط","crm.tipKeywordTitle":"مُشغِّل الكلمة المفتاحية","crm.tipKeywordDesc":"يبدأ التدفق فقط عندما تحتوي الرسالة على إحدى الكلمات المفتاحية المحددة.","crm.tipKeywordEx1":"'مرحبا' يُشغِّل تدفق الترحيب","crm.tipKeywordEx2":"'السعر' يُشغِّل معلومات المنتج","crm.tipKeywordEx3":"'مساعدة' يُشغِّل قائمة الدعم","crm.tipFirstDayTitle":"أول رسالة في اليوم","crm.tipFirstDayDesc":"يُشغَّل التدفق فقط عند أول رسالة مستلمة كل يوم من كل جهة اتصال.","crm.tipFirstDayEx1":"تحية 'صباح الخير' مرة واحدة يومياً فقط","crm.tipFirstDayEx2":"عرض يومي خاص لكل جهة اتصال","crm.tipFirstDayEx3":"يُعاد التعيين في منتصف الليل حسب المنطقة الزمنية","crm.tipFirstEverTitle":"أول رسالة على الإطلاق","crm.tipFirstEverDesc":"يُشغَّل التدفق فقط في المرة الأولى التي يرسل فيها جهة الاتصال رسالة.","crm.tipFirstEverEx1":"رسالة ترحيب لجهات الاتصال الجديدة","crm.tipFirstEverEx2":"سلسلة إعداد للعملاء الجدد","crm.tipFirstEverEx3":"تعيين CRM أولي للعملاء المحتملين الجدد","crm.tipReactivationTitle":"فاصل إعادة التنشيط","crm.tipReactivationDesc":"الحد الأدنى للوقت قبل أن يُشغَّل نفس التدفق مرة أخرى لنفس جهة الاتصال.","crm.tipReactivationEx1":"3600 ثانية = انتظر ساعة واحدة قبل إعادة التشغيل","crm.tipReactivationEx2":"يمنع الرسائل المزعجة للردود التلقائية","crm.tipReactivationEx3":"استخدم 0 للسماح بتشغيل غير محدود","crm.tipSendTextTitle":"إرسال رسالة نصية","crm.tipSendTextDesc":"يرسل رسالة نصية عادية إلى جهة الاتصال. يدعم المتغيرات مثل {name}، {phone}.","crm.tipSendTextEx1":"رسائل ترحيب مُخصَّصة","crm.tipSendTextEx2":"تأكيدات الطلبات","crm.tipSendImageTitle":"إرسال صورة","crm.tipSendImageDesc":"يرسل ملف صورة مع تعليق اختياري. يدعم PNG، JPG، GIF.","crm.tipSendImageEx1":"صور المنتجات","crm.tipSendImageEx2":"المواد الترويجية","crm.tipSendVideoTitle":"إرسال فيديو","crm.tipSendVideoDesc":"يرسل ملف فيديو مع تعليق اختياري. يدعم MP4، MOV.","crm.tipSendVideoEx1":"عروض المنتجات التوضيحية","crm.tipSendVideoEx2":"فيديوهات تعليمية","crm.tipSendAudioTitle":"إرسال صوت","crm.tipSendAudioDesc":"يرسل ملف صوتي أو مذكرة صوتية. يدعم MP3، OGG، WAV.","crm.tipSendAudioEx1":"رسائل صوتية مُسجَّلة مسبقاً","crm.tipSendAudioEx2":"إعلانات صوتية","crm.tipSendDocTitle":"إرسال مستند","crm.tipSendDocDesc":"يرسل أي نوع ملف كمستند. يدعم PDF، DOC، XLS، إلخ.","crm.tipSendDocEx1":"كتالوجات الأسعار","crm.tipSendDocEx2":"العقود والاتفاقيات","crm.tipSendListTitle":"إرسال رسالة قائمة","crm.tipSendListDesc":"يرسل قائمة تفاعلية مع أقسام وعناصر قابلة للتحديد.","crm.tipSendListEx1":"قوائم المنتجات حسب الفئة","crm.tipSendListEx2":"خيارات الخدمات","crm.tipGroupActionTitle":"إجراء مجموعة واتساب","crm.tipGroupActionDesc":"يضيف أو يزيل جهة الاتصال الحالية من مجموعات واتساب.","crm.tipGroupActionEx1":"إضافة عملاء VIP إلى مجموعة حصرية","crm.tipGroupActionEx2":"الإزالة من مجموعة الدعم بعد الحل","crm.tipTabActionTitle":"إجراء علامة تبويب مخصصة","crm.tipTabActionDesc":"يضيف أو يزيل جهة الاتصال الحالية من علامات التبويب المخصصة في CRM.","crm.tipTabActionEx1":"نقل العميل المحتمل إلى علامة تبويب 'مؤهل'","crm.tipTabActionEx2":"الإزالة من علامة تبويب 'استفسار جديد'","crm.tipLabelActionTitle":"إجراء تصنيف واتساب","crm.tipLabelActionDesc":"يضيف أو يزيل تصنيفات واتساب من جهة الاتصال الحالية.","crm.tipLabelActionEx1":"إضافة تصنيف 'تم الرد'","crm.tipLabelActionEx2":"إزالة تصنيف 'قيد الانتظار'","crm.tipCrmActionTitle":"إجراء مرحلة CRM","crm.tipCrmActionDesc":"ينقل جهة الاتصال الحالية إلى مرحلة محددة في لوحة CRM كانبان.","crm.tipCrmActionEx1":"النقل إلى مرحلة 'التفاوض'","crm.tipCrmActionEx2":"النقل إلى مرحلة 'مُغلَق مكسوب'","crm.tipSmartWaitTitle":"انتظار ذكي","crm.tipSmartWaitDesc":"يضيف تأخيراً عشوائياً بين الإجراءات ليبدو أكثر إنسانية.","crm.tipSmartWaitEx1":"انتظار 2-5 ثوانٍ بين الرسائل","crm.tipSmartWaitEx2":"محاكاة وقت القراءة الطبيعي","crm.tipTypingTitle":"مؤشر الكتابة","crm.tipTypingDesc":"يعرض فقاعة 'يكتب...' قبل إرسال الرسالة ليبدو أكثر إنسانية.","crm.tipTypingEx1":"عرض الكتابة لمدة 3 ثوانٍ قبل الرسالة","crm.tipTypingEx2":"يجعل الردود تبدو أكثر طبيعية","crm.tipAllowGroupsTitle":"السماح بالمجموعات","crm.tipAllowGroupsDesc":"عند التفعيل، سيرد روبوت المحادثة في المجموعات أيضاً. عند التعطيل، المحادثات الخاصة فقط تُشغّل التدفق.","crm.tipAllowGroupsEx1":"تشغيل: الرد في المجموعات والخاص","crm.tipAllowGroupsEx2":"إيقاف: الرد في الخاص فقط","crm.tipScheduleTitle":"جدولة الردود","crm.tipScheduleDesc":"تقييد روبوت المحادثة للعمل في أوقات/أيام محددة فقط. قم بتكوين الجدول أدناه.","crm.tipScheduleEx1":"ساعات العمل فقط (9 ص - 6 م)","crm.tipScheduleEx2":"أيام العمل فقط (الإثنين-الجمعة)","crm.tipScheduleEx3":"رد تلقائي خارج الساعات","crm.tipDontRespondOpenTitle":"عدم الرد إذا كانت مفتوحة","crm.tipDontRespondOpenDesc":"يمنع روبوت المحادثة من إرسال رسائل إذا كانت تلك المحادثة مفتوحة بالفعل في واتساب ويب.","crm.tipDontRespondOpenEx1":"مفيد عندما تتحدث بنشاط","crm.tipDontRespondOpenEx2":"يمنع الروبوت من مقاطعة محادثتك","crm.tipSimulateTypingTitle":"محاكاة الكتابة","crm.tipSimulateTypingDesc":"يعرض مؤشر 'يكتب...' قبل الإرسال، مما يجعل الردود تبدو أكثر إنسانية.","crm.tipSimulateTypingEx1":'يعرض "يكتب..." للرسائل النصية',"crm.tipSimulateTypingEx2":'يعرض "يسجل..." للصوت',"crm.tipSimulateTypingEx3":"يجعل الروبوت يبدو أكثر طبيعية","crm.tipSkipCRMTitle":"تخطي جهات اتصال CRM","crm.tipSkipCRMDesc":"لن يرد روبوت المحادثة على جهات الاتصال المضافة مسبقاً لـ CRM. مفيد للعملاء الحاليين.","crm.tipSkipCRMEx1":"رد تلقائي فقط لجهات الاتصال الجديدة","crm.tipSkipCRMEx2":"تخطي جهات اتصال CRM الحالية","crm.tipExcludeCRMTitle":"استبعاد مراحل CRM محددة","crm.tipExcludeCRMDesc":"حدد مراحل كانبان CRM محددة للاستبعاد. جهات الاتصال في تلك المراحل لن تتلقى رسائل الروبوت.","crm.tipExcludeCRMEx1":'استبعاد مرحلة "عملاء VIP"',"crm.tipExcludeCRMEx2":'استبعاد مرحلة "عدم الإزعاج"',"crm.tipIncludeCRMTitle":"تضمين مراحل CRM محددة فقط","crm.tipIncludeCRMDesc":"سيرد روبوت المحادثة فقط على جهات الاتصال في مراحل كانبان CRM المحددة. يتم تجاهل الآخرين.","crm.tipIncludeCRMEx1":'الرد فقط على مرحلة "العملاء المحتملين"',"crm.tipIncludeCRMEx2":'الرد فقط على مرحلة "الصفقات النشطة"',"crm.tipSkipLabeledTitle":"تخطي جهات الاتصال المصنفة","crm.tipSkipLabeledDesc":"لن يرد روبوت المحادثة على أي جهة اتصال لديها تصنيف واتساب.","crm.tipSkipLabeledEx1":"أي جهة اتصال مصنفة يتم تخطيها","crm.tipSkipLabeledEx2":"فقط جهات الاتصال غير المصنفة تتلقى ردوداً","crm.tipExcludeLabelTitle":"استبعاد تصنيفات محددة","crm.tipExcludeLabelDesc":"حدد تصنيفات واتساب محددة للاستبعاد. جهات الاتصال بتلك التصنيفات لن تتلقى رسائل الروبوت.","crm.tipExcludeLabelEx1":'استبعاد جهات الاتصال المصنفة "بريد مزعج"',"crm.tipExcludeLabelEx2":'استبعاد جهات الاتصال المصنفة "محظور"',"crm.tipIncludeLabelTitle":"تضمين تصنيفات محددة فقط","crm.tipIncludeLabelDesc":"سيرد روبوت المحادثة فقط على جهات الاتصال بتصنيفات واتساب المحددة. يتم تجاهل الآخرين.","crm.tipIncludeLabelEx1":'الرد فقط على المصنفين "VIP"',"crm.tipIncludeLabelEx2":'الرد فقط على المصنفين "أولوية"',"crm.tipSkipCustomTabTitle":"تخطي جهات اتصال التبويبات المخصصة","crm.tipSkipCustomTabDesc":"لن يرد روبوت المحادثة على أي جهة اتصال مُعينة لتبويب مخصص.","crm.tipSkipCustomTabEx1":'جهة اتصال في تبويب "عملاء VIP" ← لا رد',"crm.tipSkipCustomTabEx2":"جهة اتصال ليست في أي تبويب ← الروبوت يرد","crm.tipExcludeCustomTabTitle":"استبعاد تبويبات مخصصة محددة","crm.tipExcludeCustomTabDesc":"حدد تبويبات مخصصة محددة للاستبعاد. جهات الاتصال في تلك التبويبات لن تتلقى رسائل الروبوت.","crm.tipExcludeCustomTabEx1":'استبعاد جهات اتصال تبويب "محظور"',"crm.tipExcludeCustomTabEx2":'استبعاد جهات اتصال تبويب "تمت المعالجة"',"crm.tipIncludeCustomTabTitle":"تضمين تبويبات مخصصة محددة فقط","crm.tipIncludeCustomTabDesc":"سيرد روبوت المحادثة فقط على جهات الاتصال في التبويبات المخصصة المحددة. يتم تجاهل الآخرين.","crm.tipIncludeCustomTabEx1":'الرد فقط على تبويب "العملاء المحتملين النشطين"',"crm.tipIncludeCustomTabEx2":'الرد فقط على تبويب "VIP"',"templates.addCategory":"إضافة فئة","templates.editCategory":"تعديل الفئة","templates.deleteCategory":"حذف الفئة","templates.manageCategories":"إدارة","templates.categoryName":"اسم الفئة","templates.categoryIcon":"الأيقونة","templates.categoryColor":"اللون","templates.update":"تحديث","templates.form.category":"الفئة","templates.form.categoryHint":"تنظيم القوالب في فئات لسهولة الوصول","templates.allTemplates":"جميع القوالب","templates.quickReplyCategory":"رد سريع","templates.uncategorized":"غير مصنف","templates.sortNewest":"الأحدث","templates.sortOldest":"الأقدم","templates.sortNameAZ":"الاسم أ-ي","templates.sortNameZA":"الاسم ي-أ","templates.confirmDeleteCategory":"هل أنت متأكد من حذف هذه الفئة؟ سيتم نقل القوالب إلى غير مصنف.","templates.confirmDeleteTemplate":"هل أنت متأكد من حذف هذا القالب؟","templates.noCategoriesYet":"لا توجد فئات بعد","templates.createCategoryDescription":"أنشئ فئات لتنظيم قوالبك","templates.done":"تم","templates.deleteCategoryWarning":"ستصبح القوالب في هذه الفئة غير مصنفة.","templates.delete":"حذف","templates.noTemplatesInCategory":"لا توجد قوالب في هذه الفئة","templates.createFirstDescription":"أنشئ أول قالب للبدء","followUp.title":"المتابعة","followUp.newFollowUp":"متابعة جديدة","followUp.confirmDelete":"هل أنت متأكد من حذف هذه المتابعة؟","followUp.emptyTitle":"لم يتم تحديد متابعة","followUp.emptyText":"اختر متابعة من القائمة أو أنشئ واحدة جديدة للبدء بتسلسلات الرسائل التلقائية.","followUp.createNew":"إنشاء جديد","followUp.loading":"جاري التحميل...","followUp.noFollowUps":"لا توجد متابعات بعد","followUp.createFirst":"أنشئ أول تسلسل متابعة","followUp.active":"نشط","followUp.paused":"متوقف","followUp.labels":"التصنيفات","followUp.customTabs":"التبويبات المخصصة","followUp.groups":"المجموعات","followUp.kanban":"كانبان","followUp.onEnter":"عند الدخول","followUp.onLeave":"عند الخروج","followUp.afterTime":"بعد وقت","followUp.steps":"خطوات","followUp.pause":"إيقاف","followUp.activate":"تفعيل","followUp.duplicate":"نسخ","followUp.delete":"حذف","followUp.name":"اسم المتابعة","followUp.namePlaceholder":"أدخل اسم المتابعة...","followUp.nameRequired":"الرجاء إدخال اسم للمتابعة","followUp.funnelRequired":"الرجاء تحديد عنصر واحد على الأقل من القمع","followUp.stepsRequired":"الرجاء إضافة خطوة واحدة على الأقل","followUp.funnelSettings":"إعدادات القمع","followUp.selectFunnelItems":"حدد العناصر لتشغيل هذه المتابعة","followUp.comingSoon":"المُحدد قريباً","followUp.triggerSettings":"مُشغل المتابعة","followUp.onEnterDesc":"التشغيل عند دخول جهة الاتصال للقمع","followUp.onLeaveDesc":"التشغيل عند خروج جهة الاتصال من القمع","followUp.afterTimeDesc":"التشغيل بعد فترة زمنية محددة","followUp.days":"أيام","followUp.day":"يوم","followUp.hours":"ساعات","followUp.minutes":"دقائق","followUp.value":"القيمة","followUp.unit":"الوحدة","followUp.time":"الوقت","followUp.scheduleConfiguration":"تكوين الجدول الزمني","followUp.enableSchedule":"تفعيل الجدول المتقدم","followUp.enableScheduleDesc":"(إرسال فقط في أيام/تواريخ محددة)","followUp.scheduleDisabledInfo":"قم بتفعيل الجدول المتقدم أعلاه لتكوين أيام/تواريخ محددة لإرسال الرسائل.","followUp.tooltip.scheduleTitle":"تكوين الجدول الزمني - متى نرسل؟","followUp.tooltip.scheduleContent":"قم بتكوين أيام/تواريخ محددة لتنفيذ المتابعة. يعمل مع أي نوع من المُشغلات. اختر جداول يومية أو أسبوعية أو شهرية أو سنوية.","followUp.tooltip.scheduleExample":"اضبط جدولاً أسبوعياً للإثنين والأربعاء والجمعة لإرسال الرسائل في تلك الأيام فقط.","followUp.messagesConfiguredInSchedule":"الرسائل مُكوّنة في الجدول","followUp.messagesConfiguredInScheduleDesc":'لقد قمت بتفعيل "رسالة مختلفة لكل يوم" في قسم تكوين الجدول الزمني أعلاه. يتم تكوين الرسائل هناك لكل يوم محدد.',"followUp.stepsTitle":"خطوات المتابعة","followUp.step":"خطوة","followUp.actions":"إجراءات","followUp.addStep":"إضافة خطوة متابعة","followUp.rulesTitle":"قواعد التشغيل","followUp.cancelOnReply":"إلغاء عند رد العميل","followUp.allowGroups":"السماح بالرد في المجموعات","followUp.customSignature":"تخصيص التوقيع","followUp.signatureText":"نص التوقيع","followUp.signaturePlaceholder":"أدخل توقيعك...","followUp.maxExecutions":"الحد الأقصى لكل جهة اتصال","followUp.cooldownDays":"فترة الانتظار (أيام)","followUp.cancel":"إلغاء","followUp.create":"إنشاء المتابعة","followUp.save":"حفظ التغييرات","followUp.saving":"جاري الحفظ...","followUp.saved":"تم الحفظ!","followUp.back":"← رجوع","followUp.next":"التالي →","followUp.backToList":"← العودة للقائمة","followUp.wizardStep1":"الإعداد","followUp.wizardStep2":"الرسائل","followUp.wizardStep3":"الجدولة","followUp.wizardStep4":"الإجراءات","followUp.wizardStep5":"القواعد","followUp.followUps":"المتابعات","followUp.stepName":"اسم الخطوة (اختياري)","followUp.stepNamePlaceholder":"مثال: الاتصال الأول، متابعة 1...","followUp.timing":"التوقيت","followUp.mode":"الوضع","followUp.relative":"نسبي","followUp.specific":"محدد","followUp.type":"النوع","followUp.daily":"يومياً","followUp.weekly":"أسبوعياً","followUp.monthly":"شهرياً","followUp.condition":"الشرط","followUp.conditionAlways":"دائماً","followUp.conditionIfReplied":"إذا ردّ","followUp.conditionIfNotReplied":"إذا لم يردّ","followUp.conditionIfKeyword":"إذا كلمة مفتاحية","followUp.conditionIfNotKeyword":"إذا لا كلمة مفتاحية","followUp.conditionIfInFunnel":"إذا في القمع","followUp.conditionIfNotInFunnel":"إذا خرج من القمع","followUp.keywords":"الكلمات المفتاحية (مفصولة بفاصلة)","followUp.keywordsPlaceholder":"نعم، حسناً، مهتم...","followUp.actionsTitle":"الإجراءات","followUp.actionsRequired":"الرجاء إضافة إجراء واحد على الأقل","followUp.addAction":"+ إضافة إجراء","followUp.postActionsTitle":"إجراءات لاحقة","followUp.groupActions":"إجراءات المجموعة","followUp.addToGroups":"إضافة إلى المجموعات","followUp.removeFromGroups":"إزالة من المجموعات","followUp.customTabActions":"إجراءات التبويب المخصص","followUp.addToTabs":"إضافة إلى التبويبات","followUp.removeFromTabs":"إزالة من التبويبات","followUp.labelsActions":"إجراءات التصنيفات","followUp.addLabels":"إضافة تصنيفات","followUp.removeLabels":"إزالة تصنيفات","followUp.kanbanBoardActions":"إجراءات كانبان","followUp.addToKanban":"إضافة إلى المرحلة","followUp.removeFromKanban":"إزالة من المرحلة","followUp.selectStage":"اختر المرحلة...","followUp.noGroupsAvailable":"لا توجد مجموعات متاحة","followUp.noTabsAvailable":"لا توجد تبويبات متاحة","followUp.noLabelsAvailable":"لا توجد تصنيفات متاحة","followUp.noKanbanAvailable":"لا توجد لوحات كانبان متاحة","followUp.moveUp":"تحريك لأعلى","followUp.moveDown":"تحريك لأسفل","followUp.removeStep":"إزالة الخطوة","followUp.message":"الرسالة","followUp.messagePlaceholder":"اكتب رسالتك هنا...","followUp.variables":"المتغيرات","followUp.clickToInsert":"انقر لإدراج متغير:","followUp.minDelay":"الحد الأدنى للتأخير (ثانية)","followUp.maxDelay":"الحد الأقصى للتأخير (ثانية)","followUp.addMessage":"إضافة رسالة","followUp.removeMessage":"إزالة الرسالة","followUp.selectLabels":"اختر التصنيفات...","followUp.selectTabs":"اختر التبويبات المخصصة...","followUp.selectKanbanStage":"اختر CRM كانبان والمرحلة...","followUp.selectGroups":"اختر مجموعات واتساب...","followUp.selectorComingSoon":"المُحدد قريباً","followUp.webhookUrl":"رابط Webhook","followUp.includeContactData":"تضمين بيانات جهة الاتصال","followUp.search":"بحث...","followUp.noLabels":"لم يتم العثور على تصنيفات. أنشئ تصنيفات في واتساب أولاً.","followUp.noTabs":"لم يتم العثور على تبويبات مخصصة. أنشئ تبويبات من شريط التبويبات.","followUp.noGroups":"لم يتم العثور على مجموعات واتساب.","followUp.noStages":"لم يتم العثور على مراحل كانبان. أنشئ CRM ومراحل أولاً.","followUp.fluxoCategory":"الفئة","followUp.allCategories":"جميع الفئات","followUp.uncategorized":"غير مصنف","followUp.selectFluxo":"اختر Fluxo","followUp.chooseFluxo":"-- اختر Fluxo --","followUp.fluxoInfo":"سيتم تشغيل تدفق الروبوت المحدد عند تنفيذ هذه المتابعة.","followUp.messageText":"نص الرسالة","followUp.templatesType":"نوع القالب","followUp.tooltip.nameTitle":"اسم المتابعة","followUp.tooltip.nameContent":"أعطِ اسماً وصفياً لتحديد هذه سلسلة المتابعة. استخدم أسماء واضحة تصف الغرض.","followUp.tooltip.nameExample":"مثال: 'ترحيب عميل جديد'، 'تذكير بالدفع'، 'طلب ملاحظات'","followUp.tooltip.categoryTitle":"الفئة","followUp.tooltip.categoryContent":"نظّم متابعاتك في فئات لإدارة أفضل. اختر فئة أو اتركها غير مصنفة.","followUp.tooltip.funnelTitle":"إعدادات القمع - أين يُشغَّل؟","followUp.tooltip.funnelContent":"اختر التصنيفات أو التبويبات المخصصة أو المجموعات أو مراحل كانبان التي ستُشغّل هذه سلسلة المتابعة. عندما يدخل جهة الاتصال القمع المحدد، تبدأ المتابعة.","followUp.tooltip.funnelExample":"مثال: اختر تصنيف 'عميل جديد' ← عندما يحصل أي جهة اتصال على هذا التصنيف، تبدأ المتابعة تلقائياً.","followUp.tooltip.triggerTitle":"مُشغِّل المتابعة - متى تبدأ؟","followUp.tooltip.triggerContent":"يحدد متى تبدأ سلسلة المتابعة بعد حدث القمع. عند الدخول: فوراً عند دخول جهة الاتصال. عند الخروج: عند خروج جهة الاتصال. بعد وقت: انتظر X وقت قبل البدء.","followUp.tooltip.triggerExample":"مثال: 'بعد وقت' + ساعتين = تبدأ المتابعة بعد ساعتين من دخول جهة الاتصال القمع.","followUp.tooltip.actionsTitle":"الإجراءات - ماذا تفعل؟","followUp.tooltip.actionsContent":"حدد ما يحدث عند تشغيل المتابعة. تُنفَّذ جميع الإجراءات في وقت التشغيل. أضف رسائل، غيّر التصنيفات، انقل إلى مراحل كانبان، أو شغّل webhooks.","followUp.tooltip.actionsExample":"مثال: إرسال رسالة ترحيب ← إضافة تصنيف 'تم التواصل' ← نقل إلى مرحلة 'قيد التقدم'.","followUp.tooltip.rulesTitle":"قواعد التشغيل - التحكم بالسلوك","followUp.tooltip.rulesContent":"اضبط كيفية عمل المتابعة. إلغاء عند الرد يوقف التسلسل إذا ردّ العميل. السماح بالمجموعات يمكّن الإرسال في المحادثات الجماعية. التوقيع المخصص يضيف نصك في نهاية الرسائل.","followUp.tooltip.rulesExample":"أفضل ممارسة: فعّل 'إلغاء عند الرد' لتجنب إرسال رسائل مزعجة للعملاء الذين ردّوا بالفعل.","followUp.tooltip.cancelOnReplyTitle":"إلغاء عند رد العميل","followUp.tooltip.cancelOnReplyContent":"يوقف تلقائياً جميع رسائل المتابعة المعلقة لجهة اتصال عندما ترسل لك أي رسالة. هذا يمنع إرسال متابعات غير ضرورية للعملاء الذين ردّوا بالفعل.","followUp.tooltip.cancelOnReplyExample":"• مُفعَّل: تتوقف المتابعة إذا ردّ العميل قبل الإرسال\n• مُعطَّل: تُرسَل المتابعة بغض النظر عن رسائل العميل","followUp.tooltip.allowGroupsTitle":"السماح بالرد في المجموعات","followUp.tooltip.allowGroupsContent":"يتحكم فيما إذا كانت هذه المتابعة يمكنها إرسال رسائل لمجموعات واتساب. افتراضياً، تعمل المتابعات فقط لجهات الاتصال الفردية (محادثات 1-إلى-1).","followUp.tooltip.allowGroupsExample":"• مُفعَّل: تعمل المتابعة للمحادثات الفردية والمجموعات\n• مُعطَّل: تعمل المتابعة لجهات الاتصال الفردية فقط","followUp.tooltip.signatureTitle":"تخصيص التوقيع","followUp.tooltip.signatureContent":"يضيف توقيعاً مخصصاً في نهاية كل رسالة متابعة. مفيد للعلامة التجارية أو تحديد الرسائل التلقائية.","followUp.tooltip.signatureExample":"مثال: رسالتك 'مرحباً، أتحقق فقط!' تصبح 'مرحباً، أتحقق فقط!\\n\\n~ فريق CRM'","followUp.tooltip.maxExecutionsTitle":"الحد الأقصى للتنفيذات - كم مرة؟","followUp.tooltip.maxExecutionsContent":"يتحكم في عدد المرات التي يمكن لهذه المتابعة إرسال رسائل لنفس جهة الاتصال. بمجرد وصول جهة اتصال لهذا الحد، لن تتلقى هذه المتابعة مرة أخرى.","followUp.tooltip.maxExecutionsExample":"• اضبط 0 = غير محدود (بدون حد)\n• اضبط 1 = مرة واحدة فقط لكل جهة اتصال\n• اضبط 3 = جهة الاتصال تتلقى أقصى 3 مرات","followUp.tooltip.cooldownTitle":"فترة الانتظار - الانتظار قبل إعادة التشغيل","followUp.tooltip.cooldownContent":"بعد أن تتلقى جهة اتصال هذه المتابعة، كم يوماً تنتظر قبل أن تتمكن من تلقيها مرة أخرى. هذا يمنع إرسال رسائل مزعجة لنفس جهة الاتصال بشكل متكرر.","followUp.tooltip.cooldownExample":"• اضبط 0 = بدون انتظار (يمكن التشغيل مرة أخرى فوراً)\n• اضبط 7 = انتظر 7 أيام قبل إعادة التشغيل","followUp.tooltip.exampleLabel":"مثال:","followUp.tooltip.howToUseLabel":"كيفية الاستخدام:","followUp.tooltip.bestPracticeLabel":"أفضل ممارسة:","schedule.title":"الرسائل المجدولة","schedule.addSchedule":"إضافة جدولة","schedule.editSchedule":"تعديل الجدولة","schedule.schedulesCount":"الجداول","schedule.noSchedules":"لا توجد رسائل مجدولة","schedule.noSchedulesDesc":"أنشئ رسالتك المجدولة الأولى للبدء.","schedule.confirmDelete":"هل أنت متأكد أنك تريد حذف هذه الجدولة؟","schedule.inactive":"غير نشط","schedule.once":"مرة واحدة","schedule.repeated":"متكرر","schedule.scheduleFor":"جدولة لـ","schedule.selectTarget":"اختر جهة اتصال أو مجموعة","schedule.searchContacts":"البحث عن جهات الاتصال والمجموعات...","schedule.groups":"المجموعات","schedule.contacts":"جهات الاتصال","schedule.templateType":"نوع القالب","schedule.message":"الرسالة","schedule.enterMessage":"أدخل رسالتك...","schedule.scheduleDateTime":"تاريخ ووقت الجدولة","schedule.selectDateTime":"يرجى اختيار التاريخ والوقت","schedule.repeatedType":"نوع التكرار","schedule.repeatedType_minute":"دقيقة","schedule.repeatedType_hour":"ساعة","schedule.repeatedType_daily":"يومي","schedule.repeatedType_weekly":"أسبوعي","schedule.repeatedType_monthly":"شهري","schedule.repeatedType_yearly":"سنوي","schedule.everyMinutes":"كل X دقيقة","schedule.everyHours":"كل X ساعة","schedule.scheduleTime":"أوقات الجدولة","schedule.addTime":"إضافة وقت","schedule.startAndEndTime":"وقت البداية والنهاية","schedule.runAnytime":"تشغيل في أي وقت","schedule.runBetween":"تشغيل بين فترة زمنية","schedule.endSchedule":"إنهاء تكرار الجدولة في","schedule.never":"أبداً","schedule.afterCount":"عدد مرات التكرار","schedule.completeOnDate":"إكمال في التاريخ","schedule.weekday_mon":"الإثنين","schedule.weekday_tue":"الثلاثاء","schedule.weekday_wed":"الأربعاء","schedule.weekday_thu":"الخميس","schedule.weekday_fri":"الجمعة","schedule.weekday_sat":"السبت","schedule.weekday_sun":"الأحد","schedule.month_jan":"يناير","schedule.month_feb":"فبراير","schedule.month_mar":"مارس","schedule.month_apr":"أبريل","schedule.month_may":"مايو","schedule.month_jun":"يونيو","schedule.month_jul":"يوليو","schedule.month_aug":"أغسطس","schedule.month_sep":"سبتمبر","schedule.month_oct":"أكتوبر","schedule.month_nov":"نوفمبر","schedule.month_dec":"ديسمبر","schedule.postActions":"إجراءات لاحقة","schedule.groupActions":"إجراءات المجموعة","schedule.customTabActions":"إجراءات التبويب المخصص","schedule.labelsActions":"إجراءات التصنيفات","schedule.kanbanActions":"إجراءات كانبان","schedule.members":"أعضاء","schedule.noContactsFound":"لم يتم العثور على جهات اتصال","schedule.noGroupsFound":"لم يتم العثور على مجموعات","schedule.loadingContacts":"جاري تحميل جهات الاتصال...","schedule.loadingGroups":"جاري تحميل المجموعات...","schedule.selected":"محدد","schedule.tooltip.scheduleFor":"اختر جهة اتصال أو مجموعة لإرسال الرسالة المجدولة إليها.","schedule.tooltip.templateType":"اختر نوع الرسالة: نص فقط، مع وسائط، استطلاع، قائمة، أو تشغيل تدفق Fluxo.","schedule.tooltip.message":"اكتب رسالتك. استخدم متغيرات مثل {{name}} أو {{phone}} للتخصيص.","schedule.tooltip.dateTime":"حدد موعد إرسال الرسالة. للجداول المتكررة، هذا هو تاريخ/وقت البداية.","schedule.tooltip.repeatedType":"اختر تكرار: كل X دقيقة/ساعة، يومي، أسبوعي، شهري، أو سنوي.","schedule.tooltip.scheduleTimes":"أضف أوقات إرسال متعددة. انقر على + لإضافة المزيد.","schedule.tooltip.runBetween":"قصر الرسائل على ساعات محددة. مثال: إرسال فقط بين 9 صباحاً - 6 مساءً.","schedule.tooltip.endSchedule":"اختر متى تتوقف: أبداً، بعد X مرات، أو في تاريخ محدد.","schedule.tooltip.postActions":"إجراءات بعد الإرسال: إضافة/إزالة من المجموعات، التبويبات، التصنيفات، أو مراحل كانبان.","gmaps.featureTitle":"مستخرج خرائط G","feature.gmapsExtractor":"مستخرج خرائط G","gmaps.panelHeader":"مستخرج خرائط G","gmaps.status.idle":"جاهز","gmaps.status.running":"جارٍ الاستخراج...","gmaps.status.stopped":"متوقف","gmaps.status.complete":"اكتمل","gmaps.status.error":"متوقف","gmaps.statusLabel":"الحالة","gmaps.leadsFound":"العملاء: {{count}}","gmaps.leadsShort":"عملاء","gmaps.settings":"الإعدادات","gmaps.exportGroup":"تصدير وإرسال","gmaps.noPhone":"لا يوجد هاتف","gmaps.showPanel":"إظهار اللوحة","gmaps.hidePanel":"إخفاء اللوحة","gmaps.maxResults":"الحد الأقصى","gmaps.unlimited":"غير محدود","gmaps.fetchEmails":"جلب الإيميلات","gmaps.fetchEmailsTooltip":"لكل عميل لديه موقع ويب، يفتحه في الخلفية ويستخرج أول بريد إلكتروني يجده. يضيف حوالي 3 ثوانٍ لكل عميل. إذا لم يحتوِ الموقع على بريد إلكتروني ظاهر أو فشل التحميل، يبقى حقل البريد فارغاً.","gmaps.startBtn":"بدء الاستخراج","gmaps.stopBtn":"إيقاف","gmaps.clearBtn":"مسح","gmaps.exportCsv":"تصدير CSV","gmaps.exportXlsx":"تصدير XLSX","gmaps.sendToBroadcast":"إرسال للبث","gmaps.previewTitle":"معاينة","gmaps.moreRows":"المزيد","gmaps.expand":"توسيع","gmaps.expandView":"عرض كامل","gmaps.clickExpand":"انقر توسيع لعرض التفاصيل الكاملة","gmaps.clickExpandToSee":"انقر توسيع لعرض الكل","gmaps.col.name":"الاسم","gmaps.col.phone":"الهاتف","gmaps.col.website":"الموقع","gmaps.col.address":"العنوان","gmaps.col.category":"الفئة","gmaps.col.rating":"التقييم","gmaps.noLeadsYet":"لا توجد نتائج بعد — ابحث في خرائط جوجل ثم اضغط بدء","gmaps.stopReason.userStop":"توقف بواسطة المستخدم","gmaps.stopReason.endOfResults":"تم الوصول إلى نهاية نتائج خرائط جوجل","gmaps.stopReason.captcha":"تم اكتشاف كابتشا جوجل — حلّه ثم اضغط بدء","gmaps.stopReason.noFeed":"لم يتم العثور على نتائج بحث — الرجاء إجراء بحث أولاً","gmaps.stopReason.noNewResults":"لا توجد نتائج جديدة (توقفت جوجل عن إرسال البيانات)","gmaps.stopReason.maxReached":"تم الوصول للحد الأقصى للنتائج","gmaps.stopReason.tabClosed":"تم إغلاق علامة التبويب","gmaps.stopReason.error":"خطأ","gmaps.toast.searchFirst":"الرجاء إجراء بحث في خرائط جوجل أولاً، ثم اضغط بدء.","gmaps.toast.csvReady":"تم تنزيل CSV","gmaps.toast.xlsxReady":"تم تنزيل ملف Excel","gmaps.toast.noPhones":"لا توجد أرقام هواتف صالحة — لم يتم إرسال شيء.","gmaps.toast.sentPartial":"تم إرسال {{sent}} جهة اتصال إلى البث · تم تخطي {{dropped}} (بدون رقم)","gmaps.toast.sentAll":"تم إرسال {{sent}} جهة اتصال إلى البث","gmaps.toast.broadcastFail":"فشل الإرسال إلى البث. راجع وحدة التحكم.","gmaps.toast.draftRestored":"تم استعادة الجلسة السابقة","gmaps.toast.draftRestoredN":"تم استعادة {{n}} عميل من الجلسة السابقة"},pt:{"common.loading":"Carregando...","common.close":"Fechar","common.cancel":"Cancelar","common.save":"Salvar","common.copy":"Copiar","common.copied":"Copiado!","common.choose":"Escolher","common.add":"Adicionar","common.edit":"Editar","common.delete":"Excluir","common.back":"Voltar","quickReply.title":"Resposta Rápida","quickReply.addButton":"+ Adicionar","quickReply.allCategories":"Todas as Categorias","quickReply.postActions":"Ações Pós-Envio","quickReply.groupActions":"Ações de Grupo","quickReply.customTabActions":"Ações de Aba","quickReply.labelsActions":"Ações de Etiquetas","quickReply.kanbanBoardActions":"Ações Kanban","quickReply.addToGroups":"Adicionar aos Grupos","quickReply.removeFromGroups":"Remover dos Grupos","quickReply.addToTabs":"Adicionar às Abas","quickReply.removeFromTabs":"Remover das Abas","quickReply.addLabels":"Adicionar Etiquetas","quickReply.removeLabels":"Remover Etiquetas","quickReply.addToStage":"Adicionar ao Estágio","quickReply.removeFromStage":"Remover do Estágio","quickReply.selectGroups":"Selecionar grupos...","quickReply.selectTabs":"Selecionar abas...","quickReply.selectLabels":"Selecionar etiquetas...","quickReply.selectCrmStage":"Selecionar CRM e Estágio...","quickReply.noGroupsAvailable":"Nenhum grupo disponível","quickReply.noTabsAvailable":"Nenhuma aba disponível","quickReply.noLabelsAvailable":"Nenhuma etiqueta disponível","quickReply.noKanbanAvailable":"Nenhum CRM Kanban disponível","quickReply.editBeforeSending":"Editar antes de enviar","quickReply.editBeforeSendingDesc":"Permitir editar a mensagem antes de enviar","actionSidebar.title":"Ações Rápidas","actionSidebar.quickReply":"Resposta Rápida","actionSidebar.flow":"Fluxo","actionSidebar.search":"Pesquisar...","actionSidebar.filter":"Filtrar","actionSidebar.all":"Todos","actionSidebar.byType":"Por Tipo","actionSidebar.noCategory":"Sem Categoria","actionSidebar.byCategory":"Por Categoria","actionSidebar.mostUsed":"Mais Usados","actionSidebar.send":"Enviar","actionSidebar.trigger":"Acionar","actionSidebar.noItemsFound":"Nenhum item encontrado","actionSidebar.selectChatFirst":"Selecione um chat primeiro","actionSidebar.uncategorized":"Sem Categoria","actionSidebar.editAndSend":"Editar e Enviar","actionSidebar.clickToCancel":"Clique para cancelar","actionSidebar.cancel":"Cancelar","actionSidebar.sending":"Enviando...","header.activateLicense":"Ativar Licença",broadcastTitle:"Mensagem em Massa",kanbanTitle:"Abrir Kanban CRM","profile.title":"Perfil","profile.deviceName":"Nome do dispositivo","profile.expires":"Expira","profile.manageLicenseKey":"Gerenciar chave de licença","profile.settings":"Configurações","profile.watchTutorial":"Assistir tutorial","profile.language":"Idioma","profile.privacyPolicy":"Política de privacidade","profile.contactUs":"Contate-nos","profile.website":"Site","profile.premium":"Premium","profile.notActivated":"Não Ativado","profile.activateToContinue":"Ativar Licença","settings.menuFeatures":"Recursos do Menu","settings.menuFeaturesDesc":"Ative ou desative os recursos conforme necessário","settings.interfaceOptions":"Opções de Interface","settings.featureDockLabel":"Barra Lateral Esquerda","settings.featureDockDesc":"Mostrar uma barra de atalhos na borda esquerda quando um popup estiver aberto","feature.tabs":"Gestão de Guias","feature.templates":"Modelos","feature.quickReply":"Resposta Rápida","feature.kanban":"Kanban CRM","feature.chatbotFlow":"Fluxo do Chatbot","feature.followUp":"Acompanhamento","feature.broadcast":"Envio em Massa","feature.calendar":"Central de Agendamento","feature.status":"Status","feature.validator":"Validador","feature.webhook":"Webhook","feature.api":"API","feature.aiBot":"Bot de IA","feature.open":"Abrir","license.activateTitle":"Ative sua licença","license.licenseKey":"Chave de licença","license.phoneNumber":"Número de telefone","license.phoneDetected":"Número de telefone detectado","license.planName":"Nome do plano","license.endDate":"Data de término","license.expiresIn":"Expira em","license.days":"dias","license.daysLeft":"dias restantes","license.status":"Status","license.deactivateLicense":"Desativar licença","license.deactivateConfirm":"Tem certeza de que deseja desativar sua licença?","license.activateLicenseBtn":"Ativar Licença","license.validating":"Validando...","license.pasteLicenseHere":"Cole sua chave de licença aqui...","license.completeLicenseKey":"Cole a chave de licença completa que você recebeu por e-mail","trial.starting":"Iniciando seu teste gratuito de 7 dias...","trial.activated":"Teste gratuito de 7 dias ativado!","trial.daysRemaining":"{0} dias restantes no teste","trial.expired":"O teste expirou. Por favor, adquira uma licença.","trial.alreadyUsed":"O teste já foi utilizado para este número. Insira uma chave de licença para continuar.","license.waitForWhatsApp":"Por favor, aguarde o WhatsApp carregar completamente","license.securityFooter":"Protegido por validação criptográfica WebAssembly","planDetails.title":"Detalhes do plano","planDetails.licenceKey":"Chave de licença","planDetails.planName":"Nome do plano","planDetails.endDate":"Data de término","planDetails.removeKey":"Remover chave","planDetails.changeKey":"Alterar chave","features.enabledFeatures":"Recursos habilitados","licenseInfo.title":"Informações da licença","licenseInfo.phoneNumber":"Número de telefone","licenseInfo.expiresIn":"Expira em","licenseInfo.status":"Status","languages.en":"English (Inglês)","languages.zh":"中文 (Chinês)","languages.es":"Español (Espanhol)","languages.fr":"Français (Francês)","languages.ar":"العربية (Árabe)","languages.pt":"Português","languages.ru":"Русский (Russo)","languages.ja":"日本語 (Japonês)","languages.de":"Deutsch (Alemão)","errors.invalidFormat":"Formato de chave de licença inválido ou falha na validação","errors.serverError":"Ocorreu um erro no servidor","errors.networkError":"Erro de rede. Por favor, verifique sua conexão","tabs.tabs":"Abas","tabs.manageTabs":"Gerenciar Abas","tabs.addTab":"Adicionar Aba","tabs.editTab":"Editar Aba","tabs.deleteTab":"Excluir Aba","tabs.tabTitle":"Título da Aba","tabs.tabDetails":"Detalhes da Aba","tabs.enterTabTitle":"Digite o Título da Aba","tabs.enterTabDetails":"Digite os Detalhes da Aba","tabs.chooseFrom":"Escolher de","tabs.chat":"Chat","tabs.groups":"Grupos","tabs.label":"Etiqueta","tabs.searchHere":"Pesquisar aqui","tabs.selectAll":"Selecionar Tudo","tabs.clearAll":"Limpar Tudo","tabs.selected":"Selecionado","tabs.allChats":"Todos os chats","tabs.chats":"chats","tabs.noFilterApplied":"Nenhum filtro aplicado","tabs.view":"Ver","tabs.edit":"Editar","tabs.delete":"Excluir","tabs.hideFromTabBar":"Ocultar da Barra de Abas","tabs.showInTabBar":"Mostrar na Barra de Abas","tabs.sort":"Ordenar","tabs.title":"Título","tabs.details":"Detalhes","tabs.action":"Ação","tabs.selectLabel":"Selecionar Etiqueta","tabs.chooseALabel":"-- Escolha uma Etiqueta --","tabs.selectedLabel":"Etiqueta Selecionada","tabs.change":"Alterar","tabs.pleaseSelectLabel":"Por favor, selecione uma etiqueta do menu suspenso acima","tabs.areYouSureDeleteTab":"Tem certeza de que deseja excluir esta aba?","tabs.tabDeletedSuccessfully":"Aba excluída com sucesso","tabs.cancel":"Cancelar","tabs.save":"Salvar","tabs.all":"Todos","tabs.oneToOne":"1:1","tabs.individualChats":"Apenas conversas individuais","tabs.groupChats":"Apenas conversas em grupo","tabs.unread":"Não lidos","tabs.unreadChats":"Apenas conversas não lidas","tabs.unsaved":"Não salvos","tabs.unsavedContacts":"Apenas contatos não salvos","templates.title":"Modelos de Mensagens","templates.manageTemplates":"Gerenciar Modelos","templates.newTemplate":"Novo Modelo","templates.editTemplate":"Editar Modelo","templates.sendTemplate":"Enviar Modelo","templates.deleteTemplate":"Excluir Modelo","templates.duplicateTemplate":"Duplicar Modelo","templates.activateTemplate":"Ativar","templates.deactivateTemplate":"Desativar","templates.total":"Total","templates.active":"Ativos","templates.inactive":"Inativos","templates.filterAll":"Todos","templates.filterActive":"Apenas Ativos","templates.filterInactive":"Apenas Inativos","templates.filterAllTypes":"Todos os Tipos","templates.templates":"modelos","templates.searchPlaceholder":"Pesquisar modelos...","templates.noTemplates":"Nenhum modelo encontrado","templates.createFirst":"Crie seu primeiro modelo","templates.edit":"Editar","templates.copy":"Copiar","templates.msgs":"mensagens","templates.noMessageContent":"Sem conteúdo de mensagem","templates.form.templateName":"Nome do Modelo","templates.form.templateNamePlaceholder":"Digite o nome do modelo","templates.form.templateFor":"Modelo Para","templates.form.message":"Mensagem","templates.form.messagePlaceholder":"Digite sua mensagem aqui...","templates.form.insertVariable":"Clique para inserir variável:","templates.form.personalizeValue":"Valor de Personalização","templates.form.personalizeValueHint":"Transmita para seus indivíduos selecionados com valores personalizados como @variable1, @variable2, etc.","templates.form.templatesType":"Tipo de Modelos","templates.form.templateType":"Tipo de Modelo","templates.form.templateStatus":"Status do Modelo","templates.form.statusOn":"Ligado","templates.form.statusOff":"Desligado","templates.form.statusHint":'Quando o status do modelo está "ligado", ele está disponível para uso. Por outro lado, quando o status do modelo está "desligado", ele está em um estado salvo.',"templates.form.on":"Ativado","templates.form.off":"Desativado","templates.form.save":"Salvar","templates.form.cancel":"Cancelar","templates.form.selectProducts":"Selecionar Produtos","templates.form.selectContacts":"Selecionar Contatos","templates.form.addProduct":"Adicionar Produto","templates.form.addContact":"Adicionar Contato","templates.form.buttons":"Botões","templates.form.addButton":"Adicionar Botão","templates.form.buttonsHint":"Máximo de 3 botões permitidos","templates.form.selectFromContacts":"Selecionar dos Contatos","templates.form.addManually":"Adicionar Manualmente","templates.form.productHint":"Produtos do seu catálogo do WhatsApp Business","templates.form.attachImages":"Anexar Imagens/Vídeos","templates.form.attachAudio":"Anexar Áudio","templates.form.attachDocuments":"Anexar Documentos","templates.form.chooseFile":"Escolher Arquivo","templates.form.maxFileSize":"Tamanho máximo do arquivo: 16MB (limite do WhatsApp)","templates.form.uploading":"Enviando...","templates.errors.uploadFailed":"Falha ao enviar o arquivo. Tente novamente.","templates.errors.fileTooLarge":"O arquivo é muito grande. Tamanho máximo: 16MB (limite do WhatsApp).","templates.form.listButtonText":"Texto do Botão","templates.form.listButtonTextPlaceholder":"Digite o texto do botão","templates.form.listDescription":"Descrição","templates.form.listDescriptionPlaceholder":"Digite a descrição","templates.form.listSections":"Seções","templates.form.pollQuestion":"Pergunta da Enquete","templates.form.pollQuestionPlaceholder":"Digite sua pergunta da enquete","templates.form.allowMultipleAnswers":"Permitir Múltiplas Respostas","templates.form.allowMultipleAnswersHint":"Os usuários podem selecionar várias opções","templates.form.pollOptions":"Opções da Enquete","templates.form.addOption":"+ Adicionar Opção","templates.form.pollOptionsHint":"Mínimo 2, máximo 12 opções","templates.messageType.individual":"Um a Um","templates.messageType.tab":"Aba","templates.messageType.group":"Grupo","templates.messageType.label":"Etiqueta","templates.messageType.kanban":"Kanban","templates.messageType.quickReply":"⚡ Resposta Rápida","templates.attachmentType.none":"Apenas Mensagem","templates.attachmentType.imageVideo":"Mensagem + Imagens/Vídeos","templates.attachmentType.document":"Mensagem + Documentos","templates.attachmentType.audio":"Mensagem + Áudio","templates.attachmentType.contact":"Mensagem + Contatos","templates.attachmentType.poll":"Mensagem + Enquete","templates.attachmentType.list":"Mensagem + Lista","templates.attachmentType.product":"Mensagem + Produtos","templates.attachmentType.buttons":"Mensagem + Botões","templates.messages":"Mensagens","templates.addMessage":"Adicionar Mensagem","templates.deleteMessage":"Excluir Mensagem","templates.messageNumber":"Mensagem {number}","templates.delayBetweenMessages":"Atraso antes da próxima mensagem","templates.delayMin":"Mín (seg)","templates.delayMax":"Máx (seg)","templates.collapseMessage":"Recolher","templates.expandMessage":"Expandir","crm.button":"CRM","crm.openCRM":"Abrir CRM","crm.profile":"Perfil","crm.tabs":"Abas","crm.notes":"Notas","crm.reminder":"Lembrete","crm.appointment":"Compromisso","crm.income":"Receita","crm.expense":"Despesa","crm.scheduleTab":"Agendar","crm.deletedMessagesTab":"Mensagens Apagadas","crm.antiRevokeEnabled":"Anti-Revoke está LIGADO","crm.antiRevokeDisabled":"Anti-Revoke está DESLIGADO","crm.antiRevokeDescription":"Salva cópias locais das mensagens recebidas para que você possa vê-las mesmo se o remetente apagá-las.","crm.antiRevokeNotEnabledHint":"Ative o Anti-Revoke acima para começar a salvar as mensagens recebidas.","crm.noDeletedMessages":"Nenhuma mensagem apagada recuperada ainda. Estamos de olho — se alguém apagar uma mensagem, guardaremos uma cópia aqui.","crm.onlyThisContact":"Apenas este contato","crm.allContacts":"Todos os contatos","crm.clearHistory":"Limpar histórico","crm.exportCSV":"Exportar CSV","crm.revokedAt":"Apagada em","crm.copyMessage":"Copiar","crm.lionRecovered":"{brand} recuperou","crm.clickToShowOriginal":"Clique para mostrar o original","crm.antiRevokeChatTip":"Dica: você também pode clicar no ícone de recuperação diretamente sobre uma mensagem apagada no chat para vê-la rapidamente.","crm.searchMessages":"Buscar mensagens…","crm.recoveredCount":"{count} mensagem(ns) recuperada(s)","crm.confirmClearChatHistory":"Limpar mensagens recuperadas deste contato?","crm.confirmClearAllHistory":"Limpar TODAS as mensagens recuperadas de todas as conversas?","crm.noTextContent":"(sem texto — mensagem de mídia)","crm.group":"Grupo","crm.enable":"Ativar","crm.disable":"Desativar","crm.addScheduleMessage":"Adicionar Agendamento","crm.noScheduledMessages":"Sem Mensagens Agendadas","crm.noScheduledMessagesDesc":"Agende mensagens para este contato.","crm.userDetails":"Detalhes do usuário","crm.addCustomAttribute":"+ Adicionar atributo","crm.edit":"Editar","crm.cancel":"Cancelar","crm.save":"Salvar","crm.signature":"Assinatura","crm.signatureDesc":"Digite seu nome para enviar mensagens assinadas ou para mostrar aos outros agentes que você está em serviço no chat específico.","crm.enterYourName":"Digite seu nome","crm.activateSignature":"Ativar assinatura","crm.signatureAs":"Assinando como","crm.signatureNotSet":"Defina seu nome de assinatura nas configurações da extensão do WhatsApp Web.","crm.delete":"Excluir","crm.deleteConnection":"Excluir Conexão?","crm.deleteConnectionConfirm":"Tem certeza de que deseja excluir esta conexão entre os nós?","crm.fullName":"Nome completo","crm.phoneNumber":"Número de telefone","crm.email":"E-mail","crm.gender":"Gênero","crm.dateOfBirth":"Data de nascimento","crm.details":"Detalhes","crm.address":"Endereço","crm.language":"Idioma","crm.male":"Masculino","crm.female":"Feminino","crm.other":"Outro","crm.select":"- Selecionar -","crm.customAttributes":"Atributos personalizados","crm.addField":"Adicionar campo","crm.fieldLabel":"Rótulo do campo","crm.fieldValue":"Valor do campo","crm.noCustomFields":"Nenhum campo personalizado","crm.deleteFieldConfirm":"Tem certeza que deseja excluir este campo?","crm.contactTabs":"Abas do contato","crm.addToTab":"Adicionar à aba","crm.removeFromTab":"Remover da aba","crm.noTabs":"Nenhuma aba criada","crm.createTab":"Criar aba","crm.tabName":"Nome da aba","crm.contacts":"contatos","crm.addToLabel":"Adicionar ao rótulo","crm.selectLabel":"Selecionar rótulo","crm.noLabelsAvailable":"Sem rótulos. Crie uma aba primeiro.","crm.labelsAndStages":"Rótulos e Etapas","crm.whatsappLabels":"Rótulos do WhatsApp","crm.customTabs":"Abas Personalizadas","team.button":"Equipe","team.shareWith":"Compartilhar com Equipe","team.settings":"Configurações da Equipe","team.addMember":"Adicionar Membro","team.editMember":"Editar Membro","team.deleteMember":"Excluir","team.memberName":"Nome do Membro","team.memberPhone":"Número de Telefone","team.department":"Departamento","team.departmentPlaceholder":"ex., Vendas, Finanças, Suporte","team.template":"Modelo de Mensagem","team.templatePlaceholder":"Digite a mensagem com variáveis...","team.noMembers":"Nenhum membro configurado","team.clickToAdd":"Clique em + para adicionar membros","team.sending":"Enviando...","team.insertVariable":"Inserir Variável","team.preview":"Visualizar Mensagem","team.deleteConfirm":"Tem certeza de que deseja excluir este membro?","team.phonePlaceholder":"ex., +5511999999999","team.namePlaceholder":"ex., Vendas - João","team.variableHint":"Use {{name}}, {{phone}}, {{labels}} etc. para conteúdo dinâmico","team.save":"Salvar","team.cancel":"Cancelar","team.editTemplate":"Editar Modelo","team.saveAndSend":"Salvar e Enviar","team.sendOnce":"Enviar Uma Vez","team.send":"Enviar","team.selectContact":"Selecionar Contato","team.clickToSelectContact":"Clique para selecionar um contato do WhatsApp","team.searchContact":"Pesquisar contatos...","team.loadingContacts":"Carregando contatos...","team.noContactsFound":"Nenhum contato encontrado","team.noSearchResults":"Sem resultados","team.phoneHint":"Digite o número com código do país ou clique no ícone para selecionar","team.popupTitle":"Compartilhar com Equipe","team.popupSubtitle":"Enviar detalhes do contato instantaneamente","team.noTeamMembers":"Sem Membros","team.noTeamMembersDesc":"Adicione membros da equipe para compartilhar rapidamente detalhes de contato via WhatsApp","crm.addNote":"+ Adicionar nota","crm.searchNotes":"Pesquisar notas...","crm.noNotes":"Nenhuma nota","crm.addFirstNote":"Adicione sua primeira nota","crm.topic":"Tópico","crm.content":"Conteúdo","crm.editNote":"Editar nota","crm.deleteNote":"Excluir nota","crm.deleteNoteConfirm":"Tem certeza que deseja excluir esta nota?","crm.addReminder":"+ Adicionar lembrete","crm.noReminders":"Nenhum lembrete","crm.addFirstReminder":"Adicione seu primeiro lembrete","crm.reminderTopic":"Tópico do lembrete","crm.dateTime":"Data e hora","crm.repeatInterval":"Intervalo de repetição","crm.noRepeat":"Sem repetição","crm.every5Min":"A cada 5 minutos","crm.every10Min":"A cada 10 minutos","crm.every15Min":"A cada 15 minutos","crm.every30Min":"A cada 30 minutos","crm.every1Hour":"A cada hora","crm.status":"Status","crm.pending":"Pendente","crm.completed":"Concluído","crm.dismissed":"Dispensado","crm.stopped":"Parado","crm.snoozed":"Adiado","crm.due":"Vencido","crm.editReminder":"Editar lembrete","crm.deleteReminder":"Excluir lembrete","crm.markComplete":"Marcar como concluído","crm.snooze":"Adiar","crm.stop":"Parar","crm.addAppointment":"+ Adicionar compromisso","crm.noAppointments":"Nenhum compromisso","crm.addFirstAppointment":"Adicione seu primeiro compromisso","crm.appointmentTitle":"Título do compromisso","crm.attendee":"Participante","crm.googleMeetLink":"Link do Google Meet","crm.generateLink":"Gerar link","crm.messageTemplate":"Modelo de mensagem","crm.reminderBefore":"Lembrar antes","crm.sendMessageNow":"Enviar mensagem agora","crm.scheduled":"Agendado","crm.cancelled":"Cancelado","crm.missed":"Perdido","crm.editAppointment":"Editar compromisso","crm.deleteAppointment":"Excluir compromisso","crm.joinMeeting":"Entrar na reunião","crm.before5Min":"5 minutos antes","crm.before10Min":"10 minutos antes","crm.before15Min":"15 minutos antes","crm.before30Min":"30 minutos antes","crm.before1Hour":"1 hora antes","crm.before2Hours":"2 horas antes","crm.before1Day":"1 dia antes","crm.titleLabel":"Título","crm.scheduleDateTime":"Agendar Data e Hora","crm.pasteGoogleMeetLink":"Cole seu link do Google Meet aqui","crm.generateLinkHint":"Clique em 'Gerar Link' para abrir o Google Meet, depois cole o link da reunião aqui","crm.chooseTemplate":"Escolher Modelo","crm.selectTemplate":"-- Selecionar um modelo --","crm.messageTemplatePlaceholder":"Digite o modelo de mensagem...","crm.useSameMessage":"Usar a mesma mensagem no início da reunião","crm.meetingStartMessageLabel":"Mensagem de Início da Reunião","crm.meetingStartPlaceholder":"Digite a mensagem para enviar no início da reunião...","crm.meetingStartHint":"Esta mensagem será enviada quando a reunião realmente começar.","crm.sendReminderLabel":"Enviar Lembrete","crm.reminderTimeHint":"A mensagem será enviada aos participantes neste momento antes da reunião. Você também receberá uma notificação sonora.","crm.sendMessageNowTo":"Enviar mensagem agora para","crm.sendNowHint":"Marque para enviar a mensagem do compromisso imediatamente após salvar","crm.discard":"Descartar","crm.saveAndSend":"Salvar e Enviar","crm.sending":"Enviando...","crm.noAppointmentsFound":"Nenhum compromisso encontrado","crm.searchAppointments":"Pesquisar compromissos","crm.productDemoCall":"ex., Chamada de demonstração do produto","crm.reminderMessageHint":"Esta mensagem será enviada no horário do lembrete (antes da reunião).","crm.joinMeet":"Entrar no Meet","crm.appointmentTemplates":"Modelos de Compromissos","crm.savedTemplates":"Modelos Salvos","crm.noTemplatesYet":"Ainda não há modelos. Crie seu primeiro modelo!","crm.newTemplate":"+ Novo Modelo","crm.editTemplateTitle":"Editar Modelo","crm.newTemplateTitle":"Novo Modelo","crm.templateName":"Nome do Modelo","crm.templateNamePlaceholder":"ex., Lembrete de Reunião","crm.meetLinkOptional":"Link do Google Meet (Opcional)","crm.updateTemplate":"Atualizar Modelo","crm.saveTemplate":"Salvar Modelo","crm.pleaseEnterTitle":"Por favor, insira um título","crm.pleaseSelectFutureDate":"Por favor, selecione uma data e hora futura","crm.deleteAppointmentConfirm":"Tem certeza de que deseja excluir este compromisso?","crm.pleaseEnterTemplateName":"Por favor, insira um nome de modelo","crm.pleaseEnterMessageTemplate":"Por favor, insira um modelo de mensagem","crm.deleteTemplateConfirm":"Tem certeza de que deseja excluir este modelo?","crm.addIncome":"+ Adicionar receita","crm.totalIncome":"Receita total","crm.pendingIncome":"Pendente","crm.filteredTotal":"Total filtrado","crm.noIncome":"Nenhum registro de receita","crm.addFirstIncome":"Adicione sua primeira receita","crm.amount":"Valor","crm.category":"Categoria","crm.paymentMethod":"Método de pagamento","crm.description":"Descrição","crm.reference":"Referência","crm.date":"Data","crm.paymentReceived":"Pagamento recebido","crm.sale":"Venda","crm.serviceFee":"Taxa de serviço","crm.commission":"Comissão","crm.refundReceived":"Reembolso recebido","crm.cash":"Dinheiro","crm.bankTransfer":"Transferência bancária","crm.upi":"UPI","crm.pix":"PIX","crm.card":"Cartão","crm.cheque":"Cheque","crm.addCustomPaymentMethod":"Adicionar método personalizado","crm.editIncome":"Editar receita","crm.deleteIncome":"Excluir receita","crm.addExpense":"+ Adicionar despesa","crm.totalExpense":"Despesa total","crm.pendingExpense":"Pendente","crm.noExpense":"Nenhum registro de despesa","crm.addFirstExpense":"Adicione sua primeira despesa","crm.purchase":"Compra","crm.serviceCost":"Custo de serviço","crm.travel":"Viagem","crm.marketing":"Marketing","crm.commissionPaid":"Comissão paga","crm.refundGiven":"Reembolso dado","crm.editExpense":"Editar despesa","crm.deleteExpense":"Excluir despesa","crm.search":"Pesquisar...","crm.all":"Todos","crm.today":"Hoje","crm.thisWeek":"Esta semana","crm.thisMonth":"Este mês","crm.thisYear":"Este ano","crm.filterByCategory":"Filtrar por categoria","crm.filterByStatus":"Filtrar por status","crm.filterByDate":"Filtrar por data","crm.allStatus":"Todos os status","crm.allCategories":"Todas as categorias","crm.none":"Nenhum","crm.ref":"Ref","crm.tableTabName":"Nome da aba","crm.tableContactsInTab":"Contatos na aba","crm.tableAction":"Ação","crm.tableName":"Nome","crm.tableModifiedDate":"Data de modificação","crm.tableTopic":"Tópico","crm.tableReminderDate":"Data do lembrete","crm.tableRepeatSnooze":"Repetir/Adiar","crm.tableStatus":"Status","crm.tableTitle":"Título","crm.tableDateTime":"Data e hora","crm.tableAttendee":"Participante","crm.tableMeetLink":"Link do Meet","crm.tableDescription":"Descrição","crm.tableCategory":"Categoria","crm.tableAmount":"Valor","crm.tablePayment":"Pagamento","crm.tableDate":"Data","crm.addIncomeTitle":"Adicionar receita","crm.editIncomeTitle":"Editar receita","crm.addExpenseTitle":"Adicionar despesa","crm.editExpenseTitle":"Editar despesa","crm.enterAmount":"Digite o valor","crm.validAmountRequired":"Por favor, digite um valor válido","crm.descriptionRequired":"Por favor, digite uma descrição","crm.referenceInvoice":"Referência / Nº da Fatura","crm.referenceBill":"Referência / Nº do Recibo","crm.invoicePlaceholder":"ex. FAT-001","crm.billPlaceholder":"ex. REC-001","crm.paymentDescription":"ex. Pagamento por serviços","crm.expenseDescription":"ex. Material de escritório","crm.update":"Atualizar","crm.addIncomeBtn":"Adicionar receita","crm.addExpenseBtn":"Adicionar despesa","crm.recurringTransaction":"Transação Recorrente","crm.repeatEvery":"Repetir a cada","crm.neverEnds":"Sem fim","crm.endDate":"Data de término","crm.daily":"Diário","crm.weekly":"Semanal","crm.monthly":"Mensal","crm.quarterly":"Trimestral (3 meses)","crm.yearly":"Anual","crm.currencySettings":"Configurações de moeda","crm.searchCurrency":"Buscar moeda...","crm.noCurrenciesFound":"Nenhuma moeda encontrada","crm.noIncomeRecords":"Nenhum registro de receita encontrado","crm.noExpenseRecords":"Nenhum registro de despesa encontrado","crm.deleteIncomeConfirm":"Tem certeza que deseja excluir este registro de receita?","crm.deleteExpenseConfirm":"Tem certeza que deseja excluir este registro de despesa?","crm.addCategory":"Adicionar Categoria","crm.categoryName":"Nome da Categoria","crm.enterCategoryName":"Digite o nome da categoria","crm.customCategories":"Categorias Personalizadas","crm.addCustomCategory":"Adicionar Categoria Personalizada","crm.existingCustomCategories":"Categorias Personalizadas Existentes","crm.addStatus":"Adicionar Status","crm.statusName":"Nome do Status","crm.enterStatusName":"Digite o nome do status","crm.customStatuses":"Status Personalizados","crm.addCustomStatus":"Adicionar Status Personalizado","crm.existingCustomStatuses":"Status Personalizados Existentes","crm.add":"Adicionar","crm.loading":"Carregando...","crm.dismiss":"Dispensar","crm.yesterday":"Ontem","agent.agentMode":"Modo Agente","agent.identifyAsAgent":"Identificar como Agente","agent.agentName":"Nome do Agente","agent.namePlaceholder":"ex., João, Equipe de Suporte 1","agent.agentNamePlaceholder":"Digite o nome do seu agente","agent.viewTransferHistory":"Ver Histórico de Transferências","agent.transferToAgent":"Transferir para Agente","agent.transferSuccess":"Chat transferido com sucesso","agent.noAgentsOnline":"Nenhum agente disponível online","agent.selectAgent":"Selecionar Agente","agent.chooseAgent":"-- Escolha um Agente --","agent.reason":"Motivo","agent.reasonPlaceholder":"Por que você está transferindo este chat?","agent.priority":"Prioridade","agent.priorityLow":"Baixa","agent.priorityMedium":"Média","agent.priorityHigh":"Alta","agent.priorityUrgent":"Urgente","agent.transfer":"Transferir","agent.incomingTransfer":"Transferência Recebida","agent.fromAgent":"Do Agente","agent.toAgent":"Para o Agente","agent.chat":"Chat","agent.startService":"Iniciar Atendimento","agent.endService":"Encerrar Atendimento","agent.activeService":"Atendimento Ativo","agent.from":"De","agent.to":"Para","agent.duration":"Duração","agent.transferHistory":"Histórico de Transferências","agent.sent":"Enviadas","agent.received":"Recebidas","agent.status":"Status","agent.all":"Todos","agent.statusPending":"Pendente","agent.statusAccepted":"Aceito","agent.statusInService":"Em Atendimento","agent.statusCompleted":"Concluído","agent.statusDeclined":"Recusado","agent.statusExpired":"Expirado","agent.noTransfers":"Nenhuma transferência encontrada","agent.serviceQueue":"Fila de Atendimento","agent.pendingTransfers":"Transferências Pendentes","agent.activeServices":"Atendimentos Ativos","agent.sentTransfers":"Transferências Enviadas","agent.noActiveServices":"Nenhum atendimento ativo ou transferência pendente","agent.serviceEnded":"Atendimento encerrado com sucesso","agent.accept":"Aceitar","agent.decline":"Recusar","agent.notRegistered":"Agente não registrado. Por favor, ative o modo agente primeiro.","agent.statusCancelled":"Cancelado","agent.started":"Iniciado","chatTools.suggest":"Sugerir","chatTools.spelling":"Ortografia","chatTools.translate":"Traduzir","chatTools.summarize":"Resumir","chatTools.enlarge":"Expandir","chatTools.friendly":"Amigável","chatTools.formal":"Formal","chatTools.send":"Enviar","chatTools.copy":"Copiar","chatTools.use":"Usar","chatTools.aiResult":"Resultado IA","chatTools.suggestTitle":"Sugestão IA","chatTools.spellingTitle":"Corrigir ortografia e gramática","chatTools.translateTitle":"Traduzir para","chatTools.summarizeTitle":"Resumir texto","chatTools.enlargeTitle":"Expandir texto","chatTools.friendlyTitle":"Tornar amigável","chatTools.formalTitle":"Tornar formal","chatTools.conversationSummary":"Resumo do chat","chatTools.conversationSummaryTitle":"Resumir esta conversa","chatTools.conversationSummarizing":"Resumindo o chat…","chatTools.conversationSummaryEmpty":"Nenhuma mensagem para resumir neste chat","chatTools.conversationSummaryNoChat":"Abra um chat para resumi-lo","chatTools.conversationSummaryFailed":"Falha ao obter as mensagens do chat","chatTools.conversationSummaryResultTitle":"Resumo da conversa","chatTools.sendTitle":"Enviar mensagem","chatTools.selectTextFirst":"Selecione o texto primeiro ou digite na caixa de entrada","chatTools.searchLanguage":"Pesquisar idioma...","aiSettings.title":"Inserir chave API de IA","aiSettings.platformType":"Tipo de plataforma de IA","aiSettings.geminiAI":"GEMINI AI","aiSettings.chatgpt":"CHATGPT","aiSettings.deepseek":"DEEPSEEK","aiSettings.apiKey":"Chave API de IA","aiSettings.enterApiKey":"Por favor, insira sua chave API de IA","aiSettings.validate":"Validar","aiSettings.validKey":"Chave API válida!","aiSettings.invalidKey":"Chave API inválida. Por favor, verifique e tente novamente.","aiSettings.note":"Nota:","aiSettings.geminiNote":"Obtenha sua chave API Gemini no Google AI Studio (aistudio.google.com)","aiSettings.chatgptNote":"Obtenha sua chave API OpenAI em platform.openai.com/api-keys","aiSettings.deepseekNote":"Obtenha sua chave API DeepSeek em platform.deepseek.com","aiSettings.enableAITools":"Ativar ferramentas de IA","aiSettings.close":"Fechar","aiSettings.save":"Salvar","aiSettings.configureAI":"Configure seu provedor de IA e chave API para recursos alimentados por IA","settings.title":"Configurações","settings.yourLanguage":"Seu Idioma","settings.selectLanguage":"Selecionar Idioma","settings.chooseLanguage":"Escolha seu idioma preferido para a interface da extensão","settings.whatLanguageSpeak":"Que Idioma Você Fala","settings.translateMessages":"Traduzir mensagens recebidas","settings.selectSpokenLanguage":"Selecione Seu Idioma","settings.spokenLanguageHint":"As mensagens serão traduzidas para este idioma quando você clicar no ícone de tradução nas mensagens recebidas.","settings.blurSettings":"Configurações de Desfoque","settings.blurDescription":"Desfocando informações privadas da tela.","settings.blurMessages":"Desfocar mensagens","settings.blurProfileNames":"Desfocar nomes de perfil","settings.blurDisplayPhotos":"Desfocar fotos de perfil","settings.blurConversation":"Desfocar conversa","settings.displayOnHover":"Exibir conversa ao passar o mouse","settings.theme":"Tema","settings.themeDescription":"Escolha seu esquema de cores preferido","settings.lightMode":"Modo Claro","settings.lightModeDesc":"Aparência clara clássica","settings.darkMode":"Modo Escuro","settings.darkModeDesc":"Agradável aos olhos com pouca luz","settings.systemMode":"Sistema","settings.systemModeHint":"Segue o tema do WhatsApp","settings.currentTheme":"Tema atual","signature.title":"Assinatura","signature.enableSignature":"Ativar assinatura","signature.yourSignature":"Sua assinatura","signature.placeholder":"ex., - João Silva","signature.preview":"Pré-visualização","signature.save":"Salvar","backup.title":"Backup e restauração","backup.export":"Exportar","backup.import":"Importar","backup.importHint":"Envie um arquivo JSON de backup do {brand} para restaurar seus dados. Você pode selecionar quais recursos importar.","backup.kanbanCRM":"Dados do Kanban CRM","backup.customTabs":"Abas personalizadas","backup.templatesQuickReplies":"Modelos e respostas rápidas","backup.broadcastHistory":"Histórico de transmissão","backup.settings":"Configurações","backup.crmProfileData":"Dados do Perfil CRM","backup.calendarData":"Calendário (Lembretes e Compromissos)","backup.statusData":"Status","backup.webhookSettings":"Configurações de Webhook","backup.aiBotSettings":"Configurações do Bot de IA","backup.aiApiSettings":"Configurações de API de IA","backup.spokenLanguage":"Idioma Falado","backup.chatbotFlows":"Fluxos de Chatbot (Fluxo)","backup.followupData":"Sequências de acompanhamento","backup.scheduledMessages":"Mensagens agendadas","backup.scheduledBroadcasts":"Transmissões agendadas","backup.fluxoAdvanced":"Configurações avançadas do Fluxo","backup.conversationStates":"Estados de conversa","backup.bulkValidatorData":"Dados do validador em massa","backup.quickReplies":"Respostas rápidas","backup.crmTodos":"Listas de tarefas CRM","backup.signatureSettings":"Configurações de assinatura","backup.teamSettings":"Configurações de equipe","backup.blurSettings":"Configurações de desfoque","backup.featureVisibility":"Visibilidade de recursos","backup.themeSettings":"Configurações de tema","backup.uiStateSettings":"Configurações de estado da interface","backup.apiPollingSettings":"Configurações de polling de API","backup.agentSettings":"Configurações de agente","backup.autoBackup":"Backup automático","backup.autoBackupInfo":"Um backup automático será criado quando o WhatsApp Web for carregado em uma nova data","backup.autoBackupDestination":"Destino do backup","backup.autoBackupWhatsApp":"Enviar para mensagens salvas do WhatsApp","backup.autoBackupDownload":"Baixar para o computador","backup.exportNow":"Exportar agora","backup.importNow":"Importar agora","backup.selectFile":"Selecione o arquivo de backup para importar","backup.importSuccess":"Dados importados com sucesso!","backup.importError":"Erro ao importar dados. Por favor, verifique o formato do arquivo.","backup.exportSuccess":"Dados exportados com sucesso!","backup.noDataSelected":"Por favor, selecione pelo menos um tipo de dados para exportar/importar","backup.cheetahDetected":"Cheetah CRM Detectado","backup.fileLoaded":"Arquivo carregado com sucesso","backup.cheetahImportDesc":"Este backup contém dados do Cheetah CRM. Todas as funcionalidades compatíveis serão importadas e mescladas com seus dados existentes do CRM.","backup.dataToImport":"Dados a importar:","backup.mergeWarning":"Importante:","backup.mergeWarningDesc":"Os dados serão mesclados com os dados existentes do CRM. Seus dados atuais NÃO serão sobrescritos - apenas novos dados serão adicionados.","backup.importing":"Importando...","backup.importCheetah":"Importar Backup do Cheetah CRM","missedSchedule.title":"Campanha agendada perdida","missedSchedule.description":"Uma campanha agendada foi perdida porque o WhatsApp Web não estava aberto no horário programado.","missedSchedule.sendNow":"Enviar agora","missedSchedule.cancelDiscard":"Cancelar e descartar","missedSchedule.dismiss":"Lembrar mais tarde","calendar.title":"Calendário","calendar.goToToday":"Ir para hoje","calendar.reminders":"Lembretes","calendar.appointments":"Compromissos","calendar.remindersFor":"Lembretes para","calendar.appointmentsFor":"Compromissos para","calendar.noReminders":"Sem lembretes para esta data","calendar.noAppointments":"Sem compromissos para esta data","calendar.selectDate":"Selecione uma data com lembretes ou compromissos","calendar.deleteReminder":"Excluir lembrete","calendar.deleteAppointment":"Excluir compromisso","calendar.confirmDeleteReminder":"Tem certeza de que deseja excluir este lembrete?","calendar.confirmDeleteAppointment":"Tem certeza de que deseja excluir este compromisso?","calendar.everyMin":"A cada {min} min","calendar.everyHour":"A cada hora","calendar.weekdays.sun":"DOM","calendar.weekdays.mon":"SEG","calendar.weekdays.tue":"TER","calendar.weekdays.wed":"QUA","calendar.weekdays.thu":"QUI","calendar.weekdays.fri":"SEX","calendar.weekdays.sat":"SÁB","calendar.months.january":"Janeiro","calendar.months.february":"Fevereiro","calendar.months.march":"Março","calendar.months.april":"Abril","calendar.months.may":"Maio","calendar.months.june":"Junho","calendar.months.july":"Julho","calendar.months.august":"Agosto","calendar.months.september":"Setembro","calendar.months.october":"Outubro","calendar.months.november":"Novembro","calendar.months.december":"Dezembro","calendar.status.pending":"Pendente","calendar.status.completed":"Concluído","calendar.status.dismissed":"Dispensado","calendar.status.snoozed":"Adiado","calendar.status.stopped":"Parado","calendar.status.scheduled":"Agendado","calendar.status.cancelled":"Cancelado","calendar.status.missed":"Perdido","calendar.todos":"Tarefas","calendar.todosFor":"Tarefas para","calendar.noTodos":"Nenhuma tarefa encontrada","calendar.addTodo":"Adicionar Tarefa","calendar.editTodo":"Editar Tarefa","calendar.deleteTodo":"Excluir Tarefa","calendar.confirmDeleteTodo":"Tem certeza de que deseja excluir esta tarefa?","todo.title":"Título","todo.titlePlaceholder":"Digite o título da tarefa","todo.description":"Descrição","todo.descriptionPlaceholder":"Adicionar detalhes (opcional)","todo.dueDate":"Data de Vencimento","todo.dueTime":"Hora de Vencimento","todo.priority":"Prioridade","todo.priorityHigh":"Alta","todo.priorityMedium":"Média","todo.priorityLow":"Baixa","todo.category":"Categoria","todo.noCategory":"Sem Categoria","todo.categoryWork":"Trabalho","todo.categoryPersonal":"Pessoal","todo.categoryUrgent":"Urgente","todo.categoryShopping":"Compras","todo.categoryHealth":"Saúde","todo.subtasks":"Subtarefas","todo.addSubtask":"Adicionar","todo.subtaskPlaceholder":"Digite a subtarefa","todo.recurring":"Recorrente","todo.repeatEvery":"Repetir","todo.endDate":"Data Final","todo.recurringDaily":"Diariamente","todo.recurringWeekly":"Semanalmente","todo.recurringMonthly":"Mensalmente","todo.recurringYearly":"Anualmente","todo.reminder":"Lembrete","todo.reminderDate":"Data do Lembrete","todo.reminderTime":"Hora do Lembrete","todo.browserNotification":"Notificação do Navegador","todo.whatsappSelfMessage":"Enviar lembrete WhatsApp para mim","todo.whatsappSelfMessageHint":"Você receberá uma mensagem do WhatsApp no vencimento","todo.save":"Salvar Tarefa","todo.update":"Atualizar Tarefa","todo.cancel":"Cancelar","todo.addTodo":"Adicionar Tarefa","todo.editTodo":"Editar Tarefa","todo.statusPending":"Pendente","todo.statusInProgress":"Em Andamento","todo.statusCompleted":"Concluído","todo.statusCancelled":"Cancelado","todo.filterAll":"Todas as Tarefas","todo.filterToday":"Hoje","todo.filterThisWeek":"Esta Semana","todo.filterOverdue":"Atrasadas","todo.filterCompleted":"Concluídas","todo.today":"Hoje","todo.tomorrow":"Amanhã","todo.overdue":"Atrasado","todo.snoozeTime":"Tempo de Adiamento","todo.minutes":"minutos","todo.hour":"hora","todo.hours":"horas","todo.day":"dia","todo.taskReminder":"Lembrete de Tarefa","todo.highPriority":"Alta Prioridade","todo.mediumPriority":"Prioridade Média","todo.lowPriority":"Baixa Prioridade","todo.subtasksCount":"subtarefas","todo.snooze":"Adiar","todo.markDone":"Marcar como Feito","todo.dismiss":"Dispensar","todo.task":"Tarefa","todo.changeColor":"Clique para mudar a cor","todo.selectCategoryFirst":"Selecione uma categoria primeiro","todo.linkedContacts":"Contatos Vinculados","todo.optional":"Opcional","todo.selectContacts":"Selecionar Contatos","todo.searchContacts":"Pesquisar contatos...","todo.noContactsFound":"Nenhum contato encontrado","todo.selected":"selecionados","todo.contacts":"contatos","status.title":"Status","status.activeStatus":"Status Ativo","status.createStatus":"Criar Status","status.loading":"Carregando status...","status.noStatusFound":"Nenhum status encontrado","status.noStatusDescription":"Parece que você ainda não criou nenhum status. Clique no botão abaixo para adicionar um novo.","status.add":"Adicionar","status.statusName":"Nome do Status (opcional)","status.statusNamePlaceholder":"Criar um nome para o status","status.chooseType":"Escolha um tipo","status.type.text":"TEXTO","status.type.image":"IMAGEM","status.type.video":"VÍDEO","status.type.audio":"ÁUDIO","status.typeText":"Digite o texto","status.backgroundColor":"Escolha uma cor de fundo","status.clickToChange":"Clique para alterar","status.import":"Importar","status.dragHere":"Arraste o arquivo aqui","status.scheduleStatus":"Agendar o status","status.autoRepost24h":"Republicar o status a cada 24 horas","status.autoRepost":"Republicar Auto","status.postNow":"Publicar Agora","status.posting":"Publicando...","status.create":"Criar","status.edit":"Editar","status.delete":"Excluir","status.emoji":"Emoji","status.status.pending":"Pendente","status.status.posted":"Publicado","status.status.scheduled":"Agendado","status.status.failed":"Falhou","status.caption":"Legenda","status.captionPlaceholder":"Adicionar legenda...","ai.regenerate":"Reescrever","ai.regenerating":"Reescrevendo...","ai.regenerateWithAI":"Reescrever com IA","ai.notEnabled":"A IA não está habilitada. Por favor, configure as configurações de IA.","ai.failedToRegenerate":"Falha ao reescrever","ai.failedToRegenerateMessage":"Falha ao reescrever a mensagem","templates.attachmentType.imagevideo":"Mensagem + Imagens/Vídeos","templates.attachmentType.fluxo":"Fluxo Chatbot","broadcast.title":"Mensagens em Massa","broadcast.newCampaign":"Nova Campanha","broadcast.reports":"Relatórios","broadcast.close":"Fechar","broadcast.sending":"Enviando...","broadcast.paused":"Pausado","broadcast.completed":"Concluído","broadcast.clearHistory":"Limpar Histórico","broadcast.createCampaign":"Criar Campanha","broadcast.createCampaignSubtitle":"Enviar mensagens personalizadas para múltiplos contatos","broadcast.scheduledCampaigns":"Campanhas Agendadas","broadcast.campaignReports":"Relatórios de Campanha","broadcast.viewManageCampaigns":"Visualizar e gerenciar suas campanhas","broadcast.recipients":"Destinatários","broadcast.selected":"selecionados","broadcast.contacts":"Contatos","broadcast.groups":"Grupos","broadcast.phone":"Telefone","broadcast.phonePlaceholder":"Números de telefone com código do país","broadcast.clearAll":"Limpar Tudo","broadcast.contactsUploaded":"contatos carregados","broadcast.noGroupsSelected":'Nenhum grupo selecionado. Clique em "Adicionar Grupos" para selecionar.',"broadcast.addGroups":"Adicionar Grupos","broadcast.groupsSelected":"grupo(s) selecionado(s)","broadcast.upload":"Carregar","broadcast.select":"Selecionar","broadcast.download":"Baixar","broadcast.groupsContacts":"Contatos do Grupo","broadcast.tabsContacts":"Contatos da Aba","broadcast.kanbanBoard":"Quadro Kanban","broadcast.labelsContacts":"Contatos da Etiqueta","broadcast.allowRepeat":"Permitir Números Repetidos","broadcast.enableLinkPreview":"Ativar Pré-visualização de Link","broadcast.groupActions":"Ações de Grupo","broadcast.customTabActions":"Ações de Aba Personalizada","broadcast.labelsActions":"Ações de Etiquetas","broadcast.kanbanBoardActions":"Ações do Quadro Kanban","broadcast.skipBulkMessage":"Pular Mensagem em Massa","broadcast.skipBulkMessageInfo":"O envio de mensagens será pulado. Apenas ações (Grupos, Abas, Etiquetas, Kanban) serão realizadas nos contatos.","broadcast.appendSignature":"Adicionar Assinatura","broadcast.signaturePreview":"Visualização","broadcast.groupActionsNote":"Nota: Você deve ser administrador dos grupos para realizar as ações abaixo.","broadcast.addIntoGroups":"Adicionar aos Grupos","broadcast.removeFromGroups":"Remover dos Grupos","broadcast.selectGroups":"Selecionar Grupos","broadcast.addIntoTabs":"Adicionar às Abas Personalizadas","broadcast.removeFromTabs":"Remover das Abas Personalizadas","broadcast.selectTabs":"Selecionar Abas","broadcast.addToLabels":"Adicionar às Etiquetas","broadcast.removeFromLabels":"Remover das Etiquetas","broadcast.selectLabels":"Selecionar Etiquetas","broadcast.addToKanban":"Adicionar ao Estágio Kanban","broadcast.removeFromKanban":"Remover do Estágio Kanban","broadcast.selectCRMStage":"Selecionar CRM e Estágio","broadcast.sendRandomMessage":"Enviar mensagem aleatória para cada contato","broadcast.addMessage":"Adicionar Mensagem","broadcast.pauseSetting":"Configuração de Pausa","broadcast.pauseAfterXSends":"Pausar (após cada X envios):","broadcast.pauseTimeInSeconds":"Tempo de pausa (s):","broadcast.second":"Segundo","broadcast.message":"Mensagem","broadcast.moveUp":"Mover para Cima","broadcast.moveDown":"Mover para Baixo","broadcast.deleteMessage":"Excluir Mensagem","broadcast.templateType":"Tipo de Modelo","broadcast.messageOnly":"Apenas Mensagem","broadcast.enterMessageText":"Por favor, insira o texto da mensagem","broadcast.variable":"Variável","broadcast.phoneNumber":"Número de Telefone","broadcast.contactName":"Nome do Contato","broadcast.uploadCSVHint":"Carregue CSV com colunas adicionais para adicionar mais variáveis","broadcast.selectTemplates":"Selecionar Modelos","broadcast.noTemplates":"Nenhum modelo disponível","broadcast.sendingDelay":"Atraso de Envio","broadcast.minimumSecond":"Segundo Mínimo","broadcast.maximumSecond":"Segundo Máximo","broadcast.delayHint":"Cada mensagem será enviada com um atraso aleatório entre {min}-{max} segundos","broadcast.scheduleMessage":"Agendar Mensagem","broadcast.date":"Data","broadcast.time":"Hora","broadcast.autoSendIfMissed":"Envio automático se o horário agendado passou","broadcast.recurring":"Recorrente","broadcast.repeatInterval":"Repetir","broadcast.daily":"Diário","broadcast.weekly":"Semanal","broadcast.monthly":"Mensal","broadcast.yearly":"Anual","broadcast.selectDays":"Selecionar Dias","broadcast.sun":"Dom","broadcast.mon":"Seg","broadcast.tue":"Ter","broadcast.wed":"Qua","broadcast.thu":"Qui","broadcast.fri":"Sex","broadcast.sat":"Sáb","broadcast.ends":"Termina","broadcast.endNever":"Nunca","broadcast.endOnDate":"Na Data","broadcast.recurringHowToUse":"Como usar Recorrente","broadcast.recurringTip1":"Ative recorrente para repetir automaticamente este envio","broadcast.recurringTip2":"Escolha a frequência: Diário, Semanal, Mensal ou Anual","broadcast.recurringTip3":"Para Semanal: Selecione dias específicos (Seg, Ter, etc.)","broadcast.recurringTip4":'Defina data de término ou escolha "Nunca" para executar indefinidamente',"broadcast.recurringTip5":"Após cada envio, o próximo é agendado automaticamente","broadcast.selectDates":"Selecionar Datas","broadcast.selectMonths":"Selecionar Meses","broadcast.calendarSelectInfo":"Selecione datas específicas no calendário. Navegue entre os meses usando as setas.","broadcast.datesSelected":"datas selecionadas","broadcast.jan":"Jan","broadcast.feb":"Fev","broadcast.mar":"Mar","broadcast.apr":"Abr","broadcast.may":"Mai","broadcast.jun":"Jun","broadcast.jul":"Jul","broadcast.aug":"Ago","broadcast.sep":"Set","broadcast.oct":"Out","broadcast.nov":"Nov","broadcast.dec":"Dez","broadcast.quickStart":"Início Rápido","broadcast.previewStart":"Pré-visualizar e Iniciar","broadcast.scheduleBroadcast":"Agendar Transmissão","broadcast.sent":"Enviados","broadcast.failed":"Falharam","broadcast.resume":"Retomar","broadcast.pause":"Pausar","broadcast.stop":"Parar","broadcast.resumeCampaign":"Retomar Campanha?","broadcast.campaignInterrupted":"Uma campanha foi interrompida. Deseja retomar?","broadcast.remaining":"Restantes","broadcast.contactsProcessed":"contatos processados","broadcast.resumeCampaignBtn":"Retomar Campanha","broadcast.cancelDiscard":"Cancelar e Descartar","broadcast.dismissRemindLater":"Ignorar (Lembrar Depois)","broadcast.broadcastScheduled":"Transmissão Agendada!","broadcast.campaignPreview":"Pré-visualização da Campanha","broadcast.messages":"Mensagens","broadcast.stepSettings":"Configurações","broadcast.stepActions":"Ações","broadcast.stepReview":"Revisar","broadcast.delayRange":"Intervalo de Atraso","broadcast.pauseAfterDuration":"Pausar Após / Duração","broadcast.checkConsole":"Verifique o console do navegador para configuração detalhada","broadcast.sendingQueue":"Fila de Envio","broadcast.broadcastReports":"Relatórios de Transmissão","broadcast.campaignHistory":"Histórico de Campanhas","broadcast.noHistoryYet":"Ainda não há histórico de transmissão","broadcast.historyDescription":"Suas transmissões concluídas e agendadas aparecerão aqui","broadcast.noCampaignsYet":"Ainda não há campanhas concluídas","broadcast.dateTime":"Data e Hora","broadcast.status":"Status","broadcast.scheduled":"Agendado","broadcast.cancel":"Cancelar","broadcast.running":"Em Execução","broadcast.cancelled":"Cancelado","broadcast.downloadAllContacts":"Baixar Todos os Contatos","broadcast.downloadSentContacts":"Baixar Contatos Enviados","broadcast.downloadFailedContacts":"Baixar Contatos com Falha","broadcast.selectGroupsToAdd":"Selecionar Grupos para Adicionar Contatos","broadcast.selectGroupsToRemove":"Selecionar Grupos para Remover Contatos","broadcast.selectTabsToAdd":"Selecionar Abas para Adicionar Contatos","broadcast.selectTabsToRemove":"Selecionar Abas para Remover Contatos","broadcast.selectLabelsToAdd":"Selecionar Etiquetas para Adicionar Contatos","broadcast.selectLabelsToRemove":"Selecionar Etiquetas para Remover Contatos","broadcast.selectCRM":"Selecionar CRM","broadcast.selectStage":"Selecionar Estágio","broadcast.backToCRMs":"Voltar aos CRMs","broadcast.loadingGroups":"Carregando grupos...","broadcast.loadingTabs":"Carregando abas...","broadcast.loadingLabels":"Carregando etiquetas...","broadcast.noGroupsFound":"Nenhum grupo encontrado onde você é administrador","broadcast.noTabsFound":"Nenhuma aba personalizada encontrada. Crie abas primeiro.","broadcast.noLabelsFound":"Nenhuma etiqueta encontrada. Crie etiquetas no WhatsApp primeiro.","broadcast.noCRMsFound":"Nenhum CRM encontrado. Crie um CRM primeiro.","broadcast.noStagesFound":"Nenhum estágio encontrado neste CRM.","broadcast.tabsSelected":"abas selecionadas","broadcast.labelsSelected":"etiquetas selecionadas","broadcast.confirmSelection":"Confirmar Seleção","broadcast.availableVariables":"Variáveis disponíveis","broadcast.of":"de","broadcast.chats":"conversas","broadcast.remove":"Remover","broadcast.allScheduledCampaigns":"Todas as Campanhas Agendadas","broadcast.noScheduledCampaigns":"Nenhuma campanha agendada","broadcast.scheduleFirstCampaign":"Agende sua primeira campanha para vê-la aqui","broadcast.createNewCampaign":"Criar Nova Campanha","broadcast.oneTime":"Uma vez","broadcast.nextRun":"Próxima execução","broadcast.runNow":"Executar Agora","broadcast.pauseCampaign":"Pausar","broadcast.editCampaign":"Editar","broadcast.deleteCampaign":"Excluir","broadcast.confirmDeleteScheduled":"Tem certeza de que deseja excluir esta campanha agendada?","broadcast.campaignStarting":"A campanha começará em breve","broadcast.skipNext":"Pular Próxima","broadcast.unskipNext":"Não Pular","broadcast.skippingNext":"Pulando próxima","broadcast.lastRun":"Última execução","broadcast.runs":"execuções","broadcast.successRate":"sucesso","broadcast.justNow":"agora mesmo","broadcast.inAMoment":"em um momento","broadcast.ago":"atrás","broadcast.in":"em","broadcast.uploadContacts":"Carregar Contatos","broadcast.stepSelect":"Selecionar","broadcast.stepMap":"Mapear","broadcast.stepUpload":"Carregar","broadcast.uploadCSVImport":"Carregue um arquivo CSV para importar contatos","broadcast.uploadCSVOnly":"Apenas arquivos CSV (formato .csv)","broadcast.downloadSampleFile":"Baixar arquivo de exemplo","broadcast.phoneNumberLabel":"Número de Telefone:","broadcast.mapColumnHint":"mapeie a coluna com dados de 'Número de Telefone'","broadcast.chooseExtraColumns":"Escolha colunas extras para mensagens personalizadas.","broadcast.all":"Todos","broadcast.none":"Nenhum","broadcast.previous":"Anterior","broadcast.next":"Próximo","broadcast.removeUnwantedRows":"Remover Linhas Indesejadas","broadcast.totalContacts":"Total de Contatos","broadcast.startUpload":"Iniciar Upload","broadcast.rows":"linhas","broadcast.selectGroupsTitle":"Selecionar Grupos","broadcast.searchGroups":"Pesquisar grupos...","broadcast.members":"membros","broadcast.groupsSelectedCount":"grupos selecionados","broadcast.addGroupsBtn":"Adicionar Grupos","broadcast.tooltipBold":"Negrito","broadcast.tooltipItalic":"Itálico","broadcast.tooltipStrikethrough":"Tachado","broadcast.tooltipAddMedia":"Adicionar mídia","broadcast.tooltipRefresh":"Atualizar","broadcast.noCompletedCampaigns":"Nenhuma campanha concluída ainda","kanban.title":"CRM KANBAN","kanban.user":"Usuário","kanban.darkMode":"Modo Escuro","kanban.lightMode":"Modo Claro","kanban.menu":"Menu","kanban.createCRM":"Criar CRM","kanban.addStage":"Adicionar Etapa","kanban.analytics":"Análises","kanban.sync":"Sincronizar","kanban.cannotAddStages":"Não é possível adicionar etapas ao CRM de Etiquetas do WhatsApp","kanban.inbox":"CAIXA","kanban.unread":"Não lidos","kanban.pinned":"Fixados","kanban.groups":"Grupos","kanban.stages":"etapas","kanban.chats":"chats","kanban.searchInbox":"Pesquisar na caixa de entrada...","kanban.searchContacts":"Pesquisar...","kanban.stageOptions":"Opções da etapa","kanban.renameStage":"Renomear","kanban.clearSearch":"Limpar pesquisa","kanban.noChatsMatch":"Nenhum chat corresponde","kanban.noChatsYet":"Ainda não há chats","kanban.filterUnread":"Filtrar chats não lidos","kanban.filterPinned":"Filtrar chats fixados","kanban.filterGroups":"Filtrar chats de grupo","kanban.addNewStage":"Adicionar nova etapa","kanban.noCRMsFound":"Nenhum CRM encontrado","kanban.selectCRM":"Selecione um CRM no menu","kanban.loading":"Carregando Kanban CRM...","kanban.syncingLabels":"Sincronizando Etiquetas do WhatsApp e Abas...","kanban.switchCRM":"Trocar CRM","kanban.createNewCRM":"Criar Novo CRM","kanban.enterCRMName":"Digite o nome do CRM...","kanban.addNewStageTitle":"Adicionar Nova Etapa","kanban.enterStageName":"Digite o nome da etapa...","kanban.editStage":"Editar Etapa","kanban.editStageName":"Editar nome da etapa","kanban.deleteStage":"Excluir etapa","kanban.editCRM":"Editar CRM","kanban.deleteCRM":"Excluir CRM","kanban.confirmDeleteStage":"Tem certeza? Os chats serão movidos para a caixa de entrada.","kanban.cannotDeleteInbox":"Não é possível excluir a etapa da caixa de entrada.","kanban.cannotAddStagesLabels":"Não é possível adicionar etapas ao CRM de Etiquetas. As etiquetas são sincronizadas do WhatsApp.","kanban.chatsLoadedSuccess":"Chats carregados com sucesso!","kanban.failedLoadChats":"Falha ao carregar chats. Certifique-se de estar no WhatsApp Web.","kanban.noAvailableChats":"Nenhum chat disponível.","kanban.enterNewCRMName":"Digite o novo nome do CRM:","kanban.name":"Nome","kanban.phone":"Telefone","kanban.lastMessage":"Última Mensagem","kanban.noMessages":"Sem mensagens","kanban.unreadCount":"Não lidos","kanban.type":"Tipo","kanban.groupChat":"Chat de Grupo","kanban.individualChat":"Chat Individual","kanban.status":"Status","kanban.dealValue":"Valor do Negócio (R$)","kanban.enterDealValue":"Digite o valor","kanban.notes":"Notas","kanban.addNotes":"Adicionar notas sobre este chat...","kanban.justNow":"Agora","kanban.group":"Grupo","kanban.muted":"Silenciado","kanban.save":"Salvar","kanban.cancel":"Cancelar","kanban.close":"Fechar","kanban.analyticsTitle":"Painel de Análises","kanban.analyticsSubtitle":"Métricas de desempenho do pipeline","kanban.exportCSV":"Exportar CSV","kanban.exportPDF":"Exportar PDF","kanban.noAnalyticsData":"Nenhum dado de análise","kanban.from":"De:","kanban.to":"Até:","kanban.totalChats":"Total de Chats","kanban.pipelineValue":"Valor do Pipeline","kanban.activeStages":"Etapas ativas do pipeline","kanban.stagePerformance":"Desempenho por Etapa","kanban.stage":"Etapa","kanban.value":"Valor","kanban.avgTime":"Tempo Méd.","kanban.conversion":"Conversão","kanban.chatDistribution":"Distribuição de Chats","kanban.allTime":"Todo o período","kanban.today":"Hoje","kanban.last7Days":"Últimos 7 dias","kanban.last30Days":"Últimos 30 dias","kanban.allowPopups":"Por favor, permita popups para exportar PDF","kanban.addSampleChat":"Adicionar Chat de Exemplo","kanban.crmName":"Nome do CRM","kanban.stageName":"Nome da Etapa","kanban.saveChanges":"Salvar Alterações","kanban.createFirstCRM":"Crie seu primeiro CRM para começar a organizar seus chats do WhatsApp.","kanban.noStagesFound":"Nenhuma etapa encontrada neste CRM.","kanban.syncOrAddStages":"Sincronize dados do WhatsApp ou adicione etapas personalizadas.","kanban.chatDetails":"Detalhes do Chat","kanban.notAvailable":"N/D","kanban.addNotesPlaceholder":"Adicionar notas sobre este chat...","kanban.thisWeek":"esta semana","kanban.avg":"Méd","kanban.stagesLabel":"Etapas","kanban.activePipelineStages":"Etapas do pipeline ativas","kanban.customRange":"Intervalo Personalizado","kanban.dateRange":"Intervalo de Datas","kanban.confirmDeleteCrm":"Tem certeza de que deseja excluir este CRM? Todas as etapas e chats serão removidos.","kanban.openInWhatsApp":"Abrir no WhatsApp","kanban.removeFromStage":"Remover da etapa","kanban.openCRM":"Abrir CRM","kanban.addNote":"Adicionar Nota","kanban.scheduleMessage":"Agendar Mensagem","kanban.addIncome":"Adicionar Renda","kanban.whatsappNotOpen":"WhatsApp Web não está aberto. Por favor, abra o WhatsApp Web primeiro.","kanban.failedToOpenChat":"Falha ao abrir chat no WhatsApp","kanban.removeFromStageConfirm":"Tem certeza de que deseja remover este chat da etapa atual?","kanban.failedToRemove":"Falha ao remover chat da etapa","kanban.failedToOpenCRM":"Falha ao abrir CRM","kanban.chatPopup":"Chat","kanban.typeMessage":"Digite uma mensagem...","kanban.sendMessage":"Enviar","kanban.loadingMessages":"Carregando mensagens...","kanban.failedToLoadMessages":"Falha ao carregar mensagens","kanban.failedToSendMessage":"Falha ao enviar mensagem","kanban.yesterday":"Ontem","kanban.refresh":"Atualizar","kanban.loadingMedia":"Carregando...","kanban.clickToLoad":"Clique para carregar","kanban.addToStage":"Adicionar ao Estágio CRM","kanban.selectCrmStage":"Selecionar CRM e Estágio","kanban.retry":"Tentar novamente","kanban.attach":"Anexar arquivo","kanban.addCaption":"Adicionar legenda...","kanban.audioMessage":"Mensagem de áudio","kanban.document":"Documento","kanban.location":"Localização","kanban.contact":"Contato","kanban.quickReply":"Resposta Rápida","kanban.fluxo":"Fluxo","kanban.more":"mais","kanban.showLess":"Mostrar menos","kanban.noQuickReplies":"Sem respostas rápidas","kanban.noFluxos":"Sem fluxos ativos","kanban.users":"Usuários","kanban.usersBreakdown":"Detalhamento por Usuário","kanban.searchUsers":"Pesquisar usuários por nome ou número...","kanban.noUsersFound":"Nenhum usuário encontrado","kanban.tryDifferentSearch":"Tente um termo de pesquisa diferente","kanban.crm":"CRM","kanban.tabs":"Abas","kanban.labels":"Etiquetas","kanban.crmBreakdown":"Detalhamento por Etapa CRM","kanban.tabsBreakdown":"Detalhamento por Abas","kanban.labelsBreakdown":"Detalhamento por Etiquetas","kanban.noDataFound":"Nenhum dado encontrado","kanban.addDataToSeeAnalytics":"Adicione dados de receita/despesa aos contatos para ver análises","kanban.incomeVsExpense":"Receita vs Despesa por","kanban.contacts":"contatos","kanban.netProfit":"LUCRO LÍQUIDO","kanban.crmProfit":"Lucro CRM","kanban.tabsProfit":"Lucro Abas","kanban.labelsProfit":"Lucro Etiquetas","kanban.profitDistribution":"Distribuição de Lucros","kanban.sourceComparison":"Comparação de Fontes","kanban.totalContacts":"Contatos Totais","kanban.avgPerSource":"Média por Fonte","kanban.loadingMore":"Carregando mais...","kanban.allChatsLoaded":"Todos os chats carregados","kanban.dragToReorder":"Arraste para reordenar","crm.categoryBreakdown":"Detalhamento por Categoria","crm.incomeByCategory":"Receita por Categoria","crm.expenseByCategory":"Despesa por Categoria","crm.paymentMethodBreakdown":"Detalhamento por Método de Pagamento","crm.incomeByPayment":"Receita por Método de Pagamento","crm.expenseByPayment":"Despesa por Método de Pagamento","crm.userWiseBreakdown":"Detalhamento por Usuário","crm.net":"Líquido","crm.transactions":"Transações","crm.margin":"Margem","crm.netProfit":"Lucro Líquido","chart.income":"Receita","chart.expense":"Despesa","chart.profit":"Lucro","chart.noDataAvailable":"Nenhum dado disponível","chart.noProfitData":"Nenhum dado de lucro disponível","chart.noTrendData":"Nenhum dado de tendência disponível","bulkValidator.title":"Validador de Números em Massa","bulkValidator.subtitle":"Valide números do WhatsApp em massa com campanhas","bulkValidator.menu":"Menu","bulkValidator.activeCampaigns":"Campanhas Ativas","bulkValidator.completed":"Concluídas","bulkValidator.noActiveCampaigns":"Nenhuma campanha ativa. Inicie uma nova para validar números.","bulkValidator.noCompleted":"Ainda não há campanhas concluídas.","bulkValidator.createHint":"Envie um CSV de números e inicie uma validação.","bulkValidator.newCampaign":"Nova Campanha de Validação","bulkValidator.createCampaign":"Criar Nova Campanha","bulkValidator.campaignName":"Nome da Campanha","bulkValidator.enterCampaignName":"Digite o nome da campanha","bulkValidator.countryCode":"Código do País","bulkValidator.countryCodeHint":"Selecione o código do país para números sem prefixo","bulkValidator.uploadCSV":"Carregar Arquivo CSV","bulkValidator.csvHint":"Arquivo CSV com números de telefone (um por linha ou separados por vírgula)","bulkValidator.numbersFound":"números encontrados","bulkValidator.enterNameAndUpload":"Por favor, digite o nome da campanha e carregue os números","bulkValidator.createAndStart":"Criar Campanha","bulkValidator.campaigns":"Campanhas","bulkValidator.noCampaigns":"Nenhuma campanha ainda. Crie uma para começar a validar números.","bulkValidator.confirmDelete":"Tem certeza de que deseja excluir esta campanha?","bulkValidator.valid":"Válido","bulkValidator.invalid":"Inválido","bulkValidator.pending":"Pendente","bulkValidator.start":"Iniciar","bulkValidator.pause":"Pausar","bulkValidator.downloadValid":"Baixar Números Válidos","bulkValidator.downloadInvalid":"Baixar Números Inválidos","bulkValidator.downloadAll":"Baixar Todos","bulkValidator.all":"Todos","tools.allTools":"Todas as Ferramentas","tools.subtitle":"Clique para abrir • Arraste para o cabeçalho para fixar","tools.featureSettings":"Configurações de Recursos","tools.pinnedTooltip":"Fixado no cabeçalho (arraste para Ferramentas para soltar)","tools.itemTooltip":"{name} — clique para abrir ou arraste para o cabeçalho para fixar","tools.category.communication":"Comunicação","tools.category.management":"Gerenciamento","tools.category.automation":"Automação","tools.category.validation":"Validação","webhook.title":"Webhooks","webhook.subtitle":"Enviar dados de contato para outro aplicativo após a execução de eventos registrados","webhook.events":"eventos","webhook.quickResponses":"Respostas Rápidas","webhook.appointment":"Agendamento","webhook.reminder":"Lembrete","webhook.contactProfile":"Perfil de Contato","webhook.notes":"Notas","webhook.income":"Receita","webhook.expense":"Despesa","webhook.kanban":"Kanban","webhook.labels":"Etiquetas","webhook.customTabs":"Abas Personalizadas","webhook.messages":"Mensagens","webhook.todos":"Lista de Tarefas","webhook.webhookData":"Dados do WebHook","webhook.webhookUrl":"URL do WebHook","webhook.enterUrl":"Digite a URL de destino aqui","webhook.active":"Ativo","webhook.dataToSend":"Dados para enviar","webhook.lastUploads":"Últimos envios (máximo 30 visualizações)","webhook.noUploads":"Nenhum envio ainda","webhook.close":"Fechar","webhook.save":"Salvar","webhook.saving":"Salvando...","webhook.field.eventDetails":"Detalhes do Evento","webhook.field.number":"Número","webhook.field.name":"Nome","webhook.field.picture":"Foto","webhook.field.labels":"Etiquetas","webhook.field.contactProfile":"Perfil de Contato","webhook.field.appointmentTime":"Horário do Agendamento","webhook.field.meetingLink":"Link da Reunião","webhook.field.reminderTopic":"Tópico do Lembrete","webhook.field.reminderTime":"Horário do Lembrete","webhook.field.reminderDetails":"Detalhes do Lembrete","webhook.field.email":"E-mail","webhook.field.gender":"Gênero","webhook.field.dateOfBirth":"Data de Nascimento","webhook.field.address":"Endereço","webhook.field.details":"Detalhes","webhook.field.customFields":"Campos Personalizados","webhook.field.noteTopic":"Tópico da Nota","webhook.field.noteContent":"Conteúdo da Nota","webhook.field.noteTimestamp":"Carimbo de Data/Hora da Nota","webhook.field.amount":"Valor","webhook.field.category":"Categoria","webhook.field.paymentMethod":"Método de Pagamento","webhook.field.description":"Descrição","webhook.field.reference":"Referência/Fatura","webhook.field.referenceBill":"Referência/Conta","webhook.field.transactionDate":"Data da Transação","webhook.field.status":"Status","webhook.field.cardTitle":"Título do Cartão","webhook.field.columnName":"Coluna/Estágio","webhook.field.cardDescription":"Descrição do Cartão","webhook.field.labelId":"ID da Etiqueta","webhook.field.labelName":"Nome da Etiqueta","webhook.field.labelColor":"Cor da Etiqueta","webhook.field.allLabels":"Todas as Etiquetas do Contato","webhook.field.tabId":"ID da Aba","webhook.field.tabName":"Nome da Aba","webhook.field.tabColor":"Cor da Aba","webhook.field.allTabs":"Todas as Abas do Contato","webhook.field.direction":"Direção (entrada/saída)","webhook.field.messageContent":"Conteúdo da Mensagem","webhook.field.messageType":"Tipo de Mensagem","webhook.field.messageId":"ID da Mensagem","webhook.field.mediaUrl":"URL da Mídia","webhook.field.quotedMessage":"Mensagem Citada","webhook.field.timestamp":"Carimbo de Data/Hora","webhook.field.ctwaData":"Dados de Meta Ads (CTWA)","webhook.field.todoTitle":"Título da Tarefa","webhook.field.todoDescription":"Descrição da Tarefa","webhook.field.todoDueDate":"Data de Vencimento","webhook.field.todoPriority":"Prioridade","webhook.field.todoCategory":"Categoria","webhook.field.todoStatus":"Status","webhook.field.todoSubtasks":"Subtarefas","api.configureAPI":"Configurar API","api.manageToken":"Gerencie seu token de API e configurações","api.apiToken":"Token de API","api.generateToken":"Gerar Token","api.regenerate":"Regenerar","api.generating":"Gerando...","api.copyToken":"Copiar token","api.tokenWarning":"Mantenha este token em segredo. Qualquer pessoa com acesso pode enviar mensagens em seu nome.","api.enableAPI":"Habilitar API","api.apiIsEnabled":"API está atualmente habilitada","api.apiIsDisabled":"API está atualmente desabilitada","api.openDocumentation":"Abrir Documentação","api.queuePolling":"Sondagem de Fila","api.pollingActive":"Verificando mensagens na fila a cada 5 minutos","api.pollingInactive":"Habilitar para processar mensagens API recebidas","audioTranscribe.title":"Transcrição","audioTranscribe.transcribeAudio":"Transcrever áudio","audioTranscribe.copy":"Copiar","audioTranscribe.copied":"Copiado!","audioTranscribe.translate":"Traduzir","audioTranscribe.translating":"Traduzindo...","audioTranscribe.translated":"Traduzido!","audioTranscribe.original":"Original:","audioTranscribe.translatedLabel":"Traduzido","audioTranscribe.close":"Fechar","audioTranscribe.requiresChatGPT":"A transcrição de áudio requer chave API do ChatGPT. Configure o ChatGPT como seu provedor de IA nas configurações.","audioTranscribe.audioNotFound":"Não foi possível encontrar a URL do áudio. O áudio pode não estar disponível.","audioTranscribe.transcriptionFailed":"Falha na transcrição","audioTranscribe.configureAI":"Configure primeiro as configurações de IA para usar a tradução.","audioTranscribe.translationFailed":"Falha na tradução","audioTranscribe.translationTimeout":"Tempo limite de tradução esgotado. Tente novamente.","aiBot.title":"Bot de IA","aiBot.tab.testChat":"Chat de teste","aiBot.tab.qaPairs":"Pares de Perguntas e Respostas","aiBot.tab.aiBehavior":"Comportamento da IA","aiBot.tab.trainingData":"Dados de treinamento","aiBot.tab.escalation":"Escalonamento","aiBot.tab.dataPreview":"Visualização de dados","aiBot.tab.actionPrompts":"Prompts de ação","aiBot.tab.scheduleTiming":"Horário e tempo","aiBot.tab.trainingDataComingSoon":"Upload de documentos, scraping de URL e fontes de texto simples chegarão na próxima atualização.","aiBot.tab.escalationComingSoon":"A transferência automática para um humano após um número configurável de mensagens não respondidas chegará na próxima atualização.","aiBot.tab.dataPreviewComingSoon":"Uma visão somente leitura de cada par de Perguntas e Respostas, fonte e fragmento ao qual a IA tem acesso.","aiBot.comingSoon":"Em breve","aiBot.qa.addPair":"Adicionar par","aiBot.qa.editPair":"Editar par","aiBot.qa.questionLabel":"Pergunta","aiBot.qa.questionPlaceholder":"O que os clientes podem perguntar…","aiBot.qa.answerLabel":"Resposta","aiBot.qa.answerPlaceholder":"Como a IA deve responder…","aiBot.qa.categoryLabel":"Categoria (opcional)","aiBot.qa.categoryPlaceholder":"ex. Preços, Suporte, Onboarding","aiBot.qa.existingPairs":"Pares existentes","aiBot.qa.empty":"Ainda sem pares. Adicione o primeiro acima.","aiBot.qa.cancel":"Cancelar","aiBot.qa.update":"Atualizar","aiBot.qa.delete":"Excluir","aiBot.qa.edit":"Editar","aiBot.qa.enabled":"Ativado","aiBot.qa.disabled":"Desativado","aiBot.qa.on":"Lig.","aiBot.qa.off":"Desl.","aiBot.qa.deleteConfirm":"Excluir este par?","aiBot.qa.itemSingular":"par","aiBot.qa.itemPlural":"pares","aiBot.behavior.providerConfig":"Provedor de IA","aiBot.behavior.provider":"Provedor","aiBot.behavior.model":"Modelo","aiBot.behavior.apiActive":"API ativa","aiBot.behavior.noApiKey":"Sem chave de API","aiBot.behavior.apiKeyHint":"Adicione sua chave de API nas configurações de Ferramentas de IA para ativar o bot.","aiBot.behavior.triggerWords":"Palavras-gatilho","aiBot.behavior.triggerWordsPlaceholder":"suporte, ajuda, demo (separadas por vírgulas)","aiBot.behavior.triggerWordsHelp":"Quando definidas, o bot responde apenas a mensagens que contenham pelo menos uma destas palavras. Deixe vazio para responder a tudo.","aiBot.behavior.responseSettings":"Configurações de resposta","aiBot.behavior.responseTone":"Tom da resposta","aiBot.behavior.maxResponseLength":"Comprimento máximo da resposta","aiBot.behavior.temperature":"Temperatura","aiBot.behavior.temperatureHelp":"Mais baixa = mais focada. Mais alta = mais criativa.","aiBot.behavior.maxTokens":"Tokens máx.","aiBot.behavior.maxTokensHelp":"Limita o tamanho da resposta da IA.","aiBot.behavior.systemPrompt":"Contexto comercial / Prompt do sistema","aiBot.behavior.systemPromptPlaceholder":"Conte à IA sobre seu negócio, produtos e como ela deve representá-lo…","aiBot.behavior.systemPromptHelp":"Usado como instrução fundamental para cada resposta da IA.","aiBot.behavior.fallbackMessage":"Mensagem de fallback","aiBot.behavior.fallbackMessageHelp":"Enviada quando a IA não tem um par de Perguntas e Respostas, fonte ou conhecimento geral relevante para responder.","aiBot.behavior.saved":"✓ Salvo","aiBot.behavior.saveBehavior":"Salvar comportamento","aiBot.behavior.tone_friendly":"Amigável","aiBot.behavior.tone_professional":"Profissional","aiBot.behavior.tone_casual":"Casual","aiBot.behavior.tone_formal":"Formal","aiBot.behavior.tone_empathetic":"Empático","aiBot.behavior.length_short":"Curta (~50 palavras)","aiBot.behavior.length_medium":"Média (~200 palavras)","aiBot.behavior.length_long":"Longa (~400 palavras)","aiBot.kb.urlTitle":"Adicionar URL do site","aiBot.kb.urlPlaceholder":"https://exemplo.com/sobre","aiBot.kb.addUrl":"Adicionar URL","aiBot.kb.scraping":"Buscando…","aiBot.kb.urlHelp":"Buscamos a página e extraímos seu texto visível. Apenas página única — SPAs renderizadas em JS podem retornar pouco conteúdo.","aiBot.kb.errorEmpty":"Nenhum texto legível encontrado nessa URL.","aiBot.kb.errorBlocked":'Não foi possível acessar essa URL. O site pode bloquear solicitações automatizadas, exigir login ou ser renderizado em JS. Tente copiar o texto para "Colar texto simples" abaixo.',"aiBot.kb.blockedChromeStore":'A Chrome Web Store bloqueia solicitações automatizadas. Abra a listagem em seu navegador, copie o texto da descrição e cole em "Colar texto simples" abaixo.',"aiBot.kb.blockedGoogle":"Páginas do Google Docs / Drive / Sheets exigem login e não podem ser extraídas. Exporte para PDF/DOCX/TXT e faça o upload.","aiBot.kb.blockedSocial":'Redes sociais bloqueiam solicitações automatizadas. Copie o texto relevante e cole em "Colar texto simples" abaixo.',"aiBot.kb.blockedNotion":"Páginas do Notion são renderizadas em JS e retornam pouco texto. Exporte a página como Markdown/PDF e faça o upload.","aiBot.kb.plainTextTitle":"Colar texto simples","aiBot.kb.textTitlePlaceholder":'Título (opcional, ex. "Política de reembolso")',"aiBot.kb.textBodyPlaceholder":"Cole qualquer texto que a IA deve conhecer — preços, FAQs, políticas, instruções…","aiBot.kb.charsLabel":"caracteres","aiBot.kb.saveText":"Salvar texto","aiBot.kb.saving":"Salvando…","aiBot.kb.trainingSources":"Fontes de treinamento","aiBot.kb.sourceSingular":"fonte","aiBot.kb.sourcePlural":"fontes","aiBot.kb.chunkSingular":"fragmento","aiBot.kb.chunkPlural":"fragmentos","aiBot.kb.empty":"Ainda sem fontes de treinamento. Adicione uma URL ou cole texto simples acima.","aiBot.kb.deleteConfirm":"Excluir esta fonte?","aiBot.kb.uploadTitle":"Carregar documentos","aiBot.kb.uploadPrompt":"Clique para escolher um arquivo, ou arraste e solte aqui","aiBot.kb.uploadFormats":"PDF, DOCX, TXT, CSV, MD","aiBot.kb.uploadMaxSize":"Máx. 10 MB por arquivo","aiBot.kb.parsing":"Processando…","aiBot.kb.parsingFile":"Processando","aiBot.esc.enableAuto":"Ativar escalonamento automático","aiBot.esc.enableAutoDesc":"Transferir automaticamente para um humano quando a IA não puder ajudar ou o cliente pedir.","aiBot.esc.maxAttempts":"Máx. de tentativas falhadas","aiBot.esc.maxAttemptsHelp":"Transferir após este número de respostas de fallback consecutivas (janela de 24h).","aiBot.esc.triggerPhrases":"Frases-gatilho (uma por linha)","aiBot.esc.triggerPhrasesHelp":"Quando qualquer uma destas frases aparece numa mensagem recebida, o bot escalona imediatamente. Correspondência de subcadeia sem distinção de maiúsculas.","aiBot.esc.message":"Mensagem de escalonamento","aiBot.esc.messageHelp":"Enviada ao cliente logo antes de o bot parar de responder para que um humano possa assumir.","aiBot.esc.saveRules":"Salvar regras de escalonamento","aiBot.esc.statusOn":"Ativado","aiBot.esc.statusOff":"Desativado","aiBot.preview.qaPairsLabel":"Pares de Perguntas e Respostas","aiBot.preview.sourcesLabel":"Fontes","aiBot.preview.chunksLabel":"Fragmentos","aiBot.preview.helpText":"Isto é exatamente ao que a IA tem acesso agora. Itens desativados não são usados.","aiBot.preview.escalationSummary":"Escalonamento","aiBot.preview.escStatus":"Status","aiBot.preview.escThreshold":"Após","aiBot.preview.escFailed":"respostas de fallback consecutivas","aiBot.preview.escPhrases":"Frases-gatilho","aiBot.preview.escNoPhrases":"nenhuma","aiBot.preview.qaPairsTitle":"Pares de Perguntas e Respostas","aiBot.preview.sourcesTitle":"Fontes de treinamento","aiBot.preview.noQa":"Sem pares ativados.","aiBot.preview.noSources":"Sem fontes ativadas.","aiBot.fallbackMoved":"A resposta de fallback foi movida para a aba Comportamento da IA. Sua mensagem existente é preservada automaticamente.","aiBot.businessPromptMoved":"O prompt comercial foi movido para a aba Comportamento da IA. Edite-o lá — seu prompt existente é preservado.","aiBot.generalKnowledgeMoved":'A chave "Permitir que a IA use conhecimento geral" foi movida para a aba Comportamento da IA.',"aiBot.stopKeywordsRecommend":"Para novas configurações, recomendamos a aba Escalonamento — adiciona um contador de tentativas e frases-gatilho além das paradas por palavra-chave. Esta seção ainda funciona para paradas por palavra-chave apenas.","aiBot.subtitle":"Configurar respostas automáticas de IA","aiBot.menu":"Menu","aiBot.enableBot":"Ativar Bot de IA","aiBot.enableBotDesc":"Responder automaticamente a mensagens recebidas","aiBot.replyInGroups":"Responder em Grupos","aiBot.replyInGroupsDesc":"Permitir que o Bot de IA responda em chats de grupo (desativado por padrão)","aiBot.allowGeneralKnowledge":"Permitir IA usar Conhecimento Geral","aiBot.allowGeneralKnowledgeDesc":"Quando DESLIGADO, a IA responde apenas com base no seu prompt de negócio. Quando LIGADO, a IA também pode usar seu conhecimento geral.","aiBot.fallbackReply":"Resposta de Reserva","aiBot.fallbackReplyDesc":"Quando a IA não tem informação no seu prompt de negócio, enviará esta resposta em vez de inventar respostas.","aiBot.fallbackReplyPlaceholder":"Exemplo: Obrigado pela sua pergunta! Não tenho informações específicas sobre isso no momento. Nossa equipe entrará em contato em breve.","aiBot.smartDetection":"Detecção Inteligente","aiBot.smartDetectionDesc":"A IA detecta automaticamente frustração ou pedidos de assistência humana","aiBot.monday":"Segunda-feira","aiBot.tuesday":"Terça-feira","aiBot.wednesday":"Quarta-feira","aiBot.thursday":"Quinta-feira","aiBot.friday":"Sexta-feira","aiBot.saturday":"Sábado","aiBot.sunday":"Domingo","aiBot.enableWeekdays":"Ativar dias úteis","aiBot.disableWeekdays":"Desativar dias úteis","aiBot.enableWeekends":"Ativar fins de semana","aiBot.disableWeekends":"Desativar fins de semana","aiBot.applyToAll":"Aplicar a todos:","aiBot.apply":"Aplicar","aiBot.day":"Dia","aiBot.active":"Ativo","aiBot.currentStatus":"Status atual:","aiBot.botOffToday":"Bot está DESLIGADO hoje","aiBot.businessPrompt":"Prompt de Negócio","aiBot.businessPromptDesc":"Personalize como a IA responde. Descreva seu negócio, tom e diretrizes.","aiBot.businessPromptPlaceholder":"Exemplo: Você é um representante de atendimento ao cliente da [Nome da Empresa]. Vendemos [produto/serviço]. Seja amigável e profissional.","aiBot.schedule":"Horário do Bot","aiBot.scheduleEnabled":"Ativar agendamento","aiBot.scheduleEnabledDesc":"Bot responde apenas durante dias e horários definidos","aiBot.startTime":"Hora de início","aiBot.endTime":"Hora de término","aiBot.to":"até","aiBot.timezone":"Fuso horário","aiBot.replyTiming":"Tempo de resposta","aiBot.replyTimingDesc":"Atraso aleatório antes da resposta da IA","aiBot.minDelay":"Atraso mín. (seg.)","aiBot.maxDelay":"Atraso máx. (seg.)","aiBot.enabledActions":"Ações ativadas","aiBot.enabledActionsDesc":"Escolha quais ações a IA pode executar","aiBot.actionNormalReply":"Enviar resposta","aiBot.actionNormalReplyDesc":"IA envia mensagens de texto","aiBot.actionKanban":"Atualizar Kanban","aiBot.actionKanbanDesc":"Mover contatos entre estágios Kanban","aiBot.actionLabels":"Atualizar etiquetas","aiBot.actionLabelsDesc":"Adicionar/remover etiquetas do WhatsApp","aiBot.actionTabs":"Atualizar abas","aiBot.actionTabsDesc":"Adicionar/remover de abas personalizadas","aiBot.actionAppointment":"Criar compromisso","aiBot.actionAppointmentDesc":"Agendar compromissos a partir de conversas","aiBot.tabsPromptLabel":"Instruções personalizadas para gerenciamento de abas:","aiBot.tabsPromptPlaceholder":'Ex: Se o usuário perguntar sobre serviços SEO, adicionar à aba "Leads SEO"...',"aiBot.meetingLinkLabel":"Link do Google Meet:","aiBot.meetingLinkPlaceholder":"https://meet.google.com/xxx-xxxx-xxx","aiBot.meetingLinkDesc":"Este link será usado para todos os compromissos criados pela IA","aiBot.messageTemplateLabel":"Modelo de mensagem:","aiBot.messageTemplateDesc":"Esta mensagem será enviada como lembrete de compromisso","aiBot.varName":"Nome","aiBot.varDate":"Data","aiBot.varTime":"Hora","aiBot.varLink":"Link","aiBot.messageTemplatePlaceholder":"Olá {name}, seu compromisso está agendado para {date} às {time}. Entre aqui: {link}","aiBot.officeHoursLabel":"Horário comercial (Horários de compromisso):","aiBot.officeHoursDesc":"A IA só agendará compromissos dentro desses horários","aiBot.sendMessageNow":"Enviar mensagem imediatamente","aiBot.sendMessageNowDesc":"Enviar mensagem do compromisso logo após criar","aiBot.appointmentPromptLabel":"Instruções personalizadas da IA:","aiBot.appointmentPromptPlaceholder":"Ex: Ao agendar compromissos, sempre sugerir horários entre 10h - 18h...","aiBot.actionProfile":"Atualizar perfil","aiBot.actionProfileDesc":"Extrair e salvar informações de contato","aiBot.contextMessages":"Mensagens de contexto","aiBot.contextMessagesDesc":"Número de mensagens anteriores para contexto da IA","aiBot.settingsTab":"Configurações","aiBot.promptSettings":"Config. de Prompt","aiBot.actionPrompts":"Prompts de Ações","aiBot.actionPromptsDesc":"Configure prompts personalizados para diferentes ações de IA","aiBot.talkToAI":"Falar com IA","aiBot.testYourBot":"Teste seu Bot de IA","aiBot.testDescription":"As mensagens usam as configurações atuais (incluindo alterações não salvas)","aiBot.clearChat":"Limpar Chat","aiBot.typeTestMessage":"Digite uma mensagem de teste...","aiBot.aiTyping":"IA está digitando...","aiBot.noMessages":"Digite uma mensagem para testar como seu Bot de IA responderá","aiBot.send":"Enviar","aiBot.copy":"Copiar","aiBot.copied":"Copiado!","aiBot.select":"Selecionar","aiBot.aiNotConfigured":"IA não configurada. Configure a chave API de IA primeiro.","aiBot.noResponse":"Sem resposta da IA","aiBot.stopKeywords":"Palavras de Parada","aiBot.stopKeywordsInfo":"Quando o cliente envia qualquer uma dessas palavras, o Bot de IA parará de responder e o colocará na lista negra.","aiBot.enableStopKeywords":"Habilitar Palavras de Parada","aiBot.enableStopKeywordsDesc":"Parar automaticamente o Bot de IA quando o cliente solicitar assistência humana","aiBot.keywords":"Palavras-chave","aiBot.noKeywords":"Nenhuma palavra-chave adicionada ainda","aiBot.enterKeyword":"Digite a palavra-chave...","aiBot.add":"+ Adicionar","aiBot.stopMessage":"Mensagem de Parada","aiBot.stopMessagePlaceholder":"Mensagem enviada quando palavra de parada é detectada...","aiBot.stopMessageHint":"Esta mensagem será enviada ao cliente quando uma palavra de parada for detectada.","aiBot.responseMode":"Modo de Resposta:","aiBot.aiBotPrompt":"Prompt do Bot IA","aiBot.globalChatGPT":"ChatGPT Global","aiBot.newChat":"Nova Conversa","aiBot.clearAll":"Limpar Tudo","aiBot.searchChats":"Pesquisar conversas...","aiBot.noSearchResults":"Nenhuma conversa encontrada","aiBot.noChatsYet":"Ainda não há histórico de conversas","aiBot.deleteChat":"Excluir conversa","aiBot.chatsStored":"conversas salvas","aiBot.clearAllTitle":"Limpar Todas as Conversas?","aiBot.clearAllDesc":"Isso excluirá permanentemente todo o seu histórico de conversas. Esta ação não pode ser desfeita.","aiBot.messages":"mensagens","aiBot.today":"Hoje","aiBot.yesterday":"Ontem","crm.aiBotBlacklist":"Bot de IA","crm.aiBotEnabled":"Ativado para este contato","crm.aiBotDisabled":"Desativado para este contato","common.saved":"Salvo","crm.chatbotFlow":"Fluxo de Chatbot","crm.chatbotFlowDesc":"Crie bots de resposta automática por palavras-chave","crm.createNewFlow":"Criar novo fluxo","crm.noFlowsYet":"Nenhum fluxo ainda","crm.createFirstFlow":"Crie seu primeiro fluxo de chatbot","crm.active":"Ativo","crm.inactive":"Inativo","crm.flowName":"Nome do Fluxo","crm.untitledFlow":"Fluxo sem título","crm.duplicate":"Duplicar","crm.triggers":"Gatilhos","crm.actions":"Ações","crm.rules":"Regras","crm.chatbotFlows":"Fluxos de chatbot","crm.exportFlows":"Exportar","crm.importFlows":"Importar","crm.exportAll":"Exportar tudo","crm.exportSelected":"Exportar selecionados","crm.selectFlowsToExport":"Selecione os fluxos para exportar","crm.importSuccess":"Fluxos importados com sucesso!","crm.importError":"Erro ao importar fluxos","crm.invalidFlowFile":"Formato de arquivo de fluxo inválido","crm.duplicateFlowFound":"Fluxo duplicado encontrado","crm.flowAlreadyExists":"'{name}' já existe. O que você gostaria de fazer?","crm.replaceFlow":"Substituir","crm.skipFlow":"Pular","crm.renameAndAdd":"Renomear e adicionar","crm.noFlowsSelected":"Por favor, selecione pelo menos um fluxo","crm.noFlowsToExport":"Nenhum fluxo para exportar","crm.flowsExported":"{count} fluxo(s) exportado(s)","crm.flowsImported":"{count} fluxo(s) importado(s)","crm.selected":"selecionado(s)","crm.enabled":"Ativado","crm.allFlows":"Todos","crm.byCategory":"Categorias","crm.viewAllFlows":"Ver todos os fluxos","crm.viewByCategory":"Ver por categoria","crm.addFluxoCategory":"Adicionar categoria","crm.manageCategories":"Gerenciar categorias","crm.editCategory":"Editar categoria","crm.createCategory":"Criar categoria","crm.createCategoryBtn":"Criar categoria","crm.fluxoCategoryName":"Nome","crm.categoryIcon":"Ícone","crm.categoryColor":"Cor","crm.preview":"Prévia","crm.custom":"Personalizado","crm.enterFluxoCategoryName":"Digite o nome da categoria","crm.fluxoCategoryNameRequired":"Nome da categoria é obrigatório","crm.fluxoCategoryNameExists":"Uma categoria com este nome já existe","crm.confirmDeleteCategory":"Excluir esta categoria? Os fluxos serão movidos para Sem categoria.","crm.uncategorized":"Sem categoria","crm.noFlowsInCategory":"Nenhum fluxo nesta categoria","crm.dragFlowsHere":"Arraste fluxos aqui para organizar","crm.dropHere":"Solte aqui","crm.dragToMove":"Arraste para mover","crm.noCategoriesYet":"Nenhuma categoria ainda","crm.createCategoryHint":"Crie uma categoria para organizar seus fluxos","crm.createFirstCategory":"Criar primeira categoria","crm.tourViewToggleTitle":"Alternar visualização","crm.tourViewToggleContent":"Alterne entre a visualização de Todos os Fluxos e por Categoria para organizar seus chatbots.","crm.tourCategoryViewTitle":"Visualização por categoria","crm.tourCategoryViewContent":"Clique aqui para ver seus fluxos organizados por categorias.","crm.tourAddCategoryTitle":"Criar categorias","crm.tourAddCategoryContent":"Clique aqui para criar uma nova categoria com nome, ícone e cor personalizados.","crm.tourDragDropTitle":"Arrastar e soltar","crm.tourDragDropContent":"Arraste qualquer cartão de fluxo e solte-o em uma categoria para organizar seus fluxos.","crm.tourCategorySectionTitle":"Seções de categoria","crm.tourCategorySectionContent":"Clique para expandir ou recolher categorias. Edite ou exclua categorias usando os botões.","crm.skipTour":"Pular","crm.finishTour":"Entendi!","crm.next":"Próximo","crm.previous":"Anterior","crm.allFollowUps":"Todos os Follow-Ups","crm.addFollowUpCategory":"Adicionar categoria","crm.editFollowUpCategory":"Editar categoria","crm.createFollowUpCategory":"Criar categoria","crm.followUpCategoryName":"Nome","crm.enterFollowUpCategoryName":"Digite o nome da categoria","crm.followUpCategoryNameRequired":"Nome da categoria é obrigatório","crm.followUpCategoryNameExists":"Uma categoria com este nome já existe","crm.confirmDeleteFollowUpCategory":"Excluir esta categoria? Os follow-ups serão movidos para Sem categoria.","crm.noFollowUpsInCategory":"Nenhum follow-up nesta categoria","crm.simulateFlow":"Simular fluxo","crm.start":"Iniciar","crm.actionBlocks":"Blocos de ação","crm.anyMessage":"Qualquer mensagem","crm.keywords":"Palavras-chave","crm.addKeyword":"Adicionar palavra-chave","crm.firstMessageOfDay":"Primeira mensagem do dia","crm.firstMessageEver":"Primeira mensagem de sempre","crm.sendText":"Enviar Texto","crm.sendTextDesc":"Enviar uma mensagem de texto.","crm.sendImage":"Enviar Imagem","crm.sendImageDesc":"Enviar uma imagem com legenda.","crm.sendVideo":"Enviar Vídeo","crm.sendVideoDesc":"Enviar um vídeo com legenda.","crm.sendAudio":"Enviar Áudio","crm.sendAudioDesc":"Enviar um arquivo de áudio.","crm.sendDocument":"Enviar Documento","crm.sendDocumentDesc":"Enviar um arquivo de documento.","crm.responses":"Respostas","crm.responsesDesc":"Aguardar resposta do usuário e ramificar o fluxo.","crm.sendList":"Enviar Lista","crm.sendListDesc":"Enviar uma mensagem de lista interativa.","fluxo.waitInput":"Aguardar Entrada","fluxo.waitInputDesc":"Aguardar resposta validada do usuário","fluxo.promptMessage":"Mensagem de Solicitação","fluxo.enterPromptMessage":"Digite a solicitação para pedir entrada do usuário...","fluxo.inputType":"Tipo de Entrada (Validação)","fluxo.inputTypeString":"Texto (Qualquer)","fluxo.inputTypePhone":"Número de Telefone","fluxo.inputTypeNumber":"Número","fluxo.inputTypeEmail":"E-mail","fluxo.inputTypeUrl":"URL","fluxo.inputTypeDatetime":"Data/Hora","fluxo.phoneHint":"Formato: +5511987654321 (com código do país)","fluxo.emailHint":"Formato: user@example.com","fluxo.numberHint":"Aceita inteiros e decimais","fluxo.urlHint":"Formato: https://example.com","fluxo.datetimeHint":"Formato: AAAA-MM-DD ou AAAA-MM-DDTHH:MM","fluxo.stringHint":"Aceita qualquer entrada de texto","fluxo.saveResponseAs":"Salvar Resposta como Variável","fluxo.variableName":"userInput","fluxo.useVariableHint":"Use {variableName} em mensagens posteriores","fluxo.errorMessage":"Mensagem de Erro (em entrada inválida)","fluxo.invalidInputDefault":"Entrada inválida. Por favor, tente novamente.","fluxo.timeout":"Tempo Limite","fluxo.seconds":"Segundos","fluxo.minutes":"Minutos","fluxo.hours":"Horas","fluxo.timeoutHint":"Se nenhuma resposta válida neste tempo, o ramo de timeout será executado.","fluxo.customRegex":"Regex Personalizado (Opcional)","fluxo.regexPlaceholder":"^[A-Z]{2}[0-9]{4}$","fluxo.customRegexHint":"Substitui validação do tipo de entrada com padrão personalizado","fluxo.outputConnections":"Conexões de Saída","fluxo.response":"resposta","fluxo.validInputReceived":"Quando entrada válida é recebida","fluxo.noResponseTimeout":"Quando o timeout expira sem resposta válida","fluxo.validResponse":"Resposta Válida","fluxo.onInvalidInput":"Se inválido:","fluxo.promptMessageInfo":"A mensagem enviada ao usuário solicitando sua entrada. Será exibida antes de aguardar a resposta.","fluxo.inputTypeInfo":"Selecione o tipo de entrada esperado. O sistema validará a resposta do usuário conforme este formato.","fluxo.saveResponseAsInfo":"O nome da variável para armazenar a resposta válida do usuário. Use {nomeVariavel} em mensagens posteriores para exibir este valor.","fluxo.errorMessageInfo":"Mensagem enviada ao usuário quando sua entrada não corresponde ao formato esperado. Será solicitado que tente novamente.","fluxo.timeoutInfo":"Tempo máximo de espera por uma resposta válida. Se excedido, o ramo de timeout é executado em vez do ramo de resposta.","fluxo.customRegexInfo":"Avançado: Forneça um padrão regex personalizado para validar a entrada. Isto substitui a validação do tipo de entrada selecionado.","fluxo.delayInfo":"Tempo de espera em segundos antes de enviar a mensagem de solicitação. Útil para um fluxo de conversa natural.","crm.groupAction":"Ação de Grupo","crm.tabAction":"Ação de Aba","crm.labelAction":"Ação de Rótulo","crm.crmAction":"Ação CRM","crm.smartWait":"Espera Inteligente","crm.smartWaitDesc":"Aguardar um tempo aleatório entre mensagens","crm.typingIndicator":"Indicador de Digitação","crm.typingIndicatorDesc":"Mostrar bolha de digitação antes de enviar","crm.waitDuration":"Duração da Espera:","crm.typingDuration":"Duração da Digitação:","crm.randomDelay":"Atraso Aleatório:","crm.randomDelayBetween":"Atraso aleatório entre","crm.randomBetween":"Atraso aleatório entre","crm.showsTypingFor":"Mostra indicador de digitação por","crm.showsTyping":"Mostra digitação por","crm.typingPreview":"É assim que o indicador de digitação aparece para o contato","crm.addFluxo":"Adicionar Fluxo","crm.addFluxoDesc":"Executar outro fluxo","crm.selectFlowToCall":"Selecionar fluxo para executar:","crm.noFlowSelected":"Nenhum fluxo selecionado","crm.passVariables":"Passar variáveis para o fluxo chamado","crm.passVariablesHint":"Variáveis do fluxo atual estarão disponíveis no fluxo chamado","crm.passVariablesUseCase":'💡 Exemplo: Fluxo principal tem {name}="João" → Mensagem do sub-fluxo "Olá {name}!" → Mostra "Olá João!". Desativar para sub-fluxo iniciar sem variáveis.',"crm.passVariablesShort":"Passar vars","crm.continueAfterFlow":"Continuar após o término do fluxo chamado","crm.continueAfterFlowHint":"Desmarque para encerrar a conversa quando o fluxo chamado terminar","crm.continueAfterFlowUseCase":"💡 Exemplo: ON = Sub-fluxo de boas-vindas termina → retorna ao fluxo principal. OFF = Sub-fluxo termina = conversa termina (como fluxo Pedido Completo).","crm.continueAfterShort":"Continuar depois","crm.circularWarning":"Aviso: Referência circular detectada!","crm.circularWarningHint":"O fluxo selecionado contém um nó 'Adicionar Fluxo' apontando para este fluxo. Isso pode causar loops infinitos.","crm.selectFlowPlaceholder":"Selecionar um fluxo...","crm.noOtherFlows":"Nenhum outro fluxo disponível. Crie outro fluxo primeiro.","crm.delayBeforeCalling":"Atraso antes de chamar (segundos):","crm.executionSummary":"Resumo da Execução:","crm.variablesWillBe":"As variáveis serão","crm.passed":"passadas","crm.notPassed":"não passadas","crm.executeFlow":"Executar","crm.continueToNext":"Continuar para o próximo nó","crm.endConversation":"Encerrar conversa","crm.selectedFlow":"Fluxo Selecionado:","crm.addToGroups":"Adicionar a Grupos","crm.removeFromGroups":"Remover de Grupos","crm.addToTabs":"Adicionar a Abas","crm.removeFromTabs":"Remover de Abas","crm.addLabels":"Adicionar Rótulos","crm.removeLabels":"Remover Rótulos","crm.addToCrmStage":"Adicionar a Etapa CRM","crm.removeFromCrm":"Remover do CRM","crm.actionType":"Tipo de Ação:","crm.selectGroups":"Selecionar Grupos:","crm.loadGroups":"Carregar Grupos","crm.loadGroupsFromWhatsApp":"Carregar grupos do WhatsApp Web","crm.selectTabs":"Selecionar Abas:","crm.selectLabels":"Selecionar Rótulos:","crm.syncLabels":"Sincronizar Rótulos","crm.searchLabels":"Pesquisar rótulos...","crm.searchTabs":"Pesquisar abas...","crm.searchGroups":"Pesquisar grupos...","crm.selectCrm":"Selecionar CRM:","crm.selectStage":"Selecionar Etapa:","crm.selectCrmPlaceholder":"Selecionar CRM...","crm.selectStagePlaceholder":"Selecionar etapa...","crm.noGroupsSelected":"Nenhum grupo selecionado","crm.noTabsSelected":"Nenhuma aba selecionada","crm.noLabelsSelected":"Nenhum rótulo selecionado","crm.noCrmSelected":"Nenhum CRM/etapa selecionado","crm.noGroupsAvailable":"Nenhum grupo disponível.","crm.noTabsAvailable":"Nenhuma aba personalizada disponível.","crm.noCrmsAvailable":"Nenhum CRM disponível.","crm.noStagesAvailable":"Nenhuma etapa neste CRM.","crm.delay":"Atraso (segundos):","crm.selectedGroups":"Grupos:","crm.selectedTabs":"Abas:","crm.selectedLabels":"Rótulos:","crm.targetCrmStage":"CRM alvo → Etapa:","crm.targetCrm":"CRM alvo:","crm.schedule":"Agenda","crm.enableSchedule":"Ativar agenda","crm.startTime":"Hora de início","crm.endTime":"Hora de término","crm.crmRules":"Regras CRM","crm.whenAnyMessage":"Quando qualquer mensagem é recebida.","crm.whenKeywordMatch":"Quando a mensagem contém palavras-chave.","crm.byKeywordInMessage":"Por palavra-chave na mensagem","crm.firstMessageDay":"Primeira mensagem do cliente do dia.","crm.reactivationInterval":"Intervalo de reativação:","crm.generalRules":"Regras gerais:","crm.allowGroups":"Permitir responder a grupos","crm.scheduleEnabled":"Permitir respostas apenas em dias e horários específicos","crm.dontRespondIfOpen":"Não responder se a conversa estiver aberta","crm.customSignature":"Personalizar ou desativar a assinatura","crm.simulateTyping":"Simular digitação ou gravação de áudio","crm.dontRespondIfInCRM":"Não responder se o contato estiver em um CRM","crm.dontRespondToCRMs":"Não responder a CRMs","crm.respondOnlyToCRMs":"Responder apenas a CRMs","crm.enableCrmRules":"Ativar regras de abas CRM","crm.selectCrmTabs":"Selecionar abas CRM","crm.tagRules":"Regras de Tags","crm.labelRules":"Regras de etiquetas:","crm.dontRespondIfLabeled":"Não responder se o contato tiver etiqueta","crm.dontRespondToLabels":"Não responder a estas etiquetas","crm.respondOnlyToLabels":"Responder apenas a estas etiquetas","crm.selectLabelsNotToReply":"Selecionar etiquetas para não responder:","crm.selectLabelsToReply":"Selecionar etiquetas para responder:","crm.clickToSelect":"Clique para selecionar","crm.labelsNotReplied":"Etiquetas que não serão respondidas:","crm.labelsToReply":"Etiquetas que serão respondidas:","crm.customTabRules":"Regras de abas personalizadas:","crm.dontRespondIfInCustomTab":"Não responder se o contato estiver em aba personalizada","crm.dontRespondToCustomTabs":"Não responder a estas abas personalizadas","crm.respondOnlyToCustomTabs":"Responder apenas a estas abas personalizadas","crm.selectCustomTabsNotToReply":"Selecionar abas personalizadas para não responder:","crm.selectCustomTabsToReply":"Selecionar abas personalizadas para responder:","crm.customTabsNotReplied":"Abas personalizadas que não serão respondidas:","crm.customTabsToReply":"Abas personalizadas que serão respondidas:","crm.noCustomTabsAvailable":"Nenhuma aba personalizada disponível. Crie uma primeiro.","crm.pauseRules":"Regras de pausa:","crm.enablePause":"Ativar pausa","crm.pauseClientKeywords":"Palavras-chave de pausa do cliente","crm.pauseClientPlaceholder":"Pausar o chatbot se o destinatário...","crm.pauseServerKeywords":"Palavras-chave de pausa do servidor","crm.pauseServerPlaceholder":"Pausar quando o bot enviar...","crm.pauseDuration":"Tempo de Intervalo (HH:MM)","crm.tipPauseTitle":"Regras de Pausa","crm.tipPauseDesc":"Pausar o chatbot quando palavras-chave específicas forem detectadas. Use palavras-chave do cliente para permitir que os clientes pausem o bot, ou palavras-chave do servidor para pausar automaticamente após enviar certas mensagens.","crm.tipPauseEx1":"Cliente diz 'parar' → Bot pausa","crm.tipPauseEx2":"Cliente diz 'humano' → Transferir para atendente","crm.tipPauseEx3":"Bot envia 'conectando...' → Pausa automática","crm.tipPauseClientTitle":"Palavras-chave de Pausa do Cliente","crm.tipPauseClientDesc":"Palavras-chave que quando enviadas pelo cliente pausarão o chatbot para este chat. Útil para cenários de transferência para humanos.","crm.tipPauseClientEx1":"Cliente digita 'parar' ou 'stop'","crm.tipPauseClientEx2":"Cliente digita 'humano' ou 'atendente'","crm.tipPauseClientEx3":"Bot para de responder pelo tempo definido","crm.tipPauseServerTitle":"Palavras-chave de Pausa do Servidor","crm.tipPauseServerDesc":"Palavras-chave que quando enviadas pelo bot pausarão automaticamente o chatbot. Útil ao transferir para atendentes humanos.","crm.tipPauseServerEx1":"Bot envia 'Conectando você a um atendente...'","crm.tipPauseServerEx2":"Bot envia 'Por favor aguarde, transferindo...'","crm.tipPauseServerEx3":"Fluxo pausa automaticamente após esta mensagem","crm.tipPauseDurationTitle":"Tempo de Intervalo","crm.tipPauseDurationDesc":"Define quanto tempo o chatbot permanecerá pausado após detectar uma palavra-chave de pausa. Formato: Horas:Minutos (ex., 00:30 = 30 minutos).","crm.tipPauseDurationEx1":"00:30 = 30 minutos de pausa","crm.tipPauseDurationEx2":"01:00 = 1 hora de pausa","crm.tipPauseDurationEx3":"Após a duração, permanece pausado até novo gatilho","crm.enableTagRules":"Ativar regras de etiquetas do WhatsApp","crm.editBlock":"Editar bloco:","crm.close":"Fechar","crm.startNode":"Início","crm.startNodeInfo":"Este é o ponto de partida do seu fluxo. Conecte-o a outros blocos para construir seu chatbot.","crm.editTextMessage":"Editar mensagem de texto:","crm.typeTheText":"Digite o Texto","crm.saveResponseInVariable":"Salvar resposta na variável:","crm.typeVariableName":"Digite o nome da variável","crm.variableHint":"A variável armazenará a resposta do cliente do bloco atual e poderá ser usada nos blocos seguintes","crm.insertImage":"Inserir uma imagem:","crm.clickToUpload":"Clique para enviar ou arraste os arquivos aqui","crm.imageFormats":"Imagem: PNG, JPG, JPEG, GIF (máx 16MB - limite do WhatsApp)","crm.imageCaption":"Legenda da imagem (opcional)","crm.insertVideo":"Inserir um vídeo:","crm.insertAudio":"Inserir um áudio:","crm.insertDocument":"Inserir um documento:","crm.caption":"Legenda:","crm.captionOptional":"Legenda (opcional)","crm.questionMessage":"Mensagem de pergunta:","crm.typeQuestion":"Digite sua pergunta...","crm.responseOptions":"Opções de resposta:","crm.addOption":"Adicionar opção","crm.buttonText":"Texto do botão:","crm.title":"Título:","crm.listTitleOptional":"Título da lista (opcional)","crm.listDescOptional":"Descrição (opcional)","crm.listSectionsHint":"Configure seções e itens da lista nas configurações avançadas.","crm.globalSettings":"Configurações globais:","crm.editAwayMessage":"Editar mensagem de ausência:","crm.awayMessagePlaceholder":"Digite a mensagem que será enviada quando o usuário não responder...","crm.waitingTime":"Tempo de espera:","crm.waitingTimeWarning":"Quando a página do WhatsApp for recarregada, esta configuração será perdida para conversas aguardando resposta","crm.minutes":"Minutos","crm.hours":"Horas","crm.seconds":"Segundos","crm.awayMessageInfo":"Esta mensagem será enviada automaticamente quando o usuário não responder dentro do tempo especificado.","crm.blockInterval":"Intervalo de bloco:","crm.blockIntervalInfo":"Defina o intervalo padrão entre o envio de blocos do fluxo.","crm.chatSimulator":"Simulador de chat","crm.startConversation":"Inicie uma conversa enviando uma mensagem","crm.typeMessageHere":"Digite sua mensagem aqui...","crm.callNextBlock":"Chamar próximo bloco","crm.whenItemSelected":"Quando item selecionado","crm.whenResponding":"Ao responder","crm.defaultNext":"Padrão (sem correspondência)","crm.message":"Mensagem:","crm.listButton":"Texto do botão:","crm.items":"itens","crm.listItems":"Itens da lista:","crm.addItem":"Adicionar item","crm.insertVariable":"Inserir Variável","crm.contactName":"Nome do Contato","crm.currentDate":"Data Atual","crm.currentTime":"Hora Atual","crm.defaultOption1":"Opção 1","crm.defaultOption2":"Opção 2","crm.noListItems":"Sem itens. Clique em editar para adicionar.","crm.send_text":"Enviar Texto","crm.send_image":"Enviar Imagem","crm.send_video":"Enviar Vídeo","crm.send_audio":"Enviar Áudio","crm.send_document":"Enviar Documento","crm.send_list":"Enviar Lista","crm.group_action":"Ação de Grupo","crm.tab_action":"Ação de Aba","crm.label_action":"Ação de Etiqueta","crm.crm_action":"Ação CRM","crm.wait_input":"Aguardar Entrada","crm.smart_wait":"Espera Inteligente","crm.typing_indicator":"Indicador de Digitação","crm.add_fluxo":"Adicionar Fluxo","crm.timezone":"Fuso horário:","crm.day":"Dia","crm.sunday":"Domingo","crm.monday":"Segunda-feira","crm.tuesday":"Terça-feira","crm.wednesday":"Quarta-feira","crm.thursday":"Quinta-feira","crm.friday":"Sexta-feira","crm.saturday":"Sábado","crm.disableSignature":"Desativar assinatura","crm.customizeSignatureName":"Personalizar o nome da assinatura","crm.enterCustomSignature":"Digite o nome da assinatura personalizada","crm.tipAnyMsgTitle":"Gatilho de Qualquer Mensagem","crm.tipAnyMsgDesc":"O fluxo será iniciado sempre que QUALQUER mensagem for recebida de um cliente, independentemente do conteúdo.","crm.tipAnyMsgEx1":"Resposta automática geral para todas as mensagens","crm.tipAnyMsgEx2":"Mensagem de ausência quando não disponível","crm.tipAnyMsgEx3":"Pode disparar com muita frequência - use com intervalo de reativação","crm.tipKeywordTitle":"Gatilho por Palavra-chave","crm.tipKeywordDesc":"O fluxo inicia APENAS quando a mensagem contém uma das palavras-chave especificadas.","crm.tipKeywordEx1":"'olá' dispara fluxo de boas-vindas","crm.tipKeywordEx2":"'preço' dispara informações do produto","crm.tipKeywordEx3":"'ajuda' dispara menu de suporte","crm.tipFirstDayTitle":"Primeira Mensagem do Dia","crm.tipFirstDayDesc":"O fluxo é disparado APENAS na primeira mensagem recebida a cada dia de cada contato.","crm.tipFirstDayEx1":"Saudação 'Bom dia' apenas uma vez por dia","crm.tipFirstDayEx2":"Promoção especial diária para cada contato","crm.tipFirstDayEx3":"Reinicia à meia-noite com base no fuso horário","crm.tipFirstEverTitle":"Primeira Mensagem de Sempre","crm.tipFirstEverDesc":"O fluxo é disparado APENAS na primeira vez que um contato envia uma mensagem.","crm.tipFirstEverEx1":"Mensagem de boas-vindas para novos contatos","crm.tipFirstEverEx2":"Sequência de integração para novos clientes","crm.tipFirstEverEx3":"Atribuição inicial de CRM para novos leads","crm.tipReactivationTitle":"Intervalo de Reativação","crm.tipReactivationDesc":"Tempo mínimo antes que o mesmo fluxo possa disparar novamente para o mesmo contato.","crm.tipReactivationEx1":"3600s = Aguardar 1 hora antes de re-disparar","crm.tipReactivationEx2":"Previne spam de respostas automáticas","crm.tipReactivationEx3":"Use 0 para permitir disparos ilimitados","crm.tipSendTextTitle":"Enviar Mensagem de Texto","crm.tipSendTextDesc":"Envia uma mensagem de texto simples ao contato. Suporta variáveis como {name}, {phone}.","crm.tipSendTextEx1":"Mensagens de boas-vindas personalizadas","crm.tipSendTextEx2":"Confirmações de pedido","crm.tipSendImageTitle":"Enviar Imagem","crm.tipSendImageDesc":"Envia um arquivo de imagem com legenda opcional. Suporta PNG, JPG, GIF.","crm.tipSendImageEx1":"Imagens de produtos","crm.tipSendImageEx2":"Materiais promocionais","crm.tipSendVideoTitle":"Enviar Vídeo","crm.tipSendVideoDesc":"Envia um arquivo de vídeo com legenda opcional. Suporta MP4, MOV.","crm.tipSendVideoEx1":"Demonstrações de produtos","crm.tipSendVideoEx2":"Vídeos tutoriais","crm.tipSendAudioTitle":"Enviar Áudio","crm.tipSendAudioDesc":"Envia um arquivo de áudio ou nota de voz. Suporta MP3, OGG, WAV.","crm.tipSendAudioEx1":"Mensagens de voz pré-gravadas","crm.tipSendAudioEx2":"Anúncios de áudio","crm.tipSendDocTitle":"Enviar Documento","crm.tipSendDocDesc":"Envia qualquer tipo de arquivo como documento. Suporta PDF, DOC, XLS, etc.","crm.tipSendDocEx1":"Catálogos de preços","crm.tipSendDocEx2":"Contratos e acordos","crm.tipSendListTitle":"Enviar Mensagem de Lista","crm.tipSendListDesc":"Envia uma lista interativa com seções e itens selecionáveis.","crm.tipSendListEx1":"Menus de produtos por categoria","crm.tipSendListEx2":"Opções de serviços","crm.tipGroupActionTitle":"Ação de Grupo WhatsApp","crm.tipGroupActionDesc":"Adiciona ou remove o contato atual de grupos do WhatsApp.","crm.tipGroupActionEx1":"Adicionar clientes VIP ao grupo exclusivo","crm.tipGroupActionEx2":"Remover do grupo de suporte após resolução","crm.tipTabActionTitle":"Ação de Aba Personalizada","crm.tipTabActionDesc":"Adiciona ou remove o contato atual das abas personalizadas do CRM.","crm.tipTabActionEx1":"Mover lead para aba 'Qualificado'","crm.tipTabActionEx2":"Remover da aba 'Nova Consulta'","crm.tipLabelActionTitle":"Ação de Etiqueta WhatsApp","crm.tipLabelActionDesc":"Adiciona ou remove etiquetas do WhatsApp do contato atual.","crm.tipLabelActionEx1":"Adicionar etiqueta 'Respondido'","crm.tipLabelActionEx2":"Remover etiqueta 'Pendente'","crm.tipCrmActionTitle":"Ação de Etapa CRM","crm.tipCrmActionDesc":"Move o contato atual para uma etapa específica no Kanban CRM.","crm.tipCrmActionEx1":"Mover para etapa 'Negociação'","crm.tipCrmActionEx2":"Mover para etapa 'Fechado Ganho'","crm.tipSmartWaitTitle":"Espera Inteligente","crm.tipSmartWaitDesc":"Adiciona um atraso aleatório entre ações para parecer mais humano.","crm.tipSmartWaitEx1":"Esperar 2-5 segundos entre mensagens","crm.tipSmartWaitEx2":"Simular tempo natural de leitura","crm.tipTypingTitle":"Indicador de Digitação","crm.tipTypingDesc":"Mostra a bolha 'digitando...' antes de enviar a mensagem para parecer mais humano.","crm.tipTypingEx1":"Mostrar digitando por 3 segundos antes da mensagem","crm.tipTypingEx2":"Faz as respostas parecerem mais naturais","crm.tipAllowGroupsTitle":"Permitir Grupos","crm.tipAllowGroupsDesc":"Quando ativado, o chatbot também responderá em chats de grupo. Desativado, apenas chats privados acionam o fluxo.","crm.tipAllowGroupsEx1":"ON: Responder em grupos e privado","crm.tipAllowGroupsEx2":"OFF: Responder apenas em privado","crm.tipScheduleTitle":"Agendar Respostas","crm.tipScheduleDesc":"Restringir o chatbot a horários/dias específicos. Configure o agendamento abaixo.","crm.tipScheduleEx1":"Apenas horário comercial (9h - 18h)","crm.tipScheduleEx2":"Apenas dias úteis (Seg-Sex)","crm.tipScheduleEx3":"Resposta auto fora do horário","crm.tipDontRespondOpenTitle":"Não Responder se Aberto","crm.tipDontRespondOpenDesc":"Impede o chatbot de enviar mensagens se você já tem essa conversa aberta no WhatsApp Web.","crm.tipDontRespondOpenEx1":"Útil quando você está conversando ativamente","crm.tipDontRespondOpenEx2":"Impede o bot de interromper sua conversa","crm.tipSimulateTypingTitle":"Simular Digitação","crm.tipSimulateTypingDesc":"Mostra o indicador 'digitando...' antes de enviar, fazendo as respostas parecerem mais humanas.","crm.tipSimulateTypingEx1":'Mostra "digitando..." para mensagens de texto',"crm.tipSimulateTypingEx2":'Mostra "gravando..." para áudio',"crm.tipSimulateTypingEx3":"Faz o bot parecer mais natural","crm.tipSkipCRMTitle":"Pular Contatos do CRM","crm.tipSkipCRMDesc":"O chatbot não responderá a contatos já adicionados ao seu CRM. Útil para clientes existentes.","crm.tipSkipCRMEx1":"Resposta auto apenas para novos contatos","crm.tipSkipCRMEx2":"Pular contatos CRM existentes","crm.tipExcludeCRMTitle":"Excluir Etapas CRM Específicas","crm.tipExcludeCRMDesc":"Selecione etapas Kanban CRM específicas para excluir. Contatos nessas etapas não receberão mensagens do chatbot.","crm.tipExcludeCRMEx1":'Excluir etapa "Clientes VIP"',"crm.tipExcludeCRMEx2":'Excluir etapa "Não Perturbar"',"crm.tipIncludeCRMTitle":"Incluir Apenas Etapas CRM Específicas","crm.tipIncludeCRMDesc":"O chatbot responderá APENAS a contatos nas etapas Kanban CRM selecionadas. Todos os outros são ignorados.","crm.tipIncludeCRMEx1":'Responder apenas à etapa "Leads"',"crm.tipIncludeCRMEx2":'Responder apenas à etapa "Negócios Ativos"',"crm.tipSkipLabeledTitle":"Pular Contatos Etiquetados","crm.tipSkipLabeledDesc":"O chatbot não responderá a nenhum contato que tenha uma etiqueta do WhatsApp atribuída.","crm.tipSkipLabeledEx1":"Qualquer contato etiquetado é pulado","crm.tipSkipLabeledEx2":"Apenas contatos sem etiqueta recebem respostas","crm.tipExcludeLabelTitle":"Excluir Etiquetas Específicas","crm.tipExcludeLabelDesc":"Selecione etiquetas WhatsApp específicas para excluir. Contatos com essas etiquetas não receberão mensagens do chatbot.","crm.tipExcludeLabelEx1":'Excluir contatos etiquetados como "Spam"',"crm.tipExcludeLabelEx2":'Excluir contatos etiquetados como "Bloqueado"',"crm.tipIncludeLabelTitle":"Incluir Apenas Etiquetas Específicas","crm.tipIncludeLabelDesc":"O chatbot responderá APENAS a contatos com as etiquetas WhatsApp selecionadas. Todos os outros são ignorados.","crm.tipIncludeLabelEx1":'Responder apenas a etiquetados "VIP"',"crm.tipIncludeLabelEx2":'Responder apenas a etiquetados "Prioridade"',"crm.tipSkipCustomTabTitle":"Pular Contatos de Abas Personalizadas","crm.tipSkipCustomTabDesc":"O chatbot não responderá a nenhum contato atribuído a uma aba personalizada.","crm.tipSkipCustomTabEx1":'Contato na aba "Clientes VIP" → Sem resposta',"crm.tipSkipCustomTabEx2":"Contato não em nenhuma aba → Bot responde","crm.tipExcludeCustomTabTitle":"Excluir Abas Personalizadas Específicas","crm.tipExcludeCustomTabDesc":"Selecione abas personalizadas específicas para excluir. Contatos nessas abas não receberão mensagens do chatbot.","crm.tipExcludeCustomTabEx1":'Excluir contatos da aba "Bloqueados"',"crm.tipExcludeCustomTabEx2":'Excluir contatos da aba "Tratados"',"crm.tipIncludeCustomTabTitle":"Incluir Apenas Abas Personalizadas Específicas","crm.tipIncludeCustomTabDesc":"O chatbot responderá APENAS a contatos nas abas personalizadas selecionadas. Todos os outros são ignorados.","crm.tipIncludeCustomTabEx1":'Responder apenas à aba "Leads Ativos"',"crm.tipIncludeCustomTabEx2":'Responder apenas à aba "VIP"',"templates.addCategory":"Adicionar Categoria","templates.editCategory":"Editar Categoria","templates.deleteCategory":"Excluir Categoria","templates.manageCategories":"Gerenciar","templates.categoryName":"Nome da Categoria","templates.categoryIcon":"Ícone","templates.categoryColor":"Cor","templates.update":"Atualizar","templates.form.category":"Categoria","templates.form.categoryHint":"Organize modelos em categorias para acesso mais fácil","templates.allTemplates":"Todos os Modelos","templates.quickReplyCategory":"Resposta Rápida","templates.uncategorized":"Sem Categoria","templates.sortNewest":"Mais Recentes","templates.sortOldest":"Mais Antigos","templates.sortNameAZ":"Nome A-Z","templates.sortNameZA":"Nome Z-A","templates.confirmDeleteCategory":"Tem certeza de que deseja excluir esta categoria? Os modelos serão movidos para Sem Categoria.","templates.confirmDeleteTemplate":"Tem certeza de que deseja excluir este modelo?","templates.noCategoriesYet":"Nenhuma categoria ainda","templates.createCategoryDescription":"Crie categorias para organizar seus modelos","templates.done":"Concluído","templates.deleteCategoryWarning":"Os modelos desta categoria ficarão sem categoria.","templates.delete":"Excluir","templates.noTemplatesInCategory":"Não há modelos nesta categoria","templates.createFirstDescription":"Crie seu primeiro modelo para começar","followUp.title":"Acompanhamento","followUp.newFollowUp":"Novo Acompanhamento","followUp.confirmDelete":"Tem certeza de que deseja excluir este acompanhamento?","followUp.emptyTitle":"Nenhum Acompanhamento Selecionado","followUp.emptyText":"Selecione um acompanhamento da lista ou crie um novo para começar com sequências de mensagens automatizadas.","followUp.createNew":"Criar Novo","followUp.loading":"Carregando...","followUp.noFollowUps":"Nenhum acompanhamento ainda","followUp.createFirst":"Crie sua primeira sequência de acompanhamento","followUp.active":"Ativo","followUp.paused":"Pausado","followUp.labels":"Etiquetas","followUp.customTabs":"Abas Personalizadas","followUp.groups":"Grupos","followUp.kanban":"Kanban","followUp.onEnter":"Ao Entrar","followUp.onLeave":"Ao Sair","followUp.afterTime":"Após Tempo","followUp.steps":"passos","followUp.pause":"Pausar","followUp.activate":"Ativar","followUp.duplicate":"Duplicar","followUp.delete":"Excluir","followUp.name":"Nome do Acompanhamento","followUp.namePlaceholder":"Digite o nome do acompanhamento...","followUp.nameRequired":"Por favor, insira um nome para o acompanhamento","followUp.funnelRequired":"Por favor, selecione pelo menos um item do funil","followUp.stepsRequired":"Por favor, adicione pelo menos um passo","followUp.funnelSettings":"Configurações do Funil","followUp.selectFunnelItems":"Selecione itens para acionar este acompanhamento","followUp.comingSoon":"Seletor em breve","followUp.triggerSettings":"Gatilho de Acompanhamento","followUp.onEnterDesc":"Acionar quando o contato entrar no funil","followUp.onLeaveDesc":"Acionar quando o contato sair do funil","followUp.afterTimeDesc":"Acionar após um período específico","followUp.days":"Dias","followUp.day":"Dia","followUp.hours":"Horas","followUp.minutes":"Minutos","followUp.value":"Valor","followUp.unit":"Unidade","followUp.time":"Hora","followUp.stepsTitle":"Passos de Acompanhamento","followUp.step":"Passo","followUp.actions":"ações","followUp.addStep":"Adicionar Passo","followUp.rulesTitle":"Regras de Ativação","followUp.cancelOnReply":"Cancelar se o cliente responder","followUp.allowGroups":"Permitir responder em grupos","followUp.customSignature":"Personalizar assinatura","followUp.signatureText":"Texto da Assinatura","followUp.signaturePlaceholder":"Digite sua assinatura...","followUp.maxExecutions":"Máximo de vezes por contato","followUp.cooldownDays":"Período de espera (dias)","followUp.cancel":"Cancelar","followUp.create":"Criar Acompanhamento","followUp.save":"Salvar Alterações","followUp.saving":"Salvando...","followUp.saved":"Salvo!","followUp.back":"← Voltar","followUp.next":"Próximo →","followUp.backToList":"← Voltar à Lista","followUp.wizardStep1":"Configuração","followUp.wizardStep2":"Mensagens","followUp.wizardStep3":"Agendamento","followUp.wizardStep4":"Ações","followUp.wizardStep5":"Regras","followUp.followUps":"Acompanhamentos","followUp.stepName":"Nome do Passo (Opcional)","followUp.stepNamePlaceholder":"ex., Contato Inicial, Acompanhamento 1...","followUp.timing":"Tempo","followUp.mode":"Modo","followUp.relative":"Relativo","followUp.specific":"Específico","followUp.type":"Tipo","followUp.daily":"Diário","followUp.weekly":"Semanal","followUp.monthly":"Mensal","followUp.condition":"Condição","followUp.conditionAlways":"Sempre","followUp.conditionIfReplied":"Se Respondeu","followUp.conditionIfNotReplied":"Se Não Respondeu","followUp.conditionIfKeyword":"Se Palavra-chave","followUp.conditionIfNotKeyword":"Se Não Palavra-chave","followUp.conditionIfInFunnel":"Se No Funil","followUp.conditionIfNotInFunnel":"Se Saiu do Funil","followUp.keywords":"Palavras-chave (separadas por vírgula)","followUp.keywordsPlaceholder":"sim, ok, interessado...","followUp.actionsTitle":"Ações","followUp.actionsRequired":"Por favor adicione pelo menos uma ação","followUp.addAction":"+ Adicionar Ação","followUp.postActionsTitle":"Ações Posteriores","followUp.groupActions":"Ações de Grupo","followUp.addToGroups":"Adicionar aos Grupos","followUp.removeFromGroups":"Remover dos Grupos","followUp.customTabActions":"Ações de Aba Personalizada","followUp.addToTabs":"Adicionar às Abas","followUp.removeFromTabs":"Remover das Abas","followUp.labelsActions":"Ações de Etiquetas","followUp.addLabels":"Adicionar Etiquetas","followUp.removeLabels":"Remover Etiquetas","followUp.kanbanBoardActions":"Ações do Quadro Kanban","followUp.addToKanban":"Adicionar ao Estágio","followUp.removeFromKanban":"Remover do Estágio","followUp.selectStage":"Selecionar Estágio...","followUp.noGroupsAvailable":"Nenhum grupo disponível","followUp.noTabsAvailable":"Nenhuma aba disponível","followUp.noLabelsAvailable":"Nenhuma etiqueta disponível","followUp.noKanbanAvailable":"Nenhum quadro Kanban disponível","followUp.moveUp":"Mover Acima","followUp.moveDown":"Mover Abaixo","followUp.removeStep":"Remover Passo","followUp.message":"Mensagem","followUp.messagePlaceholder":"Digite sua mensagem aqui...","followUp.messageText":"Mensagem","followUp.templatesType":"Tipo de Modelo","followUp.clickToInsert":"Clique para inserir:","followUp.variables":"Variáveis","followUp.minDelay":"Atraso Mín (seg)","followUp.maxDelay":"Atraso Máx (seg)","followUp.addMessage":"Adicionar Mensagem","followUp.selectLabels":"Selecionar etiquetas...","followUp.selectTabs":"Selecionar abas...","followUp.selectKanbanStage":"Selecionar CRM Kanban e estágio...","followUp.selectGroups":"Selecionar grupos do WhatsApp...","followUp.selectorComingSoon":"Seletor em breve","followUp.webhookUrl":"URL do Webhook","followUp.includeContactData":"Incluir dados do contato no payload","followUp.search":"Buscar...","followUp.noLabels":"Nenhuma etiqueta encontrada. Crie etiquetas no WhatsApp primeiro.","followUp.noTabs":"Nenhuma aba personalizada encontrada. Crie abas na barra de abas.","followUp.noGroups":"Nenhum grupo do WhatsApp encontrado.","followUp.noStages":"Nenhuma etapa Kanban encontrada. Crie um CRM e etapas primeiro.","followUp.fluxoCategory":"Categoria","followUp.allCategories":"Todas as Categorias","followUp.uncategorized":"Sem Categoria","followUp.selectFluxo":"Selecionar Fluxo","followUp.chooseFluxo":"-- Escolha um Fluxo --","followUp.fluxoInfo":"O fluxo de chatbot selecionado será acionado quando este follow-up for executado.","followUp.tooltip.nameTitle":"Nome do Acompanhamento","followUp.tooltip.nameContent":"Dê um nome descritivo para identificar esta sequência de acompanhamento. Use nomes claros que descrevam o propósito.","followUp.tooltip.nameExample":"Exemplo: 'Boas-vindas Novo Lead', 'Lembrete de Pagamento', 'Solicitação de Feedback'","followUp.tooltip.categoryTitle":"Categoria","followUp.tooltip.categoryContent":"Organize seus acompanhamentos em categorias para melhor gerenciamento. Selecione uma categoria ou deixe como Sem Categoria.","followUp.tooltip.funnelTitle":"Configurações do Funil - Onde acionar?","followUp.tooltip.funnelContent":"Selecione quais Etiquetas, Abas Personalizadas, Grupos ou estágios Kanban acionarão esta sequência de acompanhamento. Quando um contato entra no funil selecionado, o acompanhamento começará.","followUp.tooltip.funnelExample":"Exemplo: Selecione a etiqueta 'Novo Lead' → Quando qualquer contato receber esta etiqueta, o acompanhamento inicia automaticamente.","followUp.tooltip.triggerTitle":"Gatilho de Acompanhamento - Quando começar?","followUp.tooltip.triggerContent":"Decide QUANDO a sequência de acompanhamento COMEÇARÁ após o evento do funil. Ao Entrar: imediatamente quando o contato entra. Ao Sair: quando o contato sai. Após Tempo: esperar X tempo antes de começar.","followUp.tooltip.triggerExample":"Exemplo: 'Após Tempo' + 2 horas = O acompanhamento começa 2 horas após o contato entrar no funil.","followUp.tooltip.actionsTitle":"Ações - O que fazer?","followUp.tooltip.actionsContent":"Defina o que acontece quando o acompanhamento é acionado. Todas as ações são executadas no momento do disparo. Adicione mensagens, mude etiquetas, mova para estágios Kanban, ou acione webhooks.","followUp.tooltip.actionsExample":"Exemplo: Enviar mensagem de boas-vindas → Adicionar etiqueta 'Contatado' → Mover para estágio 'Em Andamento'.","followUp.tooltip.rulesTitle":"Regras de Acionamento - Controlar comportamento","followUp.tooltip.rulesContent":"Configure como o acompanhamento se comporta. Cancelar se responder para a sequência se o cliente responder. Permitir grupos habilita o envio em chats de grupo. Assinatura personalizada adiciona seu texto no final das mensagens.","followUp.tooltip.rulesExample":"Boa Prática: Habilite 'Cancelar se responder' para evitar spam aos clientes que já responderam.","followUp.tooltip.cancelOnReplyTitle":"Cancelar se o Cliente Responder","followUp.tooltip.cancelOnReplyContent":"Para automaticamente todas as mensagens de acompanhamento pendentes para um contato quando ele envia qualquer mensagem. Isso evita enviar acompanhamentos desnecessários para clientes que já responderam.","followUp.tooltip.cancelOnReplyExample":"• Habilitado: O acompanhamento para se o cliente responder antes do envio\n• Desabilitado: O acompanhamento é enviado independente das mensagens do cliente","followUp.tooltip.allowGroupsTitle":"Permitir Responder em Grupos","followUp.tooltip.allowGroupsContent":"Controla se este acompanhamento pode enviar mensagens para grupos do WhatsApp. Por padrão, acompanhamentos funcionam apenas para contatos individuais (chats 1-a-1).","followUp.tooltip.allowGroupsExample":"• Habilitado: O acompanhamento funciona para chats individuais E grupos\n• Desabilitado: O acompanhamento funciona apenas para contatos individuais","followUp.tooltip.signatureTitle":"Personalizar Assinatura","followUp.tooltip.signatureContent":"Adiciona uma assinatura personalizada no final de cada mensagem de acompanhamento. Útil para branding ou identificar mensagens automatizadas.","followUp.tooltip.signatureExample":"Exemplo: Sua mensagem 'Olá, só verificando!' vira 'Olá, só verificando!\\n\\n~ Equipe CRM'","followUp.tooltip.maxExecutionsTitle":"Execuções Máximas - Quantas vezes?","followUp.tooltip.maxExecutionsContent":"Controla quantas vezes este acompanhamento pode enviar mensagens para o MESMO contato. Uma vez que um contato atinge este limite, não receberá mais este acompanhamento.","followUp.tooltip.maxExecutionsExample":"• Definir 0 = Ilimitado (sem limite)\n• Definir 1 = Apenas uma vez por contato\n• Definir 3 = Contato recebe no máximo 3 vezes","followUp.tooltip.cooldownTitle":"Período de Espera - Esperar antes de reacionar","followUp.tooltip.cooldownContent":"Depois que um contato recebe este acompanhamento, quantos dias esperar antes que possa receber novamente. Isso evita spam repetido ao mesmo contato.","followUp.tooltip.cooldownExample":"• Definir 0 = Sem espera (pode acionar novamente imediatamente)\n• Definir 7 = Esperar 7 dias antes de reacionar","followUp.tooltip.exampleLabel":"Exemplo:","followUp.tooltip.howToUseLabel":"Como usar:","followUp.tooltip.bestPracticeLabel":"Boa Prática:","followUp.scheduleConfiguration":"Configuração de Agendamento","followUp.enableSchedule":"Habilitar Agendamento Avançado","followUp.enableScheduleDesc":"(Enviar apenas em dias/datas específicas)","followUp.scheduleDisabledInfo":"Habilite o Agendamento Avançado acima para configurar dias/datas específicas para envio de mensagens.","followUp.tooltip.scheduleTitle":"Configuração de Agendamento - Quando enviar?","followUp.tooltip.scheduleContent":"Configure dias/datas específicas quando o acompanhamento deve ser executado. Use diário para selecionar dias da semana, semanal para semanas específicas, ou mensal para datas do mês.","followUp.tooltip.scheduleExample":"Defina agendamento Semanal para Seg, Qua, Sex para enviar mensagens apenas nesses dias.","followUp.messagesConfiguredInSchedule":"Mensagens Configuradas no Agendamento","followUp.messagesConfiguredInScheduleDesc":'Você ativou "Mensagem Diferente por Dia" na seção de Configuração de Agendamento acima. As mensagens são configuradas lá para cada dia selecionado.',"schedule.title":"Mensagens Agendadas","schedule.addSchedule":"Adicionar Agendamento","schedule.editSchedule":"Editar Agendamento","schedule.schedulesCount":"Agendamentos","schedule.noSchedules":"Sem Mensagens Agendadas","schedule.noSchedulesDesc":"Crie sua primeira mensagem agendada para começar.","schedule.confirmDelete":"Tem certeza que deseja excluir este agendamento?","schedule.inactive":"Inativo","schedule.once":"Uma vez","schedule.repeated":"Repetido","schedule.scheduleFor":"Agendar Para","schedule.selectTarget":"Selecionar Contato ou Grupo","schedule.searchContacts":"Pesquisar contatos e grupos...","schedule.groups":"Grupos","schedule.contacts":"Contatos","schedule.templateType":"Tipo de Modelo","schedule.message":"Mensagem","schedule.enterMessage":"Digite sua mensagem...","schedule.scheduleDateTime":"Data e Hora do Agendamento","schedule.selectDateTime":"Por favor selecione data e hora","schedule.repeatedType":"Tipo de Repetição","schedule.repeatedType_minute":"Minuto","schedule.repeatedType_hour":"Hora","schedule.repeatedType_daily":"Diário","schedule.repeatedType_weekly":"Semanal","schedule.repeatedType_monthly":"Mensal","schedule.repeatedType_yearly":"Anual","schedule.everyMinutes":"A cada X Minutos","schedule.everyHours":"A cada X Horas","schedule.scheduleTime":"Horários Agendados","schedule.addTime":"Adicionar Hora","schedule.startAndEndTime":"Hora de início e fim","schedule.runAnytime":"Executar a qualquer momento","schedule.runBetween":"Executar entre período de tempo","schedule.endSchedule":"Terminar Repetição do Agendamento em","schedule.never":"Nunca","schedule.afterCount":"Número de vezes repetindo","schedule.completeOnDate":"Completar na Data","schedule.weekday_mon":"Segunda-feira","schedule.weekday_tue":"Terça-feira","schedule.weekday_wed":"Quarta-feira","schedule.weekday_thu":"Quinta-feira","schedule.weekday_fri":"Sexta-feira","schedule.weekday_sat":"Sábado","schedule.weekday_sun":"Domingo","schedule.month_jan":"Janeiro","schedule.month_feb":"Fevereiro","schedule.month_mar":"Março","schedule.month_apr":"Abril","schedule.month_may":"Maio","schedule.month_jun":"Junho","schedule.month_jul":"Julho","schedule.month_aug":"Agosto","schedule.month_sep":"Setembro","schedule.month_oct":"Outubro","schedule.month_nov":"Novembro","schedule.month_dec":"Dezembro","schedule.postActions":"Ações Posteriores","schedule.groupActions":"Ações de Grupo","schedule.customTabActions":"Ações de Aba Personalizada","schedule.labelsActions":"Ações de Etiquetas","schedule.kanbanActions":"Ações Kanban","schedule.members":"membros","schedule.noContactsFound":"Nenhum contato encontrado","schedule.noGroupsFound":"Nenhum grupo encontrado","schedule.loadingContacts":"Carregando contatos...","schedule.loadingGroups":"Carregando grupos...","schedule.selected":"Selecionado","schedule.tooltip.scheduleFor":"Selecione um contato ou grupo para enviar a mensagem agendada.","schedule.tooltip.templateType":"Escolha o tipo de mensagem: só texto, com mídia, enquete, lista, ou acionar um fluxo Fluxo.","schedule.tooltip.message":"Digite sua mensagem. Use variáveis como {{name}} ou {{phone}} para personalização.","schedule.tooltip.dateTime":"Defina quando a mensagem deve ser enviada. Para agendamentos repetidos, esta é a data/hora inicial.","schedule.tooltip.repeatedType":"Escolha a frequência de repetição: a cada X minutos/horas, diário, semanal, mensal ou anual.","schedule.tooltip.scheduleTimes":"Adicione múltiplos horários de envio. Clique em + para adicionar mais.","schedule.tooltip.runBetween":"Restrinja mensagens a horários específicos. ex., enviar apenas entre 9h - 18h.","schedule.tooltip.endSchedule":"Escolha quando parar de repetir: Nunca, após X vezes, ou em uma data específica.","schedule.tooltip.postActions":"Ações após o envio: adicionar/remover de grupos, abas, etiquetas ou estágios Kanban.","gmaps.featureTitle":"Extrator do G Maps","feature.gmapsExtractor":"Extrator do G Maps","gmaps.panelHeader":"Extrator do G Maps","gmaps.status.idle":"Inativo","gmaps.status.running":"Extraindo...","gmaps.status.stopped":"Parado","gmaps.status.complete":"Concluído","gmaps.status.error":"Parado","gmaps.statusLabel":"Status","gmaps.leadsFound":"Leads: {{count}}","gmaps.leadsShort":"leads","gmaps.settings":"Configurações","gmaps.exportGroup":"Exportar e Enviar","gmaps.noPhone":"sem telefone","gmaps.showPanel":"Mostrar painel","gmaps.hidePanel":"Ocultar painel","gmaps.maxResults":"Resultados máx.","gmaps.unlimited":"Ilimitado","gmaps.fetchEmails":"Buscar e-mails","gmaps.fetchEmailsTooltip":"Para cada lead com site, abre-o em segundo plano e extrai o primeiro endereço de e-mail encontrado. Adiciona cerca de 3 segundos por lead e usa mais largura de banda. Se o site não tiver e-mail visível ou falhar ao carregar, o campo de e-mail desse lead permanece vazio.","gmaps.startBtn":"Iniciar Extração","gmaps.stopBtn":"Parar","gmaps.clearBtn":"Limpar","gmaps.exportCsv":"Exportar CSV","gmaps.exportXlsx":"Exportar XLSX","gmaps.sendToBroadcast":"Enviar para Transmissão","gmaps.previewTitle":"Pré-visualização","gmaps.moreRows":"mais","gmaps.expand":"Expandir","gmaps.expandView":"Visualização completa","gmaps.clickExpand":"Clique em Expandir para ver os detalhes completos","gmaps.clickExpandToSee":"clique em Expandir para ver tudo","gmaps.col.name":"Nome","gmaps.col.phone":"Telefone","gmaps.col.website":"Site","gmaps.col.address":"Endereço","gmaps.col.category":"Categoria","gmaps.col.rating":"Avaliação","gmaps.noLeadsYet":"Nenhum lead ainda — pesquise no Google Maps e clique em Iniciar","gmaps.stopReason.userStop":"Parado pelo usuário","gmaps.stopReason.endOfResults":"Fim dos resultados do Google Maps alcançado","gmaps.stopReason.captcha":"Captcha do Google detectado — resolva e clique em Iniciar novamente","gmaps.stopReason.noFeed":"Nenhum resultado de pesquisa do Google Maps encontrado — execute uma pesquisa primeiro","gmaps.stopReason.noNewResults":"Nenhum novo resultado sendo carregado (o Google parou de retornar dados)","gmaps.stopReason.maxReached":"Limite máximo de resultados atingido","gmaps.stopReason.tabClosed":"A aba foi fechada","gmaps.stopReason.error":"Erro","gmaps.toast.searchFirst":"Por favor, faça uma pesquisa no Google Maps primeiro e depois clique em Iniciar.","gmaps.toast.csvReady":"CSV baixado","gmaps.toast.xlsxReady":"Arquivo Excel baixado","gmaps.toast.noPhones":"Nenhum número de telefone válido — nada foi enviado.","gmaps.toast.sentPartial":"{{sent}} contatos enviados para a Transmissão · {{dropped}} ignorados (sem telefone)","gmaps.toast.sentAll":"{{sent}} contatos enviados para a Transmissão","gmaps.toast.broadcastFail":"Falha ao enviar para a Transmissão. Veja o console.","gmaps.toast.draftRestored":"Sessão anterior restaurada","gmaps.toast.draftRestoredN":"{{n}} leads restaurados da sessão anterior"},ru:{"common.loading":"Загрузка...","common.close":"Закрыть","common.cancel":"Отмена","common.save":"Сохранить","common.copy":"Копировать","common.copied":"Скопировано!","common.choose":"Выбрать","common.add":"Добавить","common.edit":"Редактировать","common.delete":"Удалить","common.back":"Назад","quickReply.title":"Быстрый ответ","quickReply.addButton":"+ Добавить","quickReply.allCategories":"Все Категории","quickReply.postActions":"Действия после отправки","quickReply.groupActions":"Действия с группами","quickReply.customTabActions":"Действия с вкладками","quickReply.labelsActions":"Действия с метками","quickReply.kanbanBoardActions":"Действия Kanban","quickReply.addToGroups":"Добавить в группы","quickReply.removeFromGroups":"Удалить из групп","quickReply.addToTabs":"Добавить во вкладки","quickReply.removeFromTabs":"Удалить из вкладок","quickReply.addLabels":"Добавить метки","quickReply.removeLabels":"Удалить метки","quickReply.addToStage":"Добавить на этап","quickReply.removeFromStage":"Удалить с этапа","quickReply.selectGroups":"Выберите группы...","quickReply.selectTabs":"Выберите вкладки...","quickReply.selectLabels":"Выберите метки...","quickReply.selectCrmStage":"Выберите CRM и этап...","quickReply.noGroupsAvailable":"Нет доступных групп","quickReply.noTabsAvailable":"Нет доступных вкладок","quickReply.noLabelsAvailable":"Нет доступных меток","quickReply.noKanbanAvailable":"Нет доступных Kanban CRM","quickReply.editBeforeSending":"Редактировать перед отправкой","quickReply.editBeforeSendingDesc":"Позволяет редактировать сообщение перед отправкой","actionSidebar.title":"Быстрые действия","actionSidebar.quickReply":"Быстрый ответ","actionSidebar.flow":"Поток","actionSidebar.search":"Поиск...","actionSidebar.filter":"Фильтр","actionSidebar.all":"Все","actionSidebar.byType":"По типу","actionSidebar.noCategory":"Без категории","actionSidebar.byCategory":"По категории","actionSidebar.mostUsed":"Часто используемые","actionSidebar.send":"Отправить","actionSidebar.trigger":"Запустить","actionSidebar.noItemsFound":"Элементы не найдены","actionSidebar.selectChatFirst":"Сначала выберите чат","actionSidebar.uncategorized":"Без категории","actionSidebar.editAndSend":"Редактировать и отправить","actionSidebar.clickToCancel":"Нажмите для отмены","actionSidebar.cancel":"Отмена","actionSidebar.sending":"Отправка...","header.activateLicense":"Активировать лицензию",broadcastTitle:"Массовая рассылка",kanbanTitle:"Открыть Kanban CRM","profile.title":"Профиль","profile.deviceName":"Имя устройства","profile.expires":"Истекает","profile.manageLicenseKey":"Управление лицензионным ключом","profile.settings":"Настройки","profile.watchTutorial":"Смотреть руководство","profile.language":"Язык","profile.privacyPolicy":"Политика конфиденциальности","profile.contactUs":"Связаться с нами","profile.website":"Веб-сайт","profile.premium":"Премиум","profile.notActivated":"Не активирован","profile.activateToContinue":"Активировать лицензию","settings.menuFeatures":"Функции меню","settings.menuFeaturesDesc":"Включайте или отключайте функции по мере необходимости","settings.interfaceOptions":"Параметры интерфейса","settings.featureDockLabel":"Левая панель функций","settings.featureDockDesc":"Показывать панель быстрого доступа слева при открытии всплывающего окна","feature.tabs":"Управление вкладками","feature.templates":"Шаблоны","feature.quickReply":"Быстрый ответ","feature.kanban":"Kanban CRM","feature.chatbotFlow":"Поток чат-бота","feature.followUp":"Отслеживание","feature.broadcast":"Массовая рассылка","feature.calendar":"Центр планирования","feature.status":"Статус","feature.validator":"Валидатор","feature.webhook":"Webhook","feature.api":"API","feature.aiBot":"ИИ-бот","feature.open":"Открыть","license.activateTitle":"Активируйте вашу лицензию","license.licenseKey":"Лицензионный ключ","license.phoneNumber":"Номер телефона","license.phoneDetected":"Обнаружен номер телефона","license.planName":"Название плана","license.endDate":"Дата окончания","license.expiresIn":"Истекает через","license.days":"дней","license.daysLeft":"дней осталось","license.status":"Статус","license.deactivateLicense":"Деактивировать лицензию","license.deactivateConfirm":"Вы уверены, что хотите деактивировать свою лицензию?","license.activateLicenseBtn":"Активировать лицензию","license.validating":"Проверка...","license.pasteLicenseHere":"Вставьте ваш лицензионный ключ здесь...","license.completeLicenseKey":"Вставьте полный лицензионный ключ, полученный по электронной почте","trial.starting":"Запуск 7-дневной бесплатной пробной версии...","trial.activated":"7-дневная бесплатная пробная версия активирована!","trial.daysRemaining":"Осталось {0} дней пробного периода","trial.expired":"Пробный период истёк. Пожалуйста, приобретите лицензию.","trial.alreadyUsed":"Пробный период для этого номера уже использован. Введите лицензионный ключ для продолжения.","license.waitForWhatsApp":"Пожалуйста, подождите, пока WhatsApp полностью загрузится","license.securityFooter":"Защищено криптографической проверкой WebAssembly","planDetails.title":"Детали плана","planDetails.licenceKey":"Лицензионный ключ","planDetails.planName":"Название плана","planDetails.endDate":"Дата окончания","planDetails.removeKey":"Удалить ключ","planDetails.changeKey":"Изменить ключ","features.enabledFeatures":"Включенные функции","licenseInfo.title":"Информация о лицензии","licenseInfo.phoneNumber":"Номер телефона","licenseInfo.expiresIn":"Истекает через","licenseInfo.status":"Статус","languages.en":"English (Английский)","languages.zh":"中文 (Китайский)","languages.es":"Español (Испанский)","languages.fr":"Français (Французский)","languages.ar":"العربية (Арабский)","languages.pt":"Português (Португальский)","languages.ru":"Русский","languages.ja":"日本語 (Японский)","languages.de":"Deutsch (Немецкий)","errors.invalidFormat":"Неверный формат лицензионного ключа или ошибка проверки","errors.serverError":"Произошла ошибка сервера","errors.networkError":"Ошибка сети. Пожалуйста, проверьте ваше соединение","tabs.tabs":"Вкладки","tabs.manageTabs":"Управление вкладками","tabs.addTab":"Добавить вкладку","tabs.editTab":"Редактировать вкладку","tabs.deleteTab":"Удалить вкладку","tabs.tabTitle":"Название вкладки","tabs.tabDetails":"Детали вкладки","tabs.enterTabTitle":"Введите название вкладки","tabs.enterTabDetails":"Введите детали вкладки","tabs.chooseFrom":"Выбрать из","tabs.chat":"Чат","tabs.groups":"Группы","tabs.label":"Метка","tabs.searchHere":"Искать здесь","tabs.selectAll":"Выбрать все","tabs.clearAll":"Очистить все","tabs.selected":"Выбрано","tabs.allChats":"Все чаты","tabs.chats":"чаты","tabs.noFilterApplied":"Фильтр не применен","tabs.view":"Просмотр","tabs.edit":"Редактировать","tabs.delete":"Удалить","tabs.hideFromTabBar":"Скрыть из панели вкладок","tabs.showInTabBar":"Показать в панели вкладок","tabs.sort":"Сортировать","tabs.title":"Название","tabs.details":"Детали","tabs.action":"Действие","tabs.selectLabel":"Выбрать метку","tabs.chooseALabel":"-- Выберите метку --","tabs.selectedLabel":"Выбранная метка","tabs.change":"Изменить","tabs.pleaseSelectLabel":"Пожалуйста, выберите метку из выпадающего списка выше","tabs.areYouSureDeleteTab":"Вы уверены, что хотите удалить эту вкладку?","tabs.tabDeletedSuccessfully":"Вкладка успешно удалена","tabs.cancel":"Отмена","tabs.save":"Сохранить","tabs.all":"Все","tabs.oneToOne":"1:1","tabs.individualChats":"Только личные чаты","tabs.groupChats":"Только групповые чаты","tabs.unread":"Непрочитанные","tabs.unreadChats":"Только непрочитанные чаты","tabs.unsaved":"Несохраненные","tabs.unsavedContacts":"Только несохраненные контакты","templates.title":"Шаблоны сообщений","templates.manageTemplates":"Управление шаблонами","templates.newTemplate":"Новый шаблон","templates.editTemplate":"Редактировать шаблон","templates.sendTemplate":"Отправить шаблон","templates.deleteTemplate":"Удалить шаблон","templates.duplicateTemplate":"Дублировать шаблон","templates.activateTemplate":"Активировать","templates.deactivateTemplate":"Деактивировать","templates.total":"Всего","templates.active":"Активные","templates.inactive":"Неактивные","templates.filterAll":"Все","templates.filterActive":"Только активные","templates.filterInactive":"Только неактивные","templates.filterAllTypes":"Все типы","templates.templates":"шаблонов","templates.searchPlaceholder":"Поиск шаблонов...","templates.noTemplates":"Шаблоны не найдены","templates.createFirst":"Создайте свой первый шаблон","templates.edit":"Редактировать","templates.copy":"Копировать","templates.msgs":"сообщений","templates.noMessageContent":"Нет содержимого сообщения","templates.form.templateName":"Название шаблона","templates.form.templateNamePlaceholder":"Введите имя шаблона","templates.form.templateFor":"Шаблон для","templates.form.message":"Сообщение","templates.form.messagePlaceholder":"Введите ваше сообщение здесь...","templates.form.insertVariable":"Нажмите, чтобы вставить переменную:","templates.form.personalizeValue":"Значение персонализации","templates.form.personalizeValueHint":"Рассылайте выбранным лицам с персонализированными значениями, такими как @variable1, @variable2 и т.д.","templates.form.templatesType":"Тип шаблонов","templates.form.templateType":"Тип шаблона","templates.form.templateStatus":"Статус шаблона","templates.form.statusOn":"Вкл","templates.form.statusOff":"Выкл","templates.form.statusHint":'Когда статус шаблона "вкл", он доступен для использования. Наоборот, когда статус шаблона "выкл", он находится в сохраненном состоянии.',"templates.form.on":"Включено","templates.form.off":"Выключено","templates.form.save":"Сохранить","templates.form.cancel":"Отмена","templates.form.selectProducts":"Выбрать товары","templates.form.selectContacts":"Выбрать контакты","templates.form.addProduct":"Добавить товар","templates.form.addContact":"Добавить контакт","templates.form.buttons":"Кнопки","templates.form.addButton":"Добавить кнопку","templates.form.buttonsHint":"Максимум 3 кнопки разрешено","templates.form.selectFromContacts":"Выбрать из контактов","templates.form.addManually":"Добавить вручную","templates.form.productHint":"Товары из вашего каталога WhatsApp Business","templates.form.attachImages":"Прикрепить изображения/видео","templates.form.attachAudio":"Прикрепить аудио","templates.form.attachDocuments":"Прикрепить документы","templates.form.chooseFile":"Выбрать файл","templates.form.maxFileSize":"Максимальный размер файла: 16МБ (лимит WhatsApp)","templates.form.uploading":"Загрузка...","templates.errors.uploadFailed":"Не удалось загрузить файл. Попробуйте ещё раз.","templates.errors.fileTooLarge":"Файл слишком большой. Максимальный размер: 16МБ (лимит WhatsApp).","templates.form.listButtonText":"Текст кнопки","templates.form.listButtonTextPlaceholder":"Введите текст кнопки","templates.form.listDescription":"Описание","templates.form.listDescriptionPlaceholder":"Введите описание","templates.form.listSections":"Разделы","templates.form.pollQuestion":"Вопрос опроса","templates.form.pollQuestionPlaceholder":"Введите вопрос опроса","templates.form.allowMultipleAnswers":"Разрешить несколько ответов","templates.form.allowMultipleAnswersHint":"Пользователи могут выбрать несколько вариантов","templates.form.pollOptions":"Варианты опроса","templates.form.addOption":"+ Добавить вариант","templates.form.pollOptionsHint":"Минимум 2, максимум 12 вариантов","templates.messageType.individual":"Один к одному","templates.messageType.tab":"Вкладка","templates.messageType.group":"Группа","templates.messageType.label":"Метка","templates.messageType.kanban":"Канбан","templates.messageType.quickReply":"⚡ Быстрый ответ","templates.attachmentType.none":"Только сообщение","templates.attachmentType.imageVideo":"Сообщение + Изображения/Видео","templates.attachmentType.document":"Сообщение + Документы","templates.attachmentType.audio":"Сообщение + Аудио","templates.attachmentType.contact":"Сообщение + Контакты","templates.attachmentType.poll":"Сообщение + Опрос","templates.attachmentType.list":"Сообщение + Список","templates.attachmentType.product":"Сообщение + Товары","templates.attachmentType.buttons":"Сообщение + Кнопки","crm.button":"CRM","crm.openCRM":"Открыть CRM","crm.title":"Профиль CRM","crm.profile":"Профиль","crm.tabs":"Вкладки","crm.notes":"Заметки","crm.reminder":"Напоминание","crm.appointment":"Встреча","crm.income":"Доход","crm.expense":"Расход","crm.scheduleTab":"Расписание","crm.deletedMessagesTab":"Удалённые сообщения","crm.antiRevokeEnabled":"Anti-Revoke ВКЛЮЧЁН","crm.antiRevokeDisabled":"Anti-Revoke ВЫКЛЮЧЕН","crm.antiRevokeDescription":"Сохраняет локальные копии входящих сообщений, чтобы вы могли их увидеть, даже если отправитель их удалит.","crm.antiRevokeNotEnabledHint":"Включите Anti-Revoke выше, чтобы начать сохранять входящие сообщения.","crm.noDeletedMessages":"Удалённые сообщения пока не восстановлены. Мы следим — если кто-то удалит сообщение, мы сохраним копию здесь.","crm.onlyThisContact":"Только этот контакт","crm.allContacts":"Все контакты","crm.clearHistory":"Очистить историю","crm.exportCSV":"Экспорт в CSV","crm.revokedAt":"Удалено в","crm.copyMessage":"Копировать","crm.lionRecovered":"{brand} восстановил","crm.clickToShowOriginal":"Нажмите, чтобы показать оригинал","crm.antiRevokeChatTip":"Совет: вы также можете нажать на значок восстановления прямо на удалённом сообщении в чате, чтобы быстро его посмотреть.","crm.searchMessages":"Поиск сообщений…","crm.recoveredCount":"Восстановлено сообщений: {count}","crm.confirmClearChatHistory":"Очистить восстановленные сообщения этого контакта?","crm.confirmClearAllHistory":"Очистить ВСЕ восстановленные сообщения во всех чатах?","crm.noTextContent":"(без текста — медиа-сообщение)","crm.group":"Группа","crm.enable":"Включить","crm.disable":"Выключить","crm.addScheduleMessage":"Добавить расписание","crm.noScheduledMessages":"Нет запланированных сообщений","crm.noScheduledMessagesDesc":"Запланируйте сообщения для этого контакта.","crm.profile.userDetails":"Данные пользователя","crm.profile.addCustomAttribute":"+ Добавить атрибут","crm.profile.edit":"Редактировать","crm.profile.cancel":"Отмена","crm.profile.save":"Сохранить","crm.profile.fullName":"Полное имя","crm.profile.phoneNumber":"Номер телефона","crm.profile.email":"Email","crm.profile.gender":"Пол","crm.profile.dateOfBirth":"Дата рождения","crm.profile.details":"Подробности","crm.profile.address":"Адрес","crm.profile.language":"Язык","crm.profile.select":"- Выбрать -","crm.profile.male":"Мужской","crm.profile.female":"Женский","crm.profile.other":"Другой","crm.profile.addCustomField":"Добавить атрибут","crm.profile.attributeName":"Название атрибута *","crm.profile.attributePlaceholder":"напр., Компания, День рождения и т.д.","crm.profile.value":"Значение","crm.profile.enterValue":"Введите значение","crm.profile.add":"Добавить","crm.profile.deleteConfirm":"Вы уверены, что хотите удалить это поле?","crm.tabs.title":"Управление вкладками","crm.tabs.createNew":"+ Создать новую вкладку","crm.tabs.memberOf":"Участник","crm.tabs.available":"Доступные вкладки","crm.tabs.noTabs":"Нет вкладок","crm.tabs.create":"Создать","crm.tabs.tabName":"Название вкладки *","crm.tabs.tabNamePlaceholder":"Введите название вкладки","crm.tabs.contacts":"контактов","crm.tabs.remove":"Удалить","crm.tabs.addTo":"Добавить в","crm.notes.title":"Заметки","crm.notes.addNew":"+ Добавить заметку","crm.notes.search":"Поиск заметок...","crm.notes.noNotes":"Нет заметок","crm.notes.addFirst":"Добавьте первую заметку для этого контакта","crm.notes.topic":"Тема *","crm.notes.topicPlaceholder":"Введите тему","crm.notes.content":"Содержание","crm.notes.writeNote":"Напишите заметку...","crm.notes.editNote":"Редактировать заметку","crm.notes.addNote":"Добавить заметку","crm.notes.deleteConfirm":"Вы уверены, что хотите удалить эту заметку?","crm.reminder.title":"Напоминания","crm.reminder.addNew":"+ Добавить напоминание","crm.reminder.noReminders":"Нет напоминаний","crm.reminder.addFirst":"Добавьте первое напоминание для этого контакта","crm.reminder.topic":"Тема *","crm.reminder.topicPlaceholder":"Введите тему напоминания","crm.reminder.dateTime":"Дата и время *","crm.reminder.details":"Подробности","crm.reminder.detailsPlaceholder":"Дополнительные подробности...","crm.reminder.repeat":"Повторять","crm.reminder.noRepeat":"Не повторять","crm.reminder.every5min":"Каждые 5 минут","crm.reminder.every10min":"Каждые 10 минут","crm.reminder.every15min":"Каждые 15 минут","crm.reminder.every30min":"Каждые 30 минут","crm.reminder.every1hour":"Каждый час","crm.reminder.editReminder":"Редактировать напоминание","crm.reminder.addReminder":"Добавить напоминание","crm.reminder.deleteConfirm":"Вы уверены, что хотите удалить это напоминание?","crm.reminder.pending":"Ожидает","crm.reminder.due":"Срок","crm.reminder.completed":"Выполнено","crm.reminder.dismissed":"Отклонено","crm.reminder.stopped":"Остановлено","crm.reminder.snoozed":"Отложено","crm.reminder.snooze":"Отложить","crm.reminder.stop":"Остановить","crm.reminder.markComplete":"Отметить выполненным","crm.appointment.title":"Встречи","crm.appointment.addNew":"+ Добавить встречу","crm.appointment.noAppointments":"Нет встреч","crm.appointment.addFirst":"Запланируйте первую встречу с этим контактом","crm.appointment.appointmentTitle":"Название *","crm.appointment.titlePlaceholder":"Введите название встречи","crm.appointment.dateTime":"Дата и время *","crm.appointment.attendee":"Участник","crm.appointment.meetLink":"Ссылка Google Meet","crm.appointment.generateLink":"Создать ссылку","crm.appointment.pasteMeetLink":"Вставьте ссылку Google Meet сюда","crm.appointment.messageTemplate":"Шаблон сообщения","crm.appointment.templatePlaceholder":"Привет {name}, напоминаем о нашей встрече {date} в {time}. Ссылка: {link}","crm.appointment.reminderBefore":"Напоминание за","crm.appointment.noReminder":"Без напоминания","crm.appointment.5minBefore":"5 минут до","crm.appointment.10minBefore":"10 минут до","crm.appointment.15minBefore":"15 минут до","crm.appointment.30minBefore":"30 минут до","crm.appointment.1hourBefore":"1 час до","crm.appointment.2hoursBefore":"2 часа до","crm.appointment.1dayBefore":"1 день до","crm.appointment.sendNow":"Отправить сообщение сейчас","crm.appointment.editAppointment":"Редактировать встречу","crm.appointment.addAppointment":"Добавить встречу","crm.appointment.deleteConfirm":"Вы уверены, что хотите удалить эту встречу?","crm.appointment.scheduled":"Запланировано","crm.appointment.completed":"Завершено","crm.appointment.cancelled":"Отменено","crm.appointment.missed":"Пропущено","crm.appointment.join":"Присоединиться","crm.appointment.cancel":"Отменить","crm.appointment.markComplete":"Отметить завершённой","crm.addAppointment":"+ Добавить встречу","crm.noAppointments":"Нет встреч","crm.addFirstAppointment":"Добавьте первую встречу","crm.appointmentTitle":"Название встречи","crm.attendee":"Участник","crm.googleMeetLink":"Ссылка Google Meet","crm.generateLink":"Создать ссылку","crm.messageTemplate":"Шаблон сообщения","crm.reminderBefore":"Напоминание за","crm.sendMessageNow":"Отправить сообщение сейчас","crm.scheduled":"Запланировано","crm.cancelled":"Отменено","crm.missed":"Пропущено","crm.editAppointment":"Редактировать встречу","crm.deleteAppointment":"Удалить встречу","crm.joinMeeting":"Присоединиться","crm.before5Min":"5 минут до","crm.before10Min":"10 минут до","crm.before15Min":"15 минут до","crm.before30Min":"30 минут до","crm.before1Hour":"1 час до","crm.before2Hours":"2 часа до","crm.before1Day":"1 день до","crm.titleLabel":"Название","crm.scheduleDateTime":"Дата и время","crm.pasteGoogleMeetLink":"Вставьте ссылку Google Meet сюда","crm.generateLinkHint":"Нажмите 'Создать ссылку' чтобы открыть Google Meet, затем вставьте ссылку на встречу сюда","crm.chooseTemplate":"Выбрать шаблон","crm.selectTemplate":"-- Выбрать шаблон --","crm.messageTemplatePlaceholder":"Введите шаблон сообщения...","crm.useSameMessage":"Использовать то же сообщение при начале встречи","crm.meetingStartMessageLabel":"Сообщение при начале встречи","crm.meetingStartPlaceholder":"Введите сообщение для отправки при начале встречи...","crm.meetingStartHint":"Это сообщение будет отправлено, когда встреча фактически начнётся.","crm.sendReminderLabel":"Отправить напоминание","crm.reminderTimeHint":"Сообщение будет отправлено участникам в это время до встречи. Вы также получите звуковое уведомление.","crm.sendMessageNowTo":"Отправить сообщение сейчас","crm.sendNowHint":"Отметьте, чтобы отправить сообщение о встрече сразу после сохранения","crm.discard":"Отменить","crm.saveAndSend":"Сохранить и отправить","crm.sending":"Отправка...","crm.noAppointmentsFound":"Встречи не найдены","crm.searchAppointments":"Поиск встреч","crm.productDemoCall":"напр., Демонстрация продукта","crm.reminderMessageHint":"Это сообщение будет отправлено в время напоминания (до встречи).","crm.joinMeet":"Присоединиться к Meet","crm.appointmentTemplates":"Шаблоны встреч","crm.savedTemplates":"Сохранённые шаблоны","crm.noTemplatesYet":"Пока нет шаблонов. Создайте свой первый шаблон!","crm.newTemplate":"+ Новый шаблон","crm.editTemplateTitle":"Редактировать шаблон","crm.newTemplateTitle":"Новый шаблон","crm.templateName":"Название шаблона","crm.templateNamePlaceholder":"напр., Напоминание о встрече","crm.meetLinkOptional":"Ссылка Google Meet (Необязательно)","crm.updateTemplate":"Обновить шаблон","crm.saveTemplate":"Сохранить шаблон","crm.pleaseEnterTitle":"Пожалуйста, введите название","crm.pleaseSelectFutureDate":"Пожалуйста, выберите будущую дату и время","crm.deleteAppointmentConfirm":"Вы уверены, что хотите удалить эту встречу?","crm.pleaseEnterTemplateName":"Пожалуйста, введите название шаблона","crm.pleaseEnterMessageTemplate":"Пожалуйста, введите шаблон сообщения","crm.deleteTemplateConfirm":"Вы уверены, что хотите удалить этот шаблон?","crm.income.title":"Доход","crm.income.addNew":"+ Добавить доход","crm.income.totalIncome":"Общий доход","crm.income.pending":"Ожидает","crm.income.filteredTotal":"По фильтру","crm.income.noIncome":"Нет доходов","crm.income.addFirst":"Добавьте первую запись о доходе для этого контакта","crm.income.amount":"Сумма *","crm.income.amountPlaceholder":"Введите сумму","crm.income.category":"Категория","crm.income.paymentMethod":"Способ оплаты","crm.income.description":"Описание","crm.income.descriptionPlaceholder":"Введите описание","crm.income.reference":"Ссылка","crm.income.referencePlaceholder":"ID транзакции, № чека и т.д.","crm.income.date":"Дата","crm.income.status":"Статус","crm.income.editIncome":"Редактировать доход","crm.income.addIncome":"Добавить доход","crm.income.deleteConfirm":"Вы уверены, что хотите удалить эту запись о доходе?","crm.income.payment":"Оплата получена","crm.income.sale":"Продажа","crm.income.service":"Комиссия за услугу","crm.income.commission":"Комиссия","crm.income.refund":"Возврат получен","crm.income.other":"Другое","crm.income.completed":"Завершено","crm.income.cancelled":"Отменено","crm.expense.title":"Расход","crm.expense.addNew":"+ Добавить расход","crm.expense.totalExpense":"Общий расход","crm.expense.pending":"Ожидает","crm.expense.filteredTotal":"По фильтру","crm.expense.noExpense":"Нет расходов","crm.expense.addFirst":"Добавьте первую запись о расходе для этого контакта","crm.expense.amount":"Сумма *","crm.expense.amountPlaceholder":"Введите сумму","crm.expense.category":"Категория","crm.expense.paymentMethod":"Способ оплаты","crm.expense.description":"Описание","crm.expense.descriptionPlaceholder":"Введите описание","crm.expense.reference":"Ссылка","crm.expense.referencePlaceholder":"ID транзакции, № чека и т.д.","crm.expense.date":"Дата","crm.expense.status":"Статус","crm.expense.editExpense":"Редактировать расход","crm.expense.addExpense":"Добавить расход","crm.expense.deleteConfirm":"Вы уверены, что хотите удалить эту запись о расходе?","crm.expense.purchase":"Покупка","crm.expense.service":"Стоимость услуги","crm.expense.travel":"Поездка","crm.expense.marketing":"Маркетинг","crm.expense.commission":"Комиссия выплачена","crm.expense.refund":"Возврат выдан","crm.expense.other":"Другое","crm.expense.completed":"Завершено","crm.expense.cancelled":"Отменено","crm.payment.cash":"Наличные","crm.payment.bankTransfer":"Банковский перевод","crm.payment.upi":"UPI","crm.payment.card":"Карта","crm.payment.cheque":"Чек","crm.payment.other":"Другое","crm.filter.search":"Поиск...","crm.filter.allCategories":"Все категории","crm.filter.allStatus":"Все статусы","crm.filter.allTime":"Всё время","crm.filter.today":"Сегодня","crm.filter.thisWeek":"Эта неделя","crm.filter.thisMonth":"Этот месяц","crm.filter.thisYear":"Этот год","crm.userDetails":"Данные пользователя","crm.addCustomAttribute":"+ Добавить атрибут","crm.edit":"Редактировать","crm.cancel":"Отмена","crm.save":"Сохранить","crm.signature":"Подпись","crm.signatureDesc":"Введите свое имя для отправки подписанных сообщений или для отображения другим агентам, что вы находитесь на связи в конкретном чате.","crm.enterYourName":"Введите ваше имя","crm.activateSignature":"Активировать подпись","crm.signatureAs":"Подпись от имени","crm.signatureNotSet":"Установите имя подписи в настройках расширения WhatsApp Web.","crm.delete":"Удалить","crm.deleteConnection":"Удалить соединение?","crm.deleteConnectionConfirm":"Вы уверены, что хотите удалить это соединение между узлами?","crm.fullName":"Полное имя","crm.phoneNumber":"Номер телефона","crm.email":"Email","crm.gender":"Пол","crm.dateOfBirth":"Дата рождения","crm.details":"Подробности","crm.address":"Адрес","crm.language":"Язык","crm.male":"Мужской","crm.female":"Женский","crm.other":"Другой","crm.select":"- Выбрать -","crm.addField":"Добавить поле","crm.fieldLabel":"Название поля","crm.fieldValue":"Значение поля","crm.deleteFieldConfirm":"Вы уверены, что хотите удалить это поле?","crm.contactTabs":"Вкладки контакта","crm.addToTab":"Добавить во вкладку","crm.removeFromTab":"Удалить из вкладки","crm.noTabs":"Нет вкладок","crm.createTab":"Создать вкладку","crm.tabName":"Название вкладки","crm.contacts":"контактов","crm.addToLabel":"Добавить к метке","crm.selectLabel":"Выбрать метку","crm.noLabelsAvailable":"Нет меток. Сначала создайте вкладку.","crm.labelsAndStages":"Метки и Этапы","crm.whatsappLabels":"Метки WhatsApp","crm.customTabs":"Пользовательские вкладки","team.button":"Команда","team.shareWith":"Поделиться с командой","team.settings":"Настройки команды","team.addMember":"Добавить участника","team.editMember":"Редактировать участника","team.deleteMember":"Удалить","team.memberName":"Имя участника","team.memberPhone":"Номер телефона","team.department":"Отдел","team.departmentPlaceholder":"напр., Продажи, Финансы, Поддержка","team.template":"Шаблон сообщения","team.templatePlaceholder":"Введите сообщение с переменными...","team.noMembers":"Нет настроенных участников","team.clickToAdd":"Нажмите + для добавления участников","team.sending":"Отправка...","team.insertVariable":"Вставить переменную","team.preview":"Предпросмотр","team.deleteConfirm":"Вы уверены, что хотите удалить этого участника?","team.phonePlaceholder":"напр., +5511999999999","team.namePlaceholder":"напр., Продажи - Иван","team.variableHint":"Используйте {{name}}, {{phone}}, {{labels}} и т.д. для динамического контента","team.save":"Сохранить","team.cancel":"Отмена","team.editTemplate":"Редактировать шаблон","team.saveAndSend":"Сохранить и отправить","team.sendOnce":"Отправить один раз","team.send":"Отправить","team.selectContact":"Выбрать контакт","team.clickToSelectContact":"Нажмите, чтобы выбрать контакт из WhatsApp","team.searchContact":"Поиск контактов...","team.loadingContacts":"Загрузка контактов...","team.noContactsFound":"Контакты не найдены","team.noSearchResults":"Нет результатов","team.phoneHint":"Введите номер с кодом страны или нажмите значок для выбора","team.popupTitle":"Поделиться с командой","team.popupSubtitle":"Отправить контактные данные мгновенно","team.noTeamMembers":"Нет участников","team.noTeamMembersDesc":"Добавьте участников команды для быстрого обмена контактами через WhatsApp","crm.addNote":"+ Добавить заметку","crm.searchNotes":"Поиск заметок...","crm.noNotes":"Нет заметок","crm.addFirstNote":"Добавьте первую заметку","crm.topic":"Тема","crm.content":"Содержание","crm.editNote":"Редактировать заметку","crm.deleteNoteConfirm":"Вы уверены, что хотите удалить эту заметку?","crm.addReminder":"+ Добавить напоминание","crm.noReminders":"Нет напоминаний","crm.addFirstReminder":"Добавьте первое напоминание","crm.reminderTopic":"Тема напоминания","crm.dateTime":"Дата и время","crm.repeatInterval":"Интервал повтора","crm.noRepeat":"Не повторять","crm.every5Min":"Каждые 5 минут","crm.every10Min":"Каждые 10 минут","crm.every15Min":"Каждые 15 минут","crm.every30Min":"Каждые 30 минут","crm.every1Hour":"Каждый час","crm.status":"Статус","crm.pending":"Ожидает","crm.completed":"Выполнено","crm.dismissed":"Отклонено","crm.stopped":"Остановлено","crm.snoozed":"Отложено","crm.due":"Срок","crm.editReminder":"Редактировать напоминание","crm.deleteReminder":"Удалить напоминание","crm.search":"Поиск...","crm.all":"Все","crm.today":"Сегодня","crm.thisWeek":"Эта неделя","crm.thisMonth":"Этот месяц","crm.thisYear":"Этот год","crm.allStatus":"Все статусы","crm.allCategories":"Все категории","crm.none":"Нет","crm.ref":"Ссылка","crm.tableTabName":"Название вкладки","crm.tableContactsInTab":"Контакты во вкладке","crm.tableAction":"Действие","crm.tableName":"Название","crm.tableModifiedDate":"Дата изменения","crm.tableTopic":"Тема","crm.tableReminderDate":"Дата напоминания","crm.tableRepeatSnooze":"Повтор/Отложить","crm.tableStatus":"Статус","crm.tableTitle":"Заголовок","crm.tableDateTime":"Дата и время","crm.tableAttendee":"Участник","crm.tableMeetLink":"Ссылка Meet","crm.tableDescription":"Описание","crm.tableCategory":"Категория","crm.tableAmount":"Сумма","crm.tablePayment":"Оплата","crm.tableDate":"Дата","crm.addIncomeTitle":"Добавить доход","crm.editIncomeTitle":"Редактировать доход","crm.addExpenseTitle":"Добавить расход","crm.editExpenseTitle":"Редактировать расход","crm.enterAmount":"Введите сумму","crm.validAmountRequired":"Пожалуйста, введите корректную сумму","crm.descriptionRequired":"Пожалуйста, введите описание","crm.referenceInvoice":"Ссылка / № счёта","crm.referenceBill":"Ссылка / № квитанции","crm.invoicePlaceholder":"напр. INV-001","crm.billPlaceholder":"напр. BILL-001","crm.paymentDescription":"напр. Оплата за услуги","crm.expenseDescription":"напр. Канцелярские товары","crm.update":"Обновить","crm.addIncomeBtn":"Добавить доход","crm.addExpenseBtn":"Добавить расход","crm.recurringTransaction":"Повторяющаяся транзакция","crm.repeatEvery":"Повторять каждые","crm.neverEnds":"Без окончания","crm.endDate":"Дата окончания","crm.daily":"Ежедневно","crm.weekly":"Еженедельно","crm.monthly":"Ежемесячно","crm.quarterly":"Ежеквартально (3 месяца)","crm.yearly":"Ежегодно","crm.currencySettings":"Настройки валюты","crm.searchCurrency":"Поиск валюты...","crm.noCurrenciesFound":"Валюты не найдены","crm.noIncomeRecords":"Записи о доходах не найдены","crm.noExpenseRecords":"Записи о расходах не найдены","crm.deleteIncomeConfirm":"Вы уверены, что хотите удалить эту запись о доходе?","crm.deleteExpenseConfirm":"Вы уверены, что хотите удалить эту запись о расходе?","crm.addCategory":"Добавить категорию","crm.categoryName":"Название категории","crm.enterCategoryName":"Введите название категории","crm.customCategories":"Пользовательские категории","crm.addCustomCategory":"Добавить пользовательскую категорию","crm.existingCustomCategories":"Существующие пользовательские категории","crm.addStatus":"Добавить статус","crm.statusName":"Название статуса","crm.enterStatusName":"Введите название статуса","crm.customStatuses":"Пользовательские статусы","crm.addCustomStatus":"Добавить пользовательский статус","crm.existingCustomStatuses":"Существующие пользовательские статусы","crm.add":"Добавить","crm.loading":"Загрузка...","crm.dismiss":"Отклонить","crm.yesterday":"Вчера","agent.agentMode":"Режим агента","agent.identifyAsAgent":"Идентифицировать как агента","agent.agentName":"Имя агента","agent.namePlaceholder":"напр., Иван, Команда поддержки 1","agent.agentNamePlaceholder":"Введите имя агента","agent.viewTransferHistory":"Просмотр истории переводов","agent.transferToAgent":"Перевести агенту","agent.transferSuccess":"Чат успешно переведён","agent.noAgentsOnline":"Нет доступных агентов онлайн","agent.selectAgent":"Выбрать агента","agent.chooseAgent":"-- Выберите агента --","agent.reason":"Причина","agent.reasonPlaceholder":"Почему вы переводите этот чат?","agent.priority":"Приоритет","agent.priorityLow":"Низкий","agent.priorityMedium":"Средний","agent.priorityHigh":"Высокий","agent.priorityUrgent":"Срочный","agent.transfer":"Перевести","agent.incomingTransfer":"Входящий перевод","agent.fromAgent":"От агента","agent.toAgent":"Агенту","agent.chat":"Чат","agent.startService":"Начать обслуживание","agent.endService":"Завершить обслуживание","agent.activeService":"Активное обслуживание","agent.from":"От","agent.to":"К","agent.duration":"Длительность","agent.transferHistory":"История переводов","agent.sent":"Отправленные","agent.received":"Полученные","agent.status":"Статус","agent.all":"Все","agent.statusPending":"Ожидание","agent.statusAccepted":"Принято","agent.statusInService":"На обслуживании","agent.statusCompleted":"Завершено","agent.statusDeclined":"Отклонено","agent.statusExpired":"Истекло","agent.noTransfers":"Переводы не найдены","agent.serviceQueue":"Очередь обслуживания","agent.pendingTransfers":"Ожидающие переводы","agent.activeServices":"Активные обслуживания","agent.sentTransfers":"Отправленные переводы","agent.noActiveServices":"Нет активных обслуживаний или ожидающих переводов","agent.serviceEnded":"Обслуживание успешно завершено","agent.accept":"Принять","agent.decline":"Отклонить","agent.notRegistered":"Агент не зарегистрирован. Пожалуйста, сначала включите режим агента.","agent.statusCancelled":"Отменено","agent.started":"Начато","chatTools.suggest":"Предложить","chatTools.spelling":"Орфография","chatTools.translate":"Перевести","chatTools.summarize":"Обобщить","chatTools.enlarge":"Расширить","chatTools.friendly":"Дружелюбно","chatTools.formal":"Формально","chatTools.send":"Отправить","chatTools.copy":"Копировать","chatTools.use":"Использовать","chatTools.aiResult":"Результат ИИ","chatTools.suggestTitle":"Предложение ИИ","chatTools.spellingTitle":"Исправить орфографию и грамматику","chatTools.translateTitle":"Перевести на","chatTools.summarizeTitle":"Обобщить текст","chatTools.enlargeTitle":"Расширить текст","chatTools.friendlyTitle":"Сделать дружелюбным","chatTools.formalTitle":"Сделать формальным","chatTools.conversationSummary":"Резюме чата","chatTools.conversationSummaryTitle":"Кратко изложить этот разговор","chatTools.conversationSummarizing":"Создание резюме чата…","chatTools.conversationSummaryEmpty":"В этом чате нет сообщений для резюме","chatTools.conversationSummaryNoChat":"Откройте чат, чтобы создать резюме","chatTools.conversationSummaryFailed":"Не удалось загрузить сообщения чата","chatTools.conversationSummaryResultTitle":"Резюме разговора","chatTools.sendTitle":"Отправить сообщение","chatTools.selectTextFirst":"Сначала выберите текст или введите в поле ввода","chatTools.searchLanguage":"Поиск языка...","aiSettings.title":"Введите ключ API ИИ","aiSettings.platformType":"Тип платформы ИИ","aiSettings.geminiAI":"GEMINI AI","aiSettings.chatgpt":"CHATGPT","aiSettings.deepseek":"DEEPSEEK","aiSettings.apiKey":"Ключ API ИИ","aiSettings.enterApiKey":"Пожалуйста, введите ваш ключ API ИИ","aiSettings.validate":"Проверить","aiSettings.validKey":"Ключ API действителен!","aiSettings.invalidKey":"Недействительный ключ API. Пожалуйста, проверьте и попробуйте снова.","aiSettings.note":"Примечание:","aiSettings.geminiNote":"Получите ключ Gemini API в Google AI Studio (aistudio.google.com)","aiSettings.chatgptNote":"Получите ключ OpenAI API на platform.openai.com/api-keys","aiSettings.deepseekNote":"Получите ключ DeepSeek API на platform.deepseek.com","aiSettings.enableAITools":"Включить инструменты ИИ","aiSettings.close":"Закрыть","aiSettings.save":"Сохранить","aiSettings.configureAI":"Настройте поставщика ИИ и ключ API для функций на базе ИИ","settings.title":"Настройки","settings.yourLanguage":"Ваш Язык","settings.selectLanguage":"Выбрать Язык","settings.chooseLanguage":"Выберите предпочитаемый язык для интерфейса расширения","settings.whatLanguageSpeak":"На каком языке вы говорите","settings.translateMessages":"Переводить входящие сообщения","settings.selectSpokenLanguage":"Выберите ваш язык","settings.spokenLanguageHint":"Сообщения будут переведены на этот язык, когда вы нажмете на значок перевода входящих сообщений.","settings.blurSettings":"Настройки размытия","settings.blurDescription":"Размытие личной информации на экране.","settings.blurMessages":"Размыть сообщения","settings.blurProfileNames":"Размыть имена профилей","settings.blurDisplayPhotos":"Размыть фото профилей","settings.blurConversation":"Размыть беседу","settings.displayOnHover":"Показать беседу при наведении","settings.theme":"Тема","settings.themeDescription":"Выберите предпочтительную цветовую схему","settings.lightMode":"Светлый режим","settings.lightModeDesc":"Классический светлый вид","settings.darkMode":"Тёмный режим","settings.darkModeDesc":"Бережёт глаза при слабом освещении","settings.systemMode":"Система","settings.systemModeHint":"Следует теме WhatsApp","settings.currentTheme":"Текущая тема","signature.title":"Подпись","signature.enableSignature":"Включить подпись","signature.yourSignature":"Ваша подпись","signature.placeholder":"напр., - Иван Петров","signature.preview":"Предпросмотр","signature.save":"Сохранить","backup.title":"Резервное копирование и восстановление","backup.export":"Экспорт","backup.import":"Импорт","backup.importHint":"Загрузите файл JSON резервной копии {brand}, чтобы восстановить данные. Вы можете выбрать, какие функции импортировать.","backup.kanbanCRM":"Данные Kanban CRM","backup.customTabs":"Пользовательские вкладки","backup.templatesQuickReplies":"Шаблоны и быстрые ответы","backup.broadcastHistory":"История рассылок","backup.settings":"Настройки","backup.crmProfileData":"Данные профиля CRM","backup.calendarData":"Календарь (Напоминания и Встречи)","backup.statusData":"Статус","backup.webhookSettings":"Настройки Webhook","backup.aiBotSettings":"Настройки ИИ-бота","backup.aiApiSettings":"Настройки API ИИ","backup.spokenLanguage":"Разговорный язык","backup.chatbotFlows":"Потоки чат-бота (Fluxo)","backup.followupData":"Последовательности отслеживания","backup.scheduledMessages":"Запланированные сообщения","backup.scheduledBroadcasts":"Запланированные рассылки","backup.fluxoAdvanced":"Расширенные настройки Fluxo","backup.conversationStates":"Состояния разговоров","backup.bulkValidatorData":"Данные массового валидатора","backup.quickReplies":"Быстрые ответы","backup.crmTodos":"Списки задач CRM","backup.signatureSettings":"Настройки подписи","backup.teamSettings":"Настройки команды","backup.blurSettings":"Настройки размытия","backup.featureVisibility":"Видимость функций","backup.themeSettings":"Настройки темы","backup.uiStateSettings":"Настройки состояния интерфейса","backup.apiPollingSettings":"Настройки опроса API","backup.agentSettings":"Настройки агента","backup.autoBackup":"Автоматическое резервное копирование","backup.autoBackupInfo":"Автоматическая резервная копия будет создана при загрузке WhatsApp Web в новую дату","backup.autoBackupDestination":"Место сохранения резервной копии","backup.autoBackupWhatsApp":"Отправить в сохранённые сообщения WhatsApp","backup.autoBackupDownload":"Скачать на компьютер","backup.exportNow":"Экспортировать сейчас","backup.importNow":"Импортировать сейчас","backup.selectFile":"Выберите файл резервной копии для импорта","backup.importSuccess":"Данные успешно импортированы!","backup.importError":"Ошибка импорта данных. Пожалуйста, проверьте формат файла.","backup.exportSuccess":"Данные успешно экспортированы!","backup.noDataSelected":"Пожалуйста, выберите хотя бы один тип данных для экспорта/импорта","backup.cheetahDetected":"Обнаружен Cheetah CRM","backup.fileLoaded":"Файл успешно загружен","backup.cheetahImportDesc":"Эта резервная копия содержит данные Cheetah CRM. Все совместимые функции будут импортированы и объединены с вашими существующими данными CRM.","backup.dataToImport":"Данные для импорта:","backup.mergeWarning":"Важно:","backup.mergeWarningDesc":"Данные будут объединены с существующими данными CRM. Ваши текущие данные НЕ будут перезаписаны - будут добавлены только новые данные.","backup.importing":"Импорт...","backup.importCheetah":"Импортировать резервную копию Cheetah CRM","missedSchedule.title":"Пропущенная запланированная кампания","missedSchedule.description":"Запланированная кампания была пропущена, потому что WhatsApp Web не был открыт в запланированное время.","missedSchedule.sendNow":"Отправить сейчас","missedSchedule.cancelDiscard":"Отменить и удалить","missedSchedule.dismiss":"Напомнить позже","calendar.title":"Календарь","calendar.goToToday":"Перейти к сегодня","calendar.reminders":"Напоминания","calendar.appointments":"Встречи","calendar.remindersFor":"Напоминания на","calendar.appointmentsFor":"Встречи на","calendar.noReminders":"Нет напоминаний на эту дату","calendar.noAppointments":"Нет встреч на эту дату","calendar.selectDate":"Выберите дату с напоминаниями или встречами","calendar.deleteReminder":"Удалить напоминание","calendar.deleteAppointment":"Удалить встречу","calendar.confirmDeleteReminder":"Вы уверены, что хотите удалить это напоминание?","calendar.confirmDeleteAppointment":"Вы уверены, что хотите удалить эту встречу?","calendar.everyMin":"Каждые {min} мин","calendar.everyHour":"Каждый час","calendar.weekdays.sun":"ВС","calendar.weekdays.mon":"ПН","calendar.weekdays.tue":"ВТ","calendar.weekdays.wed":"СР","calendar.weekdays.thu":"ЧТ","calendar.weekdays.fri":"ПТ","calendar.weekdays.sat":"СБ","calendar.months.january":"Январь","calendar.months.february":"Февраль","calendar.months.march":"Март","calendar.months.april":"Апрель","calendar.months.may":"Май","calendar.months.june":"Июнь","calendar.months.july":"Июль","calendar.months.august":"Август","calendar.months.september":"Сентябрь","calendar.months.october":"Октябрь","calendar.months.november":"Ноябрь","calendar.months.december":"Декабрь","calendar.status.pending":"Ожидание","calendar.status.completed":"Завершено","calendar.status.dismissed":"Отклонено","calendar.status.snoozed":"Отложено","calendar.status.stopped":"Остановлено","calendar.status.scheduled":"Запланировано","calendar.status.cancelled":"Отменено","calendar.status.missed":"Пропущено","calendar.todos":"Задачи","calendar.todosFor":"Задачи на","calendar.noTodos":"Задачи не найдены","calendar.addTodo":"Добавить задачу","calendar.editTodo":"Редактировать задачу","calendar.deleteTodo":"Удалить задачу","calendar.confirmDeleteTodo":"Вы уверены, что хотите удалить эту задачу?","todo.title":"Заголовок","todo.titlePlaceholder":"Введите заголовок задачи","todo.description":"Описание","todo.descriptionPlaceholder":"Добавить детали (необязательно)","todo.dueDate":"Срок выполнения","todo.dueTime":"Время выполнения","todo.priority":"Приоритет","todo.priorityHigh":"Высокий","todo.priorityMedium":"Средний","todo.priorityLow":"Низкий","todo.category":"Категория","todo.noCategory":"Без категории","todo.categoryWork":"Работа","todo.categoryPersonal":"Личное","todo.categoryUrgent":"Срочное","todo.categoryShopping":"Покупки","todo.categoryHealth":"Здоровье","todo.subtasks":"Подзадачи","todo.addSubtask":"Добавить","todo.subtaskPlaceholder":"Введите подзадачу","todo.recurring":"Повторение","todo.repeatEvery":"Повторять","todo.endDate":"Дата окончания","todo.recurringDaily":"Ежедневно","todo.recurringWeekly":"Еженедельно","todo.recurringMonthly":"Ежемесячно","todo.recurringYearly":"Ежегодно","todo.reminder":"Напоминание","todo.reminderDate":"Дата напоминания","todo.reminderTime":"Время напоминания","todo.browserNotification":"Уведомление в браузере","todo.whatsappSelfMessage":"Отправить напоминание WhatsApp себе","todo.whatsappSelfMessageHint":"Вы получите сообщение WhatsApp при наступлении срока","todo.save":"Сохранить задачу","todo.update":"Обновить задачу","todo.cancel":"Отмена","todo.addTodo":"Добавить задачу","todo.editTodo":"Редактировать задачу","todo.statusPending":"Ожидание","todo.statusInProgress":"В процессе","todo.statusCompleted":"Завершено","todo.statusCancelled":"Отменено","todo.filterAll":"Все задачи","todo.filterToday":"Сегодня","todo.filterThisWeek":"На этой неделе","todo.filterOverdue":"Просрочено","todo.filterCompleted":"Завершённые","todo.today":"Сегодня","todo.tomorrow":"Завтра","todo.overdue":"Просрочено","todo.snoozeTime":"Время отложения","todo.minutes":"минут","todo.hour":"час","todo.hours":"часов","todo.day":"день","todo.taskReminder":"Напоминание о задаче","todo.highPriority":"Высокий приоритет","todo.mediumPriority":"Средний приоритет","todo.lowPriority":"Низкий приоритет","todo.subtasksCount":"подзадач","todo.snooze":"Отложить","todo.markDone":"Отметить выполненным","todo.dismiss":"Закрыть","todo.task":"Задача","todo.changeColor":"Нажмите для изменения цвета","todo.selectCategoryFirst":"Сначала выберите категорию","todo.linkedContacts":"Связанные контакты","todo.optional":"Необязательно","todo.selectContacts":"Выбрать контакты","todo.searchContacts":"Поиск контактов...","todo.noContactsFound":"Контакты не найдены","todo.selected":"выбрано","todo.contacts":"контактов","status.title":"Статус","status.activeStatus":"Активный статус","status.createStatus":"Создать статус","status.loading":"Загрузка статусов...","status.noStatusFound":"Статус не найден","status.noStatusDescription":"Похоже, вы ещё не создали ни одного статуса. Нажмите кнопку ниже, чтобы добавить новый.","status.add":"Добавить","status.statusName":"Название статуса (необязательно)","status.statusNamePlaceholder":"Создать название для статуса","status.chooseType":"Выберите тип","status.type.text":"ТЕКСТ","status.type.image":"ИЗОБРАЖЕНИЕ","status.type.video":"ВИДЕО","status.type.audio":"АУДИО","status.typeText":"Введите текст","status.backgroundColor":"Выберите цвет фона","status.clickToChange":"Нажмите для изменения","status.import":"Импорт","status.dragHere":"Перетащите файл сюда","status.scheduleStatus":"Запланировать статус","status.autoRepost24h":"Повторять статус каждые 24 часа","status.autoRepost":"Авто-повтор","status.postNow":"Опубликовать сейчас","status.posting":"Публикация...","status.create":"Создать","status.delete":"Удалить","status.emoji":"Эмодзи","status.status.pending":"Ожидает","status.status.posted":"Опубликовано","status.status.scheduled":"Запланировано","status.status.failed":"Ошибка","status.caption":"Подпись","status.captionPlaceholder":"Добавить подпись...","status.edit":"Редактировать","ai.regenerate":"Регенерировать","ai.regenerating":"Регенерация...","ai.regenerateWithAI":"Регенерировать с ИИ","ai.notEnabled":"ИИ не включен. Пожалуйста, настройте параметры ИИ.","ai.failedToRegenerate":"Не удалось регенерировать","ai.failedToRegenerateMessage":"Не удалось регенерировать сообщение","broadcast.title":"Массовые сообщения","broadcast.newCampaign":"Новая кампания","broadcast.reports":"Отчёты","broadcast.close":"Закрыть","broadcast.sending":"Отправка...","broadcast.paused":"Приостановлено","broadcast.completed":"Завершено","broadcast.clearHistory":"Очистить историю","broadcast.createCampaign":"Создать кампанию","broadcast.createCampaignSubtitle":"Отправить персонализированные сообщения нескольким контактам","broadcast.scheduledCampaigns":"Запланированные кампании","broadcast.campaignReports":"Отчёты кампании","broadcast.viewManageCampaigns":"Просмотр и управление кампаниями","broadcast.recipients":"Получатели","broadcast.selected":"выбрано","broadcast.contacts":"Контакты","broadcast.groups":"Группы","broadcast.phone":"Телефон","broadcast.phonePlaceholder":"Номера телефонов с кодом страны","broadcast.clearAll":"Очистить всё","broadcast.contactsUploaded":"контактов загружено","broadcast.noGroupsSelected":'Группы не выбраны. Нажмите "Добавить группы" для выбора.',"broadcast.addGroups":"Добавить группы","broadcast.groupsSelected":"групп(а) выбрано","broadcast.upload":"Загрузить","broadcast.select":"Выбрать","broadcast.download":"Скачать","broadcast.groupsContacts":"Контакты группы","broadcast.tabsContacts":"Контакты вкладки","broadcast.kanbanBoard":"Доска Kanban","broadcast.labelsContacts":"Контакты метки","broadcast.allowRepeat":"Разрешить повторяющиеся номера","broadcast.enableLinkPreview":"Включить предпросмотр ссылок","broadcast.groupActions":"Действия с группами","broadcast.customTabActions":"Действия с вкладками","broadcast.labelsActions":"Действия с метками","broadcast.kanbanBoardActions":"Действия с доской Kanban","broadcast.skipBulkMessage":"Пропустить массовую рассылку","broadcast.skipBulkMessageInfo":"Отправка сообщений будет пропущена. Только действия (Группы, Вкладки, Метки, Kanban) будут выполнены для контактов.","broadcast.appendSignature":"Добавить подпись","broadcast.signaturePreview":"Предпросмотр","broadcast.groupActionsNote":"Примечание: Вы должны быть администратором групп для выполнения действий ниже.","broadcast.addIntoGroups":"Добавить в группы","broadcast.removeFromGroups":"Удалить из групп","broadcast.selectGroups":"Выбрать группы","broadcast.addIntoTabs":"Добавить во вкладки","broadcast.removeFromTabs":"Удалить из вкладок","broadcast.selectTabs":"Выбрать вкладки","broadcast.addToLabels":"Добавить к меткам","broadcast.removeFromLabels":"Удалить из меток","broadcast.selectLabels":"Выбрать метки","broadcast.addToKanban":"Добавить на этап Kanban","broadcast.removeFromKanban":"Удалить с этапа Kanban","broadcast.selectCRMStage":"Выбрать CRM и этап","broadcast.sendRandomMessage":"Отправить случайное сообщение каждому контакту","broadcast.addMessage":"Добавить сообщение","broadcast.pauseSetting":"Настройка паузы","broadcast.pauseAfterXSends":"Пауза (после каждых X отправок):","broadcast.pauseTimeInSeconds":"Время паузы (с):","broadcast.second":"Секунда","broadcast.message":"Сообщение","broadcast.moveUp":"Переместить вверх","broadcast.moveDown":"Переместить вниз","broadcast.deleteMessage":"Удалить сообщение","broadcast.templateType":"Тип шаблона","broadcast.messageOnly":"Только сообщение","broadcast.enterMessageText":"Пожалуйста, введите текст сообщения","broadcast.variable":"Переменная","broadcast.phoneNumber":"Номер телефона","broadcast.contactName":"Имя контакта","broadcast.uploadCSVHint":"Загрузите CSV с дополнительными столбцами для добавления переменных","broadcast.selectTemplates":"Выбрать шаблоны","broadcast.noTemplates":"Нет доступных шаблонов","broadcast.sendingDelay":"Задержка отправки","broadcast.minimumSecond":"Минимум секунд","broadcast.maximumSecond":"Максимум секунд","broadcast.delayHint":"Каждое сообщение будет отправлено со случайной задержкой от {min} до {max} секунд","broadcast.scheduleMessage":"Запланировать сообщение","broadcast.date":"Дата","broadcast.time":"Время","broadcast.autoSendIfMissed":"Автоматическая отправка, если время прошло","broadcast.recurring":"Повторяющийся","broadcast.repeatInterval":"Повторять","broadcast.daily":"Ежедневно","broadcast.weekly":"Еженедельно","broadcast.monthly":"Ежемесячно","broadcast.yearly":"Ежегодно","broadcast.selectDays":"Выбрать дни","broadcast.sun":"Вс","broadcast.mon":"Пн","broadcast.tue":"Вт","broadcast.wed":"Ср","broadcast.thu":"Чт","broadcast.fri":"Пт","broadcast.sat":"Сб","broadcast.ends":"Заканчивается","broadcast.endNever":"Никогда","broadcast.endOnDate":"В дату","broadcast.recurringHowToUse":"Как использовать повторение","broadcast.recurringTip1":"Включите повторение для автоматического повтора этой рассылки","broadcast.recurringTip2":"Выберите частоту: Ежедневно, Еженедельно, Ежемесячно или Ежегодно","broadcast.recurringTip3":"Для еженедельной: Выберите конкретные дни (Пн, Вт и т.д.)","broadcast.recurringTip4":'Установите дату окончания или выберите "Никогда" для бессрочного выполнения',"broadcast.recurringTip5":"После каждой рассылки следующая планируется автоматически","broadcast.selectDates":"Выбрать даты","broadcast.selectMonths":"Выбрать месяцы","broadcast.calendarSelectInfo":"Выберите конкретные даты в календаре. Переходите между месяцами с помощью стрелок.","broadcast.datesSelected":"дат выбрано","broadcast.jan":"Янв","broadcast.feb":"Фев","broadcast.mar":"Мар","broadcast.apr":"Апр","broadcast.may":"Май","broadcast.jun":"Июн","broadcast.jul":"Июл","broadcast.aug":"Авг","broadcast.sep":"Сен","broadcast.oct":"Окт","broadcast.nov":"Ноя","broadcast.dec":"Дек","broadcast.quickStart":"Быстрый старт","broadcast.previewStart":"Предпросмотр и старт","broadcast.scheduleBroadcast":"Запланировать рассылку","broadcast.sent":"Отправлено","broadcast.failed":"Не удалось","broadcast.resume":"Возобновить","broadcast.pause":"Пауза","broadcast.stop":"Остановить","broadcast.resumeCampaign":"Возобновить кампанию?","broadcast.campaignInterrupted":"Кампания была прервана. Хотите возобновить?","broadcast.remaining":"Осталось","broadcast.contactsProcessed":"контактов обработано","broadcast.resumeCampaignBtn":"Возобновить кампанию","broadcast.cancelDiscard":"Отменить и удалить","broadcast.dismissRemindLater":"Отклонить (напомнить позже)","broadcast.broadcastScheduled":"Рассылка запланирована!","broadcast.campaignPreview":"Предпросмотр кампании","broadcast.messages":"Сообщения","broadcast.stepSettings":"Настройки","broadcast.stepActions":"Действия","broadcast.stepReview":"Обзор","broadcast.delayRange":"Диапазон задержки","broadcast.pauseAfterDuration":"Пауза после / Длительность","broadcast.checkConsole":"Проверьте консоль браузера для подробной конфигурации","broadcast.sendingQueue":"Очередь отправки","broadcast.broadcastReports":"Отчёты рассылки","broadcast.campaignHistory":"История кампаний","broadcast.noHistoryYet":"История рассылок пока пуста","broadcast.historyDescription":"Завершённые и запланированные рассылки появятся здесь","broadcast.noCampaignsYet":"Завершённых кампаний пока нет","broadcast.dateTime":"Дата и время","broadcast.status":"Статус","broadcast.scheduled":"Запланировано","broadcast.cancel":"Отменить","broadcast.running":"Выполняется","broadcast.cancelled":"Отменено","broadcast.downloadAllContacts":"Скачать все контакты","broadcast.downloadSentContacts":"Скачать отправленные контакты","broadcast.downloadFailedContacts":"Скачать неудачные контакты","broadcast.selectGroupsToAdd":"Выбрать группы для добавления контактов","broadcast.selectGroupsToRemove":"Выбрать группы для удаления контактов","broadcast.selectTabsToAdd":"Выбрать вкладки для добавления контактов","broadcast.selectTabsToRemove":"Выбрать вкладки для удаления контактов","broadcast.selectLabelsToAdd":"Выбрать метки для добавления контактов","broadcast.selectLabelsToRemove":"Выбрать метки для удаления контактов","broadcast.selectCRM":"Выбрать CRM","broadcast.selectStage":"Выбрать этап","broadcast.backToCRMs":"Назад к CRM","broadcast.loadingGroups":"Загрузка групп...","broadcast.loadingTabs":"Загрузка вкладок...","broadcast.loadingLabels":"Загрузка меток...","broadcast.noGroupsFound":"Группы, где вы администратор, не найдены","broadcast.noTabsFound":"Пользовательские вкладки не найдены. Сначала создайте вкладки.","broadcast.noLabelsFound":"Метки не найдены. Сначала создайте метки в WhatsApp.","broadcast.noCRMsFound":"CRM не найдены. Сначала создайте CRM.","broadcast.noStagesFound":"Этапы в этой CRM не найдены.","broadcast.tabsSelected":"вкладок выбрано","broadcast.labelsSelected":"меток выбрано","broadcast.confirmSelection":"Подтвердить выбор","broadcast.availableVariables":"Доступные переменные","broadcast.of":"из","broadcast.chats":"чатов","broadcast.remove":"Удалить","broadcast.allScheduledCampaigns":"Все запланированные кампании","broadcast.noScheduledCampaigns":"Нет запланированных кампаний","broadcast.scheduleFirstCampaign":"Запланируйте первую кампанию, чтобы увидеть её здесь","broadcast.createNewCampaign":"Создать новую кампанию","broadcast.oneTime":"Одноразово","broadcast.nextRun":"Следующий запуск","broadcast.runNow":"Запустить сейчас","broadcast.pauseCampaign":"Пауза","broadcast.editCampaign":"Редактировать","broadcast.deleteCampaign":"Удалить","broadcast.confirmDeleteScheduled":"Вы уверены, что хотите удалить эту запланированную кампанию?","broadcast.campaignStarting":"Кампания скоро начнётся","broadcast.skipNext":"Пропустить следующий","broadcast.unskipNext":"Не пропускать","broadcast.skippingNext":"Пропуск следующего","broadcast.lastRun":"Последний запуск","broadcast.runs":"запусков","broadcast.successRate":"успешно","broadcast.justNow":"только что","broadcast.inAMoment":"через мгновение","broadcast.ago":"назад","broadcast.in":"через","broadcast.uploadContacts":"Загрузить контакты","broadcast.stepSelect":"Выбрать","broadcast.stepMap":"Сопоставить","broadcast.stepUpload":"Загрузить","broadcast.uploadCSVImport":"Загрузите CSV файл для импорта контактов","broadcast.uploadCSVOnly":"Только CSV файлы (формат .csv)","broadcast.downloadSampleFile":"Скачать пример файла","broadcast.phoneNumberLabel":"Номер телефона:","broadcast.mapColumnHint":"сопоставьте колонку с данными 'Номер телефона'","broadcast.chooseExtraColumns":"Выберите дополнительные колонки для персонализированных сообщений.","broadcast.all":"Все","broadcast.none":"Ничего","broadcast.previous":"Назад","broadcast.next":"Далее","broadcast.removeUnwantedRows":"Удалить ненужные строки","broadcast.totalContacts":"Всего контактов","broadcast.startUpload":"Начать загрузку","broadcast.rows":"строк","broadcast.selectGroupsTitle":"Выбрать группы","broadcast.searchGroups":"Поиск групп...","broadcast.members":"участников","broadcast.groupsSelectedCount":"групп выбрано","broadcast.addGroupsBtn":"Добавить группы","broadcast.tooltipBold":"Жирный","broadcast.tooltipItalic":"Курсив","broadcast.tooltipStrikethrough":"Зачёркнутый","broadcast.tooltipAddMedia":"Добавить медиа","broadcast.tooltipRefresh":"Обновить","broadcast.noCompletedCampaigns":"Пока нет завершённых кампаний","kanban.title":"CRM КАНБАН","kanban.user":"Пользователь","kanban.darkMode":"Тёмный режим","kanban.lightMode":"Светлый режим","kanban.menu":"Меню","kanban.createCRM":"Создать CRM","kanban.addStage":"Добавить этап","kanban.analytics":"Аналитика","kanban.sync":"Синхронизация","kanban.cannotAddStages":"Нельзя добавить этапы в CRM меток WhatsApp","kanban.inbox":"ВХОДЯЩИЕ","kanban.unread":"Непрочит.","kanban.pinned":"Закреплён.","kanban.groups":"Группы","kanban.stages":"этапов","kanban.chats":"чатов","kanban.searchInbox":"Поиск во входящих...","kanban.searchContacts":"Поиск...","kanban.stageOptions":"Опции этапа","kanban.renameStage":"Переименовать","kanban.clearSearch":"Очистить поиск","kanban.noChatsMatch":"Нет подходящих чатов","kanban.noChatsYet":"Пока нет чатов","kanban.filterUnread":"Фильтр непрочитанных","kanban.filterPinned":"Фильтр закреплённых","kanban.filterGroups":"Фильтр групповых чатов","kanban.addNewStage":"Добавить новый этап","kanban.noCRMsFound":"CRM не найдены","kanban.selectCRM":"Выберите CRM из меню","kanban.loading":"Загрузка Kanban CRM...","kanban.syncingLabels":"Синхронизация меток WhatsApp и вкладок...","kanban.switchCRM":"Сменить CRM","kanban.createNewCRM":"Создать новый CRM","kanban.enterCRMName":"Введите название CRM...","kanban.addNewStageTitle":"Добавить новый этап","kanban.enterStageName":"Введите название этапа...","kanban.editStage":"Редактировать этап","kanban.editStageName":"Изменить название этапа","kanban.deleteStage":"Удалить этап","kanban.editCRM":"Редактировать CRM","kanban.deleteCRM":"Удалить CRM","kanban.confirmDeleteStage":"Вы уверены? Чаты будут перемещены во входящие.","kanban.cannotDeleteInbox":"Нельзя удалить этап входящих.","kanban.cannotAddStagesLabels":"Нельзя добавить этапы в CRM меток. Метки синхронизируются из WhatsApp.","kanban.chatsLoadedSuccess":"Чаты успешно загружены!","kanban.failedLoadChats":"Не удалось загрузить чаты. Убедитесь, что вы на WhatsApp Web.","kanban.noAvailableChats":"Нет доступных чатов.","kanban.enterNewCRMName":"Введите новое название CRM:","kanban.name":"Имя","kanban.phone":"Телефон","kanban.lastMessage":"Последнее сообщение","kanban.noMessages":"Нет сообщений","kanban.unreadCount":"Непрочитано","kanban.type":"Тип","kanban.groupChat":"Групповой чат","kanban.individualChat":"Личный чат","kanban.status":"Статус","kanban.dealValue":"Сумма сделки (RUB)","kanban.enterDealValue":"Введите сумму","kanban.notes":"Заметки","kanban.addNotes":"Добавить заметки о чате...","kanban.justNow":"Только что","kanban.group":"Группа","kanban.muted":"Без звука","kanban.save":"Сохранить","kanban.cancel":"Отмена","kanban.close":"Закрыть","kanban.analyticsTitle":"Панель аналитики","kanban.analyticsSubtitle":"Метрики производительности воронки","kanban.exportCSV":"Экспорт CSV","kanban.exportPDF":"Экспорт PDF","kanban.noAnalyticsData":"Нет данных аналитики","kanban.from":"С:","kanban.to":"По:","kanban.totalChats":"Всего чатов","kanban.pipelineValue":"Стоимость воронки","kanban.activeStages":"Активные этапы воронки","kanban.stagePerformance":"Эффективность этапов","kanban.stage":"Этап","kanban.value":"Значение","kanban.avgTime":"Сред. время","kanban.conversion":"Конверсия","kanban.chatDistribution":"Распределение чатов","kanban.allTime":"Всё время","kanban.today":"Сегодня","kanban.last7Days":"Последние 7 дней","kanban.last30Days":"Последние 30 дней","kanban.allowPopups":"Пожалуйста, разрешите всплывающие окна для экспорта PDF","kanban.addSampleChat":"Добавить пример чата","kanban.crmName":"Название CRM","kanban.stageName":"Название этапа","kanban.saveChanges":"Сохранить изменения","kanban.createFirstCRM":"Создайте свою первую CRM, чтобы начать организацию чатов WhatsApp.","kanban.noStagesFound":"В этой CRM этапы не найдены.","kanban.syncOrAddStages":"Синхронизируйте данные из WhatsApp или добавьте пользовательские этапы.","kanban.chatDetails":"Детали чата","kanban.notAvailable":"Н/Д","kanban.addNotesPlaceholder":"Добавить заметки об этом чате...","kanban.thisWeek":"на этой неделе","kanban.avg":"Сред","kanban.stagesLabel":"Этапы","kanban.activePipelineStages":"Активные этапы воронки","kanban.customRange":"Произвольный период","kanban.dateRange":"Диапазон дат","kanban.confirmDeleteCrm":"Вы уверены, что хотите удалить этот CRM? Все этапы и чаты будут удалены.","kanban.openInWhatsApp":"Открыть в WhatsApp","kanban.removeFromStage":"Удалить из этапа","kanban.openCRM":"Открыть CRM","kanban.addNote":"Добавить заметку","kanban.scheduleMessage":"Запланировать сообщение","kanban.addIncome":"Добавить доход","kanban.whatsappNotOpen":"WhatsApp Web не открыт. Пожалуйста, сначала откройте WhatsApp Web.","kanban.failedToOpenChat":"Не удалось открыть чат в WhatsApp","kanban.removeFromStageConfirm":"Вы уверены, что хотите удалить этот чат из текущего этапа?","kanban.failedToRemove":"Не удалось удалить чат из этапа","kanban.failedToOpenCRM":"Не удалось открыть CRM","kanban.chatPopup":"Чат","kanban.typeMessage":"Введите сообщение...","kanban.sendMessage":"Отправить","kanban.loadingMessages":"Загрузка сообщений...","kanban.failedToLoadMessages":"Не удалось загрузить сообщения","kanban.failedToSendMessage":"Не удалось отправить сообщение","kanban.yesterday":"Вчера","kanban.refresh":"Обновить","kanban.loadingMedia":"Загрузка...","kanban.clickToLoad":"Нажмите для загрузки","kanban.addToStage":"Добавить в этап CRM","kanban.selectCrmStage":"Выбрать CRM и этап","kanban.retry":"Повторить","kanban.attach":"Прикрепить файл","kanban.addCaption":"Добавить подпись...","kanban.audioMessage":"Голосовое сообщение","kanban.document":"Документ","kanban.location":"Местоположение","kanban.contact":"Контакт","kanban.quickReply":"Быстрый ответ","kanban.fluxo":"Флоксо","kanban.more":"ещё","kanban.showLess":"Показать меньше","kanban.noQuickReplies":"Нет быстрых ответов","kanban.noFluxos":"Нет активных потоков","kanban.users":"Пользователи","kanban.usersBreakdown":"Разбивка по пользователям","kanban.searchUsers":"Поиск пользователей по имени или номеру...","kanban.noUsersFound":"Пользователи не найдены","kanban.tryDifferentSearch":"Попробуйте другой поисковый запрос","kanban.crm":"CRM","kanban.tabs":"Вкладки","kanban.labels":"Метки","kanban.crmBreakdown":"Разбивка по этапам CRM","kanban.tabsBreakdown":"Разбивка по вкладкам","kanban.labelsBreakdown":"Разбивка по меткам","kanban.noDataFound":"Данные не найдены","kanban.addDataToSeeAnalytics":"Добавьте данные о доходах/расходах контактам для просмотра аналитики","kanban.incomeVsExpense":"Доход и расход по","kanban.contacts":"контакты","kanban.netProfit":"ЧИСТАЯ ПРИБЫЛЬ","kanban.crmProfit":"Прибыль CRM","kanban.tabsProfit":"Прибыль вкладок","kanban.labelsProfit":"Прибыль меток","kanban.profitDistribution":"Распределение прибыли","kanban.sourceComparison":"Сравнение источников","kanban.totalContacts":"Всего контактов","kanban.avgPerSource":"Среднее на источник","kanban.loadingMore":"Загрузка...","kanban.allChatsLoaded":"Все чаты загружены","kanban.dragToReorder":"Перетащите для изменения порядка","crm.categoryBreakdown":"Разбивка по категориям","crm.incomeByCategory":"Доход по категории","crm.expenseByCategory":"Расход по категории","crm.paymentMethodBreakdown":"Разбивка по способу оплаты","crm.incomeByPayment":"Доход по способу оплаты","crm.expenseByPayment":"Расход по способу оплаты","crm.userWiseBreakdown":"Разбивка по пользователям","crm.net":"Нетто","crm.transactions":"Транзакции","crm.margin":"Маржа","crm.netProfit":"Чистая прибыль","chart.income":"Доход","chart.expense":"Расход","chart.profit":"Прибыль","chart.noDataAvailable":"Данные недоступны","chart.noProfitData":"Данные о прибыли недоступны","chart.noTrendData":"Данные о тенденциях недоступны","bulkValidator.title":"Массовая Проверка Номеров","bulkValidator.subtitle":"Проверяйте номера WhatsApp массово с помощью кампаний","bulkValidator.menu":"Меню","bulkValidator.activeCampaigns":"Активные Кампании","bulkValidator.completed":"Завершённые","bulkValidator.noActiveCampaigns":"Нет активных кампаний. Начните новую, чтобы проверить номера.","bulkValidator.noCompleted":"Пока нет завершённых кампаний.","bulkValidator.createHint":"Загрузите CSV с номерами и запустите проверку.","bulkValidator.newCampaign":"Новая Кампания Проверки","bulkValidator.createCampaign":"Создать Новую Кампанию","bulkValidator.campaignName":"Название Кампании","bulkValidator.enterCampaignName":"Введите название кампании","bulkValidator.countryCode":"Код Страны","bulkValidator.countryCodeHint":"Выберите код страны для номеров без префикса","bulkValidator.uploadCSV":"Загрузить CSV Файл","bulkValidator.csvHint":"CSV файл с номерами телефонов (один на строку или через запятую)","bulkValidator.numbersFound":"номеров найдено","bulkValidator.enterNameAndUpload":"Пожалуйста, введите название кампании и загрузите номера","bulkValidator.createAndStart":"Создать Кампанию","bulkValidator.campaigns":"Кампании","bulkValidator.noCampaigns":"Кампаний пока нет. Создайте одну, чтобы начать проверку номеров.","bulkValidator.confirmDelete":"Вы уверены, что хотите удалить эту кампанию?","bulkValidator.valid":"Действительный","bulkValidator.invalid":"Недействительный","bulkValidator.pending":"Ожидание","bulkValidator.start":"Начать","bulkValidator.pause":"Пауза","bulkValidator.downloadValid":"Скачать Действительные Номера","bulkValidator.downloadInvalid":"Скачать Недействительные Номера","bulkValidator.downloadAll":"Скачать Все","bulkValidator.all":"Все","tools.allTools":"Все инструменты","tools.subtitle":"Нажмите, чтобы открыть • Перетащите в шапку, чтобы закрепить","tools.featureSettings":"Настройки функций","tools.pinnedTooltip":"Закреплено в шапке (перетащите в «Инструменты», чтобы открепить)","tools.itemTooltip":"{name} — нажмите, чтобы открыть, или перетащите в шапку, чтобы закрепить","tools.category.communication":"Коммуникации","tools.category.management":"Управление","tools.category.automation":"Автоматизация","tools.category.validation":"Проверка","webhook.title":"Вебхуки","webhook.subtitle":"Отправка данных контактов в другое приложение после выполнения зарегистрированных событий","webhook.events":"события","webhook.quickResponses":"Быстрые ответы","webhook.appointment":"Встреча","webhook.reminder":"Напоминание","webhook.contactProfile":"Профиль контакта","webhook.notes":"Заметки","webhook.income":"Доход","webhook.expense":"Расход","webhook.kanban":"Канбан","webhook.labels":"Метки","webhook.customTabs":"Пользовательские вкладки","webhook.messages":"Сообщения","webhook.todos":"Список задач","webhook.webhookData":"Данные WebHook","webhook.webhookUrl":"URL WebHook","webhook.enterUrl":"Введите URL назначения здесь","webhook.active":"Активен","webhook.dataToSend":"Данные для отправки","webhook.lastUploads":"Последние загрузки (максимум 30 просмотров)","webhook.noUploads":"Загрузок пока нет","webhook.close":"Закрыть","webhook.save":"Сохранить","webhook.saving":"Сохранение...","webhook.field.eventDetails":"Детали события","webhook.field.number":"Номер","webhook.field.name":"Имя","webhook.field.picture":"Фото","webhook.field.labels":"Метки","webhook.field.contactProfile":"Профиль контакта","webhook.field.appointmentTime":"Время встречи","webhook.field.meetingLink":"Ссылка на встречу","webhook.field.reminderTopic":"Тема напоминания","webhook.field.reminderTime":"Время напоминания","webhook.field.reminderDetails":"Детали напоминания","webhook.field.email":"Электронная почта","webhook.field.gender":"Пол","webhook.field.dateOfBirth":"Дата рождения","webhook.field.address":"Адрес","webhook.field.details":"Детали","webhook.field.customFields":"Пользовательские поля","webhook.field.noteTopic":"Тема заметки","webhook.field.noteContent":"Содержание заметки","webhook.field.noteTimestamp":"Временная метка заметки","webhook.field.amount":"Сумма","webhook.field.category":"Категория","webhook.field.paymentMethod":"Способ оплаты","webhook.field.description":"Описание","webhook.field.reference":"Ссылка/Счет","webhook.field.referenceBill":"Ссылка/Накладная","webhook.field.transactionDate":"Дата транзакции","webhook.field.status":"Статус","webhook.field.cardTitle":"Название карточки","webhook.field.columnName":"Столбец/Этап","webhook.field.cardDescription":"Описание карточки","webhook.field.labelId":"ID метки","webhook.field.labelName":"Имя метки","webhook.field.labelColor":"Цвет метки","webhook.field.allLabels":"Все метки контакта","webhook.field.tabId":"ID вкладки","webhook.field.tabName":"Имя вкладки","webhook.field.tabColor":"Цвет вкладки","webhook.field.allTabs":"Все вкладки контакта","webhook.field.direction":"Направление (входящее/исходящее)","webhook.field.messageContent":"Содержание сообщения","webhook.field.messageType":"Тип сообщения","webhook.field.messageId":"ID сообщения","webhook.field.mediaUrl":"URL медиа","webhook.field.quotedMessage":"Цитируемое сообщение","webhook.field.timestamp":"Временная метка","webhook.field.ctwaData":"Данные Meta Ads (CTWA)","webhook.field.todoTitle":"Название задачи","webhook.field.todoDescription":"Описание задачи","webhook.field.todoDueDate":"Срок выполнения","webhook.field.todoPriority":"Приоритет","webhook.field.todoCategory":"Категория","webhook.field.todoStatus":"Статус","webhook.field.todoSubtasks":"Подзадачи","api.configureAPI":"Настроить API","api.manageToken":"Управление токеном API и настройками","api.apiToken":"Токен API","api.generateToken":"Сгенерировать токен","api.regenerate":"Перегенерировать","api.generating":"Генерация...","api.copyToken":"Копировать токен","api.tokenWarning":"Храните этот токен в секрете. Любой, кто имеет к нему доступ, может отправлять сообщения от вашего имени.","api.enableAPI":"Включить API","api.apiIsEnabled":"API в настоящее время включен","api.apiIsDisabled":"API в настоящее время отключен","api.openDocumentation":"Открыть документацию","api.queuePolling":"Опрос очереди","api.pollingActive":"Проверка сообщений в очереди каждые 5 минут","api.pollingInactive":"Включите для обработки входящих сообщений API","audioTranscribe.title":"Транскрипция","audioTranscribe.transcribeAudio":"Транскрибировать аудио","audioTranscribe.copy":"Копировать","audioTranscribe.copied":"Скопировано!","audioTranscribe.translate":"Перевести","audioTranscribe.translating":"Перевод...","audioTranscribe.translated":"Переведено!","audioTranscribe.original":"Оригинал:","audioTranscribe.translatedLabel":"Переведено","audioTranscribe.close":"Закрыть","audioTranscribe.requiresChatGPT":"Для транскрипции аудио требуется API-ключ ChatGPT. Настройте ChatGPT как провайдера ИИ в настройках.","audioTranscribe.audioNotFound":"Не удалось найти URL аудио. Аудио может быть недоступно.","audioTranscribe.transcriptionFailed":"Ошибка транскрипции","audioTranscribe.configureAI":"Сначала настройте параметры ИИ для использования перевода.","audioTranscribe.translationFailed":"Ошибка перевода","audioTranscribe.translationTimeout":"Время ожидания перевода истекло. Попробуйте ещё раз.","aiBot.title":"ИИ-бот","aiBot.tab.testChat":"Тестовый чат","aiBot.tab.qaPairs":"Пары вопросов и ответов","aiBot.tab.aiBehavior":"Поведение ИИ","aiBot.tab.trainingData":"Данные обучения","aiBot.tab.escalation":"Эскалация","aiBot.tab.dataPreview":"Предпросмотр данных","aiBot.tab.actionPrompts":"Подсказки действий","aiBot.tab.scheduleTiming":"Расписание и время","aiBot.tab.trainingDataComingSoon":"Загрузка документов, парсинг URL и источники простого текста появятся в следующем обновлении.","aiBot.tab.escalationComingSoon":"Автоматическая передача человеку после настраиваемого числа неотвеченных сообщений появится в следующем обновлении.","aiBot.tab.dataPreviewComingSoon":"Обзор только для чтения каждой пары вопросов и ответов, источника и фрагмента, к которым имеет доступ ИИ.","aiBot.comingSoon":"Скоро","aiBot.qa.addPair":"Добавить пару","aiBot.qa.editPair":"Редактировать пару","aiBot.qa.questionLabel":"Вопрос","aiBot.qa.questionPlaceholder":"Что могут спросить клиенты…","aiBot.qa.answerLabel":"Ответ","aiBot.qa.answerPlaceholder":"Как должен ответить ИИ…","aiBot.qa.categoryLabel":"Категория (необязательно)","aiBot.qa.categoryPlaceholder":"напр. Цены, Поддержка, Адаптация","aiBot.qa.existingPairs":"Существующие пары","aiBot.qa.empty":"Пока нет пар. Добавьте первую выше.","aiBot.qa.cancel":"Отмена","aiBot.qa.update":"Обновить","aiBot.qa.delete":"Удалить","aiBot.qa.edit":"Редактировать","aiBot.qa.enabled":"Включено","aiBot.qa.disabled":"Отключено","aiBot.qa.on":"Вкл.","aiBot.qa.off":"Выкл.","aiBot.qa.deleteConfirm":"Удалить эту пару?","aiBot.qa.itemSingular":"пара","aiBot.qa.itemPlural":"пар","aiBot.behavior.providerConfig":"Поставщик ИИ","aiBot.behavior.provider":"Поставщик","aiBot.behavior.model":"Модель","aiBot.behavior.apiActive":"API активен","aiBot.behavior.noApiKey":"Нет API-ключа","aiBot.behavior.apiKeyHint":"Добавьте свой API-ключ в настройках инструментов ИИ, чтобы активировать бота.","aiBot.behavior.triggerWords":"Триггерные слова","aiBot.behavior.triggerWordsPlaceholder":"поддержка, помощь, демо (через запятую)","aiBot.behavior.triggerWordsHelp":"Когда установлены, бот отвечает только на сообщения, содержащие хотя бы одно из этих слов. Оставьте пустым, чтобы отвечать на всё.","aiBot.behavior.responseSettings":"Настройки ответа","aiBot.behavior.responseTone":"Тон ответа","aiBot.behavior.maxResponseLength":"Макс. длина ответа","aiBot.behavior.temperature":"Температура","aiBot.behavior.temperatureHelp":"Ниже = более сфокусированно. Выше = более креативно.","aiBot.behavior.maxTokens":"Макс. токены","aiBot.behavior.maxTokensHelp":"Ограничивает размер ответа ИИ.","aiBot.behavior.systemPrompt":"Деловой контекст / Системная подсказка","aiBot.behavior.systemPromptPlaceholder":"Расскажите ИИ о вашем бизнесе, продуктах и о том, как он должен вас представлять…","aiBot.behavior.systemPromptHelp":"Используется как основная инструкция для каждого ответа ИИ.","aiBot.behavior.fallbackMessage":"Резервное сообщение","aiBot.behavior.fallbackMessageHelp":"Отправляется, когда у ИИ нет подходящей пары вопросов и ответов, источника или общих знаний для ответа.","aiBot.behavior.saved":"✓ Сохранено","aiBot.behavior.saveBehavior":"Сохранить поведение","aiBot.behavior.tone_friendly":"Дружелюбный","aiBot.behavior.tone_professional":"Профессиональный","aiBot.behavior.tone_casual":"Непринуждённый","aiBot.behavior.tone_formal":"Формальный","aiBot.behavior.tone_empathetic":"Эмпатичный","aiBot.behavior.length_short":"Короткий (~50 слов)","aiBot.behavior.length_medium":"Средний (~200 слов)","aiBot.behavior.length_long":"Длинный (~400 слов)","aiBot.kb.urlTitle":"Добавить URL веб-сайта","aiBot.kb.urlPlaceholder":"https://example.com/about","aiBot.kb.addUrl":"Добавить URL","aiBot.kb.scraping":"Получение…","aiBot.kb.urlHelp":"Мы получаем страницу и извлекаем её видимый текст. Только одна страница — JS-рендеринговые SPA могут вернуть мало содержимого.","aiBot.kb.errorEmpty":"По этому URL не найден читаемый текст.","aiBot.kb.errorBlocked":'Не удалось получить доступ к этому URL. Сайт может блокировать автоматизированные запросы, требовать вход или быть JS-рендеринговым. Попробуйте скопировать текст в "Вставить простой текст" ниже.',"aiBot.kb.blockedChromeStore":'Chrome Web Store блокирует автоматизированные запросы. Откройте список в браузере, скопируйте описание и вставьте в "Вставить простой текст" ниже.',"aiBot.kb.blockedGoogle":"Страницы Google Docs / Drive / Sheets требуют входа и не могут быть получены. Экспортируйте в PDF/DOCX/TXT и загрузите.","aiBot.kb.blockedSocial":'Социальные сети блокируют автоматизированные запросы. Скопируйте соответствующий текст и вставьте в "Вставить простой текст" ниже.',"aiBot.kb.blockedNotion":"Страницы Notion JS-рендеринговые и возвращают мало текста. Экспортируйте страницу как Markdown/PDF и загрузите.","aiBot.kb.plainTextTitle":"Вставить простой текст","aiBot.kb.textTitlePlaceholder":'Заголовок (необязательно, напр. "Политика возврата")',"aiBot.kb.textBodyPlaceholder":"Вставьте любой текст, который должен знать ИИ — цены, FAQ, политики, инструкции…","aiBot.kb.charsLabel":"симв.","aiBot.kb.saveText":"Сохранить текст","aiBot.kb.saving":"Сохранение…","aiBot.kb.trainingSources":"Источники обучения","aiBot.kb.sourceSingular":"источник","aiBot.kb.sourcePlural":"источников","aiBot.kb.chunkSingular":"фрагмент","aiBot.kb.chunkPlural":"фрагментов","aiBot.kb.empty":"Пока нет источников обучения. Добавьте URL или вставьте простой текст выше.","aiBot.kb.deleteConfirm":"Удалить этот источник?","aiBot.kb.uploadTitle":"Загрузить документы","aiBot.kb.uploadPrompt":"Нажмите, чтобы выбрать файл, или перетащите сюда","aiBot.kb.uploadFormats":"PDF, DOCX, TXT, CSV, MD","aiBot.kb.uploadMaxSize":"Макс. 10 МБ на файл","aiBot.kb.parsing":"Обработка…","aiBot.kb.parsingFile":"Обработка","aiBot.esc.enableAuto":"Включить авто-эскалацию","aiBot.esc.enableAutoDesc":"Автоматически передавать человеку, когда ИИ не может помочь или клиент просит об этом.","aiBot.esc.maxAttempts":"Макс. неудачных попыток","aiBot.esc.maxAttemptsHelp":"Передача после такого количества последовательных резервных ответов (24-часовое окно).","aiBot.esc.triggerPhrases":"Триггерные фразы (по одной в строке)","aiBot.esc.triggerPhrasesHelp":"Когда любая из этих фраз появляется во входящем сообщении, бот эскалирует немедленно. Поиск подстроки без учёта регистра.","aiBot.esc.message":"Сообщение эскалации","aiBot.esc.messageHelp":"Отправляется клиенту прямо перед тем, как бот перестанет отвечать, чтобы человек мог принять управление.","aiBot.esc.saveRules":"Сохранить правила эскалации","aiBot.esc.statusOn":"Вкл","aiBot.esc.statusOff":"Выкл","aiBot.preview.qaPairsLabel":"Пары вопросов и ответов","aiBot.preview.sourcesLabel":"Источники","aiBot.preview.chunksLabel":"Фрагменты","aiBot.preview.helpText":"Это именно то, к чему ИИ имеет доступ прямо сейчас. Отключённые элементы не используются.","aiBot.preview.escalationSummary":"Эскалация","aiBot.preview.escStatus":"Статус","aiBot.preview.escThreshold":"После","aiBot.preview.escFailed":"последовательных резервных ответов","aiBot.preview.escPhrases":"Триггерные фразы","aiBot.preview.escNoPhrases":"нет","aiBot.preview.qaPairsTitle":"Пары вопросов и ответов","aiBot.preview.sourcesTitle":"Источники обучения","aiBot.preview.noQa":"Нет включённых пар.","aiBot.preview.noSources":"Нет включённых источников.","aiBot.fallbackMoved":"Резервный ответ перемещён на вкладку «Поведение ИИ». Ваше существующее сообщение сохраняется автоматически.","aiBot.businessPromptMoved":"Бизнес-подсказка перемещена на вкладку «Поведение ИИ». Редактируйте её там — ваша существующая подсказка сохраняется.","aiBot.generalKnowledgeMoved":"Переключатель «Разрешить ИИ использовать общие знания» перемещён на вкладку «Поведение ИИ».","aiBot.stopKeywordsRecommend":"Для новых настроек рекомендуем вкладку «Эскалация» — она добавляет счётчик попыток и триггерные фразы поверх остановок по ключевым словам. Этот раздел по-прежнему работает только для остановок по ключевым словам.","aiBot.subtitle":"Настройка автоматических ответов ИИ","aiBot.menu":"Меню","aiBot.enableBot":"Включить ИИ-бот","aiBot.enableBotDesc":"Автоматически отвечать на входящие сообщения","aiBot.replyInGroups":"Отвечать в группах","aiBot.replyInGroupsDesc":"Разрешить ИИ-боту отвечать в групповых чатах (по умолчанию отключено)","aiBot.allowGeneralKnowledge":"Разрешить ИИ использовать общие знания","aiBot.allowGeneralKnowledgeDesc":"Когда ВЫКЛЮЧЕНО, ИИ отвечает только на основе вашего бизнес-промпта. Когда ВКЛЮЧЕНО, ИИ также может использовать свои общие знания.","aiBot.fallbackReply":"Резервный ответ","aiBot.fallbackReplyDesc":"Когда у ИИ нет информации в вашем бизнес-промпте, он отправит этот ответ вместо придуманных ответов.","aiBot.fallbackReplyPlaceholder":"Пример: Спасибо за ваш вопрос! У меня нет конкретной информации по этому поводу. Наша команда скоро свяжется с вами.","aiBot.smartDetection":"Умное обнаружение","aiBot.smartDetectionDesc":"ИИ автоматически определяет разочарование или запросы на помощь человека","aiBot.monday":"Понедельник","aiBot.tuesday":"Вторник","aiBot.wednesday":"Среда","aiBot.thursday":"Четверг","aiBot.friday":"Пятница","aiBot.saturday":"Суббота","aiBot.sunday":"Воскресенье","aiBot.enableWeekdays":"Включить будни","aiBot.disableWeekdays":"Отключить будни","aiBot.enableWeekends":"Включить выходные","aiBot.disableWeekends":"Отключить выходные","aiBot.applyToAll":"Применить ко всем:","aiBot.apply":"Применить","aiBot.day":"День","aiBot.active":"Активен","aiBot.currentStatus":"Текущий статус:","aiBot.botOffToday":"Бот ВЫКЛЮЧЕН сегодня","aiBot.businessPrompt":"Бизнес-промпт","aiBot.businessPromptDesc":"Настройте стиль ответов ИИ. Опишите ваш бизнес, тон и рекомендации.","aiBot.businessPromptPlaceholder":"Пример: Вы представитель службы поддержки [Название компании]. Мы продаём [продукт/услугу]. Будьте дружелюбны и профессиональны.","aiBot.schedule":"Часы работы бота","aiBot.scheduleEnabled":"Включить расписание","aiBot.scheduleEnabledDesc":"Бот отвечает только в указанные дни и время","aiBot.startTime":"Время начала","aiBot.endTime":"Время окончания","aiBot.to":"до","aiBot.timezone":"Часовой пояс","aiBot.replyTiming":"Время ответа","aiBot.replyTimingDesc":"Случайная задержка перед ответом ИИ","aiBot.minDelay":"Мин. задержка (сек.)","aiBot.maxDelay":"Макс. задержка (сек.)","aiBot.enabledActions":"Включённые действия","aiBot.enabledActionsDesc":"Выберите действия, которые может выполнять ИИ","aiBot.actionNormalReply":"Отправить ответ","aiBot.actionNormalReplyDesc":"ИИ отправляет текстовые сообщения","aiBot.actionKanban":"Обновить Kanban","aiBot.actionKanbanDesc":"Перемещать контакты между этапами Kanban","aiBot.actionLabels":"Обновить метки","aiBot.actionLabelsDesc":"Добавлять/удалять метки WhatsApp","aiBot.actionTabs":"Обновить вкладки","aiBot.actionTabsDesc":"Добавлять/удалять из пользовательских вкладок","aiBot.actionAppointment":"Создать встречу","aiBot.actionAppointmentDesc":"Планировать встречи из разговоров","aiBot.tabsPromptLabel":"Пользовательские инструкции для управления вкладками:","aiBot.tabsPromptPlaceholder":'Например: Если пользователь спрашивает об услугах SEO, добавить во вкладку "SEO Лиды"...',"aiBot.meetingLinkLabel":"Ссылка Google Meet:","aiBot.meetingLinkPlaceholder":"https://meet.google.com/xxx-xxxx-xxx","aiBot.meetingLinkDesc":"Эта ссылка будет использоваться для всех встреч, созданных ИИ","aiBot.messageTemplateLabel":"Шаблон сообщения:","aiBot.messageTemplateDesc":"Это сообщение будет отправлено как напоминание о встрече","aiBot.varName":"Имя","aiBot.varDate":"Дата","aiBot.varTime":"Время","aiBot.varLink":"Ссылка","aiBot.messageTemplatePlaceholder":"Здравствуйте {name}, ваша встреча запланирована на {date} в {time}. Присоединиться здесь: {link}","aiBot.officeHoursLabel":"Рабочие часы (время встреч):","aiBot.officeHoursDesc":"ИИ будет планировать встречи только в эти часы","aiBot.sendMessageNow":"Отправить сообщение сразу","aiBot.sendMessageNowDesc":"Отправить сообщение о встрече сразу после создания","aiBot.appointmentPromptLabel":"Пользовательские инструкции ИИ:","aiBot.appointmentPromptPlaceholder":"Например: При планировании встреч всегда предлагайте время между 10:00 - 18:00...","aiBot.actionProfile":"Обновить профиль","aiBot.actionProfileDesc":"Извлекать и сохранять контактную информацию","aiBot.contextMessages":"Сообщения контекста","aiBot.contextMessagesDesc":"Количество предыдущих сообщений для контекста ИИ","aiBot.settingsTab":"Настройки","aiBot.promptSettings":"Настройки промпта","aiBot.actionPrompts":"Промпты действий","aiBot.actionPromptsDesc":"Настройте пользовательские промпты для различных действий ИИ","aiBot.talkToAI":"Поговорить с ИИ","aiBot.testYourBot":"Протестируйте ИИ-бота","aiBot.testDescription":"Сообщения используют текущие настройки (включая несохранённые изменения)","aiBot.clearChat":"Очистить чат","aiBot.typeTestMessage":"Введите тестовое сообщение...","aiBot.aiTyping":"ИИ печатает...","aiBot.noMessages":"Введите сообщение, чтобы проверить ответ ИИ-бота","aiBot.send":"Отправить","aiBot.copy":"Копировать","aiBot.copied":"Скопировано!","aiBot.select":"Выделить","aiBot.aiNotConfigured":"ИИ не настроен. Сначала настройте API-ключ ИИ.","aiBot.noResponse":"Нет ответа от ИИ","aiBot.stopKeywords":"Стоп-слова","aiBot.stopKeywordsInfo":"Когда клиент отправляет любое из этих слов, ИИ-бот прекратит отвечать и добавит его в чёрный список.","aiBot.enableStopKeywords":"Включить стоп-слова","aiBot.enableStopKeywordsDesc":"Автоматически останавливать ИИ-бота, когда клиент запрашивает помощь человека","aiBot.keywords":"Ключевые слова","aiBot.noKeywords":"Ключевые слова ещё не добавлены","aiBot.enterKeyword":"Введите ключевое слово...","aiBot.add":"+ Добавить","aiBot.stopMessage":"Сообщение при остановке","aiBot.stopMessagePlaceholder":"Сообщение, отправляемое при обнаружении стоп-слова...","aiBot.stopMessageHint":"Это сообщение будет отправлено клиенту при обнаружении стоп-слова.","aiBot.responseMode":"Режим ответа:","aiBot.aiBotPrompt":"Промпт ИИ-бота","aiBot.globalChatGPT":"Глобальный ChatGPT","aiBot.newChat":"Новый чат","aiBot.clearAll":"Очистить всё","aiBot.searchChats":"Поиск чатов...","aiBot.noSearchResults":"Чаты не найдены","aiBot.noChatsYet":"Пока нет истории чатов","aiBot.deleteChat":"Удалить чат","aiBot.chatsStored":"чатов сохранено","aiBot.clearAllTitle":"Очистить все чаты?","aiBot.clearAllDesc":"Это навсегда удалит всю историю чатов. Это действие нельзя отменить.","aiBot.messages":"сообщений","aiBot.today":"Сегодня","aiBot.yesterday":"Вчера","crm.aiBotBlacklist":"ИИ-бот","crm.aiBotEnabled":"Включён для этого контакта","crm.aiBotDisabled":"Отключён для этого контакта","common.saved":"Сохранено","crm.chatbotFlow":"Поток чат-бота","crm.chatbotFlowDesc":"Создание автоответчиков по ключевым словам","crm.chatbotFlows":"Потоки чат-ботов","crm.exportFlows":"Экспорт","crm.importFlows":"Импорт","crm.exportAll":"Экспортировать все","crm.exportSelected":"Экспортировать выбранные","crm.selectFlowsToExport":"Выберите потоки для экспорта","crm.importSuccess":"Потоки успешно импортированы!","crm.importError":"Ошибка при импорте потоков","crm.invalidFlowFile":"Неверный формат файла потока","crm.duplicateFlowFound":"Найден дубликат потока","crm.flowAlreadyExists":"'{name}' уже существует. Что вы хотите сделать?","crm.replaceFlow":"Заменить","crm.skipFlow":"Пропустить","crm.renameAndAdd":"Переименовать и добавить","crm.noFlowsSelected":"Пожалуйста, выберите хотя бы один поток","crm.noFlowsToExport":"Нет потоков для экспорта","crm.flowsExported":"Экспортировано {count} поток(ов)","crm.flowsImported":"Импортировано {count} поток(ов)","crm.selected":"выбрано","crm.deleteFlowConfirm":"Вы уверены, что хотите удалить этот поток?","crm.createNewFlow":"Создать новый поток","crm.noFlowsYet":"Потоков пока нет","crm.createFirstFlow":"Создайте свой первый поток чат-бота","crm.active":"Активный","crm.inactive":"Неактивный","crm.enabled":"Включён","crm.allFlows":"Все","crm.byCategory":"Категории","crm.viewAllFlows":"Просмотреть все потоки","crm.viewByCategory":"Просмотр по категориям","crm.addFluxoCategory":"Добавить категорию","crm.manageCategories":"Управление категориями","crm.editCategory":"Редактировать категорию","crm.createCategory":"Создать категорию","crm.createCategoryBtn":"Создать категорию","crm.fluxoCategoryName":"Название","crm.categoryIcon":"Иконка","crm.categoryColor":"Цвет","crm.preview":"Предпросмотр","crm.custom":"Свой","crm.enterFluxoCategoryName":"Введите название категории","crm.fluxoCategoryNameRequired":"Название категории обязательно","crm.fluxoCategoryNameExists":"Категория с таким названием уже существует","crm.confirmDeleteCategory":"Удалить эту категорию? Потоки будут перемещены в Без категории.","crm.uncategorized":"Без категории","crm.noFlowsInCategory":"Нет потоков в этой категории","crm.dragFlowsHere":"Перетащите потоки сюда для организации","crm.dropHere":"Отпустите здесь","crm.dragToMove":"Перетащите для перемещения","crm.noCategoriesYet":"Категорий пока нет","crm.createCategoryHint":"Создайте категорию для организации ваших потоков","crm.createFirstCategory":"Создать первую категорию","crm.tourViewToggleTitle":"Переключение вида","crm.tourViewToggleContent":"Переключайтесь между просмотром всех потоков и просмотром по категориям для организации ваших чат-ботов.","crm.tourCategoryViewTitle":"Просмотр по категориям","crm.tourCategoryViewContent":"Нажмите здесь, чтобы увидеть потоки, организованные по категориям.","crm.tourAddCategoryTitle":"Создание категорий","crm.tourAddCategoryContent":"Нажмите здесь, чтобы создать новую категорию с пользовательским именем, иконкой и цветом.","crm.tourDragDropTitle":"Перетаскивание","crm.tourDragDropContent":"Перетащите любую карточку потока и поместите её в категорию для организации.","crm.tourCategorySectionTitle":"Разделы категорий","crm.tourCategorySectionContent":"Нажмите, чтобы развернуть или свернуть категории. Редактируйте или удаляйте категории с помощью кнопок.","crm.skipTour":"Пропустить","crm.finishTour":"Понятно!","crm.next":"Далее","crm.previous":"Назад","crm.flowName":"Название потока","crm.untitledFlow":"Без названия","crm.duplicate":"Дублировать","crm.triggers":"Триггеры","crm.actions":"Действия","crm.rules":"Правила","crm.anyMessage":"Любое сообщение","crm.keywords":"Ключевые слова","crm.addKeyword":"Добавить ключевое слово","crm.firstMessageOfDay":"Первое сообщение за день","crm.firstMessageEver":"Первое сообщение от клиента","crm.firstMessageDay":"Первое сообщение от клиента за день","crm.whenAnyMessage":"При получении любого сообщения","crm.whenKeywordMatch":"Когда сообщение содержит ключевые слова","crm.byKeywordInMessage":"По ключевому слову в сообщении","crm.reactivationInterval":"Интервал реактивации:","crm.sendText":"Отправить текст","crm.sendTextDesc":"Этот блок отправляет текст пользователю.","crm.sendImage":"Отправить изображение","crm.sendImageDesc":"Этот блок отправляет изображение пользователю.","crm.sendVideo":"Отправить видео","crm.sendVideoDesc":"Отправить видео с подписью.","crm.sendAudio":"Отправить аудио","crm.sendAudioDesc":"Отправить аудиофайл.","crm.sendDocument":"Отправить документ","crm.sendDocumentDesc":"Отправить файл документа.","crm.responses":"Ответы","crm.responsesDesc":"Ожидание ответа пользователя и разветвление потока.","crm.sendList":"Отправить список","crm.sendListDesc":"Отправить интерактивное сообщение со списком.","fluxo.waitInput":"Ожидание ввода","fluxo.waitInputDesc":"Ожидание проверенного ответа пользователя","fluxo.promptMessage":"Сообщение-запрос","fluxo.enterPromptMessage":"Введите запрос для получения ввода пользователя...","fluxo.inputType":"Тип ввода (Валидация)","fluxo.inputTypeString":"Текст (Любой)","fluxo.inputTypePhone":"Номер телефона","fluxo.inputTypeNumber":"Число","fluxo.inputTypeEmail":"Email","fluxo.inputTypeUrl":"URL","fluxo.inputTypeDatetime":"Дата/Время","fluxo.phoneHint":"Формат: +79123456789 (с кодом страны)","fluxo.emailHint":"Формат: user@example.com","fluxo.numberHint":"Принимает целые и десятичные числа","fluxo.urlHint":"Формат: https://example.com","fluxo.datetimeHint":"Формат: ГГГГ-ММ-ДД или ГГГГ-ММ-ДДТЧЧ:ММ","fluxo.stringHint":"Принимает любой текстовый ввод","fluxo.saveResponseAs":"Сохранить ответ как переменную","fluxo.variableName":"userInput","fluxo.useVariableHint":"Используйте {variableName} в последующих сообщениях","fluxo.errorMessage":"Сообщение об ошибке (при неверном вводе)","fluxo.invalidInputDefault":"Неверный ввод. Пожалуйста, попробуйте снова.","fluxo.timeout":"Тайм-аут","fluxo.seconds":"Секунды","fluxo.minutes":"Минуты","fluxo.hours":"Часы","fluxo.timeoutHint":"Если нет валидного ответа за это время, выполнится ветка тайм-аута.","fluxo.customRegex":"Пользовательское регулярное выражение (Необязательно)","fluxo.regexPlaceholder":"^[A-Z]{2}[0-9]{4}$","fluxo.customRegexHint":"Заменяет валидацию типа ввода пользовательским шаблоном","fluxo.outputConnections":"Выходные соединения","fluxo.response":"ответ","fluxo.validInputReceived":"При получении валидного ввода","fluxo.noResponseTimeout":"При истечении тайм-аута без валидного ответа","fluxo.validResponse":"Валидный ответ","fluxo.onInvalidInput":"При неверном вводе:","fluxo.promptMessageInfo":"Сообщение, отправляемое пользователю с запросом ввода. Отображается перед ожиданием ответа.","fluxo.inputTypeInfo":"Выберите ожидаемый тип ввода. Система проверит ответ пользователя на соответствие этому формату.","fluxo.saveResponseAsInfo":"Имя переменной для сохранения валидного ответа пользователя. Используйте {имяПеременной} в последующих сообщениях для отображения этого значения.","fluxo.errorMessageInfo":"Сообщение, отправляемое пользователю, когда его ввод не соответствует ожидаемому формату. Ему будет предложено повторить попытку.","fluxo.timeoutInfo":"Максимальное время ожидания валидного ответа. При превышении выполняется ветка тайм-аута вместо ветки ответа.","fluxo.customRegexInfo":"Продвинутое: Укажите пользовательский шаблон регулярного выражения для валидации ввода. Это заменяет валидацию выбранного типа ввода.","fluxo.delayInfo":"Время ожидания в секундах перед отправкой сообщения-запроса. Полезно для естественного хода разговора.","crm.groupAction":"Действие группы","crm.tabAction":"Действие вкладки","crm.labelAction":"Действие метки","crm.crmAction":"Действие CRM","crm.smartWait":"Умное ожидание","crm.smartWaitDesc":"Ждать случайное время между сообщениями","crm.typingIndicator":"Индикатор набора","crm.typingIndicatorDesc":"Показать пузырь набора перед отправкой","crm.waitDuration":"Длительность ожидания:","crm.typingDuration":"Длительность набора:","crm.randomDelay":"Случайная задержка:","crm.randomDelayBetween":"Случайная задержка между","crm.randomBetween":"Случайная задержка между","crm.showsTypingFor":"Показывает индикатор набора на","crm.showsTyping":"Показывает набор на","crm.typingPreview":"Так индикатор набора отображается у контакта","crm.addFluxo":"Добавить Флюксо","crm.addFluxoDesc":"Выполнить другой поток","crm.selectFlowToCall":"Выберите поток для выполнения:","crm.noFlowSelected":"Поток не выбран","crm.passVariables":"Передать переменные в вызываемый поток","crm.passVariablesHint":"Переменные текущего потока будут доступны в вызываемом потоке","crm.passVariablesUseCase":'💡 Пример: Основной поток имеет {name}="Иван" → Сообщение под-потока "Привет {name}!" → Показывает "Привет Иван!". ВЫКЛ = под-поток начинается без переменных.',"crm.passVariablesShort":"Передать перем.","crm.continueAfterFlow":"Продолжить после завершения вызываемого потока","crm.continueAfterFlowHint":"Снимите флажок, чтобы завершить разговор после завершения вызываемого потока","crm.continueAfterFlowUseCase":"💡 Пример: ВКЛ = Приветственный под-поток завершён → возврат к основному потоку. ВЫКЛ = Под-поток завершён = разговор завершён (как поток Заказ Выполнен).","crm.continueAfterShort":"Продолжить после","crm.circularWarning":"Внимание: обнаружена циклическая ссылка!","crm.circularWarningHint":"Выбранный поток содержит узел 'Добавить Флюксо', указывающий на этот поток. Это может вызвать бесконечные циклы.","crm.selectFlowPlaceholder":"Выберите поток...","crm.noOtherFlows":"Нет других доступных потоков. Сначала создайте другой поток.","crm.delayBeforeCalling":"Задержка перед вызовом (секунды):","crm.executionSummary":"Сводка выполнения:","crm.variablesWillBe":"Переменные будут","crm.passed":"переданы","crm.notPassed":"не переданы","crm.executeFlow":"Выполнить","crm.continueToNext":"Продолжить к следующему узлу","crm.endConversation":"Завершить разговор","crm.selectedFlow":"Выбранный поток:","crm.addToGroups":"Добавить в группы","crm.removeFromGroups":"Удалить из групп","crm.addToTabs":"Добавить во вкладки","crm.removeFromTabs":"Удалить из вкладок","crm.addLabels":"Добавить метки","crm.removeLabels":"Удалить метки","crm.addToCrmStage":"Добавить в этап CRM","crm.removeFromCrm":"Удалить из CRM","crm.actionType":"Тип действия:","crm.selectGroups":"Выбрать группы:","crm.loadGroups":"Загрузить группы","crm.loadGroupsFromWhatsApp":"Загрузить группы из WhatsApp Web","crm.selectTabs":"Выбрать вкладки:","crm.selectLabels":"Выбрать метки:","crm.syncLabels":"Синхронизировать метки","crm.searchLabels":"Поиск меток...","crm.searchTabs":"Поиск вкладок...","crm.searchGroups":"Поиск групп...","crm.selectCrm":"Выбрать CRM:","crm.selectStage":"Выбрать этап:","crm.selectCrmPlaceholder":"Выбрать CRM...","crm.selectStagePlaceholder":"Выбрать этап...","crm.noGroupsSelected":"Группы не выбраны","crm.noTabsSelected":"Вкладки не выбраны","crm.noLabelsSelected":"Метки не выбраны","crm.noCrmSelected":"CRM/этап не выбран","crm.noGroupsAvailable":"Нет доступных групп.","crm.noTabsAvailable":"Нет доступных вкладок.","crm.noCrmsAvailable":"Нет доступных CRM.","crm.noStagesAvailable":"Нет этапов в этом CRM.","crm.delay":"Задержка (секунды):","crm.selectedGroups":"Группы:","crm.selectedTabs":"Вкладки:","crm.selectedLabels":"Метки:","crm.targetCrmStage":"Целевой CRM → Этап:","crm.targetCrm":"Целевой CRM:","crm.groups":"Группы","crm.enableForGroups":"Включить для групп","crm.schedule":"Расписание","crm.enableSchedule":"Включить расписание","crm.startTime":"Время начала","crm.endTime":"Время окончания","crm.crmRules":"Правила CRM","crm.enableCrmRules":"Включить правила вкладок CRM","crm.selectCrmTabs":"Выбрать вкладки CRM","crm.tagRules":"Правила меток","crm.labelRules":"Правила меток:","crm.dontRespondIfLabeled":"Не отвечать, если контакт имеет метку","crm.dontRespondToLabels":"Не отвечать на эти метки","crm.respondOnlyToLabels":"Отвечать только на эти метки","crm.selectLabelsNotToReply":"Выберите метки, на которые не отвечать:","crm.selectLabelsToReply":"Выберите метки для ответа:","crm.clickToSelect":"Нажмите для выбора","crm.labelsNotReplied":"Метки, на которые не будет ответа:","crm.labelsToReply":"Метки, на которые будет ответ:","crm.customTabRules":"Правила пользовательских вкладок:","crm.dontRespondIfInCustomTab":"Не отвечать, если контакт находится в пользовательской вкладке","crm.dontRespondToCustomTabs":"Не отвечать на эти пользовательские вкладки","crm.respondOnlyToCustomTabs":"Отвечать только на эти пользовательские вкладки","crm.selectCustomTabsNotToReply":"Выберите пользовательские вкладки, на которые не отвечать:","crm.selectCustomTabsToReply":"Выберите пользовательские вкладки для ответа:","crm.customTabsNotReplied":"Пользовательские вкладки, на которые не будет ответа:","crm.customTabsToReply":"Пользовательские вкладки, на которые будет ответ:","crm.noCustomTabsAvailable":"Нет пользовательских вкладок. Сначала создайте одну.","crm.pauseRules":"Правила паузы:","crm.enablePause":"Включить паузу","crm.pauseClientKeywords":"Ключевые слова паузы клиента","crm.pauseClientPlaceholder":"Приостановить чат-бота, если получатель...","crm.pauseServerKeywords":"Ключевые слова паузы сервера","crm.pauseServerPlaceholder":"Пауза, когда бот отправляет...","crm.pauseDuration":"Длительность паузы (ЧЧ:ММ)","crm.tipPauseTitle":"Правила Паузы","crm.tipPauseDesc":"Приостановить чат-бота при обнаружении определённых ключевых слов. Используйте ключевые слова клиента, чтобы позволить клиентам приостановить бота, или ключевые слова сервера для автоматической паузы после отправки определённых сообщений.","crm.tipPauseEx1":"Клиент говорит 'стоп' → Бот приостанавливается","crm.tipPauseEx2":"Клиент говорит 'человек' → Перевод на оператора","crm.tipPauseEx3":"Бот отправляет 'соединяю...' → Автопауза","crm.tipPauseClientTitle":"Ключевые слова паузы клиента","crm.tipPauseClientDesc":"Ключевые слова, которые при отправке клиентом приостановят чат-бота для этого чата. Полезно для сценариев передачи человеку.","crm.tipPauseClientEx1":"Клиент пишет 'стоп' или 'stop'","crm.tipPauseClientEx2":"Клиент пишет 'человек' или 'оператор'","crm.tipPauseClientEx3":"Бот перестаёт отвечать на установленное время","crm.tipPauseServerTitle":"Ключевые слова паузы сервера","crm.tipPauseServerDesc":"Ключевые слова, которые при отправке ботом автоматически приостановят чат-бота. Полезно при переводе на операторов.","crm.tipPauseServerEx1":"Бот отправляет 'Соединяю вас с оператором...'","crm.tipPauseServerEx2":"Бот отправляет 'Пожалуйста, подождите, перевожу...'","crm.tipPauseServerEx3":"Поток автоматически приостанавливается после этого сообщения","crm.tipPauseDurationTitle":"Длительность Паузы","crm.tipPauseDurationDesc":"Установите, как долго чат-бот будет приостановлен после обнаружения ключевого слова паузы. Формат: Часы:Минуты (напр., 00:30 = 30 минут).","crm.tipPauseDurationEx1":"00:30 = 30 минут паузы","crm.tipPauseDurationEx2":"01:00 = 1 час паузы","crm.tipPauseDurationEx3":"После истечения остаётся на паузе до нового триггера","crm.enableTagRules":"Включить правила меток WhatsApp","crm.editBlock":"Редактировать блок:","crm.startNode":"Старт","crm.start":"Старт","crm.startNodeInfo":"Это начальная точка вашего потока. Подключите её к другим блокам для создания чат-бота.","crm.editTextMessage":"Редактировать текстовое сообщение:","crm.typeTheText":"Введите текст","crm.saveResponseInVariable":"Сохранить ответ в переменную:","crm.typeVariableName":"Введите имя переменной","crm.variableHint":"Переменная сохранит ответ клиента из текущего блока и может использоваться в последующих блоках потока","crm.insertImage":"Вставить изображение:","crm.clickToUpload":"Нажмите для загрузки или перетащите файлы сюда","crm.imageFormats":"Изображение: PNG, JPG, JPEG, GIF (макс. 16МБ - лимит WhatsApp)","crm.imageCaption":"Подпись к изображению (опционально)","crm.insertVideo":"Вставить видео:","crm.insertAudio":"Вставить аудио:","crm.insertDocument":"Вставить документ:","crm.caption":"Подпись:","crm.captionOptional":"Подпись (опционально)","crm.questionMessage":"Текст вопроса:","crm.typeQuestion":"Введите ваш вопрос...","crm.responseOptions":"Варианты ответа:","crm.addOption":"Добавить вариант","crm.buttonText":"Текст кнопки:","crm.listTitleOptional":"Заголовок списка (опционально)","crm.listDescOptional":"Описание (опционально)","crm.listSectionsHint":"Настройте разделы и элементы списка в расширенных настройках.","crm.globalSettings":"Глобальные настройки:","crm.editAwayMessage":"Редактировать сообщение отсутствия:","crm.awayMessagePlaceholder":"Введите сообщение, которое будет отправлено, когда пользователь не отвечает...","crm.waitingTime":"Время ожидания:","crm.waitingTimeWarning":"При перезагрузке страницы WhatsApp эта настройка будет потеряна для разговоров, ожидающих ответа","crm.minutes":"Минуты","crm.hours":"Часы","crm.seconds":"Секунды","crm.awayMessageInfo":"Это сообщение будет отправлено автоматически, когда пользователь не отвечает в течение указанного времени.","crm.blockInterval":"Интервал блоков:","crm.blockIntervalInfo":"Определите интервал по умолчанию между отправкой блоков потока.","crm.chatSimulator":"Симулятор чата","crm.simulateFlow":"Симулировать поток","crm.startConversation":"Начните разговор, отправив сообщение","crm.typeMessageHere":"Введите сообщение здесь...","crm.callNextBlock":"Вызвать следующий блок","crm.whenItemSelected":"При выборе элемента","crm.whenResponding":"При ответе","crm.defaultNext":"По умолчанию (нет совпадения)","crm.message":"Сообщение:","crm.listButton":"Текст кнопки:","crm.items":"элементов","crm.listItems":"Элементы списка:","crm.addItem":"Добавить элемент","crm.insertVariable":"Вставить переменную","crm.contactName":"Имя контакта","crm.currentDate":"Текущая дата","crm.currentTime":"Текущее время","crm.defaultOption1":"Вариант 1","crm.defaultOption2":"Вариант 2","crm.noListItems":"Нет элементов. Нажмите редактировать, чтобы добавить.","crm.actionBlocks":"Блоки действий","crm.generalRules":"Общие правила:","crm.allowGroups":"Разрешить ответы в группах","crm.scheduleEnabled":"Разрешить ответы только в определённые дни и время","crm.dontRespondIfOpen":"Не отвечать, если разговор открыт","crm.customSignature":"Настроить или отключить подпись","crm.simulateTyping":"Имитировать набор текста или запись аудио","crm.dontRespondIfInCRM":"Не отвечать, если контакт в CRM","crm.dontRespondToCRMs":"Не отвечать CRM","crm.respondOnlyToCRMs":"Отвечать только CRM","crm.dontRespondIfTagged":"Не отвечать, если контакт помечен","crm.dontRespondToTags":"Не отвечать меткам","crm.respondOnlyToTags":"Отвечать только меткам","crm.image":"Изображение:","crm.editToInsertImage":"[Редактируйте для вставки изображения]","crm.send_text":"Отправить текст","crm.send_image":"Отправить изображение","crm.send_video":"Отправить видео","crm.send_audio":"Отправить аудио","crm.send_document":"Отправить документ","crm.send_list":"Отправить список","crm.group_action":"Действие с группой","crm.tab_action":"Действие с вкладкой","crm.label_action":"Действие с меткой","crm.crm_action":"Действие CRM","crm.wait_input":"Ожидание ввода","crm.smart_wait":"Умное ожидание","crm.typing_indicator":"Индикатор набора","crm.add_fluxo":"Добавить Флюксо","crm.timezone":"Часовой пояс:","crm.day":"День","crm.sunday":"Воскресенье","crm.monday":"Понедельник","crm.tuesday":"Вторник","crm.wednesday":"Среда","crm.thursday":"Четверг","crm.friday":"Пятница","crm.saturday":"Суббота","crm.disableSignature":"Отключить подпись","crm.customizeSignatureName":"Настроить имя подписи","crm.enterCustomSignature":"Введите название пользовательской подписи","crm.tipAnyMsgTitle":"Триггер любого сообщения","crm.tipAnyMsgDesc":"Поток запустится при получении ЛЮБОГО сообщения от клиента, независимо от содержания.","crm.tipAnyMsgEx1":"Общий автоответ для всех сообщений","crm.tipAnyMsgEx2":"Сообщение об отсутствии когда недоступен","crm.tipAnyMsgEx3":"Может срабатывать слишком часто - используйте с интервалом реактивации","crm.tipKeywordTitle":"Триггер по ключевому слову","crm.tipKeywordDesc":"Поток запускается ТОЛЬКО когда сообщение содержит одно из указанных ключевых слов.","crm.tipKeywordEx1":"'привет' запускает поток приветствия","crm.tipKeywordEx2":"'цена' запускает информацию о продукте","crm.tipKeywordEx3":"'помощь' запускает меню поддержки","crm.tipFirstDayTitle":"Первое сообщение дня","crm.tipFirstDayDesc":"Поток срабатывает ТОЛЬКО на первое сообщение каждый день от каждого контакта.","crm.tipFirstDayEx1":"Приветствие 'Доброе утро' только раз в день","crm.tipFirstDayEx2":"Ежедневная специальная акция для каждого контакта","crm.tipFirstDayEx3":"Сбрасывается в полночь по часовому поясу","crm.tipFirstEverTitle":"Самое первое сообщение","crm.tipFirstEverDesc":"Поток срабатывает ТОЛЬКО при первом сообщении контакта.","crm.tipFirstEverEx1":"Приветственное сообщение для новых контактов","crm.tipFirstEverEx2":"Последовательность онбординга для новых клиентов","crm.tipFirstEverEx3":"Начальное назначение CRM для новых лидов","crm.tipReactivationTitle":"Интервал реактивации","crm.tipReactivationDesc":"Минимальное время до повторного срабатывания того же потока для того же контакта.","crm.tipReactivationEx1":"3600с = Ждать 1 час до повторного срабатывания","crm.tipReactivationEx2":"Предотвращает спам автоответов","crm.tipReactivationEx3":"Используйте 0 для неограниченных срабатываний","crm.tipSendTextTitle":"Отправить текстовое сообщение","crm.tipSendTextDesc":"Отправляет простое текстовое сообщение контакту. Поддерживает переменные {name}, {phone}.","crm.tipSendTextEx1":"Персонализированные приветственные сообщения","crm.tipSendTextEx2":"Подтверждения заказов","crm.tipSendImageTitle":"Отправить изображение","crm.tipSendImageDesc":"Отправляет файл изображения с необязательной подписью. Поддерживает PNG, JPG, GIF.","crm.tipSendImageEx1":"Изображения продуктов","crm.tipSendImageEx2":"Промо-материалы","crm.tipSendVideoTitle":"Отправить видео","crm.tipSendVideoDesc":"Отправляет видеофайл с необязательной подписью. Поддерживает MP4, MOV.","crm.tipSendVideoEx1":"Демонстрации продуктов","crm.tipSendVideoEx2":"Обучающие видео","crm.tipSendAudioTitle":"Отправить аудио","crm.tipSendAudioDesc":"Отправляет аудиофайл или голосовую заметку. Поддерживает MP3, OGG, WAV.","crm.tipSendAudioEx1":"Предзаписанные голосовые сообщения","crm.tipSendAudioEx2":"Аудио объявления","crm.tipSendDocTitle":"Отправить документ","crm.tipSendDocDesc":"Отправляет любой тип файла как документ. Поддерживает PDF, DOC, XLS и др.","crm.tipSendDocEx1":"Каталоги цен","crm.tipSendDocEx2":"Контракты и соглашения","crm.tipSendListTitle":"Отправить список-сообщение","crm.tipSendListDesc":"Отправляет интерактивный список с секциями и выбираемыми элементами.","crm.tipSendListEx1":"Меню продуктов по категориям","crm.tipSendListEx2":"Варианты услуг","crm.tipGroupActionTitle":"Действие с группой WhatsApp","crm.tipGroupActionDesc":"Добавляет или удаляет текущий контакт из групп WhatsApp.","crm.tipGroupActionEx1":"Добавить VIP клиентов в эксклюзивную группу","crm.tipGroupActionEx2":"Удалить из группы поддержки после решения","crm.tipTabActionTitle":"Действие с пользовательской вкладкой","crm.tipTabActionDesc":"Добавляет или удаляет текущий контакт из пользовательских вкладок CRM.","crm.tipTabActionEx1":"Переместить лид на вкладку 'Квалифицированный'","crm.tipTabActionEx2":"Удалить из вкладки 'Новый запрос'","crm.tipLabelActionTitle":"Действие с меткой WhatsApp","crm.tipLabelActionDesc":"Добавляет или удаляет метки WhatsApp у текущего контакта.","crm.tipLabelActionEx1":"Добавить метку 'Отвечено'","crm.tipLabelActionEx2":"Удалить метку 'Ожидание'","crm.tipCrmActionTitle":"Действие с этапом CRM","crm.tipCrmActionDesc":"Перемещает текущий контакт на определённый этап в CRM Kanban.","crm.tipCrmActionEx1":"Переместить на этап 'Переговоры'","crm.tipCrmActionEx2":"Переместить на этап 'Закрыто выиграно'","crm.tipSmartWaitTitle":"Умное ожидание","crm.tipSmartWaitDesc":"Добавляет случайную задержку между действиями для более человечного вида.","crm.tipSmartWaitEx1":"Ждать 2-5 секунд между сообщениями","crm.tipSmartWaitEx2":"Имитировать естественное время чтения","crm.tipTypingTitle":"Индикатор набора","crm.tipTypingDesc":"Показывает пузырь 'печатает...' перед отправкой сообщения для более человечного вида.","crm.tipTypingEx1":"Показать печать 3 секунды перед сообщением","crm.tipTypingEx2":"Делает ответы более естественными","crm.tipAllowGroupsTitle":"Разрешить группы","crm.tipAllowGroupsDesc":"При включении чатбот будет отвечать и в групповых чатах. При отключении только личные чаты запускают поток.","crm.tipAllowGroupsEx1":"ВКЛ: Отвечать в группах и личных","crm.tipAllowGroupsEx2":"ВЫКЛ: Отвечать только в личных","crm.tipScheduleTitle":"Расписание ответов","crm.tipScheduleDesc":"Ограничить чатбот определёнными часами/днями. Настройте расписание ниже.","crm.tipScheduleEx1":"Только рабочие часы (9-18)","crm.tipScheduleEx2":"Только рабочие дни (Пн-Пт)","crm.tipScheduleEx3":"Автоответ вне расписания","crm.tipDontRespondOpenTitle":"Не отвечать если открыт","crm.tipDontRespondOpenDesc":"Предотвращает отправку сообщений чатботом, если эта беседа уже открыта в WhatsApp Web.","crm.tipDontRespondOpenEx1":"Полезно когда вы активно общаетесь","crm.tipDontRespondOpenEx2":"Предотвращает прерывание разговора ботом","crm.tipSimulateTypingTitle":"Имитировать набор","crm.tipSimulateTypingDesc":"Показывает индикатор 'печатает...' перед отправкой, делая ответы более человечными.","crm.tipSimulateTypingEx1":'Показывает "печатает..." для текста',"crm.tipSimulateTypingEx2":'Показывает "записывает..." для аудио',"crm.tipSimulateTypingEx3":"Делает бота более естественным","crm.tipSkipCRMTitle":"Пропускать контакты CRM","crm.tipSkipCRMDesc":"Чатбот не будет отвечать контактам, уже добавленным в CRM. Полезно для существующих клиентов.","crm.tipSkipCRMEx1":"Автоответ только новым контактам","crm.tipSkipCRMEx2":"Пропускать существующие контакты CRM","crm.tipExcludeCRMTitle":"Исключить определённые этапы CRM","crm.tipExcludeCRMDesc":"Выберите определённые этапы Kanban CRM для исключения. Контакты на этих этапах не получат сообщения чатбота.","crm.tipExcludeCRMEx1":'Исключить этап "VIP клиенты"',"crm.tipExcludeCRMEx2":'Исключить этап "Не беспокоить"',"crm.tipIncludeCRMTitle":"Включить только определённые этапы CRM","crm.tipIncludeCRMDesc":"Чатбот будет отвечать ТОЛЬКО контактам на выбранных этапах Kanban CRM. Остальные игнорируются.","crm.tipIncludeCRMEx1":'Отвечать только этапу "Лиды"',"crm.tipIncludeCRMEx2":'Отвечать только этапу "Активные сделки"',"crm.tipSkipLabeledTitle":"Пропускать помеченные контакты","crm.tipSkipLabeledDesc":"Чатбот не будет отвечать контактам с присвоенной меткой WhatsApp.","crm.tipSkipLabeledEx1":"Любой помеченный контакт пропускается","crm.tipSkipLabeledEx2":"Только непомеченные контакты получают ответы","crm.tipExcludeLabelTitle":"Исключить определённые метки","crm.tipExcludeLabelDesc":"Выберите определённые метки WhatsApp для исключения. Контакты с этими метками не получат сообщения чатбота.","crm.tipExcludeLabelEx1":'Исключить контакты с меткой "Спам"',"crm.tipExcludeLabelEx2":'Исключить контакты с меткой "Заблокирован"',"crm.tipIncludeLabelTitle":"Включить только определённые метки","crm.tipIncludeLabelDesc":"Чатбот будет отвечать ТОЛЬКО контактам с выбранными метками WhatsApp. Остальные игнорируются.","crm.tipIncludeLabelEx1":'Отвечать только "VIP" помеченным',"crm.tipIncludeLabelEx2":'Отвечать только "Приоритет" помеченным',"crm.tipSkipCustomTabTitle":"Пропускать контакты пользовательских вкладок","crm.tipSkipCustomTabDesc":"Чатбот не будет отвечать контактам, назначенным на пользовательскую вкладку.","crm.tipSkipCustomTabEx1":'Контакт во вкладке "VIP клиенты" → Нет ответа',"crm.tipSkipCustomTabEx2":"Контакт не в вкладке → Бот отвечает","crm.tipExcludeCustomTabTitle":"Исключить определённые пользовательские вкладки","crm.tipExcludeCustomTabDesc":"Выберите определённые пользовательские вкладки для исключения. Контакты в этих вкладках не получат сообщения чатбота.","crm.tipExcludeCustomTabEx1":'Исключить контакты вкладки "Заблокированные"',"crm.tipExcludeCustomTabEx2":'Исключить контакты вкладки "Обработанные"',"crm.tipIncludeCustomTabTitle":"Включить только определённые пользовательские вкладки","crm.tipIncludeCustomTabDesc":"Чатбот будет отвечать ТОЛЬКО контактам в выбранных пользовательских вкладках. Остальные игнорируются.","crm.tipIncludeCustomTabEx1":'Отвечать только вкладке "Активные лиды"',"crm.tipIncludeCustomTabEx2":'Отвечать только вкладке "VIP"',"templates.addCategory":"Добавить категорию","templates.editCategory":"Редактировать категорию","templates.deleteCategory":"Удалить категорию","templates.manageCategories":"Управление","templates.categoryName":"Название категории","templates.categoryIcon":"Иконка","templates.categoryColor":"Цвет","templates.update":"Обновить","templates.form.category":"Категория","templates.form.categoryHint":"Организуйте шаблоны по категориям для удобного доступа","templates.allTemplates":"Все шаблоны","templates.quickReplyCategory":"Быстрый ответ","templates.uncategorized":"Без категории","templates.sortNewest":"Новые","templates.sortOldest":"Старые","templates.sortNameAZ":"Имя А-Я","templates.sortNameZA":"Имя Я-А","templates.confirmDeleteCategory":"Вы уверены, что хотите удалить эту категорию? Шаблоны будут перемещены в Без категории.","templates.confirmDeleteTemplate":"Вы уверены, что хотите удалить этот шаблон?","templates.noCategoriesYet":"Категорий пока нет","templates.createCategoryDescription":"Создайте категории для организации шаблонов","templates.done":"Готово","templates.deleteCategoryWarning":"Шаблоны в этой категории станут без категории.","templates.delete":"Удалить","templates.noTemplatesInCategory":"В этой категории нет шаблонов","templates.createFirstDescription":"Создайте свой первый шаблон, чтобы начать","followUp.title":"Напоминание","followUp.newFollowUp":"Новое напоминание","followUp.confirmDelete":"Вы уверены, что хотите удалить это напоминание?","followUp.emptyTitle":"Напоминание не выбрано","followUp.emptyText":"Выберите напоминание из списка или создайте новое для автоматических последовательностей сообщений.","followUp.createNew":"Создать новое","followUp.loading":"Загрузка...","followUp.noFollowUps":"Напоминаний пока нет","followUp.createFirst":"Создайте первую последовательность напоминаний","followUp.active":"Активно","followUp.paused":"Приостановлено","followUp.labels":"Метки","followUp.customTabs":"Пользовательские вкладки","followUp.groups":"Группы","followUp.kanban":"Канбан","followUp.onEnter":"При входе","followUp.onLeave":"При выходе","followUp.afterTime":"После времени","followUp.steps":"шагов","followUp.pause":"Пауза","followUp.activate":"Активировать","followUp.duplicate":"Дублировать","followUp.delete":"Удалить","followUp.name":"Название напоминания","followUp.namePlaceholder":"Введите название напоминания...","followUp.nameRequired":"Пожалуйста, введите название напоминания","followUp.funnelRequired":"Пожалуйста, выберите хотя бы один элемент воронки","followUp.stepsRequired":"Пожалуйста, добавьте хотя бы один шаг","followUp.funnelSettings":"Настройки воронки","followUp.selectFunnelItems":"Выберите элементы для активации напоминания","followUp.comingSoon":"Селектор скоро","followUp.triggerSettings":"Триггер напоминания","followUp.onEnterDesc":"Срабатывает при входе контакта в воронку","followUp.onLeaveDesc":"Срабатывает при выходе контакта из воронки","followUp.afterTimeDesc":"Срабатывает после определённого времени","followUp.days":"Дней","followUp.day":"День","followUp.hours":"Часов","followUp.minutes":"Минут","followUp.value":"Значение","followUp.unit":"Единица","followUp.time":"Время","followUp.stepsTitle":"Шаги напоминания","followUp.step":"Шаг","followUp.actions":"действий","followUp.addStep":"Добавить шаг напоминания","followUp.rulesTitle":"Правила триггера","followUp.cancelOnReply":"Отменить при ответе клиента","followUp.allowGroups":"Разрешить ответы в группах","followUp.customSignature":"Настроить подпись","followUp.signatureText":"Текст подписи","followUp.signaturePlaceholder":"Введите вашу подпись...","followUp.maxExecutions":"Макс. раз для контакта","followUp.cooldownDays":"Период ожидания (дней)","followUp.cancel":"Отмена","followUp.create":"Создать напоминание","followUp.save":"Сохранить изменения","followUp.saving":"Сохранение...","followUp.saved":"Сохранено!","followUp.back":"← Назад","followUp.next":"Далее →","followUp.backToList":"← К списку","followUp.wizardStep1":"Настройка","followUp.wizardStep2":"Сообщения","followUp.wizardStep3":"Расписание","followUp.wizardStep4":"Действия","followUp.wizardStep5":"Правила","followUp.followUps":"Напоминания","followUp.stepName":"Название шага (опционально)","followUp.stepNamePlaceholder":"напр., Первый контакт, Напоминание 1...","followUp.timing":"Время","followUp.mode":"Режим","followUp.relative":"Относительный","followUp.specific":"Конкретный","followUp.type":"Тип","followUp.daily":"Ежедневно","followUp.weekly":"Еженедельно","followUp.monthly":"Ежемесячно","followUp.condition":"Условие","followUp.conditionAlways":"Всегда","followUp.conditionIfReplied":"Если ответил","followUp.conditionIfNotReplied":"Если не ответил","followUp.conditionIfKeyword":"Если ключевое слово","followUp.conditionIfNotKeyword":"Если нет ключевого слова","followUp.conditionIfInFunnel":"Если в воронке","followUp.conditionIfNotInFunnel":"Если покинул воронку","followUp.keywords":"Ключевые слова (через запятую)","followUp.keywordsPlaceholder":"да, ок, интересно...","followUp.actionsTitle":"Действия","followUp.actionsRequired":"Пожалуйста, добавьте хотя бы одно действие","followUp.addAction":"+ Добавить действие","followUp.postActionsTitle":"Последующие действия","followUp.groupActions":"Действия группы","followUp.addToGroups":"Добавить в группы","followUp.removeFromGroups":"Удалить из групп","followUp.customTabActions":"Действия вкладки","followUp.addToTabs":"Добавить во вкладки","followUp.removeFromTabs":"Удалить из вкладок","followUp.labelsActions":"Действия меток","followUp.addLabels":"Добавить метки","followUp.removeLabels":"Удалить метки","followUp.kanbanBoardActions":"Действия канбан","followUp.addToKanban":"Добавить на этап","followUp.removeFromKanban":"Удалить с этапа","followUp.selectStage":"Выберите этап...","followUp.noGroupsAvailable":"Нет доступных групп","followUp.noTabsAvailable":"Нет доступных вкладок","followUp.noLabelsAvailable":"Нет доступных меток","followUp.noKanbanAvailable":"Нет доступных канбан-досок","followUp.moveUp":"Вверх","followUp.moveDown":"Вниз","followUp.removeStep":"Удалить шаг","followUp.message":"Сообщение","followUp.messagePlaceholder":"Введите сообщение...","followUp.variables":"Переменные","followUp.clickToInsert":"Нажмите для вставки переменной:","followUp.minDelay":"Мин. задержка (сек)","followUp.maxDelay":"Макс. задержка (сек)","followUp.addMessage":"Добавить сообщение","followUp.removeMessage":"Удалить сообщение","followUp.selectLabels":"Выберите метки...","followUp.selectTabs":"Выберите вкладки...","followUp.selectKanbanStage":"Выберите Канбан CRM и этап...","followUp.selectGroups":"Выберите группы WhatsApp...","followUp.selectorComingSoon":"Селектор скоро","followUp.webhookUrl":"URL Webhook","followUp.includeContactData":"Включить данные контакта","followUp.search":"Поиск...","followUp.noLabels":"Метки не найдены. Сначала создайте метки в WhatsApp.","followUp.noTabs":"Вкладки не найдены. Создайте вкладки на панели вкладок.","followUp.noGroups":"Группы WhatsApp не найдены.","followUp.noStages":"Этапы Канбан не найдены. Сначала создайте CRM и этапы.","followUp.fluxoCategory":"Категория","followUp.allCategories":"Все категории","followUp.uncategorized":"Без категории","followUp.selectFluxo":"Выбрать Fluxo","followUp.chooseFluxo":"-- Выберите Fluxo --","followUp.fluxoInfo":"Выбранный поток чатбота будет активирован при выполнении напоминания.","followUp.messageText":"Текст сообщения","followUp.templatesType":"Тип шаблона","followUp.tooltip.nameTitle":"Название напоминания","followUp.tooltip.nameContent":"Дайте описательное имя для идентификации этой последовательности напоминаний. Хорошие имена делают организацию и управление проще.","followUp.tooltip.nameExample":"Пример: 'Приветствие нового лида', 'Напоминание об оплате', 'Последующая встреча'","followUp.tooltip.categoryTitle":"Категория","followUp.tooltip.categoryContent":"Группировка связанных напоминаний по категориям помогает организовать их и легко находить. Создавайте такие категории, как 'Продажи', 'Поддержка', 'Маркетинг' и т.д.","followUp.tooltip.categoryExample":"Пример: Категория 'Продажи' может содержать напоминания о ценах, демо и первоначальный контакт.","followUp.tooltip.funnelTitle":"Настройки воронки - Где активировать?","followUp.tooltip.funnelContent":"Выберите, какие Метки, Вкладки, Группы или этапы Kanban будут активировать это напоминание. При добавлении контакта в выбранные элементы - напоминание запускается.","followUp.tooltip.funnelExample":"Пример: Выберите метку 'Новый лид' и вкладку 'Интересующиеся' для активации при соответствии контакта.","followUp.tooltip.funnelHowToUse":"Как использовать: Включите типы воронок, которые хотите использовать (Метки, Вкладки, Группы, Kanban), затем нажмите кнопку для выбора конкретных элементов.","followUp.tooltip.triggerTitle":"Триггер напоминания - Когда начинать?","followUp.tooltip.triggerContent":"Определите, когда должно начаться выполнение напоминания. Вы можете запустить его немедленно или запланировать на определенное время после активации контакта.","followUp.tooltip.triggerExample":"Пример: 'Через 5 минут' отправляет сообщение через 5 минут после входа контакта в воронку.","followUp.tooltip.actionsTitle":"Действия - Что делать?","followUp.tooltip.actionsContent":"Настройте последовательность действий для выполнения. Каждое действие может отправить сообщение, медиа, запустить чатбот или подождать перед следующим шагом.","followUp.tooltip.actionsExample":"Пример: Действие 1 - Отправить приветствие, Действие 2 - Подождать 1 час, Действие 3 - Отправить предложение.","followUp.tooltip.actionsHowToUse":"Как использовать: Нажмите '+ Добавить действие', чтобы создать шаги. Перетаскивайте для изменения порядка. Каждое действие может иметь задержку.","followUp.tooltip.rulesTitle":"Правила триггера - Управление поведением","followUp.tooltip.rulesContent":"Тонкая настройка выполнения напоминания. Правила определяют, когда останавливать, повторять или изменять последовательность в зависимости от поведения клиента.","followUp.tooltip.cancelOnReplyTitle":"Отмена при ответе клиента","followUp.tooltip.cancelOnReplyContent":"При включении напоминание автоматически останавливается, когда клиент отправляет любое сообщение. Это предотвращает отправку автоматических сообщений во время разговора.","followUp.tooltip.cancelOnReplyBestPractice":"Лучшая практика: Держите включенным для большинства напоминаний во избежание отправки роботизированных сообщений при активном общении с клиентом.","followUp.tooltip.allowGroupsTitle":"Разрешить ответы в группах","followUp.tooltip.allowGroupsContent":"При включении это напоминание может отправлять сообщения в групповые чаты. При отключении работает только с индивидуальными контактами.","followUp.tooltip.allowGroupsBestPractice":"Лучшая практика: Отключите для личных напоминаний (ценовые предложения, напоминания об оплате). Включите для объявлений.","followUp.tooltip.signatureTitle":"Настроить подпись","followUp.tooltip.signatureContent":"Добавьте персональную подпись в конец сообщений напоминания. Оставьте пустым, чтобы использовать подпись по умолчанию, или настройте для этого напоминания.","followUp.tooltip.signatureExample":"Пример: '--С уважением, Команда продаж' или '--Джон, Менеджер по работе с клиентами'","followUp.tooltip.maxExecutionsTitle":"Максимум выполнений - Сколько раз?","followUp.tooltip.maxExecutionsContent":"Ограничьте, сколько раз это напоминание может выполняться для одного контакта. Используйте -1 для неограниченных выполнений или установите конкретное число.","followUp.tooltip.maxExecutionsExample":"Пример: Установка '3' означает, что контакт получит эту последовательность максимум 3 раза, даже при повторном входе в воронку.","followUp.tooltip.maxExecutionsBestPractice":"Лучшая практика: Установите разумный лимит (3-5) для повторяющихся напоминаний, чтобы избежать спама клиентов.","followUp.tooltip.cooldownTitle":"Период ожидания - Подождать перед повторным запуском","followUp.tooltip.cooldownContent":"Минимальное время ожидания перед повторным запуском напоминания для того же контакта. Предотвращает дублирование сообщений при быстром повторном добавлении контакта.","followUp.tooltip.cooldownExample":"Пример: Период ожидания '24 часа' означает ожидание 24 часов после завершения перед повторным запуском для того же контакта.","followUp.tooltip.cooldownBestPractice":"Лучшая практика: Используйте 24-часовой период для ежедневных напоминаний, 7 дней для еженедельных акций.","followUp.tooltip.exampleLabel":"Пример:","followUp.tooltip.howToUseLabel":"Как использовать:","followUp.tooltip.bestPracticeLabel":"Лучшая практика:","followUp.scheduleConfiguration":"Настройка Расписания","followUp.enableSchedule":"Включить Расширенное Расписание","followUp.enableScheduleDesc":"(Отправлять только в определённые дни/даты)","followUp.scheduleDisabledInfo":"Включите Расширенное Расписание выше, чтобы настроить конкретные дни/даты для отправки сообщений.","followUp.tooltip.scheduleTitle":"Настройка Расписания - Когда отправлять?","followUp.tooltip.scheduleContent":"Настройте конкретные дни/даты, когда напоминание должно выполняться. Используйте ежедневный режим для выбора дней недели, еженедельный для конкретных недель или ежемесячный для дат месяца.","followUp.tooltip.scheduleExample":"Установите Еженедельное расписание для Пн, Ср, Пт, чтобы отправлять сообщения только в эти дни.","followUp.messagesConfiguredInSchedule":"Сообщения настроены в Расписании","followUp.messagesConfiguredInScheduleDesc":'Вы включили "Разное сообщение для каждого дня" в разделе Настройки Расписания выше. Сообщения настраиваются там для каждого выбранного дня.',"schedule.title":"Запланированные сообщения","schedule.addSchedule":"Добавить расписание","schedule.editSchedule":"Редактировать расписание","schedule.schedulesCount":"Расписания","schedule.noSchedules":"Нет запланированных сообщений","schedule.noSchedulesDesc":"Создайте своё первое запланированное сообщение для начала.","schedule.confirmDelete":"Вы уверены, что хотите удалить это расписание?","schedule.inactive":"Неактивно","schedule.once":"Один раз","schedule.repeated":"Повторяющееся","schedule.scheduleFor":"Запланировать для","schedule.selectTarget":"Выбрать контакт или группу","schedule.searchContacts":"Поиск контактов и групп...","schedule.groups":"Группы","schedule.contacts":"Контакты","schedule.templateType":"Тип шаблона","schedule.message":"Сообщение","schedule.enterMessage":"Введите сообщение...","schedule.scheduleDateTime":"Дата и время расписания","schedule.selectDateTime":"Пожалуйста, выберите дату и время","schedule.repeatedType":"Тип повторения","schedule.repeatedType_minute":"Минута","schedule.repeatedType_hour":"Час","schedule.repeatedType_daily":"Ежедневно","schedule.repeatedType_weekly":"Еженедельно","schedule.repeatedType_monthly":"Ежемесячно","schedule.repeatedType_yearly":"Ежегодно","schedule.everyMinutes":"Каждые X минут","schedule.everyHours":"Каждые X часов","schedule.scheduleTime":"Время расписания","schedule.addTime":"Добавить время","schedule.startAndEndTime":"Время начала и окончания","schedule.runAnytime":"Запускать в любое время","schedule.runBetween":"Запускать в период времени","schedule.endSchedule":"Завершить повтор расписания","schedule.never":"Никогда","schedule.afterCount":"Количество повторений","schedule.completeOnDate":"Завершить в дату","schedule.weekday_mon":"Понедельник","schedule.weekday_tue":"Вторник","schedule.weekday_wed":"Среда","schedule.weekday_thu":"Четверг","schedule.weekday_fri":"Пятница","schedule.weekday_sat":"Суббота","schedule.weekday_sun":"Воскресенье","schedule.month_jan":"Январь","schedule.month_feb":"Февраль","schedule.month_mar":"Март","schedule.month_apr":"Апрель","schedule.month_may":"Май","schedule.month_jun":"Июнь","schedule.month_jul":"Июль","schedule.month_aug":"Август","schedule.month_sep":"Сентябрь","schedule.month_oct":"Октябрь","schedule.month_nov":"Ноябрь","schedule.month_dec":"Декабрь","schedule.postActions":"Последующие действия","schedule.groupActions":"Действия группы","schedule.customTabActions":"Действия пользовательской вкладки","schedule.labelsActions":"Действия меток","schedule.kanbanActions":"Действия канбан","schedule.members":"участников","schedule.noContactsFound":"Контакты не найдены","schedule.noGroupsFound":"Группы не найдены","schedule.loadingContacts":"Загрузка контактов...","schedule.loadingGroups":"Загрузка групп...","schedule.selected":"Выбрано","schedule.tooltip.scheduleFor":"Выберите контакт или группу для отправки запланированного сообщения.","schedule.tooltip.templateType":"Выберите тип сообщения: только текст, с медиафайлами, опрос, список или запуск чат-бота Fluxo.","schedule.tooltip.message":"Введите ваше сообщение. Используйте переменные {{name}} или {{phone}} для персонализации.","schedule.tooltip.dateTime":"Установите время отправки сообщения. Для повторяющихся — это дата/время начала.","schedule.tooltip.repeatedType":"Выберите частоту повтора: каждые X минут/часов, ежедневно, еженедельно, ежемесячно или ежегодно.","schedule.tooltip.scheduleTimes":"Добавьте несколько времён для отправки. Нажмите +, чтобы добавить больше слотов.","schedule.tooltip.runBetween":"Ограничьте отправку определёнными часами. Например, только с 9:00 до 18:00.","schedule.tooltip.endSchedule":"Выберите, когда остановить повторы: никогда, после X раз или в определённую дату.","schedule.tooltip.postActions":"Действия после отправки: добавить/удалить из групп, вкладок, меток или этапов канбан.","gmaps.featureTitle":"Экстрактор G Maps","feature.gmapsExtractor":"Экстрактор G Maps","gmaps.panelHeader":"Экстрактор G Maps","gmaps.status.idle":"Ожидание","gmaps.status.running":"Извлечение...","gmaps.status.stopped":"Остановлено","gmaps.status.complete":"Готово","gmaps.status.error":"Остановлено","gmaps.statusLabel":"Статус","gmaps.leadsFound":"Лиды: {{count}}","gmaps.leadsShort":"лиды","gmaps.settings":"Настройки","gmaps.exportGroup":"Экспорт и отправка","gmaps.noPhone":"без телефона","gmaps.showPanel":"Показать панель","gmaps.hidePanel":"Скрыть панель","gmaps.maxResults":"Макс. результатов","gmaps.unlimited":"Без ограничений","gmaps.fetchEmails":"Получать e-mail","gmaps.fetchEmailsTooltip":"Для каждого лида с веб-сайтом он открывается в фоне, и извлекается первый найденный адрес электронной почты. Добавляет около 3 секунд на лид и использует дополнительный трафик. Если на сайте нет видимого e-mail или он не загружается, поле e-mail у этого лида остаётся пустым.","gmaps.startBtn":"Начать извлечение","gmaps.stopBtn":"Стоп","gmaps.clearBtn":"Очистить","gmaps.exportCsv":"Экспорт CSV","gmaps.exportXlsx":"Экспорт XLSX","gmaps.sendToBroadcast":"Отправить в рассылку","gmaps.previewTitle":"Предпросмотр","gmaps.moreRows":"ещё","gmaps.expand":"Развернуть","gmaps.expandView":"Полный вид","gmaps.clickExpand":"Нажмите «Развернуть», чтобы увидеть подробности","gmaps.clickExpandToSee":"нажмите «Развернуть», чтобы увидеть всё","gmaps.col.name":"Название","gmaps.col.phone":"Телефон","gmaps.col.website":"Веб-сайт","gmaps.col.address":"Адрес","gmaps.col.category":"Категория","gmaps.col.rating":"Рейтинг","gmaps.noLeadsYet":"Пока нет лидов — выполните поиск в Google Maps и нажмите «Старт»","gmaps.stopReason.userStop":"Остановлено пользователем","gmaps.stopReason.endOfResults":"Достигнут конец результатов Google Maps","gmaps.stopReason.captcha":"Обнаружена капча Google — решите её и снова нажмите «Старт»","gmaps.stopReason.noFeed":"Результаты поиска Google Maps не найдены — сначала выполните поиск","gmaps.stopReason.noNewResults":"Новые результаты не загружаются (Google перестал возвращать данные)","gmaps.stopReason.maxReached":"Достигнут максимальный лимит результатов","gmaps.stopReason.tabClosed":"Вкладка была закрыта","gmaps.stopReason.error":"Ошибка","gmaps.toast.searchFirst":"Сначала выполните поиск в Google Maps, затем нажмите «Старт».","gmaps.toast.csvReady":"CSV скачан","gmaps.toast.xlsxReady":"Файл Excel скачан","gmaps.toast.noPhones":"Нет действительных номеров телефонов — ничего не отправлено.","gmaps.toast.sentPartial":"{{sent}} контактов отправлено в рассылку · {{dropped}} пропущено (нет телефона)","gmaps.toast.sentAll":"{{sent}} контактов отправлено в рассылку","gmaps.toast.broadcastFail":"Ошибка отправки в рассылку. См. консоль.","gmaps.toast.draftRestored":"Предыдущая сессия восстановлена","gmaps.toast.draftRestoredN":"Восстановлено {{n}} лидов из предыдущей сессии"}};const FLOWhatsappI18nFallbacks={"crm.audio":"Audio","crm.categoriesImported":"Categorias importadas","crm.confirmDeleteReminder":"Excluir este lembrete?","crm.confirmRemoveFromTab":"Remover desta aba?","crm.createFirstFlowHint":"Crie automacoes para responder e organizar conversas.","crm.customColor":"Cor personalizada","crm.customPaymentMethods":"Metodos de pagamento personalizados","crm.document":"Documento","crm.dragFlowHint":"Arraste fluxos para organizar","crm.editToInsertAudio":"Edite para inserir audio","crm.editToInsertDocument":"Edite para inserir documento","crm.editToInsertVideo":"Edite para inserir video","crm.enterPaymentMethodName":"Digite o nome do metodo de pagamento","crm.fileTooLarge":"Arquivo muito grande","crm.flow":"fluxo","crm.flows":"fluxos","crm.noExpenseData":"Nenhuma despesa encontrada","crm.noIncomeData":"Nenhuma receita encontrada","crm.paymentMethodName":"Nome do metodo de pagamento","crm.pleaseEnterTopic":"Informe o assunto","crm.scheduleMessage":"Agendar mensagem","crm.selectCRM":"Selecionar CRM","crm.selectCRMPlaceholder":"Selecione um CRM","crm.selectStages":"Selecionar etapas","crm.selectStagesInclude":"Incluir etapas","crm.subFlowWouldRun":"Este subfluxo sera executado","crm.video":"Video","followUp.actionsCount":"{count} acoes","followUp.funnelRequiredDetailed":"Selecione ao menos um item do funil","followUp.scheduleWizard.saved":"Agenda salva","kanban.noRevenueData":"Nenhuma receita encontrada","tabs.copy":"Copiar","tabs.duplicate":"Duplicar","templates.cancel":"Cancelar","templates.confirmDelete":"Excluir este modelo?","templates.errors.maxPollOptions":"O maximo permitido e 12 opcoes","templates.errors.messageRequired":"Informe a mensagem do modelo","templates.errors.messageTooLong":"A mensagem esta muito longa","templates.errors.minPollOptions":"Informe pelo menos 2 opcoes","templates.errors.nameRequired":"Informe o nome do modelo","templates.errors.saveFailed":"Nao foi possivel salvar o modelo","templates.form.attachments":"Anexos","templates.sortManual":"Ordem manual","templates.sortMar":"Ordem manual","templates.sortName":"Nome (A-Z)","feature.schedule":"Mensagens agendadas","languages.hi":"Hindi","languages.bn":"Bengali","languages.ur":"Urdu","errors.extensionUpdated":"A extensao foi atualizada. Recarregue a pagina e tente novamente.","fluxo.responseTimeout":"Tempo limite da resposta (minutos):","fluxo.responseTimeoutHint":"Quando \"Chamar proximo bloco\" e \"Ao responder\" estiverem conectados, define quanto tempo aguardar a resposta do usuario. Padrao: 5 minutos.","crm.dontRespondIfTagged":"Nao responder se o contato tiver etiqueta","crm.dontRespondToTags":"Nao responder as etiquetas","crm.respondOnlyToTags":"Responder apenas as etiquetas","crm.image":"Imagem:","crm.editToInsertImage":"[Edite para inserir a imagem]","crm.tipReactivationEx4":"24 horas = mensagem de boas-vindas uma vez por dia","followUp.messagesTitle":"Mensagens","followUp.tooltip.messagesTitle":"Mensagens - o que enviar?","followUp.tooltip.messagesContent":"Defina as mensagens enviadas quando o follow-up disparar. Voce pode adicionar varias mensagens com tipos de anexo diferentes e intervalos entre elas.","followUp.tooltip.messagesHowToUse":"Clique em \"+ Adicionar mensagem\" para adicionar mensagens. Cada mensagem pode ter texto, imagens/videos, documentos, enquetes e mais.","followUp.tooltip.postActionsTitle":"Acoes posteriores - acoes de CRM apos as mensagens","followUp.tooltip.postActionsContent":"Configure acoes de CRM para executar depois que todas as mensagens forem enviadas. Adicione ou remova contatos de grupos, abas personalizadas, etiquetas do WhatsApp ou etapas do Kanban.","followUp.tooltip.postActionsHowToUse":"Ative uma categoria de acao no seletor e escolha em quais grupos, abas, etiquetas ou etapas o contato sera adicionado ou removido.","followUp.scheduleWizard.title":"Configuracao da agenda","followUp.scheduleWizard.step1":"Etapa 1: tipo de agenda","followUp.scheduleWizard.step2":"Etapa 2: selecionar dias","followUp.scheduleWizard.step3":"Etapa 3: horario e mensagens","followUp.scheduleWizard.next":"Avancar","followUp.scheduleWizard.back":"Voltar","followUp.scheduleWizard.done":"Concluir","followUp.schedule.daily":"Diario","followUp.schedule.dailyDesc":"Enviar em datas especificas do mes","followUp.schedule.weekly":"Semanal","followUp.schedule.weeklyDesc":"Enviar nos dias da semana selecionados","followUp.schedule.monthly":"Mensal","followUp.schedule.monthlyDesc":"Enviar em datas especificas a cada mes","followUp.schedule.yearly":"Anual","followUp.schedule.yearlyDesc":"Enviar em datas especificas a cada ano","followUp.weekday.mon":"Seg","followUp.weekday.tue":"Ter","followUp.weekday.wed":"Qua","followUp.weekday.thu":"Qui","followUp.weekday.fri":"Sex","followUp.weekday.sat":"Sab","followUp.weekday.sun":"Dom","followUp.weekday.monday":"Segunda-feira","followUp.weekday.tuesday":"Terca-feira","followUp.weekday.wednesday":"Quarta-feira","followUp.weekday.thursday":"Quinta-feira","followUp.weekday.friday":"Sexta-feira","followUp.weekday.saturday":"Sabado","followUp.weekday.sunday":"Domingo","followUp.month.jan":"Janeiro","followUp.month.feb":"Fevereiro","followUp.month.mar":"Marco","followUp.month.apr":"Abril","followUp.month.may":"Maio","followUp.month.jun":"Junho","followUp.month.jul":"Julho","followUp.month.aug":"Agosto","followUp.month.sep":"Setembro","followUp.month.oct":"Outubro","followUp.month.nov":"Novembro","followUp.month.dec":"Dezembro","followUp.selectWeekdays":"Selecionar dias da semana","followUp.selectDates":"Selecionar datas","followUp.selectYearlyDates":"Selecionar datas anuais","followUp.selectedDays":"Selecionados","followUp.noSelection":"Nenhuma selecao","followUp.addDate":"Adicionar data","followUp.removeDate":"Remover","followUp.selectMonth":"Selecionar mes","followUp.selectDay":"Selecionar dia","followUp.monthlySelectInfo":"Selecione datas que serao repetidas todos os meses","followUp.dailySelectInfo":"Selecione datas especificas para esta agenda","followUp.calendarSelectInfo":"Selecione datas especificas no calendario. Navegue pelos meses usando as setas.","followUp.messageMode":"Modo de mensagem","followUp.sameMessage":"Mesma mensagem para todos os dias","followUp.sameMessageDesc":"Use a mesma configuracao de mensagem para todos os dias selecionados","followUp.differentMessages":"Mensagem diferente por dia","followUp.differentMessagesDesc":"Configure mensagens separadas para cada dia selecionado","followUp.messageFor":"Mensagem para","followUp.sendTime":"Horario de envio","followUp.selectTime":"Selecionar horario de envio","schedule.templateType_message":"Mensagem","schedule.templateType_message_image_video":"Mensagem + imagens/videos","schedule.templateType_message_document":"Mensagem + documentos","schedule.templateType_message_audio":"Mensagem + audio","schedule.templateType_message_contacts":"Mensagem + contatos","schedule.templateType_message_buttons":"Mensagem + botoes","schedule.templateType_message_poll":"Mensagem + enquete","schedule.templateType_message_list":"Mensagem + lista","schedule.templateType_message_product":"Mensagem + produto","schedule.templateType_fluxo_flow":"Fluxos ativos do Fluxo","schedule.selectFlow":"Selecionar fluxo","schedule.selectFluxoFlow":"Selecionar um fluxo","schedule.selectTemplates":"Selecionar modelos","schedule.replyReceived":"Acoes ao receber resposta","schedule.additionalOptions":"Opcoes adicionais","schedule.archiveChat":"Arquivar conversa","schedule.blockChat":"Bloquear conversa","schedule.autoSendIfMissed":"Enviar automaticamente se o horario ja passou","schedule.webhookExecution":"Execucao de webhook","templates.sortNewest":"Mais recentes","templates.sortOldest":"Mais antigos","templates.sortNameAZ":"Nome A-Z","templates.sortNameZA":"Nome Z-A","common.add":"Adicionar","common.save":"Salvar","common.cancel":"Cancelar","common.close":"Fechar","common.delete":"Excluir","common.edit":"Editar","common.loading":"Carregando...","crm.fullName":"Nome completo","crm.phoneNumber":"Numero de telefone","crm.email":"E-mail","crm.gender":"Genero","crm.dateOfBirth":"Data de nascimento","crm.details":"Detalhes","crm.address":"Endereco","crm.language":"Idioma","crm.aiBotBlacklist":"Bot de IA","crm.aiBotDisabled":"Desativado para este contato","crm.aiBotEnabled":"Ativado para este contato","team.namePlaceholder":"Ex.: Vendas - Joao","team.phonePlaceholder":"Ex.: +55 11 99999-9999"};let i="pt";const s={en:"English",zh:"中文 (Chinese)",es:"Español (Spanish)",fr:"Français (French)",ar:"العربية (Arabic)",pt:"Português (Portuguese)",ru:"Русский (Russian)",ja:"日本語 (Japanese)",de:"Deutsch (German)"};async function l(){try{const e=await r().storage.local.get(["wa_language"]);i=e.wa_language||"pt"}catch(e){i="pt"}}function c(e){return e.replace(/\.(.)/g,(e,t)=>t.toUpperCase())}function d(e,t){const n=o[i]||{};let a=n[e];if(!a&&e.includes(".")){a=n[c(e)]}if(a)return a;if("pt"===i&&FLOWhatsappI18nFallbacks[e])return FLOWhatsappI18nFallbacks[e];if("en"!==i){const t=o.en[e];if(t)return t;if(e.includes(".")){const t=c(e),n=o.en[t];if(n)return n}}return t||FLOWhatsappI18nFallbacks[e]||e}function m(){return i}async function p(e){const t=i;i=e;try{await r().storage.local.set({wa_language:e}),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("languageChanged",{detail:{oldLang:t,newLang:e}}))}catch(e){}}},3538(e,t,n){"use strict";n.d(t,{KanbanStorage:()=>d});var a=n(6815),r=n.n(a);const o="wa_kanban_crm_data",i="wa_kanban_crm_data_sync",s="crm-whatsapp-labels",l="crm-custom-tabs",c=()=>({crms:[],stages:{},assignments:[],activeCrmId:null,chatsCache:{},lastSync:Date.now()});class d{static getState(){try{const e=localStorage.getItem(o);if(e){const t=JSON.parse(e),n=l;if(t.stages[n]){let e=!1;t.stages[n].forEach(t=>{"INBOX"!==t.name&&t.isSystemGenerated&&(t.isSystemGenerated=!1,e=!0)}),e&&this.setState(t)}return t}}catch(e){}return c()}static setState(e){try{e.lastSync=Date.now(),localStorage.setItem(o,JSON.stringify(e)),this.syncToChrome().catch(e=>{})}catch(e){}}static getCRMs(){return this.getState().crms.sort((e,t)=>e.position-t.position)}static getCRM(e){return this.getState().crms.find(t=>t.id===e)}static addCRM(e){const t=this.getState(),n={...e,id:`crm-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,createdAt:Date.now(),updatedAt:Date.now()};return t.crms.push(n),t.stages[n.id]=[],this.setState(t),n}static updateCRM(e,t){const n=this.getState(),a=n.crms.findIndex(t=>t.id===e);if(-1===a)return!1;const r=n.crms[a];if(r.isDefault){const{name:e,type:o,isDefault:i,...s}=t;n.crms[a]={...r,...s,updatedAt:Date.now()}}else n.crms[a]={...r,...t,updatedAt:Date.now()};return this.setState(n),!0}static deleteCRM(e){const t=this.getState(),n=t.crms.find(t=>t.id===e);return!(!n||n.isDefault)&&(t.crms=t.crms.filter(t=>t.id!==e),delete t.stages[e],t.assignments=t.assignments.filter(t=>t.crmId!==e),t.activeCrmId===e&&(t.activeCrmId=t.crms.length>0?t.crms[0].id:null),this.setState(t),!0)}static getStages(e){return[...this.getState().stages[e]||[]].sort((e,t)=>{const n=(e.name||"").trim().toUpperCase(),a=(t.name||"").trim().toUpperCase();return"INBOX"===n?-1:"INBOX"===a?1:(e.position||0)-(t.position||0)})}static addStage(e,t){const n=this.getState();n.stages[e]||(n.stages[e]=[]);const a={...t,id:`stage-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,crmId:e};return n.stages[e].push(a),this.setState(n),a}static updateStage(e,t){const n=this.getState();for(const a in n.stages){const r=n.stages[a].findIndex(t=>t.id===e);if(-1!==r){const e=n.stages[a][r];if(e.isSystemGenerated){const{name:o,isSystemGenerated:i,...s}=t;n.stages[a][r]={...e,...s}}else n.stages[a][r]={...e,...t};return this.setState(n),!0}}return!1}static deleteStage(e){const t=this.getState();for(const n in t.stages){const a=t.stages[n].find(t=>t.id===e);if(a){if(a.isSystemGenerated)return!1;t.stages[n]=t.stages[n].filter(t=>t.id!==e);const r=t.stages[n].find(e=>"INBOX"===e.name);if(r){const a=t.crms.find(e=>e.id===n);a&&"whatsapp_labels"!==a.type&&"custom_tabs"!==a.type?t.assignments=t.assignments.filter(t=>t.stageId!==e):t.assignments.forEach(t=>{t.stageId===e&&(t.stageId=r.id,t.assignedAt=Date.now())})}else t.assignments=t.assignments.filter(t=>t.stageId!==e);return this.setState(t),!0}}return!1}static reorderStages(e,t){const n=this.getState();if(!n.stages[e])return!1;const a=new Map(n.stages[e].map(e=>[e.id,e]));let r=0;const o=[],i=n.stages[e].find(e=>"INBOX"===e.name.toUpperCase());return i&&(i.position=r++,o.push(i)),t.forEach(e=>{const t=a.get(e);t&&"INBOX"!==t.name.toUpperCase()&&(t.position=r++,o.push(t))}),n.stages[e].forEach(e=>{o.find(t=>t.id===e.id)||(e.position=r++,o.push(e))}),n.stages[e]=o,this.setState(n),!0}static getChatAssignment(e,t){return this.getState().assignments.find(n=>n.chatId===e&&n.crmId===t)}static getChatsInStage(e){return this.getState().assignments.filter(t=>t.stageId===e)}static moveChatToStage(e,t,n,a,r){const o=this.getState(),i=o.assignments.findIndex(t=>t.chatId===e&&t.crmId===n);if(-1!==i){const e=o.assignments[i],n={...e,stageId:t,assignedAt:Date.now(),dealValue:void 0!==a?a:e.dealValue,notes:void 0!==r?r:e.notes,history:[...e.history||[],{fromStageId:e.stageId,toStageId:t,movedAt:Date.now()}]};return o.assignments[i]=n,this.setState(o),n}{const i={id:`assignment-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,chatId:e,stageId:t,crmId:n,assignedAt:Date.now(),dealValue:a,notes:r,history:[{fromStageId:null,toStageId:t,movedAt:Date.now()}]};return o.assignments.push(i),this.setState(o),i}}static removeChatFromCRM(e,t){const n=this.getState(),a=n.assignments.length;return n.assignments=n.assignments.filter(n=>!(n.chatId===e&&n.crmId===t)),n.assignments.length<a&&(this.setState(n),!0)}static getActiveCrmId(){return this.getState().activeCrmId}static setActiveCrmId(e){const t=this.getState();t.activeCrmId=e,this.setState(t)}static cacheChat(e){const t=this.getState();t.chatsCache[e.id]=e,this.setState(t)}static getCachedChat(e){return this.getState().chatsCache[e]}static getCRMWithStages(e){const t=this.getCRM(e);if(!t)return;if("whatsapp_labels"===t.type){if(!(this.getState().stages[e]||[]).some(e=>"INBOX"===e.name)){const t={id:`stage-inbox-${e}`,crmId:e,name:"INBOX",color:"#808080",position:0,isSystemGenerated:!0},n=this.getState();n.stages[e]||(n.stages[e]=[]),n.stages[e].forEach(e=>{e.position=(e.position||0)+1}),n.stages[e].unshift(t),this.setState(n)}}const n=this.getStages(e),a=this.getState().assignments.filter(t=>t.crmId===e),r=a.length,o=a.reduce((e,t)=>e+(t.dealValue||0),0);return{...t,stages:n,totalChats:r,totalValue:o}}static initializeDefaultCRMs(){const e=this.getState(),t=new Map,n=new Map,a=[];for(const r of e.crms)if("whatsapp_labels"===r.type||"custom_tabs"===r.type)t.has(r.type)?a.push(r.id):t.set(r.type,r.id);else if("user"===r.type){const e=(r.name||"").toLowerCase().trim();n.has(e)?a.push(r.id):n.set(e,r.id)}if(a.length>0){e.crms=e.crms.filter(e=>!a.includes(e.id));for(const t of a)delete e.stages[t]}const r=e.crms.some(e=>e.id===s||"whatsapp_labels"===e.type),o=e.crms.some(e=>e.id===l||"custom_tabs"===e.type);if(r){if(!(e.stages[s]||[]).some(e=>"INBOX"===e.name)){const t={id:`stage-inbox-${s}`,crmId:s,name:"INBOX",color:"#808080",position:0,isSystemGenerated:!0};e.stages[s]||(e.stages[s]=[]),e.stages[s].unshift(t),e.stages[s].forEach((e,n)=>{e.id!==t.id&&(e.position=n)})}}else{const t={id:s,name:"WhatsApp Labels",type:"whatsapp_labels",isDefault:!0,position:0,createdAt:Date.now(),updatedAt:Date.now()};e.crms.push(t),e.stages[t.id]=[{id:`stage-inbox-${s}`,crmId:s,name:"INBOX",color:"#808080",position:0,isSystemGenerated:!0}]}if(o){if(!(e.stages[l]||[]).some(e=>"INBOX"===e.name)){const t={id:`stage-inbox-${l}`,crmId:l,name:"INBOX",color:"#6b7280",position:0,isSystemGenerated:!1};e.stages[l]||(e.stages[l]=[]),e.stages[l].unshift(t),e.stages[l].forEach((e,n)=>{e.id!==t.id&&(e.position=n)})}}else{const t={id:l,name:"Custom Tabs",type:"custom_tabs",isDefault:!0,position:1,createdAt:Date.now(),updatedAt:Date.now()};e.crms.push(t),e.stages[t.id]=[{id:`stage-inbox-${l}`,crmId:l,name:"INBOX",color:"#6b7280",position:0,isSystemGenerated:!1}]}!e.activeCrmId&&e.crms.length>0&&(e.activeCrmId=e.crms[0].id),this.setState(e)}static clear(){this.setState(c())}static getDefaultCRMIds(){return{whatsappLabels:s,customTabs:l}}static async getStateAsync(){try{const e=await r().storage.local.get(i);if(e[i])return e[i]}catch(e){}return c()}static async setStateAsync(e){try{e.lastSync=Date.now(),await r().storage.local.set({[i]:e})}catch(e){}}static async syncToChrome(){try{const e=this.getState();await this.setStateAsync(e)}catch(e){}}static async getCRMsAsync(){return(await this.getStateAsync()).crms.sort((e,t)=>e.position-t.position)}static async getStagesAsync(e){return((await this.getStateAsync()).stages[e]||[]).sort((e,t)=>"INBOX"===e.name?-1:"INBOX"===t.name?1:e.position-t.position)}static async setStagesAsync(e,t){const n=await this.getStateAsync();if(e===s||e===l){if(!t.some(e=>"INBOX"===e.name)){const n={id:`stage-inbox-${e}`,crmId:e,name:"INBOX",color:"#808080",position:0,isSystemGenerated:!0};t=t.map(e=>({...e,position:e.position+1})),t=[n,...t]}}n.stages[e]=t,await this.setStateAsync(n)}static async initializeDefaultCRMsAsync(){const e=await this.getStateAsync(),t=new Set,n=new Set;e.crms=e.crms.filter(e=>{if(n.has(e.id))return!1;if(n.add(e.id),"whatsapp_labels"===e.type||"custom_tabs"===e.type){if(t.has(e.type))return!1;t.add(e.type)}return!0});const a=e.crms.some(e=>e.id===s||"whatsapp_labels"===e.type),r=e.crms.some(e=>e.id===l||"custom_tabs"===e.type);if(a){if(!(e.stages[s]||[]).some(e=>"INBOX"===e.name)){const t={id:`stage-inbox-${s}`,crmId:s,name:"INBOX",color:"#808080",position:0,isSystemGenerated:!0};e.stages[s]||(e.stages[s]=[]),e.stages[s].unshift(t),e.stages[s].forEach((e,n)=>{e.id!==t.id&&(e.position=n)})}}else{const t={id:s,name:"WhatsApp Labels",type:"whatsapp_labels",isDefault:!0,position:0,createdAt:Date.now(),updatedAt:Date.now()};e.crms.push(t),e.stages[t.id]=[{id:`stage-inbox-${s}`,crmId:s,name:"INBOX",color:"#808080",position:0,isSystemGenerated:!0}]}if(!r){const t={id:l,name:"Custom Tabs",type:"custom_tabs",isDefault:!0,position:1,createdAt:Date.now(),updatedAt:Date.now()};e.crms.push(t),e.stages[t.id]=[{id:`stage-inbox-${l}`,crmId:l,name:"INBOX",color:"#6b7280",position:0,isSystemGenerated:!1}]}!e.activeCrmId&&e.crms.length>0&&(e.activeCrmId=e.crms[0].id),await this.setStateAsync(e)}static async setActiveCrmIdAsync(e){const t=await this.getStateAsync();t.activeCrmId=e,await this.setStateAsync(t)}}},1132(e,t,n){"use strict";n.d(t,{mediaDB:()=>o});const a="wa_template_media_db",r="media_files";const o=new class{constructor(){this.db=null,this.initPromise=null}async init(){if(this.db){if(this.db.objectStoreNames.contains(r))return;this.db.close(),this.db=null,this.initPromise=null}return this.initPromise||(this.initPromise=this._openDB()),this.initPromise}_openDB(){return new Promise((e,t)=>{let n;try{n=indexedDB.open(a,2)}catch(e){return void t(e)}n.onerror=()=>{this.initPromise=null,t(n.error)},n.onsuccess=()=>{if(this.db=n.result,!this.db.objectStoreNames.contains(r)){this.db.close(),this.db=null,this.initPromise=null;const n=indexedDB.deleteDatabase(a);return n.onsuccess=()=>{this._openDB().then(e).catch(t)},void(n.onerror=()=>{t(new Error("Failed to delete and recreate database"))})}e()},n.onupgradeneeded=e=>{const t=e.target.result;if(!t.objectStoreNames.contains(r)){t.createObjectStore(r,{keyPath:"id"}).createIndex("timestamp","timestamp",{unique:!1})}}})}async saveMedia(e,t,n,a){if(await this.init(),!this.db)throw new Error("Database not initialized");const o={id:e,name:t,type:n,data:a,size:a.length,timestamp:Date.now()};return new Promise((e,t)=>{try{const n=this.db.transaction([r],"readwrite"),a=n.objectStore(r).put(o);a.onsuccess=()=>{e()},a.onerror=()=>{t(a.error)}}catch(e){this.db=null,this.initPromise=null,t(e)}})}async getMedia(e){if(await this.init(),!this.db)throw new Error("Database not initialized");return new Promise((t,n)=>{try{const a=this.db.transaction([r],"readonly"),o=a.objectStore(r).get(e);o.onsuccess=()=>{t(o.result||null)},o.onerror=()=>{n(o.error)}}catch(e){this.db=null,this.initPromise=null,n(e)}})}async getMultipleMedia(e){await this.init();const t={};for(const n of e){const e=await this.getMedia(n);e&&(t[n]=e)}return t}async deleteMedia(e){if(await this.init(),!this.db)throw new Error("Database not initialized");return new Promise((t,n)=>{try{const a=this.db.transaction([r],"readwrite"),o=a.objectStore(r).delete(e);o.onsuccess=()=>{t()},o.onerror=()=>{n(o.error)}}catch(e){this.db=null,this.initPromise=null,n(e)}})}async deleteMultipleMedia(e){for(const t of e)await this.deleteMedia(t)}async getAllMedia(){if(await this.init(),!this.db)throw new Error("Database not initialized");return new Promise((e,t)=>{try{const n=this.db.transaction([r],"readonly"),a=n.objectStore(r).getAll();a.onsuccess=()=>{e(a.result||[])},a.onerror=()=>{t(a.error)}}catch(e){this.db=null,this.initPromise=null,t(e)}})}async clearAllMedia(){if(await this.init(),!this.db)throw new Error("Database not initialized");return new Promise((e,t)=>{try{const n=this.db.transaction([r],"readwrite"),a=n.objectStore(r).clear();a.onsuccess=()=>{e()},a.onerror=()=>{t(a.error)}}catch(e){this.db=null,this.initPromise=null,t(e)}})}async getStorageSize(){return(await this.getAllMedia()).reduce((e,t)=>e+t.size,0)}async getStats(){const e=await this.getAllMedia(),t=e.reduce((e,t)=>e+t.size,0);return{count:e.length,totalSize:t,totalSizeMB:parseFloat((t/1024/1024).toFixed(2))}}}},6839(e,t,n){"use strict";n.d(t,{EB:()=>i,R$:()=>d,TabsStorage:()=>v,al:()=>s,bu:()=>l,ky:()=>c});var a=n(600);const r="wa_extension_tabs",o="kanban_tabs",i="all",s="one-to-one",l="groups",c="unread",d="unsaved";let m=null;const p=()=>({id:i,title:(0,a.t)("tabs.all"),details:(0,a.t)("tabs.allChats")||"All chats",chats:[],isPermanent:!0,isSystemFilter:!0,createdAt:Date.now(),updatedAt:Date.now()}),u=()=>({id:s,title:(0,a.t)("tabs.oneToOne")||"1:1",details:(0,a.t)("tabs.individualChats")||"Individual chats only",chats:[],isPermanent:!0,isSystemFilter:!0,createdAt:Date.now(),updatedAt:Date.now()}),g=()=>({id:l,title:(0,a.t)("tabs.groups")||"Groups",details:(0,a.t)("tabs.groupChats")||"Group chats only",chats:[],isPermanent:!0,isSystemFilter:!0,createdAt:Date.now(),updatedAt:Date.now()}),h=()=>({id:c,title:(0,a.t)("tabs.unread")||"Unread",details:(0,a.t)("tabs.unreadChats")||"Unread chats only",chats:[],isPermanent:!0,isSystemFilter:!0,createdAt:Date.now(),updatedAt:Date.now()}),b=()=>({id:d,title:(0,a.t)("tabs.unsaved")||"Unsaved",details:(0,a.t)("tabs.unsavedContacts")||"Unsaved contacts only",chats:[],isPermanent:!0,isSystemFilter:!0,createdAt:Date.now(),updatedAt:Date.now()}),f=()=>({activeView:"tabs",activeTabId:i,tabs:[p(),u(),g(),h(),b()]});class v{static async initialize(){try{if(!chrome?.runtime?.id)return;const e=await chrome.storage.local.get([r]);if(e[r])m=e[r];else{const e=localStorage.getItem(r);e?(m=JSON.parse(e),await this.saveToStorage(m),localStorage.removeItem(r)):(m=f(),await this.saveToStorage(m))}this.ensurePermanentTabs(),this.setupStorageChangeListener()}catch(e){m=f()}}static setupStorageChangeListener(){this.storageListenerAdded||(this.storageListenerAdded=!0,chrome.storage.onChanged.addListener((e,t)=>{"local"===t&&e[r]&&e[r].newValue&&(m=e[r].newValue,this.ensurePermanentTabs(),"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent("wa-tab-data-updated",{detail:{source:"storage-change"}})))}))}static ensurePermanentTabs(){m&&(m.tabs=m.tabs.filter(e=>e.id!==i&&e.id!==s&&e.id!==l&&e.id!==c&&e.id!==d),m.tabs.unshift(b()),m.tabs.unshift(h()),m.tabs.unshift(g()),m.tabs.unshift(u()),m.tabs.unshift(p()))}static async saveToStorage(e){try{if(!chrome?.runtime?.id)return;await chrome.storage.local.set({[r]:e});const t=e.tabs.filter(e=>!e.isPermanent);await chrome.storage.local.set({[o]:t});for(const e of t);}catch(e){}}static getState(){if(!m)try{const e=localStorage.getItem(r);m=e?JSON.parse(e):f()}catch(e){m=f()}return this.ensurePermanentTabs(),m}static setState(e){m=e,this.saveToStorage(e).catch(e=>{})}static getTabs(){return this.getState().tabs}static getTab(e){return this.getState().tabs.find(t=>t.id===e)}static addTab(e){const t=this.getState(),n={...e,id:`tab-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,createdAt:Date.now(),updatedAt:Date.now()};return t.tabs.push(n),this.setState(t),"undefined"!=typeof window&&"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent("wa-tab-data-updated",{detail:{tabId:n.id}})),n}static updateTab(e,t){const n=this.getState(),a=n.tabs.findIndex(t=>t.id===e);if(-1===a)return!1;const r=n.tabs[a];if(r.isPermanent){const{title:e,details:o,isPermanent:i,...s}=t;n.tabs[a]={...r,...s,updatedAt:Date.now()}}else n.tabs[a]={...r,...t,updatedAt:Date.now()};return this.setState(n),"undefined"!=typeof window&&"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent("wa-tab-data-updated",{detail:{tabId:e}})),!0}static deleteTab(e){const t=this.getState(),n=t.tabs.find(t=>t.id===e);return!(!n||n.isPermanent)&&(t.tabs=t.tabs.filter(t=>t.id!==e),t.activeTabId===e&&(t.activeTabId=i),this.setState(t),"undefined"!=typeof window&&"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent("wa-tab-deleted",{detail:{tabId:e}})),!0)}static getActiveView(){return this.getState().activeView}static setActiveView(e){const t=this.getState();t.activeView=e,this.setState(t)}static getActiveTabId(){return this.getState().activeTabId}static setActiveTab(e){const t=this.getState();return!!t.tabs.find(t=>t.id===e)&&(t.activeTabId=e,this.setState(t),!0)}static clear(){this.setState(f())}}v.storageListenerAdded=!1},1872(e,t,n){"use strict";n.d(t,{TemplatesStorage:()=>l});var a=n(3861),r=n(1132);const o="wa_templates",i="wa_template_categories";function s(e){if(e.messages&&e.messages.length>0)return e;const t={id:(0,a.Ok)(),message:e.message||"",attachmentType:e.sendAttachmentType||"none",attachments:e.attachemnt||[],pollData:e.pollData,listData:e.listData,selectedContact:e.selectedContact,selectedProducts:e.selectedProducts,buttonsData:e.buttonsData,delay:{min:3,max:5}};return{...e,messages:[t]}}class l{static async getTemplatesAsync(){try{if("undefined"!=typeof chrome&&chrome.storage){const e=(await chrome.storage.local.get(o))[o];if(e&&Array.isArray(e)){return e.map(s)}}return[]}catch(e){return[]}}static getTemplates(){try{const e=localStorage.getItem(o);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return[]}}static getTemplate(e){return this.getTemplates().find(t=>t.id===e)||null}static async saveTemplatesAsync(e){try{return!("undefined"==typeof chrome||!chrome.storage)&&(await chrome.storage.local.set({[o]:e}),!0)}catch(e){return!1}}static saveTemplates(e){try{return!("undefined"==typeof chrome||!chrome.storage)&&(chrome.storage.local.set({[o]:e}).then(()=>{}).catch(e=>{}),!0)}catch(e){return!1}}static async createTemplateAsync(e){const t=await this.getTemplatesAsync(),n={...e,id:this.generateId(),createdAt:Date.now(),modifiedAt:Date.now()};return t.push(n),await this.saveTemplatesAsync(t),n}static async updateTemplateAsync(e,t){const n=await this.getTemplatesAsync(),a=n.findIndex(t=>t.id===e);return-1!==a&&(n[a]={...n[a],...t,id:e,modifiedAt:Date.now()},await this.saveTemplatesAsync(n))}static async deleteTemplateAsync(e){const t=await this.getTemplatesAsync(),n=t.filter(t=>t.id!==e);return n.length!==t.length&&(await this.deleteTemplateMedia(e),await this.saveTemplatesAsync(n))}static async saveTemplateAsync(e){const t=await this.getTemplatesAsync(),n=t.findIndex(t=>t.id===e.id);return n>=0?t[n]={...e,modifiedAt:Date.now()}:t.push({...e,createdAt:Date.now(),modifiedAt:Date.now()}),await this.saveTemplatesAsync(t)}static async reorderTemplateAsync(e,t,n=!0){const a=await this.getTemplatesAsync(),r=a.find(t=>t.id===e),o=a.find(e=>e.id===t);if(!r||!o)return!1;const i=e=>e&&"uncategorized"!==e?e:null,s=i(r.categoryId),l=i(o.categoryId);if(s!==l)return!1;const c=a.filter(e=>i(e.categoryId)===s).sort((e,t)=>(e.sortOrder??999)-(t.sortOrder??999)),d=c.findIndex(t=>t.id===e);d>-1&&c.splice(d,1);let m=c.findIndex(e=>e.id===t);return-1===m?c.push(r):(n||m++,c.splice(m,0,r)),c.forEach((e,t)=>{const n=a.find(t=>t.id===e.id);n&&(n.sortOrder=t,n.modifiedAt=Date.now())}),await this.saveTemplatesAsync(a)}static async reorderCategoryAsync(e,t,n=!0){const r=await this.getCategoriesAsync(),o=r.filter(e=>!Object.values(a.gh).includes(e.id)),i=o.find(t=>t.id===e),s=o.find(e=>e.id===t);if(!i)return!1;const l=o.findIndex(t=>t.id===e);l>-1&&o.splice(l,1);let c=o.length;s&&(c=o.findIndex(e=>e.id===t),!n&&c>-1&&c++),o.splice(c,0,i),o.forEach((e,t)=>{e.order=t});const d=[...r.filter(e=>Object.values(a.gh).includes(e.id)),...o];return await this.saveCategoriesAsync(d)}static createTemplate(e){const t=this.getTemplates(),n={...e,id:this.generateId(),createdAt:Date.now(),modifiedAt:Date.now()};return t.push(n),this.saveTemplates(t),n}static updateTemplate(e,t){const n=this.getTemplates(),a=n.findIndex(t=>t.id===e);return-1!==a&&(n[a]={...n[a],...t,id:e,modifiedAt:Date.now()},this.saveTemplates(n))}static deleteTemplate(e){const t=this.getTemplates(),n=t.filter(t=>t.id!==e);return n.length!==t.length&&(this.deleteTemplateMedia(e),this.saveTemplates(n))}static async filterTemplatesAsync(e){let t=await this.getTemplatesAsync();return e.messageType&&(t=t.filter(t=>t.messageType===e.messageType)),void 0!==e.isActive&&(t=t.filter(t=>t.isActive===e.isActive)),e.attachmentType&&(t=t.filter(t=>t.sendAttachmentType===e.attachmentType)),e.categoryId&&(e.categoryId===a.gh.ALL||(t=e.categoryId===a.gh.QUICK_REPLY?t.filter(e=>"quick_reply"===e.messageType):e.categoryId===a.gh.UNCATEGORIZED?t.filter(e=>!e.categoryId||e.categoryId===a.gh.UNCATEGORIZED):t.filter(t=>t.categoryId===e.categoryId))),t}static async getStatsAsync(){const e=await this.getTemplatesAsync(),t={totalTemplates:e.length,activeTemplates:e.filter(e=>e.isActive).length,inactiveTemplates:e.filter(e=>!e.isActive).length,byMessageType:{individual:0,tab:0,group:0,label:0,kanban:0,quick_reply:0},byAttachmentType:{none:0,"image/video":0,document:0,audio:0,contact:0,poll:0,list:0,product:0,buttons:0,fluxo:0}};return e.forEach(e=>{t.byMessageType[e.messageType]++,t.byAttachmentType[e.sendAttachmentType]++}),t}static filterTemplates(e){let t=this.getTemplates();return e.messageType&&(t=t.filter(t=>t.messageType===e.messageType)),void 0!==e.isActive&&(t=t.filter(t=>t.isActive===e.isActive)),e.attachmentType&&(t=t.filter(t=>t.sendAttachmentType===e.attachmentType)),t}static getStats(){const e=this.getTemplates(),t={totalTemplates:e.length,activeTemplates:e.filter(e=>e.isActive).length,inactiveTemplates:e.filter(e=>!e.isActive).length,byMessageType:{individual:0,tab:0,group:0,label:0,kanban:0,quick_reply:0},byAttachmentType:{none:0,"image/video":0,document:0,audio:0,contact:0,poll:0,list:0,product:0,buttons:0,fluxo:0}};return e.forEach(e=>{t.byMessageType[e.messageType]++,t.byAttachmentType[e.sendAttachmentType]++}),t}static async duplicateTemplateAsync(e){const t=(await this.getTemplatesAsync()).find(t=>t.id===e);if(!t)return null;const{id:n,createdAt:a,modifiedAt:r,templeteName:o,...i}=t;return await this.createTemplateAsync({...i,templeteName:`${o} (Copy)`})}static async toggleActiveAsync(e){const t=(await this.getTemplatesAsync()).find(t=>t.id===e);return!!t&&await this.updateTemplateAsync(e,{isActive:!t.isActive})}static duplicateTemplate(e){const t=this.getTemplate(e);if(!t)return null;const{id:n,createdAt:a,modifiedAt:r,templeteName:o,...i}=t;return this.createTemplate({...i,templeteName:`${o} (Copy)`})}static toggleActive(e){const t=this.getTemplate(e);return!!t&&this.updateTemplate(e,{isActive:!t.isActive})}static generateId(){return`tpl_${Date.now()}_${Math.random().toString(36).substring(2,15)}`}static async saveMedia(e,t){try{const n=await this.fileToBase64(t),a=`${e}_${Date.now()}_${t.name}`;return await r.mediaDB.saveMedia(a,t.name,t.type,n),a}catch(e){throw e}}static async getMedia(e){try{const t=await r.mediaDB.getMedia(e);return t?{key:t.id,name:t.name,type:t.type,size:t.size,base64:t.data,createdAt:t.timestamp}:null}catch(e){return null}}static async getAllMedia(){try{const e=await r.mediaDB.getAllMedia(),t={};return e.forEach(e=>{t[e.id]={key:e.id,name:e.name,type:e.type,size:e.size,base64:e.data,createdAt:e.timestamp}}),t}catch(e){return{}}}static async deleteMedia(e){try{return await r.mediaDB.deleteMedia(e),!0}catch(e){return!1}}static async deleteTemplateMedia(e){try{const t=await this.getAllMedia(),n=[];return Object.keys(t).forEach(t=>{t.startsWith(`${e}_`)&&n.push(t)}),n.length>0&&await r.mediaDB.deleteMultipleMedia(n),!0}catch(e){return!1}}static fileToBase64(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>{const e=a.result;t(e)},a.onerror=()=>{n(new Error("Failed to read file"))},a.readAsDataURL(e)})}static async getMediaStorageStats(){const e=await this.getAllMedia(),t={totalFiles:0,totalSize:0,totalSizeMB:0,byTemplate:{}};return Object.entries(e).forEach(([e,n])=>{t.totalFiles++,t.totalSize+=n.size||0;const a=e.split("_")[0]+"_"+e.split("_")[1];t.byTemplate[a]=(t.byTemplate[a]||0)+1}),t.totalSizeMB=parseFloat((t.totalSize/1024/1024).toFixed(2)),t}static async cleanupOrphanedMedia(){const e=this.getTemplates(),t=new Set(e.map(e=>e.id)),n=await this.getAllMedia(),a=[];return Object.keys(n).forEach(e=>{const n=e.split("_").slice(0,2).join("_");t.has(n)||a.push(e)}),a.length>0&&await r.mediaDB.deleteMultipleMedia(a),a.length}static exportTemplates(){const e=this.getTemplates();return JSON.stringify(e,null,2)}static importTemplates(e,t=!1){try{const n=JSON.parse(e);if(!Array.isArray(n))throw new Error("Invalid template data format");let a;if(t){const e=this.getTemplates(),t=(new Set(e.map(e=>e.id)),n.map(e=>({...e,id:this.generateId(),createdAt:Date.now(),modifiedAt:Date.now()})));a=[...e,...t]}else a=n.map(e=>({...e,id:this.generateId(),createdAt:Date.now(),modifiedAt:Date.now()}));return this.saveTemplates(a)}catch(e){return!1}}static async clearAll(){try{return localStorage.removeItem(o),localStorage.removeItem("wa_template_media"),await r.mediaDB.clearAllMedia(),!0}catch(e){return!1}}static async getCategoriesAsync(){try{if("undefined"!=typeof chrome&&chrome.storage){let e=(await chrome.storage.local.get(i))[i];return e&&Array.isArray(e)&&0!==e.length||(e=a.Bl.map(e=>({...e,createdAt:Date.now()})),await this.saveCategoriesAsync(e)),e.sort((e,t)=>e.order-t.order),e}return a.Bl}catch(e){return a.Bl}}static async saveCategoriesAsync(e){try{return!("undefined"==typeof chrome||!chrome.storage)&&(await chrome.storage.local.set({[i]:e}),!0)}catch(e){return!1}}static async createCategoryAsync(e){const t=await this.getCategoriesAsync(),n=Math.max(...t.filter(e=>e.id!==a.gh.UNCATEGORIZED).map(e=>e.order),0),r={...e,id:(0,a.fO)(),order:n+1,createdAt:Date.now()};return t.push(r),await this.saveCategoriesAsync(t),r}static async updateCategoryAsync(e,t){if(Object.values(a.gh).includes(e)){const{name:e}=t;if(Object.keys(t).length>1||!e)return!1}const n=await this.getCategoriesAsync(),r=n.findIndex(t=>t.id===e);return-1!==r&&(n[r]={...n[r],...t,id:e},await this.saveCategoriesAsync(n))}static async deleteCategoryAsync(e){if(Object.values(a.gh).includes(e))return!1;const t=await this.getCategoriesAsync(),n=t.filter(t=>t.id!==e);if(n.length===t.length)return!1;const r=(await this.getTemplatesAsync()).map(t=>t.categoryId===e?{...t,categoryId:a.gh.UNCATEGORIZED,modifiedAt:Date.now()}:t);return await this.saveTemplatesAsync(r),await this.saveCategoriesAsync(n),!0}static async reorderCategoriesAsync(e){const t=await this.getCategoriesAsync();return e.forEach((e,n)=>{const r=t.find(t=>t.id===e);r&&e!==a.gh.ALL&&e!==a.gh.UNCATEGORIZED&&(r.order=n+1)}),await this.saveCategoriesAsync(t)}static async getCategoryAsync(e){return(await this.getCategoriesAsync()).find(t=>t.id===e)||null}static async getTemplateCounts(){const e=await this.getTemplatesAsync(),t={[a.gh.ALL]:e.length};return e.forEach(e=>{const n=e.categoryId||a.gh.UNCATEGORIZED;t[n]=(t[n]||0)+1}),t[a.gh.QUICK_REPLY]=e.filter(e=>"quick_reply"===e.messageType).length,t}static async getTemplatesByCategoryAsync(e){const t=await this.getTemplatesAsync();return e===a.gh.ALL?t:e===a.gh.QUICK_REPLY?t.filter(e=>"quick_reply"===e.messageType):e===a.gh.UNCATEGORIZED?t.filter(e=>!e.categoryId||e.categoryId===a.gh.UNCATEGORIZED):t.filter(t=>t.categoryId===e)}}},6815(e,t){var n,a,r;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self&&self,a=[e],n=function(e){"use strict";if(!globalThis.chrome?.runtime?.id)throw new Error("This script should only be loaded in a browser extension.");if(void 0===globalThis.browser||Object.getPrototypeOf(globalThis.browser)!==Object.prototype){const t="The message port closed before a response was received.",n=e=>{const n={alarms:{clear:{minArgs:0,maxArgs:1},clearAll:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getAll:{minArgs:0,maxArgs:0}},bookmarks:{create:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},getChildren:{minArgs:1,maxArgs:1},getRecent:{minArgs:1,maxArgs:1},getSubTree:{minArgs:1,maxArgs:1},getTree:{minArgs:0,maxArgs:0},move:{minArgs:2,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeTree:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}},browserAction:{disable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},enable:{minArgs:0,maxArgs:1,fallbackToNoCallback:!0},getBadgeBackgroundColor:{minArgs:1,maxArgs:1},getBadgeText:{minArgs:1,maxArgs:1},getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},openPopup:{minArgs:0,maxArgs:0},setBadgeBackgroundColor:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setBadgeText:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},browsingData:{remove:{minArgs:2,maxArgs:2},removeCache:{minArgs:1,maxArgs:1},removeCookies:{minArgs:1,maxArgs:1},removeDownloads:{minArgs:1,maxArgs:1},removeFormData:{minArgs:1,maxArgs:1},removeHistory:{minArgs:1,maxArgs:1},removeLocalStorage:{minArgs:1,maxArgs:1},removePasswords:{minArgs:1,maxArgs:1},removePluginData:{minArgs:1,maxArgs:1},settings:{minArgs:0,maxArgs:0}},commands:{getAll:{minArgs:0,maxArgs:0}},contextMenus:{remove:{minArgs:1,maxArgs:1},removeAll:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},cookies:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:1,maxArgs:1},getAllCookieStores:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},devtools:{inspectedWindow:{eval:{minArgs:1,maxArgs:2,singleCallbackArg:!1}},panels:{create:{minArgs:3,maxArgs:3,singleCallbackArg:!0},elements:{createSidebarPane:{minArgs:1,maxArgs:1}}}},downloads:{cancel:{minArgs:1,maxArgs:1},download:{minArgs:1,maxArgs:1},erase:{minArgs:1,maxArgs:1},getFileIcon:{minArgs:1,maxArgs:2},open:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},pause:{minArgs:1,maxArgs:1},removeFile:{minArgs:1,maxArgs:1},resume:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},extension:{isAllowedFileSchemeAccess:{minArgs:0,maxArgs:0},isAllowedIncognitoAccess:{minArgs:0,maxArgs:0}},history:{addUrl:{minArgs:1,maxArgs:1},deleteAll:{minArgs:0,maxArgs:0},deleteRange:{minArgs:1,maxArgs:1},deleteUrl:{minArgs:1,maxArgs:1},getVisits:{minArgs:1,maxArgs:1},search:{minArgs:1,maxArgs:1}},i18n:{detectLanguage:{minArgs:1,maxArgs:1},getAcceptLanguages:{minArgs:0,maxArgs:0}},identity:{launchWebAuthFlow:{minArgs:1,maxArgs:1}},idle:{queryState:{minArgs:1,maxArgs:1}},management:{get:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},getSelf:{minArgs:0,maxArgs:0},setEnabled:{minArgs:2,maxArgs:2},uninstallSelf:{minArgs:0,maxArgs:1}},notifications:{clear:{minArgs:1,maxArgs:1},create:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:0},getPermissionLevel:{minArgs:0,maxArgs:0},update:{minArgs:2,maxArgs:2}},pageAction:{getPopup:{minArgs:1,maxArgs:1},getTitle:{minArgs:1,maxArgs:1},hide:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setIcon:{minArgs:1,maxArgs:1},setPopup:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},setTitle:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0},show:{minArgs:1,maxArgs:1,fallbackToNoCallback:!0}},permissions:{contains:{minArgs:1,maxArgs:1},getAll:{minArgs:0,maxArgs:0},remove:{minArgs:1,maxArgs:1},request:{minArgs:1,maxArgs:1}},runtime:{getBackgroundPage:{minArgs:0,maxArgs:0},getPlatformInfo:{minArgs:0,maxArgs:0},openOptionsPage:{minArgs:0,maxArgs:0},requestUpdateCheck:{minArgs:0,maxArgs:0},sendMessage:{minArgs:1,maxArgs:3},sendNativeMessage:{minArgs:2,maxArgs:2},setUninstallURL:{minArgs:1,maxArgs:1}},sessions:{getDevices:{minArgs:0,maxArgs:1},getRecentlyClosed:{minArgs:0,maxArgs:1},restore:{minArgs:0,maxArgs:1}},storage:{local:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}},managed:{get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1}},sync:{clear:{minArgs:0,maxArgs:0},get:{minArgs:0,maxArgs:1},getBytesInUse:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}}},tabs:{captureVisibleTab:{minArgs:0,maxArgs:2},create:{minArgs:1,maxArgs:1},detectLanguage:{minArgs:0,maxArgs:1},discard:{minArgs:0,maxArgs:1},duplicate:{minArgs:1,maxArgs:1},executeScript:{minArgs:1,maxArgs:2},get:{minArgs:1,maxArgs:1},getCurrent:{minArgs:0,maxArgs:0},getZoom:{minArgs:0,maxArgs:1},getZoomSettings:{minArgs:0,maxArgs:1},goBack:{minArgs:0,maxArgs:1},goForward:{minArgs:0,maxArgs:1},highlight:{minArgs:1,maxArgs:1},insertCSS:{minArgs:1,maxArgs:2},move:{minArgs:2,maxArgs:2},query:{minArgs:1,maxArgs:1},reload:{minArgs:0,maxArgs:2},remove:{minArgs:1,maxArgs:1},removeCSS:{minArgs:1,maxArgs:2},sendMessage:{minArgs:2,maxArgs:3},setZoom:{minArgs:1,maxArgs:2},setZoomSettings:{minArgs:1,maxArgs:2},update:{minArgs:1,maxArgs:2}},topSites:{get:{minArgs:0,maxArgs:0}},webNavigation:{getAllFrames:{minArgs:1,maxArgs:1},getFrame:{minArgs:1,maxArgs:1}},webRequest:{handlerBehaviorChanged:{minArgs:0,maxArgs:0}},windows:{create:{minArgs:0,maxArgs:1},get:{minArgs:1,maxArgs:2},getAll:{minArgs:0,maxArgs:1},getCurrent:{minArgs:0,maxArgs:1},getLastFocused:{minArgs:0,maxArgs:1},remove:{minArgs:1,maxArgs:1},update:{minArgs:2,maxArgs:2}}};if(0===Object.keys(n).length)throw new Error("api-metadata.json has not been included in browser-polyfill");class a extends WeakMap{constructor(e,t=void 0){super(t),this.createItem=e}get(e){return this.has(e)||this.set(e,this.createItem(e)),super.get(e)}}const r=e=>e&&"object"==typeof e&&"function"==typeof e.then,o=(t,n)=>(...a)=>{e.runtime.lastError?t.reject(new Error(e.runtime.lastError.message)):n.singleCallbackArg||a.length<=1&&!1!==n.singleCallbackArg?t.resolve(a[0]):t.resolve(a)},i=e=>1==e?"argument":"arguments",s=(e,t)=>function(n,...a){if(a.length<t.minArgs)throw new Error(`Expected at least ${t.minArgs} ${i(t.minArgs)} for ${e}(), got ${a.length}`);if(a.length>t.maxArgs)throw new Error(`Expected at most ${t.maxArgs} ${i(t.maxArgs)} for ${e}(), got ${a.length}`);return new Promise((r,i)=>{if(t.fallbackToNoCallback)try{n[e](...a,o({resolve:r,reject:i},t))}catch(o){n[e](...a),t.fallbackToNoCallback=!1,t.noCallback=!0,r()}else t.noCallback?(n[e](...a),r()):n[e](...a,o({resolve:r,reject:i},t))})},l=(e,t,n)=>new Proxy(t,{apply:(t,a,r)=>n.call(a,e,...r)});let c=Function.call.bind(Object.prototype.hasOwnProperty);const d=(e,t={},n={})=>{let a=Object.create(null),r={has:(t,n)=>n in e||n in a,get(r,o,i){if(o in a)return a[o];if(!(o in e))return;let m=e[o];if("function"==typeof m)if("function"==typeof t[o])m=l(e,e[o],t[o]);else if(c(n,o)){let t=s(o,n[o]);m=l(e,e[o],t)}else m=m.bind(e);else if("object"==typeof m&&null!==m&&(c(t,o)||c(n,o)))m=d(m,t[o],n[o]);else{if(!c(n,"*"))return Object.defineProperty(a,o,{configurable:!0,enumerable:!0,get:()=>e[o],set(t){e[o]=t}}),m;m=d(m,t[o],n["*"])}return a[o]=m,m},set:(t,n,r,o)=>(n in a?a[n]=r:e[n]=r,!0),defineProperty:(e,t,n)=>Reflect.defineProperty(a,t,n),deleteProperty:(e,t)=>Reflect.deleteProperty(a,t)},o=Object.create(e);return new Proxy(o,r)},m=e=>({addListener(t,n,...a){t.addListener(e.get(n),...a)},hasListener:(t,n)=>t.hasListener(e.get(n)),removeListener(t,n){t.removeListener(e.get(n))}}),p=new a(e=>"function"!=typeof e?e:function(t){const n=d(t,{},{getContent:{minArgs:0,maxArgs:0}});e(n)}),u=new a(e=>"function"!=typeof e?e:function(t,n,a){let o,i,s=!1,l=new Promise(e=>{o=function(t){s=!0,e(t)}});try{i=e(t,n,o)}catch(e){i=Promise.reject(e)}const c=!0!==i&&r(i);if(!0!==i&&!c&&!s)return!1;const d=e=>{e.then(e=>{a(e)},e=>{let t;t=e&&(e instanceof Error||"string"==typeof e.message)?e.message:"An unexpected error occurred",a({__mozWebExtensionPolyfillReject__:!0,message:t})}).catch(e=>{})};return d(c?i:l),!0}),g=({reject:n,resolve:a},r)=>{e.runtime.lastError?e.runtime.lastError.message===t?a():n(new Error(e.runtime.lastError.message)):r&&r.__mozWebExtensionPolyfillReject__?n(new Error(r.message)):a(r)},h=(e,t,n,...a)=>{if(a.length<t.minArgs)throw new Error(`Expected at least ${t.minArgs} ${i(t.minArgs)} for ${e}(), got ${a.length}`);if(a.length>t.maxArgs)throw new Error(`Expected at most ${t.maxArgs} ${i(t.maxArgs)} for ${e}(), got ${a.length}`);return new Promise((e,t)=>{const r=g.bind(null,{resolve:e,reject:t});a.push(r),n.sendMessage(...a)})},b={devtools:{network:{onRequestFinished:m(p)}},runtime:{onMessage:m(u),onMessageExternal:m(u),sendMessage:h.bind(null,"sendMessage",{minArgs:1,maxArgs:3})},tabs:{sendMessage:h.bind(null,"sendMessage",{minArgs:2,maxArgs:3})}},f={clear:{minArgs:1,maxArgs:1},get:{minArgs:1,maxArgs:1},set:{minArgs:1,maxArgs:1}};return n.privacy={network:{"*":f},services:{"*":f},websites:{"*":f}},d(e,b,n)};e.exports=n(chrome)}else e.exports=globalThis.browser},void 0===(r="function"==typeof n?n.apply(t,a):n)||(e.exports=r)},9241(e){(function(){var t,n,a,r,o,i,s,l=[].slice,c={}.hasOwnProperty;t=function(){var e,t,n,a,r,i;if(i=arguments[0],r=2<=arguments.length?l.call(arguments,1):[],o(Object.assign))Object.assign.apply(null,arguments);else for(e=0,n=r.length;e<n;e++)if(null!=(a=r[e]))for(t in a)c.call(a,t)&&(i[t]=a[t]);return i},o=function(e){return!!e&&"[object Function]"===Object.prototype.toString.call(e)},i=function(e){var t;return!!e&&("function"==(t=typeof e)||"object"===t)},a=function(e){return o(Array.isArray)?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)},r=function(e){var t;if(a(e))return!e.length;for(t in e)if(c.call(e,t))return!1;return!0},s=function(e){var t,n;return i(e)&&(n=Object.getPrototypeOf(e))&&(t=n.constructor)&&"function"==typeof t&&t instanceof t&&Function.prototype.toString.call(t)===Function.prototype.toString.call(Object)},n=function(e){return o(e.valueOf)?e.valueOf():e},e.exports.assign=t,e.exports.isFunction=o,e.exports.isObject=i,e.exports.isArray=a,e.exports.isEmpty=r,e.exports.isPlainObject=s,e.exports.getValue=n}).call(this)},4238(e){(function(){e.exports=function(){function e(e,t,n){if(this.options=e.options,this.stringify=e.stringify,this.parent=e,null==t)throw new Error("Missing attribute name. "+this.debugInfo(t));if(null==n)throw new Error("Missing attribute value. "+this.debugInfo(t));this.name=this.stringify.attName(t),this.value=this.stringify.attValue(n)}return e.prototype.clone=function(){return Object.create(this)},e.prototype.toString=function(e){return this.options.writer.set(e).attribute(this)},e.prototype.debugInfo=function(e){return null==(e=e||this.name)?"parent: <"+this.parent.name+">":"attribute: {"+e+"}, parent: <"+this.parent.name+">"},e}()}).call(this)},2691(e,t,n){(function(){var t,a={}.hasOwnProperty;t=n(468),e.exports=function(e){function t(e,n){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing CDATA text. "+this.debugInfo());this.text=this.stringify.cdata(n)}return function(e,t){for(var n in t)a.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(t,e),t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.set(e).cdata(this)},t}(t)}).call(this)},2679(e,t,n){(function(){var t,a={}.hasOwnProperty;t=n(468),e.exports=function(e){function t(e,n){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing comment text. "+this.debugInfo());this.text=this.stringify.comment(n)}return function(e,t){for(var n in t)a.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(t,e),t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.set(e).comment(this)},t}(t)}).call(this)},4111(e,t,n){(function(){var t,a={}.hasOwnProperty;t=n(468),e.exports=function(e){function t(e,n,a,r,o,i){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing DTD element name. "+this.debugInfo());if(null==a)throw new Error("Missing DTD attribute name. "+this.debugInfo(n));if(!r)throw new Error("Missing DTD attribute type. "+this.debugInfo(n));if(!o)throw new Error("Missing DTD attribute default. "+this.debugInfo(n));if(0!==o.indexOf("#")&&(o="#"+o),!o.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(n));if(i&&!o.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(n));this.elementName=this.stringify.eleName(n),this.attributeName=this.stringify.attName(a),this.attributeType=this.stringify.dtdAttType(r),this.defaultValue=this.stringify.dtdAttDefault(i),this.defaultValueType=o}return function(e,t){for(var n in t)a.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(t,e),t.prototype.toString=function(e){return this.options.writer.set(e).dtdAttList(this)},t}(t)}).call(this)},7696(e,t,n){(function(){var t,a={}.hasOwnProperty;t=n(468),e.exports=function(e){function t(e,n,a){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing DTD element name. "+this.debugInfo());a||(a="(#PCDATA)"),Array.isArray(a)&&(a="("+a.join(",")+")"),this.name=this.stringify.eleName(n),this.value=this.stringify.dtdElementValue(a)}return function(e,t){for(var n in t)a.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(t,e),t.prototype.toString=function(e){return this.options.writer.set(e).dtdElement(this)},t}(t)}).call(this)},5529(e,t,n){(function(){var t,a,r={}.hasOwnProperty;a=n(9241).isObject,t=n(468),e.exports=function(e){function t(e,n,r,o){if(t.__super__.constructor.call(this,e),null==r)throw new Error("Missing DTD entity name. "+this.debugInfo(r));if(null==o)throw new Error("Missing DTD entity value. "+this.debugInfo(r));if(this.pe=!!n,this.name=this.stringify.eleName(r),a(o)){if(!o.pubID&&!o.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(r));if(o.pubID&&!o.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(r));if(null!=o.pubID&&(this.pubID=this.stringify.dtdPubID(o.pubID)),null!=o.sysID&&(this.sysID=this.stringify.dtdSysID(o.sysID)),null!=o.nData&&(this.nData=this.stringify.dtdNData(o.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(r))}else this.value=this.stringify.dtdEntityValue(o)}return function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);function a(){this.constructor=e}a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype}(t,e),t.prototype.toString=function(e){return this.options.writer.set(e).dtdEntity(this)},t}(t)}).call(this)},8012(e,t,n){(function(){var t,a={}.hasOwnProperty;t=n(468),e.exports=function(e){function t(e,n,a){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing DTD notation name. "+this.debugInfo(n));if(!a.pubID&&!a.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(n));this.name=this.stringify.eleName(n),null!=a.pubID&&(this.pubID=this.stringify.dtdPubID(a.pubID)),null!=a.sysID&&(this.sysID=this.stringify.dtdSysID(a.sysID))}return function(e,t){for(var n in t)a.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(t,e),t.prototype.toString=function(e){return this.options.writer.set(e).dtdNotation(this)},t}(t)}).call(this)},4130(e,t,n){(function(){var t,a,r={}.hasOwnProperty;a=n(9241).isObject,t=n(468),e.exports=function(e){function t(e,n,r,o){var i;t.__super__.constructor.call(this,e),a(n)&&(n=(i=n).version,r=i.encoding,o=i.standalone),n||(n="1.0"),this.version=this.stringify.xmlVersion(n),null!=r&&(this.encoding=this.stringify.xmlEncoding(r)),null!=o&&(this.standalone=this.stringify.xmlStandalone(o))}return function(e,t){for(var n in t)r.call(t,n)&&(e[n]=t[n]);function a(){this.constructor=e}a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype}(t,e),t.prototype.toString=function(e){return this.options.writer.set(e).declaration(this)},t}(t)}).call(this)},6376(e,t,n){(function(){var t,a,r,o,i,s,l={}.hasOwnProperty;s=n(9241).isObject,i=n(468),t=n(4111),r=n(5529),a=n(7696),o=n(8012),e.exports=function(e){function n(e,t,a){var r,o;n.__super__.constructor.call(this,e),this.name="!DOCTYPE",this.documentObject=e,s(t)&&(t=(r=t).pubID,a=r.sysID),null==a&&(a=(o=[t,a])[0],t=o[1]),null!=t&&(this.pubID=this.stringify.dtdPubID(t)),null!=a&&(this.sysID=this.stringify.dtdSysID(a))}return function(e,t){for(var n in t)l.call(t,n)&&(e[n]=t[n]);function a(){this.constructor=e}a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype}(n,e),n.prototype.element=function(e,t){var n;return n=new a(this,e,t),this.children.push(n),this},n.prototype.attList=function(e,n,a,r,o){var i;return i=new t(this,e,n,a,r,o),this.children.push(i),this},n.prototype.entity=function(e,t){var n;return n=new r(this,!1,e,t),this.children.push(n),this},n.prototype.pEntity=function(e,t){var n;return n=new r(this,!0,e,t),this.children.push(n),this},n.prototype.notation=function(e,t){var n;return n=new o(this,e,t),this.children.push(n),this},n.prototype.toString=function(e){return this.options.writer.set(e).docType(this)},n.prototype.ele=function(e,t){return this.element(e,t)},n.prototype.att=function(e,t,n,a,r){return this.attList(e,t,n,a,r)},n.prototype.ent=function(e,t){return this.entity(e,t)},n.prototype.pent=function(e,t){return this.pEntity(e,t)},n.prototype.not=function(e,t){return this.notation(e,t)},n.prototype.up=function(){return this.root()||this.documentObject},n}(i)}).call(this)},1933(e,t,n){(function(){var t,a,r,o,i={}.hasOwnProperty;o=n(9241).isPlainObject,t=n(468),r=n(3976),a=n(382),e.exports=function(e){function t(e){t.__super__.constructor.call(this,null),this.name="?xml",e||(e={}),e.writer||(e.writer=new a),this.options=e,this.stringify=new r(e),this.isDocument=!0}return function(e,t){for(var n in t)i.call(t,n)&&(e[n]=t[n]);function a(){this.constructor=e}a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype}(t,e),t.prototype.end=function(e){var t;return e?o(e)&&(t=e,e=this.options.writer.set(t)):e=this.options.writer,e.document(this)},t.prototype.toString=function(e){return this.options.writer.set(e).document(this)},t}(t)}).call(this)},400(e,t,n){(function(){var t,a,r,o,i,s,l,c,d,m,p,u,g,h,b,f,v,y,x,w,k={}.hasOwnProperty;w=n(9241),y=w.isObject,v=w.isFunction,x=w.isPlainObject,f=w.getValue,m=n(3906),a=n(2691),r=n(2679),u=n(1268),b=n(2535),p=n(5915),c=n(4130),d=n(6376),o=n(4111),s=n(5529),i=n(7696),l=n(8012),t=n(4238),h=n(3976),g=n(382),e.exports=function(){function e(e,t,n){var a;this.name="?xml",e||(e={}),e.writer?x(e.writer)&&(a=e.writer,e.writer=new g(a)):e.writer=new g(e),this.options=e,this.writer=e.writer,this.stringify=new h(e),this.onDataCallback=t||function(){},this.onEndCallback=n||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return e.prototype.node=function(e,t,n){var a,r;if(null==e)throw new Error("Missing node name.");if(this.root&&-1===this.currentLevel)throw new Error("Document can only have one root node. "+this.debugInfo(e));return this.openCurrent(),e=f(e),null===t&&null==n&&(t=(a=[{},null])[0],n=a[1]),null==t&&(t={}),t=f(t),y(t)||(n=(r=[t,n])[0],t=r[1]),this.currentNode=new m(this,e,t),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,null!=n&&this.text(n),this},e.prototype.element=function(e,t,n){return this.currentNode&&this.currentNode instanceof d?this.dtdElement.apply(this,arguments):this.node(e,t,n)},e.prototype.attribute=function(e,n){var a,r;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(e));if(null!=e&&(e=f(e)),y(e))for(a in e)k.call(e,a)&&(r=e[a],this.attribute(a,r));else v(n)&&(n=n.apply()),this.options.skipNullAttributes&&null==n||(this.currentNode.attributes[e]=new t(this,e,n));return this},e.prototype.text=function(e){var t;return this.openCurrent(),t=new b(this,e),this.onData(this.writer.text(t,this.currentLevel+1),this.currentLevel+1),this},e.prototype.cdata=function(e){var t;return this.openCurrent(),t=new a(this,e),this.onData(this.writer.cdata(t,this.currentLevel+1),this.currentLevel+1),this},e.prototype.comment=function(e){var t;return this.openCurrent(),t=new r(this,e),this.onData(this.writer.comment(t,this.currentLevel+1),this.currentLevel+1),this},e.prototype.raw=function(e){var t;return this.openCurrent(),t=new u(this,e),this.onData(this.writer.raw(t,this.currentLevel+1),this.currentLevel+1),this},e.prototype.instruction=function(e,t){var n,a,r,o,i;if(this.openCurrent(),null!=e&&(e=f(e)),null!=t&&(t=f(t)),Array.isArray(e))for(n=0,o=e.length;n<o;n++)a=e[n],this.instruction(a);else if(y(e))for(a in e)k.call(e,a)&&(r=e[a],this.instruction(a,r));else v(t)&&(t=t.apply()),i=new p(this,e,t),this.onData(this.writer.processingInstruction(i,this.currentLevel+1),this.currentLevel+1);return this},e.prototype.declaration=function(e,t,n){var a;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return a=new c(this,e,t,n),this.onData(this.writer.declaration(a,this.currentLevel+1),this.currentLevel+1),this},e.prototype.doctype=function(e,t,n){if(this.openCurrent(),null==e)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new d(this,t,n),this.currentNode.rootNodeName=e,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},e.prototype.dtdElement=function(e,t){var n;return this.openCurrent(),n=new i(this,e,t),this.onData(this.writer.dtdElement(n,this.currentLevel+1),this.currentLevel+1),this},e.prototype.attList=function(e,t,n,a,r){var i;return this.openCurrent(),i=new o(this,e,t,n,a,r),this.onData(this.writer.dtdAttList(i,this.currentLevel+1),this.currentLevel+1),this},e.prototype.entity=function(e,t){var n;return this.openCurrent(),n=new s(this,!1,e,t),this.onData(this.writer.dtdEntity(n,this.currentLevel+1),this.currentLevel+1),this},e.prototype.pEntity=function(e,t){var n;return this.openCurrent(),n=new s(this,!0,e,t),this.onData(this.writer.dtdEntity(n,this.currentLevel+1),this.currentLevel+1),this},e.prototype.notation=function(e,t){var n;return this.openCurrent(),n=new l(this,e,t),this.onData(this.writer.dtdNotation(n,this.currentLevel+1),this.currentLevel+1),this},e.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},e.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},e.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},e.prototype.openNode=function(e){if(!e.isOpen)return!this.root&&0===this.currentLevel&&e instanceof m&&(this.root=e),this.onData(this.writer.openNode(e,this.currentLevel),this.currentLevel),e.isOpen=!0},e.prototype.closeNode=function(e){if(!e.isClosed)return this.onData(this.writer.closeNode(e,this.currentLevel),this.currentLevel),e.isClosed=!0},e.prototype.onData=function(e,t){return this.documentStarted=!0,this.onDataCallback(e,t+1)},e.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},e.prototype.debugInfo=function(e){return null==e?"":"node: <"+e+">"},e.prototype.ele=function(){return this.element.apply(this,arguments)},e.prototype.nod=function(e,t,n){return this.node(e,t,n)},e.prototype.txt=function(e){return this.text(e)},e.prototype.dat=function(e){return this.cdata(e)},e.prototype.com=function(e){return this.comment(e)},e.prototype.ins=function(e,t){return this.instruction(e,t)},e.prototype.dec=function(e,t,n){return this.declaration(e,t,n)},e.prototype.dtd=function(e,t,n){return this.doctype(e,t,n)},e.prototype.e=function(e,t,n){return this.element(e,t,n)},e.prototype.n=function(e,t,n){return this.node(e,t,n)},e.prototype.t=function(e){return this.text(e)},e.prototype.d=function(e){return this.cdata(e)},e.prototype.c=function(e){return this.comment(e)},e.prototype.r=function(e){return this.raw(e)},e.prototype.i=function(e,t){return this.instruction(e,t)},e.prototype.att=function(){return this.currentNode&&this.currentNode instanceof d?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},e.prototype.a=function(){return this.currentNode&&this.currentNode instanceof d?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},e.prototype.ent=function(e,t){return this.entity(e,t)},e.prototype.pent=function(e,t){return this.pEntity(e,t)},e.prototype.not=function(e,t){return this.notation(e,t)},e}()}).call(this)},1218(e,t,n){(function(){var t,a={}.hasOwnProperty;t=n(468),e.exports=function(e){function t(e){t.__super__.constructor.call(this,e),this.isDummy=!0}return function(e,t){for(var n in t)a.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(t,e),t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return""},t}(t)}).call(this)},3906(e,t,n){(function(){var t,a,r,o,i,s,l={}.hasOwnProperty;s=n(9241),i=s.isObject,o=s.isFunction,r=s.getValue,a=n(468),t=n(4238),e.exports=function(e){function n(e,t,a){if(n.__super__.constructor.call(this,e),null==t)throw new Error("Missing element name. "+this.debugInfo());this.name=this.stringify.eleName(t),this.attributes={},null!=a&&this.attribute(a),e.isDocument&&(this.isRoot=!0,this.documentObject=e,e.rootObject=this)}return function(e,t){for(var n in t)l.call(t,n)&&(e[n]=t[n]);function a(){this.constructor=e}a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype}(n,e),n.prototype.clone=function(){var e,t,n,a;for(t in(n=Object.create(this)).isRoot&&(n.documentObject=null),n.attributes={},a=this.attributes)l.call(a,t)&&(e=a[t],n.attributes[t]=e.clone());return n.children=[],this.children.forEach(function(e){var t;return(t=e.clone()).parent=n,n.children.push(t)}),n},n.prototype.attribute=function(e,n){var a,s;if(null!=e&&(e=r(e)),i(e))for(a in e)l.call(e,a)&&(s=e[a],this.attribute(a,s));else o(n)&&(n=n.apply()),this.options.skipNullAttributes&&null==n||(this.attributes[e]=new t(this,e,n));return this},n.prototype.removeAttribute=function(e){var t,n,a;if(null==e)throw new Error("Missing attribute name. "+this.debugInfo());if(e=r(e),Array.isArray(e))for(n=0,a=e.length;n<a;n++)t=e[n],delete this.attributes[t];else delete this.attributes[e];return this},n.prototype.toString=function(e){return this.options.writer.set(e).element(this)},n.prototype.att=function(e,t){return this.attribute(e,t)},n.prototype.a=function(e,t){return this.attribute(e,t)},n}(a)}).call(this)},468(e,t,n){(function(){var t,a,r,o,i,s,l,c,d,m,p,u,g,h,b={}.hasOwnProperty;h=n(9241),g=h.isObject,u=h.isFunction,p=h.isEmpty,m=h.getValue,s=null,t=null,a=null,r=null,o=null,c=null,d=null,l=null,i=null,e.exports=function(){function e(e){this.parent=e,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.children=[],s||(s=n(3906),t=n(2691),a=n(2679),r=n(4130),o=n(6376),c=n(1268),d=n(2535),l=n(5915),i=n(1218))}return e.prototype.element=function(e,t,n){var a,r,o,i,s,l,c,d,h,f,v;if(l=null,null===t&&null==n&&(t=(h=[{},null])[0],n=h[1]),null==t&&(t={}),t=m(t),g(t)||(n=(f=[t,n])[0],t=f[1]),null!=e&&(e=m(e)),Array.isArray(e))for(o=0,c=e.length;o<c;o++)r=e[o],l=this.element(r);else if(u(e))l=this.element(e.apply());else if(g(e)){for(s in e)if(b.call(e,s))if(v=e[s],u(v)&&(v=v.apply()),g(v)&&p(v)&&(v=null),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&0===s.indexOf(this.stringify.convertAttKey))l=this.attribute(s.substr(this.stringify.convertAttKey.length),v);else if(!this.options.separateArrayItems&&Array.isArray(v))for(i=0,d=v.length;i<d;i++)r=v[i],(a={})[s]=r,l=this.element(a);else g(v)?(l=this.element(s)).element(v):l=this.element(s,v)}else l=this.options.skipNullNodes&&null===n?this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&0===e.indexOf(this.stringify.convertTextKey)?this.text(n):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&0===e.indexOf(this.stringify.convertCDataKey)?this.cdata(n):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&0===e.indexOf(this.stringify.convertCommentKey)?this.comment(n):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&0===e.indexOf(this.stringify.convertRawKey)?this.raw(n):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&0===e.indexOf(this.stringify.convertPIKey)?this.instruction(e.substr(this.stringify.convertPIKey.length),n):this.node(e,t,n);if(null==l)throw new Error("Could not create any elements with: "+e+". "+this.debugInfo());return l},e.prototype.insertBefore=function(e,t,n){var a,r,o;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(e));return r=this.parent.children.indexOf(this),o=this.parent.children.splice(r),a=this.parent.element(e,t,n),Array.prototype.push.apply(this.parent.children,o),a},e.prototype.insertAfter=function(e,t,n){var a,r,o;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(e));return r=this.parent.children.indexOf(this),o=this.parent.children.splice(r+1),a=this.parent.element(e,t,n),Array.prototype.push.apply(this.parent.children,o),a},e.prototype.remove=function(){var e;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return e=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[e,e-e+1].concat([])),this.parent},e.prototype.node=function(e,t,n){var a,r;return null!=e&&(e=m(e)),t||(t={}),t=m(t),g(t)||(n=(r=[t,n])[0],t=r[1]),a=new s(this,e,t),null!=n&&a.text(n),this.children.push(a),a},e.prototype.text=function(e){var t;return t=new d(this,e),this.children.push(t),this},e.prototype.cdata=function(e){var n;return n=new t(this,e),this.children.push(n),this},e.prototype.comment=function(e){var t;return t=new a(this,e),this.children.push(t),this},e.prototype.commentBefore=function(e){var t,n;return t=this.parent.children.indexOf(this),n=this.parent.children.splice(t),this.parent.comment(e),Array.prototype.push.apply(this.parent.children,n),this},e.prototype.commentAfter=function(e){var t,n;return t=this.parent.children.indexOf(this),n=this.parent.children.splice(t+1),this.parent.comment(e),Array.prototype.push.apply(this.parent.children,n),this},e.prototype.raw=function(e){var t;return t=new c(this,e),this.children.push(t),this},e.prototype.dummy=function(){var e;return e=new i(this),this.children.push(e),e},e.prototype.instruction=function(e,t){var n,a,r,o,i;if(null!=e&&(e=m(e)),null!=t&&(t=m(t)),Array.isArray(e))for(o=0,i=e.length;o<i;o++)n=e[o],this.instruction(n);else if(g(e))for(n in e)b.call(e,n)&&(a=e[n],this.instruction(n,a));else u(t)&&(t=t.apply()),r=new l(this,e,t),this.children.push(r);return this},e.prototype.instructionBefore=function(e,t){var n,a;return n=this.parent.children.indexOf(this),a=this.parent.children.splice(n),this.parent.instruction(e,t),Array.prototype.push.apply(this.parent.children,a),this},e.prototype.instructionAfter=function(e,t){var n,a;return n=this.parent.children.indexOf(this),a=this.parent.children.splice(n+1),this.parent.instruction(e,t),Array.prototype.push.apply(this.parent.children,a),this},e.prototype.declaration=function(e,t,n){var a,o;return a=this.document(),o=new r(a,e,t,n),a.children[0]instanceof r?a.children[0]=o:a.children.unshift(o),a.root()||a},e.prototype.doctype=function(e,t){var n,a,r,i,s,l,c,d,m;for(n=this.document(),a=new o(n,e,t),r=i=0,l=(d=n.children).length;i<l;r=++i)if(d[r]instanceof o)return n.children[r]=a,a;for(r=s=0,c=(m=n.children).length;s<c;r=++s)if(m[r].isRoot)return n.children.splice(r,0,a),a;return n.children.push(a),a},e.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},e.prototype.root=function(){var e;for(e=this;e;){if(e.isDocument)return e.rootObject;if(e.isRoot)return e;e=e.parent}},e.prototype.document=function(){var e;for(e=this;e;){if(e.isDocument)return e;e=e.parent}},e.prototype.end=function(e){return this.document().end(e)},e.prototype.prev=function(){var e;for(e=this.parent.children.indexOf(this);e>0&&this.parent.children[e-1].isDummy;)e-=1;if(e<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[e-1]},e.prototype.next=function(){var e;for(e=this.parent.children.indexOf(this);e<this.parent.children.length-1&&this.parent.children[e+1].isDummy;)e+=1;if(-1===e||e===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[e+1]},e.prototype.importDocument=function(e){var t;return(t=e.root().clone()).parent=this,t.isRoot=!1,this.children.push(t),this},e.prototype.debugInfo=function(e){var t,n;return null!=(e=e||this.name)||(null!=(t=this.parent)?t.name:void 0)?null==e?"parent: <"+this.parent.name+">":(null!=(n=this.parent)?n.name:void 0)?"node: <"+e+">, parent: <"+this.parent.name+">":"node: <"+e+">":""},e.prototype.ele=function(e,t,n){return this.element(e,t,n)},e.prototype.nod=function(e,t,n){return this.node(e,t,n)},e.prototype.txt=function(e){return this.text(e)},e.prototype.dat=function(e){return this.cdata(e)},e.prototype.com=function(e){return this.comment(e)},e.prototype.ins=function(e,t){return this.instruction(e,t)},e.prototype.doc=function(){return this.document()},e.prototype.dec=function(e,t,n){return this.declaration(e,t,n)},e.prototype.dtd=function(e,t){return this.doctype(e,t)},e.prototype.e=function(e,t,n){return this.element(e,t,n)},e.prototype.n=function(e,t,n){return this.node(e,t,n)},e.prototype.t=function(e){return this.text(e)},e.prototype.d=function(e){return this.cdata(e)},e.prototype.c=function(e){return this.comment(e)},e.prototype.r=function(e){return this.raw(e)},e.prototype.i=function(e,t){return this.instruction(e,t)},e.prototype.u=function(){return this.up()},e.prototype.importXMLBuilder=function(e){return this.importDocument(e)},e}()}).call(this)},5915(e,t,n){(function(){var t,a={}.hasOwnProperty;t=n(468),e.exports=function(e){function t(e,n,a){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing instruction target. "+this.debugInfo());this.target=this.stringify.insTarget(n),a&&(this.value=this.stringify.insValue(a))}return function(e,t){for(var n in t)a.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(t,e),t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.set(e).processingInstruction(this)},t}(t)}).call(this)},1268(e,t,n){(function(){var t,a={}.hasOwnProperty;t=n(468),e.exports=function(e){function t(e,n){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing raw text. "+this.debugInfo());this.value=this.stringify.raw(n)}return function(e,t){for(var n in t)a.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(t,e),t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.set(e).raw(this)},t}(t)}).call(this)},6775(e,t,n){(function(){var t,a,r,o,i,s,l,c,d,m,p,u,g,h,b={}.hasOwnProperty;l=n(4130),c=n(6376),t=n(2691),a=n(2679),m=n(3906),u=n(1268),g=n(2535),p=n(5915),d=n(1218),r=n(4111),o=n(7696),i=n(5529),s=n(8012),h=n(6286),e.exports=function(e){function n(e,t){n.__super__.constructor.call(this,t),this.stream=e}return function(e,t){for(var n in t)b.call(t,n)&&(e[n]=t[n]);function a(){this.constructor=e}a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype}(n,e),n.prototype.document=function(e){var t,n,r,o,i,s,m,u;for(n=0,o=(s=e.children).length;n<o;n++)(t=s[n]).isLastRootNode=!1;for(e.children[e.children.length-1].isLastRootNode=!0,u=[],r=0,i=(m=e.children).length;r<i;r++)if(!((t=m[r])instanceof d))switch(!1){case!(t instanceof l):u.push(this.declaration(t));break;case!(t instanceof c):u.push(this.docType(t));break;case!(t instanceof a):u.push(this.comment(t));break;case!(t instanceof p):u.push(this.processingInstruction(t));break;default:u.push(this.element(t))}return u},n.prototype.attribute=function(e){return this.stream.write(" "+e.name+'="'+e.value+'"')},n.prototype.cdata=function(e,t){return this.stream.write(this.space(t)+"<![CDATA["+e.text+"]]>"+this.endline(e))},n.prototype.comment=function(e,t){return this.stream.write(this.space(t)+"\x3c!-- "+e.text+" --\x3e"+this.endline(e))},n.prototype.declaration=function(e,t){return this.stream.write(this.space(t)),this.stream.write('<?xml version="'+e.version+'"'),null!=e.encoding&&this.stream.write(' encoding="'+e.encoding+'"'),null!=e.standalone&&this.stream.write(' standalone="'+e.standalone+'"'),this.stream.write(this.spacebeforeslash+"?>"),this.stream.write(this.endline(e))},n.prototype.docType=function(e,n){var l,c,d,m;if(n||(n=0),this.stream.write(this.space(n)),this.stream.write("<!DOCTYPE "+e.root().name),e.pubID&&e.sysID?this.stream.write(' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'):e.sysID&&this.stream.write(' SYSTEM "'+e.sysID+'"'),e.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(e)),c=0,d=(m=e.children).length;c<d;c++)switch(l=m[c],!1){case!(l instanceof r):this.dtdAttList(l,n+1);break;case!(l instanceof o):this.dtdElement(l,n+1);break;case!(l instanceof i):this.dtdEntity(l,n+1);break;case!(l instanceof s):this.dtdNotation(l,n+1);break;case!(l instanceof t):this.cdata(l,n+1);break;case!(l instanceof a):this.comment(l,n+1);break;case!(l instanceof p):this.processingInstruction(l,n+1);break;default:throw new Error("Unknown DTD node type: "+l.constructor.name)}this.stream.write("]")}return this.stream.write(this.spacebeforeslash+">"),this.stream.write(this.endline(e))},n.prototype.element=function(e,n){var r,o,i,s,l,c,h,f;for(l in n||(n=0),f=this.space(n),this.stream.write(f+"<"+e.name),c=e.attributes)b.call(c,l)&&(r=c[l],this.attribute(r));if(0===e.children.length||e.children.every(function(e){return""===e.value}))this.allowEmpty?this.stream.write("></"+e.name+">"):this.stream.write(this.spacebeforeslash+"/>");else if(this.pretty&&1===e.children.length&&null!=e.children[0].value)this.stream.write(">"),this.stream.write(e.children[0].value),this.stream.write("</"+e.name+">");else{for(this.stream.write(">"+this.newline),i=0,s=(h=e.children).length;i<s;i++)switch(o=h[i],!1){case!(o instanceof t):this.cdata(o,n+1);break;case!(o instanceof a):this.comment(o,n+1);break;case!(o instanceof m):this.element(o,n+1);break;case!(o instanceof u):this.raw(o,n+1);break;case!(o instanceof g):this.text(o,n+1);break;case!(o instanceof p):this.processingInstruction(o,n+1);break;case!(o instanceof d):break;default:throw new Error("Unknown XML node type: "+o.constructor.name)}this.stream.write(f+"</"+e.name+">")}return this.stream.write(this.endline(e))},n.prototype.processingInstruction=function(e,t){return this.stream.write(this.space(t)+"<?"+e.target),e.value&&this.stream.write(" "+e.value),this.stream.write(this.spacebeforeslash+"?>"+this.endline(e))},n.prototype.raw=function(e,t){return this.stream.write(this.space(t)+e.value+this.endline(e))},n.prototype.text=function(e,t){return this.stream.write(this.space(t)+e.value+this.endline(e))},n.prototype.dtdAttList=function(e,t){return this.stream.write(this.space(t)+"<!ATTLIST "+e.elementName+" "+e.attributeName+" "+e.attributeType),"#DEFAULT"!==e.defaultValueType&&this.stream.write(" "+e.defaultValueType),e.defaultValue&&this.stream.write(' "'+e.defaultValue+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(e))},n.prototype.dtdElement=function(e,t){return this.stream.write(this.space(t)+"<!ELEMENT "+e.name+" "+e.value),this.stream.write(this.spacebeforeslash+">"+this.endline(e))},n.prototype.dtdEntity=function(e,t){return this.stream.write(this.space(t)+"<!ENTITY"),e.pe&&this.stream.write(" %"),this.stream.write(" "+e.name),e.value?this.stream.write(' "'+e.value+'"'):(e.pubID&&e.sysID?this.stream.write(' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'):e.sysID&&this.stream.write(' SYSTEM "'+e.sysID+'"'),e.nData&&this.stream.write(" NDATA "+e.nData)),this.stream.write(this.spacebeforeslash+">"+this.endline(e))},n.prototype.dtdNotation=function(e,t){return this.stream.write(this.space(t)+"<!NOTATION "+e.name),e.pubID&&e.sysID?this.stream.write(' PUBLIC "'+e.pubID+'" "'+e.sysID+'"'):e.pubID?this.stream.write(' PUBLIC "'+e.pubID+'"'):e.sysID&&this.stream.write(' SYSTEM "'+e.sysID+'"'),this.stream.write(this.spacebeforeslash+">"+this.endline(e))},n.prototype.endline=function(e){return e.isLastRootNode?"":this.newline},n}(h)}).call(this)},382(e,t,n){(function(){var t,a,r,o,i,s,l,c,d,m,p,u,g,h,b={}.hasOwnProperty;l=n(4130),c=n(6376),t=n(2691),a=n(2679),m=n(3906),u=n(1268),g=n(2535),p=n(5915),d=n(1218),r=n(4111),o=n(7696),i=n(5529),s=n(8012),h=n(6286),e.exports=function(e){function n(e){n.__super__.constructor.call(this,e)}return function(e,t){for(var n in t)b.call(t,n)&&(e[n]=t[n]);function a(){this.constructor=e}a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype}(n,e),n.prototype.document=function(e){var t,n,r,o,i;for(this.textispresent=!1,o="",n=0,r=(i=e.children).length;n<r;n++)(t=i[n])instanceof d||(o+=function(){switch(!1){case!(t instanceof l):return this.declaration(t);case!(t instanceof c):return this.docType(t);case!(t instanceof a):return this.comment(t);case!(t instanceof p):return this.processingInstruction(t);default:return this.element(t,0)}}.call(this));return this.pretty&&o.slice(-this.newline.length)===this.newline&&(o=o.slice(0,-this.newline.length)),o},n.prototype.attribute=function(e){return" "+e.name+'="'+e.value+'"'},n.prototype.cdata=function(e,t){return this.space(t)+"<![CDATA["+e.text+"]]>"+this.newline},n.prototype.comment=function(e,t){return this.space(t)+"\x3c!-- "+e.text+" --\x3e"+this.newline},n.prototype.declaration=function(e,t){var n;return n=this.space(t),n+='<?xml version="'+e.version+'"',null!=e.encoding&&(n+=' encoding="'+e.encoding+'"'),null!=e.standalone&&(n+=' standalone="'+e.standalone+'"'),n+=this.spacebeforeslash+"?>",n+=this.newline},n.prototype.docType=function(e,n){var l,c,d,m,u;if(n||(n=0),m=this.space(n),m+="<!DOCTYPE "+e.root().name,e.pubID&&e.sysID?m+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"':e.sysID&&(m+=' SYSTEM "'+e.sysID+'"'),e.children.length>0){for(m+=" [",m+=this.newline,c=0,d=(u=e.children).length;c<d;c++)l=u[c],m+=function(){switch(!1){case!(l instanceof r):return this.dtdAttList(l,n+1);case!(l instanceof o):return this.dtdElement(l,n+1);case!(l instanceof i):return this.dtdEntity(l,n+1);case!(l instanceof s):return this.dtdNotation(l,n+1);case!(l instanceof t):return this.cdata(l,n+1);case!(l instanceof a):return this.comment(l,n+1);case!(l instanceof p):return this.processingInstruction(l,n+1);default:throw new Error("Unknown DTD node type: "+l.constructor.name)}}.call(this);m+="]"}return m+=this.spacebeforeslash+">",m+=this.newline},n.prototype.element=function(e,n){var r,o,i,s,l,c,h,f,v,y,x,w,k;for(h in n||(n=0),k=!1,this.textispresent?(this.newline="",this.pretty=!1):(this.newline=this.newlinedefault,this.pretty=this.prettydefault),f="",f+=(w=this.space(n))+"<"+e.name,v=e.attributes)b.call(v,h)&&(r=v[h],f+=this.attribute(r));if(0===e.children.length||e.children.every(function(e){return""===e.value}))this.allowEmpty?f+="></"+e.name+">"+this.newline:f+=this.spacebeforeslash+"/>"+this.newline;else if(this.pretty&&1===e.children.length&&null!=e.children[0].value)f+=">",f+=e.children[0].value,f+="</"+e.name+">"+this.newline;else{if(this.dontprettytextnodes)for(i=0,l=(y=e.children).length;i<l;i++)if(null!=(o=y[i]).value){this.textispresent++,k=!0;break}for(this.textispresent&&(this.newline="",this.pretty=!1,w=this.space(n)),f+=">"+this.newline,s=0,c=(x=e.children).length;s<c;s++)o=x[s],f+=function(){switch(!1){case!(o instanceof t):return this.cdata(o,n+1);case!(o instanceof a):return this.comment(o,n+1);case!(o instanceof m):return this.element(o,n+1);case!(o instanceof u):return this.raw(o,n+1);case!(o instanceof g):return this.text(o,n+1);case!(o instanceof p):return this.processingInstruction(o,n+1);case!(o instanceof d):return"";default:throw new Error("Unknown XML node type: "+o.constructor.name)}}.call(this);k&&this.textispresent--,this.textispresent||(this.newline=this.newlinedefault,this.pretty=this.prettydefault),f+=w+"</"+e.name+">"+this.newline}return f},n.prototype.processingInstruction=function(e,t){var n;return n=this.space(t)+"<?"+e.target,e.value&&(n+=" "+e.value),n+=this.spacebeforeslash+"?>"+this.newline},n.prototype.raw=function(e,t){return this.space(t)+e.value+this.newline},n.prototype.text=function(e,t){return this.space(t)+e.value+this.newline},n.prototype.dtdAttList=function(e,t){var n;return n=this.space(t)+"<!ATTLIST "+e.elementName+" "+e.attributeName+" "+e.attributeType,"#DEFAULT"!==e.defaultValueType&&(n+=" "+e.defaultValueType),e.defaultValue&&(n+=' "'+e.defaultValue+'"'),n+=this.spacebeforeslash+">"+this.newline},n.prototype.dtdElement=function(e,t){return this.space(t)+"<!ELEMENT "+e.name+" "+e.value+this.spacebeforeslash+">"+this.newline},n.prototype.dtdEntity=function(e,t){var n;return n=this.space(t)+"<!ENTITY",e.pe&&(n+=" %"),n+=" "+e.name,e.value?n+=' "'+e.value+'"':(e.pubID&&e.sysID?n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"':e.sysID&&(n+=' SYSTEM "'+e.sysID+'"'),e.nData&&(n+=" NDATA "+e.nData)),n+=this.spacebeforeslash+">"+this.newline},n.prototype.dtdNotation=function(e,t){var n;return n=this.space(t)+"<!NOTATION "+e.name,e.pubID&&e.sysID?n+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"':e.pubID?n+=' PUBLIC "'+e.pubID+'"':e.sysID&&(n+=' SYSTEM "'+e.sysID+'"'),n+=this.spacebeforeslash+">"+this.newline},n.prototype.openNode=function(e,t){var n,a,r,o;if(t||(t=0),e instanceof m){for(a in r=this.space(t)+"<"+e.name,o=e.attributes)b.call(o,a)&&(n=o[a],r+=this.attribute(n));return r+=(e.children?">":"/>")+this.newline}return r=this.space(t)+"<!DOCTYPE "+e.rootNodeName,e.pubID&&e.sysID?r+=' PUBLIC "'+e.pubID+'" "'+e.sysID+'"':e.sysID&&(r+=' SYSTEM "'+e.sysID+'"'),r+=(e.children?" [":">")+this.newline},n.prototype.closeNode=function(e,t){switch(t||(t=0),!1){case!(e instanceof m):return this.space(t)+"</"+e.name+">"+this.newline;case!(e instanceof c):return this.space(t)+"]>"+this.newline}},n}(h)}).call(this)},3976(e){(function(){var t={}.hasOwnProperty;e.exports=function(){function e(e){var n,a,r,o,i;for(r in this.assertLegalChar=(n=this.assertLegalChar,a=this,function(){return n.apply(a,arguments)}),e||(e={}),this.noDoubleEncoding=e.noDoubleEncoding,o=e.stringify||{})t.call(o,r)&&(i=o[r],this[r]=i)}return e.prototype.eleName=function(e){return e=""+e||"",this.assertLegalChar(e)},e.prototype.eleText=function(e){return e=""+e||"",this.assertLegalChar(this.elEscape(e))},e.prototype.cdata=function(e){return e=(e=""+e||"").replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(e)},e.prototype.comment=function(e){if((e=""+e||"").match(/--/))throw new Error("Comment text cannot contain double-hypen: "+e);return this.assertLegalChar(e)},e.prototype.raw=function(e){return""+e||""},e.prototype.attName=function(e){return""+e||""},e.prototype.attValue=function(e){return e=""+e||"",this.attEscape(e)},e.prototype.insTarget=function(e){return""+e||""},e.prototype.insValue=function(e){if((e=""+e||"").match(/\?>/))throw new Error("Invalid processing instruction value: "+e);return e},e.prototype.xmlVersion=function(e){if(!(e=""+e||"").match(/1\.[0-9]+/))throw new Error("Invalid version number: "+e);return e},e.prototype.xmlEncoding=function(e){if(!(e=""+e||"").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+e);return e},e.prototype.xmlStandalone=function(e){return e?"yes":"no"},e.prototype.dtdPubID=function(e){return""+e||""},e.prototype.dtdSysID=function(e){return""+e||""},e.prototype.dtdElementValue=function(e){return""+e||""},e.prototype.dtdAttType=function(e){return""+e||""},e.prototype.dtdAttDefault=function(e){return null!=e?""+e||"":e},e.prototype.dtdEntityValue=function(e){return""+e||""},e.prototype.dtdNData=function(e){return""+e||""},e.prototype.convertAttKey="@",e.prototype.convertPIKey="?",e.prototype.convertTextKey="#text",e.prototype.convertCDataKey="#cdata",e.prototype.convertCommentKey="#comment",e.prototype.convertRawKey="#raw",e.prototype.assertLegalChar=function(e){var t;if(t=e.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/))throw new Error("Invalid character in string: "+e+" at index "+t.index);return e},e.prototype.elEscape=function(e){var t;return t=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,e.replace(t,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;")},e.prototype.attEscape=function(e){var t;return t=this.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,e.replace(t,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;")},e}()}).call(this)},2535(e,t,n){(function(){var t,a={}.hasOwnProperty;t=n(468),e.exports=function(e){function t(e,n){if(t.__super__.constructor.call(this,e),null==n)throw new Error("Missing element text. "+this.debugInfo());this.value=this.stringify.eleText(n)}return function(e,t){for(var n in t)a.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype}(t,e),t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(e){return this.options.writer.set(e).text(this)},t}(t)}).call(this)},6286(e){(function(){var t={}.hasOwnProperty;e.exports=function(){function e(e){var n,a,r,o,i,s,l,c,d;for(n in e||(e={}),this.pretty=e.pretty||!1,this.allowEmpty=null!=(a=e.allowEmpty)&&a,this.pretty?(this.indent=null!=(r=e.indent)?r:"  ",this.newline=null!=(o=e.newline)?o:"\n",this.offset=null!=(i=e.offset)?i:0,this.dontprettytextnodes=null!=(s=e.dontprettytextnodes)?s:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash=null!=(l=e.spacebeforeslash)?l:"",!0===this.spacebeforeslash&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,c=e.writer||{})t.call(c,n)&&(d=c[n],this[n]=d)}return e.prototype.set=function(e){var n,a,r;for(n in e||(e={}),"pretty"in e&&(this.pretty=e.pretty),"allowEmpty"in e&&(this.allowEmpty=e.allowEmpty),this.pretty?(this.indent="indent"in e?e.indent:"  ",this.newline="newline"in e?e.newline:"\n",this.offset="offset"in e?e.offset:0,this.dontprettytextnodes="dontprettytextnodes"in e?e.dontprettytextnodes:0):(this.indent="",this.newline="",this.offset=0,this.dontprettytextnodes=0),this.spacebeforeslash="spacebeforeslash"in e?e.spacebeforeslash:"",!0===this.spacebeforeslash&&(this.spacebeforeslash=" "),this.newlinedefault=this.newline,this.prettydefault=this.pretty,a=e.writer||{})t.call(a,n)&&(r=a[n],this[n]=r);return this},e.prototype.space=function(e){var t;return this.pretty&&(t=(e||0)+this.offset+1)>0?new Array(t).join(this.indent):""},e}()}).call(this)},9665(e,t,n){(function(){var t,a,r,o,i,s,l;l=n(9241),i=l.assign,s=l.isFunction,t=n(1933),a=n(400),o=n(382),r=n(6775),e.exports.create=function(e,n,a,r){var o,s;if(null==e)throw new Error("Root element needs a name.");return r=i({},n,a,r),s=(o=new t(r)).element(e),r.headless||(o.declaration(r),null==r.pubID&&null==r.sysID||o.doctype(r)),s},e.exports.begin=function(e,n,r){var o;return s(e)&&(n=(o=[e,n])[0],r=o[1],e={}),n?new a(e,n,r):new t(e)},e.exports.stringWriter=function(e){return new o(e)},e.exports.streamWriter=function(e,t){return new r(e,t)}}).call(this)},477(){},4523(e,t,n){"use strict";n.r(t),n.d(t,{VERSION:()=>r,after:()=>It,all:()=>Qt,allKeys:()=>ge,any:()=>Zt,assign:()=>Ie,before:()=>Rt,bind:()=>xt,bindAll:()=>Et,chain:()=>bt,chunk:()=>Ln,clone:()=>Le,collect:()=>Gt,compact:()=>Cn,compose:()=>Mt,constant:()=>Q,contains:()=>en,countBy:()=>hn,create:()=>Pe,debounce:()=>Dt,default:()=>Wn,defaults:()=>Re,defer:()=>Tt,delay:()=>Ct,detect:()=>Ht,difference:()=>An,drop:()=>En,each:()=>Vt,escape:()=>rt,every:()=>Qt,extend:()=>Me,extendOwn:()=>Ie,filter:()=>Xt,find:()=>Ht,findIndex:()=>Ut,findKey:()=>Pt,findLastIndex:()=>Ft,findWhere:()=>jt,first:()=>kn,flatten:()=>Tn,foldl:()=>$t,foldr:()=>Yt,forEach:()=>Vt,functions:()=>_e,get:()=>We,groupBy:()=>un,has:()=>qe,head:()=>kn,identity:()=>He,include:()=>en,includes:()=>en,indexBy:()=>gn,indexOf:()=>Wt,initial:()=>wn,inject:()=>$t,intersection:()=>Mn,invert:()=>De,invoke:()=>tn,isArguments:()=>Y,isArray:()=>G,isArrayBuffer:()=>U,isBoolean:()=>D,isDataView:()=>V,isDate:()=>R,isElement:()=>_,isEmpty:()=>le,isEqual:()=>ue,isError:()=>P,isFinite:()=>X,isFunction:()=>O,isMap:()=>ke,isMatch:()=>ce,isNaN:()=>J,isNull:()=>T,isNumber:()=>I,isObject:()=>C,isRegExp:()=>B,isSet:()=>Se,isString:()=>M,isSymbol:()=>L,isTypedArray:()=>re,isUndefined:()=>A,isWeakMap:()=>Ee,isWeakSet:()=>Ce,iteratee:()=>$e,keys:()=>se,last:()=>Sn,lastIndexOf:()=>qt,map:()=>Gt,mapObject:()=>Xe,matcher:()=>je,matches:()=>je,max:()=>rn,memoize:()=>St,methods:()=>_e,min:()=>on,mixin:()=>Fn,negate:()=>Nt,noop:()=>Je,now:()=>tt,object:()=>Bn,omit:()=>xn,once:()=>Bt,pairs:()=>Ae,partial:()=>yt,partition:()=>bn,pick:()=>yn,pluck:()=>nn,property:()=>Ve,propertyOf:()=>Qe,random:()=>et,range:()=>Pn,reduce:()=>$t,reduceRight:()=>Yt,reject:()=>Jt,rest:()=>En,restArguments:()=>S,result:()=>ut,sample:()=>cn,select:()=>Xt,shuffle:()=>dn,size:()=>fn,some:()=>Zt,sortBy:()=>mn,sortedIndex:()=>zt,tail:()=>En,take:()=>kn,tap:()=>Ue,template:()=>pt,templateSettings:()=>it,throttle:()=>At,times:()=>Ze,toArray:()=>ln,toPath:()=>Fe,transpose:()=>In,unescape:()=>ot,union:()=>Nn,uniq:()=>_n,unique:()=>_n,uniqueId:()=>ht,unzip:()=>In,values:()=>Te,where:()=>an,without:()=>Dn,wrap:()=>_t,zip:()=>Rn});var a={};n.r(a),n.d(a,{VERSION:()=>r,after:()=>It,all:()=>Qt,allKeys:()=>ge,any:()=>Zt,assign:()=>Ie,before:()=>Rt,bind:()=>xt,bindAll:()=>Et,chain:()=>bt,chunk:()=>Ln,clone:()=>Le,collect:()=>Gt,compact:()=>Cn,compose:()=>Mt,constant:()=>Q,contains:()=>en,countBy:()=>hn,create:()=>Pe,debounce:()=>Dt,default:()=>zn,defaults:()=>Re,defer:()=>Tt,delay:()=>Ct,detect:()=>Ht,difference:()=>An,drop:()=>En,each:()=>Vt,escape:()=>rt,every:()=>Qt,extend:()=>Me,extendOwn:()=>Ie,filter:()=>Xt,find:()=>Ht,findIndex:()=>Ut,findKey:()=>Pt,findLastIndex:()=>Ft,findWhere:()=>jt,first:()=>kn,flatten:()=>Tn,foldl:()=>$t,foldr:()=>Yt,forEach:()=>Vt,functions:()=>_e,get:()=>We,groupBy:()=>un,has:()=>qe,head:()=>kn,identity:()=>He,include:()=>en,includes:()=>en,indexBy:()=>gn,indexOf:()=>Wt,initial:()=>wn,inject:()=>$t,intersection:()=>Mn,invert:()=>De,invoke:()=>tn,isArguments:()=>Y,isArray:()=>G,isArrayBuffer:()=>U,isBoolean:()=>D,isDataView:()=>V,isDate:()=>R,isElement:()=>_,isEmpty:()=>le,isEqual:()=>ue,isError:()=>P,isFinite:()=>X,isFunction:()=>O,isMap:()=>ke,isMatch:()=>ce,isNaN:()=>J,isNull:()=>T,isNumber:()=>I,isObject:()=>C,isRegExp:()=>B,isSet:()=>Se,isString:()=>M,isSymbol:()=>L,isTypedArray:()=>re,isUndefined:()=>A,isWeakMap:()=>Ee,isWeakSet:()=>Ce,iteratee:()=>$e,keys:()=>se,last:()=>Sn,lastIndexOf:()=>qt,map:()=>Gt,mapObject:()=>Xe,matcher:()=>je,matches:()=>je,max:()=>rn,memoize:()=>St,methods:()=>_e,min:()=>on,mixin:()=>Fn,negate:()=>Nt,noop:()=>Je,now:()=>tt,object:()=>Bn,omit:()=>xn,once:()=>Bt,pairs:()=>Ae,partial:()=>yt,partition:()=>bn,pick:()=>yn,pluck:()=>nn,property:()=>Ve,propertyOf:()=>Qe,random:()=>et,range:()=>Pn,reduce:()=>$t,reduceRight:()=>Yt,reject:()=>Jt,rest:()=>En,restArguments:()=>S,result:()=>ut,sample:()=>cn,select:()=>Xt,shuffle:()=>dn,size:()=>fn,some:()=>Zt,sortBy:()=>mn,sortedIndex:()=>zt,tail:()=>En,take:()=>kn,tap:()=>Ue,template:()=>pt,templateSettings:()=>it,throttle:()=>At,times:()=>Ze,toArray:()=>ln,toPath:()=>Fe,transpose:()=>In,unescape:()=>ot,union:()=>Nn,uniq:()=>_n,unique:()=>_n,uniqueId:()=>ht,unzip:()=>In,values:()=>Te,where:()=>an,without:()=>Dn,wrap:()=>_t,zip:()=>Rn});var r="1.13.8",o="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g||Function("return this")()||{},i=Array.prototype,s=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,c=i.push,d=i.slice,m=s.toString,p=s.hasOwnProperty,u="undefined"!=typeof ArrayBuffer,g="undefined"!=typeof DataView,h=Array.isArray,b=Object.keys,f=Object.create,v=u&&ArrayBuffer.isView,y=isNaN,x=isFinite,w=!{toString:null}.propertyIsEnumerable("toString"),k=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],E=Math.pow(2,53)-1;function S(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),a=Array(n),r=0;r<n;r++)a[r]=arguments[r+t];switch(t){case 0:return e.call(this,a);case 1:return e.call(this,arguments[0],a);case 2:return e.call(this,arguments[0],arguments[1],a)}var o=Array(t+1);for(r=0;r<t;r++)o[r]=arguments[r];return o[t]=a,e.apply(this,o)}}function C(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function T(e){return null===e}function A(e){return void 0===e}function D(e){return!0===e||!1===e||"[object Boolean]"===m.call(e)}function _(e){return!(!e||1!==e.nodeType)}function N(e){var t="[object "+e+"]";return function(e){return m.call(e)===t}}const M=N("String"),I=N("Number"),R=N("Date"),B=N("RegExp"),P=N("Error"),L=N("Symbol"),U=N("ArrayBuffer");var F=N("Function"),z=o.document&&o.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof z&&(F=function(e){return"function"==typeof e||!1});const O=F,W=N("Object");var q=g&&(!/\[native code\]/.test(String(DataView))||W(new DataView(new ArrayBuffer(8)))),H="undefined"!=typeof Map&&W(new Map),j=N("DataView");const V=q?function(e){return null!=e&&O(e.getInt8)&&U(e.buffer)}:j,G=h||N("Array");function K(e,t){return null!=e&&p.call(e,t)}var $=N("Arguments");!function(){$(arguments)||($=function(e){return K(e,"callee")})}();const Y=$;function X(e){return!L(e)&&x(e)&&!isNaN(parseFloat(e))}function J(e){return I(e)&&y(e)}function Q(e){return function(){return e}}function Z(e){return function(t){var n=e(t);return"number"==typeof n&&n>=0&&n<=E}}function ee(e){return function(t){return null==t?void 0:t[e]}}const te=ee("byteLength"),ne=Z(te);var ae=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;const re=u?function(e){return v?v(e)&&!V(e):ne(e)&&ae.test(m.call(e))}:Q(!1),oe=ee("length");function ie(e,t){t=function(e){for(var t={},n=e.length,a=0;a<n;++a)t[e[a]]=!0;return{contains:function(e){return!0===t[e]},push:function(n){return t[n]=!0,e.push(n)}}}(t);var n=k.length,a=e.constructor,r=O(a)&&a.prototype||s,o="constructor";for(K(e,o)&&!t.contains(o)&&t.push(o);n--;)(o=k[n])in e&&e[o]!==r[o]&&!t.contains(o)&&t.push(o)}function se(e){if(!C(e))return[];if(b)return b(e);var t=[];for(var n in e)K(e,n)&&t.push(n);return w&&ie(e,t),t}function le(e){if(null==e)return!0;var t=oe(e);return"number"==typeof t&&(G(e)||M(e)||Y(e))?0===t:0===oe(se(e))}function ce(e,t){var n=se(t),a=n.length;if(null==e)return!a;for(var r=Object(e),o=0;o<a;o++){var i=n[o];if(t[i]!==r[i]||!(i in r))return!1}return!0}function de(e){return e instanceof de?e:this instanceof de?void(this._wrapped=e):new de(e)}function me(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,te(e))}de.VERSION=r,de.prototype.value=function(){return this._wrapped},de.prototype.valueOf=de.prototype.toJSON=de.prototype.value,de.prototype.toString=function(){return String(this._wrapped)};var pe="[object DataView]";function ue(e,t){for(var n=[{a:e,b:t}],a=[],r=[];n.length;){var o=n.pop();if(!0!==o){if((e=o.a)===(t=o.b)){if(0!==e||1/e==1/t)continue;return!1}if(null==e||null==t)return!1;if(e!=e){if(t!=t)continue;return!1}var i=typeof e;if("function"!==i&&"object"!==i&&"object"!=typeof t)return!1;e instanceof de&&(e=e._wrapped),t instanceof de&&(t=t._wrapped);var s=m.call(e);if(s!==m.call(t))return!1;if(q&&"[object Object]"==s&&V(e)){if(!V(t))return!1;s=pe}switch(s){case"[object RegExp]":case"[object String]":if(""+e==""+t)continue;return!1;case"[object Number]":n.push({a:+e,b:+t});continue;case"[object Date]":case"[object Boolean]":if(+e===+t)continue;return!1;case"[object Symbol]":if(l.valueOf.call(e)===l.valueOf.call(t))continue;return!1;case"[object ArrayBuffer]":case pe:n.push({a:me(e),b:me(t)});continue}var c="[object Array]"===s;if(!c&&re(e)){if(te(e)!==te(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)continue;c=!0}if(!c){if("object"!=typeof e||"object"!=typeof t)return!1;var d=e.constructor,p=t.constructor;if(d!==p&&!(O(d)&&d instanceof d&&O(p)&&p instanceof p)&&"constructor"in e&&"constructor"in t)return!1}for(var u=a.length;u--;)if(a[u]===e){if(r[u]===t)break;return!1}if(!(u>=0))if(a.push(e),r.push(t),n.push(!0),c){if((u=e.length)!==t.length)return!1;for(;u--;)n.push({a:e[u],b:t[u]})}else{var g,h=se(e);if(u=h.length,se(t).length!==u)return!1;for(;u--;){if(!K(t,g=h[u]))return!1;n.push({a:e[g],b:t[g]})}}}else a.pop(),r.pop()}return!0}function ge(e){if(!C(e))return[];var t=[];for(var n in e)t.push(n);return w&&ie(e,t),t}function he(e){var t=oe(e);return function(n){if(null==n)return!1;var a=ge(n);if(oe(a))return!1;for(var r=0;r<t;r++)if(!O(n[e[r]]))return!1;return e!==xe||!O(n[be])}}var be="forEach",fe=["clear","delete"],ve=["get","has","set"],ye=fe.concat(be,ve),xe=fe.concat(ve),we=["add"].concat(fe,be,"has");const ke=H?he(ye):N("Map"),Ee=H?he(xe):N("WeakMap"),Se=H?he(we):N("Set"),Ce=N("WeakSet");function Te(e){for(var t=se(e),n=t.length,a=Array(n),r=0;r<n;r++)a[r]=e[t[r]];return a}function Ae(e){for(var t=se(e),n=t.length,a=Array(n),r=0;r<n;r++)a[r]=[t[r],e[t[r]]];return a}function De(e){for(var t={},n=se(e),a=0,r=n.length;a<r;a++)t[e[n[a]]]=n[a];return t}function _e(e){var t=[];for(var n in e)O(e[n])&&t.push(n);return t.sort()}function Ne(e,t){return function(n){var a=arguments.length;if(t&&(n=Object(n)),a<2||null==n)return n;for(var r=1;r<a;r++)for(var o=arguments[r],i=e(o),s=i.length,l=0;l<s;l++){var c=i[l];t&&void 0!==n[c]||(n[c]=o[c])}return n}}const Me=Ne(ge),Ie=Ne(se),Re=Ne(ge,!0);function Be(e){if(!C(e))return{};if(f)return f(e);var t=function(){};t.prototype=e;var n=new t;return t.prototype=null,n}function Pe(e,t){var n=Be(e);return t&&Ie(n,t),n}function Le(e){return C(e)?G(e)?e.slice():Me({},e):e}function Ue(e,t){return t(e),e}function Fe(e){return G(e)?e:[e]}function ze(e){return de.toPath(e)}function Oe(e,t){for(var n=t.length,a=0;a<n;a++){if(null==e)return;e=e[t[a]]}return n?e:void 0}function We(e,t,n){var a=Oe(e,ze(t));return A(a)?n:a}function qe(e,t){for(var n=(t=ze(t)).length,a=0;a<n;a++){var r=t[a];if(!K(e,r))return!1;e=e[r]}return!!n}function He(e){return e}function je(e){return e=Ie({},e),function(t){return ce(t,e)}}function Ve(e){return e=ze(e),function(t){return Oe(t,e)}}function Ge(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,a,r){return e.call(t,n,a,r)};case 4:return function(n,a,r,o){return e.call(t,n,a,r,o)}}return function(){return e.apply(t,arguments)}}function Ke(e,t,n){return null==e?He:O(e)?Ge(e,t,n):C(e)&&!G(e)?je(e):Ve(e)}function $e(e,t){return Ke(e,t,1/0)}function Ye(e,t,n){return de.iteratee!==$e?de.iteratee(e,t):Ke(e,t,n)}function Xe(e,t,n){t=Ye(t,n);for(var a=se(e),r=a.length,o={},i=0;i<r;i++){var s=a[i];o[s]=t(e[s],s,e)}return o}function Je(){}function Qe(e){return null==e?Je:function(t){return We(e,t)}}function Ze(e,t,n){var a=Array(Math.max(0,e));t=Ge(t,n,1);for(var r=0;r<e;r++)a[r]=t(r);return a}function et(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}de.toPath=Fe,de.iteratee=$e;const tt=Date.now||function(){return(new Date).getTime()};function nt(e){var t=function(t){return e[t]},n="(?:"+se(e).join("|")+")",a=RegExp(n),r=RegExp(n,"g");return function(e){return e=null==e?"":""+e,a.test(e)?e.replace(r,t):e}}const at={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},rt=nt(at),ot=nt(De(at)),it=de.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var st=/(.)^/,lt={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},ct=/\\|'|\r|\n|\u2028|\u2029/g;function dt(e){return"\\"+lt[e]}var mt=/^\s*(\w|\$)+\s*$/;function pt(e,t,n){!t&&n&&(t=n),t=Re({},t,de.templateSettings);var a=RegExp([(t.escape||st).source,(t.interpolate||st).source,(t.evaluate||st).source].join("|")+"|$","g"),r=0,o="__p+='";e.replace(a,function(t,n,a,i,s){return o+=e.slice(r,s).replace(ct,dt),r=s+t.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":a?o+="'+\n((__t=("+a+"))==null?'':__t)+\n'":i&&(o+="';\n"+i+"\n__p+='"),t}),o+="';\n";var i,s=t.variable;if(s){if(!mt.test(s))throw new Error("variable is not a bare identifier: "+s)}else o="with(obj||{}){\n"+o+"}\n",s="obj";o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{i=new Function(s,"_",o)}catch(e){throw e.source=o,e}var l=function(e){return i.call(this,e,de)};return l.source="function("+s+"){\n"+o+"}",l}function ut(e,t,n){var a=(t=ze(t)).length;if(!a)return O(n)?n.call(e):n;for(var r=0;r<a;r++){var o=null==e?void 0:e[t[r]];void 0===o&&(o=n,r=a),e=O(o)?o.call(e):o}return e}var gt=0;function ht(e){var t=++gt+"";return e?e+t:t}function bt(e){var t=de(e);return t._chain=!0,t}function ft(e,t,n,a,r){if(!(a instanceof t))return e.apply(n,r);var o=Be(e.prototype),i=e.apply(o,r);return C(i)?i:o}var vt=S(function(e,t){var n=vt.placeholder,a=function(){for(var r=0,o=t.length,i=Array(o),s=0;s<o;s++)i[s]=t[s]===n?arguments[r++]:t[s];for(;r<arguments.length;)i.push(arguments[r++]);return ft(e,a,this,this,i)};return a});vt.placeholder=de;const yt=vt,xt=S(function(e,t,n){if(!O(e))throw new TypeError("Bind must be called on a function");var a=S(function(r){return ft(e,a,t,this,n.concat(r))});return a}),wt=Z(oe);function kt(e,t,n){t||0===t||(t=1/0);for(var a=[],r=0,o=0,i=oe(e)||0,s=[];;)if(o>=i){if(!s.length)break;var l=s.pop();o=l.i,e=l.v,i=oe(e)}else{var c=e[o++];s.length>=t?a[r++]=c:wt(c)&&(G(c)||Y(c))?(s.push({i:o,v:e}),o=0,i=oe(e=c)):n||(a[r++]=c)}return a}const Et=S(function(e,t){var n=(t=kt(t,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var a=t[n];e[a]=xt(e[a],e)}return e});function St(e,t){var n=function(a){var r=n.cache,o=""+(t?t.apply(this,arguments):a);return K(r,o)||(r[o]=e.apply(this,arguments)),r[o]};return n.cache={},n}const Ct=S(function(e,t,n){return setTimeout(function(){return e.apply(null,n)},t)}),Tt=yt(Ct,de,1);function At(e,t,n){var a,r,o,i,s=0;n||(n={});var l=function(){s=!1===n.leading?0:tt(),a=null,i=e.apply(r,o),a||(r=o=null)},c=function(){var c=tt();s||!1!==n.leading||(s=c);var d=t-(c-s);return r=this,o=arguments,d<=0||d>t?(a&&(clearTimeout(a),a=null),s=c,i=e.apply(r,o),a||(r=o=null)):a||!1===n.trailing||(a=setTimeout(l,d)),i};return c.cancel=function(){clearTimeout(a),s=0,a=r=o=null},c}function Dt(e,t,n){var a,r,o,i,s,l=function(){var c=tt()-r;t>c?a=setTimeout(l,t-c):(a=null,n||(i=e.apply(s,o)),a||(o=s=null))},c=S(function(c){return s=this,o=c,r=tt(),a||(a=setTimeout(l,t),n&&(i=e.apply(s,o))),i});return c.cancel=function(){clearTimeout(a),a=o=s=null},c}function _t(e,t){return yt(t,e)}function Nt(e){return function(){return!e.apply(this,arguments)}}function Mt(){var e=arguments,t=e.length-1;return function(){for(var n=t,a=e[t].apply(this,arguments);n--;)a=e[n].call(this,a);return a}}function It(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}function Rt(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}const Bt=yt(Rt,2);function Pt(e,t,n){t=Ye(t,n);for(var a,r=se(e),o=0,i=r.length;o<i;o++)if(t(e[a=r[o]],a,e))return a}function Lt(e){return function(t,n,a){n=Ye(n,a);for(var r=oe(t),o=e>0?0:r-1;o>=0&&o<r;o+=e)if(n(t[o],o,t))return o;return-1}}const Ut=Lt(1),Ft=Lt(-1);function zt(e,t,n,a){for(var r=(n=Ye(n,a,1))(t),o=0,i=oe(e);o<i;){var s=Math.floor((o+i)/2);n(e[s])<r?o=s+1:i=s}return o}function Ot(e,t,n){return function(a,r,o){var i=0,s=oe(a);if("number"==typeof o)e>0?i=o>=0?o:Math.max(o+s,i):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return a[o=n(a,r)]===r?o:-1;if(r!=r)return(o=t(d.call(a,i,s),J))>=0?o+i:-1;for(o=e>0?i:s-1;o>=0&&o<s;o+=e)if(a[o]===r)return o;return-1}}const Wt=Ot(1,Ut,zt),qt=Ot(-1,Ft);function Ht(e,t,n){var a=(wt(e)?Ut:Pt)(e,t,n);if(void 0!==a&&-1!==a)return e[a]}function jt(e,t){return Ht(e,je(t))}function Vt(e,t,n){var a,r;if(t=Ge(t,n),wt(e))for(a=0,r=e.length;a<r;a++)t(e[a],a,e);else{var o=se(e);for(a=0,r=o.length;a<r;a++)t(e[o[a]],o[a],e)}return e}function Gt(e,t,n){t=Ye(t,n);for(var a=!wt(e)&&se(e),r=(a||e).length,o=Array(r),i=0;i<r;i++){var s=a?a[i]:i;o[i]=t(e[s],s,e)}return o}function Kt(e){return function(t,n,a,r){var o=arguments.length>=3;return function(t,n,a,r){var o=!wt(t)&&se(t),i=(o||t).length,s=e>0?0:i-1;for(r||(a=t[o?o[s]:s],s+=e);s>=0&&s<i;s+=e){var l=o?o[s]:s;a=n(a,t[l],l,t)}return a}(t,Ge(n,r,4),a,o)}}const $t=Kt(1),Yt=Kt(-1);function Xt(e,t,n){var a=[];return t=Ye(t,n),Vt(e,function(e,n,r){t(e,n,r)&&a.push(e)}),a}function Jt(e,t,n){return Xt(e,Nt(Ye(t)),n)}function Qt(e,t,n){t=Ye(t,n);for(var a=!wt(e)&&se(e),r=(a||e).length,o=0;o<r;o++){var i=a?a[o]:o;if(!t(e[i],i,e))return!1}return!0}function Zt(e,t,n){t=Ye(t,n);for(var a=!wt(e)&&se(e),r=(a||e).length,o=0;o<r;o++){var i=a?a[o]:o;if(t(e[i],i,e))return!0}return!1}function en(e,t,n,a){return wt(e)||(e=Te(e)),("number"!=typeof n||a)&&(n=0),Wt(e,t,n)>=0}const tn=S(function(e,t,n){var a,r;return O(t)?r=t:(t=ze(t),a=t.slice(0,-1),t=t[t.length-1]),Gt(e,function(e){var o=r;if(!o){if(a&&a.length&&(e=Oe(e,a)),null==e)return;o=e[t]}return null==o?o:o.apply(e,n)})});function nn(e,t){return Gt(e,Ve(t))}function an(e,t){return Xt(e,je(t))}function rn(e,t,n){var a,r,o=-1/0,i=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=wt(e)?e:Te(e)).length;s<l;s++)null!=(a=e[s])&&a>o&&(o=a);else t=Ye(t,n),Vt(e,function(e,n,a){((r=t(e,n,a))>i||r===-1/0&&o===-1/0)&&(o=e,i=r)});return o}function on(e,t,n){var a,r,o=1/0,i=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=wt(e)?e:Te(e)).length;s<l;s++)null!=(a=e[s])&&a<o&&(o=a);else t=Ye(t,n),Vt(e,function(e,n,a){((r=t(e,n,a))<i||r===1/0&&o===1/0)&&(o=e,i=r)});return o}var sn=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function ln(e){return e?G(e)?d.call(e):M(e)?e.match(sn):wt(e)?Gt(e,He):Te(e):[]}function cn(e,t,n){if(null==t||n)return wt(e)||(e=Te(e)),e[et(e.length-1)];var a=ln(e),r=oe(a);t=Math.max(Math.min(t,r),0);for(var o=r-1,i=0;i<t;i++){var s=et(i,o),l=a[i];a[i]=a[s],a[s]=l}return a.slice(0,t)}function dn(e){return cn(e,1/0)}function mn(e,t,n){var a=0;return t=Ye(t,n),nn(Gt(e,function(e,n,r){return{value:e,index:a++,criteria:t(e,n,r)}}).sort(function(e,t){var n=e.criteria,a=t.criteria;if(n!==a){if(n>a||void 0===n)return 1;if(n<a||void 0===a)return-1}return e.index-t.index}),"value")}function pn(e,t){return function(n,a,r){var o=t?[[],[]]:{};return a=Ye(a,r),Vt(n,function(t,r){var i=a(t,r,n);e(o,t,i)}),o}}const un=pn(function(e,t,n){K(e,n)?e[n].push(t):e[n]=[t]}),gn=pn(function(e,t,n){e[n]=t}),hn=pn(function(e,t,n){K(e,n)?e[n]++:e[n]=1}),bn=pn(function(e,t,n){e[n?0:1].push(t)},!0);function fn(e){return null==e?0:wt(e)?e.length:se(e).length}function vn(e,t,n){return t in n}const yn=S(function(e,t){var n={},a=t[0];if(null==e)return n;O(a)?(t.length>1&&(a=Ge(a,t[1])),t=ge(e)):(a=vn,t=kt(t,!1,!1),e=Object(e));for(var r=0,o=t.length;r<o;r++){var i=t[r],s=e[i];a(s,i,e)&&(n[i]=s)}return n}),xn=S(function(e,t){var n,a=t[0];return O(a)?(a=Nt(a),t.length>1&&(n=t[1])):(t=Gt(kt(t,!1,!1),String),a=function(e,n){return!en(t,n)}),yn(e,a,n)});function wn(e,t,n){return d.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}function kn(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:wn(e,e.length-t)}function En(e,t,n){return d.call(e,null==t||n?1:t)}function Sn(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[e.length-1]:En(e,Math.max(0,e.length-t))}function Cn(e){return Xt(e,Boolean)}function Tn(e,t){return kt(e,t,!1)}const An=S(function(e,t){return t=kt(t,!0,!0),Xt(e,function(e){return!en(t,e)})}),Dn=S(function(e,t){return An(e,t)});function _n(e,t,n,a){D(t)||(a=n,n=t,t=!1),null!=n&&(n=Ye(n,a));for(var r=[],o=[],i=0,s=oe(e);i<s;i++){var l=e[i],c=n?n(l,i,e):l;t&&!n?(i&&o===c||r.push(l),o=c):n?en(o,c)||(o.push(c),r.push(l)):en(r,l)||r.push(l)}return r}const Nn=S(function(e){return _n(kt(e,!0,!0))});function Mn(e){for(var t=[],n=arguments.length,a=0,r=oe(e);a<r;a++){var o=e[a];if(!en(t,o)){var i;for(i=1;i<n&&en(arguments[i],o);i++);i===n&&t.push(o)}}return t}function In(e){for(var t=e&&rn(e,oe).length||0,n=Array(t),a=0;a<t;a++)n[a]=nn(e,a);return n}const Rn=S(In);function Bn(e,t){for(var n={},a=0,r=oe(e);a<r;a++)t?n[e[a]]=t[a]:n[e[a][0]]=e[a][1];return n}function Pn(e,t,n){null==t&&(t=e||0,e=0),n||(n=t<e?-1:1);for(var a=Math.max(Math.ceil((t-e)/n),0),r=Array(a),o=0;o<a;o++,e+=n)r[o]=e;return r}function Ln(e,t){if(null==t||t<1)return[];for(var n=[],a=0,r=e.length;a<r;)n.push(d.call(e,a,a+=t));return n}function Un(e,t){return e._chain?de(t).chain():t}function Fn(e){return Vt(_e(e),function(t){var n=de[t]=e[t];de.prototype[t]=function(){var e=[this._wrapped];return c.apply(e,arguments),Un(this,n.apply(de,e))}}),de}Vt(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=i[e];de.prototype[e]=function(){var n=this._wrapped;return null!=n&&(t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0]),Un(this,n)}}),Vt(["concat","join","slice"],function(e){var t=i[e];de.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),Un(this,e)}});const zn=de;var On=Fn(a);On._=On;const Wn=On}},a={};function r(e){var t=a[e];if(void 0!==t)return t.exports;var o=a[e]={exports:{}};return n[e].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(n,a){if(1&a&&(n=this(n)),8&a)return n;if("object"==typeof n&&n){if(4&a&&n.__esModule)return n;if(16&a&&"function"==typeof n.then)return n}var o=Object.create(null);r.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&a&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,r.d(o,i),o},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="",(()=>{"use strict";var e={};r.r(e),r.d(e,{AbortException:()=>bd,AnnotationEditorLayer:()=>fd,AnnotationEditorParamsType:()=>vd,AnnotationEditorType:()=>yd,AnnotationEditorUIManager:()=>xd,AnnotationLayer:()=>wd,AnnotationMode:()=>kd,ColorPicker:()=>Ed,DOMSVGFactory:()=>Sd,DrawLayer:()=>Cd,FeatureTest:()=>Td,GlobalWorkerOptions:()=>Ad,ImageKind:()=>Dd,InvalidPDFException:()=>_d,MissingPDFException:()=>Nd,OPS:()=>Md,OutputScale:()=>Id,PDFDataRangeTransport:()=>Rd,PDFDateString:()=>Bd,PDFWorker:()=>Pd,PasswordResponses:()=>Ld,PermissionFlag:()=>Ud,PixelsPerInch:()=>Fd,RenderingCancelledException:()=>zd,TextLayer:()=>Od,TouchManager:()=>Wd,UnexpectedResponseException:()=>qd,Util:()=>Hd,VerbosityLevel:()=>jd,XfaLayer:()=>Vd,build:()=>Gd,createValidAbsoluteUrl:()=>Kd,fetchData:()=>$d,getDocument:()=>Yd,getFilenameFromUrl:()=>Xd,getPdfFilenameFromUrl:()=>Jd,getXfaPageViewport:()=>Qd,isDataScheme:()=>Zd,isPdfFile:()=>em,noContextMenu:()=>tm,normalizeUnicode:()=>nm,setLayerDimensions:()=>am,shadow:()=>rm,stopEvent:()=>om,version:()=>im});var t=r(6815),n=r.n(t),a=r(6540),o=r(5338),i=r(961),s=r(600);const l=(0,a.createContext)(void 0),c=({children:e})=>{const[t,n]=(0,a.useState)("en"),[r,o]=(0,a.useState)(!0);(0,a.useEffect)(()=>{(async()=>{try{await(0,s.LE)(),n((0,s.UK)())}catch(e){}finally{o(!1)}})()},[]);const i=(0,a.useCallback)(async e=>{o(!0);try{await(0,s.v2)(e),n(e)}catch(e){}finally{o(!1)}},[]),c=(0,a.useCallback)((e,t)=>(0,s.t)(e,t),[t]),d={language:t,changeLanguage:i,t:c,supportedLanguages:s.Fc,isLoading:r};return a.createElement(l.Provider,{value:d},e)};var d=r(6839);const m=[{id:"work",name:"Work",color:"#3b82f6"},{id:"personal",name:"Personal",color:"#10b981"},{id:"urgent",name:"Urgent",color:"#ef4444"},{id:"shopping",name:"Shopping",color:"#7C3AED"},{id:"health",name:"Health",color:"#0ea5e9"}],p={work:"todo.categoryWork",personal:"todo.categoryPersonal",urgent:"todo.categoryUrgent",shopping:"todo.categoryShopping",health:"todo.categoryHealth"},u=(e,t)=>({name:e,phone:t,email:"",gender:"",dateOfBirth:"",details:"",address:"",language:"Portuguese",customFields:[],updatedAt:Date.now()}),g=(e,t,n)=>({id:e,profile:u(t,n),notes:[],reminders:[],appointments:[],incomes:[],expenses:[],tabs:[],createdAt:Date.now(),updatedAt:Date.now()}),h=(e="crm")=>`${e}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,b="wa_crm_data",f="wa_crm_data_sync";class v{static getState(){try{const e=localStorage.getItem(b);if(e){return JSON.parse(e)}}catch(e){}return{contacts:{},version:1}}static setState(e){try{localStorage.setItem(b,JSON.stringify(e)),this.syncToChromeStorage(e)}catch(e){}}static syncToChromeStorage(e){try{chrome.storage.local.set({[f]:e},()=>{chrome.runtime.lastError})}catch(e){}}static getContact(e){return this.getState().contacts[e]||null}static getOrCreateContact(e,t,n){let a=n;if(t&&t.match(/^\+?[\d\s\-()]{10,}$/)){const e=t.replace(/[^\d+]/g,"").replace(/\+/g,(e,t)=>0===t?"+":"");a=e.startsWith("+")?e:"+"+e}const r=this.getContact(e);if(r){const e=a.replace(/[^\d+]/g,"").replace(/\+/g,(e,t)=>0===t?"+":"");return e&&e!==r.profile.phone&&e.match(/^\+?\d{10,}$/)&&(r.profile.phone=e,this.saveContact(r)),r}const o=a.replace(/[^\d+]/g,"").replace(/\+/g,(e,t)=>0===t?"+":""),i=g(e,t,o);return this.saveContact(i),i}static saveContact(e){const t=this.getState();e.updatedAt=Date.now(),t.contacts[e.id]=e,this.setState(t),this.dispatchEvent("wa-crm-contact-updated",{contactId:e.id})}static deleteContact(e){const t=this.getState();return!!t.contacts[e]&&(delete t.contacts[e],this.setState(t),this.dispatchEvent("wa-crm-contact-deleted",{contactId:e}),!0)}static getAllContacts(){const e=this.getState();return Object.values(e.contacts)}static updateProfile(e,t){const n=this.getContact(e);return!!n&&(n.profile={...n.profile,...t,updatedAt:Date.now()},this.saveContact(n),!0)}static addCustomField(e,t,n){const a=this.getContact(e);if(!a)return null;const r={id:h("field"),label:t,value:n,createdAt:Date.now()};return a.profile.customFields.push(r),this.saveContact(a),r}static updateCustomField(e,t,n){const a=this.getContact(e);if(!a)return!1;const r=a.profile.customFields.findIndex(e=>e.id===t);return-1!==r&&(a.profile.customFields[r]={...a.profile.customFields[r],...n},this.saveContact(a),!0)}static deleteCustomField(e,t){const n=this.getContact(e);return!!n&&(n.profile.customFields=n.profile.customFields.filter(e=>e.id!==t),this.saveContact(n),!0)}static setAIBotBlacklisted(e,t){let n=this.getContact(e);if(!n){const t=e.endsWith("@c.us")?"+"+e.replace("@c.us",""):e;n=this.getOrCreateContact(e,"",t)}return n.profile.aiBotBlacklisted=t,n.profile.updatedAt=Date.now(),this.saveContact(n),!0}static isAIBotBlacklisted(e){const t=this.getContact(e);return!0===t?.profile?.aiBotBlacklisted}static addNote(e,t,n){const a=this.getContact(e);if(!a)return null;const r={id:h("note"),topic:t,content:n,createdAt:Date.now(),updatedAt:Date.now()};return a.notes.push(r),this.saveContact(a),r}static updateNote(e,t,n){const a=this.getContact(e);if(!a)return!1;const r=a.notes.findIndex(e=>e.id===t);return-1!==r&&(a.notes[r]={...a.notes[r],...n,updatedAt:Date.now()},this.saveContact(a),!0)}static deleteNote(e,t){const n=this.getContact(e);return!!n&&(n.notes=n.notes.filter(e=>e.id!==t),this.saveContact(n),!0)}static getNotes(e){const t=this.getContact(e);return t?.notes||[]}static addReminder(e,t,n,a,r=0){const o=this.getContact(e);if(!o)return null;const i={id:h("reminder"),topic:t,details:n,datetime:a,status:"pending",createdAt:Date.now(),notified:!1,repeatInterval:r,isStopped:!1,snoozeCount:0};return o.reminders.push(i),this.saveContact(o),this.dispatchEvent("wa-crm-reminder-added",{contactId:e,reminder:i}),i}static updateReminder(e,t,n){const a=this.getContact(e);if(!a)return!1;const r=a.reminders.findIndex(e=>e.id===t);return-1!==r&&(a.reminders[r]={...a.reminders[r],...n},this.saveContact(a),this.dispatchEvent("wa-crm-reminder-updated",{contactId:e,reminder:a.reminders[r]}),!0)}static updateReminderStatus(e,t,n){return this.updateReminder(e,t,{status:n})}static markReminderNotified(e,t){return this.updateReminder(e,t,{notified:!0,lastTriggeredAt:Date.now()})}static snoozeReminder(e,t){const n=this.getContact(e);if(!n)return!1;const a=n.reminders.find(e=>e.id===t);if(!a)return!1;const r=a.repeatInterval||5,o=Date.now()+60*r*1e3;return this.updateReminder(e,t,{datetime:o,notified:!1,status:"pending",snoozeCount:(a.snoozeCount||0)+1})}static stopReminder(e,t){return this.updateReminder(e,t,{isStopped:!0,status:"stopped"})}static resetReminderForRepeat(e,t){const n=this.getContact(e);if(!n)return!1;const a=n.reminders.find(e=>e.id===t);if(!a||a.isStopped)return!1;const r=a.repeatInterval;if(void 0===r||0===r)return this.updateReminder(e,t,{status:"completed"});const o=Date.now()+60*r*1e3;return this.updateReminder(e,t,{datetime:o,notified:!1,status:"pending"})}static deleteReminder(e,t){const n=this.getContact(e);if(!n)return!1;const a=n.reminders.find(e=>e.id===t);return n.reminders=n.reminders.filter(e=>e.id!==t),this.saveContact(n),a&&this.dispatchEvent("wa-crm-reminder-deleted",{contactId:e,reminderId:t}),!0}static getReminders(e){const t=this.getContact(e);return t?.reminders||[]}static getAllPendingReminders(){const e=this.getState(),t=[];for(const n of Object.values(e.contacts))for(const e of n.reminders)e.isStopped||"stopped"!==e.status&&"dismissed"!==e.status&&("pending"!==e.status||e.notified||t.push({contactId:n.id,contactName:n.profile.name,reminder:e}));return t.sort((e,t)=>e.reminder.datetime-t.reminder.datetime)}static getDueReminders(){const e=Date.now();return this.getAllPendingReminders().filter(t=>t.reminder.datetime<=e)}static addAppointment(e,t,n,a,r,o,i,s=!0,l=""){const c=this.getContact(e);if(!c)return null;c.appointments||(c.appointments=[]);const d={id:h("appt"),title:t,datetime:n,attendees:a,message:r,meetLink:o,reminderBefore:i,useSameMessage:s,meetingStartMessage:s?r:l,status:"scheduled",createdAt:Date.now(),updatedAt:Date.now(),attendeeReminderSent:!1,userReminderNotified:!1,meetingStartNotified:!1,attendeeMeetingStartSent:!1};return c.appointments.push(d),this.saveContact(c),this.dispatchEvent("wa-crm-appointment-added",{contactId:e,appointment:d}),d}static updateAppointment(e,t,n){const a=this.getContact(e);if(!a||!a.appointments)return!1;const r=a.appointments.findIndex(e=>e.id===t);return-1!==r&&(a.appointments[r]={...a.appointments[r],...n,updatedAt:Date.now()},this.saveContact(a),this.dispatchEvent("wa-crm-appointment-updated",{contactId:e,appointment:a.appointments[r]}),!0)}static updateAppointmentStatus(e,t,n){return this.updateAppointment(e,t,{status:n})}static markAppointmentReminderSent(e,t){return this.updateAppointment(e,t,{attendeeReminderSent:!0})}static markUserReminderNotified(e,t){return this.updateAppointment(e,t,{userReminderNotified:!0})}static markMeetingStartNotified(e,t){return this.updateAppointment(e,t,{meetingStartNotified:!0})}static deleteAppointment(e,t){const n=this.getContact(e);if(!n||!n.appointments)return!1;const a=n.appointments.find(e=>e.id===t);return n.appointments=n.appointments.filter(e=>e.id!==t),this.saveContact(n),a&&this.dispatchEvent("wa-crm-appointment-deleted",{contactId:e,appointmentId:t}),!0}static getAppointments(e){const t=this.getContact(e);return t?.appointments||[]}static getAllScheduledAppointments(){const e=this.getState(),t=[];for(const n of Object.values(e.contacts))if(n.appointments)for(const e of n.appointments)"scheduled"===e.status&&t.push({contactId:n.id,contactName:n.profile.name,appointment:e});return t.sort((e,t)=>e.appointment.datetime-t.appointment.datetime)}static getAppointmentsDueForReminder(){const e=Date.now();return this.getAllScheduledAppointments().filter(({appointment:t})=>{if(t.attendeeReminderSent)return!1;return t.datetime-60*t.reminderBefore*1e3<=e})}static getAppointmentsStarting(){const e=Date.now();return this.getAllScheduledAppointments().filter(({appointment:t})=>!t.meetingStartNotified&&t.datetime<=e)}static generateMeetLink(){return"https://meet.google.com/new"}static formatAppointmentMessage(e,t,n,a){const r=new Date(n),o=r.toLocaleDateString("pt-BR",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),i=r.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit",hour12:!0});return e.replace(/\{name\}/gi,t).replace(/\{date\}/gi,o).replace(/\{time\}/gi,i).replace(/\{link\}/gi,a)}static addIncome(e,t,n,a,r,o,i,s="completed",l){const c=this.getContact(e);if(!c)return null;c.incomes||(c.incomes=[]);const d={id:h("income"),amount:t,category:n,paymentMethod:a,description:r,reference:i,date:o,status:s,createdAt:Date.now(),updatedAt:Date.now(),...l&&l.isRecurring?{isRecurring:!0,recurringInterval:l.recurringInterval,recurringEndDate:l.recurringEndDate,nextOccurrence:l.nextOccurrence}:{}};return c.incomes.push(d),this.saveContact(c),d}static updateIncome(e,t,n){const a=this.getContact(e);if(!a||!a.incomes)return!1;const r=a.incomes.findIndex(e=>e.id===t);return-1!==r&&(a.incomes[r]={...a.incomes[r],...n,updatedAt:Date.now()},this.saveContact(a),!0)}static deleteIncome(e,t){const n=this.getContact(e);return!(!n||!n.incomes)&&(n.incomes=n.incomes.filter(e=>e.id!==t),this.saveContact(n),!0)}static getIncomes(e){const t=this.getContact(e);return t?.incomes||[]}static getTotalIncome(e,t){return this.getIncomes(e).filter(e=>!t||e.status===t).reduce((e,t)=>e+t.amount,0)}static addExpense(e,t,n,a,r,o,i,s="completed",l){const c=this.getContact(e);if(!c)return null;c.expenses||(c.expenses=[]);const d={id:h("expense"),amount:t,category:n,paymentMethod:a,description:r,reference:i,date:o,status:s,createdAt:Date.now(),updatedAt:Date.now(),...l&&l.isRecurring?{isRecurring:!0,recurringInterval:l.recurringInterval,recurringEndDate:l.recurringEndDate,nextOccurrence:l.nextOccurrence}:{}};return c.expenses.push(d),this.saveContact(c),d}static updateExpense(e,t,n){const a=this.getContact(e);if(!a||!a.expenses)return!1;const r=a.expenses.findIndex(e=>e.id===t);return-1!==r&&(a.expenses[r]={...a.expenses[r],...n,updatedAt:Date.now()},this.saveContact(a),!0)}static deleteExpense(e,t){const n=this.getContact(e);return!(!n||!n.expenses)&&(n.expenses=n.expenses.filter(e=>e.id!==t),this.saveContact(n),!0)}static getExpenses(e){const t=this.getContact(e);return t?.expenses||[]}static getTotalExpense(e,t){return this.getExpenses(e).filter(e=>!t||e.status===t).reduce((e,t)=>e+t.amount,0)}static getNetBalance(e){return this.getTotalIncome(e,"completed")-this.getTotalExpense(e,"completed")}static calculateNextOccurrence(e,t){const n=new Date(e);switch(t){case"daily":n.setDate(n.getDate()+1);break;case"weekly":n.setDate(n.getDate()+7);break;case"monthly":n.setMonth(n.getMonth()+1);break;case"quarterly":n.setMonth(n.getMonth()+3);break;case"yearly":n.setFullYear(n.getFullYear()+1)}return n.getTime()}static processRecurringTransactions(){const e=[],t=[],n=Date.now(),a=this.getState();for(const r in a.contacts){const o=a.contacts[r];if(o.incomes)for(const t of o.incomes)if(t.isRecurring&&t.nextOccurrence&&t.nextOccurrence<=n){if(t.recurringEndDate&&t.recurringEndDate<n)continue;const a={id:h("income"),amount:t.amount,category:t.category,paymentMethod:t.paymentMethod,description:t.description,reference:t.reference,date:t.nextOccurrence,status:"pending",createdAt:n,updatedAt:n,recurringParentId:t.id};o.incomes.push(a),e.push(a),t.nextOccurrence=this.calculateNextOccurrence(t.nextOccurrence,t.recurringInterval),t.updatedAt=n}if(o.expenses)for(const e of o.expenses)if(e.isRecurring&&e.nextOccurrence&&e.nextOccurrence<=n){if(e.recurringEndDate&&e.recurringEndDate<n)continue;const a={id:h("expense"),amount:e.amount,category:e.category,paymentMethod:e.paymentMethod,description:e.description,reference:e.reference,date:e.nextOccurrence,status:"pending",createdAt:n,updatedAt:n,recurringParentId:e.id};o.expenses.push(a),t.push(a),e.nextOccurrence=this.calculateNextOccurrence(e.nextOccurrence,e.recurringInterval),e.updatedAt=n}(e.length>0||t.length>0)&&this.saveContact(o)}return{incomes:e,expenses:t}}static addContactToTab(e,t){const n=this.getContact(e);return!!n&&(n.tabs.includes(t)||(n.tabs.push(t),this.saveContact(n)),!0)}static removeContactFromTab(e,t){const n=this.getContact(e);return!!n&&(n.tabs=n.tabs.filter(e=>e!==t),this.saveContact(n),!0)}static getContactTabs(e){const t=this.getContact(e);return t?.tabs||[]}static dispatchEvent(e,t){"undefined"!=typeof window&&"undefined"!=typeof document&&document.dispatchEvent(new CustomEvent(e,{detail:t}))}static clear(){this.setState({contacts:{},version:1})}static exportData(){return JSON.stringify(this.getState(),null,2)}static importData(e){try{const t=JSON.parse(e);if(t.contacts&&"number"==typeof t.version)return this.setState(t),!0}catch(e){}return!1}static getCurrencySettings(){try{const e=localStorage.getItem(this.CURRENCY_KEY);if(e)return JSON.parse(e)}catch(e){}return{code:"BRL",symbol:"R$",locale:"pt-BR"}}static setCurrencySettings(e,t,n){try{const a={code:e,symbol:t,locale:n};localStorage.setItem(this.CURRENCY_KEY,JSON.stringify(a));try{chrome.storage.local.set({[this.CURRENCY_KEY]:a},()=>{chrome.runtime.lastError})}catch(e){}}catch(e){}}static formatCurrency(e){const t=this.getCurrencySettings();try{return new Intl.NumberFormat(t.locale,{style:"currency",currency:t.code,minimumFractionDigits:0,maximumFractionDigits:2}).format(e)}catch{return`${t.symbol}${e.toLocaleString()}`}}static getAppointmentTemplates(){try{const e=localStorage.getItem(this.APPOINTMENT_TEMPLATES_KEY);if(e)return JSON.parse(e)}catch(e){}return[]}static saveAppointmentTemplate(e,t,n){const a=this.getAppointmentTemplates(),r=h();return a.push({id:r,name:e,message:t,meetLink:n}),localStorage.setItem(this.APPOINTMENT_TEMPLATES_KEY,JSON.stringify(a)),r}static updateAppointmentTemplate(e,t,n,a){const r=this.getAppointmentTemplates(),o=r.findIndex(t=>t.id===e);-1!==o&&(r[o]={id:e,name:t,message:n,meetLink:a},localStorage.setItem(this.APPOINTMENT_TEMPLATES_KEY,JSON.stringify(r)))}static deleteAppointmentTemplate(e){const t=this.getAppointmentTemplates().filter(t=>t.id!==e);localStorage.setItem(this.APPOINTMENT_TEMPLATES_KEY,JSON.stringify(t))}static syncToExtensionStorage(e,t){try{"undefined"!=typeof chrome&&chrome.storage&&chrome.storage.local.set({[e]:t})}catch(e){}}static syncCustomOptionsToExtensionStorage(){const e=["wa_crm_custom_income_categories","wa_crm_custom_expense_categories","wa_crm_custom_payment_methods","wa_crm_custom_transaction_statuses","wa_crm_hidden_income_categories","wa_crm_hidden_expense_categories","wa_crm_hidden_payment_methods","wa_crm_hidden_transaction_statuses"];for(const t of e)try{const e=localStorage.getItem(t);e&&this.syncToExtensionStorage(t,JSON.parse(e))}catch(e){}}static getCustomIncomeCategories(){try{const e=localStorage.getItem(this.CUSTOM_INCOME_CATEGORIES_KEY);if(e)return JSON.parse(e)}catch(e){}return[]}static addCustomIncomeCategory(e){const t=this.getCustomIncomeCategories(),n=`custom_income_${Date.now()}`;return t.push({id:n,label:e}),localStorage.setItem(this.CUSTOM_INCOME_CATEGORIES_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.CUSTOM_INCOME_CATEGORIES_KEY,t),n}static deleteCustomIncomeCategory(e){const t=this.getCustomIncomeCategories().filter(t=>t.id!==e);localStorage.setItem(this.CUSTOM_INCOME_CATEGORIES_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.CUSTOM_INCOME_CATEGORIES_KEY,t)}static getCustomExpenseCategories(){try{const e=localStorage.getItem(this.CUSTOM_EXPENSE_CATEGORIES_KEY);if(e)return JSON.parse(e)}catch(e){}return[]}static addCustomExpenseCategory(e){const t=this.getCustomExpenseCategories(),n=`custom_expense_${Date.now()}`;return t.push({id:n,label:e}),localStorage.setItem(this.CUSTOM_EXPENSE_CATEGORIES_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.CUSTOM_EXPENSE_CATEGORIES_KEY,t),n}static deleteCustomExpenseCategory(e){const t=this.getCustomExpenseCategories().filter(t=>t.id!==e);localStorage.setItem(this.CUSTOM_EXPENSE_CATEGORIES_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.CUSTOM_EXPENSE_CATEGORIES_KEY,t)}static getCustomTransactionStatuses(){try{const e=localStorage.getItem(this.CUSTOM_TRANSACTION_STATUSES_KEY);if(e)return JSON.parse(e)}catch(e){}return[]}static addCustomTransactionStatus(e){const t=this.getCustomTransactionStatuses(),n=`custom_status_${Date.now()}`;return t.push({id:n,label:e}),localStorage.setItem(this.CUSTOM_TRANSACTION_STATUSES_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.CUSTOM_TRANSACTION_STATUSES_KEY,t),n}static deleteCustomTransactionStatus(e){const t=this.getCustomTransactionStatuses().filter(t=>t.id!==e);localStorage.setItem(this.CUSTOM_TRANSACTION_STATUSES_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.CUSTOM_TRANSACTION_STATUSES_KEY,t)}static getHiddenIncomeCategories(){try{const e=localStorage.getItem(this.HIDDEN_INCOME_CATEGORIES_KEY);if(e)return JSON.parse(e)}catch(e){}return[]}static hideIncomeCategory(e){const t=this.getHiddenIncomeCategories();t.includes(e)||(t.push(e),localStorage.setItem(this.HIDDEN_INCOME_CATEGORIES_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.HIDDEN_INCOME_CATEGORIES_KEY,t))}static showIncomeCategory(e){const t=this.getHiddenIncomeCategories().filter(t=>t!==e);localStorage.setItem(this.HIDDEN_INCOME_CATEGORIES_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.HIDDEN_INCOME_CATEGORIES_KEY,t)}static getHiddenExpenseCategories(){try{const e=localStorage.getItem(this.HIDDEN_EXPENSE_CATEGORIES_KEY);if(e)return JSON.parse(e)}catch(e){}return[]}static hideExpenseCategory(e){const t=this.getHiddenExpenseCategories();t.includes(e)||(t.push(e),localStorage.setItem(this.HIDDEN_EXPENSE_CATEGORIES_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.HIDDEN_EXPENSE_CATEGORIES_KEY,t))}static showExpenseCategory(e){const t=this.getHiddenExpenseCategories().filter(t=>t!==e);localStorage.setItem(this.HIDDEN_EXPENSE_CATEGORIES_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.HIDDEN_EXPENSE_CATEGORIES_KEY,t)}static getHiddenTransactionStatuses(){try{const e=localStorage.getItem(this.HIDDEN_TRANSACTION_STATUSES_KEY);if(e)return JSON.parse(e)}catch(e){}return[]}static hideTransactionStatus(e){const t=this.getHiddenTransactionStatuses();t.includes(e)||(t.push(e),localStorage.setItem(this.HIDDEN_TRANSACTION_STATUSES_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.HIDDEN_TRANSACTION_STATUSES_KEY,t))}static showTransactionStatus(e){const t=this.getHiddenTransactionStatuses().filter(t=>t!==e);localStorage.setItem(this.HIDDEN_TRANSACTION_STATUSES_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.HIDDEN_TRANSACTION_STATUSES_KEY,t)}static getCustomPaymentMethods(){try{const e=localStorage.getItem(this.CUSTOM_PAYMENT_METHODS_KEY);if(e)return JSON.parse(e)}catch(e){}return[]}static addCustomPaymentMethod(e){const t=this.getCustomPaymentMethods(),n=`custom_payment_${Date.now()}`;return t.push({id:n,label:e}),localStorage.setItem(this.CUSTOM_PAYMENT_METHODS_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.CUSTOM_PAYMENT_METHODS_KEY,t),n}static deleteCustomPaymentMethod(e){const t=this.getCustomPaymentMethods().filter(t=>t.id!==e);localStorage.setItem(this.CUSTOM_PAYMENT_METHODS_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.CUSTOM_PAYMENT_METHODS_KEY,t)}static getHiddenPaymentMethods(){try{const e=localStorage.getItem(this.HIDDEN_PAYMENT_METHODS_KEY);if(e)return JSON.parse(e)}catch(e){}return[]}static hidePaymentMethod(e){const t=this.getHiddenPaymentMethods();t.includes(e)||(t.push(e),localStorage.setItem(this.HIDDEN_PAYMENT_METHODS_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.HIDDEN_PAYMENT_METHODS_KEY,t))}static showPaymentMethod(e){const t=this.getHiddenPaymentMethods().filter(t=>t!==e);localStorage.setItem(this.HIDDEN_PAYMENT_METHODS_KEY,JSON.stringify(t)),this.syncToExtensionStorage(this.HIDDEN_PAYMENT_METHODS_KEY,t)}static getTodoState(){try{const e=localStorage.getItem(this.TODO_STORAGE_KEY);if(e){return JSON.parse(e)}}catch(e){}return{todos:[],categories:[...m],version:1}}static setTodoState(e){try{localStorage.setItem(this.TODO_STORAGE_KEY,JSON.stringify(e)),this.syncTodoToChromeStorage(e)}catch(e){}}static syncTodoToChromeStorage(e){try{chrome.storage.local.set({[this.TODO_CHROME_STORAGE_KEY]:e},()=>{chrome.runtime.lastError})}catch(e){}}static getAllTodos(){return this.getTodoState().todos||[]}static getTodo(e){return this.getAllTodos().find(t=>t.id===e)||null}static getTodosForDate(e){const t=this.getAllTodos(),n=new Date(e);n.setHours(0,0,0,0);const a=new Date(e);return a.setHours(23,59,59,999),t.filter(e=>!!e.dueDate&&(e.dueDate>=n.getTime()&&e.dueDate<=a.getTime()))}static getTodosByDateRange(e,t){return this.getAllTodos().filter(n=>!!n.dueDate&&(n.dueDate>=e&&n.dueDate<=t))}static getTodosByFilter(e){const t=this.getAllTodos(),n=new Date,a=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),r=a+864e5-1,o=a+6048e5-1;switch(e){case"today":return t.filter(e=>!!e.dueDate&&(e.dueDate>=a&&e.dueDate<=r&&"completed"!==e.status&&"cancelled"!==e.status));case"this_week":return t.filter(e=>!!e.dueDate&&(e.dueDate>=a&&e.dueDate<=o&&"completed"!==e.status&&"cancelled"!==e.status));case"all":return t.filter(e=>"completed"!==e.status&&"cancelled"!==e.status);case"overdue":return t.filter(e=>!!e.dueDate&&(e.dueDate<a&&"completed"!==e.status&&"cancelled"!==e.status));case"completed":return t.filter(e=>"completed"===e.status);default:return t}}static getOverdueTodos(){return this.getTodosByFilter("overdue")}static getDueTodos(){const e=this.getAllTodos(),t=Date.now();return e.filter(e=>{if(e.notified||"completed"===e.status||"cancelled"===e.status)return!1;if(e.reminderDate){let n=e.reminderDate;if(e.reminderTime){const[t,a]=e.reminderTime.split(":").map(Number),r=new Date(e.reminderDate);r.setHours(t,a,0,0),n=r.getTime()}return n<=t}if(e.dueDate){let n=e.dueDate;if(e.dueTime){const[t,a]=e.dueTime.split(":").map(Number),r=new Date(e.dueDate);r.setHours(t,a,0,0),n=r.getTime()}return n<=t}return!1})}static addTodo(e){try{const t=this.getTodoState(),n=Date.now(),a={...e,id:h("todo"),createdAt:n,updatedAt:n};return t.todos.push(a),this.setTodoState(t),this.dispatchEvent("wa-crm-todo-added",{todo:a}),a}catch(e){return null}}static updateTodo(e,t){try{const n=this.getTodoState(),a=n.todos.findIndex(t=>t.id===e);return-1!==a&&(n.todos[a]={...n.todos[a],...t,updatedAt:Date.now()},this.setTodoState(n),this.dispatchEvent("wa-crm-todo-updated",{todo:n.todos[a]}),!0)}catch(e){return!1}}static deleteTodo(e){try{const t=this.getTodoState(),n=t.todos.find(t=>t.id===e);return t.todos=t.todos.filter(t=>t.id!==e),this.setTodoState(t),n&&this.dispatchEvent("wa-crm-todo-deleted",{todoId:e}),!0}catch(e){return!1}}static toggleTodoStatus(e){const t=this.getTodo(e);if(!t)return!1;const n="completed"===t.status?"pending":"completed",a="completed"===n?Date.now():void 0;return this.updateTodo(e,{status:n,completedAt:a})}static markTodoNotified(e){return this.updateTodo(e,{notified:!0})}static addSubtask(e,t){try{const n=this.getTodo(e);if(!n)return null;const a={id:h("subtask"),title:t,completed:!1,createdAt:Date.now()},r=[...n.subtasks,a];return this.updateTodo(e,{subtasks:r}),a}catch(e){return null}}static toggleSubtask(e,t){try{const n=this.getTodo(e);if(!n)return!1;const a=n.subtasks.map(e=>e.id===t?{...e,completed:!e.completed}:e);return this.updateTodo(e,{subtasks:a})}catch(e){return!1}}static updateSubtask(e,t,n){try{const a=this.getTodo(e);if(!a)return!1;const r=a.subtasks.map(e=>e.id===t?{...e,title:n}:e);return this.updateTodo(e,{subtasks:r})}catch(e){return!1}}static deleteSubtask(e,t){try{const n=this.getTodo(e);if(!n)return!1;const a=n.subtasks.filter(e=>e.id!==t);return this.updateTodo(e,{subtasks:a})}catch(e){return!1}}static getTodoCategories(){return this.getTodoState().categories||m}static getTodoCategory(e){return this.getTodoCategories().find(t=>t.id===e)||null}static addTodoCategory(e,t){try{const n=this.getTodoState(),a={id:h("cat"),name:e,color:t};return n.categories.push(a),this.setTodoState(n),a}catch(e){return null}}static updateTodoCategory(e,t){try{const n=this.getTodoState(),a=n.categories.findIndex(t=>t.id===e);return-1!==a&&(n.categories[a]={...n.categories[a],...t},this.setTodoState(n),!0)}catch(e){return!1}}static deleteTodoCategory(e){try{const t=this.getTodoState();return t.categories=t.categories.filter(t=>t.id!==e),t.todos=t.todos.map(t=>t.categoryId===e?{...t,categoryId:void 0}:t),this.setTodoState(t),!0}catch(e){return!1}}static calculateTodoNextOccurrence(e,t){const n=new Date(e);switch(t){case"daily":n.setDate(n.getDate()+1);break;case"weekly":n.setDate(n.getDate()+7);break;case"monthly":n.setMonth(n.getMonth()+1);break;case"yearly":n.setFullYear(n.getFullYear()+1)}return n.getTime()}static processRecurringTodos(){const e=[],t=Date.now(),n=this.getTodoState();for(const a of n.todos){if(!a.isRecurring||!a.nextOccurrence||a.nextOccurrence>t)continue;if(a.recurringEndDate&&a.recurringEndDate<t)continue;const r={id:h("todo"),title:a.title,description:a.description,dueDate:a.nextOccurrence,dueTime:a.dueTime,priority:a.priority,categoryId:a.categoryId,subtasks:a.subtasks.map(e=>({...e,id:h("subtask"),completed:!1})),status:"pending",isRecurring:!1,recurringParentId:a.id,browserNotification:a.browserNotification,whatsappNotification:a.whatsappNotification,notified:!1,createdAt:t,updatedAt:t};n.todos.push(r),e.push(r);const o=n.todos.findIndex(e=>e.id===a.id);-1!==o&&a.recurringInterval&&(n.todos[o].nextOccurrence=this.calculateTodoNextOccurrence(a.nextOccurrence,a.recurringInterval),n.todos[o].updatedAt=t)}return e.length>0&&this.setTodoState(n),e}static getTodoStats(){const e=this.getAllTodos(),t=(Date.now(),(new Date).setHours(0,0,0,0)),n=t+864e5-1;return{total:e.length,pending:e.filter(e=>"pending"===e.status||"in_progress"===e.status).length,completed:e.filter(e=>"completed"===e.status).length,overdue:e.filter(e=>!(!e.dueDate||"completed"===e.status||"cancelled"===e.status)&&e.dueDate<t).length,todayDue:e.filter(e=>!(!e.dueDate||"completed"===e.status||"cancelled"===e.status)&&(e.dueDate>=t&&e.dueDate<=n)).length}}}v.CURRENCY_KEY="wa_crm_currency",v.APPOINTMENT_TEMPLATES_KEY="wa_crm_appointment_templates",v.CUSTOM_INCOME_CATEGORIES_KEY="wa_crm_custom_income_categories",v.CUSTOM_EXPENSE_CATEGORIES_KEY="wa_crm_custom_expense_categories",v.CUSTOM_TRANSACTION_STATUSES_KEY="wa_crm_custom_transaction_statuses",v.CUSTOM_PAYMENT_METHODS_KEY="wa_crm_custom_payment_methods",v.HIDDEN_PAYMENT_METHODS_KEY="wa_crm_hidden_payment_methods",v.HIDDEN_INCOME_CATEGORIES_KEY="wa_crm_hidden_income_categories",v.HIDDEN_EXPENSE_CATEGORIES_KEY="wa_crm_hidden_expense_categories",v.HIDDEN_TRANSACTION_STATUSES_KEY="wa_crm_hidden_transaction_statuses",v.TODO_STORAGE_KEY="wa_crm_todos",v.TODO_CHROME_STORAGE_KEY="wa_crm_todos_sync";const y="lion_crm_theme_settings",x="lion_crm_theme_sync",w="lionThemeChanged",k=()=>({mode:"system",lastUpdated:Date.now()}),E=()=>"undefined"!=typeof localStorage,S=()=>"undefined"!=typeof chrome&&chrome.storage&&!!chrome.storage.local,C=()=>{if("undefined"==typeof document)return!1;const e=document.documentElement,t=document.body,n=e.classList.contains("dark")||t?.classList.contains("dark"),a="dark"===(e.getAttribute("data-color-scheme")||t?.getAttribute("data-color-scheme")),r=getComputedStyle(e).colorScheme;return n||a||"dark"===r},T=e=>{if("undefined"==typeof window)return;const t=e?"dark":"light";window.postMessage({type:"SET_WHATSAPP_THEME",payload:{theme:t}},"*")},A=e=>"system"===e?C()?"dark":"light":e,D=async()=>{if(E())try{const e=localStorage.getItem(y);if(e)return JSON.parse(e)}catch(e){}if(S())try{const e=await chrome.storage.local.get(x);if(e[x])return e[x]}catch(e){}return k()},_=()=>{if(E())try{const e=localStorage.getItem(y);if(e)return JSON.parse(e)}catch(e){}return k()},N=e=>{"undefined"!=typeof document&&(e?(document.documentElement.classList.add("lion-dark"),document.body?.classList.add("lion-dark")):(document.documentElement.classList.remove("lion-dark"),document.body?.classList.remove("lion-dark")),window.dispatchEvent(new CustomEvent("lionThemeApplied",{detail:{isDark:e}})))},M=e=>{if("undefined"==typeof document)return null;let t=C();const n=()=>{const n=C();n!==t&&(t=n,e(n))},a=new MutationObserver(e=>{for(const t of e)if("attributes"===t.type&&("class"===t.attributeName||"data-color-scheme"===t.attributeName||"style"===t.attributeName)){n();break}});return a.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-color-scheme","style"]}),document.body&&a.observe(document.body,{attributes:!0,attributeFilter:["class","data-color-scheme","style"]}),a},I=w,R=[{id:"event_details",label:"Event Details",enabled:!0},{id:"number",label:"Number",enabled:!0},{id:"name",label:"Name",enabled:!0},{id:"tab_id",label:"Tab ID",enabled:!0},{id:"tab_name",label:"Tab Name",enabled:!0},{id:"tab_color",label:"Tab Color",enabled:!1},{id:"all_tabs",label:"All Contact Tabs",enabled:!1},{id:"contact_profile",label:"Contact Profile",enabled:!1}],B=async(e,t,n)=>{try{const a=localStorage.getItem("webhook_settings");if(!a)return;const r=JSON.parse(a).custom_tabs;if(!r||!r.active||!r.url)return;const o={},i=r.dataFields&&r.dataFields.length>0?r.dataFields:R;o.tab={id:n.tabId,name:n.tabName,color:n.tabColor||null};const s=d.TabsStorage.getTabs();i.forEach(a=>{if(a.enabled)switch(a.id){case"event_details":o.event={type:"custom_tabs",action:e,timestamp:Date.now()};break;case"number":o.number=t.id.split("@")[0];break;case"name":o.name=t.name;break;case"tab_id":o.tabId=n.tabId;break;case"tab_name":o.tabName=n.tabName;break;case"tab_color":o.tabColor=n.tabColor||null;break;case"all_tabs":const a=s.filter(e=>e.chats?.some(e=>e.id===t.id));o.allTabs=a.map(e=>({id:e.id,name:e.title,color:e.labelColor||null}));break;case"contact_profile":const r=v.getContact(t.id);r&&r.profile?o.contactProfile={fullName:r.profile.name||t.name,phone:r.profile.phone||t.id.split("@")[0],email:r.profile.email||null,gender:r.profile.gender||null,dateOfBirth:r.profile.dateOfBirth||null,details:r.profile.details||null,address:r.profile.address||null,language:r.profile.language||null,customFields:r.profile.customFields||[]}:o.contactProfile={fullName:t.name,phone:t.id.split("@")[0]}}}),chrome.runtime.sendMessage({type:"SEND_WEBHOOK",url:r.url,payload:o,eventType:"custom_tabs"})}catch(e){}},P=({isOpen:e,onClose:t})=>{const[n,r]=(0,a.useState)([]),[o,i]=(0,a.useState)(!1),[l,c]=(0,a.useState)(null),[m,p]=(0,a.useState)(0),[u,g]=(0,a.useState)(null),[h,b]=(0,a.useState)(null),[f,v]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{e&&y()},[e]),(0,a.useEffect)(()=>{const e=e=>{p(e=>e+1)},t=()=>{const e=_();v("dark"===A(e.mode))};return window.addEventListener("languageChanged",e),window.addEventListener(I,t),window.addEventListener("lionThemeApplied",t),()=>{window.removeEventListener("languageChanged",e),window.removeEventListener(I,t),window.removeEventListener("lionThemeApplied",t)}},[]);const y=()=>{const e=d.TabsStorage.getTabs();r(e)},x=()=>{b(null)},w=()=>{g(null),b(null)};return e?a.createElement(a.Fragment,null,a.createElement("div",{className:"tabs-manager-backdrop",onClick:t}),a.createElement("div",{className:"tabs-manager-modal "+(f?"lion-dark":"")},a.createElement("div",{className:"tabs-manager-header"},a.createElement("h2",{className:"tabs-manager-title"},(0,s.t)("tabs.tabs")),a.createElement("button",{className:"tabs-close-btn",onClick:t},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"tabs-manager-body"},a.createElement("div",{className:"add-tab-section"},a.createElement("button",{className:"add-tab-btn",onClick:()=>i(!0)},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),(0,s.t)("tabs.addTab"))),a.createElement("div",{className:"tabs-table"},a.createElement("div",{className:"tabs-table-header"},a.createElement("div",{className:"tabs-col-sort"},(0,s.t)("tabs.sort")),a.createElement("div",{className:"tabs-col-title"},(0,s.t)("tabs.title")),a.createElement("div",{className:"tabs-col-details"},(0,s.t)("tabs.details")),a.createElement("div",{className:"tabs-col-action"},(0,s.t)("tabs.action"))),a.createElement("div",{className:"tabs-table-body"},n.map(e=>{const t=u===e.id,o=h===e.id,i=!e.isPermanent;return a.createElement("div",{key:e.id,className:`tabs-table-row ${t?"dragging":""} ${o?"drag-over":""} ${i?"":"not-draggable"}`,draggable:i,onDragStart:t=>((e,t)=>{const a=n.find(e=>e.id===t);a?.isPermanent?e.preventDefault():(g(t),e.dataTransfer.effectAllowed="move")})(t,e.id),onDragOver:t=>((e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect="move",b(t)})(t,e.id),onDragLeave:x,onDrop:t=>((e,t)=>{if(e.preventDefault(),!u||u===t)return g(null),void b(null);const a=n.findIndex(e=>e.id===u),o=n.findIndex(e=>e.id===t);if(-1===a||-1===o)return g(null),void b(null);const i=n[a],s=n[o];if(i.isPermanent||s.isPermanent)return g(null),void b(null);const l=[...n],[c]=l.splice(a,1);l.splice(o,0,c),r(l);const m=d.TabsStorage.getState();m.tabs=l,d.TabsStorage.setState(m),document.dispatchEvent(new CustomEvent("wa-tab-data-updated",{detail:{tabId:u}})),g(null),b(null)})(t,e.id),onDragEnd:w},a.createElement("div",{className:"tabs-col-sort"},a.createElement("svg",{viewBox:"0 0 24 24",className:"drag-icon "+(i?"":"disabled")},a.createElement("path",{fill:"currentColor",d:"M3 15h18v-2H3v2zm0 4h18v-2H3v2zm0-8h18V9H3v2zm0-6v2h18V5H3z"}))),a.createElement("div",{className:"tabs-col-title"},e.title),a.createElement("div",{className:"tabs-col-details"},e.details||((e.chats||[]).length>0?`${(e.chats||[]).length} ${(0,s.t)("tabs.chats")}`:(0,s.t)("tabs.noFilterApplied"))),a.createElement("div",{className:"tabs-col-action"},a.createElement("button",{className:"tabs-action-btn "+(e.hidden?"hide-btn":"view-btn"),onClick:()=>(e=>{const t=n.find(t=>t.id===e);t&&(d.TabsStorage.updateTab(e,{hidden:!t.hidden}),y(),document.dispatchEvent(new CustomEvent("wa-tab-data-updated",{detail:{tabId:e}})))})(e.id),title:e.hidden?(0,s.t)("tabs.showInTabBar"):(0,s.t)("tabs.hideFromTabBar")},e.hidden?a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"})):a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}))),!e.isPermanent&&a.createElement(a.Fragment,null,a.createElement("button",{className:"tabs-action-btn edit-btn",onClick:()=>c(e),title:(0,s.t)("tabs.edit")},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}))),a.createElement("button",{className:"tabs-action-btn duplicate-btn",onClick:()=>(e=>{const t=d.TabsStorage.addTab({title:`${e.title} (${(0,s.t)("tabs.copy")||"Copy"})`,details:e.details||"",chats:[...e.chats||[]],isPermanent:!1,labelColor:e.labelColor});y(),document.dispatchEvent(new CustomEvent("wa-tab-data-updated",{detail:{tabId:t.id}}))})(e),title:(0,s.t)("tabs.duplicate")||"Duplicate"},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}))),a.createElement("button",{className:"tabs-action-btn delete-btn",onClick:()=>{return t=e.id,void(confirm((0,s.t)("tabs.areYouSureDeleteTab"))&&(d.TabsStorage.deleteTab(t),y()));var t},title:(0,s.t)("tabs.delete")},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}))))))}))))),(o||l)&&a.createElement(L,{tab:l,isDarkMode:f,onClose:()=>{i(!1),c(null)},onSave:()=>{i(!1),c(null),y()}}),a.createElement("style",null,"\n        /* Tabs Manager Modal */\n        .tabs-manager-backdrop {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.5);\n          z-index: 10000;\n          animation: fadeIn 0.2s ease;\n        }\n\n        .tabs-manager-modal {\n          position: fixed;\n          top: 50%;\n          left: 50%;\n          transform: translate(-50%, -50%);\n          background: var(--lion-bg-primary);\n          border-radius: 12px;\n          box-shadow: var(--lion-shadow-xl);\n          z-index: 10001;\n          width: 90%;\n          max-width: 1000px;\n          max-height: 80vh;\n          display: flex;\n          flex-direction: column;\n          animation: modalSlide 0.3s ease;\n        }\n\n        @keyframes fadeIn {\n          from { opacity: 0; }\n          to { opacity: 1; }\n        }\n\n        @keyframes modalSlide {\n          from {\n            opacity: 0;\n            transform: translate(-50%, -48%);\n          }\n          to {\n            opacity: 1;\n            transform: translate(-50%, -50%);\n          }\n        }\n\n        .tabs-manager-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 20px 24px;\n          border-bottom: 1px solid var(--lion-border-light);\n          flex-shrink: 0;\n        }\n\n        .tabs-manager-title {\n          font-size: 24px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          margin: 0;\n        }\n\n        .tabs-close-btn {\n          background: transparent;\n          border: none;\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          padding: 8px;\n          border-radius: 6px;\n          transition: all 0.2s;\n          display: flex;\n          align-items: center;\n        }\n\n        .tabs-close-btn:hover {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        .tabs-close-btn svg {\n          width: 24px;\n          height: 24px;\n        }\n\n        .tabs-manager-body {\n          padding: 24px;\n          overflow-y: auto;\n          flex: 1;\n        }\n\n        /* Add Tab Button */\n        .add-tab-section {\n          display: flex;\n          justify-content: flex-end;\n          margin-bottom: 20px;\n        }\n\n        .add-tab-btn {\n          background: var(--lion-primary);\n          color: white;\n          border: none;\n          padding: 10px 20px;\n          border-radius: 8px;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          transition: all 0.2s;\n        }\n\n        .add-tab-btn:hover {\n          background: var(--lion-primary-hover);\n          transform: translateY(-2px);\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.3);\n        }\n\n        .add-tab-btn svg {\n          width: 20px;\n          height: 20px;\n        }\n\n        /* Tabs Table */\n        .tabs-table {\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          overflow: hidden;\n        }\n\n        .tabs-table-header {\n          display: grid;\n          grid-template-columns: 60px 1fr 2fr 120px;\n          background: var(--lion-bg-secondary);\n          border-bottom: 1px solid var(--lion-border-light);\n          padding: 12px 16px;\n          font-weight: 600;\n          font-size: 14px;\n          color: var(--lion-text-secondary);\n        }\n\n        .tabs-table-body {\n          background: var(--lion-bg-primary);\n        }\n\n        .tabs-table-row {\n          display: grid;\n          grid-template-columns: 60px 1fr 2fr 120px;\n          padding: 16px;\n          border-bottom: 1px solid var(--lion-border-light);\n          align-items: center;\n          transition: background 0.15s, transform 0.15s, opacity 0.15s;\n        }\n\n        .tabs-table-row:last-child {\n          border-bottom: none;\n        }\n\n        .tabs-table-row:hover {\n          background: var(--lion-bg-secondary);\n        }\n\n        .tabs-table-row.dragging {\n          opacity: 0.4;\n          background: var(--lion-bg-tertiary);\n        }\n\n        .tabs-table-row.drag-over {\n          background: var(--lion-primary-light);\n          border-top: 2px solid var(--lion-primary);\n          transform: translateY(2px);\n        }\n\n        .tabs-table-row.not-draggable {\n          cursor: default;\n        }\n\n        .tabs-col-sort {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n        }\n\n        .drag-icon {\n          width: 20px;\n          height: 20px;\n          color: var(--lion-text-light);\n          cursor: grab;\n          transition: color 0.2s;\n        }\n\n        .drag-icon:hover {\n          color: var(--lion-text-muted);\n        }\n\n        .drag-icon:active {\n          cursor: grabbing;\n        }\n\n        .drag-icon.disabled {\n          color: var(--lion-border-medium);\n          cursor: not-allowed;\n        }\n\n        .tabs-col-title {\n          font-weight: 500;\n          color: var(--lion-text-primary);\n          font-size: 14px;\n        }\n\n        .tabs-col-details {\n          color: var(--lion-text-muted);\n          font-size: 13px;\n        }\n\n        .tabs-col-action {\n          display: flex;\n          gap: 8px;\n          justify-content: center;\n        }\n\n        .tabs-action-btn {\n          background: transparent;\n          border: none;\n          padding: 8px;\n          border-radius: 6px;\n          cursor: pointer;\n          transition: all 0.15s;\n          display: flex;\n          align-items: center;\n        }\n\n        .tabs-action-btn svg {\n          width: 20px;\n          height: 20px;\n        }\n\n        .view-btn {\n          color: var(--lion-info);\n        }\n\n        .view-btn:hover {\n          background: var(--lion-info-light);\n        }\n\n        .hide-btn {\n          color: var(--lion-text-light);\n        }\n\n        .hide-btn:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .edit-btn {\n          color: var(--lion-success);\n        }\n\n        .edit-btn:hover {\n          background: var(--lion-success-light);\n        }\n\n        .duplicate-btn {\n          color: var(--lion-info);\n        }\n\n        .duplicate-btn:hover {\n          background: var(--lion-info-light);\n        }\n\n        .delete-btn {\n          color: var(--lion-error);\n        }\n\n        .delete-btn:hover {\n          background: var(--lion-error-light);\n        }\n\n        /* ========== DARK MODE OVERRIDES ========== */\n        .tabs-manager-modal.lion-dark {\n          background: #1a1a1a !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-manager-header {\n          border-bottom-color: #3a3a3a !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-manager-title {\n          color: #ffffff !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-close-btn {\n          color: #a0a0a0 !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-close-btn:hover {\n          background: #333333 !important;\n          color: #ffffff !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-table {\n          border-color: #3a3a3a !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-table-header {\n          background: #262626 !important;\n          border-bottom-color: #3a3a3a !important;\n          color: #a0a0a0 !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-table-body {\n          background: #1a1a1a !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-table-row {\n          border-bottom-color: #3a3a3a !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-table-row:hover {\n          background: #262626 !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-col-title {\n          color: #ffffff !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-col-details {\n          color: #a0a0a0 !important;\n        }\n\n        .tabs-manager-modal.lion-dark .drag-icon {\n          color: #666666 !important;\n        }\n\n        .tabs-manager-modal.lion-dark .drag-icon:hover {\n          color: #a0a0a0 !important;\n        }\n\n        /* ============================================================ */\n        /* ============== V3 REDESIGN OVERRIDES ======================= */\n        /* Clean modern SaaS modal matching BroadcastModal/TemplateManager */\n        /* ============================================================ */\n\n        /* === BACKDROP === */\n        .tabs-manager-backdrop {\n          background: rgba(0, 0, 0, 0.55) !important;\n          backdrop-filter: blur(6px);\n          -webkit-backdrop-filter: blur(6px);\n        }\n\n        /* === MODAL CONTAINER === */\n        .tabs-manager-modal {\n          width: 92% !important;\n          max-width: 1100px !important;\n          max-height: 88vh !important;\n          border-radius: 16px !important;\n          border: 1px solid var(--lion-border-light);\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;\n        }\n\n        /* === HEADER === */\n        .tabs-manager-header {\n          padding: 20px 28px !important;\n          border-bottom: 1px solid var(--lion-border-light) !important;\n        }\n\n        .tabs-manager-title {\n          font-size: 20px !important;\n          font-weight: 700 !important;\n          letter-spacing: -0.01em;\n        }\n\n        .tabs-close-btn {\n          width: 36px !important;\n          height: 36px !important;\n          border-radius: 10px !important;\n          background: var(--lion-bg-tertiary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          color: var(--lion-text-muted) !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          padding: 0 !important;\n          transition: all 0.2s !important;\n        }\n\n        .tabs-close-btn:hover {\n          background: rgba(239, 68, 68, 0.1) !important;\n          color: #ef4444 !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n        }\n\n        .tabs-close-btn svg {\n          width: 18px !important;\n          height: 18px !important;\n        }\n\n        /* === BODY === */\n        .tabs-manager-body {\n          padding: 24px 28px !important;\n          background: var(--lion-bg-secondary);\n        }\n\n        /* === ADD TAB BUTTON (Gradient) === */\n        .add-tab-btn {\n          background: var(--lion-primary) !important;\n          border-radius: 10px !important;\n          padding: 10px 20px !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n          border: none !important;\n        }\n\n        .add-tab-btn:hover {\n          background: var(--lion-primary-hover) !important;\n          transform: translateY(-1px) !important;\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n        }\n\n        /* === TABLE === */\n        .tabs-table {\n          border-radius: 10px !important;\n          border: 1px solid var(--lion-border-light) !important;\n          overflow: hidden !important;\n        }\n\n        .tabs-table-header {\n          padding: 10px 16px !important;\n          font-size: 11px !important;\n          font-weight: 700 !important;\n          text-transform: uppercase !important;\n          letter-spacing: 0.5px !important;\n          color: var(--lion-text-muted) !important;\n          background: var(--lion-bg-secondary) !important;\n          border-bottom: 1px solid var(--lion-border-light) !important;\n        }\n\n        .tabs-table-body {\n          background: var(--lion-bg-primary) !important;\n        }\n\n        .tabs-table-row {\n          padding: 14px 16px !important;\n          border-bottom: 1px solid var(--lion-border-light) !important;\n          transition: background 0.15s ease !important;\n        }\n\n        .tabs-table-row:hover {\n          background: rgba(var(--lion-primary-rgb), 0.03) !important;\n        }\n\n        .tabs-table-row.drag-over {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          border-top: 2px solid var(--lion-primary) !important;\n        }\n\n        .tabs-col-title {\n          font-size: 14px !important;\n          font-weight: 600 !important;\n          color: var(--lion-text-primary) !important;\n        }\n\n        .tabs-col-details {\n          font-size: 13px !important;\n          color: var(--lion-text-muted) !important;\n        }\n\n        /* === ACTION BUTTONS === */\n        .tabs-action-btn {\n          border-radius: 8px !important;\n          padding: 7px !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .tabs-action-btn:hover {\n          transform: scale(1.08);\n        }\n\n        .tabs-action-btn svg {\n          width: 18px !important;\n          height: 18px !important;\n        }\n\n        /* === SCROLLBAR === */\n        .tabs-manager-body::-webkit-scrollbar {\n          width: 8px;\n        }\n\n        .tabs-manager-body::-webkit-scrollbar-track {\n          background: transparent;\n        }\n\n        .tabs-manager-body::-webkit-scrollbar-thumb {\n          background: var(--lion-border-medium, #d1d5db);\n          border-radius: 4px;\n        }\n\n        .tabs-manager-body::-webkit-scrollbar-thumb:hover {\n          background: var(--lion-text-light, #9ca3af);\n        }\n\n        /* === V3 DARK MODE OVERRIDES === */\n        .tabs-manager-modal.lion-dark {\n          background: #18181b !important;\n          border-color: #27272a !important;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-manager-header {\n          background: #18181b !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-manager-title {\n          color: #fafafa !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-close-btn {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #a1a1aa !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-close-btn:hover {\n          background: rgba(239, 68, 68, 0.15) !important;\n          color: #f87171 !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-manager-body {\n          background: #1a1a1a !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-table {\n          border-color: #27272a !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-table-header {\n          background: #1f1f22 !important;\n          border-bottom-color: #27272a !important;\n          color: #a1a1aa !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-table-body {\n          background: #18181b !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-table-row {\n          border-bottom-color: #27272a !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-table-row:hover {\n          background: rgba(var(--lion-primary-rgb), 0.06) !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-col-title {\n          color: #fafafa !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-col-details {\n          color: #a1a1aa !important;\n        }\n\n        .tabs-manager-modal.lion-dark .drag-icon {\n          color: #52525b !important;\n        }\n\n        .tabs-manager-modal.lion-dark .drag-icon:hover {\n          color: #a1a1aa !important;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-manager-body::-webkit-scrollbar-thumb {\n          background: #3f3f46;\n        }\n\n        .tabs-manager-modal.lion-dark .tabs-manager-body::-webkit-scrollbar-thumb:hover {\n          background: #52525b;\n        }\n      ")):null},L=({tab:e,isDarkMode:t,onClose:n,onSave:r})=>{const[o,i]=(0,a.useState)(e?.title||""),[l,c]=(0,a.useState)(e?.details||""),[m,p]=(0,a.useState)(e?.chats||[]),[u,g]=(0,a.useState)(""),[h,b]=(0,a.useState)("chat"),[f,v]=(0,a.useState)([]),[y,x]=(0,a.useState)(null),[w,k]=(0,a.useState)([]);(0,a.useEffect)(()=>{"label"!==h||y?"label"===h&&y?S(y):C():E()},[u,h,y]);const E=async()=>{try{const e=await new Promise(e=>{const t=n=>{const a=n.detail;"label"===a.type&&(document.removeEventListener("fetchChatsForTabResponse",t),e(a))};document.addEventListener("fetchChatsForTabResponse",t),document.dispatchEvent(new CustomEvent("fetchChatsForTab",{detail:{type:"label"}})),setTimeout(()=>{document.removeEventListener("fetchChatsForTabResponse",t),e({success:!1,error:"Timeout"})},2e4)});if(!e.success)return void k([]);const t=e.items.filter(e=>""===u||e.name.toLowerCase().includes(u.toLowerCase()));k(t)}catch(e){k([])}},S=async e=>{try{const t=await new Promise(t=>{const n=a=>{const r=a.detail;"labelParticipants"===r.type&&r.labelId===e&&(document.removeEventListener("fetchLabelParticipantsResponse",n),t(r))};document.addEventListener("fetchLabelParticipantsResponse",n),document.dispatchEvent(new CustomEvent("fetchLabelParticipants",{detail:{labelId:e}})),setTimeout(()=>{document.removeEventListener("fetchLabelParticipantsResponse",n),t({success:!1,error:"Timeout"})},1e4)});if(!t.success)return void v([]);const n=t.items.filter(e=>""===u||(e.name.toLowerCase().includes(u.toLowerCase())||e.id.toLowerCase().includes(u.toLowerCase())));v(n)}catch(e){v([])}},C=async()=>{try{const e=await new Promise(e=>{const t=n=>{const a=n.detail;a.type===h&&(document.removeEventListener("fetchChatsForTabResponse",t),e(a))};document.addEventListener("fetchChatsForTabResponse",t),document.dispatchEvent(new CustomEvent("fetchChatsForTab",{detail:{type:h}})),setTimeout(()=>{document.removeEventListener("fetchChatsForTabResponse",t),e({success:!1,error:"Timeout"})},2e4)});if(!e.success)return void v([]);const t=e.items.filter(e=>""===u||(e.name.toLowerCase().includes(u.toLowerCase())||e.id.toLowerCase().includes(u.toLowerCase())));v(t)}catch(e){v([])}};return a.createElement(a.Fragment,null,a.createElement("div",{className:"add-tab-backdrop",onClick:n}),a.createElement("div",{className:"add-tab-modal "+(t?"lion-dark":"")},a.createElement("div",{className:"add-tab-header"},a.createElement("h2",{className:"add-tab-title"},e?(0,s.t)("tabs.editTab"):(0,s.t)("tabs.addTab")),a.createElement("button",{className:"add-tab-close",onClick:n},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"add-tab-body"},a.createElement("div",{className:"add-tab-left"},a.createElement("div",{className:"add-tab-form-group"},a.createElement("label",{className:"add-tab-label"},(0,s.t)("tabs.tabTitle")," ",a.createElement("span",{className:"required"},"*")),a.createElement("input",{type:"text",className:"add-tab-input",placeholder:(0,s.t)("tabs.enterTabTitle"),value:o,onChange:e=>i(e.target.value)})),a.createElement("div",{className:"add-tab-form-group"},a.createElement("label",{className:"add-tab-label"},(0,s.t)("tabs.tabDetails")),a.createElement("textarea",{className:"add-tab-textarea",placeholder:(0,s.t)("tabs.enterTabDetails"),value:l,onChange:e=>c(e.target.value),rows:4}))),a.createElement("div",{className:"add-tab-right"},a.createElement("div",{className:"add-tab-search"},a.createElement("input",{type:"text",className:"add-tab-search-input",placeholder:(0,s.t)("tabs.searchHere"),value:u,onChange:e=>g(e.target.value)})),a.createElement("div",{className:"add-tab-filters"},a.createElement("label",{className:"add-tab-label"},(0,s.t)("tabs.chooseFrom"),":"),a.createElement("div",{className:"add-tab-checkboxes"},a.createElement("label",{className:"add-tab-checkbox"},a.createElement("input",{type:"radio",checked:"chat"===h,onChange:()=>{b("chat"),x(null)}}),a.createElement("span",null,(0,s.t)("tabs.chat"))),a.createElement("label",{className:"add-tab-checkbox"},a.createElement("input",{type:"radio",checked:"group"===h,onChange:()=>{b("group"),x(null)}}),a.createElement("span",null,(0,s.t)("tabs.groups"))),a.createElement("label",{className:"add-tab-checkbox"},a.createElement("input",{type:"radio",checked:"label"===h,onChange:()=>{b("label"),x(null)}}),a.createElement("span",null,(0,s.t)("tabs.label"))))),"label"===h&&!y&&a.createElement("div",{className:"add-tab-label-selector"},a.createElement("label",{className:"add-tab-label"},(0,s.t)("tabs.selectLabel"),":"),a.createElement("select",{className:"add-tab-label-dropdown",value:"",onChange:e=>{const t=e.target.value;t&&x(t)}},a.createElement("option",{value:""},(0,s.t)("tabs.chooseALabel")),w.map(e=>a.createElement("option",{key:e.id,value:e.id},e.name)))),"label"===h&&y&&a.createElement("div",{className:"add-tab-selected-label"},a.createElement("label",{className:"add-tab-label"},(0,s.t)("tabs.selectedLabel"),":"),a.createElement("div",{className:"add-tab-label-info"},a.createElement("span",{className:"add-tab-label-name"},w.find(e=>e.id===y)?.name||y),a.createElement("button",{className:"add-tab-change-label-btn",onClick:()=>x(null)},(0,s.t)("tabs.change")))),a.createElement("div",{className:"add-tab-selected"},a.createElement("div",{className:"add-tab-selected-header"},a.createElement("span",null,(0,s.t)("tabs.selected")," (",m.length,")"),a.createElement("div",{className:"add-tab-action-buttons"},f.length>0&&a.createElement("button",{className:"add-tab-select-all",onClick:()=>{const e=f.filter(e=>!m.some(t=>t.id===e.id));p([...m,...e])}},(0,s.t)("tabs.selectAll")),m.length>0&&a.createElement("button",{className:"add-tab-clear-all",onClick:()=>p([])},(0,s.t)("tabs.clearAll"))))),a.createElement("div",{className:"add-tab-chat-list"},"label"!==h||y?f.map(e=>{const t=m.some(t=>t.id===e.id);return a.createElement("div",{key:e.id,className:"add-tab-chat-item "+(t?"selected":""),onClick:()=>(e=>{const t=m.some(t=>t.id===e.id);p(t?m.filter(t=>t.id!==e.id):[...m,e])})(e)},a.createElement("input",{type:"checkbox",checked:t,onChange:()=>{}}),e.image?a.createElement("img",{src:e.image,alt:e.name,className:"add-tab-chat-avatar-img"}):a.createElement("div",{className:"add-tab-chat-avatar"},e.name.charAt(0).toUpperCase()),a.createElement("div",{className:"add-tab-chat-info"},a.createElement("div",{className:"add-tab-chat-name"},e.name),a.createElement("div",{className:"add-tab-chat-phone"},e.id.replace("@c.us","").replace("@g.us","")),"group"===e.type&&a.createElement("span",{className:"add-tab-chat-badge"},"Group")))}):a.createElement("div",{className:"add-tab-empty-message"},(0,s.t)("tabs.pleaseSelectLabel"))))),a.createElement("div",{className:"add-tab-footer"},a.createElement("button",{className:"add-tab-btn-cancel",onClick:n},(0,s.t)("tabs.cancel")),a.createElement("button",{className:"add-tab-btn-save",onClick:()=>{if(!o.trim())return void alert("Please enter a tab title");const t=o.trim(),n=l.trim();if(e){const a=e.chats||[],r=a.map(e=>e.id),o=m.map(e=>e.id),i=m.filter(e=>!r.includes(e.id)),s=a.filter(e=>!o.includes(e.id));d.TabsStorage.updateTab(e.id,{title:t,details:n,chats:m}),i.forEach(n=>{B("tab_added",{id:n.id,name:n.name},{tabId:e.id,tabName:t,tabColor:e.labelColor}),window.postMessage({type:"WA_TAB_CHANGED_FOR_FOLLOWUP",chatId:n.id,tabId:e.id,action:"add"},"*"),document.dispatchEvent(new CustomEvent("waTabChanged",{detail:{chatId:n.id,tabId:e.id,action:"add"}}))}),s.forEach(n=>{B("tab_removed",{id:n.id,name:n.name},{tabId:e.id,tabName:t,tabColor:e.labelColor}),window.postMessage({type:"WA_TAB_CHANGED_FOR_FOLLOWUP",chatId:n.id,tabId:e.id,action:"remove"},"*"),document.dispatchEvent(new CustomEvent("waTabChanged",{detail:{chatId:n.id,tabId:e.id,action:"remove"}}))})}else{const e=d.TabsStorage.addTab({title:t,details:n,chats:m,isPermanent:!1});m.forEach(n=>{B("tab_created",{id:n.id,name:n.name},{tabId:e.id,tabName:t,tabColor:e.labelColor}),window.postMessage({type:"WA_TAB_CHANGED_FOR_FOLLOWUP",chatId:n.id,tabId:e.id,action:"add"},"*"),document.dispatchEvent(new CustomEvent("waTabChanged",{detail:{chatId:n.id,tabId:e.id,action:"add"}}))})}r()}},(0,s.t)("tabs.save"))),a.createElement("style",null,"\n          .add-tab-backdrop {\n            position: fixed;\n            top: 0;\n            left: 0;\n            right: 0;\n            bottom: 0;\n            background: rgba(0, 0, 0, 0.6);\n            z-index: 10002;\n          }\n\n          .add-tab-modal {\n            position: fixed;\n            top: 50%;\n            left: 50%;\n            transform: translate(-50%, -50%);\n            background: var(--lion-bg-primary);\n            border-radius: 12px;\n            box-shadow: var(--lion-shadow-xl);\n            z-index: 10003;\n            width: 90%;\n            max-width: 900px;\n            max-height: 85vh;\n            display: flex;\n            flex-direction: column;\n          }\n\n          .add-tab-header {\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            padding: 20px 24px;\n            border-bottom: 1px solid var(--lion-border-light);\n          }\n\n          .add-tab-title {\n            font-size: 20px;\n            font-weight: 600;\n            color: var(--lion-text-primary);\n            margin: 0;\n          }\n\n          .add-tab-close {\n            background: transparent;\n            border: none;\n            color: var(--lion-text-muted);\n            cursor: pointer;\n            padding: 4px;\n            border-radius: 6px;\n            transition: all 0.2s;\n          }\n\n          .add-tab-close:hover {\n            background: var(--lion-bg-tertiary);\n            color: var(--lion-text-primary);\n          }\n\n          .add-tab-close svg {\n            width: 24px;\n            height: 24px;\n          }\n\n          .add-tab-body {\n            display: grid;\n            grid-template-columns: 1fr 1.5fr;\n            gap: 24px;\n            padding: 24px;\n            overflow-y: auto;\n            flex: 1;\n          }\n\n          .add-tab-left {\n            display: flex;\n            flex-direction: column;\n            gap: 20px;\n          }\n\n          .add-tab-form-group {\n            display: flex;\n            flex-direction: column;\n            gap: 8px;\n          }\n\n          .add-tab-label {\n            font-size: 14px;\n            font-weight: 600;\n            color: var(--lion-text-secondary);\n          }\n\n          .required {\n            color: var(--lion-error);\n          }\n\n          .add-tab-input,\n          .add-tab-textarea {\n            padding: 10px 12px;\n            border: 1px solid var(--lion-border-medium);\n            border-radius: 8px;\n            background: var(--lion-bg-primary);\n            color: var(--lion-text-primary);\n            font-size: 14px;\n            font-family: inherit;\n            transition: border 0.2s;\n          }\n\n          .add-tab-input:focus,\n          .add-tab-textarea:focus {\n            outline: none;\n            border-color: var(--lion-primary);\n          }\n\n          .add-tab-textarea {\n            resize: vertical;\n          }\n\n          .add-tab-right {\n            display: flex;\n            flex-direction: column;\n            gap: 16px;\n          }\n\n          .add-tab-search-input {\n            width: 100%;\n            padding: 10px 12px;\n            border: 1px solid var(--lion-border-medium);\n            border-radius: 8px;\n            font-size: 14px;\n            background: var(--lion-bg-primary);\n            color: var(--lion-text-primary);\n          }\n\n          .add-tab-search-input:focus {\n            outline: none;\n            border-color: var(--lion-primary);\n          }\n\n          .add-tab-filters {\n            display: flex;\n            flex-direction: column;\n            gap: 8px;\n          }\n\n          .add-tab-checkboxes {\n            display: flex;\n            gap: 16px;\n          }\n\n          .add-tab-checkbox {\n            display: flex;\n            align-items: center;\n            gap: 6px;\n            cursor: pointer;\n            font-size: 14px;\n            color: var(--lion-text-secondary);\n          }\n\n          .add-tab-selected-header {\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            font-size: 14px;\n            font-weight: 600;\n            color: var(--lion-text-secondary);\n          }\n\n          .add-tab-action-buttons {\n            display: flex;\n            gap: 12px;\n            align-items: center;\n          }\n\n          .add-tab-select-all,\n          .add-tab-clear-all {\n            background: transparent;\n            border: none;\n            font-size: 13px;\n            font-weight: 600;\n            cursor: pointer;\n            transition: all 0.2s;\n            padding: 4px 8px;\n            border-radius: 4px;\n          }\n\n          .add-tab-select-all {\n            color: var(--lion-success);\n          }\n\n          .add-tab-select-all:hover {\n            background: var(--lion-success-light);\n          }\n\n          .add-tab-clear-all {\n            color: var(--lion-error);\n          }\n\n          .add-tab-clear-all:hover {\n            background: var(--lion-error-light);\n          }\n\n          .add-tab-label-selector {\n            margin-bottom: 16px;\n          }\n\n          .add-tab-label-dropdown {\n            width: 100%;\n            padding: 10px 12px;\n            border: 1px solid var(--lion-border-medium);\n            border-radius: 8px;\n            font-size: 14px;\n            font-family: inherit;\n            margin-top: 8px;\n            cursor: pointer;\n            transition: border 0.2s;\n            background: var(--lion-bg-primary);\n            color: var(--lion-text-primary);\n          }\n\n          .add-tab-label-dropdown:focus {\n            outline: none;\n            border-color: var(--lion-primary);\n          }\n\n          .add-tab-selected-label {\n            margin-bottom: 16px;\n          }\n\n          .add-tab-label-info {\n            display: flex;\n            align-items: center;\n            gap: 12px;\n            margin-top: 8px;\n            padding: 10px 12px;\n            background: var(--lion-primary-light);\n            border: 1px solid var(--lion-primary);\n            border-radius: 8px;\n          }\n\n          .add-tab-label-name {\n            flex: 1;\n            font-size: 14px;\n            font-weight: 600;\n            color: var(--lion-primary);\n          }\n\n          .add-tab-change-label-btn {\n            padding: 6px 12px;\n            background: var(--lion-primary);\n            color: white;\n            border: none;\n            border-radius: 6px;\n            font-size: 13px;\n            font-weight: 600;\n            cursor: pointer;\n            transition: all 0.2s;\n          }\n\n          .add-tab-change-label-btn:hover {\n            background: var(--lion-primary-hover);\n          }\n\n          .add-tab-empty-message {\n            padding: 40px 20px;\n            text-align: center;\n            color: var(--lion-text-muted);\n            font-size: 14px;\n          }\n\n          .add-tab-chat-list {\n            border: 1px solid var(--lion-border-light);\n            border-radius: 8px;\n            max-height: 300px;\n            overflow-y: auto;\n            background: var(--lion-bg-primary);\n          }\n\n          .add-tab-chat-item {\n            display: flex;\n            align-items: center;\n            gap: 12px;\n            padding: 2px 12px;\n            border-bottom: 1px solid var(--lion-border-light);\n            cursor: pointer;\n            transition: background 0.15s;\n          }\n\n          .add-tab-chat-item:last-child {\n            border-bottom: none;\n          }\n\n          .add-tab-chat-item:hover {\n            background: var(--lion-bg-secondary);\n          }\n\n          .add-tab-chat-item.selected {\n            background: var(--lion-primary-light);\n          }\n\n          .add-tab-chat-avatar,\n          .add-tab-chat-avatar-img {\n            width: 40px;\n            height: 40px;\n            border-radius: 50%;\n            flex-shrink: 0;\n          }\n\n          .add-tab-chat-avatar {\n            background: var(--lion-primary);\n            color: white;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            font-weight: 600;\n          }\n\n          .add-tab-chat-avatar-img {\n            object-fit: cover;\n          }\n\n          .add-tab-chat-info {\n            flex: 1;\n            min-width: 0;\n          }\n\n          .add-tab-chat-name {\n            font-size: 14px;\n            font-weight: 500;\n            color: var(--lion-text-primary);\n          }\n\n          .add-tab-chat-phone {\n            font-size: 12px;\n            color: var(--lion-text-muted);\n          }\n\n          .add-tab-chat-badge {\n            display: inline-block;\n            padding: 2px 8px;\n            background: var(--lion-info-light);\n            color: var(--lion-info);\n            border-radius: 4px;\n            font-size: 11px;\n            font-weight: 600;\n          }\n\n          .add-tab-footer {\n            display: flex;\n            justify-content: flex-end;\n            gap: 12px;\n            padding: 20px 24px;\n            border-top: 1px solid var(--lion-border-light);\n          }\n\n          .add-tab-btn-cancel,\n          .add-tab-btn-save {\n            padding: 10px 24px;\n            border-radius: 8px;\n            font-size: 14px;\n            font-weight: 600;\n            cursor: pointer;\n            transition: all 0.2s;\n            border: none;\n          }\n\n          .add-tab-btn-cancel {\n            background: var(--lion-bg-tertiary);\n            color: var(--lion-text-secondary);\n          }\n\n          .add-tab-btn-cancel:hover {\n            background: var(--lion-border-light);\n            color: var(--lion-text-primary);\n          }\n\n          .add-tab-btn-save {\n            background: var(--lion-primary);\n            color: white;\n          }\n\n          .add-tab-btn-save:hover {\n            background: var(--lion-primary-hover);\n            transform: translateY(-1px);\n            box-shadow: var(--lion-shadow-primary);\n          }\n\n          /* ========== DARK MODE OVERRIDES ========== */\n          .add-tab-modal.lion-dark {\n            background: #1a1a1a !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-header {\n            border-bottom-color: #3a3a3a !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-title {\n            color: #ffffff !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-close {\n            color: #a0a0a0 !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-close:hover {\n            background: #333333 !important;\n            color: #ffffff !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-label {\n            color: #e0e0e0 !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-input,\n          .add-tab-modal.lion-dark .add-tab-textarea,\n          .add-tab-modal.lion-dark .add-tab-search-input,\n          .add-tab-modal.lion-dark .add-tab-label-dropdown {\n            background: #262626 !important;\n            color: #ffffff !important;\n            border-color: #3a3a3a !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-input::placeholder,\n          .add-tab-modal.lion-dark .add-tab-textarea::placeholder,\n          .add-tab-modal.lion-dark .add-tab-search-input::placeholder {\n            color: #a0a0a0 !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-checkbox {\n            color: #e0e0e0 !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-selected-header {\n            color: #e0e0e0 !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-chat-list {\n            background: #1a1a1a !important;\n            border-color: #3a3a3a !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-chat-item {\n            border-color: #3a3a3a !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-chat-item:hover {\n            background: #262626 !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-chat-item.selected {\n            background: rgba(var(--lion-primary-rgb), 0.15) !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-chat-name {\n            color: #ffffff !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-chat-phone {\n            color: #a0a0a0 !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-empty-message {\n            color: #a0a0a0 !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-footer {\n            border-top-color: #3a3a3a !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-btn-cancel {\n            background: #333333 !important;\n            color: #ffffff !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-btn-cancel:hover {\n            background: #444444 !important;\n          }\n\n          /* ============================================================ */\n          /* ============== V3 REDESIGN OVERRIDES (AddEditTab) ========== */\n          /* ============================================================ */\n\n          /* === BACKDROP === */\n          .add-tab-backdrop {\n            background: rgba(0, 0, 0, 0.55) !important;\n            backdrop-filter: blur(6px);\n            -webkit-backdrop-filter: blur(6px);\n          }\n\n          /* === MODAL CONTAINER === */\n          .add-tab-modal {\n            width: 92% !important;\n            max-width: 960px !important;\n            max-height: 88vh !important;\n            border-radius: 16px !important;\n            border: 1px solid var(--lion-border-light);\n            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;\n          }\n\n          /* === HEADER === */\n          .add-tab-header {\n            padding: 20px 28px !important;\n          }\n\n          .add-tab-title {\n            font-size: 20px !important;\n            font-weight: 700 !important;\n            letter-spacing: -0.01em;\n          }\n\n          .add-tab-close {\n            width: 36px !important;\n            height: 36px !important;\n            border-radius: 10px !important;\n            background: var(--lion-bg-tertiary) !important;\n            border: 1px solid var(--lion-border-light) !important;\n            color: var(--lion-text-muted) !important;\n            display: flex !important;\n            align-items: center !important;\n            justify-content: center !important;\n            padding: 0 !important;\n          }\n\n          .add-tab-close:hover {\n            background: rgba(239, 68, 68, 0.1) !important;\n            color: #ef4444 !important;\n            border-color: rgba(239, 68, 68, 0.3) !important;\n          }\n\n          .add-tab-close svg {\n            width: 18px !important;\n            height: 18px !important;\n          }\n\n          /* === BODY === */\n          .add-tab-body {\n            padding: 24px 28px !important;\n            background: var(--lion-bg-secondary);\n          }\n\n          /* === INPUTS (V3 focus ring) === */\n          .add-tab-input,\n          .add-tab-textarea,\n          .add-tab-search-input,\n          .add-tab-label-dropdown {\n            border-radius: 10px !important;\n            padding: 10px 14px !important;\n            font-size: 13px !important;\n            transition: border 0.2s, box-shadow 0.2s !important;\n          }\n\n          .add-tab-input:focus,\n          .add-tab-textarea:focus,\n          .add-tab-search-input:focus,\n          .add-tab-label-dropdown:focus {\n            border-color: var(--lion-primary) !important;\n            box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12) !important;\n          }\n\n          /* === LABELS === */\n          .add-tab-label {\n            font-size: 13px !important;\n            font-weight: 700 !important;\n            text-transform: uppercase !important;\n            letter-spacing: 0.3px !important;\n            color: var(--lion-text-muted) !important;\n          }\n\n          /* === CHAT LIST (V3 style) === */\n          .add-tab-chat-list {\n            border-radius: 10px !important;\n          }\n\n          .add-tab-chat-item:hover {\n            background: rgba(var(--lion-primary-rgb), 0.04) !important;\n          }\n\n          .add-tab-chat-item.selected {\n            background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          }\n\n          .add-tab-chat-badge {\n            border-radius: 6px !important;\n          }\n\n          /* === FOOTER BUTTONS (V3 gradient) === */\n          .add-tab-footer {\n            padding: 18px 28px !important;\n          }\n\n          .add-tab-btn-cancel,\n          .add-tab-btn-save {\n            border-radius: 10px !important;\n            font-size: 13px !important;\n            padding: 10px 22px !important;\n          }\n\n          .add-tab-btn-save {\n            background: var(--lion-primary) !important;\n            box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n          }\n\n          .add-tab-btn-save:hover {\n            background: var(--lion-primary-hover) !important;\n            box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n          }\n\n          .add-tab-btn-cancel {\n            border: 1px solid var(--lion-border-light) !important;\n          }\n\n          .add-tab-btn-cancel:hover {\n            border-color: var(--lion-primary) !important;\n            color: var(--lion-primary) !important;\n            background: rgba(var(--lion-primary-rgb), 0.04) !important;\n          }\n\n          /* === CHANGE LABEL BUTTON === */\n          .add-tab-change-label-btn {\n            border-radius: 8px !important;\n            background: var(--lion-primary) !important;\n          }\n\n          .add-tab-change-label-btn:hover {\n            background: var(--lion-primary-hover) !important;\n          }\n\n          /* === SCROLLBAR === */\n          .add-tab-chat-list::-webkit-scrollbar {\n            width: 8px;\n          }\n\n          .add-tab-chat-list::-webkit-scrollbar-track {\n            background: transparent;\n          }\n\n          .add-tab-chat-list::-webkit-scrollbar-thumb {\n            background: var(--lion-border-medium, #d1d5db);\n            border-radius: 4px;\n          }\n\n          .add-tab-chat-list::-webkit-scrollbar-thumb:hover {\n            background: var(--lion-text-light, #9ca3af);\n          }\n\n          /* === V3 DARK MODE OVERRIDES (AddEditTab) === */\n          .add-tab-modal.lion-dark {\n            background: #18181b !important;\n            border-color: #27272a !important;\n            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-header {\n            background: #18181b !important;\n            border-bottom-color: #27272a !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-title {\n            color: #fafafa !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-close {\n            background: #27272a !important;\n            border-color: #3f3f46 !important;\n            color: #a1a1aa !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-close:hover {\n            background: rgba(239, 68, 68, 0.15) !important;\n            color: #f87171 !important;\n            border-color: rgba(239, 68, 68, 0.3) !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-body {\n            background: #1a1a1a !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-label {\n            color: #a1a1aa !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-input,\n          .add-tab-modal.lion-dark .add-tab-textarea,\n          .add-tab-modal.lion-dark .add-tab-search-input,\n          .add-tab-modal.lion-dark .add-tab-label-dropdown {\n            background: #27272a !important;\n            border-color: #3f3f46 !important;\n            color: #fafafa !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-input::placeholder,\n          .add-tab-modal.lion-dark .add-tab-textarea::placeholder,\n          .add-tab-modal.lion-dark .add-tab-search-input::placeholder {\n            color: #71717a !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-input:focus,\n          .add-tab-modal.lion-dark .add-tab-textarea:focus,\n          .add-tab-modal.lion-dark .add-tab-search-input:focus {\n            border-color: var(--lion-primary) !important;\n            box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.2) !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-chat-list {\n            background: #18181b !important;\n            border-color: #27272a !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-chat-item {\n            border-color: #27272a !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-chat-item:hover {\n            background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-chat-name {\n            color: #fafafa !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-chat-phone {\n            color: #a1a1aa !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-footer {\n            border-top-color: #27272a !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-btn-cancel {\n            background: #27272a !important;\n            border-color: #3f3f46 !important;\n            color: #e5e7eb !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-btn-cancel:hover {\n            border-color: var(--lion-primary) !important;\n            color: var(--lion-primary) !important;\n            background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-checkbox {\n            color: #e5e7eb !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-selected-header {\n            color: #e5e7eb !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-empty-message {\n            color: #71717a !important;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-chat-list::-webkit-scrollbar-thumb {\n            background: #3f3f46;\n          }\n\n          .add-tab-modal.lion-dark .add-tab-chat-list::-webkit-scrollbar-thumb:hover {\n            background: #52525b;\n          }\n        ")))};const U="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function F(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function z(e){return"nodeType"in e}function O(e){var t,n;return e?F(e)?e:z(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function W(e){const{Document:t}=O(e);return e instanceof t}function q(e){return!F(e)&&e instanceof O(e).HTMLElement}function H(e){return e instanceof O(e).SVGElement}function j(e){return e?F(e)?e.document:z(e)?W(e)?e:q(e)||H(e)?e.ownerDocument:document:document:document}const V=U?a.useLayoutEffect:a.useEffect;function G(e){const t=(0,a.useRef)(e);return V(()=>{t.current=e}),(0,a.useCallback)(function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return null==t.current?void 0:t.current(...n)},[])}function K(e,t){void 0===t&&(t=[e]);const n=(0,a.useRef)(e);return V(()=>{n.current!==e&&(n.current=e)},t),n}function $(e,t){const n=(0,a.useRef)();return(0,a.useMemo)(()=>{const t=e(n.current);return n.current=t,t},[...t])}function Y(e){const t=G(e),n=(0,a.useRef)(null),r=(0,a.useCallback)(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,r]}function X(e){const t=(0,a.useRef)();return(0,a.useEffect)(()=>{t.current=e},[e]),t.current}let J={};function Q(e,t){return(0,a.useMemo)(()=>{if(t)return t;const n=null==J[e]?0:J[e]+1;return J[e]=n,e+"-"+n},[e,t])}function Z(e){return function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];return a.reduce((t,n)=>{const a=Object.entries(n);for(const[n,r]of a){const a=t[n];null!=a&&(t[n]=a+e*r)}return t},{...t})}}const ee=Z(1),te=Z(-1);function ne(e){if(!e)return!1;const{KeyboardEvent:t}=O(e.target);return t&&e instanceof t}function ae(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=O(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const re=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[re.Translate.toString(e),re.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:a}=e;return t+" "+n+"ms "+a}}}),oe="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ie(e){return e.matches(oe)?e:e.querySelector(oe)}const se={display:"none"};function le(e){let{id:t,value:n}=e;return a.createElement("div",{id:t,style:se},n)}function ce(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return a.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}const de=(0,a.createContext)(null);const me={draggable:"\n    To pick up a draggable item, press the space bar.\n    While dragging, use the arrow keys to move the item.\n    Press space again to drop the item in its new position, or press escape to cancel.\n  "},pe={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function ue(e){let{announcements:t=pe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=me}=e;const{announce:s,announcement:l}=function(){const[e,t]=(0,a.useState)("");return{announce:(0,a.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e}}(),c=Q("DndLiveRegion"),[d,m]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{m(!0)},[]),function(e){const t=(0,a.useContext)(de);(0,a.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}((0,a.useMemo)(()=>({onDragStart(e){let{active:n}=e;s(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:a}=e;t.onDragMove&&s(t.onDragMove({active:n,over:a}))},onDragOver(e){let{active:n,over:a}=e;s(t.onDragOver({active:n,over:a}))},onDragEnd(e){let{active:n,over:a}=e;s(t.onDragEnd({active:n,over:a}))},onDragCancel(e){let{active:n,over:a}=e;s(t.onDragCancel({active:n,over:a}))}}),[s,t])),!d)return null;const p=a.createElement(a.Fragment,null,a.createElement(le,{id:r,value:o.draggable}),a.createElement(ce,{id:c,announcement:l}));return n?(0,i.createPortal)(p,n):p}var ge;function he(){}function be(e,t){return(0,a.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(ge||(ge={}));const fe=Object.freeze({x:0,y:0});function ve(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ye(e,t){const n=ae(e);if(!n)return"0 0";return(n.x-t.left)/t.width*100+"% "+(n.y-t.top)/t.height*100+"%"}function xe(e,t){let{data:{value:n}}=e,{data:{value:a}}=t;return n-a}function we(e,t){let{data:{value:n}}=e,{data:{value:a}}=t;return a-n}function ke(e){let{left:t,top:n,height:a,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+a},{x:t+r,y:n+a}]}function Ee(e,t){if(!e||0===e.length)return null;const[n]=e;return t?n[t]:n}function Se(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}const Ce=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:a}=e;const r=Se(t,t.left,t.top),o=[];for(const e of a){const{id:t}=e,a=n.get(t);if(a){const n=ve(Se(a),r);o.push({id:t,data:{droppableContainer:e,value:n}})}}return o.sort(xe)};function Te(e,t){const n=Math.max(t.top,e.top),a=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),i=r-a,s=o-n;if(a<r&&n<o){const n=t.width*t.height,a=e.width*e.height,r=i*s;return Number((r/(n+a-r)).toFixed(4))}return 0}const Ae=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:a}=e;const r=[];for(const e of a){const{id:a}=e,o=n.get(a);if(o){const n=Te(o,t);n>0&&r.push({id:a,data:{droppableContainer:e,value:n}})}}return r.sort(we)};function De(e,t){const{top:n,left:a,bottom:r,right:o}=t;return n<=e.y&&e.y<=r&&a<=e.x&&e.x<=o}const _e=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:a}=e;if(!a)return[];const r=[];for(const e of t){const{id:t}=e,o=n.get(t);if(o&&De(a,o)){const n=ke(o).reduce((e,t)=>e+ve(a,t),0),i=Number((n/4).toFixed(4));r.push({id:t,data:{droppableContainer:e,value:i}})}}return r.sort(xe)};function Ne(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:fe}function Me(e){return function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];return a.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}const Ie=Me(1);function Re(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const Be={ignoreTransform:!1};function Pe(e,t){void 0===t&&(t=Be);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:t,transformOrigin:a}=O(e).getComputedStyle(e);t&&(n=function(e,t,n){const a=Re(t);if(!a)return e;const{scaleX:r,scaleY:o,x:i,y:s}=a,l=e.left-i-(1-r)*parseFloat(n),c=e.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width/r:e.width,m=o?e.height/o:e.height;return{width:d,height:m,top:c,right:l+d,bottom:c+m,left:l}}(n,t,a))}const{top:a,left:r,width:o,height:i,bottom:s,right:l}=n;return{top:a,left:r,width:o,height:i,bottom:s,right:l}}function Le(e){return Pe(e,{ignoreTransform:!0})}function Ue(e,t){const n=[];return e?function a(r){if(null!=t&&n.length>=t)return n;if(!r)return n;if(W(r)&&null!=r.scrollingElement&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!q(r)||H(r))return n;if(n.includes(r))return n;const o=O(e).getComputedStyle(r);return r!==e&&function(e,t){void 0===t&&(t=O(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const a=t[e];return"string"==typeof a&&n.test(a)})}(r,o)&&n.push(r),function(e,t){return void 0===t&&(t=O(e).getComputedStyle(e)),"fixed"===t.position}(r,o)?n:a(r.parentNode)}(e):n}function Fe(e){const[t]=Ue(e,1);return null!=t?t:null}function ze(e){return U&&e?F(e)?e:z(e)?W(e)||e===j(e).scrollingElement?window:q(e)?e:null:null:null}function Oe(e){return F(e)?e.scrollX:e.scrollLeft}function We(e){return F(e)?e.scrollY:e.scrollTop}function qe(e){return{x:Oe(e),y:We(e)}}var He;function je(e){return!(!U||!e)&&e===document.scrollingElement}function Ve(e){const t={x:0,y:0},n=je(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},a={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=a.y,isRight:e.scrollLeft>=a.x,maxScroll:a,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(He||(He={}));const Ge={x:.2,y:.2};function Ke(e,t,n,a,r){let{top:o,left:i,right:s,bottom:l}=n;void 0===a&&(a=10),void 0===r&&(r=Ge);const{isTop:c,isBottom:d,isLeft:m,isRight:p}=Ve(e),u={x:0,y:0},g={x:0,y:0},h=t.height*r.y,b=t.width*r.x;return!c&&o<=t.top+h?(u.y=He.Backward,g.y=a*Math.abs((t.top+h-o)/h)):!d&&l>=t.bottom-h&&(u.y=He.Forward,g.y=a*Math.abs((t.bottom-h-l)/h)),!p&&s>=t.right-b?(u.x=He.Forward,g.x=a*Math.abs((t.right-b-s)/b)):!m&&i<=t.left+b&&(u.x=He.Backward,g.x=a*Math.abs((t.left+b-i)/b)),{direction:u,speed:g}}function $e(e){if(e===document.scrollingElement){const{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}const{top:t,left:n,right:a,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:a,bottom:r,width:e.clientWidth,height:e.clientHeight}}function Ye(e){return e.reduce((e,t)=>ee(e,qe(t)),fe)}function Xe(e,t){if(void 0===t&&(t=Pe),!e)return;const{top:n,left:a,bottom:r,right:o}=t(e);Fe(e)&&(r<=0||o<=0||n>=window.innerHeight||a>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Je=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+Oe(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+We(t),0)}]];class Qe{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Ue(t),a=Ye(n);this.rect={...e},this.width=e.width,this.height=e.height;for(const[e,t,r]of Je)for(const o of t)Object.defineProperty(this,o,{get:()=>{const t=r(n),i=a[e]-t;return this.rect[o]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ze{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var a;null==(a=this.target)||a.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function et(e,t){const n=Math.abs(e.x),a=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+a**2)>t:"x"in t&&"y"in t?n>t.x&&a>t.y:"x"in t?n>t.x:"y"in t&&a>t.y}var tt,nt;function at(e){e.preventDefault()}function rt(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(tt||(tt={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(nt||(nt={}));const ot={start:[nt.Space,nt.Enter],cancel:[nt.Esc],end:[nt.Space,nt.Enter,nt.Tab]},it=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case nt.Right:return{...n,x:n.x+25};case nt.Left:return{...n,x:n.x-25};case nt.Down:return{...n,y:n.y+25};case nt.Up:return{...n,y:n.y-25}}};class st{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Ze(j(t)),this.windowListeners=new Ze(O(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(tt.Resize,this.handleCancel),this.windowListeners.add(tt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(tt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Xe(n),t(fe)}handleKeyDown(e){if(ne(e)){const{active:t,context:n,options:a}=this.props,{keyboardCodes:r=ot,coordinateGetter:o=it,scrollBehavior:i="smooth"}=a,{code:s}=e;if(r.end.includes(s))return void this.handleEnd(e);if(r.cancel.includes(s))return void this.handleCancel(e);const{collisionRect:l}=n.current,c=l?{x:l.left,y:l.top}:fe;this.referenceCoordinates||(this.referenceCoordinates=c);const d=o(e,{active:t,context:n.current,currentCoordinates:c});if(d){const t=te(d,c),a={x:0,y:0},{scrollableAncestors:r}=n.current;for(const n of r){const r=e.code,{isTop:o,isRight:s,isLeft:l,isBottom:c,maxScroll:m,minScroll:p}=Ve(n),u=$e(n),g={x:Math.min(r===nt.Right?u.right-u.width/2:u.right,Math.max(r===nt.Right?u.left:u.left+u.width/2,d.x)),y:Math.min(r===nt.Down?u.bottom-u.height/2:u.bottom,Math.max(r===nt.Down?u.top:u.top+u.height/2,d.y))},h=r===nt.Right&&!s||r===nt.Left&&!l,b=r===nt.Down&&!c||r===nt.Up&&!o;if(h&&g.x!==d.x){const e=n.scrollLeft+t.x,o=r===nt.Right&&e<=m.x||r===nt.Left&&e>=p.x;if(o&&!t.y)return void n.scrollTo({left:e,behavior:i});a.x=o?n.scrollLeft-e:r===nt.Right?n.scrollLeft-m.x:n.scrollLeft-p.x,a.x&&n.scrollBy({left:-a.x,behavior:i});break}if(b&&g.y!==d.y){const e=n.scrollTop+t.y,o=r===nt.Down&&e<=m.y||r===nt.Up&&e>=p.y;if(o&&!t.x)return void n.scrollTo({top:e,behavior:i});a.y=o?n.scrollTop-e:r===nt.Down?n.scrollTop-m.y:n.scrollTop-p.y,a.y&&n.scrollBy({top:-a.y,behavior:i});break}}this.handleMove(e,ee(te(d,this.referenceCoordinates),a))}}}handleMove(e,t){const{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function lt(e){return Boolean(e&&"distance"in e)}function ct(e){return Boolean(e&&"delay"in e)}st.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:a=ot,onActivation:r}=t,{active:o}=n;const{code:i}=e.nativeEvent;if(a.start.includes(i)){const t=o.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==r||r({event:e.nativeEvent}),!0)}return!1}}];class dt{constructor(e,t,n){var a;void 0===n&&(n=function(e){const{EventTarget:t}=O(e);return e instanceof t?e:j(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:r}=e,{target:o}=r;this.props=e,this.events=t,this.document=j(o),this.documentListeners=new Ze(this.document),this.listeners=new Ze(n),this.windowListeners=new Ze(O(o)),this.initialCoordinates=null!=(a=ae(r))?a:fe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(tt.Resize,this.handleCancel),this.windowListeners.add(tt.DragStart,at),this.windowListeners.add(tt.VisibilityChange,this.handleCancel),this.windowListeners.add(tt.ContextMenu,at),this.documentListeners.add(tt.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ct(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(lt(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:n,onPending:a}=this.props;a(n,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(tt.Click,rt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(tt.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:n,initialCoordinates:a,props:r}=this,{onMove:o,options:{activationConstraint:i}}=r;if(!a)return;const s=null!=(t=ae(e))?t:fe,l=te(a,s);if(!n&&i){if(lt(i)){if(null!=i.tolerance&&et(l,i.tolerance))return this.handleCancel();if(et(l,i.distance))return this.handleStart()}return ct(i)&&et(l,i.tolerance)?this.handleCancel():void this.handlePending(i,l)}e.cancelable&&e.preventDefault(),o(s)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===nt.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const mt={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class pt extends dt{constructor(e){const{event:t}=e,n=j(t.target);super(e,mt,n)}}pt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:a}=t;return!(!n.isPrimary||0!==n.button)&&(null==a||a({event:n}),!0)}}];const ut={move:{name:"mousemove"},end:{name:"mouseup"}};var gt;!function(e){e[e.RightClick=2]="RightClick"}(gt||(gt={}));(class extends dt{constructor(e){super(e,ut,j(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:a}=t;return n.button!==gt.RightClick&&(null==a||a({event:n}),!0)}}];const ht={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var bt,ft;function vt(e){let{acceleration:t,activator:n=bt.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:l=ft.TreeOrder,pointerCoordinates:c,scrollableAncestors:d,scrollableAncestorRects:m,delta:p,threshold:u}=e;const g=function(e){let{delta:t,disabled:n}=e;const a=X(t);return $(e=>{if(n||!a||!e)return yt;const r={x:Math.sign(t.x-a.x),y:Math.sign(t.y-a.y)};return{x:{[He.Backward]:e.x[He.Backward]||-1===r.x,[He.Forward]:e.x[He.Forward]||1===r.x},y:{[He.Backward]:e.y[He.Backward]||-1===r.y,[He.Forward]:e.y[He.Forward]||1===r.y}}},[n,t,a])}({delta:p,disabled:!i}),[h,b]=function(){const e=(0,a.useRef)(null);return[(0,a.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,a.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),f=(0,a.useRef)({x:0,y:0}),v=(0,a.useRef)({x:0,y:0}),y=(0,a.useMemo)(()=>{switch(n){case bt.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case bt.DraggableRect:return o}},[n,o,c]),x=(0,a.useRef)(null),w=(0,a.useCallback)(()=>{const e=x.current;if(!e)return;const t=f.current.x*v.current.x,n=f.current.y*v.current.y;e.scrollBy(t,n)},[]),k=(0,a.useMemo)(()=>l===ft.TreeOrder?[...d].reverse():d,[l,d]);(0,a.useEffect)(()=>{if(i&&d.length&&y){for(const e of k){if(!1===(null==r?void 0:r(e)))continue;const n=d.indexOf(e),a=m[n];if(!a)continue;const{direction:o,speed:i}=Ke(e,a,y,t,u);for(const e of["x","y"])g[e][o[e]]||(i[e]=0,o[e]=0);if(i.x>0||i.y>0)return b(),x.current=e,h(w,s),f.current=i,void(v.current=o)}f.current={x:0,y:0},v.current={x:0,y:0},b()}else b()},[t,w,r,b,i,s,JSON.stringify(y),JSON.stringify(g),h,d,k,m,JSON.stringify(u)])}(class extends dt{constructor(e){super(e,ht)}static setup(){return window.addEventListener(ht.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ht.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:a}=t;const{touches:r}=n;return!(r.length>1)&&(null==a||a({event:n}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(bt||(bt={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(ft||(ft={}));const yt={x:{[He.Backward]:!1,[He.Forward]:!1},y:{[He.Backward]:!1,[He.Forward]:!1}};var xt,wt;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(xt||(xt={})),function(e){e.Optimized="optimized"}(wt||(wt={}));const kt=new Map;function Et(e,t){return $(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function St(e){let{callback:t,disabled:n}=e;const r=G(t),o=(0,a.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.ResizeObserver)return;const{ResizeObserver:e}=window;return new e(r)},[n]);return(0,a.useEffect)(()=>()=>null==o?void 0:o.disconnect(),[o]),o}function Ct(e){return new Qe(Pe(e),e)}function Tt(e,t,n){void 0===t&&(t=Ct);const[r,o]=(0,a.useState)(null);function i(){o(a=>{if(!e)return null;var r;if(!1===e.isConnected)return null!=(r=null!=a?a:n)?r:null;const o=t(e);return JSON.stringify(a)===JSON.stringify(o)?a:o})}const s=function(e){let{callback:t,disabled:n}=e;const r=G(t),o=(0,a.useMemo)(()=>{if(n||"undefined"==typeof window||void 0===window.MutationObserver)return;const{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,a.useEffect)(()=>()=>null==o?void 0:o.disconnect(),[o]),o}({callback(t){if(e)for(const n of t){const{type:t,target:a}=n;if("childList"===t&&a instanceof HTMLElement&&a.contains(e)){i();break}}}}),l=St({callback:i});return V(()=>{i(),e?(null==l||l.observe(e),null==s||s.observe(document.body,{childList:!0,subtree:!0})):(null==l||l.disconnect(),null==s||s.disconnect())},[e]),r}const At=[];function Dt(e,t){void 0===t&&(t=[]);const n=(0,a.useRef)(null);return(0,a.useEffect)(()=>{n.current=null},t),(0,a.useEffect)(()=>{const t=e!==fe;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?te(e,n.current):fe}function _t(e){return(0,a.useMemo)(()=>e?function(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}const Nt=[];function Mt(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return q(t)?t:e}const It=[{sensor:pt,options:{}},{sensor:st,options:{}}],Rt={current:{}},Bt={draggable:{measure:Le},droppable:{measure:Le,strategy:xt.WhileDragging,frequency:wt.Optimized},dragOverlay:{measure:Pe}};class Pt extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}const Lt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Pt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:he},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Bt,measureDroppableContainers:he,windowRect:null,measuringScheduled:!1},Ut={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:he,draggableNodes:new Map,over:null,measureDroppableContainers:he},Ft=(0,a.createContext)(Ut),zt=(0,a.createContext)(Lt);function Ot(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Pt}}}function Wt(e,t){switch(t.type){case ge.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ge.DragMove:return null==e.draggable.active?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ge.DragEnd:case ge.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ge.RegisterDroppable:{const{element:n}=t,{id:a}=n,r=new Pt(e.droppable.containers);return r.set(a,n),{...e,droppable:{...e.droppable,containers:r}}}case ge.SetDroppableDisabled:{const{id:n,key:a,disabled:r}=t,o=e.droppable.containers.get(n);if(!o||a!==o.key)return e;const i=new Pt(e.droppable.containers);return i.set(n,{...o,disabled:r}),{...e,droppable:{...e.droppable,containers:i}}}case ge.UnregisterDroppable:{const{id:n,key:a}=t,r=e.droppable.containers.get(n);if(!r||a!==r.key)return e;const o=new Pt(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function qt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=(0,a.useContext)(Ft),i=X(r),s=X(null==n?void 0:n.id);return(0,a.useEffect)(()=>{if(!t&&!r&&i&&null!=s){if(!ne(i))return;if(document.activeElement===i.target)return;const e=o.get(s);if(!e)return;const{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(const e of[t.current,n.current]){if(!e)continue;const t=ie(e);if(t){t.focus();break}}})}},[r,t,o,s,i]),null}function Ht(e,t){let{transform:n,...a}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...a}),n):n}const jt=(0,a.createContext)({...fe,scaleX:1,scaleY:1});var Vt;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(Vt||(Vt={}));const Gt=(0,a.memo)(function(e){var t,n,r,o;let{id:s,accessibility:l,autoScroll:c=!0,children:d,sensors:m=It,collisionDetection:p=Ae,measuring:u,modifiers:g,...h}=e;const b=(0,a.useReducer)(Wt,void 0,Ot),[f,v]=b,[y,x]=function(){const[e]=(0,a.useState)(()=>new Set),t=(0,a.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,a.useCallback)(t=>{let{type:n,event:a}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,a)})},[e]),t]}(),[w,k]=(0,a.useState)(Vt.Uninitialized),E=w===Vt.Initialized,{draggable:{active:S,nodes:C,translate:T},droppable:{containers:A}}=f,D=null!=S?C.get(S):null,_=(0,a.useRef)({initial:null,translated:null}),N=(0,a.useMemo)(()=>{var e;return null!=S?{id:S,data:null!=(e=null==D?void 0:D.data)?e:Rt,rect:_}:null},[S,D]),M=(0,a.useRef)(null),[I,R]=(0,a.useState)(null),[B,P]=(0,a.useState)(null),L=K(h,Object.values(h)),F=Q("DndDescribedBy",s),z=(0,a.useMemo)(()=>A.getEnabled(),[A]),W=(H=u,(0,a.useMemo)(()=>({draggable:{...Bt.draggable,...null==H?void 0:H.draggable},droppable:{...Bt.droppable,...null==H?void 0:H.droppable},dragOverlay:{...Bt.dragOverlay,...null==H?void 0:H.dragOverlay}}),[null==H?void 0:H.draggable,null==H?void 0:H.droppable,null==H?void 0:H.dragOverlay]));var H;const{droppableRects:j,measureDroppableContainers:G,measuringScheduled:X}=function(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=(0,a.useState)(null),{frequency:l,measure:c,strategy:d}=o,m=(0,a.useRef)(e),p=function(){switch(d){case xt.Always:return!1;case xt.BeforeDragging:return n;default:return!n}}(),u=K(p),g=(0,a.useCallback)(function(e){void 0===e&&(e=[]),u.current||s(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[u]),h=(0,a.useRef)(null),b=$(t=>{if(p&&!n)return kt;if(!t||t===kt||m.current!==e||null!=i){const t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}const e=n.node.current,a=e?new Qe(c(e),e):null;n.rect.current=a,a&&t.set(n.id,a)}return t}return t},[e,i,n,p,c]);return(0,a.useEffect)(()=>{m.current=e},[e]),(0,a.useEffect)(()=>{p||g()},[n,p]),(0,a.useEffect)(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),(0,a.useEffect)(()=>{p||"number"!=typeof l||null!==h.current||(h.current=setTimeout(()=>{g(),h.current=null},l))},[l,p,g,...r]),{droppableRects:b,measureDroppableContainers:g,measuringScheduled:null!=i}}(z,{dragging:E,dependencies:[T.x,T.y],config:W.droppable}),J=function(e,t){const n=null!=t?e.get(t):void 0,a=n?n.node.current:null;return $(e=>{var n;return null==t?null:null!=(n=null!=a?a:e)?n:null},[a,t])}(C,S),Z=(0,a.useMemo)(()=>B?ae(B):null,[B]),te=function(){const e=!1===(null==I?void 0:I.autoScrollEnabled),t="object"==typeof c?!1===c.enabled:!1===c,n=E&&!e&&!t;if("object"==typeof c)return{...c,enabled:n};return{enabled:n}}(),ne=function(e,t){return Et(e,t)}(J,W.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=(0,a.useRef)(!1),{x:s,y:l}="boolean"==typeof o?{x:o,y:o}:o;V(()=>{if(!s&&!l||!t)return void(i.current=!1);if(i.current||!r)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const a=Ne(n(e),r);if(s||(a.x=0),l||(a.y=0),i.current=!0,Math.abs(a.x)>0||Math.abs(a.y)>0){const t=Fe(e);t&&t.scrollBy({top:a.y,left:a.x})}},[t,s,l,r,n])}({activeNode:null!=S?C.get(S):null,config:te.layoutShiftCompensation,initialRect:ne,measure:W.draggable.measure});const re=Tt(J,W.draggable.measure,ne),oe=Tt(J?J.parentElement:null),ie=(0,a.useRef)({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:j,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),se=A.getNodeFor(null==(t=ie.current.over)?void 0:t.id),le=function(e){let{measure:t}=e;const[n,r]=(0,a.useState)(null),o=St({callback:(0,a.useCallback)(e=>{for(const{target:n}of e)if(q(n)){r(e=>{const a=t(n);return e?{...e,width:a.width,height:a.height}:a});break}},[t])}),i=(0,a.useCallback)(e=>{const n=Mt(e);null==o||o.disconnect(),n&&(null==o||o.observe(n)),r(n?t(n):null)},[t,o]),[s,l]=Y(i);return(0,a.useMemo)(()=>({nodeRef:s,rect:n,setRef:l}),[n,s,l])}({measure:W.dragOverlay.measure}),ce=null!=(n=le.nodeRef.current)?n:J,me=E?null!=(r=le.rect)?r:re:null,pe=Boolean(le.nodeRef.current&&le.rect),he=Ne(be=pe?null:re,Et(be));var be;const ve=_t(ce?O(ce):null),ye=function(e){const t=(0,a.useRef)(e),n=$(n=>e?n&&n!==At&&e&&t.current&&e.parentNode===t.current.parentNode?n:Ue(e):At,[e]);return(0,a.useEffect)(()=>{t.current=e},[e]),n}(E?null!=se?se:J:null),xe=function(e,t){void 0===t&&(t=Pe);const[n]=e,r=_t(n?O(n):null),[o,i]=(0,a.useState)(Nt);function s(){i(()=>e.length?e.map(e=>je(e)?r:new Qe(t(e),e)):Nt)}const l=St({callback:s});return V(()=>{null==l||l.disconnect(),s(),e.forEach(e=>null==l?void 0:l.observe(e))},[e]),o}(ye),we=Ht(g,{transform:{x:T.x-he.x,y:T.y-he.y,scaleX:1,scaleY:1},activatorEvent:B,active:N,activeNodeRect:re,containerNodeRect:oe,draggingNodeRect:me,over:ie.current.over,overlayNodeRect:le.rect,scrollableAncestors:ye,scrollableAncestorRects:xe,windowRect:ve}),ke=Z?ee(Z,T):null,Se=function(e){const[t,n]=(0,a.useState)(null),r=(0,a.useRef)(e),o=(0,a.useCallback)(e=>{const t=ze(e.target);t&&n(e=>e?(e.set(t,qe(t)),new Map(e)):null)},[]);return(0,a.useEffect)(()=>{const t=r.current;if(e!==t){a(t);const i=e.map(e=>{const t=ze(e);return t?(t.addEventListener("scroll",o,{passive:!0}),[t,qe(t)]):null}).filter(e=>null!=e);n(i.length?new Map(i):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{const t=ze(e);null==t||t.removeEventListener("scroll",o)})}},[o,e]),(0,a.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>ee(e,t),fe):Ye(e):fe,[e,t])}(ye),Ce=Dt(Se),Te=Dt(Se,[re]),De=ee(we,Ce),_e=me?Ie(me,we):null,Me=N&&_e?p({active:N,collisionRect:_e,droppableRects:j,droppableContainers:z,pointerCoordinates:ke}):null,Re=Ee(Me,"id"),[Be,Le]=(0,a.useState)(null),Oe=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(pe?we:ee(we,Te),null!=(o=null==Be?void 0:Be.rect)?o:null,re),We=(0,a.useRef)(null),He=(0,a.useCallback)((e,t)=>{let{sensor:n,options:a}=t;if(null==M.current)return;const r=C.get(M.current);if(!r)return;const o=e.nativeEvent,s=new n({active:M.current,activeNode:r,event:o,options:a,context:ie,onAbort(e){if(!C.get(e))return;const{onDragAbort:t}=L.current,n={id:e};null==t||t(n),y({type:"onDragAbort",event:n})},onPending(e,t,n,a){if(!C.get(e))return;const{onDragPending:r}=L.current,o={id:e,constraint:t,initialCoordinates:n,offset:a};null==r||r(o),y({type:"onDragPending",event:o})},onStart(e){const t=M.current;if(null==t)return;const n=C.get(t);if(!n)return;const{onDragStart:a}=L.current,r={activatorEvent:o,active:{id:t,data:n.data,rect:_}};(0,i.unstable_batchedUpdates)(()=>{null==a||a(r),k(Vt.Initializing),v({type:ge.DragStart,initialCoordinates:e,active:t}),y({type:"onDragStart",event:r}),R(We.current),P(o)})},onMove(e){v({type:ge.DragMove,coordinates:e})},onEnd:l(ge.DragEnd),onCancel:l(ge.DragCancel)});function l(e){return async function(){const{active:t,collisions:n,over:a,scrollAdjustedTranslate:r}=ie.current;let s=null;if(t&&r){const{cancelDrop:i}=L.current;if(s={activatorEvent:o,active:t,collisions:n,delta:r,over:a},e===ge.DragEnd&&"function"==typeof i){await Promise.resolve(i(s))&&(e=ge.DragCancel)}}M.current=null,(0,i.unstable_batchedUpdates)(()=>{v({type:e}),k(Vt.Uninitialized),Le(null),R(null),P(null),We.current=null;const t=e===ge.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=L.current[t];null==e||e(s),y({type:t,event:s})}})}}We.current=s},[C]),Ve=(0,a.useCallback)((e,t)=>(n,a)=>{const r=n.nativeEvent,o=C.get(a);if(null!==M.current||!o||r.dndKit||r.defaultPrevented)return;const i={active:o};!0===e(n,t.options,i)&&(r.dndKit={capturedBy:t.sensor},M.current=a,He(n,t))},[C,He]),Ge=function(e,t){return(0,a.useMemo)(()=>e.reduce((e,n)=>{const{sensor:a}=n;return[...e,...a.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(m,Ve);!function(e){(0,a.useEffect)(()=>{if(!U)return;const t=e.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>{let{sensor:t}=e;return t}))}(m),V(()=>{re&&w===Vt.Initializing&&k(Vt.Initialized)},[re,w]),(0,a.useEffect)(()=>{const{onDragMove:e}=L.current,{active:t,activatorEvent:n,collisions:a,over:r}=ie.current;if(!t||!n)return;const o={active:t,activatorEvent:n,collisions:a,delta:{x:De.x,y:De.y},over:r};(0,i.unstable_batchedUpdates)(()=>{null==e||e(o),y({type:"onDragMove",event:o})})},[De.x,De.y]),(0,a.useEffect)(()=>{const{active:e,activatorEvent:t,collisions:n,droppableContainers:a,scrollAdjustedTranslate:r}=ie.current;if(!e||null==M.current||!t||!r)return;const{onDragOver:o}=L.current,s=a.get(Re),l=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:r.x,y:r.y},over:l};(0,i.unstable_batchedUpdates)(()=>{Le(l),null==o||o(c),y({type:"onDragOver",event:c})})},[Re]),V(()=>{ie.current={activatorEvent:B,active:N,activeNode:J,collisionRect:_e,collisions:Me,droppableRects:j,draggableNodes:C,draggingNode:ce,draggingNodeRect:me,droppableContainers:A,over:Be,scrollableAncestors:ye,scrollAdjustedTranslate:De},_.current={initial:me,translated:_e}},[N,J,Me,_e,C,ce,me,j,A,Be,ye,De]),vt({...te,delta:T,draggingRect:_e,pointerCoordinates:ke,scrollableAncestors:ye,scrollableAncestorRects:xe});const Ke=(0,a.useMemo)(()=>({active:N,activeNode:J,activeNodeRect:re,activatorEvent:B,collisions:Me,containerNodeRect:oe,dragOverlay:le,draggableNodes:C,droppableContainers:A,droppableRects:j,over:Be,measureDroppableContainers:G,scrollableAncestors:ye,scrollableAncestorRects:xe,measuringConfiguration:W,measuringScheduled:X,windowRect:ve}),[N,J,re,B,Me,oe,le,C,A,j,Be,G,ye,xe,W,X,ve]),$e=(0,a.useMemo)(()=>({activatorEvent:B,activators:Ge,active:N,activeNodeRect:re,ariaDescribedById:{draggable:F},dispatch:v,draggableNodes:C,over:Be,measureDroppableContainers:G}),[B,Ge,N,re,v,F,C,Be,G]);return a.createElement(de.Provider,{value:x},a.createElement(Ft.Provider,{value:$e},a.createElement(zt.Provider,{value:Ke},a.createElement(jt.Provider,{value:Oe},d)),a.createElement(qt,{disabled:!1===(null==l?void 0:l.restoreFocus)})),a.createElement(ue,{...l,hiddenTextDescribedById:F}))}),Kt=(0,a.createContext)(null),$t="button";function Yt(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Q("Draggable"),{activators:s,activatorEvent:l,active:c,activeNodeRect:d,ariaDescribedById:m,draggableNodes:p,over:u}=(0,a.useContext)(Ft),{role:g=$t,roleDescription:h="draggable",tabIndex:b=0}=null!=o?o:{},f=(null==c?void 0:c.id)===t,v=(0,a.useContext)(f?jt:Kt),[y,x]=Y(),[w,k]=Y(),E=function(e,t){return(0,a.useMemo)(()=>e.reduce((e,n)=>{let{eventName:a,handler:r}=n;return e[a]=e=>{r(e,t)},e},{}),[e,t])}(s,t),S=K(n);V(()=>(p.set(t,{id:t,key:i,node:y,activatorNode:w,data:S}),()=>{const e=p.get(t);e&&e.key===i&&p.delete(t)}),[p,t]);return{active:c,activatorEvent:l,activeNodeRect:d,attributes:(0,a.useMemo)(()=>({role:g,tabIndex:b,"aria-disabled":r,"aria-pressed":!(!f||g!==$t)||void 0,"aria-roledescription":h,"aria-describedby":m.draggable}),[r,g,b,f,h,m.draggable]),isDragging:f,listeners:r?void 0:E,node:y,over:u,setNodeRef:x,setActivatorNodeRef:k,transform:v}}function Xt(){return(0,a.useContext)(zt)}const Jt={timeout:25};function Qt(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Q("Droppable"),{active:s,dispatch:l,over:c,measureDroppableContainers:d}=(0,a.useContext)(Ft),m=(0,a.useRef)({disabled:n}),p=(0,a.useRef)(!1),u=(0,a.useRef)(null),g=(0,a.useRef)(null),{disabled:h,updateMeasurementsFor:b,timeout:f}={...Jt,...o},v=K(null!=b?b:r),y=St({callback:(0,a.useCallback)(()=>{p.current?(null!=g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(v.current)?v.current:[v.current]),g.current=null},f)):p.current=!0},[f]),disabled:h||!s}),x=(0,a.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),p.current=!1),e&&y.observe(e))},[y]),[w,k]=Y(x),E=K(t);return(0,a.useEffect)(()=>{y&&w.current&&(y.disconnect(),p.current=!1,y.observe(w.current))},[w,y]),(0,a.useEffect)(()=>(l({type:ge.RegisterDroppable,element:{id:r,key:i,disabled:n,node:w,rect:u,data:E}}),()=>l({type:ge.UnregisterDroppable,key:i,id:r})),[r]),(0,a.useEffect)(()=>{n!==m.current.disabled&&(l({type:ge.SetDroppableDisabled,id:r,key:i,disabled:n}),m.current.disabled=n)},[r,i,n,l]),{active:s,rect:u,isOver:(null==c?void 0:c.id)===r,node:w,over:c,setNodeRef:k}}function Zt(e){let{animation:t,children:n}=e;const[r,o]=(0,a.useState)(null),[i,s]=(0,a.useState)(null),l=X(n);return n||r||!l||o(l),V(()=>{if(!i)return;const e=null==r?void 0:r.key,n=null==r?void 0:r.props.id;null!=e&&null!=n?Promise.resolve(t(n,i)).then(()=>{o(null)}):o(null)},[t,r,i]),a.createElement(a.Fragment,null,n,r?(0,a.cloneElement)(r,{ref:s}):null)}const en={x:0,y:0,scaleX:1,scaleY:1};function tn(e){let{children:t}=e;return a.createElement(Ft.Provider,{value:Ut},a.createElement(jt.Provider,{value:en},t))}const nn={position:"fixed",touchAction:"none"},an=e=>ne(e)?"transform 250ms ease":void 0,rn=(0,a.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:s,rect:l,style:c,transform:d,transition:m=an}=e;if(!l)return null;const p=o?d:{...d,scaleX:1,scaleY:1},u={...nn,width:l.width,height:l.height,top:l.top,left:l.left,transform:re.Transform.toString(p),transformOrigin:o&&r?ye(r,l):void 0,transition:"function"==typeof m?m(r):m,...c};return a.createElement(n,{className:s,style:u,ref:t},i)}),on=e=>t=>{let{active:n,dragOverlay:a}=t;const r={},{styles:o,className:i}=e;if(null!=o&&o.active)for(const[e,t]of Object.entries(o.active))void 0!==t&&(r[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(null!=o&&o.dragOverlay)for(const[e,t]of Object.entries(o.dragOverlay))void 0!==t&&a.node.style.setProperty(e,t);return null!=i&&i.active&&n.node.classList.add(i.active),null!=i&&i.dragOverlay&&a.node.classList.add(i.dragOverlay),function(){for(const[e,t]of Object.entries(r))n.node.style.setProperty(e,t);null!=i&&i.active&&n.node.classList.remove(i.active)}},sn={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:re.Transform.toString(t)},{transform:re.Transform.toString(n)}]},sideEffects:on({styles:{active:{opacity:"0"}}})};function ln(e){let{config:t,draggableNodes:n,droppableContainers:a,measuringConfiguration:r}=e;return G((e,o)=>{if(null===t)return;const i=n.get(e);if(!i)return;const s=i.node.current;if(!s)return;const l=Mt(o);if(!l)return;const{transform:c}=O(o).getComputedStyle(o),d=Re(c);if(!d)return;const m="function"==typeof t?t:function(e){const{duration:t,easing:n,sideEffects:a,keyframes:r}={...sn,...e};return e=>{let{active:o,dragOverlay:i,transform:s,...l}=e;if(!t)return;const c={x:i.rect.left-o.rect.left,y:i.rect.top-o.rect.top},d={scaleX:1!==s.scaleX?o.rect.width*s.scaleX/i.rect.width:1,scaleY:1!==s.scaleY?o.rect.height*s.scaleY/i.rect.height:1},m={x:s.x-c.x,y:s.y-c.y,...d},p=r({...l,active:o,dragOverlay:i,transform:{initial:s,final:m}}),[u]=p,g=p[p.length-1];if(JSON.stringify(u)===JSON.stringify(g))return;const h=null==a?void 0:a({active:o,dragOverlay:i,...l}),b=i.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(e=>{b.onfinish=()=>{null==h||h(),e()}})}}(t);return Xe(s,r.draggable.measure),m({active:{id:e,data:i.data,node:s,rect:r.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:o,rect:r.dragOverlay.measure(l)},droppableContainers:a,measuringConfiguration:r,transform:d})})}let cn=0;function dn(e){return(0,a.useMemo)(()=>{if(null!=e)return cn++,cn},[e])}const mn=a.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:s,wrapperElement:l="div",className:c,zIndex:d=999}=e;const{activatorEvent:m,active:p,activeNodeRect:u,containerNodeRect:g,draggableNodes:h,droppableContainers:b,dragOverlay:f,over:v,measuringConfiguration:y,scrollableAncestors:x,scrollableAncestorRects:w,windowRect:k}=Xt(),E=(0,a.useContext)(jt),S=dn(null==p?void 0:p.id),C=Ht(s,{activatorEvent:m,active:p,activeNodeRect:u,containerNodeRect:g,draggingNodeRect:f.rect,over:v,overlayNodeRect:f.rect,scrollableAncestors:x,scrollableAncestorRects:w,transform:E,windowRect:k}),T=Et(u),A=ln({config:r,draggableNodes:h,droppableContainers:b,measuringConfiguration:y}),D=T?f.setRef:void 0;return a.createElement(tn,null,a.createElement(Zt,{animation:A},p&&S?a.createElement(rn,{key:S,id:p.id,ref:D,as:l,activatorEvent:m,adjustScale:t,className:c,transition:i,rect:T,style:{zIndex:d,...o},transform:C},n):null))});function pn(e,t,n){const a=e.slice();return a.splice(n<0?a.length+n:n,0,a.splice(t,1)[0]),a}function un(e,t){return e.reduce((e,n,a)=>{const r=t.get(n);return r&&(e[a]=r),e},Array(e.length))}function gn(e){return null!==e&&e>=0}const hn=e=>{let{rects:t,activeIndex:n,overIndex:a,index:r}=e;const o=pn(t,a,n),i=t[r],s=o[r];return s&&i?{x:s.left-i.left,y:s.top-i.top,scaleX:s.width/i.width,scaleY:s.height/i.height}:null};const bn="Sortable",fn=a.createContext({activeIndex:-1,containerId:bn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:hn,disabled:{draggable:!1,droppable:!1}});function vn(e){let{children:t,id:n,items:r,strategy:o=hn,disabled:i=!1}=e;const{active:s,dragOverlay:l,droppableRects:c,over:d,measureDroppableContainers:m}=Xt(),p=Q(bn,n),u=Boolean(null!==l.rect),g=(0,a.useMemo)(()=>r.map(e=>"object"==typeof e&&"id"in e?e.id:e),[r]),h=null!=s,b=s?g.indexOf(s.id):-1,f=d?g.indexOf(d.id):-1,v=(0,a.useRef)(g),y=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(g,v.current),x=-1!==f&&-1===b||y,w=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(i);V(()=>{y&&h&&m(g)},[y,g,h,m]),(0,a.useEffect)(()=>{v.current=g},[g]);const k=(0,a.useMemo)(()=>({activeIndex:b,containerId:p,disabled:w,disableTransforms:x,items:g,overIndex:f,useDragOverlay:u,sortedRects:un(g,c),strategy:o}),[b,p,w.draggable,w.droppable,x,g,f,c,u,o]);return a.createElement(fn.Provider,{value:k},t)}const yn=e=>{let{id:t,items:n,activeIndex:a,overIndex:r}=e;return pn(n,a,r).indexOf(t)},xn=e=>{let{containerId:t,isSorting:n,wasDragging:a,index:r,items:o,newIndex:i,previousItems:s,previousContainerId:l,transition:c}=e;return!(!c||!a)&&((s===o||r!==i)&&(!!n||i!==r&&t===l))},wn={duration:200,easing:"ease"},kn="transform",En=re.Transition.toString({property:kn,duration:0,easing:"linear"}),Sn={roleDescription:"sortable"};function Cn(e){let{animateLayoutChanges:t=xn,attributes:n,disabled:r,data:o,getNewIndex:i=yn,id:s,strategy:l,resizeObserverConfig:c,transition:d=wn}=e;const{items:m,containerId:p,activeIndex:u,disabled:g,disableTransforms:h,sortedRects:b,overIndex:f,useDragOverlay:v,strategy:y}=(0,a.useContext)(fn),x=function(e,t){var n,a;if("boolean"==typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(n=null==e?void 0:e.draggable)?n:t.draggable,droppable:null!=(a=null==e?void 0:e.droppable)?a:t.droppable}}(r,g),w=m.indexOf(s),k=(0,a.useMemo)(()=>({sortable:{containerId:p,index:w,items:m},...o}),[p,o,w,m]),E=(0,a.useMemo)(()=>m.slice(m.indexOf(s)),[m,s]),{rect:S,node:C,isOver:T,setNodeRef:A}=Qt({id:s,data:k,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:D,activatorEvent:_,activeNodeRect:N,attributes:M,setNodeRef:I,listeners:R,isDragging:B,over:P,setActivatorNodeRef:L,transform:U}=Yt({id:s,data:k,attributes:{...Sn,...n},disabled:x.draggable}),F=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}(A,I),z=Boolean(D),O=z&&!h&&gn(u)&&gn(f),W=!v&&B,q=W&&O?U:null,H=O?null!=q?q:(null!=l?l:y)({rects:b,activeNodeRect:N,activeIndex:u,overIndex:f,index:w}):null,j=gn(u)&&gn(f)?i({id:s,items:m,activeIndex:u,overIndex:f}):w,G=null==D?void 0:D.id,K=(0,a.useRef)({activeId:G,items:m,newIndex:j,containerId:p}),$=m!==K.current.items,Y=t({active:D,containerId:p,isDragging:B,isSorting:z,id:s,index:w,items:m,newIndex:K.current.newIndex,previousItems:K.current.items,previousContainerId:K.current.containerId,transition:d,wasDragging:null!=K.current.activeId}),X=function(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=(0,a.useState)(null),l=(0,a.useRef)(n);return V(()=>{if(!t&&n!==l.current&&r.current){const e=o.current;if(e){const t=Pe(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&s(n)}}n!==l.current&&(l.current=n)},[t,n,r,o]),(0,a.useEffect)(()=>{i&&s(null)},[i]),i}({disabled:!Y,index:w,node:C,rect:S});return(0,a.useEffect)(()=>{z&&K.current.newIndex!==j&&(K.current.newIndex=j),p!==K.current.containerId&&(K.current.containerId=p),m!==K.current.items&&(K.current.items=m)},[z,j,p,m]),(0,a.useEffect)(()=>{if(G===K.current.activeId)return;if(null!=G&&null==K.current.activeId)return void(K.current.activeId=G);const e=setTimeout(()=>{K.current.activeId=G},50);return()=>clearTimeout(e)},[G]),{active:D,activeIndex:u,attributes:M,data:k,rect:S,index:w,newIndex:j,items:m,isOver:T,isSorting:z,isDragging:B,listeners:R,node:C,overIndex:f,over:P,setNodeRef:F,setActivatorNodeRef:L,setDroppableNodeRef:A,setDraggableNodeRef:I,transform:null!=X?X:H,transition:function(){if(X||$&&K.current.newIndex===w)return En;if(W&&!ne(_)||!d)return;if(z||Y)return re.Transition.toString({...d,property:kn});return}()}}function Tn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const An=[nt.Down,nt.Right,nt.Up,nt.Left],Dn=(e,t)=>{let{context:{active:n,collisionRect:a,droppableRects:r,droppableContainers:o,over:i,scrollableAncestors:s}}=t;if(An.includes(e.code)){if(e.preventDefault(),!n||!a)return;const t=[];o.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;const o=r.get(n.id);if(o)switch(e.code){case nt.Down:a.top<o.top&&t.push(n);break;case nt.Up:a.top>o.top&&t.push(n);break;case nt.Left:a.left>o.left&&t.push(n);break;case nt.Right:a.left<o.left&&t.push(n)}});const l=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:a}=e;const r=ke(t),o=[];for(const e of a){const{id:t}=e,a=n.get(t);if(a){const n=ke(a),i=r.reduce((e,t,a)=>e+ve(n[a],t),0),s=Number((i/4).toFixed(4));o.push({id:t,data:{droppableContainer:e,value:s}})}}return o.sort(xe)})({active:n,collisionRect:a,droppableRects:r,droppableContainers:t,pointerCoordinates:null});let c=Ee(l,"id");if(c===(null==i?void 0:i.id)&&l.length>1&&(c=l[1].id),null!=c){const e=o.get(n.id),t=o.get(c),i=t?r.get(t.id):null,l=null==t?void 0:t.node.current;if(l&&i&&e&&t){const n=Ue(l).some((e,t)=>s[t]!==e),r=_n(e,t),o=function(e,t){if(!Tn(e)||!Tn(t))return!1;if(!_n(e,t))return!1;return e.data.current.sortable.index<t.data.current.sortable.index}(e,t),c=n||!r?{x:0,y:0}:{x:o?a.width-i.width:0,y:o?a.height-i.height:0},d={x:i.left,y:i.top};return c.x&&c.y?d:te(d,c)}}}};function _n(e,t){return!(!Tn(e)||!Tn(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var Nn=r(3861),Mn=r(1872);const In=({data:e,onChange:t})=>{const[n,o]=(0,a.useState)(!0),[i,l]=(0,a.useState)([]),[c,m]=(0,a.useState)([]),[p,u]=(0,a.useState)([]),[g,h]=(0,a.useState)([]);(0,a.useEffect)(()=>{const e=d.TabsStorage.getTabs();m(e.map(e=>({id:e.id,title:e.title})));const t=e=>{const t=e;t.detail?.groups&&l(t.detail.groups.map(e=>({id:e.id,name:e.name})))};document.addEventListener("getAllGroupsResponse",t),document.dispatchEvent(new CustomEvent("getAllGroupsRequest"));return(async()=>{try{const e=await Promise.resolve().then(r.t.bind(r,6815,23)),t=(await e.default.storage.local.get("wa_kanban_crm_data_sync")).wa_kanban_crm_data_sync;if(t){const e=t.crms?.find(e=>"whatsapp_labels"===e.type);if(e&&t.stages?.[e.id]){const n=t.stages[e.id].filter(e=>e.whatsappLabelId).map(e=>({id:e.whatsappLabelId,name:e.name}));u(n)}const n=(t.crms||[]).filter(e=>"whatsapp_labels"!==e.type&&"custom_tabs"!==e.type).map(e=>({id:e.id,name:e.name,stages:(t.stages?.[e.id]||[]).map(e=>({id:e.id,name:e.name}))}));h(n)}}catch(e){}})(),()=>{document.removeEventListener("getAllGroupsResponse",t)}},[]);const b=n=>{t({...e,postActions:{...e.postActions,...n}})};return a.createElement("div",{className:"qr-container"},a.createElement("div",{className:"qr-edit-before-send-section"},a.createElement("div",{style:Pn.editBeforeSendRow},a.createElement("div",{style:Pn.editBeforeSendInfo},a.createElement("span",{style:Pn.editBeforeSendIcon},"✏️"),a.createElement("div",{style:Pn.editBeforeSendText},a.createElement("span",{className:"qr-edit-label"},(0,s.t)("quickReply.editBeforeSending")||"Edit before sending"),a.createElement("span",{className:"qr-edit-desc"},(0,s.t)("quickReply.editBeforeSendingDesc")||"Allow editing message before sending"))),a.createElement(Bn,{checked:e.settings?.editBeforeSend||!1,onChange:n=>{return a={editBeforeSend:n},void t({...e,settings:{...e.settings,...a}});var a}}))),a.createElement("div",{className:"qr-post-actions-section"},a.createElement("div",{className:"qr-post-actions-header",onClick:()=>o(!n)},a.createElement("span",{className:"qr-post-actions-title"},"⚡ ",(0,s.t)("quickReply.postActions")||"Post Actions"),a.createElement("span",{className:"qr-expand-icon"},n?"▼":"▶")),n&&a.createElement("div",{className:"qr-post-actions-content"},a.createElement("div",{className:"qr-action-toggle-section"},a.createElement(Rn,{checked:e.postActions?.groupActionsEnabled||!1,onChange:e=>b({groupActionsEnabled:e}),label:(0,s.t)("quickReply.groupActions")||"Group Actions"}),e.postActions?.groupActionsEnabled&&a.createElement("div",{className:"qr-sub-actions"},a.createElement("div",{style:Pn.subActionRow},a.createElement("label",{className:"qr-sub-action-label"},a.createElement("input",{type:"checkbox",checked:(e.postActions?.addToGroups?.length||0)>0,onChange:e=>{e.target.checked||b({addToGroups:[]})},className:"qr-sub-checkbox"}),(0,s.t)("quickReply.addToGroups")||"Add to Groups"),a.createElement("select",{multiple:!0,value:e.postActions?.addToGroups||[],onChange:e=>{const t=Array.from(e.target.selectedOptions,e=>e.value);b({addToGroups:t})},className:"qr-multi-select"},0===i.length?a.createElement("option",{disabled:!0},(0,s.t)("quickReply.noGroupsAvailable")||"No groups available"):i.map(e=>a.createElement("option",{key:e.id,value:e.id},e.name)))),a.createElement("div",{style:Pn.subActionRow},a.createElement("label",{className:"qr-sub-action-label"},a.createElement("input",{type:"checkbox",checked:(e.postActions?.removeFromGroups?.length||0)>0,onChange:e=>{e.target.checked||b({removeFromGroups:[]})},className:"qr-sub-checkbox"}),(0,s.t)("quickReply.removeFromGroups")||"Remove from Groups"),a.createElement("select",{multiple:!0,value:e.postActions?.removeFromGroups||[],onChange:e=>{const t=Array.from(e.target.selectedOptions,e=>e.value);b({removeFromGroups:t})},className:"qr-multi-select"},0===i.length?a.createElement("option",{disabled:!0},(0,s.t)("quickReply.noGroupsAvailable")||"No groups available"):i.map(e=>a.createElement("option",{key:e.id,value:e.id},e.name)))))),a.createElement("div",{className:"qr-action-toggle-section"},a.createElement(Rn,{checked:e.postActions?.tabActionsEnabled||!1,onChange:e=>b({tabActionsEnabled:e}),label:(0,s.t)("quickReply.customTabActions")||"Custom Tab Actions"}),e.postActions?.tabActionsEnabled&&a.createElement("div",{className:"qr-sub-actions"},a.createElement("div",{style:Pn.subActionRow},a.createElement("label",{className:"qr-sub-action-label"},a.createElement("input",{type:"checkbox",checked:(e.postActions?.addToTabs?.length||0)>0,onChange:e=>{e.target.checked||b({addToTabs:[]})},className:"qr-sub-checkbox"}),(0,s.t)("quickReply.addToTabs")||"Add to Tabs"),a.createElement("select",{multiple:!0,value:e.postActions?.addToTabs||[],onChange:e=>{const t=Array.from(e.target.selectedOptions,e=>e.value);b({addToTabs:t})},className:"qr-multi-select"},0===c.length?a.createElement("option",{disabled:!0},(0,s.t)("quickReply.noTabsAvailable")||"No tabs available"):c.map(e=>a.createElement("option",{key:e.id,value:e.id},e.title)))),a.createElement("div",{style:Pn.subActionRow},a.createElement("label",{className:"qr-sub-action-label"},a.createElement("input",{type:"checkbox",checked:(e.postActions?.removeFromTabs?.length||0)>0,onChange:e=>{e.target.checked||b({removeFromTabs:[]})},className:"qr-sub-checkbox"}),(0,s.t)("quickReply.removeFromTabs")||"Remove from Tabs"),a.createElement("select",{multiple:!0,value:e.postActions?.removeFromTabs||[],onChange:e=>{const t=Array.from(e.target.selectedOptions,e=>e.value);b({removeFromTabs:t})},className:"qr-multi-select"},0===c.length?a.createElement("option",{disabled:!0},(0,s.t)("quickReply.noTabsAvailable")||"No tabs available"):c.map(e=>a.createElement("option",{key:e.id,value:e.id},e.title)))))),a.createElement("div",{className:"qr-action-toggle-section"},a.createElement(Rn,{checked:e.postActions?.labelsActionsEnabled||!1,onChange:e=>b({labelsActionsEnabled:e}),label:(0,s.t)("quickReply.labelsActions")||"Labels Actions"}),e.postActions?.labelsActionsEnabled&&a.createElement("div",{className:"qr-sub-actions"},a.createElement("div",{style:Pn.subActionRow},a.createElement("label",{className:"qr-sub-action-label"},a.createElement("input",{type:"checkbox",checked:(e.postActions?.addLabels?.length||0)>0,onChange:e=>{e.target.checked||b({addLabels:[]})},className:"qr-sub-checkbox"}),(0,s.t)("quickReply.addLabels")||"Add Labels"),a.createElement("select",{multiple:!0,value:e.postActions?.addLabels||[],onChange:e=>{const t=Array.from(e.target.selectedOptions,e=>e.value);b({addLabels:t})},className:"qr-multi-select"},0===p.length?a.createElement("option",{disabled:!0},(0,s.t)("quickReply.noLabelsAvailable")||"No labels available"):p.map(e=>a.createElement("option",{key:e.id,value:e.id},e.name)))),a.createElement("div",{style:Pn.subActionRow},a.createElement("label",{className:"qr-sub-action-label"},a.createElement("input",{type:"checkbox",checked:(e.postActions?.removeLabels?.length||0)>0,onChange:e=>{e.target.checked||b({removeLabels:[]})},className:"qr-sub-checkbox"}),(0,s.t)("quickReply.removeLabels")||"Remove Labels"),a.createElement("select",{multiple:!0,value:e.postActions?.removeLabels||[],onChange:e=>{const t=Array.from(e.target.selectedOptions,e=>e.value);b({removeLabels:t})},className:"qr-multi-select"},0===p.length?a.createElement("option",{disabled:!0},(0,s.t)("quickReply.noLabelsAvailable")||"No labels available"):p.map(e=>a.createElement("option",{key:e.id,value:e.id},e.name)))))),a.createElement("div",{className:"qr-action-toggle-section"},a.createElement(Rn,{checked:e.postActions?.kanbanActionsEnabled||!1,onChange:e=>b({kanbanActionsEnabled:e}),label:(0,s.t)("quickReply.kanbanBoardActions")||"Kanban Board Actions"}),e.postActions?.kanbanActionsEnabled&&a.createElement("div",{className:"qr-sub-actions"},a.createElement("div",{style:Pn.subActionRow},a.createElement("label",{className:"qr-sub-action-label"},a.createElement("input",{type:"checkbox",checked:null!==e.postActions?.addToKanban,onChange:e=>{e.target.checked||b({addToKanban:null})},className:"qr-sub-checkbox"}),(0,s.t)("quickReply.addToKanban")||"Add to Stage"),a.createElement("select",{value:e.postActions?.addToKanban?`${e.postActions.addToKanban.crmId}|${e.postActions.addToKanban.stageId}`:"",onChange:e=>{if(e.target.value){const[t,n]=e.target.value.split("|");b({addToKanban:{crmId:t,stageId:n}})}else b({addToKanban:null})},className:"qr-single-select"},a.createElement("option",{value:""},(0,s.t)("quickReply.selectStage")||"Select Stage..."),0===g.length?a.createElement("option",{disabled:!0},(0,s.t)("quickReply.noKanbanAvailable")||"No Kanban boards available"):g.map(e=>a.createElement("optgroup",{key:e.id,label:e.name},e.stages.map(t=>a.createElement("option",{key:t.id,value:`${e.id}|${t.id}`},t.name)))))),a.createElement("div",{style:Pn.subActionRow},a.createElement("label",{className:"qr-sub-action-label"},a.createElement("input",{type:"checkbox",checked:null!==e.postActions?.removeFromKanban,onChange:e=>{e.target.checked||b({removeFromKanban:null})},className:"qr-sub-checkbox"}),(0,s.t)("quickReply.removeFromKanban")||"Remove from Stage"),a.createElement("select",{value:e.postActions?.removeFromKanban?`${e.postActions.removeFromKanban.crmId}|${e.postActions.removeFromKanban.stageId}`:"",onChange:e=>{if(e.target.value){const[t,n]=e.target.value.split("|");b({removeFromKanban:{crmId:t,stageId:n}})}else b({removeFromKanban:null})},className:"qr-single-select"},a.createElement("option",{value:""},(0,s.t)("quickReply.selectStage")||"Select Stage..."),0===g.length?a.createElement("option",{disabled:!0},(0,s.t)("quickReply.noKanbanAvailable")||"No Kanban boards available"):g.map(e=>a.createElement("optgroup",{key:e.id,label:e.name},e.stages.map(t=>a.createElement("option",{key:t.id,value:`${e.id}|${t.id}`},t.name)))))))))),a.createElement("style",null,"\n        .qr-container {\n          margin-top: 20px;\n        }\n\n        .qr-edit-before-send-section {\n          background: var(--lion-bg-secondary);\n          border-radius: 10px;\n          border: 1px solid var(--lion-border-light);\n          padding: 16px 20px;\n          margin-bottom: 16px;\n        }\n\n        .qr-edit-label {\n          font-size: 15px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n        }\n\n        .qr-edit-desc {\n          font-size: 12px;\n          color: var(--lion-text-muted);\n        }\n\n        .qr-post-actions-section {\n          background: var(--lion-bg-secondary);\n          border-radius: 10px;\n          border: 1px solid var(--lion-border-light);\n          overflow: hidden;\n        }\n\n        .qr-post-actions-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 16px 20px;\n          cursor: pointer;\n          background: var(--lion-bg-tertiary);\n          border-bottom: 1px solid var(--lion-border-light);\n        }\n\n        .qr-post-actions-header:hover {\n          background: var(--lion-bg-hover);\n        }\n\n        .qr-post-actions-title {\n          font-size: 16px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .qr-expand-icon {\n          font-size: 14px;\n          color: var(--lion-text-secondary);\n          font-weight: bold;\n        }\n\n        .qr-post-actions-content {\n          padding: 20px;\n          background: var(--lion-bg-secondary);\n        }\n\n        .qr-action-toggle-section {\n          margin-bottom: 16px;\n          padding: 16px;\n          background: var(--lion-bg-primary);\n          border-radius: 8px;\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .qr-sub-actions {\n          margin-top: 16px;\n          padding: 16px;\n          background: var(--lion-bg-secondary);\n          border-radius: 8px;\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .qr-sub-action-label {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          margin-bottom: 10px;\n          font-size: 14px;\n          color: var(--lion-text-secondary);\n          cursor: pointer;\n          font-weight: 500;\n        }\n\n        .qr-sub-checkbox {\n          width: 18px;\n          height: 18px;\n          cursor: pointer;\n          accent-color: var(--lion-primary);\n        }\n\n        .qr-multi-select,\n        .qr-single-select {\n          width: 100%;\n          padding: 10px;\n          border: 1px solid var(--lion-border-medium);\n          border-radius: 6px;\n          font-size: 14px;\n          outline: none;\n          transition: border-color 0.2s;\n          background: var(--lion-bg-secondary);\n          color: var(--lion-text-primary);\n        }\n\n        .qr-multi-select {\n          min-height: 100px;\n        }\n\n        .qr-multi-select:focus,\n        .qr-single-select:focus {\n          border-color: var(--lion-primary);\n        }\n\n        /* Toggle Switch Styles */\n        .qr-toggle-switch {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          cursor: pointer;\n          user-select: none;\n        }\n\n        .qr-toggle-track {\n          position: relative;\n          width: 48px;\n          height: 26px;\n          background: var(--lion-border-medium);\n          border-radius: 13px;\n          transition: background 0.3s ease;\n        }\n\n        .qr-toggle-track.checked {\n          background: var(--lion-primary);\n        }\n\n        .qr-toggle-thumb {\n          position: absolute;\n          top: 3px;\n          left: 3px;\n          width: 20px;\n          height: 20px;\n          background: white;\n          border-radius: 50%;\n          transition: left 0.3s ease;\n          box-shadow: 0 2px 4px rgba(0,0,0,0.2);\n        }\n\n        .qr-toggle-track.checked .qr-toggle-thumb {\n          left: 25px;\n        }\n\n        .qr-toggle-label {\n          font-size: 15px;\n          font-weight: 500;\n          color: var(--lion-text-secondary);\n        }\n\n        /* Small Toggle Switch */\n        .qr-toggle-switch-small {\n          display: flex;\n          align-items: center;\n          cursor: pointer;\n          user-select: none;\n        }\n\n        .qr-toggle-track-small {\n          position: relative;\n          width: 44px;\n          height: 24px;\n          background: var(--lion-border-medium);\n          border-radius: 12px;\n          transition: background 0.3s ease;\n        }\n\n        .qr-toggle-track-small.checked {\n          background: var(--lion-primary);\n        }\n\n        .qr-toggle-thumb-small {\n          position: absolute;\n          top: 2px;\n          left: 2px;\n          width: 20px;\n          height: 20px;\n          background: white;\n          border-radius: 50%;\n          transition: left 0.3s ease;\n          box-shadow: 0 2px 4px rgba(0,0,0,0.2);\n        }\n\n        .qr-toggle-track-small.checked .qr-toggle-thumb-small {\n          left: 22px;\n        }\n      "))},Rn=({checked:e,onChange:t,label:n})=>a.createElement("label",{className:"qr-toggle-switch"},a.createElement("div",{className:"qr-toggle-track "+(e?"checked":"")},a.createElement("div",{className:"qr-toggle-thumb"})),a.createElement("input",{type:"checkbox",checked:e,onChange:e=>t(e.target.checked),style:{display:"none"}}),a.createElement("span",{className:"qr-toggle-label"},n)),Bn=({checked:e,onChange:t})=>a.createElement("label",{className:"qr-toggle-switch-small"},a.createElement("div",{className:"qr-toggle-track-small "+(e?"checked":"")},a.createElement("div",{className:"qr-toggle-thumb-small"})),a.createElement("input",{type:"checkbox",checked:e,onChange:e=>t(e.target.checked),style:{display:"none"}})),Pn={container:{marginTop:"20px"},editBeforeSendRow:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px"},editBeforeSendInfo:{display:"flex",alignItems:"center",gap:"12px",flex:1},editBeforeSendIcon:{fontSize:"24px"},editBeforeSendText:{display:"flex",flexDirection:"column",gap:"2px"},subActionRow:{marginBottom:"16px"}},Ln=({attachments:e,attachmentType:t,onChange:n})=>{const[r,o]=(0,a.useState)(!1),i=()=>{switch(t){case"image/video":case"audio":default:return 16777216;case"document":return 104857600}};return a.createElement("div",{className:"wa-media-attachment-field"},a.createElement("label",{className:"wa-form-label"},(()=>{switch(t){case"image/video":return(0,s.t)("templates.form.attachImages")||"Images/Videos";case"document":return(0,s.t)("templates.form.attachDocuments")||"Documents";case"audio":return(0,s.t)("templates.form.attachAudio")||"Audio Files";default:return(0,s.t)("templates.form.attachments")||"Attachments"}})()),e.length>0&&a.createElement("div",{className:"wa-attachment-list"},e.map((t,r)=>{return a.createElement("div",{key:r,className:"wa-attachment-item"},a.createElement("div",{className:"wa-attachment-info"},a.createElement("span",{className:"wa-attachment-icon"},(o=t.name,/\.(jpg|jpeg|png|gif|webp)$/i.test(o)?"🖼️":/\.(mp4|avi|mov|mkv|webm)$/i.test(o)?"🎥":/\.(mp3|wav|ogg|m4a)$/i.test(o)?"🎵":/\.(pdf)$/i.test(o)?"📄":/\.(doc|docx)$/i.test(o)?"📝":/\.(xls|xlsx|csv)$/i.test(o)?"📊":"📎")),a.createElement("div",{className:"wa-attachment-details"},a.createElement("span",{className:"wa-attachment-name"},t.name),a.createElement("input",{type:"text",className:"wa-attachment-caption",placeholder:"Add caption (optional)",value:t.caption,onChange:t=>((t,a)=>{const r=[...e];r[t]={...r[t],caption:a},n(r)})(r,t.target.value)}))),a.createElement("button",{type:"button",className:"wa-btn-remove",onClick:()=>(t=>{const a=e[t];"local"===a.type&&a.file&&Mn.TemplatesStorage.deleteMedia(a.file);const r=e.filter((e,n)=>n!==t);n(r)})(r),title:"Remover"},"✕"));var o})),a.createElement("div",{className:"wa-upload-section"},a.createElement("label",{className:"wa-upload-btn "+(r?"uploading":"")},a.createElement("input",{type:"file",accept:(()=>{switch(t){case"image/video":return"image/*,video/*";case"document":return".pdf,.doc,.docx,.xls,.xlsx,.csv,.txt";case"audio":return"audio/*";default:return"*/*"}})(),onChange:async t=>{const a=t.target.files?.[0];if(a)if(a.size>i())alert((0,s.t)("templates.errors.fileTooLarge")||`File is too large. Maximum size is ${i()/1024/1024}MB`);else{o(!0);try{const t=await Mn.TemplatesStorage.saveMedia("temp",a),r={name:a.name,caption:"",type:"local",base64Url:"",file:t};n([...e,r])}catch(e){const t=e instanceof Error?e.message:String(e);alert(((0,s.t)("templates.errors.uploadFailed")||"Failed to upload file.")+"\n\n"+t)}finally{o(!1),t.target.value=""}}},disabled:r,style:{display:"none"}}),r?a.createElement(a.Fragment,null,a.createElement("span",{className:"wa-spinner"},"⏳"),(0,s.t)("templates.form.uploading")||"Uploading..."):a.createElement(a.Fragment,null,a.createElement("span",null,"📁"),(0,s.t)("templates.form.chooseFile")||"Choose File")),a.createElement("small",{className:"wa-form-hint"},(0,s.t)("templates.form.maxFileSize")||`Max size: ${i()/1024/1024}MB`)),a.createElement("style",null,"\n        .wa-media-attachment-field {\n          margin-bottom: 16px;\n        }\n\n        .wa-attachment-list {\n          margin-bottom: 12px;\n          display: flex;\n          flex-direction: column;\n          gap: 8px;\n        }\n\n        .wa-attachment-item {\n          display: flex;\n          justify-content: space-between;\n          align-items: flex-start;\n          padding: 12px;\n          background: var(--lion-bg-secondary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 6px;\n          gap: 12px;\n        }\n\n        .wa-attachment-info {\n          flex: 1;\n          display: flex;\n          gap: 10px;\n          align-items: flex-start;\n        }\n\n        .wa-attachment-icon {\n          font-size: 24px;\n          line-height: 1;\n        }\n\n        .wa-attachment-details {\n          flex: 1;\n          display: flex;\n          flex-direction: column;\n          gap: 6px;\n        }\n\n        .wa-attachment-name {\n          font-size: 14px;\n          font-weight: 500;\n          color: var(--lion-text-secondary);\n          word-break: break-word;\n        }\n\n        .wa-attachment-caption {\n          width: 100%;\n          padding: 6px 10px;\n          border: 1px solid var(--lion-border-medium);\n          border-radius: 4px;\n          font-size: 13px;\n          outline: none;\n        }\n\n        .wa-attachment-caption:focus {\n          border-color: var(--lion-primary);\n        }\n\n        .wa-btn-remove {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n          border: 1px solid var(--lion-error);\n          border-radius: 4px;\n          width: 28px;\n          height: 28px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          font-size: 14px;\n          transition: all 0.2s;\n          flex-shrink: 0;\n        }\n\n        .wa-btn-remove:hover {\n          background: var(--lion-error);\n          color: var(--lion-bg-primary);\n        }\n\n        .wa-upload-section {\n          display: flex;\n          flex-direction: column;\n          gap: 6px;\n        }\n\n        .wa-upload-btn {\n          display: inline-flex;\n          align-items: center;\n          gap: 8px;\n          padding: 10px 16px;\n          background: var(--lion-bg-tertiary);\n          border: 2px dashed var(--lion-border-medium);\n          border-radius: 6px;\n          cursor: pointer;\n          font-size: 14px;\n          font-weight: 500;\n          color: var(--lion-text-secondary);\n          transition: all 0.2s;\n        }\n\n        .wa-upload-btn:hover:not(.uploading) {\n          background: var(--lion-border-light);\n          border-color: var(--lion-border-dark);\n        }\n\n        .wa-upload-btn.uploading {\n          cursor: not-allowed;\n          opacity: 0.7;\n        }\n\n        .wa-spinner {\n          animation: spin 1s linear infinite;\n        }\n\n        @keyframes spin {\n          from { transform: rotate(0deg); }\n          to { transform: rotate(360deg); }\n        }\n      "))},Un=({pollData:e,onChange:t})=>{const n=e||{question:"",allowMultipleAnswers:!1,options:[{option:""},{option:""}]},r=(e,a)=>{t({...n,[e]:a})};return a.createElement("div",{className:"wa-poll-config-field"},a.createElement("div",{className:"wa-form-group"},a.createElement("label",{className:"wa-form-label required"},(0,s.t)("templates.form.pollQuestion")||"Poll Question"),a.createElement("input",{type:"text",className:"wa-form-input",value:n.question,onChange:e=>r("question",e.target.value),placeholder:(0,s.t)("templates.form.pollQuestionPlaceholder")||"Enter your poll question",maxLength:255})),a.createElement("div",{className:"wa-form-group"},a.createElement("label",{className:"wa-checkbox-label"},a.createElement("input",{type:"checkbox",checked:n.allowMultipleAnswers,onChange:e=>r("allowMultipleAnswers",e.target.checked)}),a.createElement("span",null,(0,s.t)("templates.form.allowMultipleAnswers")||"Allow multiple answers")),a.createElement("small",{className:"wa-form-hint"},(0,s.t)("templates.form.allowMultipleAnswersHint")||"If enabled, users can select multiple options")),a.createElement("div",{className:"wa-form-group"},a.createElement("label",{className:"wa-form-label required"},(0,s.t)("templates.form.pollOptions")||"Poll Options"),a.createElement("div",{className:"wa-poll-options-list"},n.options.map((e,r)=>a.createElement("div",{key:r,className:"wa-poll-option-row"},a.createElement("span",{className:"wa-option-number"},r+1,"."),a.createElement("input",{type:"text",className:"wa-form-input",value:e.option,onChange:e=>((e,a)=>{const r=[...n.options];r[e]={option:a},t({...n,options:r})})(r,e.target.value),placeholder:`Option ${r+1}`,maxLength:100}),n.options.length>Nn.Mb.MIN_POLL_OPTIONS&&a.createElement("button",{type:"button",className:"wa-btn-remove-option",onClick:()=>(e=>{if(n.options.length<=Nn.Mb.MIN_POLL_OPTIONS)return void alert((0,s.t)("templates.errors.minPollOptions")||`Minimum ${Nn.Mb.MIN_POLL_OPTIONS} options required`);const a=n.options.filter((t,n)=>n!==e);t({...n,options:a})})(r),title:"Remove option"},"✕")))),n.options.length<Nn.Mb.MAX_POLL_OPTIONS&&a.createElement("button",{type:"button",className:"wa-btn-add-option",onClick:()=>{n.options.length>=Nn.Mb.MAX_POLL_OPTIONS?alert((0,s.t)("templates.errors.maxPollOptions")||`Maximum ${Nn.Mb.MAX_POLL_OPTIONS} options allowed`):t({...n,options:[...n.options,{option:""}]})}},"+ ",(0,s.t)("templates.form.addOption")||"Add Option"),a.createElement("small",{className:"wa-form-hint"},(0,s.t)("templates.form.pollOptionsHint")||`${Nn.Mb.MIN_POLL_OPTIONS}-${Nn.Mb.MAX_POLL_OPTIONS} options allowed`)),a.createElement("style",null,'\n        .wa-poll-config-field {\n          margin-top: 16px;\n          padding: 16px;\n          background: var(--lion-bg-secondary);\n          border-radius: 8px;\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .wa-checkbox-label {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          cursor: pointer;\n          font-size: 14px;\n          color: var(--lion-text-secondary);\n        }\n\n        .wa-checkbox-label input[type="checkbox"] {\n          width: 18px;\n          height: 18px;\n          cursor: pointer;\n        }\n\n        .wa-poll-options-list {\n          display: flex;\n          flex-direction: column;\n          gap: 10px;\n          margin-bottom: 12px;\n        }\n\n        .wa-poll-option-row {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .wa-option-number {\n          font-weight: 600;\n          color: var(--lion-text-muted);\n          min-width: 24px;\n          font-size: 14px;\n        }\n\n        .wa-poll-option-row .wa-form-input {\n          flex: 1;\n        }\n\n        .wa-btn-remove-option {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n          border: 1px solid var(--lion-error);\n          border-radius: 4px;\n          width: 32px;\n          height: 32px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          font-size: 16px;\n          transition: all 0.2s;\n          flex-shrink: 0;\n        }\n\n        .wa-btn-remove-option:hover {\n          background: var(--lion-error);\n          color: var(--lion-bg-primary);\n        }\n\n        .wa-btn-add-option {\n          padding: 8px 16px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-medium);\n          border-radius: 6px;\n          font-size: 14px;\n          font-weight: 500;\n          color: var(--lion-primary);\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .wa-btn-add-option:hover {\n          background: var(--lion-primary-light);\n          border-color: var(--lion-primary);\n        }\n      '))},Fn=({listData:e,onChange:t})=>{const n=e||{buttonText:"",description:"",sections:[{title:"",rows:[{title:"",description:""}]}]},r=(e,a)=>{t({...n,[e]:a})},o=(e,a,r,o)=>{const i=[...n.sections];i[e].rows[a]={...i[e].rows[a],[r]:o},t({...n,sections:i})};return a.createElement("div",{className:"wa-list-config-field"},a.createElement("div",{className:"wa-form-group"},a.createElement("label",{className:"wa-form-label required"},(0,s.t)("templates.form.listButtonText")||"List Button Text"),a.createElement("input",{type:"text",className:"wa-form-input",value:n.buttonText,onChange:e=>r("buttonText",e.target.value),placeholder:(0,s.t)("templates.form.listButtonTextPlaceholder")||"e.g., View Menu",maxLength:20})),a.createElement("div",{className:"wa-form-group"},a.createElement("label",{className:"wa-form-label"},(0,s.t)("templates.form.listDescription")||"List Description"),a.createElement("textarea",{className:"wa-form-textarea",value:n.description,onChange:e=>r("description",e.target.value),placeholder:(0,s.t)("templates.form.listDescriptionPlaceholder")||"Description (optional)",rows:2,maxLength:1024})),a.createElement("div",{className:"wa-list-sections"},a.createElement("label",{className:"wa-form-label required"},(0,s.t)("templates.form.listSections")||"List Sections"),n.sections.map((e,r)=>a.createElement("div",{key:r,className:"wa-list-section-card"},a.createElement("div",{className:"wa-section-header"},a.createElement("h4",null,"Section ",r+1),n.sections.length>1&&a.createElement("button",{type:"button",className:"wa-btn-remove-section",onClick:()=>(e=>{if(n.sections.length<=1)return void alert("At least one section is required");const a=n.sections.filter((t,n)=>n!==e);t({...n,sections:a})})(r),title:"Remove section"},"✕")),a.createElement("input",{type:"text",className:"wa-form-input",value:e.title,onChange:e=>((e,a,r)=>{const o=[...n.sections];o[e]={...o[e],[a]:r},t({...n,sections:o})})(r,"title",e.target.value),placeholder:"Section Title",maxLength:24}),a.createElement("div",{className:"wa-list-rows"},a.createElement("small",{className:"wa-rows-label"},"Rows:"),e.rows.map((i,s)=>a.createElement("div",{key:s,className:"wa-list-row"},a.createElement("div",{className:"wa-row-content"},a.createElement("input",{type:"text",className:"wa-form-input",value:i.title,onChange:e=>o(r,s,"title",e.target.value),placeholder:`Row ${s+1} Title`,maxLength:24}),a.createElement("input",{type:"text",className:"wa-form-input",value:i.description||"",onChange:e=>o(r,s,"description",e.target.value),placeholder:"Description (optional)",maxLength:72})),e.rows.length>1&&a.createElement("button",{type:"button",className:"wa-btn-remove-row",onClick:()=>((e,a)=>{if(n.sections[e].rows.length<=1)return void alert("At least one row per section is required");const r=[...n.sections];r[e].rows=r[e].rows.filter((e,t)=>t!==a),t({...n,sections:r})})(r,s),title:"Remove row"},"✕"))),e.rows.length<Nn.Mb.MAX_LIST_ROWS_PER_SECTION&&a.createElement("button",{type:"button",className:"wa-btn-add-row",onClick:()=>(e=>{const a=n.sections[e];if(n.sections.reduce((e,t)=>e+t.rows.length,0)>=Nn.Mb.MAX_LIST_TOTAL_ROWS)return void alert(`Maximum ${Nn.Mb.MAX_LIST_TOTAL_ROWS} rows total allowed across all sections`);if(a.rows.length>=Nn.Mb.MAX_LIST_ROWS_PER_SECTION)return void alert(`Maximum ${Nn.Mb.MAX_LIST_ROWS_PER_SECTION} rows per section`);const r=[...n.sections];r[e].rows.push({title:"",description:""}),t({...n,sections:r})})(r)},"+ Add Row")))),n.sections.length<Nn.Mb.MAX_LIST_SECTIONS&&a.createElement("button",{type:"button",className:"wa-btn-add-section",onClick:()=>{n.sections.length>=Nn.Mb.MAX_LIST_SECTIONS?alert(`Maximum ${Nn.Mb.MAX_LIST_SECTIONS} sections allowed`):t({...n,sections:[...n.sections,{title:"",rows:[{title:"",description:""}]}]})}},"+ Add Section")),a.createElement("style",null,"\n        .wa-list-config-field {\n          margin-top: 16px;\n          padding: 16px;\n          background: var(--lion-bg-secondary);\n          border-radius: 8px;\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .wa-list-sections {\n          display: flex;\n          flex-direction: column;\n          gap: 12px;\n        }\n\n        .wa-list-section-card {\n          padding: 16px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 6px;\n        }\n\n        .wa-section-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          margin-bottom: 12px;\n        }\n\n        .wa-section-header h4 {\n          margin: 0;\n          font-size: 14px;\n          font-weight: 600;\n          color: var(--lion-text-secondary);\n        }\n\n        .wa-btn-remove-section {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n          border: 1px solid var(--lion-error);\n          border-radius: 4px;\n          width: 28px;\n          height: 28px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          font-size: 14px;\n          transition: all 0.2s;\n        }\n\n        .wa-btn-remove-section:hover {\n          background: var(--lion-error);\n          color: var(--lion-bg-primary);\n        }\n\n        .wa-list-rows {\n          margin-top: 12px;\n          display: flex;\n          flex-direction: column;\n          gap: 8px;\n        }\n\n        .wa-rows-label {\n          font-size: 12px;\n          font-weight: 500;\n          color: var(--lion-text-muted);\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n        }\n\n        .wa-list-row {\n          display: flex;\n          gap: 8px;\n          align-items: flex-start;\n        }\n\n        .wa-row-content {\n          flex: 1;\n          display: flex;\n          flex-direction: column;\n          gap: 6px;\n        }\n\n        .wa-btn-remove-row {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n          border: 1px solid var(--lion-error);\n          border-radius: 4px;\n          width: 32px;\n          height: 32px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          font-size: 14px;\n          transition: all 0.2s;\n          flex-shrink: 0;\n          margin-top: 2px;\n        }\n\n        .wa-btn-remove-row:hover {\n          background: var(--lion-error);\n          color: var(--lion-bg-primary);\n        }\n\n        .wa-btn-add-row,\n        .wa-btn-add-section {\n          padding: 8px 16px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-medium);\n          border-radius: 6px;\n          font-size: 14px;\n          font-weight: 500;\n          color: var(--lion-primary);\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .wa-btn-add-row:hover,\n        .wa-btn-add-section:hover {\n          background: var(--lion-primary-light);\n          border-color: var(--lion-primary);\n        }\n      "))},zn=({buttonsData:e,onChange:t})=>{const n=e||{buttons:[{displayType:"quick_reply",displayText:""}]},r=(e,a,r)=>{const o=[...n.buttons];o[e]={...o[e],[a]:r},t({buttons:o})};return a.createElement("div",{className:"wa-buttons-config-field"},a.createElement("label",{className:"wa-form-label required"},(0,s.t)("templates.form.buttons")||"Buttons"),a.createElement("div",{className:"wa-buttons-list"},n.buttons.map((e,o)=>a.createElement("div",{key:o,className:"wa-button-card"},a.createElement("div",{className:"wa-button-header"},a.createElement("span",{className:"wa-button-icon"},(e=>{switch(e){case"url":return"🔗";case"call":return"📞";case"quick_reply":return"💬";default:return"🔘"}})(e.displayType)),a.createElement("select",{className:"wa-button-type-select",value:e.displayType,onChange:e=>((e,a)=>{const r=[...n.buttons];r[e]={displayType:a,displayText:r[e].displayText,linkUrl:"url"===a?"":void 0,phoneNumber:"call"===a?"":void 0},t({buttons:r})})(o,e.target.value)},a.createElement("option",{value:"quick_reply"},"Quick Reply"),a.createElement("option",{value:"url"},"URL Button"),a.createElement("option",{value:"call"},"Call Button")),n.buttons.length>1&&a.createElement("button",{type:"button",className:"wa-btn-remove-button",onClick:()=>(e=>{if(n.buttons.length<=1)return void alert("At least one button is required");const a=n.buttons.filter((t,n)=>n!==e);t({buttons:a})})(o),title:"Remove button"},"✕")),a.createElement("div",{className:"wa-button-fields"},a.createElement("input",{type:"text",className:"wa-form-input",value:e.displayText,onChange:e=>r(o,"displayText",e.target.value),placeholder:"Button Text",maxLength:20}),"url"===e.displayType&&a.createElement("input",{type:"url",className:"wa-form-input",value:e.linkUrl||"",onChange:e=>r(o,"linkUrl",e.target.value),placeholder:"https://example.com"}),"call"===e.displayType&&a.createElement("input",{type:"tel",className:"wa-form-input",value:e.phoneNumber||"",onChange:e=>r(o,"phoneNumber",e.target.value),placeholder:"+1234567890"}))))),n.buttons.length<Nn.Mb.MAX_BUTTONS&&a.createElement("button",{type:"button",className:"wa-btn-add-button",onClick:()=>{n.buttons.length>=Nn.Mb.MAX_BUTTONS?alert(`Maximum ${Nn.Mb.MAX_BUTTONS} buttons allowed`):t({buttons:[...n.buttons,{displayType:"quick_reply",displayText:""}]})}},"+ ",(0,s.t)("templates.form.addButton")||"Add Button"),a.createElement("small",{className:"wa-form-hint"},(0,s.t)("templates.form.buttonsHint")||`Maximum ${Nn.Mb.MAX_BUTTONS} buttons allowed`),a.createElement("style",null,"\n        .wa-buttons-config-field {\n          margin-top: 16px;\n          padding: 16px;\n          background: var(--lion-bg-secondary);\n          border-radius: 8px;\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .wa-buttons-list {\n          display: flex;\n          flex-direction: column;\n          gap: 12px;\n          margin-bottom: 12px;\n        }\n\n        .wa-button-card {\n          padding: 12px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 6px;\n        }\n\n        .wa-button-header {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          margin-bottom: 10px;\n        }\n\n        .wa-button-icon {\n          font-size: 20px;\n          line-height: 1;\n        }\n\n        .wa-button-type-select {\n          flex: 1;\n          padding: 6px 10px;\n          border: 1px solid var(--lion-border-medium);\n          border-radius: 4px;\n          font-size: 14px;\n          outline: none;\n        }\n\n        .wa-button-type-select:focus {\n          border-color: var(--lion-primary);\n        }\n\n        .wa-btn-remove-button {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n          border: 1px solid var(--lion-error);\n          border-radius: 4px;\n          width: 28px;\n          height: 28px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          font-size: 14px;\n          transition: all 0.2s;\n          flex-shrink: 0;\n        }\n\n        .wa-btn-remove-button:hover {\n          background: var(--lion-error);\n          color: var(--lion-bg-primary);\n        }\n\n        .wa-button-fields {\n          display: flex;\n          flex-direction: column;\n          gap: 8px;\n        }\n\n        .wa-btn-add-button {\n          padding: 8px 16px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-medium);\n          border-radius: 6px;\n          font-size: 14px;\n          font-weight: 500;\n          color: var(--lion-primary);\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .wa-btn-add-button:hover {\n          background: var(--lion-primary-light);\n          border-color: var(--lion-primary);\n        }\n      "))},On=({selectedContacts:e,onChange:t})=>{const[n,r]=(0,a.useState)(!1),[o,i]=(0,a.useState)(""),[l,c]=(0,a.useState)([]),[d,m]=(0,a.useState)(!1),p=l.filter(e=>e.name.toLowerCase().includes(o.toLowerCase()));return a.createElement("div",{className:"wa-contact-selection-field"},a.createElement("label",{className:"wa-form-label"},(0,s.t)("templates.form.selectContacts")||"Select Contacts"),e.length>0&&a.createElement("div",{className:"wa-selected-contacts"},e.map(n=>a.createElement("div",{key:n.id,className:"wa-contact-chip"},a.createElement("span",{className:"wa-contact-name"},n.name),a.createElement("button",{type:"button",onClick:()=>{return a=n.id,void t(e.filter(e=>e.id!==a));var a},className:"wa-remove-contact"},"✕")))),a.createElement("div",{className:"wa-contact-actions"},a.createElement("button",{type:"button",className:"wa-btn-select-contacts",onClick:()=>{(async()=>{m(!0);try{const e=new Promise((e,t)=>{const n=a=>{const r=a.detail;document.removeEventListener("waContactsResponse",n),r.success&&r.contacts?e(r.contacts):t(new Error(r.error||"Failed to fetch contacts"))};document.addEventListener("waContactsResponse",n),setTimeout(()=>{document.removeEventListener("waContactsResponse",n),t(new Error("Contact fetch timeout"))},1e4)});document.dispatchEvent(new CustomEvent("getWAContacts"));const t=await e;c(t)}catch(e){c([])}finally{m(!1)}})(),r(!0)}},"📇 ",(0,s.t)("templates.form.selectFromContacts")||"Select from Contacts"),a.createElement("button",{type:"button",className:"wa-btn-add-manual",onClick:()=>{const n=prompt("Enter contact name:"),a=prompt("Enter phone number (with country code):");if(n&&a){const r=a.replace(/\D/g,"")+"@c.us";t([...e,{id:r,name:n,selected:!0}])}}},"+ ",(0,s.t)("templates.form.addManually")||"Add Manually")),n&&a.createElement("div",{className:"wa-modal-overlay",onClick:()=>r(!1)},a.createElement("div",{className:"wa-modal-content",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"wa-modal-header"},a.createElement("h3",null,(0,s.t)("templates.form.selectContacts")||"Select Contacts"),a.createElement("button",{onClick:()=>r(!1)},"✕")),a.createElement("input",{type:"text",className:"wa-search-contacts",placeholder:"Search contacts...",value:o,onChange:e=>i(e.target.value)}),a.createElement("div",{className:"wa-contacts-list"},d?a.createElement("div",{className:"wa-loading"},"Loading contacts..."):p.length>0?p.map(n=>a.createElement("div",{key:n.id,className:"wa-contact-item"},a.createElement("input",{type:"checkbox",checked:e.some(e=>e.id===n.id),onChange:()=>(n=>{const a=e.some(e=>e.id===n.id);t(a?e.filter(e=>e.id!==n.id):[...e,{...n,selected:!0}])})(n)}),a.createElement("span",null,n.name))):a.createElement("div",{className:"wa-empty"},'No contacts available. Use "Add Manually" to add contacts.')),a.createElement("button",{className:"wa-modal-done",onClick:()=>r(!1)},"Done"))),a.createElement("style",null,"\n        .wa-contact-selection-field {\n          margin-top: 16px;\n          padding: 16px;\n          background: var(--lion-bg-secondary);\n          border-radius: 8px;\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .wa-selected-contacts {\n          display: flex;\n          flex-wrap: wrap;\n          gap: 8px;\n          margin-bottom: 12px;\n        }\n\n        .wa-contact-chip {\n          display: inline-flex;\n          align-items: center;\n          gap: 6px;\n          padding: 6px 12px;\n          background: var(--lion-info-light);\n          border: 1px solid var(--lion-info);\n          border-radius: 16px;\n          font-size: 14px;\n          color: var(--lion-info);\n        }\n\n        .wa-remove-contact {\n          background: none;\n          border: none;\n          color: var(--lion-error);\n          cursor: pointer;\n          font-size: 14px;\n          padding: 0;\n          line-height: 1;\n        }\n\n        .wa-contact-actions {\n          display: flex;\n          gap: 8px;\n        }\n\n        .wa-btn-select-contacts,\n        .wa-btn-add-manual {\n          padding: 8px 16px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-medium);\n          border-radius: 6px;\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .wa-btn-select-contacts:hover,\n        .wa-btn-add-manual:hover {\n          background: var(--lion-primary-light);\n          border-color: var(--lion-primary);\n        }\n\n        .wa-modal-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.7);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 10002;\n        }\n\n        .wa-modal-content {\n          background: var(--lion-bg-primary);\n          border-radius: 12px;\n          width: 90%;\n          max-width: 500px;\n          max-height: 80vh;\n          display: flex;\n          flex-direction: column;\n        }\n\n        .wa-modal-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 16px 20px;\n          border-bottom: 1px solid var(--lion-border-light);\n        }\n\n        .wa-modal-header h3 {\n          margin: 0;\n          font-size: 18px;\n        }\n\n        .wa-modal-header button {\n          background: none;\n          border: none;\n          font-size: 24px;\n          cursor: pointer;\n          color: var(--lion-text-muted);\n        }\n\n        .wa-search-contacts {\n          margin: 16px 20px;\n          padding: 10px;\n          border: 1px solid var(--lion-border-medium);\n          border-radius: 6px;\n          font-size: 14px;\n        }\n\n        .wa-contacts-list {\n          flex: 1;\n          overflow-y: auto;\n          padding: 0 20px;\n        }\n\n        .wa-contact-item {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          padding: 12px;\n          border-bottom: 1px solid var(--lion-bg-tertiary);\n          cursor: pointer;\n        }\n\n        .wa-contact-item:hover {\n          background: var(--lion-bg-secondary);\n        }\n\n        .wa-modal-done {\n          margin: 16px 20px;\n          padding: 10px;\n          background: var(--lion-primary);\n          color: var(--lion-bg-primary);\n          border: none;\n          border-radius: 6px;\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n        }\n\n        .wa-loading,\n        .wa-empty {\n          text-align: center;\n          padding: 40px 20px;\n          color: var(--lion-text-muted);\n        }\n      "))},Wn=({selectedProducts:e,onChange:t})=>{const[n,r]=(0,a.useState)(!1),[o,i]=(0,a.useState)(""),[l,c]=(0,a.useState)([]),[d,m]=(0,a.useState)(!1),p=l.filter(e=>e.name.toLowerCase().includes(o.toLowerCase()));return a.createElement("div",{className:"wa-product-selection-field"},a.createElement("label",{className:"wa-form-label"},(0,s.t)("templates.form.selectProducts")||"Select Products"),e.length>0&&a.createElement("div",{className:"wa-selected-products"},e.map((n,r)=>{const[o]=n.split("$@$");return a.createElement("div",{key:r,className:"wa-product-chip"},a.createElement("span",null,"🛍️ ",o),a.createElement("button",{type:"button",onClick:()=>(n=>{t(e.filter(e=>e!==n))})(n),className:"wa-remove-product"},"✕"))})),a.createElement("button",{type:"button",className:"wa-btn-select-products",onClick:()=>{(async()=>{m(!0);try{const e=new Promise((e,t)=>{const n=a=>{const r=a.detail;document.removeEventListener("waCatalogProductsResponse",n),r.success&&r.products?e(r.products):t(new Error(r.error||"Failed to fetch products"))};document.addEventListener("waCatalogProductsResponse",n),setTimeout(()=>{document.removeEventListener("waCatalogProductsResponse",n),t(new Error("Product fetch timeout"))},1e4)});document.dispatchEvent(new CustomEvent("getWACatalogProducts"));const t=await e;c(t)}catch(e){c([])}finally{m(!1)}})(),r(!0)}},"🛍️ ",(0,s.t)("templates.form.selectProducts")||"Select Products"),a.createElement("small",{className:"wa-form-hint"},(0,s.t)("templates.form.productHint")||"Products from your WhatsApp Business catalog. You can add multiple products."),n&&a.createElement("div",{className:"wa-modal-overlay",onClick:()=>r(!1)},a.createElement("div",{className:"wa-modal-content",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"wa-modal-header"},a.createElement("h3",null,(0,s.t)("templates.form.selectProducts")||"Select Products"),a.createElement("button",{onClick:()=>r(!1)},"✕")),a.createElement("input",{type:"text",className:"wa-search-products",placeholder:"Search products...",value:o,onChange:e=>i(e.target.value)}),a.createElement("div",{className:"wa-products-list"},d?a.createElement("div",{className:"wa-loading"},"Loading products..."):p.length>0?p.map(n=>{const r=`${n.name}$@$${n.retailerId||n.id}`,o=e.includes(r);return a.createElement("div",{key:n.id,className:"wa-product-item"},a.createElement("input",{type:"checkbox",checked:o,onChange:()=>(n=>{const a=`${n.name}$@$${n.retailerId||n.id}`,r=e.includes(a);t(r?e.filter(e=>e!==a):[...e,a])})(n)}),a.createElement("div",{className:"wa-product-info"},a.createElement("div",{className:"wa-product-name"},n.name),n.price&&a.createElement("div",{className:"wa-product-price"},n.price),n.description&&a.createElement("div",{className:"wa-product-desc"},n.description.substring(0,60),"...")))}):a.createElement("div",{className:"wa-empty"},'No products available. Use "Add Manually" to add products or set up your WhatsApp Business catalog.')),a.createElement("button",{className:"wa-modal-done",onClick:()=>r(!1)},"Done"))),a.createElement("style",null,"\n        .wa-product-selection-field {\n          margin-top: 16px;\n          padding: 16px;\n          background: var(--lion-bg-secondary);\n          border-radius: 8px;\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .wa-selected-products {\n          display: flex;\n          flex-wrap: wrap;\n          gap: 8px;\n          margin-bottom: 12px;\n        }\n\n        .wa-product-chip {\n          display: inline-flex;\n          align-items: center;\n          gap: 6px;\n          padding: 6px 12px;\n          background: var(--lion-warning-light);\n          border: 1px solid var(--lion-warning);\n          border-radius: 16px;\n          font-size: 14px;\n          color: var(--lion-primary-dark);\n        }\n\n        .wa-remove-product {\n          background: none;\n          border: none;\n          color: var(--lion-error);\n          cursor: pointer;\n          font-size: 14px;\n          padding: 0;\n          line-height: 1;\n        }\n\n        .wa-btn-select-products {\n          padding: 8px 16px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-medium);\n          border-radius: 6px;\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s;\n          margin-bottom: 8px;\n        }\n\n        .wa-btn-select-products:hover {\n          background: var(--lion-primary-light);\n          border-color: var(--lion-primary);\n        }\n\n        .wa-modal-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.7);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 10002;\n        }\n\n        .wa-modal-content {\n          background: var(--lion-bg-primary);\n          border-radius: 12px;\n          width: 90%;\n          max-width: 600px;\n          max-height: 80vh;\n          display: flex;\n          flex-direction: column;\n        }\n\n        .wa-modal-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 16px 20px;\n          border-bottom: 1px solid var(--lion-border-light);\n        }\n\n        .wa-modal-header h3 {\n          margin: 0;\n          font-size: 18px;\n        }\n\n        .wa-modal-header button {\n          background: none;\n          border: none;\n          font-size: 24px;\n          cursor: pointer;\n          color: var(--lion-text-muted);\n        }\n\n        .wa-search-products {\n          margin: 16px 20px;\n          padding: 10px;\n          border: 1px solid var(--lion-border-medium);\n          border-radius: 6px;\n          font-size: 14px;\n        }\n\n        .wa-products-list {\n          flex: 1;\n          overflow-y: auto;\n          padding: 0 20px;\n        }\n\n        .wa-product-item {\n          display: flex;\n          align-items: flex-start;\n          gap: 12px;\n          padding: 12px;\n          border-bottom: 1px solid var(--lion-bg-tertiary);\n          cursor: pointer;\n        }\n\n        .wa-product-item:hover {\n          background: var(--lion-bg-secondary);\n        }\n\n        .wa-product-info {\n          flex: 1;\n        }\n\n        .wa-product-name {\n          font-weight: 500;\n          font-size: 14px;\n          color: var(--lion-text-primary);\n          margin-bottom: 4px;\n        }\n\n        .wa-product-price {\n          font-size: 13px;\n          color: var(--lion-primary);\n          font-weight: 600;\n          margin-bottom: 4px;\n        }\n\n        .wa-product-desc {\n          font-size: 12px;\n          color: var(--lion-text-muted);\n        }\n\n        .wa-modal-done {\n          margin: 16px 20px;\n          padding: 10px;\n          background: var(--lion-primary);\n          color: var(--lion-bg-primary);\n          border: none;\n          border-radius: 6px;\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n        }\n\n        .wa-loading,\n        .wa-empty {\n          text-align: center;\n          padding: 40px 20px;\n          color: var(--lion-text-muted);\n        }\n      "))},qn={chatgpt:["gpt-4o-mini","gpt-4o","gpt-4-turbo","gpt-3.5-turbo"],gemini:["gemini-2.5-flash","gemini-2.5-pro","gemini-1.5-flash","gemini-1.5-pro"],deepseek:["deepseek-chat","deepseek-reasoner"]},Hn=e=>qn[e]?.[0]||"",jn="wa_ai_settings",Vn={provider:"chatgpt",apiKey:"",enabled:!1,model:"",shortcuts:{summarize:"Alt+S",translate:"Alt+T",spelling:"Alt+P",enlarge:"Alt+E",friendly:"Alt+F",formal:"Alt+O",search:"Alt+Q"}};class Gn{static getSettings(){try{const e=localStorage.getItem(jn);if(e){const t=JSON.parse(e);return{...Vn,...t}}}catch(e){}return Vn}static async getSettingsAsync(){try{const e=(await Promise.resolve().then(r.t.bind(r,6815,23))).default,t=await e.storage.local.get(jn);if(t[jn]){const e="string"==typeof t[jn]?JSON.parse(t[jn]):t[jn];return{...Vn,...e}}}catch(e){}return Vn}static async isEnabledAsync(){const e=await this.getSettingsAsync();return e.enabled&&!!e.apiKey}static saveSettings(e){try{const t={...this.getSettings(),...e};localStorage.setItem(jn,JSON.stringify(t)),this.syncToBrowserStorage(t)}catch(e){}}static async syncToBrowserStorage(e){try{const t=(await Promise.resolve().then(r.t.bind(r,6815,23))).default;await t.storage.local.set({[jn]:e})}catch(e){}}static getApiKey(){return this.getSettings().apiKey}static getProvider(){return this.getSettings().provider}static isEnabled(){const e=this.getSettings();return e.enabled&&!!e.apiKey}static getShortcuts(){return this.getSettings().shortcuts}static updateShortcut(e,t){const n=this.getSettings();n.shortcuts[e]=t,this.saveSettings(n)}}const Kn=[{code:"en",name:"English"},{code:"hi",name:"Hindi"},{code:"es",name:"Spanish"},{code:"fr",name:"French"},{code:"de",name:"German"},{code:"it",name:"Italian"},{code:"pt",name:"Portuguese"},{code:"ru",name:"Russian"},{code:"ja",name:"Japanese"},{code:"ko",name:"Korean"},{code:"zh",name:"Chinese"},{code:"ar",name:"Arabic"},{code:"bn",name:"Bengali"},{code:"gu",name:"Gujarati"},{code:"mr",name:"Marathi"},{code:"ta",name:"Tamil"},{code:"te",name:"Telugu"},{code:"kn",name:"Kannada"},{code:"ml",name:"Malayalam"},{code:"pa",name:"Punjabi"},{code:"ur",name:"Urdu"},{code:"th",name:"Thai"},{code:"vi",name:"Vietnamese"},{code:"id",name:"Indonesian"},{code:"ms",name:"Malay"},{code:"tr",name:"Turkish"},{code:"pl",name:"Polish"},{code:"nl",name:"Dutch"},{code:"sv",name:"Swedish"},{code:"da",name:"Danish"},{code:"no",name:"Norwegian"},{code:"fi",name:"Finnish"},{code:"el",name:"Greek"},{code:"he",name:"Hebrew"},{code:"uk",name:"Ukrainian"},{code:"cs",name:"Czech"},{code:"hu",name:"Hungarian"},{code:"ro",name:"Romanian"}];let $n="pt";const Yn=e=>{$n=e},Xn=()=>{try{const e=Kn.find(e=>e.code===$n);return e?.name||"English"}catch(e){return"English"}};class Jn{static async processText(e,t,n){const a=n?.useAsyncSettings?await Gn.getSettingsAsync():Gn.getSettings();if(!a.enabled||!a.apiKey)return{success:!1,error:"AI is not enabled or API key is missing"};const r=this.buildPrompt(e,t,n);try{switch(a.provider){case"chatgpt":return await this.callChatGPT(a.apiKey,r);case"gemini":return await this.callGemini(a.apiKey,r);case"deepseek":return await this.callDeepSeek(a.apiKey,r);default:return{success:!1,error:"Unknown AI provider"}}}catch(e){return{success:!1,error:e instanceof Error?e.message:"Unknown error"}}}static buildPrompt(e,t,n){switch(t){case"summarize":return`Summarize the following text concisely:\n\n${e}`;case"conversationSummary":{const t=n?.targetLanguage||Xn()||"Portuguese";return`You are summarizing a real WhatsApp conversation between two people for a busy professional who needs a clear recap.\n\nThe conversation is given below. Lines starting with "Me:" are from the user (you are summarizing for them). Lines starting with "User:" are from the other person.\n\nIf a section labelled "LATEST_INCOMING_MESSAGES_FROM_CONTACT:" appears at the very end after a "---" separator, those are the most recent messages the OTHER person (not "Me") sent — preferring everything they sent today; if nothing today, the single most recent prior message. Your "Suggested Next Step" MUST be a direct reply addressing those exact messages, never your own ("Me:") messages, never the broader conversation theme.\n\nWrite the summary in ${t}. Be specific — quote exact names, numbers, dates, prices, products, places, or commitments that appear in the conversation. Do not be generic. Do not invent details that aren't in the messages.\n\nStructure your reply EXACTLY like this (translate the section labels to ${t}):\n\n📋 Overview\n2-3 sentence summary of the whole conversation in plain prose.\n\n💬 Key Points\n- Bullet 1 (specific topic with concrete details)\n- Bullet 2\n- Bullet 3\n(4-6 bullets total. Each bullet must mention a concrete name/number/fact, not vague words like "discussed something".)\n\n✅ Decisions & Commitments\n- Any decisions made, prices agreed, dates set, or things either side committed to.\n- If none, write: "None"\n\n❓ Open / Pending\n- Unanswered questions or pending action items.\n- If none, write: "None"\n\n🎯 Suggested Next Step\nA direct, ready-to-send reply addressing the LATEST_INCOMING_MESSAGES_FROM_CONTACT block (if provided). It must answer/react to THOSE specific messages — never to your own ("Me:") messages, never to the broader conversation theme. Keep it short and actionable (1-2 sentences) and write it as if the user can send it as-is. If no LATEST_INCOMING_MESSAGES_FROM_CONTACT block is present, suggest one short next action based on what the contact most recently said in the conversation.\n\nRules:\n- Output language MUST be ${t} (including the section labels).\n- Do NOT add any preamble like "Here is the summary".\n- Do NOT wrap your output in code blocks or markdown headings.\n- Use the exact emoji markers shown above for section starts.\n- If the conversation is too short or has no real content, say so honestly in 1 line instead of inventing.\n\nConversation:\n${e}`}case"translate":return`Translate the following text to ${n?.targetLanguage||Xn()||"Portuguese"}. Only provide the translation, no explanations:\n\n${e}`;case"spelling":return`Correct any spelling and grammar mistakes in the following text. Only provide the corrected text, no explanations:\n\n${e}`;case"enlarge":return`Expand and elaborate on the following text while maintaining its meaning. Make it more detailed:\n\n${e}`;case"friendly":return`Rewrite the following text in a friendly, warm, and casual tone. Only provide the rewritten text:\n\n${e}`;case"formal":return`Rewrite the following text in a formal, professional tone. Only provide the rewritten text:\n\n${e}`;case"search":return`Provide a brief, helpful response about: ${e}`;case"suggest":return`Based on the following conversation context, suggest a short, appropriate reply (1-2 sentences):\n\n${e}`;case"regenerate":const t=n?.targetLanguage||Xn()||"Portuguese";return`Rewrite the following message in ${t} with fresh wording while keeping the EXACT same meaning, intent, and tone. Do not add or remove any information. The output MUST be in ${t}. Only provide the rewritten message, no explanations:\n\n${e}`;default:return e}}static async callChatGPT(e,t){const n=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({model:"gpt-3.5-turbo",messages:[{role:"system",content:"You are a helpful assistant. Provide concise, direct responses without unnecessary explanations."},{role:"user",content:t}],max_tokens:4000,temperature:.7})});if(!n.ok){const e=await n.json();throw new Error(e.error?.message||"ChatGPT API error")}const a=await n.json(),r=a.choices?.[0]?.message?.content?.trim();return{success:!0,result:r}}static async callGemini(e,t){const n=await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contents:[{parts:[{text:t}]}],generationConfig:{maxOutputTokens:4000,temperature:.7}})});if(!n.ok){const e=await n.json().catch(()=>({}));throw new Error(e.error?.message||`Gemini API error: ${n.status}`)}const a=await n.json(),r=a.candidates?.[0]?.content?.parts?.[0]?.text?.trim();if(!r)throw new Error("Gemini returned empty response. Check your API key and quota.");return{success:!0,result:r}}static async callDeepSeek(e,t){const n=await fetch("https://api.deepseek.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({model:"deepseek-chat",messages:[{role:"system",content:"You are a helpful assistant. Provide concise, direct responses without unnecessary explanations."},{role:"user",content:t}],max_tokens:4000,temperature:.7})});if(!n.ok){const e=await n.json();throw new Error(e.error?.message||"DeepSeek API error")}const a=await n.json(),r=a.choices?.[0]?.message?.content?.trim();return{success:!0,result:r}}static async translate(e,t,n){return this.processText(e,"translate",{targetLanguage:t,useAsyncSettings:n})}static async summarize(e,t){return this.processText(e,"summarize",{useAsyncSettings:t})}static async summarizeConversation(e,t,n){return this.processText(e,"conversationSummary",{targetLanguage:t,useAsyncSettings:n})}static async checkSpelling(e,t){return this.processText(e,"spelling",{useAsyncSettings:t})}static async enlarge(e,t){return this.processText(e,"enlarge",{useAsyncSettings:t})}static async makeFriendly(e,t){return this.processText(e,"friendly",{useAsyncSettings:t})}static async makeFormal(e,t){return this.processText(e,"formal",{useAsyncSettings:t})}static async search(e,t){return this.processText(e,"search",{useAsyncSettings:t})}static async suggest(e,t){return this.processText(e,"suggest",{useAsyncSettings:t})}static async regenerate(e,t,n){return this.processText(e,"regenerate",{targetLanguage:t,useAsyncSettings:n})}}const Qn=({text:e,onRegenerate:t,disabled:n=!1,className:r="",style:o={},size:i="medium",variant:l="button",language:c})=>{const[d,m]=(0,a.useState)(!1),[p,u]=(0,a.useState)(null),[,g]=(0,a.useState)(0),[h,b]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{const e=()=>{g(e=>e+1)};return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{const e=()=>{const e=_();b("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]);const f={...{display:"inline-flex",alignItems:"center",gap:"6px",border:"none",borderRadius:"6px",cursor:n||d?"not-allowed":"pointer",fontWeight:500,transition:"all 0.2s ease",opacity:n?.5:1,...{small:{padding:"4px 8px",fontSize:"12px"},medium:{padding:"6px 12px",fontSize:"13px"},large:{padding:"8px 16px",fontSize:"14px"}}[i]},...{button:{background:"var(--lion-primary)",color:"#ffffff",boxShadow:"0 2px 4px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.3)"},icon:{background:"transparent",color:h?"#ffffff":"var(--lion-primary)",padding:"6px"},toolbar:{background:h?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.2)":"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.1)",color:h?"#ffffff":"var(--lion-primary)",border:h?"1px solid rgba(var(--lion-primary-rgb, 37, 99, 235), 0.5)":"1px solid rgba(var(--lion-primary-rgb, 37, 99, 235), 0.3)"}}[l],...o};return a.createElement(a.Fragment,null,a.createElement("style",null,"\n          @keyframes spin {\n            from { transform: rotate(0deg); }\n            to { transform: rotate(360deg); }\n          }\n          .ai-regenerate-btn:hover:not(:disabled) {\n            transform: translateY(-1px);\n            box-shadow: 0 4px 8px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.4) !important;\n          }\n          .ai-regenerate-btn:active:not(:disabled) {\n            transform: translateY(0);\n          }\n        "),a.createElement("button",{className:`ai-regenerate-btn ${r}`,style:f,onClick:async()=>{if(e.trim()&&!d&&!n){if(!Gn.isEnabled())return u((0,s.t)("ai.notEnabled")),void setTimeout(()=>u(null),3e3);m(!0),u(null);try{const n=await Jn.regenerate(e,c);n.success&&n.result?t(n.result):(u(n.error||(0,s.t)("ai.failedToRegenerate")),setTimeout(()=>u(null),3e3))}catch(e){u((0,s.t)("ai.failedToRegenerateMessage")),setTimeout(()=>u(null),3e3)}finally{m(!1)}}},disabled:n||d||!e.trim(),title:p||(0,s.t)("ai.regenerateWithAI"),type:"button"},d?a.createElement(()=>a.createElement("svg",{width:"small"===i?12:"medium"===i?14:16,height:"small"===i?12:"medium"===i?14:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{animation:"spin 1s linear infinite"}},a.createElement("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.3"}),a.createElement("path",{d:"M12 2a10 10 0 0 1 10 10"})),null):a.createElement(()=>a.createElement("svg",{width:"small"===i?12:"medium"===i?14:16,height:"small"===i?12:"medium"===i?14:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M12 3l1.5 5.5L19 10l-5.5 1.5L12 17l-1.5-5.5L5 10l5.5-1.5L12 3z"}),a.createElement("path",{d:"M19 15l.5 2 2 .5-2 .5-.5 2-.5-2-2-.5 2-.5.5-2z"}),a.createElement("path",{d:"M5 19l.5 1 1 .5-1 .5-.5 1-.5-1-1-.5 1-.5.5-1z"})),null),"icon"!==l&&a.createElement("span",null,d?(0,s.t)("ai.regenerating"):(0,s.t)("ai.regenerate"))))},Zn=({messages:e,onChange:t,dynamicValueData:n})=>{const[r,o]=(0,a.useState)(new Set(e.map(e=>e.id))),i=[{value:"none",label:(0,s.t)("templates.attachmentType.none")||"Message"},{value:"image/video",label:(0,s.t)("templates.attachmentType.imageVideo")||"Message + Images/Videos"},{value:"document",label:(0,s.t)("templates.attachmentType.document")||"Message + Documents"},{value:"audio",label:(0,s.t)("templates.attachmentType.audio")||"Message + Audio"},{value:"contact",label:(0,s.t)("templates.attachmentType.contact")||"Message + Contacts"},{value:"poll",label:(0,s.t)("templates.attachmentType.poll")||"Message + Poll"},{value:"list",label:(0,s.t)("templates.attachmentType.list")||"Message + List"},{value:"product",label:(0,s.t)("templates.attachmentType.product")||"Message + Product"}],l=()=>{const n=(0,Nn.tp)();t([...e,n]),o(e=>new Set([...e,n.id]))},c=(n,a)=>{t(e.map(e=>e.id===n?{...e,...a}:e))},d=(t,n)=>{const a=document.getElementById(`message-textarea-${t}`);if(!a)return;const r=e.find(e=>e.id===t);if(!r)return;const o=a.selectionStart||0,i=r.message.substring(0,o),s=r.message.substring(o);c(t,{message:i+n+" "+s}),setTimeout(()=>{a.focus(),a.setSelectionRange(o+n.length+1,o+n.length+1)},0)},m=(t,n,a)=>{const r=document.getElementById(`message-textarea-${t}`);if(!r)return;const o=e.find(e=>e.id===t);if(!o)return;const i=r.selectionStart||0,s=r.selectionEnd||0,l=o.message.substring(i,s),d=o.message.substring(0,i),m=o.message.substring(s);c(t,{message:d+n+l+a+m}),setTimeout(()=>{r.focus(),r.setSelectionRange(i+n.length,s+n.length)},0)};return a.createElement("div",{className:"wa-multi-message-field"},a.createElement("div",{className:"wa-multi-message-header"},a.createElement("span",{className:"wa-multi-message-title"},(0,s.t)("templates.messages")||"Messages"," (",e.length,")"),a.createElement("button",{type:"button",className:"wa-btn-add-message",onClick:l},a.createElement("span",null,"+")," ",(0,s.t)("templates.addMessage")||"Add Message")),a.createElement("div",{className:"wa-message-cards"},e.map((l,p)=>{const u=r.has(l.id),g=p===e.length-1;return a.createElement("div",{key:l.id,className:"wa-message-card"},a.createElement("div",{className:"wa-message-card-header",onClick:()=>{return e=l.id,void o(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});var e}},a.createElement("span",{className:"wa-message-number"},(0,s.t)("templates.messageNumber")?.replace("{number}",String(p+1))||`Message ${p+1}`),a.createElement("div",{className:"wa-message-card-actions"},a.createElement("button",{type:"button",className:"wa-btn-expand",title:u?(0,s.t)("templates.collapseMessage")||"Collapse":(0,s.t)("templates.expandMessage")||"Expand"},u?"▼":"▶"),a.createElement("button",{type:"button",className:"wa-btn-delete-message",onClick:n=>{var a;n.stopPropagation(),a=l.id,e.length<=1||(t(e.filter(e=>e.id!==a)),o(e=>{const t=new Set(e);return t.delete(a),t}))},disabled:e.length<=1,title:(0,s.t)("templates.deleteMessage")||"Delete Message"},"🗑️"))),u&&a.createElement("div",{className:"wa-message-card-body"},a.createElement("div",{className:"wa-form-group"},a.createElement("label",{className:"wa-form-label"},(0,s.t)("templates.form.templateType")||"Template Type"),a.createElement("select",{className:"wa-form-select",value:l.attachmentType,onChange:e=>((e,t)=>{const n={attachmentType:t};"image/video"!==t&&"document"!==t&&"audio"!==t&&(n.attachments=[]),"contact"!==t&&(n.selectedContact=[]),"poll"!==t&&(n.pollData=null),"list"!==t&&(n.listData=null),"product"!==t&&(n.selectedProducts=[]),"buttons"!==t&&(n.buttonsData=null),c(e,n)})(l.id,e.target.value)},i.map(e=>a.createElement("option",{key:e.value,value:e.value},e.label)))),a.createElement("div",{className:"wa-form-group"},a.createElement("label",{className:"wa-form-label required"},(0,s.t)("templates.form.message")||"Message"),a.createElement("div",{className:"wa-message-toolbar"},a.createElement("button",{type:"button",onClick:()=>m(l.id,"*","*"),title:"Bold",className:"wa-toolbar-btn"},a.createElement("strong",null,"B")),a.createElement("button",{type:"button",onClick:()=>m(l.id,"_","_"),title:"Italic",className:"wa-toolbar-btn"},a.createElement("em",null,"I")),a.createElement("button",{type:"button",onClick:()=>m(l.id,"~","~"),title:"Strikethrough",className:"wa-toolbar-btn"},a.createElement("s",null,"S")),a.createElement("button",{type:"button",onClick:()=>m(l.id,"```","```"),title:"Code",className:"wa-toolbar-btn"},"</>"),a.createElement("div",{style:{marginLeft:"auto"}},a.createElement(Qn,{text:l.message,onRegenerate:e=>c(l.id,{message:e}),size:"small",variant:"toolbar",language:Xn()}))),a.createElement("textarea",{id:`message-textarea-${l.id}`,className:"wa-form-textarea",value:l.message,onChange:e=>c(l.id,{message:e.target.value}),placeholder:(0,s.t)("templates.form.messagePlaceholder")||"Type your message here...",rows:4,maxLength:Nn.Mb.MAX_MESSAGE_LENGTH}),a.createElement("div",{className:"wa-message-counter"},l.message.length," / ",Nn.Mb.MAX_MESSAGE_LENGTH),a.createElement("div",{className:"wa-variable-buttons"},a.createElement("small",{className:"wa-form-hint"},(0,s.t)("templates.form.insertVariable")||"Click to insert variable:"),a.createElement("div",{className:"wa-variable-list"},Nn.dv.map(e=>a.createElement("button",{key:e,type:"button",onClick:()=>d(l.id,e),className:"wa-variable-btn"},e)),n.map((e,t)=>a.createElement("button",{key:t,type:"button",onClick:()=>d(l.id,e),className:"wa-variable-btn"},e))))),(e=>{const t=e.attachmentType;if("none"===t)return null;switch(t){case"image/video":case"document":case"audio":return a.createElement(Ln,{attachments:e.attachments||[],attachmentType:t,onChange:t=>c(e.id,{attachments:t})});case"contact":return a.createElement(On,{selectedContacts:e.selectedContact||[],onChange:t=>c(e.id,{selectedContact:t})});case"poll":return a.createElement(Un,{pollData:e.pollData||null,onChange:t=>c(e.id,{pollData:t})});case"list":return a.createElement(Fn,{listData:e.listData||null,onChange:t=>c(e.id,{listData:t})});case"product":return a.createElement(Wn,{selectedProducts:e.selectedProducts||[],onChange:t=>c(e.id,{selectedProducts:t})});case"buttons":return a.createElement(zn,{buttonsData:e.buttonsData||null,onChange:t=>c(e.id,{buttonsData:t})});default:return null}})(l),!g&&a.createElement("div",{className:"wa-form-group wa-delay-group"},a.createElement("label",{className:"wa-form-label"},(0,s.t)("templates.delayBetweenMessages")||"Delay before next message"),a.createElement("div",{className:"wa-delay-inputs"},a.createElement("div",{className:"wa-delay-input-group"},a.createElement("label",null,(0,s.t)("templates.delayMin")||"Min (sec)"),a.createElement("input",{type:"number",className:"wa-form-input wa-delay-input",min:"1",max:"60",value:l.delay.min,onChange:e=>c(l.id,{delay:{...l.delay,min:Math.max(1,parseInt(e.target.value)||1)}})})),a.createElement("span",{className:"wa-delay-separator"},"—"),a.createElement("div",{className:"wa-delay-input-group"},a.createElement("label",null,(0,s.t)("templates.delayMax")||"Max (sec)"),a.createElement("input",{type:"number",className:"wa-form-input wa-delay-input",min:"1",max:"120",value:l.delay.max,onChange:e=>c(l.id,{delay:{...l.delay,max:Math.max(l.delay.min,parseInt(e.target.value)||5)}})}))))))})),a.createElement("button",{type:"button",className:"wa-btn-add-message wa-btn-add-message-bottom",onClick:l},a.createElement("span",null,"+")," ",(0,s.t)("templates.addMessage")||"Add Message"),a.createElement("style",null,"\n        .wa-multi-message-field {\n          margin-bottom: 20px;\n        }\n\n        .wa-multi-message-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          margin-bottom: 16px;\n          padding-bottom: 12px;\n          border-bottom: 2px solid var(--lion-primary);\n        }\n\n        .wa-multi-message-title {\n          font-size: 16px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n        }\n\n        .wa-btn-add-message {\n          display: inline-flex;\n          align-items: center;\n          gap: 6px;\n          padding: 8px 16px;\n          background: var(--lion-primary);\n          color: #ffffff !important;\n          border: 1px solid var(--lion-primary);\n          border-radius: 6px;\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .wa-btn-add-message:hover {\n          background: var(--lion-primary-hover);\n          border-color: var(--lion-primary-hover);\n          color: #ffffff !important;\n        }\n\n        .wa-btn-add-message span {\n          font-size: 18px;\n          line-height: 1;\n          color: #ffffff !important;\n        }\n\n        .wa-btn-add-message-bottom {\n          margin-top: 16px;\n          width: 100%;\n          justify-content: center;\n          padding: 12px 16px;\n          border-style: dashed;\n          border-width: 2px;\n          background: transparent;\n          color: var(--lion-text-primary) !important;\n          border-color: var(--lion-border-medium);\n        }\n\n        .wa-btn-add-message-bottom:hover {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-primary);\n          color: var(--lion-text-primary) !important;\n        }\n\n        .wa-message-cards {\n          display: flex;\n          flex-direction: column;\n          gap: 12px;\n        }\n\n        .wa-message-card {\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 10px;\n          overflow: hidden;\n          box-shadow: var(--lion-shadow-sm);\n        }\n\n        .wa-message-card-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 14px 16px;\n          background: var(--lion-bg-secondary);\n          cursor: pointer;\n          border-bottom: 1px solid var(--lion-border-light);\n          user-select: none;\n        }\n\n        .wa-message-card-header:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .wa-message-number {\n          font-size: 15px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n        }\n\n        .wa-message-card-actions {\n          display: flex;\n          gap: 8px;\n          align-items: center;\n        }\n\n        .wa-btn-expand {\n          background: transparent;\n          border: none;\n          font-size: 12px;\n          color: var(--lion-text-secondary);\n          cursor: pointer;\n          padding: 4px;\n        }\n\n        .wa-btn-expand:hover {\n          color: var(--lion-text-primary);\n        }\n\n        .wa-btn-delete-message {\n          background: transparent;\n          border: none;\n          font-size: 16px;\n          cursor: pointer;\n          padding: 4px;\n          opacity: 0.7;\n          transition: opacity 0.2s;\n          filter: grayscale(0);\n        }\n\n        .wa-btn-delete-message:hover:not(:disabled) {\n          opacity: 1;\n        }\n\n        .wa-btn-delete-message:disabled {\n          opacity: 0.3;\n          cursor: not-allowed;\n        }\n\n        .wa-message-card-body {\n          padding: 20px;\n          background: var(--lion-bg-primary);\n        }\n\n        .wa-form-group {\n          margin-bottom: 16px;\n        }\n\n        .wa-form-label {\n          display: block;\n          margin-bottom: 8px;\n          font-size: 14px;\n          font-weight: 500;\n          color: var(--lion-text-secondary);\n        }\n\n        .wa-form-label.required::after {\n          content: ' *';\n          color: var(--lion-error);\n        }\n\n        .wa-form-input,\n        .wa-form-select,\n        .wa-form-textarea {\n          width: 100%;\n          padding: 10px 12px;\n          border: 1px solid var(--lion-border-medium);\n          border-radius: 6px;\n          font-size: 14px;\n          font-family: inherit;\n          outline: none;\n          transition: border-color 0.2s;\n          background: var(--lion-bg-secondary) !important;\n          color: var(--lion-text-primary) !important;\n        }\n\n        .wa-form-input::placeholder,\n        .wa-form-textarea::placeholder {\n          color: var(--lion-text-muted);\n        }\n\n        .wa-form-input:focus,\n        .wa-form-select:focus,\n        .wa-form-textarea:focus {\n          border-color: var(--lion-primary);\n          background: var(--lion-bg-tertiary) !important;\n        }\n\n        .wa-form-textarea {\n          resize: vertical;\n          min-height: 80px;\n        }\n\n        .wa-form-hint {\n          display: block;\n          margin-top: 4px;\n          font-size: 12px;\n          color: var(--lion-text-muted);\n        }\n\n        .wa-message-toolbar {\n          display: flex;\n          gap: 4px;\n          margin-bottom: 8px;\n          padding: 8px;\n          background: var(--lion-bg-secondary);\n          border-radius: 6px;\n        }\n\n        .wa-toolbar-btn {\n          padding: 6px 12px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-medium);\n          border-radius: 4px;\n          cursor: pointer;\n          font-size: 14px;\n          transition: all 0.2s;\n          color: var(--lion-text-primary);\n        }\n\n        .wa-toolbar-btn:hover {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-dark);\n        }\n\n        .wa-message-counter {\n          text-align: right;\n          font-size: 12px;\n          color: var(--lion-text-muted);\n          margin-top: 4px;\n        }\n\n        .wa-variable-buttons {\n          margin-top: 12px;\n        }\n\n        .wa-variable-list {\n          display: flex;\n          flex-wrap: wrap;\n          gap: 6px;\n          margin-top: 8px;\n        }\n\n        .wa-variable-btn {\n          padding: 6px 12px;\n          background: var(--lion-primary) !important;\n          border: 1px solid var(--lion-primary) !important;\n          border-radius: 6px;\n          font-size: 12px;\n          font-family: monospace;\n          color: #ffffff !important;\n          cursor: pointer;\n          transition: all 0.2s;\n          font-weight: 500;\n        }\n\n        .wa-variable-btn:hover {\n          background: var(--lion-primary-hover) !important;\n          border-color: var(--lion-primary-hover) !important;\n          color: #ffffff !important;\n        }\n\n        .wa-delay-group {\n          padding: 16px;\n          background: var(--lion-bg-secondary);\n          border-radius: 8px;\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .wa-delay-inputs {\n          display: flex;\n          align-items: flex-end;\n          gap: 12px;\n        }\n\n        .wa-delay-input-group {\n          display: flex;\n          flex-direction: column;\n          gap: 4px;\n        }\n\n        .wa-delay-input-group label {\n          font-size: 12px;\n          color: var(--lion-text-muted);\n        }\n\n        .wa-delay-input {\n          width: 80px;\n          text-align: center;\n        }\n\n        .wa-delay-separator {\n          color: var(--lion-text-light);\n          font-size: 18px;\n          margin-bottom: 6px;\n        }\n      "))},ea=({template:e,onSave:t,onCancel:n})=>{const[r,o]=(0,a.useState)(()=>{const t={...Nn.m2,...e||{}};return t.messages&&0!==t.messages.length||(t.message?t.messages=[{id:Math.random().toString(36).substring(2,11),message:t.message,attachmentType:t.sendAttachmentType||"none",attachments:t.attachemnt||[],pollData:t.pollData,listData:t.listData,selectedContact:t.selectedContact,selectedProducts:t.selectedProducts,buttonsData:t.buttonsData,delay:{min:3,max:5}}]:t.messages=[(0,Nn.tp)()]),t}),[i,l]=(0,a.useState)({}),[c,d]=(0,a.useState)([]),[m,p]=(0,a.useState)(1),[u,g]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{const e=()=>{const e=_();g("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]),(0,a.useEffect)(()=>{(async()=>{try{const e=(await Mn.TemplatesStorage.getCategoriesAsync()).filter(e=>e.id!==Nn.gh.ALL&&e.id!==Nn.gh.QUICK_REPLY);d(e)}catch(e){}})()},[]),(0,a.useEffect)(()=>{if("true"!==sessionStorage.getItem("preSelectQuickReply")||e){"quick-reply"!==new URLSearchParams(window.location.search).get("preselect")||e||o(e=>({...e,messageType:"quick_reply",quickReplyData:Nn.yV}))}else o(e=>({...e,messageType:"quick_reply",quickReplyData:Nn.yV})),sessionStorage.removeItem("preSelectQuickReply")},[e]);const h=[{value:"individual",label:(0,s.t)("templates.messageType.individual")||"One to One"},{value:"tab",label:(0,s.t)("templates.messageType.tab")||"Tab"},{value:"group",label:(0,s.t)("templates.messageType.group")||"Group"},{value:"label",label:(0,s.t)("templates.messageType.label")||"Label"},{value:"kanban",label:(0,s.t)("templates.messageType.kanban")||"Kanban"},{value:"quick_reply",label:(0,s.t)("templates.messageType.quickReply")||"⚡ Quick Reply"}],b=(e,t)=>{o(n=>({...n,[e]:t})),i[e]&&l(t=>({...t,[e]:""}))},f="quick_reply"===r.messageType?3:2,v="quick_reply"===r.messageType?["Basic Info","Messages","Quick Reply"]:["Basic Info","Messages"];(0,a.useEffect)(()=>{m>f&&p(f)},[r.messageType]);return a.createElement("div",{className:"wa-template-editor-overlay "+(u?"lion-dark":"")},a.createElement("div",{className:"wa-template-editor"},a.createElement("div",{className:"wa-template-editor-header"},a.createElement("div",{className:"header-content"},a.createElement("div",{className:"header-icon"},a.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.createElement("polyline",{points:"14 2 14 8 20 8"}),a.createElement("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),a.createElement("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),a.createElement("polyline",{points:"10 9 9 9 8 9"}))),a.createElement("div",{className:"header-text"},a.createElement("h2",null,e?(0,s.t)("templates.editTemplate")||"Edit Template":(0,s.t)("templates.newTemplate")||"New Template"),a.createElement("span",{className:"header-subtitle"},"Step ",m," of ",f," — ",v[m-1]))),a.createElement("button",{className:"wa-template-close",onClick:n},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),a.createElement("div",{className:"wa-template-editor-body"},a.createElement("div",{className:"wizard-step-indicator"},v.map((e,t)=>{const n=t+1,r=n===m,o=n<m;return a.createElement(a.Fragment,{key:n},t>0&&a.createElement("div",{className:"wizard-step-line "+(o?"completed":"")}),a.createElement("div",{className:`wizard-step ${r?"active":""} ${o?"completed":""}`,onClick:()=>{o&&p(n)},style:{cursor:o?"pointer":"default"}},a.createElement("div",{className:"wizard-step-circle"},o?a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3"},a.createElement("polyline",{points:"20 6 9 17 4 12"})):n),a.createElement("span",{className:"wizard-step-label"},e)))})),1===m&&a.createElement("div",{className:"form-section"},a.createElement("div",{className:"section-header"},a.createElement("span",{className:"section-icon"},"📝"),a.createElement("span",{className:"section-title"},"Basic Information")),a.createElement("div",{className:"wa-form-group"},a.createElement("label",{className:"wa-form-label required"},(0,s.t)("templates.form.templateName")||"Template Name"),a.createElement("div",{className:"input-with-icon"},a.createElement("svg",{className:"input-icon",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})),a.createElement("input",{type:"text",className:"wa-form-input "+(i.templeteName?"error":""),value:r.templeteName,onChange:e=>b("templeteName",e.target.value),placeholder:(0,s.t)("templates.form.templateNamePlaceholder")||"Enter template name",maxLength:Nn.Mb.MAX_TEMPLATE_NAME_LENGTH})),i.templeteName&&a.createElement("span",{className:"wa-form-error"},i.templeteName)),a.createElement("div",{className:"form-row"},a.createElement("div",{className:"wa-form-group flex-1"},a.createElement("label",{className:"wa-form-label"},(0,s.t)("templates.form.category")||"Category"),a.createElement("div",{className:"input-with-icon"},a.createElement("svg",{className:"input-icon",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})),a.createElement("select",{className:"wa-form-select",value:r.categoryId||Nn.gh.UNCATEGORIZED,onChange:e=>b("categoryId",e.target.value)},c.map(e=>a.createElement("option",{key:e.id,value:e.id},e.icon," ",e.name))))),a.createElement("div",{className:"wa-form-group flex-1"},a.createElement("label",{className:"wa-form-label"},(0,s.t)("templates.form.templateFor")||"Template For"),a.createElement("div",{className:"input-with-icon"},a.createElement("svg",{className:"input-icon",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"9",cy:"7",r:"4"}),a.createElement("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),a.createElement("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})),a.createElement("select",{className:"wa-form-select",value:r.messageType,onChange:e=>{const t=e.target.value;b("messageType",t),"quick_reply"!==t||r.quickReplyData||b("quickReplyData",Nn.yV)}},h.map(e=>a.createElement("option",{key:e.value,value:e.value},e.label)))))),a.createElement("div",{className:"wa-form-group"},a.createElement("label",{className:"wa-form-label"},(0,s.t)("templates.form.personalizeValue")||"Personalize Value"),a.createElement("div",{className:"personalize-row"},a.createElement("div",{className:"input-with-icon",style:{maxWidth:"120px"}},a.createElement("svg",{className:"input-icon",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"4 17 10 11 4 5"}),a.createElement("line",{x1:"12",y1:"19",x2:"20",y2:"19"})),a.createElement("input",{type:"number",className:"wa-form-input",min:"1",max:Nn.Mb.MAX_DYNAMIC_VARIABLES,value:r.dynamicValueCount,onChange:e=>(e=>{const t=Math.max(1,Math.min(e,Nn.Mb.MAX_DYNAMIC_VARIABLES));b("dynamicValueCount",t);const n=Array(t).fill(null).map((e,t)=>`@variable${t+1}`);b("dynamicValueData",n)})(parseInt(e.target.value)||1)})),a.createElement("div",{className:"variable-pills"},Array.from({length:r.dynamicValueCount},(e,t)=>a.createElement("span",{key:t,className:"variable-pill"},"@variable",t+1)))),a.createElement("small",{className:"wa-form-hint"},(0,s.t)("templates.form.personalizeValueHint")||"Use variables like @variable1, @variable2 in your message for personalization")),a.createElement("div",{className:"status-card",style:{marginTop:"20px"}},a.createElement("div",{className:"status-info"},a.createElement("span",{className:"status-label"},(0,s.t)("templates.form.templateStatus")||"Template Status"),a.createElement("span",{className:"status-hint"},r.isActive?"Modelo ativo e pronto para uso":"Modelo salvo, mas inativo")),a.createElement("div",{className:"wa-toggle-switch"},a.createElement("input",{type:"checkbox",id:"templateStatus",checked:r.isActive,onChange:e=>b("isActive",e.target.checked)}),a.createElement("label",{htmlFor:"templateStatus",className:"wa-toggle-label"},r.isActive?(0,s.t)("templates.form.statusOn")||"Active":(0,s.t)("templates.form.statusOff")||"Inactive")))),2===m&&a.createElement("div",{className:"form-section"},a.createElement("div",{className:"section-header"},a.createElement("span",{className:"section-icon"},"💬"),a.createElement("span",{className:"section-title"},"Messages")),a.createElement(Zn,{messages:r.messages||[],onChange:e=>b("messages",e),dynamicValueData:r.dynamicValueData}),i.messages&&a.createElement("span",{className:"wa-form-error"},i.messages)),3===m&&"quick_reply"===r.messageType&&a.createElement("div",{className:"form-section"},a.createElement("div",{className:"section-header"},a.createElement("span",{className:"section-icon"},"⚡"),a.createElement("span",{className:"section-title"},"Quick Reply Settings")),a.createElement(In,{data:r.quickReplyData||Nn.yV,onChange:e=>b("quickReplyData",e)}))),a.createElement("div",{className:"wa-template-editor-footer"},1===m?a.createElement("button",{className:"wa-btn wa-btn-secondary",onClick:n},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),(0,s.t)("templates.form.cancel")||"Cancel"):a.createElement("button",{className:"wa-btn wa-btn-secondary",onClick:()=>{p(e=>Math.max(e-1,1))}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),a.createElement("polyline",{points:"12 19 5 12 12 5"})),(0,s.t)("common.back")||"Voltar"),m<f?a.createElement("button",{className:"wa-btn wa-btn-primary",onClick:()=>{(e=>{const t={};if(1===e&&(r.templeteName.trim()||(t.templeteName=(0,s.t)("templates.errors.nameRequired")||"Template name is required")),2===e){const e=r.messages||[];0===e.length?t.messages=(0,s.t)("templates.errors.messageRequired")||"At least one message is required":(e.some(e=>e.message.trim().length>0||e.attachments&&e.attachments.length>0)||(t.messages=(0,s.t)("templates.errors.messageRequired")||"At least one message must have content or media"),e.find(e=>e.message.length>Nn.Mb.MAX_MESSAGE_LENGTH)&&(t.messages=(0,s.t)("templates.errors.messageTooLong")||`Message is too long (max ${Nn.Mb.MAX_MESSAGE_LENGTH} characters)`))}return l(t),0===Object.keys(t).length})(m)&&p(e=>Math.min(e+1,f))}},(0,s.t)("crm.next")||"Próximo",a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),a.createElement("polyline",{points:"12 5 19 12 12 19"}))):a.createElement("button",{className:"wa-btn wa-btn-primary",onClick:async()=>{if((()=>{const e={};r.templeteName.trim()||(e.templeteName=(0,s.t)("templates.errors.nameRequired")||"Template name is required");const t=r.messages||[];0===t.length?e.messages=(0,s.t)("templates.errors.messageRequired")||"At least one message is required":(t.some(e=>e.message.trim().length>0||e.attachments&&e.attachments.length>0)||(e.messages=(0,s.t)("templates.errors.messageRequired")||"At least one message must have content or media"),t.find(e=>e.message.length>Nn.Mb.MAX_MESSAGE_LENGTH)&&(e.messages=(0,s.t)("templates.errors.messageTooLong")||`Message is too long (max ${Nn.Mb.MAX_MESSAGE_LENGTH} characters)`));return l(e),0===Object.keys(e).length})())try{e?await Mn.TemplatesStorage.updateTemplateAsync(e.id,r):await Mn.TemplatesStorage.createTemplateAsync(r),await new Promise(e=>setTimeout(e,300)),window.dispatchEvent(new CustomEvent("wa-template-saved")),t()}catch(e){alert((0,s.t)("templates.errors.saveFailed")||"Failed to save template")}}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"20 6 9 17 4 12"})),(0,s.t)("templates.form.save")||"Save Template"))),a.createElement("style",null,'\n        /* Dark mode variable overrides for this component */\n        .wa-template-editor-overlay.lion-dark {\n          --lion-bg-primary: #1a1a1a;\n          --lion-bg-secondary: #262626;\n          --lion-bg-tertiary: #2a2a2a;\n          --lion-bg-hover: #333333;\n          --lion-text-primary: #ffffff;\n          --lion-text-secondary: #e5e7eb;\n          --lion-text-muted: #a0a0a0;\n          --lion-text-light: #6b7280;\n          --lion-border-light: #3f3f3f;\n          --lion-border-medium: #525252;\n          --lion-border-dark: #6b7280;\n          --lion-primary-light: #1e3a8a;\n          --lion-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);\n          --lion-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);\n          --lion-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);\n          --lion-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);\n          --lion-shadow-primary: 0 4px 12px rgba(63, 28, 3, 0.5);\n        }\n\n        .wa-template-editor-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.6);\n          backdrop-filter: blur(4px);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 10001;\n          padding: 20px;\n        }\n\n        .wa-template-editor {\n          background: var(--lion-bg-secondary);\n          border-radius: 20px;\n          width: 100%;\n          max-width: 720px;\n          max-height: 90vh;\n          display: flex;\n          flex-direction: column;\n          box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);\n          overflow: hidden;\n        }\n\n        .wa-template-editor-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 20px 24px;\n          background: var(--lion-primary);\n          color: #ffffff;\n        }\n\n        .header-content {\n          display: flex;\n          align-items: center;\n          gap: 14px;\n        }\n\n        .header-icon {\n          width: 44px;\n          height: 44px;\n          background: rgba(255, 255, 255, 0.2);\n          border-radius: 12px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n        }\n\n        .header-text h2 {\n          margin: 0;\n          font-size: 18px;\n          font-weight: 600;\n        }\n\n        .header-subtitle {\n          font-size: 13px;\n          opacity: 0.85;\n        }\n\n        .wa-template-close {\n          background: rgba(255, 255, 255, 0.15);\n          border: none;\n          width: 36px;\n          height: 36px;\n          border-radius: 10px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          color: #ffffff;\n          transition: all 0.2s;\n        }\n\n        .wa-template-close:hover {\n          background: rgba(255, 255, 255, 0.25);\n        }\n\n        .wa-template-editor-body {\n          flex: 1;\n          overflow-y: auto;\n          padding: 24px;\n          display: flex;\n          flex-direction: column;\n          gap: 20px;\n        }\n\n        .form-section {\n          background: var(--lion-bg-primary);\n          border-radius: 14px;\n          padding: 20px;\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .section-header {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          margin-bottom: 18px;\n          padding-bottom: 12px;\n          border-bottom: 1px solid var(--lion-bg-tertiary);\n        }\n\n        .section-icon {\n          font-size: 18px;\n        }\n\n        .section-title {\n          font-size: 15px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n        }\n\n        .form-row {\n          display: flex;\n          gap: 16px;\n        }\n\n        .flex-1 {\n          flex: 1;\n        }\n\n        .wa-form-group {\n          margin-bottom: 16px;\n        }\n\n        .wa-form-group:last-child {\n          margin-bottom: 0;\n        }\n\n        .wa-form-label {\n          display: block;\n          margin-bottom: 8px;\n          font-size: 13px;\n          font-weight: 600;\n          color: var(--lion-text-secondary);\n        }\n\n        .wa-form-label.required::after {\n          content: \' *\';\n          color: var(--lion-error);\n        }\n\n        .input-with-icon {\n          position: relative;\n        }\n\n        .input-icon {\n          position: absolute;\n          left: 12px;\n          top: 50%;\n          transform: translateY(-50%);\n          color: var(--lion-text-muted);\n          pointer-events: none;\n        }\n\n        .input-with-icon .wa-form-input,\n        .input-with-icon .wa-form-select {\n          padding-left: 40px;\n        }\n\n        .wa-form-input,\n        .wa-form-select,\n        .wa-form-textarea {\n          width: 100%;\n          padding: 12px 14px;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 10px;\n          font-size: 14px;\n          font-family: inherit;\n          outline: none;\n          transition: all 0.2s;\n          background: var(--lion-bg-secondary);\n          color: var(--lion-text-primary);\n        }\n\n        .wa-form-input:hover,\n        .wa-form-select:hover {\n          border-color: var(--lion-border-medium);\n        }\n\n        .wa-form-input:focus,\n        .wa-form-select:focus,\n        .wa-form-textarea:focus {\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 3px var(--lion-primary-light);\n          background: var(--lion-bg-primary);\n        }\n\n        .wa-form-input::placeholder,\n        .wa-form-textarea::placeholder {\n          color: var(--lion-text-muted);\n        }\n\n        .wa-form-input.error,\n        .wa-form-textarea.error {\n          border-color: var(--lion-error);\n          box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);\n        }\n\n        .wa-form-textarea {\n          resize: vertical;\n          min-height: 100px;\n        }\n\n        .wa-form-error {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          margin-top: 6px;\n          font-size: 12px;\n          color: var(--lion-error);\n        }\n\n        .wa-form-hint {\n          display: block;\n          margin-top: 6px;\n          font-size: 12px;\n          color: var(--lion-text-muted);\n          line-height: 1.4;\n        }\n\n        .personalize-row {\n          display: flex;\n          align-items: center;\n          gap: 14px;\n          position: relative;\n          z-index: 10;\n        }\n\n        .variable-pills {\n          display: flex;\n          flex-wrap: wrap;\n          align-items: center;\n          gap: 6px;\n          position: relative;\n          z-index: 10;\n          margin-top: 2px;\n        }\n\n        .variable-pill {\n          padding: 6px 12px;\n          background: var(--lion-primary-light);\n          border: 1px solid var(--lion-primary);\n          border-radius: 6px;\n          font-size: 12px;\n          font-family: \'SF Mono\', \'Monaco\', \'Consolas\', monospace;\n          color: var(--lion-primary);\n          font-weight: 500;\n          position: relative;\n          z-index: 10;\n          line-height: 1;\n          display: inline-flex;\n          align-items: center;\n        }\n\n        .status-card {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 14px 16px;\n          background: var(--lion-bg-secondary);\n          border-radius: 10px;\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .status-info {\n          display: flex;\n          flex-direction: column;\n          gap: 2px;\n        }\n\n        .status-label {\n          font-size: 14px;\n          font-weight: 600;\n          color: var(--lion-text-secondary);\n        }\n\n        .status-hint {\n          font-size: 12px;\n          color: var(--lion-text-muted);\n        }\n\n        .wa-toggle-switch {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n        }\n\n        .wa-toggle-switch input[type="checkbox"] {\n          width: 48px;\n          height: 26px;\n          background: var(--lion-border-medium);\n          border-radius: 13px;\n          position: relative;\n          cursor: pointer;\n          appearance: none;\n          transition: all 0.3s ease;\n        }\n\n        .wa-toggle-switch input[type="checkbox"]::before {\n          content: \'\';\n          position: absolute;\n          width: 22px;\n          height: 22px;\n          border-radius: 50%;\n          background: var(--lion-bg-primary);\n          top: 2px;\n          left: 2px;\n          transition: all 0.3s ease;\n          box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);\n        }\n\n        .wa-toggle-switch input[type="checkbox"]:checked {\n          background: var(--lion-primary);\n        }\n\n        .wa-toggle-switch input[type="checkbox"]:checked::before {\n          transform: translateX(22px);\n        }\n\n        .wa-toggle-label {\n          font-size: 13px;\n          font-weight: 600;\n          color: var(--lion-text-secondary);\n          min-width: 60px;\n        }\n\n        .wa-template-editor-footer {\n          display: flex;\n          justify-content: flex-end;\n          gap: 12px;\n          padding: 18px 24px;\n          background: var(--lion-bg-primary);\n          border-top: 1px solid var(--lion-border-light);\n        }\n\n        .wa-btn {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          padding: 11px 22px;\n          border-radius: 10px;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          border: none;\n          transition: all 0.2s;\n        }\n\n        .wa-btn-secondary {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n        }\n\n        .wa-btn-secondary:hover {\n          background: var(--lion-border-light);\n          color: var(--lion-text-secondary);\n        }\n\n        .wa-btn-primary {\n          background: var(--lion-primary);\n          color: #ffffff;\n          box-shadow: var(--lion-shadow-primary);\n        }\n\n        .wa-btn-primary:hover {\n          box-shadow: 0 6px 16px rgba(var(--lion-primary-rgb), 0.35);\n          transform: translateY(-1px);\n        }\n\n        /* Message toolbar styling */\n        .wa-message-toolbar {\n          display: flex;\n          gap: 4px;\n          margin-bottom: 8px;\n          padding: 8px;\n          background: var(--lion-bg-secondary);\n          border-radius: 8px;\n        }\n\n        .wa-toolbar-btn {\n          padding: 6px 12px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 6px;\n          cursor: pointer;\n          font-size: 14px;\n          color: var(--lion-text-primary);\n          transition: all 0.2s;\n        }\n\n        .wa-toolbar-btn:hover {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-medium);\n        }\n\n        .wa-message-counter {\n          text-align: right;\n          font-size: 12px;\n          color: var(--lion-text-muted);\n          margin-top: 4px;\n        }\n\n        .wa-variable-buttons {\n          margin-top: 12px;\n        }\n\n        .wa-variable-list {\n          display: flex;\n          flex-wrap: wrap;\n          gap: 6px;\n          margin-top: 8px;\n        }\n\n        .wa-variable-btn {\n          padding: 5px 12px;\n          background: var(--lion-primary-light);\n          border: 1px solid var(--lion-primary-light);\n          border-radius: 6px;\n          font-size: 12px;\n          font-family: monospace;\n          color: var(--lion-primary);\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .wa-variable-btn:hover {\n          background: var(--lion-primary-light);\n          border-color: var(--lion-primary);\n        }\n\n        /* ============================================================ */\n        /* ============ V2 REDESIGN OVERRIDES (LIGHT) ================ */\n        /* ============================================================ */\n\n        /* Backdrop */\n        .wa-template-editor-overlay {\n          background: rgba(0, 0, 0, 0.55) !important;\n          backdrop-filter: blur(6px) !important;\n          -webkit-backdrop-filter: blur(6px) !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          z-index: 10001 !important;\n        }\n\n        /* Modal container */\n        .wa-template-editor-overlay .wa-template-editor {\n          background: var(--lion-bg-primary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          border-radius: 16px !important;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0,0,0,0.05) !important;\n          width: 92% !important;\n          max-width: 1100px !important;\n          max-height: 88vh !important;\n          overflow: hidden !important;\n          display: flex !important;\n          flex-direction: column !important;\n        }\n\n        /* Header - remove legacy gradient */\n        .wa-template-editor-overlay .wa-template-editor-header {\n          background: var(--lion-bg-primary) !important;\n          background-image: none !important;\n          border-bottom: 1px solid var(--lion-border-light) !important;\n          color: var(--lion-text-primary) !important;\n          padding: 20px 28px !important;\n          box-shadow: none !important;\n          flex-shrink: 0 !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: space-between !important;\n          gap: 12px !important;\n        }\n\n        .wa-template-editor-overlay .wa-template-editor-header h2,\n        .wa-template-editor-overlay .wa-template-editor-header .editor-title {\n          color: var(--lion-text-primary) !important;\n          font-size: 20px !important;\n          font-weight: 700 !important;\n          margin: 0 !important;\n        }\n\n        .wa-template-editor-overlay .wa-template-editor-header p,\n        .wa-template-editor-overlay .wa-template-editor-header .editor-subtitle {\n          color: var(--lion-text-muted) !important;\n          font-size: 13px !important;\n          margin: 0 !important;\n        }\n\n        /* Icon box in header - keep blue accent */\n        .wa-template-editor-overlay .wa-template-editor-header .editor-icon-box,\n        .wa-template-editor-overlay .wa-template-editor-header svg.header-icon {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border-radius: 10px !important;\n          width: 40px !important;\n          height: 40px !important;\n          padding: 8px !important;\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.25) !important;\n        }\n\n        /* Close button */\n        .wa-template-editor-overlay .wa-template-editor-header button.close-btn,\n        .wa-template-editor-overlay .wa-template-editor-header button[aria-label*="close" i] {\n          background: var(--lion-bg-tertiary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          color: var(--lion-text-muted) !important;\n          border-radius: 10px !important;\n          width: 36px !important;\n          height: 36px !important;\n          padding: 0 !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .wa-template-editor-overlay .wa-template-editor-header button.close-btn:hover {\n          background: rgba(239, 68, 68, 0.1) !important;\n          color: #ef4444 !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n        }\n\n        /* Body */\n        .wa-template-editor-overlay .wa-template-editor-body {\n          background: var(--lion-bg-secondary) !important;\n          padding: 24px 28px !important;\n          flex: 1 !important;\n          overflow-y: auto !important;\n          min-height: 0 !important;\n        }\n\n        /* Form groups */\n        .wa-template-editor-overlay .wa-form-group {\n          margin-bottom: 18px !important;\n        }\n\n        .wa-template-editor-overlay .wa-form-label {\n          color: var(--lion-text-muted) !important;\n          font-size: 12px !important;\n          font-weight: 700 !important;\n          margin-bottom: 6px !important;\n          display: block !important;\n          text-transform: uppercase !important;\n          letter-spacing: 0.5px !important;\n        }\n\n        /* Inputs */\n        .wa-template-editor-overlay .wa-form-input,\n        .wa-template-editor-overlay .wa-template-editor-body input[type="text"],\n        .wa-template-editor-overlay .wa-template-editor-body input[type="number"],\n        .wa-template-editor-overlay .wa-template-editor-body textarea,\n        .wa-template-editor-overlay .wa-template-editor-body select {\n          background: var(--lion-bg-primary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          border-radius: 10px !important;\n          padding: 10px 14px !important;\n          color: var(--lion-text-primary) !important;\n          font-size: 13px !important;\n          width: 100% !important;\n          box-sizing: border-box !important;\n          outline: none !important;\n          transition: all 0.15s ease !important;\n          box-shadow: none !important;\n        }\n\n        .wa-template-editor-overlay .wa-form-input:focus,\n        .wa-template-editor-overlay .wa-template-editor-body input:focus,\n        .wa-template-editor-overlay .wa-template-editor-body textarea:focus,\n        .wa-template-editor-overlay .wa-template-editor-body select:focus {\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12) !important;\n        }\n\n        .wa-template-editor-overlay input::placeholder,\n        .wa-template-editor-overlay textarea::placeholder {\n          color: var(--lion-text-light) !important;\n        }\n\n        /* Fix icon overlap — restore padding-left for inputs inside input-with-icon */\n        .wa-template-editor-overlay .input-with-icon .wa-form-input,\n        .wa-template-editor-overlay .input-with-icon .wa-form-select,\n        .wa-template-editor-overlay .input-with-icon input[type="text"],\n        .wa-template-editor-overlay .input-with-icon input[type="number"],\n        .wa-template-editor-overlay .input-with-icon select {\n          padding-left: 40px !important;\n        }\n\n        .wa-template-editor-overlay .wa-form-error {\n          color: var(--lion-error) !important;\n          font-size: 12px !important;\n          margin-top: 4px !important;\n        }\n\n        /* Status card */\n        .wa-template-editor-overlay .status-card,\n        .wa-template-editor-overlay .wa-template-editor-body .status-section {\n          background: var(--lion-bg-primary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          border-radius: 12px !important;\n          padding: 14px 18px !important;\n          box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;\n        }\n\n        /* Toggle switch */\n        .wa-template-editor-overlay .wa-toggle-switch {\n          background: var(--lion-border-light) !important;\n        }\n\n        .wa-template-editor-overlay .wa-toggle-switch.active,\n        .wa-template-editor-overlay .wa-toggle-switch.on,\n        .wa-template-editor-overlay input:checked + .wa-toggle-switch {\n          background: var(--lion-primary) !important;\n        }\n\n        /* Footer */\n        .wa-template-editor-overlay .wa-template-editor-footer {\n          background: var(--lion-bg-primary) !important;\n          border-top: 1px solid var(--lion-border-light) !important;\n          padding: 18px 28px !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: space-between !important;\n          gap: 12px !important;\n          flex-shrink: 0 !important;\n        }\n\n        /* Primary save button */\n        .wa-template-editor-overlay .wa-btn-primary,\n        .wa-template-editor-overlay button.btn-save {\n          background: var(--lion-primary) !important;\n          background-image: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border: none !important;\n          border-radius: 10px !important;\n          padding: 10px 20px !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .wa-template-editor-overlay .wa-btn-primary:hover {\n          transform: translateY(-1px) !important;\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n        }\n\n        /* Secondary button */\n        .wa-template-editor-overlay .wa-btn-secondary,\n        .wa-template-editor-overlay button.btn-cancel {\n          background: var(--lion-bg-primary) !important;\n          background-image: none !important;\n          color: var(--lion-text-secondary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          border-radius: 10px !important;\n          padding: 10px 20px !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          box-shadow: none !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .wa-template-editor-overlay .wa-btn-secondary:hover {\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n          background: rgba(var(--lion-primary-rgb), 0.04) !important;\n        }\n\n        /* Checkboxes */\n        .wa-template-editor-overlay input[type="checkbox"] {\n          accent-color: var(--lion-primary) !important;\n        }\n\n        /* Variable pills */\n        .wa-template-editor-overlay .wa-variable-pill,\n        .wa-template-editor-overlay .variable-pill {\n          background: rgba(var(--lion-primary-rgb), 0.1) !important;\n          color: var(--lion-primary) !important;\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.25) !important;\n          padding: 3px 10px !important;\n          border-radius: 999px !important;\n          font-size: 11px !important;\n          font-weight: 700 !important;\n          font-family: monospace !important;\n        }\n\n        /* Dark mode */\n        .wa-template-editor-overlay.lion-dark .wa-template-editor {\n          background: #18181b !important;\n          border-color: #27272a !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-template-editor-header {\n          background: #18181b !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-template-editor-header h2 {\n          color: #fafafa !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-template-editor-body {\n          background: #1a1a1a !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-form-label {\n          color: #e5e7eb !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-form-input,\n        .wa-template-editor-overlay.lion-dark .wa-template-editor-body input,\n        .wa-template-editor-overlay.lion-dark .wa-template-editor-body textarea,\n        .wa-template-editor-overlay.lion-dark .wa-template-editor-body select {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #fafafa !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .status-card {\n          background: #1f1f22 !important;\n          border-color: #27272a !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-template-editor-footer {\n          background: #18181b !important;\n          border-top-color: #27272a !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-btn-secondary {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #e5e7eb !important;\n        }\n\n        /* ============================================================ */\n        /* ============== V3 WIZARD REDESIGN OVERRIDES ================ */\n        /* ============================================================ */\n\n        /* === BACKDROP === */\n        .wa-template-editor-overlay {\n          background: rgba(0, 0, 0, 0.55) !important;\n          backdrop-filter: blur(6px) !important;\n          -webkit-backdrop-filter: blur(6px) !important;\n        }\n\n        /* === MODAL CONTAINER === */\n        .wa-template-editor {\n          width: 92% !important;\n          max-width: 1000px !important;\n          max-height: 88vh !important;\n          border-radius: 16px !important;\n          border: 1px solid var(--lion-border-light) !important;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;\n        }\n\n        /* === HEADER === */\n        .wa-template-editor-header {\n          padding: 20px 28px !important;\n          border-bottom: 1px solid var(--lion-border-light) !important;\n          background: var(--lion-bg-primary) !important;\n          border-radius: 16px 16px 0 0 !important;\n        }\n\n        .wa-template-editor-header h2 {\n          font-size: 20px !important;\n          font-weight: 700 !important;\n          letter-spacing: -0.01em !important;\n          color: var(--lion-text-primary) !important;\n        }\n\n        .wa-template-editor-header .header-subtitle {\n          font-size: 13px !important;\n          color: var(--lion-text-muted) !important;\n          font-weight: 500 !important;\n        }\n\n        .wa-template-editor-header .header-icon {\n          width: 42px !important;\n          height: 42px !important;\n          border-radius: 12px !important;\n          background: var(--lion-primary) !important;\n        }\n\n        .wa-template-close {\n          width: 36px !important;\n          height: 36px !important;\n          border-radius: 10px !important;\n          background: var(--lion-bg-tertiary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          color: var(--lion-text-muted) !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          padding: 0 !important;\n        }\n\n        .wa-template-close:hover {\n          background: rgba(239, 68, 68, 0.1) !important;\n          color: #ef4444 !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n        }\n\n        /* === BODY === */\n        .wa-template-editor-body {\n          padding: 24px 28px !important;\n          background: var(--lion-bg-secondary) !important;\n        }\n\n        /* === STEP INDICATOR === */\n        .wizard-step-indicator {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 0;\n          margin-bottom: 28px;\n          padding: 16px 0;\n        }\n\n        .wizard-step {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          gap: 8px;\n          position: relative;\n          min-width: 80px;\n        }\n\n        .wizard-step-circle {\n          width: 36px;\n          height: 36px;\n          border-radius: 50%;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          font-size: 14px;\n          font-weight: 700;\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n          border: 2px solid var(--lion-border-light);\n          transition: all 0.3s ease;\n        }\n\n        .wizard-step.active .wizard-step-circle {\n          background: var(--lion-primary);\n          color: #ffffff;\n          border-color: var(--lion-primary);\n          box-shadow: 0 2px 12px rgba(var(--lion-primary-rgb), 0.35);\n        }\n\n        .wizard-step.completed .wizard-step-circle {\n          background: var(--lion-primary);\n          color: #ffffff;\n          border-color: var(--lion-primary);\n        }\n\n        .wizard-step-label {\n          font-size: 12px;\n          font-weight: 600;\n          color: var(--lion-text-muted);\n          text-align: center;\n          white-space: nowrap;\n        }\n\n        .wizard-step.active .wizard-step-label {\n          color: var(--lion-primary);\n        }\n\n        .wizard-step.completed .wizard-step-label {\n          color: var(--lion-text-secondary);\n        }\n\n        .wizard-step-line {\n          width: 60px;\n          height: 2px;\n          background: var(--lion-border-light);\n          margin: 0 4px;\n          margin-bottom: 28px;\n          transition: background 0.3s ease;\n        }\n\n        .wizard-step-line.completed {\n          background: var(--lion-primary);\n        }\n\n        /* === FORM SECTIONS (V3) === */\n        .form-section {\n          background: var(--lion-bg-primary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          border-radius: 14px !important;\n          padding: 24px !important;\n          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;\n        }\n\n        .section-header {\n          margin-bottom: 20px !important;\n          padding-bottom: 14px !important;\n          border-bottom: 1px solid var(--lion-border-light) !important;\n        }\n\n        .section-title {\n          font-size: 15px !important;\n          font-weight: 700 !important;\n          color: var(--lion-text-primary) !important;\n        }\n\n        /* === FORM INPUTS (V3) === */\n        .wa-form-input,\n        .wa-form-select,\n        .wa-form-textarea {\n          border-radius: 10px !important;\n          padding: 10px 14px !important;\n          font-size: 13px !important;\n          border: 1px solid var(--lion-border-light) !important;\n          background: var(--lion-bg-primary) !important;\n          color: var(--lion-text-primary) !important;\n          transition: border 0.2s, box-shadow 0.2s !important;\n        }\n\n        .wa-form-input:focus,\n        .wa-form-select:focus,\n        .wa-form-textarea:focus {\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12) !important;\n          outline: none !important;\n        }\n\n        .wa-form-label {\n          font-size: 12px !important;\n          font-weight: 700 !important;\n          text-transform: uppercase !important;\n          letter-spacing: 0.4px !important;\n          color: var(--lion-text-muted) !important;\n        }\n\n        /* === VARIABLE PILLS === */\n        .variable-pill {\n          background: rgba(var(--lion-primary-rgb), 0.1) !important;\n          color: var(--lion-primary) !important;\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.2) !important;\n          border-radius: 8px !important;\n          padding: 4px 10px !important;\n          font-size: 12px !important;\n          font-weight: 600 !important;\n        }\n\n        /* === STATUS CARD (V3) === */\n        .status-card {\n          background: var(--lion-bg-secondary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          border-radius: 12px !important;\n          padding: 16px 20px !important;\n        }\n\n        /* === FOOTER (V3) === */\n        .wa-template-editor-footer {\n          padding: 18px 28px !important;\n          border-top: 1px solid var(--lion-border-light) !important;\n          background: var(--lion-bg-primary) !important;\n          border-radius: 0 0 16px 16px !important;\n          display: flex !important;\n          justify-content: space-between !important;\n          gap: 12px !important;\n        }\n\n        .wa-btn {\n          border-radius: 10px !important;\n          padding: 10px 22px !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          display: flex !important;\n          align-items: center !important;\n          gap: 8px !important;\n          transition: all 0.2s !important;\n        }\n\n        .wa-btn-primary {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border: none !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n        }\n\n        .wa-btn-primary:hover {\n          transform: translateY(-1px) !important;\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n        }\n\n        .wa-btn-secondary {\n          background: var(--lion-bg-primary) !important;\n          color: var(--lion-text-secondary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n        }\n\n        .wa-btn-secondary:hover {\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n          background: rgba(var(--lion-primary-rgb), 0.04) !important;\n        }\n\n        /* === SCROLLBAR === */\n        .wa-template-editor-body::-webkit-scrollbar {\n          width: 8px;\n        }\n\n        .wa-template-editor-body::-webkit-scrollbar-track {\n          background: transparent;\n        }\n\n        .wa-template-editor-body::-webkit-scrollbar-thumb {\n          background: var(--lion-border-medium, #d1d5db);\n          border-radius: 4px;\n        }\n\n        .wa-template-editor-body::-webkit-scrollbar-thumb:hover {\n          background: var(--lion-text-light, #9ca3af);\n        }\n\n        /* === V3 DARK MODE === */\n        .wa-template-editor-overlay.lion-dark .wa-template-editor {\n          background: #18181b !important;\n          border-color: #27272a !important;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-template-editor-header {\n          background: #18181b !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-template-editor-header h2 {\n          color: #fafafa !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .header-subtitle {\n          color: #a1a1aa !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-template-close {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #a1a1aa !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-template-close:hover {\n          background: rgba(239, 68, 68, 0.15) !important;\n          color: #f87171 !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-template-editor-body {\n          background: #1a1a1a !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .form-section {\n          background: #1f1f22 !important;\n          border-color: #27272a !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .section-header {\n          border-bottom-color: #27272a !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .section-title {\n          color: #fafafa !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-form-label {\n          color: #a1a1aa !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-form-input,\n        .wa-template-editor-overlay.lion-dark .wa-form-select,\n        .wa-template-editor-overlay.lion-dark .wa-form-textarea {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #fafafa !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-form-input:focus,\n        .wa-template-editor-overlay.lion-dark .wa-form-select:focus,\n        .wa-template-editor-overlay.lion-dark .wa-form-textarea:focus {\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.2) !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wizard-step-circle {\n          background: #27272a;\n          border-color: #3f3f46;\n          color: #a1a1aa;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wizard-step-label {\n          color: #71717a;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wizard-step.active .wizard-step-label {\n          color: var(--lion-primary);\n        }\n\n        .wa-template-editor-overlay.lion-dark .wizard-step-line {\n          background: #3f3f46;\n        }\n\n        .wa-template-editor-overlay.lion-dark .status-card {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .status-label {\n          color: #fafafa !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .status-hint {\n          color: #a1a1aa !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-template-editor-footer {\n          background: #18181b !important;\n          border-top-color: #27272a !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-btn-secondary {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #e5e7eb !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-btn-secondary:hover {\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .variable-pill {\n          background: rgba(var(--lion-primary-rgb), 0.15) !important;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-template-editor-body::-webkit-scrollbar-thumb {\n          background: #3f3f46;\n        }\n\n        .wa-template-editor-overlay.lion-dark .wa-template-editor-body::-webkit-scrollbar-thumb:hover {\n          background: #52525b;\n        }\n      '))},ta=({category:e,isActive:t,isDragOver:n,count:r,displayName:o,onClick:i})=>{const{setNodeRef:s,isOver:l}=Qt({id:`category-drop-${e.id}`}),c=n||l;return a.createElement("div",{ref:s,className:`template-sidebar-category ${t?"active":""} ${c?"drag-over":""}`,onClick:i},a.createElement("span",{className:"category-icon"},e.icon),a.createElement("span",{className:"category-name"},o),a.createElement("span",{className:"category-count"},r))},na=({categories:e,selectedCategoryId:t,templateCounts:n,onSelectCategory:r,onAddCategory:o,onManageCategories:i,dragOverCategoryId:l})=>{const c=e.filter(e=>e.id===Nn.gh.ALL||e.id===Nn.gh.QUICK_REPLY),d=e.filter(e=>!Object.values(Nn.gh).includes(e.id)),m=e.find(e=>e.id===Nn.gh.UNCATEGORIZED),p=e=>e.id===Nn.gh.ALL?(0,s.t)("templates.allTemplates")||"All Templates":e.id===Nn.gh.QUICK_REPLY?(0,s.t)("templates.quickReplyCategory")||"Quick Reply":e.id===Nn.gh.UNCATEGORIZED?(0,s.t)("templates.uncategorized")||"Uncategorized":e.name,u=e=>a.createElement(ta,{key:e.id,category:e,isActive:t===e.id,isDragOver:l===e.id,count:n[e.id]||0,displayName:p(e),onClick:()=>r(e.id)});return a.createElement("div",{className:"template-sidebar"},a.createElement("div",{className:"template-sidebar-header"},a.createElement("img",{src:"undefined"!=typeof chrome&&chrome.runtime?chrome.runtime.getURL("icons/logo.png"):"icons/logo.png",alt:"CRM",className:"sidebar-logo"}),a.createElement("span",{className:"sidebar-title"},(0,s.t)("templates.title")||"Templates")),a.createElement("div",{className:"template-sidebar-section"},c.map(u)),d.length>0&&a.createElement("div",{className:"template-sidebar-divider"}),a.createElement("div",{className:"template-sidebar-section template-sidebar-categories"},d.map(u)),m&&a.createElement(a.Fragment,null,a.createElement("div",{className:"template-sidebar-divider"}),a.createElement("div",{className:"template-sidebar-section"},u(m))),a.createElement("div",{className:"template-sidebar-actions"},a.createElement("button",{className:"sidebar-action-btn sidebar-action-add",onClick:o},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"})),(0,s.t)("templates.addCategory")||"Add Category"),a.createElement("button",{className:"sidebar-action-btn sidebar-action-manage",onClick:i},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"3"}),a.createElement("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})),(0,s.t)("templates.manageCategories")||"Manage")),a.createElement("style",null,"\n        .template-sidebar {\n          width: 240px;\n          min-width: 240px;\n          background: linear-gradient(180deg, var(--lion-sidebar-start) 0%, var(--lion-sidebar-end) 100%);\n          display: flex;\n          flex-direction: column;\n          border-radius: 20px 0 0 20px;\n          overflow: hidden;\n        }\n\n        .template-sidebar-header {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          padding: 20px 16px;\n          border-bottom: 1px solid var(--lion-sidebar-border);\n        }\n\n        .sidebar-logo {\n          width: 36px;\n          height: 36px;\n          object-fit: contain;\n        }\n\n        .sidebar-title {\n          font-size: 18px;\n          font-weight: 700;\n          color: #ffffff;\n        }\n\n        .template-sidebar-section {\n          padding: 12px 12px;\n        }\n\n        .template-sidebar-categories {\n          flex: 1;\n          overflow-y: auto;\n          max-height: calc(100vh - 400px);\n        }\n\n        .template-sidebar-divider {\n          height: 1px;\n          background: var(--lion-sidebar-border);\n          margin: 0 16px;\n        }\n\n        .template-sidebar-category {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          padding: 12px 14px;\n          border-radius: 10px;\n          color: var(--lion-sidebar-text-muted);\n          cursor: pointer;\n          transition: all 0.2s ease;\n          margin-bottom: 4px;\n        }\n\n        .template-sidebar-category:hover:not(.active) {\n          background: rgba(255, 255, 255, 0.05);\n          color: var(--lion-sidebar-text);\n        }\n\n        .template-sidebar-category.active {\n          background: var(--lion-primary);\n          color: #ffffff;\n        }\n\n        .template-sidebar-category.drag-over {\n          background: rgba(var(--lion-primary-rgb), 0.12) !important;\n          border: 2px dashed var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n          transform: scale(1.02);\n        }\n\n        .template-sidebar-category.drag-over .category-name {\n          color: var(--lion-primary) !important;\n          font-weight: 700 !important;\n        }\n\n        .category-icon {\n          font-size: 18px;\n          width: 24px;\n          text-align: center;\n        }\n\n        .category-name {\n          flex: 1;\n          font-size: 14px;\n          font-weight: 500;\n          white-space: nowrap;\n          overflow: hidden;\n          text-overflow: ellipsis;\n        }\n\n        .category-count {\n          font-size: 12px;\n          background: rgba(255, 255, 255, 0.1);\n          padding: 2px 8px;\n          border-radius: 10px;\n          min-width: 24px;\n          text-align: center;\n        }\n\n        .template-sidebar-category.active .category-count {\n          background: rgba(255, 255, 255, 0.2);\n        }\n\n        .template-sidebar-actions {\n          padding: 16px 12px;\n          border-top: 1px solid var(--lion-sidebar-border);\n          display: flex;\n          flex-direction: column;\n          gap: 8px;\n        }\n\n        .sidebar-action-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 8px;\n          padding: 10px 14px;\n          border-radius: 10px;\n          font-size: 13px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s ease;\n          border: none;\n        }\n\n        .sidebar-action-add {\n          background: var(--lion-primary);\n          color: #ffffff;\n        }\n\n        .sidebar-action-add:hover {\n          box-shadow: var(--lion-shadow-primary);\n          transform: translateY(-1px);\n        }\n\n        .sidebar-action-manage {\n          background: rgba(255, 255, 255, 0.05);\n          color: var(--lion-sidebar-text-muted);\n          border: 1px solid var(--lion-sidebar-border);\n        }\n\n        .sidebar-action-manage:hover {\n          background: rgba(255, 255, 255, 0.1);\n          color: var(--lion-sidebar-text);\n        }\n\n        /* ============================================================ */\n        /* ============ V2 REDESIGN OVERRIDES (LIGHT) ================ */\n        /* ============================================================ */\n\n        .template-sidebar {\n          background: #fafafa !important;\n          background-image: none !important;\n          border-right: 1px solid #f0f0f0 !important;\n          border-radius: 16px 0 0 16px !important;\n          width: 240px !important;\n          flex-shrink: 0 !important;\n          display: flex !important;\n          flex-direction: column !important;\n        }\n\n        .template-sidebar-header {\n          background: #ffffff !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n          padding: 18px 16px !important;\n          display: flex !important;\n          align-items: center !important;\n          gap: 12px !important;\n          color: #1f2937 !important;\n        }\n\n        .template-sidebar-header img,\n        .template-sidebar-header svg,\n        .template-sidebar-header .sidebar-logo {\n          width: 34px !important;\n          height: 34px !important;\n          border-radius: 10px !important;\n          background: var(--lion-primary) !important;\n          padding: 6px !important;\n          color: #ffffff !important;\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.25) !important;\n          flex-shrink: 0 !important;\n        }\n\n        .template-sidebar-header h2,\n        .template-sidebar-header span {\n          color: #1f2937 !important;\n          font-size: 15px !important;\n          font-weight: 700 !important;\n        }\n\n        .template-sidebar-section {\n          padding: 14px 10px 8px !important;\n          color: #9ca3af !important;\n          font-size: 10px !important;\n          font-weight: 700 !important;\n          text-transform: uppercase !important;\n          letter-spacing: 0.5px !important;\n        }\n\n        .template-sidebar-category {\n          display: flex !important;\n          align-items: center !important;\n          gap: 10px !important;\n          padding: 10px 14px !important;\n          margin: 2px 10px !important;\n          border-radius: 10px !important;\n          color: #52525b !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n          background: transparent !important;\n          background-image: none !important;\n          border: 1px solid transparent !important;\n        }\n\n        .template-sidebar-category:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          color: var(--lion-primary) !important;\n          border-color: rgba(var(--lion-primary-rgb), 0.15) !important;\n        }\n\n        .template-sidebar-category.active {\n          background: var(--lion-primary) !important;\n          background-image: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border-color: transparent !important;\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.28) !important;\n        }\n\n        .template-sidebar-category.active .count-badge,\n        .template-sidebar-category.active span {\n          color: #ffffff !important;\n        }\n\n        .template-sidebar-category .count-badge,\n        .template-sidebar-category > span:last-child {\n          margin-left: auto !important;\n          background: rgba(var(--lion-primary-rgb), 0.12) !important;\n          color: var(--lion-primary) !important;\n          padding: 2px 8px !important;\n          border-radius: 999px !important;\n          font-size: 11px !important;\n          font-weight: 700 !important;\n        }\n\n        .template-sidebar-category.active .count-badge,\n        .template-sidebar-category.active > span:last-child {\n          background: rgba(255, 255, 255, 0.25) !important;\n          color: #ffffff !important;\n        }\n\n        .template-sidebar-divider {\n          height: 1px !important;\n          background: #f0f0f0 !important;\n          margin: 10px 16px !important;\n        }\n\n        .template-sidebar-actions {\n          margin-top: auto !important;\n          padding: 14px 12px !important;\n          border-top: 1px solid #f0f0f0 !important;\n          display: flex !important;\n          flex-direction: column !important;\n          gap: 8px !important;\n        }\n\n        .sidebar-action-btn,\n        .sidebar-action-add {\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          gap: 8px !important;\n          padding: 10px 14px !important;\n          background: var(--lion-primary) !important;\n          background-image: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border: none !important;\n          border-radius: 10px !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .sidebar-action-btn:hover,\n        .sidebar-action-add:hover {\n          transform: translateY(-1px) !important;\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n        }\n\n        .sidebar-action-manage {\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          gap: 8px !important;\n          padding: 10px 14px !important;\n          background: #ffffff !important;\n          color: #374151 !important;\n          border: 1px solid #e5e7eb !important;\n          border-radius: 10px !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n          box-shadow: none !important;\n        }\n\n        .sidebar-action-manage:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        /* Dark mode */\n        .lion-dark .template-sidebar {\n          background: #1a1a1a !important;\n          border-right-color: #27272a !important;\n        }\n\n        .lion-dark .template-sidebar-header {\n          background: #18181b !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        .lion-dark .template-sidebar-header h2,\n        .lion-dark .template-sidebar-header span {\n          color: #fafafa !important;\n        }\n\n        .lion-dark .template-sidebar-category {\n          color: #a1a1aa !important;\n        }\n\n        .lion-dark .template-sidebar-category:hover {\n          background: rgba(var(--lion-primary-rgb), 0.12) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        .lion-dark .template-sidebar-divider {\n          background: #27272a !important;\n        }\n\n        .lion-dark .template-sidebar-actions {\n          border-top-color: #27272a !important;\n        }\n\n        .lion-dark .sidebar-action-manage {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #e5e7eb !important;\n        }\n\n        .lion-dark .sidebar-action-manage:hover {\n          background: rgba(var(--lion-primary-rgb), 0.15) !important;\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n      "))},aa={individual:{bg:"rgba(59, 130, 246, 0.1)",color:"#7C3AED",label:"One to One"},tab:{bg:"rgba(236, 72, 153, 0.1)",color:"#db2777",label:"Tab"},group:{bg:"rgba(245, 158, 11, 0.1)",color:"#6D28D9",label:"Group"},label:{bg:"rgba(99, 102, 241, 0.1)",color:"#6D28D9",label:"Label"},kanban:{bg:"rgba(139, 92, 246, 0.1)",color:"#7C3AED",label:"Kanban"},quick_reply:{bg:"rgba(var(--lion-primary-rgb), 0.1)",color:"var(--lion-primary)",label:"Quick Reply"}},ra={none:{icon:"📝",label:"Text"},"image/video":{icon:"🖼️",label:"Media"},document:{icon:"📄",label:"Document"},audio:{icon:"🎵",label:"Audio"},contact:{icon:"👤",label:"Contact"},poll:{icon:"📊",label:"Poll"},list:{icon:"📋",label:"List"},product:{icon:"🛍️",label:"Product"},buttons:{icon:"🔘",label:"Buttons"},fluxo:{icon:"🤖",label:"Fluxo"}},oa=({template:e,onEdit:t,onDuplicate:n,onDelete:r,onToggleActive:o})=>{const i=aa[e.messageType],l=ra[e.sendAttachmentType||"none"],c=e.messages&&e.messages.length>0?e.messages[0].message:e.message,d=e.messages?.length||1;return a.createElement("div",{className:"template-card "+(e.isActive?"":"inactive")},a.createElement("div",{className:"template-card-header"},a.createElement("h3",{className:"template-card-name"},e.templeteName||"Untitled Template"),a.createElement("button",{className:"template-status-toggle "+(e.isActive?"active":""),onClick:t=>{t.stopPropagation(),o(e)},title:e.isActive?"Deactivate":"Activate"},e.isActive?a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),a.createElement("circle",{cx:"12",cy:"12",r:"3"})):a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),a.createElement("line",{x1:"1",y1:"1",x2:"23",y2:"23"})))),a.createElement("div",{className:"template-card-badges"},a.createElement("span",{className:"template-badge",style:{background:i.bg,color:i.color}},i.label),a.createElement("span",{className:"template-badge template-badge-attachment"},l.icon," ",l.label),d>1&&a.createElement("span",{className:"template-badge template-badge-multi"},d," ",(0,s.t)("templates.msgs")||"msgs"),!e.isActive&&a.createElement("span",{className:"template-badge template-badge-inactive"},(0,s.t)("templates.inactive")||"Inactive")),a.createElement("div",{className:"template-card-preview"},c?c.substring(0,120)+(c.length>120?"...":""):a.createElement("span",{className:"no-preview"},(0,s.t)("templates.noMessageContent")||"No message content")),a.createElement("div",{className:"template-card-meta"},a.createElement("span",{className:"meta-date"},new Date(e.modifiedAt).toLocaleDateString())),a.createElement("div",{className:"template-card-actions"},a.createElement("button",{className:"card-action-btn",onClick:n=>{n.stopPropagation(),t(e)},title:(0,s.t)("templates.edit")||"Edit"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})),(0,s.t)("templates.edit")||"Edit"),a.createElement("button",{className:"card-action-btn",onClick:t=>{t.stopPropagation(),n(e)},title:(0,s.t)("templates.copy")||"Copy"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),a.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})),(0,s.t)("templates.copy")||"Copy"),a.createElement("button",{className:"card-action-btn card-action-delete",onClick:t=>{t.stopPropagation(),r(e)},title:(0,s.t)("templates.delete")||"Delete"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"3 6 5 6 21 6"}),a.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})),(0,s.t)("templates.delete")||"Delete")),a.createElement("style",null,"\n        .template-card {\n          background: var(--lion-bg-primary);\n          border-radius: 14px;\n          border: 1px solid var(--lion-border-light);\n          padding: 16px;\n          transition: all 0.2s ease;\n          cursor: pointer;\n          display: flex;\n          flex-direction: column;\n          gap: 12px;\n        }\n\n        .template-card:hover {\n          box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);\n          transform: translateY(-2px);\n          border-color: var(--lion-primary);\n        }\n\n        .template-card.inactive {\n          opacity: 0.7;\n          background: var(--lion-bg-secondary);\n        }\n\n        .template-card-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: flex-start;\n          gap: 8px;\n        }\n\n        .template-card-name {\n          font-size: 15px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          margin: 0;\n          line-height: 1.3;\n          flex: 1;\n          overflow: hidden;\n          text-overflow: ellipsis;\n          display: -webkit-box;\n          -webkit-line-clamp: 2;\n          -webkit-box-orient: vertical;\n        }\n\n        .template-status-toggle {\n          width: 28px;\n          height: 28px;\n          border-radius: 8px;\n          border: none;\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.2s ease;\n          flex-shrink: 0;\n        }\n\n        .template-status-toggle:hover {\n          background: var(--lion-border-light);\n        }\n\n        .template-status-toggle.active {\n          background: var(--lion-success-light);\n          color: var(--lion-success);\n        }\n\n        .template-card-badges {\n          display: flex;\n          gap: 6px;\n          flex-wrap: wrap;\n        }\n\n        .template-badge {\n          padding: 3px 8px;\n          border-radius: 6px;\n          font-size: 11px;\n          font-weight: 500;\n        }\n\n        .template-badge-attachment {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-secondary);\n        }\n\n        .template-badge-multi {\n          background: var(--lion-warning-light);\n          color: var(--lion-warning);\n        }\n\n        .template-badge-inactive {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n        }\n\n        .template-card-preview {\n          font-size: 13px;\n          color: var(--lion-text-muted);\n          line-height: 1.5;\n          min-height: 40px;\n          max-height: 60px;\n          overflow: hidden;\n        }\n\n        .template-card-preview .no-preview {\n          font-style: italic;\n          color: var(--lion-text-muted);\n        }\n\n        .template-card-meta {\n          font-size: 11px;\n          color: var(--lion-text-muted);\n        }\n\n        .template-card-actions {\n          display: flex;\n          gap: 8px;\n          padding-top: 12px;\n          border-top: 1px solid var(--lion-bg-tertiary);\n        }\n\n        .card-action-btn {\n          flex: 1;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 4px;\n          padding: 8px 12px;\n          border-radius: 8px;\n          border: none;\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n          font-size: 12px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s ease;\n        }\n\n        .card-action-btn:hover {\n          background: var(--lion-border-light);\n          color: var(--lion-text-primary);\n        }\n\n        .card-action-btn.card-action-delete:hover {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n        }\n\n        /* ============================================================ */\n        /* ============ V2 REDESIGN OVERRIDES (LIGHT) ================ */\n        /* ============================================================ */\n\n        .template-card {\n          background: #ffffff !important;\n          border: 1px solid #f0f0f0 !important;\n          border-radius: 14px !important;\n          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;\n          padding: 16px !important;\n          transition: all 0.2s ease !important;\n          display: flex !important;\n          flex-direction: column !important;\n          gap: 10px !important;\n          position: relative !important;\n        }\n\n        .template-card:hover {\n          border-color: rgba(var(--lion-primary-rgb), 0.3) !important;\n          box-shadow: 0 6px 18px rgba(var(--lion-primary-rgb), 0.1), 0 2px 6px rgba(0,0,0,0.04) !important;\n          transform: translateY(-2px) !important;\n        }\n\n        .template-card-header {\n          display: flex !important;\n          align-items: flex-start !important;\n          justify-content: space-between !important;\n          gap: 10px !important;\n        }\n\n        .template-card-header h3,\n        .template-card-header .template-card-name {\n          color: #1f2937 !important;\n          font-size: 14px !important;\n          font-weight: 700 !important;\n          margin: 0 !important;\n          line-height: 1.3 !important;\n          flex: 1 !important;\n          word-break: break-word !important;\n        }\n\n        .template-card-status-btn {\n          width: 28px !important;\n          height: 28px !important;\n          background: #f4f4f5 !important;\n          border: 1px solid #e5e7eb !important;\n          border-radius: 8px !important;\n          color: #9ca3af !important;\n          cursor: pointer !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          padding: 0 !important;\n          flex-shrink: 0 !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .template-card-status-btn.active {\n          background: rgba(16, 185, 129, 0.1) !important;\n          border-color: rgba(16, 185, 129, 0.3) !important;\n          color: #10b981 !important;\n        }\n\n        .template-card-badges {\n          display: flex !important;\n          flex-wrap: wrap !important;\n          gap: 6px !important;\n          align-items: center !important;\n        }\n\n        .template-card-badges .badge,\n        .template-card-badges > span {\n          padding: 3px 10px !important;\n          border-radius: 999px !important;\n          font-size: 11px !important;\n          font-weight: 700 !important;\n          display: inline-flex !important;\n          align-items: center !important;\n          gap: 4px !important;\n          border: 1px solid rgba(0, 0, 0, 0.06) !important;\n        }\n\n        .template-card-preview {\n          color: #6b7280 !important;\n          font-size: 12px !important;\n          line-height: 1.5 !important;\n          display: -webkit-box !important;\n          -webkit-line-clamp: 3 !important;\n          -webkit-box-orient: vertical !important;\n          overflow: hidden !important;\n          margin: 0 !important;\n          padding: 10px 12px !important;\n          background: #fafafa !important;\n          border-radius: 8px !important;\n          border: 1px solid #f4f4f5 !important;\n        }\n\n        .template-card-meta {\n          color: #9ca3af !important;\n          font-size: 11px !important;\n          font-weight: 500 !important;\n          margin: 0 !important;\n        }\n\n        .template-card-actions {\n          display: flex !important;\n          gap: 6px !important;\n          padding-top: 10px !important;\n          border-top: 1px solid #f4f4f5 !important;\n          margin-top: 2px !important;\n        }\n\n        .card-action-btn,\n        .template-card-actions button {\n          flex: 1 !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          gap: 5px !important;\n          padding: 7px 10px !important;\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          color: #374151 !important;\n          border-radius: 8px !important;\n          font-size: 12px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .card-action-btn:hover,\n        .template-card-actions button:hover {\n          background: rgba(var(--lion-primary-rgb), 0.06) !important;\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        .card-action-btn.card-action-delete:hover,\n        .template-card-actions button.card-action-delete:hover {\n          background: rgba(239, 68, 68, 0.08) !important;\n          border-color: #ef4444 !important;\n          color: #ef4444 !important;\n        }\n\n        .card-action-btn svg,\n        .template-card-actions button svg {\n          width: 13px !important;\n          height: 13px !important;\n        }\n\n        .template-card-drag-handle {\n          opacity: 0.3 !important;\n          transition: opacity 0.15s ease !important;\n        }\n\n        .template-card:hover .template-card-drag-handle {\n          opacity: 0.7 !important;\n        }\n\n        /* Dark mode */\n        .lion-dark .template-card {\n          background: #1f1f22 !important;\n          border-color: #27272a !important;\n        }\n\n        .lion-dark .template-card:hover {\n          border-color: rgba(var(--lion-primary-rgb), 0.4) !important;\n        }\n\n        .lion-dark .template-card-header h3,\n        .lion-dark .template-card-header .template-card-name {\n          color: #fafafa !important;\n        }\n\n        .lion-dark .template-card-preview {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #a1a1aa !important;\n        }\n\n        .lion-dark .template-card-meta {\n          color: #71717a !important;\n        }\n\n        .lion-dark .template-card-actions {\n          border-top-color: #27272a !important;\n        }\n\n        .lion-dark .card-action-btn,\n        .lion-dark .template-card-actions button {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #e5e7eb !important;\n        }\n\n        .lion-dark .template-card-status-btn {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #71717a !important;\n        }\n      "))},ia=({template:e,isDraggable:t=!0,...n})=>{const{attributes:r,listeners:o,setNodeRef:i,transform:l,transition:c,isDragging:d}=Cn({id:e.id,disabled:!t}),m={transform:re.Transform.toString(l),transition:c,opacity:d?.5:1,zIndex:d?1e3:"auto"},p=aa[e.messageType],u=ra[e.sendAttachmentType||"none"],g=e.messages&&e.messages.length>0?e.messages[0].message:e.message,h=e.messages?.length||1;return a.createElement("div",{ref:i,style:m,className:`template-card ${e.isActive?"":"inactive"} ${d?"dragging":""}`},t&&a.createElement("div",{className:"template-card-drag-handle",...r,...o},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M8 6h2v2H8V6zm6 0h2v2h-2V6zM8 11h2v2H8v-2zm6 0h2v2h-2v-2zm-6 5h2v2H8v-2zm6 0h2v2h-2v-2z"}))),a.createElement("div",{className:"template-card-header"},a.createElement("h3",{className:"template-card-name"},e.templeteName||"Untitled Template"),a.createElement("button",{className:"template-status-toggle "+(e.isActive?"active":""),onClick:t=>{t.stopPropagation(),n.onToggleActive(e)},title:e.isActive?"Deactivate":"Activate"},e.isActive?a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),a.createElement("circle",{cx:"12",cy:"12",r:"3"})):a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),a.createElement("line",{x1:"1",y1:"1",x2:"23",y2:"23"})))),a.createElement("div",{className:"template-card-badges"},a.createElement("span",{className:"template-badge",style:{background:p.bg,color:p.color}},p.label),a.createElement("span",{className:"template-badge template-badge-attachment"},u.icon," ",u.label),h>1&&a.createElement("span",{className:"template-badge template-badge-multi"},h," ",(0,s.t)("templates.msgs")||"msgs"),!e.isActive&&a.createElement("span",{className:"template-badge template-badge-inactive"},(0,s.t)("templates.inactive")||"Inactive")),a.createElement("div",{className:"template-card-preview"},g?g.substring(0,120)+(g.length>120?"...":""):a.createElement("span",{className:"no-preview"},(0,s.t)("templates.noMessageContent")||"No message content")),a.createElement("div",{className:"template-card-meta"},a.createElement("span",{className:"meta-date"},new Date(e.modifiedAt).toLocaleDateString())),a.createElement("div",{className:"template-card-actions"},a.createElement("button",{className:"card-action-btn",onClick:t=>{t.stopPropagation(),n.onEdit(e)},title:(0,s.t)("templates.edit")||"Edit"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})),(0,s.t)("templates.edit")||"Edit"),a.createElement("button",{className:"card-action-btn",onClick:t=>{t.stopPropagation(),n.onDuplicate(e)},title:(0,s.t)("templates.copy")||"Copy"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),a.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})),(0,s.t)("templates.copy")||"Copy"),a.createElement("button",{className:"card-action-btn card-action-delete",onClick:t=>{t.stopPropagation(),n.onDelete(e)},title:(0,s.t)("templates.delete")||"Delete"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"3 6 5 6 21 6"}),a.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})),(0,s.t)("templates.delete")||"Delete")),a.createElement("style",null,"\n        .template-card {\n          background: var(--lion-bg-primary);\n          border-radius: 14px;\n          border: 1px solid var(--lion-border-light);\n          padding: 16px;\n          transition: all 0.2s ease;\n          cursor: pointer;\n          display: flex;\n          flex-direction: column;\n          gap: 12px;\n          position: relative;\n        }\n\n        .template-card:hover {\n          box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);\n          transform: translateY(-2px);\n          border-color: var(--lion-primary);\n        }\n\n        .template-card.inactive {\n          opacity: 0.7;\n          background: var(--lion-bg-secondary);\n        }\n\n        .template-card.dragging {\n          box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);\n          border-color: var(--lion-primary);\n        }\n\n        .template-card-drag-handle {\n          position: absolute;\n          top: 8px;\n          left: 50%;\n          transform: translateX(-50%);\n          width: 32px;\n          height: 16px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          color: var(--lion-text-muted);\n          cursor: grab;\n          opacity: 0;\n          transition: opacity 0.2s ease;\n          border-radius: 4px;\n        }\n\n        .template-card:hover .template-card-drag-handle {\n          opacity: 0.5;\n        }\n\n        .template-card-drag-handle:hover {\n          opacity: 1 !important;\n          background: var(--lion-bg-tertiary);\n        }\n\n        .template-card-drag-handle:active {\n          cursor: grabbing;\n        }\n\n        .template-card-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: flex-start;\n          gap: 8px;\n        }\n\n        .template-card-name {\n          font-size: 15px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          margin: 0;\n          line-height: 1.3;\n          flex: 1;\n          overflow: hidden;\n          text-overflow: ellipsis;\n          display: -webkit-box;\n          -webkit-line-clamp: 2;\n          -webkit-box-orient: vertical;\n        }\n\n        .template-status-toggle {\n          width: 28px;\n          height: 28px;\n          border-radius: 8px;\n          border: none;\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.2s ease;\n          flex-shrink: 0;\n        }\n\n        .template-status-toggle:hover {\n          background: var(--lion-border-light);\n        }\n\n        .template-status-toggle.active {\n          background: var(--lion-success-light);\n          color: var(--lion-success);\n        }\n\n        .template-card-badges {\n          display: flex;\n          gap: 6px;\n          flex-wrap: wrap;\n        }\n\n        .template-badge {\n          padding: 3px 8px;\n          border-radius: 6px;\n          font-size: 11px;\n          font-weight: 500;\n        }\n\n        .template-badge-attachment {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-secondary);\n        }\n\n        .template-badge-multi {\n          background: var(--lion-warning-light);\n          color: var(--lion-warning);\n        }\n\n        .template-badge-inactive {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n        }\n\n        .template-card-preview {\n          font-size: 13px;\n          color: var(--lion-text-muted);\n          line-height: 1.5;\n          min-height: 40px;\n          max-height: 60px;\n          overflow: hidden;\n        }\n\n        .template-card-preview .no-preview {\n          font-style: italic;\n          color: var(--lion-text-muted);\n        }\n\n        .template-card-meta {\n          font-size: 11px;\n          color: var(--lion-text-muted);\n        }\n\n        .template-card-actions {\n          display: flex;\n          gap: 8px;\n          padding-top: 12px;\n          border-top: 1px solid var(--lion-bg-tertiary);\n        }\n\n        .card-action-btn {\n          flex: 1;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 4px;\n          padding: 8px 12px;\n          border-radius: 8px;\n          border: none;\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n          font-size: 12px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s ease;\n        }\n\n        .card-action-btn:hover {\n          background: var(--lion-border-light);\n          color: var(--lion-text-primary);\n        }\n\n        .card-action-btn.card-action-delete:hover {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n        }\n\n        /* ============================================================ */\n        /* ============ V2 REDESIGN OVERRIDES (LIGHT) ================ */\n        /* ============================================================ */\n\n        .template-card {\n          background: #ffffff !important;\n          border: 1px solid #f0f0f0 !important;\n          border-radius: 14px !important;\n          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;\n          padding: 16px !important;\n          transition: all 0.2s ease !important;\n          display: flex !important;\n          flex-direction: column !important;\n          gap: 10px !important;\n          position: relative !important;\n        }\n\n        .template-card:hover {\n          border-color: rgba(var(--lion-primary-rgb), 0.3) !important;\n          box-shadow: 0 6px 18px rgba(var(--lion-primary-rgb), 0.1), 0 2px 6px rgba(0,0,0,0.04) !important;\n          transform: translateY(-2px) !important;\n        }\n\n        .template-card-header {\n          display: flex !important;\n          align-items: flex-start !important;\n          justify-content: space-between !important;\n          gap: 10px !important;\n        }\n\n        .template-card-header h3,\n        .template-card-header .template-card-name {\n          color: #1f2937 !important;\n          font-size: 14px !important;\n          font-weight: 700 !important;\n          margin: 0 !important;\n          line-height: 1.3 !important;\n          flex: 1 !important;\n          word-break: break-word !important;\n        }\n\n        .template-card-status-btn {\n          width: 28px !important;\n          height: 28px !important;\n          background: #f4f4f5 !important;\n          border: 1px solid #e5e7eb !important;\n          border-radius: 8px !important;\n          color: #9ca3af !important;\n          cursor: pointer !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          padding: 0 !important;\n          flex-shrink: 0 !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .template-card-status-btn.active {\n          background: rgba(16, 185, 129, 0.1) !important;\n          border-color: rgba(16, 185, 129, 0.3) !important;\n          color: #10b981 !important;\n        }\n\n        .template-card-badges {\n          display: flex !important;\n          flex-wrap: wrap !important;\n          gap: 6px !important;\n          align-items: center !important;\n        }\n\n        .template-card-badges .badge,\n        .template-card-badges > span {\n          padding: 3px 10px !important;\n          border-radius: 999px !important;\n          font-size: 11px !important;\n          font-weight: 700 !important;\n          display: inline-flex !important;\n          align-items: center !important;\n          gap: 4px !important;\n          border: 1px solid rgba(0, 0, 0, 0.06) !important;\n        }\n\n        .template-card-preview {\n          color: #6b7280 !important;\n          font-size: 12px !important;\n          line-height: 1.5 !important;\n          display: -webkit-box !important;\n          -webkit-line-clamp: 3 !important;\n          -webkit-box-orient: vertical !important;\n          overflow: hidden !important;\n          margin: 0 !important;\n          padding: 10px 12px !important;\n          background: #fafafa !important;\n          border-radius: 8px !important;\n          border: 1px solid #f4f4f5 !important;\n        }\n\n        .template-card-meta {\n          color: #9ca3af !important;\n          font-size: 11px !important;\n          font-weight: 500 !important;\n          margin: 0 !important;\n        }\n\n        .template-card-actions {\n          display: flex !important;\n          gap: 6px !important;\n          padding-top: 10px !important;\n          border-top: 1px solid #f4f4f5 !important;\n          margin-top: 2px !important;\n        }\n\n        .card-action-btn,\n        .template-card-actions button {\n          flex: 1 !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          gap: 5px !important;\n          padding: 7px 10px !important;\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          color: #374151 !important;\n          border-radius: 8px !important;\n          font-size: 12px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .card-action-btn:hover,\n        .template-card-actions button:hover {\n          background: rgba(var(--lion-primary-rgb), 0.06) !important;\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        .card-action-btn.card-action-delete:hover,\n        .template-card-actions button.card-action-delete:hover {\n          background: rgba(239, 68, 68, 0.08) !important;\n          border-color: #ef4444 !important;\n          color: #ef4444 !important;\n        }\n\n        .card-action-btn svg,\n        .template-card-actions button svg {\n          width: 13px !important;\n          height: 13px !important;\n        }\n\n        .template-card-drag-handle {\n          opacity: 0.3 !important;\n          transition: opacity 0.15s ease !important;\n        }\n\n        .template-card:hover .template-card-drag-handle {\n          opacity: 0.7 !important;\n        }\n\n        /* Dark mode */\n        .lion-dark .template-card {\n          background: #1f1f22 !important;\n          border-color: #27272a !important;\n        }\n\n        .lion-dark .template-card:hover {\n          border-color: rgba(var(--lion-primary-rgb), 0.4) !important;\n        }\n\n        .lion-dark .template-card-header h3,\n        .lion-dark .template-card-header .template-card-name {\n          color: #fafafa !important;\n        }\n\n        .lion-dark .template-card-preview {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #a1a1aa !important;\n        }\n\n        .lion-dark .template-card-meta {\n          color: #71717a !important;\n        }\n\n        .lion-dark .template-card-actions {\n          border-top-color: #27272a !important;\n        }\n\n        .lion-dark .card-action-btn,\n        .lion-dark .template-card-actions button {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #e5e7eb !important;\n        }\n\n        .lion-dark .template-card-status-btn {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #71717a !important;\n        }\n      "))},sa={primary:"#7C3AED",primaryHover:"#6D28D9",primaryLight:"#eff6ff",primaryDark:"#1e40af",accent:"#7C3AED",headerBg:"#ffffff",headerBorder:"#f0f0f0",headerText:"#1f2937",headerTextMuted:"#52525b",iconColor:"#52525b",iconHoverColor:"#1f2937",sidebarStart:"#ffffff",sidebarEnd:"#ffffff",sidebarBorder:"#f0f0f0",sidebarText:"#1f2937",sidebarTextMuted:"#52525b",bgPrimary:"#ffffff",bgSecondary:"#fafafa",bgTertiary:"#f4f4f5",bgHover:"#f3f4f6",tabBarBg:"#fafafa",tabBarBorder:"#f0f0f0",textPrimary:"#1f2937",textSecondary:"#374151",textMuted:"#6b7280",textLight:"#9ca3af",borderLight:"#e5e7eb",borderMedium:"#d1d5db",borderDark:"#9ca3af",success:"#10b981",successLight:"#ecfdf5",error:"#ef4444",errorLight:"#fef2f2",warning:"#0ea5e9",warningLight:"#eff6ff",info:"#3b82f6",infoLight:"#eff6ff",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.05)",shadowMd:"0 4px 6px rgba(0, 0, 0, 0.1)",shadowLg:"0 10px 15px rgba(0, 0, 0, 0.1)",shadowXl:"0 20px 25px rgba(0, 0, 0, 0.15)",shadowPrimary:"0 4px 12px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.25)",radiusSm:"4px",radiusMd:"8px",radiusLg:"12px",radiusXl:"16px",radiusFull:"9999px",spacingXs:"4px",spacingSm:"8px",spacingMd:"12px",spacingLg:"16px",spacingXl:"24px",spacing2xl:"32px",fontXs:"11px",fontSm:"12px",fontMd:"14px",fontLg:"16px",fontXl:"18px",font2xl:"20px",font3xl:"24px"},la={primary:"#7C3AED",primaryHover:"#6D28D9",primaryLight:"#172554",primaryDark:"#1e40af",accent:"#7C3AED",headerBg:"#18181b",headerBorder:"#27272a",headerText:"#fafafa",headerTextMuted:"#a1a1aa",iconColor:"#a1a1aa",iconHoverColor:"#fafafa",sidebarStart:"#18181b",sidebarEnd:"#18181b",sidebarBorder:"#27272a",sidebarText:"#fafafa",sidebarTextMuted:"#a1a1aa",bgPrimary:"#1a1a1a",bgSecondary:"#212124",bgTertiary:"#27272a",bgHover:"#27272a",tabBarBg:"#1a1a1a",tabBarBorder:"#27272a",textPrimary:"#fafafa",textSecondary:"#e5e7eb",textMuted:"#a1a1aa",textLight:"#71717a",borderLight:"#3f3f46",borderMedium:"#52525b",borderDark:"#71717a",success:"#22c55e",successLight:"#14532d",error:"#f87171",errorLight:"#7f1d1d",warning:"#60a5fa",warningLight:"#1e3a8a",info:"#60a5fa",infoLight:"#1e3a5f",shadowSm:"0 1px 2px rgba(0, 0, 0, 0.3)",shadowMd:"0 4px 6px rgba(0, 0, 0, 0.4)",shadowLg:"0 10px 15px rgba(0, 0, 0, 0.4)",shadowXl:"0 20px 25px rgba(0, 0, 0, 0.5)",shadowPrimary:"0 4px 12px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.3)",radiusSm:"4px",radiusMd:"8px",radiusLg:"12px",radiusXl:"16px",radiusFull:"9999px",spacingXs:"4px",spacingSm:"8px",spacingMd:"12px",spacingLg:"16px",spacingXl:"24px",spacing2xl:"32px",fontXs:"11px",fontSm:"12px",fontMd:"14px",fontLg:"16px",fontXl:"18px",font2xl:"20px",font3xl:"24px"},ca=sa,da=e=>{const t=e.replace("#","");return`${parseInt(t.substring(0,2),16)}, ${parseInt(t.substring(2,4),16)}, ${parseInt(t.substring(4,6),16)}`},ma=`\n  :root, :host {\n    /* Primary Colors */\n    --lion-primary: ${sa.primary};\n    --lion-primary-rgb: ${da(sa.primary)};\n    --lion-primary-hover: ${sa.primaryHover};\n    --lion-primary-hover-rgb: ${da(sa.primaryHover)};\n    --lion-primary-light: ${sa.primaryLight};\n    --lion-primary-dark: ${sa.primaryDark};\n    --lion-accent: ${sa.accent};\n\n    /* Header - Clean White */\n    --lion-header-bg: ${sa.headerBg};\n    --lion-header-border: ${sa.headerBorder};\n    --lion-header-text: ${sa.headerText};\n    --lion-header-text-muted: ${sa.headerTextMuted};\n    --lion-icon-color: ${sa.iconColor};\n    --lion-icon-hover-color: ${sa.iconHoverColor};\n\n    /* Tab Bar */\n    --lion-tab-bar-bg: ${sa.tabBarBg};\n    --lion-tab-bar-border: ${sa.tabBarBorder};\n\n    /* Legacy Sidebar (backward compat) */\n    --lion-sidebar-start: ${sa.sidebarStart};\n    --lion-sidebar-end: ${sa.sidebarEnd};\n    --lion-sidebar-border: ${sa.sidebarBorder};\n    --lion-sidebar-text: ${sa.sidebarText};\n    --lion-sidebar-text-muted: ${sa.sidebarTextMuted};\n    --lion-sidebar-gradient: linear-gradient(180deg, ${sa.sidebarStart} 0%, ${sa.sidebarEnd} 100%);\n    --lion-header-gradient: ${sa.headerBg};\n\n    /* Background Colors */\n    --lion-bg-primary: ${sa.bgPrimary};\n    --lion-bg-secondary: ${sa.bgSecondary};\n    --lion-bg-tertiary: ${sa.bgTertiary};\n    --lion-bg-hover: ${sa.bgHover};\n\n    /* Text Colors */\n    --lion-text-primary: ${sa.textPrimary};\n    --lion-text-secondary: ${sa.textSecondary};\n    --lion-text-muted: ${sa.textMuted};\n    --lion-text-light: ${sa.textLight};\n\n    /* Border Colors */\n    --lion-border-light: ${sa.borderLight};\n    --lion-border-medium: ${sa.borderMedium};\n    --lion-border-dark: ${sa.borderDark};\n\n    /* Status Colors */\n    --lion-success: ${sa.success};\n    --lion-success-light: ${sa.successLight};\n    --lion-error: ${sa.error};\n    --lion-error-light: ${sa.errorLight};\n    --lion-warning: ${sa.warning};\n    --lion-warning-light: ${sa.warningLight};\n    --lion-info: ${sa.info};\n    --lion-info-light: ${sa.infoLight};\n\n    /* Shadows */\n    --lion-shadow-sm: ${sa.shadowSm};\n    --lion-shadow-md: ${sa.shadowMd};\n    --lion-shadow-lg: ${sa.shadowLg};\n    --lion-shadow-xl: ${sa.shadowXl};\n    --lion-shadow-primary: ${sa.shadowPrimary};\n\n    /* Border Radius */\n    --lion-radius-sm: ${sa.radiusSm};\n    --lion-radius-md: ${sa.radiusMd};\n    --lion-radius-lg: ${sa.radiusLg};\n    --lion-radius-xl: ${sa.radiusXl};\n    --lion-radius-full: ${sa.radiusFull};\n\n    /* Button Gradients */\n    --lion-btn-primary-gradient: linear-gradient(135deg, ${sa.primary} 0%, ${sa.primaryHover} 100%);\n    --lion-btn-primary-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.3);\n  }\n\n  /* Dark Mode CSS Variables */\n  :root.lion-dark,\n  :host.lion-dark,\n  html.lion-dark,\n  body.lion-dark,\n  .lion-dark {\n    /* Primary Colors */\n    --lion-primary: ${la.primary};\n    --lion-primary-rgb: ${da(la.primary)};\n    --lion-primary-hover: ${la.primaryHover};\n    --lion-primary-hover-rgb: ${da(la.primaryHover)};\n    --lion-primary-light: ${la.primaryLight};\n    --lion-primary-dark: ${la.primaryDark};\n    --lion-accent: ${la.accent};\n\n    /* Header - Near-black zinc */\n    --lion-header-bg: ${la.headerBg};\n    --lion-header-border: ${la.headerBorder};\n    --lion-header-text: ${la.headerText};\n    --lion-header-text-muted: ${la.headerTextMuted};\n    --lion-icon-color: ${la.iconColor};\n    --lion-icon-hover-color: ${la.iconHoverColor};\n\n    /* Tab Bar */\n    --lion-tab-bar-bg: ${la.tabBarBg};\n    --lion-tab-bar-border: ${la.tabBarBorder};\n\n    /* Legacy Sidebar */\n    --lion-sidebar-start: ${la.sidebarStart};\n    --lion-sidebar-end: ${la.sidebarEnd};\n    --lion-sidebar-border: ${la.sidebarBorder};\n    --lion-sidebar-text: ${la.sidebarText};\n    --lion-sidebar-text-muted: ${la.sidebarTextMuted};\n    --lion-sidebar-gradient: linear-gradient(180deg, ${la.sidebarStart} 0%, ${la.sidebarEnd} 100%);\n    --lion-header-gradient: ${la.headerBg};\n\n    /* Background Colors */\n    --lion-bg-primary: ${la.bgPrimary};\n    --lion-bg-secondary: ${la.bgSecondary};\n    --lion-bg-tertiary: ${la.bgTertiary};\n    --lion-bg-hover: ${la.bgHover};\n\n    /* Text Colors */\n    --lion-text-primary: ${la.textPrimary};\n    --lion-text-secondary: ${la.textSecondary};\n    --lion-text-muted: ${la.textMuted};\n    --lion-text-light: ${la.textLight};\n\n    /* Border Colors */\n    --lion-border-light: ${la.borderLight};\n    --lion-border-medium: ${la.borderMedium};\n    --lion-border-dark: ${la.borderDark};\n\n    /* Status Colors */\n    --lion-success: ${la.success};\n    --lion-success-light: ${la.successLight};\n    --lion-error: ${la.error};\n    --lion-error-light: ${la.errorLight};\n    --lion-warning: ${la.warning};\n    --lion-warning-light: ${la.warningLight};\n    --lion-info: ${la.info};\n    --lion-info-light: ${la.infoLight};\n\n    /* Shadows */\n    --lion-shadow-sm: ${la.shadowSm};\n    --lion-shadow-md: ${la.shadowMd};\n    --lion-shadow-lg: ${la.shadowLg};\n    --lion-shadow-xl: ${la.shadowXl};\n    --lion-shadow-primary: ${la.shadowPrimary};\n\n    /* Button Gradients */\n    --lion-btn-primary-gradient: linear-gradient(135deg, ${la.primary} 0%, ${la.primaryHover} 100%);\n    --lion-btn-primary-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.35);\n  }\n`,pa=({isOpen:e,category:t,onClose:n,onSave:r})=>{const[o,i]=(0,a.useState)(""),[l,c]=(0,a.useState)("📁"),[d,m]=(0,a.useState)(ca.primary),[p,u]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{t?(i(t.name),c(t.icon),m(t.color)):(i(""),c("📁"),m(ca.primary))},[t,e]),(0,a.useEffect)(()=>{const e=()=>{const e=_();u("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]);if(!e)return null;const g=!!t;return a.createElement("div",{className:"category-modal-overlay "+(p?"lion-dark":""),onClick:n},a.createElement("div",{className:"category-modal",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"category-modal-header"},a.createElement("h2",null,g?(0,s.t)("templates.editCategory")||"Edit Category":(0,s.t)("templates.addCategory")||"Add Category"),a.createElement("button",{className:"category-modal-close",onClick:n},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),a.createElement("form",{onSubmit:e=>{e.preventDefault(),o.trim()&&r({name:o.trim(),icon:l,color:d})}},a.createElement("div",{className:"category-modal-body"},a.createElement("div",{className:"form-group"},a.createElement("label",null,(0,s.t)("templates.categoryName")||"Category Name"," *"),a.createElement("input",{type:"text",value:o,onChange:e=>i(e.target.value),placeholder:"e.g., Marketing, Support, Sales",maxLength:50,autoFocus:!0})),a.createElement("div",{className:"form-group"},a.createElement("label",null,(0,s.t)("templates.categoryIcon")||"Icon"),a.createElement("div",{className:"icon-picker"},Nn.CS.map(e=>a.createElement("button",{key:e,type:"button",className:"icon-option "+(l===e?"selected":""),onClick:()=>c(e)},e)))),a.createElement("div",{className:"form-group"},a.createElement("label",null,(0,s.t)("templates.categoryColor")||"Color"),a.createElement("div",{className:"color-picker"},Nn.Gv.map(e=>a.createElement("button",{key:e,type:"button",className:"color-option "+(d===e?"selected":""),style:{background:e},onClick:()=>m(e)})))),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Preview"),a.createElement("div",{className:"category-preview"},a.createElement("span",{className:"preview-icon"},l),a.createElement("span",{className:"preview-name",style:{color:d}},o||"Category Name")))),a.createElement("div",{className:"category-modal-footer"},a.createElement("button",{type:"button",className:"btn-cancel",onClick:n},(0,s.t)("common.cancel")||"Cancel"),a.createElement("button",{type:"submit",className:"btn-save",disabled:!o.trim()},g?(0,s.t)("templates.update")||"Update":(0,s.t)("common.save")||"Save"))),a.createElement("style",null,'\n          /* Dark mode variable overrides for this component */\n          .category-modal-overlay.lion-dark {\n            --lion-bg-primary: #1a1a1a;\n            --lion-bg-secondary: #262626;\n            --lion-bg-tertiary: #2a2a2a;\n            --lion-bg-hover: #333333;\n            --lion-text-primary: #ffffff;\n            --lion-text-secondary: #e5e7eb;\n            --lion-text-muted: #a0a0a0;\n            --lion-text-light: #6b7280;\n            --lion-border-light: #3f3f3f;\n            --lion-border-medium: #525252;\n            --lion-border-dark: #6b7280;\n            --lion-primary-light: #1e3a8a;\n            --lion-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);\n            --lion-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);\n            --lion-shadow-primary: 0 4px 12px rgba(63, 28, 3, 0.5);\n          }\n\n          .category-modal-overlay {\n            position: fixed;\n            top: 0;\n            left: 0;\n            right: 0;\n            bottom: 0;\n            background: rgba(0, 0, 0, 0.6);\n            backdrop-filter: blur(4px);\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            z-index: 10003;\n          }\n\n          .category-modal {\n            background: var(--lion-bg-primary);\n            border-radius: 16px;\n            width: 90%;\n            max-width: 420px;\n            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n            overflow: hidden;\n          }\n\n          .category-modal-header {\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            padding: 20px 24px;\n            background: var(--lion-primary);\n            color: #ffffff;\n          }\n\n          .category-modal-header h2 {\n            margin: 0;\n            font-size: 18px;\n            font-weight: 600;\n          }\n\n          .category-modal-close {\n            background: rgba(255, 255, 255, 0.15);\n            border: none;\n            border-radius: 8px;\n            width: 32px;\n            height: 32px;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            cursor: pointer;\n            color: #ffffff;\n            transition: all 0.2s;\n          }\n\n          .category-modal-close:hover {\n            background: rgba(255, 255, 255, 0.25);\n          }\n\n          .category-modal-body {\n            padding: 24px;\n            display: flex;\n            flex-direction: column;\n            gap: 20px;\n          }\n\n          .form-group {\n            display: flex;\n            flex-direction: column;\n            gap: 8px;\n          }\n\n          .form-group label {\n            font-size: 13px;\n            font-weight: 600;\n            color: var(--lion-text-secondary);\n          }\n\n          .form-group input {\n            padding: 12px 14px;\n            border: 1px solid var(--lion-border-light);\n            border-radius: 10px;\n            font-size: 14px;\n            outline: none;\n            transition: all 0.2s;\n            background: var(--lion-bg-primary);\n            color: var(--lion-text-primary);\n          }\n\n          .form-group input:focus {\n            border-color: var(--lion-primary);\n            box-shadow: 0 0 0 3px var(--lion-primary-light);\n          }\n\n          .form-group input::placeholder {\n            color: var(--lion-text-muted);\n          }\n\n          .icon-picker {\n            display: flex;\n            flex-wrap: wrap;\n            gap: 6px;\n          }\n\n          .icon-option {\n            width: 40px;\n            height: 40px;\n            border: 2px solid var(--lion-border-light);\n            border-radius: 10px;\n            background: var(--lion-bg-secondary);\n            font-size: 18px;\n            cursor: pointer;\n            transition: all 0.2s;\n          }\n\n          .icon-option:hover {\n            border-color: var(--lion-primary);\n            background: var(--lion-primary-light);\n          }\n\n          .icon-option.selected {\n            border-color: var(--lion-primary);\n            background: var(--lion-primary-light);\n            box-shadow: 0 0 0 2px var(--lion-primary-light);\n          }\n\n          .color-picker {\n            display: flex;\n            flex-wrap: wrap;\n            gap: 8px;\n          }\n\n          .color-option {\n            width: 32px;\n            height: 32px;\n            border-radius: 50%;\n            border: 3px solid transparent;\n            cursor: pointer;\n            transition: all 0.2s;\n          }\n\n          .color-option:hover {\n            transform: scale(1.1);\n          }\n\n          .color-option.selected {\n            border-color: var(--lion-text-primary);\n            box-shadow: 0 0 0 2px var(--lion-bg-primary), 0 0 0 4px currentColor;\n          }\n\n          .category-preview {\n            display: flex;\n            align-items: center;\n            gap: 10px;\n            padding: 12px 14px;\n            background: var(--lion-bg-secondary);\n            border-radius: 10px;\n            border: 1px solid var(--lion-border-light);\n          }\n\n          .preview-icon {\n            font-size: 20px;\n          }\n\n          .preview-name {\n            font-size: 14px;\n            font-weight: 600;\n          }\n\n          .category-modal-footer {\n            display: flex;\n            justify-content: flex-end;\n            gap: 12px;\n            padding: 16px 24px;\n            background: var(--lion-bg-secondary);\n            border-top: 1px solid var(--lion-border-light);\n          }\n\n          .btn-cancel,\n          .btn-save {\n            padding: 10px 20px;\n            border-radius: 10px;\n            font-size: 14px;\n            font-weight: 600;\n            cursor: pointer;\n            transition: all 0.2s;\n            border: none;\n          }\n\n          .btn-cancel {\n            background: var(--lion-bg-tertiary);\n            color: var(--lion-text-muted);\n          }\n\n          .btn-cancel:hover {\n            background: var(--lion-border-light);\n            color: var(--lion-text-secondary);\n          }\n\n          .btn-save {\n            background: var(--lion-primary);\n            color: #ffffff;\n          }\n\n          .btn-save:hover:not(:disabled) {\n            box-shadow: var(--lion-shadow-primary);\n            transform: translateY(-1px);\n          }\n\n          .btn-save:disabled {\n            opacity: 0.5;\n            cursor: not-allowed;\n          }\n\n          /* ============================================================ */\n          /* ============ V2 REDESIGN OVERRIDES (LIGHT) ================ */\n          /* ============================================================ */\n\n          .category-modal-overlay {\n            background: rgba(0, 0, 0, 0.6) !important;\n            backdrop-filter: blur(6px) !important;\n            -webkit-backdrop-filter: blur(6px) !important;\n          }\n\n          .category-modal-overlay .category-modal {\n            background: var(--lion-bg-primary) !important;\n            border: 1px solid var(--lion-border-light) !important;\n            border-radius: 14px !important;\n            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0,0,0,0.05) !important;\n            max-width: 380px !important;\n            width: 90% !important;\n          }\n\n          .category-modal-overlay .category-modal-header {\n            background: var(--lion-bg-primary) !important;\n            background-image: none !important;\n            border-bottom: 1px solid var(--lion-border-light) !important;\n            color: var(--lion-text-primary) !important;\n            padding: 14px 18px !important;\n            display: flex !important;\n            align-items: center !important;\n            justify-content: space-between !important;\n          }\n\n          .category-modal-overlay .category-modal-header h2,\n          .category-modal-overlay .category-modal-header h3 {\n            color: var(--lion-text-primary) !important;\n            font-size: 15px !important;\n            font-weight: 700 !important;\n            margin: 0 !important;\n          }\n\n          .category-modal-overlay .category-modal-header .close-btn,\n          .category-modal-overlay .category-modal-header .category-modal-close {\n            background: var(--lion-bg-tertiary) !important;\n            border: 1px solid var(--lion-border-light) !important;\n            color: var(--lion-text-muted) !important;\n            border-radius: 8px !important;\n            width: 30px !important;\n            height: 30px !important;\n          }\n\n          .category-modal-overlay .category-modal-header .close-btn:hover,\n          .category-modal-overlay .category-modal-header .category-modal-close:hover {\n            background: rgba(239, 68, 68, 0.1) !important;\n            color: #ef4444 !important;\n            border-color: rgba(239, 68, 68, 0.3) !important;\n          }\n\n          .category-modal-overlay .category-modal-body {\n            background: var(--lion-bg-secondary) !important;\n            padding: 16px 18px !important;\n            gap: 14px !important;\n            display: flex !important;\n            flex-direction: column !important;\n          }\n\n          .category-modal-overlay .category-modal-body label,\n          .category-modal-overlay .form-label {\n            color: var(--lion-text-muted) !important;\n            font-size: 12px !important;\n            font-weight: 700 !important;\n            text-transform: uppercase !important;\n            letter-spacing: 0.5px !important;\n            display: block !important;\n            margin-bottom: 6px !important;\n          }\n\n          .category-modal-overlay .category-modal-body input[type="text"],\n          .category-modal-overlay .category-modal-body input[type="number"] {\n            background: var(--lion-bg-primary) !important;\n            border: 1px solid var(--lion-border-light) !important;\n            border-radius: 10px !important;\n            padding: 10px 14px !important;\n            color: var(--lion-text-primary) !important;\n            font-size: 13px !important;\n            width: 100% !important;\n            box-sizing: border-box !important;\n            outline: none !important;\n            transition: all 0.15s ease !important;\n            box-shadow: none !important;\n          }\n\n          .category-modal-overlay .category-modal-body input:focus {\n            border-color: var(--lion-primary) !important;\n            box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12) !important;\n          }\n\n          /* Icon picker grid */\n          .category-modal-overlay .icon-picker {\n            display: grid !important;\n            grid-template-columns: repeat(8, 1fr) !important;\n            gap: 5px !important;\n            padding: 8px !important;\n            background: var(--lion-bg-primary) !important;\n            border: 1px solid var(--lion-border-light) !important;\n            border-radius: 12px !important;\n          }\n\n          .category-modal-overlay .icon-option {\n            width: 34px !important;\n            height: 34px !important;\n            background: var(--lion-bg-secondary) !important;\n            border: 1px solid var(--lion-border-light) !important;\n            border-radius: 10px !important;\n            cursor: pointer !important;\n            display: flex !important;\n            align-items: center !important;\n            justify-content: center !important;\n            font-size: 20px !important;\n            transition: all 0.15s ease !important;\n          }\n\n          .category-modal-overlay .icon-option:hover {\n            background: rgba(var(--lion-primary-rgb), 0.08) !important;\n            border-color: rgba(var(--lion-primary-rgb), 0.3) !important;\n            transform: scale(1.05) !important;\n          }\n\n          .category-modal-overlay .icon-option.selected {\n            background: rgba(var(--lion-primary-rgb), 0.12) !important;\n            border-color: var(--lion-primary) !important;\n            box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.15) !important;\n          }\n\n          /* Color picker grid */\n          .category-modal-overlay .color-picker {\n            display: flex !important;\n            flex-wrap: wrap !important;\n            gap: 8px !important;\n            padding: 8px !important;\n            background: var(--lion-bg-primary) !important;\n            border: 1px solid var(--lion-border-light) !important;\n            border-radius: 12px !important;\n          }\n\n          .category-modal-overlay .color-option {\n            width: 28px !important;\n            height: 28px !important;\n            border-radius: 50% !important;\n            cursor: pointer !important;\n            border: 2px solid transparent !important;\n            transition: all 0.15s ease !important;\n          }\n\n          .category-modal-overlay .color-option:hover {\n            transform: scale(1.1) !important;\n          }\n\n          .category-modal-overlay .color-option.selected {\n            border-color: var(--lion-text-primary) !important;\n            box-shadow: 0 0 0 3px var(--lion-bg-primary), 0 0 0 5px var(--lion-text-primary) !important;\n          }\n\n          /* Preview box */\n          .category-modal-overlay .category-preview {\n            background: var(--lion-bg-primary) !important;\n            border: 1px solid var(--lion-border-light) !important;\n            border-radius: 10px !important;\n            padding: 10px 14px !important;\n            display: flex !important;\n            align-items: center !important;\n            gap: 10px !important;\n            box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;\n          }\n\n          /* Footer */\n          .category-modal-overlay .category-modal-footer {\n            background: var(--lion-bg-primary) !important;\n            border-top: 1px solid var(--lion-border-light) !important;\n            padding: 12px 18px !important;\n            display: flex !important;\n            justify-content: flex-end !important;\n            gap: 10px !important;\n          }\n\n          /* Buttons */\n          .category-modal-overlay .btn-cancel {\n            background: var(--lion-bg-primary) !important;\n            background-image: none !important;\n            color: var(--lion-text-muted) !important;\n            border: 1px solid var(--lion-border-light) !important;\n            border-radius: 8px !important;\n            padding: 8px 18px !important;\n            font-size: 13px !important;\n            font-weight: 600 !important;\n            cursor: pointer !important;\n            transition: all 0.15s ease !important;\n          }\n\n          .category-modal-overlay .btn-cancel:hover {\n            background: rgba(var(--lion-primary-rgb), 0.04) !important;\n            border-color: var(--lion-primary) !important;\n          }\n\n          .category-modal-overlay .btn-save {\n            background: var(--lion-primary) !important;\n            background-image: var(--lion-primary) !important;\n            color: #ffffff !important;\n            border: none !important;\n            border-radius: 8px !important;\n            padding: 8px 18px !important;\n            font-size: 13px !important;\n            font-weight: 600 !important;\n            cursor: pointer !important;\n            box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n            transition: all 0.15s ease !important;\n          }\n\n          .category-modal-overlay .btn-save:hover:not(:disabled) {\n            transform: translateY(-1px) !important;\n            box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n          }\n\n          /* Dark mode */\n          .category-modal-overlay.lion-dark .category-modal {\n            background: #18181b !important;\n            border-color: #27272a !important;\n          }\n\n          .category-modal-overlay.lion-dark .category-modal-header {\n            background: #18181b !important;\n            border-bottom-color: #27272a !important;\n          }\n\n          .category-modal-overlay.lion-dark .category-modal-header h2,\n          .category-modal-overlay.lion-dark .category-modal-header h3 {\n            color: #fafafa !important;\n          }\n\n          .category-modal-overlay.lion-dark .category-modal-body {\n            background: #1a1a1a !important;\n          }\n\n          .category-modal-overlay.lion-dark .category-modal-body input {\n            background: #27272a !important;\n            border-color: #3f3f46 !important;\n            color: #fafafa !important;\n          }\n\n          .category-modal-overlay.lion-dark .icon-picker,\n          .category-modal-overlay.lion-dark .color-picker,\n          .category-modal-overlay.lion-dark .category-preview {\n            background: #1f1f22 !important;\n            border-color: #27272a !important;\n          }\n\n          .category-modal-overlay.lion-dark .icon-option {\n            background: #27272a !important;\n            border-color: #3f3f46 !important;\n          }\n\n          .category-modal-overlay.lion-dark .category-modal-footer {\n            background: #18181b !important;\n            border-top-color: #27272a !important;\n          }\n\n          .category-modal-overlay.lion-dark .btn-cancel {\n            background: #27272a !important;\n            border-color: #3f3f46 !important;\n            color: #e5e7eb !important;\n          }\n        ')))},ua=({isOpen:e,categories:t,onClose:n,onCategoriesChanged:r})=>{const[o,i]=(0,a.useState)(null),[l,c]=(0,a.useState)(!1),[d,m]=(0,a.useState)(null),[p,u]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{const e=()=>{const e=_();u("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]);const g=t.filter(e=>e.id!==Nn.gh.ALL&&e.id!==Nn.gh.QUICK_REPLY&&e.id!==Nn.gh.UNCATEGORIZED),h=()=>{i(null),c(!0)};return e?a.createElement(a.Fragment,null,a.createElement("div",{className:"category-manager-overlay "+(p?"lion-dark":""),onClick:n},a.createElement("div",{className:"category-manager-modal",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"category-manager-header"},a.createElement("div",{className:"header-title"},a.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})),a.createElement("h2",null,(0,s.t)("templates.manageCategories")||"Manage Categories")),a.createElement("button",{className:"category-manager-close",onClick:n},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),a.createElement("div",{className:"category-manager-content"},0===g.length?a.createElement("div",{className:"category-empty-state"},a.createElement("div",{className:"empty-icon"},"📁"),a.createElement("h3",null,(0,s.t)("templates.noCategoriesYet")||"No categories yet"),a.createElement("p",null,(0,s.t)("templates.createCategoryDescription")||"Create categories to organize your templates"),a.createElement("button",{className:"btn-add-first",onClick:h},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"})),(0,s.t)("templates.addCategory")||"Add Category")):a.createElement("div",{className:"category-list"},g.map(e=>a.createElement("div",{key:e.id,className:"category-item"},a.createElement("div",{className:"category-item-left"},a.createElement("span",{className:"category-icon",style:{background:`${e.color}20`}},e.icon),a.createElement("span",{className:"category-name",style:{color:e.color}},e.name)),a.createElement("div",{className:"category-item-actions"},a.createElement("button",{className:"btn-action btn-edit",onClick:()=>(e=>{i(e),c(!0)})(e),title:(0,s.t)("templates.editCategory")||"Edit"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))),a.createElement("button",{className:"btn-action btn-delete",onClick:()=>(async e=>{m(e)})(e),title:(0,s.t)("templates.deleteCategory")||"Delete"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"3 6 5 6 21 6"}),a.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),a.createElement("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),a.createElement("line",{x1:"14",y1:"11",x2:"14",y2:"17"})))))))),g.length>0&&a.createElement("div",{className:"category-manager-footer"},a.createElement("button",{className:"btn-add-category",onClick:h},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"})),(0,s.t)("templates.addCategory")||"Add Category"),a.createElement("button",{className:"btn-done",onClick:n},(0,s.t)("templates.done")||"Done"))),d&&a.createElement("div",{className:"delete-confirm-dialog",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"delete-confirm-icon"},a.createElement("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"#ef4444",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),a.createElement("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"}))),a.createElement("h3",null,(0,s.t)("templates.deleteCategory")||"Delete Category"),a.createElement("p",null,(0,s.t)("templates.confirmDeleteCategory")||"Are you sure you want to delete"," ",a.createElement("strong",{style:{color:d.color}},d.icon," ",d.name),"?"),a.createElement("p",{className:"delete-warning"},(0,s.t)("templates.deleteCategoryWarning")||"Templates in this category will become uncategorized."),a.createElement("div",{className:"delete-confirm-actions"},a.createElement("button",{className:"btn-cancel",onClick:()=>m(null)},(0,s.t)("templates.cancel")||"Cancel"),a.createElement("button",{className:"btn-confirm-delete",onClick:async()=>{d&&(await Mn.TemplatesStorage.deleteCategoryAsync(d.id),m(null),r())}},(0,s.t)("templates.delete")||"Delete"))),a.createElement("style",null,'\n          /* Dark mode variable overrides for this component */\n          .category-manager-overlay.lion-dark {\n            --lion-bg-primary: #1a1a1a;\n            --lion-bg-secondary: #262626;\n            --lion-bg-tertiary: #2a2a2a;\n            --lion-bg-hover: #333333;\n            --lion-text-primary: #ffffff;\n            --lion-text-secondary: #e5e7eb;\n            --lion-text-muted: #a0a0a0;\n            --lion-text-light: #6b7280;\n            --lion-border-light: #3f3f3f;\n            --lion-border-medium: #525252;\n            --lion-border-dark: #6b7280;\n            --lion-primary-light: #1e3a8a;\n            --lion-error-light: #7f1d1d;\n            --lion-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);\n            --lion-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);\n            --lion-shadow-primary: 0 4px 12px rgba(63, 28, 3, 0.5);\n          }\n\n          .category-manager-overlay {\n            position: fixed;\n            top: 0;\n            left: 0;\n            right: 0;\n            bottom: 0;\n            background: rgba(0, 0, 0, 0.6);\n            backdrop-filter: blur(4px);\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            z-index: 10002;\n          }\n\n          .category-manager-modal {\n            background: var(--lion-bg-primary);\n            border-radius: 20px;\n            width: 90%;\n            max-width: 480px;\n            max-height: 80vh;\n            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);\n            overflow: hidden;\n            display: flex;\n            flex-direction: column;\n          }\n\n          .category-manager-header {\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            padding: 20px 24px;\n            background: var(--lion-primary);\n            color: #ffffff;\n          }\n\n          .header-title {\n            display: flex;\n            align-items: center;\n            gap: 12px;\n          }\n\n          .header-title h2 {\n            margin: 0;\n            font-size: 18px;\n            font-weight: 600;\n          }\n\n          .category-manager-close {\n            background: rgba(255, 255, 255, 0.15);\n            border: none;\n            border-radius: 10px;\n            width: 36px;\n            height: 36px;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            cursor: pointer;\n            color: #ffffff;\n            transition: all 0.2s;\n          }\n\n          .category-manager-close:hover {\n            background: rgba(255, 255, 255, 0.25);\n          }\n\n          .category-manager-content {\n            flex: 1;\n            overflow-y: auto;\n            padding: 20px 24px;\n          }\n\n          .category-empty-state {\n            display: flex;\n            flex-direction: column;\n            align-items: center;\n            justify-content: center;\n            text-align: center;\n            padding: 40px 20px;\n          }\n\n          .empty-icon {\n            font-size: 64px;\n            margin-bottom: 16px;\n            opacity: 0.6;\n          }\n\n          .category-empty-state h3 {\n            margin: 0 0 8px 0;\n            font-size: 18px;\n            font-weight: 600;\n            color: var(--lion-text-secondary);\n          }\n\n          .category-empty-state p {\n            margin: 0 0 24px 0;\n            font-size: 14px;\n            color: var(--lion-text-muted);\n          }\n\n          .btn-add-first {\n            display: flex;\n            align-items: center;\n            gap: 8px;\n            background: var(--lion-primary);\n            color: #ffffff;\n            border: none;\n            border-radius: 12px;\n            padding: 14px 28px;\n            font-size: 15px;\n            font-weight: 600;\n            cursor: pointer;\n            transition: all 0.2s;\n          }\n\n          .btn-add-first:hover {\n            transform: translateY(-2px);\n            box-shadow: var(--lion-shadow-primary);\n          }\n\n          .category-list {\n            display: flex;\n            flex-direction: column;\n            gap: 12px;\n          }\n\n          .category-item {\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            padding: 14px 16px;\n            background: var(--lion-bg-secondary);\n            border: 1px solid var(--lion-border-light);\n            border-radius: 12px;\n            transition: all 0.2s;\n          }\n\n          .category-item:hover {\n            background: var(--lion-bg-tertiary);\n            border-color: var(--lion-border-medium);\n          }\n\n          .category-item-left {\n            display: flex;\n            align-items: center;\n            gap: 12px;\n          }\n\n          .category-icon {\n            width: 40px;\n            height: 40px;\n            border-radius: 10px;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            font-size: 20px;\n          }\n\n          .category-name {\n            font-size: 15px;\n            font-weight: 600;\n          }\n\n          .category-item-actions {\n            display: flex;\n            gap: 8px;\n          }\n\n          .btn-action {\n            width: 36px;\n            height: 36px;\n            border-radius: 10px;\n            border: none;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            cursor: pointer;\n            transition: all 0.2s;\n          }\n\n          .btn-edit {\n            background: var(--lion-bg-tertiary);\n            color: var(--lion-text-muted);\n          }\n\n          .btn-edit:hover {\n            background: var(--lion-border-light);\n            color: var(--lion-text-secondary);\n          }\n\n          .btn-delete {\n            background: var(--lion-error-light);\n            color: var(--lion-error);\n          }\n\n          .btn-delete:hover {\n            background: var(--lion-error-light);\n            color: var(--lion-error);\n          }\n\n          .category-manager-footer {\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n            padding: 16px 24px;\n            background: var(--lion-bg-secondary);\n            border-top: 1px solid var(--lion-border-light);\n          }\n\n          .btn-add-category {\n            display: flex;\n            align-items: center;\n            gap: 8px;\n            background: var(--lion-bg-primary);\n            color: var(--lion-primary);\n            border: 2px solid var(--lion-primary);\n            border-radius: 10px;\n            padding: 10px 18px;\n            font-size: 14px;\n            font-weight: 600;\n            cursor: pointer;\n            transition: all 0.2s;\n          }\n\n          .btn-add-category:hover {\n            background: var(--lion-primary-light);\n          }\n\n          .btn-done {\n            background: var(--lion-primary);\n            color: #ffffff;\n            border: none;\n            border-radius: 10px;\n            padding: 10px 24px;\n            font-size: 14px;\n            font-weight: 600;\n            cursor: pointer;\n            transition: all 0.2s;\n          }\n\n          .btn-done:hover {\n            box-shadow: var(--lion-shadow-primary);\n            transform: translateY(-1px);\n          }\n\n          /* Delete Confirmation Dialog */\n          .delete-confirm-dialog {\n            position: fixed;\n            top: 50%;\n            left: 50%;\n            transform: translate(-50%, -50%);\n            background: var(--lion-bg-primary);\n            border-radius: 20px;\n            padding: 32px;\n            width: 90%;\n            max-width: 380px;\n            text-align: center;\n            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);\n            z-index: 10003;\n          }\n\n          .delete-confirm-icon {\n            margin-bottom: 16px;\n          }\n\n          .delete-confirm-dialog h3 {\n            margin: 0 0 12px 0;\n            font-size: 20px;\n            font-weight: 700;\n            color: var(--lion-text-primary);\n          }\n\n          .delete-confirm-dialog p {\n            margin: 0 0 8px 0;\n            font-size: 14px;\n            color: var(--lion-text-muted);\n          }\n\n          .delete-warning {\n            font-size: 13px !important;\n            color: var(--lion-text-muted) !important;\n            font-style: italic;\n          }\n\n          .delete-confirm-actions {\n            display: flex;\n            gap: 12px;\n            margin-top: 24px;\n          }\n\n          .delete-confirm-actions .btn-cancel {\n            flex: 1;\n            padding: 12px 20px;\n            background: var(--lion-bg-tertiary);\n            color: var(--lion-text-muted);\n            border: none;\n            border-radius: 10px;\n            font-size: 14px;\n            font-weight: 600;\n            cursor: pointer;\n            transition: all 0.2s;\n          }\n\n          .delete-confirm-actions .btn-cancel:hover {\n            background: var(--lion-border-light);\n            color: var(--lion-text-secondary);\n          }\n\n          .btn-confirm-delete {\n            flex: 1;\n            padding: 12px 20px;\n            background: linear-gradient(135deg, var(--lion-error) 0%, var(--lion-error) 100%);\n            color: #ffffff;\n            border: none;\n            border-radius: 10px;\n            font-size: 14px;\n            font-weight: 600;\n            cursor: pointer;\n            transition: all 0.2s;\n          }\n\n          .btn-confirm-delete:hover {\n            box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);\n            transform: translateY(-1px);\n          }\n\n          /* Scrollbar */\n          .category-manager-content::-webkit-scrollbar {\n            width: 6px;\n          }\n\n          .category-manager-content::-webkit-scrollbar-track {\n            background: transparent;\n          }\n\n          .category-manager-content::-webkit-scrollbar-thumb {\n            background: var(--lion-border-medium);\n            border-radius: 3px;\n          }\n\n          .category-manager-content::-webkit-scrollbar-thumb:hover {\n            background: var(--lion-text-muted);\n          }\n\n          /* ============================================================ */\n          /* ============ V2 REDESIGN OVERRIDES (LIGHT) ================ */\n          /* ============================================================ */\n\n          .category-manager-overlay {\n            background: rgba(0, 0, 0, 0.55) !important;\n            backdrop-filter: blur(6px) !important;\n            -webkit-backdrop-filter: blur(6px) !important;\n          }\n\n          .category-manager-overlay .category-manager-modal {\n            background: #ffffff !important;\n            border: 1px solid #e5e7eb !important;\n            border-radius: 16px !important;\n            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0,0,0,0.05) !important;\n            max-width: 520px !important;\n            width: 92% !important;\n          }\n\n          .category-manager-overlay .category-manager-header {\n            background: #ffffff !important;\n            background-image: none !important;\n            border-bottom: 1px solid #f0f0f0 !important;\n            color: #1f2937 !important;\n            padding: 18px 22px !important;\n          }\n\n          .category-manager-overlay .category-manager-header h2,\n          .category-manager-overlay .category-manager-header h3 {\n            color: #1f2937 !important;\n            font-size: 18px !important;\n            font-weight: 700 !important;\n            margin: 0 !important;\n          }\n\n          .category-manager-overlay .category-manager-header .close-btn,\n          .category-manager-overlay .category-manager-header button[class*="close"] {\n            background: #f4f4f5 !important;\n            border: 1px solid #e5e7eb !important;\n            color: #52525b !important;\n            border-radius: 10px !important;\n            width: 34px !important;\n            height: 34px !important;\n          }\n\n          .category-manager-overlay .category-manager-header .close-btn:hover {\n            background: rgba(239, 68, 68, 0.1) !important;\n            color: #ef4444 !important;\n            border-color: rgba(239, 68, 68, 0.3) !important;\n          }\n\n          .category-manager-overlay .category-manager-content {\n            background: #fafafa !important;\n            padding: 16px 20px !important;\n          }\n\n          .category-manager-overlay .category-list {\n            display: flex !important;\n            flex-direction: column !important;\n            gap: 8px !important;\n          }\n\n          .category-manager-overlay .category-item {\n            background: #ffffff !important;\n            border: 1px solid #f0f0f0 !important;\n            border-radius: 10px !important;\n            padding: 10px 14px !important;\n            display: flex !important;\n            align-items: center !important;\n            justify-content: space-between !important;\n            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;\n            transition: all 0.15s ease !important;\n          }\n\n          .category-manager-overlay .category-item:hover {\n            border-color: rgba(var(--lion-primary-rgb), 0.3) !important;\n            box-shadow: 0 3px 10px rgba(var(--lion-primary-rgb), 0.08) !important;\n          }\n\n          .category-manager-overlay .category-item-left {\n            display: flex !important;\n            align-items: center !important;\n            gap: 10px !important;\n          }\n\n          .category-manager-overlay .category-item-actions {\n            display: flex !important;\n            gap: 6px !important;\n          }\n\n          .category-manager-overlay .btn-action,\n          .category-manager-overlay .btn-edit,\n          .category-manager-overlay .btn-delete {\n            background: #ffffff !important;\n            border: 1px solid #e5e7eb !important;\n            border-radius: 8px !important;\n            width: 32px !important;\n            height: 32px !important;\n            padding: 0 !important;\n            cursor: pointer !important;\n            display: flex !important;\n            align-items: center !important;\n            justify-content: center !important;\n            color: #52525b !important;\n            transition: all 0.15s ease !important;\n          }\n\n          .category-manager-overlay .btn-edit:hover {\n            background: rgba(var(--lion-primary-rgb), 0.08) !important;\n            border-color: var(--lion-primary) !important;\n            color: var(--lion-primary) !important;\n          }\n\n          .category-manager-overlay .btn-delete:hover {\n            background: rgba(239, 68, 68, 0.08) !important;\n            border-color: #ef4444 !important;\n            color: #ef4444 !important;\n          }\n\n          .category-manager-overlay .empty-state,\n          .category-manager-overlay .empty-categories {\n            background: #ffffff !important;\n            border: 2px dashed #e5e7eb !important;\n            border-radius: 12px !important;\n            padding: 32px 20px !important;\n            text-align: center !important;\n          }\n\n          .category-manager-overlay .empty-state h3,\n          .category-manager-overlay .empty-state p {\n            color: #1f2937 !important;\n          }\n\n          .category-manager-overlay .category-manager-footer {\n            background: #ffffff !important;\n            border-top: 1px solid #f0f0f0 !important;\n            padding: 14px 22px !important;\n          }\n\n          .category-manager-overlay .btn-primary,\n          .category-manager-overlay button.btn-add,\n          .category-manager-overlay button.btn-done {\n            background: var(--lion-primary) !important;\n            color: #ffffff !important;\n            border: none !important;\n            border-radius: 10px !important;\n            padding: 10px 20px !important;\n            font-weight: 600 !important;\n            font-size: 13px !important;\n            box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n            cursor: pointer !important;\n            transition: all 0.15s ease !important;\n          }\n\n          .category-manager-overlay .btn-primary:hover {\n            transform: translateY(-1px) !important;\n            box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n          }\n\n          /* Delete confirmation dialog */\n          .delete-confirm-dialog {\n            background: #ffffff !important;\n            border: 1px solid #e5e7eb !important;\n            border-radius: 16px !important;\n            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25) !important;\n            padding: 24px !important;\n            max-width: 400px !important;\n          }\n\n          .delete-confirm-dialog h3 {\n            color: #1f2937 !important;\n            font-size: 17px !important;\n            font-weight: 700 !important;\n          }\n\n          .delete-confirm-dialog p {\n            color: #6b7280 !important;\n            font-size: 13px !important;\n          }\n\n          /* Dark mode */\n          .category-manager-overlay.lion-dark .category-manager-modal {\n            background: #18181b !important;\n            border-color: #27272a !important;\n          }\n\n          .category-manager-overlay.lion-dark .category-manager-header {\n            background: #18181b !important;\n            border-bottom-color: #27272a !important;\n          }\n\n          .category-manager-overlay.lion-dark .category-manager-header h2,\n          .category-manager-overlay.lion-dark .category-manager-header h3 {\n            color: #fafafa !important;\n          }\n\n          .category-manager-overlay.lion-dark .category-manager-content {\n            background: #1a1a1a !important;\n          }\n\n          .category-manager-overlay.lion-dark .category-item {\n            background: #1f1f22 !important;\n            border-color: #27272a !important;\n          }\n\n          .category-manager-overlay.lion-dark .category-manager-footer {\n            background: #18181b !important;\n            border-top-color: #27272a !important;\n          }\n\n          .category-manager-overlay.lion-dark .btn-action,\n          .category-manager-overlay.lion-dark .btn-edit,\n          .category-manager-overlay.lion-dark .btn-delete {\n            background: #27272a !important;\n            border-color: #3f3f46 !important;\n            color: #a1a1aa !important;\n          }\n        ')),a.createElement(pa,{isOpen:l,category:o,onClose:()=>{c(!1),i(null)},onSave:async e=>{o?await Mn.TemplatesStorage.updateCategoryAsync(o.id,e):await Mn.TemplatesStorage.createCategoryAsync(e),c(!1),i(null),r()}})):null},ga=({isOpen:e,onClose:t})=>{const[n,r]=(0,a.useState)([]),[o,i]=(0,a.useState)([]),[l,c]=(0,a.useState)({}),[d,m]=(0,a.useState)(null),[p,u]=(0,a.useState)(!1),[g,h]=(0,a.useState)(null),[b,f]=(0,a.useState)(Nn.gh.ALL),[v,y]=(0,a.useState)(!1),[x,w]=(0,a.useState)(!1),[k,E]=(0,a.useState)(null),[S,C]=(0,a.useState)("all"),[T,D]=(0,a.useState)("all"),[N,M]=(0,a.useState)("manual"),[R,B]=(0,a.useState)(""),[P,L]=(0,a.useState)(null),[U,F]=(0,a.useState)(null),z=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.useMemo)(()=>[...t].filter(e=>null!=e),[...t])}(be(pt,{activationConstraint:{distance:8}}),be(st,{coordinateGetter:Dn})),[O,W]=(0,a.useState)(0),[q,H]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{e&&j()},[e]),(0,a.useEffect)(()=>{const e=()=>W(e=>e+1),t=()=>{const e=_();H("dark"===A(e.mode))};return window.addEventListener("languageChanged",e),window.addEventListener(I,t),window.addEventListener("lionThemeApplied",t),()=>{window.removeEventListener("languageChanged",e),window.removeEventListener(I,t),window.removeEventListener("lionThemeApplied",t)}},[]),(0,a.useEffect)(()=>{e&&"true"===sessionStorage.getItem("preSelectQuickReply")&&(h(null),u(!0))},[e]);const j=async()=>{const[e,t,n,a]=await Promise.all([Mn.TemplatesStorage.getTemplatesAsync(),Mn.TemplatesStorage.getCategoriesAsync(),Mn.TemplatesStorage.getTemplateCounts(),Mn.TemplatesStorage.getStatsAsync()]);r(e),i(t),c(n),m(a)},V=[...n.filter(e=>{if(b!==Nn.gh.ALL)if(b===Nn.gh.QUICK_REPLY){if("quick_reply"!==e.messageType)return!1}else if(b===Nn.gh.UNCATEGORIZED){if(e.categoryId&&e.categoryId!==Nn.gh.UNCATEGORIZED)return!1}else if(e.categoryId!==b)return!1;if("active"===S&&!e.isActive)return!1;if("inactive"===S&&e.isActive)return!1;if("all"!==T&&e.messageType!==T)return!1;if(R){const t=R.toLowerCase(),n=e.messages?.[0]?.message||e.message||"";return e.templeteName.toLowerCase().includes(t)||n.toLowerCase().includes(t)}return!0})].sort((e,t)=>"manual"===N?(e.sortOrder??999)-(t.sortOrder??999):"newest"===N?t.modifiedAt-e.modifiedAt:"oldest"===N?e.modifiedAt-t.modifiedAt:"name"===N?e.templeteName.localeCompare(t.templeteName):0),G=P?V.find(e=>e.id===P):null,K=()=>{h(null),u(!0)},$=e=>{h(e),u(!0)},Y=async e=>{confirm((0,s.t)("templates.confirmDelete")||"Are you sure you want to delete this template?")&&(await Mn.TemplatesStorage.deleteTemplateAsync(e.id),window.dispatchEvent(new CustomEvent("wa-template-deleted")),await j())},X=async e=>{await Mn.TemplatesStorage.duplicateTemplateAsync(e.id)&&(window.dispatchEvent(new CustomEvent("wa-template-saved")),await j())},J=async e=>{await Mn.TemplatesStorage.toggleActiveAsync(e.id),window.dispatchEvent(new CustomEvent("wa-template-saved")),await j()},Q=()=>{u(!1),h(null),j()};return e?p?a.createElement(ea,{template:g,onSave:Q,onCancel:Q}):a.createElement("div",{className:"template-manager-overlay "+(q?"lion-dark":"")},a.createElement(Gt,{sensors:z,collisionDetection:Ce,onDragStart:e=>{L(e.active.id)},onDragOver:e=>{const{over:t}=e;t&&String(t.id).startsWith("category-drop-")?F(String(t.id).replace("category-drop-","")):F(null)},onDragEnd:async e=>{const{active:t,over:a}=e;if(L(null),F(null),!a)return;const r=String(a.id);if(r.startsWith("category-drop-")){const e=r.replace("category-drop-",""),a=String(t.id),o=n.find(e=>e.id===a);if(o&&o.categoryId!==e){await Mn.TemplatesStorage.updateTemplateAsync(a,{categoryId:e})&&(window.dispatchEvent(new CustomEvent("wa-template-saved")),await j())}return}if(t.id===a.id)return;if("manual"!==N)return;const o=V.find(e=>e.id===t.id),i=V.find(e=>e.id===a.id);if(!o||!i)return;const s=V.findIndex(e=>e.id===t.id)>V.findIndex(e=>e.id===a.id);await Mn.TemplatesStorage.reorderTemplateAsync(o.id,i.id,s)&&(window.dispatchEvent(new CustomEvent("wa-template-reordered")),await j())}},a.createElement("div",{className:"template-manager"},a.createElement(na,{categories:o,selectedCategoryId:b,templateCounts:l,onSelectCategory:f,onAddCategory:()=>{E(null),y(!0)},onManageCategories:()=>{w(!0)},dragOverCategoryId:U}),a.createElement("div",{className:"template-manager-main"},a.createElement("div",{className:"template-manager-header"},a.createElement("div",{className:"header-left"},a.createElement("h1",null,(0,s.t)("templates.title")||"Message Templates"),d&&a.createElement("span",{className:"header-stats"},d.totalTemplates," ",(0,s.t)("templates.total")||"total"," · ",d.activeTemplates," ",(0,s.t)("templates.active")||"active")),a.createElement("div",{className:"header-right"},a.createElement("div",{className:"header-search"},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("circle",{cx:"11",cy:"11",r:"8"}),a.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})),a.createElement("input",{type:"text",placeholder:(0,s.t)("templates.searchPlaceholder")||"Search templates...",value:R,onChange:e=>B(e.target.value)})),a.createElement("button",{className:"btn-new-template",onClick:K},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"})),(0,s.t)("templates.newTemplate")||"New Template"),a.createElement("button",{className:"btn-close",onClick:t},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))))),a.createElement("div",{className:"template-filter-bar"},a.createElement("div",{className:"filter-group"},a.createElement("select",{value:S,onChange:e=>C(e.target.value),className:"filter-select"},a.createElement("option",{value:"all"},(0,s.t)("templates.filterAll")||"All Status"),a.createElement("option",{value:"active"},(0,s.t)("templates.filterActive")||"Active"),a.createElement("option",{value:"inactive"},(0,s.t)("templates.filterInactive")||"Inactive")),a.createElement("select",{value:T,onChange:e=>D(e.target.value),className:"filter-select"},a.createElement("option",{value:"all"},(0,s.t)("templates.filterAllTypes")||"All Types"),a.createElement("option",{value:"individual"},(0,s.t)("templates.messageType.individual")||"One to One"),a.createElement("option",{value:"tab"},(0,s.t)("templates.messageType.tab")||"Tab"),a.createElement("option",{value:"group"},(0,s.t)("templates.messageType.group")||"Group"),a.createElement("option",{value:"label"},(0,s.t)("templates.messageType.label")||"Label"),a.createElement("option",{value:"kanban"},(0,s.t)("templates.messageType.kanban")||"Kanban"),a.createElement("option",{value:"quick_reply"},(0,s.t)("templates.messageType.quickReply")||"Quick Reply")),a.createElement("select",{value:N,onChange:e=>M(e.target.value),className:"filter-select"},a.createElement("option",{value:"manual"},(0,s.t)("templates.sortManual")||"Manual Order"),a.createElement("option",{value:"newest"},(0,s.t)("templates.sortNewest")||"Newest First"),a.createElement("option",{value:"oldest"},(0,s.t)("templates.sortOldest")||"Oldest First"),a.createElement("option",{value:"name"},(0,s.t)("templates.sortName")||"Name (A-Z)"))),a.createElement("div",{className:"filter-info"},V.length," ",(0,s.t)("templates.templates")||"templates")),a.createElement("div",{className:"template-content"},0===V.length?a.createElement("div",{className:"template-empty"},a.createElement("div",{className:"empty-icon"},"📋"),a.createElement("h3",null,(0,s.t)("templates.noTemplatesInCategory")||"No templates found"),a.createElement("p",null,(0,s.t)("templates.createFirstDescription")||"Create your first template to get started"),a.createElement("button",{className:"btn-create-first",onClick:K},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"})),(0,s.t)("templates.createFirst")||"Create Template")):a.createElement(a.Fragment,null,a.createElement(vn,{items:V.map(e=>e.id),strategy:hn,disabled:"manual"!==N},a.createElement("div",{className:"template-grid"},V.map(e=>a.createElement(ia,{key:e.id,template:e,onEdit:$,onDuplicate:X,onDelete:Y,onToggleActive:J,isDraggable:"manual"===N})))))))),a.createElement(mn,null,G?a.createElement(oa,{template:G,onEdit:()=>{},onDuplicate:()=>{},onDelete:()=>{},onToggleActive:()=>{}}):null)),a.createElement(pa,{isOpen:v,category:k,onClose:()=>{y(!1),E(null)},onSave:async e=>{k?await Mn.TemplatesStorage.updateCategoryAsync(k.id,e):await Mn.TemplatesStorage.createCategoryAsync(e),y(!1),E(null),await j()}}),a.createElement(ua,{isOpen:x,categories:o,onClose:()=>w(!1),onCategoriesChanged:j}),a.createElement("style",null,"\n        /* Dark mode variable overrides for this component */\n        .template-manager-overlay.lion-dark {\n          --lion-bg-primary: #1a1a1a;\n          --lion-bg-secondary: #262626;\n          --lion-bg-tertiary: #2a2a2a;\n          --lion-bg-hover: #333333;\n          --lion-text-primary: #ffffff;\n          --lion-text-secondary: #e5e7eb;\n          --lion-text-muted: #a0a0a0;\n          --lion-text-light: #6b7280;\n          --lion-border-light: #3f3f3f;\n          --lion-border-medium: #525252;\n          --lion-border-dark: #6b7280;\n          --lion-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);\n          --lion-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);\n          --lion-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);\n          --lion-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.5);\n        }\n\n        .template-manager-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.85) 100%);\n          backdrop-filter: blur(4px);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 10000;\n          padding: 20px;\n        }\n\n        .template-manager {\n          background: var(--lion-bg-primary);\n          border-radius: 20px;\n          width: 98%;\n          max-width: 1200px;\n          height: 90vh;\n          display: flex;\n          box-shadow: var(--lion-shadow-xl);\n          overflow: hidden;\n        }\n\n        .template-manager-main {\n          flex: 1;\n          display: flex;\n          flex-direction: column;\n          overflow: hidden;\n          background: var(--lion-bg-primary);\n        }\n\n        .template-manager-header {\n          background: var(--lion-primary);\n          padding: 20px 28px;\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          gap: 16px;\n        }\n\n        .header-left {\n          display: flex;\n          flex-direction: column;\n          gap: 4px;\n        }\n\n        .header-left h1 {\n          margin: 0;\n          font-size: 20px;\n          font-weight: 700;\n          color: #ffffff;\n        }\n\n        .header-stats {\n          font-size: 13px;\n          color: rgba(255, 255, 255, 0.8);\n        }\n\n        .header-right {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n        }\n\n        .header-search {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          background: rgba(255, 255, 255, 0.15);\n          border-radius: 10px;\n          padding: 8px 14px;\n          color: #ffffff;\n        }\n\n        .header-search input {\n          background: transparent;\n          border: none;\n          outline: none;\n          color: #ffffff;\n          font-size: 14px;\n          width: 200px;\n        }\n\n        .header-search input::placeholder {\n          color: rgba(255, 255, 255, 0.7);\n        }\n\n        .btn-new-template {\n          display: flex;\n          flex-direction: row;\n          align-items: center;\n          gap: 8px;\n          background: #ffffff;\n          color: var(--lion-primary-hover);\n          border: none;\n          border-radius: 10px;\n          padding: 10px 18px;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .btn-new-template:hover {\n          transform: translateY(-1px);\n          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n        }\n\n        .btn-close {\n          background: rgba(255, 255, 255, 0.15);\n          border: none;\n          border-radius: 10px;\n          width: 40px;\n          height: 40px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          color: #ffffff;\n          transition: all 0.2s;\n        }\n\n        .btn-close:hover {\n          background: rgba(255, 255, 255, 0.25);\n        }\n\n        .template-filter-bar {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 16px 24px;\n          background: var(--lion-bg-primary);\n          border-bottom: 1px solid var(--lion-border-light);\n        }\n\n        .filter-group {\n          display: flex;\n          gap: 12px;\n        }\n\n        .filter-select {\n          padding: 8px 12px;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          font-size: 13px;\n          color: var(--lion-text-secondary);\n          background: var(--lion-bg-primary);\n          cursor: pointer;\n          outline: none;\n          transition: all 0.2s;\n        }\n\n        .filter-select:focus {\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.1);\n        }\n\n        .filter-info {\n          font-size: 13px;\n          color: var(--lion-text-muted);\n        }\n\n        .template-content {\n          flex: 1;\n          overflow-y: auto;\n          padding: 24px;\n          background: var(--lion-bg-secondary);\n        }\n\n        .template-grid {\n          display: grid;\n          grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));\n          gap: 20px;\n        }\n\n        .template-empty {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          justify-content: center;\n          height: 100%;\n          text-align: center;\n          color: var(--lion-text-muted);\n        }\n\n        .empty-icon {\n          font-size: 64px;\n          margin-bottom: 16px;\n          opacity: 0.5;\n        }\n\n        .template-empty h3 {\n          margin: 0 0 8px 0;\n          font-size: 18px;\n          font-weight: 600;\n          color: var(--lion-text-secondary);\n        }\n\n        .template-empty p {\n          margin: 0 0 24px 0;\n          font-size: 14px;\n        }\n\n        .btn-create-first {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          background: var(--lion-primary);\n          color: #ffffff;\n          border: none;\n          border-radius: 10px;\n          padding: 12px 24px;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .btn-create-first:hover {\n          transform: translateY(-2px);\n          box-shadow: var(--lion-shadow-primary);\n        }\n\n        /* Scrollbar */\n        .template-content::-webkit-scrollbar {\n          width: 8px;\n        }\n\n        .template-content::-webkit-scrollbar-track {\n          background: transparent;\n        }\n\n        .template-content::-webkit-scrollbar-thumb {\n          background: var(--lion-border-medium);\n          border-radius: 4px;\n        }\n\n        .template-content::-webkit-scrollbar-thumb:hover {\n          background: var(--lion-text-muted);\n        }\n\n        /* ============================================================ */\n        /* ============ V2 REDESIGN OVERRIDES (LIGHT) ================ */\n        /* Clean white + blue accent matching header/BroadcastModal  */\n        /* ============================================================ */\n\n        /* === Backdrop === */\n        .template-manager-overlay {\n          background: rgba(0, 0, 0, 0.55) !important;\n          backdrop-filter: blur(6px) !important;\n          -webkit-backdrop-filter: blur(6px) !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          z-index: 10000 !important;\n        }\n\n        /* === Modal container === */\n        .template-manager-overlay .template-manager {\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          border-radius: 16px !important;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0,0,0,0.05) !important;\n          width: 92% !important;\n          max-width: 1240px !important;\n          height: 88vh !important;\n          max-height: 88vh !important;\n          overflow: hidden !important;\n          display: flex !important;\n          flex-direction: row !important;\n        }\n\n        /* === Main area === */\n        .template-manager-overlay .template-manager-main {\n          flex: 1 1 auto !important;\n          display: flex !important;\n          flex-direction: column !important;\n          min-width: 0 !important;\n          min-height: 0 !important;\n          overflow: hidden !important;\n          background: #ffffff !important;\n        }\n\n        /* === Header - Remove legacy gradient === */\n        .template-manager-overlay .template-manager-header {\n          background: #ffffff !important;\n          background-image: none !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n          color: #1f2937 !important;\n          padding: 18px 24px !important;\n          box-shadow: none !important;\n          flex-shrink: 0 !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: space-between !important;\n          gap: 16px !important;\n        }\n\n        .template-manager-overlay .template-manager-header .header-left {\n          display: flex !important;\n          flex-direction: column !important;\n          gap: 2px !important;\n        }\n\n        .template-manager-overlay .template-manager-header h2,\n        .template-manager-overlay .template-manager-header .header-title {\n          color: #1f2937 !important;\n          font-size: 19px !important;\n          font-weight: 700 !important;\n          margin: 0 !important;\n        }\n\n        .template-manager-overlay .template-manager-header .header-stats,\n        .template-manager-overlay .template-manager-header .header-subtitle {\n          color: #6b7280 !important;\n          font-size: 12px !important;\n          font-weight: 500 !important;\n        }\n\n        .template-manager-overlay .template-manager-header .header-right {\n          display: flex !important;\n          align-items: center !important;\n          gap: 10px !important;\n        }\n\n        /* === Search input in header === */\n        .template-manager-overlay .header-search,\n        .template-manager-overlay .header-search input {\n          background: #ffffff !important;\n        }\n\n        .template-manager-overlay .header-search input[type=\"text\"],\n        .template-manager-overlay .header-search input[type=\"search\"],\n        .template-manager-overlay input.search-input {\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          border-radius: 10px !important;\n          padding: 9px 14px 9px 36px !important;\n          color: #1f2937 !important;\n          font-size: 13px !important;\n          min-width: 260px !important;\n          outline: none !important;\n          transition: all 0.15s ease !important;\n          box-shadow: none !important;\n        }\n\n        .template-manager-overlay .header-search input:focus {\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12) !important;\n        }\n\n        .template-manager-overlay .header-search input::placeholder {\n          color: #9ca3af !important;\n        }\n\n        /* === New Template button (primary CTA) === */\n        .template-manager-overlay .btn-new-template,\n        .template-manager-overlay .header-create-btn,\n        .template-manager-overlay button.btn-create {\n          background: var(--lion-primary) !important;\n          background-image: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border: none !important;\n          border-radius: 10px !important;\n          padding: 10px 18px !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n          transition: all 0.15s ease !important;\n          display: inline-flex !important;\n          flex-direction: row !important;\n          align-items: center !important;\n          gap: 6px !important;\n        }\n\n        .template-manager-overlay .btn-new-template:hover,\n        .template-manager-overlay .header-create-btn:hover,\n        .template-manager-overlay button.btn-create:hover {\n          transform: translateY(-1px) !important;\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n        }\n\n        /* === Header close button === */\n        .template-manager-overlay .template-manager-header .close-btn,\n        .template-manager-overlay .template-manager-header .btn-close,\n        .template-manager-overlay .template-manager-header button[aria-label*=\"close\" i],\n        .template-manager-overlay .template-manager-header .header-close-btn {\n          background: var(--lion-bg-tertiary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          color: var(--lion-text-muted) !important;\n          border-radius: 10px !important;\n          width: 36px !important;\n          height: 36px !important;\n          padding: 0 !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .template-manager-overlay .template-manager-header .close-btn:hover,\n        .template-manager-overlay .template-manager-header .btn-close:hover,\n        .template-manager-overlay .template-manager-header .header-close-btn:hover {\n          background: rgba(239, 68, 68, 0.1) !important;\n          color: #ef4444 !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n        }\n\n        /* === Filter bar === */\n        .template-manager-overlay .template-filter-bar {\n          background: #ffffff !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n          padding: 14px 24px !important;\n          display: flex !important;\n          align-items: center !important;\n          gap: 12px !important;\n          flex-wrap: wrap !important;\n          flex-shrink: 0 !important;\n        }\n\n        .template-manager-overlay .filter-group {\n          display: flex !important;\n          align-items: center !important;\n          gap: 8px !important;\n        }\n\n        /* === Filter selects - WIDER so labels don't truncate === */\n        .template-manager-overlay .filter-select,\n        .template-manager-overlay .template-filter-bar select {\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          border-radius: 10px !important;\n          padding: 9px 32px 9px 14px !important;\n          color: #374151 !important;\n          font-size: 13px !important;\n          font-weight: 500 !important;\n          min-width: 140px !important;\n          cursor: pointer !important;\n          outline: none !important;\n          transition: all 0.15s ease !important;\n          box-shadow: none !important;\n          appearance: none !important;\n          background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E\") !important;\n          background-repeat: no-repeat !important;\n          background-position: right 10px center !important;\n        }\n\n        .template-manager-overlay .filter-select:hover,\n        .template-manager-overlay .template-filter-bar select:hover {\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        .template-manager-overlay .filter-select:focus,\n        .template-manager-overlay .template-filter-bar select:focus {\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12) !important;\n        }\n\n        .template-manager-overlay .filter-info {\n          margin-left: auto !important;\n          color: #6b7280 !important;\n          font-size: 12px !important;\n          font-weight: 600 !important;\n        }\n\n        /* === Content area === */\n        .template-manager-overlay .template-content {\n          background: #fafafa !important;\n          padding: 20px 24px !important;\n          flex: 1 !important;\n          min-height: 0 !important;\n          overflow-y: auto !important;\n        }\n\n        /* === Template grid === */\n        .template-manager-overlay .template-grid {\n          display: grid !important;\n          grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;\n          gap: 16px !important;\n        }\n\n        /* === Empty state === */\n        .template-manager-overlay .template-empty {\n          background: #ffffff !important;\n          border: 2px dashed #e5e7eb !important;\n          border-radius: 14px !important;\n          padding: 60px 24px !important;\n          text-align: center !important;\n          color: #6b7280 !important;\n          display: flex !important;\n          flex-direction: column !important;\n          align-items: center !important;\n          gap: 12px !important;\n        }\n\n        .template-manager-overlay .template-empty .empty-icon {\n          font-size: 48px !important;\n          margin-bottom: 8px !important;\n          opacity: 0.5 !important;\n        }\n\n        .template-manager-overlay .template-empty h3 {\n          color: #1f2937 !important;\n          font-size: 16px !important;\n          font-weight: 700 !important;\n          margin: 0 !important;\n        }\n\n        .template-manager-overlay .template-empty p {\n          color: #6b7280 !important;\n          font-size: 13px !important;\n          margin: 0 !important;\n        }\n\n        .template-manager-overlay .btn-create-first {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border: none !important;\n          border-radius: 10px !important;\n          padding: 10px 20px !important;\n          font-weight: 600 !important;\n          font-size: 13px !important;\n          cursor: pointer !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n          transition: all 0.15s ease !important;\n          margin-top: 12px !important;\n        }\n\n        .template-manager-overlay .btn-create-first:hover {\n          transform: translateY(-1px) !important;\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n        }\n\n        /* === Scrollbars === */\n        .template-manager-overlay .template-content::-webkit-scrollbar {\n          width: 10px !important;\n        }\n\n        .template-manager-overlay .template-content::-webkit-scrollbar-track {\n          background: #f4f4f5 !important;\n          border-radius: 5px !important;\n        }\n\n        .template-manager-overlay .template-content::-webkit-scrollbar-thumb {\n          background: #d4d4d8 !important;\n          border-radius: 5px !important;\n          border: 2px solid #f4f4f5 !important;\n        }\n\n        .template-manager-overlay .template-content::-webkit-scrollbar-thumb:hover {\n          background: #a1a1aa !important;\n        }\n\n        /* ============================================================ */\n        /* ================ V2 DARK MODE OVERRIDES ==================== */\n        /* ============================================================ */\n\n        .template-manager-overlay.lion-dark .template-manager {\n          background: #18181b !important;\n          border-color: #27272a !important;\n        }\n\n        .template-manager-overlay.lion-dark .template-manager-main {\n          background: #18181b !important;\n        }\n\n        .template-manager-overlay.lion-dark .template-manager-header {\n          background: #18181b !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        .template-manager-overlay.lion-dark .template-manager-header h2,\n        .template-manager-overlay.lion-dark .template-manager-header .header-title {\n          color: #fafafa !important;\n        }\n\n        .template-manager-overlay.lion-dark .template-manager-header .header-stats,\n        .template-manager-overlay.lion-dark .template-manager-header .header-subtitle {\n          color: #a1a1aa !important;\n        }\n\n        .template-manager-overlay.lion-dark .header-search,\n        .template-manager-overlay.lion-dark .header-search input,\n        .template-manager-overlay.lion-dark input.search-input {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #fafafa !important;\n        }\n        .template-manager-overlay.lion-dark .header-search input::placeholder,\n        .template-manager-overlay.lion-dark input.search-input::placeholder {\n          color: #71717a !important;\n        }\n\n        .template-manager-overlay.lion-dark .template-manager-header .close-btn,\n        .template-manager-overlay.lion-dark .template-manager-header .btn-close,\n        .template-manager-overlay.lion-dark .template-manager-header .header-close-btn {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #a1a1aa !important;\n        }\n\n        .template-manager-overlay.lion-dark .template-filter-bar {\n          background: #18181b !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        .template-manager-overlay.lion-dark .filter-select,\n        .template-manager-overlay.lion-dark .template-filter-bar select {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #e5e7eb !important;\n        }\n\n        .template-manager-overlay.lion-dark .filter-info {\n          color: #a1a1aa !important;\n        }\n\n        .template-manager-overlay.lion-dark .template-content {\n          background: #1a1a1a !important;\n        }\n\n        .template-manager-overlay.lion-dark .template-empty {\n          background: #1f1f22 !important;\n          border-color: #3f3f46 !important;\n          color: #a1a1aa !important;\n        }\n\n        .template-manager-overlay.lion-dark .template-empty h3 {\n          color: #fafafa !important;\n        }\n      ")):null},ha="wa_active_broadcast",ba="wa_broadcast_history",fa="wa_scheduled_broadcasts",va="wa_active_campaign",ya="media";const xa=new class{constructor(){this.db=null}async initDB(){return new Promise((e,t)=>{const n=indexedDB.open("WaBroadcastDB",1);n.onerror=()=>{t(n.error)},n.onsuccess=()=>{this.db=n.result,e()},n.onupgradeneeded=e=>{const t=e.target.result;if(!t.objectStoreNames.contains(ya)){const e=t.createObjectStore(ya,{keyPath:"id"});e.createIndex("broadcastId","broadcastId",{unique:!1}),e.createIndex("createdAt","createdAt",{unique:!1})}}})}async saveMedia(e,t,n,a,r){return this.db||await this.initDB(),new Promise((o,i)=>{const s=this.db.transaction([ya],"readwrite").objectStore(ya),l={id:e,broadcastId:t,data:n,fileName:a,mimeType:r,createdAt:Date.now()},c=s.put(l);c.onerror=()=>{i(c.error)},c.onsuccess=()=>{o()}})}async getMedia(e){return this.db||await this.initDB(),new Promise((t,n)=>{const a=this.db.transaction([ya],"readonly").objectStore(ya).get(e);a.onerror=()=>{n(a.error)},a.onsuccess=()=>{t(a.result||null)}})}async deleteMedia(e){return this.db||await this.initDB(),new Promise((t,n)=>{const a=this.db.transaction([ya],"readwrite").objectStore(ya).delete(e);a.onerror=()=>{n(a.error)},a.onsuccess=()=>{t()}})}async deleteMediaByBroadcast(e){return this.db||await this.initDB(),new Promise((t,n)=>{const a=this.db.transaction([ya],"readwrite").objectStore(ya).index("broadcastId").openCursor(IDBKeyRange.only(e));a.onerror=()=>{n(a.error)},a.onsuccess=e=>{const n=e.target.result;n?(n.delete(),n.continue()):t()}})}async cleanOldMedia(){this.db||await this.initDB();const e=Date.now()-6048e5;return new Promise((t,n)=>{const a=this.db.transaction([ya],"readwrite").objectStore(ya).index("createdAt").openCursor(IDBKeyRange.upperBound(e));a.onerror=()=>{n(a.error)},a.onsuccess=e=>{const n=e.target.result;n?(n.delete(),n.continue()):t()}})}async saveActiveBroadcast(e){try{await n().storage.local.set({[ha]:e})}catch(e){}}async getActiveBroadcast(){try{return(await n().storage.local.get(ha))[ha]||null}catch(e){return null}}async clearActiveBroadcast(){try{await n().storage.local.remove(ha)}catch(e){}}async addToHistory(e){try{const t=(await n().storage.local.get(ba))[ba]||[];t.unshift(e),t.length>100&&t.splice(100),await n().storage.local.set({[ba]:t})}catch(e){}}async getHistory(){try{return(await n().storage.local.get(ba))[ba]||[]}catch(e){return[]}}async clearHistory(){try{await n().storage.local.remove(ba)}catch(e){}}async saveScheduledBroadcast(e){try{const t=(await n().storage.local.get(fa))[fa]||[],a=t.findIndex(t=>t.id===e.id);a>=0?t[a]=e:t.push(e),await n().storage.local.set({[fa]:t})}catch(e){}}async getScheduledBroadcasts(){try{return(await n().storage.local.get(fa))[fa]||[]}catch(e){return[]}}async removeScheduledBroadcast(e){try{const t=await n().storage.local.get(fa),a=(t[fa]||[]).filter(t=>t.id!==e);await n().storage.local.set({[fa]:a}),await this.deleteMediaByBroadcast(e)}catch(e){}}async getDueScheduledBroadcasts(){try{const e=await this.getScheduledBroadcasts(),t=Date.now();return e.filter(e=>"scheduled"===e.status&&e.scheduledTime&&e.scheduledTime<=t)}catch(e){return[]}}generateId(){return`broadcast_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}async saveActiveCampaign(e){try{await n().storage.local.set({[va]:e})}catch(e){}}async getActiveCampaign(){try{const e=(await n().storage.local.get(va))[va]||null;return e}catch(e){return null}}async updateCampaignProgress(e,t,n,a,r,o){try{const i=await this.getActiveCampaign();i&&(i.currentIndex=e,i.sent=t,i.failed=n,i.queueItems=a,i.results=r,i.lastUpdatedAt=Date.now(),void 0!==o?.isPaused&&(i.isPaused=o.isPaused),void 0!==o?.status&&(i.status=o.status),await this.saveActiveCampaign(i))}catch(e){}}async updateCampaignPauseState(e){try{const t=await this.getActiveCampaign();if(t){t.isPaused=e,t.status=e?"paused":"running",t.lastUpdatedAt=Date.now(),await this.saveActiveCampaign(t);await this.getActiveCampaign()}}catch(e){}}async clearActiveCampaign(){try{await n().storage.local.remove(va)}catch(e){}}async hasInterruptedCampaign(){const e=await this.getActiveCampaign();return null!==e&&e.currentIndex<e.total}},wa="wa_signature_settings",ka={signature:"",enabled:!1};class Ea{static getSettings(){try{const e=localStorage.getItem(wa);if(e){const t=JSON.parse(e);return{...ka,...t}}}catch(e){}return ka}static saveSettings(e){try{const t={...this.getSettings(),...e};localStorage.setItem(wa,JSON.stringify(t)),window.dispatchEvent(new CustomEvent("signatureSettingsChanged"))}catch(e){}}static getSignature(){return this.getSettings().signature}static setSignature(e){this.saveSettings({signature:e})}static isEnabled(){const e=this.getSettings();return e.enabled&&!!e.signature.trim()}static setEnabled(e){this.saveSettings({enabled:e})}static appendSignature(e){if(!this.isEnabled())return e;const t=this.getSignature().trim();if(!t)return e;return`${`*${t}:*`}\n${e}`}}const Sa=()=>new Promise(e=>{const t=setTimeout(()=>{document.removeEventListener("getAllGroupsResponse",n),e([])},1e4),n=a=>{const r=a;clearTimeout(t),document.removeEventListener("getAllGroupsResponse",n),e(r.detail?.groups||[])};document.addEventListener("getAllGroupsResponse",n),document.dispatchEvent(new CustomEvent("getAllGroupsRequest"))}),Ca=e=>new Promise(t=>{const n=setTimeout(()=>{document.removeEventListener("getGroupMembersResponse",a),t([])},15e3),a=r=>{const o=r;o.detail?.groupId===e&&(clearTimeout(n),document.removeEventListener("getGroupMembersResponse",a),t(o.detail?.members||[]))};document.addEventListener("getGroupMembersResponse",a),document.dispatchEvent(new CustomEvent("getGroupMembersRequest",{detail:{groupId:e}}))}),Ta=async()=>{try{const e=await Promise.resolve().then(r.t.bind(r,6815,23)),t=(await e.default.storage.local.get("wa_kanban_crm_data_sync")).wa_kanban_crm_data_sync;if(!t||!t.crms)return[];const n=t.crms.find(e=>"whatsapp_labels"===e.type);if(!n)return[];const a=t.stages?.[n.id]||[];return a.map(e=>({id:e.whatsappLabelId||e.id,name:e.name,color:e.color||"#4ecdc4",stageId:e.id}))}catch(e){return[]}},Aa=async()=>{try{const e=await Promise.resolve().then(r.t.bind(r,6815,23)),t=await e.default.storage.local.get("kanban_tabs");return t.kanban_tabs||[]}catch(e){return[]}},Da=async()=>{try{const e=await Promise.resolve().then(r.t.bind(r,6815,23)),t=await e.default.storage.local.get("wa_kanban_crm_data_sync");return t.wa_kanban_crm_data_sync||{crms:[],stages:{},assignments:[],chatsCache:{}}}catch(e){return{crms:[],stages:{},assignments:[],chatsCache:{}}}},_a=e=>e.map(e=>`${e.id}:${e.templeteName}:${e.message?.substring(0,50)}:${e.modifiedAt||0}`).sort().join("|"),Na=async()=>{try{return await xa.getHistory()}catch(e){return[]}},Ma=async()=>{try{return await xa.getScheduledBroadcasts()}catch(e){return[]}},Ia=e=>{const t=[];let n="",a=!1;for(let r=0;r<e.length;r++){const o=e[r];'"'===o?a=!a:","!==o&&";"!==o&&"\t"!==o||a?n+=o:(t.push(n.trim()),n="")}return t.push(n.trim()),t},Ra=(e,t)=>{if(!e||!e.results||0===e.results.length)return void alert("Nenhum dado disponível para este relatório.");let n=e.results;if("sent"===t?n=e.results.filter(e=>!0===e.success):"failed"===t&&(n=e.results.filter(e=>!1===e.success)),0===n.length)return void alert(`Nenhum contato com status ${t} para baixar.`);let a=["Telefone","Nome","Status","Erro","Data/Hora"].join(",")+"\n";n.forEach(e=>{const t=[e.contact||e.phone||"",e.name||"",e.success?"Enviado":"Falhou",e.error||"",e.timestamp?new Date(e.timestamp).toLocaleString():""].map(e=>{const t=String(e);return t.includes(",")||t.includes('"')||t.includes("\n")?`"${t.replace(/"/g,'""')}"`:t});a+=t.join(",")+"\n"});const r=new Date(e.startedAt).toISOString().split("T")[0],o=new Date(e.startedAt).toLocaleTimeString().replace(/:/g,"-"),i=new Blob(["\ufeff"+a],{type:"text/csv;charset=utf-8;"}),s=URL.createObjectURL(i),l=document.createElement("a");l.setAttribute("href",s),l.setAttribute("download",`campaign_${t}_${r}_${o}.csv`),document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(s)},Ba=(0,a.createContext)(null),Pa=({children:e})=>{const[t,n]=(0,a.useState)(0),[r,o]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)}),[i,s]=(0,a.useState)("oneToOne"),[l,c]=(0,a.useState)("manual"),[d,m]=(0,a.useState)(""),[p,u]=(0,a.useState)([]),[g,h]=(0,a.useState)([]),[b,f]=(0,a.useState)([]),[v,y]=(0,a.useState)([]),[x,w]=(0,a.useState)([]),[k,E]=(0,a.useState)([]),[S,C]=(0,a.useState)([]),[T,D]=(0,a.useState)([]),[N,M]=(0,a.useState)([]),[R,B]=(0,a.useState)([]),[P,L]=(0,a.useState)([]),[U,F]=(0,a.useState)([]),[z,O]=(0,a.useState)(null),[W,q]=(0,a.useState)(null),[H,j]=(0,a.useState)([{id:"1",attachmentType:"none",content:"",attachments:[],selectedContacts:[],pollData:null,listData:null,selectedProducts:[]}]),[V,G]=(0,a.useState)(0),[K,$]=(0,a.useState)(!1),[Y,X]=(0,a.useState)(60),[J,Q]=(0,a.useState)(240),[Z,ee]=(0,a.useState)(!1),[te,ne]=(0,a.useState)(!1),[ae,re]=(0,a.useState)(!1),[oe,ie]=(0,a.useState)(5),[se,le]=(0,a.useState)(300),[ce,de]=(0,a.useState)(!1),[me,pe]=(0,a.useState)(!1),[ue,ge]=(0,a.useState)(!1),[he,be]=(0,a.useState)(!1),[fe,ve]=(0,a.useState)(!1),[ye,xe]=(0,a.useState)(!1),[we,ke]=(0,a.useState)(!0),[Ee,Se]=(0,a.useState)(""),[Ce,Te]=(0,a.useState)(!1),[Ae,De]=(0,a.useState)(!1),[_e,Ne]=(0,a.useState)([]),[Me,Ie]=(0,a.useState)([]),[Re,Be]=(0,a.useState)(!1),[Pe,Le]=(0,a.useState)(!1),[Ue,Fe]=(0,a.useState)([]),[ze,Oe]=(0,a.useState)(!1),[We,qe]=(0,a.useState)(!1),[He,je]=(0,a.useState)([]),[Ve,Ge]=(0,a.useState)([]),[Ke,$e]=(0,a.useState)(!1),[Ye,Xe]=(0,a.useState)(!1),[Je,Qe]=(0,a.useState)([]),[Ze,et]=(0,a.useState)(!1),[tt,nt]=(0,a.useState)(!1),[at,rt]=(0,a.useState)([]),[ot,it]=(0,a.useState)([]),[st,lt]=(0,a.useState)(!1),[ct,dt]=(0,a.useState)(!1),[mt,pt]=(0,a.useState)([]),[ut,gt]=(0,a.useState)(!1),[ht,bt]=(0,a.useState)(!1),[ft,vt]=(0,a.useState)(null),[yt,xt]=(0,a.useState)(null),[wt,kt]=(0,a.useState)(!1),[Et,St]=(0,a.useState)(!1),[Ct,Tt]=(0,a.useState)(null),[At,Dt]=(0,a.useState)(null),[_t,Nt]=(0,a.useState)([]),[Mt,It]=(0,a.useState)([]),[Rt,Bt]=(0,a.useState)([]),[Pt,Lt]=(0,a.useState)(!1),[Ut,Ft]=(0,a.useState)(""),[zt,Ot]=(0,a.useState)(""),[Wt,qt]=(0,a.useState)(!0),[Ht,jt]=(0,a.useState)(!1),[Vt,Gt]=(0,a.useState)("daily"),[Kt,$t]=(0,a.useState)([]),[Yt,Xt]=(0,a.useState)([]),[Jt,Qt]=(0,a.useState)([]),[Zt,en]=(0,a.useState)("never"),[tn,nn]=(0,a.useState)(""),[an,rn]=(0,a.useState)(()=>new Date),[on,sn]=(0,a.useState)(!1),[ln,cn]=(0,a.useState)(!1),[dn,mn]=(0,a.useState)(!1),[pn,un]=(0,a.useState)({sent:0,total:0,failed:0}),[gn,hn]=(0,a.useState)(!1),[bn,fn]=(0,a.useState)([]),[vn,yn]=(0,a.useState)([]),[xn,wn]=(0,a.useState)(!1),[kn,En]=(0,a.useState)(!1),[Sn,Cn]=(0,a.useState)([]),[Tn,An]=(0,a.useState)([]),[Dn,_n]=(0,a.useState)(""),[Nn,Mn]=(0,a.useState)(!1),[In,Rn]=(0,a.useState)(null),[Bn,Pn]=(0,a.useState)(!1),[Ln,Un]=(0,a.useState)(!1),[Fn,zn]=(0,a.useState)(1),[On,Wn]=(0,a.useState)([]),[qn,Hn]=(0,a.useState)(""),[jn,Vn]=(0,a.useState)([]),[Gn,Kn]=(0,a.useState)(0),[$n,Yn]=(0,a.useState)([]),[Xn,Jn]=(0,a.useState)([]),[Qn,Zn]=(0,a.useState)(new Set),[ea,ta]=(0,a.useState)([]),[na,aa]=(0,a.useState)(!1),[ra,oa]=(0,a.useState)([]),[ia,sa]=(0,a.useState)([]),[la,ca]=(0,a.useState)(!1),[da,ma]=(0,a.useState)(!1),[pa,ua]=(0,a.useState)(!1),[ga,ha]=(0,a.useState)(null),[ba,fa]=(0,a.useState)(!1),[va,ya]=(0,a.useState)(null),[xa,wa]=(0,a.useState)(!1),[ka,Ea]=(0,a.useState)(!1),[Sa,Ca]=(0,a.useState)(!1),[Ta,Aa]=(0,a.useState)(!1),[Da,_a]=(0,a.useState)([]),[Na,Ma]=(0,a.useState)(new Set),[Ia,Ra]=(0,a.useState)(""),[Pa,La]=(0,a.useState)(""),[Ua,Fa]=(0,a.useState)("campaign"),[za,Oa]=(0,a.useState)([]),[Wa,qa]=(0,a.useState)(null),Ha=(0,a.useRef)(null),ja=(0,a.useRef)(null),Va=(0,a.useRef)(null),Ga=(0,a.useRef)(!1),Ka=(0,a.useRef)(Y),$a=(0,a.useRef)(J),Ya=(0,a.useRef)(null),Xa=(0,a.useRef)(null),Ja=(0,a.useRef)("");(0,a.useEffect)(()=>{const e=()=>{n(e=>e+1)};return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{const e=()=>{const e=_();o("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]),(0,a.useEffect)(()=>{Ga.current=dn},[dn]),(0,a.useEffect)(()=>{Ka.current=Y,$a.current=J},[Y,J]);const Qa={forceUpdate:t,isDarkMode:r,setIsDarkMode:o,broadcastMode:i,setBroadcastMode:s,contactSource:l,setContactSource:c,manualPhones:d,setManualPhones:m,selectedGroups:p,setSelectedGroups:u,selectedGroupsData:g,setSelectedGroupsData:h,selectedLabels:b,setSelectedLabels:f,selectedTabs:v,setSelectedTabs:y,selectedKanbanStages:x,setSelectedKanbanStages:w,contacts:k,setContacts:E,availableGroups:S,setAvailableGroups:C,adminGroups:T,setAdminGroups:D,availableLabels:N,setAvailableLabels:M,availableTabs:R,setAvailableTabs:B,availableKanbanStages:P,setAvailableKanbanStages:L,availableKanbanCRMs:U,setAvailableKanbanCRMs:F,selectedKanbanCRM:z,setSelectedKanbanCRM:O,kanbanData:W,setKanbanData:q,messages:H,setMessages:j,activeMessageIndex:V,setActiveMessageIndex:G,sendRandomMessage:K,setSendRandomMessage:$,minDelay:Y,setMinDelay:X,maxDelay:J,setMaxDelay:Q,allowDuplicates:Z,setAllowDuplicates:ee,enableLinkPreview:te,setEnableLinkPreview:ne,pauseEnabled:ae,setPauseEnabled:re,pauseAfterContacts:oe,setPauseAfterContacts:ie,pauseTimeSeconds:se,setPauseTimeSeconds:le,groupActions:ce,setGroupActions:de,customTabActions:me,setCustomTabActions:pe,labelsActions:ue,setLabelsActions:ge,kanbanBoardActions:he,setKanbanBoardActions:be,skipBulkMessage:fe,setSkipBulkMessage:ve,userHasSignature:ye,setUserHasSignature:xe,appendSignatureEnabled:we,setAppendSignatureEnabled:ke,userSignature:Ee,setUserSignature:Se,addToGroupsEnabled:Ce,setAddToGroupsEnabled:Te,removeFromGroupsEnabled:Ae,setRemoveFromGroupsEnabled:De,groupsForAddAction:_e,setGroupsForAddAction:Ne,groupsForRemoveAction:Me,setGroupsForRemoveAction:Ie,showAddGroupSelector:Re,setShowAddGroupSelector:Be,showRemoveGroupSelector:Pe,setShowRemoveGroupSelector:Le,tempSelectedGroups:Ue,setTempSelectedGroups:Fe,addToTabsEnabled:ze,setAddToTabsEnabled:Oe,removeFromTabsEnabled:We,setRemoveFromTabsEnabled:qe,tabsForAddAction:He,setTabsForAddAction:je,tabsForRemoveAction:Ve,setTabsForRemoveAction:Ge,showAddTabSelector:Ke,setShowAddTabSelector:$e,showRemoveTabSelector:Ye,setShowRemoveTabSelector:Xe,tempSelectedTabsForAction:Je,setTempSelectedTabsForAction:Qe,addToLabelsEnabled:Ze,setAddToLabelsEnabled:et,removeFromLabelsEnabled:tt,setRemoveFromLabelsEnabled:nt,labelsForAddAction:at,setLabelsForAddAction:rt,labelsForRemoveAction:ot,setLabelsForRemoveAction:it,showAddLabelSelector:st,setShowAddLabelSelector:lt,showRemoveLabelSelector:ct,setShowRemoveLabelSelector:dt,tempSelectedLabelsForAction:mt,setTempSelectedLabelsForAction:pt,addToKanbanEnabled:ut,setAddToKanbanEnabled:gt,removeFromKanbanEnabled:ht,setRemoveFromKanbanEnabled:bt,kanbanForAddAction:ft,setKanbanForAddAction:vt,kanbanForRemoveAction:yt,setKanbanForRemoveAction:xt,showAddKanbanSelector:wt,setShowAddKanbanSelector:kt,showRemoveKanbanSelector:Et,setShowRemoveKanbanSelector:St,selectedKanbanCRMForAdd:Ct,setSelectedKanbanCRMForAdd:Tt,selectedKanbanCRMForRemove:At,setSelectedKanbanCRMForRemove:Dt,availableKanbanStagesForAdd:_t,setAvailableKanbanStagesForAdd:Nt,availableKanbanStagesForRemove:Mt,setAvailableKanbanStagesForRemove:It,availableCRMs:Rt,setAvailableCRMs:Bt,isScheduled:Pt,setIsScheduled:Lt,scheduledDate:Ut,setScheduledDate:Ft,scheduledTime:zt,setScheduledTime:Ot,autoSendIfMissed:Wt,setAutoSendIfMissed:qt,isRecurring:Ht,setIsRecurring:jt,recurringInterval:Vt,setRecurringInterval:Gt,recurringDays:Kt,setRecurringDays:$t,recurringCalendarDates:Yt,setRecurringCalendarDates:Xt,recurringMonths:Jt,setRecurringMonths:Qt,recurringEndType:Zt,setRecurringEndType:en,recurringEndDate:tn,setRecurringEndDate:nn,calendarDate:an,setCalendarDate:rn,isLoading:on,setIsLoading:sn,isSending:ln,setIsSending:cn,isPaused:dn,setIsPaused:mn,progress:pn,setProgress:un,showTemplateSelector:gn,setShowTemplateSelector:hn,availableTemplates:bn,setAvailableTemplates:fn,queueItems:vn,setQueueItems:yn,showQueueView:xn,setShowQueueView:wn,showReportsView:kn,setShowReportsView:En,broadcastHistory:Sn,setBroadcastHistory:Cn,scheduledBroadcasts:Tn,setScheduledBroadcasts:An,currentBroadcastId:Dn,setCurrentBroadcastId:_n,hasInterruptedCampaign:Nn,setHasInterruptedCampaign:Mn,interruptedCampaign:In,setInterruptedCampaign:Rn,showResumeModal:Bn,setShowResumeModal:Pn,showUploadWizard:Ln,setShowUploadWizard:Un,uploadStep:Fn,setUploadStep:zn,uploadedFileData:On,setUploadedFileData:Wn,uploadedFileName:qn,setUploadedFileName:Hn,columnHeaders:jn,setColumnHeaders:Vn,phoneNumberColumn:Gn,setPhoneNumberColumn:Kn,selectedExtraColumns:$n,setSelectedExtraColumns:Yn,uploadedContacts:Xn,setUploadedContacts:Jn,removedRows:Qn,setRemovedRows:Zn,availableVariables:ea,setAvailableVariables:ta,showVariableDropdown:na,setShowVariableDropdown:aa,uploadedContactsData:ra,setUploadedContactsData:oa,uploadedColumnsOrder:ia,setUploadedColumnsOrder:sa,showSelectDropdown:la,setShowSelectDropdown:ca,showContactsSelector:da,setShowContactsSelector:ma,showScheduleConfirm:pa,setShowScheduleConfirm:ua,scheduleConfirmData:ga,setScheduleConfirmData:ha,showPreviewModal:ba,setShowPreviewModal:fa,previewData:va,setPreviewData:ya,showGroupsSelector:xa,setShowGroupsSelector:wa,showTabsSelector:ka,setShowTabsSelector:Ea,showKanbanSelector:Sa,setShowKanbanSelector:Ca,showLabelsSelector:Ta,setShowLabelsSelector:Aa,allContacts:Da,setAllContacts:_a,selectedContactIds:Na,setSelectedContactIds:Ma,contactSearchQuery:Ia,setContactSearchQuery:Ra,groupSearchQuery:Pa,setGroupSearchQuery:La,currentView:Ua,setCurrentView:Fa,scheduledCampaigns:za,setScheduledCampaigns:Oa,editingCampaign:Wa,setEditingCampaign:qa,refs:{fileInputRef:Ha,mediaInputRef:ja,uploadFileInputRef:Va,isPausedRef:Ga,minDelayRef:Ka,maxDelayRef:$a,syncIntervalRef:Ya,templatePollingRef:Xa,lastTemplateHashRef:Ja}};return a.createElement(Ba.Provider,{value:Qa},e)},La=()=>{const e=(0,a.useContext)(Ba);if(!e)throw new Error("useBroadcastContext must be used within a BroadcastProvider");return e},Ua=({onClose:e,onLoadReportsData:t})=>{const{currentView:n,setCurrentView:r,isSending:o,isPaused:i,queueItems:l,scheduledCampaigns:c,setShowQueueView:d,setShowReportsView:m}=La();return a.createElement("div",{className:"broadcast-sidebar"},a.createElement("div",{className:"broadcast-sidebar-header"},a.createElement("svg",{viewBox:"0 0 24 24",className:"broadcast-logo"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),a.createElement("span",null,(0,s.t)("broadcast.title"))),a.createElement("nav",{className:"broadcast-nav"},a.createElement("button",{className:"broadcast-nav-item "+("campaign"===n?"active":""),onClick:()=>r("campaign")},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"})),a.createElement("span",null,(0,s.t)("broadcast.newCampaign"))),(o||l.length>0)&&a.createElement("button",{className:`broadcast-nav-item sending ${"sending"===n?"active":""} ${!o&&l.length>0?"completed":""} ${i?"paused":""}`,onClick:()=>{r("sending"),d(!0)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20",className:o&&!i?"sending-icon":""},a.createElement("path",{fill:"currentColor",d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})),a.createElement("span",null,o?i?(0,s.t)("broadcast.paused"):(0,s.t)("broadcast.sending"):(0,s.t)("broadcast.completed"))),a.createElement("button",{className:"broadcast-nav-item "+("scheduled"===n?"active":""),onClick:()=>r("scheduled")},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"})),a.createElement("span",null,(0,s.t)("broadcast.scheduled")),c.length>0&&a.createElement("span",{className:"nav-badge"},c.length)),a.createElement("button",{className:"broadcast-nav-item "+("reports"===n?"active":""),onClick:()=>{r("reports"),m(!1),t()}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z"})),a.createElement("span",null,(0,s.t)("broadcast.reports")))),a.createElement("div",{className:"broadcast-sidebar-footer"},a.createElement("button",{className:"broadcast-close-sidebar-btn",onClick:e},a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),a.createElement("span",null,(0,s.t)("broadcast.close")))))},Fa=({onResume:e,onCancel:t})=>{const{showResumeModal:n,interruptedCampaign:r,setShowResumeModal:o}=La();return n&&r?a.createElement("div",{className:"broadcast-resume-modal-overlay"},a.createElement("div",{className:"broadcast-resume-modal"},a.createElement("div",{className:"broadcast-resume-header"},a.createElement("svg",{viewBox:"0 0 24 24",width:"48",height:"48",className:"broadcast-resume-icon"},a.createElement("path",{fill:"var(--lion-primary)",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z"})),a.createElement("h2",null,(0,s.t)("broadcast.resumeCampaign")),a.createElement("p",null,(0,s.t)("broadcast.campaignInterrupted"))),a.createElement("div",{className:"broadcast-resume-progress"},a.createElement("div",{className:"broadcast-resume-stats"},a.createElement("div",{className:"broadcast-resume-stat"},a.createElement("span",{className:"stat-value"},r.sent),a.createElement("span",{className:"stat-label"},(0,s.t)("broadcast.sent"))),a.createElement("div",{className:"broadcast-resume-stat pending"},a.createElement("span",{className:"stat-value"},r.total-r.currentIndex),a.createElement("span",{className:"stat-label"},(0,s.t)("broadcast.remaining"))),a.createElement("div",{className:"broadcast-resume-stat failed"},a.createElement("span",{className:"stat-value"},r.failed),a.createElement("span",{className:"stat-label"},(0,s.t)("broadcast.failed")))),a.createElement("div",{className:"broadcast-resume-progress-bar"},a.createElement("div",{className:"broadcast-resume-progress-fill",style:{width:r.currentIndex/r.total*100+"%"}})),a.createElement("span",{className:"broadcast-resume-progress-text"},r.currentIndex," / ",r.total," ",(0,s.t)("broadcast.contactsProcessed"))),a.createElement("div",{className:"broadcast-resume-actions"},a.createElement("button",{className:"broadcast-resume-btn primary",onClick:e},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M8 5v14l11-7z"})),(0,s.t)("broadcast.resumeCampaignBtn")),a.createElement("button",{className:"broadcast-resume-btn secondary",onClick:t},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),(0,s.t)("broadcast.cancelDiscard")),a.createElement("button",{className:"broadcast-resume-btn dismiss",onClick:()=>{o(!1)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),(0,s.t)("broadcast.dismissRemindLater"))))):null},za=({isOpen:e,onClose:t})=>a.createElement(Pa,null,a.createElement(Oa,{isOpen:e,onClose:t})),Oa=({isOpen:e,onClose:t})=>{const r=La(),{isDarkMode:o,broadcastMode:i,setBroadcastMode:l,contactSource:c,setContactSource:d,manualPhones:m,setManualPhones:p,selectedGroups:u,setSelectedGroups:g,selectedGroupsData:h,setSelectedGroupsData:b,selectedLabels:f,setSelectedLabels:v,selectedTabs:y,setSelectedTabs:x,selectedKanbanStages:w,setSelectedKanbanStages:k,contacts:E,setContacts:S,availableGroups:C,setAvailableGroups:T,adminGroups:A,setAdminGroups:D,availableLabels:_,setAvailableLabels:N,availableTabs:M,setAvailableTabs:I,availableKanbanStages:R,setAvailableKanbanStages:B,availableKanbanCRMs:P,setAvailableKanbanCRMs:L,selectedKanbanCRM:U,setSelectedKanbanCRM:F,kanbanData:z,setKanbanData:O,messages:W,setMessages:q,activeMessageIndex:H,setActiveMessageIndex:j,sendRandomMessage:V,setSendRandomMessage:G,minDelay:K,setMinDelay:$,maxDelay:Y,setMaxDelay:X,allowDuplicates:J,setAllowDuplicates:Q,enableLinkPreview:Z,setEnableLinkPreview:ee,pauseEnabled:te,setPauseEnabled:ne,pauseAfterContacts:ae,setPauseAfterContacts:re,pauseTimeSeconds:oe,setPauseTimeSeconds:ie,groupActions:se,setGroupActions:le,customTabActions:ce,setCustomTabActions:de,labelsActions:me,setLabelsActions:pe,kanbanBoardActions:ue,setKanbanBoardActions:ge,skipBulkMessage:he,setSkipBulkMessage:be,userHasSignature:fe,setUserHasSignature:ve,appendSignatureEnabled:ye,setAppendSignatureEnabled:xe,userSignature:we,setUserSignature:ke,addToGroupsEnabled:Ee,setAddToGroupsEnabled:Se,removeFromGroupsEnabled:Ce,setRemoveFromGroupsEnabled:Te,groupsForAddAction:Ae,setGroupsForAddAction:De,groupsForRemoveAction:_e,setGroupsForRemoveAction:Ne,showAddGroupSelector:Me,setShowAddGroupSelector:Ie,showRemoveGroupSelector:Re,setShowRemoveGroupSelector:Be,tempSelectedGroups:Pe,setTempSelectedGroups:Le,addToTabsEnabled:Ue,setAddToTabsEnabled:Fe,removeFromTabsEnabled:ze,setRemoveFromTabsEnabled:Oe,tabsForAddAction:We,setTabsForAddAction:qe,tabsForRemoveAction:He,setTabsForRemoveAction:je,showAddTabSelector:Ve,setShowAddTabSelector:Ge,showRemoveTabSelector:Ke,setShowRemoveTabSelector:$e,tempSelectedTabsForAction:Ye,setTempSelectedTabsForAction:Xe,addToLabelsEnabled:Je,setAddToLabelsEnabled:Qe,removeFromLabelsEnabled:Ze,setRemoveFromLabelsEnabled:et,labelsForAddAction:tt,setLabelsForAddAction:nt,labelsForRemoveAction:at,setLabelsForRemoveAction:rt,showAddLabelSelector:ot,setShowAddLabelSelector:it,showRemoveLabelSelector:st,setShowRemoveLabelSelector:lt,tempSelectedLabelsForAction:ct,setTempSelectedLabelsForAction:dt,addToKanbanEnabled:mt,setAddToKanbanEnabled:pt,removeFromKanbanEnabled:ut,setRemoveFromKanbanEnabled:gt,kanbanForAddAction:ht,setKanbanForAddAction:bt,kanbanForRemoveAction:ft,setKanbanForRemoveAction:vt,showAddKanbanSelector:yt,setShowAddKanbanSelector:xt,showRemoveKanbanSelector:wt,setShowRemoveKanbanSelector:kt,selectedKanbanCRMForAdd:Et,setSelectedKanbanCRMForAdd:St,selectedKanbanCRMForRemove:Ct,setSelectedKanbanCRMForRemove:Tt,availableKanbanStagesForAdd:At,setAvailableKanbanStagesForAdd:Dt,availableKanbanStagesForRemove:_t,setAvailableKanbanStagesForRemove:Nt,availableCRMs:Mt,setAvailableCRMs:It,isScheduled:Rt,setIsScheduled:Bt,scheduledDate:Pt,setScheduledDate:Lt,scheduledTime:Ut,setScheduledTime:Ft,autoSendIfMissed:zt,setAutoSendIfMissed:Ot,isRecurring:Wt,setIsRecurring:qt,recurringInterval:Ht,setRecurringInterval:jt,recurringDays:Vt,setRecurringDays:Gt,recurringCalendarDates:Kt,setRecurringCalendarDates:$t,recurringMonths:Yt,setRecurringMonths:Xt,recurringEndType:Jt,setRecurringEndType:Qt,recurringEndDate:Zt,setRecurringEndDate:en,calendarDate:tn,setCalendarDate:nn,isLoading:an,setIsLoading:rn,isSending:on,setIsSending:sn,isPaused:ln,setIsPaused:cn,progress:dn,setProgress:mn,showTemplateSelector:pn,setShowTemplateSelector:un,availableTemplates:gn,setAvailableTemplates:hn,queueItems:bn,setQueueItems:fn,showQueueView:vn,setShowQueueView:yn,showReportsView:xn,setShowReportsView:wn,broadcastHistory:kn,setBroadcastHistory:En,scheduledBroadcasts:Sn,setScheduledBroadcasts:Cn,currentBroadcastId:Tn,setCurrentBroadcastId:An,hasInterruptedCampaign:Dn,setHasInterruptedCampaign:_n,interruptedCampaign:Nn,setInterruptedCampaign:In,showResumeModal:Rn,setShowResumeModal:Bn,showUploadWizard:Pn,setShowUploadWizard:zn,uploadStep:qn,setUploadStep:Hn,uploadedFileData:jn,setUploadedFileData:Vn,uploadedFileName:Gn,setUploadedFileName:Kn,columnHeaders:$n,setColumnHeaders:Yn,phoneNumberColumn:Jn,setPhoneNumberColumn:Zn,selectedExtraColumns:ea,setSelectedExtraColumns:ta,uploadedContacts:na,setUploadedContacts:aa,removedRows:ra,setRemovedRows:oa,availableVariables:ia,setAvailableVariables:sa,showVariableDropdown:la,setShowVariableDropdown:da,uploadedContactsData:ma,setUploadedContactsData:pa,uploadedColumnsOrder:ua,setUploadedColumnsOrder:ga,showSelectDropdown:ha,setShowSelectDropdown:ba,showContactsSelector:fa,setShowContactsSelector:va,showScheduleConfirm:ya,setShowScheduleConfirm:wa,scheduleConfirmData:ka,setScheduleConfirmData:Ba,showPreviewModal:Pa,setShowPreviewModal:za,previewData:Oa,setPreviewData:Wa,showGroupsSelector:qa,setShowGroupsSelector:Ha,showTabsSelector:ja,setShowTabsSelector:Va,showKanbanSelector:Ga,setShowKanbanSelector:Ka,showLabelsSelector:$a,setShowLabelsSelector:Ya,allContacts:Xa,setAllContacts:Ja,selectedContactIds:Qa,setSelectedContactIds:Za,contactSearchQuery:er,setContactSearchQuery:tr,groupSearchQuery:nr,setGroupSearchQuery:ar,currentView:rr,setCurrentView:or,scheduledCampaigns:ir,setScheduledCampaigns:sr,editingCampaign:lr,setEditingCampaign:cr,refs:dr}=r,{fileInputRef:mr,mediaInputRef:pr,uploadFileInputRef:ur,isPausedRef:gr,minDelayRef:hr,maxDelayRef:br,syncIntervalRef:fr,templatePollingRef:vr,lastTemplateHashRef:yr}=dr,[xr,wr]=(0,a.useState)(1),kr=[(0,s.t)("broadcast.recipients"),(0,s.t)("broadcast.messages"),(0,s.t)("broadcast.stepSettings"),(0,s.t)("broadcast.stepActions"),(0,s.t)("broadcast.stepReview")],[Er,Sr]=(0,a.useState)(!1);(0,a.useEffect)(()=>{"campaign"===rr&&wr(1)},[rr]),(0,a.useEffect)(()=>{5===xr&&Sr(!1)},[xr]);(0,a.useEffect)(()=>{e?(Tr(),Cr()):(fr.current&&(clearInterval(fr.current),fr.current=null),Nr(),((e=!1)=>{const t=!0===window.__WA_BROADCAST_LOOP_RUNNING__;e&&t||(l("oneToOne"),d("manual"),p(""),g([]),b([]),v([]),x([]),k([]),S([]),F(null),q([{id:"1",attachmentType:"none",content:"",attachments:[],selectedContacts:[],pollData:null,listData:null,selectedProducts:[]}]),j(0),G(!1),$(30),X(240),hr.current=30,br.current=240,Q(!1),ee(!1),ne(!1),re(5),ie(300),le(!1),de(!1),pe(!1),ge(!1),Se(!1),Te(!1),De([]),Ne([]),Fe(!1),Oe(!1),qe([]),je([]),Qe(!1),et(!1),nt([]),rt([]),pt(!1),gt(!1),bt(null),vt(null),Bt(!1),Lt(""),Ft(""),Ot(!0),sn(!1),cn(!1),gr.current=!1,mn({sent:0,total:0,failed:0}),fn([]),yn(!1),An(""),Vn([]),Kn(""),Yn([]),Zn(0),ta([]),aa([]),oa(new Set),sa([]),pa([]),ga([]),Za(new Set),tr(""))})(!0),window.__WA_BROADCAST_LOOP_RUNNING__||window.__WA_BROADCAST_EXECUTION_ID__&&(window.__WA_BROADCAST_EXECUTION_ID__=null,window.__WA_BROADCAST_LOOP_PROGRESS__=null))},[e]);const Cr=async()=>{try{const e=await n().storage.local.get("gmaps_broadcast_payload"),t=e?.gmaps_broadcast_payload;if(!t||"gmaps"!==t.source||!Array.isArray(t.contacts)||0===t.contacts.length)return;d("manual"),g([]),v([]),x([]),k([]);const a=t.contacts.map(e=>e.phone).join("\n");p(a);const r=[];t.contacts.forEach(e=>{Object.keys(e).forEach(e=>{"phone"!==e&&(r.includes(e)||r.push(e))})});const o=t.contacts.map(e=>{const t={phone:e.phone};return r.forEach(n=>{t[n]=(e[n]??"").toString()}),t});pa(o);const i=r.map((e,t)=>({name:e,column:t}));sa(i),await n().storage.local.remove("gmaps_broadcast_payload")}catch(e){}},Tr=async()=>{rn(!0);try{const e=Ea.getSettings(),t=!!e.signature.trim();ve(t),ke(e.signature),xe(t);const n=await Sa();T(n);const a=await new Promise(e=>{const t=`admin_groups_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,n=setTimeout(()=>{document.removeEventListener("getAdminGroupsResponse",a),e([])},3e4),a=r=>{const o=r;o.detail?.requestId&&o.detail.requestId!==t||(clearTimeout(n),document.removeEventListener("getAdminGroupsResponse",a),e(o.detail?.groups||[]))};document.addEventListener("getAdminGroupsResponse",a),document.dispatchEvent(new CustomEvent("getAdminGroupsRequest",{detail:{requestId:t}}))});D(a);const r=await Ta();N(r);const o=await Aa();I(o);const i=await Da();O(i),L(i.crms||[]);const s=await(async()=>{try{return(await Mn.TemplatesStorage.getTemplatesAsync()).filter(e=>!1!==e.isActive)}catch(e){return[]}})();hn(s),yr.current=_a(s),_r(),await Dr(),await Ar()}catch(e){}finally{rn(!1)}},Ar=async()=>{try{const e=await xa.getActiveCampaign();if(e&&e.currentIndex<e.total){if(!e.messages||!Array.isArray(e.messages)||0===e.messages.length)return await xa.clearActiveCampaign(),_n(!1),void In(null);if(!e.queueItems||!Array.isArray(e.queueItems))return await xa.clearActiveCampaign(),_n(!1),void In(null);!0===e.isMissedSchedule&&(e.isMissedSchedule=!1,await xa.saveActiveCampaign(e)),In(e),_n(!0),Bn(!0)}else e&&(await xa.clearActiveCampaign(),_n(!1),In(null))}catch(e){}},Dr=async()=>{const[e,t]=await Promise.all([Na(),Ma()]);En(e||[]);const n=t.filter(e=>"scheduled"===e.status&&(!(!e.contacts||!Array.isArray(e.contacts))&&!(!e.messages||!Array.isArray(e.messages))));Cn(n)},_r=()=>{vr.current&&clearInterval(vr.current),vr.current=setInterval(async()=>{try{const e=(await Mn.TemplatesStorage.getTemplatesAsync()).filter(e=>!1!==e.isActive),t=_a(e);t!==yr.current&&(yr.current=t,hn(e))}catch(e){}},2e3)},Nr=()=>{vr.current&&(clearInterval(vr.current),vr.current=null)},Mr=async e=>{const t=e.target.files?.[0];if(t)try{Kn(t.name);const e=await t.text();let n=[];const a=t.name.toLowerCase().split(".").pop();if("csv"===a||"txt"===a){const t=e.split("\n").filter(e=>e.trim());for(const e of t){const t=Ia(e);t.length>0&&n.push(t)}}else if("xlsx"===a||"xls"===a){const t=e.split("\n").filter(e=>e.trim());for(const e of t){const t=Ia(e);t.length>0&&n.push(t)}}if(0===n.length)return void alert("No data found in file");const r=n[0].map((e,t)=>e.trim()||`column ${t+1}`);Yn(r),Vn(n);const o=r.map((e,t)=>t).filter(e=>0!==e);ta(o)}catch(e){alert("Falha ao analisar o arquivo. Verifique o formato do arquivo.")}},Ir=e=>{2!==e||0!==jn.length?(3===e&&Rr(),Hn(e)):alert("Por favor, envie um arquivo primeiro")},Rr=()=>{const e=[],t=jn.slice(1);for(let n=0;n<t.length;n++){const a=t[n],r={rowIndex:n,phoneNumber:a[Jn]||"",extraData:{}};for(const e of ea){const t=$n[e]||`column ${e+1}`;r.extraData[t]=a[e]||""}e.push(r)}aa(e)},Br=async()=>{ba(!1),rn(!0);try{const e=await Sa();T(e),Ha(!0)}catch(e){}finally{rn(!1)}},Pr=()=>{if(!er.trim())return Xa;const e=er.toLowerCase();return Xa.filter(t=>t.name?.toLowerCase().includes(e)||t.phoneNumber?.includes(e))},Lr=()=>{if(!nr.trim())return C;const e=nr.toLowerCase();return C.filter(t=>t.name?.toLowerCase().includes(e))},Ur=(e,t)=>{const n="up"===t?e-1:e+1;if(n<0||n>=W.length)return;const a=[...W],r=a[e];a[e]=a[n],a[n]=r,q(a),j(n)},Fr=e=>{const t=[...W];t[H]={...t[H],content:e},q(t)},zr=e=>{const t=document.querySelector(".broadcast-message-textarea");if(t){const n=t.selectionStart,a=t.selectionEnd,r=W[H].content,o=r.substring(0,n)+e+r.substring(a);Fr(o),setTimeout(()=>{t.selectionStart=t.selectionEnd=n+e.length,t.focus()},0)}else Fr(W[H].content+e)},Or=e=>{const t=document.querySelector(".broadcast-message-textarea");if(!t)return;const n=t.selectionStart,a=t.selectionEnd,r=t.value.substring(n,a);if(!r)return;let o=r;switch(e){case"bold":o=`*${r}*`;break;case"italic":o=`_${r}_`;break;case"strikethrough":o=`~${r}~`}const i=W[H].content,s=i.substring(0,n)+o+i.substring(a);Fr(s)},Wr=async e=>{const t=[];if(!e||0===e.length)return t;for(const n of e)if(!n.file||n.base64Url&&n.base64Url.startsWith("data:"))t.push(n);else try{const e=await Mn.TemplatesStorage.getMedia(n.file);e&&e.base64?t.push({...n,base64Url:e.base64,file:e.base64}):t.push(n)}catch(e){t.push(n)}return t},qr=async()=>{const e=[];if(ma.length>0)for(const t of ma){const{phone:n,name:a,...r}=t;e.push({...r,phone:n,name:a||n})}else if("manual"===c||m.trim()){const n=m.split("\n").map(e=>{const t=e.trim();if(!t)return null;const n=t.split(","),a=n[0].trim(),r=n.length>1?n.slice(1).join(",").trim():"";return a.length<10?null:{phone:a,name:r}}).filter(e=>null!==e),a=n.filter(e=>!e.name||e.name===e.phone).map(e=>e.phone);if(a.length>0){const r=await(t=a,new Promise(e=>{const n=setTimeout(()=>{document.removeEventListener("fetchWhatsAppNamesResponse",a),e(t.map(e=>({phone:e,name:e})))},1e4),a=r=>{const o=r;clearTimeout(n),document.removeEventListener("fetchWhatsAppNamesResponse",a),o.detail?.success&&o.detail?.contacts?e(o.detail.contacts):e(t.map(e=>({phone:e,name:e})))};document.addEventListener("fetchWhatsAppNamesResponse",a),document.dispatchEvent(new CustomEvent("fetchWhatsAppNames",{detail:{phones:t}}))})),o=new Map(r.map(e=>[e.phone.replace(/[^\d]/g,""),e.name]));for(const t of n){const n=t.phone.replace(/[^\d]/g,""),a=o.get(n);e.push({phone:t.phone,name:t.name||a||t.phone})}}else e.push(...n.map(e=>({phone:e.phone,name:e.name||e.phone})))}var t;if(h.length>0)for(const t of h)e.push({phone:t.id,name:t.name||t.id});if(f.length>0)for(const t of f){const n=await Hr(t);for(const t of n){const n=t.phoneNumber||t.id?.user||"";n&&e.push({phone:n,name:t.name||t.pushname||n})}}if(y.length>0)for(const t of M)if(y.includes(t.id)&&t.chats)for(const n of t.chats){const t=n.id||"",a=t.includes("@lid"),r=a?t:t.split("@")[0];r&&e.push({phone:r,name:n.name||(a?t.split("@")[0]:r)})}if(!J){const t=new Set,n=e.filter(e=>!t.has(e.phone)&&(t.add(e.phone),!0));e.length,n.length;return n}return e},Hr=e=>new Promise(t=>{const n=setTimeout(()=>{document.removeEventListener("kanbanFetchChatsByLabelResponse",a),t([])},1e4),a=r=>{const o=r;if(o.detail?.requestLabelId===e){clearTimeout(n),document.removeEventListener("kanbanFetchChatsByLabelResponse",a);const e=(o.detail?.chats||[]).filter(e=>!e.isGroup&&"group"!==e.type).map(e=>{const t=e.id||"",n=t.includes("@lid"),a=n?t:e.phoneNumber||t.split("@")[0]||"";return{id:{user:a},phoneNumber:a,name:e.name||(n?t.split("@")[0]:e.phoneNumber)||"",displayName:e.name||(n?t.split("@")[0]:e.phoneNumber)||""}});t(e)}};document.addEventListener("kanbanFetchChatsByLabelResponse",a),document.dispatchEvent(new CustomEvent("kanbanFetchChatsByLabelRequest",{detail:{labelId:e}}))}),jr=async e=>{const t=`broadcast_${Date.now()}`;An(t);const a=Date.now();window.__WA_BROADCAST_EXECUTION_ID__=t,window.__WA_BROADCAST_LOOP_RUNNING__=!0;const r=V?e.length:e.length*W.length;window.__WA_BROADCAST_LOOP_PROGRESS__={sent:0,failed:0,currentIndex:0,total:r};const o=hr.current,i=br.current,s=[];for(const e of W){const t={...e};if(e.attachments&&e.attachments.length>0){const n=[];for(const t of e.attachments)if(!t.base64Url&&t.file&&"local"===t.type)try{const e=await Mn.TemplatesStorage.getMedia(t.file);e&&e.base64?n.push({...t,base64Url:e.base64,file:e.base64}):n.push(t)}catch(e){n.push(t)}else n.push(t);t.attachments=n}s.push(t)}const l=e.map(e=>({contact:e.phone,name:e.name||e.phone,status:"pending"}));fn(l),yn(!0);const c={id:t,contactsWithData:e,messages:s,sendRandomMessage:V,minDelay:o,maxDelay:i,pauseEnabled:te,pauseAfterContacts:ae,pauseTimeSeconds:oe,enableLinkPreview:Z,groupActions:se,addToGroupsEnabled:Ee,removeFromGroupsEnabled:Ce,groupsForAddAction:Ae,groupsForRemoveAction:_e,customTabActions:ce,addToTabsEnabled:Ue,removeFromTabsEnabled:ze,tabsForAddAction:We,tabsForRemoveAction:He,labelsActions:me,addToLabelsEnabled:Je,removeFromLabelsEnabled:Ze,labelsForAddAction:tt,labelsForRemoveAction:at,kanbanBoardActions:ue,addToKanbanEnabled:mt,removeFromKanbanEnabled:ut,kanbanForAddAction:ht,kanbanForRemoveAction:ft,skipBulkMessage:he,appendSignatureEnabled:ye,userSignature:we,currentIndex:0,sent:0,failed:0,total:r,queueItems:l,results:[],startedAt:a,lastUpdatedAt:a,status:"running",isPaused:!1};await xa.saveActiveCampaign(c);try{const e=await n().runtime.sendMessage({type:"START_BROADCAST_LOOP",campaign:c});if(!e||!e.success)return alert("Falha ao iniciar o envio em massa: " + (e ? e.error || "Erro desconhecido" : "Sem resposta do serviço de fundo") + ". Por favor, tente novamente."),void sn(!1)}catch(e){return alert("Falha ao iniciar o envio em massa: " + e.message + ". Por favor, tente novamente."),void sn(!1)}const d=setInterval(async()=>{try{const e=await xa.getActiveCampaign();if(!e){clearInterval(d),window.__WA_BROADCAST_LOOP_RUNNING__=!1,window.__WA_BROADCAST_LOOP_PROGRESS__=null,sn(!1);const e=await Na();return void En(e||[])}if(mn({sent:e.sent,failed:e.failed,total:e.total}),fn(e.queueItems||[]),window.__WA_BROADCAST_LOOP_PROGRESS__={sent:e.sent,failed:e.failed,currentIndex:e.currentIndex,total:e.total},"completed"===e.status||e.currentIndex>=e.total){clearInterval(d),window.__WA_BROADCAST_LOOP_RUNNING__=!1,window.__WA_BROADCAST_LOOP_PROGRESS__=null,sn(!1),_n(!1),In(null);const e=await Na();En(e||[]),or("sending"),await xa.clearActiveCampaign()}}catch(e){}},500);window.__WA_BROADCAST_POLL_INTERVAL__=d};(0,a.useEffect)(()=>{"scheduled"===rr&&Vr()},[rr]),(0,a.useEffect)(()=>{const e=(e,t)=>{"local"===t&&e.wa_scheduled_broadcasts&&Vr()};return n().storage.onChanged.addListener(e),()=>{n().storage.onChanged.removeListener(e)}},[]);const Vr=async()=>{try{const e=(await xa.getScheduledBroadcasts()).filter(e=>!(!e.contacts||!Array.isArray(e.contacts))&&!(!e.messages||!Array.isArray(e.messages)));e.sort((e,t)=>(e.scheduledTime||0)-(t.scheduledTime||0)),sr(e)}catch(e){}};if(!e)return null;return a.createElement("div",{className:"broadcast-modal-overlay "+(o?"lion-dark":"")},a.createElement(Fa,{onResume:async()=>{if(!Nn)return;const e=!0===window.__WA_BROADCAST_LOOP_RUNNING__;q(Nn.messages||[{id:"1",attachmentType:"none",content:"",attachments:[],selectedContacts:[],pollData:null,listData:null,selectedProducts:[]}]),G(Nn.sendRandomMessage),$(Nn.minDelay),X(Nn.maxDelay),hr.current=Nn.minDelay,br.current=Nn.maxDelay,ne(Nn.pauseEnabled),re(Nn.pauseAfterContacts),ie(Nn.pauseTimeSeconds),ee(Nn.enableLinkPreview),le(Nn.groupActions),Se(Nn.addToGroupsEnabled),Te(Nn.removeFromGroupsEnabled),De(Nn.groupsForAddAction),Ne(Nn.groupsForRemoveAction),de(Nn.customTabActions||!1),Fe(Nn.addToTabsEnabled||!1),Oe(Nn.removeFromTabsEnabled||!1),qe(Nn.tabsForAddAction||[]),je(Nn.tabsForRemoveAction||[]),pe(Nn.labelsActions||!1),Qe(Nn.addToLabelsEnabled||!1),et(Nn.removeFromLabelsEnabled||!1),nt(Nn.labelsForAddAction||[]),rt(Nn.labelsForRemoveAction||[]),ge(Nn.kanbanBoardActions||!1),pt(Nn.addToKanbanEnabled||!1),gt(Nn.removeFromKanbanEnabled||!1),bt(Nn.kanbanForAddAction||null),vt(Nn.kanbanForRemoveAction||null),xe(Nn.appendSignatureEnabled||!1),ke(Nn.userSignature||""),fn(Nn.queueItems||[]),mn({sent:Nn.sent,failed:Nn.failed,total:Nn.total}),An(Nn.id),Bn(!1),yn(!0),or("sending"),sn(!0);const t=!0===Nn.isPaused||"paused"===Nn.status;if(cn(t),gr.current=t,e)return fr.current&&clearInterval(fr.current),void(fr.current=setInterval(async()=>{if(!window.__WA_BROADCAST_LOOP_RUNNING__){fr.current&&(clearInterval(fr.current),fr.current=null);const e=await xa.getActiveCampaign();return e&&(mn({sent:e.sent,failed:e.failed,total:e.total}),fn(e.queueItems||[])),void sn(!1)}if(window.__WA_BROADCAST_LOOP_PROGRESS__){const e=window.__WA_BROADCAST_LOOP_PROGRESS__;mn({sent:e.sent,failed:e.failed,total:e.total})}const e=await xa.getActiveCampaign();e&&fn(e.queueItems||[])},500));await(async e=>{mn({sent:e.sent,failed:e.failed,total:e.total}),fn(e.queueItems||[]),window.__WA_BROADCAST_LOOP_RUNNING__=!0,window.__WA_BROADCAST_LOOP_PROGRESS__={sent:e.sent,failed:e.failed,currentIndex:e.currentIndex,total:e.total},e.status="running",e.isPaused=!1,await xa.saveActiveCampaign(e);try{const t=await n().runtime.sendMessage({type:"START_BROADCAST_LOOP",campaign:e});if(!t||!t.success)return alert("Falha ao retomar o envio em massa. Por favor, tente novamente."),void sn(!1)}catch(e){return alert("Falha ao retomar o envio em massa. Por favor, tente novamente."),void sn(!1)}const t=setInterval(async()=>{try{const e=await xa.getActiveCampaign();if(!e){clearInterval(t),window.__WA_BROADCAST_LOOP_RUNNING__=!1,window.__WA_BROADCAST_LOOP_PROGRESS__=null,sn(!1);const e=await Na();return void En(e||[])}if(mn({sent:e.sent,failed:e.failed,total:e.total}),fn(e.queueItems||[]),window.__WA_BROADCAST_LOOP_PROGRESS__={sent:e.sent,failed:e.failed,currentIndex:e.currentIndex,total:e.total},"completed"===e.status||e.currentIndex>=e.total){clearInterval(t),window.__WA_BROADCAST_LOOP_RUNNING__=!1,window.__WA_BROADCAST_LOOP_PROGRESS__=null,sn(!1),_n(!1),In(null);const n=await Na();En(n||[]),alert(`Broadcast complete!\nSent: ${e.sent}\nFailed: ${e.failed}`),await xa.clearActiveCampaign()}}catch(e){}},500);window.__WA_BROADCAST_POLL_INTERVAL__=t})(Nn)},onCancel:async()=>{if(!Nn)return;try{await n().runtime.sendMessage({type:"STOP_BROADCAST"})}catch(e){}await xa.addToHistory({id:Nn.id,name:`Broadcast ${new Date(Nn.startedAt).toLocaleDateString()}`,contacts:Nn.total,messages:Nn.messages?.length||0,sentCount:Nn.sent,failedCount:Nn.failed,startedAt:Nn.startedAt,completedAt:Date.now(),status:"cancelled",results:Nn.results}),await xa.clearActiveCampaign(),_n(!1),In(null),Bn(!1);const e=await Na();En(e||[])}}),a.createElement("div",{className:"broadcast-modal"},a.createElement(Ua,{onClose:t,onLoadReportsData:Dr}),a.createElement("div",{className:"broadcast-main"},a.createElement("div",{className:"broadcast-header"},a.createElement("div",{className:"broadcast-header-content"},a.createElement("h1",{className:"broadcast-title"},"campaign"===rr?(0,s.t)("broadcast.createCampaign"):"scheduled"===rr?(0,s.t)("broadcast.scheduledCampaigns"):(0,s.t)("broadcast.campaignReports")),a.createElement("p",{className:"broadcast-subtitle"},"campaign"===rr?(0,s.t)("broadcast.createCampaignSubtitle"):(0,s.t)("broadcast.viewManageCampaigns"))),a.createElement("button",{className:"broadcast-header-close-btn",onClick:t,title:(0,s.t)("broadcast.close")},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})))),"reports"===rr?a.createElement("div",{className:"reports-inline-container",style:{flex:1,overflow:"auto",padding:"24px 28px",background:"var(--lion-bg-secondary)",display:"flex",flexDirection:"column",minHeight:0,gap:"16px"}},0===kn.length?a.createElement("div",{style:{padding:"60px 20px",textAlign:"center",background:"var(--lion-bg-primary)",border:"2px dashed var(--lion-border-light)",borderRadius:"14px"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"48",height:"48",style:{margin:"0 auto 12px",display:"block",opacity:.3}},a.createElement("path",{fill:"currentColor",d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z"})),a.createElement("p",{style:{margin:"0 0 4px",color:"var(--lion-text-primary)",fontWeight:700,fontSize:"15px"}},"Nenhum histórico de envio ainda"),a.createElement("span",{style:{color:"var(--lion-text-muted)",fontSize:"13px"}},"Seus envios concluídos aparecerão aqui")):a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},kn.map(e=>a.createElement("div",{key:e.id,style:{background:"var(--lion-bg-primary)",border:"1px solid var(--lion-border-light)",borderRadius:"12px",padding:"16px 20px",display:"flex",alignItems:"center",gap:"16px",transition:"all 0.15s",cursor:"default"}},a.createElement("div",{style:{width:"10px",height:"10px",borderRadius:"50%",flexShrink:0,background:"completed"===e.status?"#10b981":"failed"===e.status?"#ef4444":"var(--lion-primary)"}}),a.createElement("div",{style:{minWidth:"100px"}},a.createElement("div",{style:{fontSize:"13px",fontWeight:600,color:"var(--lion-text-primary)"}},new Date(e.startedAt).toLocaleDateString()),a.createElement("div",{style:{fontSize:"11px",color:"var(--lion-text-muted)"}},new Date(e.startedAt).toLocaleTimeString())),a.createElement("div",{style:{flex:1,display:"flex",gap:"20px",alignItems:"center"}},a.createElement("div",{style:{textAlign:"center"}},a.createElement("div",{style:{fontSize:"16px",fontWeight:700,color:"var(--lion-text-primary)"}},e.contacts),a.createElement("div",{style:{fontSize:"10px",color:"var(--lion-text-muted)",textTransform:"uppercase",letterSpacing:"0.5px"}},"Contacts")),a.createElement("div",{style:{textAlign:"center"}},a.createElement("div",{style:{fontSize:"16px",fontWeight:700,color:"#10b981"}},e.sentCount),a.createElement("div",{style:{fontSize:"10px",color:"var(--lion-text-muted)",textTransform:"uppercase",letterSpacing:"0.5px"}},"Sent")),a.createElement("div",{style:{textAlign:"center"}},a.createElement("div",{style:{fontSize:"16px",fontWeight:700,color:e.failedCount>0?"#ef4444":"var(--lion-text-muted)"}},e.failedCount),a.createElement("div",{style:{fontSize:"10px",color:"var(--lion-text-muted)",textTransform:"uppercase",letterSpacing:"0.5px"}},"Failed"))),a.createElement("span",{style:{padding:"4px 12px",borderRadius:"8px",fontSize:"11px",fontWeight:700,background:"completed"===e.status?"rgba(16,185,129,0.1)":"failed"===e.status?"rgba(239,68,68,0.1)":"rgba(var(--lion-primary-rgb),0.1)",color:"completed"===e.status?"#10b981":"failed"===e.status?"#ef4444":"var(--lion-primary)"}},"completed"===e.status?"Completed":"failed"===e.status?"Failed":"running"===e.status?"Running":"Cancelled"),a.createElement("button",{onClick:()=>(e=>{if(!e||!e.results||0===e.results.length)return void alert("Nenhum dado disponível para este relatório.");let t=["Telefone","Nome","Status","Erro","Data/Hora"].join(",")+"\n";e.results.forEach(e=>{const n=[e.contact||e.phone||"",e.name||"",e.success?"Enviado":"Falhou",e.error||"",e.timestamp?new Date(e.timestamp).toLocaleString():""].map(e=>{const t=String(e);return t.includes(",")||t.includes('"')||t.includes("\n")?`"${t.replace(/"/g,'""')}"`:t});t+=n.join(",")+"\n"}),t+="\n",t+="Summary\n",t+=`Total Contacts,${e.contacts}\n`,t+=`Sent,${e.sentCount}\n`,t+=`Failed,${e.failedCount}\n`,t+=`Status,${e.status}\n`,t+=`Date,${new Date(e.startedAt).toLocaleString()}\n`;const n=new Date(e.startedAt).toISOString().split("T")[0],a=new Date(e.startedAt).toLocaleTimeString().replace(/:/g,"-"),r=new Blob(["\ufeff"+t],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(r),i=document.createElement("a");i.setAttribute("href",o),i.setAttribute("download",`campaign_report_${n}_${a}.csv`),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)})(e),title:"Baixar relatório",style:{background:"var(--lion-bg-tertiary)",border:"1px solid var(--lion-border-light)",borderRadius:"8px",padding:"6px 8px",cursor:"pointer",display:"flex",alignItems:"center",color:"var(--lion-text-muted)"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor"},a.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})))))),kn.length>0&&a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:"8px"}},a.createElement("span",{style:{color:"var(--lion-text-muted)",fontSize:"12px"}},kn.length," campaign",1!==kn.length?"s":""),a.createElement("button",{onClick:async()=>{confirm("Are you sure you want to clear all broadcast history?")&&(await xa.clearHistory(),En([]))},style:{background:"transparent",color:"var(--lion-text-muted)",border:"1px solid var(--lion-border-light)",borderRadius:"8px",padding:"6px 14px",fontSize:"12px",fontWeight:600,cursor:"pointer"}},"Clear History"))):"scheduled"===rr?a.createElement("div",{className:"scheduled-campaigns-container"},a.createElement("div",{className:"scheduled-campaigns-header"},a.createElement("h3",null,(0,s.t)("broadcast.allScheduledCampaigns")),a.createElement("button",{className:"refresh-btn",onClick:Vr},a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})))),0===ir.length?a.createElement("div",{className:"scheduled-empty-state"},a.createElement("svg",{viewBox:"0 0 24 24",width:"64",height:"64"},a.createElement("path",{fill:"var(--lion-text-muted)",d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"})),a.createElement("p",null,(0,s.t)("broadcast.noScheduledCampaigns")),a.createElement("span",null,(0,s.t)("broadcast.scheduleFirstCampaign")),a.createElement("button",{className:"create-campaign-btn",onClick:()=>or("campaign")},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),(0,s.t)("broadcast.createNewCampaign"))):a.createElement("div",{className:"scheduled-campaigns-list"},ir.map(e=>a.createElement("div",{key:e.id,className:`scheduled-campaign-item ${"paused"===e.status?"paused":""} ${e.skipNextOccurrence?"skipping":""}`},a.createElement("div",{className:"campaign-info"},a.createElement("div",{className:"campaign-name"},(e=>{if(e.name)return e.name;const t=e.messages?.[0]?.content;return t?t.length>40?t.substring(0,40)+"...":t:`Campaign #${e.id.substring(0,8)}`})(e)),a.createElement("div",{className:"campaign-meta"},a.createElement("span",{className:"schedule-badge"},(e=>{if(!e.isRecurring)return(0,s.t)("broadcast.oneTime");switch(e.recurringInterval){case"daily":return(0,s.t)("broadcast.daily");case"weekly":return(0,s.t)("broadcast.weekly");case"monthly":return(0,s.t)("broadcast.monthly");case"yearly":return(0,s.t)("broadcast.yearly");default:return(0,s.t)("broadcast.oneTime")}})(e)),a.createElement("span",{className:`status-badge ${e.status}`},"paused"===e.status?(0,s.t)("broadcast.paused"):(0,s.t)("broadcast.scheduled")),e.skipNextOccurrence&&a.createElement("span",{className:"skip-badge"},(0,s.t)("broadcast.skippingNext")),a.createElement("span",{className:"contact-count"},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})),e.contacts?.length||0," ",(0,s.t)("broadcast.contacts"))),a.createElement("div",{className:"campaign-schedule-info"},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"})),a.createElement("span",null,(0,s.t)("broadcast.nextRun"),": ",e.scheduledTime?new Date(e.scheduledTime).toLocaleString():"-")),e.isRecurring&&e.lastRunAt&&a.createElement("div",{className:"campaign-history"},a.createElement("span",{className:"last-run"},(0,s.t)("broadcast.lastRun"),": ",(e=>{const t=e-Date.now(),n=Math.abs(t),a=t<0;if(n<6e4)return a?(0,s.t)("broadcast.justNow"):(0,s.t)("broadcast.inAMoment");if(n<36e5){const e=Math.round(n/6e4);return a?`${e}m ${(0,s.t)("broadcast.ago")}`:`${(0,s.t)("broadcast.in")} ${e}m`}if(n<864e5){const e=Math.round(n/36e5);return a?`${e}h ${(0,s.t)("broadcast.ago")}`:`${(0,s.t)("broadcast.in")} ${e}h`}const r=Math.round(n/864e5);return a?`${r}d ${(0,s.t)("broadcast.ago")}`:`${(0,s.t)("broadcast.in")} ${r}d`})(e.lastRunAt)),e.totalRuns&&a.createElement("span",{className:"total-runs"},"• ",e.totalRuns," ",(0,s.t)("broadcast.runs")," • ",e.successRate||0,"% ",(0,s.t)("broadcast.successRate")))),a.createElement("div",{className:"campaign-actions"},a.createElement("button",{className:"campaign-action-btn edit",onClick:()=>(e=>{if(e.contacts&&Array.isArray(e.contacts)&&e.messages&&Array.isArray(e.messages)){if(p(e.contacts.join("\n")),q(e.messages),$(e.minDelay),X(e.maxDelay),hr.current=e.minDelay,br.current=e.maxDelay,Q(e.allowDuplicates),ee(e.enableLinkPreview),e.scheduledTime){const t=new Date(e.scheduledTime);Lt(t.toISOString().split("T")[0]),Ft(t.toTimeString().slice(0,5)),Bt(!0)}if(qt(e.isRecurring||!1),e.recurringInterval&&jt(e.recurringInterval),e.recurringDays&&Array.isArray(e.recurringDays)&&Gt(e.recurringDays),e.recurringMonths&&Array.isArray(e.recurringMonths)&&Xt(e.recurringMonths),e.recurringEndDate){const t=new Date(e.recurringEndDate);en(t.toISOString().split("T")[0]),Qt("date")}else Qt("never");cr(e),or("campaign")}})(e),title:(0,s.t)("broadcast.editCampaign")},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}))),a.createElement("button",{className:"campaign-action-btn run",onClick:()=>(async e=>{try{const n={...e,scheduledTime:Date.now(),status:"running",lastRunAt:Date.now(),originalScheduledTime:e.originalScheduledTime||e.scheduledTime};await xa.saveScheduledBroadcast(n),await Vr(),window.postMessage({type:"WA_EXECUTE_SCHEDULED_BROADCAST",broadcast:n},"*"),t()}catch(e){alert((0,s.t)("broadcast.errorStartingCampaign")||"Failed to start campaign")}})(e),title:(0,s.t)("broadcast.runNow")},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M8 5v14l11-7z"}))),a.createElement("button",{className:"campaign-action-btn pause",onClick:()=>(async e=>{try{const t="paused"===e.status?"scheduled":"paused";e.status=t,await xa.saveScheduledBroadcast(e),await Vr()}catch(e){}})(e),title:"paused"===e.status?(0,s.t)("broadcast.resumeCampaign"):(0,s.t)("broadcast.pauseCampaign")},"paused"===e.status?a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M8 5v14l11-7z"})):a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}))),e.isRecurring&&a.createElement("button",{className:"campaign-action-btn skip "+(e.skipNextOccurrence?"skipped":""),onClick:()=>e.skipNextOccurrence?(async e=>{try{e.skipNextOccurrence=!1,await xa.saveScheduledBroadcast(e),await Vr()}catch(e){}})(e):(async e=>{try{e.skipNextOccurrence=!0,await xa.saveScheduledBroadcast(e),await Vr()}catch(e){}})(e),title:e.skipNextOccurrence?(0,s.t)("broadcast.unskipNext"):(0,s.t)("broadcast.skipNext")},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z"}))),a.createElement("button",{className:"campaign-action-btn delete",onClick:()=>(async e=>{if(confirm((0,s.t)("broadcast.confirmDeleteScheduled")))try{await xa.removeScheduledBroadcast(e),await Vr()}catch(e){}})(e.id),title:(0,s.t)("broadcast.deleteCampaign")},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})))))))):"sending"===rr?a.createElement("div",{style:{flex:1,overflow:"auto",padding:"24px 28px",background:"var(--lion-bg-secondary)",display:"flex",flexDirection:"column",gap:"10px",minHeight:0}},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"}},a.createElement("div",{style:{display:"flex",gap:"20px",alignItems:"center"}},a.createElement("div",{style:{textAlign:"center"}},a.createElement("div",{style:{fontSize:"20px",fontWeight:700,color:"var(--lion-text-primary)"}},bn.length),a.createElement("div",{style:{fontSize:"10px",color:"var(--lion-text-muted)",textTransform:"uppercase",letterSpacing:"0.5px"}},"Total")),a.createElement("div",{style:{textAlign:"center"}},a.createElement("div",{style:{fontSize:"20px",fontWeight:700,color:"#10b981"}},bn.filter(e=>"sent"===e.status).length),a.createElement("div",{style:{fontSize:"10px",color:"var(--lion-text-muted)",textTransform:"uppercase",letterSpacing:"0.5px"}},"Sent")),a.createElement("div",{style:{textAlign:"center"}},a.createElement("div",{style:{fontSize:"20px",fontWeight:700,color:bn.filter(e=>"failed"===e.status).length>0?"#ef4444":"var(--lion-text-muted)"}},bn.filter(e=>"failed"===e.status).length),a.createElement("div",{style:{fontSize:"10px",color:"var(--lion-text-muted)",textTransform:"uppercase",letterSpacing:"0.5px"}},"Failed")),a.createElement("div",{style:{textAlign:"center"}},a.createElement("div",{style:{fontSize:"20px",fontWeight:700,color:"var(--lion-primary)"}},bn.filter(e=>"pending"===e.status||"sending"===e.status).length),a.createElement("div",{style:{fontSize:"10px",color:"var(--lion-text-muted)",textTransform:"uppercase",letterSpacing:"0.5px"}},"Pending"))),on&&a.createElement("div",{style:{display:"flex",gap:"8px"}},a.createElement("button",{onClick:async()=>{const e=!ln;cn(e),gr.current=e,await xa.updateCampaignPauseState(e);await xa.getActiveCampaign();try{const t=e?"PAUSE_BROADCAST":"RESUME_BROADCAST";await n().runtime.sendMessage({type:t})}catch(e){}},style:{background:ln?"linear-gradient(135deg, #10b981, #059669)":"var(--lion-primary)",color:"#fff",border:"none",borderRadius:"10px",padding:"8px 18px",fontSize:"13px",fontWeight:600,cursor:"pointer"}},ln?(0,s.t)("broadcast.resume"):(0,s.t)("broadcast.pause")),a.createElement("button",{onClick:async()=>{try{await n().runtime.sendMessage({type:"STOP_BROADCAST"});const e=await xa.getActiveCampaign();e&&(await xa.addToHistory({id:e.id,name:`Broadcast ${new Date(e.startedAt||Date.now()).toLocaleDateString()}`,contacts:e.total,messages:e.messages?.length||0,sentCount:e.sent,failedCount:e.failed,startedAt:e.startedAt||Date.now(),completedAt:Date.now(),status:"stopped",results:e.results||[]}),await xa.clearActiveCampaign()),sn(!1),cn(!1),mn({sent:0,failed:0,total:0}),fn([]),fr.current&&(clearInterval(fr.current),fr.current=null);const t=await Na();En(t||[])}catch(e){}},style:{background:"transparent",color:"#ef4444",border:"1px solid rgba(239,68,68,0.3)",borderRadius:"10px",padding:"8px 18px",fontSize:"13px",fontWeight:600,cursor:"pointer"}},"Stop"))),bn.length>0&&a.createElement("div",{style:{marginBottom:"6px"}},a.createElement("div",{style:{height:"4px",background:"var(--lion-bg-tertiary)",borderRadius:"2px",overflow:"hidden"}},a.createElement("div",{style:{height:"100%",borderRadius:"2px",transition:"width 0.3s",background:"var(--lion-primary)",width:bn.filter(e=>"sent"===e.status||"failed"===e.status).length/bn.length*100+"%"}})),a.createElement("div",{style:{textAlign:"center",fontSize:"11px",color:"var(--lion-text-muted)",marginTop:"6px"}},bn.filter(e=>"sent"===e.status||"failed"===e.status).length," / ",bn.length," Completed")),(bn||[]).map((e,t)=>a.createElement("div",{key:e.contact,style:{background:"var(--lion-bg-primary)",border:"1px solid var(--lion-border-light)",borderRadius:"12px",padding:"14px 20px",display:"flex",alignItems:"center",gap:"14px"}},a.createElement("div",{style:{width:"10px",height:"10px",borderRadius:"50%",flexShrink:0,background:"sent"===e.status?"#10b981":"failed"===e.status?"#ef4444":"sending"===e.status?"var(--lion-primary)":"var(--lion-border-medium)",boxShadow:"sending"===e.status?"0 0 8px rgba(var(--lion-primary-rgb), 0.5)":"none",animation:"sending"===e.status?"pulse 1.5s infinite":"none"}}),a.createElement("div",{style:{width:"28px",height:"28px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--lion-bg-tertiary)",fontSize:"11px",fontWeight:700,color:"var(--lion-text-muted)"}},t+1),a.createElement("div",{style:{flex:1}},a.createElement("div",{style:{fontSize:"14px",fontWeight:600,color:"var(--lion-text-primary)"}},e.name||e.contact),a.createElement("div",{style:{fontSize:"12px",color:"var(--lion-text-muted)"}},e.contact)),e.timestamp&&a.createElement("span",{style:{fontSize:"11px",color:"var(--lion-text-light)",minWidth:"70px",textAlign:"right"}},new Date(e.timestamp).toLocaleTimeString()),a.createElement("span",{style:{padding:"3px 10px",borderRadius:"8px",fontSize:"11px",fontWeight:700,background:"sent"===e.status?"rgba(16,185,129,0.1)":"failed"===e.status?"rgba(239,68,68,0.1)":"sending"===e.status?"rgba(var(--lion-primary-rgb),0.1)":"var(--lion-bg-tertiary)",color:"sent"===e.status?"#10b981":"failed"===e.status?"#ef4444":"sending"===e.status?"var(--lion-primary)":"var(--lion-text-muted)"}},"sent"===e.status?"Sent":"failed"===e.status?"Failed":"sending"===e.status?"Sending...":"Pending"))),0===bn.length&&a.createElement("div",{style:{padding:"60px 20px",textAlign:"center",background:"var(--lion-bg-primary)",border:"2px dashed var(--lion-border-light)",borderRadius:"14px"}},a.createElement("p",{style:{margin:"0 0 4px",color:"var(--lion-text-primary)",fontWeight:700,fontSize:"15px"}},"No active campaign"),a.createElement("span",{style:{color:"var(--lion-text-muted)",fontSize:"13px"}},"Start a new campaign to see sending progress here"))):a.createElement(a.Fragment,null,a.createElement("div",{className:"campaign-step-indicator"},kr.map((e,t)=>{const n=t+1,r=n===xr,o=n<xr;return a.createElement(a.Fragment,{key:n},t>0&&a.createElement("div",{className:"campaign-step-line "+(o?"completed":"")}),a.createElement("div",{className:`campaign-step ${r?"active":""} ${o?"completed":""}`,onClick:()=>{wr(n)},style:{cursor:"pointer"}},a.createElement("div",{className:"campaign-step-circle"},o?a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3"},a.createElement("polyline",{points:"20 6 9 17 4 12"})):n),a.createElement("span",{className:"campaign-step-label"},e)))})),a.createElement("div",{className:"broadcast-content broadcast-wizard-content"},1===xr&&a.createElement("div",{className:"broadcast-left-panel"},a.createElement("div",{className:"broadcast-card"},a.createElement("div",{className:"broadcast-card-header"},a.createElement("h3",null,(0,s.t)("broadcast.recipients")),a.createElement("span",{className:"broadcast-badge"},m.split("\n").filter(e=>e.trim()).length||h.length," ",(0,s.t)("broadcast.selected"))),a.createElement("div",{className:"broadcast-mode-selection"},a.createElement("button",{className:"broadcast-mode-btn "+("oneToOne"===i?"active":""),onClick:()=>l("oneToOne")},a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})),a.createElement("span",null,(0,s.t)("broadcast.contacts"))),a.createElement("button",{className:"broadcast-mode-btn "+("groups"===i?"active":""),onClick:()=>l("groups")},a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"})),a.createElement("span",null,(0,s.t)("broadcast.groups")))),"oneToOne"===i&&a.createElement(a.Fragment,null,ma.length>0?a.createElement("div",{className:"uploaded-contacts-section"},a.createElement("div",{className:"uploaded-contacts-header"},a.createElement("span",{className:"uploaded-count"},ma.length," ",(0,s.t)("broadcast.contactsUploaded")),a.createElement("button",{className:"clear-contacts-btn",onClick:()=>{pa([]),ga([]),sa([]),p(""),S([])}},(0,s.t)("broadcast.clearAll"))),a.createElement("div",{className:"uploaded-contacts-table-wrapper"},a.createElement("table",{className:"uploaded-contacts-table"},a.createElement("thead",null,a.createElement("tr",null,a.createElement("th",null,(0,s.t)("broadcast.phone")),(ua||[]).map((e,t)=>a.createElement("th",{key:t},e)),a.createElement("th",null))),a.createElement("tbody",null,(ma||[]).map((e,t)=>a.createElement("tr",{key:t},a.createElement("td",null,e.phone),(ua||[]).map((t,n)=>a.createElement("td",{key:n},e[t]||"")),a.createElement("td",null,a.createElement("button",{className:"remove-contact-btn",onClick:()=>{return e=t,void pa(t=>{const n=t.filter((t,n)=>n!==e);return p(n.map(e=>e.phone).join("\n")),n});var e},title:(0,s.t)("broadcast.remove")},"×"))))))),a.createElement("div",{className:"variable-hint-box"},a.createElement("span",null,"📝 Available variables: "),a.createElement("code",null,"{{phone}}"),(ua||[]).map((e,t)=>a.createElement("code",{key:t},`{{${e}}}`)))):a.createElement("textarea",{className:"broadcast-phone-input",placeholder:(0,s.t)("broadcast.phonePlaceholder")||"Phone numbers with country code",value:m,onChange:e=>p(e.target.value),rows:6}),a.createElement("div",{className:"broadcast-contact-buttons"},a.createElement("button",{className:"broadcast-btn broadcast-btn-upload",onClick:()=>{zn(!0),Hn(1),Vn([]),Kn(""),Yn([]),Zn(0),ta([]),aa([]),oa(new Set)}},(0,s.t)("broadcast.upload")||"Upload"),a.createElement("div",{className:"select-dropdown-wrapper"},a.createElement("button",{className:"broadcast-btn broadcast-btn-select",onClick:()=>ba(!ha)},(0,s.t)("broadcast.select")||"Select"," ",a.createElement("span",{className:"dropdown-arrow"},"▼")),ha&&a.createElement("div",{className:"select-dropdown-menu"},a.createElement("div",{className:"select-dropdown-item",onClick:async()=>{ba(!1),rn(!0);try{const e=await new Promise(e=>{const t=setTimeout(()=>{document.removeEventListener("waContactsResponse",n),e([])},15e3),n=a=>{const r=a;clearTimeout(t),document.removeEventListener("waContactsResponse",n),r.detail?.success?e(r.detail?.contacts||[]):e([])};document.addEventListener("waContactsResponse",n),document.dispatchEvent(new CustomEvent("getWAContacts"))});Ja(e),va(!0)}catch(e){}finally{rn(!1)}}},a.createElement("span",{className:"dropdown-item-icon"},"👤"),a.createElement("span",null,(0,s.t)("broadcast.contacts"))),a.createElement("div",{className:"select-dropdown-item",onClick:Br},a.createElement("span",{className:"dropdown-item-icon"},"👥"),a.createElement("span",null,(0,s.t)("broadcast.groupsContacts"))),a.createElement("div",{className:"select-dropdown-item",onClick:async()=>{ba(!1),rn(!0);try{const e=await Aa();I(e),Va(!0)}catch(e){}finally{rn(!1)}}},a.createElement("span",{className:"dropdown-item-icon"},"📑"),a.createElement("span",null,(0,s.t)("broadcast.tabsContacts"))),a.createElement("div",{className:"select-dropdown-item",onClick:async()=>{ba(!1),rn(!0);try{const e=await Da();O(e);const t=(e.crms||[]).filter(e=>"user"===e.type);L(t),F(null),B([]),k([]),Ka(!0)}catch(e){}finally{rn(!1)}}},a.createElement("span",{className:"dropdown-item-icon"},"📋"),a.createElement("span",null,(0,s.t)("broadcast.kanbanBoard"))),a.createElement("div",{className:"select-dropdown-item",onClick:async()=>{ba(!1),rn(!0);try{const e=await Ta();N(e),Ya(!0)}catch(e){}finally{rn(!1)}}},a.createElement("span",{className:"dropdown-item-icon"},"🏷️"),a.createElement("span",null,(0,s.t)("broadcast.labelsContacts"))))),a.createElement("button",{className:"broadcast-btn broadcast-btn-download",onClick:async()=>{const e=await qr();if(0===e.length)return void alert("Nenhum contato para baixar. Por favor, adicione contatos primeiro.");const t=new Set(["phone","name"]);e.forEach(e=>{Object.keys(e).forEach(e=>t.add(e))});const n=Array.from(t);let a=n.join(",")+"\n";e.forEach(e=>{const t=n.map(t=>{const n=e[t]||"";return n.includes(",")||n.includes('"')||n.includes("\n")?`"${n.replace(/"/g,'""')}"`:n});a+=t.join(",")+"\n"});const r=new Blob(["\ufeff"+a],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(r),i=document.createElement("a");i.setAttribute("href",o),i.setAttribute("download",`contacts_${(new Date).toISOString().split("T")[0]}.csv`),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)},title:(0,s.t)("broadcast.download")},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})),(0,s.t)("broadcast.download")))),"groups"===i&&a.createElement("div",{className:"broadcast-groups-section"},a.createElement("div",{className:"selected-groups-list"},0===h.length?a.createElement("div",{className:"no-groups-message"},(0,s.t)("broadcast.noGroupsSelected")):(h||[]).map((e,t)=>a.createElement("div",{key:t,className:"selected-group-item"},a.createElement("span",{className:"group-icon"},"👥"),a.createElement("span",{className:"group-name"},e.name),a.createElement("button",{className:"remove-group-btn",onClick:()=>{return t=e.id,void b(e=>e.filter(e=>e.id!==t));var t},title:(0,s.t)("broadcast.remove")},"×")))),a.createElement("div",{className:"broadcast-contact-buttons"},a.createElement("button",{className:"broadcast-btn broadcast-btn-select",onClick:Br},(0,s.t)("broadcast.addGroups"))),h.length>0&&a.createElement("div",{className:"groups-count-info"},h.length," ",(0,s.t)("broadcast.groupsSelected"))))),2===xr&&a.createElement("div",{className:"broadcast-right-panel"},a.createElement("label",{className:"broadcast-checkbox"},a.createElement("input",{type:"checkbox",checked:V,onChange:e=>{G(e.target.checked)}}),a.createElement("span",null,(0,s.t)("broadcast.sendRandomMessage"))),a.createElement("button",{className:"broadcast-btn broadcast-btn-add",onClick:()=>{const e={id:Date.now().toString(),attachmentType:"none",content:"",attachments:[],selectedContacts:[],pollData:null,listData:null,selectedProducts:[]};q([...W,e]),j(W.length)}},(0,s.t)("broadcast.addMessage")),a.createElement("label",{className:"broadcast-toggle"},a.createElement("input",{type:"checkbox",checked:te,onChange:e=>ne(e.target.checked)}),a.createElement("span",{className:"toggle-slider"}),a.createElement("span",null,(0,s.t)("broadcast.pauseSetting"))),te&&a.createElement("div",{className:"pause-settings-config"},a.createElement("div",{className:"pause-setting-row"},a.createElement("span",{className:"pause-setting-label"},(0,s.t)("broadcast.pauseAfterXSends")),a.createElement("input",{type:"number",className:"pause-setting-input",value:ae,onChange:e=>{const t=e.target.value;re(t===""?"":Math.max(1,parseInt(t)))},onBlur:e=>{const t=parseInt(e.target.value);re(Math.max(1,isNaN(t)?5:t))},min:"1"}),a.createElement("span",{className:"pause-setting-unit"},(0,s.t)("broadcast.contacts"))),a.createElement("div",{className:"pause-setting-row"},a.createElement("span",{className:"pause-setting-label"},(0,s.t)("broadcast.pauseTimeInSeconds")),a.createElement("input",{type:"number",className:"pause-setting-input",value:oe,onChange:e=>{const t=e.target.value;ie(t===""?"":Math.max(1,parseInt(t)))},onBlur:e=>{const t=parseInt(e.target.value);ie(Math.max(1,isNaN(t)?300:t))},min:"1"}),a.createElement("span",{className:"pause-setting-unit"},(0,s.t)("broadcast.second")))),a.createElement("div",{className:"broadcast-messages-container"},(W||[]).map((e,t)=>a.createElement("div",{key:e.id,className:`broadcast-message-box ${H===t?"active":""} ${1===W.length?"single-mode":""}`},W.length>1&&a.createElement("div",{className:"message-box-header",onClick:()=>j(t)},a.createElement("span",{className:"message-box-toggle"},H===t?"▼":"▶"," ",(0,s.t)("broadcast.message")," (",t+1,")"),a.createElement("div",{className:"message-box-actions"},t>0&&a.createElement("button",{className:"message-action-btn",onClick:e=>{e.stopPropagation(),Ur(t,"up")},title:(0,s.t)("broadcast.moveUp")},"↑"),t<W.length-1&&a.createElement("button",{className:"message-action-btn",onClick:e=>{e.stopPropagation(),Ur(t,"down")},title:(0,s.t)("broadcast.moveDown")},"↓"),a.createElement("button",{className:"message-action-btn message-delete-btn",onClick:e=>{e.stopPropagation(),(e=>{if(1===W.length)return;const t=W.filter((t,n)=>n!==e);q(t),H>=t.length&&j(t.length-1)})(t)},title:(0,s.t)("broadcast.deleteMessage")},"🗑"))),a.createElement("div",{className:"message-box-content"},a.createElement("div",{className:"broadcast-template-type"},a.createElement("label",null,(0,s.t)("templates.form.templateType")||"Templates Type"),a.createElement("select",{value:e.attachmentType,onChange:e=>{j(t),(e=>{const t=[...W];t[H]={...t[H],attachmentType:e,attachments:"image/video"===e||"document"===e||"audio"===e?t[H].attachments:[],selectedContacts:"contact"===e?t[H].selectedContacts:[],pollData:"poll"===e?t[H].pollData:null,listData:"list"===e?t[H].listData:null,selectedProducts:"product"===e?t[H].selectedProducts:[]},q(t)})(e.target.value)}},a.createElement("option",{value:"none"},(0,s.t)("templates.attachmentType.none")||"Message Only"),a.createElement("option",{value:"image/video"},(0,s.t)("templates.attachmentType.imageVideo")||"Message + Images/Videos"),a.createElement("option",{value:"document"},(0,s.t)("templates.attachmentType.document")||"Message + Documents"),a.createElement("option",{value:"audio"},(0,s.t)("templates.attachmentType.audio")||"Message + Audio"),a.createElement("option",{value:"contact"},(0,s.t)("templates.attachmentType.contact")||"Message + Contacts"),a.createElement("option",{value:"poll"},(0,s.t)("templates.attachmentType.poll")||"Message + Poll"),a.createElement("option",{value:"list"},(0,s.t)("templates.attachmentType.list")||"Message + List"),a.createElement("option",{value:"product"},(0,s.t)("templates.attachmentType.product")||"Message + Products"))),a.createElement("textarea",{className:"broadcast-message-textarea",placeholder:(0,s.t)("broadcast.enterMessageText"),value:e.content,onChange:e=>{j(t),Fr(e.target.value)},onFocus:()=>j(t),rows:6}),a.createElement("div",{className:"broadcast-message-toolbar"},a.createElement("div",{className:"variable-dropdown-wrapper"},a.createElement("button",{className:"toolbar-btn",onClick:()=>{j(t),da(!la)},title:(0,s.t)("broadcast.variable")},"+ ",(0,s.t)("broadcast.variable")),la&&H===t&&a.createElement("div",{className:"variable-dropdown"},a.createElement("div",{className:"variable-option",onClick:()=>{zr("{{phone}}"),da(!1)}},"{{phone}}"," - ",(0,s.t)("broadcast.phoneNumber")),ua.length>0?ua.map((e,t)=>a.createElement("div",{key:t,className:"variable-option",onClick:()=>{zr(`{{${e}}}`),da(!1)}},`{{${e}}}`," - ",e)):a.createElement("div",{className:"variable-option",onClick:()=>{zr("{{name}}"),da(!1)}},"{{name}}"," - ",(0,s.t)("broadcast.contactName")),0===ua.length&&a.createElement("div",{className:"variable-hint"},(0,s.t)("broadcast.uploadCSVHint")))),a.createElement("button",{className:"toolbar-btn",onClick:()=>{j(t),Or("bold")},title:(0,s.t)("broadcast.tooltipBold")},"B"),a.createElement("button",{className:"toolbar-btn toolbar-btn-italic",onClick:()=>{j(t),Or("italic")},title:(0,s.t)("broadcast.tooltipItalic")},"I"),a.createElement("button",{className:"toolbar-btn",onClick:()=>{j(t),Or("strikethrough")},title:(0,s.t)("broadcast.tooltipStrikethrough")},"S"),a.createElement("button",{className:"toolbar-btn",onClick:()=>{j(t),pr.current?.click()},title:(0,s.t)("broadcast.tooltipAddMedia")},"📎"),a.createElement("button",{className:"toolbar-btn toolbar-btn-templates",onClick:()=>{j(t),un(!pn)}},(0,s.t)("broadcast.selectTemplates")),a.createElement("div",{style:{marginLeft:"auto"}},a.createElement(Qn,{text:e.content,onRegenerate:e=>{j(t),Fr(e)},size:"small",variant:"toolbar",language:Xn()}))),pn&&H===t&&a.createElement("div",{className:"broadcast-template-selector"},0===gn.length?a.createElement("div",{className:"no-templates"},(0,s.t)("broadcast.noTemplates")):gn.map(e=>{const t=e.messages&&e.messages.length>0,n=t?e.messages[0]:null,r=t?n?.message||"":e.message||e.content||"",o=t?n?.attachmentType||"none":e.sendAttachment&&e.sendAttachmentType||"none",i=t?e.messages.length:1;return a.createElement("div",{key:e.id,className:"template-option",onClick:()=>(async e=>{const t=[];if(e.messages&&e.messages.length>0)for(let n=0;n<e.messages.length;n++){const a=e.messages[n],r=await Wr(a.attachments||[]),o={id:`msg-${Date.now()}-${n}`,content:a.message||"",attachmentType:a.attachmentType||"none",attachments:r,selectedContacts:a.selectedContact||[],pollData:a.pollData||null,listData:a.listData||null,selectedProducts:a.selectedProducts||[]};t.push(o)}else{const n=e.attachemnt||[],a=await Wr(n),r={id:`msg-${Date.now()}-0`,content:e.message||e.content||"",attachmentType:e.sendAttachment&&e.sendAttachmentType||"none",attachments:a,selectedContacts:e.selectedContact||[],pollData:e.pollData||null,listData:e.listData||null,selectedProducts:e.selectedProducts||[]};t.push(r)}if(q(t),j(0),un(!1),e.quickReplyData?.postActions){const t=e.quickReplyData.postActions;if(t.groupActionsEnabled){if(le(!0),t.addToGroups&&t.addToGroups.length>0){Se(!0);const e=t.addToGroups.map(e=>{const t=A.find(t=>t.id===e);return t?{id:e,name:t.name||e}:null}).filter(Boolean);De(e)}if(t.removeFromGroups&&t.removeFromGroups.length>0){Te(!0);const e=t.removeFromGroups.map(e=>{const t=A.find(t=>t.id===e);return t?{id:e,name:t.name||e}:null}).filter(Boolean);Ne(e)}}if(t.tabActionsEnabled){if(de(!0),t.addToTabs&&t.addToTabs.length>0){Fe(!0);const e=t.addToTabs.map(e=>{const t=M.find(t=>t.id===e);return t?{id:e,title:t.title||e}:null}).filter(Boolean);qe(e)}if(t.removeFromTabs&&t.removeFromTabs.length>0){Oe(!0);const e=t.removeFromTabs.map(e=>{const t=M.find(t=>t.id===e);return t?{id:e,title:t.title||e}:null}).filter(Boolean);je(e)}}if(t.labelsActionsEnabled){if(pe(!0),t.addLabels&&t.addLabels.length>0){Qe(!0);const e=t.addLabels.map(e=>{const t=_.find(t=>t.id===e);return t?{id:e,name:t.name||e}:null}).filter(Boolean);nt(e)}if(t.removeLabels&&t.removeLabels.length>0){et(!0);const e=t.removeLabels.map(e=>{const t=_.find(t=>t.id===e);return t?{id:e,name:t.name||e}:null}).filter(Boolean);rt(e)}}if(t.kanbanActionsEnabled){if(ge(!0),t.addToKanban){pt(!0);const e=P.find(e=>e.id===t.addToKanban.crmId),n=e?.stages?.find(e=>e.id===t.addToKanban.stageId);e&&n&&bt({crmId:t.addToKanban.crmId,crmName:e.name||t.addToKanban.crmId,stageId:t.addToKanban.stageId,stageName:n.name||t.addToKanban.stageId})}if(t.removeFromKanban){gt(!0);const e=P.find(e=>e.id===t.removeFromKanban.crmId),n=e?.stages?.find(e=>e.id===t.removeFromKanban.stageId);e&&n&&vt({crmId:t.removeFromKanban.crmId,crmName:e.name||t.removeFromKanban.crmId,stageId:t.removeFromKanban.stageId,stageName:n.name||t.removeFromKanban.stageId})}}}})(e)},a.createElement("div",{className:"template-option-header"},a.createElement("span",{className:"template-name"},e.templeteName||e.name,i>1&&a.createElement("span",{style:{marginLeft:"6px",fontSize:"11px",color:ca.primary}},"(",i,")")),a.createElement("span",{className:"template-type-badge"},"image/video"===o?"🖼️":"document"===o?"📄":"audio"===o?"🎵":"contact"===o?"👤":"poll"===o?"📊":"list"===o?"📋":"product"===o?"🛍️":"📝")),a.createElement("span",{className:"template-preview"},r?.substring(0,60),"..."))})),"none"!==e.attachmentType&&a.createElement("div",{className:"broadcast-attachment-section"},("image/video"===e.attachmentType||"document"===e.attachmentType||"audio"===e.attachmentType)&&a.createElement(Ln,{attachments:e.attachments,attachmentType:e.attachmentType,onChange:e=>((e,t)=>{const n=[...W];n[e]={...n[e],attachments:t},q(n)})(t,e)}),"contact"===e.attachmentType&&a.createElement(On,{selectedContacts:e.selectedContacts,onChange:e=>((e,t)=>{const n=[...W];n[e]={...n[e],selectedContacts:t},q(n)})(t,e)}),"poll"===e.attachmentType&&a.createElement(Un,{pollData:e.pollData,onChange:e=>((e,t)=>{const n=[...W];n[e]={...n[e],pollData:t},q(n)})(t,e)}),"list"===e.attachmentType&&a.createElement(Fn,{listData:e.listData,onChange:e=>((e,t)=>{const n=[...W];n[e]={...n[e],listData:t},q(n)})(t,e)}),"product"===e.attachmentType&&a.createElement(Wn,{selectedProducts:e.selectedProducts,onChange:e=>((e,t)=>{const n=[...W];n[e]={...n[e],selectedProducts:t},q(n)})(t,e)})))))),a.createElement("input",{ref:pr,type:"file",accept:"image/*,video/*,.pdf,.doc,.docx",style:{display:"none"},onChange:async e=>{const t=e.target.files?.[0];if(t)try{let e="document";t.type.startsWith("image/")||t.type.startsWith("video/")?e="image/video":t.type.startsWith("audio/")&&(e="audio");const n=new FileReader;n.onload=()=>{const a=n.result,r={name:t.name,caption:"",type:"local",base64Url:a,file:a},o=[...W],i=o[H].attachments||[];o[H]={...o[H],attachmentType:e,attachments:[...i,r]},q(o)},n.readAsDataURL(t)}catch(e){}}})),3===xr&&a.createElement("div",{className:"broadcast-right-panel"},a.createElement("div",{className:"broadcast-delay-config"},a.createElement("label",null,(0,s.t)("broadcast.sendingDelay")),a.createElement("div",{className:"delay-inputs"},a.createElement("div",{className:"delay-input-group"},a.createElement("label",null,(0,s.t)("broadcast.minimumSecond"),":"),a.createElement("input",{type:"number",value:K,onChange:e=>{const t=e.target.value;$(t===""?"":parseInt(t))},onBlur:e=>{const t=parseInt(e.target.value);$(Math.max(1,isNaN(t)?30:t))},min:1,max:600}),a.createElement("span",{className:"delay-unit"},"seg")),a.createElement("div",{className:"delay-input-group"},a.createElement("label",null,(0,s.t)("broadcast.maximumSecond"),":"),a.createElement("input",{type:"number",value:Y,onChange:e=>{const t=e.target.value;X(t===""?"":parseInt(t))},onBlur:e=>{const t=parseInt(e.target.value);X(Math.max(K,isNaN(t)?240:t))},min:1,max:999}),a.createElement("span",{className:"delay-unit"},"seg"))),a.createElement("p",{className:"delay-hint"},(0,s.t)("broadcast.delayHint").replace("{min}",String(K)).replace("{max}",String(Y)))),a.createElement("div",{className:"broadcast-schedule-section"},a.createElement("label",{className:"broadcast-toggle"},a.createElement("input",{type:"checkbox",checked:Rt,onChange:e=>Bt(e.target.checked)}),a.createElement("span",{className:"toggle-slider"}),a.createElement("span",null,(0,s.t)("broadcast.scheduleMessage"))),Rt&&a.createElement("div",{className:"schedule-inputs"},a.createElement("div",{className:"schedule-input-group"},a.createElement("label",null,(0,s.t)("broadcast.date"),":"),a.createElement("input",{type:"date",value:Pt,onChange:e=>Lt(e.target.value),min:(new Date).toISOString().split("T")[0]})),a.createElement("div",{className:"schedule-input-group"},a.createElement("label",null,(0,s.t)("broadcast.time"),":"),a.createElement("input",{type:"time",value:Ut,onChange:e=>Ft(e.target.value)})),a.createElement("label",{className:"auto-send-checkbox"},a.createElement("input",{type:"checkbox",checked:zt,onChange:e=>Ot(e.target.checked)}),a.createElement("span",null,(0,s.t)("broadcast.autoSendIfMissed"))),a.createElement("div",{className:"recurring-section"},a.createElement("div",{className:"recurring-header"},a.createElement("label",{className:"broadcast-toggle recurring-toggle"},a.createElement("input",{type:"checkbox",checked:Wt,onChange:e=>qt(e.target.checked)}),a.createElement("span",{className:"toggle-slider"}),a.createElement("span",null,(0,s.t)("broadcast.recurring")||"Recurring")),a.createElement("div",{className:"recurring-info-wrapper"},a.createElement("span",{className:"recurring-info-icon"},"i"),a.createElement("div",{className:"recurring-info-tooltip"},a.createElement("div",{className:"tooltip-title"},(0,s.t)("broadcast.recurringHowToUse")||"How to use Recurring"),a.createElement("ul",{className:"tooltip-list"},a.createElement("li",null,(0,s.t)("broadcast.recurringTip1")||"Enable recurring to automatically repeat this broadcast"),a.createElement("li",null,(0,s.t)("broadcast.recurringTip2")||"Choose frequency: Daily, Weekly, Monthly, or Yearly"),a.createElement("li",null,(0,s.t)("broadcast.recurringTip3")||"For Weekly: Select specific days (Mon, Tue, etc.)"),a.createElement("li",null,(0,s.t)("broadcast.recurringTip4")||'Set end date or choose "Never" to run indefinitely'),a.createElement("li",null,(0,s.t)("broadcast.recurringTip5")||"After each broadcast, next one is auto-scheduled"))))),Wt&&a.createElement("div",{className:"recurring-options"},a.createElement("div",{className:"recurring-input-group"},a.createElement("label",null,(0,s.t)("broadcast.repeatInterval")||"Repeat",":"),a.createElement("select",{value:Ht,onChange:e=>jt(e.target.value),className:"recurring-select"},a.createElement("option",{value:"daily"},(0,s.t)("broadcast.daily")||"Daily"),a.createElement("option",{value:"weekly"},(0,s.t)("broadcast.weekly")||"Weekly"),a.createElement("option",{value:"monthly"},(0,s.t)("broadcast.monthly")||"Monthly"),a.createElement("option",{value:"yearly"},(0,s.t)("broadcast.yearly")||"Yearly"))),"weekly"===Ht&&a.createElement("div",{className:"recurring-days-group"},a.createElement("label",null,(0,s.t)("broadcast.selectDays")||"Select Days",":"),a.createElement("div",{className:"recurring-days"},[{day:0,label:(0,s.t)("broadcast.sun")||"Sun"},{day:1,label:(0,s.t)("broadcast.mon")||"Mon"},{day:2,label:(0,s.t)("broadcast.tue")||"Tue"},{day:3,label:(0,s.t)("broadcast.wed")||"Wed"},{day:4,label:(0,s.t)("broadcast.thu")||"Thu"},{day:5,label:(0,s.t)("broadcast.fri")||"Fri"},{day:6,label:(0,s.t)("broadcast.sat")||"Sat"}].map(({day:e,label:t})=>a.createElement("button",{key:e,type:"button",className:"day-chip "+((Vt||[]).includes(e)?"selected":""),onClick:()=>{(Vt||[]).includes(e)?Gt((Vt||[]).filter(t=>t!==e)):Gt([...Vt||[],e].sort())}},t)))),"monthly"===Ht&&a.createElement("div",{className:"recurring-days-group"},a.createElement("label",null,(0,s.t)("broadcast.selectDates")||"Select Dates",":"),(()=>{const e=tn.getFullYear(),t=tn.getMonth(),n=new Date(e,t,1).getDay(),r=new Date(e,t+1,0).getDate(),o=new Date(e,t,0).getDate(),i=new Date,l=i.getFullYear()===e&&i.getMonth()===t,c=(e,t,n)=>`${e}-${String(t+1).padStart(2,"0")}-${String(n).padStart(2,"0")}`,d=[],m=0===t?11:t-1,p=0===t?e-1:e;for(let e=n-1;e>=0;e--){const t=o-e;d.push({date:t,isCurrentMonth:!1,isWeekend:!1,dateStr:c(p,m,t)})}for(let a=1;a<=r;a++){const r=(n+a-1)%7;d.push({date:a,isCurrentMonth:!0,isWeekend:0===r||6===r,dateStr:c(e,t,a)})}const u=11===t?0:t+1,g=11===t?e+1:e,h=42-d.length;for(let e=1;e<=h;e++)d.push({date:e,isCurrentMonth:!1,isWeekend:!1,dateStr:c(g,u,e)});return a.createElement("div",{className:"full-calendar-container"},a.createElement("div",{className:"full-calendar-header"},a.createElement("button",{type:"button",className:"calendar-nav-btn",onClick:()=>nn(new Date(e,t-1,1))},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M15 18l-6-6 6-6"}))),a.createElement("span",{className:"calendar-title"},["January","February","March","April","May","June","July","August","September","October","November","December"][t]," ",e),a.createElement("button",{type:"button",className:"calendar-nav-btn",onClick:()=>nn(new Date(e,t+1,1))},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M9 18l6-6-6-6"})))),a.createElement("div",{className:"full-calendar-weekdays"},["SUN","MON","TUE","WED","THU","FRI","SAT"].map((e,t)=>a.createElement("div",{key:e,className:"calendar-weekday "+(0===t||6===t?"weekend":"")},e))),a.createElement("div",{className:"full-calendar-grid"},d.map((e,t)=>{const n=(Kt||[]).includes(e.dateStr),r=l&&e.isCurrentMonth&&e.date===i.getDate();return a.createElement("div",{key:t,className:`full-calendar-date ${n?"selected":""} ${e.isCurrentMonth?"":"other-month"} ${r?"today":""} ${e.isCurrentMonth&&e.isWeekend?"weekend":""}`,onClick:()=>{(Kt||[]).includes(e.dateStr)?$t((Kt||[]).filter(t=>t!==e.dateStr)):$t([...Kt||[],e.dateStr].sort())}},e.date)})),(Kt||[]).length>0&&a.createElement("div",{className:"full-calendar-selected"},a.createElement("span",{className:"selected-count"},(Kt||[]).length," ",(0,s.t)("broadcast.datesSelected")||"dates selected")),a.createElement("div",{className:"full-calendar-info"},(0,s.t)("broadcast.calendarSelectInfo")||"Select specific dates from the calendar. Navigate months using arrows."))})()),"yearly"===Ht&&a.createElement("div",{className:"recurring-days-group"},a.createElement("label",null,(0,s.t)("broadcast.selectDates")||"Select Dates",":"),(()=>{const e=tn.getFullYear(),t=tn.getMonth(),n=new Date(e,t,1).getDay(),r=new Date(e,t+1,0).getDate(),o=new Date(e,t,0).getDate(),i=new Date,l=i.getFullYear()===e&&i.getMonth()===t,c=(e,t,n)=>`${e}-${String(t+1).padStart(2,"0")}-${String(n).padStart(2,"0")}`,d=[],m=0===t?11:t-1,p=0===t?e-1:e;for(let e=n-1;e>=0;e--){const t=o-e;d.push({date:t,isCurrentMonth:!1,isWeekend:!1,dateStr:c(p,m,t)})}for(let a=1;a<=r;a++){const r=(n+a-1)%7;d.push({date:a,isCurrentMonth:!0,isWeekend:0===r||6===r,dateStr:c(e,t,a)})}const u=11===t?0:t+1,g=11===t?e+1:e,h=42-d.length;for(let e=1;e<=h;e++)d.push({date:e,isCurrentMonth:!1,isWeekend:!1,dateStr:c(g,u,e)});return a.createElement("div",{className:"full-calendar-container"},a.createElement("div",{className:"full-calendar-header"},a.createElement("button",{type:"button",className:"calendar-nav-btn",onClick:()=>nn(new Date(e,t-1,1))},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M15 18l-6-6 6-6"}))),a.createElement("span",{className:"calendar-title"},["January","February","March","April","May","June","July","August","September","October","November","December"][t]," ",e),a.createElement("button",{type:"button",className:"calendar-nav-btn",onClick:()=>nn(new Date(e,t+1,1))},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M9 18l6-6-6-6"})))),a.createElement("div",{className:"full-calendar-weekdays"},["SUN","MON","TUE","WED","THU","FRI","SAT"].map((e,t)=>a.createElement("div",{key:e,className:"calendar-weekday "+(0===t||6===t?"weekend":"")},e))),a.createElement("div",{className:"full-calendar-grid"},d.map((e,t)=>{const n=(Kt||[]).includes(e.dateStr),r=l&&e.isCurrentMonth&&e.date===i.getDate();return a.createElement("div",{key:t,className:`full-calendar-date ${n?"selected":""} ${e.isCurrentMonth?"":"other-month"} ${r?"today":""} ${e.isCurrentMonth&&e.isWeekend?"weekend":""}`,onClick:()=>{(Kt||[]).includes(e.dateStr)?$t((Kt||[]).filter(t=>t!==e.dateStr)):$t([...Kt||[],e.dateStr].sort())}},e.date)})),(Kt||[]).length>0&&a.createElement("div",{className:"full-calendar-selected"},a.createElement("span",{className:"selected-count"},(Kt||[]).length," ",(0,s.t)("broadcast.datesSelected")||"dates selected")),a.createElement("div",{className:"full-calendar-info"},(0,s.t)("broadcast.calendarSelectInfo")||"Select specific dates from the calendar. Navigate months using arrows."))})()),a.createElement("div",{className:"recurring-end-group"},a.createElement("label",null,(0,s.t)("broadcast.ends")||"Ends",":"),a.createElement("div",{className:"recurring-end-options"},a.createElement("label",{className:"recurring-end-option"},a.createElement("input",{type:"radio",name:"recurringEnd",checked:"never"===Jt,onChange:()=>Qt("never")}),a.createElement("span",null,(0,s.t)("broadcast.endNever")||"Never")),a.createElement("label",{className:"recurring-end-option"},a.createElement("input",{type:"radio",name:"recurringEnd",checked:"date"===Jt,onChange:()=>Qt("date")}),a.createElement("span",null,(0,s.t)("broadcast.endOnDate")||"On Date",":"),"date"===Jt&&a.createElement("input",{type:"date",value:Zt,onChange:e=>en(e.target.value),min:Pt||(new Date).toISOString().split("T")[0],className:"recurring-end-date-input"}))))))))),4===xr&&a.createElement("div",{className:"broadcast-left-panel"},a.createElement("div",{className:"broadcast-toggle-options"},a.createElement("label",{className:"broadcast-toggle"},a.createElement("input",{type:"checkbox",checked:J,onChange:e=>Q(e.target.checked)}),a.createElement("span",{className:"toggle-slider"}),a.createElement("span",null,(0,s.t)("broadcast.allowRepeat"))),a.createElement("label",{className:"broadcast-toggle"},a.createElement("input",{type:"checkbox",checked:Z,onChange:e=>ee(e.target.checked)}),a.createElement("span",{className:"toggle-slider"}),a.createElement("span",null,(0,s.t)("broadcast.enableLinkPreview"))),a.createElement("label",{className:"broadcast-toggle"},a.createElement("input",{type:"checkbox",checked:se,onChange:e=>{le(e.target.checked),e.target.checked||(Se(!1),Te(!1),De([]),Ne([]))}}),a.createElement("span",{className:"toggle-slider"}),a.createElement("span",null,(0,s.t)("broadcast.groupActions"))),se&&a.createElement("div",{className:"group-actions-panel"},a.createElement("p",{className:"group-actions-note"},(0,s.t)("broadcast.groupActionsNote")),a.createElement("label",{className:"broadcast-checkbox group-action-checkbox"},a.createElement("input",{type:"checkbox",checked:Ee,onChange:e=>{Se(e.target.checked),e.target.checked||De([])}}),a.createElement("span",null,(0,s.t)("broadcast.addIntoGroups"))),Ee&&a.createElement("div",{className:"group-action-selector"},a.createElement("div",{className:"group-select-dropdown",onClick:()=>{Le(Ae.map(e=>e.id)),Ie(!0)}},a.createElement("span",{className:"group-select-placeholder"},Ae.length>0?`${Ae.length} ${(0,s.t)("broadcast.groupsSelected")}`:(0,s.t)("broadcast.selectGroups")),a.createElement("span",{className:"dropdown-arrow"},"▼")),Ae.length>0&&a.createElement("div",{className:"selected-groups-chips"},Ae.map((e,t)=>a.createElement("span",{key:t,className:"group-chip"},e.name,a.createElement("button",{className:"chip-remove",onClick:t=>{t.stopPropagation(),De(t=>t.filter(t=>t.id!==e.id))}},"×"))))),a.createElement("label",{className:"broadcast-checkbox group-action-checkbox"},a.createElement("input",{type:"checkbox",checked:Ce,onChange:e=>{Te(e.target.checked),e.target.checked||Ne([])}}),a.createElement("span",null,(0,s.t)("broadcast.removeFromGroups"))),Ce&&a.createElement("div",{className:"group-action-selector"},a.createElement("div",{className:"group-select-dropdown",onClick:()=>{Le(_e.map(e=>e.id)),Be(!0)}},a.createElement("span",{className:"group-select-placeholder"},_e.length>0?`${_e.length} ${(0,s.t)("broadcast.groupsSelected")}`:(0,s.t)("broadcast.selectGroups")),a.createElement("span",{className:"dropdown-arrow"},"▼")),_e.length>0&&a.createElement("div",{className:"selected-groups-chips"},_e.map((e,t)=>a.createElement("span",{key:t,className:"group-chip"},e.name,a.createElement("button",{className:"chip-remove",onClick:t=>{t.stopPropagation(),Ne(t=>t.filter(t=>t.id!==e.id))}},"×")))))),a.createElement("label",{className:"broadcast-toggle"},a.createElement("input",{type:"checkbox",checked:ce,onChange:e=>{de(e.target.checked),e.target.checked||(Fe(!1),Oe(!1),qe([]),je([]))}}),a.createElement("span",{className:"toggle-slider"}),a.createElement("span",null,(0,s.t)("broadcast.customTabActions"))),ce&&a.createElement("div",{className:"group-actions-panel"},a.createElement("label",{className:"broadcast-checkbox group-action-checkbox"},a.createElement("input",{type:"checkbox",checked:Ue,onChange:e=>{Fe(e.target.checked),e.target.checked||qe([])}}),a.createElement("span",null,(0,s.t)("broadcast.addIntoTabs"))),Ue&&a.createElement("div",{className:"group-action-selector"},a.createElement("div",{className:"group-select-dropdown",onClick:()=>{Xe(We.map(e=>e.id)),Ge(!0)}},a.createElement("span",{className:"group-select-placeholder"},We.length>0?`${We.length} ${(0,s.t)("broadcast.tabsSelected")}`:(0,s.t)("broadcast.selectTabs")),a.createElement("span",{className:"dropdown-arrow"},"▼")),We.length>0&&a.createElement("div",{className:"selected-groups-chips"},We.map((e,t)=>a.createElement("span",{key:t,className:"group-chip"},e.title,a.createElement("button",{className:"chip-remove",onClick:t=>{t.stopPropagation(),qe(t=>t.filter(t=>t.id!==e.id))}},"×"))))),a.createElement("label",{className:"broadcast-checkbox group-action-checkbox"},a.createElement("input",{type:"checkbox",checked:ze,onChange:e=>{Oe(e.target.checked),e.target.checked||je([])}}),a.createElement("span",null,(0,s.t)("broadcast.removeFromTabs"))),ze&&a.createElement("div",{className:"group-action-selector"},a.createElement("div",{className:"group-select-dropdown",onClick:()=>{Xe(He.map(e=>e.id)),$e(!0)}},a.createElement("span",{className:"group-select-placeholder"},He.length>0?`${He.length} ${(0,s.t)("broadcast.tabsSelected")}`:(0,s.t)("broadcast.selectTabs")),a.createElement("span",{className:"dropdown-arrow"},"▼")),He.length>0&&a.createElement("div",{className:"selected-groups-chips"},He.map((e,t)=>a.createElement("span",{key:t,className:"group-chip"},e.title,a.createElement("button",{className:"chip-remove",onClick:t=>{t.stopPropagation(),je(t=>t.filter(t=>t.id!==e.id))}},"×")))))),a.createElement("label",{className:"broadcast-toggle"},a.createElement("input",{type:"checkbox",checked:me,onChange:e=>{pe(e.target.checked),e.target.checked||(Qe(!1),et(!1),nt([]),rt([]))}}),a.createElement("span",{className:"toggle-slider"}),a.createElement("span",null,(0,s.t)("broadcast.labelsActions"))),me&&a.createElement("div",{className:"group-actions-panel"},a.createElement("label",{className:"broadcast-checkbox group-action-checkbox"},a.createElement("input",{type:"checkbox",checked:Je,onChange:e=>{Qe(e.target.checked),e.target.checked||nt([])}}),a.createElement("span",null,(0,s.t)("broadcast.addToLabels"))),Je&&a.createElement("div",{className:"group-action-selector"},a.createElement("div",{className:"group-select-dropdown",onClick:()=>{dt(tt.map(e=>e.id)),it(!0)}},a.createElement("span",{className:"group-select-placeholder"},tt.length>0?`${tt.length} ${(0,s.t)("broadcast.labelsSelected")}`:(0,s.t)("broadcast.selectLabels")),a.createElement("span",{className:"dropdown-arrow"},"▼")),tt.length>0&&a.createElement("div",{className:"selected-groups-chips"},tt.map((e,t)=>a.createElement("span",{key:t,className:"group-chip"},e.name,a.createElement("button",{className:"chip-remove",onClick:t=>{t.stopPropagation(),nt(t=>t.filter(t=>t.id!==e.id))}},"×"))))),a.createElement("label",{className:"broadcast-checkbox group-action-checkbox"},a.createElement("input",{type:"checkbox",checked:Ze,onChange:e=>{et(e.target.checked),e.target.checked||rt([])}}),a.createElement("span",null,(0,s.t)("broadcast.removeFromLabels"))),Ze&&a.createElement("div",{className:"group-action-selector"},a.createElement("div",{className:"group-select-dropdown",onClick:()=>{dt(at.map(e=>e.id)),lt(!0)}},a.createElement("span",{className:"group-select-placeholder"},at.length>0?`${at.length} ${(0,s.t)("broadcast.labelsSelected")}`:(0,s.t)("broadcast.selectLabels")),a.createElement("span",{className:"dropdown-arrow"},"▼")),at.length>0&&a.createElement("div",{className:"selected-groups-chips"},at.map((e,t)=>a.createElement("span",{key:t,className:"group-chip"},e.name,a.createElement("button",{className:"chip-remove",onClick:t=>{t.stopPropagation(),rt(t=>t.filter(t=>t.id!==e.id))}},"×")))))),a.createElement("label",{className:"broadcast-toggle"},a.createElement("input",{type:"checkbox",checked:ue,onChange:e=>{ge(e.target.checked),e.target.checked||(pt(!1),gt(!1),bt(null),vt(null))}}),a.createElement("span",{className:"toggle-slider"}),a.createElement("span",null,(0,s.t)("broadcast.kanbanBoardActions"))),ue&&a.createElement("div",{className:"group-actions-panel"},a.createElement("label",{className:"broadcast-checkbox group-action-checkbox"},a.createElement("input",{type:"checkbox",checked:mt,onChange:e=>{pt(e.target.checked),e.target.checked||(bt(null),St(null),Dt([]))}}),a.createElement("span",null,(0,s.t)("broadcast.addToKanban"))),mt&&a.createElement("div",{className:"group-action-selector"},a.createElement("div",{className:"group-select-dropdown",onClick:async()=>{const e=await Da();if(e&&e.crms&&It(e.crms),St(ht?.crmId||null),ht?.crmId){const e=z?.stages?.[ht.crmId]||[];Dt(e)}xt(!0)}},a.createElement("span",{className:"group-select-placeholder"},ht?`${ht.crmName} → ${ht.stageName}`:(0,s.t)("broadcast.selectCRMStage")),a.createElement("span",{className:"dropdown-arrow"},"▼")),ht&&a.createElement("div",{className:"selected-groups-chips"},a.createElement("span",{className:"group-chip"},ht.crmName," → ",ht.stageName,a.createElement("button",{className:"chip-remove",onClick:e=>{e.stopPropagation(),bt(null)}},"×")))),a.createElement("label",{className:"broadcast-checkbox group-action-checkbox"},a.createElement("input",{type:"checkbox",checked:ut,onChange:e=>{gt(e.target.checked),e.target.checked||(vt(null),Tt(null),Nt([]))}}),a.createElement("span",null,(0,s.t)("broadcast.removeFromKanban"))),ut&&a.createElement("div",{className:"group-action-selector"},a.createElement("div",{className:"group-select-dropdown",onClick:async()=>{const e=await Da();if(e&&e.crms&&It(e.crms),Tt(ft?.crmId||null),ft?.crmId){const e=z?.stages?.[ft.crmId]||[];Nt(e)}kt(!0)}},a.createElement("span",{className:"group-select-placeholder"},ft?`${ft.crmName} → ${ft.stageName}`:(0,s.t)("broadcast.selectCRMStage")),a.createElement("span",{className:"dropdown-arrow"},"▼")),ft&&a.createElement("div",{className:"selected-groups-chips"},a.createElement("span",{className:"group-chip"},ft.crmName," → ",ft.stageName,a.createElement("button",{className:"chip-remove",onClick:e=>{e.stopPropagation(),vt(null)}},"×"))))),a.createElement("label",{className:"broadcast-toggle skip-bulk-message-toggle"},a.createElement("input",{type:"checkbox",checked:he,onChange:e=>be(e.target.checked)}),a.createElement("span",{className:"toggle-slider"}),a.createElement("span",null,(0,s.t)("broadcast.skipBulkMessage"))),he&&a.createElement("div",{className:"skip-bulk-message-info"},a.createElement("span",{className:"info-icon"},"ℹ️"),a.createElement("span",null,(0,s.t)("broadcast.skipBulkMessageInfo"))),fe&&a.createElement(a.Fragment,null,a.createElement("label",{className:"broadcast-toggle signature-toggle"},a.createElement("input",{type:"checkbox",checked:ye,onChange:e=>xe(e.target.checked)}),a.createElement("span",{className:"toggle-slider"}),a.createElement("span",null,(0,s.t)("broadcast.appendSignature"))),ye&&a.createElement("div",{className:"signature-preview"},a.createElement("span",{className:"signature-label"},(0,s.t)("broadcast.signaturePreview"),":"),a.createElement("span",{className:"signature-text"},"*",we,"*"))))),5===xr&&a.createElement("div",{className:"broadcast-step-review"},a.createElement("div",{className:"campaign-summary-card"},a.createElement("h3",{style:{margin:"0 0 16px",fontSize:"15px",fontWeight:700,color:"var(--lion-text-primary)"}},"📊 Resumo da Campanha"),a.createElement("div",{className:"campaign-summary-grid"},a.createElement("div",{className:"summary-stat"},a.createElement("span",{className:"summary-stat-label"},"Destinatários"),a.createElement("span",{className:"summary-stat-value"},m.split("\n").filter(e=>e.trim()).length||h.length||ma.length)),a.createElement("div",{className:"summary-stat"},a.createElement("span",{className:"summary-stat-label"},"Mensagens"),a.createElement("span",{className:"summary-stat-value"},W.filter(e=>e.content.trim()||e.attachments&&e.attachments.length>0).length)),a.createElement("div",{className:"summary-stat"},a.createElement("span",{className:"summary-stat-label"},"Intervalo"),a.createElement("span",{className:"summary-stat-value"},K,"-",Y,"s")),a.createElement("div",{className:"summary-stat"},a.createElement("span",{className:"summary-stat-label"},"Modo"),a.createElement("span",{className:"summary-stat-value"},"oneToOne"===i?"Contatos":"Grupos")),a.createElement("div",{className:"summary-stat"},a.createElement("span",{className:"summary-stat-label"},"Agendamento"),a.createElement("span",{className:"summary-stat-value"},Rt?`${Pt} ${Ut}`:"Imediato")),a.createElement("div",{className:"summary-stat"},a.createElement("span",{className:"summary-stat-label"},"Pausa"),a.createElement("span",{className:"summary-stat-value"},te?`A cada ${ae} contatos`:"Desativada"))),a.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginTop:"12px"}},se&&a.createElement("span",{className:"summary-badge active"},"Ações de Grupo"),ce&&a.createElement("span",{className:"summary-badge active"},"Ações de Aba"),me&&a.createElement("span",{className:"summary-badge active"},"Ações de Etiquetas"),ue&&a.createElement("span",{className:"summary-badge active"},"Ações Kanban"),he&&a.createElement("span",{className:"summary-badge warning"},"Ignorar Mensagem (Apenas Ações)"),V&&a.createElement("span",{className:"summary-badge info"},"Mensagem Aleatória"))),a.createElement("div",{className:"campaign-warning-banner"},a.createElement("div",{className:"warning-icon"},"⚠️"),a.createElement("div",{className:"warning-content"},a.createElement("strong",null,"Importante — Leia antes de enviar"),a.createElement("p",{style:{margin:"6px 0 0",fontSize:"12px",lineHeight:1.5}},"O envio de mensagens em massa pode resultar no banimento temporário ou permanente do seu número pelo WhatsApp. Recomendamos:"),a.createElement("ul",{style:{margin:"6px 0 0",paddingLeft:"16px",fontSize:"12px",lineHeight:1.6}},a.createElement("li",null,"Manter intervalos mínimos de 5 a 15 segundos"),a.createElement("li",null,"Não enviar para mais de 100 contatos de uma vez"),a.createElement("li",null,"Usar mensagens personalizadas com variáveis"),a.createElement("li",null,"Evitar enviar a mesma mensagem para muitos contatos")))),a.createElement("div",{className:"wa-preview-container"},a.createElement("h4",{style:{margin:"0 0 12px",fontSize:"13px",fontWeight:700,color:"var(--lion-text-muted)",textTransform:"uppercase",letterSpacing:"0.5px"}},"Pré-visualização da Mensagem"),a.createElement("div",{className:"wa-preview-chat"},W.filter(e=>e.content.trim()||e.attachments&&e.attachments.length>0).map((e,t)=>a.createElement("div",{key:e.id||t,className:"wa-preview-bubble outgoing"},e.attachments&&e.attachments.length>0&&a.createElement("div",{className:"wa-preview-media"},"📎 ","image/video"===e.attachmentType?"🖼️ Image/Video":"document"===e.attachmentType?"📄 Document":"audio"===e.attachmentType?"🎵 Audio":"Media"," attached"),e.content&&a.createElement("div",{className:"wa-preview-text"},e.content),ye&&we&&a.createElement("div",{className:"wa-preview-signature"},we),a.createElement("div",{className:"wa-preview-time"},(new Date).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})," ✓✓"))),0===W.filter(e=>e.content.trim()||e.attachments&&e.attachments.length>0).length&&a.createElement("div",{style:{textAlign:"center",color:"var(--lion-text-muted)",padding:"20px",fontSize:"13px"}},"Nenhuma mensagem configurada"))),a.createElement("label",{className:"send-confirm-checkbox"},a.createElement("input",{type:"checkbox",checked:Er,onChange:e=>Sr(e.target.checked)}),a.createElement("span",null,"Compreendo os riscos do envio em massa e desejo continuar")))),a.createElement("div",{className:"campaign-wizard-footer"},xr>1?a.createElement("button",{className:"broadcast-btn broadcast-btn-secondary",onClick:()=>{wr(e=>Math.max(e-1,1))}},"← Back"):a.createElement("div",null),a.createElement("div",{className:"campaign-wizard-footer-right"},xr<5?a.createElement("button",{className:"broadcast-btn broadcast-btn-primary",onClick:()=>{wr(e=>Math.min(e+1,5))}},"Next →"):a.createElement(a.Fragment,null,Rt?a.createElement("button",{className:"broadcast-btn broadcast-btn-schedule",onClick:async()=>{const e=await qr();if(0===e.length)return void alert("Nenhum contato selecionado. Por favor, adicione números de telefone ou selecione contatos.");if(!he&&W.every(e=>!(e.content.trim()||e.attachments&&0!==e.attachments.length)))return void alert("Por favor, insira uma mensagem ou envie uma mídia.");if(he){if(!(se&&(Ee||Ce)||ce&&(Ue||ze)||me&&(Je||Ze)||ue&&(mt||ut)))return void alert("Skip Bulk Message is enabled but no actions are configured. Please enable at least one action (Group, Tab, Label, or Kanban).")}if(!Pt||!Ut)return void alert("Por favor, selecione data e hora para o agendamento.");const t=new Date(`${Pt}T${Ut}`);if(t<=new Date)alert("Scheduled time must be in the future.");else try{const n=[];for(const e of W){const t={...e};if(e.attachments&&e.attachments.length>0){const n=[];for(const t of e.attachments)if(t.base64Url&&t.base64Url.startsWith("data:")||!t.file||t.file.startsWith("data:"))n.push(t);else try{const e=await Mn.TemplatesStorage.getMedia(t.file);e&&e.base64?n.push({...t,base64Url:e.base64,file:e.base64}):n.push(t)}catch(e){n.push(t)}t.attachments=n}n.push(t)}const a={id:lr?.id||xa.generateId(),contacts:e.map(e=>e.phone),contactsData:e,messages:n,sendRandomMessage:V,minDelay:K,maxDelay:Y,allowDuplicates:J,enableLinkPreview:Z,pauseEnabled:te,pauseAfterContacts:ae,pauseTimeSeconds:oe,scheduledTime:t.getTime(),originalScheduledTime:lr?.originalScheduledTime||t.getTime(),createdAt:lr?.createdAt||Date.now(),status:"scheduled",executionHistory:lr?.executionHistory,lastRunAt:lr?.lastRunAt,totalRuns:lr?.totalRuns,successRate:lr?.successRate,progress:{sent:0,failed:0,total:V?e.length:e.length*W.length},results:[],groupActions:se,addToGroupsEnabled:Ee,removeFromGroupsEnabled:Ce,groupsForAddAction:Ae.map(e=>({id:e.id,name:e.name})),groupsForRemoveAction:_e.map(e=>({id:e.id,name:e.name})),customTabActions:ce,addToTabsEnabled:Ue,removeFromTabsEnabled:ze,tabsForAddAction:We.map(e=>({id:e.id,title:e.title})),tabsForRemoveAction:He.map(e=>({id:e.id,title:e.title})),labelsActions:me,addToLabelsEnabled:Je,removeFromLabelsEnabled:Ze,labelsForAddAction:tt.map(e=>({id:e.id,name:e.name})),labelsForRemoveAction:at.map(e=>({id:e.id,name:e.name})),kanbanBoardActions:ue,addToKanbanEnabled:mt,removeFromKanbanEnabled:ut,kanbanForAddAction:ht,kanbanForRemoveAction:ft,autoSendIfMissed:zt,isRecurring:Wt,recurringInterval:Wt?Ht:void 0,recurringDays:Wt&&"weekly"===Ht?Vt:void 0,recurringEndDate:Wt&&"date"===Jt&&Zt?new Date(Zt).getTime():null,nextOccurrence:Wt?t.getTime():void 0};if(Wt&&"weekly"===Ht&&0===Vt.length)return void alert("Por favor, selecione pelo menos um dia para envios recorrentes semanais.");await xa.saveScheduledBroadcast(a),document.dispatchEvent(new CustomEvent("scheduleNewBroadcast",{detail:{broadcast:a,scheduledTime:t.getTime()}}));try{await chrome.runtime.sendMessage({action:"scheduleNewBroadcast",broadcastId:a.id,scheduledTime:t.getTime()})}catch(e){}lr&&(cr(null),await Vr()),Ba({dateTime:t.toLocaleString(),contacts:e.length,messages:W.length,isEdit:!!lr}),wa(!0)}catch(e){alert("Falha ao agendar o envio em massa. Por favor, tente novamente.")}},disabled:!Er||!Pt||!Ut},"📅 ",(0,s.t)("broadcast.scheduleBroadcast")):a.createElement("button",{className:"broadcast-btn broadcast-btn-quick-start",onClick:async()=>{const e=await qr();if(0===e.length)return void alert("Nenhum contato selecionado. Por favor, adicione números de telefone ou selecione contatos.");if(!he&&W.every(e=>!(e.content.trim()||e.attachments&&0!==e.attachments.length)))return void alert("Por favor, insira uma mensagem ou envie uma mídia.");if(he){if(!(se&&(Ee||Ce)||ce&&(Ue||ze)||me&&(Je||Ze)||ue&&(mt||ut)))return void alert("Skip Bulk Message is enabled but no actions are configured. Please enable at least one action (Group, Tab, Label, or Kanban).")}sn(!0),or("sending");const t=V?e.length:e.length*W.length;mn({sent:0,total:t,failed:0}),await jr(e)},disabled:!Er||on},on?`${(0,s.t)("broadcast.sending")} (${dn.sent}/${dn.total})`:"🚀 Enviar Agora"))))))),ya&&ka&&a.createElement("div",{className:"schedule-confirm-overlay"},a.createElement("div",{className:"schedule-confirm-modal"},a.createElement("div",{className:"schedule-confirm-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"64",height:"64"},a.createElement("circle",{cx:"12",cy:"12",r:"11",fill:"var(--lion-primary)"}),a.createElement("path",{fill:"#ffffff",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),a.createElement("h2",{className:"schedule-confirm-title"},(0,s.t)("broadcast.broadcastScheduled")),a.createElement("p",{className:"schedule-confirm-datetime"},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"var(--lion-primary)",d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"})),ka.dateTime),a.createElement("div",{className:"schedule-confirm-stats"},a.createElement("div",{className:"schedule-stat"},a.createElement("span",{className:"schedule-stat-value"},ka.contacts),a.createElement("span",{className:"schedule-stat-label"},(0,s.t)("broadcast.contacts"))),a.createElement("div",{className:"schedule-stat"},a.createElement("span",{className:"schedule-stat-value"},ka.messages),a.createElement("span",{className:"schedule-stat-label"},(0,s.t)("broadcast.messages")))),a.createElement("button",{className:"schedule-confirm-btn",onClick:()=>{wa(!1),Ba(null),t()}},"OK"))),xn&&a.createElement("div",{className:"reports-view-overlay "+(o?"lion-dark":"")},a.createElement("div",{className:"reports-view-modal"},a.createElement("div",{className:"reports-view-header"},a.createElement("h2",null,(0,s.t)("broadcast.broadcastReports")),a.createElement("button",{className:"reports-refresh-btn",onClick:Dr,title:(0,s.t)("broadcast.tooltipRefresh")},"🔄"),a.createElement("button",{className:"reports-close-btn",onClick:()=>wn(!1)},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})))),a.createElement("div",{className:"reports-view-content"},Sn.length>0&&a.createElement("div",{className:"reports-section scheduled-section"},a.createElement("h3",{className:"section-title"},"🕐 Scheduled Campaigns (",Sn.length,")"),a.createElement("div",{className:"reports-list"},Sn.map(e=>a.createElement("div",{key:e.id,className:"reports-list-item status-scheduled"},a.createElement("div",{className:"col-date"},a.createElement("div",{className:"date-main scheduled-time"},"📅 ",new Date(e.scheduledTime).toLocaleDateString()),a.createElement("div",{className:"date-time scheduled-time"},"⏰ ",new Date(e.scheduledTime).toLocaleTimeString())),a.createElement("div",{className:"col-contacts"},a.createElement("span",{className:"contacts-count"},e.contacts?.length||0),a.createElement("span",{className:"contacts-label"},"contacts")),a.createElement("div",{className:"col-messages"},a.createElement("span",{className:"messages-count"},e.messages?.length||0),a.createElement("span",{className:"messages-label"},"messages")),a.createElement("div",{className:"col-status"},a.createElement("span",{className:"status-badge scheduled"},"⏳ Scheduled")),a.createElement("div",{className:"col-actions"},a.createElement("button",{className:"cancel-scheduled-btn",onClick:async()=>{confirm("Cancel this scheduled broadcast?")&&(await xa.removeScheduledBroadcast(e.id),n().runtime.sendMessage({action:"cancelScheduledBroadcast",broadcastId:e.id}),await Dr())},title:(0,s.t)("broadcast.cancel")},"❌")))))),a.createElement("div",{className:"reports-section history-section"},a.createElement("h3",{className:"section-title"},"📊 ",(0,s.t)("broadcast.campaignHistory")," (",kn.length,")"),0===kn.length&&0===Sn.length?a.createElement("div",{className:"reports-empty"},a.createElement("svg",{viewBox:"0 0 24 24",width:"48",height:"48"},a.createElement("path",{fill:"#8696a0",d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z"})),a.createElement("p",null,(0,s.t)("broadcast.noHistoryYet")),a.createElement("span",null,(0,s.t)("broadcast.historyDescription"))):0===kn.length?a.createElement("div",{className:"reports-empty-small"},a.createElement("p",null,(0,s.t)("broadcast.noCompletedCampaigns"))):a.createElement("div",{className:"reports-list"},a.createElement("div",{className:"reports-list-header"},a.createElement("span",{className:"col-date"},(0,s.t)("broadcast.dateTime")),a.createElement("span",{className:"col-contacts"},(0,s.t)("broadcast.contacts")),a.createElement("span",{className:"col-sent"},(0,s.t)("broadcast.sent")),a.createElement("span",{className:"col-failed"},(0,s.t)("broadcast.failed")),a.createElement("span",{className:"col-status"},(0,s.t)("broadcast.status"))),kn.map(e=>a.createElement("div",{key:e.id,className:`reports-list-item status-${e.status}`},a.createElement("div",{className:"col-date"},a.createElement("div",{className:"date-main"},new Date(e.startedAt).toLocaleDateString()),a.createElement("div",{className:"date-time"},new Date(e.startedAt).toLocaleTimeString())),a.createElement("div",{className:"col-contacts"},a.createElement("span",{className:"contacts-count"},e.contacts),a.createElement("button",{className:"inline-download-btn",onClick:()=>Ra(e,"all"),title:(0,s.t)("broadcast.downloadAllContacts")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})))),a.createElement("div",{className:"col-sent"},a.createElement("span",{className:"sent-badge"},"✅ ",e.sentCount),a.createElement("button",{className:"inline-download-btn sent",onClick:()=>Ra(e,"sent"),title:(0,s.t)("broadcast.downloadSentContacts")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})))),a.createElement("div",{className:"col-failed"},a.createElement("span",{className:"failed-badge"},"❌ ",e.failedCount),e.failedCount>0&&a.createElement("button",{className:"inline-download-btn failed",onClick:()=>Ra(e,"failed"),title:(0,s.t)("broadcast.downloadFailedContacts")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})))),a.createElement("div",{className:"col-status"},a.createElement("span",{className:`status-badge ${e.status}`},"completed"===e.status?`✅ ${(0,s.t)("broadcast.completed")}`:"failed"===e.status?`❌ ${(0,s.t)("broadcast.failed")}`:"running"===e.status?`🔄 ${(0,s.t)("broadcast.running")}`:`⚠️ ${(0,s.t)("broadcast.cancelled")}`))))))),a.createElement("div",{className:"reports-view-footer"},a.createElement("span",{className:"reports-count"},Sn.length," ",(0,s.t)("broadcast.scheduled")," • ",kn.length," ",(0,s.t)("broadcast.completed")),kn.length>0&&a.createElement("button",{className:"reports-clear-btn",onClick:async()=>{confirm("Are you sure you want to clear all broadcast history?")&&(await xa.clearHistory(),En([]))}},(0,s.t)("broadcast.clearHistory"))))),Pn&&a.createElement("div",{className:"upload-wizard-overlay"},a.createElement("div",{className:"upload-wizard-modal"},a.createElement("div",{className:"upload-wizard-header"},a.createElement("h2",null,(0,s.t)("broadcast.uploadContacts")),a.createElement("button",{className:"wizard-close-btn",onClick:()=>zn(!1)},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})))),a.createElement("div",{className:"upload-wizard-steps"},a.createElement("div",{className:`wizard-step ${qn>=1?"active":""} ${qn>1?"completed":""}`},a.createElement("div",{className:"step-number"},qn>1?"✓":"1"),a.createElement("span",null,(0,s.t)("broadcast.stepSelect"))),a.createElement("div",{className:"step-line"}),a.createElement("div",{className:`wizard-step ${qn>=2?"active":""} ${qn>2?"completed":""}`},a.createElement("div",{className:"step-number"},qn>2?"✓":"2"),a.createElement("span",null,(0,s.t)("broadcast.stepMap"))),a.createElement("div",{className:"step-line"}),a.createElement("div",{className:"wizard-step "+(qn>=3?"active":"")},a.createElement("div",{className:"step-number"},"3"),a.createElement("span",null,(0,s.t)("broadcast.stepUpload")))),a.createElement("div",{className:"upload-wizard-content"},1===qn&&a.createElement("div",{className:"wizard-step-content"},a.createElement("div",{className:"upload-drop-area",onClick:()=>ur.current?.click()},a.createElement("div",{className:"upload-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"48",height:"48"},a.createElement("path",{fill:"var(--lion-primary)",d:"M9 16h6v-6h4l-7-7-7 7h4v6zm-4 2h14v2H5v-2z"}))),a.createElement("p",{className:"upload-text"},(0,s.t)("broadcast.uploadCSVImport")),a.createElement("input",{ref:ur,type:"file",accept:".csv",style:{display:"none"},onChange:Mr})),a.createElement("p",{className:"upload-hint"},(0,s.t)("broadcast.uploadCSVOnly")),a.createElement("div",{className:"sample-files"},a.createElement("span",null,(0,s.t)("broadcast.downloadSampleFile")),a.createElement("button",{className:"sample-btn",onClick:()=>(e=>{let t="",n="",a="";const r=[["phone_number","name","company","city","notes"],["919876543210","Maria Silva","Acme Corp","Mumbai","VIP Customer"],["918765432109","Jane Smith","Tech Ltd","Delhi","New Lead"],["917654321098","Bob Wilson","Global Inc","Bangalore","Follow up"]];"csv"===e||"excel"===e?(t=r.map(e=>e.join(",")).join("\n"),n="sample_contacts.csv",a="text/csv"):(t=r.map(e=>e.join("\t")).join("\n"),n="sample_contacts.txt",a="text/plain");const o=new Blob([t],{type:a}),i=URL.createObjectURL(o),s=document.createElement("a");s.href=i,s.download=n,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(i)})("csv")},"CSV")),Gn&&a.createElement("div",{className:"uploaded-file-info"},a.createElement("span",{className:"file-icon"},"📄"),a.createElement("span",{className:"file-name"},Gn),a.createElement("span",{className:"file-rows"},jn.length," ",(0,s.t)("broadcast.rows")))),2===qn&&a.createElement("div",{className:"wizard-step-content"},a.createElement("div",{className:"map-section"},a.createElement("div",{className:"phone-column-select"},a.createElement("label",null,(0,s.t)("broadcast.phoneNumberLabel")),a.createElement("select",{value:Jn,onChange:e=>Zn(parseInt(e.target.value))},($n||[]).map((e,t)=>a.createElement("option",{key:t,value:t},e)))),a.createElement("p",{className:"map-hint"},(0,s.t)("broadcast.mapColumnHint"))),a.createElement("div",{className:"extra-columns-section"},a.createElement("div",{className:"extra-columns-header"},a.createElement("span",null,(0,s.t)("broadcast.chooseExtraColumns")),a.createElement("div",{className:"select-all-btns"},a.createElement("button",{className:"select-all-btn",onClick:()=>{const e=$n.map((e,t)=>t).filter(e=>e!==Jn);ta(e)}},(0,s.t)("broadcast.all")),a.createElement("button",{className:"select-none-btn",onClick:()=>{ta([])}},(0,s.t)("broadcast.none")))),a.createElement("div",{className:"extra-columns-grid"},($n||[]).map((e,t)=>{if(t===Jn)return null;const n=jn[1]?.[t]||"";return a.createElement("div",{key:t,className:"extra-column-card "+((ea||[]).includes(t)?"selected":""),onClick:()=>{return e=t,void ta(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]);var e}},a.createElement("div",{className:"column-checkbox"},(ea||[]).includes(t)&&a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"var(--lion-primary)",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),a.createElement("div",{className:"column-info"},a.createElement("span",{className:"column-name"},e),a.createElement("span",{className:"column-sample"},n)))})))),3===qn&&a.createElement("div",{className:"wizard-step-content"},a.createElement("div",{className:"preview-header"},a.createElement("button",{className:"remove-rows-btn"},(0,s.t)("broadcast.removeUnwantedRows")),a.createElement("span",{className:"total-contacts"},(0,s.t)("broadcast.totalContacts")," ",a.createElement("span",{className:"contact-count"},na.length-ra.size))),a.createElement("div",{className:"preview-table-container"},a.createElement("table",{className:"preview-table"},a.createElement("thead",null,a.createElement("tr",null,a.createElement("th",null,(0,s.t)("broadcast.phoneNumberLabel").replace(":","")),(ea||[]).map(e=>a.createElement("th",{key:e},($n||[])[e])))),a.createElement("tbody",null,(na||[]).map((e,t)=>a.createElement("tr",{key:t,className:ra.has(e.rowIndex)?"removed-row":"",onClick:()=>{return t=e.rowIndex,void oa(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t}},a.createElement("td",null,e.phoneNumber),(ea||[]).map(t=>a.createElement("td",{key:t},e.extraData[($n||[])[t]]||""))))))))),a.createElement("div",{className:"upload-wizard-footer"},qn>1&&a.createElement("button",{className:"wizard-btn wizard-btn-prev",onClick:()=>Ir(qn-1)},(0,s.t)("broadcast.previous")),a.createElement("button",{className:"wizard-btn wizard-btn-close",onClick:()=>zn(!1)},(0,s.t)("broadcast.close")),qn<3?a.createElement("button",{className:"wizard-btn wizard-btn-next",onClick:()=>Ir(qn+1),disabled:1===qn&&0===jn.length},(0,s.t)("broadcast.next")):a.createElement("button",{className:"wizard-btn wizard-btn-upload",onClick:()=>{const e=na.filter(e=>!ra.has(e.rowIndex)),t=e.map(e=>e.phoneNumber).filter(e=>e),n=m.trim(),a=t.join("\n");p(n?`${n}\n${a}`:a);const r=[],o=[];for(const e of ea)if(e!==Jn){const t=$n[e]||`column${e+1}`;r.push({name:t,column:e}),o.push(t)}sa(r),ga(o);const i=e.map(e=>({phone:e.phoneNumber,...e.extraData}));S(i),pa(i),zn(!1)}},(0,s.t)("broadcast.startUpload"))))),fa&&a.createElement("div",{className:"selector-modal-overlay"},a.createElement("div",{className:"selector-modal selector-modal-large"},a.createElement("div",{className:"selector-header"},a.createElement("h3",null,"Select Contacts"),a.createElement("button",{className:"selector-close-btn",onClick:()=>{va(!1),tr("")}},"×")),a.createElement("div",{className:"selector-search"},a.createElement("input",{type:"text",placeholder:"Search contacts by name or phone...",value:er,onChange:e=>tr(e.target.value),className:"selector-search-input"})),!an&&Xa.length>0&&a.createElement("div",{className:"selector-select-all-row"},a.createElement("button",{className:"selector-select-all-btn "+(Qa.size===Pr().length&&Pr().length>0?"active":""),onClick:()=>{const e=Pr();Qa.size===e.length&&e.length>0?Za(new Set):(()=>{const e=Pr();Za(new Set(e.map(e=>e.id)))})()}},Qa.size===Pr().length&&Pr().length>0?"Deselect All":`Select All (${Pr().length})`)),a.createElement("div",{className:"selector-content"},an?a.createElement("div",{className:"selector-loading"},"Loading contacts..."):0===Xa.length?a.createElement("div",{className:"selector-empty"},"No contacts found. Make sure WhatsApp Web is loaded."):a.createElement("div",{className:"selector-list"},Xa.filter(e=>{if(!er)return!0;const t=er.toLowerCase();return(e.name||"").toLowerCase().includes(t)||(e.phoneNumber||"").includes(t)}).map((e,t)=>a.createElement("label",{key:t,className:"selector-item"},a.createElement("input",{type:"checkbox",checked:Qa.has(e.id),onChange:()=>{return t=e.id,void Za(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t}}),a.createElement("span",{className:"selector-item-name"},e.name||"Unknown"),a.createElement("span",{className:"selector-item-phone"},e.phoneNumber||""))))),a.createElement("div",{className:"selector-footer"},a.createElement("span",{className:"selector-count"},Qa.size," selected of ",Xa.length),a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>{va(!1),tr("")}},"Cancel"),a.createElement("button",{className:"selector-btn selector-btn-confirm",onClick:()=>{(()=>{const e=Xa.filter(e=>Qa.has(e.id)).map(e=>e.phoneNumber||"").filter(e=>e),t=m.trim(),n=e.join("\n");p(t?`${t}\n${n}`:n),va(!1),Za(new Set)})(),tr("")}},"Add Contacts")))),qa&&a.createElement("div",{className:"selector-modal-overlay"},a.createElement("div",{className:"selector-modal"},a.createElement("div",{className:"selector-header"},a.createElement("h3",null,(0,s.t)("broadcast.selectGroupsTitle")),a.createElement("button",{className:"selector-close-btn",onClick:()=>{Ha(!1),ar("")}},"×")),a.createElement("div",{className:"selector-search"},a.createElement("input",{type:"text",placeholder:(0,s.t)("broadcast.searchGroups")||"Search groups...",value:nr,onChange:e=>ar(e.target.value),className:"selector-search-input"})),!an&&C.length>0&&a.createElement("div",{className:"selector-select-all-row"},a.createElement("button",{className:"selector-select-all-btn "+(u.length===Lr().length&&Lr().length>0?"active":""),onClick:()=>{const e=Lr();u.length===e.length&&e.length>0?g([]):(()=>{const e=Lr();g(e.map(e=>e.id))})()}},u.length===Lr().length&&Lr().length>0?(0,s.t)("broadcast.deselectAll")||"Deselect All":`${(0,s.t)("broadcast.selectAll")||"Select All"} (${Lr().length})`)),a.createElement("div",{className:"selector-content"},an?a.createElement("div",{className:"selector-loading"},(0,s.t)("broadcast.loadingGroups")):0===C.length?a.createElement("div",{className:"selector-empty"},(0,s.t)("broadcast.noGroupsFound")):a.createElement("div",{className:"selector-list"},C.filter(e=>{if(!nr.trim())return!0;return(e.name||e.subject||"").toLowerCase().includes(nr.toLowerCase())}).map((e,t)=>a.createElement("label",{key:t,className:"selector-item"},a.createElement("input",{type:"checkbox",checked:(u||[]).includes(e.id),onChange:()=>{return t=e.id,void g(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]);var t}}),a.createElement("span",{className:"selector-item-name"},e.name||e.subject||"Unknown Group"),a.createElement("span",{className:"selector-item-count"},e.participantCount||0," ",(0,s.t)("broadcast.members")))))),a.createElement("div",{className:"selector-footer"},a.createElement("span",{className:"selector-count"},u.length," ",(0,s.t)("broadcast.groupsSelectedCount")),a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>{Ha(!1),ar("")}},(0,s.t)("broadcast.cancel")),a.createElement("button",{className:"selector-btn selector-btn-confirm",onClick:async()=>{rn(!0);try{if("groups"===i){const e=[];for(const t of u){const n=C.find(e=>e.id===t);n&&e.push({id:t,name:n.name||t})}const t=new Set(h.map(e=>e.id)),n=e.filter(e=>!t.has(e.id));b(e=>[...e,...n])}else{const e=[];for(const t of u){const n=await Ca(t);for(const t of n)t.phone&&e.push({phone:t.phone,name:t.name||t.phone})}const t=e.filter((e,t,n)=>t===n.findIndex(t=>t.phone===e.phone)),n=m.trim(),a=new Set(n.split("\n").map(e=>e.split(",")[0].trim()).filter(Boolean)),r=t.filter(e=>!a.has(e.phone)).map(e=>`${e.phone},${e.name}`).join("\n");r&&p(n?`${n}\n${r}`:r)}}catch(e){}finally{rn(!1),Ha(!1),g([])}}},(0,s.t)("broadcast.addGroupsBtn"))))),ja&&a.createElement("div",{className:"selector-modal-overlay"},a.createElement("div",{className:"selector-modal"},a.createElement("div",{className:"selector-header"},a.createElement("h3",null,(0,s.t)("broadcast.selectTabs")),a.createElement("button",{className:"selector-close-btn",onClick:()=>Va(!1)},"×")),!an&&M.length>0&&a.createElement("div",{className:"selector-select-all-row"},a.createElement("button",{className:"selector-select-all-btn "+(y.length===M.length&&M.length>0?"active":""),onClick:()=>{y.length===M.length&&M.length>0?x([]):x(M.map(e=>e.id))}},y.length===M.length&&M.length>0?(0,s.t)("broadcast.deselectAll")||"Deselect All":`${(0,s.t)("broadcast.selectAll")||"Select All"} (${M.length})`)),a.createElement("div",{className:"selector-content"},an?a.createElement("div",{className:"selector-loading"},(0,s.t)("broadcast.loadingTabs")):0===M.length?a.createElement("div",{className:"selector-empty"},(0,s.t)("broadcast.noTabsFound")):a.createElement("div",{className:"selector-list"},M.map((e,t)=>a.createElement("label",{key:t,className:"selector-item"},a.createElement("input",{type:"checkbox",checked:(y||[]).includes(e.id),onChange:()=>{return t=e.id,void x(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]);var t}}),a.createElement("span",{className:"selector-item-name"},e.title||"Unnamed Tab"),a.createElement("span",{className:"selector-item-count"},e.chats?.length||0," ",(0,s.t)("broadcast.contacts")))))),a.createElement("div",{className:"selector-footer"},a.createElement("span",{className:"selector-count"},y.length," ",(0,s.t)("broadcast.tabsSelected")),a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>Va(!1)},(0,s.t)("broadcast.cancel")),a.createElement("button",{className:"selector-btn selector-btn-confirm",onClick:()=>{const e=[];for(const t of M)if(y.includes(t.id)&&t.chats&&t.chats.length>0)for(const n of t.chats){const t=n.id||"",a=t.includes("@lid"),r=a?t:t.split("@")[0],o=n.name||(a?t.split("@")[0]:r);r&&e.push({phone:r,name:o})}const t=e.filter((e,t,n)=>t===n.findIndex(t=>t.phone===e.phone)),n=m.trim(),a=new Set(n.split("\n").map(e=>e.split(",")[0].trim()).filter(Boolean)),r=t.filter(e=>!a.has(e.phone)).map(e=>`${e.phone},${e.name}`).join("\n");r&&p(n?`${n}\n${r}`:r),Va(!1),x([])}},(0,s.t)("broadcast.tabsContacts"))))),Ga&&a.createElement("div",{className:"selector-modal-overlay"},a.createElement("div",{className:"selector-modal"},a.createElement("div",{className:"selector-header"},U?a.createElement(a.Fragment,null,a.createElement("button",{className:"selector-back-btn",onClick:()=>{F(null),B([]),k([])}},"← Back"),a.createElement("h3",null,"Select Stages")):a.createElement("h3",null,"Select CRM"),a.createElement("button",{className:"selector-close-btn",onClick:()=>{Ka(!1),F(null)}},"×")),a.createElement("div",{className:"selector-content"},an?a.createElement("div",{className:"selector-loading"},"Loading..."):U?0===R.length?a.createElement("div",{className:"selector-empty"},"No stages in this CRM"):a.createElement(a.Fragment,null,a.createElement("div",{className:"selector-select-all-row"},a.createElement("button",{className:"selector-select-all-btn "+(w.length===R.length&&R.length>0?"active":""),onClick:()=>{w.length===R.length&&R.length>0?k([]):k(R.map(e=>e.id))}},w.length===R.length&&R.length>0?"Deselect All":`Select All (${R.length})`)),a.createElement("div",{className:"selector-list"},R.map((e,t)=>{const n=(z?.assignments||[]).filter(t=>t.crmId===U&&t.stageId===e.id).length;return a.createElement("label",{key:t,className:"selector-item"},a.createElement("input",{type:"checkbox",checked:(w||[]).includes(e.id),onChange:()=>{return t=e.id,void k(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]);var t}}),a.createElement("span",{className:"selector-item-color",style:{backgroundColor:e.color||"#ccc",width:12,height:12,borderRadius:"50%",marginRight:8}}),a.createElement("span",{className:"selector-item-name"},e.name||"Unnamed Stage"),a.createElement("span",{className:"selector-item-count"},n," contatos"))}))):0===P.length?a.createElement("div",{className:"selector-empty"},"Nenhum CRM encontrado. Crie um CRM no Quadro Kanban primeiro."):a.createElement("div",{className:"selector-list"},P.map((e,t)=>a.createElement("div",{key:t,className:"selector-item selector-item-clickable",onClick:()=>{return t=e.id,F(t),B(z?.stages?.[t]||[]),void k([]);var t}},a.createElement("span",{className:"selector-item-name"},e.name||"Unnamed CRM"),a.createElement("span",{className:"selector-item-arrow"},"→"))))),a.createElement("div",{className:"selector-footer"},U?a.createElement(a.Fragment,null,a.createElement("span",{className:"selector-count"},w.length," etapas selecionadas"),a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>{Ka(!1),F(null)}},"Cancel"),a.createElement("button",{className:"selector-btn selector-btn-confirm",onClick:async()=>{if(!z||!U)return void Ka(!1);const e=[],t=z.assignments||[],n=z.chatsCache||{};for(const a of t)if(a.crmId===U&&w.includes(a.stageId)){const t=a.chatId,r=t.includes("@lid"),o=r?t:t.split("@")[0],i=n[t];if(i){const n=i.name||(r?t.split("@")[0]:o);o&&e.push({phone:o,name:n})}else o&&e.push({phone:o,name:r?t.split("@")[0]:o})}const a=e.filter((e,t,n)=>t===n.findIndex(t=>t.phone===e.phone)),r=m.trim(),o=new Set(r.split("\n").map(e=>e.split(",")[0].trim()).filter(Boolean)),i=a.filter(e=>!o.has(e.phone)).map(e=>`${e.phone},${e.name}`).join("\n");i&&p(r?`${r}\n${i}`:i),Ka(!1),F(null),k([])},disabled:0===w.length},"Add Contacts")):a.createElement(a.Fragment,null,a.createElement("span",{className:"selector-count"},"Select a CRM to see stages"),a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>Ka(!1)},"Cancel"))))),$a&&a.createElement("div",{className:"selector-modal-overlay"},a.createElement("div",{className:"selector-modal"},a.createElement("div",{className:"selector-header"},a.createElement("h3",null,"Select Labels"),a.createElement("button",{className:"selector-close-btn",onClick:()=>Ya(!1)},"×")),!an&&_.length>0&&a.createElement("div",{className:"selector-select-all-row"},a.createElement("button",{className:"selector-select-all-btn "+(f.length===_.length&&_.length>0?"active":""),onClick:()=>{f.length===_.length&&_.length>0?v([]):v(_.map(e=>e.id))}},f.length===_.length&&_.length>0?"Deselect All":`Select All (${_.length})`)),a.createElement("div",{className:"selector-content"},an?a.createElement("div",{className:"selector-loading"},"Loading labels..."):0===_.length?a.createElement("div",{className:"selector-empty"},"No labels found"):a.createElement("div",{className:"selector-list"},_.map((e,t)=>a.createElement("label",{key:t,className:"selector-item"},a.createElement("input",{type:"checkbox",checked:(f||[]).includes(e.id),onChange:()=>{return t=e.id,void v(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]);var t}}),a.createElement("span",{className:"selector-item-color",style:{background:e.hexColor||"#ccc"}}),a.createElement("span",{className:"selector-item-name"},e.name||"Unnamed Label"))))),a.createElement("div",{className:"selector-footer"},a.createElement("span",{className:"selector-count"},f.length," etiquetas selecionadas"),a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>Ya(!1)},"Cancel"),a.createElement("button",{className:"selector-btn selector-btn-confirm",onClick:async()=>{const e=[];for(const t of f){const n=await Hr(t);for(const t of n){const n=t.phoneNumber||t.id?.user||"",a=t.name||t.displayName||n;n&&e.push({phone:n,name:a})}}const t=e.filter((e,t,n)=>t===n.findIndex(t=>t.phone===e.phone)),n=m.trim(),a=new Set(n.split("\n").map(e=>e.split(",")[0].trim()).filter(Boolean)),r=t.filter(e=>!a.has(e.phone)).map(e=>`${e.phone},${e.name}`).join("\n");r&&p(n?`${n}\n${r}`:r),Ya(!1)}},"Add Label Contacts")))),Me&&a.createElement("div",{className:"selector-modal-overlay"},a.createElement("div",{className:"selector-modal"},a.createElement("div",{className:"selector-header"},a.createElement("h3",null,"Select Groups to Add Contacts"),a.createElement("button",{className:"selector-close-btn",onClick:()=>Ie(!1)},"×")),a.createElement("div",{className:"selector-content"},an?a.createElement("div",{className:"selector-loading"},"Loading groups..."):0===A.length?a.createElement("div",{className:"selector-empty"},"No groups found where you are admin"):a.createElement("div",{className:"selector-list"},A.map((e,t)=>a.createElement("label",{key:t,className:"selector-item"},a.createElement("input",{type:"checkbox",checked:(Pe||[]).includes(e.id),onChange:()=>{Le(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}}),a.createElement("span",{className:"selector-item-name"},e.name||e.subject||"Unknown Group"),a.createElement("span",{className:"selector-item-count"},e.participantCount||0," members"))))),a.createElement("div",{className:"selector-footer"},a.createElement("span",{className:"selector-count"},Pe.length," grupos selecionados"),a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>Ie(!1)},"Cancel"),a.createElement("button",{className:"selector-btn selector-btn-confirm",onClick:()=>{const e=Pe.map(e=>{const t=A.find(t=>t.id===e);return{id:e,name:t?.name||t?.subject||"Unknown"}});De(e),Ie(!1)}},"Confirm Selection")))),Re&&a.createElement("div",{className:"selector-modal-overlay"},a.createElement("div",{className:"selector-modal"},a.createElement("div",{className:"selector-header"},a.createElement("h3",null,"Select Groups to Remove Contacts From"),a.createElement("button",{className:"selector-close-btn",onClick:()=>Be(!1)},"×")),a.createElement("div",{className:"selector-content"},an?a.createElement("div",{className:"selector-loading"},"Loading groups..."):0===A.length?a.createElement("div",{className:"selector-empty"},"No groups found where you are admin"):a.createElement("div",{className:"selector-list"},A.map((e,t)=>a.createElement("label",{key:t,className:"selector-item"},a.createElement("input",{type:"checkbox",checked:(Pe||[]).includes(e.id),onChange:()=>{Le(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}}),a.createElement("span",{className:"selector-item-name"},e.name||e.subject||"Unknown Group"),a.createElement("span",{className:"selector-item-count"},e.participantCount||0," members"))))),a.createElement("div",{className:"selector-footer"},a.createElement("span",{className:"selector-count"},Pe.length," grupos selecionados"),a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>Be(!1)},"Cancel"),a.createElement("button",{className:"selector-btn selector-btn-confirm",onClick:()=>{const e=Pe.map(e=>{const t=A.find(t=>t.id===e);return{id:e,name:t?.name||t?.subject||"Unknown"}});Ne(e),Be(!1)}},"Confirm Selection")))),Ve&&a.createElement("div",{className:"selector-modal-overlay"},a.createElement("div",{className:"selector-modal"},a.createElement("div",{className:"selector-header"},a.createElement("h3",null,"Select Tabs to Add Contacts"),a.createElement("button",{className:"selector-close-btn",onClick:()=>Ge(!1)},"×")),a.createElement("div",{className:"selector-content"},an?a.createElement("div",{className:"selector-loading"},"Loading tabs..."):0===M.length?a.createElement("div",{className:"selector-empty"},"No custom tabs found. Create tabs first."):a.createElement("div",{className:"selector-list"},M.map((e,t)=>a.createElement("label",{key:t,className:"selector-item"},a.createElement("input",{type:"checkbox",checked:(Ye||[]).includes(e.id),onChange:()=>{Xe(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}}),a.createElement("span",{className:"selector-item-name"},e.title||"Unnamed Tab"),a.createElement("span",{className:"selector-item-count"},e.chats?.length||0," chats"))))),a.createElement("div",{className:"selector-footer"},a.createElement("span",{className:"selector-count"},Ye.length," abas selecionadas"),a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>Ge(!1)},"Cancel"),a.createElement("button",{className:"selector-btn selector-btn-confirm",onClick:()=>{const e=Ye.map(e=>{const t=M.find(t=>t.id===e);return{id:e,title:t?.title||"Unknown"}});qe(e),Ge(!1)}},"Confirm Selection")))),Ke&&a.createElement("div",{className:"selector-modal-overlay"},a.createElement("div",{className:"selector-modal"},a.createElement("div",{className:"selector-header"},a.createElement("h3",null,"Select Tabs to Remove Contacts From"),a.createElement("button",{className:"selector-close-btn",onClick:()=>$e(!1)},"×")),a.createElement("div",{className:"selector-content"},an?a.createElement("div",{className:"selector-loading"},"Loading tabs..."):0===M.length?a.createElement("div",{className:"selector-empty"},"No custom tabs found. Create tabs first."):a.createElement("div",{className:"selector-list"},M.map((e,t)=>a.createElement("label",{key:t,className:"selector-item"},a.createElement("input",{type:"checkbox",checked:(Ye||[]).includes(e.id),onChange:()=>{Xe(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}}),a.createElement("span",{className:"selector-item-name"},e.title||"Unnamed Tab"),a.createElement("span",{className:"selector-item-count"},e.chats?.length||0," chats"))))),a.createElement("div",{className:"selector-footer"},a.createElement("span",{className:"selector-count"},Ye.length," abas selecionadas"),a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>$e(!1)},"Cancel"),a.createElement("button",{className:"selector-btn selector-btn-confirm",onClick:()=>{const e=Ye.map(e=>{const t=M.find(t=>t.id===e);return{id:e,title:t?.title||"Unknown"}});je(e),$e(!1)}},"Confirm Selection")))),ot&&a.createElement("div",{className:"selector-modal-overlay"},a.createElement("div",{className:"selector-modal"},a.createElement("div",{className:"selector-header"},a.createElement("h3",null,"Select Labels to Add Contacts"),a.createElement("button",{className:"selector-close-btn",onClick:()=>it(!1)},"×")),a.createElement("div",{className:"selector-content"},an?a.createElement("div",{className:"selector-loading"},"Loading labels..."):0===_.length?a.createElement("div",{className:"selector-empty"},"No labels found. Create labels in WhatsApp first."):a.createElement("div",{className:"selector-list"},_.map((e,t)=>a.createElement("label",{key:t,className:"selector-item"},a.createElement("input",{type:"checkbox",checked:(ct||[]).includes(e.id),onChange:()=>{dt(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}}),a.createElement("span",{className:"selector-item-color",style:{backgroundColor:e.hexColor||"#667781",width:12,height:12,borderRadius:"50%",marginRight:8}}),a.createElement("span",{className:"selector-item-name"},e.name||"Unnamed Label"))))),a.createElement("div",{className:"selector-footer"},a.createElement("span",{className:"selector-count"},ct.length," etiquetas selecionadas"),a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>it(!1)},"Cancel"),a.createElement("button",{className:"selector-btn selector-btn-confirm",onClick:()=>{const e=ct.map(e=>{const t=_.find(t=>t.id===e);return{id:e,name:t?.name||"Unknown"}});nt(e),it(!1)}},"Confirm Selection")))),st&&a.createElement("div",{className:"selector-modal-overlay"},a.createElement("div",{className:"selector-modal"},a.createElement("div",{className:"selector-header"},a.createElement("h3",null,"Select Labels to Remove Contacts From"),a.createElement("button",{className:"selector-close-btn",onClick:()=>lt(!1)},"×")),a.createElement("div",{className:"selector-content"},an?a.createElement("div",{className:"selector-loading"},"Loading labels..."):0===_.length?a.createElement("div",{className:"selector-empty"},"No labels found. Create labels in WhatsApp first."):a.createElement("div",{className:"selector-list"},_.map((e,t)=>a.createElement("label",{key:t,className:"selector-item"},a.createElement("input",{type:"checkbox",checked:(ct||[]).includes(e.id),onChange:()=>{dt(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])}}),a.createElement("span",{className:"selector-item-color",style:{backgroundColor:e.hexColor||"#667781",width:12,height:12,borderRadius:"50%",marginRight:8}}),a.createElement("span",{className:"selector-item-name"},e.name||"Unnamed Label"))))),a.createElement("div",{className:"selector-footer"},a.createElement("span",{className:"selector-count"},ct.length," etiquetas selecionadas"),a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>lt(!1)},"Cancel"),a.createElement("button",{className:"selector-btn selector-btn-confirm",onClick:()=>{const e=ct.map(e=>{const t=_.find(t=>t.id===e);return{id:e,name:t?.name||"Unknown"}});rt(e),lt(!1)}},"Confirm Selection")))),yt&&a.createElement("div",{className:"selector-modal-overlay"},a.createElement("div",{className:"selector-modal"},a.createElement("div",{className:"selector-header"},a.createElement("h3",null,Et?"Select Stage":"Select CRM"),a.createElement("button",{className:"selector-close-btn",onClick:()=>{xt(!1),St(null),Dt([])}},"×")),a.createElement("div",{className:"selector-content"},Et?0===At.length?a.createElement("div",{className:"selector-empty"},"No stages found in this CRM."):a.createElement("div",{className:"selector-list"},a.createElement("div",{className:"selector-item selector-item-back",onClick:()=>{St(null),Dt([])}},a.createElement("span",{className:"dropdown-arrow"},"←"),a.createElement("span",{className:"selector-item-name"},"Back to CRMs")),At.map((e,t)=>a.createElement("div",{key:t,className:"selector-item selector-item-clickable",onClick:()=>{const t=Mt.find(e=>e.id===Et);bt({crmId:Et,crmName:t?.name||"Unknown CRM",stageId:e.id,stageName:e.name||"Unknown Stage"}),xt(!1),St(null),Dt([])}},a.createElement("span",{className:"selector-item-color",style:{backgroundColor:e.color||"#667781",width:12,height:12,borderRadius:"50%",marginRight:8}}),a.createElement("span",{className:"selector-item-name"},e.name||"Unnamed Stage")))):0===Mt.length?a.createElement("div",{className:"selector-empty"},"No CRMs found. Create a CRM first."):a.createElement("div",{className:"selector-list"},Mt.map((e,t)=>a.createElement("div",{key:t,className:"selector-item selector-item-clickable",onClick:()=>{St(e.id);const t=z?.stages?.[e.id]||[];Dt(t)}},a.createElement("span",{className:"selector-item-name"},e.name||"Unnamed CRM"),a.createElement("span",{className:"dropdown-arrow"},"→"))))),a.createElement("div",{className:"selector-footer"},a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>{xt(!1),St(null),Dt([])}},"Cancel")))),wt&&a.createElement("div",{className:"selector-modal-overlay"},a.createElement("div",{className:"selector-modal"},a.createElement("div",{className:"selector-header"},a.createElement("h3",null,Ct?"Select Stage":"Select CRM"),a.createElement("button",{className:"selector-close-btn",onClick:()=>{kt(!1),Tt(null),Nt([])}},"×")),a.createElement("div",{className:"selector-content"},Ct?0===_t.length?a.createElement("div",{className:"selector-empty"},"No stages found in this CRM."):a.createElement("div",{className:"selector-list"},a.createElement("div",{className:"selector-item selector-item-back",onClick:()=>{Tt(null),Nt([])}},a.createElement("span",{className:"dropdown-arrow"},"←"),a.createElement("span",{className:"selector-item-name"},"Back to CRMs")),_t.map((e,t)=>a.createElement("div",{key:t,className:"selector-item selector-item-clickable",onClick:()=>{const t=Mt.find(e=>e.id===Ct);vt({crmId:Ct,crmName:t?.name||"Unknown CRM",stageId:e.id,stageName:e.name||"Unknown Stage"}),kt(!1),Tt(null),Nt([])}},a.createElement("span",{className:"selector-item-color",style:{backgroundColor:e.color||"#667781",width:12,height:12,borderRadius:"50%",marginRight:8}}),a.createElement("span",{className:"selector-item-name"},e.name||"Unnamed Stage")))):0===Mt.length?a.createElement("div",{className:"selector-empty"},"No CRMs found. Create a CRM first."):a.createElement("div",{className:"selector-list"},Mt.map((e,t)=>a.createElement("div",{key:t,className:"selector-item selector-item-clickable",onClick:()=>{Tt(e.id);const t=z?.stages?.[e.id]||[];Nt(t)}},a.createElement("span",{className:"selector-item-name"},e.name||"Unnamed CRM"),a.createElement("span",{className:"dropdown-arrow"},"→"))))),a.createElement("div",{className:"selector-footer"},a.createElement("button",{className:"selector-btn selector-btn-cancel",onClick:()=>{kt(!1),Tt(null),Nt([])}},"Cancel")))),a.createElement("style",null,'\n        /* ========== FULL SCREEN BROADCAST MODAL ========== */\n        .broadcast-modal-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.85) 100%);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 10000;\n          backdrop-filter: blur(4px);\n        }\n\n        .broadcast-modal {\n          background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);\n          border-radius: 20px;\n          width: 98%;\n          max-width: 1400px;\n          height: 95vh;\n          max-height: 95vh;\n          overflow: hidden;\n          display: flex;\n          flex-direction: row;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255,255,255,0.1);\n        }\n\n        /* ========== SIDEBAR ========== */\n        .broadcast-sidebar {\n          width: 220px;\n          min-width: 220px;\n          background: linear-gradient(180deg, var(--lion-sidebar-start) 0%, var(--lion-sidebar-end) 100%);\n          display: flex;\n          flex-direction: column;\n          border-radius: 20px 0 0 20px;\n        }\n\n        .broadcast-sidebar-header {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          padding: 20px;\n          border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n          color: #ffffff;\n          font-size: 16px;\n          font-weight: 700;\n        }\n\n        .broadcast-logo {\n          width: 28px;\n          height: 28px;\n          color: var(--lion-primary);\n        }\n\n        .broadcast-nav {\n          flex: 1;\n          padding: 16px 12px;\n          display: flex;\n          flex-direction: column;\n          gap: 8px;\n        }\n\n        .broadcast-nav-item {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          padding: 12px 16px;\n          border: none;\n          background: transparent;\n          color: #94a3b8;\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n          border-radius: 10px;\n          transition: all 0.2s;\n          text-align: left;\n        }\n\n        .broadcast-nav-item:hover {\n          background: rgba(255, 255, 255, 0.05);\n          color: #e2e8f0;\n        }\n\n        .broadcast-nav-item.active {\n          background: var(--lion-primary);\n          color: #ffffff;\n        }\n\n        /* Sending button - animated style */\n        .broadcast-nav-item.sending {\n          background: linear-gradient(135deg, #0ea5e9 0%, #6D28D9 100%);\n          color: #ffffff;\n          animation: sendingPulse 1.5s ease-in-out infinite;\n        }\n\n        .broadcast-nav-item.sending .sending-icon {\n          animation: sendingArrow 1s ease-in-out infinite;\n        }\n\n        @keyframes sendingPulse {\n          0%, 100% { opacity: 1; }\n          50% { opacity: 0.8; }\n        }\n\n        @keyframes sendingArrow {\n          0%, 100% { transform: translateX(0); }\n          50% { transform: translateX(3px); }\n        }\n\n        /* Completed state - green color, no animation */\n        .broadcast-nav-item.sending.completed {\n          background: var(--lion-primary);\n          animation: none;\n        }\n\n        /* Paused state - slower pulse animation */\n        .broadcast-nav-item.sending.paused {\n          animation: pausedPulse 2s ease-in-out infinite;\n        }\n\n        @keyframes pausedPulse {\n          0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }\n          50% { opacity: 0.9; box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }\n        }\n\n        .broadcast-nav-item svg {\n          flex-shrink: 0;\n        }\n\n        .broadcast-sidebar-footer {\n          padding: 16px;\n          border-top: 1px solid rgba(255, 255, 255, 0.1);\n        }\n\n        .broadcast-close-sidebar-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 8px;\n          width: 100%;\n          padding: 12px;\n          border: none;\n          background: rgba(239, 68, 68, 0.1);\n          color: #f87171;\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n          border-radius: 10px;\n          transition: all 0.2s;\n        }\n\n        .broadcast-close-sidebar-btn:hover {\n          background: rgba(239, 68, 68, 0.2);\n          color: #ef4444;\n        }\n\n        /* Nav badge for scheduled count */\n        .nav-badge {\n          background: var(--lion-primary);\n          color: white;\n          font-size: 11px;\n          font-weight: 600;\n          padding: 2px 6px;\n          border-radius: 10px;\n          margin-left: auto;\n        }\n\n        /* ========== SCHEDULED CAMPAIGNS VIEW ========== */\n        .scheduled-campaigns-container {\n          flex: 1;\n          display: flex;\n          flex-direction: column;\n          padding: 24px;\n          overflow-y: auto;\n        }\n\n        .scheduled-campaigns-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          margin-bottom: 20px;\n        }\n\n        .scheduled-campaigns-header h3 {\n          font-size: 18px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          margin: 0;\n        }\n\n        .refresh-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 36px;\n          height: 36px;\n          border: none;\n          background: var(--lion-bg-secondary);\n          border-radius: 8px;\n          cursor: pointer;\n          color: var(--lion-text-muted);\n          transition: all 0.2s;\n        }\n\n        .refresh-btn:hover {\n          background: var(--lion-primary-light);\n          color: var(--lion-primary);\n        }\n\n        .scheduled-empty-state {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          justify-content: center;\n          padding: 60px 20px;\n          text-align: center;\n        }\n\n        .scheduled-empty-state svg {\n          opacity: 0.5;\n          margin-bottom: 16px;\n        }\n\n        .scheduled-empty-state p {\n          font-size: 16px;\n          font-weight: 500;\n          color: var(--lion-text-primary);\n          margin: 0 0 8px 0;\n        }\n\n        .scheduled-empty-state span {\n          font-size: 14px;\n          color: var(--lion-text-muted);\n          margin-bottom: 24px;\n        }\n\n        .create-campaign-btn {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          padding: 12px 24px;\n          background: var(--lion-primary);\n          color: white;\n          border: none;\n          border-radius: 8px;\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .create-campaign-btn:hover {\n          background: var(--lion-primary-hover);\n        }\n\n        .scheduled-campaigns-list {\n          display: flex;\n          flex-direction: column;\n          gap: 12px;\n        }\n\n        .scheduled-campaign-item {\n          background: var(--lion-bg-secondary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 12px;\n          padding: 16px 20px;\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          transition: all 0.2s;\n        }\n\n        .scheduled-campaign-item:hover {\n          border-color: var(--lion-primary);\n          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);\n        }\n\n        .scheduled-campaign-item.paused {\n          opacity: 0.7;\n          border-left: 3px solid var(--lion-warning);\n        }\n\n        .scheduled-campaign-item.skipping {\n          border-left: 3px solid var(--lion-warning);\n        }\n\n        .campaign-info {\n          flex: 1;\n          min-width: 0;\n        }\n\n        .campaign-name {\n          font-size: 15px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          margin-bottom: 6px;\n          white-space: nowrap;\n          overflow: hidden;\n          text-overflow: ellipsis;\n        }\n\n        .campaign-meta {\n          display: flex;\n          flex-wrap: wrap;\n          gap: 8px;\n          align-items: center;\n          margin-bottom: 6px;\n        }\n\n        .schedule-badge {\n          background: var(--lion-primary-light);\n          color: var(--lion-primary);\n          padding: 3px 10px;\n          border-radius: 12px;\n          font-size: 12px;\n          font-weight: 500;\n        }\n\n        .status-badge {\n          padding: 3px 10px;\n          border-radius: 12px;\n          font-size: 12px;\n          font-weight: 500;\n        }\n\n        .status-badge.scheduled {\n          background: #dcfce7;\n          color: #16a34a;\n        }\n\n        .status-badge.paused {\n          background: #dbeafe;\n          color: #6D28D9;\n        }\n\n        .skip-badge {\n          background: #dbeafe;\n          color: #6D28D9;\n          padding: 3px 10px;\n          border-radius: 12px;\n          font-size: 11px;\n          font-weight: 500;\n        }\n\n        .contact-count {\n          display: flex;\n          align-items: center;\n          gap: 4px;\n          font-size: 12px;\n          color: var(--lion-text-muted);\n        }\n\n        .campaign-schedule-info {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          font-size: 13px;\n          color: var(--lion-text-secondary);\n        }\n\n        .campaign-schedule-info svg {\n          color: var(--lion-primary);\n        }\n\n        .campaign-history {\n          display: flex;\n          gap: 8px;\n          font-size: 12px;\n          color: var(--lion-text-muted);\n          margin-top: 6px;\n        }\n\n        .last-run, .total-runs {\n          display: flex;\n          align-items: center;\n          gap: 4px;\n        }\n\n        .campaign-actions {\n          display: flex;\n          gap: 6px;\n          margin-left: 16px;\n        }\n\n        .campaign-action-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 34px;\n          height: 34px;\n          border: none;\n          border-radius: 8px;\n          cursor: pointer;\n          background: transparent;\n          color: var(--lion-text-muted);\n          transition: all 0.2s;\n        }\n\n        .campaign-action-btn:hover {\n          background: var(--lion-bg-primary);\n        }\n\n        .campaign-action-btn.edit:hover {\n          color: var(--lion-primary);\n        }\n\n        .campaign-action-btn.run:hover {\n          color: var(--lion-success);\n        }\n\n        .campaign-action-btn.pause:hover {\n          color: var(--lion-warning);\n        }\n\n        .campaign-action-btn.skip:hover {\n          color: var(--lion-warning);\n        }\n\n        .campaign-action-btn.skip.skipped {\n          color: var(--lion-warning);\n          background: rgba(245, 158, 11, 0.1);\n        }\n\n        .campaign-action-btn.delete:hover {\n          color: var(--lion-error);\n        }\n\n        /* Dark mode for scheduled view */\n        .broadcast-modal-overlay.lion-dark .scheduled-campaigns-container {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .scheduled-campaign-item {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .scheduled-campaign-item:hover {\n          border-color: var(--lion-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .campaign-action-btn:hover {\n          background: rgba(255, 255, 255, 0.05);\n        }\n\n        .broadcast-modal-overlay.lion-dark .status-badge.scheduled {\n          background: rgba(22, 163, 74, 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .status-badge.paused {\n          background: rgba(217, 119, 6, 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .skip-badge {\n          background: rgba(217, 119, 6, 0.2);\n        }\n\n        /* ========== MAIN CONTENT ========== */\n        .broadcast-main {\n          flex: 1;\n          display: flex;\n          flex-direction: column;\n          overflow: hidden;\n        }\n\n        /* ========== HEADER ========== */\n        .broadcast-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 20px 32px;\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        .broadcast-header-content {\n          display: flex;\n          flex-direction: column;\n          gap: 4px;\n        }\n\n        .broadcast-title {\n          margin: 0;\n          font-size: 20px;\n          font-weight: 700;\n        }\n\n        .broadcast-subtitle {\n          margin: 0;\n          font-size: 13px;\n          opacity: 0.9;\n        }\n\n        .broadcast-header-close-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 40px;\n          height: 40px;\n          border: none;\n          background: rgba(255, 255, 255, 0.15);\n          color: white;\n          border-radius: 10px;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .broadcast-header-close-btn:hover {\n          background: rgba(255, 255, 255, 0.25);\n          transform: scale(1.05);\n        }\n\n        /* ========== CARD STYLES ========== */\n        .broadcast-card {\n          background: #ffffff;\n          border-radius: 14px;\n          border: 1px solid #e2e8f0;\n          overflow: hidden;\n        }\n\n        .broadcast-card-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 16px 20px;\n          background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);\n          border-bottom: 1px solid #e2e8f0;\n        }\n\n        .broadcast-card-header h3 {\n          margin: 0;\n          font-size: 15px;\n          font-weight: 700;\n          color: var(--lion-sidebar-start);\n        }\n\n        .broadcast-badge {\n          background: var(--lion-primary);\n          color: white;\n          padding: 4px 12px;\n          border-radius: 20px;\n          font-size: 12px;\n          font-weight: 600;\n        }\n\n        .broadcast-mode-btn {\n          flex: 1;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 8px;\n          padding: 12px 16px;\n          border: none;\n          background: transparent;\n          color: #64748b;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          border-radius: 8px;\n          transition: all 0.2s;\n        }\n\n        .broadcast-mode-btn:hover {\n          background: rgba(34, 197, 94, 0.1);\n          color: var(--lion-primary);\n        }\n\n        .broadcast-mode-btn.active {\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        .broadcast-header-left {\n          display: flex;\n          align-items: center;\n          gap: 14px;\n          font-size: 22px;\n          font-weight: 700;\n          color: #ffffff;\n          text-shadow: 0 1px 2px rgba(0,0,0,0.1);\n        }\n\n        .broadcast-icon {\n          width: 32px;\n          height: 32px;\n          color: #ffffff;\n          filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));\n        }\n\n        .broadcast-header-right {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n        }\n\n        .broadcast-reports-btn {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          background: rgba(255, 255, 255, 0.2);\n          border: none;\n          cursor: pointer;\n          padding: 10px 16px;\n          border-radius: 10px;\n          color: #ffffff;\n          font-size: 14px;\n          font-weight: 600;\n          transition: all 0.2s ease;\n        }\n\n        .broadcast-reports-btn:hover {\n          background: rgba(255, 255, 255, 0.3);\n          transform: scale(1.02);\n        }\n\n        .broadcast-close-btn {\n          background: rgba(255, 255, 255, 0.15);\n          border: none;\n          cursor: pointer;\n          padding: 10px;\n          border-radius: 10px;\n          color: #ffffff;\n          transition: all 0.2s ease;\n        }\n\n        .broadcast-close-btn:hover {\n          background: rgba(255, 255, 255, 0.25);\n          transform: scale(1.05);\n        }\n\n        .broadcast-close-btn svg {\n          width: 24px;\n          height: 24px;\n        }\n\n        /* ========== CONTENT AREA ========== */\n        .broadcast-content {\n          display: flex;\n          flex: 1;\n          overflow: hidden;\n        }\n\n        .broadcast-left-panel {\n          width: 40%;\n          padding: 28px;\n          border-right: 1px solid #e2e8f0;\n          overflow-y: auto;\n          background: #ffffff;\n        }\n\n        .broadcast-right-panel {\n          width: 60%;\n          padding: 28px;\n          overflow-y: auto;\n          background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);\n        }\n\n        .broadcast-section-title {\n          font-size: 16px;\n          font-weight: 700;\n          color: var(--lion-sidebar-start);\n          margin-bottom: 20px;\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .broadcast-section-title::before {\n          content: \'\';\n          width: 4px;\n          height: 20px;\n          background: var(--lion-primary);\n          border-radius: 2px;\n        }\n\n        /* ========== MODE SELECTION (One to One / Groups) ========== */\n        .broadcast-mode-selection {\n          display: flex;\n          gap: 12px;\n          margin-bottom: 24px;\n          padding: 6px;\n          background: #f1f5f9;\n          border-radius: 12px;\n        }\n\n        .broadcast-radio {\n          flex: 1;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 10px;\n          cursor: pointer;\n          font-size: 14px;\n          font-weight: 600;\n          color: #64748b;\n          padding: 14px 20px;\n          border-radius: 10px;\n          transition: all 0.25s ease;\n          background: transparent;\n        }\n\n        .broadcast-radio:has(input:checked) {\n          background: #ffffff;\n          color: var(--lion-primary);\n          box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15), 0 1px 3px rgba(0,0,0,0.08);\n        }\n\n        .broadcast-radio input[type="radio"] {\n          display: none;\n        }\n\n        .broadcast-radio span::before {\n          content: \'\';\n          display: inline-block;\n          width: 18px;\n          height: 18px;\n          border: 2px solid #cbd5e1;\n          border-radius: 50%;\n          margin-right: 8px;\n          vertical-align: middle;\n          transition: all 0.2s;\n        }\n\n        .broadcast-radio:has(input:checked) span::before {\n          border-color: var(--lion-primary);\n          background: var(--lion-primary);\n          box-shadow: inset 0 0 0 3px #fff;\n        }\n\n        .broadcast-checkbox {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          margin-bottom: 14px;\n          cursor: pointer;\n          font-size: 14px;\n          color: #475569;\n          padding: 12px 16px;\n          background: #f8fafc;\n          border-radius: 10px;\n          border: 1px solid #e2e8f0;\n          transition: all 0.2s;\n        }\n\n        .broadcast-checkbox:hover {\n          border-color: var(--lion-primary);\n          background: #f0fdf4;\n        }\n\n        .broadcast-checkbox input[type="checkbox"] {\n          width: 20px;\n          height: 20px;\n          cursor: pointer;\n          accent-color: var(--lion-primary);\n          border-radius: 6px;\n        }\n\n        /* ========== GROUPS MODE STYLES ========== */\n        .broadcast-groups-section {\n          margin-bottom: 20px;\n        }\n\n        .selected-groups-list {\n          min-height: 200px;\n          max-height: 350px;\n          overflow-y: auto;\n          border: 2px solid #e2e8f0;\n          border-radius: 14px;\n          padding: 16px;\n          margin-bottom: 16px;\n          background: #ffffff;\n        }\n\n        .no-groups-message {\n          color: #94a3b8;\n          text-align: center;\n          padding: 60px 24px;\n          font-size: 15px;\n        }\n\n        .no-groups-message::before {\n          content: \'👥\';\n          display: block;\n          font-size: 40px;\n          margin-bottom: 12px;\n          opacity: 0.5;\n        }\n\n        .selected-group-item {\n          display: flex;\n          align-items: center;\n          gap: 14px;\n          padding: 14px 18px;\n          background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);\n          border-radius: 12px;\n          margin-bottom: 10px;\n          border: 1px solid #e2e8f0;\n          transition: all 0.2s;\n        }\n\n        .selected-group-item:hover {\n          border-color: var(--lion-primary);\n          box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1);\n        }\n\n        .selected-group-item:last-child {\n          margin-bottom: 0;\n        }\n\n        .group-icon {\n          font-size: 20px;\n          width: 40px;\n          height: 40px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          background: var(--lion-primary);\n          border-radius: 10px;\n          color: white;\n        }\n\n        .group-name {\n          flex: 1;\n          font-size: 15px;\n          color: var(--lion-sidebar-start);\n          font-weight: 600;\n        }\n\n        .remove-group-btn {\n          background: #fee2e2;\n          border: none;\n          color: #ef4444;\n          font-size: 16px;\n          cursor: pointer;\n          padding: 8px 12px;\n          border-radius: 8px;\n          line-height: 1;\n          transition: color 0.2s;\n        }\n\n        .remove-group-btn:hover {\n          background: #ef4444;\n          color: #ffffff;\n        }\n\n        .groups-count-info {\n          font-size: 14px;\n          color: var(--lion-primary-hover);\n          font-weight: 600;\n          text-align: center;\n          padding: 12px 16px;\n          background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);\n          border-radius: 10px;\n          border: 1px solid #a7f3d0;\n        }\n\n        /* ========== PAUSE SETTINGS ========== */\n        .pause-settings-config {\n          background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);\n          border: 1px solid #e2e8f0;\n          border-radius: 12px;\n          padding: 16px 20px;\n          margin-top: 12px;\n          margin-bottom: 16px;\n        }\n\n        .pause-setting-row {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          margin-bottom: 12px;\n        }\n\n        .pause-setting-row:last-child {\n          margin-bottom: 0;\n        }\n\n        .pause-setting-label {\n          font-size: 14px;\n          color: #475569;\n          font-weight: 500;\n          min-width: 180px;\n        }\n\n        .pause-setting-input {\n          width: 80px;\n          padding: 10px 14px;\n          border: 2px solid #e2e8f0;\n          border-radius: 8px;\n          font-size: 15px;\n          font-weight: 600;\n          text-align: center;\n          background: #ffffff;\n          transition: all 0.2s;\n        }\n\n        .pause-setting-input:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);\n        }\n\n        .pause-setting-unit {\n          font-size: 13px;\n          color: #64748b;\n          font-weight: 500;\n        }\n\n        /* ========== PHONE INPUT ========== */\n        .broadcast-phone-input {\n          width: 100%;\n          padding: 18px 20px;\n          border: 2px solid #e2e8f0;\n          border-radius: 14px;\n          font-size: 14px;\n          resize: vertical;\n          margin-bottom: 20px;\n          font-family: \'Segoe UI\', system-ui, sans-serif;\n          min-height: 200px;\n          background: #ffffff;\n          transition: all 0.25s ease;\n          line-height: 1.6;\n        }\n\n        .broadcast-phone-input::placeholder {\n          color: #94a3b8;\n        }\n\n        .broadcast-phone-input:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);\n        }\n\n        /* ========== BUTTONS ========== */\n        .broadcast-contact-buttons {\n          display: flex;\n          gap: 10px;\n          margin-bottom: 24px;\n          flex-wrap: wrap;\n        }\n\n        .broadcast-btn {\n          padding: 10px 16px;\n          border-radius: 10px;\n          font-size: 13px;\n          font-weight: 600;\n          cursor: pointer;\n          border: none;\n          transition: all 0.25s ease;\n          display: flex;\n          align-items: center;\n          gap: 6px;\n        }\n\n        .broadcast-btn-upload {\n          background: var(--lion-primary);\n          color: white;\n          box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);\n        }\n\n        .broadcast-btn-upload:hover {\n          transform: translateY(-1px);\n          box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);\n        }\n\n        .broadcast-btn-select {\n          background: var(--lion-primary);\n          color: white;\n          box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);\n        }\n\n        .broadcast-btn-select:hover {\n          transform: translateY(-1px);\n          box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);\n        }\n\n        .broadcast-btn-download {\n          background: var(--lion-primary);\n          color: white;\n          box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 5px;\n          padding: 10px 14px;\n          min-width: auto;\n        }\n\n        .broadcast-btn-download:hover {\n          transform: translateY(-1px);\n          box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);\n        }\n\n        .broadcast-btn-download svg {\n          flex-shrink: 0;\n          width: 14px;\n          height: 14px;\n        }\n\n        .broadcast-btn-add {\n          background: var(--lion-primary);\n          color: white;\n          margin-bottom: 20px;\n          box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);\n        }\n\n        .broadcast-btn-add:hover {\n          transform: translateY(-2px);\n          box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);\n        }\n\n        .dropdown-arrow {\n          font-size: 10px;\n          opacity: 0.8;\n        }\n\n        .broadcast-source-options {\n          margin-bottom: 24px;\n          padding: 20px;\n          background: #ffffff;\n          border-radius: 14px;\n          border: 1px solid #e2e8f0;\n        }\n\n        /* ========== TOGGLE OPTIONS ========== */\n        .broadcast-toggle-options {\n          display: flex;\n          flex-direction: column;\n          gap: 12px;\n          padding: 20px;\n          background: #ffffff;\n          border-radius: 14px;\n          border: 1px solid #e2e8f0;\n          margin-bottom: 20px;\n        }\n\n        .broadcast-toggle {\n          display: flex;\n          align-items: center;\n          gap: 14px;\n          font-size: 14px;\n          color: #475569;\n          cursor: pointer;\n          padding: 10px 14px;\n          border-radius: 10px;\n          transition: background 0.2s;\n        }\n\n        .broadcast-toggle:hover {\n          background: #f8fafc;\n        }\n\n        .broadcast-toggle input {\n          display: none;\n        }\n\n        .toggle-slider {\n          width: 48px;\n          height: 26px;\n          background: #cbd5e1;\n          border-radius: 13px;\n          position: relative;\n          transition: background 0.25s ease;\n          flex-shrink: 0;\n        }\n\n        .toggle-slider::after {\n          content: \'\';\n          position: absolute;\n          width: 22px;\n          height: 22px;\n          background: white;\n          border-radius: 50%;\n          top: 2px;\n          left: 2px;\n          transition: transform 0.25s ease;\n          box-shadow: 0 2px 4px rgba(0,0,0,0.15);\n        }\n\n        .broadcast-toggle input:checked + .toggle-slider {\n          background: var(--lion-primary);\n        }\n\n        .broadcast-toggle input:checked + .toggle-slider::after {\n          transform: translateX(22px);\n        }\n\n        /* ========== SKIP BULK MESSAGE ========== */\n        .skip-bulk-message-toggle {\n          margin-top: 12px;\n          border-top: 1px dashed #e5e7eb;\n          padding-top: 12px;\n        }\n\n        .skip-bulk-message-info {\n          display: flex;\n          align-items: flex-start;\n          gap: 8px;\n          margin-left: 62px;\n          margin-top: 8px;\n          padding: 10px 14px;\n          background: linear-gradient(135deg, #dbeafe 0%, #dbeafe 100%);\n          border-radius: 10px;\n          border: 1px solid #60a5fa;\n          font-size: 12px;\n          color: #1e3a8a;\n          line-height: 1.5;\n        }\n\n        .skip-bulk-message-info .info-icon {\n          font-size: 14px;\n          flex-shrink: 0;\n        }\n\n        /* ========== SIGNATURE TOGGLE ========== */\n        .signature-toggle {\n          margin-top: 8px;\n        }\n\n        .signature-preview {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          margin-left: 62px;\n          margin-top: 8px;\n          padding: 10px 14px;\n          background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);\n          border-radius: 10px;\n          border: 1px solid #86efac;\n          font-size: 12px;\n          color: #166534;\n        }\n\n        .signature-preview .signature-label {\n          font-weight: 500;\n          color: #15803d;\n        }\n\n        .signature-preview .signature-text {\n          font-family: monospace;\n          background: rgba(255, 255, 255, 0.7);\n          padding: 4px 8px;\n          border-radius: 4px;\n          max-width: 200px;\n          overflow: hidden;\n          text-overflow: ellipsis;\n          white-space: nowrap;\n        }\n\n        /* ========== GROUP ACTIONS PANEL ========== */\n        .group-actions-panel {\n          margin-left: 62px;\n          padding: 16px;\n          background: linear-gradient(135deg, #f8fafc 0%, #f8fafc 100%);\n          border-radius: 12px;\n          border: 1px solid #bfdbfe;\n          margin-top: 8px;\n          margin-bottom: 8px;\n        }\n\n        .group-actions-note {\n          font-size: 12px;\n          color: #6D28D9;\n          margin: 0 0 14px 0;\n          padding: 8px 12px;\n          background: #dbeafe;\n          border-radius: 8px;\n          border-left: 3px solid var(--lion-primary-hover);\n        }\n\n        .group-action-checkbox {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          font-size: 14px;\n          color: #374151;\n          cursor: pointer;\n          padding: 8px 0;\n        }\n\n        .group-action-checkbox input {\n          width: 18px;\n          height: 18px;\n          accent-color: var(--lion-primary-hover);\n          cursor: pointer;\n        }\n\n        .group-action-selector {\n          margin-left: 28px;\n          margin-top: 8px;\n          margin-bottom: 12px;\n        }\n\n        .group-select-dropdown {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 10px 14px;\n          background: #ffffff;\n          border: 1px solid #d1d5db;\n          border-radius: 8px;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .group-select-dropdown:hover {\n          border-color: var(--lion-primary-hover);\n          box-shadow: 0 0 0 3px rgba(6, 78, 168, 0.1);\n        }\n\n        .group-select-placeholder {\n          font-size: 13px;\n          color: #6b7280;\n        }\n\n        .selected-groups-chips {\n          display: flex;\n          flex-wrap: wrap;\n          gap: 6px;\n          margin-top: 10px;\n        }\n\n        .group-chip {\n          display: inline-flex;\n          align-items: center;\n          gap: 6px;\n          padding: 4px 10px;\n          background: var(--lion-primary-light, #eff6ff);\n          border: 1px solid var(--lion-primary, #bfdbfe);\n          border-radius: 20px;\n          font-size: 12px;\n          color: var(--lion-primary-dark, #6D28D9);\n        }\n\n        .chip-remove {\n          background: none;\n          border: none;\n          color: #dc2626;\n          cursor: pointer;\n          font-size: 14px;\n          font-weight: bold;\n          padding: 0;\n          line-height: 1;\n        }\n\n        .chip-remove:hover {\n          color: #b91c1c;\n        }\n\n        /* ========== RIGHT PANEL - MESSAGE SECTION ========== */\n        .broadcast-messages-container {\n          display: flex;\n          flex-direction: column;\n          gap: 16px;\n          margin-bottom: 24px;\n        }\n\n        .broadcast-message-box {\n          background: #ffffff;\n          border: 2px solid #e2e8f0;\n          border-radius: 14px;\n          overflow: hidden;\n          transition: all 0.25s ease;\n        }\n\n        .broadcast-message-box:hover {\n          border-color: #cbd5e1;\n        }\n\n        .broadcast-message-box.active {\n          border-color: var(--lion-primary);\n          box-shadow: 0 4px 16px rgba(34, 197, 94, 0.12);\n        }\n\n        .message-box-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 14px 18px;\n          background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);\n          border-bottom: 1px solid #e2e8f0;\n          cursor: pointer;\n          transition: background 0.2s;\n        }\n\n        .message-box-header:hover {\n          background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);\n        }\n\n        .broadcast-message-box.active .message-box-header {\n          background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);\n          border-bottom-color: #86efac;\n        }\n\n        .message-box-toggle {\n          font-size: 14px;\n          font-weight: 700;\n          color: #475569;\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .broadcast-message-box.active .message-box-toggle {\n          color: var(--lion-primary);\n        }\n\n        .message-box-actions {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .message-action-btn {\n          width: 32px;\n          height: 32px;\n          border: none;\n          background: #ffffff;\n          border-radius: 8px;\n          font-size: 14px;\n          cursor: pointer;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.2s;\n          color: #64748b;\n          border: 1px solid #e2e8f0;\n        }\n\n        .message-action-btn:hover {\n          background: #f1f5f9;\n          color: var(--lion-sidebar-start);\n          border-color: #cbd5e1;\n        }\n\n        .message-delete-btn:hover {\n          background: #fee2e2;\n          color: #dc2626;\n          border-color: #fecaca;\n        }\n\n        .message-box-content {\n          padding: 18px;\n        }\n\n        /* Attachment Section Styling */\n        .broadcast-attachment-section {\n          margin-top: 16px;\n          padding: 16px;\n          background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);\n          border-radius: 12px;\n          border: 1px solid #e2e8f0;\n        }\n\n        .broadcast-attachment-section .wa-attachment-uploader {\n          background: #ffffff;\n          border-radius: 10px;\n        }\n\n        .broadcast-attachment-section .wa-form-group {\n          margin-bottom: 16px;\n        }\n\n        .broadcast-attachment-section .wa-form-label {\n          font-size: 13px;\n          font-weight: 600;\n          color: #475569;\n          margin-bottom: 8px;\n          display: block;\n        }\n\n        .broadcast-attachment-section .wa-form-input,\n        .broadcast-attachment-section .wa-form-textarea {\n          width: 100%;\n          padding: 10px 12px;\n          border: 1px solid #e2e8f0;\n          border-radius: 8px;\n          font-size: 14px;\n          transition: all 0.2s;\n        }\n\n        .broadcast-attachment-section .wa-form-input:focus,\n        .broadcast-attachment-section .wa-form-textarea:focus {\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);\n          outline: none;\n        }\n\n        .broadcast-message-tab {\n          background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);\n          padding: 14px 22px;\n          border-radius: 12px;\n          font-size: 14px;\n          font-weight: 700;\n          color: #475569;\n          display: inline-flex;\n          align-items: center;\n          gap: 8px;\n          cursor: pointer;\n          border: 2px solid transparent;\n          transition: all 0.2s;\n        }\n\n        .broadcast-message-tab:hover {\n          border-color: var(--lion-primary);\n          background: #f0fdf4;\n          color: var(--lion-primary);\n        }\n\n        .broadcast-template-type {\n          display: flex;\n          align-items: center;\n          gap: 16px;\n          margin-bottom: 20px;\n          padding: 16px 20px;\n          background: #ffffff;\n          border-radius: 14px;\n          border: 1px solid #e2e8f0;\n        }\n\n        .broadcast-template-type label {\n          font-size: 14px;\n          font-weight: 700;\n          color: var(--lion-sidebar-start);\n        }\n\n        .broadcast-template-type select {\n          flex: 1;\n          padding: 12px 16px;\n          border: 2px solid #e2e8f0;\n          border-radius: 10px;\n          font-size: 14px;\n          background: #f8fafc;\n          cursor: pointer;\n          font-weight: 500;\n          color: #475569;\n          transition: all 0.2s;\n        }\n\n        .broadcast-template-type select:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n          background: #ffffff;\n        }\n\n        .broadcast-message-textarea {\n          width: 100%;\n          padding: 20px;\n          border: 2px solid #e2e8f0;\n          border-radius: 14px;\n          font-size: 15px;\n          resize: vertical;\n          font-family: \'Segoe UI\', system-ui, sans-serif;\n          margin-bottom: 16px;\n          background: #ffffff;\n          min-height: 220px;\n          transition: all 0.25s ease;\n          line-height: 1.7;\n        }\n\n        .broadcast-message-textarea::placeholder {\n          color: #94a3b8;\n        }\n\n        .broadcast-message-textarea:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);\n        }\n\n        .broadcast-message-toolbar {\n          display: flex;\n          gap: 10px;\n          flex-wrap: wrap;\n          margin-bottom: 24px;\n          padding: 16px;\n          background: #ffffff;\n          border-radius: 14px;\n          border: 1px solid #e2e8f0;\n          align-items: center;\n        }\n\n        .toolbar-btn {\n          padding: 10px 16px;\n          background: #f8fafc;\n          border: 2px solid #e2e8f0;\n          border-radius: 10px;\n          cursor: pointer;\n          font-size: 14px;\n          font-weight: 600;\n          transition: all 0.2s;\n          color: #475569;\n        }\n\n        .toolbar-btn:hover {\n          background: #f0fdf4;\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n          transform: translateY(-1px);\n        }\n\n        .toolbar-btn-italic {\n          font-style: italic;\n        }\n\n        .toolbar-btn-templates {\n          margin-left: auto;\n          background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);\n          border-color: var(--lion-primary);\n          color: var(--lion-primary-hover);\n        }\n\n        .toolbar-btn-templates:hover {\n          background: var(--lion-primary);\n          color: white;\n          border-color: var(--lion-primary-hover);\n        }\n\n        .variable-dropdown-wrapper {\n          position: relative;\n        }\n\n        .variable-dropdown {\n          position: relative;\n          background: white;\n          border: 1px solid #e5e7eb;\n          border-radius: 8px;\n          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n          z-index: 99999;\n          min-width: 220px;\n          max-height: 180px;\n          overflow-y: scroll;\n        }\n\n        .variable-dropdown::-webkit-scrollbar {\n          width: 6px;\n        }\n\n        .variable-dropdown::-webkit-scrollbar-track {\n          background: #f1f1f1;\n          border-radius: 3px;\n        }\n\n        .variable-dropdown::-webkit-scrollbar-thumb {\n          background: #c1c1c1;\n          border-radius: 3px;\n        }\n\n        .variable-dropdown::-webkit-scrollbar-thumb:hover {\n          background: #a1a1a1;\n        }\n\n        .variable-option {\n          padding: 10px 14px;\n          cursor: pointer;\n          font-size: 13px;\n          color: #374151;\n          border-bottom: 1px solid #f3f4f6;\n          transition: background 0.2s;\n        }\n\n        .variable-option:hover {\n          background: #f0fdf4;\n          color: var(--lion-primary);\n        }\n\n        .variable-option:last-child {\n          border-bottom: none;\n        }\n\n        .variable-hint {\n          padding: 12px 14px;\n          font-size: 12px;\n          color: #9ca3af;\n          text-align: center;\n          border-top: 1px solid #f3f4f6;\n        }\n\n        .broadcast-template-selector {\n          background: white;\n          border: 2px solid #e5e7eb;\n          border-radius: 10px;\n          max-height: 250px;\n          overflow-y: auto;\n          margin-bottom: 16px;\n          box-shadow: 0 4px 12px rgba(0,0,0,0.1);\n        }\n\n        .template-option {\n          padding: 12px 16px;\n          border-bottom: 1px solid #f3f4f6;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .template-option:hover {\n          background: #f0fdf4;\n          border-left: 3px solid var(--lion-primary);\n          padding-left: 13px;\n        }\n\n        .template-option:last-child {\n          border-bottom: none;\n        }\n\n        .template-option-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          margin-bottom: 4px;\n        }\n\n        .template-name {\n          font-weight: 600;\n          color: #1f2937;\n          font-size: 14px;\n        }\n\n        .template-type-badge {\n          font-size: 16px;\n          opacity: 0.9;\n        }\n\n        .template-preview {\n          font-size: 12px;\n          color: #6b7280;\n          line-height: 1.4;\n          display: block;\n        }\n\n        .no-templates {\n          padding: 24px;\n          text-align: center;\n          color: #9ca3af;\n          font-size: 14px;\n        }\n\n        /* ========== DELAY CONFIG SECTION ========== */\n        .broadcast-delay-config {\n          margin-bottom: 24px;\n          padding: 20px 24px;\n          background: #ffffff;\n          border-radius: 14px;\n          border: 1px solid #e2e8f0;\n          box-shadow: 0 1px 3px rgba(0,0,0,0.04);\n        }\n\n        .broadcast-delay-config > label {\n          font-size: 15px;\n          font-weight: 700;\n          display: block;\n          margin-bottom: 16px;\n          color: var(--lion-sidebar-start);\n        }\n\n        .delay-inputs {\n          display: flex;\n          gap: 32px;\n          flex-wrap: wrap;\n        }\n\n        .delay-input-group {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          flex: 1;\n          min-width: 200px;\n        }\n\n        .delay-input-group label {\n          font-size: 13px;\n          color: #64748b;\n          font-weight: 500;\n          white-space: nowrap;\n        }\n\n        .delay-input-group input {\n          width: 70px;\n          padding: 10px 12px;\n          border: 1px solid #e2e8f0;\n          border-radius: 8px;\n          font-size: 15px;\n          text-align: center;\n          font-weight: 600;\n          background: #f8fafc;\n          transition: all 0.2s;\n        }\n\n        .delay-input-group input:focus {\n          outline: none;\n          border-color: #00a884;\n          background: #ffffff;\n          box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.1);\n        }\n\n        .delay-unit {\n          font-size: 13px;\n          color: #94a3b8;\n          font-weight: 500;\n        }\n\n        .delay-hint {\n          margin-top: 12px;\n          font-size: 12px;\n          color: #64748b;\n          padding: 8px 12px;\n          background: #f1f5f9;\n          border-radius: 6px;\n          margin-bottom: 0;\n        }\n\n        /* ========== ACTION BUTTONS ========== */\n        .broadcast-actions {\n          display: flex;\n          gap: 16px;\n          justify-content: flex-end;\n          padding: 24px 0;\n          border-top: 2px solid #e2e8f0;\n          margin-top: 24px;\n        }\n\n        .broadcast-btn-quick-start {\n          background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);\n          color: #475569;\n          border: 2px solid #e2e8f0;\n          padding: 14px 28px;\n          font-size: 15px;\n          font-weight: 600;\n          border-radius: 12px;\n          cursor: pointer;\n          transition: all 0.25s ease;\n          box-shadow: 0 2px 4px rgba(0,0,0,0.04);\n        }\n\n        .broadcast-btn-quick-start:hover {\n          background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);\n          border-color: #cbd5e1;\n          transform: translateY(-2px);\n          box-shadow: 0 4px 12px rgba(0,0,0,0.08);\n        }\n\n        .broadcast-btn-preview {\n          background: var(--lion-primary);\n          color: white;\n          padding: 14px 32px;\n          font-size: 15px;\n          font-weight: 600;\n          border: none;\n          border-radius: 12px;\n          cursor: pointer;\n          transition: all 0.25s ease;\n          box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);\n        }\n\n        .broadcast-btn-preview:hover {\n          transform: translateY(-2px);\n          box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);\n        }\n\n        .broadcast-btn-quick-start:disabled,\n        .broadcast-btn-preview:disabled {\n          opacity: 0.5;\n          cursor: not-allowed;\n          transform: none;\n          box-shadow: none;\n        }\n\n        /* ========== PROGRESS SECTION ========== */\n        .broadcast-progress {\n          margin-top: 24px;\n          padding: 24px;\n          background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);\n          border-radius: 16px;\n          border: 2px solid #e2e8f0;\n          box-shadow: 0 4px 16px rgba(0,0,0,0.06);\n        }\n\n        .progress-bar {\n          width: 100%;\n          height: 12px;\n          background: #e2e8f0;\n          border-radius: 6px;\n          overflow: hidden;\n          margin-bottom: 16px;\n          box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);\n        }\n\n        .progress-fill {\n          height: 100%;\n          background: linear-gradient(90deg, var(--lion-primary) 0%, #4ade80 50%, var(--lion-primary) 100%);\n          background-size: 200% 100%;\n          animation: progressShimmer 2s ease-in-out infinite;\n          transition: width 0.3s ease;\n          border-radius: 6px;\n        }\n\n        @keyframes progressShimmer {\n          0% { background-position: 100% 0; }\n          100% { background-position: -100% 0; }\n        }\n\n        .progress-text {\n          font-size: 15px;\n          color: #64748b;\n          margin-bottom: 16px;\n          font-weight: 500;\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n        }\n\n        .progress-text strong {\n          color: var(--lion-primary);\n          font-weight: 700;\n        }\n\n        .broadcast-btn-pause {\n          background: var(--lion-primary);\n          color: white;\n          width: 100%;\n          padding: 14px 24px;\n          font-size: 15px;\n          font-weight: 600;\n          border: none;\n          border-radius: 12px;\n          cursor: pointer;\n          transition: all 0.25s ease;\n          box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);\n        }\n\n        .broadcast-btn-pause:hover {\n          transform: translateY(-2px);\n          box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);\n        }\n\n        .broadcast-progress-buttons {\n          display: flex;\n          gap: 12px;\n          margin-top: 8px;\n        }\n\n        .broadcast-progress-buttons .broadcast-btn-pause,\n        .broadcast-progress-buttons .broadcast-btn-stop {\n          flex: 1;\n          width: auto;\n        }\n\n        .broadcast-btn-stop {\n          background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);\n          color: white;\n          padding: 14px 24px;\n          font-size: 15px;\n          font-weight: 600;\n          border: none;\n          border-radius: 12px;\n          cursor: pointer;\n          transition: all 0.25s ease;\n          box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);\n        }\n\n        .broadcast-btn-stop:hover {\n          transform: translateY(-2px);\n          box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);\n        }\n\n        /* ========== SCHEDULE SECTION ========== */\n        .broadcast-btn-schedule {\n          background: linear-gradient(135deg, #3b82f6 0%, #7C3AED 100%);\n          color: white;\n          padding: 14px 28px;\n          font-size: 15px;\n          font-weight: 600;\n          border: none;\n          border-radius: 12px;\n          cursor: pointer;\n          transition: all 0.25s ease;\n          box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);\n        }\n\n        .broadcast-btn-schedule:hover {\n          transform: translateY(-2px);\n          box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);\n        }\n\n        .broadcast-btn-schedule:disabled {\n          opacity: 0.5;\n          cursor: not-allowed;\n          transform: none;\n          box-shadow: none;\n        }\n\n        .broadcast-schedule-section {\n          margin-bottom: 24px;\n          padding: 20px 24px;\n          background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);\n          border-radius: 14px;\n          border: 1px solid #bfdbfe;\n        }\n\n        .broadcast-schedule-section .broadcast-toggle {\n          background: transparent;\n          padding: 0;\n          margin-bottom: 0;\n        }\n\n        .broadcast-schedule-section .broadcast-toggle:hover {\n          background: transparent;\n        }\n\n        .schedule-inputs {\n          display: flex;\n          flex-wrap: wrap;\n          gap: 24px;\n          margin-top: 18px;\n          padding-top: 18px;\n          border-top: 1px solid #bfdbfe;\n        }\n\n        .schedule-input-group {\n          display: flex;\n          flex-direction: column;\n          gap: 8px;\n          flex: 1;\n        }\n\n        .schedule-input-group label {\n          font-size: 13px;\n          color: #3b82f6;\n          font-weight: 600;\n        }\n\n        .schedule-input-group input {\n          padding: 12px 16px;\n          border: 2px solid #bfdbfe;\n          border-radius: 10px;\n          font-size: 14px;\n          font-weight: 500;\n          background: #ffffff;\n          transition: all 0.2s;\n        }\n\n        .schedule-input-group input:focus {\n          outline: none;\n          border-color: #3b82f6;\n          box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);\n        }\n\n        /* Auto send checkbox styling */\n        .auto-send-checkbox {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          margin-top: 16px;\n          padding: 12px 16px;\n          background: #dbeafe;\n          border: 1px solid #60a5fa;\n          border-radius: 10px;\n          cursor: pointer;\n          transition: all 0.2s;\n          width: 100%;\n        }\n\n        .auto-send-checkbox:hover {\n          background: #bfdbfe;\n        }\n\n        .auto-send-checkbox input[type="checkbox"] {\n          width: 18px;\n          height: 18px;\n          accent-color: #0ea5e9;\n          cursor: pointer;\n        }\n\n        .auto-send-checkbox span {\n          font-size: 13px;\n          color: #1e3a8a;\n          font-weight: 500;\n        }\n\n        /* ========== RECURRING SECTION - PREMIUM MODERN STYLES ========== */\n        .recurring-section {\n          margin-top: 24px;\n          padding: 24px;\n          background: linear-gradient(145deg, #f8fafc 0%, #eff6ff 50%, #dbeafe 100%);\n          border-radius: 20px;\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.15);\n          box-shadow:\n            0 4px 20px rgba(var(--lion-primary-rgb), 0.08),\n            inset 0 1px 0 rgba(255, 255, 255, 0.8);\n        }\n\n        .recurring-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          margin-bottom: 20px;\n          padding-bottom: 16px;\n          border-bottom: 1px solid rgba(var(--lion-primary-rgb), 0.12);\n        }\n\n        .recurring-toggle {\n          margin-bottom: 0;\n          padding-bottom: 0;\n          border-bottom: none;\n        }\n\n        .recurring-toggle span:last-child {\n          font-size: 15px;\n          font-weight: 700;\n          background: var(--lion-primary);\n          -webkit-background-clip: text;\n          -webkit-text-fill-color: transparent;\n          background-clip: text;\n          letter-spacing: 0.3px;\n        }\n\n        /* Info Icon and Tooltip */\n        .recurring-info-wrapper {\n          position: relative;\n          display: inline-flex;\n        }\n\n        .recurring-info-icon {\n          width: 22px;\n          height: 22px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          background: var(--lion-primary);\n          color: white;\n          border-radius: 50%;\n          font-size: 13px;\n          font-weight: 700;\n          font-style: italic;\n          font-family: Georgia, serif;\n          cursor: pointer;\n          transition: all 0.25s ease;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.3);\n        }\n\n        .recurring-info-icon:hover {\n          transform: scale(1.1);\n          box-shadow: 0 4px 16px rgba(var(--lion-primary-rgb), 0.4);\n        }\n\n        .recurring-info-tooltip {\n          position: absolute;\n          top: calc(100% + 12px);\n          right: 0;\n          width: 320px;\n          padding: 18px;\n          background: white;\n          border-radius: 16px;\n          box-shadow:\n            0 10px 40px rgba(0, 0, 0, 0.15),\n            0 4px 12px rgba(var(--lion-primary-rgb), 0.1);\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.15);\n          opacity: 0;\n          visibility: hidden;\n          transform: translateY(-8px);\n          transition: all 0.25s ease;\n          z-index: 1000;\n        }\n\n        .recurring-info-tooltip::before {\n          content: \'\';\n          position: absolute;\n          top: -8px;\n          right: 16px;\n          width: 16px;\n          height: 16px;\n          background: white;\n          border-left: 1px solid rgba(var(--lion-primary-rgb), 0.15);\n          border-top: 1px solid rgba(var(--lion-primary-rgb), 0.15);\n          transform: rotate(45deg);\n        }\n\n        .recurring-info-wrapper:hover .recurring-info-tooltip {\n          opacity: 1;\n          visibility: visible;\n          transform: translateY(0);\n        }\n\n        .tooltip-title {\n          font-size: 14px;\n          font-weight: 700;\n          color: var(--lion-primary);\n          margin-bottom: 12px;\n          padding-bottom: 10px;\n          border-bottom: 1px solid rgba(var(--lion-primary-rgb), 0.12);\n        }\n\n        .tooltip-list {\n          margin: 0;\n          padding: 0;\n          list-style: none;\n        }\n\n        .tooltip-list li {\n          position: relative;\n          padding-left: 20px;\n          margin-bottom: 10px;\n          font-size: 13px;\n          color: #4b5563;\n          line-height: 1.5;\n        }\n\n        .tooltip-list li:last-child {\n          margin-bottom: 0;\n        }\n\n        .tooltip-list li::before {\n          content: \'✓\';\n          position: absolute;\n          left: 0;\n          color: var(--lion-primary);\n          font-weight: 700;\n          font-size: 11px;\n        }\n\n        .recurring-options {\n          display: flex;\n          flex-direction: column;\n          gap: 24px;\n        }\n\n        .recurring-input-group {\n          display: flex;\n          flex-direction: column;\n          gap: 10px;\n        }\n\n        .recurring-input-group label {\n          font-size: 12px;\n          color: #9ca3af;\n          font-weight: 700;\n          text-transform: uppercase;\n          letter-spacing: 1px;\n          display: flex;\n          align-items: center;\n          gap: 6px;\n        }\n\n        .recurring-input-group label::before {\n          content: "🔄";\n          font-size: 14px;\n        }\n\n        .recurring-select {\n          width: 100%;\n          padding: 14px 18px;\n          border: 2px solid #e5e7eb;\n          border-radius: 14px;\n          font-size: 15px;\n          font-weight: 600;\n          background: white;\n          color: #1f2937;\n          cursor: pointer;\n          transition: all 0.25s ease;\n          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);\n        }\n\n        .recurring-select:hover {\n          border-color: var(--lion-primary);\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.12);\n        }\n\n        .recurring-select:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 4px rgba(var(--lion-primary-rgb), 0.12);\n        }\n\n        .recurring-days-group {\n          display: flex;\n          flex-direction: column;\n          gap: 14px;\n        }\n\n        .recurring-days-group label {\n          font-size: 12px;\n          color: #9ca3af;\n          font-weight: 700;\n          text-transform: uppercase;\n          letter-spacing: 1px;\n          display: flex;\n          align-items: center;\n          gap: 6px;\n        }\n\n        .recurring-days-group label::before {\n          content: "📅";\n          font-size: 14px;\n        }\n\n        .recurring-days {\n          display: grid;\n          grid-template-columns: repeat(7, 1fr);\n          gap: 8px;\n        }\n\n        .day-chip {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          padding: 14px 8px;\n          border: 2px solid #e5e7eb;\n          border-radius: 12px;\n          font-size: 11px;\n          font-weight: 700;\n          background: white;\n          color: #6b7280;\n          cursor: pointer;\n          transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n          box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);\n        }\n\n        .day-chip:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n          transform: translateY(-3px);\n          box-shadow: 0 6px 16px rgba(var(--lion-primary-rgb), 0.18);\n        }\n\n        .day-chip.selected {\n          background: var(--lion-primary);\n          border-color: transparent;\n          color: white;\n          transform: translateY(-3px);\n          box-shadow: 0 6px 20px rgba(var(--lion-primary-rgb), 0.35);\n        }\n\n        /* Full Calendar View */\n        .full-calendar-container {\n          border: 1px solid #374151;\n          border-radius: 12px;\n          overflow: hidden;\n          background: #1a1a1a;\n        }\n\n        .full-calendar-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 12px 16px;\n          background: #262626;\n          border-bottom: 1px solid #374151;\n        }\n\n        .calendar-nav-btn {\n          width: 32px;\n          height: 32px;\n          border: 1px solid #374151;\n          border-radius: 8px;\n          background: #1a1a1a;\n          color: #e5e7eb;\n          cursor: pointer;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.2s ease;\n        }\n\n        .calendar-nav-btn:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n          background: rgba(var(--lion-primary-rgb), 0.1);\n        }\n\n        .calendar-title {\n          font-size: 15px;\n          font-weight: 600;\n          color: #e5e7eb;\n        }\n\n        .full-calendar-weekdays {\n          display: grid;\n          grid-template-columns: repeat(7, 1fr);\n          padding: 8px 12px;\n          background: #262626;\n          border-bottom: 1px solid #374151;\n        }\n\n        .calendar-weekday {\n          text-align: center;\n          font-size: 11px;\n          font-weight: 600;\n          color: #9ca3af;\n          text-transform: uppercase;\n        }\n\n        .calendar-weekday.weekend {\n          color: #ef4444;\n        }\n\n        .full-calendar-grid {\n          display: grid;\n          grid-template-columns: repeat(7, 1fr);\n          gap: 4px;\n          padding: 12px;\n          background: #1a1a1a;\n        }\n\n        .full-calendar-date {\n          aspect-ratio: 1;\n          border: 1px solid transparent;\n          border-radius: 8px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          font-size: 13px;\n          font-weight: 500;\n          color: #e5e7eb;\n          background: #262626;\n          transition: all 0.2s ease;\n          min-height: 36px;\n        }\n\n        .full-calendar-date:hover {\n          border-color: var(--lion-primary);\n          background: rgba(var(--lion-primary-rgb), 0.15);\n        }\n\n        .full-calendar-date.selected {\n          border-color: var(--lion-primary);\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        .full-calendar-date.other-month {\n          color: #6b7280;\n          opacity: 0.5;\n        }\n\n        .full-calendar-date.today {\n          border-color: var(--lion-primary);\n          font-weight: 700;\n        }\n\n        .full-calendar-date.weekend {\n          color: #ef4444;\n        }\n\n        .full-calendar-date.weekend.selected {\n          color: white;\n        }\n\n        .full-calendar-info {\n          padding: 10px 16px;\n          background: rgba(var(--lion-primary-rgb), 0.1);\n          font-size: 12px;\n          color: #9ca3af;\n          text-align: center;\n          border-top: 1px solid #374151;\n        }\n\n        /* Yearly Month Selection (Jan-Dec) */\n        .recurring-months {\n          display: grid;\n          grid-template-columns: repeat(4, 1fr);\n          gap: 8px;\n        }\n\n        .month-chip {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          padding: 12px 8px;\n          border: 2px solid #e5e7eb;\n          border-radius: 12px;\n          font-size: 12px;\n          font-weight: 700;\n          background: white;\n          color: #6b7280;\n          cursor: pointer;\n          transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n          box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);\n        }\n\n        .month-chip:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n          transform: translateY(-3px);\n          box-shadow: 0 6px 16px rgba(var(--lion-primary-rgb), 0.18);\n        }\n\n        .month-chip.selected {\n          background: var(--lion-primary);\n          border-color: transparent;\n          color: white;\n          transform: translateY(-3px);\n          box-shadow: 0 6px 20px rgba(var(--lion-primary-rgb), 0.35);\n        }\n\n        .recurring-end-group {\n          display: flex;\n          flex-direction: column;\n          gap: 14px;\n        }\n\n        .recurring-end-group > label {\n          font-size: 12px;\n          color: #9ca3af;\n          font-weight: 700;\n          text-transform: uppercase;\n          letter-spacing: 1px;\n          display: flex;\n          align-items: center;\n          gap: 6px;\n        }\n\n        .recurring-end-group > label::before {\n          content: "🏁";\n          font-size: 14px;\n        }\n\n        .recurring-end-options {\n          display: flex;\n          gap: 12px;\n        }\n\n        .recurring-end-option {\n          flex: 1;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 10px;\n          padding: 16px 20px;\n          border: 2px solid #e5e7eb;\n          border-radius: 14px;\n          font-size: 14px;\n          font-weight: 600;\n          color: #374151;\n          cursor: pointer;\n          transition: all 0.25s ease;\n          background: white;\n          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);\n        }\n\n        .recurring-end-option:hover {\n          border-color: var(--lion-primary);\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.12);\n        }\n\n        .recurring-end-option:has(input:checked) {\n          border-color: var(--lion-primary);\n          background: linear-gradient(145deg, rgba(var(--lion-primary-rgb), 0.08) 0%, rgba(var(--lion-primary-rgb), 0.04) 100%);\n          box-shadow: 0 4px 16px rgba(var(--lion-primary-rgb), 0.15);\n        }\n\n        .recurring-end-option input[type="radio"] {\n          width: 20px;\n          height: 20px;\n          accent-color: var(--lion-primary);\n          cursor: pointer;\n        }\n\n        .recurring-end-date-input {\n          padding: 12px 16px;\n          border: 2px solid #e5e7eb;\n          border-radius: 12px;\n          font-size: 14px;\n          font-weight: 600;\n          margin-left: 10px;\n          transition: all 0.25s ease;\n          background: white;\n          box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);\n        }\n\n        .recurring-end-date-input:hover {\n          border-color: var(--lion-primary);\n        }\n\n        .recurring-end-date-input:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 4px rgba(var(--lion-primary-rgb), 0.12);\n        }\n\n        /* Scrollbar styling */\n        .broadcast-left-panel::-webkit-scrollbar,\n        .broadcast-right-panel::-webkit-scrollbar {\n          width: 6px;\n        }\n\n        .broadcast-left-panel::-webkit-scrollbar-track,\n        .broadcast-right-panel::-webkit-scrollbar-track {\n          background: #f1f1f1;\n        }\n\n        .broadcast-left-panel::-webkit-scrollbar-thumb,\n        .broadcast-right-panel::-webkit-scrollbar-thumb {\n          background: #d1d5db;\n          border-radius: 3px;\n        }\n\n        .broadcast-left-panel::-webkit-scrollbar-thumb:hover,\n        .broadcast-right-panel::-webkit-scrollbar-thumb:hover {\n          background: #9ca3af;\n        }\n\n        /* ========== UPLOAD WIZARD STYLES ========== */\n        .upload-wizard-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: linear-gradient(135deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.8) 100%);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 10001;\n          backdrop-filter: blur(4px);\n        }\n\n        .upload-wizard-modal {\n          background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);\n          border-radius: 20px;\n          width: 95%;\n          max-width: 950px;\n          max-height: 90vh;\n          display: flex;\n          flex-direction: column;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255,255,255,0.1);\n          overflow: hidden;\n        }\n\n        .upload-wizard-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 22px 28px;\n          background: var(--lion-primary);\n        }\n\n        .upload-wizard-header h2 {\n          font-size: 20px;\n          font-weight: 700;\n          color: #ffffff;\n          margin: 0;\n          text-shadow: 0 1px 2px rgba(0,0,0,0.1);\n        }\n\n        .wizard-close-btn {\n          background: rgba(255, 255, 255, 0.15);\n          border: none;\n          cursor: pointer;\n          padding: 10px;\n          border-radius: 10px;\n          color: #ffffff;\n          transition: all 0.2s;\n        }\n\n        .wizard-close-btn:hover {\n          background: rgba(255, 255, 255, 0.25);\n          transform: scale(1.05);\n        }\n\n        /* Steps Indicator */\n        .upload-wizard-steps {\n          display: flex;\n          align-items: center;\n          justify-content: flex-start;\n          padding: 20px 40px;\n          border-bottom: 1px solid #e5e7eb;\n          background: #fafafa;\n        }\n\n        .wizard-step {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          gap: 8px;\n          color: #9ca3af;\n        }\n\n        .wizard-step.active {\n          color: var(--lion-primary);\n        }\n\n        .wizard-step.completed {\n          color: var(--lion-primary);\n        }\n\n        .step-number {\n          width: 32px;\n          height: 32px;\n          border-radius: 50%;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          font-size: 14px;\n          font-weight: 600;\n          border: 2px solid currentColor;\n          background: transparent;\n        }\n\n        .wizard-step.active .step-number {\n          background: var(--lion-primary);\n          color: white;\n          border-color: var(--lion-primary);\n        }\n\n        .wizard-step.completed .step-number {\n          background: var(--lion-primary);\n          color: white;\n          border-color: var(--lion-primary);\n        }\n\n        .wizard-step span {\n          font-size: 14px;\n          font-weight: 500;\n        }\n\n        .step-line {\n          width: 60px;\n          height: 2px;\n          background: #e5e7eb;\n          margin: 0 12px;\n          margin-bottom: 24px;\n        }\n\n        .wizard-step.completed + .step-line {\n          background: var(--lion-primary);\n        }\n\n        .upload-wizard-content {\n          flex: 1;\n          overflow-y: auto;\n          padding: 24px 40px;\n        }\n\n        .wizard-step-content {\n          min-height: 300px;\n        }\n\n        /* Step 1: Upload Area */\n        .upload-drop-area {\n          border: 2px dashed #e5e7eb;\n          border-radius: 12px;\n          padding: 60px 40px;\n          text-align: center;\n          cursor: pointer;\n          transition: all 0.2s;\n          background: #fafafa;\n        }\n\n        .upload-drop-area:hover {\n          border-color: var(--lion-primary);\n          background: #f0fdf4;\n        }\n\n        .upload-icon {\n          margin-bottom: 16px;\n        }\n\n        .upload-text {\n          font-size: 16px;\n          color: var(--lion-primary);\n          margin: 0;\n          font-weight: 500;\n        }\n\n        .upload-hint {\n          text-align: center;\n          color: #6b7280;\n          font-size: 14px;\n          margin: 20px 0;\n        }\n\n        .sample-files {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 12px;\n          margin-top: 24px;\n        }\n\n        .sample-files span {\n          color: #6b7280;\n          font-size: 14px;\n        }\n\n        .sample-btn {\n          padding: 8px 16px;\n          border: 1px solid #e5e7eb;\n          background: white;\n          border-radius: 6px;\n          font-size: 13px;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .sample-btn:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n\n        .uploaded-file-info {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 12px;\n          margin-top: 20px;\n          padding: 12px 20px;\n          background: #f0fdf4;\n          border-radius: 8px;\n          border: 1px solid #86efac;\n        }\n\n        .file-icon {\n          font-size: 20px;\n        }\n\n        .file-name {\n          font-weight: 500;\n          color: #166534;\n        }\n\n        .file-rows {\n          color: #6b7280;\n          font-size: 13px;\n        }\n\n        /* Step 2: Mapping */\n        .map-section {\n          margin-bottom: 30px;\n          padding-bottom: 20px;\n          border-bottom: 1px solid #e5e7eb;\n        }\n\n        .phone-column-select {\n          display: flex;\n          align-items: center;\n          gap: 16px;\n        }\n\n        .phone-column-select label {\n          font-weight: 500;\n          color: #374151;\n        }\n\n        .phone-column-select select {\n          padding: 10px 16px;\n          border: 1px solid #e5e7eb;\n          border-radius: 8px;\n          font-size: 14px;\n          min-width: 180px;\n          background: white;\n          cursor: pointer;\n        }\n\n        .phone-column-select select:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n        }\n\n        .map-hint {\n          color: #6b7280;\n          font-size: 13px;\n          margin-top: 8px;\n          margin-bottom: 0;\n        }\n\n        .extra-columns-section {\n          margin-top: 20px;\n        }\n\n        .extra-columns-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          margin-bottom: 16px;\n        }\n\n        .extra-columns-header span {\n          color: #0ea5e9;\n          font-size: 14px;\n          font-weight: 500;\n        }\n\n        .select-all-btns {\n          display: flex;\n          gap: 8px;\n        }\n\n        .select-all-btn,\n        .select-none-btn {\n          padding: 6px 16px;\n          border: 1px solid #e5e7eb;\n          background: white;\n          border-radius: 6px;\n          font-size: 13px;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .select-all-btn:hover,\n        .select-none-btn:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n\n        .extra-columns-grid {\n          display: grid;\n          grid-template-columns: repeat(3, 1fr);\n          gap: 16px;\n        }\n\n        .extra-column-card {\n          display: flex;\n          align-items: flex-start;\n          gap: 12px;\n          padding: 16px;\n          border: 1px solid #e5e7eb;\n          border-radius: 10px;\n          cursor: pointer;\n          transition: all 0.2s;\n          background: white;\n        }\n\n        .extra-column-card:hover {\n          border-color: var(--lion-primary);\n        }\n\n        .extra-column-card.selected {\n          border-color: var(--lion-primary);\n          background: #f0fdf4;\n        }\n\n        .column-checkbox {\n          width: 24px;\n          height: 24px;\n          border: 2px solid #e5e7eb;\n          border-radius: 6px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          flex-shrink: 0;\n        }\n\n        .extra-column-card.selected .column-checkbox {\n          border-color: var(--lion-primary);\n          background: #f0fdf4;\n        }\n\n        .column-info {\n          display: flex;\n          flex-direction: column;\n          gap: 4px;\n        }\n\n        .column-name {\n          font-weight: 500;\n          color: #374151;\n          font-size: 14px;\n        }\n\n        .column-sample {\n          color: #6b7280;\n          font-size: 13px;\n        }\n\n        /* Step 3: Preview */\n        .preview-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          margin-bottom: 20px;\n        }\n\n        .remove-rows-btn {\n          padding: 10px 20px;\n          background: var(--lion-primary);\n          color: white;\n          border: none;\n          border-radius: 8px;\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .remove-rows-btn:hover {\n          background: var(--lion-primary-hover);\n        }\n\n        .total-contacts {\n          font-size: 14px;\n          color: #6b7280;\n        }\n\n        .contact-count {\n          color: var(--lion-primary);\n          font-weight: 600;\n          margin-left: 4px;\n        }\n\n        .preview-table-container {\n          max-height: 400px;\n          overflow: auto;\n          border: 1px solid #e5e7eb;\n          border-radius: 10px;\n        }\n\n        .preview-table {\n          width: 100%;\n          border-collapse: collapse;\n          font-size: 13px;\n        }\n\n        .preview-table thead {\n          position: sticky;\n          top: 0;\n          background: #f9fafb;\n        }\n\n        .preview-table th {\n          padding: 12px 16px;\n          text-align: left;\n          font-weight: 600;\n          color: #374151;\n          border-bottom: 1px solid #e5e7eb;\n        }\n\n        .preview-table td {\n          padding: 12px 16px;\n          border-bottom: 1px solid #f3f4f6;\n          color: #4b5563;\n          max-width: 200px;\n          overflow: hidden;\n          text-overflow: ellipsis;\n          white-space: nowrap;\n        }\n\n        .preview-table tbody tr {\n          cursor: pointer;\n          transition: background 0.2s;\n        }\n\n        .preview-table tbody tr:hover {\n          background: #f9fafb;\n        }\n\n        .preview-table tbody tr.removed-row {\n          background: #fef2f2;\n          text-decoration: line-through;\n          opacity: 0.6;\n        }\n\n        /* Footer */\n        .upload-wizard-footer {\n          display: flex;\n          justify-content: flex-end;\n          gap: 12px;\n          padding: 20px 24px;\n          border-top: 1px solid #e5e7eb;\n          background: #fafafa;\n        }\n\n        .wizard-btn {\n          padding: 12px 24px;\n          border-radius: 8px;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .wizard-btn-close {\n          background: white;\n          border: 1px solid #e5e7eb;\n          color: #374151;\n        }\n\n        .wizard-btn-close:hover {\n          background: #f9fafb;\n        }\n\n        .wizard-btn-prev {\n          background: white;\n          border: 1px solid #e5e7eb;\n          color: #374151;\n        }\n\n        .wizard-btn-prev:hover {\n          background: #f9fafb;\n        }\n\n        .wizard-btn-next {\n          background: var(--lion-primary);\n          border: none;\n          color: white;\n        }\n\n        .wizard-btn-next:hover {\n          background: var(--lion-primary-hover);\n        }\n\n        .wizard-btn-next:disabled {\n          background: #d1d5db;\n          cursor: not-allowed;\n        }\n\n        .wizard-btn-upload {\n          background: var(--lion-primary);\n          border: none;\n          color: white;\n        }\n\n        .wizard-btn-upload:hover {\n          background: var(--lion-primary-hover);\n        }\n\n        /* Uploaded Contacts Table Styles */\n        .uploaded-contacts-section {\n          margin-bottom: 16px;\n        }\n\n        .uploaded-contacts-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          margin-bottom: 12px;\n        }\n\n        .uploaded-count {\n          font-size: 14px;\n          font-weight: 600;\n          color: var(--lion-primary-hover);\n        }\n\n        .clear-contacts-btn {\n          padding: 6px 14px;\n          background: #fee2e2;\n          border: 1px solid #fecaca;\n          border-radius: 6px;\n          color: #dc2626;\n          font-size: 13px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .clear-contacts-btn:hover {\n          background: #fecaca;\n          border-color: #f87171;\n        }\n\n        .uploaded-contacts-table-wrapper {\n          max-height: 200px;\n          overflow: auto;\n          border: 1px solid #e5e7eb;\n          border-radius: 10px;\n          background: white;\n        }\n\n        .uploaded-contacts-table {\n          width: 100%;\n          border-collapse: collapse;\n          font-size: 13px;\n        }\n\n        .uploaded-contacts-table thead {\n          position: sticky;\n          top: 0;\n          background: #f9fafb;\n          z-index: 1;\n        }\n\n        .uploaded-contacts-table th {\n          padding: 10px 12px;\n          text-align: left;\n          font-weight: 600;\n          color: #374151;\n          border-bottom: 1px solid #e5e7eb;\n          white-space: nowrap;\n        }\n\n        .uploaded-contacts-table td {\n          padding: 8px 12px;\n          border-bottom: 1px solid #f3f4f6;\n          color: #4b5563;\n          max-width: 150px;\n          overflow: hidden;\n          text-overflow: ellipsis;\n          white-space: nowrap;\n        }\n\n        .uploaded-contacts-table tbody tr:hover {\n          background: #f9fafb;\n        }\n\n        .uploaded-contacts-table tbody tr:last-child td {\n          border-bottom: none;\n        }\n\n        .remove-contact-btn {\n          width: 24px;\n          height: 24px;\n          border: none;\n          background: #fee2e2;\n          color: #dc2626;\n          border-radius: 4px;\n          cursor: pointer;\n          font-size: 16px;\n          line-height: 1;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.2s;\n        }\n\n        .remove-contact-btn:hover {\n          background: #fecaca;\n        }\n\n        .variable-hint-box {\n          margin-top: 12px;\n          padding: 10px 14px;\n          background: #f0f9ff;\n          border: 1px solid #bae6fd;\n          border-radius: 8px;\n          font-size: 12px;\n          color: #0369a1;\n          display: flex;\n          flex-wrap: wrap;\n          gap: 8px;\n          align-items: center;\n        }\n\n        .variable-hint-box code {\n          background: #e0f2fe;\n          padding: 2px 6px;\n          border-radius: 4px;\n          font-family: monospace;\n          font-size: 11px;\n          color: #0284c7;\n        }\n\n        /* Scrollbar for uploaded contacts table */\n        .uploaded-contacts-table-wrapper::-webkit-scrollbar {\n          width: 6px;\n          height: 6px;\n        }\n\n        .uploaded-contacts-table-wrapper::-webkit-scrollbar-track {\n          background: #f1f1f1;\n        }\n\n        .uploaded-contacts-table-wrapper::-webkit-scrollbar-thumb {\n          background: #d1d5db;\n          border-radius: 3px;\n        }\n\n        .uploaded-contacts-table-wrapper::-webkit-scrollbar-thumb:hover {\n          background: #9ca3af;\n        }\n\n        /* ========== SELECT DROPDOWN STYLES ========== */\n        .select-dropdown-wrapper {\n          position: relative;\n        }\n\n        .select-dropdown-menu {\n          position: absolute;\n          bottom: calc(100% + 6px);\n          left: 50%;\n          transform: translateX(-50%);\n          background: var(--lion-bg-primary, #ffffff);\n          border: 1px solid var(--lion-border-light, #e5e7eb);\n          border-radius: 12px;\n          box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.05);\n          z-index: 1000;\n          min-width: 220px;\n          overflow: hidden;\n        }\n\n        .select-dropdown-item {\n          display: flex;\n          align-items: center;\n          gap: 14px;\n          padding: 14px 18px;\n          cursor: pointer;\n          transition: all 0.2s;\n          font-size: 14px;\n          font-weight: 500;\n          color: #475569;\n          border-bottom: 1px solid #f1f5f9;\n        }\n\n        .select-dropdown-item:last-child {\n          border-bottom: none;\n        }\n\n        .select-dropdown-item:hover {\n          background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);\n          color: var(--lion-primary-hover);\n          padding-left: 22px;\n        }\n\n        .dropdown-item-icon {\n          font-size: 18px;\n          width: 24px;\n          text-align: center;\n        }\n\n        /* ========== SELECTOR MODAL STYLES ========== */\n        .selector-modal-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.75) 100%);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 10002;\n          backdrop-filter: blur(4px);\n        }\n\n        .selector-modal {\n          background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);\n          border-radius: 20px;\n          width: 90%;\n          max-width: 550px;\n          max-height: 75vh;\n          display: flex;\n          flex-direction: column;\n          box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255,255,255,0.1);\n          overflow: hidden;\n        }\n\n        .selector-modal-large {\n          max-width: 650px;\n          max-height: 80vh;\n        }\n\n        .selector-search {\n          padding: 16px 24px;\n          background: #ffffff;\n          border-bottom: 1px solid #e2e8f0;\n        }\n\n        .selector-search-input {\n          width: 100%;\n          padding: 14px 18px;\n          border: 2px solid #e2e8f0;\n          border-radius: 12px;\n          font-size: 14px;\n          outline: none;\n          transition: all 0.25s ease;\n          background: #f8fafc;\n        }\n\n        .selector-search-input:focus {\n          border-color: var(--lion-primary);\n          background: #ffffff;\n          box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);\n        }\n\n        .selector-search-input::placeholder {\n          color: #94a3b8;\n        }\n\n        .selector-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 20px 24px;\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        .selector-header h3 {\n          margin: 0;\n          font-size: 18px;\n          font-weight: 700;\n          color: #ffffff;\n          text-shadow: 0 1px 2px rgba(0,0,0,0.1);\n        }\n\n        .selector-close-btn {\n          width: 36px;\n          height: 36px;\n          border: none;\n          background: rgba(255, 255, 255, 0.2);\n          border-radius: 10px;\n          font-size: 20px;\n          color: #ffffff;\n          cursor: pointer;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.2s;\n        }\n\n        .selector-close-btn:hover {\n          background: rgba(255, 255, 255, 0.3);\n          transform: scale(1.05);\n        }\n\n        .selector-back-btn {\n          padding: 8px 14px;\n          border: none;\n          background: rgba(255, 255, 255, 0.2);\n          border-radius: 8px;\n          font-size: 14px;\n          color: #ffffff;\n          cursor: pointer;\n          margin-right: 10px;\n          transition: all 0.2s;\n          font-weight: 500;\n        }\n\n        .selector-back-btn:hover {\n          background: rgba(255, 255, 255, 0.3);\n        }\n\n        .selector-item-clickable {\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .selector-item-clickable:hover {\n          background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);\n        }\n\n        .selector-item-arrow {\n          margin-left: auto;\n          color: #94a3b8;\n          font-size: 16px;\n          transition: transform 0.2s;\n        }\n\n        .selector-item-clickable:hover .selector-item-arrow {\n          color: var(--lion-primary);\n          transform: translateX(4px);\n        }\n\n        .selector-content {\n          flex: 1;\n          overflow-y: auto;\n          padding: 12px 0;\n          background: #ffffff;\n        }\n\n        .selector-loading,\n        .selector-empty {\n          padding: 60px 24px;\n          text-align: center;\n          color: #94a3b8;\n          font-size: 15px;\n        }\n\n        .selector-loading::before {\n          content: \'⏳\';\n          display: block;\n          font-size: 32px;\n          margin-bottom: 12px;\n          opacity: 0.6;\n        }\n\n        .selector-empty::before {\n          content: \'📭\';\n          display: block;\n          font-size: 32px;\n          margin-bottom: 12px;\n          opacity: 0.6;\n        }\n\n        .selector-list {\n          display: flex;\n          flex-direction: column;\n        }\n\n        .selector-item {\n          display: flex;\n          align-items: center;\n          gap: 14px;\n          padding: 14px 24px;\n          cursor: pointer;\n          transition: all 0.2s;\n          border-bottom: 1px solid #f1f5f9;\n        }\n\n        .selector-item:hover {\n          background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);\n        }\n\n        .selector-item:last-child {\n          border-bottom: none;\n        }\n\n        .selector-item input[type="checkbox"] {\n          width: 22px;\n          height: 22px;\n          accent-color: var(--lion-primary);\n          cursor: pointer;\n          border-radius: 6px;\n        }\n\n        .selector-item-name {\n          flex: 1;\n          font-size: 15px;\n          color: var(--lion-sidebar-start);\n          font-weight: 600;\n        }\n\n        .selector-item-phone,\n        .selector-item-count {\n          font-size: 13px;\n          color: #94a3b8;\n          font-weight: 500;\n        }\n\n        .selector-item-color {\n          width: 18px;\n          height: 18px;\n          border-radius: 6px;\n          flex-shrink: 0;\n          box-shadow: 0 1px 3px rgba(0,0,0,0.15);\n        }\n\n        .selector-item-clickable {\n          justify-content: space-between;\n        }\n\n        .selector-item-clickable:hover {\n          background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);\n        }\n\n        .selector-item-back {\n          background: #f8fafc;\n          border-bottom: 2px solid #e2e8f0;\n        }\n\n        .selector-item-back:hover {\n          background: #f1f5f9;\n        }\n\n        .selector-footer {\n          display: flex;\n          align-items: center;\n          gap: 14px;\n          padding: 18px 24px;\n          border-top: 2px solid #e2e8f0;\n          background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);\n        }\n\n        .selector-count {\n          flex: 1;\n          font-size: 14px;\n          color: #64748b;\n          font-weight: 600;\n        }\n\n        .selector-btn {\n          padding: 12px 24px;\n          border-radius: 10px;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.25s ease;\n        }\n\n        .selector-btn-cancel {\n          background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);\n          border: 2px solid #e2e8f0;\n          color: #475569;\n        }\n\n        .selector-btn-cancel:hover {\n          background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);\n          border-color: #cbd5e1;\n        }\n\n        .selector-btn-confirm {\n          background: var(--lion-primary);\n          border: none;\n          color: white;\n          box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);\n        }\n\n        .selector-btn-confirm:hover {\n          transform: translateY(-2px);\n          box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);\n        }\n\n        /* ========== SELECT ALL ROW ========== */\n        .selector-select-all-row {\n          padding: 10px 24px;\n          border-bottom: 1px solid #e2e8f0;\n          background: #f8fafc;\n          display: flex;\n          align-items: center;\n          gap: 12px;\n        }\n\n        .selector-select-all-btn {\n          padding: 8px 16px;\n          font-size: 13px;\n          font-weight: 600;\n          background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);\n          border: 1px solid #cbd5e1;\n          border-radius: 8px;\n          cursor: pointer;\n          transition: all 0.2s ease;\n          color: #475569;\n        }\n\n        .selector-select-all-btn:hover {\n          background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);\n          border-color: #94a3b8;\n          transform: translateY(-1px);\n        }\n\n        .selector-select-all-btn.active {\n          background: var(--lion-primary);\n          border-color: var(--lion-primary);\n          color: white;\n        }\n\n        .selector-select-all-btn.active:hover {\n          background: linear-gradient(135deg, var(--lion-primary-hover) 0%, var(--lion-primary-dark, #1e40af) 100%);\n        }\n\n        /* ========== SCHEDULE CONFIRMATION MODAL ========== */\n        .schedule-confirm-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.7);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 10002;\n          backdrop-filter: blur(4px);\n        }\n\n        .schedule-confirm-modal {\n          background: #ffffff;\n          border-radius: 20px;\n          padding: 40px 50px;\n          text-align: center;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);\n          max-width: 400px;\n          width: 90%;\n        }\n\n        .schedule-confirm-icon {\n          margin-bottom: 20px;\n        }\n\n        .schedule-confirm-title {\n          font-size: 24px;\n          font-weight: 700;\n          color: var(--lion-sidebar-start);\n          margin: 0 0 16px 0;\n        }\n\n        .schedule-confirm-datetime {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 8px;\n          font-size: 16px;\n          color: #475569;\n          margin: 0 0 24px 0;\n          font-weight: 500;\n        }\n\n        .schedule-confirm-stats {\n          display: flex;\n          justify-content: center;\n          gap: 40px;\n          margin-bottom: 30px;\n          padding: 20px;\n          background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);\n          border-radius: 12px;\n        }\n\n        .schedule-stat {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          gap: 4px;\n        }\n\n        .schedule-stat-value {\n          font-size: 28px;\n          font-weight: 700;\n          color: var(--lion-primary);\n        }\n\n        .schedule-stat-label {\n          font-size: 13px;\n          color: #64748b;\n          font-weight: 500;\n        }\n\n        .schedule-confirm-btn {\n          background: var(--lion-primary);\n          color: white;\n          border: none;\n          padding: 14px 50px;\n          font-size: 16px;\n          font-weight: 600;\n          border-radius: 12px;\n          cursor: pointer;\n          transition: all 0.2s;\n          box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);\n        }\n\n        .schedule-confirm-btn:hover {\n          transform: translateY(-2px);\n          box-shadow: 0 6px 20px rgba(34, 197, 94, 0.45);\n        }\n\n        /* ========== PREVIEW MODAL ========== */\n        .preview-modal-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.7);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 10002;\n          backdrop-filter: blur(4px);\n        }\n\n        .preview-modal {\n          background: #ffffff;\n          border-radius: 20px;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);\n          max-width: 480px;\n          width: 90%;\n          overflow: hidden;\n        }\n\n        .preview-modal-header {\n          background: var(--lion-primary);\n          padding: 24px 30px;\n          display: flex;\n          align-items: center;\n          gap: 16px;\n          position: relative;\n        }\n\n        .preview-icon {\n          flex-shrink: 0;\n        }\n\n        .preview-modal-title {\n          font-size: 22px;\n          font-weight: 700;\n          color: #ffffff;\n          margin: 0;\n          flex: 1;\n        }\n\n        .preview-modal-close {\n          position: absolute;\n          top: 16px;\n          right: 16px;\n          background: rgba(255, 255, 255, 0.2);\n          border: none;\n          width: 32px;\n          height: 32px;\n          border-radius: 8px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          color: white;\n          transition: all 0.2s;\n        }\n\n        .preview-modal-close:hover {\n          background: rgba(255, 255, 255, 0.3);\n        }\n\n        .preview-modal-content {\n          padding: 30px;\n        }\n\n        .preview-stats-grid {\n          display: grid;\n          grid-template-columns: repeat(2, 1fr);\n          gap: 16px;\n          margin-bottom: 20px;\n        }\n\n        .preview-stat-card {\n          background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);\n          border: 1px solid #e2e8f0;\n          border-radius: 14px;\n          padding: 18px;\n          display: flex;\n          align-items: center;\n          gap: 14px;\n        }\n\n        .preview-stat-icon {\n          width: 48px;\n          height: 48px;\n          border-radius: 12px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          flex-shrink: 0;\n        }\n\n        .preview-stat-icon.contacts {\n          background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);\n          color: #7C3AED;\n        }\n\n        .preview-stat-icon.messages {\n          background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);\n          color: var(--lion-primary-hover);\n        }\n\n        .preview-stat-icon.delay {\n          background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);\n          color: #6D28D9;\n        }\n\n        .preview-stat-icon.pause {\n          background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);\n          color: #db2777;\n        }\n\n        .preview-stat-info {\n          display: flex;\n          flex-direction: column;\n          gap: 2px;\n        }\n\n        .preview-stat-value {\n          font-size: 20px;\n          font-weight: 700;\n          color: var(--lion-sidebar-start);\n        }\n\n        .preview-stat-label {\n          font-size: 12px;\n          color: #64748b;\n          font-weight: 500;\n        }\n\n        .preview-info-note {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          padding: 12px 16px;\n          background: #f8fafc;\n          border-radius: 10px;\n          font-size: 13px;\n          color: #64748b;\n        }\n\n        .preview-modal-footer {\n          padding: 20px 30px 30px;\n          display: flex;\n          justify-content: center;\n          gap: 12px;\n        }\n\n        .preview-cancel-btn {\n          background: #f1f5f9;\n          color: #64748b;\n          border: 1px solid #e2e8f0;\n          padding: 14px 40px;\n          font-size: 16px;\n          font-weight: 600;\n          border-radius: 12px;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .preview-cancel-btn:hover {\n          background: #e2e8f0;\n          color: #475569;\n        }\n\n        .preview-quick-start-btn {\n          padding: 14px 40px !important;\n          font-size: 16px !important;\n          border-radius: 12px !important;\n        }\n\n        /* ========== QUEUE VIEW MODAL ========== */\n        .queue-view-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.7);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 10001;\n          backdrop-filter: blur(4px);\n        }\n\n        .queue-view-modal {\n          background: #ffffff;\n          border-radius: 20px;\n          width: 98%;\n          max-width: 1400px;\n          height: 95vh;\n          max-height: 95vh;\n          display: flex;\n          flex-direction: column;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);\n        }\n\n        .queue-view-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 20px 24px;\n          background: linear-gradient(90deg, #3b82f6 0%, #7C3AED 100%);\n          color: white;\n          border-radius: 16px 16px 0 0;\n        }\n\n        .queue-view-header h2 {\n          margin: 0;\n          font-size: 18px;\n          font-weight: 600;\n        }\n\n        .queue-stats {\n          display: flex;\n          gap: 16px;\n        }\n\n        .queue-stats .stat {\n          font-size: 14px;\n          font-weight: 500;\n        }\n\n        .queue-header-actions {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          margin-left: auto;\n          margin-right: 15px;\n        }\n\n        .queue-pause-btn {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          background: rgba(255, 255, 255, 0.2);\n          border: 2px solid rgba(255, 255, 255, 0.4);\n          cursor: pointer;\n          padding: 8px 16px;\n          border-radius: 8px;\n          color: white;\n          font-size: 14px;\n          font-weight: 600;\n          transition: all 0.2s;\n        }\n\n        .queue-pause-btn:hover {\n          background: rgba(255, 255, 255, 0.3);\n          border-color: rgba(255, 255, 255, 0.6);\n          transform: scale(1.02);\n        }\n\n        .queue-pause-btn.paused {\n          background: rgba(34, 197, 94, 0.3);\n          border-color: rgba(34, 197, 94, 0.6);\n          animation: pulse-green 1.5s infinite;\n        }\n\n        @keyframes pulse-green {\n          0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }\n          50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }\n        }\n\n        .queue-close-btn {\n          background: rgba(255, 255, 255, 0.2);\n          border: none;\n          cursor: pointer;\n          padding: 8px;\n          border-radius: 8px;\n          color: white;\n          transition: all 0.2s;\n        }\n\n        .queue-close-btn:hover {\n          background: rgba(255, 255, 255, 0.3);\n        }\n\n        .queue-view-content {\n          flex: 1;\n          overflow-y: auto;\n        }\n\n        .queue-list {\n          padding: 12px;\n        }\n\n        .queue-item {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          padding: 12px 16px;\n          border-radius: 10px;\n          margin-bottom: 8px;\n          transition: all 0.3s ease;\n        }\n\n        .queue-item-pending {\n          background: #f1f5f9;\n          border: 1px solid #e2e8f0;\n        }\n\n        .queue-item-sending {\n          background: #dbeafe;\n          border: 1px solid #93c5fd;\n          animation: pulse 1s infinite;\n        }\n\n        .queue-item-sent {\n          background: #dcfce7;\n          border: 1px solid #86efac;\n        }\n\n        .queue-item-failed {\n          background: #fee2e2;\n          border: 1px solid #fca5a5;\n        }\n\n        @keyframes pulse {\n          0%, 100% { opacity: 1; }\n          50% { opacity: 0.7; }\n        }\n\n        .queue-item-index {\n          width: 28px;\n          height: 28px;\n          background: #e2e8f0;\n          border-radius: 50%;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          font-size: 12px;\n          font-weight: 600;\n          color: #64748b;\n        }\n\n        .queue-item-sent .queue-item-index {\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        .queue-item-failed .queue-item-index {\n          background: #ef4444;\n          color: white;\n        }\n\n        .queue-item-status {\n          font-size: 20px;\n        }\n\n        .queue-item-info {\n          flex: 1;\n        }\n\n        .queue-item-name {\n          font-weight: 600;\n          font-size: 14px;\n          color: var(--lion-sidebar-start);\n        }\n\n        .queue-item-phone {\n          font-size: 12px;\n          color: #64748b;\n        }\n\n        .queue-item-time {\n          font-size: 12px;\n          color: #64748b;\n          text-align: right;\n        }\n\n        .queue-item-time .error-text {\n          display: block;\n          color: #ef4444;\n          font-size: 11px;\n          margin-top: 2px;\n        }\n\n        .queue-view-footer {\n          padding: 16px 24px;\n          border-top: 1px solid #e2e8f0;\n          background: #f8fafc;\n          border-radius: 0 0 16px 16px;\n        }\n\n        .queue-progress-bar {\n          height: 8px;\n          background: #e2e8f0;\n          border-radius: 4px;\n          overflow: hidden;\n          margin-bottom: 8px;\n        }\n\n        .queue-progress-fill {\n          height: 100%;\n          background: var(--lion-primary);\n          transition: width 0.3s ease;\n        }\n\n        .queue-progress-text {\n          text-align: center;\n          font-size: 13px;\n          color: #64748b;\n        }\n\n        /* ========== REPORTS VIEW MODAL ========== */\n        .reports-view-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.7);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 10001;\n          backdrop-filter: blur(4px);\n        }\n\n        .reports-view-modal {\n          background: #ffffff;\n          border-radius: 20px;\n          width: 98%;\n          max-width: 1400px;\n          height: 95vh;\n          max-height: 95vh;\n          display: flex;\n          flex-direction: column;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);\n        }\n\n        .reports-view-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 20px 24px;\n          background: var(--lion-primary);\n          color: white;\n          border-radius: 16px 16px 0 0;\n        }\n\n        .reports-view-header h2 {\n          margin: 0;\n          font-size: 18px;\n          font-weight: 600;\n        }\n\n        .reports-close-btn {\n          background: rgba(255, 255, 255, 0.2);\n          border: none;\n          cursor: pointer;\n          padding: 8px;\n          border-radius: 8px;\n          color: white;\n          transition: all 0.2s;\n        }\n\n        .reports-close-btn:hover {\n          background: rgba(255, 255, 255, 0.3);\n        }\n\n        .reports-view-content {\n          flex: 1;\n          overflow-y: auto;\n        }\n\n        .reports-empty {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          justify-content: center;\n          padding: 60px 20px;\n          color: #64748b;\n        }\n\n        .reports-empty p {\n          margin: 16px 0 4px;\n          font-size: 16px;\n          font-weight: 600;\n          color: #334155;\n        }\n\n        .reports-empty span {\n          font-size: 14px;\n        }\n\n        .reports-list {\n          padding: 0;\n        }\n\n        .reports-list-header {\n          display: grid;\n          grid-template-columns: 2fr 1.2fr 1.2fr 1.2fr 1.5fr;\n          padding: 12px 20px;\n          background: #f1f5f9;\n          font-size: 12px;\n          font-weight: 600;\n          color: #64748b;\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n          position: sticky;\n          top: 0;\n        }\n\n        .reports-list-item {\n          display: grid;\n          grid-template-columns: 2fr 1.2fr 1.2fr 1.2fr 1.5fr;\n          padding: 16px 20px;\n          border-bottom: 1px solid #e2e8f0;\n          align-items: center;\n          transition: background 0.2s;\n        }\n\n        .reports-list-item:hover {\n          background: #f8fafc;\n        }\n\n        .col-date .date-main {\n          font-weight: 600;\n          color: var(--lion-sidebar-start);\n          font-size: 14px;\n        }\n\n        .col-date .date-time {\n          font-size: 12px;\n          color: #64748b;\n        }\n\n        .col-contacts {\n          font-weight: 600;\n          color: #334155;\n        }\n\n        .sent-badge {\n          background: #dcfce7;\n          color: #166534;\n          padding: 4px 10px;\n          border-radius: 12px;\n          font-size: 13px;\n          font-weight: 600;\n        }\n\n        .failed-badge {\n          background: #fee2e2;\n          color: #991b1b;\n          padding: 4px 10px;\n          border-radius: 12px;\n          font-size: 13px;\n          font-weight: 600;\n        }\n\n        .status-badge {\n          padding: 4px 12px;\n          border-radius: 12px;\n          font-size: 12px;\n          font-weight: 500;\n        }\n\n        .status-badge.completed {\n          background: #dcfce7;\n          color: #166534;\n        }\n\n        .status-badge.failed {\n          background: #fee2e2;\n          color: #991b1b;\n        }\n\n        .status-badge.cancelled {\n          background: #dbeafe;\n          color: #1e3a8a;\n        }\n\n        .status-badge.scheduled {\n          background: #dbeafe;\n          color: #1e40af;\n        }\n\n        .status-badge.running {\n          background: #dbeafe;\n          color: #1e3a8a;\n          animation: pulse 1.5s infinite;\n        }\n\n        .col-contacts,\n        .col-sent,\n        .col-failed {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .contacts-count {\n          font-weight: 600;\n          color: #334155;\n        }\n\n        .inline-download-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 26px;\n          height: 26px;\n          border: none;\n          border-radius: 6px;\n          background: var(--lion-primary);\n          color: white;\n          cursor: pointer;\n          transition: all 0.2s;\n          box-shadow: 0 2px 6px rgba(34, 197, 94, 0.25);\n          flex-shrink: 0;\n        }\n\n        .inline-download-btn:hover {\n          transform: scale(1.1);\n          box-shadow: 0 3px 10px rgba(34, 197, 94, 0.35);\n        }\n\n        .inline-download-btn.sent {\n          background: var(--lion-primary);\n        }\n\n        .inline-download-btn.failed {\n          background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);\n          box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);\n        }\n\n        .inline-download-btn.failed:hover {\n          box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);\n        }\n\n        /* Scheduled campaigns section styles */\n        .reports-section {\n          margin-bottom: 8px;\n        }\n\n        .section-title {\n          padding: 12px 20px;\n          margin: 0;\n          font-size: 14px;\n          font-weight: 600;\n          color: #334155;\n          background: #f8fafc;\n          border-bottom: 1px solid #e2e8f0;\n        }\n\n        .scheduled-section {\n          background: #eff6ff;\n          border-bottom: 2px solid #3b82f6;\n        }\n\n        .scheduled-section .section-title {\n          background: #dbeafe;\n          color: #1e40af;\n        }\n\n        .status-scheduled {\n          display: grid;\n          grid-template-columns: 2fr 1fr 1fr 1fr 0.5fr;\n          padding: 16px 20px;\n          border-bottom: 1px solid #bfdbfe;\n          align-items: center;\n          background: #eff6ff;\n        }\n\n        .status-scheduled:hover {\n          background: #dbeafe;\n        }\n\n        .scheduled-time {\n          color: #1e40af !important;\n        }\n\n        .col-contacts .contacts-count,\n        .col-messages .messages-count {\n          display: block;\n          font-weight: 600;\n          color: #1e40af;\n          font-size: 16px;\n        }\n\n        .col-contacts .contacts-label,\n        .col-messages .messages-label {\n          font-size: 11px;\n          color: #64748b;\n        }\n\n        .cancel-scheduled-btn {\n          background: transparent;\n          border: none;\n          cursor: pointer;\n          padding: 6px;\n          font-size: 16px;\n          border-radius: 6px;\n          transition: all 0.2s;\n        }\n\n        .cancel-scheduled-btn:hover {\n          background: #fee2e2;\n        }\n\n        .reports-refresh-btn {\n          background: rgba(255, 255, 255, 0.2);\n          border: none;\n          cursor: pointer;\n          padding: 6px 10px;\n          border-radius: 6px;\n          font-size: 16px;\n          margin-left: auto;\n          margin-right: 12px;\n          transition: all 0.2s;\n        }\n\n        .reports-refresh-btn:hover {\n          background: rgba(255, 255, 255, 0.3);\n        }\n\n        .reports-empty-small {\n          padding: 30px 20px;\n          text-align: center;\n          color: #64748b;\n          font-size: 14px;\n        }\n\n        .history-section .section-title {\n          background: #f1f5f9;\n        }\n\n        .reports-view-footer {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 16px 24px;\n          border-top: 1px solid #e2e8f0;\n          background: #f8fafc;\n          border-radius: 0 0 16px 16px;\n        }\n\n        .reports-count {\n          font-size: 14px;\n          color: #64748b;\n        }\n\n        .reports-clear-btn {\n          background: transparent;\n          border: 1px solid #ef4444;\n          color: #ef4444;\n          padding: 8px 16px;\n          border-radius: 8px;\n          font-size: 13px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .reports-clear-btn:hover {\n          background: #ef4444;\n          color: white;\n        }\n\n        /* Resume Campaign Modal Styles */\n        .broadcast-resume-modal-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.6);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 10001;\n          backdrop-filter: blur(4px);\n        }\n\n        .broadcast-resume-modal {\n          background: white;\n          border-radius: 20px;\n          padding: 32px;\n          width: 420px;\n          max-width: 90vw;\n          box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n          animation: resumeModalSlideIn 0.3s ease-out;\n        }\n\n        @keyframes resumeModalSlideIn {\n          from {\n            opacity: 0;\n            transform: scale(0.9) translateY(-20px);\n          }\n          to {\n            opacity: 1;\n            transform: scale(1) translateY(0);\n          }\n        }\n\n        .broadcast-resume-header {\n          text-align: center;\n          margin-bottom: 24px;\n        }\n\n        .broadcast-resume-icon {\n          margin-bottom: 16px;\n        }\n\n        .broadcast-resume-header h2 {\n          font-size: 22px;\n          font-weight: 600;\n          color: var(--lion-sidebar-start);\n          margin: 0 0 8px 0;\n        }\n\n        .broadcast-resume-header p {\n          font-size: 14px;\n          color: #64748b;\n          margin: 0;\n        }\n\n        .broadcast-resume-progress {\n          background: #f8fafc;\n          border-radius: 12px;\n          padding: 20px;\n          margin-bottom: 24px;\n        }\n\n        .broadcast-resume-stats {\n          display: flex;\n          justify-content: space-around;\n          margin-bottom: 16px;\n        }\n\n        .broadcast-resume-stat {\n          text-align: center;\n        }\n\n        .broadcast-resume-stat .stat-value {\n          display: block;\n          font-size: 28px;\n          font-weight: 700;\n          color: var(--lion-primary);\n        }\n\n        .broadcast-resume-stat.pending .stat-value {\n          color: #0ea5e9;\n        }\n\n        .broadcast-resume-stat.failed .stat-value {\n          color: #ef4444;\n        }\n\n        .broadcast-resume-stat .stat-label {\n          display: block;\n          font-size: 12px;\n          color: #64748b;\n          margin-top: 4px;\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n        }\n\n        .broadcast-resume-progress-bar {\n          height: 8px;\n          background: #e2e8f0;\n          border-radius: 4px;\n          overflow: hidden;\n          margin-bottom: 8px;\n        }\n\n        .broadcast-resume-progress-fill {\n          height: 100%;\n          background: var(--lion-primary);\n          border-radius: 4px;\n          transition: width 0.3s ease;\n        }\n\n        .broadcast-resume-progress-text {\n          display: block;\n          text-align: center;\n          font-size: 13px;\n          color: #64748b;\n        }\n\n        .broadcast-resume-actions {\n          display: flex;\n          flex-direction: column;\n          gap: 12px;\n        }\n\n        .broadcast-resume-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 8px;\n          padding: 14px 24px;\n          border-radius: 12px;\n          font-size: 15px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n          border: none;\n        }\n\n        .broadcast-resume-btn.primary {\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        .broadcast-resume-btn.primary:hover {\n          transform: translateY(-2px);\n          box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);\n        }\n\n        .broadcast-resume-btn.secondary {\n          background: #f1f5f9;\n          color: #64748b;\n        }\n\n        .broadcast-resume-btn.secondary:hover {\n          background: #e2e8f0;\n          color: #475569;\n        }\n\n        .broadcast-resume-btn.dismiss {\n          background: transparent;\n          color: #94a3b8;\n          border: 1px dashed #cbd5e1;\n          padding: 10px 24px;\n          font-size: 13px;\n        }\n\n        .broadcast-resume-btn.dismiss:hover {\n          background: #f8fafc;\n          color: #64748b;\n          border-color: #94a3b8;\n        }\n\n        /* ========== CAMPAIGN WIZARD LAYOUT ========== */\n        .broadcast-wizard-content {\n          flex-direction: column !important;\n          overflow-y: auto !important;\n          padding: 24px 28px !important;\n        }\n\n        .broadcast-wizard-content .broadcast-left-panel,\n        .broadcast-wizard-content .broadcast-right-panel {\n          width: 100% !important;\n          max-width: 100% !important;\n          flex: none !important;\n          height: auto !important;\n          max-height: none !important;\n          overflow: visible !important;\n          border-right: none !important;\n          padding: 0 !important;\n          background: transparent !important;\n        }\n\n        /* ========== CAMPAIGN WIZARD STEP INDICATOR ========== */\n        .campaign-step-indicator {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 0;\n          padding: 16px 28px;\n          background: var(--lion-bg-secondary, #fafafa);\n          border-bottom: 1px solid var(--lion-border-light, #e5e7eb);\n          flex-shrink: 0;\n        }\n\n        .campaign-step {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          gap: 8px;\n          min-width: 70px;\n        }\n\n        .campaign-step-circle {\n          width: 36px;\n          height: 36px;\n          border-radius: 50%;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          font-size: 14px;\n          font-weight: 700;\n          background: var(--lion-bg-tertiary, #f4f4f5);\n          color: var(--lion-text-muted, #6b7280);\n          border: 2px solid var(--lion-border-light, #e5e7eb);\n          transition: all 0.3s ease;\n        }\n\n        .campaign-step.active .campaign-step-circle {\n          background: var(--lion-primary);\n          color: #ffffff;\n          border-color: var(--lion-primary);\n          box-shadow: 0 2px 12px rgba(var(--lion-primary-rgb), 0.35);\n        }\n\n        .campaign-step.completed .campaign-step-circle {\n          background: var(--lion-primary);\n          color: #ffffff;\n          border-color: var(--lion-primary);\n        }\n\n        .campaign-step-label {\n          font-size: 11px;\n          font-weight: 600;\n          color: var(--lion-text-muted, #6b7280);\n          text-align: center;\n          white-space: nowrap;\n        }\n\n        .campaign-step.active .campaign-step-label {\n          color: var(--lion-primary);\n        }\n\n        .campaign-step.completed .campaign-step-label {\n          color: var(--lion-text-secondary, #374151);\n        }\n\n        .campaign-step-line {\n          width: 50px;\n          height: 2px;\n          background: var(--lion-border-light, #e5e7eb);\n          margin: 0 4px;\n          margin-bottom: 26px;\n          transition: background 0.3s ease;\n        }\n\n        .campaign-step-line.completed {\n          background: var(--lion-primary);\n        }\n\n        /* ========== CAMPAIGN WIZARD FOOTER ========== */\n        .campaign-wizard-footer {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 14px 28px;\n          border-top: 1px solid var(--lion-border-light, #e5e7eb);\n          background: var(--lion-bg-primary, #ffffff);\n          flex-shrink: 0;\n          z-index: 10;\n          position: relative;\n        }\n\n        .campaign-wizard-footer-right {\n          display: flex;\n          gap: 10px;\n          align-items: center;\n        }\n\n        .broadcast-btn-secondary {\n          background: var(--lion-bg-primary, #ffffff) !important;\n          color: var(--lion-text-secondary, #374151) !important;\n          border: 1px solid var(--lion-border-light, #e5e7eb) !important;\n          border-radius: 10px;\n          padding: 10px 20px;\n          font-weight: 600;\n          font-size: 13px;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .broadcast-btn-secondary:hover {\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n          background: rgba(var(--lion-primary-rgb), 0.04) !important;\n        }\n\n        .broadcast-btn-primary {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border: none !important;\n          border-radius: 10px;\n          padding: 10px 20px;\n          font-weight: 600;\n          font-size: 13px;\n          cursor: pointer;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n          transition: all 0.2s;\n        }\n\n        .broadcast-btn-primary:hover {\n          transform: translateY(-1px);\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35);\n        }\n\n        /* ========== STEP 5: REVIEW & SEND ========== */\n        .broadcast-step-review {\n          display: flex;\n          flex-direction: column;\n          gap: 20px;\n        }\n\n        .campaign-summary-card {\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 14px;\n          padding: 20px;\n          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);\n        }\n\n        .campaign-summary-grid {\n          display: grid;\n          grid-template-columns: repeat(3, 1fr);\n          gap: 12px;\n        }\n\n        .summary-stat {\n          background: var(--lion-bg-secondary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 10px;\n          padding: 12px 14px;\n          display: flex;\n          flex-direction: column;\n          gap: 4px;\n        }\n\n        .summary-stat-label {\n          font-size: 11px;\n          font-weight: 700;\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n          color: var(--lion-text-muted);\n        }\n\n        .summary-stat-value {\n          font-size: 16px;\n          font-weight: 700;\n          color: var(--lion-text-primary);\n        }\n\n        .summary-badge {\n          display: inline-flex;\n          align-items: center;\n          padding: 4px 10px;\n          border-radius: 6px;\n          font-size: 11px;\n          font-weight: 600;\n        }\n\n        .summary-badge.active {\n          background: rgba(16, 185, 129, 0.1);\n          color: #10b981;\n          border: 1px solid rgba(16, 185, 129, 0.2);\n        }\n\n        .summary-badge.warning {\n          background: rgba(245, 158, 11, 0.1);\n          color: #0ea5e9;\n          border: 1px solid rgba(245, 158, 11, 0.2);\n        }\n\n        .summary-badge.info {\n          background: rgba(59, 130, 246, 0.1);\n          color: #3b82f6;\n          border: 1px solid rgba(59, 130, 246, 0.2);\n        }\n\n        /* Warning Banner */\n        .campaign-warning-banner {\n          display: flex;\n          gap: 14px;\n          padding: 16px 20px;\n          background: rgba(245, 158, 11, 0.08);\n          border: 1px solid rgba(245, 158, 11, 0.25);\n          border-radius: 12px;\n          color: var(--lion-text-secondary);\n        }\n\n        .campaign-warning-banner .warning-icon {\n          font-size: 24px;\n          flex-shrink: 0;\n        }\n\n        .campaign-warning-banner .warning-content strong {\n          font-size: 14px;\n          color: #1e40af;\n        }\n\n        /* WhatsApp Message Preview */\n        .wa-preview-container {\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 14px;\n          padding: 20px;\n        }\n\n        .wa-preview-chat {\n          background: #e5ddd5;\n          border-radius: 10px;\n          padding: 16px;\n          display: flex;\n          flex-direction: column;\n          gap: 8px;\n          max-height: 300px;\n          overflow-y: auto;\n          background-image: url("data:image/svg+xml,%3Csvg width=\'60\' height=\'60\' viewBox=\'0 0 60 60\' xmlns=\'http://www.w3.org/2000/svg\'%3E%3Cg fill=\'%23c8c0b8\' fill-opacity=\'0.15\'%3E%3Ccircle cx=\'30\' cy=\'30\' r=\'2\'/%3E%3C/g%3E%3C/svg%3E");\n        }\n\n        .wa-preview-bubble.outgoing {\n          align-self: flex-end;\n          background: #dcf8c6;\n          border-radius: 8px 0 8px 8px;\n          padding: 8px 12px;\n          max-width: 80%;\n          box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);\n          position: relative;\n        }\n\n        .wa-preview-text {\n          font-size: 14px;\n          color: #111b21;\n          line-height: 1.5;\n          white-space: pre-wrap;\n          word-break: break-word;\n        }\n\n        .wa-preview-media {\n          font-size: 12px;\n          color: #667781;\n          padding: 6px 10px;\n          background: rgba(0, 0, 0, 0.05);\n          border-radius: 6px;\n          margin-bottom: 6px;\n        }\n\n        .wa-preview-signature {\n          font-size: 12px;\n          color: #667781;\n          font-style: italic;\n          margin-top: 4px;\n          padding-top: 4px;\n          border-top: 1px solid rgba(0, 0, 0, 0.08);\n        }\n\n        .wa-preview-time {\n          font-size: 10px;\n          color: #667781;\n          text-align: right;\n          margin-top: 2px;\n        }\n\n        /* Confirmation Checkbox */\n        .send-confirm-checkbox {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          padding: 14px 18px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 12px;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .send-confirm-checkbox:hover {\n          border-color: var(--lion-primary);\n          background: rgba(var(--lion-primary-rgb), 0.03);\n        }\n\n        .send-confirm-checkbox input[type="checkbox"] {\n          width: 18px;\n          height: 18px;\n          accent-color: var(--lion-primary);\n          cursor: pointer;\n          flex-shrink: 0;\n        }\n\n        .send-confirm-checkbox span {\n          font-size: 13px;\n          font-weight: 600;\n          color: var(--lion-text-secondary);\n        }\n\n\n        /* ============================================================ */\n        /* ============== V3 COMPLETE REDESIGN (LIGHT) ================ */\n        /* Clean modern SaaS modal matching header design               */\n        /* ============================================================ */\n\n        /* === MODAL CONTAINER - Smaller, cleaner === */\n        .broadcast-modal-overlay .broadcast-modal {\n          background: #ffffff !important;\n          border-radius: 16px !important;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0,0,0,0.05) !important;\n          overflow: hidden !important;\n          width: 92% !important;\n          max-width: 1240px !important;\n          height: 88vh !important;\n          max-height: 88vh !important;\n          border: 1px solid #e5e7eb !important;\n        }\n\n        .broadcast-modal-overlay {\n          background: rgba(0, 0, 0, 0.55) !important;\n          backdrop-filter: blur(6px) !important;\n        }\n\n        /* === SIDEBAR === */\n        .broadcast-modal-overlay .broadcast-sidebar {\n          background: #fafafa !important;\n          border-right: 1px solid #f0f0f0 !important;\n          border-radius: 16px 0 0 16px !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-sidebar-header {\n          border-bottom: 1px solid #f0f0f0 !important;\n          color: #1f2937 !important;\n          background: #ffffff !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-sidebar-header svg {\n          color: var(--lion-primary) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-nav {\n          padding: 16px 10px !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-nav-item {\n          color: #52525b !important;\n          font-weight: 600 !important;\n          border-radius: 10px !important;\n          padding: 11px 14px !important;\n          font-size: 13px !important;\n          background: transparent !important;\n          border: 1px solid transparent !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-nav-item:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          color: var(--lion-primary) !important;\n          border-color: rgba(var(--lion-primary-rgb), 0.15) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-nav-item.active {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.28) !important;\n          border-color: transparent !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-nav-item.active svg {\n          color: #ffffff !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-sidebar-footer {\n          border-top: 1px solid #f0f0f0 !important;\n          padding: 14px 12px !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-close-sidebar-btn {\n          background: rgba(239, 68, 68, 0.08) !important;\n          color: #ef4444 !important;\n          border: 1px solid rgba(239, 68, 68, 0.2) !important;\n          border-radius: 10px !important;\n          font-weight: 600 !important;\n          padding: 10px 14px !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-close-sidebar-btn:hover {\n          background: rgba(239, 68, 68, 0.15) !important;\n          border-color: rgba(239, 68, 68, 0.35) !important;\n        }\n\n        /* === MAIN CONTENT HEADER === */\n        .broadcast-modal-overlay .broadcast-main {\n          background: #ffffff !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-header {\n          background: #ffffff !important;\n          background-image: none !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n          color: #1f2937 !important;\n          padding: 20px 28px !important;\n          box-shadow: none !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-header h2,\n        .broadcast-modal-overlay .broadcast-header-title {\n          color: #1f2937 !important;\n          font-size: 19px !important;\n          font-weight: 700 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-header p,\n        .broadcast-modal-overlay .broadcast-header-subtitle {\n          color: #6b7280 !important;\n          font-size: 13px !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-header-close,\n        .broadcast-modal-overlay .broadcast-close-btn {\n          background: #f4f4f5 !important;\n          border: 1px solid #e5e7eb !important;\n          color: #52525b !important;\n          border-radius: 10px !important;\n          width: 36px !important;\n          height: 36px !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-header-close:hover,\n        .broadcast-modal-overlay .broadcast-close-btn:hover {\n          background: rgba(239, 68, 68, 0.1) !important;\n          color: #ef4444 !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n        }\n\n        /* === CONTENT AREA === */\n        .broadcast-modal-overlay .broadcast-content {\n          background: #fafafa !important;\n          padding: 0 !important;\n        }\n\n        /* === CARDS === */\n        .broadcast-modal-overlay .broadcast-card {\n          background: #ffffff !important;\n          border: 1px solid #f0f0f0 !important;\n          border-radius: 14px !important;\n          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-card-header {\n          border-bottom: 1px solid #f0f0f0 !important;\n          padding: 14px 18px !important;\n          background: #ffffff !important;\n          background-image: none !important;\n          color: #1f2937 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-card-title {\n          color: #1f2937 !important;\n          font-size: 14px !important;\n          font-weight: 700 !important;\n        }\n\n        /* === BUTTONS === */\n        .broadcast-modal-overlay .broadcast-btn,\n        .broadcast-modal-overlay .broadcast-btn-primary,\n        .broadcast-modal-overlay .btn-primary {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border: none !important;\n          border-radius: 10px !important;\n          padding: 10px 18px !important;\n          font-weight: 600 !important;\n          font-size: 13px !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n          transition: all 0.15s ease !important;\n          cursor: pointer !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-btn:hover,\n        .broadcast-modal-overlay .broadcast-btn-primary:hover,\n        .broadcast-modal-overlay .btn-primary:hover {\n          transform: translateY(-1px) !important;\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-btn-secondary,\n        .broadcast-modal-overlay .btn-secondary {\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          color: #374151 !important;\n          border-radius: 10px !important;\n          padding: 10px 16px !important;\n          font-weight: 600 !important;\n          font-size: 13px !important;\n          box-shadow: none !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-btn-secondary:hover,\n        .broadcast-modal-overlay .btn-secondary:hover {\n          background: var(--lion-primary-light, #eff6ff) !important;\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        /* Contacts/Groups mode toggle */\n        .broadcast-modal-overlay .broadcast-mode-btn {\n          background: transparent !important;\n          background-image: none !important;\n          border: 1px solid transparent !important;\n          color: #6b7280 !important;\n          border-radius: 10px !important;\n          font-weight: 600 !important;\n          padding: 10px 16px !important;\n          box-shadow: none !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-mode-btn:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-mode-btn.active {\n          background: var(--lion-primary) !important;\n          background-image: none !important;\n          color: #ffffff !important;\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n        }\n\n        /* === INPUTS / TEXTAREAS / SELECTS === */\n        .broadcast-modal-overlay input[type="text"],\n        .broadcast-modal-overlay input[type="number"],\n        .broadcast-modal-overlay input[type="tel"],\n        .broadcast-modal-overlay input[type="date"],\n        .broadcast-modal-overlay input[type="time"],\n        .broadcast-modal-overlay input[type="datetime-local"],\n        .broadcast-modal-overlay input[type="search"],\n        .broadcast-modal-overlay textarea,\n        .broadcast-modal-overlay select,\n        .broadcast-modal-overlay .broadcast-phone-input,\n        .broadcast-modal-overlay .broadcast-message-textarea {\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          border-radius: 10px !important;\n          padding: 10px 14px !important;\n          color: #1f2937 !important;\n          font-size: 13px !important;\n          transition: all 0.15s ease !important;\n          box-shadow: none !important;\n        }\n\n        .broadcast-modal-overlay input:focus,\n        .broadcast-modal-overlay textarea:focus,\n        .broadcast-modal-overlay select:focus {\n          outline: none !important;\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12) !important;\n        }\n\n        .broadcast-modal-overlay input::placeholder,\n        .broadcast-modal-overlay textarea::placeholder {\n          color: #9ca3af !important;\n        }\n\n        /* === TOGGLES === */\n        .broadcast-modal-overlay .broadcast-toggle,\n        .broadcast-modal-overlay .toggle-switch,\n        .broadcast-modal-overlay .toggle-slider {\n          background: #e5e7eb !important;\n          border: none !important;\n          box-shadow: none !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-toggle.active,\n        .broadcast-modal-overlay .toggle-switch.active,\n        .broadcast-modal-overlay input[type="checkbox"]:checked + .toggle-slider {\n          background: var(--lion-primary) !important;\n        }\n\n        /* === BADGES === */\n        .broadcast-modal-overlay .broadcast-badge,\n        .broadcast-modal-overlay .broadcast-count-badge,\n        .broadcast-modal-overlay .recipients-count {\n          background: rgba(var(--lion-primary-rgb), 0.1) !important;\n          color: var(--lion-primary) !important;\n          font-weight: 700 !important;\n          border-radius: 999px !important;\n          padding: 3px 12px !important;\n          font-size: 11px !important;\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.2) !important;\n        }\n\n        /* === MESSAGE BOXES === */\n        .broadcast-modal-overlay .broadcast-message-box,\n        .broadcast-modal-overlay .message-box {\n          background: #ffffff !important;\n          border: 1px solid #f0f0f0 !important;\n          border-radius: 12px !important;\n          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-message-box.active,\n        .broadcast-modal-overlay .message-box.active {\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.08), 0 2px 6px rgba(0,0,0,0.04) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-message-header,\n        .broadcast-modal-overlay .message-box-header {\n          background: #fafafa !important;\n          background-image: none !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n        }\n\n        /* === NESTED MODALS === */\n        .broadcast-modal-overlay .broadcast-resume-modal,\n        .broadcast-modal-overlay .preview-modal,\n        .broadcast-modal-overlay .queue-view-modal,\n        .broadcast-modal-overlay .reports-view-modal,\n        .broadcast-modal-overlay .upload-wizard-modal {\n          background: #ffffff !important;\n          border: 1px solid #f0f0f0 !important;\n          border-radius: 16px !important;\n          box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-resume-modal-overlay,\n        .broadcast-modal-overlay .preview-modal-overlay,\n        .broadcast-modal-overlay .queue-view-modal-overlay,\n        .broadcast-modal-overlay .reports-view-modal-overlay,\n        .broadcast-modal-overlay .upload-wizard-overlay {\n          background: rgba(0, 0, 0, 0.55) !important;\n          backdrop-filter: blur(4px) !important;\n        }\n\n        /* === RESUME MODAL BUTTONS === */\n        .broadcast-modal-overlay .broadcast-resume-btn {\n          border-radius: 10px !important;\n          font-weight: 600 !important;\n          font-size: 13px !important;\n          padding: 10px 18px !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-resume-btn.primary {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border: none !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-resume-btn.primary:hover {\n          transform: translateY(-1px);\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-resume-btn.secondary {\n          background: rgba(239, 68, 68, 0.08) !important;\n          color: #ef4444 !important;\n          border: 1px solid rgba(239, 68, 68, 0.2) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-resume-btn.secondary:hover {\n          background: rgba(239, 68, 68, 0.15) !important;\n          border-color: rgba(239, 68, 68, 0.35) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-resume-btn.dismiss {\n          background: #ffffff !important;\n          color: #6b7280 !important;\n          border: 1px solid #e5e7eb !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-resume-btn.dismiss:hover {\n          background: #f9fafb !important;\n          border-color: #d1d5db !important;\n          color: #374151 !important;\n        }\n\n        /* === DROPDOWNS === */\n        .broadcast-modal-overlay .broadcast-dropdown,\n        .broadcast-modal-overlay .dropdown-menu,\n        .broadcast-modal-overlay .select-dropdown {\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          border-radius: 12px !important;\n          box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0,0,0,0.06) !important;\n          padding: 6px !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-dropdown-item,\n        .broadcast-modal-overlay .dropdown-item {\n          padding: 10px 14px !important;\n          border-radius: 8px !important;\n          color: #374151 !important;\n          font-size: 13px !important;\n          font-weight: 500 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-dropdown-item:hover,\n        .broadcast-modal-overlay .dropdown-item:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        /* === CHIPS (selected groups/tabs/labels) === */\n        .broadcast-modal-overlay .group-chip,\n        .broadcast-modal-overlay .tab-chip,\n        .broadcast-modal-overlay .label-chip,\n        .broadcast-modal-overlay .selected-chip {\n          background: rgba(var(--lion-primary-rgb), 0.1) !important;\n          color: var(--lion-primary) !important;\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.25) !important;\n          border-radius: 999px !important;\n          padding: 4px 12px !important;\n          font-size: 12px !important;\n          font-weight: 600 !important;\n        }\n\n        .broadcast-modal-overlay .group-chip .remove-btn,\n        .broadcast-modal-overlay .tab-chip .remove-btn,\n        .broadcast-modal-overlay .label-chip .remove-btn,\n        .broadcast-modal-overlay .selected-chip .remove-btn {\n          color: var(--lion-primary) !important;\n          opacity: 0.7 !important;\n        }\n\n        .broadcast-modal-overlay .group-chip .remove-btn:hover,\n        .broadcast-modal-overlay .tab-chip .remove-btn:hover,\n        .broadcast-modal-overlay .label-chip .remove-btn:hover,\n        .broadcast-modal-overlay .selected-chip .remove-btn:hover {\n          opacity: 1 !important;\n        }\n\n        /* === TABLES (uploaded contacts) === */\n        .broadcast-modal-overlay table {\n          background: #ffffff !important;\n          border: 1px solid #f0f0f0 !important;\n          border-radius: 10px !important;\n          overflow: hidden !important;\n        }\n\n        .broadcast-modal-overlay th {\n          background: #fafafa !important;\n          color: #374151 !important;\n          font-weight: 700 !important;\n          font-size: 11px !important;\n          text-transform: uppercase !important;\n          letter-spacing: 0.5px !important;\n          padding: 10px 14px !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n        }\n\n        .broadcast-modal-overlay td {\n          color: #1f2937 !important;\n          padding: 10px 14px !important;\n          border-bottom: 1px solid #f4f4f5 !important;\n          font-size: 13px !important;\n        }\n\n        .broadcast-modal-overlay tr:hover td {\n          background: rgba(var(--lion-primary-rgb), 0.03) !important;\n        }\n\n        /* === SCROLLBARS === */\n        .broadcast-modal-overlay *::-webkit-scrollbar {\n          width: 8px;\n          height: 8px;\n        }\n        .broadcast-modal-overlay *::-webkit-scrollbar-track {\n          background: transparent;\n        }\n        .broadcast-modal-overlay *::-webkit-scrollbar-thumb {\n          background: #e5e7eb;\n          border-radius: 4px;\n        }\n        .broadcast-modal-overlay *::-webkit-scrollbar-thumb:hover {\n          background: #d1d5db;\n        }\n\n        /* ============================================================ */\n        /* ================== V2 DARK MODE OVERRIDES ================== */\n        /* ============================================================ */\n\n        .broadcast-modal-overlay.lion-dark .broadcast-modal {\n          background: #18181b !important;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.06) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-sidebar {\n          background: #1a1a1a !important;\n          border-right-color: #27272a !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-sidebar-header {\n          background: #18181b !important;\n          border-bottom-color: #27272a !important;\n          color: #fafafa !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-nav-item {\n          color: #a1a1aa !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-nav-item.active {\n          color: #ffffff !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-nav-item:hover {\n          background: rgba(var(--lion-primary-rgb), 0.12) !important;\n          color: var(--lion-primary) !important;\n          border-color: rgba(var(--lion-primary-rgb), 0.2) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-sidebar-footer {\n          border-top-color: #27272a !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-main {\n          background: #18181b !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-header {\n          background: #18181b !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-header h2,\n        .broadcast-modal-overlay.lion-dark .broadcast-header-title {\n          color: #fafafa !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-header p,\n        .broadcast-modal-overlay.lion-dark .broadcast-header-subtitle {\n          color: #a1a1aa !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-header-close,\n        .broadcast-modal-overlay.lion-dark .broadcast-close-btn {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #a1a1aa !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-content {\n          background: #1a1a1a !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-card {\n          background: #1f1f22 !important;\n          border-color: #27272a !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-card-header {\n          background: #1f1f22 !important;\n          border-bottom-color: #27272a !important;\n          color: #fafafa !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-card-title {\n          color: #fafafa !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark input[type="text"],\n        .broadcast-modal-overlay.lion-dark input[type="number"],\n        .broadcast-modal-overlay.lion-dark input[type="tel"],\n        .broadcast-modal-overlay.lion-dark input[type="date"],\n        .broadcast-modal-overlay.lion-dark input[type="time"],\n        .broadcast-modal-overlay.lion-dark textarea,\n        .broadcast-modal-overlay.lion-dark select,\n        .broadcast-modal-overlay.lion-dark .broadcast-phone-input,\n        .broadcast-modal-overlay.lion-dark .broadcast-message-textarea {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #fafafa !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark input::placeholder,\n        .broadcast-modal-overlay.lion-dark textarea::placeholder {\n          color: #71717a !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-btn-secondary,\n        .broadcast-modal-overlay.lion-dark .btn-secondary {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #e5e7eb !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-btn-secondary:hover,\n        .broadcast-modal-overlay.lion-dark .btn-secondary:hover {\n          background: rgba(var(--lion-primary-rgb), 0.15) !important;\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-message-box,\n        .broadcast-modal-overlay.lion-dark .message-box {\n          background: #1f1f22 !important;\n          border-color: #27272a !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-message-header,\n        .broadcast-modal-overlay.lion-dark .message-box-header {\n          background: #27272a !important;\n          border-bottom-color: #3f3f46 !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-resume-modal,\n        .broadcast-modal-overlay.lion-dark .preview-modal,\n        .broadcast-modal-overlay.lion-dark .queue-view-modal,\n        .broadcast-modal-overlay.lion-dark .reports-view-modal,\n        .broadcast-modal-overlay.lion-dark .upload-wizard-modal {\n          background: #18181b !important;\n          border-color: #27272a !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark table {\n          background: #1f1f22 !important;\n          border-color: #27272a !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark th {\n          background: #27272a !important;\n          color: #e5e7eb !important;\n          border-bottom-color: #3f3f46 !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark td {\n          color: #fafafa !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark *::-webkit-scrollbar-thumb {\n          background: #3f3f46;\n        }\n\n        .broadcast-modal-overlay.lion-dark *::-webkit-scrollbar-thumb:hover {\n          background: #52525b;\n        }\n\n        /* ============================================================ */\n        /* =============== V3 ADDITIONS & FIXES ======================= */\n        /* Fixes invisible icons/text, heavy buttons, size, spacing     */\n        /* ============================================================ */\n\n        /* === Sidebar logo icon visibility === */\n        .broadcast-modal-overlay .broadcast-sidebar-header {\n          padding: 20px !important;\n          gap: 12px !important;\n          font-size: 16px !important;\n          font-weight: 700 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-logo {\n          width: 36px !important;\n          height: 36px !important;\n          padding: 7px !important;\n          border-radius: 10px !important;\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.3) !important;\n          flex-shrink: 0 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-logo svg,\n        .broadcast-modal-overlay .broadcast-logo path {\n          fill: #ffffff !important;\n          color: #ffffff !important;\n        }\n\n        /* === Nav item icons === */\n        .broadcast-modal-overlay .broadcast-nav-item svg {\n          width: 18px !important;\n          height: 18px !important;\n          flex-shrink: 0 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-nav-item:not(.active) svg path {\n          fill: currentColor !important;\n        }\n\n        /* === Nav badges === */\n        .broadcast-modal-overlay .nav-badge {\n          background: rgba(var(--lion-primary-rgb), 0.15) !important;\n          color: var(--lion-primary) !important;\n          font-weight: 700 !important;\n          font-size: 10px !important;\n          padding: 2px 8px !important;\n          border-radius: 999px !important;\n          margin-left: auto !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-nav-item.active .nav-badge {\n          background: rgba(255, 255, 255, 0.25) !important;\n          color: #ffffff !important;\n        }\n\n        /* === HEADER FIX: use proper classes === */\n        .broadcast-modal-overlay .broadcast-header-content {\n          display: flex !important;\n          flex-direction: column !important;\n          gap: 4px !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-title {\n          color: #1f2937 !important;\n          font-size: 20px !important;\n          font-weight: 700 !important;\n          margin: 0 !important;\n          line-height: 1.2 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-subtitle {\n          color: #6b7280 !important;\n          font-size: 13px !important;\n          margin: 0 !important;\n          line-height: 1.3 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-header-close-btn {\n          background: #f4f4f5 !important;\n          border: 1px solid #e5e7eb !important;\n          color: #52525b !important;\n          border-radius: 10px !important;\n          width: 36px !important;\n          height: 36px !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n          padding: 0 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-header-close-btn:hover {\n          background: rgba(239, 68, 68, 0.1) !important;\n          color: #ef4444 !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-header-close-btn svg {\n          width: 18px !important;\n          height: 18px !important;\n        }\n\n        /* === Card Header: Recipients title fix === */\n        .broadcast-modal-overlay .broadcast-card-header {\n          display: flex !important;\n          align-items: center !important;\n          justify-content: space-between !important;\n          padding: 14px 18px !important;\n          background: #ffffff !important;\n          background-image: none !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-card-header h3,\n        .broadcast-modal-overlay .broadcast-card-header h2,\n        .broadcast-modal-overlay .broadcast-card-header .broadcast-card-title,\n        .broadcast-modal-overlay .broadcast-card-header > span:first-child,\n        .broadcast-modal-overlay .broadcast-card-header > div:first-child {\n          color: #1f2937 !important;\n          font-size: 14px !important;\n          font-weight: 700 !important;\n          display: flex !important;\n          align-items: center !important;\n          gap: 8px !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-card-header svg {\n          color: var(--lion-primary) !important;\n          width: 18px !important;\n          height: 18px !important;\n        }\n\n        /* === Mode selection (Contacts / Groups) === */\n        .broadcast-modal-overlay .broadcast-mode-selection {\n          display: flex !important;\n          gap: 8px !important;\n          padding: 14px 18px !important;\n          background: #ffffff !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-mode-btn {\n          flex: 1 !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          gap: 8px !important;\n          padding: 10px 16px !important;\n          background: #fafafa !important;\n          background-image: none !important;\n          border: 1px solid #e5e7eb !important;\n          color: #6b7280 !important;\n          border-radius: 10px !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n          box-shadow: none !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-mode-btn svg {\n          width: 16px !important;\n          height: 16px !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-mode-btn:hover {\n          background: rgba(var(--lion-primary-rgb), 0.06) !important;\n          border-color: rgba(var(--lion-primary-rgb), 0.2) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-mode-btn.active {\n          background: var(--lion-primary) !important;\n          background-image: none !important;\n          color: #ffffff !important;\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.3) !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-mode-btn.active svg {\n          color: #ffffff !important;\n          fill: #ffffff !important;\n        }\n\n        /* === Phone number textarea === */\n        .broadcast-modal-overlay .broadcast-phone-input {\n          margin: 16px 18px !important;\n          width: calc(100% - 36px) !important;\n          min-height: 160px !important;\n          resize: vertical !important;\n          font-family: inherit !important;\n        }\n\n        /* === Contact action buttons (Upload / Select / Download) === */\n        .broadcast-modal-overlay .broadcast-contact-buttons {\n          display: flex !important;\n          gap: 10px !important;\n          padding: 0 18px 16px !important;\n          flex-wrap: wrap !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-btn-upload,\n        .broadcast-modal-overlay .broadcast-btn-select,\n        .broadcast-modal-overlay .broadcast-btn-download {\n          flex: 1 !important;\n          min-width: 100px !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          gap: 6px !important;\n          padding: 10px 14px !important;\n          background: #ffffff !important;\n          background-image: none !important;\n          border: 1px solid #e5e7eb !important;\n          color: #374151 !important;\n          border-radius: 10px !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          box-shadow: none !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-btn-upload:hover,\n        .broadcast-modal-overlay .broadcast-btn-select:hover,\n        .broadcast-modal-overlay .broadcast-btn-download:hover {\n          background: rgba(var(--lion-primary-rgb), 0.06) !important;\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n          transform: none !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-btn-upload svg,\n        .broadcast-modal-overlay .broadcast-btn-select svg,\n        .broadcast-modal-overlay .broadcast-btn-download svg {\n          width: 15px !important;\n          height: 15px !important;\n          color: currentColor !important;\n        }\n\n        .broadcast-modal-overlay .dropdown-arrow {\n          font-size: 9px !important;\n          opacity: 0.7 !important;\n        }\n\n        /* === Toggle rows with labels === */\n        .broadcast-modal-overlay .broadcast-toggle-row,\n        .broadcast-modal-overlay .broadcast-option-row {\n          display: flex !important;\n          align-items: center !important;\n          justify-content: flex-start !important;\n          gap: 12px !important;\n          padding: 12px 18px !important;\n          border-top: 1px solid #f0f0f0 !important;\n          color: #374151 !important;\n          font-size: 13px !important;\n          font-weight: 500 !important;\n        }\n\n        /* === Send random message checkbox row === */\n        .broadcast-modal-overlay .broadcast-random-message-row,\n        .broadcast-modal-overlay .random-message-container {\n          display: flex !important;\n          align-items: center !important;\n          gap: 10px !important;\n          padding: 14px 18px !important;\n          background: #ffffff !important;\n          border: 1px solid #f0f0f0 !important;\n          border-radius: 14px !important;\n          color: #374151 !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;\n        }\n\n        /* === Custom checkbox styling === */\n        .broadcast-modal-overlay input[type="checkbox"] {\n          width: 18px !important;\n          height: 18px !important;\n          accent-color: var(--lion-primary) !important;\n          cursor: pointer !important;\n        }\n\n        /* === Add Message button (primary action) === */\n        .broadcast-modal-overlay .broadcast-add-message-btn,\n        .broadcast-modal-overlay .add-message-btn {\n          display: inline-flex !important;\n          align-items: center !important;\n          gap: 8px !important;\n          padding: 10px 18px !important;\n          background: #ffffff !important;\n          border: 1px solid var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n          border-radius: 10px !important;\n          font-size: 13px !important;\n          font-weight: 700 !important;\n          cursor: pointer !important;\n          box-shadow: 0 2px 6px rgba(var(--lion-primary-rgb), 0.12) !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-add-message-btn:hover,\n        .broadcast-modal-overlay .add-message-btn:hover {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.3) !important;\n          transform: translateY(-1px) !important;\n        }\n\n        /* === Pause Setting toggle card === */\n        .broadcast-modal-overlay .pause-setting,\n        .broadcast-modal-overlay .broadcast-pause-row {\n          display: flex !important;\n          align-items: center !important;\n          gap: 12px !important;\n          padding: 14px 18px !important;\n          background: #ffffff !important;\n          border: 1px solid #f0f0f0 !important;\n          border-radius: 14px !important;\n          color: #374151 !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;\n          margin-bottom: 12px !important;\n        }\n\n        /* === Message Type dropdown === */\n        .broadcast-modal-overlay .broadcast-template-type,\n        .broadcast-modal-overlay .message-type-select,\n        .broadcast-modal-overlay .broadcast-message-type-wrapper {\n          padding: 14px 18px !important;\n          background: #ffffff !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n        }\n\n        /* === Message textarea === */\n        .broadcast-modal-overlay .broadcast-message-textarea {\n          width: 100% !important;\n          min-height: 180px !important;\n          resize: vertical !important;\n          font-family: inherit !important;\n          line-height: 1.5 !important;\n        }\n\n        /* === CRITICAL LAYOUT: Fullscreen overlay + centered modal === */\n        .broadcast-modal-overlay {\n          position: fixed !important;\n          top: 0 !important;\n          left: 0 !important;\n          right: 0 !important;\n          bottom: 0 !important;\n          width: 100vw !important;\n          height: 100vh !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          background: rgba(0, 0, 0, 0.55) !important;\n          backdrop-filter: blur(6px) !important;\n          -webkit-backdrop-filter: blur(6px) !important;\n          z-index: 10000 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-modal {\n          display: flex !important;\n          flex-direction: row !important;\n          height: 88vh !important;\n          max-height: 88vh !important;\n          overflow: hidden !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-sidebar {\n          flex-shrink: 0 !important;\n          height: 100% !important;\n          display: flex !important;\n          flex-direction: column !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-main {\n          flex: 1 1 auto !important;\n          display: flex !important;\n          flex-direction: column !important;\n          height: 100% !important;\n          min-height: 0 !important;\n          min-width: 0 !important;\n          overflow: hidden !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-header {\n          flex-shrink: 0 !important;\n        }\n\n        /* Content area (below header) fills remaining height */\n        .broadcast-modal-overlay .broadcast-content {\n          flex: 1 1 auto !important;\n          display: flex !important;\n          flex-direction: row !important;\n          min-height: 0 !important;\n          overflow: hidden !important;\n        }\n\n        /* BOTH panels scrollable independently */\n        .broadcast-modal-overlay .broadcast-left-panel {\n          flex: 0 0 42% !important;\n          max-width: 42% !important;\n          min-width: 0 !important;\n          height: 100% !important;\n          max-height: 100% !important;\n          overflow-y: scroll !important;\n          overflow-x: hidden !important;\n          padding: 20px !important;\n          box-sizing: border-box !important;\n          background: #ffffff !important;\n          border-right: 1px solid #f0f0f0 !important;\n          display: flex !important;\n          flex-direction: column !important;\n          gap: 14px !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-right-panel {\n          flex: 1 1 auto !important;\n          min-width: 0 !important;\n          height: 100% !important;\n          max-height: 100% !important;\n          overflow-y: scroll !important;\n          overflow-x: hidden !important;\n          padding: 20px !important;\n          box-sizing: border-box !important;\n          background: #fafafa !important;\n          background-image: none !important;\n          display: flex !important;\n          flex-direction: column !important;\n          gap: 14px !important;\n        }\n\n        /* === WIZARD MODE: Full-width single column === */\n        .broadcast-modal-overlay .broadcast-wizard-content {\n          flex-direction: column !important;\n          overflow-y: auto !important;\n          overflow-x: hidden !important;\n          padding: 24px 28px !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-wizard-content .broadcast-left-panel,\n        .broadcast-modal-overlay .broadcast-wizard-content .broadcast-right-panel {\n          flex: none !important;\n          width: 100% !important;\n          max-width: 100% !important;\n          height: auto !important;\n          max-height: none !important;\n          overflow: visible !important;\n          overflow-y: visible !important;\n          border-right: none !important;\n          padding: 0 !important;\n          background: transparent !important;\n        }\n\n        /* Wizard content: scroll internally, keep footer fixed at bottom */\n        .broadcast-modal-overlay .broadcast-wizard-content {\n          flex: 1 1 auto !important;\n          min-height: 0 !important;\n          overflow-y: auto !important;\n          overflow-x: hidden !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-wizard-content .broadcast-card {\n          overflow: visible !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-wizard-content .select-dropdown-menu {\n          z-index: 1000 !important;\n        }\n\n        /* === RECURRING SECTION V3 OVERRIDES === */\n        .broadcast-modal-overlay .recurring-section {\n          background: var(--lion-bg-primary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          border-radius: 14px !important;\n          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;\n          padding: 20px !important;\n          margin-top: 16px !important;\n        }\n\n        .broadcast-modal-overlay .recurring-header {\n          border-bottom: 1px solid var(--lion-border-light) !important;\n          padding-bottom: 14px !important;\n          margin-bottom: 16px !important;\n        }\n\n        .broadcast-modal-overlay .recurring-toggle span:last-child {\n          background: none !important;\n          -webkit-background-clip: unset !important;\n          -webkit-text-fill-color: var(--lion-text-primary) !important;\n          background-clip: unset !important;\n          font-size: 14px !important;\n          font-weight: 600 !important;\n        }\n\n        .broadcast-modal-overlay .recurring-select {\n          background: var(--lion-bg-primary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          border-radius: 10px !important;\n          padding: 10px 14px !important;\n          font-size: 13px !important;\n          font-weight: 500 !important;\n          color: var(--lion-text-primary) !important;\n          box-shadow: none !important;\n        }\n\n        .broadcast-modal-overlay .recurring-select:focus {\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12) !important;\n        }\n\n        .broadcast-modal-overlay .recurring-input-group label,\n        .broadcast-modal-overlay .recurring-days-group label {\n          color: var(--lion-text-muted) !important;\n          font-size: 12px !important;\n        }\n\n        .broadcast-modal-overlay .recurring-input-group label::before,\n        .broadcast-modal-overlay .recurring-days-group label::before {\n          display: none !important;\n        }\n\n        .broadcast-modal-overlay .recurring-options {\n          gap: 16px !important;\n        }\n\n        .broadcast-modal-overlay .day-chip {\n          background: var(--lion-bg-primary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          border-radius: 10px !important;\n          padding: 10px 6px !important;\n          font-size: 11px !important;\n          color: var(--lion-text-secondary) !important;\n          box-shadow: none !important;\n        }\n\n        .broadcast-modal-overlay .day-chip:hover {\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n          transform: none !important;\n          box-shadow: none !important;\n        }\n\n        .broadcast-modal-overlay .day-chip.selected {\n          background: var(--lion-primary) !important;\n          border-color: var(--lion-primary) !important;\n          color: #ffffff !important;\n          transform: none !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n        }\n\n        .broadcast-modal-overlay .month-chip {\n          background: var(--lion-bg-primary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          border-radius: 10px !important;\n          padding: 10px 6px !important;\n          color: var(--lion-text-secondary) !important;\n          box-shadow: none !important;\n        }\n\n        .broadcast-modal-overlay .month-chip:hover {\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n          transform: none !important;\n        }\n\n        .broadcast-modal-overlay .month-chip.selected {\n          background: var(--lion-primary) !important;\n          border-color: var(--lion-primary) !important;\n          color: #ffffff !important;\n          transform: none !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n        }\n\n        /* Calendar light mode fix */\n        .broadcast-modal-overlay .full-calendar-container {\n          border: 1px solid var(--lion-border-light) !important;\n          border-radius: 12px !important;\n          background: var(--lion-bg-primary) !important;\n        }\n\n        .broadcast-modal-overlay .full-calendar-header {\n          background: var(--lion-bg-secondary) !important;\n          border-bottom: 1px solid var(--lion-border-light) !important;\n        }\n\n        .broadcast-modal-overlay .calendar-title {\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay .calendar-nav-btn {\n          border: 1px solid var(--lion-border-light) !important;\n          background: var(--lion-bg-primary) !important;\n          color: var(--lion-text-secondary) !important;\n        }\n\n        .broadcast-modal-overlay .calendar-nav-btn:hover {\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        .broadcast-modal-overlay .full-calendar-weekdays {\n          background: var(--lion-bg-secondary) !important;\n          border-bottom: 1px solid var(--lion-border-light) !important;\n        }\n\n        .broadcast-modal-overlay .calendar-weekday {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .broadcast-modal-overlay .full-calendar-grid {\n          background: var(--lion-bg-primary) !important;\n        }\n\n        .broadcast-modal-overlay .full-calendar-date {\n          background: var(--lion-bg-primary) !important;\n          color: var(--lion-text-primary) !important;\n          border: 1px solid transparent !important;\n        }\n\n        .broadcast-modal-overlay .full-calendar-date:hover {\n          border-color: var(--lion-primary) !important;\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n        }\n\n        .broadcast-modal-overlay .full-calendar-date.selected {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n        }\n\n        .broadcast-modal-overlay .full-calendar-date.other-month {\n          color: var(--lion-text-light) !important;\n        }\n\n        .broadcast-modal-overlay .full-calendar-info {\n          background: rgba(var(--lion-primary-rgb), 0.06) !important;\n          color: var(--lion-text-muted) !important;\n          border-top: 1px solid var(--lion-border-light) !important;\n        }\n\n        .broadcast-modal-overlay .recurring-end-group label,\n        .broadcast-modal-overlay .recurring-end-options label {\n          color: var(--lion-text-secondary) !important;\n        }\n\n        /* Recurring info tooltip — fixed position to escape all overflow */\n        .broadcast-modal-overlay .recurring-info-wrapper {\n          position: static !important;\n        }\n\n        .broadcast-modal-overlay .recurring-info-tooltip {\n          position: fixed !important;\n          top: auto !important;\n          bottom: auto !important;\n          right: auto !important;\n          left: 50% !important;\n          top: 50% !important;\n          transform: translate(-50%, -50%) !important;\n          width: 320px !important;\n          padding: 20px !important;\n          background: #ffffff !important;\n          border: 1px solid var(--lion-border-light) !important;\n          border-radius: 14px !important;\n          box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25) !important;\n          z-index: 99999 !important;\n          font-size: 13px !important;\n          line-height: 1.6 !important;\n          color: var(--lion-text-secondary) !important;\n        }\n\n        .broadcast-modal-overlay .recurring-info-tooltip::before {\n          display: none !important;\n        }\n\n        .broadcast-modal-overlay .tooltip-title {\n          color: var(--lion-text-primary) !important;\n          font-size: 14px !important;\n          font-weight: 700 !important;\n          border-bottom: 1px solid var(--lion-border-light) !important;\n          margin-bottom: 12px !important;\n          padding-bottom: 10px !important;\n        }\n\n        .broadcast-modal-overlay .tooltip-list li {\n          color: var(--lion-text-secondary) !important;\n          font-size: 13px !important;\n          margin-bottom: 8px !important;\n        }\n\n        .broadcast-modal-overlay .tooltip-list li::before {\n          color: var(--lion-primary) !important;\n        }\n\n        /* Auto-send info bar — clean style */\n        .broadcast-modal-overlay .broadcast-schedule-section .broadcast-toggle,\n        .broadcast-modal-overlay .schedule-auto-send {\n          background: var(--lion-bg-primary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          border-radius: 10px !important;\n          padding: 10px 14px !important;\n        }\n\n        /* === QUEUE VIEW V3 OVERRIDES === */\n        .broadcast-modal-overlay .queue-view-overlay {\n          background: rgba(0, 0, 0, 0.55) !important;\n          backdrop-filter: blur(6px) !important;\n        }\n\n        .broadcast-modal-overlay .queue-view-modal {\n          background: var(--lion-bg-primary) !important;\n          border-radius: 16px !important;\n          width: 92% !important;\n          max-width: 800px !important;\n          height: auto !important;\n          max-height: 80vh !important;\n          border: 1px solid var(--lion-border-light) !important;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22) !important;\n        }\n\n        .broadcast-modal-overlay .queue-view-header {\n          background: var(--lion-bg-primary) !important;\n          color: var(--lion-text-primary) !important;\n          border-bottom: 1px solid var(--lion-border-light) !important;\n          border-radius: 16px 16px 0 0 !important;\n          padding: 16px 24px !important;\n        }\n\n        .broadcast-modal-overlay .queue-view-header h2 {\n          color: var(--lion-text-primary) !important;\n          font-size: 17px !important;\n          font-weight: 700 !important;\n        }\n\n        .broadcast-modal-overlay .queue-stats .stat {\n          font-size: 13px !important;\n          font-weight: 600 !important;\n        }\n\n        .broadcast-modal-overlay .queue-pause-btn {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border: none !important;\n          border-radius: 10px !important;\n          padding: 8px 16px !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          display: flex !important;\n          align-items: center !important;\n          gap: 6px !important;\n        }\n\n        .broadcast-modal-overlay .queue-pause-btn.paused {\n          background: linear-gradient(135deg, #10b981, #059669) !important;\n        }\n\n        .broadcast-modal-overlay .queue-close-btn {\n          width: 34px !important;\n          height: 34px !important;\n          border-radius: 10px !important;\n          background: var(--lion-bg-tertiary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          color: var(--lion-text-muted) !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          padding: 0 !important;\n          cursor: pointer !important;\n        }\n\n        .broadcast-modal-overlay .queue-close-btn:hover {\n          background: rgba(239, 68, 68, 0.1) !important;\n          color: #ef4444 !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n        }\n\n        .broadcast-modal-overlay .queue-view-content {\n          padding: 0 !important;\n          flex: 1 !important;\n          overflow-y: auto !important;\n        }\n\n        .broadcast-modal-overlay .queue-item {\n          padding: 12px 24px !important;\n          border-bottom: 1px solid var(--lion-border-light) !important;\n          display: flex !important;\n          align-items: center !important;\n          gap: 12px !important;\n          background: var(--lion-bg-primary) !important;\n        }\n\n        .broadcast-modal-overlay .queue-item:hover {\n          background: var(--lion-bg-secondary) !important;\n        }\n\n        .broadcast-modal-overlay .queue-item-index {\n          width: 28px !important;\n          height: 28px !important;\n          border-radius: 50% !important;\n          background: var(--lion-bg-tertiary) !important;\n          color: var(--lion-text-muted) !important;\n          font-size: 12px !important;\n          font-weight: 600 !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n        }\n\n        .broadcast-modal-overlay .queue-item-name {\n          font-size: 14px !important;\n          font-weight: 600 !important;\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay .queue-item-phone {\n          font-size: 12px !important;\n          color: var(--lion-text-muted) !important;\n        }\n\n        .broadcast-modal-overlay .queue-progress {\n          padding: 14px 24px !important;\n          border-top: 1px solid var(--lion-border-light) !important;\n          background: var(--lion-bg-secondary) !important;\n          border-radius: 0 0 16px 16px !important;\n        }\n\n        .broadcast-modal-overlay .queue-progress-bar {\n          height: 4px !important;\n          background: var(--lion-bg-tertiary) !important;\n          border-radius: 2px !important;\n          overflow: hidden !important;\n        }\n\n        .broadcast-modal-overlay .queue-progress-fill {\n          height: 100% !important;\n          background: var(--lion-primary) !important;\n          border-radius: 2px !important;\n          transition: width 0.3s ease !important;\n        }\n\n        .broadcast-modal-overlay .queue-progress-text {\n          text-align: center !important;\n          font-size: 12px !important;\n          color: var(--lion-text-muted) !important;\n          margin-top: 8px !important;\n        }\n\n        /* Wizard mode: ensure contact buttons are fully visible */\n        .broadcast-modal-overlay .broadcast-wizard-content .broadcast-contact-buttons {\n          display: flex !important;\n          gap: 10px !important;\n          padding: 16px 0 0 !important;\n          flex-wrap: wrap !important;\n          position: relative !important;\n          z-index: 10 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-wizard-content .broadcast-btn-upload,\n        .broadcast-modal-overlay .broadcast-wizard-content .broadcast-btn-select,\n        .broadcast-modal-overlay .broadcast-wizard-content .broadcast-btn-download {\n          flex: 1 !important;\n          min-width: 120px !important;\n          display: flex !important;\n          visibility: visible !important;\n          opacity: 1 !important;\n        }\n\n        /* === VERY VISIBLE scrollbars on panels === */\n        .broadcast-modal-overlay .broadcast-left-panel::-webkit-scrollbar,\n        .broadcast-modal-overlay .broadcast-right-panel::-webkit-scrollbar {\n          width: 12px !important;\n          height: 12px !important;\n          display: block !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-left-panel::-webkit-scrollbar-track,\n        .broadcast-modal-overlay .broadcast-right-panel::-webkit-scrollbar-track {\n          background: #f4f4f5 !important;\n          border-radius: 6px !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-left-panel::-webkit-scrollbar-thumb,\n        .broadcast-modal-overlay .broadcast-right-panel::-webkit-scrollbar-thumb {\n          background: #a1a1aa !important;\n          border-radius: 6px !important;\n          border: 2px solid #f4f4f5 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-left-panel::-webkit-scrollbar-thumb:hover,\n        .broadcast-modal-overlay .broadcast-right-panel::-webkit-scrollbar-thumb:hover {\n          background: #71717a !important;\n        }\n\n        /* Firefox scrollbar support */\n        .broadcast-modal-overlay .broadcast-left-panel,\n        .broadcast-modal-overlay .broadcast-right-panel {\n          scrollbar-width: auto !important;\n          scrollbar-color: #a1a1aa #f4f4f5 !important;\n        }\n\n        /* === SELECTOR MODALS (Contacts, Groups, Tabs, CRM, Labels, Stages) === */\n        .selector-modal-overlay {\n          background: rgba(0, 0, 0, 0.55) !important;\n          background-image: none !important;\n          backdrop-filter: blur(6px) !important;\n          z-index: 10002 !important;\n        }\n\n        .selector-modal-overlay .selector-modal {\n          background: #ffffff !important;\n          background-image: none !important;\n          border: 1px solid #e5e7eb !important;\n          border-radius: 16px !important;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0,0,0,0.05) !important;\n          width: 92% !important;\n          max-width: 560px !important;\n          max-height: 82vh !important;\n          display: flex !important;\n          flex-direction: column !important;\n          overflow: hidden !important;\n        }\n\n        .selector-modal-overlay .selector-modal-large {\n          max-width: 680px !important;\n        }\n\n        /* Selector header - white, clean */\n        .selector-modal-overlay .selector-header {\n          background: #ffffff !important;\n          background-image: none !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n          padding: 18px 22px !important;\n          color: #1f2937 !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: space-between !important;\n          flex-shrink: 0 !important;\n        }\n\n        .selector-modal-overlay .selector-header h3 {\n          margin: 0 !important;\n          font-size: 17px !important;\n          font-weight: 700 !important;\n          color: #1f2937 !important;\n          text-shadow: none !important;\n        }\n\n        .selector-modal-overlay .selector-close-btn {\n          width: 34px !important;\n          height: 34px !important;\n          background: #f4f4f5 !important;\n          border: 1px solid #e5e7eb !important;\n          color: #52525b !important;\n          border-radius: 10px !important;\n          font-size: 18px !important;\n          padding: 0 !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .selector-modal-overlay .selector-close-btn:hover {\n          background: rgba(239, 68, 68, 0.1) !important;\n          color: #ef4444 !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n          transform: none !important;\n        }\n\n        .selector-modal-overlay .selector-back-btn {\n          background: #f4f4f5 !important;\n          border: 1px solid #e5e7eb !important;\n          color: #52525b !important;\n          border-radius: 10px !important;\n          padding: 7px 14px !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .selector-modal-overlay .selector-back-btn:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        /* Search input area */\n        .selector-modal-overlay .selector-search {\n          background: #fafafa !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n          padding: 14px 20px !important;\n          flex-shrink: 0 !important;\n        }\n\n        .selector-modal-overlay .selector-search-input {\n          width: 100% !important;\n          padding: 10px 14px !important;\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          border-radius: 10px !important;\n          font-size: 13px !important;\n          color: #1f2937 !important;\n          outline: none !important;\n          transition: all 0.15s ease !important;\n          box-sizing: border-box !important;\n        }\n\n        .selector-modal-overlay .selector-search-input:focus {\n          border-color: var(--lion-primary) !important;\n          background: #ffffff !important;\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12) !important;\n        }\n\n        .selector-modal-overlay .selector-search-input::placeholder {\n          color: #9ca3af !important;\n        }\n\n        /* Select All button */\n        .selector-modal-overlay .selector-toolbar,\n        .selector-modal-overlay .selector-select-all-wrapper {\n          padding: 12px 20px !important;\n          background: #fafafa !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n          flex-shrink: 0 !important;\n        }\n\n        .selector-modal-overlay .selector-select-all-btn {\n          padding: 8px 16px !important;\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          color: #374151 !important;\n          border-radius: 8px !important;\n          font-size: 12px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .selector-modal-overlay .selector-select-all-btn:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        .selector-modal-overlay .selector-select-all-btn.active {\n          background: var(--lion-primary) !important;\n          border-color: var(--lion-primary) !important;\n          color: #ffffff !important;\n        }\n\n        /* Body list area */\n        .selector-modal-overlay .selector-body,\n        .selector-modal-overlay .selector-list {\n          flex: 1 !important;\n          overflow-y: auto !important;\n          background: #ffffff !important;\n          padding: 4px 0 !important;\n          min-height: 0 !important;\n        }\n\n        /* Individual items */\n        .selector-modal-overlay .selector-item,\n        .selector-modal-overlay .contact-item,\n        .selector-modal-overlay .group-item,\n        .selector-modal-overlay .label-item,\n        .selector-modal-overlay .stage-item,\n        .selector-modal-overlay .tab-item {\n          display: flex !important;\n          align-items: center !important;\n          gap: 12px !important;\n          padding: 10px 20px !important;\n          border-bottom: 1px solid #f4f4f5 !important;\n          cursor: pointer !important;\n          transition: background 0.12s ease !important;\n          color: #1f2937 !important;\n          font-size: 13px !important;\n          background: #ffffff !important;\n        }\n\n        .selector-modal-overlay .selector-item:hover,\n        .selector-modal-overlay .contact-item:hover,\n        .selector-modal-overlay .group-item:hover,\n        .selector-modal-overlay .label-item:hover,\n        .selector-modal-overlay .stage-item:hover,\n        .selector-modal-overlay .tab-item:hover {\n          background: rgba(var(--lion-primary-rgb), 0.05) !important;\n        }\n\n        .selector-modal-overlay .selector-item.selected,\n        .selector-modal-overlay .contact-item.selected,\n        .selector-modal-overlay .group-item.selected {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n        }\n\n        /* Item labels text (names, phone numbers, etc.) */\n        .selector-modal-overlay .contact-name,\n        .selector-modal-overlay .group-name,\n        .selector-modal-overlay .label-name,\n        .selector-modal-overlay .stage-name,\n        .selector-modal-overlay .tab-name,\n        .selector-modal-overlay .selector-item-name,\n        .selector-modal-overlay .selector-item-title {\n          color: #1f2937 !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          flex: 1 !important;\n        }\n\n        .selector-modal-overlay .contact-phone,\n        .selector-modal-overlay .group-members,\n        .selector-modal-overlay .label-count,\n        .selector-modal-overlay .stage-count,\n        .selector-modal-overlay .selector-item-subtitle {\n          color: #6b7280 !important;\n          font-size: 12px !important;\n          font-weight: 500 !important;\n        }\n\n        /* Checkboxes in selector items */\n        .selector-modal-overlay input[type="checkbox"] {\n          width: 18px !important;\n          height: 18px !important;\n          accent-color: var(--lion-primary) !important;\n          cursor: pointer !important;\n          flex-shrink: 0 !important;\n        }\n\n        /* Footer with Cancel / Add buttons */\n        .selector-modal-overlay .selector-footer,\n        .selector-modal-overlay .selector-actions {\n          background: #ffffff !important;\n          border-top: 1px solid #f0f0f0 !important;\n          padding: 14px 20px !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: space-between !important;\n          gap: 10px !important;\n          flex-shrink: 0 !important;\n        }\n\n        .selector-modal-overlay .selector-selected-count {\n          color: #6b7280 !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n        }\n\n        .selector-modal-overlay .selector-cancel-btn {\n          padding: 10px 20px !important;\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          color: #374151 !important;\n          border-radius: 10px !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .selector-modal-overlay .selector-cancel-btn:hover {\n          background: #f9fafb !important;\n          border-color: #d1d5db !important;\n        }\n\n        .selector-modal-overlay .selector-add-btn,\n        .selector-modal-overlay .selector-confirm-btn {\n          padding: 10px 20px !important;\n          background: var(--lion-primary) !important;\n          border: none !important;\n          color: #ffffff !important;\n          border-radius: 10px !important;\n          font-size: 13px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .selector-modal-overlay .selector-add-btn:hover,\n        .selector-modal-overlay .selector-confirm-btn:hover {\n          transform: translateY(-1px) !important;\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n        }\n\n        .selector-modal-overlay .selector-add-btn:disabled,\n        .selector-modal-overlay .selector-confirm-btn:disabled {\n          opacity: 0.5 !important;\n          cursor: not-allowed !important;\n          box-shadow: none !important;\n          transform: none !important;\n        }\n\n        /* Empty state */\n        .selector-modal-overlay .selector-empty {\n          text-align: center !important;\n          padding: 40px 20px !important;\n          color: #6b7280 !important;\n          font-size: 13px !important;\n        }\n\n        /* Dark mode for selector modals */\n        .lion-dark .selector-modal-overlay .selector-modal {\n          background: #18181b !important;\n          border-color: #27272a !important;\n        }\n\n        .lion-dark .selector-modal-overlay .selector-header {\n          background: #18181b !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        .lion-dark .selector-modal-overlay .selector-header h3 {\n          color: #fafafa !important;\n        }\n\n        .lion-dark .selector-modal-overlay .selector-close-btn,\n        .lion-dark .selector-modal-overlay .selector-back-btn {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #a1a1aa !important;\n        }\n\n        .lion-dark .selector-modal-overlay .selector-search {\n          background: #1a1a1a !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        .lion-dark .selector-modal-overlay .selector-search-input {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #fafafa !important;\n        }\n\n        .lion-dark .selector-modal-overlay .selector-body,\n        .lion-dark .selector-modal-overlay .selector-list {\n          background: #18181b !important;\n        }\n\n        .lion-dark .selector-modal-overlay .selector-item,\n        .lion-dark .selector-modal-overlay .contact-item,\n        .lion-dark .selector-modal-overlay .group-item,\n        .lion-dark .selector-modal-overlay .label-item,\n        .lion-dark .selector-modal-overlay .stage-item,\n        .lion-dark .selector-modal-overlay .tab-item {\n          background: #18181b !important;\n          border-bottom-color: #27272a !important;\n          color: #fafafa !important;\n        }\n\n        .lion-dark .selector-modal-overlay .contact-name,\n        .lion-dark .selector-modal-overlay .group-name,\n        .lion-dark .selector-modal-overlay .label-name,\n        .lion-dark .selector-modal-overlay .stage-name,\n        .lion-dark .selector-modal-overlay .selector-item-name {\n          color: #fafafa !important;\n        }\n\n        .lion-dark .selector-modal-overlay .selector-footer,\n        .lion-dark .selector-modal-overlay .selector-actions {\n          background: #18181b !important;\n          border-top-color: #27272a !important;\n        }\n\n        .lion-dark .selector-modal-overlay .selector-cancel-btn {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #e5e7eb !important;\n        }\n\n        .lion-dark .selector-modal-overlay .selector-toolbar,\n        .lion-dark .selector-modal-overlay .selector-select-all-wrapper {\n          background: #1a1a1a !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        .lion-dark .selector-modal-overlay .selector-select-all-btn {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #e5e7eb !important;\n        }\n\n        /* Missing: selector content scroll area background */\n        .lion-dark .selector-modal-overlay .selector-content {\n          background: #18181b !important;\n        }\n\n        /* Missing: selector confirm button (Add Contacts / Add Groups / etc) */\n        .lion-dark .selector-modal-overlay .selector-btn-confirm {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n        }\n        .lion-dark .selector-modal-overlay .selector-btn-confirm:hover {\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n        }\n\n        /* Missing: selector title that\'s invisible (white text was on white shell) */\n        .lion-dark .selector-modal-overlay .selector-title,\n        .lion-dark .selector-modal-overlay .selector-modal h2,\n        .lion-dark .selector-modal-overlay .selector-modal h3 {\n          color: #fafafa !important;\n        }\n\n        /* Recipients toggle (Contacts | Groups buttons) — improve dark contrast */\n        .broadcast-modal-overlay.lion-dark .broadcast-mode-btn {\n          background: #27272a !important;\n          color: #a1a1aa !important;\n          border-color: #3f3f46 !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-mode-btn:hover {\n          background: rgba(var(--lion-primary-rgb), 0.12) !important;\n          color: var(--lion-primary) !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-mode-btn.active {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border-color: transparent !important;\n        }\n\n        /* === REPORTS VIEW overlay (now unused since rendered inline) === */\n        /* Hide the old separate reports popup entirely since reports\n           now render inline inside broadcast-main via currentView === \'reports\' */\n        .reports-view-overlay {\n          display: none !important;\n        }\n\n        .reports-view-overlay .reports-view-header {\n          background: #ffffff !important;\n          background-image: none !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n          color: #1f2937 !important;\n          padding: 20px 28px !important;\n          border-radius: 16px 16px 0 0 !important;\n        }\n\n        .reports-view-overlay .reports-view-header h2 {\n          color: #1f2937 !important;\n          font-size: 19px !important;\n          font-weight: 700 !important;\n          margin: 0 !important;\n        }\n\n        .reports-view-overlay .reports-close-btn,\n        .reports-view-overlay .reports-refresh-btn {\n          background: #f4f4f5 !important;\n          border: 1px solid #e5e7eb !important;\n          color: #52525b !important;\n          border-radius: 10px !important;\n          width: 36px !important;\n          height: 36px !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          padding: 0 !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .reports-view-overlay .reports-close-btn:hover {\n          background: rgba(239, 68, 68, 0.1) !important;\n          color: #ef4444 !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n        }\n\n        .reports-view-overlay .reports-refresh-btn:hover {\n          background: rgba(var(--lion-primary-rgb), 0.1) !important;\n          color: var(--lion-primary) !important;\n          border-color: var(--lion-primary) !important;\n        }\n\n        .reports-view-overlay .reports-view-content {\n          background: #fafafa !important;\n          padding: 20px !important;\n          flex: 1 !important;\n          overflow-y: auto !important;\n        }\n\n        .reports-view-overlay .reports-section,\n        .reports-view-overlay .scheduled-section,\n        .reports-view-overlay .history-section {\n          background: #ffffff !important;\n          border: 1px solid #f0f0f0 !important;\n          border-radius: 14px !important;\n          box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;\n          padding: 16px !important;\n          margin-bottom: 16px !important;\n        }\n\n        .reports-view-overlay .section-title {\n          color: #1f2937 !important;\n          font-size: 14px !important;\n          font-weight: 700 !important;\n          padding: 0 0 12px !important;\n          background: transparent !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n          margin-bottom: 12px !important;\n        }\n\n        .reports-view-overlay .reports-list-header {\n          background: #fafafa !important;\n          color: #374151 !important;\n          font-size: 11px !important;\n          font-weight: 700 !important;\n          text-transform: uppercase !important;\n          letter-spacing: 0.5px !important;\n          padding: 10px 14px !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n          border-radius: 8px !important;\n        }\n\n        .reports-view-overlay .reports-list-item {\n          background: #ffffff !important;\n          border-bottom: 1px solid #f4f4f5 !important;\n          padding: 12px 14px !important;\n          color: #374151 !important;\n        }\n\n        .reports-view-overlay .reports-list-item:hover {\n          background: rgba(var(--lion-primary-rgb), 0.04) !important;\n        }\n\n        .reports-view-overlay .reports-empty {\n          background: #ffffff !important;\n          border: 2px dashed #e5e7eb !important;\n          border-radius: 14px !important;\n          padding: 40px 20px !important;\n          text-align: center !important;\n        }\n\n        .reports-view-overlay .reports-empty p {\n          color: #1f2937 !important;\n          font-size: 15px !important;\n          font-weight: 700 !important;\n        }\n\n        .reports-view-overlay .reports-empty span {\n          color: #6b7280 !important;\n          font-size: 13px !important;\n        }\n\n        .reports-view-overlay .reports-view-footer {\n          background: #ffffff !important;\n          border-top: 1px solid #f0f0f0 !important;\n          padding: 14px 24px !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: space-between !important;\n        }\n\n        .reports-view-overlay .reports-footer-stats {\n          color: #6b7280 !important;\n          font-size: 13px !important;\n        }\n\n        .reports-view-overlay .reports-clear-btn {\n          background: rgba(239, 68, 68, 0.08) !important;\n          color: #ef4444 !important;\n          border: 1px solid rgba(239, 68, 68, 0.2) !important;\n          border-radius: 8px !important;\n          padding: 8px 14px !important;\n          font-size: 12px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n        }\n\n        .reports-view-overlay .reports-clear-btn:hover {\n          background: rgba(239, 68, 68, 0.15) !important;\n        }\n\n        /* Dark mode for reports view */\n        .reports-view-overlay.lion-dark .reports-view-modal {\n          background: #18181b !important;\n          border-color: #27272a !important;\n        }\n\n        .reports-view-overlay.lion-dark .reports-view-header {\n          background: #18181b !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        .reports-view-overlay.lion-dark .reports-view-header h2 {\n          color: #fafafa !important;\n        }\n\n        .reports-view-overlay.lion-dark .reports-view-content {\n          background: #1a1a1a !important;\n        }\n\n        .reports-view-overlay.lion-dark .reports-section,\n        .reports-view-overlay.lion-dark .scheduled-section,\n        .reports-view-overlay.lion-dark .history-section {\n          background: #1f1f22 !important;\n          border-color: #27272a !important;\n        }\n\n        .reports-view-overlay.lion-dark .section-title {\n          color: #fafafa !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        .reports-view-overlay.lion-dark .reports-empty {\n          background: #1f1f22 !important;\n          border-color: #3f3f46 !important;\n        }\n\n        .reports-view-overlay.lion-dark .reports-empty p {\n          color: #fafafa !important;\n        }\n\n        .reports-view-overlay.lion-dark .reports-view-footer {\n          background: #18181b !important;\n          border-top-color: #27272a !important;\n        }\n\n        /* === FORCE cards inside panels to natural height (not stretched) === */\n        .broadcast-modal-overlay .broadcast-left-panel > *,\n        .broadcast-modal-overlay .broadcast-right-panel > * {\n          flex-shrink: 0 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-left-panel .broadcast-card,\n        .broadcast-modal-overlay .broadcast-right-panel .broadcast-card {\n          flex-shrink: 0 !important;\n          height: auto !important;\n          max-height: none !important;\n        }\n\n        /* Override any inline or legacy height:100% on card children */\n        .broadcast-modal-overlay .broadcast-left-panel .broadcast-card > *,\n        .broadcast-modal-overlay .broadcast-right-panel .broadcast-card > * {\n          height: auto !important;\n          max-height: none !important;\n        }\n\n        /* Modal main container - also flex column */\n        .broadcast-modal-overlay .broadcast-modal {\n          display: flex !important;\n          flex-direction: row !important;\n        }\n\n        /* Sidebar stays fixed width */\n        .broadcast-modal-overlay .broadcast-sidebar {\n          flex-shrink: 0 !important;\n        }\n\n        /* === Badges with consistent style === */\n        .broadcast-modal-overlay .broadcast-badge {\n          background: rgba(var(--lion-primary-rgb), 0.12) !important;\n          color: var(--lion-primary) !important;\n          font-weight: 700 !important;\n          border-radius: 999px !important;\n          padding: 4px 12px !important;\n          font-size: 11px !important;\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.25) !important;\n          white-space: nowrap !important;\n        }\n\n        /* === Settings section (Allow Repeat, Link Preview etc.) === */\n        .broadcast-modal-overlay .broadcast-settings-section,\n        .broadcast-modal-overlay .broadcast-options-list {\n          background: #ffffff !important;\n          border: 1px solid #f0f0f0 !important;\n          border-radius: 14px !important;\n          box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;\n          overflow: hidden !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-settings-section > div,\n        .broadcast-modal-overlay .broadcast-options-list > div {\n          padding: 12px 18px !important;\n          border-bottom: 1px solid #f4f4f5 !important;\n          color: #374151 !important;\n          font-size: 13px !important;\n          font-weight: 500 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-settings-section > div:last-child,\n        .broadcast-modal-overlay .broadcast-options-list > div:last-child {\n          border-bottom: none !important;\n        }\n\n        /* === Uploaded contacts table === */\n        .broadcast-modal-overlay .uploaded-contacts-section {\n          padding: 16px 18px !important;\n        }\n\n        .broadcast-modal-overlay .uploaded-contacts-header {\n          display: flex !important;\n          align-items: center !important;\n          justify-content: space-between !important;\n          padding: 0 0 12px !important;\n        }\n\n        .broadcast-modal-overlay .uploaded-count {\n          font-size: 13px !important;\n          font-weight: 700 !important;\n          color: #374151 !important;\n        }\n\n        .broadcast-modal-overlay .clear-contacts-btn {\n          background: rgba(239, 68, 68, 0.08) !important;\n          color: #ef4444 !important;\n          border: 1px solid rgba(239, 68, 68, 0.2) !important;\n          border-radius: 8px !important;\n          padding: 6px 12px !important;\n          font-size: 12px !important;\n          font-weight: 600 !important;\n          cursor: pointer !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .broadcast-modal-overlay .clear-contacts-btn:hover {\n          background: rgba(239, 68, 68, 0.15) !important;\n        }\n\n        /* === Variable hint box === */\n        .broadcast-modal-overlay .variable-hint-box {\n          background: rgba(var(--lion-primary-rgb), 0.06) !important;\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.2) !important;\n          color: #6D28D9 !important;\n          border-radius: 10px !important;\n          padding: 10px 12px !important;\n          font-size: 12px !important;\n          margin-top: 10px !important;\n        }\n\n        /* === Resume modal header === */\n        .broadcast-modal-overlay .broadcast-resume-header {\n          padding: 24px 24px 12px !important;\n          text-align: center !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-resume-header h2 {\n          color: #1f2937 !important;\n          font-size: 18px !important;\n          font-weight: 700 !important;\n          margin: 12px 0 6px !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-resume-header p {\n          color: #6b7280 !important;\n          font-size: 13px !important;\n          margin: 0 !important;\n        }\n\n        /* === Scheduled campaigns container === */\n        .broadcast-modal-overlay .scheduled-campaigns-container {\n          padding: 20px !important;\n        }\n\n        .broadcast-modal-overlay .scheduled-empty-state {\n          background: #ffffff !important;\n          border: 2px dashed #e5e7eb !important;\n          border-radius: 14px !important;\n          padding: 40px 20px !important;\n          text-align: center !important;\n          color: #6b7280 !important;\n        }\n\n        .broadcast-modal-overlay .create-campaign-btn {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border: none !important;\n          border-radius: 10px !important;\n          padding: 10px 20px !important;\n          font-weight: 600 !important;\n          font-size: 13px !important;\n          cursor: pointer !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n          margin-top: 16px !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .broadcast-modal-overlay .create-campaign-btn:hover {\n          transform: translateY(-1px) !important;\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n        }\n\n        /* === Scheduled campaign item === */\n        .broadcast-modal-overlay .scheduled-campaign-item {\n          background: #ffffff !important;\n          border: 1px solid #f0f0f0 !important;\n          border-radius: 14px !important;\n          padding: 16px !important;\n          margin-bottom: 12px !important;\n          box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;\n        }\n\n        .broadcast-modal-overlay .campaign-name {\n          color: #1f2937 !important;\n          font-size: 15px !important;\n          font-weight: 700 !important;\n          margin-bottom: 8px !important;\n        }\n\n        .broadcast-modal-overlay .schedule-badge,\n        .broadcast-modal-overlay .status-badge {\n          display: inline-block !important;\n          padding: 3px 10px !important;\n          border-radius: 999px !important;\n          font-size: 11px !important;\n          font-weight: 700 !important;\n        }\n\n        .broadcast-modal-overlay .schedule-badge {\n          background: rgba(var(--lion-primary-rgb), 0.1) !important;\n          color: var(--lion-primary) !important;\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.25) !important;\n        }\n\n        .broadcast-modal-overlay .status-badge.active {\n          background: rgba(16, 185, 129, 0.1) !important;\n          color: #10b981 !important;\n          border: 1px solid rgba(16, 185, 129, 0.25) !important;\n        }\n\n        .broadcast-modal-overlay .status-badge.paused {\n          background: rgba(245, 158, 11, 0.1) !important;\n          color: #0ea5e9 !important;\n          border: 1px solid rgba(245, 158, 11, 0.25) !important;\n        }\n\n        /* === Fix any remaining dark/invisible elements === */\n        .broadcast-modal-overlay h1,\n        .broadcast-modal-overlay h2,\n        .broadcast-modal-overlay h3,\n        .broadcast-modal-overlay h4,\n        .broadcast-modal-overlay h5 {\n          color: #1f2937 !important;\n        }\n\n        .broadcast-modal-overlay .broadcast-main p,\n        .broadcast-modal-overlay .broadcast-main label,\n        .broadcast-modal-overlay .broadcast-main span:not(.broadcast-badge):not(.schedule-badge):not(.status-badge):not(.nav-badge):not(.dropdown-arrow) {\n          color: #374151;\n        }\n\n        /* === Refresh button === */\n        .broadcast-modal-overlay .refresh-btn {\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          color: #52525b !important;\n          border-radius: 8px !important;\n          width: 36px !important;\n          height: 36px !important;\n          cursor: pointer !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .broadcast-modal-overlay .refresh-btn:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        /* === Dark mode additions === */\n        .broadcast-modal-overlay.lion-dark .broadcast-title { color: #fafafa !important; }\n        .broadcast-modal-overlay.lion-dark .broadcast-subtitle { color: #a1a1aa !important; }\n        .broadcast-modal-overlay.lion-dark .broadcast-card-header > span:first-child,\n        .broadcast-modal-overlay.lion-dark .broadcast-card-header > div:first-child {\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-mode-btn {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #a1a1aa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-btn-upload,\n        .broadcast-modal-overlay.lion-dark .broadcast-btn-select,\n        .broadcast-modal-overlay.lion-dark .broadcast-btn-download {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #e5e7eb !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-add-message-btn,\n        .broadcast-modal-overlay.lion-dark .add-message-btn {\n          background: #18181b !important;\n        }\n        .broadcast-modal-overlay.lion-dark .pause-setting,\n        .broadcast-modal-overlay.lion-dark .broadcast-pause-row,\n        .broadcast-modal-overlay.lion-dark .broadcast-random-message-row,\n        .broadcast-modal-overlay.lion-dark .random-message-container,\n        .broadcast-modal-overlay.lion-dark .broadcast-settings-section,\n        .broadcast-modal-overlay.lion-dark .broadcast-options-list,\n        .broadcast-modal-overlay.lion-dark .scheduled-campaign-item {\n          background: #1f1f22 !important;\n          border-color: #27272a !important;\n          color: #e5e7eb !important;\n        }\n        .broadcast-modal-overlay.lion-dark .scheduled-empty-state {\n          background: #1f1f22 !important;\n          border-color: #3f3f46 !important;\n          color: #a1a1aa !important;\n        }\n        .broadcast-modal-overlay.lion-dark h1,\n        .broadcast-modal-overlay.lion-dark h2,\n        .broadcast-modal-overlay.lion-dark h3 {\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-main p,\n        .broadcast-modal-overlay.lion-dark .broadcast-main label,\n        .broadcast-modal-overlay.lion-dark .broadcast-main span:not(.broadcast-badge):not(.schedule-badge):not(.status-badge):not(.nav-badge) {\n          color: #d4d4d8;\n        }\n\n        /* ===================================================================\n           UPLOAD CONTACTS WIZARD — dark mode\n           Uses .lion-dark ancestor selector because .upload-wizard-overlay\n           does NOT carry lion-dark class itself (compound selector won\'t match)\n           =================================================================== */\n        .lion-dark .upload-wizard-overlay .upload-wizard-modal {\n          background: #18181b !important;\n        }\n        .lion-dark .upload-wizard-overlay .upload-wizard-steps {\n          background: #1f1f23 !important;\n          border-bottom-color: #27272a !important;\n        }\n        .lion-dark .upload-wizard-overlay .wizard-step {\n          color: #71717a !important;\n        }\n        .lion-dark .upload-wizard-overlay .wizard-step.active,\n        .lion-dark .upload-wizard-overlay .wizard-step.completed {\n          color: var(--lion-primary) !important;\n        }\n        .lion-dark .upload-wizard-overlay .step-line {\n          background: #3f3f46 !important;\n        }\n        .lion-dark .upload-wizard-overlay .upload-wizard-content {\n          background: #18181b !important;\n        }\n        .lion-dark .upload-wizard-overlay .upload-drop-area {\n          background: #1f1f23 !important;\n          border-color: #3f3f46 !important;\n        }\n        .lion-dark .upload-wizard-overlay .upload-drop-area:hover {\n          border-color: var(--lion-primary) !important;\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n        }\n        .lion-dark .upload-wizard-overlay .upload-text {\n          color: var(--lion-primary) !important;\n        }\n        .lion-dark .upload-wizard-overlay .upload-hint,\n        .lion-dark .upload-wizard-overlay .sample-files span,\n        .lion-dark .upload-wizard-overlay .map-hint,\n        .lion-dark .upload-wizard-overlay .total-contacts,\n        .lion-dark .upload-wizard-overlay .file-rows {\n          color: #a1a1aa !important;\n        }\n        .lion-dark .upload-wizard-overlay .sample-btn,\n        .lion-dark .upload-wizard-overlay .select-all-btn,\n        .lion-dark .upload-wizard-overlay .select-none-btn {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #e5e7eb !important;\n        }\n        .lion-dark .upload-wizard-overlay .sample-btn:hover,\n        .lion-dark .upload-wizard-overlay .select-all-btn:hover,\n        .lion-dark .upload-wizard-overlay .select-none-btn:hover {\n          background: rgba(var(--lion-primary-rgb), 0.12) !important;\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n        .lion-dark .upload-wizard-overlay .uploaded-file-info {\n          background: rgba(var(--lion-primary-rgb), 0.1) !important;\n          border-color: rgba(var(--lion-primary-rgb), 0.3) !important;\n        }\n        .lion-dark .upload-wizard-overlay .file-name {\n          color: #fafafa !important;\n        }\n        .lion-dark .upload-wizard-overlay .map-section {\n          border-bottom-color: #27272a !important;\n        }\n        .lion-dark .upload-wizard-overlay .phone-column-select label {\n          color: #e5e7eb !important;\n        }\n        .lion-dark .upload-wizard-overlay .phone-column-select select {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #fafafa !important;\n        }\n        .lion-dark .upload-wizard-overlay .extra-columns-header span {\n          color: var(--lion-info, #60a5fa) !important;\n        }\n        .lion-dark .upload-wizard-overlay .extra-column-card {\n          background: #1f1f23 !important;\n          border-color: #3f3f46 !important;\n        }\n        .lion-dark .upload-wizard-overlay .extra-column-card:hover {\n          border-color: var(--lion-primary) !important;\n        }\n        .lion-dark .upload-wizard-overlay .extra-column-card.selected {\n          background: rgba(var(--lion-primary-rgb), 0.1) !important;\n          border-color: var(--lion-primary) !important;\n        }\n        .lion-dark .upload-wizard-overlay .column-checkbox {\n          border-color: #3f3f46 !important;\n        }\n        .lion-dark .upload-wizard-overlay .column-name {\n          color: #fafafa !important;\n        }\n        .lion-dark .upload-wizard-overlay .column-sample {\n          color: #a1a1aa !important;\n        }\n        .lion-dark .upload-wizard-overlay .preview-table-container {\n          background: #18181b !important;\n          border-color: #27272a !important;\n        }\n        .lion-dark .upload-wizard-overlay .preview-table {\n          background: #18181b !important;\n          color: #fafafa !important;\n        }\n        .lion-dark .upload-wizard-overlay .preview-table thead {\n          background: #1f1f23 !important;\n        }\n        .lion-dark .upload-wizard-overlay .preview-table th {\n          color: #a1a1aa !important;\n          border-bottom-color: #27272a !important;\n        }\n        .lion-dark .upload-wizard-overlay .preview-table tbody tr {\n          background: #18181b !important;\n          border-bottom-color: #27272a !important;\n        }\n        .lion-dark .upload-wizard-overlay .preview-table tbody tr:hover {\n          background: #1f1f23 !important;\n        }\n        .lion-dark .upload-wizard-overlay .preview-table tbody tr.removed-row {\n          background: rgba(239, 68, 68, 0.12) !important;\n        }\n        .lion-dark .upload-wizard-overlay .preview-table td {\n          color: #e5e7eb !important;\n          border-bottom-color: #27272a !important;\n        }\n        .lion-dark .upload-wizard-overlay .upload-wizard-footer {\n          background: #1f1f23 !important;\n          border-top-color: #27272a !important;\n        }\n        .lion-dark .upload-wizard-overlay .wizard-btn-prev,\n        .lion-dark .upload-wizard-overlay .wizard-btn-close {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #e5e7eb !important;\n        }\n\n        /* ===================================================================\n           RECIPIENTS PREVIEW TABLE (in main BroadcastModal Recipients step)\n           =================================================================== */\n        .broadcast-modal-overlay.lion-dark .preview-table,\n        .broadcast-modal-overlay.lion-dark .recipient-table {\n          background: #18181b !important;\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .preview-table thead,\n        .broadcast-modal-overlay.lion-dark .recipient-table thead {\n          background: #1f1f23 !important;\n        }\n        .broadcast-modal-overlay.lion-dark .preview-table th,\n        .broadcast-modal-overlay.lion-dark .recipient-table th {\n          color: #a1a1aa !important;\n          border-bottom-color: #27272a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .preview-table tbody tr,\n        .broadcast-modal-overlay.lion-dark .recipient-table tbody tr {\n          background: #18181b !important;\n          border-bottom-color: #27272a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .preview-table tbody tr:hover,\n        .broadcast-modal-overlay.lion-dark .recipient-table tbody tr:hover {\n          background: #1f1f23 !important;\n        }\n        .broadcast-modal-overlay.lion-dark .preview-table td,\n        .broadcast-modal-overlay.lion-dark .recipient-table td {\n          color: #e5e7eb !important;\n          border-bottom-color: #27272a !important;\n        }\n\n        /* ===================================================================\n           TEMPLATE TYPE SELECTOR DROPDOWN (Messages step)\n           =================================================================== */\n        .broadcast-modal-overlay.lion-dark .broadcast-template-selector,\n        .broadcast-modal-overlay.lion-dark .template-type-dropdown {\n          background: #1f1f23 !important;\n          border-color: #3f3f46 !important;\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-template-selector option,\n        .broadcast-modal-overlay.lion-dark .template-type-dropdown option {\n          background: #1f1f23 !important;\n          color: #fafafa !important;\n        }\n\n        /* ===================================================================\n           REVIEW STEP — campaign summary, stats, warning banner, disclaimer\n           =================================================================== */\n        .broadcast-modal-overlay.lion-dark .broadcast-step-review,\n        .broadcast-modal-overlay.lion-dark .campaign-summary-card {\n          background: #1f1f23 !important;\n          border-color: #27272a !important;\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .summary-stat {\n          background: #18181b !important;\n          border-color: #27272a !important;\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .summary-stat-label,\n        .broadcast-modal-overlay.lion-dark .summary-label {\n          color: #a1a1aa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .summary-stat-value,\n        .broadcast-modal-overlay.lion-dark .summary-value {\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .campaign-warning-banner,\n        .broadcast-modal-overlay.lion-dark .broadcast-review-warning {\n          background: rgba(245, 158, 11, 0.12) !important;\n          border-color: rgba(245, 158, 11, 0.4) !important;\n          color: #93c5fd !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-disclaimer,\n        .broadcast-modal-overlay.lion-dark .review-disclaimer {\n          background: #18181b !important;\n          border-color: #27272a !important;\n          color: #d4d4d8 !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-disclaimer label,\n        .broadcast-modal-overlay.lion-dark .review-disclaimer label {\n          color: #e5e7eb !important;\n        }\n\n        /* ===================================================================\n           RECIPIENTS STEP — mode selection wrapper (Contacts | Groups toggle)\n           =================================================================== */\n        .broadcast-modal-overlay.lion-dark .broadcast-mode-selection {\n          background: #1f1f23 !important;\n          border: 1px solid #27272a !important;\n        }\n\n        /* Radio variant used in some step headings */\n        .broadcast-modal-overlay.lion-dark .broadcast-radio {\n          color: #a1a1aa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-radio:has(input:checked) {\n          background: #27272a !important;\n          color: var(--lion-primary) !important;\n        }\n\n        /* ===================================================================\n           RECIPIENTS STEP — uploaded contacts preview table\n           (when user has uploaded a CSV the rows show here)\n           =================================================================== */\n        .broadcast-modal-overlay.lion-dark .uploaded-contacts-table-wrapper {\n          background: #18181b !important;\n          border-color: #27272a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .uploaded-contacts-table {\n          background: #18181b !important;\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .uploaded-contacts-table thead {\n          background: #1f1f23 !important;\n        }\n        .broadcast-modal-overlay.lion-dark .uploaded-contacts-table th {\n          color: #a1a1aa !important;\n          border-bottom-color: #27272a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .uploaded-contacts-table td {\n          color: #e5e7eb !important;\n          border-bottom-color: #27272a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .uploaded-contacts-table tbody tr:hover {\n          background: #1f1f23 !important;\n        }\n        .broadcast-modal-overlay.lion-dark .variable-hint-box {\n          background: rgba(59, 130, 246, 0.1) !important;\n          border-color: rgba(59, 130, 246, 0.3) !important;\n          color: #93c5fd !important;\n        }\n        .broadcast-modal-overlay.lion-dark .variable-hint-box code {\n          background: rgba(59, 130, 246, 0.18) !important;\n          color: #93c5fd !important;\n        }\n        .broadcast-modal-overlay.lion-dark .clear-contacts-btn {\n          background: rgba(239, 68, 68, 0.12) !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n          color: #f87171 !important;\n        }\n        .broadcast-modal-overlay.lion-dark .clear-contacts-btn:hover {\n          background: rgba(239, 68, 68, 0.2) !important;\n        }\n        .broadcast-modal-overlay.lion-dark .remove-contact-btn {\n          background: rgba(239, 68, 68, 0.12) !important;\n          color: #f87171 !important;\n        }\n        .broadcast-modal-overlay.lion-dark .remove-contact-btn:hover {\n          background: rgba(239, 68, 68, 0.2) !important;\n        }\n\n        /* ===================================================================\n           MESSAGES STEP — panel, message box content, template type selector,\n           "Add Message" primary button, Pause toggle row\n           =================================================================== */\n        .broadcast-modal-overlay.lion-dark .broadcast-right-panel {\n          background: transparent !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-message-box,\n        .broadcast-modal-overlay.lion-dark .broadcast-message-box.active {\n          background: #1f1f23 !important;\n          border-color: #27272a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .message-box-header {\n          background: #1f1f23 !important;\n          border-bottom-color: #27272a !important;\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .message-box-content {\n          background: #1f1f23 !important;\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-template-type {\n          background: transparent !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-template-type label {\n          color: #a1a1aa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-template-type select {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-template-type select option {\n          background: #1f1f23 !important;\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-message-textarea {\n          background: #18181b !important;\n          border-color: #3f3f46 !important;\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-message-textarea::placeholder {\n          color: #71717a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-btn-add {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n        }\n        .broadcast-modal-overlay.lion-dark .pause-settings-config {\n          background: #18181b !important;\n          border-color: #27272a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .pause-setting-label {\n          color: #a1a1aa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .pause-setting-input {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #fafafa !important;\n        }\n\n        /* ===================================================================\n           ACTIONS STEP — toggle rows\n           (BroadcastDarkMode.ts had rules but they were shadowed by base\n            styles due to load order; load order was fixed in styles/index.ts,\n            but also add belt-and-braces !important rules here so this works\n            regardless of future load-order regressions.)\n           =================================================================== */\n        .broadcast-modal-overlay.lion-dark .broadcast-toggle-options {\n          background: #1f1f23 !important;\n          border-color: #27272a !important;\n        }\n        /* Override the generic .broadcast-toggle { background: #e5e7eb } V3\n           rule at line ~269 which applies to both light AND dark mode and\n           forces the toggle LABEL pill grey. Without this, the entire row\n           wrapper stays pale grey in dark mode even though the slider track\n           and container are dark. */\n        .broadcast-modal-overlay.lion-dark .broadcast-toggle {\n          background: transparent !important;\n          color: #e5e7eb !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-toggle:hover {\n          background: #27272a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .toggle-slider {\n          background: #3f3f46 !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-toggle input:checked + .toggle-slider {\n          background: var(--lion-primary) !important;\n        }\n        .broadcast-modal-overlay.lion-dark .skip-bulk-message-toggle {\n          border-top-color: #27272a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .skip-bulk-message-info {\n          background: rgba(245, 158, 11, 0.12) !important;\n          border-color: rgba(245, 158, 11, 0.3) !important;\n          color: #93c5fd !important;\n        }\n        .broadcast-modal-overlay.lion-dark .group-actions-panel {\n          background: #18181b !important;\n          border-color: #27272a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .group-actions-note {\n          color: #a1a1aa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-checkbox {\n          color: #e5e7eb !important;\n        }\n        .broadcast-modal-overlay.lion-dark .group-action-selector .group-select-dropdown {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #fafafa !important;\n        }\n        .broadcast-modal-overlay.lion-dark .group-chip {\n          background: rgba(var(--lion-primary-rgb), 0.12) !important;\n          color: var(--lion-primary) !important;\n          border-color: rgba(var(--lion-primary-rgb), 0.3) !important;\n        }\n\n        /* ===================================================================\n           REVIEW STEP — the "no messages configured" placeholder card\n           (lives inside .wa-preview-chat which mimics WhatsApp\'s beige\n            chat wallpaper; keep the wallpaper light on purpose, just darken\n            the empty-state text + the outer card that wraps it)\n           =================================================================== */\n        .broadcast-modal-overlay.lion-dark .wa-preview-chat {\n          background: #1a1a1a !important;\n          background-image: none !important;\n        }\n        .broadcast-modal-overlay.lion-dark .wa-preview-bubble.outgoing {\n          background: #1f3a2f !important;\n        }\n        .broadcast-modal-overlay.lion-dark .wa-preview-text,\n        .broadcast-modal-overlay.lion-dark .wa-preview-media,\n        .broadcast-modal-overlay.lion-dark .wa-preview-signature,\n        .broadcast-modal-overlay.lion-dark .wa-preview-time {\n          color: #d4d4d8 !important;\n        }\n        .broadcast-modal-overlay.lion-dark .send-confirm-checkbox {\n          background: #1f1f23 !important;\n          border-color: #27272a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .send-confirm-checkbox:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n        }\n        .broadcast-modal-overlay.lion-dark .send-confirm-checkbox span {\n          color: #e5e7eb !important;\n        }\n\n        /* Belt-and-braces: left/right panels (Recipients/Actions/Messages) */\n        .broadcast-modal-overlay.lion-dark .broadcast-left-panel {\n          background: #18181b !important;\n          border-right-color: #27272a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .broadcast-right-panel {\n          background: #18181b !important;\n        }\n\n        /* Signature preview card (Actions step when "Add Signature" is on) */\n        .broadcast-modal-overlay.lion-dark .signature-preview {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          border-color: rgba(var(--lion-primary-rgb), 0.3) !important;\n          color: #d4d4d8 !important;\n        }\n        .broadcast-modal-overlay.lion-dark .signature-preview .signature-label {\n          color: var(--lion-primary) !important;\n        }\n        .broadcast-modal-overlay.lion-dark .signature-preview .signature-text {\n          background: rgba(255, 255, 255, 0.08) !important;\n          color: #fafafa !important;\n        }\n\n        /* Review step — wa-preview-container outer wrapper */\n        .broadcast-modal-overlay.lion-dark .wa-preview-container {\n          background: #1f1f23 !important;\n          border-color: #27272a !important;\n        }\n        .broadcast-modal-overlay.lion-dark .wa-preview-container h4 {\n          color: #a1a1aa !important;\n        }\n\n        /* Review step — warning banner: brighten the title and list text */\n        .broadcast-modal-overlay.lion-dark .campaign-warning-banner .warning-content strong {\n          color: #93c5fd !important;\n        }\n        .broadcast-modal-overlay.lion-dark .campaign-warning-banner .warning-content p,\n        .broadcast-modal-overlay.lion-dark .campaign-warning-banner .warning-content ul,\n        .broadcast-modal-overlay.lion-dark .campaign-warning-banner .warning-content li {\n          color: #bfdbfe !important;\n        }\n\n        /* Review step — summary badges (active/warning/info) tinted for dark bg */\n        .broadcast-modal-overlay.lion-dark .summary-badge.active {\n          background: rgba(16, 185, 129, 0.15) !important;\n          color: #34d399 !important;\n          border-color: rgba(16, 185, 129, 0.35) !important;\n        }\n        .broadcast-modal-overlay.lion-dark .summary-badge.warning {\n          background: rgba(245, 158, 11, 0.15) !important;\n          color: #93c5fd !important;\n          border-color: rgba(245, 158, 11, 0.35) !important;\n        }\n        .broadcast-modal-overlay.lion-dark .summary-badge.info {\n          background: rgba(59, 130, 246, 0.15) !important;\n          color: #93c5fd !important;\n          border-color: rgba(59, 130, 246, 0.35) !important;\n        }\n\n        /* ========== DARK MODE OVERRIDES ========== */\n        .broadcast-modal-overlay.lion-dark {\n          --lion-bg-primary: #1a1a1a;\n          --lion-bg-secondary: #262626;\n          --lion-bg-tertiary: #2a2a2a;\n          --lion-text-primary: #ffffff;\n          --lion-text-secondary: #e5e7eb;\n          --lion-text-muted: #9ca3af;\n          --lion-border-light: #3f3f3f;\n          --lion-border-medium: #525252;\n          --lion-primary-light: rgba(6, 78, 168, 0.15);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-modal {\n          background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-left-panel,\n        .broadcast-modal-overlay.lion-dark .broadcast-right-panel {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-card {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-card-header {\n          background: linear-gradient(135deg, var(--lion-bg-tertiary) 0%, var(--lion-bg-secondary) 100%);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-card-header h3 {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-section-title {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-mode-selection {\n          background: var(--lion-bg-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-radio {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-radio:has(input:checked) {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-checkbox {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-checkbox:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selected-groups-list {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selected-group-item {\n          background: linear-gradient(135deg, var(--lion-bg-tertiary) 0%, var(--lion-bg-secondary) 100%);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .group-name {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .pause-settings-config {\n          background: linear-gradient(135deg, var(--lion-bg-tertiary) 0%, var(--lion-bg-secondary) 100%);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .pause-setting-label {\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .pause-setting-input {\n          background: var(--lion-bg-primary);\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-input,\n        .broadcast-modal-overlay.lion-dark .broadcast-textarea {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-select {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .message-card {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .message-card-header {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .message-card-header span {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-option-card {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-option-card:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .toggle-label {\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .action-config-panel {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .action-config-header {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .action-checkbox-label {\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selected-items-list {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selected-item-tag {\n          background: var(--lion-bg-primary);\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .reports-content {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .reports-header {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .reports-header-title h2,\n        .broadcast-modal-overlay.lion-dark .reports-header-title p {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .reports-tabs {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .reports-tab {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .reports-tab.active {\n          background: var(--lion-primary);\n          color: #ffffff;\n        }\n\n        .broadcast-modal-overlay.lion-dark .history-item {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .history-item-header h4 {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .history-item-time {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .history-stat-label {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .history-stat-value {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-view {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-header {\n          background: linear-gradient(135deg, var(--lion-sidebar-start) 0%, var(--lion-sidebar-end) 100%);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-item {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-item.sent {\n          background: rgba(16, 185, 129, 0.15);\n          border-color: rgba(16, 185, 129, 0.3);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-item.pending {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-contact-name {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-contact-phone {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-timestamp {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .upload-wizard-modal {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .upload-wizard-header {\n          background: linear-gradient(135deg, var(--lion-sidebar-start) 0%, var(--lion-sidebar-end) 100%);\n        }\n\n        .broadcast-modal-overlay.lion-dark .upload-wizard-body {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .upload-step-content h4 {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .upload-step-content p,\n        .broadcast-modal-overlay.lion-dark .upload-step-content label {\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .upload-drop-zone {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .upload-preview-table {\n          background: var(--lion-bg-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .upload-preview-table th {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .upload-preview-table td {\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .contacts-selector-modal {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .contacts-selector-header {\n          background: linear-gradient(135deg, var(--lion-sidebar-start) 0%, var(--lion-sidebar-end) 100%);\n        }\n\n        .broadcast-modal-overlay.lion-dark .contacts-search input {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .contacts-list-item {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .contacts-list-item:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .contact-name {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .contact-phone {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .groups-selector-modal {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .groups-search input {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .groups-list-item {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .groups-list-item:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .no-groups-message,\n        .broadcast-modal-overlay.lion-dark .no-contacts-message {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .template-type-select {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .template-type-label {\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-footer {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-btn-secondary {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-secondary);\n        }\n\n        /* ========== DARK MODE - PHONE INPUT ========== */\n        .broadcast-modal-overlay.lion-dark .broadcast-phone-input {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-phone-input::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-phone-input:focus {\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 4px rgba(6, 78, 168, 0.15);\n        }\n\n        /* ========== DARK MODE - TOGGLE OPTIONS ========== */\n        .broadcast-modal-overlay.lion-dark .broadcast-toggle-options {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-toggle {\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-toggle:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .toggle-slider {\n          background: #4b5563;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-toggle input:checked + .toggle-slider {\n          background: var(--lion-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .skip-bulk-message-toggle {\n          border-top-color: var(--lion-border-light);\n        }\n\n        /* ========== DARK MODE - MESSAGE BOX ========== */\n        .broadcast-modal-overlay.lion-dark .broadcast-message-box {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-message-box:hover {\n          border-color: var(--lion-border-medium);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-message-box.active {\n          border-color: var(--lion-primary);\n          box-shadow: 0 4px 16px rgba(6, 78, 168, 0.15);\n        }\n\n        .broadcast-modal-overlay.lion-dark .message-box-header {\n          background: linear-gradient(135deg, var(--lion-bg-tertiary) 0%, var(--lion-bg-secondary) 100%);\n          border-bottom-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .message-box-header:hover {\n          background: linear-gradient(135deg, #3f3f3f 0%, var(--lion-bg-tertiary) 100%);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-message-box.active .message-box-header {\n          background: linear-gradient(135deg, rgba(6, 78, 168, 0.15) 0%, rgba(6, 78, 168, 0.08) 100%);\n          border-bottom-color: rgba(6, 78, 168, 0.3);\n        }\n\n        .broadcast-modal-overlay.lion-dark .message-box-toggle {\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-message-box.active .message-box-toggle {\n          color: var(--lion-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .message-action-btn {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .message-action-btn:hover {\n          background: var(--lion-bg-secondary);\n          color: var(--lion-text-primary);\n          border-color: var(--lion-border-medium);\n        }\n\n        .broadcast-modal-overlay.lion-dark .message-delete-btn:hover {\n          background: rgba(239, 68, 68, 0.15);\n          color: #ef4444;\n          border-color: rgba(239, 68, 68, 0.3);\n        }\n\n        .broadcast-modal-overlay.lion-dark .message-box-content {\n          background: var(--lion-bg-secondary);\n        }\n\n        /* ========== DARK MODE - TEMPLATE TYPE ========== */\n        .broadcast-modal-overlay.lion-dark .broadcast-template-type {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-template-type label {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-template-type select {\n          background: var(--lion-bg-tertiary) !important;\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-template-type select:focus {\n          border-color: var(--lion-primary);\n          background: var(--lion-bg-secondary) !important;\n        }\n\n        /* ========== DARK MODE - MESSAGE TEXTAREA ========== */\n        .broadcast-modal-overlay.lion-dark .broadcast-message-textarea {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-message-textarea::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-message-textarea:focus {\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 4px rgba(6, 78, 168, 0.15);\n        }\n\n        /* ========== DARK MODE - MESSAGE TOOLBAR ========== */\n        .broadcast-modal-overlay.lion-dark .broadcast-message-toolbar {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .toolbar-btn {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .toolbar-btn:hover {\n          background: rgba(6, 78, 168, 0.15);\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .toolbar-btn-templates {\n          background: linear-gradient(135deg, rgba(6, 78, 168, 0.15) 0%, rgba(6, 78, 168, 0.08) 100%);\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .toolbar-btn-templates:hover {\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        /* ========== DARK MODE - VARIABLE DROPDOWN ========== */\n        .broadcast-modal-overlay.lion-dark .variable-dropdown {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);\n        }\n\n        .broadcast-modal-overlay.lion-dark .variable-dropdown::-webkit-scrollbar-track {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .variable-dropdown::-webkit-scrollbar-thumb {\n          background: #525252;\n        }\n\n        .broadcast-modal-overlay.lion-dark .variable-dropdown::-webkit-scrollbar-thumb:hover {\n          background: #6b7280;\n        }\n\n        .broadcast-modal-overlay.lion-dark .variable-option {\n          color: var(--lion-text-secondary);\n          border-bottom-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .variable-option:hover {\n          background: rgba(6, 78, 168, 0.15);\n          color: var(--lion-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .variable-hint {\n          color: var(--lion-text-muted);\n          border-top-color: var(--lion-border-light);\n        }\n\n        /* ========== DARK MODE - TEMPLATE SELECTOR ========== */\n        .broadcast-modal-overlay.lion-dark .broadcast-template-selector {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .template-option {\n          border-bottom-color: var(--lion-border-light);\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .template-option:hover {\n          background: rgba(6, 78, 168, 0.15);\n          border-left-color: var(--lion-primary);\n        }\n\n        /* ========== DARK MODE - DELAY CONFIG ========== */\n        .broadcast-modal-overlay.lion-dark .broadcast-delay-config {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-delay-config > label {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .delay-input-group label {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .delay-input-group input {\n          background: var(--lion-bg-tertiary) !important;\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .delay-input-group input:focus {\n          border-color: var(--lion-primary);\n          background: var(--lion-bg-secondary) !important;\n          box-shadow: 0 0 0 3px rgba(6, 78, 168, 0.15);\n        }\n\n        .broadcast-modal-overlay.lion-dark .delay-unit {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .delay-hint {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n        }\n\n        /* ========== DARK MODE - ATTACHMENT SECTION ========== */\n        .broadcast-modal-overlay.lion-dark .broadcast-attachment-section {\n          background: linear-gradient(135deg, var(--lion-bg-tertiary) 0%, var(--lion-bg-secondary) 100%);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-attachment-section .wa-attachment-uploader {\n          background: var(--lion-bg-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-attachment-section .wa-form-label {\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-attachment-section .wa-form-input,\n        .broadcast-modal-overlay.lion-dark .broadcast-attachment-section .wa-form-textarea {\n          background: var(--lion-bg-tertiary) !important;\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-attachment-section .wa-form-input:focus,\n        .broadcast-modal-overlay.lion-dark .broadcast-attachment-section .wa-form-textarea:focus {\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 3px rgba(6, 78, 168, 0.15);\n        }\n\n        /* ========== DARK MODE - MESSAGE TAB ========== */\n        .broadcast-modal-overlay.lion-dark .broadcast-message-tab {\n          background: linear-gradient(135deg, var(--lion-bg-tertiary) 0%, var(--lion-bg-secondary) 100%);\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-message-tab.active {\n          background: rgba(6, 78, 168, 0.15);\n          color: var(--lion-primary);\n        }\n\n        /* ========== DARK MODE - ACTION BUTTONS SECTION ========== */\n        .broadcast-modal-overlay.lion-dark .broadcast-actions {\n          border-top-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-btn-quick-start {\n          background: linear-gradient(135deg, var(--lion-bg-tertiary) 0%, var(--lion-bg-secondary) 100%);\n          color: var(--lion-text-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-btn-quick-start:hover {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-medium);\n        }\n\n        /* ========== DARK MODE - SELECTOR MODALS ========== */\n        .broadcast-modal-overlay.lion-dark .selector-modal {\n          background: linear-gradient(180deg, var(--lion-bg-primary) 0%, var(--lion-bg-secondary) 100%);\n          box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-search {\n          background: var(--lion-bg-secondary);\n          border-bottom-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-search-input {\n          background: var(--lion-bg-tertiary) !important;\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-search-input:focus {\n          border-color: var(--lion-primary);\n          background: var(--lion-bg-secondary) !important;\n          box-shadow: 0 0 0 4px rgba(6, 78, 168, 0.15);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-search-input::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-content {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-loading,\n        .broadcast-modal-overlay.lion-dark .selector-empty {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-list {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-item {\n          border-bottom-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-item:hover {\n          background: linear-gradient(135deg, var(--lion-bg-tertiary) 0%, var(--lion-bg-secondary) 100%);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-item-name {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-item-phone,\n        .broadcast-modal-overlay.lion-dark .selector-item-count {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-item-arrow {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-item-clickable:hover {\n          background: linear-gradient(135deg, rgba(6, 78, 168, 0.15) 0%, rgba(6, 78, 168, 0.08) 100%);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-item-clickable:hover .selector-item-arrow {\n          color: var(--lion-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-item-back {\n          background: var(--lion-bg-tertiary);\n          border-bottom-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-item-back:hover {\n          background: var(--lion-bg-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-footer {\n          background: linear-gradient(180deg, var(--lion-bg-secondary) 0%, var(--lion-bg-tertiary) 100%);\n          border-top-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-count {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-btn-cancel {\n          background: linear-gradient(135deg, var(--lion-bg-tertiary) 0%, var(--lion-bg-secondary) 100%);\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-btn-cancel:hover {\n          background: linear-gradient(135deg, var(--lion-bg-secondary) 0%, var(--lion-bg-tertiary) 100%);\n          border-color: var(--lion-border-medium);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-select-all-row {\n          background: var(--lion-bg-secondary);\n          border-bottom-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-select-all-btn {\n          background: linear-gradient(135deg, var(--lion-bg-tertiary) 0%, var(--lion-bg-secondary) 100%);\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selector-select-all-btn:hover {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-medium);\n          color: var(--lion-text-primary);\n        }\n\n        /* ========== DARK MODE - SCHEDULE SECTION ========== */\n        .broadcast-modal-overlay.lion-dark .broadcast-schedule-section {\n          background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.08) 100%);\n          border-color: rgba(59, 130, 246, 0.3);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-schedule-section .broadcast-toggle {\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .schedule-inputs {\n          border-top-color: rgba(59, 130, 246, 0.3);\n        }\n\n        .broadcast-modal-overlay.lion-dark .schedule-input-group label {\n          color: #60a5fa;\n        }\n\n        .broadcast-modal-overlay.lion-dark .schedule-input-group input {\n          background: var(--lion-bg-secondary) !important;\n          border-color: rgba(59, 130, 246, 0.4);\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .schedule-input-group input:focus {\n          border-color: #3b82f6;\n          box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .auto-send-checkbox {\n          background: rgba(251, 191, 36, 0.15);\n          border-color: rgba(251, 191, 36, 0.4);\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .auto-send-checkbox:hover {\n          background: rgba(251, 191, 36, 0.25);\n        }\n\n        .broadcast-modal-overlay.lion-dark .auto-send-label {\n          color: var(--lion-text-secondary);\n        }\n\n        /* ========== DARK MODE - RECURRING SECTION (PREMIUM) ========== */\n        .broadcast-modal-overlay.lion-dark .recurring-section {\n          background: linear-gradient(145deg, rgba(var(--lion-primary-rgb), 0.08) 0%, rgba(var(--lion-primary-rgb), 0.04) 50%, rgba(30, 30, 35, 0.95) 100%);\n          border-color: rgba(var(--lion-primary-rgb), 0.25);\n          box-shadow:\n            0 4px 24px rgba(0, 0, 0, 0.3),\n            inset 0 1px 0 rgba(var(--lion-primary-rgb), 0.15);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-toggle {\n          border-bottom-color: rgba(var(--lion-primary-rgb), 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-toggle span:last-child {\n          background: linear-gradient(135deg, #6D28D9 0%, var(--lion-primary) 100%);\n          -webkit-background-clip: text;\n          -webkit-text-fill-color: transparent;\n          background-clip: text;\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-header {\n          border-bottom-color: rgba(var(--lion-primary-rgb), 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-info-icon {\n          box-shadow: 0 2px 12px rgba(var(--lion-primary-rgb), 0.4);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-info-icon:hover {\n          box-shadow: 0 4px 20px rgba(var(--lion-primary-rgb), 0.5);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-info-tooltip {\n          background: #2a2a2f;\n          border-color: rgba(var(--lion-primary-rgb), 0.25);\n          box-shadow:\n            0 10px 50px rgba(0, 0, 0, 0.4),\n            0 4px 16px rgba(var(--lion-primary-rgb), 0.15);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-info-tooltip::before {\n          background: #2a2a2f;\n          border-color: rgba(var(--lion-primary-rgb), 0.25);\n        }\n\n        .broadcast-modal-overlay.lion-dark .tooltip-title {\n          color: #6D28D9;\n          border-bottom-color: rgba(var(--lion-primary-rgb), 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .tooltip-list li {\n          color: #d1d5db;\n        }\n\n        .broadcast-modal-overlay.lion-dark .tooltip-list li::before {\n          color: #6D28D9;\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-input-group label,\n        .broadcast-modal-overlay.lion-dark .recurring-days-group label,\n        .broadcast-modal-overlay.lion-dark .recurring-end-group > label {\n          color: #a0a0a0;\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-select {\n          background: rgba(40, 40, 45, 0.9);\n          border-color: rgba(255, 255, 255, 0.1);\n          color: #ffffff;\n          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-select:hover {\n          border-color: var(--lion-primary);\n          box-shadow: 0 4px 16px rgba(var(--lion-primary-rgb), 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-select:focus {\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 4px rgba(var(--lion-primary-rgb), 0.15);\n        }\n\n        .broadcast-modal-overlay.lion-dark .day-chip {\n          background: rgba(40, 40, 45, 0.9);\n          border-color: rgba(255, 255, 255, 0.1);\n          color: #a0a0a0;\n          box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .day-chip:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n          box-shadow: 0 6px 20px rgba(var(--lion-primary-rgb), 0.25);\n        }\n\n        .broadcast-modal-overlay.lion-dark .day-chip.selected {\n          background: var(--lion-primary);\n          border-color: transparent;\n          color: white;\n          box-shadow: 0 6px 24px rgba(var(--lion-primary-rgb), 0.4);\n        }\n\n        /* Dark Mode - Yearly Month Chips */\n        .broadcast-modal-overlay.lion-dark .month-chip {\n          background: rgba(40, 40, 45, 0.9);\n          border-color: rgba(255, 255, 255, 0.1);\n          color: #a0a0a0;\n          box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .month-chip:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n          box-shadow: 0 6px 20px rgba(var(--lion-primary-rgb), 0.25);\n        }\n\n        .broadcast-modal-overlay.lion-dark .month-chip.selected {\n          background: var(--lion-primary);\n          border-color: transparent;\n          color: white;\n          box-shadow: 0 6px 24px rgba(var(--lion-primary-rgb), 0.4);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-end-option {\n          background: rgba(40, 40, 45, 0.9);\n          border-color: rgba(255, 255, 255, 0.1);\n          color: #e0e0e0;\n          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-end-option:hover {\n          border-color: var(--lion-primary);\n          box-shadow: 0 4px 16px rgba(var(--lion-primary-rgb), 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-end-option:has(input:checked) {\n          border-color: var(--lion-primary);\n          background: linear-gradient(145deg, rgba(var(--lion-primary-rgb), 0.15) 0%, rgba(var(--lion-primary-rgb), 0.08) 100%);\n          box-shadow: 0 4px 20px rgba(var(--lion-primary-rgb), 0.25);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-end-date-input {\n          background: rgba(40, 40, 45, 0.9);\n          border-color: rgba(255, 255, 255, 0.1);\n          color: #ffffff;\n          box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-end-date-input:hover {\n          border-color: var(--lion-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .recurring-end-date-input:focus {\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 4px rgba(var(--lion-primary-rgb), 0.15);\n        }\n\n        /* ========== DARK MODE - REPORTS LIST ========== */\n        .broadcast-modal-overlay.lion-dark .reports-list-header {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .reports-list-item {\n          border-bottom-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .reports-list-item:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .col-date .date-main {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .col-date .date-time {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .col-contacts {\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .reports-footer {\n          background: var(--lion-bg-secondary);\n          border-top-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .reports-footer-stats {\n          color: var(--lion-text-muted);\n        }\n\n        /* ========== DARK MODE - MEDIA ATTACHMENT FIELD ========== */\n        .broadcast-modal-overlay.lion-dark .wa-media-attachment-field {\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .wa-media-attachment-field .wa-form-label {\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .wa-attachment-item {\n          background: var(--lion-bg-tertiary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .wa-attachment-name {\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .wa-attachment-caption {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .wa-attachment-caption::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .wa-upload-btn {\n          background: var(--lion-bg-tertiary) !important;\n          border-color: var(--lion-border-light) !important;\n          color: var(--lion-text-secondary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .wa-upload-btn:hover:not(.uploading) {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-medium) !important;\n          color: var(--lion-text-primary) !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .wa-form-hint {\n          color: var(--lion-text-muted) !important;\n        }\n\n        /* ========== DARK MODE - REPORTS VIEW MODAL ========== */\n        .reports-view-overlay.lion-dark {\n          --lion-bg-primary: #1a1a1a;\n          --lion-bg-secondary: #262626;\n          --lion-bg-tertiary: #2a2a2a;\n          --lion-text-primary: #ffffff;\n          --lion-text-secondary: #e5e7eb;\n          --lion-text-muted: #9ca3af;\n          --lion-border-light: #3f3f3f;\n          --lion-border-medium: #525252;\n        }\n\n        .reports-view-overlay.lion-dark .reports-view-modal {\n          background: var(--lion-bg-primary);\n        }\n\n        .reports-view-overlay.lion-dark .reports-view-content {\n          background: var(--lion-bg-primary);\n        }\n\n        .reports-view-overlay.lion-dark .reports-section {\n          background: var(--lion-bg-primary);\n        }\n\n        .reports-view-overlay.lion-dark .section-title {\n          color: var(--lion-text-primary);\n        }\n\n        .reports-view-overlay.lion-dark .reports-list-header {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n        }\n\n        .reports-view-overlay.lion-dark .reports-list-item {\n          border-bottom-color: var(--lion-border-light);\n          background: var(--lion-bg-primary);\n        }\n\n        .reports-view-overlay.lion-dark .reports-list-item:hover {\n          background: var(--lion-bg-secondary);\n        }\n\n        .reports-view-overlay.lion-dark .col-date .date-main {\n          color: var(--lion-text-primary);\n        }\n\n        .reports-view-overlay.lion-dark .col-date .date-time {\n          color: var(--lion-text-muted);\n        }\n\n        .reports-view-overlay.lion-dark .col-contacts {\n          color: var(--lion-text-secondary);\n        }\n\n        .reports-view-overlay.lion-dark .reports-empty {\n          background: var(--lion-bg-primary);\n        }\n\n        .reports-view-overlay.lion-dark .reports-empty p {\n          color: var(--lion-text-primary);\n        }\n\n        .reports-view-overlay.lion-dark .reports-empty span {\n          color: var(--lion-text-muted);\n        }\n\n        .reports-view-overlay.lion-dark .reports-view-footer {\n          background: var(--lion-bg-secondary);\n          border-top-color: var(--lion-border-light);\n        }\n\n        .reports-view-overlay.lion-dark .reports-footer-stats {\n          color: var(--lion-text-muted);\n        }\n\n        .reports-view-overlay.lion-dark .reports-clear-btn {\n          color: var(--lion-text-muted);\n          border-color: var(--lion-border-light);\n        }\n\n        .reports-view-overlay.lion-dark .reports-clear-btn:hover {\n          background: rgba(239, 68, 68, 0.15);\n          border-color: #ef4444;\n          color: #ef4444;\n        }\n\n        .reports-view-overlay.lion-dark .section-title {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n          border-bottom-color: var(--lion-border-light);\n        }\n\n        .reports-view-overlay.lion-dark .scheduled-section {\n          background: rgba(59, 130, 246, 0.1);\n          border-bottom-color: #3b82f6;\n        }\n\n        .reports-view-overlay.lion-dark .scheduled-section .section-title {\n          background: rgba(59, 130, 246, 0.2);\n          color: #60a5fa;\n        }\n\n        .reports-view-overlay.lion-dark .status-scheduled {\n          background: rgba(59, 130, 246, 0.08);\n          border-bottom-color: rgba(59, 130, 246, 0.3);\n        }\n\n        .reports-view-overlay.lion-dark .status-scheduled:hover {\n          background: rgba(59, 130, 246, 0.15);\n        }\n\n        .reports-view-overlay.lion-dark .history-section {\n          background: var(--lion-bg-primary);\n        }\n\n        .reports-view-overlay.lion-dark .history-section .section-title {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        /* ========== DARK MODE - SELECT DROPDOWN ========== */\n        .broadcast-modal-overlay.lion-dark .select-dropdown-menu {\n          background: linear-gradient(180deg, var(--lion-bg-secondary) 0%, var(--lion-bg-tertiary) 100%);\n          border-color: var(--lion-border-light);\n          box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.2);\n        }\n\n        .broadcast-modal-overlay.lion-dark .select-dropdown-item {\n          color: var(--lion-text-secondary);\n          border-bottom-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .select-dropdown-item:hover {\n          background: linear-gradient(135deg, rgba(6, 78, 168, 0.15) 0%, rgba(6, 78, 168, 0.08) 100%);\n          color: var(--lion-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .group-select-dropdown {\n          background: var(--lion-bg-tertiary) !important;\n          border-color: var(--lion-border-light) !important;\n          color: var(--lion-text-primary) !important;\n        }\n\n        /* ========== DARK MODE - RESUME CAMPAIGN MODAL ========== */\n        .broadcast-modal-overlay.lion-dark .broadcast-resume-modal {\n          background: var(--lion-bg-primary);\n          box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-resume-header h2 {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-resume-header p {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-resume-progress {\n          background: var(--lion-bg-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-resume-stat .stat-label {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-resume-progress-bar {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-resume-progress-text {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-resume-btn-secondary {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-secondary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-resume-btn-secondary:hover {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-medium);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-resume-btn-dismiss {\n          color: var(--lion-text-muted);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-resume-btn-dismiss:hover {\n          background: var(--lion-bg-secondary);\n        }\n\n        /* ========== DARK MODE - QUEUE VIEW MODAL ========== */\n        .broadcast-modal-overlay.lion-dark .queue-view-modal {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-view-content {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-item-pending {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-item-sending {\n          background: rgba(245, 158, 11, 0.15);\n          border-color: rgba(245, 158, 11, 0.4);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-item-sent {\n          background: rgba(16, 185, 129, 0.15);\n          border-color: rgba(16, 185, 129, 0.4);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-item-failed {\n          background: rgba(239, 68, 68, 0.15);\n          border-color: rgba(239, 68, 68, 0.4);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-item-index {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-item-name {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-item-phone {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-item-time {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-view-footer {\n          background: var(--lion-bg-secondary);\n          border-top-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-progress-bar {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .queue-progress-text {\n          color: var(--lion-text-muted);\n        }\n\n        /* ========== DARK MODE - CAMPAIGN PREVIEW MODAL ========== */\n        .broadcast-modal-overlay.lion-dark .preview-modal {\n          background: var(--lion-bg-primary);\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);\n        }\n\n        .broadcast-modal-overlay.lion-dark .preview-modal-content {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .preview-stat-card {\n          background: linear-gradient(135deg, var(--lion-bg-secondary) 0%, var(--lion-bg-tertiary) 100%);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .preview-stat-value {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .preview-stat-label {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .preview-info-note {\n          background: var(--lion-bg-secondary);\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .preview-modal-footer {\n          background: var(--lion-bg-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .preview-cancel-btn {\n          background: var(--lion-bg-secondary);\n          color: var(--lion-text-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .preview-cancel-btn:hover {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        /* ========== DARK MODE - ACTION PANELS (Group, Custom Tab, Labels, Kanban) ========== */\n        .broadcast-modal-overlay.lion-dark .group-actions-panel {\n          background: linear-gradient(135deg, var(--lion-bg-secondary) 0%, var(--lion-bg-tertiary) 100%);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .group-actions-note {\n          background: rgba(6, 78, 168, 0.15);\n          color: var(--lion-primary);\n          border-left-color: var(--lion-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .group-action-checkbox {\n          color: var(--lion-text-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .group-select-dropdown {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .group-select-dropdown:hover {\n          border-color: var(--lion-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .group-select-placeholder {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .selected-groups-chips .group-chip {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n          border-color: var(--lion-border-light);\n        }\n\n        .broadcast-modal-overlay.lion-dark .group-chip-remove {\n          color: var(--lion-text-muted);\n        }\n\n        .broadcast-modal-overlay.lion-dark .group-chip-remove:hover {\n          color: var(--lion-error);\n        }\n\n        /* Campaign Wizard Dark Mode */\n        .broadcast-modal-overlay.lion-dark .campaign-step-circle {\n          background: #27272a;\n          border-color: #3f3f46;\n          color: #a1a1aa;\n        }\n\n        .broadcast-modal-overlay.lion-dark .campaign-step-label {\n          color: #71717a;\n        }\n\n        .broadcast-modal-overlay.lion-dark .campaign-step.active .campaign-step-label {\n          color: var(--lion-primary);\n        }\n\n        .broadcast-modal-overlay.lion-dark .campaign-step-line {\n          background: #3f3f46;\n        }\n\n        .broadcast-modal-overlay.lion-dark .campaign-wizard-footer {\n          border-top-color: #27272a;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-btn-secondary {\n          background: #27272a !important;\n          border-color: #3f3f46 !important;\n          color: #e5e7eb !important;\n        }\n\n        .broadcast-modal-overlay.lion-dark .broadcast-btn-secondary:hover {\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n        }\n\n'))},Wa="bulk_validator_campaigns",qa=[{code:"91",name:"India",flag:"🇮🇳"},{code:"55",name:"Brazil",flag:"🇧🇷"},{code:"54",name:"Argentina",flag:"🇦🇷"},{code:"51",name:"Peru",flag:"🇵🇪"},{code:"52",name:"Mexico",flag:"🇲🇽"},{code:"57",name:"Colombia",flag:"🇨🇴"},{code:"56",name:"Chile",flag:"🇨🇱"},{code:"1",name:"USA/Canada",flag:"🇺🇸"},{code:"44",name:"UK",flag:"🇬🇧"},{code:"34",name:"Spain",flag:"🇪🇸"},{code:"351",name:"Portugal",flag:"🇵🇹"},{code:"49",name:"Germany",flag:"🇩🇪"},{code:"33",name:"France",flag:"🇫🇷"},{code:"39",name:"Italy",flag:"🇮🇹"},{code:"62",name:"Indonesia",flag:"🇮🇩"},{code:"63",name:"Philippines",flag:"🇵🇭"},{code:"27",name:"South Africa",flag:"🇿🇦"},{code:"971",name:"UAE",flag:"🇦🇪"},{code:"966",name:"Saudi Arabia",flag:"🇸🇦"}],Ha=({isOpen:e,onClose:t})=>{const[n,r]=(0,a.useState)([]),[o,i]=(0,a.useState)("new"),[l,c]=(0,a.useState)(""),[d,m]=(0,a.useState)("91"),[p,u]=(0,a.useState)([]),[g,h]=(0,a.useState)(null),[b,f]=(0,a.useState)(!1),v=(0,a.useRef)(null),y=(0,a.useRef)(null),x=(0,a.useRef)(!1),w=(0,a.useRef)(!1),[k,E]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{const e=()=>{const e=_();E("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]),(0,a.useEffect)(()=>{S()},[]),(0,a.useEffect)(()=>()=>{y.current&&clearInterval(y.current)},[]);const S=()=>{try{const e=localStorage.getItem(Wa);e&&r(JSON.parse(e))}catch(e){}},C=e=>{try{localStorage.setItem(Wa,JSON.stringify(e)),r(e)}catch(e){}},T=async e=>{const t=async()=>{if(w.current)return void D(e,"paused");const n=localStorage.getItem(Wa),a=n?JSON.parse(n):[],r=a.find(t=>t.id===e);if(!r)return;if(0===r.pendingNumbers.length)return void D(e,"completed");const o=r.pendingNumbers[0];try{const n=await N(o),i={...r};n?i.validNumbers=[...r.validNumbers,o]:i.invalidNumbers=[...r.invalidNumbers,o],i.pendingNumbers=r.pendingNumbers.slice(1),i.validatedCount=r.validatedCount+1;const s=a.map(t=>t.id===e?i:t);C(s),i.pendingNumbers.length>0&&!w.current?setTimeout(()=>t(),1500):0===i.pendingNumbers.length&&D(e,"completed")}catch(n){const i={...r};i.invalidNumbers=[...r.invalidNumbers,o],i.pendingNumbers=r.pendingNumbers.slice(1),i.validatedCount=r.validatedCount+1;const s=a.map(t=>t.id===e?i:t);C(s),i.pendingNumbers.length>0&&!w.current?setTimeout(()=>t(),1500):0===i.pendingNumbers.length&&D(e,"completed")}};t()},D=(e,t)=>{const n=localStorage.getItem(Wa),a=(n?JSON.parse(n):[]).map(n=>n.id===e?{...n,status:t}:n);C(a),f(!1),x.current=!1,h(null)},N=e=>new Promise(t=>{const n=`validate_${e}_${Date.now()}`,a=e=>{"BULK_VALIDATE_RESPONSE"===e.data?.type&&e.data?.messageId===n&&(window.removeEventListener("message",a),t(!0===e.data.isValid))};window.addEventListener("message",a),window.postMessage({type:"BULK_VALIDATE_NUMBER",number:e,messageId:n},"*"),setTimeout(()=>{window.removeEventListener("message",a),t(!1)},1e4)}),M=(e,t)=>{let n=[],a="";switch(t){case"valid":n=e.validNumbers,a=`${e.name}_valid_numbers.csv`;break;case"invalid":n=e.invalidNumbers,a=`${e.name}_invalid_numbers.csv`;break;case"all":n=["Phone Number,Status",...e.validNumbers.map(e=>`${e},Valid`),...e.invalidNumbers.map(e=>`${e},Invalid`),...e.pendingNumbers.map(e=>`${e},Pending`)],a=`${e.name}_all_numbers.csv`}"all"!==t&&(n=["Phone Number",...n]);const r=n.join("\n"),o=new Blob([r],{type:"text/csv;charset=utf-8;"}),i=document.createElement("a");i.href=URL.createObjectURL(o),i.download=a,i.click()};if(!e)return null;const R=n.filter(e=>"completed"!==e.status),B=n.filter(e=>"completed"===e.status),P=[{id:"new",label:(0,s.t)("bulkValidator.newCampaign")||"New Campaign",icon:a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"}))},{id:"active",label:(0,s.t)("bulkValidator.activeCampaigns")||"Active Campaigns",icon:a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polygon",{points:"5 3 19 12 5 21 5 3"})),count:R.length},{id:"completed",label:(0,s.t)("bulkValidator.completed")||"Completed",icon:a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),a.createElement("polyline",{points:"22 4 12 14.01 9 11.01"})),count:B.length}],L=e=>{const t=e.validatedCount/e.totalNumbers*100,r="completed"===e.status?"#10b981":"running"===e.status?"var(--lion-primary)":"paused"===e.status?"#0ea5e9":"#6b7280";return a.createElement("div",{key:e.id,style:ja.campaignCard},a.createElement("div",{style:ja.campaignHeader},a.createElement("div",{style:{flex:1,minWidth:0}},a.createElement("h4",{style:ja.campaignName},e.name),a.createElement("span",{style:ja.campaignDate},(o=e.createdAt,new Date(o).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})))),a.createElement("span",{style:{...ja.statusBadge,background:r}},e.status.toUpperCase())),a.createElement("div",{style:ja.progressSection},a.createElement("div",{style:ja.progressBar},a.createElement("div",{style:{...ja.progressFill,width:`${t}%`}})),a.createElement("div",{style:ja.progressText},e.validatedCount," / ",e.totalNumbers," (",Math.round(t),"%)")),a.createElement("div",{style:ja.statsRow},a.createElement("div",{style:ja.statItem},a.createElement("span",{style:{color:"#10b981",fontWeight:700}},e.validNumbers.length),a.createElement("span",{style:ja.statLabel},(0,s.t)("bulkValidator.valid")||"Valid")),a.createElement("div",{style:ja.statItem},a.createElement("span",{style:{color:"#ef4444",fontWeight:700}},e.invalidNumbers.length),a.createElement("span",{style:ja.statLabel},(0,s.t)("bulkValidator.invalid")||"Invalid")),a.createElement("div",{style:ja.statItem},a.createElement("span",{style:{color:"var(--bv-text-muted)",fontWeight:700}},e.pendingNumbers.length),a.createElement("span",{style:ja.statLabel},(0,s.t)("bulkValidator.pending")||"Pending"))),a.createElement("div",{style:ja.campaignActions},("pending"===e.status||"paused"===e.status)&&a.createElement("button",{style:ja.actionBtnPrimary,onClick:()=>(async e=>{const t=localStorage.getItem(Wa),n=t?JSON.parse(t):[],a=n.find(t=>t.id===e);if(!a||0===a.pendingNumbers.length)return;h(e),f(!0),x.current=!0,w.current=!1;const r=n.map(t=>t.id===e?{...t,status:"running"}:t);C(r),T(e)})(e.id),disabled:b},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M8 5v14l11-7z"})),(0,s.t)("bulkValidator.start")||"Start"),"running"===e.status&&a.createElement("button",{style:{...ja.actionBtnPrimary,background:"linear-gradient(135deg, #0ea5e9, #6D28D9)"},onClick:()=>(e=>{w.current=!0,x.current=!1,f(!1),h(null);const t=localStorage.getItem(Wa),n=(t?JSON.parse(t):[]).map(t=>t.id===e?{...t,status:"paused"}:t);C(n)})(e.id)},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})),(0,s.t)("bulkValidator.pause")||"Pause"),e.validatedCount>0&&a.createElement("div",{style:ja.downloadGroup},e.validNumbers.length>0&&a.createElement("button",{style:{...ja.actionBtnGhost,color:"#10b981",borderColor:"#10b98140"},onClick:()=>M(e,"valid"),title:(0,s.t)("bulkValidator.downloadValid")||"Download Valid Numbers"},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})),(0,s.t)("bulkValidator.valid")||"Valid"),e.invalidNumbers.length>0&&a.createElement("button",{style:{...ja.actionBtnGhost,color:"#ef4444",borderColor:"#ef444440"},onClick:()=>M(e,"invalid"),title:(0,s.t)("bulkValidator.downloadInvalid")||"Download Invalid Numbers"},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})),(0,s.t)("bulkValidator.invalid")||"Invalid"),a.createElement("button",{style:ja.actionBtnGhost,onClick:()=>M(e,"all"),title:(0,s.t)("bulkValidator.downloadAll")||"Download All"},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})),(0,s.t)("bulkValidator.all")||"All")),a.createElement("button",{style:ja.deleteBtn,onClick:()=>(e=>{if(!confirm((0,s.t)("bulkValidator.confirmDelete")||"Tem certeza que deseja excluir esta campanha?"))return;const t=n.filter(t=>t.id!==e);C(t)})(e.id),title:(0,s.t)("delete")||"Delete"},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})))));var o},U=(e,t)=>a.createElement("div",{style:ja.emptyState},a.createElement("div",{style:ja.emptyIconWrap},t),a.createElement("p",{style:ja.emptyText},e));return a.createElement("div",{className:"bulk-validator-overlay "+(k?"lion-dark":""),style:ja.overlay,onClick:t},a.createElement("style",null,ma),a.createElement("style",null,"\n        .bulk-validator-overlay {\n          --bv-modal-bg: #ffffff;\n          --bv-modal-border: #e5e7eb;\n          --bv-text-primary: #1f2937;\n          --bv-text-muted: #6b7280;\n          --bv-text-label: #374151;\n          --bv-input-bg: #ffffff;\n          --bv-input-border: #d1d5db;\n          --bv-card-bg: #f9fafb;\n          --bv-sidebar-bg: #f9fafb;\n          --bv-progress-bg: #e5e7eb;\n          animation: bvOverlayFade 0.18s ease;\n        }\n        .bulk-validator-overlay.lion-dark {\n          --bv-modal-bg: #1a1a1a;\n          --bv-modal-border: #2a2a2a;\n          --bv-text-primary: #ffffff;\n          --bv-text-muted: #a0a0a0;\n          --bv-text-label: #e0e0e0;\n          --bv-input-bg: #262626;\n          --bv-input-border: #3a3a3a;\n          --bv-card-bg: #262626;\n          --bv-sidebar-bg: #141414;\n          --bv-progress-bg: #333333;\n        }\n        @keyframes bvOverlayFade { from { opacity: 0; } to { opacity: 1; } }\n        @keyframes bvModalPop {\n          from { opacity: 0; transform: translateY(8px) scale(0.985); }\n          to { opacity: 1; transform: translateY(0) scale(1); }\n        }\n        .bv-modal-wrap { animation: bvModalPop 0.2s ease; }\n\n        .bv-close-btn:hover {\n          background: rgba(239, 68, 68, 0.1) !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n          color: #ef4444 !important;\n          transform: rotate(90deg);\n        }\n\n        .bv-nav-item {\n          transition: all 0.15s ease;\n        }\n        .bv-nav-item:hover:not(.active) {\n          background: var(--bv-modal-bg);\n          color: var(--bv-text-primary);\n        }\n        .bv-nav-item.active {\n          background: var(--lion-primary);\n          color: #ffffff;\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.3);\n        }\n        .bv-nav-item.active .bv-nav-badge {\n          background: rgba(255,255,255,0.28);\n          color: #ffffff;\n        }\n\n        .bv-input:focus {\n          outline: none;\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 4px rgba(var(--lion-primary-rgb), 0.12);\n        }\n\n        .bv-primary-btn:hover:not(:disabled) {\n          transform: translateY(-1px);\n          box-shadow: 0 10px 22px rgba(var(--lion-primary-rgb), 0.42) !important;\n        }\n        .bv-primary-btn:disabled { opacity: 0.55; cursor: not-allowed; }\n\n        .bv-scroll::-webkit-scrollbar { width: 5px; }\n        .bv-scroll::-webkit-scrollbar-thumb { background: var(--bv-input-border); border-radius: 5px; }\n        .bv-scroll::-webkit-scrollbar-track { background: transparent; }\n      "),a.createElement("div",{className:"bv-modal-wrap",style:ja.modal,onClick:e=>e.stopPropagation()},a.createElement("div",{style:ja.header},a.createElement("div",{style:ja.headerTitle},a.createElement("div",{style:ja.headerIcon},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#ffffff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))),a.createElement("div",null,a.createElement("h2",{style:ja.title},(0,s.t)("bulkValidator.title")||"Bulk Number Validator"),a.createElement("p",{style:ja.subtitle},(0,s.t)("bulkValidator.subtitle")||"Validate WhatsApp numbers in bulk with campaigns"))),a.createElement("button",{className:"bv-close-btn",style:ja.closeBtn,onClick:t,"aria-label":"Close"},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),a.createElement("div",{style:ja.body},a.createElement("aside",{style:ja.sidebar},a.createElement("div",{style:ja.sidebarLabel},(0,s.t)("bulkValidator.menu")||"Menu"),a.createElement("div",{style:ja.sidebarNav},P.map(e=>a.createElement("button",{key:e.id,className:"bv-nav-item "+(o===e.id?"active":""),style:ja.navItem,onClick:()=>i(e.id)},a.createElement("span",{style:{display:"flex",alignItems:"center"}},e.icon),a.createElement("span",{style:{flex:1,textAlign:"left"}},e.label),"number"==typeof e.count&&a.createElement("span",{className:"bv-nav-badge",style:ja.navBadge},e.count))))),a.createElement("main",{className:"bv-scroll",style:ja.content},"new"===o&&a.createElement("div",{style:ja.newCampaignForm},a.createElement("h3",{style:ja.formTitle},(0,s.t)("bulkValidator.createCampaign")||"Criar Nova Campanha"),a.createElement("p",{style:ja.formSubtitle},(0,s.t)("bulkValidator.createHint")||"Envie um arquivo CSV com números para iniciar a validação."),a.createElement("div",{style:ja.formGroup},a.createElement("label",{style:ja.label},(0,s.t)("bulkValidator.campaignName")||"Nome da Campanha"),a.createElement("input",{type:"text",className:"bv-input",style:ja.input,value:l,onChange:e=>c(e.target.value),placeholder:(0,s.t)("bulkValidator.enterCampaignName")||"Digite o nome da campanha"})),a.createElement("div",{style:ja.formGroup},a.createElement("label",{style:ja.label},(0,s.t)("bulkValidator.countryCode")||"Country Code"),a.createElement("select",{className:"bv-input",style:ja.input,value:d,onChange:e=>m(e.target.value)},qa.map(e=>a.createElement("option",{key:e.code,value:e.code},e.flag," +",e.code," - ",e.name))),a.createElement("p",{style:ja.hint},(0,s.t)("bulkValidator.countryCodeHint")||"Select country code for numbers without prefix")),a.createElement("div",{style:ja.formGroup},a.createElement("label",{style:ja.label},(0,s.t)("bulkValidator.uploadCSV")||"Enviar Arquivo CSV"),a.createElement("input",{ref:v,type:"file",accept:".csv,.txt",className:"bv-input",style:ja.fileInput,onChange:e=>{const t=e.target.files?.[0];if(!t)return;const n=new FileReader;n.onload=e=>{const t=e.target?.result,n=t.split(/[\r\n]+/).filter(e=>e.trim()),a=[];n.forEach(e=>{e.split(/[,;\t]/).forEach(e=>{const t=e.trim().replace(/[^0-9+]/g,"");if(t.length>=10){let e=t;e.startsWith("+")&&(e=e.substring(1)),e.startsWith(d)||(e=d+e),a.push(e)}})});const r=[...new Set(a)];u(r)},n.readAsText(t)}}),a.createElement("p",{style:ja.hint},(0,s.t)("bulkValidator.csvHint")||"CSV file with phone numbers (one per line or comma separated)")),p.length>0&&a.createElement("div",{style:ja.uploadedInfo},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})),a.createElement("span",null,p.length," ",(0,s.t)("bulkValidator.numbersFound")||"numbers found")),a.createElement("div",{style:ja.formActions},a.createElement("button",{style:ja.cancelBtn,onClick:()=>{c(""),u([]),v.current&&(v.current.value="")}},(0,s.t)("cancel")||"Reset"),a.createElement("button",{className:"bv-primary-btn",style:ja.createBtn,onClick:()=>{if(!l.trim()||0===p.length)return void alert((0,s.t)("bulkValidator.enterNameAndUpload")||"Por favor, insira o nome da campanha e envie os números");const e=[{id:`campaign_${Date.now()}`,name:l.trim(),createdAt:Date.now(),totalNumbers:p.length,validatedCount:0,validNumbers:[],invalidNumbers:[],pendingNumbers:[...p],status:"pending"},...n];C(e),c(""),u([]),i("active"),v.current&&(v.current.value="")},disabled:!l.trim()||0===p.length},(0,s.t)("bulkValidator.createAndStart")||"Criar Campanha"))),"active"===o&&a.createElement("div",null,a.createElement("div",{style:ja.contentHeader},a.createElement("h3",{style:ja.contentHeaderTitle},(0,s.t)("bulkValidator.activeCampaigns")||"Active Campaigns"),a.createElement("span",{style:ja.contentHeaderCount},R.length)),0===R.length?U((0,s.t)("bulkValidator.noActiveCampaigns")||"No active campaigns. Start a new one to validate numbers.",a.createElement("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polygon",{points:"5 3 19 12 5 21 5 3"}))):R.map(L)),"completed"===o&&a.createElement("div",null,a.createElement("div",{style:ja.contentHeader},a.createElement("h3",{style:ja.contentHeaderTitle},(0,s.t)("bulkValidator.completed")||"Completed"),a.createElement("span",{style:ja.contentHeaderCount},B.length)),0===B.length?U((0,s.t)("bulkValidator.noCompleted")||"No completed campaigns yet.",a.createElement("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),a.createElement("polyline",{points:"22 4 12 14.01 9 11.01"}))):B.map(L))))))},ja={overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.55)",backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},modal:{background:"var(--bv-modal-bg)",borderRadius:"16px",width:"92%",maxWidth:"920px",height:"88vh",maxHeight:"720px",display:"flex",flexDirection:"column",boxShadow:"0 24px 60px rgba(0, 0, 0, 0.25), 0 8px 20px rgba(0, 0, 0, 0.08)",border:"1px solid var(--bv-modal-border)",overflow:"hidden"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"20px 24px",borderBottom:"1px solid var(--bv-modal-border)",background:"var(--bv-modal-bg)",flexShrink:0},headerTitle:{display:"flex",alignItems:"center",gap:"14px",flex:1,minWidth:0},headerIcon:{width:"42px",height:"42px",borderRadius:"12px",background:"var(--lion-primary)",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 6px 16px rgba(var(--lion-primary-rgb), 0.32)",flexShrink:0},title:{margin:0,fontSize:"20px",fontWeight:700,color:"var(--bv-text-primary)",letterSpacing:"-0.2px"},subtitle:{margin:"4px 0 0",fontSize:"13px",color:"var(--bv-text-muted)",lineHeight:1.4},closeBtn:{background:"var(--bv-card-bg)",border:"1px solid var(--bv-modal-border)",color:"var(--bv-text-muted)",cursor:"pointer",width:"36px",height:"36px",borderRadius:"10px",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.15s ease",flexShrink:0,marginLeft:"12px"},body:{display:"flex",flex:1,overflow:"hidden",minHeight:0},sidebar:{width:"220px",background:"var(--bv-sidebar-bg)",borderRight:"1px solid var(--bv-modal-border)",padding:"16px 10px",flexShrink:0,display:"flex",flexDirection:"column",overflowY:"auto"},sidebarLabel:{padding:"4px 10px 10px",fontSize:"11px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.8px",color:"var(--bv-text-muted)"},sidebarNav:{display:"flex",flexDirection:"column",gap:"4px"},navItem:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 12px",border:"none",background:"none",borderRadius:"8px",fontSize:"13px",fontWeight:500,color:"var(--bv-text-label)",cursor:"pointer",textAlign:"left",width:"100%"},navBadge:{fontSize:"10px",fontWeight:700,padding:"2px 8px",borderRadius:"999px",background:"var(--bv-card-bg)",color:"var(--bv-text-muted)",minWidth:"22px",textAlign:"center"},content:{flex:1,padding:"24px 26px",overflowY:"auto",minWidth:0},contentHeader:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"16px"},contentHeaderTitle:{margin:0,fontSize:"16px",fontWeight:700,color:"var(--bv-text-primary)",letterSpacing:"-0.1px"},contentHeaderCount:{fontSize:"11px",fontWeight:700,padding:"3px 10px",borderRadius:"999px",background:"rgba(var(--lion-primary-rgb), 0.12)",color:"var(--lion-primary)"},newCampaignForm:{background:"transparent",padding:0},formTitle:{margin:"0 0 6px",fontSize:"16px",fontWeight:700,color:"var(--bv-text-primary)",letterSpacing:"-0.1px"},formSubtitle:{margin:"0 0 20px",fontSize:"13px",color:"var(--bv-text-muted)",lineHeight:1.5},formGroup:{marginBottom:"16px"},label:{display:"block",marginBottom:"8px",fontSize:"11px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.6px",color:"var(--bv-text-muted)"},input:{width:"100%",padding:"11px 14px",background:"var(--bv-input-bg)",border:"1px solid var(--bv-input-border)",borderRadius:"10px",color:"var(--bv-text-primary)",fontSize:"14px",outline:"none",boxSizing:"border-box",transition:"all 0.15s ease"},fileInput:{width:"100%",padding:"11px 14px",background:"var(--bv-input-bg)",border:"1px solid var(--bv-input-border)",borderRadius:"10px",color:"var(--bv-text-primary)",fontSize:"13px",cursor:"pointer",boxSizing:"border-box"},hint:{margin:"6px 0 0",fontSize:"12px",color:"var(--bv-text-muted)",lineHeight:1.5},uploadedInfo:{display:"flex",alignItems:"center",gap:"8px",padding:"11px 14px",background:"rgba(16, 185, 129, 0.1)",border:"1px solid rgba(16, 185, 129, 0.3)",borderRadius:"10px",color:"#10b981",fontSize:"13px",fontWeight:600,marginBottom:"18px"},formActions:{display:"flex",gap:"10px",justifyContent:"flex-end",marginTop:"22px"},cancelBtn:{padding:"10px 22px",background:"var(--bv-input-bg)",border:"1px solid var(--bv-input-border)",borderRadius:"10px",color:"var(--bv-text-label)",fontSize:"13px",fontWeight:600,cursor:"pointer",letterSpacing:"0.2px",transition:"all 0.15s ease"},createBtn:{padding:"10px 22px",background:"var(--lion-primary)",border:"1px solid transparent",borderRadius:"10px",color:"#ffffff",fontSize:"13px",fontWeight:600,cursor:"pointer",letterSpacing:"0.2px",boxShadow:"0 6px 16px rgba(var(--lion-primary-rgb), 0.32)",transition:"all 0.15s ease"},emptyState:{textAlign:"center",padding:"60px 20px",color:"var(--bv-text-muted)",display:"flex",flexDirection:"column",alignItems:"center",gap:"12px"},emptyIconWrap:{width:"72px",height:"72px",borderRadius:"50%",background:"var(--bv-card-bg)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--bv-text-muted)"},emptyText:{margin:0,fontSize:"13px",maxWidth:"280px",lineHeight:1.5},campaignCard:{background:"var(--bv-card-bg)",border:"1px solid var(--bv-modal-border)",borderRadius:"14px",padding:"16px 18px",marginBottom:"12px"},campaignHeader:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",marginBottom:"12px"},campaignName:{margin:"0 0 3px",fontSize:"14px",fontWeight:700,color:"var(--bv-text-primary)"},campaignDate:{fontSize:"11px",color:"var(--bv-text-muted)",fontWeight:500},statusBadge:{padding:"4px 10px",borderRadius:"999px",fontSize:"10px",fontWeight:700,color:"white",letterSpacing:"0.6px",flexShrink:0},progressSection:{marginBottom:"14px"},progressBar:{height:"8px",background:"var(--bv-progress-bg)",borderRadius:"999px",overflow:"hidden",marginBottom:"6px"},progressFill:{height:"100%",background:"var(--lion-primary)",borderRadius:"999px",transition:"width 0.3s ease"},progressText:{fontSize:"11px",color:"var(--bv-text-muted)",textAlign:"right",fontWeight:600},statsRow:{display:"flex",gap:"18px",marginBottom:"14px",padding:"10px 12px",background:"var(--bv-modal-bg)",borderRadius:"10px",border:"1px solid var(--bv-modal-border)"},statItem:{display:"flex",alignItems:"center",gap:"6px",fontSize:"12px"},statLabel:{color:"var(--bv-text-muted)",fontWeight:500},campaignActions:{display:"flex",gap:"6px",flexWrap:"wrap",alignItems:"center"},actionBtnPrimary:{padding:"7px 14px",background:"var(--lion-primary)",border:"none",borderRadius:"8px",color:"white",fontSize:"12px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",boxShadow:"0 4px 10px rgba(var(--lion-primary-rgb), 0.3)"},actionBtnGhost:{padding:"7px 12px",background:"var(--bv-modal-bg)",border:"1px solid var(--bv-input-border)",borderRadius:"8px",color:"var(--bv-text-label)",fontSize:"11px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:"5px",transition:"all 0.15s ease"},deleteBtn:{padding:"7px 10px",background:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",borderRadius:"8px",color:"#ef4444",fontSize:"11px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",marginLeft:"auto"},downloadGroup:{display:"flex",gap:"6px",flexWrap:"wrap"}},Va=`\n  ${ma}\n\n  .todo-form-overlay {\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background: rgba(0, 0, 0, 0.55);\n    backdrop-filter: blur(6px);\n    -webkit-backdrop-filter: blur(6px);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    z-index: 10001;\n    animation: todoFadeIn 0.15s ease;\n  }\n\n  @keyframes todoFadeIn {\n    from { opacity: 0; }\n    to { opacity: 1; }\n  }\n\n  .todo-form-modal {\n    background: var(--lion-bg-primary);\n    border-radius: 16px;\n    border: 1px solid var(--lion-border-light);\n    width: 95%;\n    max-width: 520px;\n    max-height: 90vh;\n    overflow: hidden;\n    box-shadow: 0 25px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.05);\n    animation: todoSlideUp 0.3s ease;\n    display: flex;\n    flex-direction: column;\n  }\n\n  @keyframes todoSlideUp {\n    from { transform: translateY(20px); opacity: 0; }\n    to { transform: translateY(0); opacity: 1; }\n  }\n\n  .todo-form-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 20px 24px;\n    background: var(--lion-bg-primary);\n    border-bottom: 1px solid var(--lion-border-light);\n  }\n\n  .todo-form-title {\n    font-size: 20px;\n    font-weight: 700;\n    color: var(--lion-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 10px;\n  }\n\n  .todo-form-title svg {\n    width: 24px;\n    height: 24px;\n    color: var(--lion-primary);\n  }\n\n  .todo-form-close {\n    background: var(--lion-bg-tertiary, #f4f4f5);\n    border: 1px solid var(--lion-border-light);\n    color: var(--lion-text-muted);\n    width: 36px;\n    height: 36px;\n    border-radius: 10px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s;\n  }\n\n  .todo-form-close:hover {\n    background: rgba(239, 68, 68, 0.1);\n    border-color: rgba(239, 68, 68, 0.3);\n    color: var(--lion-error);\n  }\n\n  .todo-form-content {\n    padding: 20px;\n    overflow-y: auto;\n    flex: 1;\n    scrollbar-width: thin;\n    scrollbar-color: var(--lion-border-light) transparent;\n  }\n\n  .todo-form-content::-webkit-scrollbar {\n    width: 5px;\n  }\n\n  .todo-form-content::-webkit-scrollbar-track {\n    background: transparent;\n  }\n\n  .todo-form-content::-webkit-scrollbar-thumb {\n    background: var(--lion-border-light);\n    border-radius: 10px;\n  }\n\n  .todo-form-content::-webkit-scrollbar-thumb:hover {\n    background: var(--lion-border-medium, #d1d5db);\n  }\n\n  .todo-form-group {\n    margin-bottom: 16px;\n  }\n\n  .todo-form-label {\n    display: block;\n    font-size: 12px;\n    font-weight: 700;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    color: var(--lion-text-primary);\n    margin-bottom: 6px;\n  }\n\n  .todo-form-label.required::after {\n    content: ' *';\n    color: var(--lion-error);\n  }\n\n  .todo-form-input {\n    width: 100%;\n    padding: 10px 12px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 14px;\n    color: var(--lion-text-primary);\n    background: var(--lion-bg-secondary);\n    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;\n    box-sizing: border-box;\n  }\n\n  .todo-form-input:hover {\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .todo-form-input:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n    background: var(--lion-bg-primary);\n  }\n\n  .todo-form-textarea {\n    min-height: 80px;\n    resize: vertical;\n    border-radius: 10px;\n  }\n\n  .todo-form-row {\n    display: grid;\n    grid-template-columns: 1fr 1fr;\n    gap: 12px;\n  }\n\n  .todo-form-select {\n    width: 100%;\n    padding: 10px 12px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 14px;\n    color: var(--lion-text-primary);\n    background: var(--lion-bg-secondary);\n    cursor: pointer;\n    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;\n  }\n\n  .todo-form-select:hover {\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .todo-form-select:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n    background: var(--lion-bg-primary);\n  }\n\n  /* Priority Select with Colors */\n  .priority-option {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .priority-dot {\n    width: 10px;\n    height: 10px;\n    border-radius: 50%;\n  }\n\n  .priority-dot.high { background: var(--lion-error); }\n  .priority-dot.medium { background: var(--lion-warning); }\n  .priority-dot.low { background: var(--lion-info); }\n\n  /* Category with Color Preview */\n  .category-select-wrapper {\n    display: flex;\n    gap: 8px;\n  }\n\n  .category-select-wrapper select {\n    flex: 1;\n  }\n\n  .category-color-preview {\n    width: 40px;\n    height: 40px;\n    border-radius: 8px;\n    border: 1px solid var(--lion-border-light);\n    cursor: pointer;\n    padding: 0;\n    -webkit-appearance: none;\n    appearance: none;\n  }\n\n  .category-color-preview::-webkit-color-swatch-wrapper {\n    padding: 0;\n  }\n\n  .category-color-preview::-webkit-color-swatch {\n    border: none;\n    border-radius: 6px;\n  }\n\n  .category-color-preview::-moz-color-swatch {\n    border: none;\n    border-radius: 6px;\n  }\n\n  .category-color-preview:disabled {\n    cursor: not-allowed;\n    opacity: 0.5;\n  }\n\n  /* Section Divider */\n  .todo-form-section {\n    margin-top: 20px;\n    padding-top: 16px;\n    border-top: 1px solid var(--lion-border-light);\n  }\n\n  .todo-form-section-title {\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--lion-text-primary);\n    margin-bottom: 12px;\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .todo-form-section-title svg {\n    width: 18px;\n    height: 18px;\n    color: var(--lion-primary);\n  }\n\n  /* Subtasks */\n  .subtask-list {\n    margin-bottom: 10px;\n  }\n\n  .subtask-item {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    padding: 8px 10px;\n    background: var(--lion-bg-tertiary);\n    border-radius: 6px;\n    margin-bottom: 6px;\n  }\n\n  .subtask-text {\n    flex: 1;\n    font-size: 13px;\n    color: var(--lion-text-primary);\n  }\n\n  .subtask-delete {\n    background: none;\n    border: none;\n    color: var(--lion-text-muted);\n    cursor: pointer;\n    padding: 4px;\n    border-radius: 4px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n  }\n\n  .subtask-delete:hover {\n    background: rgba(239, 68, 68, 0.1); /* error with alpha */\n    color: var(--lion-error);\n  }\n\n  .subtask-delete svg {\n    width: 16px;\n    height: 16px;\n  }\n\n  .add-subtask-row {\n    display: flex;\n    gap: 8px;\n  }\n\n  .add-subtask-row input {\n    flex: 1;\n  }\n\n  .add-subtask-btn {\n    padding: 10px 16px;\n    background: var(--lion-bg-tertiary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    color: var(--lion-text-primary);\n    font-size: 13px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    transition: all 0.15s;\n  }\n\n  .add-subtask-btn:hover {\n    background: var(--lion-primary);\n    color: white;\n    border-color: var(--lion-primary);\n  }\n\n  .add-subtask-btn svg {\n    width: 16px;\n    height: 16px;\n  }\n\n  /* Toggle Switch */\n  .toggle-row {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 10px 0;\n  }\n\n  .toggle-label {\n    font-size: 14px;\n    color: var(--lion-text-primary);\n  }\n\n  .toggle-switch {\n    position: relative;\n    width: 44px;\n    height: 24px;\n  }\n\n  .toggle-switch input {\n    opacity: 0;\n    width: 0;\n    height: 0;\n  }\n\n  .toggle-slider {\n    position: absolute;\n    cursor: pointer;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background-color: var(--lion-bg-tertiary);\n    border: 1px solid var(--lion-border-light);\n    transition: all 0.15s ease;\n    border-radius: 24px;\n  }\n\n  .toggle-slider:before {\n    position: absolute;\n    content: "";\n    height: 18px;\n    width: 18px;\n    left: 2px;\n    bottom: 2px;\n    background-color: white;\n    transition: all 0.15s ease;\n    border-radius: 50%;\n    box-shadow: 0 1px 4px rgba(0,0,0,0.15);\n  }\n\n  .toggle-switch input:checked + .toggle-slider {\n    background: var(--lion-primary);\n    border-color: var(--lion-primary);\n    box-shadow: 0 2px 6px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .toggle-switch input:checked + .toggle-slider:before {\n    transform: translateX(20px);\n  }\n\n  /* Recurring Options */\n  .recurring-options {\n    margin-top: 10px;\n    padding: 12px;\n    background: var(--lion-bg-tertiary);\n    border-radius: 10px;\n  }\n\n  /* Checkbox Row */\n  .checkbox-row {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    padding: 8px 0;\n  }\n\n  .checkbox-row input[type="checkbox"] {\n    width: 18px;\n    height: 18px;\n    accent-color: var(--lion-primary);\n    cursor: pointer;\n  }\n\n  .checkbox-row label {\n    font-size: 14px;\n    color: var(--lion-text-primary);\n    cursor: pointer;\n  }\n\n  .checkbox-hint {\n    font-size: 12px;\n    color: var(--lion-text-muted);\n    margin-left: 28px;\n    margin-top: -4px;\n  }\n\n  /* Footer */\n  .todo-form-footer {\n    display: flex;\n    justify-content: flex-end;\n    gap: 10px;\n    padding: 16px 20px;\n    border-top: 1px solid var(--lion-border-light);\n    background: var(--lion-bg-secondary);\n  }\n\n  .todo-form-btn {\n    padding: 10px 20px;\n    border-radius: 10px;\n    font-size: 14px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.15s;\n    display: flex;\n    align-items: center;\n    gap: 6px;\n  }\n\n  .todo-form-btn-cancel {\n    background: var(--lion-bg-tertiary, #f4f4f5);\n    border: 1px solid var(--lion-border-light);\n    color: var(--lion-text-muted);\n  }\n\n  .todo-form-btn-cancel:hover {\n    background: var(--lion-bg-primary);\n    color: var(--lion-text-primary);\n  }\n\n  .todo-form-btn-save {\n    background: var(--lion-primary);\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n    border: none;\n    color: white;\n  }\n\n  .todo-form-btn-save:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.35);\n  }\n\n  .todo-form-btn-save:disabled {\n    background: var(--lion-text-muted);\n    box-shadow: none;\n    transform: none;\n    cursor: not-allowed;\n  }\n\n  /* Contact Linking Section */\n  .contact-linking-section {\n    margin-top: 20px;\n    padding-top: 16px;\n    border-top: 1px solid var(--lion-border-light);\n  }\n\n  .contact-linking-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    margin-bottom: 12px;\n  }\n\n  .contact-linking-title {\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--lion-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .contact-linking-title svg {\n    width: 18px;\n    height: 18px;\n    color: var(--lion-primary);\n  }\n\n  .contact-optional-badge {\n    font-size: 11px;\n    font-weight: 400;\n    color: var(--lion-text-muted);\n    background: var(--lion-bg-tertiary);\n    padding: 2px 8px;\n    border-radius: 10px;\n  }\n\n  .selected-contacts-list {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 8px;\n    margin-bottom: 12px;\n  }\n\n  .selected-contact-chip {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    background: var(--lion-primary-light);\n    border: 1px solid rgba(var(--lion-primary-rgb), 0.3);\n    padding: 6px 10px;\n    border-radius: 20px;\n    font-size: 13px;\n    color: var(--lion-text-primary);\n  }\n\n  .selected-contact-chip .chip-name {\n    max-width: 120px;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n\n  .selected-contact-chip .chip-remove {\n    background: none;\n    border: none;\n    color: var(--lion-primary);\n    cursor: pointer;\n    padding: 0;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    width: 16px;\n    height: 16px;\n  }\n\n  .selected-contact-chip .chip-remove:hover {\n    color: var(--lion-primary-hover);\n  }\n\n  .selected-contact-chip .chip-remove svg {\n    width: 14px;\n    height: 14px;\n  }\n\n  .select-contacts-btn {\n    width: 100%;\n    padding: 12px;\n    border: 2px dashed var(--lion-border-light);\n    border-radius: 10px;\n    background: transparent;\n    color: var(--lion-text-secondary);\n    font-size: 13px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    gap: 8px;\n    transition: all 0.15s;\n  }\n\n  .select-contacts-btn:hover {\n    border-color: var(--lion-primary);\n    color: var(--lion-primary);\n    background: rgba(var(--lion-primary-rgb), 0.05);\n  }\n\n  .select-contacts-btn svg {\n    width: 18px;\n    height: 18px;\n  }\n\n  .select-contacts-btn:disabled {\n    opacity: 0.7;\n    cursor: wait;\n  }\n\n  .loading-spinner-small {\n    width: 16px;\n    height: 16px;\n    border: 2px solid rgba(var(--lion-primary-rgb), 0.3);\n    border-top-color: var(--lion-primary);\n    border-radius: 50%;\n    animation: spinSmall 0.8s linear infinite;\n  }\n\n  @keyframes spinSmall {\n    to { transform: rotate(360deg); }\n  }\n\n  /* Contact Selection Modal */\n  .contact-modal-overlay {\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background: rgba(0, 0, 0, 0.55);\n    backdrop-filter: blur(6px);\n    -webkit-backdrop-filter: blur(6px);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    z-index: 10002;\n    animation: todoFadeIn 0.15s ease;\n  }\n\n  .contact-modal {\n    background: var(--lion-bg-primary);\n    border-radius: 16px;\n    border: 1px solid var(--lion-border-light);\n    width: 90%;\n    max-width: 400px;\n    max-height: 70vh;\n    overflow: hidden;\n    box-shadow: 0 25px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.05);\n    display: flex;\n    flex-direction: column;\n  }\n\n  .contact-modal-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 16px 20px;\n    background: var(--lion-bg-primary);\n    border-bottom: 1px solid var(--lion-border-light);\n    color: var(--lion-text-primary);\n  }\n\n  .contact-modal-title {\n    font-size: 16px;\n    font-weight: 600;\n  }\n\n  .contact-modal-close {\n    background: var(--lion-bg-tertiary, #f4f4f5);\n    border: 1px solid var(--lion-border-light);\n    color: var(--lion-text-muted);\n    width: 32px;\n    height: 32px;\n    border-radius: 10px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s;\n  }\n\n  .contact-modal-close:hover {\n    background: rgba(239, 68, 68, 0.1);\n    border-color: rgba(239, 68, 68, 0.3);\n    color: var(--lion-error);\n  }\n\n  .contact-modal-search {\n    padding: 12px;\n    border-bottom: 1px solid var(--lion-border-light);\n  }\n\n  .contact-modal-search input {\n    width: 100%;\n    padding: 10px 12px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 14px;\n    color: var(--lion-text-primary);\n    background: var(--lion-bg-secondary);\n    box-sizing: border-box;\n    transition: border-color 0.15s, box-shadow 0.15s;\n  }\n\n  .contact-modal-search input:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  .contact-modal-list {\n    flex: 1;\n    overflow-y: auto;\n    padding: 8px 0;\n  }\n\n  .contact-modal-item {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    padding: 10px 16px;\n    cursor: pointer;\n    transition: background 0.15s;\n  }\n\n  .contact-modal-item:hover {\n    background: var(--lion-bg-tertiary);\n  }\n\n  .contact-modal-item.selected {\n    background: var(--lion-primary-light);\n  }\n\n  .contact-modal-checkbox {\n    width: 20px;\n    height: 20px;\n    border: 2px solid var(--lion-border-light);\n    border-radius: 4px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    flex-shrink: 0;\n    transition: all 0.15s;\n  }\n\n  .contact-modal-item.selected .contact-modal-checkbox {\n    background: var(--lion-primary);\n    border-color: var(--lion-primary);\n  }\n\n  .contact-modal-checkbox svg {\n    width: 14px;\n    height: 14px;\n    color: white;\n    opacity: 0;\n  }\n\n  .contact-modal-item.selected .contact-modal-checkbox svg {\n    opacity: 1;\n  }\n\n  .contact-modal-info {\n    flex: 1;\n    min-width: 0;\n  }\n\n  .contact-modal-name {\n    font-size: 14px;\n    font-weight: 500;\n    color: var(--lion-text-primary);\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n\n  .contact-modal-phone {\n    font-size: 12px;\n    color: var(--lion-text-muted);\n  }\n\n  .contact-modal-empty {\n    padding: 40px 20px;\n    text-align: center;\n    color: var(--lion-text-muted);\n    font-size: 14px;\n  }\n\n  .contact-modal-footer {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    padding: 12px 16px;\n    border-top: 1px solid var(--lion-border-light);\n    background: var(--lion-bg-secondary);\n  }\n\n  .contact-modal-count {\n    font-size: 13px;\n    color: var(--lion-text-secondary);\n  }\n\n  .contact-modal-done {\n    padding: 8px 20px;\n    background: var(--lion-primary);\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n    border: none;\n    border-radius: 10px;\n    color: white;\n    font-size: 14px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.15s;\n  }\n\n  .contact-modal-done:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.35);\n  }\n`,Ga=({isOpen:e,onClose:t,onSave:n,editTodo:r,initialDate:o})=>{const[i,l]=(0,a.useState)(""),[c,d]=(0,a.useState)(""),[m,u]=(0,a.useState)(""),[g,b]=(0,a.useState)(""),[f,y]=(0,a.useState)("medium"),[x,w]=(0,a.useState)(""),[k,E]=(0,a.useState)([]),[S,C]=(0,a.useState)(""),[T,A]=(0,a.useState)(!1),[D,_]=(0,a.useState)("daily"),[N,M]=(0,a.useState)(""),[I,R]=(0,a.useState)(""),[B,P]=(0,a.useState)(""),[L,U]=(0,a.useState)(!0),[F,z]=(0,a.useState)(!1),[O,W]=(0,a.useState)(15),[q,H]=(0,a.useState)([]),[j,V]=(0,a.useState)(!1),[G,K]=(0,a.useState)(""),[$,Y]=(0,a.useState)([]),[X,J]=(0,a.useState)(!1),[Q,Z]=(0,a.useState)([]),[,ee]=(0,a.useState)(0);(0,a.useEffect)(()=>{const e=()=>ee(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{if(e){const e=v.getTodoCategories();Z(e)}},[e]),(0,a.useEffect)(()=>{e&&(r?(l(r.title),d(r.description||""),u(r.dueDate?ne(r.dueDate):""),b(r.dueTime||""),y(r.priority),w(r.categoryId||""),E([...r.subtasks]),A(r.isRecurring),_(r.recurringInterval||"daily"),M(r.recurringEndDate?ne(r.recurringEndDate):""),R(r.reminderDate?ne(r.reminderDate):""),P(r.reminderTime||""),U(r.browserNotification),z(r.whatsappNotification),W(r.snoozeMinutes||15),H(r.linkedContactIds||[])):(te(),o&&u(ne(o.getTime()))))},[e,r,o]);const te=()=>{l(""),d(""),u(""),b(""),y("medium"),w(""),E([]),C(""),A(!1),_("daily"),M(""),R(""),P(""),U(!0),z(!1),W(15),H([]),K("")},ne=e=>{const t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`},ae=()=>{if(!S.trim())return;const e={id:h("subtask"),title:S.trim(),completed:!1,createdAt:Date.now()};E([...k,e]),C("")},re=(e,t=!1)=>{const[n,a,r]=e.split("-").map(Number);return t?new Date(n,a-1,r,23,59,59,999).getTime():new Date(n,a-1,r,0,0,0,0).getTime()},oe=$.filter(e=>e.profile.name.toLowerCase().includes(G.toLowerCase())||e.profile.phone.includes(G));return e?a.createElement(a.Fragment,null,a.createElement("style",null,Va),a.createElement("div",{className:"todo-form-overlay",onClick:e=>{e.target===e.currentTarget&&t()}},a.createElement("div",{className:"todo-form-modal"},a.createElement("div",{className:"todo-form-header"},a.createElement("div",{className:"todo-form-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M9 11l3 3L22 4"}),a.createElement("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})),r?(0,s.t)("todo.editTodo")||"Editar Tarefa":(0,s.t)("todo.addTodo")||"Adicionar Tarefa"),a.createElement("button",{className:"todo-form-close",onClick:t},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),a.createElement("div",{className:"todo-form-content"},a.createElement("div",{className:"todo-form-group"},a.createElement("label",{className:"todo-form-label required"},(0,s.t)("todo.title")||"Title"),a.createElement("input",{type:"text",className:"todo-form-input",placeholder:(0,s.t)("todo.titlePlaceholder")||"Enter task title",value:i,onChange:e=>l(e.target.value),autoFocus:!0})),a.createElement("div",{className:"todo-form-group"},a.createElement("label",{className:"todo-form-label"},(0,s.t)("todo.description")||"Description"),a.createElement("textarea",{className:"todo-form-input todo-form-textarea",placeholder:(0,s.t)("todo.descriptionPlaceholder")||"Add details (optional)",value:c,onChange:e=>d(e.target.value)})),a.createElement("div",{className:"todo-form-row"},a.createElement("div",{className:"todo-form-group"},a.createElement("label",{className:"todo-form-label"},(0,s.t)("todo.dueDate")||"Due Date"),a.createElement("input",{type:"date",className:"todo-form-input",value:m,onChange:e=>u(e.target.value)})),a.createElement("div",{className:"todo-form-group"},a.createElement("label",{className:"todo-form-label"},(0,s.t)("todo.dueTime")||"Due Time"),a.createElement("input",{type:"time",className:"todo-form-input",value:g,onChange:e=>b(e.target.value)}))),a.createElement("div",{className:"todo-form-row"},a.createElement("div",{className:"todo-form-group"},a.createElement("label",{className:"todo-form-label"},(0,s.t)("todo.priority")||"Priority"),a.createElement("select",{className:"todo-form-select",value:f,onChange:e=>y(e.target.value)},a.createElement("option",{value:"high"},(0,s.t)("todo.priorityHigh")||"High"),a.createElement("option",{value:"medium"},(0,s.t)("todo.priorityMedium")||"Medium"),a.createElement("option",{value:"low"},(0,s.t)("todo.priorityLow")||"Low"))),a.createElement("div",{className:"todo-form-group"},a.createElement("label",{className:"todo-form-label"},(0,s.t)("todo.category")||"Category"),a.createElement("div",{className:"category-select-wrapper"},a.createElement("select",{className:"todo-form-select",value:x,onChange:e=>w(e.target.value)},a.createElement("option",{value:""},(0,s.t)("todo.noCategory")||"No Category"),Q.map(e=>{const t=p[e.id],n=t&&(0,s.t)(t)||e.name;return a.createElement("option",{key:e.id,value:e.id},n)})),a.createElement("input",{type:"color",className:"category-color-preview",value:(()=>{if(!x)return"#cccccc";const e=Q.find(e=>e.id===x);return e?.color||"#cccccc"})(),onChange:e=>{return t=e.target.value,void(x&&(v.updateTodoCategory(x,{color:t}),Z(e=>e.map(e=>e.id===x?{...e,color:t}:e))));var t},disabled:!x,title:x?(0,s.t)("todo.changeColor")||"Click to change color":(0,s.t)("todo.selectCategoryFirst")||"Select category first"})))),a.createElement("div",{className:"todo-form-section"},a.createElement("div",{className:"todo-form-section-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M9 11l3 3L22 4"}),a.createElement("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"})),(0,s.t)("todo.subtasks")||"Subtasks"),k.length>0&&a.createElement("div",{className:"subtask-list"},k.map(e=>a.createElement("div",{key:e.id,className:"subtask-item"},a.createElement("span",{className:"subtask-text"},e.title),a.createElement("button",{className:"subtask-delete",onClick:()=>{return t=e.id,void E(k.filter(e=>e.id!==t));var t}},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))))),a.createElement("div",{className:"add-subtask-row"},a.createElement("input",{type:"text",className:"todo-form-input",placeholder:(0,s.t)("todo.subtaskPlaceholder")||"Enter subtask",value:S,onChange:e=>C(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ae())}}),a.createElement("button",{className:"add-subtask-btn",onClick:ae},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"})),(0,s.t)("todo.addSubtask")||"Adicionar"))),a.createElement("div",{className:"todo-form-section"},a.createElement("div",{className:"toggle-row"},a.createElement("span",{className:"toggle-label"},(0,s.t)("todo.recurring")||"Recurring"),a.createElement("label",{className:"toggle-switch"},a.createElement("input",{type:"checkbox",checked:T,onChange:e=>A(e.target.checked)}),a.createElement("span",{className:"toggle-slider"}))),T&&a.createElement("div",{className:"recurring-options"},a.createElement("div",{className:"todo-form-row"},a.createElement("div",{className:"todo-form-group"},a.createElement("label",{className:"todo-form-label"},(0,s.t)("todo.repeatEvery")||"Repeat"),a.createElement("select",{className:"todo-form-select",value:D,onChange:e=>_(e.target.value)},a.createElement("option",{value:"daily"},(0,s.t)("todo.recurringDaily")||"Daily"),a.createElement("option",{value:"weekly"},(0,s.t)("todo.recurringWeekly")||"Weekly"),a.createElement("option",{value:"monthly"},(0,s.t)("todo.recurringMonthly")||"Monthly"),a.createElement("option",{value:"yearly"},(0,s.t)("todo.recurringYearly")||"Yearly"))),a.createElement("div",{className:"todo-form-group"},a.createElement("label",{className:"todo-form-label"},(0,s.t)("todo.endDate")||"End Date"),a.createElement("input",{type:"date",className:"todo-form-input",value:N,onChange:e=>M(e.target.value)}))))),a.createElement("div",{className:"todo-form-section"},a.createElement("div",{className:"todo-form-section-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),a.createElement("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})),(0,s.t)("todo.reminder")||"Reminder"),a.createElement("div",{className:"todo-form-row"},a.createElement("div",{className:"todo-form-group"},a.createElement("label",{className:"todo-form-label"},(0,s.t)("todo.reminderDate")||"Reminder Date"),a.createElement("input",{type:"date",className:"todo-form-input",value:I,onChange:e=>R(e.target.value)})),a.createElement("div",{className:"todo-form-group"},a.createElement("label",{className:"todo-form-label"},(0,s.t)("todo.reminderTime")||"Reminder Time"),a.createElement("input",{type:"time",className:"todo-form-input",value:B,onChange:e=>P(e.target.value)}))),(I||B)&&a.createElement("div",{className:"todo-form-row"},a.createElement("div",{className:"todo-form-group"},a.createElement("label",{className:"todo-form-label"},(0,s.t)("todo.snoozeTime")||"Snooze Time"),a.createElement("select",{className:"todo-form-input",value:O,onChange:e=>W(Number(e.target.value))},a.createElement("option",{value:5},"5 ",(0,s.t)("todo.minutes")||"minutes"),a.createElement("option",{value:10},"10 ",(0,s.t)("todo.minutes")||"minutes"),a.createElement("option",{value:15},"15 ",(0,s.t)("todo.minutes")||"minutes"),a.createElement("option",{value:30},"30 ",(0,s.t)("todo.minutes")||"minutes"),a.createElement("option",{value:60},"1 ",(0,s.t)("todo.hour")||"hour"),a.createElement("option",{value:120},"2 ",(0,s.t)("todo.hours")||"hours"),a.createElement("option",{value:240},"4 ",(0,s.t)("todo.hours")||"hours"),a.createElement("option",{value:1440},"1 ",(0,s.t)("todo.day")||"day")))),a.createElement("div",{className:"checkbox-row"},a.createElement("input",{type:"checkbox",id:"browserNotification",checked:L,onChange:e=>U(e.target.checked)}),a.createElement("label",{htmlFor:"browserNotification"},(0,s.t)("todo.browserNotification")||"Browser Notification")),a.createElement("div",{className:"checkbox-row"},a.createElement("input",{type:"checkbox",id:"whatsappNotification",checked:F,onChange:e=>z(e.target.checked)}),a.createElement("label",{htmlFor:"whatsappNotification"},(0,s.t)("todo.whatsappSelfMessage")||"Send WhatsApp reminder to myself")),F&&a.createElement("div",{className:"checkbox-hint"},(0,s.t)("todo.whatsappSelfMessageHint")||"Você receberá uma mensagem no WhatsApp quando a tarefa expirar")),a.createElement("div",{className:"contact-linking-section"},a.createElement("div",{className:"contact-linking-header"},a.createElement("div",{className:"contact-linking-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"9",cy:"7",r:"4"}),a.createElement("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),a.createElement("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})),(0,s.t)("todo.linkedContacts")||"Linked Contacts"),a.createElement("span",{className:"contact-optional-badge"},(0,s.t)("todo.optional")||"Optional")),q.length>0&&a.createElement("div",{className:"selected-contacts-list"},q.map(e=>a.createElement("div",{key:e,className:"selected-contact-chip"},a.createElement("span",{className:"chip-name"},(e=>{const t=$.find(t=>t.id===e);return t?.profile.name||e.replace("@c.us","")})(e)),a.createElement("button",{className:"chip-remove",onClick:()=>(e=>{H(t=>t.filter(t=>t!==e))})(e),title:"Remover"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))))),a.createElement("button",{type:"button",className:"select-contacts-btn",disabled:X,onClick:async()=>{J(!0);try{const e=(await new Promise(e=>{const t=setTimeout(()=>{document.removeEventListener("waContactsResponse",n),e([])},15e3),n=a=>{const r=a;clearTimeout(t),document.removeEventListener("waContactsResponse",n),r.detail?.success?e(r.detail?.contacts||[]):e([])};document.addEventListener("waContactsResponse",n),document.dispatchEvent(new CustomEvent("getWAContacts"))})).map(e=>({id:e.id,profile:{name:e.name||e.phoneNumber||e.id.replace("@c.us","").replace("@s.whatsapp.net",""),phone:e.phoneNumber||e.id.replace("@c.us","").replace("@s.whatsapp.net","")}}));Y(e),V(!0)}catch(e){}finally{J(!1)}}},X?a.createElement(a.Fragment,null,a.createElement("span",{className:"loading-spinner-small"}),(0,s.t)("todo.loadingContacts")||"Loading..."):a.createElement(a.Fragment,null,a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"8.5",cy:"7",r:"4"}),a.createElement("line",{x1:"20",y1:"8",x2:"20",y2:"14"}),a.createElement("line",{x1:"23",y1:"11",x2:"17",y2:"11"})),(0,s.t)("todo.selectContacts")||"Select Contacts")))),j&&a.createElement("div",{className:"contact-modal-overlay",onClick:e=>{e.target===e.currentTarget&&V(!1)}},a.createElement("div",{className:"contact-modal"},a.createElement("div",{className:"contact-modal-header"},a.createElement("span",{className:"contact-modal-title"},(0,s.t)("todo.selectContacts")||"Select Contacts"),a.createElement("button",{className:"contact-modal-close",onClick:()=>V(!1)},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"16",height:"16"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),a.createElement("div",{className:"contact-modal-search"},a.createElement("input",{type:"text",placeholder:(0,s.t)("todo.searchContacts")||"Search contacts...",value:G,onChange:e=>K(e.target.value),autoFocus:!0})),a.createElement("div",{className:"contact-modal-list"},0===oe.length?a.createElement("div",{className:"contact-modal-empty"},(0,s.t)("todo.noContactsFound")||"No contacts found"):oe.map(e=>a.createElement("div",{key:e.id,className:"contact-modal-item "+(q.includes(e.id)?"selected":""),onClick:()=>{return t=e.id,void H(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]);var t}},a.createElement("div",{className:"contact-modal-checkbox"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))),a.createElement("div",{className:"contact-modal-info"},a.createElement("div",{className:"contact-modal-name"},e.profile.name),a.createElement("div",{className:"contact-modal-phone"},e.profile.phone))))),a.createElement("div",{className:"contact-modal-footer"},a.createElement("span",{className:"contact-modal-count"},q.length," ",(0,s.t)("todo.selected")||"selected"),a.createElement("button",{className:"contact-modal-done",onClick:()=>V(!1)},(0,s.t)("todo.save")||"Done")))),a.createElement("div",{className:"todo-form-footer"},a.createElement("button",{className:"todo-form-btn todo-form-btn-cancel",onClick:t},(0,s.t)("todo.cancel")||"Cancel"),a.createElement("button",{className:"todo-form-btn todo-form-btn-save",onClick:()=>{if(!i.trim())return;Date.now();const e=m?re(m):void 0,a=I?re(I):void 0,o=N?re(N,!0):void 0;let s;T&&e&&(s=e);let l=!1;if(r){const e=r.reminderDate?ne(r.reminderDate):"",t=r.reminderTime||"";e===I&&t===B||(l=!0)}const d={title:i.trim(),description:c.trim(),dueDate:e,dueTime:g||void 0,reminderDate:a,reminderTime:B||void 0,priority:f,categoryId:x||void 0,subtasks:k,status:r?.status||"pending",completedAt:r?.completedAt,isRecurring:T,recurringInterval:T?D:void 0,recurringEndDate:T?o:void 0,nextOccurrence:T?s:void 0,recurringParentId:r?.recurringParentId,browserNotification:L,whatsappNotification:F,notified:!l&&(r?.notified||!1),snoozeMinutes:O,linkedContactIds:q.length>0?q:void 0};r?v.updateTodo(r.id,d):v.addTodo(d),n(),t()},disabled:!i.trim()},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"16",height:"16"},a.createElement("path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),a.createElement("polyline",{points:"17 21 17 13 7 13 7 21"}),a.createElement("polyline",{points:"7 3 7 8 15 8"})),r?(0,s.t)("todo.update")||"Update Todo":(0,s.t)("todo.save")||"Save Todo"))))):null},Ka=({selectedDate:e,onRefresh:t})=>{const[n,r]=(0,a.useState)([]),[o,i]=(0,a.useState)("today"),[l,c]=(0,a.useState)([]),[d,m]=(0,a.useState)([]),[u,g]=(0,a.useState)(!1),[h,b]=(0,a.useState)(null),[f,y]=(0,a.useState)({total:0,pending:0,completed:0,overdue:0,todayDue:0});(0,a.useEffect)(()=>{i("selected_date"),w()},[e]);const[,x]=(0,a.useState)(0);(0,a.useEffect)(()=>{const e=()=>x(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{w(),k(),E(),S();const e=()=>{w(),S()};return document.addEventListener("wa-crm-todo-added",e),document.addEventListener("wa-crm-todo-updated",e),document.addEventListener("wa-crm-todo-deleted",e),()=>{document.removeEventListener("wa-crm-todo-added",e),document.removeEventListener("wa-crm-todo-updated",e),document.removeEventListener("wa-crm-todo-deleted",e)}},[o]);const w=()=>{let t;t="selected_date"===o?v.getTodosForDate(e):v.getTodosByFilter(o),t.sort((e,t)=>{const n={high:0,medium:1,low:2};return n[e.priority]!==n[t.priority]?n[e.priority]-n[t.priority]:(e.dueDate||1/0)-(t.dueDate||1/0)}),r(t)},k=()=>{const e=v.getTodoCategories();c(e)},E=()=>{try{const e=v.getAllContacts();m(e)}catch(e){m([])}},S=()=>{const e=v.getTodoStats();y(e)},C=e=>{b(e),g(!0)},T=t=>{if("selected_date"===t)return e.toLocaleDateString();return{today:(0,s.t)("todo.filterToday")||"Today",this_week:(0,s.t)("todo.filterThisWeek")||"This Week",all:(0,s.t)("todo.filterAll")||"All Tasks",overdue:(0,s.t)("todo.filterOverdue")||"Overdue",completed:(0,s.t)("todo.filterCompleted")||"Completed"}[t]};return a.createElement(a.Fragment,null,a.createElement("style",null,"\n  .todo-panel {\n    height: 100%;\n    display: flex;\n    flex-direction: column;\n  }\n\n  .todo-panel-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n    margin-bottom: 16px;\n    flex-wrap: wrap;\n  }\n\n  .todo-panel-title {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    color: var(--lion-primary);\n  }\n\n  .todo-panel-title svg {\n    width: 24px;\n    height: 24px;\n  }\n\n  .todo-panel-title span {\n    font-size: 16px;\n    font-weight: 700;\n    color: var(--lion-text-primary);\n  }\n\n  .todo-panel-actions {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n  }\n\n  .todo-filter-select {\n    padding: 8px 12px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 13px;\n    color: var(--lion-text-primary);\n    background: var(--lion-bg-primary);\n    cursor: pointer;\n    min-width: 120px;\n    transition: border-color 0.15s, box-shadow 0.15s;\n  }\n\n  .todo-filter-select:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  .todo-add-btn {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    padding: 8px 14px;\n    background: var(--lion-primary);\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n    border: none;\n    border-radius: 10px;\n    color: white;\n    font-size: 13px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: transform 0.15s, box-shadow 0.15s;\n  }\n\n  .todo-add-btn:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35);\n  }\n\n  .todo-add-btn:active {\n    transform: translateY(0);\n    box-shadow: 0 1px 4px rgba(var(--lion-primary-rgb), 0.2);\n  }\n\n  .todo-add-btn svg {\n    width: 16px;\n    height: 16px;\n  }\n\n  .todo-list {\n    flex: 1;\n    overflow-y: auto;\n    scrollbar-width: thin;\n    scrollbar-color: rgba(0,0,0,0.15) transparent;\n  }\n\n  .todo-list::-webkit-scrollbar {\n    width: 5px;\n  }\n\n  .todo-list::-webkit-scrollbar-track {\n    background: transparent;\n  }\n\n  .todo-list::-webkit-scrollbar-thumb {\n    background: rgba(0,0,0,0.15);\n    border-radius: 10px;\n  }\n\n  .todo-list::-webkit-scrollbar-thumb:hover {\n    background: rgba(0,0,0,0.25);\n  }\n\n  .todo-item {\n    background: var(--lion-bg-primary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 12px;\n    padding: 14px;\n    margin-bottom: 10px;\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);\n    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;\n    cursor: pointer;\n  }\n\n  .todo-item:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .todo-item.completed {\n    opacity: 0.6;\n  }\n\n  .todo-item-header {\n    display: flex;\n    align-items: flex-start;\n    gap: 10px;\n    margin-bottom: 8px;\n  }\n\n  .todo-checkbox {\n    width: 20px;\n    height: 20px;\n    border: 2px solid var(--lion-border-light);\n    border-radius: 4px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    flex-shrink: 0;\n    margin-top: 2px;\n    transition: all 0.15s;\n  }\n\n  .todo-checkbox:hover {\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.1);\n  }\n\n  .todo-checkbox.checked {\n    background: var(--lion-primary);\n    border-color: transparent;\n  }\n\n  .todo-checkbox.checked svg {\n    color: white;\n  }\n\n  .todo-checkbox svg {\n    width: 14px;\n    height: 14px;\n    color: transparent;\n  }\n\n  .todo-item-content {\n    flex: 1;\n    min-width: 0;\n  }\n\n  .todo-item-title {\n    font-size: 14px;\n    font-weight: 500;\n    color: var(--lion-text-primary);\n    margin-bottom: 4px;\n    word-break: break-word;\n  }\n\n  .todo-item.completed .todo-item-title {\n    text-decoration: line-through;\n    color: var(--lion-text-muted);\n  }\n\n  .todo-item-meta {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    flex-wrap: wrap;\n    font-size: 12px;\n    color: var(--lion-text-muted);\n  }\n\n  .todo-meta-item {\n    display: flex;\n    align-items: center;\n    gap: 4px;\n  }\n\n  .todo-meta-item svg {\n    width: 14px;\n    height: 14px;\n  }\n\n  .todo-priority-badge {\n    padding: 2px 8px;\n    border-radius: 8px;\n    font-size: 10px;\n    font-weight: 600;\n    text-transform: uppercase;\n    letter-spacing: 0.3px;\n  }\n\n  .todo-priority-badge.high {\n    background: var(--lion-error-light);\n    color: var(--lion-error);\n  }\n\n  .todo-priority-badge.medium {\n    background: var(--lion-warning-light);\n    color: var(--lion-warning);\n  }\n\n  .todo-priority-badge.low {\n    background: var(--lion-info-light);\n    color: var(--lion-info);\n  }\n\n  .todo-category-badge {\n    padding: 2px 8px;\n    border-radius: 8px;\n    font-size: 10px;\n    font-weight: 600;\n    color: white;\n  }\n\n  .todo-recurring-icon {\n    color: var(--lion-primary);\n  }\n\n  .todo-overdue {\n    color: var(--lion-error) !important;\n  }\n\n  .todo-item-actions {\n    display: flex;\n    gap: 6px;\n    margin-left: 8px;\n  }\n\n  .todo-action-btn {\n    background: none;\n    border: none;\n    padding: 6px;\n    border-radius: 6px;\n    cursor: pointer;\n    color: var(--lion-text-muted);\n    transition: all 0.15s;\n  }\n\n  .todo-action-btn:hover {\n    background: var(--lion-bg-tertiary);\n  }\n\n  .todo-action-btn.edit:hover {\n    background: var(--lion-info-light);\n    color: var(--lion-info);\n  }\n\n  .todo-action-btn.duplicate:hover {\n    background: var(--lion-primary-light);\n    color: var(--lion-primary);\n  }\n\n  .todo-action-btn.delete:hover {\n    background: var(--lion-error-light);\n    color: var(--lion-error);\n  }\n\n  .todo-action-btn svg {\n    width: 16px;\n    height: 16px;\n  }\n\n  /* Subtasks Preview */\n  .todo-subtasks-preview {\n    margin-top: 8px;\n    padding-top: 8px;\n    border-top: 1px solid var(--lion-border-light);\n  }\n\n  .subtask-preview-item {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    font-size: 12px;\n    color: var(--lion-text-secondary);\n    padding: 2px 0;\n  }\n\n  .subtask-preview-item.completed {\n    text-decoration: line-through;\n    color: var(--lion-text-muted);\n  }\n\n  .subtask-preview-check {\n    width: 14px;\n    height: 14px;\n    border: 1.5px solid var(--lion-border-light);\n    border-radius: 3px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    cursor: pointer;\n    flex-shrink: 0;\n    transition: all 0.15s;\n  }\n\n  .subtask-preview-check.checked {\n    background: var(--lion-primary);\n    border-color: transparent;\n  }\n\n  .subtask-preview-check svg {\n    width: 10px;\n    height: 10px;\n    color: white;\n  }\n\n  /* Empty State */\n  .todo-empty {\n    text-align: center;\n    padding: 48px 20px;\n    color: var(--lion-text-muted);\n  }\n\n  .todo-empty svg {\n    width: 56px;\n    height: 56px;\n    opacity: 0.2;\n    margin-bottom: 14px;\n  }\n\n  .todo-empty-text {\n    font-size: 14px;\n    color: var(--lion-text-muted);\n    font-weight: 500;\n  }\n\n  /* Stats Bar */\n  .todo-stats-bar {\n    display: flex;\n    gap: 16px;\n    padding: 10px 0;\n    margin-bottom: 12px;\n    border-bottom: 1px solid var(--lion-border-light);\n  }\n\n  .todo-stat {\n    font-size: 10px;\n    color: var(--lion-text-muted);\n    text-transform: uppercase;\n    font-weight: 700;\n    letter-spacing: 0.3px;\n  }\n\n  .todo-stat-value {\n    font-weight: 600;\n    color: var(--lion-text-primary);\n    margin-right: 4px;\n    font-size: 13px;\n  }\n\n  .todo-stat-value.overdue {\n    color: var(--lion-error);\n  }\n\n  .todo-stat-value.completed {\n    color: var(--lion-primary);\n  }\n\n  /* Linked Contacts Display */\n  .todo-linked-contacts {\n    display: flex;\n    align-items: center;\n    gap: 4px;\n    color: var(--lion-text-secondary);\n    background: var(--lion-primary-light);\n    padding: 2px 8px;\n    border-radius: 10px;\n  }\n\n  .todo-linked-contacts svg {\n    width: 12px;\n    height: 12px;\n    color: var(--lion-primary);\n  }\n"),a.createElement("div",{className:"todo-panel"},a.createElement("div",{className:"todo-panel-header"},a.createElement("div",{className:"todo-panel-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M9 11l3 3L22 4"}),a.createElement("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})),a.createElement("span",null,(0,s.t)("calendar.todos")||"Todos")),a.createElement("div",{className:"todo-panel-actions"},a.createElement("select",{className:"todo-filter-select",value:o,onChange:e=>i(e.target.value)},a.createElement("option",{value:"selected_date"},T("selected_date")),a.createElement("option",{value:"today"},T("today")),a.createElement("option",{value:"this_week"},T("this_week")),a.createElement("option",{value:"all"},T("all")),a.createElement("option",{value:"overdue"},T("overdue")),a.createElement("option",{value:"completed"},T("completed"))),a.createElement("button",{className:"todo-add-btn",onClick:()=>{b(null),g(!0)}},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"})),(0,s.t)("calendar.addTodo")||"Add Todo"))),a.createElement("div",{className:"todo-stats-bar"},a.createElement("div",{className:"todo-stat"},a.createElement("span",{className:"todo-stat-value"},f.pending),(0,s.t)("todo.statusPending")||"Pending"),a.createElement("div",{className:"todo-stat"},a.createElement("span",{className:"todo-stat-value completed"},f.completed),(0,s.t)("todo.statusCompleted")||"Completed"),f.overdue>0&&a.createElement("div",{className:"todo-stat"},a.createElement("span",{className:"todo-stat-value overdue"},f.overdue),(0,s.t)("todo.filterOverdue")||"Overdue")),a.createElement("div",{className:"todo-list"},0===n.length?a.createElement("div",{className:"todo-empty"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1"},a.createElement("path",{d:"M9 11l3 3L22 4"}),a.createElement("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})),a.createElement("div",{className:"todo-empty-text"},(0,s.t)("calendar.noTodos")||"No todos found")):n.map(e=>{const t=(n=e.categoryId)&&l.find(e=>e.id===n)||null;var n;const r=(e=>{if(!e.dueDate||"completed"===e.status)return!1;const t=new Date;return t.setHours(0,0,0,0),e.dueDate<t.getTime()})(e);return a.createElement("div",{key:e.id,className:"todo-item "+("completed"===e.status?"completed":""),onClick:()=>C(e)},a.createElement("div",{className:"todo-item-header"},a.createElement("div",{className:"todo-checkbox "+("completed"===e.status?"checked":""),onClick:t=>((e,t)=>{t.stopPropagation(),v.toggleTodoStatus(e),w(),S()})(e.id,t)},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))),a.createElement("div",{className:"todo-item-content"},a.createElement("div",{className:"todo-item-title"},e.title),a.createElement("div",{className:"todo-item-meta"},a.createElement("span",{className:`todo-priority-badge ${e.priority}`},(0,s.t)(`todo.priority${e.priority.charAt(0).toUpperCase()+e.priority.slice(1)}`)||e.priority),t&&a.createElement("span",{className:"todo-category-badge",style:{backgroundColor:t.color}},p[t.id]&&(0,s.t)(p[t.id])||t.name),e.dueDate&&a.createElement("span",{className:"todo-meta-item "+(r?"todo-overdue":"")},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"})),((e,t)=>{if(!e)return"";const n=new Date(e),a=new Date;a.setHours(0,0,0,0);const r=new Date(a);r.setDate(r.getDate()+1);let o="";return o=n.getTime()<a.getTime()?(0,s.t)("todo.overdue")||"Overdue":n.getTime()<r.getTime()?(0,s.t)("todo.today")||"Today":n.getTime()<r.getTime()+864e5?(0,s.t)("todo.tomorrow")||"Tomorrow":n.toLocaleDateString(),t&&(o+=` ${t}`),o})(e.dueDate,e.dueTime)),e.isRecurring&&a.createElement("span",{className:"todo-meta-item todo-recurring-icon"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"23 4 23 10 17 10"}),a.createElement("polyline",{points:"1 20 1 14 7 14"}),a.createElement("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"}))),e.subtasks.length>0&&a.createElement("span",{className:"todo-meta-item"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M9 11l3 3L22 4"}),a.createElement("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"})),e.subtasks.filter(e=>e.completed).length,"/",e.subtasks.length),e.linkedContactIds&&e.linkedContactIds.length>0&&a.createElement("span",{className:"todo-meta-item todo-linked-contacts"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"9",cy:"7",r:"4"}),a.createElement("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),a.createElement("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})),1===e.linkedContactIds.length?(e=>{const t=d.find(t=>t.id===e);return t?.profile.name||e.replace("@c.us","")})(e.linkedContactIds[0]):`${e.linkedContactIds.length} ${(0,s.t)("todo.contacts")||"contacts"}`))),a.createElement("div",{className:"todo-item-actions"},a.createElement("button",{className:"todo-action-btn edit",onClick:t=>{t.stopPropagation(),C(e)},title:(0,s.t)("calendar.editTodo")||"Edit"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))),a.createElement("button",{className:"todo-action-btn duplicate",onClick:t=>((e,t)=>{t.stopPropagation(),v.addTodo({title:`${e.title} (${(0,s.t)("calendar.copy")||"Copy"})`,description:e.description,status:"pending",priority:e.priority,dueDate:e.dueDate,dueTime:e.dueTime,categoryId:e.categoryId,subtasks:e.subtasks.map(e=>({...e,id:`subtask_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,completed:!1})),isRecurring:e.isRecurring,recurringInterval:e.recurringInterval,recurringEndDate:e.recurringEndDate,linkedContactIds:e.linkedContactIds?[...e.linkedContactIds]:void 0,browserNotification:e.browserNotification,whatsappNotification:e.whatsappNotification})&&(w(),S())})(e,t),title:(0,s.t)("calendar.duplicateTodo")||"Duplicate"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),a.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))),a.createElement("button",{className:"todo-action-btn delete",onClick:t=>((e,t)=>{t.stopPropagation(),confirm((0,s.t)("calendar.confirmDeleteTodo")||"Tem certeza que deseja excluir esta tarefa?")&&(v.deleteTodo(e),w(),S())})(e.id,t),title:(0,s.t)("calendar.deleteTodo")||"Delete"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"3 6 5 6 21 6"}),a.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))))),e.subtasks.length>0&&a.createElement("div",{className:"todo-subtasks-preview"},e.subtasks.slice(0,3).map(t=>a.createElement("div",{key:t.id,className:"subtask-preview-item "+(t.completed?"completed":"")},a.createElement("div",{className:"subtask-preview-check "+(t.completed?"checked":""),onClick:n=>((e,t,n)=>{n.stopPropagation(),v.toggleSubtask(e,t),w()})(e.id,t.id,n)},t.completed&&a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))),a.createElement("span",null,t.title))),e.subtasks.length>3&&a.createElement("div",{className:"subtask-preview-item",style:{color:"var(--lion-text-muted)"}},"+",e.subtasks.length-3," more")))}))),a.createElement(Ga,{isOpen:u,onClose:()=>{g(!1),b(null)},onSave:()=>{w(),S(),t()},editTodo:h,initialDate:e}))},$a=`\n  ${ma}\n\n  .calendar-modal-overlay {\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background: rgba(0, 0, 0, 0.55);\n    backdrop-filter: blur(6px);\n    -webkit-backdrop-filter: blur(6px);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    z-index: 10000;\n    animation: fadeIn 0.15s ease;\n  }\n\n  @keyframes fadeIn {\n    from { opacity: 0; }\n    to { opacity: 1; }\n  }\n\n  .calendar-modal {\n    background: var(--lion-bg-primary);\n    border-radius: 16px;\n    width: 95%;\n    max-width: 900px;\n    max-height: 90vh;\n    overflow: hidden;\n    border: 1px solid var(--lion-border-light);\n    box-shadow: 0 25px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.05);\n    animation: slideUp 0.3s ease;\n    display: flex;\n    flex-direction: column;\n  }\n\n  @keyframes slideUp {\n    from { transform: translateY(20px); opacity: 0; }\n    to { transform: translateY(0); opacity: 1; }\n  }\n\n  .calendar-modal-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 20px 28px;\n    background: var(--lion-bg-primary);\n    border-bottom: 1px solid var(--lion-border-light);\n  }\n\n  .calendar-modal-title {\n    font-size: 20px;\n    font-weight: 700;\n    color: var(--lion-text-primary);\n    letter-spacing: -0.01em;\n    display: flex;\n    align-items: center;\n    gap: 10px;\n  }\n\n  .calendar-modal-title svg {\n    width: 24px;\n    height: 24px;\n    color: var(--lion-primary);\n  }\n\n  .calendar-close-btn {\n    background: var(--lion-bg-tertiary, #f4f4f5);\n    border: 1px solid var(--lion-border-light);\n    color: var(--lion-text-muted);\n    width: 36px;\n    height: 36px;\n    border-radius: 10px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    padding: 0;\n    transition: all 0.15s;\n  }\n\n  .calendar-close-btn:hover {\n    background: rgba(239,68,68,0.1);\n    color: var(--lion-error);\n    border-color: rgba(239,68,68,0.3);\n  }\n\n  .calendar-modal-content {\n    display: flex;\n    flex: 1;\n    overflow: hidden;\n  }\n\n  .calendar-left-panel {\n    flex: 0 0 320px;\n    padding: 20px;\n    border-right: 1px solid var(--lion-border-light);\n    overflow-y: auto;\n  }\n\n  .calendar-right-panel {\n    flex: 1;\n    padding: 20px;\n    overflow-y: auto;\n    background: var(--lion-bg-secondary);\n  }\n\n  /* Slim scrollbar */\n  .calendar-left-panel::-webkit-scrollbar,\n  .calendar-right-panel::-webkit-scrollbar {\n    width: 5px;\n  }\n\n  .calendar-left-panel::-webkit-scrollbar-track,\n  .calendar-right-panel::-webkit-scrollbar-track {\n    background: transparent;\n  }\n\n  .calendar-left-panel::-webkit-scrollbar-thumb,\n  .calendar-right-panel::-webkit-scrollbar-thumb {\n    background: var(--lion-border-light);\n    border-radius: 4px;\n  }\n\n  .calendar-left-panel::-webkit-scrollbar-thumb:hover,\n  .calendar-right-panel::-webkit-scrollbar-thumb:hover {\n    background: var(--lion-text-muted);\n  }\n\n  /* Calendar Navigation */\n  .calendar-nav {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    margin-bottom: 16px;\n  }\n\n  .calendar-nav-btn {\n    background: var(--lion-bg-tertiary);\n    border: 1px solid var(--lion-border-light);\n    width: 32px;\n    height: 32px;\n    border-radius: 10px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    color: var(--lion-text-primary);\n    transition: all 0.15s;\n  }\n\n  .calendar-nav-btn:hover {\n    border-color: var(--lion-primary);\n    color: var(--lion-primary);\n    background: var(--lion-bg-tertiary);\n  }\n\n  .calendar-nav-title {\n    font-size: 16px;\n    font-weight: 600;\n    color: var(--lion-text-primary);\n  }\n\n  /* Calendar Grid */\n  .calendar-grid {\n    display: grid;\n    grid-template-columns: repeat(7, 1fr);\n    gap: 2px;\n  }\n\n  .calendar-weekday {\n    text-align: center;\n    font-size: 11px;\n    font-weight: 600;\n    color: var(--lion-text-muted);\n    padding: 8px 0;\n    text-transform: uppercase;\n  }\n\n  .calendar-day {\n    aspect-ratio: 1;\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    font-size: 13px;\n    cursor: pointer;\n    border-radius: 8px;\n    transition: all 0.15s;\n    position: relative;\n    color: var(--lion-text-primary);\n    background: var(--lion-bg-primary);\n  }\n\n  .calendar-day:hover {\n    background: var(--lion-bg-tertiary);\n  }\n\n  .calendar-day.other-month {\n    color: var(--lion-text-light);\n  }\n\n  .calendar-day.today {\n    border: 2px solid var(--lion-primary);\n    font-weight: 600;\n  }\n\n  .calendar-day.selected {\n    background: var(--lion-primary);\n    color: white;\n    box-shadow: 0 2px 6px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .calendar-day.selected:hover {\n    background: linear-gradient(135deg, var(--lion-primary-hover), var(--lion-primary));\n  }\n\n  .calendar-day-indicators {\n    display: flex;\n    gap: 3px;\n    margin-top: 2px;\n    height: 6px;\n  }\n\n  .calendar-day-dot {\n    width: 6px;\n    height: 6px;\n    border-radius: 50%;\n  }\n\n  .calendar-day-dot.reminder {\n    background: var(--lion-warning);\n  }\n\n  .calendar-day-dot.appointment {\n    background: var(--lion-info);\n  }\n\n  .calendar-day-dot.todo {\n    background: var(--lion-primary);\n  }\n\n  /* Selected Date Info */\n  .selected-date-info {\n    margin-top: 20px;\n    padding-top: 16px;\n    border-top: 1px solid var(--lion-border-light);\n  }\n\n  .selected-date-title {\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--lion-text-primary);\n    margin-bottom: 12px;\n  }\n\n  .date-icons {\n    display: flex;\n    gap: 12px;\n  }\n\n  .date-icon-btn {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    padding: 12px 20px;\n    border-radius: 10px;\n    cursor: pointer;\n    border: 2px solid transparent;\n    transition: all 0.15s;\n    flex: 1;\n  }\n\n  .date-icon-btn.reminder {\n    background: var(--lion-warning-light);\n    color: var(--lion-warning);\n  }\n\n  .date-icon-btn.reminder:hover,\n  .date-icon-btn.reminder.active {\n    background: rgba(245, 158, 11, 0.2);\n    border-color: var(--lion-warning);\n  }\n\n  .date-icon-btn.appointment {\n    background: var(--lion-info-light);\n    color: var(--lion-info);\n  }\n\n  .date-icon-btn.appointment:hover,\n  .date-icon-btn.appointment.active {\n    background: rgba(59, 130, 246, 0.2);\n    border-color: var(--lion-info);\n  }\n\n  .date-icon-btn.todo {\n    background: var(--lion-primary-light);\n    color: var(--lion-primary);\n  }\n\n  .date-icon-btn.todo:hover,\n  .date-icon-btn.todo.active {\n    background: rgba(var(--lion-primary-rgb), 0.2);\n    border-color: var(--lion-primary);\n  }\n\n  .date-icon-btn.disabled {\n    opacity: 0.4;\n    cursor: not-allowed;\n  }\n\n  .date-icon-btn svg {\n    width: 28px;\n    height: 28px;\n    margin-bottom: 6px;\n  }\n\n  .date-icon-count {\n    font-size: 13px;\n    font-weight: 600;\n  }\n\n  .date-icon-label {\n    font-size: 11px;\n    margin-top: 2px;\n    opacity: 0.8;\n  }\n\n  /* Right Panel - Lists */\n  .list-header {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    margin-bottom: 16px;\n  }\n\n  .list-header svg {\n    width: 24px;\n    height: 24px;\n  }\n\n  .list-header.reminder {\n    color: var(--lion-warning);\n  }\n\n  .list-header.appointment {\n    color: var(--lion-info);\n  }\n\n  .list-header-title {\n    font-size: 16px;\n    font-weight: 600;\n    color: var(--lion-text-primary);\n  }\n\n  .empty-state {\n    text-align: center;\n    padding: 40px 20px;\n    color: var(--lion-text-muted);\n  }\n\n  .empty-state svg {\n    width: 64px;\n    height: 64px;\n    opacity: 0.3;\n    margin-bottom: 12px;\n  }\n\n  .empty-state-text {\n    font-size: 14px;\n  }\n\n  /* List Items */\n  .list-item {\n    background: var(--lion-bg-primary);\n    border-radius: 10px;\n    padding: 14px;\n    margin-bottom: 10px;\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n    transition: transform 0.15s, box-shadow 0.15s;\n  }\n\n  .list-item:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);\n  }\n\n  .list-item-header {\n    display: flex;\n    justify-content: space-between;\n    align-items: flex-start;\n    margin-bottom: 8px;\n  }\n\n  .list-item-contact {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .contact-avatar {\n    width: 32px;\n    height: 32px;\n    border-radius: 50%;\n    background: var(--lion-primary);\n    color: white;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    font-size: 12px;\n    font-weight: 600;\n  }\n\n  .contact-info {\n    display: flex;\n    flex-direction: column;\n  }\n\n  .contact-name {\n    font-size: 13px;\n    font-weight: 600;\n    color: var(--lion-text-primary);\n  }\n\n  .contact-phone {\n    font-size: 11px;\n    color: var(--lion-text-muted);\n  }\n\n  .list-item-actions {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .list-item-status {\n    padding: 3px 8px;\n    border-radius: 12px;\n    font-size: 10px;\n    font-weight: 600;\n    text-transform: uppercase;\n  }\n\n  .list-item-duplicate {\n    background: var(--lion-info-light);\n    border: none;\n    color: var(--lion-info);\n    width: 28px;\n    height: 28px;\n    border-radius: 6px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s;\n  }\n\n  .list-item-duplicate:hover {\n    background: rgba(59, 130, 246, 0.2);\n    transform: scale(1.05);\n  }\n\n  .list-item-duplicate svg {\n    width: 16px;\n    height: 16px;\n  }\n\n  .list-item-delete {\n    background: var(--lion-error-light);\n    border: none;\n    color: var(--lion-error);\n    width: 28px;\n    height: 28px;\n    border-radius: 6px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s;\n  }\n\n  .list-item-delete:hover {\n    background: rgba(239, 68, 68, 0.2);\n    transform: scale(1.05);\n  }\n\n  .list-item-delete svg {\n    width: 16px;\n    height: 16px;\n  }\n\n  .status-pending {\n    background: var(--lion-warning-light);\n    color: var(--lion-warning);\n  }\n\n  .status-scheduled {\n    background: var(--lion-info-light);\n    color: var(--lion-info);\n  }\n\n  .status-completed {\n    background: var(--lion-primary-light);\n    color: var(--lion-primary);\n  }\n\n  .status-cancelled,\n  .status-dismissed,\n  .status-stopped {\n    background: var(--lion-error-light);\n    color: var(--lion-error);\n  }\n\n  .status-missed,\n  .status-snoozed {\n    background: rgba(107, 114, 128, 0.1);\n    color: var(--lion-text-muted);\n  }\n\n  .list-item-topic {\n    font-size: 14px;\n    font-weight: 500;\n    color: var(--lion-text-primary);\n    margin-bottom: 4px;\n  }\n\n  .list-item-time {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    font-size: 12px;\n    color: var(--lion-text-muted);\n    margin-bottom: 6px;\n  }\n\n  .list-item-time svg {\n    width: 14px;\n    height: 14px;\n  }\n\n  .list-item-details {\n    font-size: 12px;\n    color: var(--lion-text-secondary);\n    line-height: 1.4;\n    overflow: hidden;\n    display: -webkit-box;\n    -webkit-line-clamp: 2;\n    -webkit-box-orient: vertical;\n  }\n\n  .list-item-repeat {\n    display: inline-flex;\n    align-items: center;\n    gap: 4px;\n    font-size: 11px;\n    color: var(--lion-primary);\n    margin-top: 6px;\n  }\n\n  .list-item-repeat svg {\n    width: 12px;\n    height: 12px;\n  }\n\n  /* Today Button */\n  .today-btn {\n    background: var(--lion-primary);\n    color: white;\n    border: none;\n    padding: 6px 12px;\n    border-radius: 10px;\n    font-size: 12px;\n    font-weight: 500;\n    cursor: pointer;\n    margin-top: 12px;\n    width: 100%;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n    transition: all 0.15s;\n  }\n\n  .today-btn:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35);\n  }\n\n  @media (max-width: 768px) {\n    .calendar-modal-content {\n      flex-direction: column;\n    }\n\n    .calendar-left-panel {\n      flex: none;\n      border-right: none;\n      border-bottom: 1px solid var(--lion-border-light);\n    }\n\n    .calendar-right-panel {\n      flex: 1;\n      min-height: 300px;\n    }\n  }\n`,Ya=({isOpen:e,onClose:t})=>{const[n,r]=(0,a.useState)(new Date),[o,i]=(0,a.useState)(new Date),[l,c]=(0,a.useState)(null),[,d]=(0,a.useState)(0),[m,p]=(0,a.useState)([]),[u,g]=(0,a.useState)([]),[h,b]=(0,a.useState)([]),[f,y]=(0,a.useState)([]),[x,w]=(0,a.useState)([]),[k,E]=(0,a.useState)([]);(0,a.useEffect)(()=>{const e=()=>d(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]);const S=[(0,s.t)("calendar.weekdays.sun"),(0,s.t)("calendar.weekdays.mon"),(0,s.t)("calendar.weekdays.tue"),(0,s.t)("calendar.weekdays.wed"),(0,s.t)("calendar.weekdays.thu"),(0,s.t)("calendar.weekdays.fri"),(0,s.t)("calendar.weekdays.sat")],C=[(0,s.t)("calendar.months.january"),(0,s.t)("calendar.months.february"),(0,s.t)("calendar.months.march"),(0,s.t)("calendar.months.april"),(0,s.t)("calendar.months.may"),(0,s.t)("calendar.months.june"),(0,s.t)("calendar.months.july"),(0,s.t)("calendar.months.august"),(0,s.t)("calendar.months.september"),(0,s.t)("calendar.months.october"),(0,s.t)("calendar.months.november"),(0,s.t)("calendar.months.december")];(0,a.useEffect)(()=>{if(!e)return;(()=>{const e=v.getAllContacts(),t=[],n=[];e.forEach(e=>{e.reminders?.forEach(n=>{t.push({contactId:e.id,contactName:e.profile.name,contactPhone:e.profile.phone,reminder:n})}),e.appointments?.forEach(t=>{n.push({contactId:e.id,contactName:e.profile.name,contactPhone:e.profile.phone,appointment:t})})}),y(t),w(n);const a=v.getAllTodos();E(a)})();const t=()=>{const e=v.getAllTodos();E(e)};return document.addEventListener("wa-crm-todo-added",t),document.addEventListener("wa-crm-todo-updated",t),document.addEventListener("wa-crm-todo-deleted",t),()=>{document.removeEventListener("wa-crm-todo-added",t),document.removeEventListener("wa-crm-todo-updated",t),document.removeEventListener("wa-crm-todo-deleted",t)}},[e]),(0,a.useEffect)(()=>{const e=new Date(o);e.setHours(0,0,0,0);const t=new Date(o);t.setHours(23,59,59,999);const n=f.filter(n=>{const a=new Date(n.reminder.datetime);return a>=e&&a<=t}),a=x.filter(n=>{const a=new Date(n.appointment.datetime);return a>=e&&a<=t}),r=k.filter(n=>!!n.dueDate&&(n.dueDate>=e.getTime()&&n.dueDate<=t.getTime()));p(n),g(a),b(r),n.length>0?c("reminder"):a.length>0?c("appointment"):(r.length,c("todo"))},[o,f,x,k]);const T=e=>{const t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},A=()=>({en:"en-US",es:"es-ES",zh:"zh-CN",ja:"ja-JP",de:"de-DE",fr:"fr-FR",ar:"ar-SA",pt:"pt-BR",ru:"ru-RU"}[(0,s.UK)()]||"en-US"),D=e=>new Date(e).toLocaleTimeString(A(),{hour:"2-digit",minute:"2-digit",hour12:"de"!==(0,s.UK)()&&"fr"!==(0,s.UK)()}),_=e=>e.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2),N=e=>(0,s.t)(`calendar.status.${e}`)||e;return e?a.createElement(a.Fragment,null,a.createElement("style",null,$a),a.createElement("div",{className:"calendar-modal-overlay",onClick:e=>{e.target===e.currentTarget&&t()}},a.createElement("div",{className:"calendar-modal"},a.createElement("div",{className:"calendar-modal-header"},a.createElement("div",{className:"calendar-modal-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"})),(0,s.t)("calendar.title")),a.createElement("button",{className:"calendar-close-btn",onClick:t},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),a.createElement("div",{className:"calendar-modal-content"},a.createElement("div",{className:"calendar-left-panel"},a.createElement("div",{className:"calendar-nav"},a.createElement("button",{className:"calendar-nav-btn",onClick:()=>{r(new Date(n.getFullYear(),n.getMonth()-1,1))}},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"15 18 9 12 15 6"}))),a.createElement("div",{className:"calendar-nav-title"},C[n.getMonth()]," ",n.getFullYear()),a.createElement("button",{className:"calendar-nav-btn",onClick:()=>{r(new Date(n.getFullYear(),n.getMonth()+1,1))}},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"9 18 15 12 9 6"})))),a.createElement("div",{className:"calendar-grid"},S.map(e=>a.createElement("div",{key:e,className:"calendar-weekday"},e)),(()=>{const e=n.getFullYear(),t=n.getMonth(),a=new Date(e,t,1),r=new Date(e,t+1,0),o=a.getDay(),i=r.getDate(),s=[],l=new Date(e,t,0).getDate();for(let n=o-1;n>=0;n--)s.push({date:new Date(e,t-1,l-n),isOtherMonth:!0});for(let n=1;n<=i;n++)s.push({date:new Date(e,t,n),isOtherMonth:!1});const c=42-s.length;for(let n=1;n<=c;n++)s.push({date:new Date(e,t+1,n),isOtherMonth:!0});return s})().map((e,t)=>{const n=(e=>{const t=new Date(e);t.setHours(0,0,0,0);const n=new Date(e);return n.setHours(23,59,59,999),{hasReminder:f.some(e=>{const a=new Date(e.reminder.datetime);return a>=t&&a<=n}),hasAppointment:x.some(e=>{const a=new Date(e.appointment.datetime);return a>=t&&a<=n}),hasTodo:k.some(e=>!!e.dueDate&&e.dueDate>=t.getTime()&&e.dueDate<=n.getTime())}})(e.date);return a.createElement("div",{key:t,className:`calendar-day ${e.isOtherMonth?"other-month":""} ${T(e.date)?"today":""} ${r=e.date,r.getDate()===o.getDate()&&r.getMonth()===o.getMonth()&&r.getFullYear()===o.getFullYear()?"selected":""}`,onClick:()=>i(new Date(e.date))},e.date.getDate(),a.createElement("div",{className:"calendar-day-indicators"},n.hasReminder&&a.createElement("span",{className:"calendar-day-dot reminder"}),n.hasAppointment&&a.createElement("span",{className:"calendar-day-dot appointment"}),n.hasTodo&&a.createElement("span",{className:"calendar-day-dot todo"})));var r})),a.createElement("button",{className:"today-btn",onClick:()=>{const e=new Date;r(e),i(e)}},(0,s.t)("calendar.goToToday")),a.createElement("div",{className:"selected-date-info"},a.createElement("div",{className:"selected-date-title"},o.toLocaleDateString(A(),{weekday:"long",month:"long",day:"numeric",year:"numeric"})),a.createElement("div",{className:"date-icons"},a.createElement("div",{className:`date-icon-btn reminder ${"reminder"===l?"active":""} ${0===m.length?"disabled":""}`,onClick:()=>m.length>0&&c("reminder")},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),a.createElement("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})),a.createElement("span",{className:"date-icon-count"},m.length),a.createElement("span",{className:"date-icon-label"},(0,s.t)("calendar.reminders"))),a.createElement("div",{className:`date-icon-btn appointment ${"appointment"===l?"active":""} ${0===u.length?"disabled":""}`,onClick:()=>u.length>0&&c("appointment")},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"}),a.createElement("circle",{cx:"12",cy:"15",r:"2"})),a.createElement("span",{className:"date-icon-count"},u.length),a.createElement("span",{className:"date-icon-label"},(0,s.t)("calendar.appointments"))),a.createElement("div",{className:"date-icon-btn todo "+("todo"===l?"active":""),onClick:()=>c("todo")},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M9 11l3 3L22 4"}),a.createElement("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})),a.createElement("span",{className:"date-icon-count"},h.length),a.createElement("span",{className:"date-icon-label"},(0,s.t)("calendar.todos")||"Todos"))))),a.createElement("div",{className:"calendar-right-panel"},"reminder"===l&&a.createElement(a.Fragment,null,a.createElement("div",{className:"list-header reminder"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),a.createElement("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})),a.createElement("span",{className:"list-header-title"},(0,s.t)("calendar.remindersFor")," ",o.toLocaleDateString())),0===m.length?a.createElement("div",{className:"empty-state"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1"},a.createElement("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),a.createElement("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})),a.createElement("div",{className:"empty-state-text"},(0,s.t)("calendar.noReminders"))):m.map(e=>{return a.createElement("div",{key:e.reminder.id,className:"list-item"},a.createElement("div",{className:"list-item-header"},a.createElement("div",{className:"list-item-contact"},a.createElement("div",{className:"contact-avatar"},_(e.contactName)),a.createElement("div",{className:"contact-info"},a.createElement("div",{className:"contact-name"},e.contactName),a.createElement("div",{className:"contact-phone"},e.contactPhone))),a.createElement("div",{className:"list-item-actions"},a.createElement("span",{className:`list-item-status status-${e.reminder.status}`},N(e.reminder.status)),a.createElement("button",{className:"list-item-duplicate",onClick:t=>{t.stopPropagation(),(e=>{const t=v.addReminder(e.contactId,`${e.reminder.topic} (${(0,s.t)("calendar.copy")||"Copy"})`,e.reminder.details,e.reminder.datetime,e.reminder.repeatInterval);if(t){const n={contactId:e.contactId,contactName:e.contactName,contactPhone:e.contactPhone,reminder:t};y(e=>[...e,n]);const a=new Date(t.datetime),r=new Date(o);r.setHours(0,0,0,0);const i=new Date(o);i.setHours(23,59,59,999),a>=r&&a<=i&&p(e=>[...e,n])}})(e)},title:(0,s.t)("calendar.duplicateReminder")||"Duplicate"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),a.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))),a.createElement("button",{className:"list-item-delete",onClick:t=>{var n,a;t.stopPropagation(),n=e.contactId,a=e.reminder.id,confirm((0,s.t)("calendar.confirmDeleteReminder"))&&(v.deleteReminder(n,a),y(e=>e.filter(e=>e.reminder.id!==a)),p(e=>e.filter(e=>e.reminder.id!==a)))},title:(0,s.t)("calendar.deleteReminder")},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"3 6 5 6 21 6"}),a.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),a.createElement("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),a.createElement("line",{x1:"14",y1:"11",x2:"14",y2:"17"}))))),a.createElement("div",{className:"list-item-topic"},e.reminder.topic),a.createElement("div",{className:"list-item-time"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("polyline",{points:"12 6 12 12 16 14"})),D(e.reminder.datetime)),e.reminder.details&&a.createElement("div",{className:"list-item-details"},e.reminder.details),e.reminder.repeatInterval>0&&a.createElement("div",{className:"list-item-repeat"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"23 4 23 10 17 10"}),a.createElement("polyline",{points:"1 20 1 14 7 14"}),a.createElement("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})),0===(t=e.reminder.repeatInterval)?"":t<60?(0,s.t)("calendar.everyMin").replace("{min}",String(t)):(0,s.t)("calendar.everyHour")));var t})),"appointment"===l&&a.createElement(a.Fragment,null,a.createElement("div",{className:"list-header appointment"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"})),a.createElement("span",{className:"list-header-title"},(0,s.t)("calendar.appointmentsFor")," ",o.toLocaleDateString())),0===u.length?a.createElement("div",{className:"empty-state"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1"},a.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"})),a.createElement("div",{className:"empty-state-text"},(0,s.t)("calendar.noAppointments"))):u.map(e=>a.createElement("div",{key:e.appointment.id,className:"list-item"},a.createElement("div",{className:"list-item-header"},a.createElement("div",{className:"list-item-contact"},a.createElement("div",{className:"contact-avatar"},_(e.contactName)),a.createElement("div",{className:"contact-info"},a.createElement("div",{className:"contact-name"},e.contactName),a.createElement("div",{className:"contact-phone"},e.contactPhone))),a.createElement("div",{className:"list-item-actions"},a.createElement("span",{className:`list-item-status status-${e.appointment.status}`},N(e.appointment.status)),a.createElement("button",{className:"list-item-duplicate",onClick:t=>{t.stopPropagation(),(e=>{const t=v.addAppointment(e.contactId,`${e.appointment.title} (${(0,s.t)("calendar.copy")||"Copy"})`,e.appointment.datetime,e.appointment.attendees?[...e.appointment.attendees]:[],e.appointment.message,e.appointment.meetLink,e.appointment.reminderBefore,e.appointment.useSameMessage,e.appointment.meetingStartMessage);if(t){const n={contactId:e.contactId,contactName:e.contactName,contactPhone:e.contactPhone,appointment:t};w(e=>[...e,n]);const a=new Date(t.datetime),r=new Date(o);r.setHours(0,0,0,0);const i=new Date(o);i.setHours(23,59,59,999),a>=r&&a<=i&&g(e=>[...e,n])}})(e)},title:(0,s.t)("calendar.duplicateAppointment")||"Duplicate"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),a.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))),a.createElement("button",{className:"list-item-delete",onClick:t=>{var n,a;t.stopPropagation(),n=e.contactId,a=e.appointment.id,confirm((0,s.t)("calendar.confirmDeleteAppointment"))&&(v.deleteAppointment(n,a),w(e=>e.filter(e=>e.appointment.id!==a)),g(e=>e.filter(e=>e.appointment.id!==a)))},title:(0,s.t)("calendar.deleteAppointment")},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"3 6 5 6 21 6"}),a.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),a.createElement("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),a.createElement("line",{x1:"14",y1:"11",x2:"14",y2:"17"}))))),a.createElement("div",{className:"list-item-topic"},e.appointment.title),a.createElement("div",{className:"list-item-time"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("polyline",{points:"12 6 12 12 16 14"})),D(e.appointment.datetime)),e.appointment.meetLink&&a.createElement("div",{className:"list-item-details"},a.createElement("a",{href:e.appointment.meetLink,target:"_blank",rel:"noopener noreferrer",style:{color:ca.info}},e.appointment.meetLink))))),"todo"===l&&a.createElement(Ka,{selectedDate:o,onRefresh:()=>{const e=v.getAllTodos();E(e)}}),null===l&&a.createElement("div",{className:"empty-state"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1"},a.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"})),a.createElement("div",{className:"empty-state-text"},(0,s.t)("calendar.selectDate")))))))):null},Xa=[{value:"#ef4444",name:"Red"},{value:"#7C3AED",name:"Royal Blue"},{value:"#0ea5e9",name:"Amber"},{value:"#10b981",name:"Green"},{value:"#14b8a6",name:"Teal"},{value:"#06b6d4",name:"Cyan"},{value:"#3b82f6",name:"Blue"},{value:"#7C3AED",name:"Indigo"},{value:"#7C3AED",name:"Violet"},{value:"#a855f7",name:"Purple"},{value:"#ec4899",name:"Pink"},{value:"#f43f5e",name:"Rose"},{value:"#1f2937",name:"Dark"},{value:"#374151",name:"Gray"},{value:"#4b5563",name:"Slate"},{value:"#ffffff",name:"White"}],Ja="wa_crm_status_items",Qa=()=>{try{const e=localStorage.getItem(Ja);if(!e)return[];const t=JSON.parse(e);return t.filter(e=>"scheduled"===e.status).length,t}catch(e){return[]}},Za=e=>{try{const t=JSON.stringify(e);localStorage.setItem(Ja,t);return localStorage.getItem(Ja)===t}catch(e){return"QuotaExceededError"!==e.name&&22!==e.code||alert("Storage quota exceeded! Please delete some old statuses or use smaller media files."),!1}},er=`\n  ${ma}\n\n  .status-modal-overlay {\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background: rgba(0, 0, 0, 0.55);\n    backdrop-filter: blur(6px);\n    -webkit-backdrop-filter: blur(6px);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    z-index: 10001;\n    animation: statusFadeIn 0.15s ease;\n  }\n\n  @keyframes statusFadeIn {\n    from { opacity: 0; }\n    to { opacity: 1; }\n  }\n\n  .status-modal {\n    background: var(--lion-bg-primary, #ffffff);\n    border-radius: 16px;\n    width: 92%;\n    max-width: 920px;\n    height: 88vh;\n    max-height: 720px;\n    overflow: hidden;\n    border: 1px solid var(--lion-border-light);\n    box-shadow: 0 25px 80px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.05);\n    animation: statusSlideUp 0.3s ease;\n    display: flex;\n    flex-direction: column;\n  }\n\n  @keyframes statusSlideUp {\n    from { transform: translateY(30px); opacity: 0; }\n    to { transform: translateY(0); opacity: 1; }\n  }\n\n  /* Modal Header */\n  .status-modal-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 18px 24px;\n    background: var(--lion-bg-primary);\n    border-bottom: 1px solid var(--lion-border-light);\n  }\n\n  .status-modal-title {\n    font-size: 20px;\n    font-weight: 700;\n    color: var(--lion-text-primary);\n    letter-spacing: -0.01em;\n    display: flex;\n    align-items: center;\n    gap: 10px;\n  }\n\n  .status-modal-title svg {\n    width: 22px;\n    height: 22px;\n    color: var(--lion-primary);\n  }\n\n  .status-close-btn {\n    background: var(--lion-bg-tertiary, #f4f4f5);\n    border: 1px solid var(--lion-border-light);\n    color: var(--lion-text-muted);\n    width: 36px;\n    height: 36px;\n    border-radius: 10px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s;\n  }\n\n  .status-close-btn:hover {\n    background: rgba(239,68,68,0.1);\n    color: var(--lion-error);\n    border-color: rgba(239,68,68,0.3);\n    transform: rotate(90deg);\n  }\n\n  .status-close-btn svg {\n    width: 20px;\n    height: 20px;\n  }\n\n  /* 2-Panel Layout */\n  .status-modal-content {\n    flex: 1;\n    display: flex;\n    overflow: hidden;\n  }\n\n  /* LEFT Sidebar */\n  .status-sidebar {\n    width: 200px;\n    min-width: 200px;\n    padding: 16px 12px;\n    border-right: 1px solid var(--lion-border-light);\n    display: flex;\n    flex-direction: column;\n    gap: 6px;\n    background: var(--lion-bg-primary);\n  }\n\n  .status-sidebar-item {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    padding: 12px 14px;\n    border-radius: 10px;\n    cursor: pointer;\n    color: var(--lion-text-secondary);\n    font-size: 13px;\n    font-weight: 500;\n    transition: all 0.15s ease;\n    position: relative;\n  }\n\n  .status-sidebar-item:hover {\n    background: var(--lion-bg-secondary);\n    color: var(--lion-text-primary);\n  }\n\n  .status-sidebar-item.active {\n    background: var(--lion-primary);\n    color: #ffffff;\n    font-weight: 600;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .status-sidebar-item svg {\n    width: 18px;\n    height: 18px;\n    flex-shrink: 0;\n  }\n\n  .status-sidebar-count {\n    margin-left: auto;\n    font-size: 11px;\n    background: rgba(0, 0, 0, 0.06);\n    padding: 2px 8px;\n    border-radius: 10px;\n    min-width: 20px;\n    text-align: center;\n  }\n\n  .status-sidebar-item.active .status-sidebar-count {\n    background: rgba(255, 255, 255, 0.25);\n    color: #ffffff;\n  }\n\n  /* RIGHT Main Panel */\n  .status-main-panel {\n    flex: 1;\n    overflow-y: auto;\n    padding: 24px;\n    background: var(--lion-bg-secondary);\n    scrollbar-width: thin;\n    scrollbar-color: var(--lion-border-light) transparent;\n  }\n\n  .status-main-panel::-webkit-scrollbar {\n    width: 6px;\n  }\n\n  .status-main-panel::-webkit-scrollbar-track {\n    background: transparent;\n  }\n\n  .status-main-panel::-webkit-scrollbar-thumb {\n    background: var(--lion-border-medium, #d1d5db);\n    border-radius: 3px;\n  }\n\n  /* Legacy scrollbar selectors kept for compatibility */\n  .status-modal-content::-webkit-scrollbar {\n    width: 0;\n  }\n\n  .status-modal-content::-webkit-scrollbar-track {\n    background: transparent;\n  }\n\n  .status-modal-content::-webkit-scrollbar-thumb {\n    background: transparent;\n    border-radius: 10px;\n  }\n\n  .status-modal-content::-webkit-scrollbar-thumb:hover {\n    background: var(--lion-text-muted);\n  }\n\n  /* View Toggle - List vs Create */\n  .status-view-toggle {\n    display: flex;\n    gap: 8px;\n    margin-bottom: 20px;\n  }\n\n  .status-view-btn {\n    flex: 1;\n    padding: 12px 16px;\n    border: 2px solid var(--lion-border-light, #e5e7eb);\n    background: var(--lion-bg-primary, #ffffff);\n    border-radius: 10px;\n    font-size: 14px;\n    font-weight: 500;\n    color: var(--lion-text-secondary, #6b7280);\n    cursor: pointer;\n    transition: all 0.15s;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    gap: 8px;\n  }\n\n  .status-view-btn:hover {\n    border-color: var(--lion-primary, var(--lion-primary));\n    color: var(--lion-primary, var(--lion-primary));\n  }\n\n  .status-view-btn.active {\n    background: var(--lion-primary, var(--lion-primary));\n    border-color: var(--lion-primary, var(--lion-primary));\n    color: white;\n  }\n\n  .status-view-btn svg {\n    width: 18px;\n    height: 18px;\n  }\n\n  /* Empty State */\n  .status-empty-state {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    text-align: center;\n    padding: 60px 24px;\n    color: var(--lion-text-muted, #9ca3af);\n    min-height: 300px;\n  }\n\n  .status-empty-icon {\n    width: 60px;\n    height: 60px;\n    margin: 0 auto 20px;\n    opacity: 0.3;\n    color: var(--lion-text-muted);\n  }\n\n  .status-empty-title {\n    font-size: 17px;\n    font-weight: 700;\n    color: var(--lion-text-secondary, #374151);\n    margin-bottom: 8px;\n  }\n\n  .status-empty-text {\n    font-size: 13px;\n    line-height: 1.5;\n    margin-bottom: 24px;\n    max-width: 320px;\n  }\n\n  .status-empty-add-btn {\n    display: inline-flex;\n    align-items: center;\n    gap: 6px;\n    padding: 10px 24px;\n    background: var(--lion-primary);\n    color: #ffffff;\n    border: none;\n    border-radius: 10px;\n    font-size: 13px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.15s ease;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .status-empty-add-btn:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35);\n  }\n\n  /* Status List */\n  .status-list {\n    display: flex;\n    flex-direction: column;\n    gap: 12px;\n  }\n\n  .status-list-item {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    padding: 14px;\n    background: var(--lion-bg-secondary, #f9fafb);\n    border-radius: 12px;\n    border: 1px solid var(--lion-border-light, #e5e7eb);\n    transition: all 0.15s;\n  }\n\n  .status-list-item:hover {\n    border-color: var(--lion-primary, var(--lion-primary));\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb),0.1);\n  }\n\n  .status-list-preview {\n    width: 48px;\n    height: 48px;\n    border-radius: 10px;\n    flex-shrink: 0;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    color: white;\n    font-weight: 600;\n    overflow: hidden;\n  }\n\n  .status-list-preview img {\n    width: 100%;\n    height: 100%;\n    object-fit: cover;\n  }\n\n  .status-list-preview svg {\n    width: 24px;\n    height: 24px;\n  }\n\n  .status-list-info {\n    flex: 1;\n    min-width: 0;\n  }\n\n  .status-list-name {\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--lion-text-primary, #1f2937);\n    margin-bottom: 4px;\n    white-space: nowrap;\n    overflow: hidden;\n    text-overflow: ellipsis;\n  }\n\n  .status-list-meta {\n    font-size: 12px;\n    color: var(--lion-text-muted, #9ca3af);\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .status-list-badge {\n    display: inline-flex;\n    align-items: center;\n    gap: 4px;\n    padding: 2px 8px;\n    border-radius: 10px;\n    font-size: 11px;\n    font-weight: 500;\n  }\n\n  .status-list-badge.scheduled {\n    background: rgba(var(--lion-primary-rgb),0.1);\n    color: var(--lion-primary);\n  }\n\n  .status-list-badge.posted {\n    background: var(--lion-success-light);\n    color: var(--lion-success);\n  }\n\n  .status-list-badge.pending {\n    background: var(--lion-info-light);\n    color: var(--lion-info);\n  }\n\n  .status-list-badge.auto-repost {\n    background: rgba(139, 92, 246, 0.1);\n    color: #7C3AED;\n  }\n\n  .status-list-actions {\n    display: flex;\n    gap: 8px;\n  }\n\n  .status-action-btn {\n    width: 36px;\n    height: 36px;\n    border: none;\n    border-radius: 8px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s;\n  }\n\n  .status-action-btn.post {\n    background: var(--lion-primary, var(--lion-primary));\n    color: white;\n  }\n\n  .status-action-btn.post:hover {\n    background: var(--lion-primary-hover, var(--lion-primary-hover));\n    transform: scale(1.05);\n  }\n\n  .status-action-btn.delete {\n    background: var(--lion-bg-tertiary, #f3f4f6);\n    color: var(--lion-error, #ef4444);\n  }\n\n  .status-action-btn.delete:hover {\n    background: rgba(239, 68, 68, 0.1);\n  }\n\n  .status-action-btn svg {\n    width: 18px;\n    height: 18px;\n  }\n\n  /* Create Status Form */\n  .status-form {\n    display: flex;\n    flex-direction: column;\n    gap: 20px;\n  }\n\n  .status-form-group {\n    display: flex;\n    flex-direction: column;\n    gap: 8px;\n  }\n\n  .status-form-label {\n    font-size: 12px;\n    font-weight: 700;\n    color: var(--lion-text-secondary, #374151);\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n  }\n\n  .status-form-input {\n    padding: 12px 14px;\n    border: 2px solid var(--lion-border-light, #e5e7eb);\n    border-radius: 10px;\n    font-size: 14px;\n    color: var(--lion-text-primary, #1f2937);\n    background: var(--lion-bg-primary, #ffffff);\n    transition: all 0.15s;\n  }\n\n  .status-form-input:focus {\n    outline: none;\n    border-color: var(--lion-primary, var(--lion-primary));\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  .status-form-input::placeholder {\n    color: var(--lion-text-light, #9ca3af);\n  }\n\n  /* Type Selector */\n  .status-type-selector {\n    display: grid;\n    grid-template-columns: repeat(3, 1fr);\n    gap: 10px;\n  }\n\n  .status-type-btn {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    gap: 6px;\n    padding: 14px 10px;\n    border: 2px solid var(--lion-border-light, #e5e7eb);\n    border-radius: 12px;\n    background: var(--lion-bg-primary, #ffffff);\n    cursor: pointer;\n    transition: all 0.15s;\n  }\n\n  .status-type-btn:hover {\n    border-color: var(--lion-primary, var(--lion-primary));\n  }\n\n  .status-type-btn.selected {\n    background: var(--lion-primary);\n    border-color: var(--lion-primary, var(--lion-primary));\n    color: white;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .status-type-btn svg {\n    width: 24px;\n    height: 24px;\n  }\n\n  .status-type-btn span {\n    font-size: 12px;\n    font-weight: 500;\n  }\n\n  /* Text Status Specific */\n  .status-text-area {\n    width: 100%;\n    min-height: 160px;\n    resize: vertical;\n    font-family: inherit;\n    font-size: 15px;\n    line-height: 1.6;\n    box-sizing: border-box;\n  }\n\n  .status-caption-area {\n    width: 100%;\n    min-height: 80px;\n    resize: vertical;\n    font-family: inherit;\n    font-size: 14px;\n    line-height: 1.5;\n    box-sizing: border-box;\n  }\n\n  .status-char-counter {\n    display: flex;\n    justify-content: flex-end;\n    align-items: center;\n    margin-top: 6px;\n    font-size: 12px;\n    color: var(--lion-text-muted, #9ca3af);\n  }\n\n  .status-char-counter span.warning {\n    color: var(--lion-primary, var(--lion-primary));\n    font-weight: 600;\n  }\n\n  .status-char-max {\n    color: var(--lion-text-muted, #9ca3af);\n  }\n\n  /* Loading State */\n  .status-loading {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    padding: 40px 20px;\n    gap: 16px;\n    color: var(--lion-text-muted, #9ca3af);\n  }\n\n  .status-loading-spinner {\n    width: 32px;\n    height: 32px;\n    border: 3px solid var(--lion-border-light, #e5e7eb);\n    border-top-color: var(--lion-primary, var(--lion-primary));\n    border-radius: 50%;\n    animation: statusSpin 0.8s linear infinite;\n  }\n\n  @keyframes statusSpin {\n    to { transform: rotate(360deg); }\n  }\n\n  /* Status List Header */\n  .status-list-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    margin-bottom: 16px;\n  }\n\n  .status-count {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .status-count-number {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    width: 32px;\n    height: 32px;\n    background: var(--lion-primary, var(--lion-primary));\n    color: white;\n    font-size: 14px;\n    font-weight: 700;\n    border-radius: 50%;\n  }\n\n  .status-count-label {\n    font-size: 14px;\n    font-weight: 500;\n    color: var(--lion-text-secondary, #6b7280);\n  }\n\n  /* WhatsApp Status Item */\n  .status-list-item.whatsapp-status {\n    border-left: 3px solid var(--lion-primary, var(--lion-primary));\n  }\n\n  /* Small Add Button */\n  .status-add-btn-small {\n    width: 40px;\n    height: 40px;\n    border-radius: 50%;\n    background: var(--lion-primary, var(--lion-primary));\n    border: none;\n    color: white;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb),0.3);\n  }\n\n  .status-add-btn-small:hover {\n    background: var(--lion-primary-hover, var(--lion-primary-hover));\n    transform: scale(1.1);\n    box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb),0.4);\n  }\n\n  .status-add-btn-small svg {\n    width: 20px;\n    height: 20px;\n  }\n\n  /* Edit Button */\n  .status-action-btn.edit {\n    background: var(--lion-bg-tertiary, #f3f4f6);\n    color: var(--lion-primary, var(--lion-primary));\n  }\n\n  .status-action-btn.edit:hover {\n    background: rgba(var(--lion-primary-rgb), 0.1);\n  }\n\n  .status-text-input-wrapper {\n    width: 100%;\n    position: relative;\n  }\n\n  .status-text-input-wrapper textarea {\n    width: 100%;\n    padding-right: 48px;\n    box-sizing: border-box;\n  }\n\n  .status-text-preview {\n    width: 100%;\n    min-height: 140px;\n    border-radius: 12px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    padding: 20px;\n    text-align: center;\n    color: white;\n    font-size: 16px;\n    font-weight: 500;\n    word-break: break-word;\n    transition: background 0.3s;\n    line-height: 1.5;\n  }\n\n  /* Color Picker - Single Button Style */\n\n  .status-color-btn {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    padding: 10px 16px;\n    border: 2px solid var(--lion-border-light, #e5e7eb);\n    border-radius: 10px;\n    background: var(--lion-bg-primary, #ffffff);\n    cursor: pointer;\n    transition: all 0.15s;\n    flex: 1;\n  }\n\n  .status-color-btn:hover {\n    border-color: var(--lion-primary, var(--lion-primary));\n  }\n\n  .status-color-preview {\n    width: 32px;\n    height: 32px;\n    border-radius: 8px;\n    border: 2px solid rgba(0, 0, 0, 0.1);\n    flex-shrink: 0;\n  }\n\n  .status-color-btn-text {\n    flex: 1;\n    text-align: left;\n  }\n\n  .status-color-btn-text span {\n    display: block;\n    font-size: 14px;\n    font-weight: 500;\n    color: var(--lion-text-primary, #1f2937);\n  }\n\n  .status-color-btn-text small {\n    font-size: 12px;\n    color: var(--lion-text-muted, #9ca3af);\n  }\n\n  .status-color-btn svg {\n    width: 20px;\n    height: 20px;\n    color: var(--lion-text-muted, #9ca3af);\n  }\n\n  .status-color-pickers-row {\n    display: flex;\n    gap: 12px;\n  }\n\n  .status-color-picker-row {\n    position: relative;\n  }\n\n  .status-color-input {\n    position: absolute;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n    opacity: 0;\n    cursor: pointer;\n  }\n\n  /* Media Upload */\n  .status-media-upload {\n    display: flex;\n    flex-direction: column;\n    gap: 12px;\n  }\n\n  .status-upload-area {\n    display: flex;\n    align-items: center;\n    gap: 16px;\n    padding: 20px;\n    border: 2px dashed var(--lion-border-light, #e5e7eb);\n    border-radius: 12px;\n    cursor: pointer;\n    transition: all 0.15s;\n  }\n\n  .status-upload-area:hover {\n    border-color: var(--lion-primary, var(--lion-primary));\n    background: rgba(var(--lion-primary-rgb),0.02);\n  }\n\n  .status-upload-btn {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    width: 60px;\n    height: 60px;\n    background: var(--lion-bg-tertiary, #f3f4f6);\n    border-radius: 12px;\n    color: var(--lion-primary, var(--lion-primary));\n    flex-shrink: 0;\n  }\n\n  .status-upload-btn svg {\n    width: 28px;\n    height: 28px;\n  }\n\n  .status-upload-text {\n    flex: 1;\n  }\n\n  .status-upload-text span {\n    display: block;\n    font-size: 14px;\n    font-weight: 500;\n    color: var(--lion-primary, var(--lion-primary));\n    margin-bottom: 4px;\n  }\n\n  .status-upload-text small {\n    font-size: 12px;\n    color: var(--lion-text-muted, #9ca3af);\n  }\n\n  .status-upload-input {\n    display: none;\n  }\n\n  .status-media-preview {\n    position: relative;\n    border-radius: 12px;\n    overflow: hidden;\n    background: var(--lion-bg-tertiary, #f3f4f6);\n  }\n\n  .status-media-preview img,\n  .status-media-preview video {\n    width: 100%;\n    max-height: 200px;\n    object-fit: contain;\n  }\n\n  .status-media-preview audio {\n    width: 100%;\n    margin-top: 20px;\n  }\n\n  .status-media-remove {\n    position: absolute;\n    top: 8px;\n    right: 8px;\n    width: 28px;\n    height: 28px;\n    background: rgba(0, 0, 0, 0.6);\n    border: none;\n    border-radius: 50%;\n    color: white;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s;\n  }\n\n  .status-media-remove:hover {\n    background: rgba(239, 68, 68, 0.9);\n  }\n\n  .status-media-remove svg {\n    width: 16px;\n    height: 16px;\n  }\n\n  /* Schedule Options */\n  .status-schedule-section {\n    display: flex;\n    flex-direction: column;\n    gap: 12px;\n    padding: 16px;\n    background: var(--lion-bg-secondary, #f9fafb);\n    border-radius: 12px;\n  }\n\n  .status-schedule-option {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    cursor: pointer;\n  }\n\n  .status-schedule-option input[type="radio"],\n  .status-schedule-option input[type="checkbox"] {\n    width: 18px;\n    height: 18px;\n    accent-color: var(--lion-primary, var(--lion-primary));\n    cursor: pointer;\n  }\n\n  .status-schedule-option label {\n    font-size: 14px;\n    color: var(--lion-text-primary, #1f2937);\n    cursor: pointer;\n  }\n\n  .status-schedule-datetime {\n    display: grid;\n    grid-template-columns: 1fr 1fr;\n    gap: 12px;\n    margin-top: 8px;\n    padding-left: 28px;\n  }\n\n  .status-schedule-datetime input {\n    padding: 10px 12px;\n    border: 2px solid var(--lion-border-light, #e5e7eb);\n    border-radius: 8px;\n    font-size: 14px;\n    color: var(--lion-text-primary, #1f2937);\n    background: var(--lion-bg-primary, #ffffff);\n  }\n\n  .status-schedule-datetime input:focus {\n    outline: none;\n    border-color: var(--lion-primary, var(--lion-primary));\n  }\n\n  /* Action Buttons */\n  .status-modal-actions {\n    display: flex;\n    justify-content: flex-end;\n    gap: 12px;\n    padding: 18px 0 0 0;\n    margin-top: 20px;\n    border-top: 1px solid var(--lion-border-light, #e5e7eb);\n    flex-shrink: 0;\n  }\n\n  .status-btn {\n    padding: 10px 24px;\n    border: none;\n    border-radius: 10px;\n    font-size: 13px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.15s;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    gap: 8px;\n    min-width: 120px;\n  }\n\n  .status-btn.cancel {\n    background: var(--lion-bg-tertiary, #f4f4f5);\n    border: 1px solid var(--lion-border-light);\n    color: var(--lion-text-muted);\n    border-radius: 10px;\n  }\n\n  .status-btn.cancel:hover {\n    background: var(--lion-bg-secondary);\n  }\n\n  .status-btn.create {\n    background: var(--lion-primary);\n    color: white;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n    border-radius: 10px;\n  }\n\n  .status-btn.create:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.3);\n  }\n\n  .status-btn.create:disabled {\n    opacity: 0.5;\n    cursor: not-allowed;\n    transform: none;\n    box-shadow: none;\n  }\n\n  .status-btn svg {\n    width: 18px;\n    height: 18px;\n  }\n\n  /* ========== DARK MODE OVERRIDES ========== */\n  .status-modal-overlay.lion-dark .status-modal {\n    background: var(--lion-bg-primary);\n  }\n\n  .status-modal-overlay.lion-dark .status-modal-content {\n    background: var(--lion-bg-primary);\n  }\n\n  .status-modal-overlay.lion-dark .status-form-input {\n    background: var(--lion-bg-secondary) !important;\n    color: var(--lion-text-primary) !important;\n    border-color: var(--lion-border-light);\n  }\n\n  .status-modal-overlay.lion-dark .status-form-input::placeholder {\n    color: var(--lion-text-muted) !important;\n  }\n\n  .status-modal-overlay.lion-dark .status-form-label {\n    color: var(--lion-text-secondary);\n  }\n\n  .status-modal-overlay.lion-dark .status-type-btn {\n    background: var(--lion-bg-secondary);\n    border-color: var(--lion-border-light);\n    color: var(--lion-text-primary);\n  }\n\n  .status-modal-overlay.lion-dark .status-type-btn:hover {\n    border-color: var(--lion-primary);\n  }\n\n  .status-modal-overlay.lion-dark .status-type-btn.selected {\n    background: var(--lion-primary);\n    border-color: var(--lion-primary);\n    color: white;\n  }\n\n  .status-modal-overlay.lion-dark .status-view-btn {\n    background: var(--lion-bg-secondary);\n    border-color: var(--lion-border-light);\n    color: var(--lion-text-secondary);\n  }\n\n  .status-modal-overlay.lion-dark .status-view-btn.active {\n    background: var(--lion-primary);\n    border-color: var(--lion-primary);\n    color: white;\n  }\n\n  .status-modal-overlay.lion-dark .status-schedule-section {\n    background: var(--lion-bg-secondary);\n  }\n\n  .status-modal-overlay.lion-dark .status-schedule-option label {\n    color: var(--lion-text-primary);\n  }\n\n  .status-modal-overlay.lion-dark .status-schedule-datetime input {\n    background: var(--lion-bg-tertiary) !important;\n    color: var(--lion-text-primary) !important;\n    border-color: var(--lion-border-light);\n  }\n\n  .status-modal-overlay.lion-dark .status-modal-actions {\n    background: var(--lion-bg-secondary);\n    border-top-color: var(--lion-border-light);\n  }\n\n  .status-modal-overlay.lion-dark .status-list-item {\n    background: var(--lion-bg-secondary);\n    border-color: var(--lion-border-light);\n  }\n\n  .status-modal-overlay.lion-dark .status-list-name {\n    color: var(--lion-text-primary);\n  }\n\n  .status-modal-overlay.lion-dark .status-list-meta {\n    color: var(--lion-text-muted);\n  }\n\n  .status-modal-overlay.lion-dark .status-empty-title {\n    color: var(--lion-text-primary);\n  }\n\n  .status-modal-overlay.lion-dark .status-empty-text {\n    color: var(--lion-text-muted);\n  }\n\n  .status-modal-overlay.lion-dark .status-upload-area {\n    border-color: var(--lion-border-light);\n    background: var(--lion-bg-secondary);\n  }\n\n  .status-modal-overlay.lion-dark .status-upload-area:hover {\n    border-color: var(--lion-primary);\n    background: rgba(var(--lion-primary-rgb),0.05);\n  }\n\n  .status-modal-overlay.lion-dark .status-upload-btn {\n    background: var(--lion-bg-tertiary);\n  }\n\n  .status-modal-overlay.lion-dark .status-upload-text small {\n    color: var(--lion-text-muted);\n  }\n\n  .status-modal-overlay.lion-dark .status-media-preview {\n    background: var(--lion-bg-tertiary);\n  }\n\n  .status-modal-overlay.lion-dark .status-color-btn {\n    background: var(--lion-bg-secondary);\n    border-color: var(--lion-border-light);\n  }\n\n  .status-modal-overlay.lion-dark .status-color-btn-text span {\n    color: var(--lion-text-primary);\n  }\n\n  .status-modal-overlay.lion-dark .status-color-btn-text small {\n    color: var(--lion-text-muted);\n  }\n\n  .status-modal-overlay.lion-dark .status-action-btn.delete {\n    background: var(--lion-bg-tertiary);\n  }\n\n  .status-modal-overlay.lion-dark .status-action-btn.edit {\n    background: var(--lion-bg-tertiary);\n  }\n\n  .status-modal-overlay.lion-dark .status-count-label {\n    color: var(--lion-text-secondary);\n  }\n\n  .status-modal-overlay.lion-dark .status-char-counter {\n    color: var(--lion-text-muted);\n  }\n\n  /* Dark mode radio buttons and checkboxes */\n  .status-modal-overlay.lion-dark .status-schedule-option input[type="radio"],\n  .status-modal-overlay.lion-dark .status-schedule-option input[type="checkbox"] {\n    appearance: none;\n    -webkit-appearance: none;\n    width: 18px;\n    height: 18px;\n    border: 2px solid var(--lion-border-light, #4b5563);\n    background: var(--lion-bg-tertiary, #374151);\n    cursor: pointer;\n    position: relative;\n    flex-shrink: 0;\n  }\n\n  .status-modal-overlay.lion-dark .status-schedule-option input[type="radio"] {\n    border-radius: 50%;\n  }\n\n  .status-modal-overlay.lion-dark .status-schedule-option input[type="checkbox"] {\n    border-radius: 4px;\n  }\n\n  .status-modal-overlay.lion-dark .status-schedule-option input[type="radio"]:checked {\n    border-color: var(--lion-primary, #7C3AED);\n    background: var(--lion-primary, #7C3AED);\n  }\n\n  .status-modal-overlay.lion-dark .status-schedule-option input[type="radio"]:checked::after {\n    content: '';\n    position: absolute;\n    top: 50%;\n    left: 50%;\n    transform: translate(-50%, -50%);\n    width: 8px;\n    height: 8px;\n    border-radius: 50%;\n    background: white;\n  }\n\n  .status-modal-overlay.lion-dark .status-schedule-option input[type="checkbox"]:checked {\n    border-color: var(--lion-primary, #7C3AED);\n    background: var(--lion-primary, #7C3AED);\n  }\n\n  .status-modal-overlay.lion-dark .status-schedule-option input[type="checkbox"]:checked::after {\n    content: '';\n    position: absolute;\n    top: 50%;\n    left: 50%;\n    transform: translate(-50%, -50%) rotate(45deg);\n    width: 4px;\n    height: 8px;\n    border: solid white;\n    border-width: 0 2px 2px 0;\n    margin-top: -1px;\n  }\n\n  .status-modal-overlay.lion-dark .status-schedule-option input[type="radio"]:hover,\n  .status-modal-overlay.lion-dark .status-schedule-option input[type="checkbox"]:hover {\n    border-color: var(--lion-primary, #7C3AED);\n  }\n\n`,tr=({isOpen:e,onClose:t})=>{const[n,r]=(0,a.useState)("list"),[o,i]=(0,a.useState)([]),[,l]=(0,a.useState)(0),[c,d]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{const e=()=>{const e=_();d("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]);const[m,p]=(0,a.useState)("text"),[u,g]=(0,a.useState)(""),[h,b]=(0,a.useState)(""),[f,v]=(0,a.useState)(Xa[0].value),[y,x]=(0,a.useState)(null),[w,k]=(0,a.useState)(""),[E,S]=(0,a.useState)(""),[C,T]=(0,a.useState)(!1),[D,N]=(0,a.useState)(!1),[M,R]=(0,a.useState)(""),[B,P]=(0,a.useState)(""),[L,U]=(0,a.useState)(!1),[F,z]=(0,a.useState)(!1),[O,W]=(0,a.useState)([]),q=(0,a.useRef)(null),H=(0,a.useRef)(null),j=(0,a.useCallback)(()=>{z(!0),window.postMessage({type:"GET_MY_WHATSAPP_STATUSES"},"*");const e=t=>{"GET_MY_WHATSAPP_STATUSES_RESPONSE"===t.data?.type&&(window.removeEventListener("message",e),z(!1),t.data.payload?.success&&t.data.payload.statuses&&W(t.data.payload.statuses))};window.addEventListener("message",e),setTimeout(()=>{window.removeEventListener("message",e),z(!1)},1e4)},[]);(0,a.useEffect)(()=>{e&&(i(Qa()),j())},[e,j]),(0,a.useEffect)(()=>{if(!e)return;const t=e=>{if(e.key===Ja&&e.newValue)try{const t=JSON.parse(e.newValue);i(t)}catch(e){}},n=()=>{i(Qa())};return window.addEventListener("storage",t),window.addEventListener("statusItemsUpdated",n),()=>{window.removeEventListener("storage",t),window.removeEventListener("statusItemsUpdated",n)}},[e]),(0,a.useEffect)(()=>{const e=()=>l(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]);const V=(0,a.useCallback)(()=>{g(""),b(""),v(Xa[0].value),x(null),k(""),S(""),T(!1),N(!1),R(""),P("")},[]),G=()=>{x(null),k(""),q.current&&(q.current.value="")},K=async e=>{U(!0);try{window.postMessage({type:"POST_WHATSAPP_STATUS",payload:{statusId:e.id,type:e.type,content:e.content,caption:e.caption,backgroundColor:e.backgroundColor}},"*");const t=await new Promise(t=>{const n=a=>{"POST_WHATSAPP_STATUS_RESPONSE"===a.data?.type&&a.data?.payload?.statusId===e.id&&(window.removeEventListener("message",n),t(a.data.payload))};window.addEventListener("message",n),setTimeout(()=>{window.removeEventListener("message",n),t({success:!1,error:"Timeout"})},3e4)}),n=o.map(n=>n.id===e.id?{...n,status:t.success?"posted":"failed",lastPostedAt:t.success?Date.now():void 0}:n);if(i(n),Za(n),t.success&&t.newStatusDetails){const n={id:t.newStatusDetails.id||e.id,type:t.newStatusDetails.type||e.type,content:t.newStatusDetails.content||e.content,backgroundColor:t.newStatusDetails.backgroundColor||e.backgroundColor,caption:t.newStatusDetails.caption,createdAt:t.newStatusDetails.createdAt||Date.now(),status:"posted",isFromWhatsApp:!0};W(e=>[n,...e])}else t.success&&setTimeout(()=>{j()},3e3)}catch(e){}finally{U(!1)}},$=e=>{const t=o.filter(t=>t.id!==e);i(t);Za(t)},Y=e=>new Date(e).toLocaleDateString((0,s.UK)(),{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"});return e?a.createElement(a.Fragment,null,a.createElement("style",null,er),a.createElement("div",{className:"status-modal-overlay "+(c?"lion-dark":""),onClick:t},a.createElement("div",{className:"status-modal",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"status-modal-header"},a.createElement("div",{className:"status-modal-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("path",{d:"M12 6v6l4 2"})),(0,s.t)("status.title")||"Status"),a.createElement("button",{className:"status-close-btn",onClick:t},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 6L6 18M6 6l12 12"})))),a.createElement("div",{className:"status-modal-content"},a.createElement("div",{className:"status-sidebar"},a.createElement("div",{className:"status-sidebar-item "+("create"===n?"active":""),onClick:()=>r("create")},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"})),(0,s.t)("status.createStatus")||"Create Status"),a.createElement("div",{className:"status-sidebar-item "+("list"===n?"active":""),onClick:()=>r("list")},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),a.createElement("polyline",{points:"14 2 14 8 20 8"}),a.createElement("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),a.createElement("line",{x1:"16",y1:"17",x2:"8",y2:"17"})),(0,s.t)("status.activeStatus")||"Active Statuses",a.createElement("span",{className:"status-sidebar-count"},O.length))),a.createElement("div",{className:"status-main-panel"},"list"===n?a.createElement(a.Fragment,null,F&&a.createElement("div",{className:"status-loading"},a.createElement("div",{className:"status-loading-spinner"}),a.createElement("span",null,(0,s.t)("status.loading")||"Loading statuses...")),F||0!==o.length||0!==O.length?!F&&a.createElement(a.Fragment,null,a.createElement("div",{className:"status-list-header"},a.createElement("div",{className:"status-count"},a.createElement("span",{className:"status-count-number"},O.length),a.createElement("span",{className:"status-count-label"},(0,s.t)("status.activeStatus")," (WhatsApp)")),a.createElement("button",{className:"status-add-btn-small",onClick:()=>r("create"),title:(0,s.t)("status.add")},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M12 5v14M5 12h14"})))),a.createElement("div",{className:"status-list"},0===O.length&&a.createElement("div",{style:{padding:"16px",textAlign:"center",color:"var(--lion-text-muted)",fontSize:"13px"}},(0,s.t)("status.noWhatsAppStatus")||"No active WhatsApp status"),O.map(e=>a.createElement("div",{key:e.id,className:"status-list-item whatsapp-status"},a.createElement("div",{className:"status-list-preview",style:{backgroundColor:"text"===e.type&&e.backgroundColor||ca.sidebarStart}},"text"===e.type?a.createElement("span",{style:{fontSize:"12px"}},(e.content||"").substring(0,20)):"image"===e.type&&e.thumbnail?a.createElement("img",{src:e.thumbnail,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):"image"===e.type?a.createElement("svg",{viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),a.createElement("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),a.createElement("path",{d:"M21 15l-5-5L5 21"})):"video"===e.type&&e.thumbnail?a.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},a.createElement("img",{src:e.thumbnail,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}),a.createElement("svg",{viewBox:"0 0 24 24",fill:"white",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.5))"}},a.createElement("path",{d:"M8 5v14l11-7z"}))):"video"===e.type?a.createElement("svg",{viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M8 5v14l11-7z"})):a.createElement("svg",{viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"}))),a.createElement("div",{className:"status-list-info"},a.createElement("div",{className:"status-list-name"},"text"===e.type?(e.content||"").substring(0,30):(0,s.t)(`status.type.${e.type}`)),a.createElement("div",{className:"status-list-meta"},a.createElement("span",{className:"status-list-badge posted"},a.createElement("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"currentColor",style:{marginRight:"4px"}},a.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),(0,s.t)("status.status.posted")),a.createElement("span",null,Y(e.createdAt))))))),o.length>0&&a.createElement(a.Fragment,null,a.createElement("div",{className:"status-list-header",style:{marginTop:"20px"}},a.createElement("div",{className:"status-count"},a.createElement("span",{className:"status-count-number"},o.length),a.createElement("span",{className:"status-count-label"},(0,s.t)("status.extensionStatuses")||"Extension Statuses"))),a.createElement("div",{className:"status-list"},o.map(e=>a.createElement("div",{key:e.id,className:"status-list-item"},a.createElement("div",{className:"status-list-preview",style:{backgroundColor:"text"===e.type?e.backgroundColor:ca.sidebarStart}},"text"===e.type?a.createElement("span",{style:{fontSize:"12px"}},e.content.substring(0,20)):"image"===e.type?a.createElement("img",{src:e.content,alt:""}):"video"===e.type?a.createElement("svg",{viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M8 5v14l11-7z"})):a.createElement("svg",{viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z"}))),a.createElement("div",{className:"status-list-info"},a.createElement("div",{className:"status-list-name"},e.name||(0,s.t)(`status.type.${e.type}`)),a.createElement("div",{className:"status-list-meta"},a.createElement("span",{className:`status-list-badge ${e.status}`},(0,s.t)(`status.status.${e.status}`)),e.autoRepost&&a.createElement("span",{className:"status-list-badge auto-repost"},(0,s.t)("status.autoRepost")),"scheduled"===e.status&&e.scheduledAt?a.createElement("span",{style:{color:"var(--lion-primary)",fontWeight:500}},"📅 ",Y(e.scheduledAt)):a.createElement("span",null,Y(e.createdAt)))),a.createElement("div",{className:"status-list-actions"},"posted"!==e.status&&a.createElement("button",{className:"status-action-btn post",onClick:()=>K(e),disabled:L,title:(0,s.t)("status.postNow")},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"}))),a.createElement("button",{className:"status-action-btn edit",onClick:()=>(e=>{if(g(e.name||""),p(e.type),b("text"===e.type?e.content:""),v(e.backgroundColor||Xa[0].value),"text"!==e.type&&e.content&&k(e.content),S(e.caption||""),T(!!e.scheduledAt),N(e.autoRepost||!1),e.scheduledAt){const t=new Date(e.scheduledAt);R(t.toISOString().split("T")[0]),P(t.toTimeString().slice(0,5))}$(e.id),r("create")})(e),title:(0,s.t)("status.edit")||"Edit"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"}))),a.createElement("button",{className:"status-action-btn delete",onClick:()=>$(e.id),title:(0,s.t)("status.delete")},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"}))))))))):a.createElement("div",{className:"status-empty-state"},a.createElement("svg",{className:"status-empty-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("path",{d:"M8 14s1.5 2 4 2 4-2 4-2"}),a.createElement("line",{x1:"9",y1:"9",x2:"9.01",y2:"9"}),a.createElement("line",{x1:"15",y1:"9",x2:"15.01",y2:"9"})),a.createElement("div",{className:"status-empty-title"},(0,s.t)("status.noStatusFound")),a.createElement("div",{className:"status-empty-text"},(0,s.t)("status.noStatusDescriptionSidebar")||'Click "Create Status" from the sidebar to add a new status.'))):a.createElement("div",{className:"status-form"},a.createElement("div",{className:"status-form-group"},a.createElement("label",{className:"status-form-label"},(0,s.t)("status.statusName")),a.createElement("input",{type:"text",className:"status-form-input",placeholder:(0,s.t)("status.statusNamePlaceholder"),value:u,onChange:e=>g(e.target.value)})),a.createElement("div",{className:"status-form-group"},a.createElement("label",{className:"status-form-label"},(0,s.t)("status.chooseType")),a.createElement("div",{className:"status-type-selector"},a.createElement("button",{className:"status-type-btn "+("text"===m?"selected":""),onClick:()=>{p("text"),G()}},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M4 7V4h16v3M9 20h6M12 4v16"})),a.createElement("span",null,(0,s.t)("status.type.text"))),a.createElement("button",{className:"status-type-btn "+("image"===m?"selected":""),onClick:()=>{p("image"),G()}},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),a.createElement("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),a.createElement("path",{d:"M21 15l-5-5L5 21"})),a.createElement("span",null,(0,s.t)("status.type.image"))),a.createElement("button",{className:"status-type-btn "+("video"===m?"selected":""),onClick:()=>{p("video"),G()}},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),a.createElement("path",{d:"M10 9l5 3-5 3V9z"})),a.createElement("span",null,(0,s.t)("status.type.video"))))),"text"===m&&a.createElement(a.Fragment,null,a.createElement("div",{className:"status-form-group"},a.createElement("textarea",{className:"status-form-input status-text-area",placeholder:(0,s.t)("status.typeText"),value:h,onChange:e=>b(e.target.value),maxLength:700}),a.createElement("div",{className:"status-char-counter",style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},a.createElement(Qn,{text:h,onRegenerate:e=>b(e),size:"small",variant:"toolbar",language:Xn()}),a.createElement("div",null,a.createElement("span",{className:h.length>650?"warning":""},h.length),a.createElement("span",{className:"status-char-max"},"/ 700")))),h&&a.createElement("div",{className:"status-text-preview",style:{backgroundColor:f}},h),a.createElement("div",{className:"status-form-group"},a.createElement("label",{className:"status-form-label"},(0,s.t)("status.backgroundColor")||"Background Color"),a.createElement("div",{className:"status-color-picker-row"},a.createElement("button",{type:"button",className:"status-color-btn",onClick:()=>H.current?.click()},a.createElement("div",{className:"status-color-preview",style:{backgroundColor:f}}),a.createElement("div",{className:"status-color-btn-text"},a.createElement("span",null,(e=>{const t=Xa.find(t=>t.value.toLowerCase()===e.toLowerCase());if(t)return t.name;if(e.startsWith("#"))return e.toUpperCase();if(e.startsWith("var(")){const t=e.match(/--lion-(\w+)/);if(t)return t[1].charAt(0).toUpperCase()+t[1].slice(1)}return"Custom"})(f)),a.createElement("small",null,(0,s.t)("status.clickToChange")||"Click to change color")),a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z"}))),a.createElement("input",{ref:H,type:"color",className:"status-color-input",value:f,onChange:e=>v(e.target.value)})))),"text"!==m&&a.createElement("div",{className:"status-media-upload"},w?a.createElement("div",{className:"status-media-preview"},"image"===m&&a.createElement("img",{src:w,alt:"Preview"}),"video"===m&&a.createElement("video",{src:w,controls:!0}),"audio"===m&&a.createElement("audio",{src:w,controls:!0}),a.createElement("button",{className:"status-media-remove",onClick:G},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 6L6 18M6 6l12 12"})))):a.createElement("div",{className:"status-upload-area",onClick:()=>q.current?.click()},a.createElement("div",{className:"status-upload-btn"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"}),a.createElement("polyline",{points:"17 8 12 3 7 8"}),a.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"15"}))),a.createElement("div",{className:"status-upload-text"},a.createElement("span",null,(0,s.t)("status.import")),a.createElement("small",null,(0,s.t)("status.dragHere"))),a.createElement("input",{ref:q,type:"file",className:"status-upload-input",accept:(()=>{switch(m){case"image":return"image/*";case"video":return"video/*";case"audio":return"audio/*";default:return""}})(),onChange:e=>{const t=e.target.files?.[0];if(t){x(t);const e=new FileReader;e.onload=()=>{k(e.result)},e.readAsDataURL(t)}}})),("image"===m||"video"===m)&&w&&a.createElement("div",{className:"status-form-group",style:{marginTop:"12px"}},a.createElement("label",{className:"status-form-label"},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginRight:"6px",verticalAlign:"middle"}},a.createElement("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})),(0,s.t)("status.caption")||"Caption (Optional)"),a.createElement("textarea",{className:"status-form-input status-caption-area",placeholder:(0,s.t)("status.captionPlaceholder")||"Add a caption to your status...",value:E,onChange:e=>S(e.target.value),maxLength:700,rows:3}),a.createElement("div",{className:"status-char-counter",style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},a.createElement(Qn,{text:E,onRegenerate:e=>S(e),size:"small",variant:"toolbar",language:Xn()}),a.createElement("div",null,a.createElement("span",{className:E.length>650?"warning":""},E.length),a.createElement("span",{className:"status-char-max"},"/ 700"))))),a.createElement("div",{className:"status-schedule-section"},a.createElement("div",{className:"status-schedule-option"},a.createElement("input",{type:"radio",id:"schedule-no",name:"schedule",checked:!C,onChange:()=>T(!1)}),a.createElement("label",{htmlFor:"schedule-no"},(0,s.t)("status.postNow"))),a.createElement("div",{className:"status-schedule-option"},a.createElement("input",{type:"radio",id:"schedule-yes",name:"schedule",checked:C,onChange:()=>T(!0)}),a.createElement("label",{htmlFor:"schedule-yes"},(0,s.t)("status.scheduleStatus"))),C&&a.createElement("div",{className:"status-schedule-datetime"},a.createElement("input",{type:"date",value:M,onChange:e=>R(e.target.value),min:(new Date).toISOString().split("T")[0]}),a.createElement("input",{type:"time",value:B,onChange:e=>P(e.target.value)})),a.createElement("div",{className:"status-schedule-option",style:{marginTop:"8px"}},a.createElement("input",{type:"checkbox",id:"auto-repost",checked:D,onChange:e=>N(e.target.checked)}),a.createElement("label",{htmlFor:"auto-repost"},(0,s.t)("status.autoRepost24h"))))),"create"===n&&a.createElement("div",{className:"status-modal-actions"},a.createElement("button",{className:"status-btn cancel",onClick:()=>{V(),r("list")}},(0,s.t)("common.cancel")),a.createElement("button",{className:"status-btn create",onClick:async()=>{let e="";if("text"===m){if(!h.trim())return;e=h}else{if(!w)return;e=w}const t={id:`status-${Date.now()}`,name:u||void 0,type:m,content:e,caption:("image"===m||"video"===m)&&E||void 0,backgroundColor:"text"===m?f:void 0,scheduledAt:C&&M&&B?new Date(`${M}T${B}`).getTime():void 0,autoRepost:D,createdAt:Date.now(),status:C?"scheduled":"pending"},n=[t,...o];i(n);Za(n)?(C||await K(t),V(),r("list")):i(o)},disabled:"text"===m&&!h.trim()||"text"!==m&&!w||L},L?(0,s.t)("status.posting"):(0,s.t)("status.create")))))))):null},nr="webhook_settings",ar=e=>{const t=[{id:"event_details",label:(0,s.t)("webhook.field.eventDetails"),enabled:!0},{id:"number",label:(0,s.t)("webhook.field.number"),enabled:!0},{id:"name",label:(0,s.t)("webhook.field.name"),enabled:!0},{id:"picture",label:(0,s.t)("webhook.field.picture"),enabled:!1},{id:"labels",label:(0,s.t)("webhook.field.labels"),enabled:!1},{id:"contact_profile",label:(0,s.t)("webhook.field.contactProfile"),enabled:!1}];switch(e){case"appointment":return[{id:"event_details",label:(0,s.t)("webhook.field.eventDetails"),enabled:!0},{id:"number",label:(0,s.t)("webhook.field.number"),enabled:!0},{id:"name",label:(0,s.t)("webhook.field.name"),enabled:!0},{id:"appointment_time",label:(0,s.t)("webhook.field.appointmentTime"),enabled:!0},{id:"meeting_link",label:(0,s.t)("webhook.field.meetingLink"),enabled:!1},{id:"contact_profile",label:(0,s.t)("webhook.field.contactProfile"),enabled:!1}];case"reminder":return[{id:"event_details",label:(0,s.t)("webhook.field.eventDetails"),enabled:!0},{id:"number",label:(0,s.t)("webhook.field.number"),enabled:!0},{id:"name",label:(0,s.t)("webhook.field.name"),enabled:!0},{id:"reminder_topic",label:(0,s.t)("webhook.field.reminderTopic"),enabled:!0},{id:"reminder_time",label:(0,s.t)("webhook.field.reminderTime"),enabled:!0},{id:"reminder_details",label:(0,s.t)("webhook.field.reminderDetails"),enabled:!1},{id:"contact_profile",label:(0,s.t)("webhook.field.contactProfile"),enabled:!1}];case"todos":return[{id:"event_details",label:(0,s.t)("webhook.field.eventDetails"),enabled:!0},{id:"todo_title",label:(0,s.t)("webhook.field.todoTitle")||"Task Title",enabled:!0},{id:"todo_description",label:(0,s.t)("webhook.field.todoDescription")||"Task Description",enabled:!0},{id:"todo_due_date",label:(0,s.t)("webhook.field.todoDueDate")||"Due Date",enabled:!0},{id:"todo_priority",label:(0,s.t)("webhook.field.todoPriority")||"Priority",enabled:!0},{id:"todo_category",label:(0,s.t)("webhook.field.todoCategory")||"Category",enabled:!0},{id:"todo_status",label:(0,s.t)("webhook.field.todoStatus")||"Status",enabled:!0},{id:"todo_subtasks",label:(0,s.t)("webhook.field.todoSubtasks")||"Subtasks",enabled:!1}];case"contact_profile":return[{id:"event_details",label:(0,s.t)("webhook.field.eventDetails"),enabled:!0},{id:"number",label:(0,s.t)("webhook.field.number"),enabled:!0},{id:"name",label:(0,s.t)("webhook.field.name"),enabled:!0},{id:"email",label:(0,s.t)("webhook.field.email"),enabled:!0},{id:"gender",label:(0,s.t)("webhook.field.gender"),enabled:!1},{id:"date_of_birth",label:(0,s.t)("webhook.field.dateOfBirth"),enabled:!1},{id:"address",label:(0,s.t)("webhook.field.address"),enabled:!1},{id:"details",label:(0,s.t)("webhook.field.details"),enabled:!1},{id:"custom_fields",label:(0,s.t)("webhook.field.customFields"),enabled:!0}];case"notes":return[{id:"event_details",label:(0,s.t)("webhook.field.eventDetails"),enabled:!0},{id:"number",label:(0,s.t)("webhook.field.number"),enabled:!0},{id:"name",label:(0,s.t)("webhook.field.name"),enabled:!0},{id:"note_topic",label:(0,s.t)("webhook.field.noteTopic"),enabled:!0},{id:"note_content",label:(0,s.t)("webhook.field.noteContent"),enabled:!0},{id:"note_timestamp",label:(0,s.t)("webhook.field.noteTimestamp"),enabled:!1},{id:"contact_profile",label:(0,s.t)("webhook.field.contactProfile"),enabled:!1}];case"income":return[{id:"event_details",label:(0,s.t)("webhook.field.eventDetails"),enabled:!0},{id:"number",label:(0,s.t)("webhook.field.number"),enabled:!0},{id:"name",label:(0,s.t)("webhook.field.name"),enabled:!0},{id:"amount",label:(0,s.t)("webhook.field.amount"),enabled:!0},{id:"category",label:(0,s.t)("webhook.field.category"),enabled:!0},{id:"payment_method",label:(0,s.t)("webhook.field.paymentMethod"),enabled:!0},{id:"description",label:(0,s.t)("webhook.field.description"),enabled:!1},{id:"reference",label:(0,s.t)("webhook.field.reference"),enabled:!1},{id:"transaction_date",label:(0,s.t)("webhook.field.transactionDate"),enabled:!0},{id:"status",label:(0,s.t)("webhook.field.status"),enabled:!0},{id:"contact_profile",label:(0,s.t)("webhook.field.contactProfile"),enabled:!1}];case"expense":return[{id:"event_details",label:(0,s.t)("webhook.field.eventDetails"),enabled:!0},{id:"number",label:(0,s.t)("webhook.field.number"),enabled:!0},{id:"name",label:(0,s.t)("webhook.field.name"),enabled:!0},{id:"amount",label:(0,s.t)("webhook.field.amount"),enabled:!0},{id:"category",label:(0,s.t)("webhook.field.category"),enabled:!0},{id:"payment_method",label:(0,s.t)("webhook.field.paymentMethod"),enabled:!0},{id:"description",label:(0,s.t)("webhook.field.description"),enabled:!1},{id:"reference",label:(0,s.t)("webhook.field.referenceBill"),enabled:!1},{id:"transaction_date",label:(0,s.t)("webhook.field.transactionDate"),enabled:!0},{id:"status",label:(0,s.t)("webhook.field.status"),enabled:!0},{id:"contact_profile",label:(0,s.t)("webhook.field.contactProfile"),enabled:!1}];case"kanban":return[{id:"event_details",label:(0,s.t)("webhook.field.eventDetails"),enabled:!0},{id:"number",label:(0,s.t)("webhook.field.number"),enabled:!0},{id:"name",label:(0,s.t)("webhook.field.name"),enabled:!0},{id:"card_title",label:(0,s.t)("webhook.field.cardTitle"),enabled:!0},{id:"column_name",label:(0,s.t)("webhook.field.columnName"),enabled:!0},{id:"card_description",label:(0,s.t)("webhook.field.cardDescription"),enabled:!1},{id:"contact_profile",label:(0,s.t)("webhook.field.contactProfile"),enabled:!1}];case"labels":return[{id:"event_details",label:(0,s.t)("webhook.field.eventDetails"),enabled:!0},{id:"number",label:(0,s.t)("webhook.field.number"),enabled:!0},{id:"name",label:(0,s.t)("webhook.field.name"),enabled:!0},{id:"label_id",label:(0,s.t)("webhook.field.labelId"),enabled:!0},{id:"label_name",label:(0,s.t)("webhook.field.labelName"),enabled:!0},{id:"label_color",label:(0,s.t)("webhook.field.labelColor"),enabled:!1},{id:"all_labels",label:(0,s.t)("webhook.field.allLabels"),enabled:!1},{id:"contact_profile",label:(0,s.t)("webhook.field.contactProfile"),enabled:!1}];case"custom_tabs":return[{id:"event_details",label:(0,s.t)("webhook.field.eventDetails"),enabled:!0},{id:"number",label:(0,s.t)("webhook.field.number"),enabled:!0},{id:"name",label:(0,s.t)("webhook.field.name"),enabled:!0},{id:"tab_id",label:(0,s.t)("webhook.field.tabId"),enabled:!0},{id:"tab_name",label:(0,s.t)("webhook.field.tabName"),enabled:!0},{id:"tab_color",label:(0,s.t)("webhook.field.tabColor"),enabled:!1},{id:"all_tabs",label:(0,s.t)("webhook.field.allTabs"),enabled:!1},{id:"contact_profile",label:(0,s.t)("webhook.field.contactProfile"),enabled:!1}];case"messages":return[{id:"event_details",label:(0,s.t)("webhook.field.eventDetails"),enabled:!0},{id:"direction",label:(0,s.t)("webhook.field.direction"),enabled:!0},{id:"number",label:(0,s.t)("webhook.field.number"),enabled:!0},{id:"name",label:(0,s.t)("webhook.field.name"),enabled:!0},{id:"message_content",label:(0,s.t)("webhook.field.messageContent"),enabled:!0},{id:"message_type",label:(0,s.t)("webhook.field.messageType"),enabled:!0},{id:"message_id",label:(0,s.t)("webhook.field.messageId"),enabled:!1},{id:"media_url",label:(0,s.t)("webhook.field.mediaUrl"),enabled:!1},{id:"quoted_message",label:(0,s.t)("webhook.field.quotedMessage"),enabled:!1},{id:"timestamp",label:(0,s.t)("webhook.field.timestamp"),enabled:!0},{id:"ctwa_data",label:(0,s.t)("webhook.field.ctwaData"),enabled:!0},{id:"contact_profile",label:(0,s.t)("webhook.field.contactProfile"),enabled:!1}];default:return t}},rr=[{id:"zapier",name:"Zapier",color:"#7C3AED"},{id:"bitrix24",name:"Bitrix24",color:"#2fc7f7"},{id:"chatgpt",name:"ChatGPT",color:"#10a37f"},{id:"erp",name:"ERP",color:"#7C3AED"},{id:"hubspot",name:"HubSpot",color:"#0ea5e9"},{id:"n8n",name:"n8n",color:"#ea4b71"},{id:"pipedrive",name:"Pipedrive",color:"#1a1a1a"},{id:"sheets",name:"Google Sheets",color:"#34a853"},{id:"make",name:"Make",color:"#6d28d9"}],or=({isOpen:e,onClose:t})=>{const[n,r]=(0,a.useState)("quick_response"),[o,i]=(0,a.useState)({}),[l,c]=(0,a.useState)(!1),[d,m]=(0,a.useState)(!1),[,p]=(0,a.useState)(0),[u,g]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{const e=()=>{const e=_();g("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]),(0,a.useEffect)(()=>{const e=()=>{p(e=>e+1)};return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{e&&h()},[e]);const h=()=>{try{const e=localStorage.getItem(nr);e&&i(JSON.parse(e))}catch(e){}},b=e=>{if(o[e]){const t=o[e],n=ar(e),a=t.dataFields?.map(e=>e.id)||[],r=n.map(e=>e.id);let i=!1;if("custom_tabs"===e)i=!a.includes("tab_id")||!a.includes("tab_name");else if("labels"===e)i=!a.includes("label_id")||!a.includes("label_name");else if("messages"===e)i=!a.includes("direction")||!a.includes("message_type");else if("todos"===e)i=!a.includes("todo_title")||!a.includes("todo_priority");else{i=r.filter(e=>a.includes(e)).length<r.length/2}return i||0===t.dataFields?.length?{...t,dataFields:n}:t}return{url:"",active:!1,dataFields:ar(e),lastUploads:[]}},f=(e,t)=>{const n=b(e);i(a=>({...a,[e]:{...n,...t}}))},v=[{id:"quick_response",label:(0,s.t)("webhook.quickResponses")||"Quick Responses",icon:"quick"},{id:"appointment",label:(0,s.t)("webhook.appointment")||"Appointment",icon:"appointment"},{id:"reminder",label:(0,s.t)("webhook.reminder")||"Reminder",icon:"reminder"},{id:"todos",label:(0,s.t)("webhook.todos")||"Todo List",icon:"todos"},{id:"contact_profile",label:(0,s.t)("webhook.contactProfile")||"Perfil do Contato",icon:"profile"},{id:"notes",label:(0,s.t)("webhook.notes")||"Notes",icon:"notes"},{id:"income",label:(0,s.t)("webhook.income")||"Income",icon:"income"},{id:"expense",label:(0,s.t)("webhook.expense")||"Expense",icon:"expense"},{id:"kanban",label:(0,s.t)("webhook.kanban")||"Kanban",icon:"kanban"},{id:"labels",label:(0,s.t)("webhook.labels")||"Labels",icon:"labels"},{id:"custom_tabs",label:(0,s.t)("webhook.customTabs")||"Custom Tabs",icon:"tabs"},{id:"messages",label:(0,s.t)("webhook.messages")||"Messages",icon:"messages"}],y=b(n);return e?a.createElement("div",{className:"webhook-modal-overlay "+(u?"lion-dark":""),onClick:t},a.createElement("div",{className:"webhook-modal",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"webhook-modal-header"},a.createElement("div",{className:"webhook-header-left"},a.createElement("div",{className:"webhook-header-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),a.createElement("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}))),a.createElement("div",{className:"webhook-header-text"},a.createElement("h2",null,(0,s.t)("webhook.title")||"WebHooks"),a.createElement("p",null,(0,s.t)("webhook.subtitle")||"Envie dados de contatos para outra aplicação após a execução de eventos registrados"))),a.createElement("button",{className:"webhook-close-btn",onClick:t,"aria-label":"Close"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),a.createElement("div",{className:"webhook-integrations"},rr.map(e=>a.createElement("div",{key:e.id,className:"webhook-integration-icon",title:e.name},a.createElement("div",{className:"integration-circle",style:{backgroundColor:`${e.color}15`,borderColor:`${e.color}30`}},"zapier"===e.id&&a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:e.color,d:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"})),"bitrix24"===e.id&&a.createElement("span",{style:{color:e.color,fontWeight:"bold",fontSize:"10px"}},"Bitrix",a.createElement("br",null),"24"),"chatgpt"===e.id&&a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:e.color,d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073z"})),"erp"===e.id&&a.createElement("span",{style:{color:e.color,fontWeight:"bold",fontSize:"12px",border:`2px solid ${e.color}`,borderRadius:"50%",padding:"2px 6px"}},"ERP"),"hubspot"===e.id&&a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:e.color,d:"M18.164 7.93V5.084a2.198 2.198 0 001.267-1.984v-.066A2.198 2.198 0 0017.233.836h-.066a2.198 2.198 0 00-2.198 2.198v.066c0 .907.55 1.685 1.334 2.02v2.81a6.004 6.004 0 00-3.254 1.594l-8.652-6.73a2.54 2.54 0 00.082-.635A2.542 2.542 0 001.937-.383a2.542 2.542 0 00-2.542 2.542 2.542 2.542 0 002.542 2.542c.48 0 .927-.135 1.31-.365l8.503 6.614a6.027 6.027 0 00-.058 7.047l-2.502 2.503a2.08 2.08 0 00-.617-.095 2.1 2.1 0 00-2.1 2.1 2.1 2.1 0 002.1 2.1 2.1 2.1 0 002.1-2.1c0-.22-.035-.432-.095-.633l2.468-2.468a6.02 6.02 0 103.118-11.474z"})),"n8n"===e.id&&a.createElement("span",{style:{color:e.color,fontWeight:"bold",fontSize:"14px"}},"n8n"),"pipedrive"===e.id&&a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("circle",{cx:"12",cy:"12",r:"10",fill:e.color}),a.createElement("text",{x:"12",y:"16",textAnchor:"middle",fill:"white",fontSize:"10",fontWeight:"bold"},"P")),"sheets"===e.id&&a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:e.color,d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7zm4-8h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6z"})),"make"===e.id&&a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("circle",{cx:"12",cy:"12",r:"10",fill:e.color}),a.createElement("path",{fill:"white",d:"M8 8h8v8H8z"})))))),a.createElement("div",{className:"webhook-content"},a.createElement("div",{className:"webhook-sidebar"},a.createElement("div",{className:"webhook-sidebar-title"},(0,s.t)("webhook.events")||"events"),a.createElement("div",{className:"webhook-event-list"},v.map(e=>a.createElement("button",{key:e.id,className:"webhook-event-item "+(n===e.id?"active":""),onClick:()=>r(e.id)},e.label)))),a.createElement("div",{className:"webhook-config-panel"},a.createElement("div",{className:"webhook-config-title"},(0,s.t)("webhook.webhookData")||"WebHook Data"),a.createElement("div",{className:"webhook-url-section"},a.createElement("label",{className:"webhook-label"},(0,s.t)("webhook.webhookUrl")||"WebHook URL"),a.createElement("input",{type:"url",className:"webhook-url-input",placeholder:(0,s.t)("webhook.enterUrl")||"Enter the destination URL here",value:y.url,onChange:e=>f(n,{url:e.target.value})})),a.createElement("div",{className:"webhook-toggle-section"},a.createElement("span",{className:"webhook-toggle-label"},(0,s.t)("webhook.active")||"Active"),a.createElement("button",{className:"webhook-toggle "+(y.active?"active":""),onClick:()=>f(n,{active:!y.active})},a.createElement("div",{className:"webhook-toggle-knob"}))),a.createElement("div",{className:"webhook-data-section"},a.createElement("button",{className:"webhook-data-header",onClick:()=>c(!1)},a.createElement("span",null,(0,s.t)("webhook.dataToSend")||"Data to send"),a.createElement("svg",{className:"webhook-chevron "+(l?"":"open"),viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}))),!l&&a.createElement("div",{className:"webhook-data-fields"},y.dataFields.map(e=>a.createElement("label",{key:e.id,className:"webhook-data-field"},a.createElement("input",{type:"checkbox",checked:e.enabled,onChange:()=>(e=>{const t=b(n).dataFields.map(t=>t.id===e?{...t,enabled:!t.enabled}:t);f(n,{dataFields:t})})(e.id)}),a.createElement("span",{className:"webhook-checkbox "+(e.enabled?"checked":"")},e.enabled&&a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"}))),a.createElement("span",{className:"webhook-field-label"},e.label))))),a.createElement("div",{className:"webhook-uploads-section"},a.createElement("button",{className:"webhook-data-header",onClick:()=>c(!l)},a.createElement("span",null,(0,s.t)("webhook.lastUploads")||`Last ${y.lastUploads.length} uploads (maximum 30 views)`),a.createElement("svg",{className:"webhook-chevron "+(l?"open":""),viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}))),l&&a.createElement("div",{className:"webhook-uploads-list"},0===y.lastUploads.length?a.createElement("div",{className:"webhook-no-uploads"},(0,s.t)("webhook.noUploads")||"No uploads yet"):y.lastUploads.slice(0,30).map((e,t)=>a.createElement("div",{key:t,className:`webhook-upload-item ${e.status}`},a.createElement("span",{className:"webhook-upload-time"},new Date(e.timestamp).toLocaleString()),a.createElement("span",{className:`webhook-upload-status ${e.status}`},"success"===e.status?"✓":"✗"))))))),a.createElement("div",{className:"webhook-modal-footer"},a.createElement("button",{className:"webhook-btn-secondary",onClick:t},(0,s.t)("webhook.close")||"Close"),a.createElement("button",{className:"webhook-btn-primary",onClick:async()=>{m(!0);try{const e={...o};e[n]=b(n),localStorage.setItem(nr,JSON.stringify(e)),"undefined"!=typeof chrome&&chrome.storage&&await chrome.storage.local.set({[nr]:e}),i(e)}catch(e){}m(!1)},disabled:d},d?(0,s.t)("webhook.saving")||"Salvando...":(0,s.t)("webhook.save")||"Salvar"))),a.createElement("style",null,`\n        .webhook-modal-overlay {\n          position: fixed;\n          inset: 0;\n          background: rgba(0, 0, 0, 0.55);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 10000;\n          backdrop-filter: blur(6px);\n          -webkit-backdrop-filter: blur(6px);\n          animation: webhookOverlayFade 0.18s ease;\n        }\n\n        @keyframes webhookOverlayFade {\n          from { opacity: 0; }\n          to { opacity: 1; }\n        }\n\n        @keyframes webhookModalPop {\n          from { opacity: 0; transform: translateY(8px) scale(0.985); }\n          to { opacity: 1; transform: translateY(0) scale(1); }\n        }\n\n        .webhook-modal {\n          background: var(--lion-bg-primary);\n          border-radius: 16px;\n          width: 92%;\n          max-width: 920px;\n          height: 88vh;\n          max-height: 720px;\n          overflow: hidden;\n          display: flex;\n          flex-direction: column;\n          box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 8px 20px rgba(0, 0, 0, 0.08);\n          border: 1px solid var(--lion-border-light);\n          animation: webhookModalPop 0.2s ease;\n        }\n\n        .webhook-modal-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: flex-start;\n          padding: 20px 24px;\n          border-bottom: 1px solid var(--lion-border-light);\n          background: var(--lion-bg-primary);\n          flex-shrink: 0;\n        }\n\n        .webhook-header-left {\n          display: flex;\n          align-items: flex-start;\n          gap: 12px;\n          flex: 1;\n          min-width: 0;\n        }\n\n        .webhook-header-icon {\n          width: 40px;\n          height: 40px;\n          border-radius: 12px;\n          background: var(--lion-primary);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          color: #ffffff;\n          flex-shrink: 0;\n          box-shadow: 0 6px 16px rgba(var(--lion-primary-rgb), 0.28);\n        }\n\n        .webhook-header-text {\n          flex: 1;\n          min-width: 0;\n        }\n\n        .webhook-header-left h2 {\n          margin: 0 0 4px 0;\n          font-size: 20px;\n          font-weight: 700;\n          color: var(--lion-text-primary);\n          letter-spacing: -0.2px;\n        }\n\n        .webhook-header-left p {\n          margin: 0;\n          font-size: 13px;\n          color: var(--lion-text-muted);\n          line-height: 1.4;\n        }\n\n        .webhook-close-btn {\n          background: var(--lion-bg-secondary);\n          border: 1px solid var(--lion-border-light);\n          cursor: pointer;\n          color: var(--lion-text-muted);\n          width: 36px;\n          height: 36px;\n          border-radius: 10px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.15s ease;\n          flex-shrink: 0;\n          margin-left: 12px;\n        }\n\n        .webhook-close-btn svg { width: 18px; height: 18px; }\n\n        .webhook-close-btn:hover {\n          background: rgba(239, 68, 68, 0.1);\n          border-color: rgba(239, 68, 68, 0.3);\n          color: #ef4444;\n          transform: rotate(90deg);\n        }\n\n        .webhook-integrations {\n          display: flex;\n          gap: 10px;\n          padding: 14px 24px;\n          border-bottom: 1px solid var(--lion-border-light);\n          overflow-x: auto;\n          background: var(--lion-bg-secondary);\n          flex-shrink: 0;\n        }\n\n        .webhook-integrations::-webkit-scrollbar { height: 4px; }\n        .webhook-integrations::-webkit-scrollbar-thumb {\n          background: var(--lion-border-light);\n          border-radius: 4px;\n        }\n\n        .webhook-integration-icon {\n          flex-shrink: 0;\n        }\n\n        .integration-circle {\n          width: 44px;\n          height: 44px;\n          border-radius: 12px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          border: 1px solid;\n          transition: all 0.15s ease;\n          cursor: pointer;\n          background: var(--lion-bg-primary);\n        }\n\n        .integration-circle:hover {\n          transform: translateY(-2px);\n          box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);\n        }\n\n        .webhook-content {\n          display: flex;\n          flex: 1;\n          overflow: hidden;\n          min-height: 0;\n        }\n\n        .webhook-sidebar {\n          width: 220px;\n          background: var(--lion-bg-secondary);\n          border-right: 1px solid var(--lion-border-light);\n          padding: 16px 10px;\n          overflow-y: auto;\n          flex-shrink: 0;\n          display: flex;\n          flex-direction: column;\n        }\n\n        .webhook-sidebar::-webkit-scrollbar { width: 5px; }\n        .webhook-sidebar::-webkit-scrollbar-thumb {\n          background: var(--lion-border-light);\n          border-radius: 5px;\n        }\n\n        .webhook-sidebar-title {\n          padding: 4px 10px 10px;\n          font-size: 11px;\n          font-weight: 700;\n          text-transform: uppercase;\n          letter-spacing: 0.8px;\n          color: var(--lion-text-muted);\n        }\n\n        .webhook-event-list {\n          display: flex;\n          flex-direction: column;\n          gap: 2px;\n        }\n\n        .webhook-event-item {\n          background: none;\n          border: none;\n          padding: 10px 12px;\n          text-align: left;\n          cursor: pointer;\n          font-size: 13px;\n          font-weight: 500;\n          color: var(--lion-text-secondary);\n          transition: all 0.15s ease;\n          border-radius: 8px;\n          position: relative;\n        }\n\n        .webhook-event-item:hover {\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-primary);\n        }\n\n        .webhook-event-item.active {\n          background: var(--lion-primary);\n          color: #ffffff;\n          font-weight: 600;\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.3);\n        }\n\n        .webhook-config-panel {\n          flex: 1;\n          padding: 22px 26px;\n          overflow-y: auto;\n          min-width: 0;\n        }\n\n        .webhook-config-panel::-webkit-scrollbar { width: 5px; }\n        .webhook-config-panel::-webkit-scrollbar-thumb {\n          background: var(--lion-border-light);\n          border-radius: 5px;\n        }\n\n        .webhook-config-title {\n          font-size: 16px;\n          font-weight: 700;\n          color: var(--lion-text-primary);\n          margin-bottom: 18px;\n          letter-spacing: -0.1px;\n        }\n\n        .webhook-url-section {\n          margin-bottom: 18px;\n        }\n\n        .webhook-label {\n          display: block;\n          font-size: 11px;\n          font-weight: 700;\n          text-transform: uppercase;\n          letter-spacing: 0.6px;\n          color: var(--lion-text-muted);\n          margin-bottom: 8px;\n        }\n\n        .webhook-url-input {\n          width: 100%;\n          padding: 11px 14px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 10px;\n          color: var(--lion-text-primary);\n          font-size: 14px;\n          transition: all 0.15s ease;\n          box-sizing: border-box;\n        }\n\n        .webhook-url-input:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 4px rgba(var(--lion-primary-rgb), 0.12);\n        }\n\n        .webhook-url-input::placeholder {\n          color: var(--lion-text-light);\n        }\n\n        .webhook-toggle-section {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          margin-bottom: 22px;\n          padding: 12px 14px;\n          background: var(--lion-bg-secondary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 10px;\n        }\n\n        .webhook-toggle-label {\n          font-size: 13px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          flex: 1;\n        }\n\n        .webhook-toggle {\n          width: 40px;\n          height: 22px;\n          border-radius: 999px;\n          background: var(--lion-border-light);\n          border: none;\n          cursor: pointer;\n          position: relative;\n          transition: background 0.18s ease;\n          flex-shrink: 0;\n        }\n\n        .webhook-toggle.active {\n          background: var(--lion-primary);\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.15);\n        }\n\n        .webhook-toggle-knob {\n          width: 18px;\n          height: 18px;\n          border-radius: 50%;\n          background: #ffffff;\n          position: absolute;\n          top: 2px;\n          left: 2px;\n          transition: transform 0.18s ease;\n          box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);\n        }\n\n        .webhook-toggle.active .webhook-toggle-knob {\n          transform: translateX(18px);\n        }\n\n        .webhook-data-section,\n        .webhook-uploads-section {\n          margin-bottom: 14px;\n          background: var(--lion-bg-secondary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 14px;\n          overflow: hidden;\n        }\n\n        .webhook-data-header {\n          width: 100%;\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 13px 16px;\n          background: none;\n          border: none;\n          cursor: pointer;\n          font-size: 13px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          transition: background 0.15s ease;\n        }\n\n        .webhook-data-header:hover {\n          background: var(--lion-bg-primary);\n        }\n\n        .webhook-chevron {\n          transition: transform 0.18s ease;\n          color: var(--lion-text-muted);\n        }\n\n        .webhook-chevron.open {\n          transform: rotate(180deg);\n          color: var(--lion-primary);\n        }\n\n        .webhook-data-fields {\n          padding: 8px 16px 16px;\n          display: flex;\n          flex-direction: column;\n          gap: 10px;\n          border-top: 1px solid var(--lion-border-light);\n        }\n\n        .webhook-data-field {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          cursor: pointer;\n          padding: 6px 8px;\n          border-radius: 8px;\n          transition: background 0.15s ease;\n        }\n\n        .webhook-data-field:hover {\n          background: var(--lion-bg-primary);\n        }\n\n        .webhook-data-field input {\n          display: none;\n        }\n\n        .webhook-checkbox {\n          width: 20px;\n          height: 20px;\n          border-radius: 6px;\n          border: 2px solid ${ca.borderMedium||ca.borderLight};\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.15s ease;\n          flex-shrink: 0;\n          background: var(--lion-bg-primary);\n        }\n\n        .webhook-checkbox.checked {\n          background: var(--lion-primary);\n          border-color: var(--lion-primary);\n          color: #ffffff;\n          box-shadow: 0 2px 6px rgba(var(--lion-primary-rgb), 0.35);\n        }\n\n        .webhook-field-label {\n          font-size: 13px;\n          color: var(--lion-text-primary);\n          font-weight: 500;\n        }\n\n        .webhook-uploads-list {\n          padding: 8px 16px 16px;\n          border-top: 1px solid var(--lion-border-light);\n        }\n\n        .webhook-no-uploads {\n          text-align: center;\n          color: var(--lion-text-light);\n          padding: 24px 16px;\n          font-size: 13px;\n        }\n\n        .webhook-upload-item {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 10px 12px;\n          border-radius: 8px;\n          margin-bottom: 6px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .webhook-upload-time {\n          font-size: 12px;\n          color: var(--lion-text-muted);\n        }\n\n        .webhook-upload-status.success {\n          color: var(--lion-success);\n          font-weight: 700;\n        }\n\n        .webhook-upload-status.failed {\n          color: var(--lion-error);\n          font-weight: 700;\n        }\n\n        .webhook-modal-footer {\n          display: flex;\n          justify-content: flex-end;\n          gap: 10px;\n          padding: 14px 24px;\n          border-top: 1px solid var(--lion-border-light);\n          background: var(--lion-bg-secondary);\n          flex-shrink: 0;\n        }\n\n        .webhook-btn-secondary,\n        .webhook-btn-primary {\n          padding: 10px 22px;\n          border-radius: 10px;\n          font-size: 13px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.15s ease;\n          letter-spacing: 0.2px;\n        }\n\n        .webhook-btn-secondary {\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          color: var(--lion-text-primary);\n        }\n\n        .webhook-btn-secondary:hover {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-text-muted);\n        }\n\n        .webhook-btn-primary {\n          background: var(--lion-primary);\n          border: 1px solid transparent;\n          color: #ffffff;\n          box-shadow: 0 6px 16px rgba(var(--lion-primary-rgb), 0.32);\n        }\n\n        .webhook-btn-primary:hover:not(:disabled) {\n          transform: translateY(-1px);\n          box-shadow: 0 10px 22px rgba(var(--lion-primary-rgb), 0.42);\n        }\n\n        .webhook-btn-primary:active:not(:disabled) {\n          transform: translateY(0);\n        }\n\n        .webhook-btn-primary:disabled {\n          opacity: 0.6;\n          cursor: not-allowed;\n        }\n\n        /* Responsive Design */\n        @media (max-width: 768px) {\n          .webhook-modal {\n            width: 95%;\n            height: 92vh;\n            max-height: 92vh;\n          }\n\n          .webhook-content {\n            flex-direction: column;\n          }\n\n          .webhook-sidebar {\n            width: 100%;\n            border-right: none;\n            border-bottom: 1px solid var(--lion-border-light);\n            padding: 10px 10px;\n          }\n\n          .webhook-event-list {\n            flex-direction: row;\n            overflow-x: auto;\n            gap: 6px;\n          }\n\n          .webhook-event-item {\n            white-space: nowrap;\n            padding: 8px 14px;\n          }\n\n          .webhook-integrations {\n            padding: 12px 16px;\n            gap: 8px;\n          }\n\n          .integration-circle {\n            width: 40px;\n            height: 40px;\n          }\n\n          .webhook-modal-header {\n            padding: 16px;\n          }\n\n          .webhook-config-panel {\n            padding: 16px;\n          }\n        }\n\n        @media (max-width: 480px) {\n          .webhook-header-left h2 {\n            font-size: 18px;\n          }\n\n          .webhook-header-left p {\n            font-size: 12px;\n          }\n\n          .webhook-modal-footer {\n            flex-direction: column;\n          }\n\n          .webhook-btn-secondary,\n          .webhook-btn-primary {\n            width: 100%;\n          }\n        }\n\n        /* ========== DARK MODE OVERRIDES ========== */\n        .webhook-modal-overlay.lion-dark .webhook-modal {\n          background: var(--lion-bg-primary);\n          border-color: var(--lion-border-light);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-modal-header {\n          border-bottom-color: var(--lion-border-light);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-header-left h2 {\n          color: var(--lion-text-primary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-header-left p {\n          color: var(--lion-text-muted);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-close-btn {\n          color: var(--lion-text-muted);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-close-btn:hover {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-integrations {\n          border-bottom-color: var(--lion-border-light);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-sidebar {\n          background: var(--lion-bg-secondary);\n          border-right-color: var(--lion-border-light);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-sidebar-title {\n          color: var(--lion-text-muted);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-event-item {\n          color: var(--lion-text-muted);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-event-item:hover {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-event-item.active {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-event-item:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-url-input {\n          background: var(--lion-bg-secondary) !important;\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-toggle-section {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-light);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-toggle-label {\n          color: var(--lion-text-primary) !important;\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-integrations {\n          background: var(--lion-bg-secondary);\n        }\n\n        .webhook-modal-overlay.lion-dark .integration-circle {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-data-field:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-checkbox {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-close-btn {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-border-light);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-data-section,\n        .webhook-modal-overlay.lion-dark .webhook-uploads-section {\n          border-color: var(--lion-border-light);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-data-header:hover {\n          background: var(--lion-bg-primary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-btn-primary {\n          color: #ffffff !important;\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-config-panel {\n          background: var(--lion-bg-primary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-config-title {\n          color: var(--lion-text-primary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-label {\n          color: var(--lion-text-secondary) !important;\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-url-input {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n          color: var(--lion-text-primary) !important;\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-url-input::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-toggle-label {\n          color: var(--lion-text-secondary) !important;\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-toggle {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-data-section,\n        .webhook-modal-overlay.lion-dark .webhook-uploads-section {\n          background: var(--lion-bg-secondary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-data-header {\n          color: var(--lion-text-primary) !important;\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-data-header span {\n          color: var(--lion-text-primary) !important;\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-data-header:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-checkbox {\n          border-color: var(--lion-border-light);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-field-label {\n          color: var(--lion-text-primary) !important;\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-data-field {\n          color: var(--lion-text-primary) !important;\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-no-uploads {\n          color: var(--lion-text-muted);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-upload-item {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-light);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-upload-time {\n          color: var(--lion-text-muted);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-modal-footer {\n          border-top-color: var(--lion-border-light);\n          background: var(--lion-bg-secondary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-btn-secondary {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-primary);\n        }\n\n        .webhook-modal-overlay.lion-dark .webhook-btn-secondary:hover {\n          background: var(--lion-bg-primary);\n        }\n      `)):null},ir="http://127.0.0.1:8088",sr=`${ir}/api`,lr={base:ir,api:sr,validate:"",templates:"",quickReply:"",autoTrial:""},cr=[""],dr=[""],mr=["https:\/\/flowhatsapp.com.br"],pr=["https:\/\/www.youtube.com\/@FLOWhatsapp"],ur=["https:\/\/flowhatsapp.com.br\/politica-privacidade\/"],gr=e=>/^<<.*>>$/.test(e),hr=()=>lr.api,br="api_polling_settings",fr=({isOpen:e,onClose:t,phoneHash:n,licenseSignature:r})=>{const[o,i]=(0,a.useState)({hasToken:!1,apiToken:null,isEnabled:!1}),[l,c]=(0,a.useState)(!1),[d,m]=(0,a.useState)(!1),[p,u]=(0,a.useState)(null),[g,h]=(0,a.useState)(!1),[b,f]=(0,a.useState)(!1),[v,y]=(0,a.useState)(null),[x,w]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{const e=()=>{const e=_();w("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]);const k={bgPrimary:x?"#1a1a1a":ca.bgPrimary,bgSecondary:x?"#262626":ca.bgSecondary,bgTertiary:x?"#333333":ca.bgTertiary,textPrimary:x?"#ffffff":ca.textPrimary,textSecondary:x?"#e0e0e0":ca.textSecondary,textMuted:x?"#a0a0a0":ca.textMuted,textLight:x?"#888888":ca.textLight,borderLight:x?"#3a3a3a":ca.borderLight,primary:ca.primary,primaryHover:ca.primaryHover,primaryLight:x?"rgba(6, 78, 168, 0.15)":ca.primaryLight,success:ca.success,successLight:x?"rgba(16, 185, 129, 0.15)":ca.successLight,error:ca.error,errorLight:x?"rgba(239, 68, 68, 0.15)":ca.errorLight};(0,a.useEffect)(()=>{e&&n&&r&&(T(),E())},[e,n,r]);const E=async()=>{try{const e=(await chrome.storage.local.get(br))[br]||{enabled:!1,apiBaseUrl:hr()};f(e.enabled)}catch(e){}},S=async()=>{try{const e=await C("stats");e.success&&e.stats&&y({pending:e.stats.pending||0,completed:e.stats.completed||0})}catch(e){}},C=async(e,t={})=>new Promise((a,o)=>{if(!hr())return a({success:!1,error:"API FLOWhatsapp nao configurada"});const i={action:e,phone_hash:n,license_signature:r,timestamp:Math.floor(Date.now()/1e3),...t};chrome.runtime.sendMessage({action:"proxyApiCall",url:`${hr()}/api-token-simple.php`,method:"POST",headers:{"Content-Type":"application/json"},body:i},e=>{chrome.runtime.lastError?o(new Error(chrome.runtime.lastError.message)):e.success?a(e.data):o(new Error(e.error||"API call failed"))})}),T=async()=>{c(!0),u(null);try{const e=await C("get_token");e.success?i({hasToken:e.has_token,apiToken:e.api_token,isEnabled:e.is_enabled}):u(e.error||"Failed to load configuration")}catch(e){u("Failed to connect to server")}finally{c(!1)}};return e?a.createElement("div",{className:"api-config-modal-overlay "+(x?"lion-dark":""),onClick:e=>{e.target===e.currentTarget&&t()},style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.55)",backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e5,animation:"apiOverlayFade 0.18s ease"}},a.createElement("div",{className:"api-config-modal",style:{backgroundColor:k.bgPrimary,borderRadius:"16px",width:"92%",maxWidth:"720px",maxHeight:"90vh",overflow:"hidden",boxShadow:"0 24px 60px rgba(0, 0, 0, 0.25), 0 8px 20px rgba(0, 0, 0, 0.08)",border:`1px solid ${k.borderLight}`,display:"flex",flexDirection:"column",animation:"apiModalPop 0.2s ease"}},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"20px 24px",borderBottom:`1px solid ${k.borderLight}`,flexShrink:0}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"14px",flex:1,minWidth:0}},a.createElement("div",{style:{width:"42px",height:"42px",borderRadius:"12px",background:"var(--lion-primary)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:"0 6px 16px rgba(var(--lion-primary-rgb), 0.32)"}},a.createElement("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#ffffff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polyline",{points:"16 18 22 12 16 6"}),a.createElement("polyline",{points:"8 6 2 12 8 18"}))),a.createElement("div",{style:{flex:1,minWidth:0}},a.createElement("h2",{style:{margin:0,fontSize:"20px",fontWeight:700,color:k.textPrimary,letterSpacing:"-0.2px"}},(0,s.t)("api.configureAPI")||"Configure API"),a.createElement("p",{className:"api-header-subtitle",style:{margin:"4px 0 0",fontSize:"13px",color:k.textMuted,lineHeight:"1.4"}},(0,s.t)("api.manageToken")||"Manage your API token and settings"))),a.createElement("button",{className:"api-close-btn",onClick:t,"aria-label":"Close",style:{background:k.bgSecondary,border:`1px solid ${k.borderLight}`,cursor:"pointer",width:"36px",height:"36px",color:k.textMuted,borderRadius:"10px",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.15s ease",flexShrink:0,marginLeft:"12px"}},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})))),a.createElement("div",{className:"api-config-content",style:{padding:"24px 26px 8px",overflowY:"auto",flex:1}},p&&a.createElement("div",{style:{backgroundColor:k.errorLight,border:`1px solid ${k.error}30`,borderRadius:"10px",padding:"14px 18px",marginBottom:"24px",color:k.error,fontSize:"14px",display:"flex",alignItems:"center",gap:"10px"}},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none"},a.createElement("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),a.createElement("path",{d:"M12 8v4M12 16h.01",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})),p),a.createElement("div",{style:{marginBottom:"22px"}},a.createElement("label",{className:"api-field-label",style:{display:"block",fontSize:"11px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.6px",color:k.textMuted,marginBottom:"8px"}},(0,s.t)("api.apiToken")||"API Token"),a.createElement("div",{style:{display:"flex",gap:"10px"}},a.createElement("div",{className:"api-token-input-wrap",style:{flex:1,display:"flex",alignItems:"center",backgroundColor:k.bgSecondary,border:`1px solid ${k.borderLight}`,borderRadius:"10px",padding:"0 14px",height:"44px",transition:"all 0.15s ease"}},a.createElement("input",{type:"text",value:o.apiToken||"",readOnly:!0,placeholder:l?"Loading...":"Generate a token to get started",style:{flex:1,background:"none",border:"none",outline:"none",color:k.textPrimary,fontSize:"14px",fontFamily:"monospace"}}),o.apiToken&&a.createElement("button",{onClick:async()=>{if(o.apiToken)try{await navigator.clipboard.writeText(o.apiToken),m(!0),setTimeout(()=>m(!1),2e3)}catch(e){}},title:(0,s.t)("api.copyToken")||"Copy token",style:{background:"none",border:"none",cursor:"pointer",padding:"6px",color:d?k.success:k.textMuted,display:"flex",alignItems:"center",borderRadius:"6px",transition:"background 0.2s"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=k.borderLight},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},d?a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})):a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none"},a.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",stroke:"currentColor",strokeWidth:"2"}),a.createElement("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1",stroke:"currentColor",strokeWidth:"2"})))),a.createElement("button",{className:"api-regen-btn",onClick:async()=>{h(!0),u(null);try{const e=await C("generate_token");e.success?i({hasToken:!0,apiToken:e.api_token,isEnabled:e.is_enabled}):u(e.error||"Failed to generate token")}catch(e){u("Failed to generate token")}finally{h(!1)}},disabled:g||l,style:{padding:"0 22px",height:"44px",background:"var(--lion-primary)",color:"#fff",border:"1px solid transparent",borderRadius:"10px",fontSize:"13px",fontWeight:600,cursor:g||l?"not-allowed":"pointer",opacity:g||l?.7:1,transition:"all 0.15s ease",whiteSpace:"nowrap",boxShadow:"0 6px 16px rgba(var(--lion-primary-rgb), 0.32)",letterSpacing:"0.2px"}},g?a.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"}},a.createElement("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",opacity:"0.25"}),a.createElement("path",{d:"M12 2a10 10 0 019.95 9",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})),(0,s.t)("api.generating")||"Generating..."):o.hasToken?(0,s.t)("api.regenerate")||"Regenerate":(0,s.t)("api.generateToken")||"Generate Token")),a.createElement("p",{className:"api-token-warning",style:{margin:"10px 0 0",fontSize:"12px",color:k.textLight,lineHeight:"1.5"}},(0,s.t)("api.tokenWarning")||"Keep this token secret. Anyone with access can send messages on your behalf.")),a.createElement("div",{className:"api-toggle-panel",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 18px",backgroundColor:k.bgSecondary,borderRadius:"14px",marginBottom:"14px",border:`1px solid ${k.borderLight}`,transition:"all 0.15s ease"}},a.createElement("div",{style:{flex:1,minWidth:0}},a.createElement("div",{className:"api-toggle-title",style:{fontSize:"14px",fontWeight:700,color:k.textPrimary}},(0,s.t)("api.enableAPI")||"Enable API"),a.createElement("div",{className:"api-toggle-desc",style:{fontSize:"12px",color:k.textMuted,marginTop:"3px"}},o.isEnabled?(0,s.t)("api.apiIsEnabled")||"API is currently enabled":(0,s.t)("api.apiIsDisabled")||"API is currently disabled")),a.createElement("button",{onClick:async()=>{if(o.hasToken){c(!0),u(null);try{const e=!o.isEnabled,t=await C("toggle_enabled",{is_enabled:e});t.success?i(e=>({...e,isEnabled:t.is_enabled})):u(t.error||"Failed to toggle API")}catch(e){u("Failed to toggle API")}finally{c(!1)}}},disabled:!o.hasToken||l,style:{width:"46px",height:"26px",borderRadius:"999px",background:o.isEnabled?"var(--lion-primary)":"#d1d5db",border:"none",cursor:!o.hasToken||l?"not-allowed":"pointer",position:"relative",transition:"all 0.18s ease",opacity:o.hasToken?1:.5,boxShadow:o.isEnabled?"0 0 0 3px rgba(var(--lion-primary-rgb), 0.15)":"none",flexShrink:0,marginLeft:"14px"}},a.createElement("div",{style:{width:"20px",height:"20px",borderRadius:"50%",backgroundColor:"#fff",position:"absolute",top:"3px",left:o.isEnabled?"23px":"3px",transition:"all 0.18s ease",boxShadow:"0 2px 4px rgba(0,0,0,0.2)"}}))),a.createElement("div",{className:"api-toggle-panel",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 18px",backgroundColor:b?k.successLight:k.bgSecondary,borderRadius:"14px",marginBottom:"16px",border:`1px solid ${b?k.success+"40":k.borderLight}`,transition:"all 0.15s ease"}},a.createElement("div",{style:{flex:1,minWidth:0}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"}},a.createElement("div",{className:"api-toggle-title",style:{fontSize:"14px",fontWeight:700,color:k.textPrimary}},(0,s.t)("api.queuePolling")||"Queue Polling"),b&&a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"5px",padding:"3px 9px",background:`linear-gradient(135deg, ${k.success}, ${k.success}dd)`,borderRadius:"999px",fontSize:"10px",fontWeight:700,color:"#ffffff",letterSpacing:"0.6px",boxShadow:`0 3px 10px ${k.success}55`}},a.createElement("span",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#ffffff",animation:"pulse 1.5s infinite"}}),"ACTIVE")),a.createElement("div",{className:"api-toggle-desc",style:{fontSize:"12px",color:k.textMuted,marginTop:"4px",lineHeight:"1.4"}},b?(0,s.t)("api.pollingActive")||"Checking for queued messages every 5 minutes":(0,s.t)("api.pollingInactive")||"Enable to process incoming API messages"),b&&v&&a.createElement("div",{style:{display:"flex",gap:"14px",marginTop:"8px",fontSize:"11px",fontWeight:600}},a.createElement("span",{style:{color:k.primary}},v.pending," pending"),a.createElement("span",{style:{color:k.success}},v.completed," completed (24h)"))),a.createElement("button",{onClick:async()=>{const e=!b;f(e);try{const t={enabled:e,apiBaseUrl:hr()};await chrome.storage.local.set({[br]:t}),chrome.runtime.sendMessage({type:e?"API_POLLING_START":"API_POLLING_STOP"}),e&&o.hasToken&&S()}catch(t){f(!e)}},disabled:!o.hasToken||!o.isEnabled,style:{width:"46px",height:"26px",borderRadius:"999px",background:b?`linear-gradient(135deg, ${k.success}, ${k.success}cc)`:"#d1d5db",border:"none",cursor:o.hasToken&&o.isEnabled?"pointer":"not-allowed",position:"relative",transition:"all 0.18s ease",opacity:o.hasToken&&o.isEnabled?1:.5,flexShrink:0,marginLeft:"14px",boxShadow:b?`0 0 0 3px ${k.success}25`:"none"},title:o.hasToken?o.isEnabled?"":"Enable API first":"Generate token first"},a.createElement("div",{style:{width:"20px",height:"20px",borderRadius:"50%",backgroundColor:"#fff",position:"absolute",top:"3px",left:b?"23px":"3px",transition:"all 0.18s ease",boxShadow:"0 2px 4px rgba(0,0,0,0.2)"}})))),a.createElement("div",{style:{display:"flex",gap:"10px",padding:"14px 24px",borderTop:`1px solid ${k.borderLight}`,backgroundColor:k.bgSecondary,flexShrink:0}},a.createElement("button",{onClick:t,className:"api-btn-secondary",style:{padding:"10px 22px",background:k.bgPrimary,border:`1px solid ${k.borderLight}`,borderRadius:"10px",color:k.textPrimary,fontSize:"13px",fontWeight:600,cursor:"pointer",transition:"all 0.15s ease",letterSpacing:"0.2px"}},(0,s.t)("webhook.close")||"Close"),a.createElement("button",{className:"api-docs-btn",onClick:()=>{window.open("https://documenter.getpostman.com/view/43709792/2sB3dTuoJe","_blank")},style:{flex:1,padding:"10px 22px",background:"var(--lion-primary)",border:"1px solid transparent",borderRadius:"10px",color:"#ffffff",fontSize:"13px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px",transition:"all 0.15s ease",boxShadow:"0 6px 16px rgba(var(--lion-primary-rgb), 0.32)",letterSpacing:"0.2px"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M12 6.042A8.967 8.967 0 006 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 016 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 016-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0018 18a8.967 8.967 0 00-6 2.292m0-14.25v14.25",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),(0,s.t)("api.openDocumentation")||"Open Documentation",a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M7 17L17 7M17 7H7M17 7v10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))))),a.createElement("style",null,`\n        @keyframes spin {\n          from { transform: rotate(0deg); }\n          to { transform: rotate(360deg); }\n        }\n        @keyframes pulse {\n          0%, 100% { opacity: 1; }\n          50% { opacity: 0.4; }\n        }\n        @keyframes apiOverlayFade {\n          from { opacity: 0; }\n          to { opacity: 1; }\n        }\n        @keyframes apiModalPop {\n          from { opacity: 0; transform: translateY(8px) scale(0.985); }\n          to { opacity: 1; transform: translateY(0) scale(1); }\n        }\n\n        .api-config-modal .api-close-btn:hover {\n          background: rgba(239, 68, 68, 0.1) !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n          color: #ef4444 !important;\n          transform: rotate(90deg);\n        }\n\n        .api-config-modal .api-token-input-wrap:focus-within {\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 4px rgba(var(--lion-primary-rgb), 0.12);\n        }\n\n        .api-config-modal .api-regen-btn:hover:not(:disabled) {\n          transform: translateY(-1px);\n          box-shadow: 0 10px 22px rgba(var(--lion-primary-rgb), 0.42) !important;\n        }\n\n        .api-config-modal .api-docs-btn:hover {\n          transform: translateY(-1px);\n          box-shadow: 0 10px 22px rgba(var(--lion-primary-rgb), 0.42) !important;\n        }\n\n        .api-config-modal .api-btn-secondary:hover {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-text-muted) !important;\n        }\n\n        .api-config-content::-webkit-scrollbar { width: 5px; }\n        .api-config-content::-webkit-scrollbar-thumb {\n          background: ${k.borderLight};\n          border-radius: 5px;\n        }\n        .api-config-content::-webkit-scrollbar-track {\n          background: transparent;\n        }\n\n        /* ========== DARK MODE OVERRIDES ========== */\n        .api-config-modal-overlay.lion-dark .api-config-modal {\n          background: var(--lion-bg-primary) !important;\n        }\n\n        .api-config-modal-overlay.lion-dark .api-config-modal * {\n          color: var(--lion-text-primary);\n        }\n\n        .api-config-modal-overlay.lion-dark h2 {\n          color: #ffffff !important;\n        }\n\n        .api-config-modal-overlay.lion-dark p,\n        .api-config-modal-overlay.lion-dark label,\n        .api-config-modal-overlay.lion-dark span,\n        .api-config-modal-overlay.lion-dark div {\n          color: var(--lion-text-primary) !important;\n        }\n\n        .api-config-modal-overlay.lion-dark input {\n          background: var(--lion-bg-secondary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .api-config-modal-overlay.lion-dark input::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        /* Muted text should be lighter gray */\n        .api-config-modal-overlay.lion-dark .api-muted-text {\n          color: #a0a0a0 !important;\n        }\n\n        /* Toggle panels */\n        .api-config-modal-overlay.lion-dark .api-toggle-panel {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .api-config-modal-overlay.lion-dark .api-toggle-panel .api-toggle-title {\n          color: #ffffff !important;\n        }\n\n        .api-config-modal-overlay.lion-dark .api-toggle-panel .api-toggle-desc {\n          color: #a0a0a0 !important;\n        }\n\n        /* Header subtitle */\n        .api-config-modal-overlay.lion-dark .api-header-subtitle {\n          color: #a0a0a0 !important;\n        }\n\n        /* Token warning text */\n        .api-config-modal-overlay.lion-dark .api-token-warning {\n          color: #888888 !important;\n        }\n\n        /* Close button */\n        .api-config-modal-overlay.lion-dark button svg {\n          color: var(--lion-text-muted);\n        }\n\n        /* Documentation button - keep gradient for visibility on dark bg */\n        .api-config-modal-overlay.lion-dark .api-docs-btn {\n          color: #ffffff !important;\n          background: var(--lion-primary) !important;\n        }\n\n        .api-config-modal-overlay.lion-dark .api-docs-btn svg {\n          color: #ffffff !important;\n        }\n\n        /* Close button — dark mode */\n        .api-config-modal-overlay.lion-dark .api-close-btn {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        /* Regen button — keep gradient in dark */\n        .api-config-modal-overlay.lion-dark .api-regen-btn {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n        }\n\n        /* Secondary (Close) button */\n        .api-config-modal-overlay.lion-dark .api-btn-secondary {\n          background: var(--lion-bg-tertiary) !important;\n          border-color: var(--lion-border-light) !important;\n          color: var(--lion-text-primary) !important;\n        }\n\n        /* Footer area */\n        .api-config-modal-overlay.lion-dark .api-config-modal > div:last-of-type {\n          background: var(--lion-bg-secondary) !important;\n          border-top-color: var(--lion-border-light) !important;\n        }\n      `)):null},vr="wa_ai_bot_settings",yr={enabled:!0,startTime:"09:00",endTime:"18:00"},xr={enabled:!1,startTime:"10:00",endTime:"16:00"},wr={enabled:!1,enabledAt:0,replyInGroups:!1,schedule:{enabled:!1,timezone:"America/Sao_Paulo",monday:{...yr},tuesday:{...yr},wednesday:{...yr},thursday:{...yr},friday:{...yr},saturday:{...xr},sunday:{...xr}},replyTiming:{minDelay:3,maxDelay:15},actionToggles:{updateTabs:!0,createAppointment:!0,updateProfile:!0,normalReply:!0},actionPrompts:{updateTabs:"",createAppointment:""},appointmentConfig:{meetLink:"",messageTemplate:"Olá {name}, seu compromisso está agendado para {date} às {time}. Participe aqui: {link}",officeHoursStart:"09:00",officeHoursEnd:"19:00",sendMessageImmediately:!0},stopKeywords:{enabled:!0,keywords:["stop","human","talk to human","agent please"],stopMessage:"AI Bot has been disabled for you. A human agent will assist you shortly.",smartDetection:!0},contextMessageCount:30,businessPrompt:"",allowGeneralKnowledge:!1,fallbackReply:""},kr=[{value:"America/Sao_Paulo",label:"🇮🇳 India (IST) UTC+5:30",region:"Asia"},{value:"Asia/Dubai",label:"🇦🇪 Dubai (GST) UTC+4",region:"Asia"},{value:"Asia/Karachi",label:"🇵🇰 Pakistan (PKT) UTC+5",region:"Asia"},{value:"Asia/Dhaka",label:"🇧🇩 Bangladesh (BST) UTC+6",region:"Asia"},{value:"Asia/Colombo",label:"🇱🇰 Sri Lanka (IST) UTC+5:30",region:"Asia"},{value:"Asia/Kathmandu",label:"🇳🇵 Nepal (NPT) UTC+5:45",region:"Asia"},{value:"Asia/Singapore",label:"🇸🇬 Singapore (SGT) UTC+8",region:"Asia"},{value:"Asia/Kuala_Lumpur",label:"🇲🇾 Malaysia (MYT) UTC+8",region:"Asia"},{value:"Asia/Bangkok",label:"🇹🇭 Thailand (ICT) UTC+7",region:"Asia"},{value:"Asia/Jakarta",label:"🇮🇩 Indonesia (WIB) UTC+7",region:"Asia"},{value:"Asia/Ho_Chi_Minh",label:"🇻🇳 Vietnam (ICT) UTC+7",region:"Asia"},{value:"Asia/Manila",label:"🇵🇭 Philippines (PHT) UTC+8",region:"Asia"},{value:"Asia/Hong_Kong",label:"🇭🇰 Hong Kong (HKT) UTC+8",region:"Asia"},{value:"Asia/Shanghai",label:"🇨🇳 China (CST) UTC+8",region:"Asia"},{value:"Asia/Taipei",label:"🇹🇼 Taiwan (CST) UTC+8",region:"Asia"},{value:"Asia/Seoul",label:"🇰🇷 South Korea (KST) UTC+9",region:"Asia"},{value:"Asia/Tokyo",label:"🇯🇵 Japan (JST) UTC+9",region:"Asia"},{value:"Asia/Riyadh",label:"🇸🇦 Saudi Arabia (AST) UTC+3",region:"Middle East"},{value:"Asia/Kuwait",label:"🇰🇼 Kuwait (AST) UTC+3",region:"Middle East"},{value:"Asia/Qatar",label:"🇶🇦 Qatar (AST) UTC+3",region:"Middle East"},{value:"Asia/Bahrain",label:"🇧🇭 Bahrain (AST) UTC+3",region:"Middle East"},{value:"Asia/Jerusalem",label:"🇮🇱 Israel (IST) UTC+2",region:"Middle East"},{value:"Asia/Tehran",label:"🇮🇷 Iran (IRST) UTC+3:30",region:"Middle East"},{value:"Asia/Baghdad",label:"🇮🇶 Iraq (AST) UTC+3",region:"Middle East"},{value:"Europe/Istanbul",label:"🇹🇷 Turkey (TRT) UTC+3",region:"Middle East"},{value:"Europe/London",label:"🇬🇧 UK (GMT/BST) UTC+0/+1",region:"Europe"},{value:"Europe/Dublin",label:"🇮🇪 Ireland (GMT/IST) UTC+0/+1",region:"Europe"},{value:"Europe/Paris",label:"🇫🇷 France (CET) UTC+1",region:"Europe"},{value:"Europe/Berlin",label:"🇩🇪 Germany (CET) UTC+1",region:"Europe"},{value:"Europe/Amsterdam",label:"🇳🇱 Netherlands (CET) UTC+1",region:"Europe"},{value:"Europe/Brussels",label:"🇧🇪 Belgium (CET) UTC+1",region:"Europe"},{value:"Europe/Rome",label:"🇮🇹 Italy (CET) UTC+1",region:"Europe"},{value:"Europe/Madrid",label:"🇪🇸 Spain (CET) UTC+1",region:"Europe"},{value:"Europe/Lisbon",label:"🇵🇹 Portugal (WET) UTC+0",region:"Europe"},{value:"Europe/Zurich",label:"🇨🇭 Switzerland (CET) UTC+1",region:"Europe"},{value:"Europe/Vienna",label:"🇦🇹 Austria (CET) UTC+1",region:"Europe"},{value:"Europe/Warsaw",label:"🇵🇱 Poland (CET) UTC+1",region:"Europe"},{value:"Europe/Prague",label:"🇨🇿 Czech (CET) UTC+1",region:"Europe"},{value:"Europe/Stockholm",label:"🇸🇪 Sweden (CET) UTC+1",region:"Europe"},{value:"Europe/Oslo",label:"🇳🇴 Norway (CET) UTC+1",region:"Europe"},{value:"Europe/Copenhagen",label:"🇩🇰 Denmark (CET) UTC+1",region:"Europe"},{value:"Europe/Helsinki",label:"🇫🇮 Finland (EET) UTC+2",region:"Europe"},{value:"Europe/Athens",label:"🇬🇷 Greece (EET) UTC+2",region:"Europe"},{value:"Europe/Bucharest",label:"🇷🇴 Romania (EET) UTC+2",region:"Europe"},{value:"Europe/Kiev",label:"🇺🇦 Ukraine (EET) UTC+2",region:"Europe"},{value:"Europe/Moscow",label:"🇷🇺 Russia/Moscow (MSK) UTC+3",region:"Europe"},{value:"America/New_York",label:"🇺🇸 US Eastern (EST) UTC-5",region:"Americas"},{value:"America/Chicago",label:"🇺🇸 US Central (CST) UTC-6",region:"Americas"},{value:"America/Denver",label:"🇺🇸 US Mountain (MST) UTC-7",region:"Americas"},{value:"America/Los_Angeles",label:"🇺🇸 US Pacific (PST) UTC-8",region:"Americas"},{value:"America/Anchorage",label:"🇺🇸 Alaska (AKST) UTC-9",region:"Americas"},{value:"Pacific/Honolulu",label:"🇺🇸 Hawaii (HST) UTC-10",region:"Americas"},{value:"America/Toronto",label:"🇨🇦 Canada/Toronto (EST) UTC-5",region:"Americas"},{value:"America/Vancouver",label:"🇨🇦 Canada/Vancouver (PST) UTC-8",region:"Americas"},{value:"America/Mexico_City",label:"🇲🇽 Mexico City (CST) UTC-6",region:"Americas"},{value:"America/Sao_Paulo",label:"🇧🇷 Brazil (BRT) UTC-3",region:"Americas"},{value:"America/Buenos_Aires",label:"🇦🇷 Argentina (ART) UTC-3",region:"Americas"},{value:"America/Santiago",label:"🇨🇱 Chile (CLT) UTC-4",region:"Americas"},{value:"America/Lima",label:"🇵🇪 Peru (PET) UTC-5",region:"Americas"},{value:"America/Bogota",label:"🇨🇴 Colombia (COT) UTC-5",region:"Americas"},{value:"America/Caracas",label:"🇻🇪 Venezuela (VET) UTC-4",region:"Americas"},{value:"Africa/Cairo",label:"🇪🇬 Egypt (EET) UTC+2",region:"Africa"},{value:"Africa/Lagos",label:"🇳🇬 Nigeria (WAT) UTC+1",region:"Africa"},{value:"Africa/Nairobi",label:"🇰🇪 Kenya (EAT) UTC+3",region:"Africa"},{value:"Africa/Johannesburg",label:"🇿🇦 South Africa (SAST) UTC+2",region:"Africa"},{value:"Africa/Casablanca",label:"🇲🇦 Morocco (WET) UTC+0",region:"Africa"},{value:"Australia/Sydney",label:"🇦🇺 Australia/Sydney (AEST) UTC+10",region:"Oceania"},{value:"Australia/Melbourne",label:"🇦🇺 Australia/Melbourne (AEST) UTC+10",region:"Oceania"},{value:"Australia/Brisbane",label:"🇦🇺 Australia/Brisbane (AEST) UTC+10",region:"Oceania"},{value:"Australia/Perth",label:"🇦🇺 Australia/Perth (AWST) UTC+8",region:"Oceania"},{value:"Pacific/Auckland",label:"🇳🇿 New Zealand (NZST) UTC+12",region:"Oceania"},{value:"Pacific/Fiji",label:"🇫🇯 Fiji (FJT) UTC+12",region:"Oceania"}],Er=[{key:"monday",short:"Mon",full:"Monday"},{key:"tuesday",short:"Tue",full:"Tuesday"},{key:"wednesday",short:"Wed",full:"Wednesday"},{key:"thursday",short:"Thu",full:"Thursday"},{key:"friday",short:"Fri",full:"Friday"},{key:"saturday",short:"Sat",full:"Saturday"},{key:"sunday",short:"Sun",full:"Sunday"}];class Sr{static getSettings(){try{const e=localStorage.getItem(vr);if(e){const t=JSON.parse(e);let n=wr.schedule;if(t.schedule)if(t.schedule.startTime&&!t.schedule.monday){const e={enabled:!0,startTime:t.schedule.startTime||"09:00",endTime:t.schedule.endTime||"18:00"};n={enabled:t.schedule.enabled??!1,timezone:t.schedule.timezone||"America/Sao_Paulo",monday:{...e},tuesday:{...e},wednesday:{...e},thursday:{...e},friday:{...e},saturday:{enabled:!1,startTime:"10:00",endTime:"16:00"},sunday:{enabled:!1,startTime:"10:00",endTime:"16:00"}}}else n={enabled:t.schedule.enabled??wr.schedule.enabled,timezone:t.schedule.timezone||wr.schedule.timezone,monday:{...wr.schedule.monday,...t.schedule.monday},tuesday:{...wr.schedule.tuesday,...t.schedule.tuesday},wednesday:{...wr.schedule.wednesday,...t.schedule.wednesday},thursday:{...wr.schedule.thursday,...t.schedule.thursday},friday:{...wr.schedule.friday,...t.schedule.friday},saturday:{...wr.schedule.saturday,...t.schedule.saturday},sunday:{...wr.schedule.sunday,...t.schedule.sunday}};return{...wr,...t,schedule:n,replyTiming:{...wr.replyTiming,...t.replyTiming},actionToggles:{...wr.actionToggles,...t.actionToggles},actionPrompts:{...wr.actionPrompts,...t.actionPrompts},appointmentConfig:{...wr.appointmentConfig,...t.appointmentConfig},stopKeywords:{...wr.stopKeywords,...t.stopKeywords}}}}catch(e){}return{...wr}}static saveSettings(e){try{const t=this.getSettings(),n={...t,...e,schedule:e.schedule?{...t.schedule,...e.schedule}:t.schedule,replyTiming:e.replyTiming?{...t.replyTiming,...e.replyTiming}:t.replyTiming,actionToggles:e.actionToggles?{...t.actionToggles,...e.actionToggles}:t.actionToggles,actionPrompts:e.actionPrompts?{...t.actionPrompts,...e.actionPrompts}:t.actionPrompts,appointmentConfig:e.appointmentConfig?{...t.appointmentConfig,...e.appointmentConfig}:t.appointmentConfig,stopKeywords:e.stopKeywords?{...t.stopKeywords,...e.stopKeywords}:t.stopKeywords};!0!==e.enabled||t.enabled||(n.enabledAt=Date.now()),localStorage.setItem(vr,JSON.stringify(n)),document.dispatchEvent(new CustomEvent("aiBotSettingsChanged",{detail:n}))}catch(e){}}static isEnabled(){return this.getSettings().enabled}static getCurrentDayKey(e){const t=new Date;return new Intl.DateTimeFormat("en-US",{timeZone:e,weekday:"long"}).format(t).toLowerCase()}static isWithinSchedule(){const e=this.getSettings();if(!e.schedule.enabled)return!0;try{const t=e.schedule.timezone,n=new Date,a=this.getCurrentDayKey(t),r=e.schedule[a];if(!r||!r.enabled)return!1;const o=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"2-digit",minute:"2-digit",hour12:!1}).format(n),[i,s]=o.split(":").map(Number),l=60*i+s,[c,d]=r.startTime.split(":").map(Number),[m,p]=r.endTime.split(":").map(Number),u=60*c+d,g=60*m+p;let h;return h=u<=g?l>=u&&l<=g:l>=u||l<=g,h}catch(e){return!0}}static getRandomDelay(){const e=this.getSettings(),{minDelay:t,maxDelay:n}=e.replyTiming;return Math.floor(Math.random()*(n-t+1))+t}static isActionEnabled(e){return this.getSettings().actionToggles[e]}static getBusinessPrompt(){return this.getSettings().businessPrompt}static getContextMessageCount(){return this.getSettings().contextMessageCount}static shouldReplyInGroups(){return this.getSettings().replyInGroups}static getEnabledAt(){return this.getSettings().enabledAt||0}static isMessageAfterEnabled(e){const t=this.getEnabledAt();if(0===t)return!0;return!(1e3*e<t)}static shouldProcess(){return this.isEnabled()&&this.isWithinSchedule()}static shouldProcessChat(e){if(!this.shouldProcess())return!1;const t=e.endsWith("@c.us"),n=e.endsWith("@lid"),a=e.endsWith("@g.us");return!!(t||n||a)&&!(a&&!this.shouldReplyInGroups())}static shouldProcessMessage(e,t){return!!this.shouldProcessChat(e)&&!!this.isMessageAfterEnabled(t)}static resetToDefaults(){localStorage.setItem(vr,JSON.stringify(wr)),document.dispatchEvent(new CustomEvent("aiBotSettingsChanged",{detail:wr}))}}const Cr="qa_pairs",Tr="sources",Ar="kb_settings",Dr="escalation",_r="attempts";let Nr=null;function Mr(){return Nr||(Nr=new Promise((e,t)=>{if("undefined"==typeof indexedDB)return void t(new Error("IndexedDB is not available in this context"));const n=indexedDB.open("lion_ai_bot_kb",1);n.onupgradeneeded=e=>{const t=e.target.result;t.objectStoreNames.contains(Cr)||t.createObjectStore(Cr,{keyPath:"id"}),t.objectStoreNames.contains(Tr)||t.createObjectStore(Tr,{keyPath:"id"}),t.objectStoreNames.contains(Ar)||t.createObjectStore(Ar,{keyPath:"k"}),t.objectStoreNames.contains(Dr)||t.createObjectStore(Dr,{keyPath:"k"}),t.objectStoreNames.contains(_r)||t.createObjectStore(_r,{keyPath:"chatId"})},n.onsuccess=()=>{const t=n.result;t.onversionchange=()=>{try{t.close()}catch{}Nr=null},t.onclose=()=>{Nr=null},e(t)},n.onerror=()=>{Nr=null,t(n.error||new Error("Failed to open KB IndexedDB"))},n.onblocked=()=>{}}),Nr)}function Ir(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error||new Error("IDB request failed"))})}async function Rr(e,t){const n=(await Mr()).transaction(e,"readonly");return await Ir(n.objectStore(e).get(t))}async function Br(e){const t=(await Mr()).transaction(e,"readonly");return await Ir(t.objectStore(e).getAll())||[]}async function Pr(e,t){const n=(await Mr()).transaction(e,"readwrite");await Ir(n.objectStore(e).put(t)),await Ur(n)}async function Lr(e,t){const n=(await Mr()).transaction(e,"readwrite");await Ir(n.objectStore(e).delete(t)),await Ur(n)}function Ur(e){return new Promise((t,n)=>{e.oncomplete=()=>t(),e.onabort=()=>n(e.error||new Error("IDB transaction aborted")),e.onerror=()=>n(e.error||new Error("IDB transaction error"))})}function Fr(e="kb"){try{if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return`${e}_${crypto.randomUUID()}`}catch{}return`${e}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,10)}`}const zr={triggerWords:[],tone:"friendly",maxLength:"medium",temperature:.7,maxTokens:1e3,fallbackMessage:"I'm sorry, I don't have the information you're looking for right now. A team member will get back to you shortly."},Or="settings",Wr={short:50,medium:200,long:400},qr={qa:[],sources:[],settings:{...zr},warmed:!1};async function Hr(){qr.warmed||await Yr()}const jr=new Set(["a","an","and","are","as","at","be","by","for","from","has","have","he","i","in","is","it","its","of","on","or","that","the","this","to","was","were","will","with","you","your","me","my","we","us","they","them","their","do","does","did","can","could","should","would","how","what","when","where","why","who","which","so","if","but","not","no","yes","about","just","tell","please","pls"]),Vr={whitelabel:["white","label"],whitelabeled:["white","labeled"],whitelabelling:["white","labelling"],whitelabelled:["white","labelled"],whatsapp:["whats","app"],chatbot:["chat","bot"],followup:["follow","up"],signup:["sign","up"],login:["log","in"]};function Gr(e){if(!e)return new Set;const t=e.toLowerCase().match(/[a-z0-9ऀ-ॿ؀-ۿ]+/gi)||[],n=new Set;for(const e of t){if(e.length<2)continue;if(jr.has(e))continue;n.add(e);const t=Vr[e];if(t)for(const e of t)n.add(e)}return n}function Kr(e,t,n=1){if(0===e.size||!t)return 0;const a=t.toLowerCase(),r=Gr(t);let o=0,i=0;for(const t of e)if(r.has(t)){o++;const e=a.split(t).length-1;i+=.25*Math.min(e,3)}else t.length>=4&&a.includes(t)&&o++;return 0===o?0:o*n+i+(o>=2?o:0)}class $r{static async warmCache(){return Yr()}static async getQAPairs(){return await Hr(),[...qr.qa]}static async addQAPair(e){const t=Date.now(),n={id:Fr("qa"),question:e.question.trim(),answer:e.answer.trim(),category:(e.category||"").trim(),enabled:!0,createdAt:t,updatedAt:t};return await Pr(Cr,n),qr.qa.push(n),n}static async updateQAPair(e,t){await Hr();const n=qr.qa.find(t=>t.id===e);if(!n)return!1;const a={...n,...t,updatedAt:Date.now()};return await Pr(Cr,a),Object.assign(n,a),!0}static async deleteQAPair(e){await Lr(Cr,e);const t=qr.qa.findIndex(t=>t.id===e);return t>=0&&qr.qa.splice(t,1),!0}static async toggleQAPair(e,t){return this.updateQAPair(e,{enabled:t})}static async getSources(){return await Hr(),[...qr.sources]}static async addSource(e){const t={id:Fr("src"),type:e.type,title:e.title.trim()||e.sourceRef,sourceRef:e.sourceRef,chunks:e.chunks||[],enabled:e.enabled??!0,createdAt:Date.now(),sizeKB:e.sizeKB||0};return await Pr(Tr,t),qr.sources.push(t),t}static async updateSource(e,t){await Hr();const n=qr.sources.find(t=>t.id===e);if(!n)return!1;const a={...n,...t};return await Pr(Tr,a),Object.assign(n,a),!0}static async deleteSource(e){await Lr(Tr,e);const t=qr.sources.findIndex(t=>t.id===e);return t>=0&&qr.sources.splice(t,1),!0}static async toggleSource(e,t){return this.updateSource(e,{enabled:t})}static async getKBSettings(){return await Hr(),{...qr.settings}}static async saveKBSettings(e){await Hr();const t={...qr.settings,...e};var n,a,r;t.temperature=(n=t.temperature,a=0,r=1,Number.isNaN(n)?a:Math.max(a,Math.min(r,n))),t.maxTokens=Math.max(50,Math.min(4e3,Math.floor(t.maxTokens))),t.triggerWords=(t.triggerWords||[]).map(e=>e.trim().toLowerCase()).filter(Boolean),await Pr(Ar,{k:Or,value:t}),qr.settings=t}static async getStats(){await Hr();const e=qr.sources.reduce((e,t)=>e+(t.chunks?.length||0),0);return{qaCount:qr.qa.length,sourceCount:qr.sources.length,chunkCount:e}}static getStatsSync(){if(!qr.warmed)return{qaCount:0,sourceCount:0,chunkCount:0};const e=qr.sources.reduce((e,t)=>e+(t.chunks?.length||0),0);return{qaCount:qr.qa.length,sourceCount:qr.sources.length,chunkCount:e}}static async findRelevantQA(e,t=3){if(await Hr(),0===qr.qa.length)return[];const n=Gr(e);if(0===n.size)return[];const a=[];for(const e of qr.qa){if(!e.enabled)continue;const t=Kr(n,e.question,2)+Kr(n,e.answer,1);t>=1&&a.push({qa:e,score:t})}return a.sort((e,t)=>t.score-e.score),a.slice(0,t).map(e=>e.qa)}static async findRelevantChunks(e,t=8){if(await Hr(),0===qr.sources.length)return[];const n=Gr(e);if(0===n.size)return[];const a=[];for(const e of qr.sources)if(e.enabled)for(const t of e.chunks||[]){const r=Kr(n,t,1);r>=1&&a.push({source:e,chunk:t,score:r})}a.sort((e,t)=>t.score-e.score);const r=Math.max(2,Math.ceil(t/2)),o=new Map,i=[],s=[];for(const e of a){const n=o.get(e.source.id)||0;n<r&&i.length<t?(i.push(e),o.set(e.source.id,n+1)):s.push(e)}for(;i.length<t&&s.length>0;)i.push(s.shift());return i}static async messageMatchesTriggerWords(e){await Hr();const t=qr.settings.triggerWords;if(!t||0===t.length)return!0;const n=(e||"").toLowerCase();return t.some(e=>e&&n.includes(e))}}async function Yr(){try{const[e,t,n]=await Promise.all([Br(Cr),Br(Tr),Rr(Ar,Or)]);qr.qa=e||[],qr.sources=t||[],qr.settings=n?.value?{...zr,...n.value}:{...zr};try{if("undefined"!=typeof localStorage){if(!qr.settings.fallbackMessage||qr.settings.fallbackMessage===zr.fallbackMessage){const e=localStorage.getItem("wa_ai_bot_settings");if(e){const t=JSON.parse(e),n=(t?.fallbackReply||"").trim();n&&(qr.settings.fallbackMessage=n,await Pr(Ar,{k:Or,value:qr.settings}))}}}}catch(e){}qr.warmed=!0}catch(e){qr.warmed=!0}}function Xr(e,t=500){const n=(e||"").trim();if(!n)return[];if(n.length<=t)return[n];const a=n.split(/(?<=[.!?।])\s+|\n{2,}/).map(e=>e.trim()).filter(Boolean),r=[];let o="";const i=()=>{o.trim()&&r.push(o.trim()),o=""};for(const e of a){if(e.length>t){i();let n=e;for(;n.length>t;){let e=n.lastIndexOf(" ",t);e<.6*t&&(e=t),r.push(n.slice(0,e).trim()),n=n.slice(e).trim()}n&&(o=n);continue}(o+" "+e).trim().length>t&&i(),o=o?`${o} ${e}`:e}return i(),r}const Jr=new class{async processMessage(e,t,n,a,r){const o=Gn.getSettings(),i=Sr.getSettings();if(!o.enabled||!o.apiKey)return null;try{const e=await $r.getKBSettings(),s=await this.buildSystemPrompt(t,i,r,n,e),l=this.buildMessages(s,a,n),c=o.model?.trim()||Hn(o.provider);let d;switch(o.provider){case"chatgpt":d=await this.callChatGPT(o.apiKey,l,e,c);break;case"gemini":d=await this.callGemini(o.apiKey,l,e,c);break;case"deepseek":d=await this.callDeepSeek(o.apiKey,l,e,c);break;default:throw new Error("Unknown AI provider")}return this.parseAIResponse(d,i)}catch(e){return null}}async processMessageWithSettings(e,t,n,a,r,o,i=!1){const s=Gn.getSettings();if(!s.enabled||!s.apiKey)throw new Error("AI is not enabled or API key is missing. Please configure AI settings first.");if(i)return this.processGlobalChatGPT(n,a);try{const e=await $r.getKBSettings(),i=await this.buildSystemPrompt(t,o,r,n,e),l=this.buildMessages(i,a,n),c=s.model?.trim()||Hn(s.provider);let d;switch(s.provider){case"chatgpt":d=await this.callChatGPT(s.apiKey,l,e,c);break;case"gemini":d=await this.callGemini(s.apiKey,l,e,c);break;case"deepseek":d=await this.callDeepSeek(s.apiKey,l,e,c);break;default:throw new Error("Unknown AI provider")}return this.parseAIResponse(d,o)}catch(e){throw e}}async processGlobalChatGPT(e,t){try{const n=Gn.getSettings();if(!n.enabled||!n.apiKey)throw new Error("AI not configured");const a=[{role:"system",content:'You are ChatGPT, a helpful AI assistant created by OpenAI.\n\nIMPORTANT GUIDELINES:\n- Remember and use the full conversation context when responding\n- If the user corrects you or says something is wrong, acknowledge it and adjust your response\n- Follow the user\'s instructions precisely - if they ask for a specific format, language, or style, comply\n- Respond in the same language the user uses\n- Be helpful, accurate, and conversational\n- If asked to translate, translate accurately without adding extra commentary unless requested\n- If the user provides feedback like "not like this, do it like this" - follow their guidance\n\nYou are having a continuous conversation - treat all previous messages as context for your responses.'},...t.map(e=>({role:e.role,content:e.content})),{role:"user",content:e}];let r;const o=n.provider||"chatgpt";if("chatgpt"===o)r=await this.callChatGPTSimple(n.apiKey,a);else if("gemini"===o)r=await this.callGeminiSimple(n.apiKey,a);else{if("deepseek"!==o)throw new Error("Unknown AI provider");r=await this.callDeepSeekSimple(n.apiKey,a)}return{action:"NORMAL",reply:r.trim()}}catch(e){throw e}}async callChatGPTSimple(e,t){const n=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({model:"gpt-4o-mini",messages:t,max_tokens:1500,temperature:.7})});if(!n.ok){const e=await n.json();throw new Error(e.error?.message||"ChatGPT API error")}const a=await n.json();return a.choices[0]?.message?.content||""}async callGeminiSimple(e,t){const n=t.filter(e=>"system"!==e.role).map(e=>({role:"user"===e.role?"user":"model",parts:[{text:e.content}]})),a=t.find(e=>"system"===e.role)?.content||"",r=await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({system_instruction:{parts:[{text:a}]},contents:n,generationConfig:{temperature:.7,maxOutputTokens:1500}})});if(!r.ok){const e=await r.json().catch(()=>({}));throw new Error(e.error?.message||`Gemini API error: ${r.status}`)}const o=await r.json();return o.candidates?.[0]?.content?.parts?.[0]?.text||""}async callDeepSeekSimple(e,t){const n=await fetch("https://api.deepseek.com/v1/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:JSON.stringify({model:"deepseek-chat",messages:t,max_tokens:1500,temperature:.7})});if(!n.ok)throw new Error("DeepSeek API error");const a=await n.json();return a.choices[0]?.message?.content||""}async buildSystemPrompt(e,t,n,a="",r=zr){const o=this.getAvailableTabs(),i=new Date,s=t.schedule?.timezone||"America/Sao_Paulo",l=i.getFullYear(),c=new Intl.DateTimeFormat("pt-BR",{timeZone:s,weekday:"short",year:"numeric",month:"short",day:"numeric"}).format(i),d=new Intl.DateTimeFormat("pt-BR",{timeZone:s,hour:"2-digit",minute:"2-digit",hour12:!0}).format(i),m=[];t.stopKeywords?.smartDetection&&m.push("STOP_BOT"),t.actionToggles.updateProfile&&m.push("UPDATE_PROFILE"),t.actionToggles.createAppointment&&m.push("CREATE_APPOINTMENT"),t.actionToggles.updateTabs&&m.push("UPDATE_TABS"),m.push("NORMAL");let p="";if(t.businessPrompt?.trim()&&(p+=`## BUSINESS CONTEXT\n${t.businessPrompt.trim()}\n\n`),p+=`Você é um assistente do WhatsApp para "${e}". Responda APENAS com JSON válido.\n\n## ESQUEMA JSON (ESTRITO)\n{"action":"ACTION","reply":"mensagem","actionData":{...}}\n\n- action: OBRIGATÓRIO - um de: ${m.join(", ")}\n- reply: OBRIGATÓRIO - resposta natural ao cliente (NUNCA mencione ações de CRM)\n- actionData: OPCIONAL - apenas para ações não normais (non-NORMAL)\n\n## PRIORIDADE DE AÇÃO (escolha a primeira aplicável)\n`,t.stopKeywords?.smartDetection){p+=`0. STOP_BOT - ⚠️ PRIORIDADE MÁXIMA - Usuário frustrado OU deseja atendente humano\n   Detecte estes sinais:\n   - Frustração: "isso é inútil", "você não entende", "que porcaria", "bot não entende nada"\n   - Confusão repetida: usuário perguntando a mesma coisa várias vezes com irritação\n   - Solicitação humana: "falar com atendente", "pessoa real", "atendente humano", "falar com humano", "suporte humano"\n   - Questionamento de Bot: "você é um bot?", "isso é automatizado?", "é robô?"\n\n   Quando detectado, retorne: {"action":"STOP_BOT","reply":"${t.stopKeywords?.stopMessage||"O Bot de IA foi desativado para você. Um atendente humano irá ajudá-lo em breve."}","actionData":{"stopReason":"frustration|human_request"}}\n\n`}if(t.actionToggles.updateProfile&&(p+='1. UPDATE_PROFILE - Usuário compartilha informações pessoais/profissionais (nome, e-mail, empresa, redes sociais, etc.)\n   actionData: {"extractedData":{"name":"...","email":"...","customFields":[{"label":"Empresa","value":"..."}]}}\n'),t.actionToggles.createAppointment){const e=t.appointmentConfig?.officeHoursStart||"09:00",n=t.appointmentConfig?.officeHoursEnd||"19:00";p+=`2. CREATE_APPOINTMENT - Usuário deseja agendar uma reunião/chamada\n   AGORA: ${c} ${d} | Ano: ${l}\n\n   ⚠️ HORÁRIO COMERCIAL RÍGIDO: APENAS ${e} - ${n}\n   - REJEITE qualquer horário FORA do horário comercial (ex: 3h, 23h, etc.)\n   - Se o usuário pedir um horário fora do comercial, sugira educadamente os horários disponíveis\n\n   ⚠️ OBRIGATÓRIO: PERGUNTE O MOTIVO DA REUNIÃO ANTES DE CRIAR\n   Você DEVE saber sobre o que é a reunião antes de agendar. Títulos genéricos como "Reunião", "Compromisso", "Chamada" NÃO são aceitáveis.\n\n   INFORMAÇÕES NECESSÁRIAS (TODAS devem ser fornecidas pelo usuário):\n   1. MOTIVO/TÓPICO - "Sobre o que é esta reunião?" (ex: "Demonstração de produto", "Discussão de vendas", "Chamada de suporte")\n   2. DATA - Quando? (hoje, amanhã, data específica)\n   3. HORA - Que horas? (deve estar entre ${e}-${n})\n\n   ⚠️ REGRAS CRÍTICAS:\n   - Se o usuário disser "agendar às 10h" mas NENHUM MOTIVO for mencionado → NÃO crie o compromisso → Pergunte "Claro, sobre o que é esta reunião?"\n   - Se o usuário disser "reunião amanhã" mas SEM HORA ou MOTIVO → Peça ambos\n   - APENAS use CREATE_APPOINTMENT quando tiver um motivo ESPECÍFICO como "Demonstração de Produto", "Chamada de Vendas", "Consulta", etc.\n   - NUNCA crie compromisso com título genérico - sempre pergunte antes!\n   \n   Análise de data/hora: amanha=+1dia, depois de amanha=+2dias, segunda=proxima segunda, 16:00=16:00\n   actionData: {"appointmentTitle":"[MOTIVO ESPECÍFICO]","appointmentDateTime":"YYYY-MM-DDTHH:mm:ss"}\n\n   EXEMPLOS:\n   Usuário: "Marcar compromisso para 10h" → {"action":"NORMAL","reply":"Claro, posso agendar para as 10h. Sobre o que é esta reunião?"}\n   Usuário: "Demonstração de produto amanhã às 15h" → {"action":"CREATE_APPOINTMENT","reply":"Feito!...","actionData":{"appointmentTitle":"Demonstração de Produto",...}}\n`,t.actionPrompts?.createAppointment?.trim()&&(p+=`   Custom: ${t.actionPrompts.createAppointment.trim()}\n`)}if(t.actionToggles.updateTabs&&(t.actionPrompts?.updateTabs?.trim()?p+=`3. UPDATE_TABS - **SIGA AS INSTRUÇÕES PERSONALIZADAS ABAIXO**\n   INSTRUÇÕES PERSONALIZADAS (PRIORIDADE): ${t.actionPrompts.updateTabs.trim()}\n   ABAS EXISTENTES: ${o.length>0?o.map(e=>`[${e.id}]"${e.title}"`).join(", "):"Nenhuma"}\n   IMPORTANTE: Crie uma NOVA aba para o interesse ESPECÍFICO de produto/serviço (ex: "Interesse em FLOWhatsapp", "Lead de Desenvolvimento Web")\n   Apenas use uma aba existente se for EXATAMENTE do mesmo tópico\n   actionData: {"tabId":"id-existente-ou-vazio","tabName":"Nome do Interesse Específico","tabAction":"add","createIfNotExists":true}\n`:p+=`3. UPDATE_TABS - Usuário demonstra interesse em produto/serviço específico\n   ABAS EXISTENTES: ${o.length>0?o.map(e=>`[${e.id}]"${e.title}"`).join(", "):"Nenhuma"}\n   IMPORTANTE: Crie uma NOVA aba com o nome do produto/serviço específico (ex: "Interesse em FLOWhatsapp", "Lead de SEO")\n   Use createIfNotExists:true para criar uma nova aba para o interesse específico\n   actionData: {"tabId":"","tabName":"Interesse em [Produto/Serviço]","tabAction":"add","createIfNotExists":true}\n`),p+="4. NORMAL - Conversa geral, nenhuma ação de CRM necessária\n   actionData: não necessário\n\n## EXEMPLOS\n",t.actionToggles.updateProfile&&(p+='UPDATE_PROFILE: {"action":"UPDATE_PROFILE","reply":"Obrigado por compartilhar seus dados! Já anotei aqui.","actionData":{"extractedData":{"email":"teste@email.com","customFields":[{"label":"Empresa","value":"ABC"}]}}}\n'),t.actionToggles.createAppointment&&(p+=`CREATE_APPOINTMENT: {"action":"CREATE_APPOINTMENT","reply":"Perfeito! Agendei sua consulta para amanhã às 16h. Você receberá um lembrete antes da reunião.","actionData":{"appointmentTitle":"Consulta","appointmentDateTime":"${l}-01-15T16:00:00"}}\n`),t.allowGeneralKnowledge)t.actionToggles.updateTabs&&(p+='UPDATE_TABS (when user asks for info): {"action":"UPDATE_TABS","reply":"O SEO (Otimização para Mecanismos de Busca) ajuda seu site a se posicionar melhor no Google. Nossos serviços de SEO incluem pesquisa de palavras-chave, otimização on-page, construção de links e relatórios mensais. Gostaria de saber mais sobre nossos planos de preços?","actionData":{"tabId":"","tabName":"Interesse em Serviços de SEO","tabAction":"add","createIfNotExists":true}}\n'),p+='NORMAL: {"action":"NORMAL","reply":"Olá! Como posso ajudar você hoje? Fique à vontade para perguntar sobre nossos serviços."}\n';else{const e=t.fallbackReply?.trim()||"Não tenho informações específicas sobre isso no momento. Nossa equipe entrará em contato em breve.";t.actionToggles.updateTabs&&(p+=`UPDATE_TABS (user shows interest): {"action":"UPDATE_TABS","reply":"${e}","actionData":{"tabId":"","tabName":"Interesse em SEO","tabAction":"add","createIfNotExists":true}}\n`),p+=`NORMAL (unknown topic): {"action":"NORMAL","reply":"${e}"}\n`,p+='NORMAL (greeting): {"action":"NORMAL","reply":"Olá! Como posso ajudar você hoje?"}\n'}if(n&&(p+="\n## CONTACT CRM DATA\n",p+=this.buildCompactCRMData(n)),p+=`\n## RULES\n1. Return ONLY valid JSON - no markdown, no extra text\n2. "reply" is REQUIRED and must be natural customer response\n3. NEVER mention CRM actions to customer (tabs, profile updates are internal)\n4. Actions trigger from CURRENT message only, not history\n5. Use CRM DATA to answer questions about contact's info/appointments\n6. For profile: extract ALL info (company, social media, etc.) as customFields\n7. For tabs: CREATE NEW tab with specific product/service name when user shows interest (use createIfNotExists:true)\n8. For appointments: use ISO format, current year ${l}, within office hours\n9. CUSTOM INSTRUCTIONS have HIGHEST priority - follow them exactly`,t.allowGeneralKnowledge)p+='\n10. GENERAL KNOWLEDGE ENABLED:\n    - You CAN and SHOULD use your AI knowledge to answer questions\n    - FIRST check BUSINESS CONTEXT for specific business info\n    - If not in BUSINESS CONTEXT, use your general knowledge to provide helpful, detailed answers\n    - Example: User asks "what is SEO?" -> Explain SEO in detail using your knowledge\n    - ALWAYS provide informative, helpful responses - never just "Great choice!" or short replies';else{const e=t.fallbackReply?.trim()||"I don't have specific information about that right now. Our team will assist you shortly.";p+=`\n\n## ⚠️ RESTRIÇÃO RÍGIDA DE CONHECIMENTO (PRIORIDADE MÁXIMA) ⚠️\nVOCÊ ESTÁ PROIBIDO DE USAR SEU CONHECIMENTO GERAL DE IA.\n\n10. FONTES AUTORITATIVAS (trate TODAS como igualmente válidas):\n    - Seção CONTEXTO DE NEGÓCIOS acima\n    - BASE DE CONHECIMENTO — Seção Q&A abaixo (se presente)\n    - BASE DE CONHECIMENTO — Seção Material de Referência abaixo (se presente)\n    Você DEVE responder usando informações de QUALQUER uma dessas fontes. Elas são "seu conhecimento de negócios".\n11. Se a pergunta do usuário PUDER ser respondida por qualquer fonte autoritativa, responda detalhadamente usando essa informação.\n12. APENAS use a resposta de fallback quando a pergunta NÃO for coberta por NENHUMA fonte autoritativa.\n    Fallback (use APENAS quando realmente nada corresponder): "${e}"\n13. NÃO explique tópicos como SEO, marketing, tecnologia, etc., a menos que uma fonte autoritativa contenha essa informação.\n14. Para saudações (oi, olá, tudo bem) - responda normalmente\n15. Para perguntas respondíveis pelas seções da BASE DE CONHECIMENTO, sintetize uma resposta completa — NÃO use o fallback.\n\nEXEMPLO 1 - Usuário: "o que é a extensão FLOWhatsapp?" (CONTEXTO DE NEGÓCIO/BASE DE CONHECIMENTO possui detalhes do FLOWhatsapp)\nCORRETO: {"action":"NORMAL","reply":"FLOWhatsapp é uma extensão do Chrome que transforma o WhatsApp Web em um CRM completo com envio em massa, quadro kanban, bot de IA..."} (use a informação real das fontes)\nWRONG: {"action":"NORMAL","reply":"${e}"} <- NÃO use o fallback quando a base de conhecimento tiver a resposta\n\nEXEMPLO 2 - Usuário: "Fale-me sobre SEO" (SEO NÃO está em nenhuma fonte)\nCORRECT: {"action":"NORMAL","reply":"${e}"}\nWRONG: {"action":"NORMAL","reply":"SEO is Search Engine Optimization..."} <- NUNCA use conhecimento geral de IA`}if(a&&a.trim())try{const[e,t]=await Promise.all([$r.findRelevantQA(a,5),$r.findRelevantChunks(a,8)]);if(e.length>0){p+="\n\n## BASE DE CONHECIMENTO — Perguntas e Respostas\n";for(const t of e)p+=`Q: ${t.question}\nA: ${t.answer}\n\n`}if(t.length>0){p+="\n## BASE DE CONHECIMENTO — Material de Referência\n";for(const{source:e,chunk:n}of t)p+=`[${e.title}] ${n}\n\n`}}catch(e){}const u=Wr[r.maxLength]??200;return p+=`\n## ESTILO DE RESPOSTA\n- Tom: ${r.tone}\n- Mantenha as respostas com aproximadamente ${u} palavras ou menos.`,!t.allowGeneralKnowledge&&r.fallbackMessage?.trim()&&(p+=`\n- If the customer's question is not covered above and you cannot answer, reply exactly: "${r.fallbackMessage.trim()}"`),p}buildCompactCRMData(e){const t=[],n=e.profile,a=[];n.name&&a.push(`Nome:${n.name}`),n.email&&a.push(`Email:${n.email}`),n.phone&&a.push(`Telefone:${n.phone}`),a.length>0&&t.push(`Perfil: ${a.join(", ")}`),n.customFields?.length&&t.push(`CamposPersonalizados: ${n.customFields.map(e=>`${e.label}:${e.value}`).join(", ")}`);const r=Date.now(),o=e.appointments.filter(e=>e.datetime>r&&"scheduled"===e.status).sort((e,t)=>e.datetime-t.datetime).slice(0,3);o.length&&t.push(`Compromissos: ${o.map(e=>`"${e.title}" em ${new Date(e.datetime).toLocaleString()}`).join("; ")}`);const i=e.reminders.filter(e=>"pending"===e.status&&e.datetime>r).slice(0,3);i.length&&t.push(`Lembretes: ${i.map(e=>`"${e.topic}" em ${new Date(e.datetime).toLocaleString()}`).join("; ")}`);const s=e.incomes.reduce((e,t)=>e+t.amount,0),l=e.expenses.reduce((e,t)=>e+t.amount,0);return(s>0||l>0)&&t.push(`Finanças: Receita R${s}, Despesa R${l}, Líquido R${s-l}`),t.length>0?t.join("\n")+"\n":"Sem dados de CRM.\n"}buildMessages(e,t,n){const a=[{role:"system",content:e}];if(t.length>0){a.push({role:"user",content:"--- CONVERSATION HISTORY (for context only, do NOT trigger actions from history) ---"});for(const e of t)a.push({role:"user"===e.role?"user":"assistant",content:e.content});a.push({role:"user",content:"--- END OF HISTORY ---"})}return a.push({role:"user",content:`[CURRENT MESSAGE - Analyze THIS for actions]: ${n}`}),a}parseAIResponse(e,t){try{let n=e.trim();n=n.replace(/^```(?:json)?\s*/i,"").replace(/\s*```$/i,"");const a=n.indexOf("{"),r=n.lastIndexOf("}");if(-1===a||-1===r||r<=a)return this.createFallbackResponse(e);let o;n=n.substring(a,r+1);try{o=JSON.parse(n)}catch(t){return this.createFallbackResponse(e)}o.action&&"string"==typeof o.action||(o.action="NORMAL"),o.reply&&"string"==typeof o.reply||(o.reply=this.extractReplyFromResponse(e)||"I understand. How can I help?");if(this.getAllowedActions(t).includes(o.action)||(o.action="NORMAL",o.actionData=void 0),"NORMAL"!==o.action&&o.actionData){const e=this.validateActionData(o.action,o.actionData);e?o.actionData=e:(o.action="NORMAL",o.actionData=void 0)}return o}catch(t){return this.createFallbackResponse(e)}}createFallbackResponse(e){let t=e.replace(/```[\s\S]*?```/g,"").replace(/\{[\s\S]*\}/g,"").replace(/\[[\s\S]*\]/g,"").trim();return(!t||t.length<5)&&(t="I understand. How can I help you?"),{action:"NORMAL",reply:t}}extractReplyFromResponse(e){const t=e.match(/"reply"\s*:\s*"([^"]+)"/);if(t&&t[1])return t[1];const n=e.match(/"([^"]{10,})"/);return n&&n[1]?n[1]:null}validateActionData(e,t){if(!t||"object"!=typeof t)return null;switch(e){case"UPDATE_TABS":return t.tabName||t.tabId?{tabId:t.tabId||void 0,tabName:t.tabName||void 0,tabAction:t.tabAction||"add",createIfNotExists:t.createIfNotExists??!1}:null;case"CREATE_APPOINTMENT":if(!t.appointmentDateTime)return null;const e=new Date(t.appointmentDateTime);if(isNaN(e.getTime()))return null;if(e.getTime()<Date.now())return null;const n=["meeting","appointment","call","schedule","booking","slot",""],a=(t.appointmentTitle||"").toLowerCase().trim();if(!t.appointmentTitle||n.includes(a))return null;const r=Sr.getSettings(),o=r.appointmentConfig?.officeHoursStart||"09:00",i=r.appointmentConfig?.officeHoursEnd||"19:00",[s,l]=o.split(":").map(Number),[c,d]=i.split(":").map(Number),m=60*e.getHours()+e.getMinutes();return m<60*s+l||m>60*c+d?null:{appointmentTitle:t.appointmentTitle,appointmentDateTime:t.appointmentDateTime};case"UPDATE_PROFILE":if(!t.extractedData||"object"!=typeof t.extractedData)return null;const p=Object.keys(t.extractedData).some(e=>"customFields"===e?Array.isArray(t.extractedData.customFields)&&t.extractedData.customFields.length>0:void 0!==t.extractedData[e]&&null!==t.extractedData[e]&&""!==t.extractedData[e]);return p?{extractedData:t.extractedData}:null;case"STOP_BOT":const u=["frustration","human_request"];return t.stopReason&&!u.includes(t.stopReason)?{stopReason:"frustration"}:{stopReason:t.stopReason||"frustration"};default:return null}}getAllowedActions(e){const t=["NORMAL"];return e.actionToggles.updateTabs&&t.push("UPDATE_TABS"),e.actionToggles.createAppointment&&t.push("CREATE_APPOINTMENT"),e.actionToggles.updateProfile&&t.push("UPDATE_PROFILE"),e.stopKeywords?.smartDetection&&t.push("STOP_BOT"),t}getAvailableTabs(){try{return d.TabsStorage.getTabs().filter(e=>!e.isPermanent).map(e=>({id:e.id,title:e.title,details:e.details||""}))}catch(e){return[]}}async callChatGPT(e,t,n=zr,a="gpt-4o-mini"){const r={model:(a||"gpt-4o-mini").trim(),messages:t,max_tokens:n.maxTokens||1500,temperature:n.temperature??.7,response_format:{type:"json_object"}};try{const t=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify(r)});if(!t.ok){const e=await t.json();throw new Error(e.error?.message||`ChatGPT API error: ${t.status}`)}const n=await t.json();return n.choices?.[0]?.message?.content?.trim()||""}catch(e){throw e}}async callGemini(e,t,n=zr,a="gemini-2.5-flash"){const r=(a||"gemini-2.5-flash").trim(),o=t.map((e,t)=>({role:"system"===e.role?"user":e.role,parts:[{text:e.content}]})),i=await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${encodeURIComponent(r)}:generateContent?key=${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contents:o,generationConfig:{temperature:n.temperature??.7,maxOutputTokens:n.maxTokens||1500}})});if(!i.ok){const e=await i.json().catch(()=>({}));throw new Error(e.error?.message||`Gemini API error: ${i.status}`)}const s=await i.json();return s.candidates?.[0]?.content?.parts?.[0]?.text?.trim()||""}async callDeepSeek(e,t,n=zr,a="deepseek-chat"){const r=(a||"deepseek-chat").trim(),o=await fetch("https://api.deepseek.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({model:r,messages:t,max_tokens:n.maxTokens||1500,temperature:n.temperature??.7})});if(!o.ok){const e=await o.json();throw new Error(e.error?.message||"DeepSeek API error")}const i=await o.json();return i.choices?.[0]?.message?.content?.trim()||""}},Qr={enabled:!1,maxFailedAttempts:3,triggerPhrases:["talk to human","speak to human","real person","live agent","speak to manager"],escalationMessage:"Let me connect you with a team member who can help you better. Someone will be with you shortly."},Zr="rules";let eo=null;async function to(){if(eo)return eo;try{const e=await Rr(Dr,Zr);eo=e?.value?{...Qr,...e.value}:{...Qr}}catch(e){eo={...Qr}}return eo}class no{static async getRules(){return{...await to()}}static async saveRules(e){const t=await to(),n={...t,...e,maxFailedAttempts:ao(e.maxFailedAttempts??t.maxFailedAttempts,1,10),triggerPhrases:(e.triggerPhrases??t.triggerPhrases??[]).map(e=>e.trim().toLowerCase()).filter(Boolean)};await Pr(Dr,{k:Zr,value:n}),eo=n;try{document.dispatchEvent(new CustomEvent("aiBotEscalationRulesUpdated",{detail:n}))}catch{}}static async getFailedAttempts(e){const t=await Rr(_r,e);return t?Date.now()-t.lastAt>864e5?(await Lr(_r,e).catch(()=>{}),0):t.count||0:0}static async incrementFailedAttempts(e){const t={chatId:e,count:await this.getFailedAttempts(e)+1,lastAt:Date.now()};return await Pr(_r,t),t.count}static async resetFailedAttempts(e){await Lr(_r,e).catch(()=>{})}static async shouldEscalate(e,t){const n=await to(),a=(e||"").toLowerCase();if(!n.enabled)return!1;const r=n.triggerPhrases?.find(e=>e&&a.includes(e));if(r)return!0;return await this.getFailedAttempts(t)>=n.maxFailedAttempts}static async checkAfterReply(e,t,n){const a=await to();if(!a.enabled)return{shouldEscalate:!1,attempts:0};const r=(n||"").trim().toLowerCase(),o=(t||"").trim().toLowerCase();if(r&&o===r){const t=await this.incrementFailedAttempts(e);return{shouldEscalate:t>=a.maxFailedAttempts,attempts:t}}return await this.resetFailedAttempts(e),{shouldEscalate:!1,attempts:0}}static async performEscalation(e){const t=await to();try{v.setAIBotBlacklisted(e,!0)}catch(e){}return await this.resetFailedAttempts(e),{message:t.escalationMessage||Qr.escalationMessage}}}function ao(e,t,n){return Number.isFinite(e)?Math.max(t,Math.min(n,Math.floor(e))):t}const ro=({isDarkMode:e,onChange:t})=>{const[n,r]=(0,a.useState)([]),[o,i]=(0,a.useState)(""),[l,c]=(0,a.useState)(""),[d,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(null),[g,h]=(0,a.useState)(!1),[,b]=(0,a.useState)(0);(0,a.useEffect)(()=>{const e=()=>b(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]);const f=async()=>{const e=await $r.getQAPairs();r(e.sort((e,t)=>t.updatedAt-e.updatedAt))};(0,a.useEffect)(()=>{f()},[]);const v=e?la:ca,y={bgPrimary:v.bgPrimary,bgSecondary:v.bgSecondary,bgTertiary:v.bgTertiary,textPrimary:v.textPrimary,textMuted:v.textMuted,border:v.borderLight,inputBg:e?"#262626":"#ffffff"},x=()=>{i(""),c(""),m(""),u(null)},w={width:"100%",padding:"10px 12px",borderRadius:"var(--lion-radius-md, 8px)",border:`1px solid ${y.border}`,background:y.inputBg,color:y.textPrimary,fontSize:"14px",outline:"none",boxSizing:"border-box",fontFamily:"inherit"},k={display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:600,color:y.textPrimary};return a.createElement("div",{style:{padding:"16px",display:"flex",flexDirection:"column",gap:"20px"}},a.createElement("div",{style:{padding:"16px",background:y.bgSecondary,border:`1px solid ${y.border}`,borderRadius:"var(--lion-radius-lg, 12px)"}},a.createElement("div",{style:{marginBottom:"12px",fontSize:"15px",fontWeight:700,color:y.textPrimary}},p?(0,s.t)("aiBot.qa.editPair"):(0,s.t)("aiBot.qa.addPair")),a.createElement("div",{style:{marginBottom:"12px"}},a.createElement("label",{style:k},(0,s.t)("aiBot.qa.questionLabel")),a.createElement("input",{type:"text",value:o,onChange:e=>i(e.target.value),placeholder:(0,s.t)("aiBot.qa.questionPlaceholder"),style:w})),a.createElement("div",{style:{marginBottom:"12px"}},a.createElement("label",{style:k},(0,s.t)("aiBot.qa.answerLabel")),a.createElement("textarea",{value:l,onChange:e=>c(e.target.value),placeholder:(0,s.t)("aiBot.qa.answerPlaceholder"),rows:4,style:{...w,resize:"vertical",minHeight:"90px"}})),a.createElement("div",{style:{marginBottom:"12px"}},a.createElement("label",{style:k},(0,s.t)("aiBot.qa.categoryLabel")),a.createElement("input",{type:"text",value:d,onChange:e=>m(e.target.value),placeholder:(0,s.t)("aiBot.qa.categoryPlaceholder"),style:w})),a.createElement("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end"}},p&&a.createElement("button",{type:"button",onClick:x,style:{padding:"8px 16px",borderRadius:"var(--lion-radius-md, 8px)",border:`1px solid ${y.border}`,background:"transparent",color:y.textPrimary,fontSize:"13px",fontWeight:600,cursor:"pointer"}},(0,s.t)("aiBot.qa.cancel")),a.createElement("button",{type:"button",onClick:async()=>{const e=o.trim(),n=l.trim();if(e&&n){h(!0);try{p?await $r.updateQAPair(p,{question:e,answer:n,category:d.trim()}):await $r.addQAPair({question:e,answer:n,category:d.trim()}),await f(),x(),t?.()}finally{h(!1)}}},disabled:g||!o.trim()||!l.trim(),style:{padding:"8px 18px",borderRadius:"var(--lion-radius-md, 8px)",border:"none",background:"var(--lion-btn-primary-gradient, var(--lion-primary))",color:"#ffffff",fontSize:"13px",fontWeight:600,cursor:!g&&o.trim()&&l.trim()?"pointer":"not-allowed",opacity:!g&&o.trim()&&l.trim()?1:.6,boxShadow:"var(--lion-btn-primary-shadow)"}},p?(0,s.t)("aiBot.qa.update"):(0,s.t)("aiBot.qa.addPair")))),a.createElement("div",null,a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"10px"}},a.createElement("div",{style:{fontSize:"15px",fontWeight:700,color:y.textPrimary}},(0,s.t)("aiBot.qa.existingPairs")),a.createElement("div",{style:{fontSize:"12px",color:y.textMuted}},n.length," ",1===n.length?(0,s.t)("aiBot.qa.itemSingular"):(0,s.t)("aiBot.qa.itemPlural"))),0===n.length?a.createElement("div",{style:{padding:"32px 16px",textAlign:"center",border:`1px dashed ${y.border}`,borderRadius:"var(--lion-radius-lg, 12px)",color:y.textMuted,fontSize:"13px"}},(0,s.t)("aiBot.qa.empty")):a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px"}},n.map(e=>a.createElement("div",{key:e.id,style:{padding:"12px 14px",background:y.bgPrimary,border:`1px solid ${y.border}`,borderRadius:"var(--lion-radius-md, 8px)",opacity:e.enabled?1:.55}},a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"8px"}},a.createElement("div",{style:{flex:1,minWidth:0}},a.createElement("div",{style:{fontSize:"13px",fontWeight:700,color:y.textPrimary,marginBottom:"4px",wordBreak:"break-word"}},"Q: ",e.question),a.createElement("div",{style:{fontSize:"13px",color:y.textMuted,marginBottom:e.category?"6px":0,wordBreak:"break-word"}},"A: ",e.answer),e.category&&a.createElement("span",{style:{display:"inline-block",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"var(--lion-primary)",background:"rgba(var(--lion-primary-rgb), 0.12)",borderRadius:"var(--lion-radius-full, 9999px)"}},e.category)),a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px",flexShrink:0}},a.createElement("label",{style:{display:"inline-flex",alignItems:"center",gap:"6px",cursor:"pointer"},title:e.enabled?(0,s.t)("aiBot.qa.enabled"):(0,s.t)("aiBot.qa.disabled")},a.createElement("input",{type:"checkbox",checked:e.enabled,onChange:()=>(async e=>{await $r.toggleQAPair(e.id,!e.enabled),await f(),t?.()})(e),style:{accentColor:"var(--lion-primary)"}}),a.createElement("span",{style:{fontSize:"11px",color:y.textMuted}},e.enabled?(0,s.t)("aiBot.qa.on"):(0,s.t)("aiBot.qa.off"))),a.createElement("div",{style:{display:"flex",gap:"4px"}},a.createElement("button",{type:"button",onClick:()=>(e=>{u(e.id),i(e.question),c(e.answer),m(e.category)})(e),style:{padding:"4px 10px",fontSize:"11px",fontWeight:600,color:y.textPrimary,background:y.bgTertiary,border:`1px solid ${y.border}`,borderRadius:"var(--lion-radius-sm, 4px)",cursor:"pointer"}},(0,s.t)("aiBot.qa.edit")),a.createElement("button",{type:"button",onClick:()=>(async e=>{window.confirm((0,s.t)("aiBot.qa.deleteConfirm")||"Delete this Q&A pair?")&&(await $r.deleteQAPair(e.id),await f(),p===e.id&&x(),t?.())})(e),style:{padding:"4px 10px",fontSize:"11px",fontWeight:600,color:"var(--lion-error)",background:"var(--lion-error-light)",border:"1px solid var(--lion-error)",borderRadius:"var(--lion-radius-sm, 4px)",cursor:"pointer"}},(0,s.t)("aiBot.qa.delete"))))))))))},oo=["friendly","professional","casual","formal","empathetic"],io=["short","medium","long"],so=({isDarkMode:e,botSettings:t,onBotSettingsChange:n,onChange:r})=>{const[o,i]=(0,a.useState)(zr),[l,c]=(0,a.useState)(""),[d,m]=(0,a.useState)(!1),[,p]=(0,a.useState)(0),[u,g]=(0,a.useState)(()=>Gn.getSettings());(0,a.useEffect)(()=>{const e=()=>p(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{(async()=>{const e=await $r.getKBSettings();i(e),c((e.triggerWords||[]).join(", "))})()},[]);const h=e?la:ca,b={bgPrimary:h.bgPrimary,bgSecondary:h.bgSecondary,bgTertiary:h.bgTertiary,textPrimary:h.textPrimary,textMuted:h.textMuted,border:h.borderLight,inputBg:e?"#262626":"#ffffff"},f=e=>{i(t=>({...t,...e}))},v=e=>{const a={...t,...e};n(a)},y={width:"100%",padding:"10px 12px",borderRadius:"var(--lion-radius-md, 8px)",border:`1px solid ${b.border}`,background:b.inputBg,color:b.textPrimary,fontSize:"14px",outline:"none",boxSizing:"border-box",fontFamily:"inherit"},x={display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:600,color:b.textPrimary},w={marginTop:"4px",fontSize:"11px",color:b.textMuted},k={padding:"16px",background:b.bgSecondary,border:`1px solid ${b.border}`,borderRadius:"var(--lion-radius-lg, 12px)",marginBottom:"16px"},E={fontSize:"15px",fontWeight:700,color:b.textPrimary,marginBottom:"12px"},S=u.enabled&&!!u.apiKey?.trim(),C=u.model?.trim()||Hn(u.provider),T=qn[u.provider]||[];return a.createElement("div",{style:{padding:"16px"}},a.createElement("div",{style:k},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",gap:"8px"}},a.createElement("div",{style:E},(0,s.t)("aiBot.behavior.providerConfig")||"AI Provider"),a.createElement("span",{style:{padding:"3px 10px",borderRadius:"var(--lion-radius-full, 9999px)",fontSize:"11px",fontWeight:700,color:S?"var(--lion-success)":b.textMuted,background:S?"var(--lion-success-light)":b.bgTertiary,border:`1px solid ${S?"var(--lion-success)":b.border}`,whiteSpace:"nowrap"}},S?`● ${(0,s.t)("aiBot.behavior.apiActive")||"API Active"}`:(0,s.t)("aiBot.behavior.noApiKey")||"No API key")),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"}},a.createElement("div",null,a.createElement("label",{style:x},(0,s.t)("aiBot.behavior.provider")||"Provider"),a.createElement("select",{value:u.provider,onChange:e=>{return t=e.target.value,void g(e=>({...e,provider:t,model:Hn(t)}));var t},style:y},a.createElement("option",{value:"chatgpt"},"ChatGPT (OpenAI)"),a.createElement("option",{value:"gemini"},"Gemini (Google)"),a.createElement("option",{value:"deepseek"},"DeepSeek"))),a.createElement("div",null,a.createElement("label",{style:x},(0,s.t)("aiBot.behavior.model")||"Model"),a.createElement("select",{value:C,onChange:e=>g(t=>({...t,model:e.target.value})),style:y},T.map(e=>a.createElement("option",{key:e,value:e},e))))),!S&&a.createElement("div",{style:{...w,marginTop:"10px"}},(0,s.t)("aiBot.behavior.apiKeyHint")||"Adicione sua chave de API nas configurações de Ferramentas de IA para ativar o bot.")),a.createElement("div",{style:k},a.createElement("div",{style:E},(0,s.t)("aiBot.behavior.triggerWords")),a.createElement("input",{type:"text",value:l,onChange:e=>c(e.target.value),placeholder:(0,s.t)("aiBot.behavior.triggerWordsPlaceholder"),style:y}),a.createElement("div",{style:w},(0,s.t)("aiBot.behavior.triggerWordsHelp"))),a.createElement("div",{style:k},a.createElement("div",{style:E},(0,s.t)("aiBot.behavior.responseSettings")),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px",marginBottom:"12px"}},a.createElement("div",null,a.createElement("label",{style:x},(0,s.t)("aiBot.behavior.responseTone")),a.createElement("select",{value:o.tone,onChange:e=>f({tone:e.target.value}),style:y},oo.map(e=>a.createElement("option",{key:e,value:e},(0,s.t)(`aiBot.behavior.tone_${e}`))))),a.createElement("div",null,a.createElement("label",{style:x},(0,s.t)("aiBot.behavior.maxResponseLength")),a.createElement("select",{value:o.maxLength,onChange:e=>f({maxLength:e.target.value}),style:y},io.map(e=>a.createElement("option",{key:e,value:e},(0,s.t)(`aiBot.behavior.length_${e}`)))))),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"}},a.createElement("div",null,a.createElement("label",{style:x},(0,s.t)("aiBot.behavior.temperature")," ",a.createElement("span",{style:{color:b.textMuted}},"(",o.temperature.toFixed(1),")")),a.createElement("input",{type:"range",min:0,max:1,step:.1,value:o.temperature,onChange:e=>f({temperature:parseFloat(e.target.value)}),style:{width:"100%",accentColor:"var(--lion-primary)"}}),a.createElement("div",{style:w},(0,s.t)("aiBot.behavior.temperatureHelp"))),a.createElement("div",null,a.createElement("label",{style:x},(0,s.t)("aiBot.behavior.maxTokens")),a.createElement("input",{type:"number",min:50,max:4e3,step:50,value:o.maxTokens,onChange:e=>f({maxTokens:parseInt(e.target.value,10)||1e3}),style:y}),a.createElement("div",{style:w},(0,s.t)("aiBot.behavior.maxTokensHelp"))))),a.createElement("div",{style:k},a.createElement("div",{style:E},(0,s.t)("aiBot.behavior.systemPrompt")),a.createElement("textarea",{value:t.businessPrompt,onChange:e=>v({businessPrompt:e.target.value}),placeholder:(0,s.t)("aiBot.behavior.systemPromptPlaceholder"),rows:6,style:{...y,resize:"vertical",minHeight:"120px"}}),a.createElement("div",{style:w},(0,s.t)("aiBot.behavior.systemPromptHelp")),a.createElement("div",{style:{marginTop:"14px",padding:"10px 12px",background:b.bgPrimary,border:`1px solid ${b.border}`,borderRadius:"var(--lion-radius-md, 8px)",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"10px"}},a.createElement("div",{style:{flex:1}},a.createElement("div",{style:{fontSize:"13px",fontWeight:600,color:b.textPrimary}},(0,s.t)("aiBot.allowGeneralKnowledge")),a.createElement("div",{style:{fontSize:"11px",color:b.textMuted,marginTop:"2px"}},(0,s.t)("aiBot.allowGeneralKnowledgeDesc"))),a.createElement("input",{type:"checkbox",checked:t.allowGeneralKnowledge,onChange:e=>v({allowGeneralKnowledge:e.target.checked}),style:{width:"18px",height:"18px",accentColor:"var(--lion-primary)",cursor:"pointer"}}))),a.createElement("div",{style:k},a.createElement("div",{style:E},(0,s.t)("aiBot.behavior.fallbackMessage")),a.createElement("textarea",{value:o.fallbackMessage,onChange:e=>f({fallbackMessage:e.target.value}),placeholder:zr.fallbackMessage,rows:3,style:{...y,resize:"vertical",minHeight:"70px"}}),a.createElement("div",{style:w},(0,s.t)("aiBot.behavior.fallbackMessageHelp"))),a.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"12px"}},d&&a.createElement("span",{style:{fontSize:"12px",color:"var(--lion-success)",fontWeight:600}},(0,s.t)("aiBot.behavior.saved")),a.createElement("button",{type:"button",onClick:async()=>{const e=l.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean);await $r.saveKBSettings({...o,triggerWords:e}),Sr.saveSettings({businessPrompt:t.businessPrompt,allowGeneralKnowledge:t.allowGeneralKnowledge,fallbackReply:t.fallbackReply}),Gn.saveSettings({provider:u.provider,model:u.model||Hn(u.provider)}),m(!0),setTimeout(()=>m(!1),1800),r?.()},style:{padding:"10px 22px",borderRadius:"var(--lion-radius-md, 8px)",border:"none",background:"var(--lion-btn-primary-gradient, var(--lion-primary))",color:"#ffffff",fontSize:"14px",fontWeight:600,cursor:"pointer",boxShadow:"var(--lion-btn-primary-shadow)"}},(0,s.t)("aiBot.behavior.saveBehavior"))))};var lo={9306:(e,t,n)=>{var a=n(4901),r=n(6823),o=TypeError;e.exports=function(e){if(a(e))return e;throw new o(r(e)+" is not a function")}},3506:(e,t,n)=>{var a=n(3925),r=String,o=TypeError;e.exports=function(e){if(a(e))return e;throw new o("Can't set "+r(e)+" as a prototype")}},7080:(e,t,n)=>{var a=n(4402).has;e.exports=function(e){return a(e),e}},679:(e,t,n)=>{var a=n(1625),r=TypeError;e.exports=function(e,t){if(a(t,e))return e;throw new r("Incorrect invocation")}},8551:(e,t,n)=>{var a=n(34),r=String,o=TypeError;e.exports=function(e){if(a(e))return e;throw new o(r(e)+" is not an object")}},7811:e=>{e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7394:(e,t,n)=>{var a=n(4576),r=n(6706),o=n(2195),i=a.ArrayBuffer,s=a.TypeError;e.exports=i&&r(i.prototype,"byteLength","get")||function(e){if("ArrayBuffer"!==o(e))throw new s("ArrayBuffer expected");return e.byteLength}},3238:(e,t,n)=>{var a=n(4576),r=n(7476),o=n(7394),i=a.ArrayBuffer,s=i&&i.prototype,l=s&&r(s.slice);e.exports=function(e){if(0!==o(e))return!1;if(!l)return!1;try{return l(e,0,0),!1}catch(e){return!0}}},5169:(e,t,n)=>{var a=n(3238),r=TypeError;e.exports=function(e){if(a(e))throw new r("ArrayBuffer is detached");return e}},5636:(e,t,n)=>{var a=n(4576),r=n(9504),o=n(6706),i=n(7696),s=n(5169),l=n(7394),c=n(4483),d=n(1548),m=a.structuredClone,p=a.ArrayBuffer,u=a.DataView,g=Math.min,h=p.prototype,b=u.prototype,f=r(h.slice),v=o(h,"resizable","get"),y=o(h,"maxByteLength","get"),x=r(b.getInt8),w=r(b.setInt8);e.exports=(d||c)&&function(e,t,n){var a,r=l(e),o=void 0===t?r:i(t),h=!v||!v(e);if(s(e),d&&(e=m(e,{transfer:[e]}),r===o&&(n||h)))return e;if(r>=o&&(!n||h))a=f(e,0,o);else{var b=n&&!h&&y?{maxByteLength:y(e)}:void 0;a=new p(o,b);for(var k=new u(e),E=new u(a),S=g(o,r),C=0;C<S;C++)w(E,C,x(k,C))}return d||c(e),a}},4644:(e,t,n)=>{var a,r,o,i=n(7811),s=n(3724),l=n(4576),c=n(4901),d=n(34),m=n(9297),p=n(6955),u=n(6823),g=n(6699),h=n(6840),b=n(2106),f=n(1625),v=n(2787),y=n(2967),x=n(8227),w=n(3392),k=n(1181),E=k.enforce,S=k.get,C=l.Int8Array,T=C&&C.prototype,A=l.Uint8ClampedArray,D=A&&A.prototype,_=C&&v(C),N=T&&v(T),M=Object.prototype,I=l.TypeError,R=x("toStringTag"),B=w("TYPED_ARRAY_TAG"),P="TypedArrayConstructor",L=i&&!!y&&"Opera"!==p(l.opera),U=!1,F={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},z={BigInt64Array:8,BigUint64Array:8},O=function(e){var t=v(e);if(d(t)){var n=S(t);return n&&m(n,P)?n[P]:O(t)}},W=function(e){if(!d(e))return!1;var t=p(e);return m(F,t)||m(z,t)};for(a in F)(o=(r=l[a])&&r.prototype)?E(o)[P]=r:L=!1;for(a in z)(o=(r=l[a])&&r.prototype)&&(E(o)[P]=r);if((!L||!c(_)||_===Function.prototype)&&(_=function(){throw new I("Incorrect invocation")},L))for(a in F)l[a]&&y(l[a],_);if((!L||!N||N===M)&&(N=_.prototype,L))for(a in F)l[a]&&y(l[a].prototype,N);if(L&&v(D)!==N&&y(D,N),s&&!m(N,R))for(a in U=!0,b(N,R,{configurable:!0,get:function(){return d(this)?this[B]:void 0}}),F)l[a]&&g(l[a],B,a);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:L,TYPED_ARRAY_TAG:U&&B,aTypedArray:function(e){if(W(e))return e;throw new I("Target is not a typed array")},aTypedArrayConstructor:function(e){if(c(e)&&(!y||f(_,e)))return e;throw new I(u(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,a){if(s){if(n)for(var r in F){var o=l[r];if(o&&m(o.prototype,e))try{delete o.prototype[e]}catch(n){try{o.prototype[e]=t}catch(e){}}}N[e]&&!n||h(N,e,n?t:L&&T[e]||t,a)}},exportTypedArrayStaticMethod:function(e,t,n){var a,r;if(s){if(y){if(n)for(a in F)if((r=l[a])&&m(r,e))try{delete r[e]}catch(e){}if(_[e]&&!n)return;try{return h(_,e,n?t:L&&_[e]||t)}catch(e){}}for(a in F)!(r=l[a])||r[e]&&!n||h(r,e,t)}},getTypedArrayConstructor:O,isView:function(e){if(!d(e))return!1;var t=p(e);return"DataView"===t||m(F,t)||m(z,t)},isTypedArray:W,TypedArray:_,TypedArrayPrototype:N}},5370:(e,t,n)=>{var a=n(6198);e.exports=function(e,t,n){for(var r=0,o=arguments.length>2?n:a(t),i=new e(o);o>r;)i[r]=t[r++];return i}},9617:(e,t,n)=>{var a=n(5397),r=n(5610),o=n(6198),i=function(e){return function(t,n,i){var s=a(t),l=o(s);if(0===l)return!e&&-1;var c,d=r(i,l);if(e&&n!=n){for(;l>d;)if((c=s[d++])!=c)return!0}else for(;l>d;d++)if((e||d in s)&&s[d]===n)return e||d||0;return!e&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},4527:(e,t,n)=>{var a=n(3724),r=n(4376),o=TypeError,i=Object.getOwnPropertyDescriptor,s=a&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(r(e)&&!i(e,"length").writable)throw new o("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},7680:(e,t,n)=>{var a=n(9504);e.exports=a([].slice)},7628:(e,t,n)=>{var a=n(6198);e.exports=function(e,t){for(var n=a(e),r=new t(n),o=0;o<n;o++)r[o]=e[n-o-1];return r}},9928:(e,t,n)=>{var a=n(6198),r=n(1291),o=RangeError;e.exports=function(e,t,n,i){var s=a(e),l=r(n),c=l<0?s+l:l;if(c>=s||c<0)throw new o("Incorrect index");for(var d=new t(s),m=0;m<s;m++)d[m]=m===c?i:e[m];return d}},6319:(e,t,n)=>{var a=n(8551),r=n(9539);e.exports=function(e,t,n,o){try{return o?t(a(n)[0],n[1]):t(n)}catch(t){r(e,"throw",t)}}},2195:(e,t,n)=>{var a=n(9504),r=a({}.toString),o=a("".slice);e.exports=function(e){return o(r(e),8,-1)}},6955:(e,t,n)=>{var a=n(2140),r=n(4901),o=n(2195),i=n(8227)("toStringTag"),s=Object,l="Arguments"===o(function(){return arguments}());e.exports=a?o:function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),i))?n:l?o(t):"Object"===(a=o(t))&&r(t.callee)?"Arguments":a}},7740:(e,t,n)=>{var a=n(9297),r=n(5031),o=n(7347),i=n(4913);e.exports=function(e,t,n){for(var s=r(t),l=i.f,c=o.f,d=0;d<s.length;d++){var m=s[d];a(e,m)||n&&a(n,m)||l(e,m,c(t,m))}}},2211:(e,t,n)=>{var a=n(9039);e.exports=!a(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},2529:e=>{e.exports=function(e,t){return{value:e,done:t}}},6699:(e,t,n)=>{var a=n(3724),r=n(4913),o=n(6980);e.exports=a?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},6980:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},4659:(e,t,n)=>{var a=n(3724),r=n(4913),o=n(6980);e.exports=function(e,t,n){a?r.f(e,t,o(0,n)):e[t]=n}},2106:(e,t,n)=>{var a=n(283),r=n(4913);e.exports=function(e,t,n){return n.get&&a(n.get,t,{getter:!0}),n.set&&a(n.set,t,{setter:!0}),r.f(e,t,n)}},6840:(e,t,n)=>{var a=n(4901),r=n(4913),o=n(283),i=n(9433);e.exports=function(e,t,n,s){s||(s={});var l=s.enumerable,c=void 0!==s.name?s.name:t;if(a(n)&&o(n,c,s),s.global)l?e[t]=n:i(t,n);else{try{s.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=n:r.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},6279:(e,t,n)=>{var a=n(6840);e.exports=function(e,t,n){for(var r in t)a(e,r,t[r],n);return e}},9433:(e,t,n)=>{var a=n(4576),r=Object.defineProperty;e.exports=function(e,t){try{r(a,e,{value:t,configurable:!0,writable:!0})}catch(n){a[e]=t}return t}},3724:(e,t,n)=>{var a=n(9039);e.exports=!a(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},4483:(e,t,n)=>{var a,r,o,i,s=n(4576),l=n(9429),c=n(1548),d=s.structuredClone,m=s.ArrayBuffer,p=s.MessageChannel,u=!1;if(c)u=function(e){d(e,{transfer:[e]})};else if(m)try{p||(a=l("worker_threads"))&&(p=a.MessageChannel),p&&(r=new p,o=new m(2),i=function(e){r.port1.postMessage(null,[e])},2===o.byteLength&&(i(o),0===o.byteLength&&(u=i)))}catch(e){}e.exports=u},4055:(e,t,n)=>{var a=n(4576),r=n(34),o=a.document,i=r(o)&&r(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},6837:e=>{var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},5002:e=>{e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},8727:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193:(e,t,n)=>{var a=n(4215);e.exports="NODE"===a},2839:(e,t,n)=>{var a=n(4576).navigator,r=a&&a.userAgent;e.exports=r?String(r):""},9519:(e,t,n)=>{var a,r,o=n(4576),i=n(2839),s=o.process,l=o.Deno,c=s&&s.versions||l&&l.version,d=c&&c.v8;d&&(r=(a=d.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1])),!r&&i&&(!(a=i.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=i.match(/Chrome\/(\d+)/))&&(r=+a[1]),e.exports=r},4215:(e,t,n)=>{var a=n(4576),r=n(2839),o=n(2195),i=function(e){return r.slice(0,e.length)===e};e.exports=i("Bun/")?"BUN":i("Cloudflare-Workers")?"CLOUDFLARE":i("Deno/")?"DENO":i("Node.js/")?"NODE":a.Bun&&"string"==typeof Bun.version?"BUN":a.Deno&&"object"==typeof Deno.version?"DENO":"process"===o(a.process)?"NODE":a.window&&a.document?"BROWSER":"REST"},8574:(e,t,n)=>{var a=n(9504),r=Error,o=a("".replace),i=String(new r("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,l=s.test(i);e.exports=function(e,t){if(l&&"string"==typeof e&&!r.prepareStackTrace)for(;t--;)e=o(e,s,"");return e}},6518:(e,t,n)=>{var a=n(4576),r=n(7347).f,o=n(6699),i=n(6840),s=n(9433),l=n(7740),c=n(2796);e.exports=function(e,t){var n,d,m,p,u,g=e.target,h=e.global,b=e.stat;if(n=h?a:b?a[g]||s(g,{}):a[g]&&a[g].prototype)for(d in t){if(p=t[d],m=e.dontCallGetSet?(u=r(n,d))&&u.value:n[d],!c(h?d:g+(b?".":"#")+d,e.forced)&&void 0!==m){if(typeof p==typeof m)continue;l(p,m)}(e.sham||m&&m.sham)&&o(p,"sham",!0),i(n,d,p,e)}}},9039:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},8745:(e,t,n)=>{var a=n(616),r=Function.prototype,o=r.apply,i=r.call;e.exports="object"==typeof Reflect&&Reflect.apply||(a?i.bind(o):function(){return i.apply(o,arguments)})},6080:(e,t,n)=>{var a=n(7476),r=n(9306),o=n(616),i=a(a.bind);e.exports=function(e,t){return r(e),void 0===t?e:o?i(e,t):function(){return e.apply(t,arguments)}}},616:(e,t,n)=>{var a=n(9039);e.exports=!a(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},9565:(e,t,n)=>{var a=n(616),r=Function.prototype.call;e.exports=a?r.bind(r):function(){return r.apply(r,arguments)}},350:(e,t,n)=>{var a=n(3724),r=n(9297),o=Function.prototype,i=a&&Object.getOwnPropertyDescriptor,s=r(o,"name"),l=s&&"something"===function(){}.name,c=s&&(!a||a&&i(o,"name").configurable);e.exports={EXISTS:s,PROPER:l,CONFIGURABLE:c}},6706:(e,t,n)=>{var a=n(9504),r=n(9306);e.exports=function(e,t,n){try{return a(r(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},7476:(e,t,n)=>{var a=n(2195),r=n(9504);e.exports=function(e){if("Function"===a(e))return r(e)}},9504:(e,t,n)=>{var a=n(616),r=Function.prototype,o=r.call,i=a&&r.bind.bind(o,o);e.exports=a?i:function(e){return function(){return o.apply(e,arguments)}}},9429:(e,t,n)=>{var a=n(4576),r=n(6193);e.exports=function(e){if(r){try{return a.process.getBuiltinModule(e)}catch(e){}try{return Function('return require("'+e+'")')()}catch(e){}}}},7751:(e,t,n)=>{var a=n(4576),r=n(4901);e.exports=function(e,t){return arguments.length<2?(n=a[e],r(n)?n:void 0):a[e]&&a[e][t];var n}},1767:e=>{e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},8646:(e,t,n)=>{var a=n(9565),r=n(8551),o=n(1767),i=n(851);e.exports=function(e,t){t&&"string"==typeof e||r(e);var n=i(e);return o(r(void 0!==n?a(n,e):e))}},851:(e,t,n)=>{var a=n(6955),r=n(5966),o=n(4117),i=n(6269),s=n(8227)("iterator");e.exports=function(e){if(!o(e))return r(e,s)||r(e,"@@iterator")||i[a(e)]}},81:(e,t,n)=>{var a=n(9565),r=n(9306),o=n(8551),i=n(6823),s=n(851),l=TypeError;e.exports=function(e,t){var n=arguments.length<2?s(e):t;if(r(n))return o(a(n,e));throw new l(i(e)+" is not iterable")}},5966:(e,t,n)=>{var a=n(9306),r=n(4117);e.exports=function(e,t){var n=e[t];return r(n)?void 0:a(n)}},3789:(e,t,n)=>{var a=n(9306),r=n(8551),o=n(9565),i=n(1291),s=n(1767),l="Invalid size",c=RangeError,d=TypeError,m=Math.max,p=function(e,t){this.set=e,this.size=m(t,0),this.has=a(e.has),this.keys=a(e.keys)};p.prototype={getIterator:function(){return s(r(o(this.keys,this.set)))},includes:function(e){return o(this.has,this.set,e)}},e.exports=function(e){r(e);var t=+e.size;if(t!=t)throw new d(l);var n=i(t);if(n<0)throw new c(l);return new p(e,n)}},4576:function(e){var t=function(e){return e&&e.Math===Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof r.g&&r.g)||t("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297:(e,t,n)=>{var a=n(9504),r=n(8981),o=a({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(r(e),t)}},421:e=>{e.exports={}},397:(e,t,n)=>{var a=n(7751);e.exports=a("document","documentElement")},5917:(e,t,n)=>{var a=n(3724),r=n(9039),o=n(4055);e.exports=!a&&!r(function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a})},7055:(e,t,n)=>{var a=n(9504),r=n(9039),o=n(2195),i=Object,s=a("".split);e.exports=r(function(){return!i("z").propertyIsEnumerable(0)})?function(e){return"String"===o(e)?s(e,""):i(e)}:i},3167:(e,t,n)=>{var a=n(4901),r=n(34),o=n(2967);e.exports=function(e,t,n){var i,s;return o&&a(i=t.constructor)&&i!==n&&r(s=i.prototype)&&s!==n.prototype&&o(e,s),e}},3706:(e,t,n)=>{var a=n(9504),r=n(4901),o=n(7629),i=a(Function.toString);r(o.inspectSource)||(o.inspectSource=function(e){return i(e)}),e.exports=o.inspectSource},1181:(e,t,n)=>{var a,r,o,i=n(8622),s=n(4576),l=n(34),c=n(6699),d=n(9297),m=n(7629),p=n(6119),u=n(421),g="Object already initialized",h=s.TypeError,b=s.WeakMap;if(i||m.state){var f=m.state||(m.state=new b);f.get=f.get,f.has=f.has,f.set=f.set,a=function(e,t){if(f.has(e))throw new h(g);return t.facade=e,f.set(e,t),t},r=function(e){return f.get(e)||{}},o=function(e){return f.has(e)}}else{var v=p("state");u[v]=!0,a=function(e,t){if(d(e,v))throw new h(g);return t.facade=e,c(e,v,t),t},r=function(e){return d(e,v)?e[v]:{}},o=function(e){return d(e,v)}}e.exports={set:a,get:r,has:o,enforce:function(e){return o(e)?r(e):a(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=r(t)).type!==e)throw new h("Incompatible receiver, "+e+" required");return n}}}},4209:(e,t,n)=>{var a=n(8227),r=n(6269),o=a("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||i[o]===e)}},4376:(e,t,n)=>{var a=n(2195);e.exports=Array.isArray||function(e){return"Array"===a(e)}},1108:(e,t,n)=>{var a=n(6955);e.exports=function(e){var t=a(e);return"BigInt64Array"===t||"BigUint64Array"===t}},4901:e=>{var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},2796:(e,t,n)=>{var a=n(9039),r=n(4901),o=/#|\.prototype\./,i=function(e,t){var n=l[s(e)];return n===d||n!==c&&(r(t)?a(t):!!t)},s=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=i.data={},c=i.NATIVE="N",d=i.POLYFILL="P";e.exports=i},4117:e=>{e.exports=function(e){return null==e}},34:(e,t,n)=>{var a=n(4901);e.exports=function(e){return"object"==typeof e?null!==e:a(e)}},3925:(e,t,n)=>{var a=n(34);e.exports=function(e){return a(e)||null===e}},6395:e=>{e.exports=!1},757:(e,t,n)=>{var a=n(7751),r=n(4901),o=n(1625),i=n(7040),s=Object;e.exports=i?function(e){return"symbol"==typeof e}:function(e){var t=a("Symbol");return r(t)&&o(t.prototype,s(e))}},507:(e,t,n)=>{var a=n(9565);e.exports=function(e,t,n){for(var r,o,i=n?e:e.iterator,s=e.next;!(r=a(s,i)).done;)if(void 0!==(o=t(r.value)))return o}},2652:(e,t,n)=>{var a=n(6080),r=n(9565),o=n(8551),i=n(6823),s=n(4209),l=n(6198),c=n(1625),d=n(81),m=n(851),p=n(9539),u=TypeError,g=function(e,t){this.stopped=e,this.result=t},h=g.prototype;e.exports=function(e,t,n){var b,f,v,y,x,w,k,E=n&&n.that,S=!(!n||!n.AS_ENTRIES),C=!(!n||!n.IS_RECORD),T=!(!n||!n.IS_ITERATOR),A=!(!n||!n.INTERRUPTED),D=a(t,E),_=function(e){return b&&p(b,"normal",e),new g(!0,e)},N=function(e){return S?(o(e),A?D(e[0],e[1],_):D(e[0],e[1])):A?D(e,_):D(e)};if(C)b=e.iterator;else if(T)b=e;else{if(!(f=m(e)))throw new u(i(e)+" is not iterable");if(s(f)){for(v=0,y=l(e);y>v;v++)if((x=N(e[v]))&&c(h,x))return x;return new g(!1)}b=d(e,f)}for(w=C?e.next:b.next;!(k=r(w,b)).done;){try{x=N(k.value)}catch(e){p(b,"throw",e)}if("object"==typeof x&&x&&c(h,x))return x}return new g(!1)}},9539:(e,t,n)=>{var a=n(9565),r=n(8551),o=n(5966);e.exports=function(e,t,n){var i,s;r(e);try{if(!(i=o(e,"return"))){if("throw"===t)throw n;return n}i=a(i,e)}catch(e){s=!0,i=e}if("throw"===t)throw n;if(s)throw i;return r(i),n}},9462:(e,t,n)=>{var a=n(9565),r=n(2360),o=n(6699),i=n(6279),s=n(8227),l=n(1181),c=n(5966),d=n(7657).IteratorPrototype,m=n(2529),p=n(9539),u=s("toStringTag"),g="IteratorHelper",h="WrapForValidIterator",b=l.set,f=function(e){var t=l.getterFor(e?h:g);return i(r(d),{next:function(){var n=t(this);if(e)return n.nextHandler();try{var a=n.done?void 0:n.nextHandler();return m(a,n.done)}catch(e){throw n.done=!0,e}},return:function(){var n=t(this),r=n.iterator;if(n.done=!0,e){var o=c(r,"return");return o?a(o,r):m(void 0,!0)}if(n.inner)try{p(n.inner.iterator,"normal")}catch(e){return p(r,"throw",e)}return r&&p(r,"normal"),m(void 0,!0)}})},v=f(!0),y=f(!1);o(y,u,"Iterator Helper"),e.exports=function(e,t){var n=function(n,a){a?(a.iterator=n.iterator,a.next=n.next):a=n,a.type=t?h:g,a.nextHandler=e,a.counter=0,a.done=!1,b(this,a)};return n.prototype=t?v:y,n}},713:(e,t,n)=>{var a=n(9565),r=n(9306),o=n(8551),i=n(1767),s=n(9462),l=n(6319),c=s(function(){var e=this.iterator,t=o(a(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)});e.exports=function(e){return o(this),r(e),new c(i(this),{mapper:e})}},7657:(e,t,n)=>{var a,r,o,i=n(9039),s=n(4901),l=n(34),c=n(2360),d=n(2787),m=n(6840),p=n(8227),u=n(6395),g=p("iterator"),h=!1;[].keys&&("next"in(o=[].keys())?(r=d(d(o)))!==Object.prototype&&(a=r):h=!0),!l(a)||i(function(){var e={};return a[g].call(e)!==e})?a={}:u&&(a=c(a)),s(a[g])||m(a,g,function(){return this}),e.exports={IteratorPrototype:a,BUGGY_SAFARI_ITERATORS:h}},6269:e=>{e.exports={}},6198:(e,t,n)=>{var a=n(8014);e.exports=function(e){return a(e.length)}},283:(e,t,n)=>{var a=n(9504),r=n(9039),o=n(4901),i=n(9297),s=n(3724),l=n(350).CONFIGURABLE,c=n(3706),d=n(1181),m=d.enforce,p=d.get,u=String,g=Object.defineProperty,h=a("".slice),b=a("".replace),f=a([].join),v=s&&!r(function(){return 8!==g(function(){},"length",{value:8}).length}),y=String(String).split("String"),x=e.exports=function(e,t,n){"Symbol("===h(u(t),0,7)&&(t="["+b(u(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!i(e,"name")||l&&e.name!==t)&&(s?g(e,"name",{value:t,configurable:!0}):e.name=t),v&&n&&i(n,"arity")&&e.length!==n.arity&&g(e,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?s&&g(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var a=m(e);return i(a,"source")||(a.source=f(y,"string"==typeof t?t:"")),e};Function.prototype.toString=x(function(){return o(this)&&p(this).source||c(this)},"toString")},741:e=>{var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var a=+e;return(a>0?n:t)(a)}},6043:(e,t,n)=>{var a=n(9306),r=TypeError,o=function(e){var t,n;this.promise=new e(function(e,a){if(void 0!==t||void 0!==n)throw new r("Bad Promise constructor");t=e,n=a}),this.resolve=a(t),this.reject=a(n)};e.exports.f=function(e){return new o(e)}},2603:(e,t,n)=>{var a=n(655);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:a(e)}},4149:e=>{var t=RangeError;e.exports=function(e){if(e==e)return e;throw new t("NaN is not allowed")}},2360:(e,t,n)=>{var a,r=n(8551),o=n(6801),i=n(8727),s=n(421),l=n(397),c=n(4055),d=n(6119),m="prototype",p="script",u=d("IE_PROTO"),g=function(){},h=function(e){return"<"+p+">"+e+"</"+p+">"},b=function(e){e.write(h("")),e.close();var t=e.parentWindow.Object;return e=null,t},f=function(){try{a=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;f="undefined"!=typeof document?document.domain&&a?b(a):(t=c("iframe"),n="java"+p+":",t.style.display="none",l.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(h("document.F=Object")),e.close(),e.F):b(a);for(var r=i.length;r--;)delete f[m][i[r]];return f()};s[u]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(g[m]=r(e),n=new g,g[m]=null,n[u]=e):n=f(),void 0===t?n:o.f(n,t)}},6801:(e,t,n)=>{var a=n(3724),r=n(8686),o=n(4913),i=n(8551),s=n(5397),l=n(1072);t.f=a&&!r?Object.defineProperties:function(e,t){i(e);for(var n,a=s(t),r=l(t),c=r.length,d=0;c>d;)o.f(e,n=r[d++],a[n]);return e}},4913:(e,t,n)=>{var a=n(3724),r=n(5917),o=n(8686),i=n(8551),s=n(6969),l=TypeError,c=Object.defineProperty,d=Object.getOwnPropertyDescriptor,m="enumerable",p="configurable",u="writable";t.f=a?o?function(e,t,n){if(i(e),t=s(t),i(n),"function"==typeof e&&"prototype"===t&&"value"in n&&u in n&&!n[u]){var a=d(e,t);a&&a[u]&&(e[t]=n.value,n={configurable:p in n?n[p]:a[p],enumerable:m in n?n[m]:a[m],writable:!1})}return c(e,t,n)}:c:function(e,t,n){if(i(e),t=s(t),i(n),r)try{return c(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new l("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},7347:(e,t,n)=>{var a=n(3724),r=n(9565),o=n(8773),i=n(6980),s=n(5397),l=n(6969),c=n(9297),d=n(5917),m=Object.getOwnPropertyDescriptor;t.f=a?m:function(e,t){if(e=s(e),t=l(t),d)try{return m(e,t)}catch(e){}if(c(e,t))return i(!r(o.f,e,t),e[t])}},8480:(e,t,n)=>{var a=n(1828),r=n(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return a(e,r)}},3717:(e,t)=>{t.f=Object.getOwnPropertySymbols},2787:(e,t,n)=>{var a=n(9297),r=n(4901),o=n(8981),i=n(6119),s=n(2211),l=i("IE_PROTO"),c=Object,d=c.prototype;e.exports=s?c.getPrototypeOf:function(e){var t=o(e);if(a(t,l))return t[l];var n=t.constructor;return r(n)&&t instanceof n?n.prototype:t instanceof c?d:null}},1625:(e,t,n)=>{var a=n(9504);e.exports=a({}.isPrototypeOf)},1828:(e,t,n)=>{var a=n(9504),r=n(9297),o=n(5397),i=n(9617).indexOf,s=n(421),l=a([].push);e.exports=function(e,t){var n,a=o(e),c=0,d=[];for(n in a)!r(s,n)&&r(a,n)&&l(d,n);for(;t.length>c;)r(a,n=t[c++])&&(~i(d,n)||l(d,n));return d}},1072:(e,t,n)=>{var a=n(1828),r=n(8727);e.exports=Object.keys||function(e){return a(e,r)}},8773:(e,t)=>{var n={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,r=a&&!n.call({1:2},1);t.f=r?function(e){var t=a(this,e);return!!t&&t.enumerable}:n},2967:(e,t,n)=>{var a=n(6706),r=n(34),o=n(7750),i=n(3506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=a(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,a){return o(n),i(a),r(n)?(t?e(n,a):n.__proto__=a,n):n}}():void 0)},4270:(e,t,n)=>{var a=n(9565),r=n(4901),o=n(34),i=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&r(n=e.toString)&&!o(s=a(n,e)))return s;if(r(n=e.valueOf)&&!o(s=a(n,e)))return s;if("string"!==t&&r(n=e.toString)&&!o(s=a(n,e)))return s;throw new i("Can't convert object to primitive value")}},5031:(e,t,n)=>{var a=n(7751),r=n(9504),o=n(8480),i=n(3717),s=n(8551),l=r([].concat);e.exports=a("Reflect","ownKeys")||function(e){var t=o.f(s(e)),n=i.f;return n?l(t,n(e)):t}},8235:(e,t,n)=>{var a=n(9504),r=n(9297),o=SyntaxError,i=parseInt,s=String.fromCharCode,l=a("".charAt),c=a("".slice),d=a(/./.exec),m={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},p=/^[\da-f]{4}$/i,u=/^[\u0000-\u001F]$/;e.exports=function(e,t){for(var n=!0,a="";t<e.length;){var g=l(e,t);if("\\"===g){var h=c(e,t,t+2);if(r(m,h))a+=m[h],t+=2;else{if("\\u"!==h)throw new o('Unknown escape sequence: "'+h+'"');var b=c(e,t+=2,t+4);if(!d(p,b))throw new o("Bad Unicode escape at: "+t);a+=s(i(b,16)),t+=4}}else{if('"'===g){n=!1,t++;break}if(d(u,g))throw new o("Bad control character in string literal at: "+t);a+=g,t++}}if(n)throw new o("Unterminated string at: "+t);return{value:a,end:t}}},1103:e=>{e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},7750:(e,t,n)=>{var a=n(4117),r=TypeError;e.exports=function(e){if(a(e))throw new r("Can't call method on "+e);return e}},9286:(e,t,n)=>{var a=n(4402),r=n(8469),o=a.Set,i=a.add;e.exports=function(e){var t=new o;return r(e,function(e){i(t,e)}),t}},3440:(e,t,n)=>{var a=n(7080),r=n(4402),o=n(9286),i=n(5170),s=n(3789),l=n(8469),c=n(507),d=r.has,m=r.remove;e.exports=function(e){var t=a(this),n=s(e),r=o(t);return i(t)<=n.size?l(t,function(e){n.includes(e)&&m(r,e)}):c(n.getIterator(),function(e){d(t,e)&&m(r,e)}),r}},4402:(e,t,n)=>{var a=n(9504),r=Set.prototype;e.exports={Set,add:a(r.add),has:a(r.has),remove:a(r.delete),proto:r}},8750:(e,t,n)=>{var a=n(7080),r=n(4402),o=n(5170),i=n(3789),s=n(8469),l=n(507),c=r.Set,d=r.add,m=r.has;e.exports=function(e){var t=a(this),n=i(e),r=new c;return o(t)>n.size?l(n.getIterator(),function(e){m(t,e)&&d(r,e)}):s(t,function(e){n.includes(e)&&d(r,e)}),r}},4449:(e,t,n)=>{var a=n(7080),r=n(4402).has,o=n(5170),i=n(3789),s=n(8469),l=n(507),c=n(9539);e.exports=function(e){var t=a(this),n=i(e);if(o(t)<=n.size)return!1!==s(t,function(e){if(n.includes(e))return!1},!0);var d=n.getIterator();return!1!==l(d,function(e){if(r(t,e))return c(d,"normal",!1)})}},3838:(e,t,n)=>{var a=n(7080),r=n(5170),o=n(8469),i=n(3789);e.exports=function(e){var t=a(this),n=i(e);return!(r(t)>n.size)&&!1!==o(t,function(e){if(!n.includes(e))return!1},!0)}},8527:(e,t,n)=>{var a=n(7080),r=n(4402).has,o=n(5170),i=n(3789),s=n(507),l=n(9539);e.exports=function(e){var t=a(this),n=i(e);if(o(t)<n.size)return!1;var c=n.getIterator();return!1!==s(c,function(e){if(!r(t,e))return l(c,"normal",!1)})}},8469:(e,t,n)=>{var a=n(9504),r=n(507),o=n(4402),i=o.Set,s=o.proto,l=a(s.forEach),c=a(s.keys),d=c(new i).next;e.exports=function(e,t,n){return n?r({iterator:c(e),next:d},t):l(e,t)}},4916:(e,t,n)=>{var a=n(7751),r=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=a("Set");try{(new t)[e](r(0));try{return(new t)[e](r(-1)),!1}catch(e){return!0}}catch(e){return!1}}},5170:(e,t,n)=>{var a=n(6706),r=n(4402);e.exports=a(r.proto,"size","get")||function(e){return e.size}},3650:(e,t,n)=>{var a=n(7080),r=n(4402),o=n(9286),i=n(3789),s=n(507),l=r.add,c=r.has,d=r.remove;e.exports=function(e){var t=a(this),n=i(e).getIterator(),r=o(t);return s(n,function(e){c(t,e)?d(r,e):l(r,e)}),r}},4204:(e,t,n)=>{var a=n(7080),r=n(4402).add,o=n(9286),i=n(3789),s=n(507);e.exports=function(e){var t=a(this),n=i(e).getIterator(),l=o(t);return s(n,function(e){r(l,e)}),l}},6119:(e,t,n)=>{var a=n(5745),r=n(3392),o=a("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},7629:(e,t,n)=>{var a=n(6395),r=n(4576),o=n(9433),i="__core-js_shared__",s=e.exports=r[i]||o(i,{});(s.versions||(s.versions=[])).push({version:"3.39.0",mode:a?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:(e,t,n)=>{var a=n(7629);e.exports=function(e,t){return a[e]||(a[e]=t||{})}},1548:(e,t,n)=>{var a=n(4576),r=n(9039),o=n(9519),i=n(4215),s=a.structuredClone;e.exports=!!s&&!r(function(){if("DENO"===i&&o>92||"NODE"===i&&o>94||"BROWSER"===i&&o>97)return!1;var e=new ArrayBuffer(8),t=s(e,{transfer:[e]});return 0!==e.byteLength||8!==t.byteLength})},4495:(e,t,n)=>{var a=n(9519),r=n(9039),o=n(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!r(function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&a&&a<41})},5610:(e,t,n)=>{var a=n(1291),r=Math.max,o=Math.min;e.exports=function(e,t){var n=a(e);return n<0?r(n+t,0):o(n,t)}},5854:(e,t,n)=>{var a=n(2777),r=TypeError;e.exports=function(e){var t=a(e,"number");if("number"==typeof t)throw new r("Can't convert number to bigint");return BigInt(t)}},7696:(e,t,n)=>{var a=n(1291),r=n(8014),o=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=a(e),n=r(t);if(t!==n)throw new o("Wrong length or index");return n}},5397:(e,t,n)=>{var a=n(7055),r=n(7750);e.exports=function(e){return a(r(e))}},1291:(e,t,n)=>{var a=n(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:a(t)}},8014:(e,t,n)=>{var a=n(1291),r=Math.min;e.exports=function(e){var t=a(e);return t>0?r(t,9007199254740991):0}},8981:(e,t,n)=>{var a=n(7750),r=Object;e.exports=function(e){return r(a(e))}},9590:(e,t,n)=>{var a=n(1291),r=RangeError;e.exports=function(e){var t=a(e);if(t<0)throw new r("The argument can't be less than 0");return t}},2777:(e,t,n)=>{var a=n(9565),r=n(34),o=n(757),i=n(5966),s=n(4270),l=n(8227),c=TypeError,d=l("toPrimitive");e.exports=function(e,t){if(!r(e)||o(e))return e;var n,l=i(e,d);if(l){if(void 0===t&&(t="default"),n=a(l,e,t),!r(n)||o(n))return n;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},6969:(e,t,n)=>{var a=n(2777),r=n(757);e.exports=function(e){var t=a(e,"string");return r(t)?t:t+""}},2140:(e,t,n)=>{var a={};a[n(8227)("toStringTag")]="z",e.exports="[object z]"===String(a)},655:(e,t,n)=>{var a=n(6955),r=String;e.exports=function(e){if("Symbol"===a(e))throw new TypeError("Cannot convert a Symbol value to a string");return r(e)}},6823:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3392:(e,t,n)=>{var a=n(9504),r=0,o=Math.random(),i=a(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+i(++r+o,36)}},7040:(e,t,n)=>{var a=n(4495);e.exports=a&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686:(e,t,n)=>{var a=n(3724),r=n(9039);e.exports=a&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},2812:e=>{var t=TypeError;e.exports=function(e,n){if(e<n)throw new t("Not enough arguments");return e}},8622:(e,t,n)=>{var a=n(4576),r=n(4901),o=a.WeakMap;e.exports=r(o)&&/native code/.test(String(o))},8227:(e,t,n)=>{var a=n(4576),r=n(5745),o=n(9297),i=n(3392),s=n(4495),l=n(7040),c=a.Symbol,d=r("wks"),m=l?c.for||c:c&&c.withoutSetter||i;e.exports=function(e){return o(d,e)||(d[e]=s&&o(c,e)?c[e]:m("Symbol."+e)),d[e]}},6573:(e,t,n)=>{var a=n(3724),r=n(2106),o=n(3238),i=ArrayBuffer.prototype;a&&!("detached"in i)&&r(i,"detached",{configurable:!0,get:function(){return o(this)}})},7936:(e,t,n)=>{var a=n(6518),r=n(5636);r&&a({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return r(this,arguments.length?arguments[0]:void 0,!1)}})},8100:(e,t,n)=>{var a=n(6518),r=n(5636);r&&a({target:"ArrayBuffer",proto:!0},{transfer:function(){return r(this,arguments.length?arguments[0]:void 0,!0)}})},4114:(e,t,n)=>{var a=n(6518),r=n(8981),o=n(6198),i=n(4527),s=n(6837);a({target:"Array",proto:!0,arity:1,forced:n(9039)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=r(this),n=o(t),a=arguments.length;s(n+a);for(var l=0;l<a;l++)t[n]=arguments[l],n++;return i(t,n),n}})},8111:(e,t,n)=>{var a=n(6518),r=n(4576),o=n(679),i=n(8551),s=n(4901),l=n(2787),c=n(2106),d=n(4659),m=n(9039),p=n(9297),u=n(8227),g=n(7657).IteratorPrototype,h=n(3724),b=n(6395),f="constructor",v="Iterator",y=u("toStringTag"),x=TypeError,w=r[v],k=b||!s(w)||w.prototype!==g||!m(function(){w({})}),E=function(){if(o(this,g),l(this)===g)throw new x("Abstract class Iterator not directly constructable")},S=function(e,t){h?c(g,e,{configurable:!0,get:function(){return t},set:function(t){if(i(this),this===g)throw new x("You can't redefine this property");p(this,e)?this[e]=t:d(this,e,t)}}):g[e]=t};p(g,y)||S(y,v),!k&&p(g,f)&&g[f]!==Object||S(f,E),E.prototype=g,a({global:!0,constructor:!0,forced:k},{Iterator:E})},9314:(e,t,n)=>{var a=n(6518),r=n(9565),o=n(8551),i=n(1767),s=n(4149),l=n(9590),c=n(9462),d=n(6395),m=c(function(){for(var e,t=this.iterator,n=this.next;this.remaining;)if(this.remaining--,e=o(r(n,t)),this.done=!!e.done)return;if(e=o(r(n,t)),!(this.done=!!e.done))return e.value});a({target:"Iterator",proto:!0,real:!0,forced:d},{drop:function(e){o(this);var t=l(s(+e));return new m(i(this),{remaining:t})}})},1148:(e,t,n)=>{var a=n(6518),r=n(2652),o=n(9306),i=n(8551),s=n(1767);a({target:"Iterator",proto:!0,real:!0},{every:function(e){i(this),o(e);var t=s(this),n=0;return!r(t,function(t,a){if(!e(t,n++))return a()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},2489:(e,t,n)=>{var a=n(6518),r=n(9565),o=n(9306),i=n(8551),s=n(1767),l=n(9462),c=n(6319),d=n(6395),m=l(function(){for(var e,t,n=this.iterator,a=this.predicate,o=this.next;;){if(e=i(r(o,n)),this.done=!!e.done)return;if(t=e.value,c(n,a,[t,this.counter++],!0))return t}});a({target:"Iterator",proto:!0,real:!0,forced:d},{filter:function(e){return i(this),o(e),new m(s(this),{predicate:e})}})},531:(e,t,n)=>{var a=n(6518),r=n(9565),o=n(9306),i=n(8551),s=n(1767),l=n(8646),c=n(9462),d=n(9539),m=n(6395),p=c(function(){for(var e,t,n=this.iterator,a=this.mapper;;){if(t=this.inner)try{if(!(e=i(r(t.next,t.iterator))).done)return e.value;this.inner=null}catch(e){d(n,"throw",e)}if(e=i(r(this.next,n)),this.done=!!e.done)return;try{this.inner=l(a(e.value,this.counter++),!1)}catch(e){d(n,"throw",e)}}});a({target:"Iterator",proto:!0,real:!0,forced:m},{flatMap:function(e){return i(this),o(e),new p(s(this),{mapper:e,inner:null})}})},1701:(e,t,n)=>{var a=n(6518),r=n(713);a({target:"Iterator",proto:!0,real:!0,forced:n(6395)},{map:r})},3579:(e,t,n)=>{var a=n(6518),r=n(2652),o=n(9306),i=n(8551),s=n(1767);a({target:"Iterator",proto:!0,real:!0},{some:function(e){i(this),o(e);var t=s(this),n=0;return r(t,function(t,a){if(e(t,n++))return a()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},1689:(e,t,n)=>{var a=n(6518),r=n(4576),o=n(8745),i=n(7680),s=n(6043),l=n(9306),c=n(1103),d=r.Promise,m=!1;a({target:"Promise",stat:!0,forced:!d||!d.try||c(function(){d.try(function(e){m=8===e},8)}).error||!m},{try:function(e){var t=arguments.length>1?i(arguments,1):[],n=s.f(this),a=c(function(){return o(l(e),void 0,t)});return(a.error?n.reject:n.resolve)(a.value),n.promise}})},4628:(e,t,n)=>{var a=n(6518),r=n(6043);a({target:"Promise",stat:!0},{withResolvers:function(){var e=r.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}})},7642:(e,t,n)=>{var a=n(6518),r=n(3440);a({target:"Set",proto:!0,real:!0,forced:!n(4916)("difference")},{difference:r})},8004:(e,t,n)=>{var a=n(6518),r=n(9039),o=n(8750);a({target:"Set",proto:!0,real:!0,forced:!n(4916)("intersection")||r(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:o})},3853:(e,t,n)=>{var a=n(6518),r=n(4449);a({target:"Set",proto:!0,real:!0,forced:!n(4916)("isDisjointFrom")},{isDisjointFrom:r})},5876:(e,t,n)=>{var a=n(6518),r=n(3838);a({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSubsetOf")},{isSubsetOf:r})},2475:(e,t,n)=>{var a=n(6518),r=n(8527);a({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSupersetOf")},{isSupersetOf:r})},5024:(e,t,n)=>{var a=n(6518),r=n(3650);a({target:"Set",proto:!0,real:!0,forced:!n(4916)("symmetricDifference")},{symmetricDifference:r})},1698:(e,t,n)=>{var a=n(6518),r=n(4204);a({target:"Set",proto:!0,real:!0,forced:!n(4916)("union")},{union:r})},7467:(e,t,n)=>{var a=n(7628),r=n(4644),o=r.aTypedArray,i=r.exportTypedArrayMethod,s=r.getTypedArrayConstructor;i("toReversed",function(){return a(o(this),s(this))})},4732:(e,t,n)=>{var a=n(4644),r=n(9504),o=n(9306),i=n(5370),s=a.aTypedArray,l=a.getTypedArrayConstructor,c=a.exportTypedArrayMethod,d=r(a.TypedArrayPrototype.sort);c("toSorted",function(e){void 0!==e&&o(e);var t=s(this),n=i(l(t),t);return d(n,e)})},9577:(e,t,n)=>{var a=n(9928),r=n(4644),o=n(1108),i=n(1291),s=n(5854),l=r.aTypedArray,c=r.getTypedArrayConstructor,d=r.exportTypedArrayMethod,m=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(e){return 8===e}}();d("with",{with:function(e,t){var n=l(this),r=i(e),d=o(n)?s(t):+t;return a(n,c(n),r,d)}}.with,!m)},8992:(e,t,n)=>{n(8111)},4743:(e,t,n)=>{n(9314)},3215:(e,t,n)=>{n(1148)},4520:(e,t,n)=>{n(2489)},670:(e,t,n)=>{n(531)},1454:(e,t,n)=>{n(1701)},7550:(e,t,n)=>{n(3579)},8335:(e,t,n)=>{var a=n(6518),r=n(3724),o=n(4576),i=n(7751),s=n(9504),l=n(9565),c=n(4901),d=n(34),m=n(4376),p=n(9297),u=n(655),g=n(6198),h=n(4659),b=n(9039),f=n(8235),v=n(4495),y=o.JSON,x=o.Number,w=o.SyntaxError,k=y&&y.parse,E=i("Object","keys"),S=Object.getOwnPropertyDescriptor,C=s("".charAt),T=s("".slice),A=s(/./.exec),D=s([].push),_=/^\d$/,N=/^[1-9]$/,M=/^[\d-]$/,I=/^[\t\n\r ]$/,R=function(e,t,n,a){var r,o,i,s,c,u=e[t],h=a&&u===a.value,b=h&&"string"==typeof a.source?{source:a.source}:{};if(d(u)){var f=m(u),v=h?a.nodes:f?[]:{};if(f)for(r=v.length,i=g(u),s=0;s<i;s++)B(u,s,R(u,""+s,n,s<r?v[s]:void 0));else for(o=E(u),i=g(o),s=0;s<i;s++)c=o[s],B(u,c,R(u,c,n,p(v,c)?v[c]:void 0))}return l(n,e,t,u,b)},B=function(e,t,n){if(r){var a=S(e,t);if(a&&!a.configurable)return}void 0===n?delete e[t]:h(e,t,n)},P=function(e,t,n,a){this.value=e,this.end=t,this.source=n,this.nodes=a},L=function(e,t){this.source=e,this.index=t};L.prototype={fork:function(e){return new L(this.source,e)},parse:function(){var e=this.source,t=this.skip(I,this.index),n=this.fork(t),a=C(e,t);if(A(M,a))return n.number();switch(a){case"{":return n.object();case"[":return n.array();case'"':return n.string();case"t":return n.keyword(!0);case"f":return n.keyword(!1);case"n":return n.keyword(null)}throw new w('Unexpected character: "'+a+'" at: '+t)},node:function(e,t,n,a,r){return new P(t,a,e?null:T(this.source,n,a),r)},object:function(){for(var e=this.source,t=this.index+1,n=!1,a={},r={};t<e.length;){if(t=this.until(['"',"}"],t),"}"===C(e,t)&&!n){t++;break}var o=this.fork(t).string(),i=o.value;t=o.end,t=this.until([":"],t)+1,t=this.skip(I,t),o=this.fork(t).parse(),h(r,i,o),h(a,i,o.value),t=this.until([",","}"],o.end);var s=C(e,t);if(","===s)n=!0,t++;else if("}"===s){t++;break}}return this.node(1,a,this.index,t,r)},array:function(){for(var e=this.source,t=this.index+1,n=!1,a=[],r=[];t<e.length;){if(t=this.skip(I,t),"]"===C(e,t)&&!n){t++;break}var o=this.fork(t).parse();if(D(r,o),D(a,o.value),t=this.until([",","]"],o.end),","===C(e,t))n=!0,t++;else if("]"===C(e,t)){t++;break}}return this.node(1,a,this.index,t,r)},string:function(){var e=this.index,t=f(this.source,this.index+1);return this.node(0,t.value,e,t.end)},number:function(){var e=this.source,t=this.index,n=t;if("-"===C(e,n)&&n++,"0"===C(e,n))n++;else{if(!A(N,C(e,n)))throw new w("Failed to parse number at: "+n);n=this.skip(_,n+1)}if(("."===C(e,n)&&(n=this.skip(_,n+1)),"e"===C(e,n)||"E"===C(e,n))&&(n++,"+"!==C(e,n)&&"-"!==C(e,n)||n++,n===(n=this.skip(_,n))))throw new w("Failed to parse number's exponent value at: "+n);return this.node(0,x(T(e,t,n)),t,n)},keyword:function(e){var t=""+e,n=this.index,a=n+t.length;if(T(this.source,n,a)!==t)throw new w("Failed to parse value at: "+n);return this.node(0,e,n,a)},skip:function(e,t){for(var n=this.source;t<n.length&&A(e,C(n,t));t++);return t},until:function(e,t){t=this.skip(I,t);for(var n=C(this.source,t),a=0;a<e.length;a++)if(e[a]===n)return t;throw new w('Unexpected character: "'+n+'" at: '+t)}};var U=b(function(){var e,t="9007199254740993";return k(t,function(t,n,a){e=a.source}),e!==t}),F=v&&!b(function(){return 1/k("-0 \t")!=-1/0});a({target:"JSON",stat:!0,forced:U},{parse:function(e,t){return F&&!c(t)?k(e):function(e,t){e=u(e);var n=new L(e,0,""),a=n.parse(),r=a.value,o=n.skip(I,a.end);if(o<e.length)throw new w('Unexpected extra character: "'+C(e,o)+'" after the parsed data at: '+o);return c(t)?R({"":r},"",t,a):r}(e,t)}})},5247:(e,t,n)=>{n(1689)},4979:(e,t,n)=>{var a=n(6518),r=n(4576),o=n(7751),i=n(6980),s=n(4913).f,l=n(9297),c=n(679),d=n(3167),m=n(2603),p=n(5002),u=n(8574),g=n(3724),h=n(6395),b="DOMException",f=o("Error"),v=o(b),y=function(){c(this,x);var e=arguments.length,t=m(e<1?void 0:arguments[0]),n=m(e<2?void 0:arguments[1],"Error"),a=new v(t,n),r=new f(t);return r.name=b,s(a,"stack",i(1,u(r.stack,1))),d(a,this,y),a},x=y.prototype=v.prototype,w="stack"in new f(b),k="stack"in new v(1,2),E=v&&g&&Object.getOwnPropertyDescriptor(r,b),S=!(!E||E.writable&&E.configurable),C=w&&!S&&!k;a({global:!0,constructor:!0,forced:h||C},{DOMException:C?y:v});var T=o(b),A=T.prototype;if(A.constructor!==T)for(var D in h||s(A,"constructor",i(1,T)),p)if(l(p,D)){var _=p[D],N=_.s;l(T,N)||s(T,N,i(6,_.c))}},4603:(e,t,n)=>{var a=n(6840),r=n(9504),o=n(655),i=n(2812),s=URLSearchParams,l=s.prototype,c=r(l.append),d=r(l.delete),m=r(l.forEach),p=r([].push),u=new s("a=1&a=2&b=3");u.delete("a",1),u.delete("b",void 0),u+""!="a=2"&&a(l,"delete",function(e){var t=arguments.length,n=t<2?void 0:arguments[1];if(t&&void 0===n)return d(this,e);var a=[];m(this,function(e,t){p(a,{key:t,value:e})}),i(t,1);for(var r,s=o(e),l=o(n),u=0,g=0,h=!1,b=a.length;u<b;)r=a[u++],h||r.key===s?(h=!0,d(this,r.key)):g++;for(;g<b;)(r=a[g++]).key===s&&r.value===l||c(this,r.key,r.value)},{enumerable:!0,unsafe:!0})},7566:(e,t,n)=>{var a=n(6840),r=n(9504),o=n(655),i=n(2812),s=URLSearchParams,l=s.prototype,c=r(l.getAll),d=r(l.has),m=new s("a=1");!m.has("a",2)&&m.has("a",void 0)||a(l,"has",function(e){var t=arguments.length,n=t<2?void 0:arguments[1];if(t&&void 0===n)return d(this,e);var a=c(this,e);i(t,1);for(var r=o(n),s=0;s<a.length;)if(a[s++]===r)return!0;return!1},{enumerable:!0,unsafe:!0})},8721:(e,t,n)=>{var a=n(3724),r=n(9504),o=n(2106),i=URLSearchParams.prototype,s=r(i.forEach);a&&!("size"in i)&&o(i,"size",{get:function(){var e=0;return s(this,function(){e++}),e},configurable:!0,enumerable:!0})}},co={};function mo(e){var t=co[e];if(void 0!==t)return t.exports;var n=co[e]={exports:{}};return lo[e].call(n.exports,n,n.exports,mo),n.exports}mo.d=(e,t)=>{for(var n in t)mo.o(t,n)&&!mo.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},mo.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var po=globalThis.pdfjsLib={};mo.d(po,{AbortException:()=>Si,AnnotationEditorLayer:()=>gd,AnnotationEditorParamsType:()=>Ao,AnnotationEditorType:()=>To,AnnotationEditorUIManager:()=>cs,AnnotationLayer:()=>Yc,AnnotationMode:()=>Co,ColorPicker:()=>od,DOMSVGFactory:()=>fc,DrawLayer:()=>hd,FeatureTest:()=>Di,GlobalWorkerOptions:()=>fl,ImageKind:()=>Po,InvalidPDFException:()=>xi,MissingPDFException:()=>wi,OPS:()=>ii,OutputScale:()=>es,PDFDataRangeTransport:()=>tc,PDFDateString:()=>$i,PDFWorker:()=>oc,PasswordResponses:()=>si,PermissionFlag:()=>Do,PixelsPerInch:()=>Li,RenderingCancelledException:()=>zi,TextLayer:()=>Vl,TouchManager:()=>ms,UnexpectedResponseException:()=>ki,Util:()=>Ni,VerbosityLevel:()=>oi,XfaLayer:()=>vc,build:()=>pc,createValidAbsoluteUrl:()=>hi,fetchData:()=>Ui,getDocument:()=>Ql,getFilenameFromUrl:()=>qi,getPdfFilenameFromUrl:()=>Hi,getXfaPageViewport:()=>Yi,isDataScheme:()=>Oi,isPdfFile:()=>Wi,noContextMenu:()=>Gi,normalizeUnicode:()=>Ri,setLayerDimensions:()=>Zi,shadow:()=>bi,stopEvent:()=>Ki,version:()=>mc});mo(4114),mo(6573),mo(8100),mo(7936),mo(7467),mo(4732),mo(9577),mo(5247),mo(4979),mo(4603),mo(7566),mo(8721);const uo=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),go=[1,0,0,1,0,0],ho=[.001,0,0,.001,0,0],bo=1.35,fo=1,vo=2,yo=4,xo=16,wo=32,ko=64,Eo=128,So=256,Co={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},To={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},Ao={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35,DRAW_STEP:41},Do={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},_o=0,No=1,Mo=2,Io=3,Ro=3,Bo=4,Po={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Lo=1,Uo=2,Fo=3,zo=4,Oo=5,Wo=6,qo=7,Ho=8,jo=9,Vo=10,Go=11,Ko=12,$o=13,Yo=14,Xo=15,Jo=16,Qo=17,Zo=20,ei=1,ti=2,ni=3,ai=4,ri=5,oi={ERRORS:0,WARNINGS:1,INFOS:5},ii={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93},si={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let li=oi.WARNINGS;function ci(e){Number.isInteger(e)&&(li=e)}function di(){return li}function mi(e){oi.INFOS}function pi(e){oi.WARNINGS}function ui(e){throw new Error(e)}function gi(e,t){e||ui(t)}function hi(e,t=null,n=null){if(!e)return null;try{if(n&&"string"==typeof e){if(n.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);t?.length>=2&&(e=`http://${e}`)}if(n.tryConvertEncoding)try{e=decodeURIComponent(escape(e))}catch{}}const a=t?new URL(e,t):new URL(e);if(function(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(a))return a}catch{}return null}function bi(e,t,n,a=!1){return Object.defineProperty(e,t,{value:n,enumerable:!a,configurable:!0,writable:!1}),n}const fi=function(){function e(e,t){this.message=e,this.name=t}return e.prototype=new Error,e.constructor=e,e}();class vi extends fi{constructor(e,t){super(e,"PasswordException"),this.code=t}}class yi extends fi{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class xi extends fi{constructor(e){super(e,"InvalidPDFException")}}class wi extends fi{constructor(e){super(e,"MissingPDFException")}}class ki extends fi{constructor(e,t){super(e,"UnexpectedResponseException"),this.status=t}}class Ei extends fi{constructor(e){super(e,"FormatError")}}class Si extends fi{constructor(e){super(e,"AbortException")}}function Ci(e){"object"==typeof e&&void 0!==e?.length||ui("Invalid argument for bytesToString");const t=e.length,n=8192;if(t<n)return String.fromCharCode.apply(null,e);const a=[];for(let r=0;r<t;r+=n){const o=Math.min(r+n,t),i=e.subarray(r,o);a.push(String.fromCharCode.apply(null,i))}return a.join("")}function Ti(e){"string"!=typeof e&&ui("Invalid argument for stringToBytes");const t=e.length,n=new Uint8Array(t);for(let a=0;a<t;++a)n[a]=255&e.charCodeAt(a);return n}function Ai(e){const t=Object.create(null);for(const[n,a]of e)t[n]=a;return t}class Di{static get isLittleEndian(){return bi(this,"isLittleEndian",function(){const e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return bi(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return bi(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get isImageDecoderSupported(){return bi(this,"isImageDecoderSupported","undefined"!=typeof ImageDecoder)}static get platform(){return"undefined"!=typeof navigator&&"string"==typeof navigator?.platform?bi(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:"string"==typeof navigator?.userAgent&&navigator.userAgent.includes("Firefox")}):bi(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){return bi(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const _i=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0"));class Ni{static makeHexColor(e,t,n){return`#${_i[e]}${_i[t]}${_i[n]}`}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[1],t[1]=n,n=t[2],t[2]=t[3],t[3]=n,e[1]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const n=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/n,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/n]}static getAxialAlignedBoundingBox(e,t){const n=this.applyTransform(e,t),a=this.applyTransform(e.slice(2,4),t),r=this.applyTransform([e[0],e[3]],t),o=this.applyTransform([e[2],e[1]],t);return[Math.min(n[0],a[0],r[0],o[0]),Math.min(n[1],a[1],r[1],o[1]),Math.max(n[0],a[0],r[0],o[0]),Math.max(n[1],a[1],r[1],o[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],n=e[0]*t[0]+e[1]*t[2],a=e[0]*t[1]+e[1]*t[3],r=e[2]*t[0]+e[3]*t[2],o=e[2]*t[1]+e[3]*t[3],i=(n+o)/2,s=Math.sqrt((n+o)**2-4*(n*o-r*a))/2,l=i+s||1,c=i-s||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),a=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>a)return null;const r=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),o=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return r>o?null:[n,r,a,o]}static#e(e,t,n,a,r,o,i,s,l,c){if(l<=0||l>=1)return;const d=1-l,m=l*l,p=m*l,u=d*(d*(d*e+3*l*t)+3*m*n)+p*a,g=d*(d*(d*r+3*l*o)+3*m*i)+p*s;c[0]=Math.min(c[0],u),c[1]=Math.min(c[1],g),c[2]=Math.max(c[2],u),c[3]=Math.max(c[3],g)}static#t(e,t,n,a,r,o,i,s,l,c,d,m){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&this.#e(e,t,n,a,r,o,i,s,-d/c,m));const p=c**2-4*d*l;if(p<0)return;const u=Math.sqrt(p),g=2*l;this.#e(e,t,n,a,r,o,i,s,(-c+u)/g,m),this.#e(e,t,n,a,r,o,i,s,(-c-u)/g,m)}static bezierBoundingBox(e,t,n,a,r,o,i,s,l){return l?(l[0]=Math.min(l[0],e,i),l[1]=Math.min(l[1],t,s),l[2]=Math.max(l[2],e,i),l[3]=Math.max(l[3],t,s)):l=[Math.min(e,i),Math.min(t,s),Math.max(e,i),Math.max(t,s)],this.#t(e,n,r,i,t,a,o,s,3*(3*(n-r)-e+i),6*(e-2*n+r),3*(n-e),l),this.#t(e,n,r,i,t,a,o,s,3*(3*(a-o)-t+s),6*(t-2*a+o),3*(a-t),l),l}}let Mi=null,Ii=null;function Ri(e){return Mi||(Mi=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,Ii=new Map([["ﬅ","ſt"]])),e.replaceAll(Mi,(e,t,n)=>t?t.normalize("NFKC"):Ii.get(n))}const Bi="pdfjs_internal_id_";mo(4628),mo(7642),mo(8004),mo(3853),mo(5876),mo(2475),mo(5024),mo(1698),mo(1454),mo(8992),mo(4743),mo(3215),mo(7550),mo(8335);const Pi="http://www.w3.org/2000/svg";class Li{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function Ui(e,t="text"){if(Vi(e,document.baseURI)){const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);switch(t){case"arraybuffer":return n.arrayBuffer();case"blob":return n.blob();case"json":return n.json()}return n.text()}return new Promise((n,a)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType=t,r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE)if(200!==r.status&&0!==r.status)a(new Error(r.statusText));else{switch(t){case"arraybuffer":case"blob":case"json":return void n(r.response)}n(r.responseText)}},r.send(null)})}class Fi{constructor({viewBox:e,userUnit:t,scale:n,rotation:a,offsetX:r=0,offsetY:o=0,dontFlip:i=!1}){this.viewBox=e,this.userUnit=t,this.scale=n,this.rotation=a,this.offsetX=r,this.offsetY=o,n*=t;const s=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,d,m,p,u,g,h,b;switch((a%=360)<0&&(a+=360),a){case 180:c=-1,d=0,m=0,p=1;break;case 90:c=0,d=1,m=1,p=0;break;case 270:c=0,d=-1,m=-1,p=0;break;case 0:c=1,d=0,m=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}i&&(m=-m,p=-p),0===c?(u=Math.abs(l-e[1])*n+r,g=Math.abs(s-e[0])*n+o,h=(e[3]-e[1])*n,b=(e[2]-e[0])*n):(u=Math.abs(s-e[0])*n+r,g=Math.abs(l-e[1])*n+o,h=(e[2]-e[0])*n,b=(e[3]-e[1])*n),this.transform=[c*n,d*n,m*n,p*n,u-c*n*s-m*n*l,g-d*n*s-p*n*l],this.width=h,this.height=b}get rawDims(){const{userUnit:e,viewBox:t}=this,n=t.map(t=>t*e);return bi(this,"rawDims",{pageWidth:n[2]-n[0],pageHeight:n[3]-n[1],pageX:n[0],pageY:n[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:a=this.offsetY,dontFlip:r=!1}={}){return new Fi({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:a,dontFlip:r})}convertToViewportPoint(e,t){return Ni.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=Ni.applyTransform([e[0],e[1]],this.transform),n=Ni.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){return Ni.applyInverseTransform([e,t],this.transform)}}class zi extends fi{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function Oi(e){const t=e.length;let n=0;for(;n<t&&""===e[n].trim();)n++;return"data:"===e.substring(n,n+5).toLowerCase()}function Wi(e){return"string"==typeof e&&/\.pdf$/i.test(e)}function qi(e){return[e]=e.split(/[#?]/,1),e.substring(e.lastIndexOf("/")+1)}function Hi(e,t="document.pdf"){if("string"!=typeof e)return t;if(Oi(e))return pi(),t;const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,a=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let r=n.exec(a[1])||n.exec(a[2])||n.exec(a[3]);if(r&&(r=r[0],r.includes("%")))try{r=n.exec(decodeURIComponent(r))[0]}catch{}return r||t}class ji{started=Object.create(null);times=[];time(e){e in this.started&&pi(),this.started[e]=Date.now()}timeEnd(e){e in this.started||pi(),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let t=0;for(const{name:e}of this.times)t=Math.max(e.length,t);for(const{name:n,start:a,end:r}of this.times)e.push(`${n.padEnd(t)} ${r-a}ms\n`);return e.join("")}}function Vi(e,t){try{const{protocol:n}=t?new URL(e,t):new URL(e);return"http:"===n||"https:"===n}catch{return!1}}function Gi(e){e.preventDefault()}function Ki(e){e.preventDefault(),e.stopPropagation()}class $i{static#n;static toDateObject(e){if(!e||"string"!=typeof e)return null;this.#n||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const t=this.#n.exec(e);if(!t)return null;const n=parseInt(t[1],10);let a=parseInt(t[2],10);a=a>=1&&a<=12?a-1:0;let r=parseInt(t[3],10);r=r>=1&&r<=31?r:1;let o=parseInt(t[4],10);o=o>=0&&o<=23?o:0;let i=parseInt(t[5],10);i=i>=0&&i<=59?i:0;let s=parseInt(t[6],10);s=s>=0&&s<=59?s:0;const l=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(t[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===l?(o+=c,i+=d):"+"===l&&(o-=c,i-=d),new Date(Date.UTC(n,a,r,o,i,s))}}function Yi(e,{scale:t=1,rotation:n=0}){const{width:a,height:r}=e.attributes.style,o=[0,0,parseInt(a),parseInt(r)];return new Fi({viewBox:o,userUnit:1,scale:t,rotation:n})}function Xi(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(16711680&t)>>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map(e=>parseInt(e)):e.startsWith("rgba(")?e.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(pi(),[0,0,0])}function Ji(e){const{a:t,b:n,c:a,d:r,e:o,f:i}=e.getTransform();return[t,n,a,r,o,i]}function Qi(e){const{a:t,b:n,c:a,d:r,e:o,f:i}=e.getTransform().invertSelf();return[t,n,a,r,o,i]}function Zi(e,t,n=!1,a=!0){if(t instanceof Fi){const{pageWidth:a,pageHeight:r}=t.rawDims,{style:o}=e,i=Di.isCSSRoundSupported,s=`var(--scale-factor) * ${a}px`,l=`var(--scale-factor) * ${r}px`,c=i?`round(down, ${s}, var(--scale-round-x, 1px))`:`calc(${s})`,d=i?`round(down, ${l}, var(--scale-round-y, 1px))`:`calc(${l})`;n&&t.rotation%180!=0?(o.width=d,o.height=c):(o.width=c,o.height=d)}a&&e.setAttribute("data-main-rotation",t.rotation)}class es{constructor(){const e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}}class ts{#a=null;#r=null;#o;#i=null;#s=null;static#l=null;constructor(e){this.#o=e,ts.#l||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button"})}render(){const e=this.#a=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const t=this.#o._uiManager._signal;e.addEventListener("contextmenu",Gi,{signal:t}),e.addEventListener("pointerdown",ts.#c,{signal:t});const n=this.#i=document.createElement("div");n.className="buttons",e.append(n);const a=this.#o.toolbarPosition;if(a){const{style:t}=e,n="ltr"===this.#o._uiManager.direction?1-a[0]:a[0];t.insetInlineEnd=100*n+"%",t.top=`calc(${100*a[1]}% + var(--editor-toolbar-vert-offset))`}return this.#d(),e}get div(){return this.#a}static#c(e){e.stopPropagation()}#m(e){this.#o._focusEventsAllowed=!1,Ki(e)}#p(e){this.#o._focusEventsAllowed=!0,Ki(e)}#u(e){const t=this.#o._uiManager._signal;e.addEventListener("focusin",this.#m.bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",this.#p.bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",Gi,{signal:t})}hide(){this.#a.classList.add("hidden"),this.#r?.hideDropdown()}show(){this.#a.classList.remove("hidden"),this.#s?.shown()}#d(){const{editorType:e,_uiManager:t}=this.#o,n=document.createElement("button");n.className="delete",n.tabIndex=0,n.setAttribute("data-l10n-id",ts.#l[e]),this.#u(n),n.addEventListener("click",e=>{t.delete()},{signal:t._signal}),this.#i.append(n)}get#g(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const t=await e.render();this.#u(t),this.#i.prepend(t,this.#g),this.#s=e}addColorPicker(e){this.#r=e;const t=e.renderButton();this.#u(t),this.#i.prepend(t,this.#g)}remove(){this.#a.remove(),this.#r?.destroy(),this.#r=null}}class ns{#i=null;#a=null;#h;constructor(e){this.#h=e}#b(){const e=this.#a=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",Gi,{signal:this.#h._signal});const t=this.#i=document.createElement("div");return t.className="buttons",e.append(t),this.#f(),e}#v(e,t){let n=0,a=0;for(const r of e){const e=r.y+r.height;if(e<n)continue;const o=r.x+(t?r.width:0);e>n?(a=o,n=e):t?o>a&&(a=o):o<a&&(a=o)}return[t?1-a:a,n]}show(e,t,n){const[a,r]=this.#v(t,n),{style:o}=this.#a||=this.#b();e.append(this.#a),o.insetInlineEnd=100*a+"%",o.top=`calc(${100*r}% + var(--editor-toolbar-vert-offset))`}hide(){this.#a.remove()}#f(){const e=document.createElement("button");e.className="highlightButton",e.tabIndex=0,e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const t=document.createElement("span");e.append(t),t.className="visuallyHidden",t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const n=this.#h._signal;e.addEventListener("contextmenu",Gi,{signal:n}),e.addEventListener("click",()=>{this.#h.highlightSelection("floating_button")},{signal:n}),this.#i.append(e)}}function as(e,t,n){for(const a of n)t.addEventListener(a,e[a].bind(e))}class rs{#y=0;get id(){return"pdfjs_internal_editor_"+this.#y++}}class os{#x=function(){if("function"==typeof crypto.randomUUID)return crypto.randomUUID();const e=new Uint8Array(32);return crypto.getRandomValues(e),Ci(e)}();#y=0;#w=null;static get _isSVGFittingCanvas(){const e=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),t=new Image;t.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';return bi(this,"_isSVGFittingCanvas",t.decode().then(()=>(e.drawImage(t,0,0,1,1,0,0,1,3),0===new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0])))}async#k(e,t){this.#w||=new Map;let n=this.#w.get(e);if(null===n)return null;if(n?.bitmap)return n.refCounter+=1,n;try{let e;if(n||={bitmap:null,id:`image_${this.#x}_${this.#y++}`,refCounter:0,isSvg:!1},"string"==typeof t?(n.url=t,e=await Ui(t,"blob")):t instanceof File?e=n.file=t:t instanceof Blob&&(e=t),"image/svg+xml"===e.type){const t=os._isSVGFittingCanvas,a=new FileReader,r=new Image,o=new Promise((e,o)=>{r.onload=()=>{n.bitmap=r,n.isSvg=!0,e()},a.onload=async()=>{const e=n.svgUrl=a.result;r.src=await t?`${e}#svgView(preserveAspectRatio(none))`:e},r.onerror=a.onerror=o});a.readAsDataURL(e),await o}else n.bitmap=await createImageBitmap(e);n.refCounter=1}catch(e){pi(),n=null}return this.#w.set(e,n),n&&this.#w.set(n.id,n),n}async getFromFile(e){const{lastModified:t,name:n,size:a,type:r}=e;return this.#k(`${t}_${n}_${a}_${r}`,e)}async getFromUrl(e){return this.#k(e,e)}async getFromBlob(e,t){const n=await t;return this.#k(e,n)}async getFromId(e){this.#w||=new Map;const t=this.#w.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){const{blobPromise:e}=t;return delete t.blobPromise,this.getFromBlob(t.id,e)}return this.getFromUrl(t.url)}getFromCanvas(e,t){this.#w||=new Map;let n=this.#w.get(e);if(n?.bitmap)return n.refCounter+=1,n;const a=new OffscreenCanvas(t.width,t.height);return a.getContext("2d").drawImage(t,0,0),n={bitmap:a.transferToImageBitmap(),id:`image_${this.#x}_${this.#y++}`,refCounter:1,isSvg:!1},this.#w.set(e,n),this.#w.set(n.id,n),n}getSvgUrl(e){const t=this.#w.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#w||=new Map;const t=this.#w.get(e);if(!t)return;if(t.refCounter-=1,0!==t.refCounter)return;const{bitmap:n}=t;if(!t.url&&!t.file){const e=new OffscreenCanvas(n.width,n.height);e.getContext("bitmaprenderer").transferFromImageBitmap(n),t.blobPromise=e.convertToBlob()}n.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#x}_`)}}class is{#E=[];#S=!1;#C;#T=-1;constructor(e=128){this.#C=e}add({cmd:e,undo:t,post:n,mustExec:a,type:r=NaN,overwriteIfSameType:o=!1,keepUndo:i=!1}){if(a&&e(),this.#S)return;const s={cmd:e,undo:t,post:n,type:r};if(-1===this.#T)return this.#E.length>0&&(this.#E.length=0),this.#T=0,void this.#E.push(s);if(o&&this.#E[this.#T].type===r)return i&&(s.undo=this.#E[this.#T].undo),void(this.#E[this.#T]=s);const l=this.#T+1;l===this.#C?this.#E.splice(0,1):(this.#T=l,l<this.#E.length&&this.#E.splice(l)),this.#E.push(s)}undo(){if(-1===this.#T)return;this.#S=!0;const{undo:e,post:t}=this.#E[this.#T];e(),t?.(),this.#S=!1,this.#T-=1}redo(){if(this.#T<this.#E.length-1){this.#T+=1,this.#S=!0;const{cmd:e,post:t}=this.#E[this.#T];e(),t?.(),this.#S=!1}}hasSomethingToUndo(){return-1!==this.#T}hasSomethingToRedo(){return this.#T<this.#E.length-1}cleanType(e){if(-1!==this.#T){for(let t=this.#T;t>=0;t--)if(this.#E[t].type!==e)return this.#E.splice(t+1,this.#T-t),void(this.#T=t);this.#E.length=0,this.#T=-1}}destroy(){this.#E=null}}class ss{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=Di.platform;for(const[n,a,r={}]of e)for(const e of n){const n=e.startsWith("mac+");t&&n?(this.callbacks.set(e.slice(4),{callback:a,options:r}),this.allKeys.add(e.split("+").at(-1))):t||n||(this.callbacks.set(e,{callback:a,options:r}),this.allKeys.add(e.split("+").at(-1)))}}#A(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;const n=this.callbacks.get(this.#A(t));if(!n)return;const{callback:a,options:{bubbles:r=!1,args:o=[],checker:i=null}}=n;i&&!i(e,t)||(a.bind(e,...o,t)(),r||Ki(t))}}class ls{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return function(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const n of e.keys()){t.style.color=n;const a=window.getComputedStyle(t).color;e.set(n,Xi(a))}t.remove()}(e),bi(this,"_colors",e)}convert(e){const t=Xi(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[e,n]of this._colors)if(n.every((e,n)=>e===t[n]))return ls._colorsMapping.get(e);return t}getHexCode(e){const t=this._colors.get(e);return t?Ni.makeHexColor(...t):e}}class cs{#D=new AbortController;#_=null;#N=new Map;#M=new Map;#I=null;#R=null;#B=null;#P=new is;#L=null;#U=null;#F=0;#z=new Set;#O=null;#W=null;#q=new Set;_editorUndoBar=null;#H=!1;#j=!1;#V=!1;#G=null;#K=null;#$=null;#Y=null;#X=!1;#J=null;#Q=new rs;#Z=!1;#ee=!1;#te=null;#ne=null;#ae=null;#re=null;#oe=To.NONE;#ie=new Set;#se=null;#le=null;#ce=null;#de={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#me=[0,0];#pe=null;#ue=null;#ge=null;#he=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const e=cs.prototype,t=e=>e.#ue.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&e.hasSomethingToControl(),n=(e,{target:t})=>{if(t instanceof HTMLInputElement){const{type:e}=t;return"text"!==e&&"number"!==e}return!0},a=this.TRANSLATE_SMALL,r=this.TRANSLATE_BIG;return bi(this,"_keyboardManager",new ss([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],e.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:n}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:n}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#ue.contains(t)&&!e.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#ue.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-a,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-r,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[a,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[r,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-a],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-r],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,a],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,r],checker:t}]]))}constructor(e,t,n,a,r,o,i,s,l,c,d,m,p){const u=this._signal=this.#D.signal;this.#ue=e,this.#ge=t,this.#I=n,this._eventBus=a,a._on("editingaction",this.onEditingAction.bind(this),{signal:u}),a._on("pagechanging",this.onPageChanging.bind(this),{signal:u}),a._on("scalechanging",this.onScaleChanging.bind(this),{signal:u}),a._on("rotationchanging",this.onRotationChanging.bind(this),{signal:u}),a._on("setpreference",this.onSetPreference.bind(this),{signal:u}),a._on("switchannotationeditorparams",e=>this.updateParams(e.type,e.value),{signal:u}),this.#be(),this.#fe(),this.#ve(),this.#R=r.annotationStorage,this.#G=r.filterFactory,this.#le=o,this.#Y=i||null,this.#H=s,this.#j=l,this.#V=c,this.#re=d||null,this.viewParameters={realScale:Li.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=m||null,this._supportsPinchToZoom=!1!==p}destroy(){this.#he?.resolve(),this.#he=null,this.#D?.abort(),this.#D=null,this._signal=null;for(const e of this.#M.values())e.destroy();this.#M.clear(),this.#N.clear(),this.#q.clear(),this.#_=null,this.#ie.clear(),this.#P.destroy(),this.#I?.destroy(),this.#J?.hide(),this.#J=null,this.#K&&(clearTimeout(this.#K),this.#K=null),this.#pe&&(clearTimeout(this.#pe),this.#pe=null),this._editorUndoBar?.destroy()}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#re}get useNewAltTextFlow(){return this.#j}get useNewAltTextWhenAddingImage(){return this.#V}get hcmFilter(){return bi(this,"hcmFilter",this.#le?this.#G.addHCMFilter(this.#le.foreground,this.#le.background):"none")}get direction(){return bi(this,"direction",getComputedStyle(this.#ue).direction)}get highlightColors(){return bi(this,"highlightColors",this.#Y?new Map(this.#Y.split(",").map(e=>e.split("=").map(e=>e.trim()))):null)}get highlightColorNames(){return bi(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#U=e}setMainHighlightColorPicker(e){this.#ae=e}editAltText(e,t=!1){this.#I?.editAltText(this,e,t)}switchToMode(e,t){this._eventBus.on("annotationeditormodechanged",t,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch("setpreference",{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){if("enableNewAltTextWhenAddingImage"===e)this.#V=t}onPageChanging({pageNumber:e}){this.#F=e-1}focusMainContainer(){this.#ue.focus()}findParent(e,t){for(const n of this.#M.values()){const{x:a,y:r,width:o,height:i}=n.div.getBoundingClientRect();if(e>=a&&e<=a+o&&t>=r&&t<=r+i)return n}return null}disableUserSelect(e=!1){this.#ge.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#q.add(e)}removeShouldRescale(e){this.#q.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*Li.PDF_TO_CSS_UNITS;for(const e of this.#q)e.onScaleChanging();this.#U?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#ye({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#xe(e){const{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(const t of this.#M.values())if(t.hasTextLayer(e))return t;return null}highlightSelection(e=""){const t=document.getSelection();if(!t||t.isCollapsed)return;const{anchorNode:n,anchorOffset:a,focusNode:r,focusOffset:o}=t,i=t.toString(),s=this.#ye(t).closest(".textLayer"),l=this.getSelectionBoxes(s);if(!l)return;t.empty();const c=this.#xe(s),d=this.#oe===To.NONE,m=()=>{c?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:l,anchorNode:n,anchorOffset:a,focusNode:r,focusOffset:o,text:i}),d&&this.showAllEditors("highlight",!0,!0)};d?this.switchToMode(To.HIGHLIGHT,m):m()}#we(){const e=document.getSelection();if(!e||e.isCollapsed)return;const t=this.#ye(e).closest(".textLayer"),n=this.getSelectionBoxes(t);n&&(this.#J||=new ns(this),this.#J.show(t,n,"ltr"===this.direction))}addToAnnotationStorage(e){e.isEmpty()||!this.#R||this.#R.has(e.id)||this.#R.setValue(e.id,e)}#ke(){const e=document.getSelection();if(!e||e.isCollapsed)return void(this.#se&&(this.#J?.hide(),this.#se=null,this.#Ee({hasSelectedText:!1})));const{anchorNode:t}=e;if(t===this.#se)return;const n=this.#ye(e).closest(".textLayer");if(n){if(this.#J?.hide(),this.#se=t,this.#Ee({hasSelectedText:!0}),(this.#oe===To.HIGHLIGHT||this.#oe===To.NONE)&&(this.#oe===To.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#X=this.isShiftKeyDown,!this.isShiftKeyDown)){const e=this.#oe===To.HIGHLIGHT?this.#xe(n):null;e?.toggleDrawing();const t=new AbortController,a=this.combinedSignal(t),r=n=>{"pointerup"===n.type&&0!==n.button||(t.abort(),e?.toggleDrawing(!0),"pointerup"===n.type&&this.#Se("main_toolbar"))};window.addEventListener("pointerup",r,{signal:a}),window.addEventListener("blur",r,{signal:a})}}else this.#se&&(this.#J?.hide(),this.#se=null,this.#Ee({hasSelectedText:!1}))}#Se(e=""){this.#oe===To.HIGHLIGHT?this.highlightSelection(e):this.#H&&this.#we()}#be(){document.addEventListener("selectionchange",this.#ke.bind(this),{signal:this._signal})}#Ce(){if(this.#$)return;this.#$=new AbortController;const e=this.combinedSignal(this.#$);window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})}#Te(){this.#$?.abort(),this.#$=null}blur(){if(this.isShiftKeyDown=!1,this.#X&&(this.#X=!1,this.#Se("main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const t of this.#ie)if(t.div.contains(e)){this.#ne=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#ne)return;const[e,t]=this.#ne;this.#ne=null,t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#ve(){if(this.#te)return;this.#te=new AbortController;const e=this.combinedSignal(this.#te);window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})}#Ae(){this.#te?.abort(),this.#te=null}#De(){if(this.#L)return;this.#L=new AbortController;const e=this.combinedSignal(this.#L);document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})}#_e(){this.#L?.abort(),this.#L=null}#fe(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})}addEditListeners(){this.#ve(),this.#De()}removeEditListeners(){this.#Ae(),this.#_e()}dragOver(e){for(const{type:t}of e.dataTransfer.items)for(const n of this.#W)if(n.isHandlingMimeForPasting(t))return e.dataTransfer.dropEffect="copy",void e.preventDefault()}drop(e){for(const t of e.dataTransfer.items)for(const n of this.#W)if(n.isHandlingMimeForPasting(t.type))return n.paste(t,this.currentLayer),void e.preventDefault()}copy(e){if(e.preventDefault(),this.#_?.commitOrRemove(),!this.hasSelection)return;const t=[];for(const e of this.#ie){const n=e.serialize(!0);n&&t.push(n)}0!==t.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:t}=e;for(const e of t.items)for(const t of this.#W)if(t.isHandlingMimeForPasting(e.type))return void t.paste(e,this.currentLayer);let n=t.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(e){return void pi(e.message)}if(!Array.isArray(n))return;this.unselectAll();const a=this.currentLayer;try{const e=[];for(const t of n){const n=await a.deserialize(t);if(!n)return;e.push(n)}const t=()=>{for(const t of e)this.#Ne(t);this.#Me(e)},r=()=>{for(const t of e)t.remove()};this.addCommands({cmd:t,undo:r,mustExec:!0})}catch(e){pi(e.message)}}keydown(e){this.isShiftKeyDown||"Shift"!==e.key||(this.isShiftKeyDown=!0),this.#oe===To.NONE||this.isEditorHandlingKeyboard||cs._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&"Shift"===e.key&&(this.isShiftKeyDown=!1,this.#X&&(this.#X=!1,this.#Se("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu")}}#Ee(e){const t=Object.entries(e).some(([e,t])=>this.#de[e]!==t);t&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#de,e)}),this.#oe===To.HIGHLIGHT&&!1===e.hasSelectedEditor&&this.#Ie([[Ao.HIGHLIGHT_FREE,!0]]))}#Ie(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#Ce(),this.#De(),this.#Ee({isEditing:this.#oe!==To.NONE,isEmpty:this.#Re(),hasSomethingToUndo:this.#P.hasSomethingToUndo(),hasSomethingToRedo:this.#P.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#Te(),this.#_e(),this.#Ee({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#W){this.#W=e;for(const e of this.#W)this.#Ie(e.defaultPropertiesToUpdate)}}getId(){return this.#Q.id}get currentLayer(){return this.#M.get(this.#F)}getLayer(e){return this.#M.get(e)}get currentPageIndex(){return this.#F}addLayer(e){this.#M.set(e.pageIndex,e),this.#Z?e.enable():e.disable()}removeLayer(e){this.#M.delete(e.pageIndex)}async updateMode(e,t=null,n=!1){if(this.#oe!==e&&(!this.#he||(await this.#he.promise,this.#he))){if(this.#he=Promise.withResolvers(),this.#oe=e,e===To.NONE)return this.setEditingState(!1),this.#Be(),this._editorUndoBar?.hide(),void this.#he.resolve();this.setEditingState(!0),await this.#Pe(),this.unselectAll();for(const t of this.#M.values())t.updateMode(e);if(!t)return n&&this.addNewEditorFromKeyboard(),void this.#he.resolve();for(const e of this.#N.values())e.annotationElementId===t?(this.setSelected(e),e.enterInEditMode()):e.unselect();this.#he.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==this.#oe&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){if(this.#W){switch(e){case Ao.CREATE:return void this.currentLayer.addNewEditor();case Ao.HIGHLIGHT_DEFAULT_COLOR:this.#ae?.updateColor(t);break;case Ao.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#ce||=new Map).set(e,t),this.showAllEditors("highlight",t)}for(const n of this.#ie)n.updateParams(e,t);for(const n of this.#W)n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(const n of this.#N.values())n.editorType===e&&n.show(t);(this.#ce?.get(Ao.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#Ie([[Ao.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#ee!==e){this.#ee=e;for(const t of this.#M.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}async#Pe(){if(!this.#Z){this.#Z=!0;const e=[];for(const t of this.#M.values())e.push(t.enable());await Promise.all(e);for(const e of this.#N.values())e.enable()}}#Be(){if(this.unselectAll(),this.#Z){this.#Z=!1;for(const e of this.#M.values())e.disable();for(const e of this.#N.values())e.disable()}}getEditors(e){const t=[];for(const n of this.#N.values())n.pageIndex===e&&t.push(n);return t}getEditor(e){return this.#N.get(e)}addEditor(e){this.#N.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#K&&clearTimeout(this.#K),this.#K=setTimeout(()=>{this.focusMainContainer(),this.#K=null},0)),this.#N.delete(e.id),this.unselect(e),e.annotationElementId&&this.#z.has(e.annotationElementId)||this.#R?.remove(e.id)}addDeletedAnnotationElement(e){this.#z.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#z.has(e)}removeDeletedAnnotationElement(e){this.#z.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#Ne(e){const t=this.#M.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#_!==e&&(this.#_=e,e&&this.#Ie(e.propertiesToUpdate))}get#Le(){let e=null;for(e of this.#ie);return e}updateUI(e){this.#Le===e&&this.#Ie(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#Ie(e.defaultPropertiesToUpdate)}toggleSelected(e){if(this.#ie.has(e))return this.#ie.delete(e),e.unselect(),void this.#Ee({hasSelectedEditor:this.hasSelection});this.#ie.add(e),e.select(),this.#Ie(e.propertiesToUpdate),this.#Ee({hasSelectedEditor:!0})}setSelected(e){this.#U?.commitOrRemove();for(const t of this.#ie)t!==e&&t.unselect();this.#ie.clear(),this.#ie.add(e),e.select(),this.#Ie(e.propertiesToUpdate),this.#Ee({hasSelectedEditor:!0})}isSelected(e){return this.#ie.has(e)}get firstSelectedEditor(){return this.#ie.values().next().value}unselect(e){e.unselect(),this.#ie.delete(e),this.#Ee({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#ie.size}get isEnterHandled(){return 1===this.#ie.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#P.undo(),this.#Ee({hasSomethingToUndo:this.#P.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Re()}),this._editorUndoBar?.hide()}redo(){this.#P.redo(),this.#Ee({hasSomethingToUndo:!0,hasSomethingToRedo:this.#P.hasSomethingToRedo(),isEmpty:this.#Re()})}addCommands(e){this.#P.add(e),this.#Ee({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Re()})}cleanUndoStack(e){this.#P.cleanType(e)}#Re(){if(0===this.#N.size)return!0;if(1===this.#N.size)for(const e of this.#N.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();const e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const t=e?[e]:[...this.#ie],n=()=>{for(const e of t)this.#Ne(e)};this.addCommands({cmd:()=>{this._editorUndoBar?.show(n,1===t.length?t[0].editorType:t.length);for(const e of t)e.remove()},undo:n,mustExec:!0})}commitOrRemove(){this.#_?.commitOrRemove()}hasSomethingToControl(){return this.#_||this.hasSelection}#Me(e){for(const e of this.#ie)e.unselect();this.#ie.clear();for(const t of e)t.isEmpty()||(this.#ie.add(t),t.select());this.#Ee({hasSelectedEditor:this.hasSelection})}selectAll(){for(const e of this.#ie)e.commit();this.#Me(this.#N.values())}unselectAll(){if((!this.#_||(this.#_.commitOrRemove(),this.#oe===To.NONE))&&!this.#U?.commitOrRemove()&&this.hasSelection){for(const e of this.#ie)e.unselect();this.#ie.clear(),this.#Ee({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#me[0]+=e,this.#me[1]+=t;const[a,r]=this.#me,o=[...this.#ie];this.#pe&&clearTimeout(this.#pe),this.#pe=setTimeout(()=>{this.#pe=null,this.#me[0]=this.#me[1]=0,this.addCommands({cmd:()=>{for(const e of o)this.#N.has(e.id)&&e.translateInPage(a,r)},undo:()=>{for(const e of o)this.#N.has(e.id)&&e.translateInPage(-a,-r)},mustExec:!1})},1e3);for(const n of o)n.translateInPage(e,t)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#O=new Map;for(const e of this.#ie)this.#O.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#O)return!1;this.disableUserSelect(!1);const e=this.#O;this.#O=null;let t=!1;for(const[{x:n,y:a,pageIndex:r},o]of e)o.newX=n,o.newY=a,o.newPageIndex=r,t||=n!==o.savedX||a!==o.savedY||r!==o.savedPageIndex;if(!t)return!1;const n=(e,t,n,a)=>{if(this.#N.has(e.id)){const r=this.#M.get(a);r?e._setParentAndPosition(r,t,n):(e.pageIndex=a,e.x=t,e.y=n)}};return this.addCommands({cmd:()=>{for(const[t,{newX:a,newY:r,newPageIndex:o}]of e)n(t,a,r,o)},undo:()=>{for(const[t,{savedX:a,savedY:r,savedPageIndex:o}]of e)n(t,a,r,o)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#O)for(const n of this.#O.keys())n.drag(e,t)}rebuild(e){if(null===e.parent){const t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#ie.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#_===e}getActive(){return this.#_}getMode(){return this.#oe}get imageManager(){return bi(this,"imageManager",new os)}getSelectionBoxes(e){if(!e)return null;const t=document.getSelection();for(let n=0,a=t.rangeCount;n<a;n++)if(!e.contains(t.getRangeAt(n).commonAncestorContainer))return null;const{x:n,y:a,width:r,height:o}=e.getBoundingClientRect();let i;switch(e.getAttribute("data-main-rotation")){case"90":i=(e,t,i,s)=>({x:(t-a)/o,y:1-(e+i-n)/r,width:s/o,height:i/r});break;case"180":i=(e,t,i,s)=>({x:1-(e+i-n)/r,y:1-(t+s-a)/o,width:i/r,height:s/o});break;case"270":i=(e,t,i,s)=>({x:1-(t+s-a)/o,y:(e-n)/r,width:s/o,height:i/r});break;default:i=(e,t,i,s)=>({x:(e-n)/r,y:(t-a)/o,width:i/r,height:s/o})}const s=[];for(let e=0,n=t.rangeCount;e<n;e++){const n=t.getRangeAt(e);if(!n.collapsed)for(const{x:e,y:t,width:a,height:r}of n.getClientRects())0!==a&&0!==r&&s.push(i(e,t,a,r))}return 0===s.length?null:s}addChangedExistingAnnotation({annotationElementId:e,id:t}){(this.#B||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#B?.delete(e)}renderAnnotationElement(e){const t=this.#B?.get(e.data.id);if(!t)return;const n=this.#R.getRawValue(t);n&&(this.#oe!==To.NONE||n.hasBeenModified)&&n.renderAnnotationElement(e)}}class ds{#s=null;#Ue=!1;#Fe=null;#ze=null;#Oe=null;#We=null;#qe=!1;#He=null;#o=null;#je=null;#Ve=null;#Ge=!1;static#Ke=null;static _l10n=null;constructor(e){this.#o=e,this.#Ge=e._uiManager.useNewAltTextFlow,ds.#Ke||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(e){ds._l10n??=e}async render(){const e=this.#Fe=document.createElement("button");e.className="altText",e.tabIndex="0";const t=this.#ze=document.createElement("span");e.append(t),this.#Ge?(e.classList.add("new"),e.setAttribute("data-l10n-id",ds.#Ke.missing),t.setAttribute("data-l10n-id",ds.#Ke["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const n=this.#o._uiManager._signal;e.addEventListener("contextmenu",Gi,{signal:n}),e.addEventListener("pointerdown",e=>e.stopPropagation(),{signal:n});const a=e=>{e.preventDefault(),this.#o._uiManager.editAltText(this.#o),this.#Ge&&this.#o._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#$e}})};return e.addEventListener("click",a,{capture:!0,signal:n}),e.addEventListener("keydown",t=>{t.target===e&&"Enter"===t.key&&(this.#qe=!0,a(t))},{signal:n}),await this.#Ye(),e}get#$e(){return(this.#s?"added":null===this.#s&&this.guessedText&&"review")||"missing"}finish(){this.#Fe&&(this.#Fe.focus({focusVisible:this.#qe}),this.#qe=!1)}isEmpty(){return this.#Ge?null===this.#s:!this.#s&&!this.#Ue}hasData(){return this.#Ge?null!==this.#s||!!this.#je:this.isEmpty()}get guessedText(){return this.#je}async setGuessedText(e){null===this.#s&&(this.#je=e,this.#Ve=await ds._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e}),this.#Ye())}toggleAltTextBadge(e=!1){if(!this.#Ge||this.#s)return this.#He?.remove(),void(this.#He=null);if(!this.#He){const e=this.#He=document.createElement("div");e.className="noAltTextBadge",this.#o.div.append(e)}this.#He.classList.toggle("hidden",!e)}serialize(e){let t=this.#s;return e||this.#je!==t||(t=this.#Ve),{altText:t,decorative:this.#Ue,guessedText:this.#je,textWithDisclaimer:this.#Ve}}get data(){return{altText:this.#s,decorative:this.#Ue}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:a,cancel:r=!1}){n&&(this.#je=n,this.#Ve=a),this.#s===e&&this.#Ue===t||(r||(this.#s=e,this.#Ue=t),this.#Ye())}toggle(e=!1){this.#Fe&&(!e&&this.#We&&(clearTimeout(this.#We),this.#We=null),this.#Fe.disabled=!e)}shown(){this.#o._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#$e}})}destroy(){this.#Fe?.remove(),this.#Fe=null,this.#ze=null,this.#Oe=null,this.#He?.remove(),this.#He=null}async#Ye(){const e=this.#Fe;if(!e)return;if(this.#Ge){if(e.classList.toggle("done",!!this.#s),e.setAttribute("data-l10n-id",ds.#Ke[this.#$e]),this.#ze?.setAttribute("data-l10n-id",ds.#Ke[`${this.#$e}-label`]),!this.#s)return void this.#Oe?.remove()}else{if(!this.#s&&!this.#Ue)return e.classList.remove("done"),void this.#Oe?.remove();e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=this.#Oe;if(!t){this.#Oe=t=document.createElement("span"),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${this.#o.id}`;const n=100,a=this.#o._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(this.#We),this.#We=null},{once:!0}),e.addEventListener("mouseenter",()=>{this.#We=setTimeout(()=>{this.#We=null,this.#Oe.classList.add("show"),this.#o._reportTelemetry({action:"alt_text_tooltip"})},n)},{signal:a}),e.addEventListener("mouseleave",()=>{this.#We&&(clearTimeout(this.#We),this.#We=null),this.#Oe?.classList.remove("show")},{signal:a})}this.#Ue?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=this.#s),t.parentNode||e.append(t);const n=this.#o.getImageForAltText();n?.setAttribute("aria-describedby",t.id)}}class ms{#ue;#Xe=!1;#Je=null;#Qe;#Ze;#et;#tt;#nt;#at=null;#rt;#ot=null;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:a=null,onPinching:r=null,onPinchEnd:o=null,signal:i}){this.#ue=e,this.#Je=n,this.#Qe=t,this.#Ze=a,this.#et=r,this.#tt=o,this.#rt=new AbortController,this.#nt=AbortSignal.any([i,this.#rt.signal]),e.addEventListener("touchstart",this.#it.bind(this),{passive:!1,signal:this.#nt})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return bi(this,"MIN_TOUCH_DISTANCE_TO_PINCH",35/(window.devicePixelRatio||1))}#it(e){if(this.#Qe?.()||e.touches.length<2)return;if(!this.#ot){this.#ot=new AbortController;const e=AbortSignal.any([this.#nt,this.#ot.signal]),t=this.#ue,n={signal:e,passive:!1};t.addEventListener("touchmove",this.#st.bind(this),n),t.addEventListener("touchend",this.#lt.bind(this),n),t.addEventListener("touchcancel",this.#lt.bind(this),n),this.#Ze?.()}if(Ki(e),2!==e.touches.length||this.#Je?.())return void(this.#at=null);let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]),this.#at={touch0X:t.screenX,touch0Y:t.screenY,touch1X:n.screenX,touch1Y:n.screenY}}#st(e){if(!this.#at||2!==e.touches.length)return;let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]);const{screenX:a,screenY:r}=t,{screenX:o,screenY:i}=n,s=this.#at,{touch0X:l,touch0Y:c,touch1X:d,touch1Y:m}=s,p=d-l,u=m-c,g=o-a,h=i-r,b=Math.hypot(g,h)||1,f=Math.hypot(p,u)||1;if(!this.#Xe&&Math.abs(f-b)<=ms.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(s.touch0X=a,s.touch0Y=r,s.touch1X=o,s.touch1Y=i,e.preventDefault(),!this.#Xe)return void(this.#Xe=!0);const v=[(a+o)/2,(r+i)/2];this.#et?.(v,f,b)}#lt(e){this.#ot.abort(),this.#ot=null,this.#tt?.(),this.#at&&(e.preventDefault(),this.#at=null,this.#Xe=!1)}destroy(){this.#rt?.abort(),this.#rt=null}}class ps{#ct=null;#dt=null;#s=null;#mt=!1;#pt=null;#ut="";#gt=!1;#ht=null;#bt=null;#ft=null;#vt=null;#yt="";#xt=!1;#wt=null;#kt=!1;#Et=!1;#St=!1;#Ct=null;#Tt=0;#At=0;#Dt=null;#_t=null;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#Nt=!1;#Mt=ps._zIndex++;static _borderLineWidth=-1;static _colorManager=new ls;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const e=ps.prototype._resizeWithKeyboard,t=cs.TRANSLATE_SMALL,n=cs.TRANSLATE_BIG;return bi(this,"_resizerKeyboardManager",new ss([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,n]}],[["Escape","mac+Escape"],ps.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:t,rawDims:{pageWidth:n,pageHeight:a,pageX:r,pageY:o}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,a],this.pageTranslation=[r,o];const[i,s]=this.parentDimensions;this.x=e.x/i,this.y=e.y/s,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get isDrawer(){return!1}static get _defaultLineColor(){return bi(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new us({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){if(ps._l10n??=e,ps._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==ps._borderLineWidth)return;const n=getComputedStyle(document.documentElement);ps._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){ui("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#Nt}set _isDraggable(e){this.#Nt=e,this.div?.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(2*e),this.y+=this.width*e/(2*t);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(2*e),this.y-=this.width*e/(2*t);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#Mt}setParent(e){null!==e?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):this.#It(),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#xt?this.#xt=!1:this.parent.setSelected(this))}focusout(e){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const t=e.relatedTarget;t?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,a){const[r,o]=this.parentDimensions;[n,a]=this.screenToPageTranslation(n,a),this.x=(e+n)/r,this.y=(t+a)/o,this.fixAndSetPosition()}#Rt([e,t],n,a){[n,a]=this.screenToPageTranslation(n,a),this.x+=n/e,this.y+=a/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,t){this.#Rt(this.parentDimensions,e,t)}translateInPage(e,t){this.#wt||=[this.x,this.y,this.width,this.height],this.#Rt(this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}drag(e,t){this.#wt||=[this.x,this.y,this.width,this.height];const{div:n,parentDimensions:[a,r]}=this;if(this.x+=e/a,this.y+=t/r,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:o,y:i}=this;const[s,l]=this.getBaseTranslation();o+=s,i+=l;const{style:c}=n;c.left=`${(100*o).toFixed(2)}%`,c.top=`${(100*i).toFixed(2)}%`,this._onTranslating(o,i),n.scrollIntoView({block:"nearest"})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!this.#wt&&(this.#wt[0]!==this.x||this.#wt[1]!==this.y)}get _hasBeenResized(){return!!this.#wt&&(this.#wt[2]!==this.width||this.#wt[3]!==this.height)}getBaseTranslation(){const[e,t]=this.parentDimensions,{_borderLineWidth:n}=ps,a=n/e,r=n/t;switch(this.rotation){case 90:return[-a,r];case 180:return[a,r];case 270:return[a,-r];default:return[-a,-r]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:t},pageDimensions:[n,a]}=this;let{x:r,y:o,width:i,height:s}=this;if(i*=n,s*=a,r*=n,o*=a,this._mustFixPosition)switch(e){case 0:r=Math.max(0,Math.min(n-i,r)),o=Math.max(0,Math.min(a-s,o));break;case 90:r=Math.max(0,Math.min(n-s,r)),o=Math.min(a,Math.max(i,o));break;case 180:r=Math.min(n,Math.max(i,r)),o=Math.min(a,Math.max(s,o));break;case 270:r=Math.min(n,Math.max(s,r)),o=Math.max(0,Math.min(a-i,o))}this.x=r/=n,this.y=o/=a;const[l,c]=this.getBaseTranslation();r+=l,o+=c,t.left=`${(100*r).toFixed(2)}%`,t.top=`${(100*o).toFixed(2)}%`,this.moveInDOM()}static#Bt(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(e,t){return ps.#Bt(e,t,this.parentRotation)}pageTranslationToScreen(e,t){return ps.#Bt(e,t,360-this.parentRotation)}#Pt(e){switch(e){case 90:{const[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,t]=this.pageDimensions;return[0,e/t,-t/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,n]}=this;return[t*e,n*e]}setDims(e,t){const[n,a]=this.parentDimensions,{style:r}=this.div;r.width=`${(100*e/n).toFixed(2)}%`,this.#gt||(r.height=`${(100*t/a).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:t,width:n}=e,a=n.endsWith("%"),r=!this.#gt&&t.endsWith("%");if(a&&r)return;const[o,i]=this.parentDimensions;a||(e.width=`${(100*parseFloat(n)/o).toFixed(2)}%`),this.#gt||r||(e.height=`${(100*parseFloat(t)/i).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#Lt(){if(this.#ht)return;this.#ht=document.createElement("div"),this.#ht.classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(const n of e){const e=document.createElement("div");this.#ht.append(e),e.classList.add("resizer",n),e.setAttribute("data-resizer-name",n),e.addEventListener("pointerdown",this.#Ut.bind(this,n),{signal:t}),e.addEventListener("contextmenu",Gi,{signal:t}),e.tabIndex=-1}this.div.prepend(this.#ht)}#Ut(e,t){t.preventDefault();const{isMac:n}=Di.platform;if(0!==t.button||t.ctrlKey&&n)return;this.#s?.toggle(!1);const a=this._isDraggable;this._isDraggable=!1,this.#bt=[t.screenX,t.screenY];const r=new AbortController,o=this._uiManager.combinedSignal(r);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#Ft.bind(this,e),{passive:!0,capture:!0,signal:o}),window.addEventListener("touchmove",Ki,{passive:!1,signal:o}),window.addEventListener("contextmenu",Gi,{signal:o}),this.#ft={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const i=this.parent.div.style.cursor,s=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const l=()=>{r.abort(),this.parent.togglePointerEvents(!0),this.#s?.toggle(!0),this._isDraggable=a,this.parent.div.style.cursor=i,this.div.style.cursor=s,this.#zt()};window.addEventListener("pointerup",l,{signal:o}),window.addEventListener("blur",l,{signal:o})}#Ot(e,t,n,a){this.width=n,this.height=a,this.x=e,this.y=t;const[r,o]=this.parentDimensions;this.setDims(r*n,o*a),this.fixAndSetPosition(),this._onResized()}_onResized(){}#zt(){if(!this.#ft)return;const{savedX:e,savedY:t,savedWidth:n,savedHeight:a}=this.#ft;this.#ft=null;const r=this.x,o=this.y,i=this.width,s=this.height;r===e&&o===t&&i===n&&s===a||this.addCommands({cmd:this.#Ot.bind(this,r,o,i,s),undo:this.#Ot.bind(this,e,t,n,a),mustExec:!0})}static _round(e){return Math.round(1e4*e)/1e4}#Ft(e,t){const[n,a]=this.parentDimensions,r=this.x,o=this.y,i=this.width,s=this.height,l=ps.MIN_SIZE/n,c=ps.MIN_SIZE/a,d=this.#Pt(this.rotation),m=(e,t)=>[d[0]*e+d[2]*t,d[1]*e+d[3]*t],p=this.#Pt(360-this.rotation);let u,g,h=!1,b=!1;switch(e){case"topLeft":h=!0,u=(e,t)=>[0,0],g=(e,t)=>[e,t];break;case"topMiddle":u=(e,t)=>[e/2,0],g=(e,t)=>[e/2,t];break;case"topRight":h=!0,u=(e,t)=>[e,0],g=(e,t)=>[0,t];break;case"middleRight":b=!0,u=(e,t)=>[e,t/2],g=(e,t)=>[0,t/2];break;case"bottomRight":h=!0,u=(e,t)=>[e,t],g=(e,t)=>[0,0];break;case"bottomMiddle":u=(e,t)=>[e/2,t],g=(e,t)=>[e/2,0];break;case"bottomLeft":h=!0,u=(e,t)=>[0,t],g=(e,t)=>[e,0];break;case"middleLeft":b=!0,u=(e,t)=>[0,t/2],g=(e,t)=>[e,t/2]}const f=u(i,s),v=g(i,s);let y=m(...v);const x=ps._round(r+y[0]),w=ps._round(o+y[1]);let k,E,S=1,C=1;if(t.fromKeyboard)({deltaX:k,deltaY:E}=t);else{const{screenX:e,screenY:n}=t,[a,r]=this.#bt;[k,E]=this.screenToPageTranslation(e-a,n-r),this.#bt[0]=e,this.#bt[1]=n}var T,A;if([k,E]=(T=k/n,A=E/a,[p[0]*T+p[2]*A,p[1]*T+p[3]*A]),h){const e=Math.hypot(i,s);S=C=Math.max(Math.min(Math.hypot(v[0]-f[0]-k,v[1]-f[1]-E)/e,1/i,1/s),l/i,c/s)}else b?S=Math.max(l,Math.min(1,Math.abs(v[0]-f[0]-k)))/i:C=Math.max(c,Math.min(1,Math.abs(v[1]-f[1]-E)))/s;const D=ps._round(i*S),_=ps._round(s*C);y=m(...g(D,_));const N=x-y[0],M=w-y[1];this.#wt||=[this.x,this.y,this.width,this.height],this.width=D,this.height=_,this.x=N,this.y=M,this.setDims(n*D,a*_),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#s?.finish()}async addEditToolbar(){return this._editToolbar||this.#Et||(this._editToolbar=new ts(this),this.div.append(this._editToolbar.render()),this.#s&&await this._editToolbar.addAltText(this.#s)),this._editToolbar}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#s?.destroy())}addContainer(e){const t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#s||(ds.initialize(ps._l10n),this.#s=new ds(this),this.#ct&&(this.#s.data=this.#ct,this.#ct=null),await this.addEditToolbar())}get altTextData(){return this.#s?.data}set altTextData(e){this.#s&&(this.#s.data=e)}get guessedAltText(){return this.#s?.guessedText}async setGuessedAltText(e){await(this.#s?.setGuessedText(e))}serializeAltText(e){return this.#s?.serialize(e)}hasAltText(){return!!this.#s&&!this.#s.isEmpty()}hasAltTextData(){return this.#s?.hasData()??!1}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#mt?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.#Wt();const[e,t]=this.parentDimensions;this.parentRotation%180!=0&&(this.div.style.maxWidth=`${(100*t/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/t).toFixed(2)}%`);const[n,a]=this.getInitialTranslation();return this.translate(n,a),as(this,this.div,["pointerdown"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#_t||=new ms({container:this.div,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#qt.bind(this),onPinching:this.#Ht.bind(this),onPinchEnd:this.#jt.bind(this),signal:this._uiManager._signal})),this._uiManager._editorUndoBar?.hide(),this.div}#qt(){this.#ft={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#s?.toggle(!1),this.parent.togglePointerEvents(!1)}#Ht(e,t,n){let a=n/t*.7+1-.7;if(1===a)return;const r=this.#Pt(this.rotation),o=(e,t)=>[r[0]*e+r[2]*t,r[1]*e+r[3]*t],[i,s]=this.parentDimensions,l=this.x,c=this.y,d=this.width,m=this.height,p=ps.MIN_SIZE/i,u=ps.MIN_SIZE/s;a=Math.max(Math.min(a,1/d,1/m),p/d,u/m);const g=ps._round(d*a),h=ps._round(m*a);if(g===d&&h===m)return;this.#wt||=[l,c,d,m];const b=o(d/2,m/2),f=ps._round(l+b[0]),v=ps._round(c+b[1]),y=o(g/2,h/2);this.x=f-y[0],this.y=v-y[1],this.width=g,this.height=h,this.setDims(i*g,s*h),this.fixAndSetPosition(),this._onResizing()}#jt(){this.#s?.toggle(!0),this.parent.togglePointerEvents(!0),this.#zt()}pointerdown(e){const{isMac:t}=Di.platform;0!==e.button||e.ctrlKey&&t?e.preventDefault():(this.#xt=!0,this._isDraggable?this.#Vt(e):this.#Gt(e))}get isSelected(){return this._uiManager.isSelected(this)}#Gt(e){const{isMac:t}=Di.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#Vt(e){const{isSelected:t}=this;this._uiManager.setUpDragSession();let n=!1;const a=new AbortController,r=this._uiManager.combinedSignal(a),o={capture:!0,passive:!1,signal:r},i=e=>{a.abort(),this.#pt=null,this.#xt=!1,this._uiManager.endDragSession()||this.#Gt(e),n&&this._onStopDragging()};t&&(this.#Tt=e.clientX,this.#At=e.clientY,this.#pt=e.pointerId,this.#ut=e.pointerType,window.addEventListener("pointermove",e=>{n||(n=!0,this._onStartDragging());const{clientX:t,clientY:a,pointerId:r}=e;if(r!==this.#pt)return void Ki(e);const[o,i]=this.screenToPageTranslation(t-this.#Tt,a-this.#At);this.#Tt=t,this.#At=a,this._uiManager.dragSelectedEditors(o,i)},o),window.addEventListener("touchmove",Ki,o),window.addEventListener("pointerdown",e=>{e.pointerType===this.#ut&&(this.#_t||e.isPrimary)&&i(e),Ki(e)},o));const s=e=>{this.#pt&&this.#pt!==e.pointerId?Ki(e):i(e)};window.addEventListener("pointerup",s,{signal:r}),window.addEventListener("blur",s,{signal:r})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#Ct&&clearTimeout(this.#Ct),this.#Ct=setTimeout(()=>{this.#Ct=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,n=this.rotation){const a=this.parentScale,[r,o]=this.pageDimensions,[i,s]=this.pageTranslation,l=e/a,c=t/a,d=this.x*r,m=this.y*o,p=this.width*r,u=this.height*o;switch(n){case 0:return[d+l+i,o-m-c-u+s,d+l+p+i,o-m-c+s];case 90:return[d+c+i,o-m+l+s,d+c+u+i,o-m+l+p+s];case 180:return[d-l-p+i,o-m+c+s,d-l+i,o-m+c+u+s];case 270:return[d-c-u+i,o-m-l-p+s,d-c+i,o-m-l+s];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[n,a,r,o]=e,i=r-n,s=o-a;switch(this.rotation){case 0:return[n,t-o,i,s];case 90:return[n,t-a,s,i];case 180:return[r,t-a,i,s];case 270:return[r,t-o,s,i];default:throw new Error("Invalid rotation")}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){this.#Et=!0}disableEditMode(){this.#Et=!1}isInEditMode(){return this.#Et}shouldGetKeyboardEvents(){return this.#St}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:t,bottom:n,right:a}=this.getClientDimensions(),{innerHeight:r,innerWidth:o}=window;return t<o&&a>0&&e<r&&n>0}#Wt(){if(this.#vt||!this.div)return;this.#vt=new AbortController;const e=this._uiManager.combinedSignal(this.#vt);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})}rebuild(){this.#Wt()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,t=null){ui("An editor must be serializable")}static async deserialize(e,t,n){const a=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:n});a.rotation=e.rotation,a.#ct=e.accessibilityData;const[r,o]=a.pageDimensions,[i,s,l,c]=a.getRectInCurrentCoords(e.rect,o);return a.x=i/r,a.y=s/o,a.width=l/r,a.height=c/o,a}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.#vt?.abort(),this.#vt=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#Ct&&(clearTimeout(this.#Ct),this.#Ct=null),this.#It(),this.removeEditToolbar(),this.#Dt){for(const e of this.#Dt.values())clearTimeout(e);this.#Dt=null}this.parent=null,this.#_t?.destroy(),this.#_t=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#Lt(),this.#ht.classList.remove("hidden"),as(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||"Enter"!==e.key)return;this._uiManager.setSelected(this),this.#ft={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const t=this.#ht.children;if(!this.#dt){this.#dt=Array.from(t);const e=this.#Kt.bind(this),n=this.#$t.bind(this),a=this._uiManager._signal;for(const t of this.#dt){const r=t.getAttribute("data-resizer-name");t.setAttribute("role","spinbutton"),t.addEventListener("keydown",e,{signal:a}),t.addEventListener("blur",n,{signal:a}),t.addEventListener("focus",this.#Yt.bind(this,r),{signal:a}),t.setAttribute("data-l10n-id",ps._l10nResizer[r])}}const n=this.#dt[0];let a=0;for(const e of t){if(e===n)break;a++}const r=(360-this.rotation+this.parentRotation)%360/90*(this.#dt.length/4);if(r!==a){if(r<a)for(let e=0;e<a-r;e++)this.#ht.append(this.#ht.firstChild);else if(r>a)for(let e=0;e<r-a;e++)this.#ht.firstChild.before(this.#ht.lastChild);let e=0;for(const n of t){const t=this.#dt[e++].getAttribute("data-resizer-name");n.setAttribute("data-l10n-id",ps._l10nResizer[t])}}this.#Xt(0),this.#St=!0,this.#ht.firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#Kt(e){ps._resizerKeyboardManager.exec(this,e)}#$t(e){this.#St&&e.relatedTarget?.parentNode!==this.#ht&&this.#It()}#Yt(e){this.#yt=this.#St?e:""}#Xt(e){if(this.#dt)for(const t of this.#dt)t.tabIndex=e}_resizeWithKeyboard(e,t){this.#St&&this.#Ft(this.#yt,{deltaX:e,deltaY:t,fromKeyboard:!0})}#It(){this.#St=!1,this.#Xt(-1),this.#zt()}_stopResizingWithKeyboard(){this.#It(),this.div.focus()}select(){this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar?(this._editToolbar?.show(),this.#s?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()})}unselect(){this.#ht?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#s?.toggleAltTextBadge(!0)}updateParams(e,t){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#kt}set isEditing(e){this.#kt=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){this.#gt=!0;const n=e/t,{style:a}=this.div;a.aspectRatio=n,a.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){this.#Dt||=new Map;const{action:t}=e;let n=this.#Dt.get(t);return n&&clearTimeout(n),n=setTimeout(()=>{this._reportTelemetry(e),this.#Dt.delete(t),0===this.#Dt.size&&(this.#Dt=null)},ps._telemetryTimeout),void this.#Dt.set(t,n)}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#mt=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#mt=!0}renderAnnotationElement(e){let t=e.container.querySelector(".annotationContent");if(t){if("CANVAS"===t.nodeName){const e=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.before(t)}}else t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);return t}resetAnnotationElement(e){const{firstChild:t}=e.container;"DIV"===t?.nodeName&&t.classList.contains("annotationContent")&&t.remove()}}class us extends ps{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const gs=3285377520,hs=4294901760,bs=65535;class fs{constructor(e){this.h1=e?4294967295&e:gs,this.h2=e?4294967295&e:gs}update(e){let t,n;if("string"==typeof e){t=new Uint8Array(2*e.length),n=0;for(let a=0,r=e.length;a<r;a++){const r=e.charCodeAt(a);r<=255?t[n++]=r:(t[n++]=r>>>8,t[n++]=255&r)}}else{if(!ArrayBuffer.isView(e))throw new Error("Invalid data format, must be a string or TypedArray.");t=e.slice(),n=t.byteLength}const a=n>>2,r=n-4*a,o=new Uint32Array(t.buffer,0,a);let i=0,s=0,l=this.h1,c=this.h2;const d=3432918353,m=461845907,p=11601,u=13715;for(let e=0;e<a;e++)1&e?(i=o[e],i=i*d&hs|i*p&bs,i=i<<15|i>>>17,i=i*m&hs|i*u&bs,l^=i,l=l<<13|l>>>19,l=5*l+3864292196):(s=o[e],s=s*d&hs|s*p&bs,s=s<<15|s>>>17,s=s*m&hs|s*u&bs,c^=s,c=c<<13|c>>>19,c=5*c+3864292196);switch(i=0,r){case 3:i^=t[4*a+2]<<16;case 2:i^=t[4*a+1]<<8;case 1:i^=t[4*a],i=i*d&hs|i*p&bs,i=i<<15|i>>>17,i=i*m&hs|i*u&bs,1&a?l^=i:c^=i}this.h1=l,this.h2=c}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&hs|36045*e&bs,t=4283543511*t&hs|(2950163797*(t<<16|e>>>16)&hs)>>>16,e^=t>>>1,e=444984403*e&hs|60499*e&bs,t=3301882366*t&hs|(3120437893*(t<<16|e>>>16)&hs)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}const vs=Object.freeze({map:null,hash:"",transfer:void 0});class ys{#Jt=!1;#Qt=null;#Zt=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const n=this.#Zt.get(e);return void 0===n?t:Object.assign(t,n)}getRawValue(e){return this.#Zt.get(e)}remove(e){if(this.#Zt.delete(e),0===this.#Zt.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const e of this.#Zt.values())if(e instanceof ps)return;this.onAnnotationEditor(null)}}setValue(e,t){const n=this.#Zt.get(e);let a=!1;if(void 0!==n)for(const[e,r]of Object.entries(t))n[e]!==r&&(a=!0,n[e]=r);else a=!0,this.#Zt.set(e,t);a&&this.#en(),t instanceof ps&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type)}has(e){return this.#Zt.has(e)}getAll(){return this.#Zt.size>0?Ai(this.#Zt):null}setAll(e){for(const[t,n]of Object.entries(e))this.setValue(t,n)}get size(){return this.#Zt.size}#en(){this.#Jt||(this.#Jt=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#Jt&&(this.#Jt=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new xs(this)}get serializable(){if(0===this.#Zt.size)return vs;const e=new Map,t=new fs,n=[],a=Object.create(null);let r=!1;for(const[n,o]of this.#Zt){const i=o instanceof ps?o.serialize(!1,a):o;i&&(e.set(n,i),t.update(`${n}:${JSON.stringify(i)}`),r||=!!i.bitmap)}if(r)for(const t of e.values())t.bitmap&&n.push(t.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:vs}get editorStats(){let e=null;const t=new Map;for(const n of this.#Zt.values()){if(!(n instanceof ps))continue;const a=n.telemetryFinalData;if(!a)continue;const{type:r}=a;t.has(r)||t.set(r,Object.getPrototypeOf(n).constructor),e||=Object.create(null);const o=e[r]||=new Map;for(const[e,t]of Object.entries(a)){if("type"===e)continue;let n=o.get(e);n||(n=new Map,o.set(e,n));const a=n.get(t)??0;n.set(t,a+1)}}for(const[n,a]of t)e[n]=a.computeTelemetryFinalData(e[n]);return e}resetModifiedIds(){this.#Qt=null}get modifiedIds(){if(this.#Qt)return this.#Qt;const e=[];for(const t of this.#Zt.values())t instanceof ps&&t.annotationElementId&&t.serialize()&&e.push(t.annotationElementId);return this.#Qt={ids:new Set(e),hash:e.join(",")}}}class xs extends ys{#tn;constructor(e){super();const{map:t,hash:n,transfer:a}=e.serializable,r=structuredClone(t,a?{transfer:a}:null);this.#tn={map:r,hash:n,transfer:a}}get print(){ui("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#tn}get modifiedIds(){return bi(this,"modifiedIds",{ids:new Set,hash:""})}}class ws{#nn=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#nn.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:t}){if(e&&!this.#nn.has(e.loadedName)){if(gi(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:n,src:a,style:r}=e,o=new FontFace(n,a,r);this.addNativeFontFace(o);try{await o.load(),this.#nn.add(n),t?.(e)}catch{pi(e.baseFontName),this.removeNativeFontFace(o)}return}ui("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo)return void await this.loadSystemFont(e);if(this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw pi(t.family),e.disableFontFace=!0,n}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(t=>{const n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){return bi(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){let e=!1;return(uo||"undefined"!=typeof navigator&&"string"==typeof navigator?.userAgent&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),bi(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const{loadingRequests:t}=this,n={done:!1,complete:function(){for(gi(!n.done,"completeRequest() cannot be called twice."),n.done=!0;t.length>0&&t[0].done;){const e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(n),n}get _loadTestFont(){return bi(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function a(e,t,n,a){return e.substring(0,t)+a+e.substring(t+n)}let r,o;const i=this._document.createElement("canvas");i.width=1,i.height=1;const s=i.getContext("2d");let l=0;const c=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=a(d,976,c.length,c);const m=1482184792;let p=n(d,16);for(r=0,o=c.length-3;r<o;r+=4)p=p-m+n(c,r)|0;var u;r<c.length&&(p=p-m+n(c+"XXX",r)|0),d=a(d,16,4,(u=p,String.fromCharCode(u>>24&255,u>>16&255,u>>8&255,255&u)));const g=`@font-face {font-family:"${c}";src:${`url(data:font/opentype;base64,${btoa(d)});`}}`;this.insertRule(g);const h=this._document.createElement("div");h.style.visibility="hidden",h.style.width=h.style.height="10px",h.style.position="absolute",h.style.top=h.style.left="0px";for(const t of[e.loadedName,c]){const e=this._document.createElement("span");e.textContent="Hi",e.style.fontFamily=t,h.append(e)}this._document.body.append(h),function e(t,n){if(++l>30)return pi(),void n();s.font="30px "+t,s.fillText(".",0,20),s.getImageData(0,0,1,1).data[3]>0?n():setTimeout(e.bind(null,t,n))}(c,()=>{h.remove(),t.complete()})}}class ks{constructor(e,{disableFontFace:t=!1,fontExtraProperties:n=!1,inspectFont:a=null}){this.compiledGlyphs=Object.create(null);for(const t in e)this[t]=e[t];this.disableFontFace=!0===t,this.fontExtraProperties=!0===n,this._inspectFont=a}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${t=this.data,Uint8Array.prototype.toBase64?t.toBase64():btoa(Ci(t))});`;var t;let n;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else n=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),n}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];const n=this.loadedName+"_path_"+t;let a;try{a=e.get(n)}catch(e){pi()}const r=new Path2D(a||"");return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=r}}const Es=1,Ss=2,Cs=1,Ts=2,As=3,Ds=4,_s=5,Ns=6,Ms=7,Is=8;function Rs(){}function Bs(e){if(e instanceof Si||e instanceof xi||e instanceof wi||e instanceof vi||e instanceof ki||e instanceof yi)return e;switch(e instanceof Error||"object"==typeof e&&null!==e||ui('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new Si(e.message);case"InvalidPDFException":return new xi(e.message);case"MissingPDFException":return new wi(e.message);case"PasswordException":return new vi(e.message,e.code);case"UnexpectedResponseException":return new ki(e.message,e.status);case"UnknownErrorException":return new yi(e.message,e.details)}return new yi(e.message,e.toString())}class Ps{#an=new AbortController;constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener("message",this.#rn.bind(this),{signal:this.#an.signal})}#rn({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#on(e);if(e.callback){const t=e.callbackId,n=this.callbackCapabilities[t];if(!n)throw new Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===Es)n.resolve(e.data);else{if(e.callback!==Ss)throw new Error("Unexpected callback case");n.reject(Bs(e.reason))}return}const t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const n=this.sourceName,a=e.sourceName,r=this.comObj;return void Promise.try(t,e.data).then(function(t){r.postMessage({sourceName:n,targetName:a,callback:Es,callbackId:e.callbackId,data:t})},function(t){r.postMessage({sourceName:n,targetName:a,callback:Ss,callbackId:e.callbackId,reason:Bs(t)})})}e.streamId?this.#in(e):t(e.data)}on(e,t){const n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){const a=this.callbackId++,r=Promise.withResolvers();this.callbackCapabilities[a]=r;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:a,data:t},n)}catch(e){r.reject(e)}return r.promise}sendWithStream(e,t,n,a){const r=this.streamId++,o=this.sourceName,i=this.targetName,s=this.comObj;return new ReadableStream({start:n=>{const l=Promise.withResolvers();return this.streamControllers[r]={controller:n,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},s.postMessage({sourceName:o,targetName:i,action:e,streamId:r,data:t,desiredSize:n.desiredSize},a),l.promise},pull:e=>{const t=Promise.withResolvers();return this.streamControllers[r].pullCall=t,s.postMessage({sourceName:o,targetName:i,stream:Ns,streamId:r,desiredSize:e.desiredSize}),t.promise},cancel:e=>{gi(e instanceof Error,"cancel must have a valid reason");const t=Promise.withResolvers();return this.streamControllers[r].cancelCall=t,this.streamControllers[r].isClosed=!0,s.postMessage({sourceName:o,targetName:i,stream:Cs,streamId:r,reason:Bs(e)}),t.promise}},n)}#in(e){const t=e.streamId,n=this.sourceName,a=e.sourceName,r=this.comObj,o=this,i=this.actionHandler[e.action],s={enqueue(e,o=1,i){if(this.isCancelled)return;const s=this.desiredSize;this.desiredSize-=o,s>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),r.postMessage({sourceName:n,targetName:a,stream:Ds,streamId:t,chunk:e},i)},close(){this.isCancelled||(this.isCancelled=!0,r.postMessage({sourceName:n,targetName:a,stream:As,streamId:t}),delete o.streamSinks[t])},error(e){gi(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,r.postMessage({sourceName:n,targetName:a,stream:_s,streamId:t,reason:Bs(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};s.sinkCapability.resolve(),s.ready=s.sinkCapability.promise,this.streamSinks[t]=s,Promise.try(i,e.data,s).then(function(){r.postMessage({sourceName:n,targetName:a,stream:Is,streamId:t,success:!0})},function(e){r.postMessage({sourceName:n,targetName:a,stream:Is,streamId:t,reason:Bs(e)})})}#on(e){const t=e.streamId,n=this.sourceName,a=e.sourceName,r=this.comObj,o=this.streamControllers[t],i=this.streamSinks[t];switch(e.stream){case Is:e.success?o.startCall.resolve():o.startCall.reject(Bs(e.reason));break;case Ms:e.success?o.pullCall.resolve():o.pullCall.reject(Bs(e.reason));break;case Ns:if(!i){r.postMessage({sourceName:n,targetName:a,stream:Ms,streamId:t,success:!0});break}i.desiredSize<=0&&e.desiredSize>0&&i.sinkCapability.resolve(),i.desiredSize=e.desiredSize,Promise.try(i.onPull||Rs).then(function(){r.postMessage({sourceName:n,targetName:a,stream:Ms,streamId:t,success:!0})},function(e){r.postMessage({sourceName:n,targetName:a,stream:Ms,streamId:t,reason:Bs(e)})});break;case Ds:if(gi(o,"enqueue should have stream controller"),o.isClosed)break;o.controller.enqueue(e.chunk);break;case As:if(gi(o,"close should have stream controller"),o.isClosed)break;o.isClosed=!0,o.controller.close(),this.#sn(o,t);break;case _s:gi(o,"error should have stream controller"),o.controller.error(Bs(e.reason)),this.#sn(o,t);break;case Ts:e.success?o.cancelCall.resolve():o.cancelCall.reject(Bs(e.reason)),this.#sn(o,t);break;case Cs:if(!i)break;const s=Bs(e.reason);Promise.try(i.onCancel||Rs,s).then(function(){r.postMessage({sourceName:n,targetName:a,stream:Ts,streamId:t,success:!0})},function(e){r.postMessage({sourceName:n,targetName:a,stream:Ts,streamId:t,reason:Bs(e)})}),i.sinkCapability.reject(s),i.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async#sn(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#an?.abort(),this.#an=null}}class Ls{#ln=!1;constructor({enableHWA:e=!1}){this.#ln=e}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d",{willReadFrequently:!this.#ln})}}reset(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){ui("Abstract method `_createCanvas` called.")}}class Us{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(t).then(e=>({cMapData:e,isCompressed:this.isCompressed})).catch(e=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)})}async _fetch(e){ui("Abstract method `_fetch` called.")}}class Fs extends Us{async _fetch(e){const t=await Ui(e,this.isCompressed?"arraybuffer":"text");return t instanceof ArrayBuffer?new Uint8Array(t):Ti(t)}}mo(4520);class zs{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,n,a,r){return"none"}destroy(e=!1){}}class Os{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetch(t).catch(e=>{throw new Error(`Unable to load font data at: ${t}`)})}async _fetch(e){ui("Abstract method `_fetch` called.")}}class Ws extends Os{async _fetch(e){const t=await Ui(e,"arraybuffer");return new Uint8Array(t)}}if(uo){let e;try{const t=process.getBuiltinModule("module").createRequire("file:///D:/Extension%20Development/secure-wa-extension/secure-wa-extension/secure-wa-extension/extension/node_modules/pdfjs-dist/legacy/build/pdf.mjs");try{e=t("@napi-rs/canvas")}catch(e){pi()}}catch(e){pi()}globalThis.DOMMatrix||(e?.DOMMatrix?globalThis.DOMMatrix=e.DOMMatrix:pi()),globalThis.ImageData||(e?.ImageData?globalThis.ImageData=e.ImageData:pi()),globalThis.Path2D||(e?.Path2D?globalThis.Path2D=e.Path2D:pi())}async function qs(e){const t=process.getBuiltinModule("fs"),n=await t.promises.readFile(e);return new Uint8Array(n)}const Hs="Fill",js="Stroke",Vs="Shading";function Gs(e,t){if(!t)return;const n=t[2]-t[0],a=t[3]-t[1],r=new Path2D;r.rect(t[0],t[1],n,a),e.clip(r)}class Ks{getPattern(){ui("Abstract method `getPattern` called.")}}class $s extends Ks{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,n,a){let r;if(a===js||a===Hs){const o=t.current.getClippedPathBoundingBox(a,Ji(e))||[0,0,0,0],i=Math.ceil(o[2]-o[0])||1,s=Math.ceil(o[3]-o[1])||1,l=t.cachedCanvases.getCanvas("pattern",i,s),c=l.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-o[0],-o[1]),n=Ni.transform(n,[1,0,0,1,o[0],o[1]]),c.transform(...t.baseTransform),this.matrix&&c.transform(...this.matrix),Gs(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),r=e.createPattern(l.canvas,"no-repeat");const d=new DOMMatrix(n);r.setTransform(d)}else Gs(e,this._bbox),r=this._createGradient(e);return r}}function Ys(e,t,n,a,r,o,i,s){const l=t.coords,c=t.colors,d=e.data,m=4*e.width;let p;l[n+1]>l[a+1]&&(p=n,n=a,a=p,p=o,o=i,i=p),l[a+1]>l[r+1]&&(p=a,a=r,r=p,p=i,i=s,s=p),l[n+1]>l[a+1]&&(p=n,n=a,a=p,p=o,o=i,i=p);const u=(l[n]+t.offsetX)*t.scaleX,g=(l[n+1]+t.offsetY)*t.scaleY,h=(l[a]+t.offsetX)*t.scaleX,b=(l[a+1]+t.offsetY)*t.scaleY,f=(l[r]+t.offsetX)*t.scaleX,v=(l[r+1]+t.offsetY)*t.scaleY;if(g>=v)return;const y=c[o],x=c[o+1],w=c[o+2],k=c[i],E=c[i+1],S=c[i+2],C=c[s],T=c[s+1],A=c[s+2],D=Math.round(g),_=Math.round(v);let N,M,I,R,B,P,L,U;for(let e=D;e<=_;e++){if(e<b){const t=e<g?0:(g-e)/(g-b);N=u-(u-h)*t,M=y-(y-k)*t,I=x-(x-E)*t,R=w-(w-S)*t}else{let t;t=e>v?1:b===v?0:(b-e)/(b-v),N=h-(h-f)*t,M=k-(k-C)*t,I=E-(E-T)*t,R=S-(S-A)*t}let t;t=e<g?0:e>v?1:(g-e)/(g-v),B=u-(u-f)*t,P=y-(y-C)*t,L=x-(x-T)*t,U=w-(w-A)*t;const n=Math.round(Math.min(N,B)),a=Math.round(Math.max(N,B));let r=m*e+4*n;for(let e=n;e<=a;e++)t=(N-e)/(N-B),t<0?t=0:t>1&&(t=1),d[r++]=M-(M-P)*t|0,d[r++]=I-(I-L)*t|0,d[r++]=R-(R-U)*t|0,d[r++]=255}}function Xs(e,t,n){const a=t.coords,r=t.colors;let o,i;switch(t.type){case"lattice":const s=t.verticesPerRow,l=Math.floor(a.length/s)-1,c=s-1;for(o=0;o<l;o++){let t=o*s;for(let o=0;o<c;o++,t++)Ys(e,n,a[t],a[t+1],a[t+s],r[t],r[t+1],r[t+s]),Ys(e,n,a[t+s+1],a[t+1],a[t+s],r[t+s+1],r[t+1],r[t+s])}break;case"triangles":for(o=0,i=a.length;o<i;o+=3)Ys(e,n,a[o],a[o+1],a[o+2],r[o],r[o+1],r[o+2]);break;default:throw new Error("illegal figure")}}class Js extends Ks{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(e,t,n){const a=Math.floor(this._bounds[0]),r=Math.floor(this._bounds[1]),o=Math.ceil(this._bounds[2])-a,i=Math.ceil(this._bounds[3])-r,s=Math.min(Math.ceil(Math.abs(o*e[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(i*e[1]*1.1)),3e3),c=o/s,d=i/l,m={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-r,scaleX:1/c,scaleY:1/d},p=s+4,u=l+4,g=n.getCanvas("mesh",p,u),h=g.context,b=h.createImageData(s,l);if(t){const e=b.data;for(let n=0,a=e.length;n<a;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2],e[n+3]=255}for(const e of this._figures)Xs(b,e,m);h.putImageData(b,2,2);return{canvas:g.canvas,offsetX:a-2*c,offsetY:r-2*d,scaleX:c,scaleY:d}}getPattern(e,t,n,a){let r;if(Gs(e,this._bbox),a===Vs)r=Ni.singularValueDecompose2dScale(Ji(e));else if(r=Ni.singularValueDecompose2dScale(t.baseTransform),this.matrix){const e=Ni.singularValueDecompose2dScale(this.matrix);r=[r[0]*e[0],r[1]*e[1]]}const o=this._createMeshCanvas(r,a===Vs?null:this._background,t.cachedCanvases);return a!==Vs&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(o.offsetX,o.offsetY),e.scale(o.scaleX,o.scaleY),e.createPattern(o.canvas,"no-repeat")}}class Qs extends Ks{getPattern(){return"hotpink"}}const Zs=1,el=2;class tl{static MAX_PATTERN_SIZE=3e3;constructor(e,t,n,a,r){this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=t,this.ctx=n,this.canvasGraphicsFactory=a,this.baseTransform=r}createPatternCanvas(e){const{bbox:t,operatorList:n,paintType:a,tilingType:r,color:o,canvasGraphicsFactory:i}=this;let{xstep:s,ystep:l}=this;s=Math.abs(s),l=Math.abs(l),mi();const c=t[0],d=t[1],m=t[2],p=t[3],u=m-c,g=p-d,h=Ni.singularValueDecompose2dScale(this.matrix),b=Ni.singularValueDecompose2dScale(this.baseTransform),f=h[0]*b[0],v=h[1]*b[1];let y=u,x=g,w=!1,k=!1;const E=Math.ceil(s*f),S=Math.ceil(l*v);E>=Math.ceil(u*f)?y=s:w=!0,S>=Math.ceil(g*v)?x=l:k=!0;const C=this.getSizeAndScale(y,this.ctx.canvas.width,f),T=this.getSizeAndScale(x,this.ctx.canvas.height,v),A=e.cachedCanvases.getCanvas("pattern",C.size,T.size),D=A.context,_=i.createCanvasGraphics(D);if(_.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(_,a,o),D.translate(-C.scale*c,-T.scale*d),_.transform(C.scale,0,0,T.scale,0,0),D.save(),this.clipBbox(_,c,d,m,p),_.baseTransform=Ji(_.ctx),_.executeOperatorList(n),_.endDrawing(),D.restore(),w||k){const t=A.canvas;w&&(y=s),k&&(x=l);const n=this.getSizeAndScale(y,this.ctx.canvas.width,f),a=this.getSizeAndScale(x,this.ctx.canvas.height,v),r=n.size,o=a.size,i=e.cachedCanvases.getCanvas("pattern-workaround",r,o),m=i.context,p=w?Math.floor(u/s):0,h=k?Math.floor(g/l):0;for(let e=0;e<=p;e++)for(let n=0;n<=h;n++)m.drawImage(t,r*e,o*n,r,o,0,0,r,o);return{canvas:i.canvas,scaleX:n.scale,scaleY:a.scale,offsetX:c,offsetY:d}}return{canvas:A.canvas,scaleX:C.scale,scaleY:T.scale,offsetX:c,offsetY:d}}getSizeAndScale(e,t,n){const a=Math.max(tl.MAX_PATTERN_SIZE,t);let r=Math.ceil(e*n);return r>=a?r=a:n=r/e,{scale:n,size:r}}clipBbox(e,t,n,a,r){const o=a-t,i=r-n;e.ctx.rect(t,n,o,i),e.current.updateRectMinMax(Ji(e.ctx),[t,n,a,r]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){const a=e.ctx,r=e.current;switch(t){case Zs:const e=this.ctx;a.fillStyle=e.fillStyle,a.strokeStyle=e.strokeStyle,r.fillColor=e.fillStyle,r.strokeColor=e.strokeStyle;break;case el:const o=Ni.makeHexColor(n[0],n[1],n[2]);a.fillStyle=o,a.strokeStyle=o,r.fillColor=o,r.strokeColor=o;break;default:throw new Ei(`Unsupported paint type: ${t}`)}}getPattern(e,t,n,a){let r=n;a!==Vs&&(r=Ni.transform(r,t.baseTransform),this.matrix&&(r=Ni.transform(r,this.matrix)));const o=this.createPatternCanvas(t);let i=new DOMMatrix(r);i=i.translate(o.offsetX,o.offsetY),i=i.scale(1/o.scaleX,1/o.scaleY);const s=e.createPattern(o.canvas,"repeat");return s.setTransform(i),s}}function nl({src:e,srcPos:t=0,dest:n,width:a,height:r,nonBlackColor:o=4294967295,inverseDecode:i=!1}){const s=Di.isLittleEndian?4278190080:255,[l,c]=i?[o,s]:[s,o],d=a>>3,m=7&a,p=e.length;n=new Uint32Array(n.buffer);let u=0;for(let a=0;a<r;a++){for(const a=t+d;t<a;t++){const a=t<p?e[t]:255;n[u++]=128&a?c:l,n[u++]=64&a?c:l,n[u++]=32&a?c:l,n[u++]=16&a?c:l,n[u++]=8&a?c:l,n[u++]=4&a?c:l,n[u++]=2&a?c:l,n[u++]=1&a?c:l}if(0===m)continue;const a=t<p?e[t++]:255;for(let e=0;e<m;e++)n[u++]=a&1<<7-e?c:l}return{srcPos:t,destPos:u}}const al=16;class rl{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let a;return void 0!==this.cache[e]?(a=this.cache[e],this.canvasFactory.reset(a,t,n)):(a=this.canvasFactory.create(t,n),this.cache[e]=a),a}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function ol(e,t,n,a,r,o,i,s,l,c){const[d,m,p,u,g,h]=Ji(e);if(0===m&&0===p){const b=i*d+g,f=Math.round(b),v=s*u+h,y=Math.round(v),x=(i+l)*d+g,w=Math.abs(Math.round(x)-f)||1,k=(s+c)*u+h,E=Math.abs(Math.round(k)-y)||1;return e.setTransform(Math.sign(d),0,0,Math.sign(u),f,y),e.drawImage(t,n,a,r,o,0,0,w,E),e.setTransform(d,m,p,u,g,h),[w,E]}if(0===d&&0===u){const b=s*p+g,f=Math.round(b),v=i*m+h,y=Math.round(v),x=(s+c)*p+g,w=Math.abs(Math.round(x)-f)||1,k=(i+l)*m+h,E=Math.abs(Math.round(k)-y)||1;return e.setTransform(0,Math.sign(m),Math.sign(p),0,f,y),e.drawImage(t,n,a,r,o,0,0,E,w),e.setTransform(d,m,p,u,g,h),[E,w]}e.drawImage(t,n,a,r,o,i,s,l,c);return[Math.hypot(d,m)*l,Math.hypot(p,u)*c]}class il{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=go,this.textMatrixScale=1,this.fontMatrix=ho,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=_o,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.patternStroke=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,t])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,n){[t,n]=Ni.applyTransform([t,n],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,n),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,n)}updateRectMinMax(e,t){const n=Ni.applyTransform(t,e),a=Ni.applyTransform(t.slice(2),e),r=Ni.applyTransform([t[0],t[3]],e),o=Ni.applyTransform([t[2],t[1]],e);this.minX=Math.min(this.minX,n[0],a[0],r[0],o[0]),this.minY=Math.min(this.minY,n[1],a[1],r[1],o[1]),this.maxX=Math.max(this.maxX,n[0],a[0],r[0],o[0]),this.maxY=Math.max(this.maxY,n[1],a[1],r[1],o[1])}updateScalingPathMinMax(e,t){Ni.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.minY=Math.min(this.minY,t[1]),this.maxX=Math.max(this.maxX,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,n,a,r,o,i,s,l,c){const d=Ni.bezierBoundingBox(t,n,a,r,o,i,s,l,c);c||this.updateRectMinMax(e,d)}getPathBoundingBox(e=Hs,t=null){const n=[this.minX,this.minY,this.maxX,this.maxY];if(e===js){t||ui("Stroke bounding box must include transform.");const e=Ni.singularValueDecompose2dScale(t),a=e[0]*this.lineWidth/2,r=e[1]*this.lineWidth/2;n[0]-=a,n[1]-=r,n[2]+=a,n[3]+=r}return n}updateClipFromPath(){const e=Ni.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=Hs,t=null){return Ni.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function sl(e,t){if(t instanceof ImageData)return void e.putImageData(t,0,0);const n=t.height,a=t.width,r=n%al,o=(n-r)/al,i=0===r?o:o+1,s=e.createImageData(a,al);let l,c=0;const d=t.data,m=s.data;let p,u,g,h;if(t.kind===Po.GRAYSCALE_1BPP){const t=d.byteLength,n=new Uint32Array(m.buffer,0,m.byteLength>>2),h=n.length,b=a+7>>3,f=4294967295,v=Di.isLittleEndian?4278190080:255;for(p=0;p<i;p++){for(g=p<o?al:r,l=0,u=0;u<g;u++){const e=t-c;let r=0;const o=e>b?a:8*e-7,i=-8&o;let s=0,m=0;for(;r<i;r+=8)m=d[c++],n[l++]=128&m?f:v,n[l++]=64&m?f:v,n[l++]=32&m?f:v,n[l++]=16&m?f:v,n[l++]=8&m?f:v,n[l++]=4&m?f:v,n[l++]=2&m?f:v,n[l++]=1&m?f:v;for(;r<o;r++)0===s&&(m=d[c++],s=128),n[l++]=m&s?f:v,s>>=1}for(;l<h;)n[l++]=0;e.putImageData(s,0,p*al)}}else if(t.kind===Po.RGBA_32BPP){for(u=0,h=a*al*4,p=0;p<o;p++)m.set(d.subarray(c,c+h)),c+=h,e.putImageData(s,0,u),u+=al;p<i&&(h=a*r*4,m.set(d.subarray(c,c+h)),e.putImageData(s,0,u))}else{if(t.kind!==Po.RGB_24BPP)throw new Error(`bad image kind: ${t.kind}`);for(g=al,h=a*g,p=0;p<i;p++){for(p>=o&&(g=r,h=a*g),l=0,u=h;u--;)m[l++]=d[c++],m[l++]=d[c++],m[l++]=d[c++],m[l++]=255;e.putImageData(s,0,p*al)}}}function ll(e,t){if(t.bitmap)return void e.drawImage(t.bitmap,0,0);const n=t.height,a=t.width,r=n%al,o=(n-r)/al,i=0===r?o:o+1,s=e.createImageData(a,al);let l=0;const c=t.data,d=s.data;for(let t=0;t<i;t++){const n=t<o?al:r;({srcPos:l}=nl({src:c,srcPos:l,dest:d,width:a,height:n,nonBlackColor:0})),e.putImageData(s,0,t*al)}}function cl(e,t){const n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const a of n)void 0!==e[a]&&(t[a]=e[a]);void 0!==e.setLineDash&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function dl(e){if(e.strokeStyle=e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",void 0!==e.setLineDash&&(e.setLineDash([]),e.lineDashOffset=0),!uo){const{filter:t}=e;"none"!==t&&""!==t&&(e.filter="none")}}function ml(e,t){if(t)return!0;const n=Ni.singularValueDecompose2dScale(e);n[0]=Math.fround(n[0]),n[1]=Math.fround(n[1]);const a=Math.fround((globalThis.devicePixelRatio||1)*Li.PDF_TO_CSS_UNITS);return n[0]<=a&&n[1]<=a}const pl=["butt","round","square"],ul=["miter","round","bevel"],gl={},hl={};class bl{constructor(e,t,n,a,r,{optionalContentConfig:o,markedContentStack:i=null},s,l){this.ctx=e,this.current=new il(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=n,this.canvasFactory=a,this.filterFactory=r,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=i||[],this.optionalContentConfig=o,this.cachedCanvases=new rl(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=s,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,t=null){return"string"==typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:a=null}){const r=this.ctx.canvas.width,o=this.ctx.canvas.height,i=this.ctx.fillStyle;if(this.ctx.fillStyle=a||"#ffffff",this.ctx.fillRect(0,0,r,o),this.ctx.fillStyle=i,n){const e=this.cachedCanvases.getCanvas("transparent",r,o);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...Ji(this.compositeCtx))}this.ctx.save(),dl(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=Ji(this.ctx)}executeOperatorList(e,t,n,a){const r=e.argsArray,o=e.fnArray;let i=t||0;const s=r.length;if(s===i)return i;const l=s-i>10&&"function"==typeof n,c=l?Date.now()+15:0;let d=0;const m=this.commonObjs,p=this.objs;let u;for(;;){if(void 0!==a&&i===a.nextBreakPoint)return a.breakIt(i,n),i;if(u=o[i],u!==ii.dependency)this[u].apply(this,r[i]);else for(const e of r[i]){const t=e.startsWith("g_")?m:p;if(!t.has(e))return t.get(e,n),i}if(i++,i===s)return i;if(l&&++d>10){if(Date.now()>c)return n(),i;d=0}}}#cn(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#cn(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#dn()}#dn(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==e){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){const n=e.width??e.displayWidth,a=e.height??e.displayHeight;let r,o,i=Math.max(Math.hypot(t[0],t[1]),1),s=Math.max(Math.hypot(t[2],t[3]),1),l=n,c=a,d="prescale1";for(;i>2&&l>1||s>2&&c>1;){let t=l,n=c;i>2&&l>1&&(t=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),i/=l/t),s>2&&c>1&&(n=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,s/=c/n),r=this.cachedCanvases.getCanvas(d,t,n),o=r.context,o.clearRect(0,0,t,n),o.drawImage(e,0,0,l,c,0,0,t,n),e=r.canvas,l=t,c=n,d="prescale1"===d?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}_createMaskCanvas(e){const t=this.ctx,{width:n,height:a}=e,r=this.current.fillColor,o=this.current.patternFill,i=Ji(t);let s,l,c,d;if((e.bitmap||e.data)&&e.count>1){const t=e.bitmap||e.data.buffer;l=JSON.stringify(o?i:[i.slice(0,4),r]),s=this._cachedBitmapsMap.get(t),s||(s=new Map,this._cachedBitmapsMap.set(t,s));const n=s.get(l);if(n&&!o){return{canvas:n,offsetX:Math.round(Math.min(i[0],i[2])+i[4]),offsetY:Math.round(Math.min(i[1],i[3])+i[5])}}c=n}c||(d=this.cachedCanvases.getCanvas("maskCanvas",n,a),ll(d.context,e));let m=Ni.transform(i,[1/n,0,0,-1/a,0,0]);m=Ni.transform(m,[1,0,0,1,0,-a]);const[p,u,g,h]=Ni.getAxialAlignedBoundingBox([0,0,n,a],m),b=Math.round(g-p)||1,f=Math.round(h-u)||1,v=this.cachedCanvases.getCanvas("fillCanvas",b,f),y=v.context,x=p,w=u;y.translate(-x,-w),y.transform(...m),c||(c=this._scaleImage(d.canvas,Qi(y)),c=c.img,s&&o&&s.set(l,c)),y.imageSmoothingEnabled=ml(Ji(y),e.interpolate),ol(y,c,0,0,c.width,c.height,0,0,n,a),y.globalCompositeOperation="source-in";const k=Ni.transform(Qi(y),[1,0,0,1,-x,-w]);return y.fillStyle=o?r.getPattern(t,this,k,Hs):r,y.fillRect(0,0,n,a),s&&!o&&(this.cachedCanvases.delete("fillCanvas"),s.set(l,v.canvas)),{canvas:v.canvas,offsetX:Math.round(x),offsetY:Math.round(w)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=pl[e]}setLineJoin(e){this.ctx.lineJoin=ul[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const n=this.ctx;void 0!==n.setLineDash&&(n.setLineDash(e),n.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,n]of e)switch(t){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n,this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,a=this.cachedCanvases.getCanvas(n,e,t);this.suspendedCtx=this.ctx,this.ctx=a.context;const r=this.ctx;r.setTransform(...Ji(this.suspendedCtx)),cl(this.suspendedCtx,r),function(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()},e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,n){t.translate(e,n),this.__originalTranslate(e,n)},e.scale=function(e,n){t.scale(e,n),this.__originalScale(e,n)},e.transform=function(e,n,a,r,o,i){t.transform(e,n,a,r,o,i),this.__originalTransform(e,n,a,r,o,i)},e.setTransform=function(e,n,a,r,o,i){t.setTransform(e,n,a,r,o,i),this.__originalSetTransform(e,n,a,r,o,i)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,n){t.moveTo(e,n),this.__originalMoveTo(e,n)},e.lineTo=function(e,n){t.lineTo(e,n),this.__originalLineTo(e,n)},e.bezierCurveTo=function(e,n,a,r,o,i){t.bezierCurveTo(e,n,a,r,o,i),this.__originalBezierCurveTo(e,n,a,r,o,i)},e.rect=function(e,n,a,r){t.rect(e,n,a,r),this.__originalRect(e,n,a,r)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(r,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),cl(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,t,n,a){const r=a[0],o=a[1],i=a[2]-r,s=a[3]-o;0!==i&&0!==s&&(this.genericComposeSMask(t.context,n,i,s,t.subtype,t.backdrop,t.transferMap,r,o,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,0,0),e.restore())}genericComposeSMask(e,t,n,a,r,o,i,s,l,c,d){let m=e.canvas,p=s-c,u=l-d;if(o){const t=Ni.makeHexColor(...o);if(p<0||u<0||p+n>m.width||u+a>m.height){const e=this.cachedCanvases.getCanvas("maskExtension",n,a),r=e.context;r.drawImage(m,-p,-u),r.globalCompositeOperation="destination-atop",r.fillStyle=t,r.fillRect(0,0,n,a),r.globalCompositeOperation="source-over",m=e.canvas,p=u=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const r=new Path2D;r.rect(p,u,n,a),e.clip(r),e.globalCompositeOperation="destination-atop",e.fillStyle=t,e.fillRect(p,u,n,a),e.restore()}}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),"Alpha"===r&&i?t.filter=this.filterFactory.addAlphaFilter(i):"Luminosity"===r&&(t.filter=this.filterFactory.addLuminosityFilter(i));const g=new Path2D;g.rect(s,l,n,a),t.clip(g),t.globalCompositeOperation="destination-in",t.drawImage(m,p,u,n,a,s,l,n,a),t.restore()}save(){this.inSMaskMode?(cl(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),cl(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,t,n,a,r,o){this.ctx.transform(e,t,n,a,r,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n){const a=this.ctx,r=this.current;let o,i,s=r.x,l=r.y;const c=Ji(a),d=0===c[0]&&0===c[3]||0===c[1]&&0===c[2],m=d?n.slice(0):null;for(let n=0,p=0,u=e.length;n<u;n++)switch(0|e[n]){case ii.rectangle:s=t[p++],l=t[p++];const e=t[p++],n=t[p++],u=s+e,g=l+n;a.moveTo(s,l),0===e||0===n?a.lineTo(u,g):(a.lineTo(u,l),a.lineTo(u,g),a.lineTo(s,g)),d||r.updateRectMinMax(c,[s,l,u,g]),a.closePath();break;case ii.moveTo:s=t[p++],l=t[p++],a.moveTo(s,l),d||r.updatePathMinMax(c,s,l);break;case ii.lineTo:s=t[p++],l=t[p++],a.lineTo(s,l),d||r.updatePathMinMax(c,s,l);break;case ii.curveTo:o=s,i=l,s=t[p+4],l=t[p+5],a.bezierCurveTo(t[p],t[p+1],t[p+2],t[p+3],s,l),r.updateCurvePathMinMax(c,o,i,t[p],t[p+1],t[p+2],t[p+3],s,l,m),p+=6;break;case ii.curveTo2:o=s,i=l,a.bezierCurveTo(s,l,t[p],t[p+1],t[p+2],t[p+3]),r.updateCurvePathMinMax(c,o,i,s,l,t[p],t[p+1],t[p+2],t[p+3],m),s=t[p+2],l=t[p+3],p+=4;break;case ii.curveTo3:o=s,i=l,s=t[p+2],l=t[p+3],a.bezierCurveTo(t[p],t[p+1],s,l,s,l),r.updateCurvePathMinMax(c,o,i,t[p],t[p+1],s,l,s,l,m),p+=4;break;case ii.closePath:a.closePath()}d&&r.updateScalingPathMinMax(c,m),r.setCurrentPoint(s,l)}closePath(){this.ctx.closePath()}stroke(e=!0){const t=this.ctx,n=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof n&&n?.getPattern?(t.save(),t.strokeStyle=n.getPattern(t,this,Qi(t),js),this.rescaleAndStroke(!1),t.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){const t=this.ctx,n=this.current.fillColor;let a=!1;this.current.patternFill&&(t.save(),t.fillStyle=n.getPattern(t,this,Qi(t),Hs),a=!0);const r=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==r&&(this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill()),a&&t.restore(),e&&this.consumePath(r)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=gl}eoClip(){this.pendingClip=hl}beginText(){this.current.textMatrix=go,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,t=this.ctx;if(void 0===e)return void t.beginPath();const n=new Path2D,a=t.getTransform().invertSelf();for(const{transform:t,x:r,y:o,fontSize:i,path:s}of e)n.addPath(s,new DOMMatrix(t).preMultiplySelf(a).translate(r,o).scale(i,-i));t.clip(n),t.beginPath(),delete this.pendingTextPaths}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){const n=this.commonObjs.get(e),a=this.current;if(!n)throw new Error(`Can't find font for ${e}`);if(a.fontMatrix=n.fontMatrix||ho,0!==a.fontMatrix[0]&&0!==a.fontMatrix[3]||pi(),t<0?(t=-t,a.fontDirection=-1):a.fontDirection=1,this.current.font=n,this.current.fontSize=t,n.isType3Font)return;const r=n.loadedName||"sans-serif",o=n.systemFontInfo?.css||`"${r}", ${n.fallbackName}`;let i="normal";n.black?i="900":n.bold&&(i="bold");const s=n.italic?"italic":"normal";let l=t;t<16?l=16:t>100&&(l=100),this.current.fontSizeScale=t/l,this.ctx.font=`${s} ${i} ${l}px ${o}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,n,a,r,o){this.current.textMatrix=[e,t,n,a,r,o],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}#mn(e,t,n){const a=new Path2D;return a.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(t)),a}paintChar(e,t,n,a,r){const o=this.ctx,i=this.current,s=i.font,l=i.textRenderingMode,c=i.fontSize/i.fontSizeScale,d=l&Ro,m=!!(l&Bo),p=i.patternFill&&!s.missingFile,u=i.patternStroke&&!s.missingFile;let g;if((s.disableFontFace||m||p||u)&&(g=s.getPathGenerator(this.commonObjs,e)),s.disableFontFace||p||u){if(o.save(),o.translate(t,n),o.scale(c,-c),d===_o||d===Mo)if(a){const e=o.getTransform();o.setTransform(...a),o.fill(this.#mn(g,e,a))}else o.fill(g);if(d===No||d===Mo)if(r){const e=o.getTransform();o.setTransform(...r),o.stroke(this.#mn(g,e,r))}else o.lineWidth/=c,o.stroke(g);o.restore()}else d!==_o&&d!==Mo||o.fillText(e,t,n),d!==No&&d!==Mo||o.strokeText(e,t,n);if(m){(this.pendingTextPaths||=[]).push({transform:Ji(o),x:t,y:n,fontSize:c,path:g})}}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let n=!1;for(let e=3;e<t.length;e+=4)if(t[e]>0&&t[e]<255){n=!0;break}return bi(this,"isFontSubpixelAAEnabled",n)}showText(e){const t=this.current,n=t.font;if(n.isType3Font)return this.showType3Text(e);const a=t.fontSize;if(0===a)return;const r=this.ctx,o=t.fontSizeScale,i=t.charSpacing,s=t.wordSpacing,l=t.fontDirection,c=t.textHScale*l,d=e.length,m=n.vertical,p=m?1:-1,u=n.defaultVMetrics,g=a*t.fontMatrix[0],h=t.textRenderingMode===_o&&!n.disableFontFace&&!t.patternFill;let b,f;if(r.save(),r.transform(...t.textMatrix),r.translate(t.x,t.y+t.textRise),l>0?r.scale(c,-1):r.scale(c,1),t.patternFill){r.save();const e=t.fillColor.getPattern(r,this,Qi(r),Hs);b=Ji(r),r.restore(),r.fillStyle=e}if(t.patternStroke){r.save();const e=t.strokeColor.getPattern(r,this,Qi(r),js);f=Ji(r),r.restore(),r.strokeStyle=e}let v=t.lineWidth;const y=t.textMatrixScale;if(0===y||0===v){const e=t.textRenderingMode&Ro;e!==No&&e!==Mo||(v=this.getSinglePixelWidth())}else v/=y;if(1!==o&&(r.scale(o,o),v/=o),r.lineWidth=v,n.isInvalidPDFjsFont){const n=[];let a=0;for(const t of e)n.push(t.unicode),a+=t.width;return r.fillText(n.join(""),0,0),t.x+=a*g*c,r.restore(),void this.compose()}let x,w=0;for(x=0;x<d;++x){const t=e[x];if("number"==typeof t){w+=p*t*a/1e3;continue}let c=!1;const d=(t.isSpace?s:0)+i,v=t.fontChar,y=t.accent;let k,E,S=t.width;if(m){const e=t.vmetric||u,n=-(t.vmetric?e[1]:.5*S)*g,a=e[2]*g;S=e?-e[0]:S,k=n/o,E=(w+a)/o}else k=w/o,E=0;if(n.remeasure&&S>0){const e=1e3*r.measureText(v).width/a*o;if(S<e&&this.isFontSubpixelAAEnabled){const t=S/e;c=!0,r.save(),r.scale(t,1),k/=t}else S!==e&&(k+=(S-e)/2e3*a/o)}if(this.contentVisible&&(t.isInFont||n.missingFile))if(h&&!y)r.fillText(v,k,E);else if(this.paintChar(v,k,E,b,f),y){const e=k+a*y.offset.x/o,t=E-a*y.offset.y/o;this.paintChar(y.fontChar,e,t,b,f)}w+=m?S*g-d*l:S*g+d*l,c&&r.restore()}m?t.y-=w:t.x+=w*c,r.restore(),this.compose()}showType3Text(e){const t=this.ctx,n=this.current,a=n.font,r=n.fontSize,o=n.fontDirection,i=a.vertical?1:-1,s=n.charSpacing,l=n.wordSpacing,c=n.textHScale*o,d=n.fontMatrix||ho,m=e.length;let p,u,g,h;if(!(n.textRenderingMode===Io)&&0!==r){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,t.save(),t.transform(...n.textMatrix),t.translate(n.x,n.y),t.scale(c,o),p=0;p<m;++p){if(u=e[p],"number"==typeof u){h=i*u*r/1e3,this.ctx.translate(h,0),n.x+=h*c;continue}const o=(u.isSpace?l:0)+s,m=a.charProcOperatorList[u.operatorListId];if(!m){pi(u.operatorListId);continue}this.contentVisible&&(this.processingType3=u,this.save(),t.scale(r,r),t.transform(...d),this.executeOperatorList(m),this.restore());g=Ni.applyTransform([u.width,0],d)[0]*r+o,t.translate(g,0),n.x+=g*c}t.restore(),this.processingType3=null}}setCharWidth(e,t){}setCharWidthAndBounds(e,t,n,a,r,o){this.ctx.rect(n,a,r-n,o-a),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let t;if("TilingPattern"===e[0]){const n=e[1],a=this.baseTransform||Ji(this.ctx),r={createCanvasGraphics:e=>new bl(e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new tl(e,n,this.ctx,r,a)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,n){this.ctx.strokeStyle=this.current.strokeColor=Ni.makeHexColor(e,t,n),this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,t,n){this.ctx.fillStyle=this.current.fillColor=Ni.makeHexColor(e,t,n),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t=null){let n;return this.cachedPatterns.has(e)?n=this.cachedPatterns.get(e):(n=function(e){switch(e[0]){case"RadialAxial":return new $s(e);case"Mesh":return new Js(e);case"Dummy":return new Qs}throw new Error(`Unknown IR type: ${e[0]}`)}(this.getObject(e)),this.cachedPatterns.set(e,n)),t&&(n.matrix=t),n}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const n=this._getPattern(e);t.fillStyle=n.getPattern(t,this,Qi(t),Vs);const a=Qi(t);if(a){const{width:e,height:n}=t.canvas,[r,o,i,s]=Ni.getAxialAlignedBoundingBox([0,0,e,n],a);this.ctx.fillRect(r,o,i-r,s-o)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){ui("Should not call beginInlineImage")}beginImageData(){ui("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=Ji(this.ctx),t)){const e=t[2]-t[0],n=t[3]-t[1];this.ctx.rect(t[0],t[1],e,n),this.current.updateRectMinMax(Ji(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;e.isolated||mi(),e.knockout&&pi();const n=Ji(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let a=Ni.getAxialAlignedBoundingBox(e.bbox,Ji(t));const r=[0,0,t.canvas.width,t.canvas.height];a=Ni.intersect(a,r)||[0,0,0,0];const o=Math.floor(a[0]),i=Math.floor(a[1]),s=Math.max(Math.ceil(a[2])-o,1),l=Math.max(Math.ceil(a[3])-i,1);this.current.startNewPathAndClipBox([0,0,s,l]);let c="groupAt"+this.groupLevel;e.smask&&(c+="_smask_"+this.smaskCounter++%2);const d=this.cachedCanvases.getCanvas(c,s,l),m=d.context;m.translate(-o,-i),m.transform(...n),e.smask?this.smaskStack.push({canvas:d.canvas,context:m,offsetX:o,offsetY:i,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(o,i),t.save()),cl(t,m),this.ctx=m,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,n=this.groupStack.pop();if(this.ctx=n,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const e=Ji(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...e);const n=Ni.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,t,n,a,r){if(this.#cn(),dl(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),t){const a=t[2]-t[0],o=t[3]-t[1];if(r&&this.annotationCanvasMap){(n=n.slice())[4]-=t[0],n[5]-=t[1],(t=t.slice())[0]=t[1]=0,t[2]=a,t[3]=o;const[r,i]=Ni.singularValueDecompose2dScale(Ji(this.ctx)),{viewportScale:s}=this,l=Math.ceil(a*this.outputScaleX*s),c=Math.ceil(o*this.outputScaleY*s);this.annotationCanvas=this.canvasFactory.create(l,c);const{canvas:d,context:m}=this.annotationCanvas;this.annotationCanvasMap.set(e,d),this.annotationCanvas.savedCtx=this.ctx,this.ctx=m,this.ctx.save(),this.ctx.setTransform(r,0,0,-i,0,o*i),dl(this.ctx)}else dl(this.ctx),this.endPath(),this.ctx.rect(t[0],t[1],a,o),this.ctx.clip(),this.ctx.beginPath()}this.current=new il(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...n),this.transform(...a)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#dn(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;(e=this.getObject(e.data,e)).count=t;const n=this.ctx,a=this.processingType3;if(a&&(void 0===a.compiled&&(a.compiled=function(e){const{width:t,height:n}=e;if(t>1e3||n>1e3)return null;const a=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),r=t+1;let o,i,s,l=new Uint8Array(r*(n+1));const c=t+7&-8;let d=new Uint8Array(c*n),m=0;for(const t of e.data){let e=128;for(;e>0;)d[m++]=t&e?0:255,e>>=1}let p=0;for(m=0,0!==d[m]&&(l[0]=1,++p),i=1;i<t;i++)d[m]!==d[m+1]&&(l[i]=d[m]?2:1,++p),m++;for(0!==d[m]&&(l[i]=2,++p),o=1;o<n;o++){m=o*c,s=o*r,d[m-c]!==d[m]&&(l[s]=d[m]?1:8,++p);let e=(d[m]?4:0)+(d[m-c]?8:0);for(i=1;i<t;i++)e=(e>>2)+(d[m+1]?4:0)+(d[m-c+1]?8:0),a[e]&&(l[s+i]=a[e],++p),m++;if(d[m-c]!==d[m]&&(l[s+i]=d[m]?2:4,++p),p>1e3)return null}for(m=c*(n-1),s=o*r,0!==d[m]&&(l[s]=8,++p),i=1;i<t;i++)d[m]!==d[m+1]&&(l[s+i]=d[m]?4:8,++p),m++;if(0!==d[m]&&(l[s+i]=4,++p),p>1e3)return null;const u=new Int32Array([0,r,-1,0,-r,0,0,0,1]),g=new Path2D;for(o=0;p&&o<=n;o++){let e=o*r;const n=e+t;for(;e<n&&!l[e];)e++;if(e===n)continue;g.moveTo(e%r,o);const a=e;let i=l[e];do{const t=u[i];do{e+=t}while(!l[e]);const n=l[e];5!==n&&10!==n?(i=n,l[e]=0):(i=n&51*i>>4,l[e]&=i>>2|i<<2),g.lineTo(e%r,e/r|0),l[e]||--p}while(a!==e);--o}return d=null,l=null,function(e){e.save(),e.scale(1/t,-1/n),e.translate(0,-n),e.fill(g),e.beginPath(),e.restore()}}(e)),a.compiled))return void a.compiled(n);const r=this._createMaskCanvas(e),o=r.canvas;n.save(),n.setTransform(1,0,0,1,0,0),n.drawImage(o,r.offsetX,r.offsetY),n.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,n=0,a=0,r,o){if(!this.contentVisible)return;e=this.getObject(e.data,e);const i=this.ctx;i.save();const s=Ji(i);i.transform(t,n,a,r,0,0);const l=this._createMaskCanvas(e);i.setTransform(1,0,0,1,l.offsetX-s[4],l.offsetY-s[5]);for(let e=0,c=o.length;e<c;e+=2){const c=Ni.transform(s,[t,n,a,r,o[e],o[e+1]]),[d,m]=Ni.applyTransform([0,0],c);i.drawImage(l.canvas,d,m)}i.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const t=this.ctx,n=this.current.fillColor,a=this.current.patternFill;for(const r of e){const{data:e,width:o,height:i,transform:s}=r,l=this.cachedCanvases.getCanvas("maskCanvas",o,i),c=l.context;c.save();ll(c,this.getObject(e,r)),c.globalCompositeOperation="source-in",c.fillStyle=a?n.getPattern(c,this,Qi(t),Hs):n,c.fillRect(0,0,o,i),c.restore(),t.save(),t.transform(...s),t.scale(1,-1),ol(t,l.canvas,0,0,o,i,0,-1,1,1),t.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const t=this.getObject(e);t?this.paintInlineImageXObject(t):pi()}paintImageXObjectRepeat(e,t,n,a){if(!this.contentVisible)return;const r=this.getObject(e);if(!r)return void pi();const o=r.width,i=r.height,s=[];for(let e=0,r=a.length;e<r;e+=2)s.push({transform:[t,0,0,n,a[e],a[e+1]],x:0,y:0,w:o,h:i});this.paintInlineImageXObjectGroup(r,s)}applyTransferMapsToCanvas(e){return"none"!==this.current.transferMaps&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if("none"===this.current.transferMaps)return e.bitmap;const{bitmap:t,width:n,height:a}=e,r=this.cachedCanvases.getCanvas("inlineImage",n,a),o=r.context;return o.filter=this.current.transferMaps,o.drawImage(t,0,0),o.filter="none",r.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const t=e.width,n=e.height,a=this.ctx;if(this.save(),!uo){const{filter:e}=a;"none"!==e&&""!==e&&(a.filter="none")}let r;if(a.scale(1/t,-1/n),e.bitmap)r=this.applyTransferMapsToBitmap(e);else if("function"==typeof HTMLElement&&e instanceof HTMLElement||!e.data)r=e;else{const a=this.cachedCanvases.getCanvas("inlineImage",t,n).context;sl(a,e),r=this.applyTransferMapsToCanvas(a)}const o=this._scaleImage(r,Qi(a));a.imageSmoothingEnabled=ml(Ji(a),e.interpolate),ol(a,o.img,0,0,o.paintWidth,o.paintHeight,0,-n,t,n),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,t){if(!this.contentVisible)return;const n=this.ctx;let a;if(e.bitmap)a=e.bitmap;else{const t=e.width,n=e.height,r=this.cachedCanvases.getCanvas("inlineImage",t,n).context;sl(r,e),a=this.applyTransferMapsToCanvas(r)}for(const e of t)n.save(),n.transform(...e.transform),n.scale(1,-1),ol(n,a,e.x,e.y,e.w,e.h,0,-1,1,1),n.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,t){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t){"OC"===e?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(t)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){const t=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const n=this.ctx;this.pendingClip&&(t||(this.pendingClip===hl?n.clip("evenodd"):n.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),n.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=Ji(this.ctx);if(0===e[1]&&0===e[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const t=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),a=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(n,a)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:e}=this.current,{a:t,b:n,c:a,d:r}=this.ctx.getTransform();let o,i;if(0===n&&0===a){const n=Math.abs(t),a=Math.abs(r);if(n===a)if(0===e)o=i=1/n;else{const t=n*e;o=i=t<1?1/t:1}else if(0===e)o=1/n,i=1/a;else{const t=n*e,r=a*e;o=t<1?1/t:1,i=r<1?1/r:1}}else{const s=Math.abs(t*r-n*a),l=Math.hypot(t,n),c=Math.hypot(a,r);if(0===e)o=c/s,i=l/s;else{const t=e*s;o=c>t?c/t:1,i=l>t?l/t:1}}this._cachedScaleForStroking[0]=o,this._cachedScaleForStroking[1]=i}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:n}=this.current,[a,r]=this.getScaleForStroking();if(t.lineWidth=n||1,1===a&&1===r)return void t.stroke();const o=t.getLineDash();if(e&&t.save(),t.scale(a,r),o.length>0){const e=Math.max(a,r);t.setLineDash(o.map(t=>t/e)),t.lineDashOffset/=e}t.stroke(),e&&t.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const e in ii)void 0!==bl.prototype[e]&&(bl.prototype[ii[e]]=bl.prototype[e]);class fl{static#pn=null;static#un="";static get workerPort(){return this.#pn}static set workerPort(e){if(!("undefined"!=typeof Worker&&e instanceof Worker)&&null!==e)throw new Error("Invalid `workerPort` type.");this.#pn=e}static get workerSrc(){return this.#un}static set workerSrc(e){if("string"!=typeof e)throw new Error("Invalid `workerSrc` type.");this.#un=e}}class vl{#gn;#hn;constructor({parsedData:e,rawData:t}){this.#gn=e,this.#hn=t}getRaw(){return this.#hn}get(e){return this.#gn.get(e)??null}getAll(){return Ai(this.#gn)}has(e){return this.#gn.has(e)}}const yl=Symbol("INTERNAL");class xl{#bn=!1;#fn=!1;#vn=!1;#yn=!0;constructor(e,{name:t,intent:n,usage:a,rbGroups:r}){this.#bn=!!(e&vo),this.#fn=!!(e&yo),this.name=t,this.intent=n,this.usage=a,this.rbGroups=r}get visible(){if(this.#vn)return this.#yn;if(!this.#yn)return!1;const{print:e,view:t}=this.usage;return this.#bn?"OFF"!==t?.viewState:!this.#fn||"OFF"!==e?.printState}_setVisible(e,t,n=!1){e!==yl&&ui("Internal method `_setVisible` called."),this.#vn=n,this.#yn=t}}class wl{#xn=null;#wn=new Map;#kn=null;#En=null;constructor(e,t=vo){if(this.renderingIntent=t,this.name=null,this.creator=null,null!==e){this.name=e.name,this.creator=e.creator,this.#En=e.order;for(const n of e.groups)this.#wn.set(n.id,new xl(t,n));if("OFF"===e.baseState)for(const e of this.#wn.values())e._setVisible(yl,!1);for(const t of e.on)this.#wn.get(t)._setVisible(yl,!0);for(const t of e.off)this.#wn.get(t)._setVisible(yl,!1);this.#kn=this.getHash()}}#Sn(e){const t=e.length;if(t<2)return!0;const n=e[0];for(let a=1;a<t;a++){const t=e[a];let r;if(Array.isArray(t))r=this.#Sn(t);else{if(!this.#wn.has(t))return pi(),!0;r=this.#wn.get(t).visible}switch(n){case"And":if(!r)return!1;break;case"Or":if(r)return!0;break;case"Not":return!r;default:return!0}}return"And"===n}isVisible(e){if(0===this.#wn.size)return!0;if(!e)return mi(),!0;if("OCG"===e.type)return this.#wn.has(e.id)?this.#wn.get(e.id).visible:(pi(e.id),!0);if("OCMD"===e.type){if(e.expression)return this.#Sn(e.expression);if(!e.policy||"AnyOn"===e.policy){for(const t of e.ids){if(!this.#wn.has(t))return pi(),!0;if(this.#wn.get(t).visible)return!0}return!1}if("AllOn"===e.policy){for(const t of e.ids){if(!this.#wn.has(t))return pi(),!0;if(!this.#wn.get(t).visible)return!1}return!0}if("AnyOff"===e.policy){for(const t of e.ids){if(!this.#wn.has(t))return pi(),!0;if(!this.#wn.get(t).visible)return!0}return!1}if("AllOff"===e.policy){for(const t of e.ids){if(!this.#wn.has(t))return pi(),!0;if(this.#wn.get(t).visible)return!1}return!0}return pi(e.policy),!0}return pi(e.type),!0}setVisibility(e,t=!0,n=!0){const a=this.#wn.get(e);if(a){if(n&&t&&a.rbGroups.length)for(const t of a.rbGroups)for(const n of t)n!==e&&this.#wn.get(n)?._setVisible(yl,!1,!0);a._setVisible(yl,!!t,!0),this.#xn=null}else pi()}setOCGState({state:e,preserveRB:t}){let n;for(const a of e){switch(a){case"ON":case"OFF":case"Toggle":n=a;continue}const e=this.#wn.get(a);if(e)switch(n){case"ON":this.setVisibility(a,!0,t);break;case"OFF":this.setVisibility(a,!1,t);break;case"Toggle":this.setVisibility(a,!e.visible,t)}}this.#xn=null}get hasInitialVisibility(){return null===this.#kn||this.getHash()===this.#kn}getOrder(){return this.#wn.size?this.#En?this.#En.slice():[...this.#wn.keys()]:null}getGroups(){return this.#wn.size>0?Ai(this.#wn):null}getGroup(e){return this.#wn.get(e)||null}getHash(){if(null!==this.#xn)return this.#xn;const e=new fs;for(const[t,n]of this.#wn)e.update(`${t}:${n.visible}`);return this.#xn=e.hexdigest()}}class kl{constructor(e,{disableRange:t=!1,disableStream:n=!1}){gi(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:a,initialData:r,progressiveDone:o,contentDispositionFilename:i}=e;if(this._queuedChunks=[],this._progressiveDone=o,this._contentDispositionFilename=i,r?.length>0){const e=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!n,this._isRangeSupported=!t,this._contentLength=a,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((e,t)=>{this._onReceiveData({begin:e,chunk:t})}),e.addProgressListener((e,t)=>{this._onProgress({loaded:e,total:t})}),e.addProgressiveReadListener(e=>{this._onReceiveData({chunk:e})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){const n=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{gi(this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(n),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){void 0===e.total?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){gi(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new El(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new Sl(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}}class El{constructor(e,t,n=!1,a=null){this._stream=e,this._done=n||!1,this._filename=Wi(a)?a:null,this._queuedChunks=t||[],this._loaded=0;for(const e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunks.push(e);this._loaded+=e.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Sl{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Cl(e,t){const n=new Headers;if(!e||!t||"object"!=typeof t)return n;for(const e in t){const a=t[e];void 0!==a&&n.append(e,a)}return n}function Tl(e){try{return new URL(e).origin}catch{}return null}function Al({responseHeaders:e,isHttp:t,rangeChunkSize:n,disableRange:a}){const r={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(e.get("Content-Length"),10);if(!Number.isInteger(o))return r;if(r.suggestedLength=o,o<=2*n)return r;if(a||!t)return r;if("bytes"!==e.get("Accept-Ranges"))return r;return"identity"!==(e.get("Content-Encoding")||"identity")||(r.allowRangeRequests=!0),r}function Dl(e){const t=e.get("Content-Disposition");if(t){let e=function(e){let t=!0,n=a("filename\\*","i").exec(e);if(n){n=n[1];let e=i(n);return e=unescape(e),e=s(e),e=l(e),o(e)}if(n=function(e){const t=[];let n;const r=a("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=r.exec(e));){let[,e,a,r]=n;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[a,r]}const o=[];for(let e=0;e<t.length&&e in t;++e){let[n,a]=t[e];a=i(a),n&&(a=unescape(a),0===e&&(a=s(a))),o.push(a)}return o.join("")}(e),n)return o(l(n));if(n=a("filename","i").exec(e),n){n=n[1];let e=i(n);return e=l(e),o(e)}function a(e,t){return new RegExp("(?:^|;)\\s*"+e+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',t)}function r(e,n){if(e){if(!/^[\x00-\xFF]+$/.test(n))return n;try{const a=new TextDecoder(e,{fatal:!0}),r=Ti(n);n=a.decode(r),t=!1}catch{}}return n}function o(e){return t&&/[\x80-\xff]/.test(e)&&(e=r("utf-8",e),t&&(e=r("iso-8859-1",e))),e}function i(e){if(e.startsWith('"')){const t=e.slice(1).split('\\"');for(let e=0;e<t.length;++e){const n=t[e].indexOf('"');-1!==n&&(t[e]=t[e].slice(0,n),t.length=e+1),t[e]=t[e].replaceAll(/\\(.)/g,"$1")}e=t.join('"')}return e}function s(e){const t=e.indexOf("'");return-1===t?e:r(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,""))}function l(e){return!e.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(e,t,n,a){if("q"===n||"Q"===n)return r(t,a=(a=a.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))}));try{a=atob(a)}catch{}return r(t,a)})}return""}(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if(Wi(e))return e}return null}function _l(e,t){return 404===e||0===e&&t.startsWith("file:")?new wi('Missing PDF "'+t+'".'):new ki(`Unexpected server response (${e}) while retrieving PDF "${t}".`,e)}function Nl(e){return 200===e||206===e}function Ml(e,t,n){return{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function Il(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(pi(),new Uint8Array(e).buffer)}class Rl{_responseOrigin=null;constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=Cl(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return gi(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Bl(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new Pl(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class Bl{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange;const n=new Headers(e.headers),a=t.url;fetch(a,Ml(n,this._withCredentials,this._abortController)).then(t=>{if(e._responseOrigin=Tl(t.url),!Nl(t.status))throw _l(t.status,a);this._reader=t.body.getReader(),this._headersCapability.resolve();const n=t.headers,{allowRangeRequests:r,suggestedLength:o}=Al({responseHeaders:n,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=o||this._contentLength,this._filename=Dl(n),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Si("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:Il(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class Pl{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;const a=e.source;this._withCredentials=a.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!a.disableStream,this._abortController=new AbortController;const r=new Headers(e.headers);r.append("Range",`bytes=${t}-${n-1}`);const o=a.url;fetch(o,Ml(r,this._withCredentials,this._abortController)).then(t=>{const n=Tl(t.url);if(n!==e._responseOrigin)throw new Error(`Expected range response-origin "${n}" to match "${e._responseOrigin}".`);if(!Nl(t.status))throw _l(t.status,o);this._readCapability.resolve(),this._reader=t.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:Il(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class Ll{_responseOrigin=null;constructor({url:e,httpHeaders:t,withCredentials:n}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=Cl(this.isHttp,t),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){const t=new XMLHttpRequest,n=this.currXhrId++,a=this.pendingRequests[n]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const[e,n]of this.headers)t.setRequestHeader(e,n);return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),a.expectedStatus=206):a.expectedStatus=200,t.responseType="arraybuffer",gi(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>{e.onError(t.status)},t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),a.onHeadersReceived=e.onHeadersReceived,a.onDone=e.onDone,a.onError=e.onError,a.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){const n=this.pendingRequests[e];n&&n.onProgress?.(t)}onStateChange(e,t){const n=this.pendingRequests[e];if(!n)return;const a=n.xhr;if(a.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4!==a.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===a.status&&this.isHttp)return void n.onError(a.status);const r=a.status||200;if(!(200===r&&206===n.expectedStatus)&&r!==n.expectedStatus)return void n.onError(a.status);const o=function(e){const t=e.response;return"string"!=typeof t?t:Ti(t).buffer}(a);if(206===r){const e=a.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);t?n.onDone({begin:parseInt(t[1],10),chunk:o}):(pi(),n.onError(0))}else o?n.onDone({begin:0,chunk:o}):n.onError(a.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}class Ul{constructor(e){this._source=e,this._manager=new Ll(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return gi(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new Fl(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const n=new zl(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class Fl{constructor(e,t){this._manager=e,this._url=t.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,t=this._manager.getRequestXhr(e);this._manager._responseOrigin=Tl(t.responseURL);const n=t.getAllResponseHeaders(),a=new Headers(n?n.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(e=>{const[t,...n]=e.split(": ");return[t,n.join(": ")]}):[]),{allowRangeRequests:r,suggestedLength:o}=Al({responseHeaders:a,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=o||this._contentLength,this._filename=Dl(a),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e)if(this._requests.length>0){this._requests.shift().resolve({value:e.chunk,done:!1})}else this._cachedChunks.push(e.chunk);if(this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=_l(e,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class zl{constructor(e,t,n){this._manager=e,this._url=e.url,this._requestId=e.request({begin:t,end:n,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){const e=Tl(this._manager.getRequestXhr(this._requestId)?.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(e){const t=e.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunk=t;this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??=_l(e,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const Ol=/^[a-z][a-z0-9\-+.]+:/i;class Wl{constructor(e){this.source=e,this.url=function(e){if(Ol.test(e))return new URL(e);const t=process.getBuiltinModule("url");return new URL(t.pathToFileURL(e))}(e.url),gi("file:"===this.url.protocol,"PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return gi(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new ql(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const n=new Hl(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class ql{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const n=process.getBuiltinModule("fs");n.promises.lstat(this._url).then(e=>{this._contentLength=e.size,this._setReadableStream(n.createReadStream(this._url)),this._headersCapability.resolve()},e=>{"ENOENT"===e.code&&(e=new wi(`Missing PDF "${this._url}".`)),this._storedError=e,this._headersCapability.reject(e)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(e).buffer,done:!1}}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Si("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Hl{constructor(e,t,n){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const a=e.source;this._isStreamingSupported=!a.disableStream;const r=process.getBuiltinModule("fs");this._setReadableStream(r.createReadStream(this._url,{start:t,end:n-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,this.onProgress?.({loaded:this._loaded});return{value:new Uint8Array(e).buffer,done:!1}}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const jl=30;class Vl{#Cn=Promise.withResolvers();#ue=null;#Tn=!1;#An=!!globalThis.FontInspector?.enabled;#Dn=null;#_n=null;#Nn=0;#Mn=0;#In=null;#Rn=null;#Bn=0;#Pn=0;#Ln=Object.create(null);#Un=[];#Fn=null;#zn=[];#On=new WeakMap;#Wn=null;static#qn=new Map;static#Hn=new Map;static#jn=new WeakMap;static#Vn=null;static#Gn=new Set;constructor({textContentSource:e,container:t,viewport:n}){if(e instanceof ReadableStream)this.#Fn=e;else{if("object"!=typeof e)throw new Error('No "textContentSource" parameter specified.');this.#Fn=new ReadableStream({start(t){t.enqueue(e),t.close()}})}this.#ue=this.#Rn=t,this.#Pn=n.scale*(globalThis.devicePixelRatio||1),this.#Bn=n.rotation,this.#_n={div:null,properties:null,ctx:null};const{pageWidth:a,pageHeight:r,pageX:o,pageY:i}=n.rawDims;this.#Wn=[1,0,0,-1,-o,i+r],this.#Mn=a,this.#Nn=r,Vl.#Kn(),Zi(t,n),this.#Cn.promise.finally(()=>{Vl.#Gn.delete(this),this.#_n=null,this.#Ln=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:t}=Di.platform;return bi(this,"fontFamilyMap",new Map([["sans-serif",(e&&t?"Calibri, ":"")+"sans-serif"],["monospace",(e&&t?"Lucida Console, ":"")+"monospace"]]))}render(){const e=()=>{this.#In.read().then(({value:t,done:n})=>{n?this.#Cn.resolve():(this.#Dn??=t.lang,Object.assign(this.#Ln,t.styles),this.#$n(t.items),e())},this.#Cn.reject)};return this.#In=this.#Fn.getReader(),Vl.#Gn.add(this),e(),this.#Cn.promise}update({viewport:e,onBefore:t=null}){const n=e.scale*(globalThis.devicePixelRatio||1),a=e.rotation;if(a!==this.#Bn&&(t?.(),this.#Bn=a,Zi(this.#Rn,{rotation:a})),n!==this.#Pn){t?.(),this.#Pn=n;const e={div:null,properties:null,ctx:Vl.#Yn(this.#Dn)};for(const t of this.#zn)e.properties=this.#On.get(t),e.div=t,this.#Xn(e)}}cancel(){const e=new Si("TextLayer task cancelled.");this.#In?.cancel(e).catch(()=>{}),this.#In=null,this.#Cn.reject(e)}get textDivs(){return this.#zn}get textContentItemsStr(){return this.#Un}#$n(e){if(this.#Tn)return;this.#_n.ctx??=Vl.#Yn(this.#Dn);const t=this.#zn,n=this.#Un;for(const a of e){if(t.length>1e5)return pi(),void(this.#Tn=!0);if(void 0!==a.str)n.push(a.str),this.#Jn(a);else if("beginMarkedContentProps"===a.type||"beginMarkedContent"===a.type){const e=this.#ue;this.#ue=document.createElement("span"),this.#ue.classList.add("markedContent"),null!==a.id&&this.#ue.setAttribute("id",`${a.id}`),e.append(this.#ue)}else"endMarkedContent"===a.type&&(this.#ue=this.#ue.parentNode)}}#Jn(e){const t=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};this.#zn.push(t);const a=Ni.transform(this.#Wn,e.transform);let r=Math.atan2(a[1],a[0]);const o=this.#Ln[e.fontName];o.vertical&&(r+=Math.PI/2);let i=this.#An&&o.fontSubstitution||o.fontFamily;i=Vl.fontFamilyMap.get(i)||i;const s=Math.hypot(a[2],a[3]),l=s*Vl.#Qn(i,this.#Dn);let c,d;0===r?(c=a[4],d=a[5]-l):(c=a[4]+l*Math.sin(r),d=a[5]-l*Math.cos(r));const m="calc(var(--scale-factor)*",p=t.style;this.#ue===this.#Rn?(p.left=`${(100*c/this.#Mn).toFixed(2)}%`,p.top=`${(100*d/this.#Nn).toFixed(2)}%`):(p.left=`${m}${c.toFixed(2)}px)`,p.top=`${m}${d.toFixed(2)}px)`),p.fontSize=`${m}${(Vl.#Vn*s).toFixed(2)}px)`,p.fontFamily=i,n.fontSize=s,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,this.#An&&(t.dataset.fontName=o.fontSubstitutionLoadedName||e.fontName),0!==r&&(n.angle=r*(180/Math.PI));let u=!1;if(e.str.length>1)u=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),n=Math.abs(e.transform[3]);t!==n&&Math.max(t,n)/Math.min(t,n)>1.5&&(u=!0)}if(u&&(n.canvasWidth=o.vertical?e.height:e.width),this.#On.set(t,n),this.#_n.div=t,this.#_n.properties=n,this.#Xn(this.#_n),n.hasText&&this.#ue.append(t),n.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this.#ue.append(e)}}#Xn(e){const{div:t,properties:n,ctx:a}=e,{style:r}=t;let o="";if(Vl.#Vn>1&&(o=`scale(${1/Vl.#Vn})`),0!==n.canvasWidth&&n.hasText){const{fontFamily:e}=r,{canvasWidth:i,fontSize:s}=n;Vl.#Zn(a,s*this.#Pn,e);const{width:l}=a.measureText(t.textContent);l>0&&(o=`scaleX(${i*this.#Pn/l}) ${o}`)}0!==n.angle&&(o=`rotate(${n.angle}deg) ${o}`),o.length>0&&(r.transform=o)}static cleanup(){if(!(this.#Gn.size>0)){this.#qn.clear();for(const{canvas:e}of this.#Hn.values())e.remove();this.#Hn.clear()}}static#Yn(e=null){let t=this.#Hn.get(e||="");if(!t){const n=document.createElement("canvas");n.className="hiddenCanvasElement",n.lang=e,document.body.append(n),t=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#Hn.set(e,t),this.#jn.set(t,{size:0,family:""})}return t}static#Zn(e,t,n){const a=this.#jn.get(e);t===a.size&&n===a.family||(e.font=`${t}px ${n}`,a.size=t,a.family=n)}static#Kn(){if(null!==this.#Vn)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),this.#Vn=e.getBoundingClientRect().height,e.remove()}static#Qn(e,t){const n=this.#qn.get(e);if(n)return n;const a=this.#Yn(t);a.canvas.width=a.canvas.height=jl,this.#Zn(a,jl,e);const r=a.measureText("");let o=r.fontBoundingBoxAscent,i=Math.abs(r.fontBoundingBoxDescent);if(o){const t=o/(o+i);return this.#qn.set(e,t),a.canvas.width=a.canvas.height=0,t}a.strokeStyle="red",a.clearRect(0,0,jl,jl),a.strokeText("g",0,0);let s=a.getImageData(0,0,jl,jl).data;i=0;for(let e=s.length-1-3;e>=0;e-=4)if(s[e]>0){i=Math.ceil(e/4/jl);break}a.clearRect(0,0,jl,jl),a.strokeText("A",0,jl),s=a.getImageData(0,0,jl,jl).data,o=0;for(let e=0,t=s.length;e<t;e+=4)if(s[e]>0){o=jl-Math.floor(e/4/jl);break}a.canvas.width=a.canvas.height=0;const l=o?o/(o+i):.8;return this.#qn.set(e,l),l}}class Gl{static textContent(e){const t=[],n={items:t,styles:Object.create(null)};return function e(n){if(!n)return;let a=null;const r=n.name;if("#text"===r)a=n.value;else{if(!Gl.shouldBuildText(r))return;n?.attributes?.textContent?a=n.attributes.textContent:n.value&&(a=n.value)}if(null!==a&&t.push({str:a}),n.children)for(const t of n.children)e(t)}(e),n}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}const Kl=65536,$l=uo?class extends Ls{_createCanvas(e,t){return process.getBuiltinModule("module").createRequire("file:///D:/Extension%20Development/secure-wa-extension/secure-wa-extension/secure-wa-extension/extension/node_modules/pdfjs-dist/legacy/build/pdf.mjs")("@napi-rs/canvas").createCanvas(e,t)}}:class extends Ls{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){const n=this._document.createElement("canvas");return n.width=e,n.height=t,n}},Yl=uo?class extends Us{async _fetch(e){return qs(e)}}:Fs,Xl=uo?class extends zs{}:class extends zs{#ea;#ta;#na;#aa;#ra;#oa;#y=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#aa=e,this.#ra=t}get#w(){return this.#ta||=new Map}get#ia(){return this.#oa||=new Map}get#sa(){if(!this.#na){const e=this.#ra.createElement("div"),{style:t}=e;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;const n=this.#ra.createElementNS(Pi,"svg");n.setAttribute("width",0),n.setAttribute("height",0),this.#na=this.#ra.createElementNS(Pi,"defs"),e.append(n),n.append(this.#na),this.#ra.body.append(e)}return this.#na}#la(e){if(1===e.length){const t=e[0],n=new Array(256);for(let e=0;e<256;e++)n[e]=t[e]/255;const a=n.join(",");return[a,a,a]}const[t,n,a]=e,r=new Array(256),o=new Array(256),i=new Array(256);for(let e=0;e<256;e++)r[e]=t[e]/255,o[e]=n[e]/255,i[e]=a[e]/255;return[r.join(","),o.join(","),i.join(",")]}#ca(e){if(void 0===this.#ea){this.#ea="";const e=this.#ra.URL;e!==this.#ra.baseURI&&(Oi(e)?pi():this.#ea=e.split("#",1)[0])}return`url(${this.#ea}#${e})`}addFilter(e){if(!e)return"none";let t=this.#w.get(e);if(t)return t;const[n,a,r]=this.#la(e),o=1===e.length?n:`${n}${a}${r}`;if(t=this.#w.get(o),t)return this.#w.set(e,t),t;const i=`g_${this.#aa}_transfer_map_${this.#y++}`,s=this.#ca(i);this.#w.set(e,s),this.#w.set(o,s);const l=this.#da(i);return this.#ma(n,a,r,l),s}addHCMFilter(e,t){const n=`${e}-${t}`,a="base";let r=this.#ia.get(a);if(r?.key===n)return r.url;if(r?(r.filter?.remove(),r.key=n,r.url="none",r.filter=null):(r={key:n,url:"none",filter:null},this.#ia.set(a,r)),!e||!t)return r.url;const o=this.#pa(e);e=Ni.makeHexColor(...o);const i=this.#pa(t);if(t=Ni.makeHexColor(...i),this.#sa.style.color="","#000000"===e&&"#ffffff"===t||e===t)return r.url;const s=new Array(256);for(let e=0;e<=255;e++){const t=e/255;s[e]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const l=s.join(","),c=`g_${this.#aa}_hcm_filter`,d=r.filter=this.#da(c);this.#ma(l,l,l,d),this.#ua(d);const m=(e,t)=>{const n=o[e]/255,a=i[e]/255,r=new Array(t+1);for(let e=0;e<=t;e++)r[e]=n+e/t*(a-n);return r.join(",")};return this.#ma(m(0,5),m(1,5),m(2,5),d),r.url=this.#ca(c),r.url}addAlphaFilter(e){let t=this.#w.get(e);if(t)return t;const[n]=this.#la([e]),a=`alpha_${n}`;if(t=this.#w.get(a),t)return this.#w.set(e,t),t;const r=`g_${this.#aa}_alpha_map_${this.#y++}`,o=this.#ca(r);this.#w.set(e,o),this.#w.set(a,o);const i=this.#da(r);return this.#ga(n,i),o}addLuminosityFilter(e){let t,n,a=this.#w.get(e||"luminosity");if(a)return a;if(e?([t]=this.#la([e]),n=`luminosity_${t}`):n="luminosity",a=this.#w.get(n),a)return this.#w.set(e,a),a;const r=`g_${this.#aa}_luminosity_map_${this.#y++}`,o=this.#ca(r);this.#w.set(e,o),this.#w.set(n,o);const i=this.#da(r);return this.#ha(i),e&&this.#ga(t,i),o}addHighlightHCMFilter(e,t,n,a,r){const o=`${t}-${n}-${a}-${r}`;let i=this.#ia.get(e);if(i?.key===o)return i.url;if(i?(i.filter?.remove(),i.key=o,i.url="none",i.filter=null):(i={key:o,url:"none",filter:null},this.#ia.set(e,i)),!t||!n)return i.url;const[s,l]=[t,n].map(this.#pa.bind(this));let c=Math.round(.2126*s[0]+.7152*s[1]+.0722*s[2]),d=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[m,p]=[a,r].map(this.#pa.bind(this));d<c&&([c,d,m,p]=[d,c,p,m]),this.#sa.style.color="";const u=(e,t,n)=>{const a=new Array(256),r=(d-c)/n,o=e/255,i=(t-e)/(255*n);let s=0;for(let e=0;e<=n;e++){const t=Math.round(c+e*r),n=o+e*i;for(let e=s;e<=t;e++)a[e]=n;s=t+1}for(let e=s;e<256;e++)a[e]=a[s-1];return a.join(",")},g=`g_${this.#aa}_hcm_${e}_filter`,h=i.filter=this.#da(g);return this.#ua(h),this.#ma(u(m[0],p[0],5),u(m[1],p[1],5),u(m[2],p[2],5),h),i.url=this.#ca(g),i.url}destroy(e=!1){e&&this.#oa?.size||(this.#na?.parentNode.parentNode.remove(),this.#na=null,this.#ta?.clear(),this.#ta=null,this.#oa?.clear(),this.#oa=null,this.#y=0)}#ha(e){const t=this.#ra.createElementNS(Pi,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),e.append(t)}#ua(e){const t=this.#ra.createElementNS(Pi,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(t)}#da(e){const t=this.#ra.createElementNS(Pi,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),this.#sa.append(t),t}#ba(e,t,n){const a=this.#ra.createElementNS(Pi,t);a.setAttribute("type","discrete"),a.setAttribute("tableValues",n),e.append(a)}#ma(e,t,n,a){const r=this.#ra.createElementNS(Pi,"feComponentTransfer");a.append(r),this.#ba(r,"feFuncR",e),this.#ba(r,"feFuncG",t),this.#ba(r,"feFuncB",n)}#ga(e,t){const n=this.#ra.createElementNS(Pi,"feComponentTransfer");t.append(n),this.#ba(n,"feFuncA",e)}#pa(e){return this.#sa.style.color=e,Xi(getComputedStyle(this.#sa).getPropertyValue("color"))}},Jl=uo?class extends Os{async _fetch(e){return qs(e)}}:Ws;function Ql(e={}){"string"==typeof e||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t=new ec,{docId:n}=t,a=e.url?function(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(uo&&"string"==typeof e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(e.url):null,r=e.data?function(e){if(uo&&"undefined"!=typeof Buffer&&e instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if("string"==typeof e)return Ti(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||"object"==typeof e&&!isNaN(e?.length))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(e.data):null,o=e.httpHeaders||null,i=!0===e.withCredentials,s=e.password??null,l=e.range instanceof tc?e.range:null,c=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:Kl;let d=e.worker instanceof oc?e.worker:null;const m=e.verbosity,p="string"!=typeof e.docBaseUrl||Oi(e.docBaseUrl)?null:e.docBaseUrl,u="string"==typeof e.cMapUrl?e.cMapUrl:null,g=!1!==e.cMapPacked,h=e.CMapReaderFactory||Yl,b="string"==typeof e.standardFontDataUrl?e.standardFontDataUrl:null,f=e.StandardFontDataFactory||Jl,v=!0!==e.stopAtErrors,y=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,x=!1!==e.isEvalSupported,w="boolean"==typeof e.isOffscreenCanvasSupported?e.isOffscreenCanvasSupported:!uo,k="boolean"==typeof e.isImageDecoderSupported?e.isImageDecoderSupported:!uo&&(Di.platform.isFirefox||!globalThis.chrome),E=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,S="boolean"==typeof e.disableFontFace?e.disableFontFace:uo,C=!0===e.fontExtraProperties,T=!0===e.enableXfa,A=e.ownerDocument||globalThis.document,D=!0===e.disableRange,_=!0===e.disableStream,N=!0===e.disableAutoFetch,M=!0===e.pdfBug,I=e.CanvasFactory||$l,R=e.FilterFactory||Xl,B=!0===e.enableHWA,P=l?l.length:e.length??NaN,L="boolean"==typeof e.useSystemFonts?e.useSystemFonts:!uo&&!S,U="boolean"==typeof e.useWorkerFetch?e.useWorkerFetch:h===Fs&&f===Ws&&u&&b&&Vi(u,document.baseURI)&&Vi(b,document.baseURI);ci(m);const F={canvasFactory:new I({ownerDocument:A,enableHWA:B}),filterFactory:new R({docId:n,ownerDocument:A}),cMapReaderFactory:U?null:new h({baseUrl:u,isCompressed:g}),standardFontDataFactory:U?null:new f({baseUrl:b})};if(!d){const e={verbosity:m,port:fl.workerPort};d=e.port?oc.fromPort(e):new oc(e),t._worker=d}const z={docId:n,apiVersion:"4.10.38",data:r,password:s,disableAutoFetch:N,rangeChunkSize:c,length:P,docBaseUrl:p,enableXfa:T,evaluatorOptions:{maxImageSize:y,disableFontFace:S,ignoreErrors:v,isEvalSupported:x,isOffscreenCanvasSupported:w,isImageDecoderSupported:k,canvasMaxAreaInBytes:E,fontExtraProperties:C,useSystemFonts:L,cMapUrl:U?u:null,standardFontDataUrl:U?b:null}},O={disableFontFace:S,fontExtraProperties:C,ownerDocument:A,pdfBug:M,styleElement:null,loadingParams:{disableAutoFetch:N,enableXfa:T}};return d.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const e=d.messageHandler.sendWithPromise("GetDocRequest",z,r?[r.buffer]:null);let s;if(l)s=new kl(l,{disableRange:D,disableStream:_});else if(!r){if(!a)throw new Error("getDocument - no `url` parameter provided.");let e;if(uo)if(Vi(a)){if("undefined"==typeof fetch||"undefined"==typeof Response||!("body"in Response.prototype))throw new Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`.");e=Rl}else e=Wl;else e=Vi(a)?Rl:Ul;s=new e({url:a,length:P,httpHeaders:o,withCredentials:i,rangeChunkSize:c,disableRange:D,disableStream:_})}return e.then(e=>{if(t.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const a=new Ps(n,e,d.port),r=new ic(a,t,s,O,F);t._transport=r,a.send("Ready",null)})}).catch(t._capability.reject),t}function Zl(e){return"object"==typeof e&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0}class ec{static#aa=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d"+ec.#aa++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await(this._transport?.destroy())}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}}class tc{constructor(e,t,n=!1,a=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=a,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(const n of this._rangeListeners)n(e,t)}onDataProgress(e,t){this._readyCapability.promise.then(()=>{for(const n of this._progressListeners)n(e,t)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const t of this._progressiveReadListeners)t(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){ui("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class nc{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return bi(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class ac{#fa=null;#va=!1;constructor(e,t,n,a=!1){this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=a?new ji:null,this._pdfBug=a,this.commonObjs=n.commonObjs,this.objs=new lc,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:n=0,offsetY:a=0,dontFlip:r=!1}={}){return new Fi({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:a,dontFlip:r})}getAnnotations({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return bi(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:t,intent:n="display",annotationMode:a=Co.ENABLE,transform:r=null,background:o=null,optionalContentConfigPromise:i=null,annotationCanvasMap:s=null,pageColors:l=null,printAnnotationStorage:c=null,isEditing:d=!1}){this._stats?.time("Overall");const m=this._transport.getRenderingIntent(n,a,c,d),{renderingIntent:p,cacheKey:u}=m;this.#va=!1,this.#ya(),i||=this._transport.getOptionalContentConfig(p);let g=this._intentStates.get(u);g||(g=Object.create(null),this._intentStates.set(u,g)),g.streamReaderCancelTimeout&&(clearTimeout(g.streamReaderCancelTimeout),g.streamReaderCancelTimeout=null);const h=!!(p&yo);g.displayReadyCapability||(g.displayReadyCapability=Promise.withResolvers(),g.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(m));const b=e=>{g.renderTasks.delete(f),(this._maybeCleanupAfterRender||h)&&(this.#va=!0),this.#xa(!h),e?(f.capability.reject(e),this._abortOperatorList({intentState:g,reason:e instanceof Error?e:new Error(e)})):f.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},f=new dc({callback:b,params:{canvasContext:e,viewport:t,transform:r,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:s,operatorList:g.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!h,pdfBug:this._pdfBug,pageColors:l});(g.renderTasks||=new Set).add(f);const v=f.task;return Promise.all([g.displayReadyCapability.promise,i]).then(([e,t])=>{if(this.destroyed)b();else{if(this._stats?.time("Rendering"),!(t.renderingIntent&p))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");f.initializeGraphics({transparency:e,optionalContentConfig:t}),f.operatorListChanged()}}).catch(b),v}getOperatorList({intent:e="display",annotationMode:t=Co.ENABLE,printAnnotationStorage:n=null,isEditing:a=!1}={}){const r=this._transport.getRenderingIntent(e,t,n,a,!0);let o,i=this._intentStates.get(r.cacheKey);return i||(i=Object.create(null),this._intentStates.set(r.cacheKey,i)),i.opListReadCapability||(o=Object.create(null),o.operatorListChanged=function(){i.operatorList.lastChunk&&(i.opListReadCapability.resolve(i.operatorList),i.renderTasks.delete(o))},i.opListReadCapability=Promise.withResolvers(),(i.renderTasks||=new Set).add(o),i.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(r)),i.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===e,disableNormalization:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(e=>Gl.textContent(e));const t=this.streamTextContent(e);return new Promise(function(e,n){const a=t.getReader(),r={items:[],styles:Object.create(null),lang:null};!function t(){a.read().then(function({value:n,done:a}){a?e(r):(r.lang??=n.lang,Object.assign(r.styles,n.styles),r.items.push(...n.items),t())},n)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),this.#va=!1,this.#ya(),Promise.all(e)}cleanup(e=!1){this.#va=!0;const t=this.#xa(!1);return e&&t&&(this._stats&&=new ji),t}#xa(e=!1){if(this.#ya(),!this.#va||this.destroyed)return!1;if(e)return this.#fa=setTimeout(()=>{this.#fa=null,this.#xa(!1)},5e3),!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#va=!1,!0}#ya(){this.#fa&&(clearTimeout(this.#fa),this.#fa=null)}_startRenderPage(e,t){const n=this._intentStates.get(t);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let n=0,a=e.length;n<a;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(const e of t.renderTasks)e.operatorListChanged();e.lastChunk&&this.#xa(!0)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:a}){const{map:r,transfer:o}=n,i=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:r,modifiedIds:a},o).getReader(),s=this._intentStates.get(t);s.streamReader=i;const l=()=>{i.read().then(({value:e,done:t})=>{t?s.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,s),l())},e=>{if(s.streamReader=null,!this._transport.destroyed){if(s.operatorList){s.operatorList.lastChunk=!0;for(const e of s.renderTasks)e.operatorListChanged();this.#xa(!0)}if(s.displayReadyCapability)s.displayReadyCapability.reject(e);else{if(!s.opListReadCapability)throw e;s.opListReadCapability.reject(e)}}})};l()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(t instanceof zi){let n=100;return t.extraDelay>0&&t.extraDelay<1e3&&(n+=t.extraDelay),void(e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},n))}}if(e.streamReader.cancel(new Si(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}class rc{#wa=new Map;#ka=Promise.resolve();postMessage(e,t){const n={data:structuredClone(e,t?{transfer:t}:null)};this.#ka.then(()=>{for(const[e]of this.#wa)e.call(this,n)})}addEventListener(e,t,n=null){let a=null;if(n?.signal instanceof AbortSignal){const{signal:r}=n;if(r.aborted)return void pi();const o=()=>this.removeEventListener(e,t);a=()=>r.removeEventListener("abort",o),r.addEventListener("abort",o)}this.#wa.set(t,a)}removeEventListener(e,t){const n=this.#wa.get(t);n?.(),this.#wa.delete(t)}terminate(){for(const[,e]of this.#wa)e?.();this.#wa.clear()}}class oc{static#Ea=0;static#Sa=!1;static#Ca;static{uo&&(this.#Sa=!0,fl.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(e,t)=>{let n;try{if(n=new URL(e),!n.origin||"null"===n.origin)return!1}catch{return!1}const a=new URL(t,n);return n.origin===a.origin},this._createCDNWrapper=e=>{const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))}}constructor({name:e=null,port:t=null,verbosity:n=di()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=n,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,t){if(oc.#Ca?.has(t))throw new Error("Cannot use more than one PDFWorker per port.");return(oc.#Ca||=new WeakMap).set(t,this),void this._initializeFromPort(t)}this._initialize()}get promise(){return this._readyCapability.promise}#Ta(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new Ps("main","worker",e),this._messageHandler.on("ready",function(){}),this.#Ta()}_initialize(){if(oc.#Sa||oc.#Aa)return void this._setupFakeWorker();let{workerSrc:e}=oc;try{oc._isSameOrigin(window.location.href,e)||(e=oc._createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e,{type:"module"}),n=new Ps("main","worker",t),a=()=>{r.abort(),n.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},r=new AbortController;t.addEventListener("error",()=>{this._webWorker||a()},{signal:r.signal}),n.on("test",e=>{r.abort(),!this.destroyed&&e?(this._messageHandler=n,this._port=t,this._webWorker=t,this.#Ta()):a()}),n.on("ready",e=>{if(r.abort(),this.destroyed)a();else try{o()}catch{this._setupFakeWorker()}});const o=()=>{const e=new Uint8Array;n.send("test",e,[e.buffer])};return void o()}catch{mi()}this._setupFakeWorker()}_setupFakeWorker(){oc.#Sa||(pi(),oc.#Sa=!0),oc._setupFakeWorkerGlobal.then(e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new rc;this._port=t;const n="fake"+oc.#Ea++,a=new Ps(n+"_worker",n,t);e.setup(a,t),this._messageHandler=new Ps(n,n+"_worker",t),this.#Ta()}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this._webWorker?.terminate(),this._webWorker=null,oc.#Ca?.delete(this._port),this._port=null,this._messageHandler?.destroy(),this._messageHandler=null}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const t=this.#Ca?.get(e.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new oc(e)}static get workerSrc(){if(fl.workerSrc)return fl.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#Aa(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return bi(this,"_setupFakeWorkerGlobal",(async()=>{if(this.#Aa)return this.#Aa;return(await import(this.workerSrc)).WorkerMessageHandler})())}}class ic{#Da=new Map;#_a=new Map;#Na=new Map;#Ma=new Map;#Ia=null;constructor(e,t,n,a,r){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new lc,this.fontLoader=new ws({ownerDocument:a.ownerDocument,styleElement:a.styleElement}),this.loadingParams=a.loadingParams,this._params=a,this.canvasFactory=r.canvasFactory,this.filterFactory=r.filterFactory,this.cMapReaderFactory=r.cMapReaderFactory,this.standardFontDataFactory=r.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#Ra(e,t=null){const n=this.#Da.get(e);if(n)return n;const a=this.messageHandler.sendWithPromise(e,t);return this.#Da.set(e,a),a}get annotationStorage(){return bi(this,"annotationStorage",new ys)}getRenderingIntent(e,t=Co.ENABLE,n=null,a=!1,r=!1){let o=vo,i=vs;switch(e){case"any":o=fo;break;case"display":break;case"print":o=yo;break;default:pi()}const s=o&yo&&n instanceof xs?n:this.annotationStorage;switch(t){case Co.DISABLE:o+=ko;break;case Co.ENABLE:break;case Co.ENABLE_FORMS:o+=xo;break;case Co.ENABLE_STORAGE:o+=wo,i=s.serializable;break;default:pi()}a&&(o+=Eo),r&&(o+=So);const{ids:l,hash:c}=s.modifiedIds;return{renderingIntent:o,cacheKey:[o,i.hash,c].join("_"),annotationStorageSerializable:i,modifiedIds:l}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#Ia?.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const t of this.#_a.values())e.push(t._destroy());this.#_a.clear(),this.#Na.clear(),this.#Ma.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#Da.clear(),this.filterFactory.destroy(),Vl.cleanup(),this._networkStream?.cancelAllRequests(new Si("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(e,t)=>{gi(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then(function({value:e,done:n}){n?t.close():(gi(e instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on("ReaderHeadersReady",async e=>{await this._fullReader.headersReady;const{isStreamingSupported:n,isRangeSupported:a,contentLength:r}=this._fullReader;return n&&a||(this._lastProgress&&t.onProgress?.(this._lastProgress),this._fullReader.onProgress=e=>{t.onProgress?.({loaded:e.loaded,total:e.total})}),{isStreamingSupported:n,isRangeSupported:a,contentLength:r}}),e.on("GetRangeReader",(e,t)=>{gi(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(e.begin,e.end);n?(t.onPull=()=>{n.read().then(function({value:e,done:n}){n?t.close():(gi(e instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{n.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}):t.close()}),e.on("GetDoc",({pdfInfo:e})=>{this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new nc(e,this))}),e.on("DocException",e=>{t._capability.reject(Bs(e))}),e.on("PasswordRequest",e=>{this.#Ia=Promise.withResolvers();try{if(!t.onPassword)throw Bs(e);const n=e=>{e instanceof Error?this.#Ia.reject(e):this.#Ia.resolve({password:e})};t.onPassword(n,e.code)}catch(e){this.#Ia.reject(e)}return this.#Ia.promise}),e.on("DataLoaded",e=>{t.onProgress?.({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on("StartRenderPage",e=>{if(this.destroyed)return;this.#_a.get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)}),e.on("commonobj",([t,n,a])=>{if(this.destroyed)return null;if(this.commonObjs.has(t))return null;switch(n){case"Font":const{disableFontFace:r,fontExtraProperties:o,pdfBug:i}=this._params;if("error"in a){const e=a.error;pi(),this.commonObjs.resolve(t,e);break}const s=i&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,l=new ks(a,{disableFontFace:r,fontExtraProperties:o,inspectFont:s});this.fontLoader.bind(l).catch(()=>e.sendWithPromise("FontFallback",{id:t})).finally(()=>{!o&&l.data&&(l.data=null),this.commonObjs.resolve(t,l)});break;case"CopyLocalImage":const{imageRef:c}=a;gi(c,"The imageRef must be defined.");for(const e of this.#_a.values())for(const[,n]of e.objs)if(n?.ref===c)return n.dataLen?(this.commonObjs.resolve(t,structuredClone(n)),n.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(t,a);break;default:throw new Error(`Got unknown common object type ${n}`)}return null}),e.on("obj",([e,t,n,a])=>{if(this.destroyed)return;const r=this.#_a.get(t);if(!r.objs.has(e))if(0!==r._intentStates.size)switch(n){case"Image":r.objs.resolve(e,a),a?.dataLen>1e7&&(r._maybeCleanupAfterRender=!0);break;case"Pattern":r.objs.resolve(e,a);break;default:throw new Error(`Got unknown object type ${n}`)}else a?.bitmap?.close()}),e.on("DocProgress",e=>{this.destroyed||t.onProgress?.({loaded:e.loaded,total:e.total})}),e.on("FetchBuiltInCMap",async e=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.cMapReaderFactory)throw new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.");return this.cMapReaderFactory.fetch(e)}),e.on("FetchStandardFontData",async e=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.standardFontDataFactory)throw new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.");return this.standardFontDataFactory.fetch(e)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&pi();const{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,n=this.#Na.get(t);if(n)return n;const a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(n=>{if(this.destroyed)throw new Error("Transport destroyed");n.refStr&&this.#Ma.set(n.refStr,e);const a=new ac(t,n,this,this._params.pdfBug);return this.#_a.set(t,a),a});return this.#Na.set(t,a),a}getPageIndex(e){return Zl(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return this.#Ra("GetFieldObjects")}hasJSActions(){return this.#Ra("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!=typeof e?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#Ra("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#Ra("GetOptionalContentConfig").then(t=>new wl(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=this.#Da.get(e);if(t)return t;const n=this.messageHandler.sendWithPromise(e,null).then(e=>({info:e[0],metadata:e[1]?new vl(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#Da.set(e,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of this.#_a.values()){if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`)}this.commonObjs.clear(),e||this.fontLoader.clear(),this.#Da.clear(),this.filterFactory.destroy(!0),Vl.cleanup()}}cachedPageNumber(e){if(!Zl(e))return null;const t=0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`;return this.#Ma.get(t)??null}}const sc=Symbol("INITIAL_DATA");class lc{#Ba=Object.create(null);#Pa(e){return this.#Ba[e]||={...Promise.withResolvers(),data:sc}}get(e,t=null){if(t){const n=this.#Pa(e);return n.promise.then(()=>t(n.data)),null}const n=this.#Ba[e];if(!n||n.data===sc)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){const t=this.#Ba[e];return!!t&&t.data!==sc}delete(e){const t=this.#Ba[e];return!(!t||t.data===sc)&&(delete this.#Ba[e],!0)}resolve(e,t=null){const n=this.#Pa(e);n.data=t,n.resolve()}clear(){for(const e in this.#Ba){const{data:t}=this.#Ba[e];t?.bitmap?.close()}this.#Ba=Object.create(null)}*[Symbol.iterator](){for(const e in this.#Ba){const{data:t}=this.#Ba[e];t!==sc&&(yield[e,t])}}}class cc{#La=null;constructor(e){this.#La=e,this.onContinue=null}get promise(){return this.#La.capability.promise}cancel(e=0){this.#La.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#La.operatorList;if(!e)return!1;const{annotationCanvasMap:t}=this.#La;return e.form||e.canvas&&t?.size>0}}class dc{#Ua=null;static#Fa=new WeakSet;constructor({callback:e,params:t,objs:n,commonObjs:a,annotationCanvasMap:r,operatorList:o,pageIndex:i,canvasFactory:s,filterFactory:l,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:m=null}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=a,this.annotationCanvasMap=r,this.operatorListIdx=null,this.operatorList=o,this._pageIndex=i,this.canvasFactory=s,this.filterFactory=l,this._pdfBug=d,this.pageColors=m,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new cc(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(dc.#Fa.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");dc.#Fa.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:a,transform:r,background:o}=this.params;this.gfx=new bl(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:r,viewport:a,transparency:e,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#Ua&&(window.cancelAnimationFrame(this.#Ua),this.#Ua=null),dc.#Fa.delete(this._canvas),this.callback(e||new zi(`Rendering cancelled, page ${this._pageIndex+1}`,t))}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#Ua=window.requestAnimationFrame(()=>{this.#Ua=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),dc.#Fa.delete(this._canvas),this.callback())))}}const mc="4.10.38",pc="f9bea397f";mo(670);function uc(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}function gc(e){return Math.max(0,Math.min(255,255*e))}class hc{static CMYK_G([e,t,n,a]){return["G",1-Math.min(1,.3*e+.59*n+.11*t+a)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return[e=gc(e),e,e]}static G_HTML([e]){const t=uc(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return["G",.3*e+.59*t+.11*n]}static RGB_rgb(e){return e.map(gc)}static RGB_HTML(e){return`#${e.map(uc).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,n,a]){return["RGB",1-Math.min(1,e+a),1-Math.min(1,n+a),1-Math.min(1,t+a)]}static CMYK_rgb([e,t,n,a]){return[gc(1-Math.min(1,e+a)),gc(1-Math.min(1,n+a)),gc(1-Math.min(1,t+a))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){const a=1-e,r=1-t,o=1-n;return["CMYK",a,r,o,Math.min(a,r,o)]}}class bc{create(e,t,n=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const a=this._createSVG("svg:svg");return a.setAttribute("version","1.1"),n||(a.setAttribute("width",`${e}px`),a.setAttribute("height",`${t}px`)),a.setAttribute("preserveAspectRatio","none"),a.setAttribute("viewBox",`0 0 ${e} ${t}`),a}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){ui("Abstract method `_createSVG` called.")}}class fc extends bc{_createSVG(e){return document.createElementNS(Pi,e)}}class vc{static setupStorage(e,t,n,a,r){const o=a.getValue(t,{value:null});switch(n.name){case"textarea":if(null!==o.value&&(e.textContent=o.value),"print"===r)break;e.addEventListener("input",e=>{a.setValue(t,{value:e.target.value})});break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){if(o.value===n.attributes.xfaOn?e.setAttribute("checked",!0):o.value===n.attributes.xfaOff&&e.removeAttribute("checked"),"print"===r)break;e.addEventListener("change",e=>{a.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})})}else{if(null!==o.value&&e.setAttribute("value",o.value),"print"===r)break;e.addEventListener("input",e=>{a.setValue(t,{value:e.target.value})})}break;case"select":if(null!==o.value){e.setAttribute("value",o.value);for(const e of n.children)e.attributes.value===o.value?e.attributes.selected=!0:e.attributes.hasOwnProperty("selected")&&delete e.attributes.selected}e.addEventListener("input",e=>{const n=e.target.options,r=-1===n.selectedIndex?"":n[n.selectedIndex].value;a.setValue(t,{value:r})})}}static setAttributes({html:e,element:t,storage:n=null,intent:a,linkService:r}){const{attributes:o}=t,i=e instanceof HTMLAnchorElement;"radio"===o.type&&(o.name=`${o.name}-${a}`);for(const[t,n]of Object.entries(o))if(null!=n)switch(t){case"class":n.length&&e.setAttribute(t,n.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",n);break;case"style":Object.assign(e.style,n);break;case"textContent":e.textContent=n;break;default:(!i||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,n)}i&&r.addLinkAttributes(e,o.href,o.newWindow),n&&o.dataId&&this.setupStorage(e,o.dataId,t,n)}static render(e){const t=e.annotationStorage,n=e.linkService,a=e.xfaHtml,r=e.intent||"display",o=document.createElement(a.name);a.attributes&&this.setAttributes({html:o,element:a,intent:r,linkService:n});const i="richText"!==r,s=e.div;if(s.append(o),e.viewport){const t=`matrix(${e.viewport.transform.join(",")})`;s.style.transform=t}i&&s.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===a.children.length){if(a.value){const e=document.createTextNode(a.value);o.append(e),i&&Gl.shouldBuildText(a.name)&&l.push(e)}return{textDivs:l}}const c=[[a,-1,o]];for(;c.length>0;){const[e,a,o]=c.at(-1);if(a+1===e.children.length){c.pop();continue}const s=e.children[++c.at(-1)[1]];if(null===s)continue;const{name:d}=s;if("#text"===d){const e=document.createTextNode(s.value);l.push(e),o.append(e);continue}const m=s?.attributes?.xmlns?document.createElementNS(s.attributes.xmlns,d):document.createElement(d);if(o.append(m),s.attributes&&this.setAttributes({html:m,element:s,storage:t,intent:r,linkService:n}),s.children?.length>0)c.push([s,-1,m]);else if(s.value){const e=document.createTextNode(s.value);i&&Gl.shouldBuildText(d)&&l.push(e),m.append(e)}}for(const e of s.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))e.setAttribute("readOnly",!0);return{textDivs:l}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}const yc=1e3,xc=new WeakSet;function wc(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class kc{static create(e){switch(e.data.annotationType){case Uo:return new Sc(e);case Lo:return new Cc(e);case Zo:switch(e.data.fieldType){case"Tx":return new Ac(e);case"Btn":return e.data.radioButton?new Nc(e):e.data.checkBox?new _c(e):new Mc(e);case"Ch":return new Ic(e);case"Sig":return new Dc(e)}return new Tc(e);case Jo:return new Rc(e);case Fo:return new Pc(e);case zo:return new Lc(e);case Oo:return new Uc(e);case Wo:return new Fc(e);case Ho:return new zc(e);case Yo:return new Wc(e);case Xo:return new qc(e);case qo:return new Oc(e);case jo:return new Hc(e);case Vo:return new jc(e);case Go:return new Vc(e);case Ko:return new Gc(e);case $o:return new Kc(e);case Qo:return new $c(e);default:return new Ec(e)}}}class Ec{#za=null;#Oa=!1;#Wa=null;constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:a=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(n)),a&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:t,richText:n}){return!!(e?.str||t?.str||n?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return Ec._hasPopupData(this.data)}updateEdited(e){if(!this.container)return;this.#za||={rect:this.data.rect.slice(0)};const{rect:t}=e;t&&this.#qa(t),this.#Wa?.popup.updateEdited(e)}resetEdited(){this.#za&&(this.#qa(this.#za.rect),this.#Wa?.popup.resetEdited(),this.#za=null)}#qa(e){const{container:{style:t},data:{rect:n,rotation:a},parent:{viewport:{rawDims:{pageWidth:r,pageHeight:o,pageX:i,pageY:s}}}}=this;n?.splice(0,4,...e);const{width:l,height:c}=wc(e);t.left=100*(e[0]-i)/r+"%",t.top=100*(o-e[3]+s)/o+"%",0===a?(t.width=100*l/r+"%",t.height=100*c/o+"%"):this.setRotation(a)}_createContainer(e){const{data:t,parent:{page:n,viewport:a}}=this,r=document.createElement("section");r.setAttribute("data-annotation-id",t.id),this instanceof Tc||(r.tabIndex=yc);const{style:o}=r;if(o.zIndex=this.parent.zIndex++,t.alternativeText&&(r.title=t.alternativeText),t.noRotate&&r.classList.add("norotate"),!t.rect||this instanceof Rc){const{rotation:e}=t;return t.hasOwnCanvas||0===e||this.setRotation(e,r),r}const{width:i,height:s}=wc(t.rect);if(!e&&t.borderStyle.width>0){o.borderWidth=`${t.borderStyle.width}px`;const e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;if(e>0||n>0){const t=`calc(${e}px * var(--scale-factor)) / calc(${n}px * var(--scale-factor))`;o.borderRadius=t}else if(this instanceof Nc){const e=`calc(${i}px * var(--scale-factor)) / calc(${s}px * var(--scale-factor))`;o.borderRadius=e}switch(t.borderStyle.style){case ei:o.borderStyle="solid";break;case ti:o.borderStyle="dashed";break;case ni:case ai:pi();break;case ri:o.borderBottomStyle="solid"}const a=t.borderColor||null;a?(this.#Oa=!0,o.borderColor=Ni.makeHexColor(0|a[0],0|a[1],0|a[2])):o.borderWidth=0}const l=Ni.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]),{pageWidth:c,pageHeight:d,pageX:m,pageY:p}=a.rawDims;o.left=100*(l[0]-m)/c+"%",o.top=100*(l[1]-p)/d+"%";const{rotation:u}=t;return t.hasOwnCanvas||0===u?(o.width=100*i/c+"%",o.height=100*s/d+"%"):this.setRotation(u,r),r}setRotation(e,t=this.container){if(!this.data.rect)return;const{pageWidth:n,pageHeight:a}=this.parent.viewport.rawDims,{width:r,height:o}=wc(this.data.rect);let i,s;e%180==0?(i=100*r/n,s=100*o/a):(i=100*o/n,s=100*r/a),t.style.width=`${i}%`,t.style.height=`${s}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(e,t,n)=>{const a=n.detail[e],r=a[0],o=a.slice(1);n.target.style[t]=hc[`${r}_HTML`](o),this.annotationStorage.setValue(this.data.id,{[t]:hc[`${r}_rgb`](o)})};return bi(this,"_commonActions",{display:e=>{const{display:t}=e.detail,n=t%2==1;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:1===t||2===t})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:t}=e.detail;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:e=>{const t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){const n=this._commonActions;for(const a of Object.keys(t.detail)){const r=e[a]||n[a];r?.(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const n=this._commonActions;for(const[a,r]of Object.entries(t)){const o=n[a];if(o){o({detail:{[a]:r},target:e}),delete t[a]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,n,a,r]=this.data.rect.map(e=>Math.fround(e));if(8===e.length){const[o,i,s,l]=e.subarray(2,6);if(a===o&&r===i&&t===s&&n===l)return}const{style:o}=this.container;let i;if(this.#Oa){const{borderColor:e,borderWidth:t}=o;o.borderWidth=0,i=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${e}" stroke-width="${t}">`],this.container.classList.add("hasBorder")}const s=a-t,l=r-n,{svgFactory:c}=this,d=c.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);const m=c.createElement("defs");d.append(m);const p=c.createElement("clipPath"),u=`clippath_${this.data.id}`;p.setAttribute("id",u),p.setAttribute("clipPathUnits","objectBoundingBox"),m.append(p);for(let n=2,a=e.length;n<a;n+=8){const a=e[n],o=e[n+1],d=e[n+2],m=e[n+3],u=c.createElement("rect"),g=(d-t)/s,h=(r-o)/l,b=(a-d)/s,f=(o-m)/l;u.setAttribute("x",g),u.setAttribute("y",h),u.setAttribute("width",b),u.setAttribute("height",f),p.append(u),i?.push(`<rect vector-effect="non-scaling-stroke" x="${g}" y="${h}" width="${b}" height="${f}"/>`)}this.#Oa&&(i.push("</g></svg>')"),o.backgroundImage=i.join("")),this.container.append(d),this.container.style.clipPath=`url(#${u})`}_createPopup(){const{data:e}=this,t=this.#Wa=new Rc({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]});this.parent.div.append(t.render())}render(){ui("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const n=[];if(this._fieldObjects){const a=this._fieldObjects[e];if(a)for(const{page:e,id:r,exportValues:o}of a){if(-1===e)continue;if(r===t)continue;const a="string"==typeof o?o:null,i=document.querySelector(`[data-element-id="${r}"]`);!i||xc.has(i)?n.push({id:r,exportValue:a,domElement:i}):pi()}return n}for(const a of document.getElementsByName(e)){const{exportValue:e}=a,r=a.getAttribute("data-element-id");r!==t&&(xc.has(a)&&n.push({id:r,exportValue:e,domElement:a}))}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t})})}}class Sc extends Ec{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,n=document.createElement("a");n.setAttribute("data-element-id",e.id);let a=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),a=!0):e.action?(this._bindNamedAction(n,e.action),a=!0):e.attachment?(this.#Ha(n,e.attachment,e.attachmentDest),a=!0):e.setOCGState?(this.#ja(n,e.setOCGState),a=!0):e.dest?(this._bindLink(n,e.dest),a=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),a=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),a=!0):this.isTooltipOnly&&!a&&(this._bindLink(n,""),a=!0)),this.container.classList.add("linkAnnotation"),a&&this.container.append(n),this.container}#Va(){this.container.setAttribute("data-internal-link","")}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&this.#Va()}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),this.#Va()}#Ha(e,t,n=null){e.href=this.linkService.getAnchorUrl(""),t.description&&(e.title=t.description),e.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,n),!1),this.#Va()}#ja(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),this.#Va()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const a of Object.keys(t.actions)){const r=n.get(a);r&&(e[r]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:a}}),!1))}e.onclick||(e.onclick=()=>!1),this.#Va()}_bindResetFormAction(e,t){const n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl("")),this.#Va(),!this._fieldObjects)return pi(),void(n||(e.onclick=()=>!1));e.onclick=()=>{n?.();const{fields:e,refs:a,include:r}=t,o=[];if(0!==e.length||0!==a.length){const t=new Set(a);for(const n of e){const e=this._fieldObjects[n]||[];for(const{id:n}of e)t.add(n)}for(const e of Object.values(this._fieldObjects))for(const n of e)t.has(n.id)===r&&o.push(n)}else for(const e of Object.values(this._fieldObjects))o.push(...e);const i=this.annotationStorage,s=[];for(const e of o){const{id:t}=e;switch(s.push(t),e.type){case"text":{const n=e.defaultValue||"";i.setValue(t,{value:n});break}case"checkbox":case"radiobutton":{const n=e.defaultValue===e.exportValues;i.setValue(t,{value:n});break}case"combobox":case"listbox":{const n=e.defaultValue||"";i.setValue(t,{value:n});break}default:continue}const n=document.querySelector(`[data-element-id="${t}"]`);n&&(xc.has(n)?n.dispatchEvent(new Event("resetform")):pi())}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:s,name:"ResetForm"}}),!1}}}class Cc extends Ec{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class Tc extends Ec{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&("CANVAS"===e.previousSibling?.nodeName&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return Di.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,n,a,r){n.includes("mouse")?e.addEventListener(n,e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:r(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})}):e.addEventListener(n,e=>{if("blur"===n){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if("focus"===n){if(t.focused)return;t.focused=!0}r&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:a,value:r(e)}})})}_setEventListeners(e,t,n,a){for(const[r,o]of n)("Action"===o||this.data.actions?.[o])&&("Focus"!==o&&"Blur"!==o||(t||={focused:!1}),this._setEventListener(e,t,r,o,a),"Focus"!==o||this.data.actions?.Blur?"Blur"!==o||this.data.actions?.Focus||this._setEventListener(e,t,"focus","Focus",null):this._setEventListener(e,t,"blur","Blur",null))}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":Ni.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,a=this.data.defaultAppearanceData.fontSize||9,r=e.style;let o;const i=e=>Math.round(10*e)/10;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(bo*a))||1);o=Math.min(a,i(t/bo))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);o=Math.min(a,i(e/bo))}r.fontSize=`calc(${o}px * var(--scale-factor))`,r.color=Ni.makeHexColor(n[0],n[1],n[2]),null!==this.data.textAlignment&&(r.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class Ac extends Tc{constructor(e){super(e,{isRenderable:e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,n,a){const r=this.annotationStorage;for(const o of this._getElementsByName(e.name,e.id))o.domElement&&(o.domElement[t]=n),r.setValue(o.id,{[a]:n})}render(){const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const a=e.getValue(t,{value:this.data.fieldValue});let r=a.value||"";const o=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;o&&r.length>o&&(r=r.slice(0,o));let i=a.formattedValue||this.data.textContent?.join("\n")||null;i&&this.data.comb&&(i=i.replaceAll(/\s+/g,""));const s={userValue:r,formattedValue:i,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=i??r,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",i??r),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),xc.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=yc,this._setRequired(n,this.data.required),o&&(n.maxLength=o),n.addEventListener("input",a=>{e.setValue(t,{value:a.target.value}),this.setPropertyOnSiblings(n,"value",a.target.value,"value"),s.formattedValue=null}),n.addEventListener("resetform",e=>{const t=this.data.defaultFieldValue??"";n.value=s.userValue=t,s.formattedValue=null});let l=e=>{const{formattedValue:t}=s;null!=t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",e=>{if(s.focused)return;const{target:t}=e;s.userValue&&(t.value=s.userValue),s.lastCommittedValue=t.value,s.commitKey=1,this.data.actions?.Focus||(s.focused=!0)}),n.addEventListener("updatefromsandbox",n=>{this.showElementAndHideCanvas(n.target);const a={value(n){s.userValue=n.detail.value??"",e.setValue(t,{value:s.userValue.toString()}),n.target.value=s.userValue},formattedValue(n){const{formattedValue:a}=n.detail;s.formattedValue=a,null!=a&&n.target!==document.activeElement&&(n.target.value=a),e.setValue(t,{formattedValue:a})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{const{charLimit:a}=n.detail,{target:r}=n;if(0===a)return void r.removeAttribute("maxLength");r.setAttribute("maxLength",a);let o=s.userValue;!o||o.length<=a||(o=o.slice(0,a),r.value=s.userValue=o,e.setValue(t,{value:o}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:o,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}}))}};this._dispatchEventFromSandbox(a,n)}),n.addEventListener("keydown",e=>{s.commitKey=1;let n=-1;if("Escape"===e.key?n=0:"Enter"!==e.key||this.data.multiLine?"Tab"===e.key&&(s.commitKey=3):n=2,-1===n)return;const{value:a}=e.target;s.lastCommittedValue!==a&&(s.lastCommittedValue=a,s.userValue=a,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:a,willCommit:!0,commitKey:n,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))});const a=l;l=null,n.addEventListener("blur",e=>{if(!s.focused||!e.relatedTarget)return;this.data.actions?.Blur||(s.focused=!1);const{value:n}=e.target;s.userValue=n,s.lastCommittedValue!==n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:n,willCommit:!0,commitKey:s.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),a(e)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",e=>{s.lastCommittedValue=null;const{data:n,target:a}=e,{value:r,selectionStart:o,selectionEnd:i}=a;let l=o,c=i;switch(e.inputType){case"deleteWordBackward":{const e=r.substring(0,o).match(/\w*[^\w]*$/);e&&(l-=e[0].length);break}case"deleteWordForward":{const e=r.substring(o).match(/^[^\w]*\w*/);e&&(c+=e[0].length);break}case"deleteContentBackward":o===i&&(l-=1);break;case"deleteContentForward":o===i&&(c+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:r,change:n||"",willCommit:!1,selStart:l,selEnd:c}})}),this._setEventListeners(n,s,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.value)}if(l&&n.addEventListener("blur",l),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/o;n.classList.add("comb"),n.style.letterSpacing=`calc(${e}px * var(--scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Dc extends Tc{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class _c extends Tc{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,n=t.id;let a=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;"string"==typeof a&&(a="Off"!==a,e.setValue(n,{value:a})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");return xc.add(r),r.setAttribute("data-element-id",n),r.disabled=t.readOnly,this._setRequired(r,this.data.required),r.type="checkbox",r.name=t.fieldName,a&&r.setAttribute("checked",!0),r.setAttribute("exportValue",t.exportValue),r.tabIndex=yc,r.addEventListener("change",a=>{const{name:r,checked:o}=a.target;for(const a of this._getElementsByName(r,n)){const n=o&&a.exportValue===t.exportValue;a.domElement&&(a.domElement.checked=n),e.setValue(a.id,{value:n})}e.setValue(n,{value:o})}),r.addEventListener("resetform",e=>{const n=t.defaultFieldValue||"Off";e.target.checked=n===t.exportValue}),this.enableScripting&&this.hasJSActions&&(r.addEventListener("updatefromsandbox",t=>{const a={value(t){t.target.checked="Off"!==t.detail.value,e.setValue(n,{value:t.target.checked})}};this._dispatchEventFromSandbox(a,t)}),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class Nc extends Tc{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,n=t.id;let a=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;if("string"==typeof a&&(a=a!==t.buttonValue,e.setValue(n,{value:a})),a)for(const a of this._getElementsByName(t.fieldName,n))e.setValue(a.id,{value:!1});const r=document.createElement("input");if(xc.add(r),r.setAttribute("data-element-id",n),r.disabled=t.readOnly,this._setRequired(r,this.data.required),r.type="radio",r.name=t.fieldName,a&&r.setAttribute("checked",!0),r.tabIndex=yc,r.addEventListener("change",t=>{const{name:a,checked:r}=t.target;for(const t of this._getElementsByName(a,n))e.setValue(t.id,{value:!1});e.setValue(n,{value:r})}),r.addEventListener("resetform",e=>{const n=t.defaultFieldValue;e.target.checked=null!=n&&n===t.buttonValue}),this.enableScripting&&this.hasJSActions){const a=t.buttonValue;r.addEventListener("updatefromsandbox",t=>{const r={value:t=>{const r=a===t.detail.value;for(const a of this._getElementsByName(t.target.name)){const t=r&&a.id===n;a.domElement&&(a.domElement.checked=t),e.setValue(a.id,{value:t})}}};this._dispatchEventFromSandbox(r,t)}),this._setEventListeners(r,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)}return this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class Mc extends Sc{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({},e)})),e}}class Ic extends Tc{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),a=document.createElement("select");xc.add(a),a.setAttribute("data-element-id",t),a.disabled=this.data.readOnly,this._setRequired(a,this.data.required),a.name=this.data.fieldName,a.tabIndex=yc;let r=this.data.combo&&this.data.options.length>0;this.data.combo||(a.size=this.data.options.length,this.data.multiSelect&&(a.multiple=!0)),a.addEventListener("resetform",e=>{const t=this.data.defaultFieldValue;for(const e of a.options)e.selected=e.value===t});for(const e of this.data.options){const t=document.createElement("option");t.textContent=e.displayValue,t.value=e.exportValue,n.value.includes(e.exportValue)&&(t.setAttribute("selected",!0),r=!1),a.append(t)}let o=null;if(r){const e=document.createElement("option");e.value=" ",e.setAttribute("hidden",!0),e.setAttribute("selected",!0),a.prepend(e),o=()=>{e.remove(),a.removeEventListener("input",o),o=null},a.addEventListener("input",o)}const i=e=>{const t=e?"value":"textContent",{options:n,multiple:r}=a;return r?Array.prototype.filter.call(n,e=>e.selected).map(e=>e[t]):-1===n.selectedIndex?null:n[n.selectedIndex][t]};let s=i(!1);const l=e=>{const t=e.target.options;return Array.prototype.map.call(t,e=>({displayValue:e.textContent,exportValue:e.value}))};return this.enableScripting&&this.hasJSActions?(a.addEventListener("updatefromsandbox",n=>{const r={value(n){o?.();const r=n.detail.value,l=new Set(Array.isArray(r)?r:[r]);for(const e of a.options)e.selected=l.has(e.value);e.setValue(t,{value:i(!0)}),s=i(!1)},multipleSelection(e){a.multiple=!0},remove(n){const r=a.options,o=n.detail.remove;if(r[o].selected=!1,a.remove(o),r.length>0){-1===Array.prototype.findIndex.call(r,e=>e.selected)&&(r[0].selected=!0)}e.setValue(t,{value:i(!0),items:l(n)}),s=i(!1)},clear(n){for(;0!==a.length;)a.remove(0);e.setValue(t,{value:null,items:[]}),s=i(!1)},insert(n){const{index:r,displayValue:o,exportValue:c}=n.detail.insert,d=a.children[r],m=document.createElement("option");m.textContent=o,m.value=c,d?d.before(m):a.append(m),e.setValue(t,{value:i(!0),items:l(n)}),s=i(!1)},items(n){const{items:r}=n.detail;for(;0!==a.length;)a.remove(0);for(const e of r){const{displayValue:t,exportValue:n}=e,r=document.createElement("option");r.textContent=t,r.value=n,a.append(r)}a.options.length>0&&(a.options[0].selected=!0),e.setValue(t,{value:i(!0),items:l(n)}),s=i(!1)},indices(n){const a=new Set(n.detail.indices);for(const e of n.target.options)e.selected=a.has(e.index);e.setValue(t,{value:i(!0)}),s=i(!1)},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(r,n)}),a.addEventListener("input",n=>{const a=i(!0),r=i(!1);e.setValue(t,{value:a}),n.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:s,change:r,changeEx:a,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(a,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],e=>e.target.value)):a.addEventListener("input",function(n){e.setValue(t,{value:i(!0)})}),this.data.combo&&this._setTextStyle(a),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class Rc extends Ec{constructor(e){const{data:t,elements:n}=e;super(e,{isRenderable:Ec._hasPopupData(t)}),this.elements=n,this.popup=null}render(){this.container.classList.add("popupAnnotation");const e=this.popup=new Bc({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),t=[];for(const n of this.elements)n.popup=e,n.container.ariaHasPopup="dialog",t.push(n.data.id),n.addHighlightArea();return this.container.setAttribute("aria-controls",t.map(e=>`${Bi}${e}`).join(",")),this.container}}class Bc{#Ga=this.#Ka.bind(this);#$a=this.#Ya.bind(this);#Xa=this.#Ja.bind(this);#Qa=this.#Za.bind(this);#er=null;#ue=null;#tr=null;#nr=null;#ar=null;#rr=null;#or=null;#ir=!1;#sr=null;#T=null;#lr=null;#cr=null;#dr=null;#za=null;#mr=!1;constructor({container:e,color:t,elements:n,titleObj:a,modificationDate:r,contentsObj:o,richText:i,parent:s,rect:l,parentRect:c,open:d}){this.#ue=e,this.#dr=a,this.#tr=o,this.#cr=i,this.#rr=s,this.#er=t,this.#lr=l,this.#or=c,this.#ar=n,this.#nr=$i.toDateObject(r),this.trigger=n.flatMap(e=>e.getElementsToTriggerPopup());for(const e of this.trigger)e.addEventListener("click",this.#Qa),e.addEventListener("mouseenter",this.#Xa),e.addEventListener("mouseleave",this.#$a),e.classList.add("popupTriggerArea");for(const e of n)e.container?.addEventListener("keydown",this.#Ga);this.#ue.hidden=!0,d&&this.#Za()}render(){if(this.#sr)return;const e=this.#sr=document.createElement("div");if(e.className="popup",this.#er){const t=e.style.outlineColor=Ni.makeHexColor(...this.#er);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))e.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`;else{const t=.7;e.style.backgroundColor=Ni.makeHexColor(...this.#er.map(e=>Math.floor(t*(255-e)+e)))}}const t=document.createElement("span");t.className="header";const n=document.createElement("h1");if(t.append(n),({dir:n.dir,str:n.textContent}=this.#dr),e.append(t),this.#nr){const e=document.createElement("span");e.classList.add("popupDate"),e.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),e.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#nr.valueOf()})),t.append(e)}const a=this.#pr;if(a)vc.render({xfaHtml:a,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const t=this._formatContents(this.#tr);e.append(t)}this.#ue.append(e)}get#pr(){const e=this.#cr,t=this.#tr;return!e?.str||t?.str&&t.str!==e.str?null:this.#cr.html||null}get#ur(){return this.#pr?.attributes?.style?.fontSize||0}get#gr(){return this.#pr?.attributes?.style?.color||null}#hr(e){const t=[],n={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},a={style:{color:this.#gr,fontSize:this.#ur?`calc(${this.#ur}px * var(--scale-factor))`:""}};for(const n of e.split("\n"))t.push({name:"span",value:n,attributes:a});return n}_formatContents({str:e,dir:t}){const n=document.createElement("p");n.classList.add("popupContent"),n.dir=t;const a=e.split(/(?:\r\n?|\n)/);for(let e=0,t=a.length;e<t;++e){const r=a[e];n.append(document.createTextNode(r)),e<t-1&&n.append(document.createElement("br"))}return n}#Ka(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||("Enter"===e.key||"Escape"===e.key&&this.#ir)&&this.#Za()}updateEdited({rect:e,popupContent:t}){this.#za||={contentsObj:this.#tr,richText:this.#cr},e&&(this.#T=null),t&&(this.#cr=this.#hr(t),this.#tr=null),this.#sr?.remove(),this.#sr=null}resetEdited(){this.#za&&(({contentsObj:this.#tr,richText:this.#cr}=this.#za),this.#za=null,this.#sr?.remove(),this.#sr=null,this.#T=null)}#br(){if(null!==this.#T)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:a,pageY:r}}}=this.#rr;let o=!!this.#or,i=o?this.#or:this.#lr;for(const e of this.#ar)if(!i||null!==Ni.intersect(e.data.rect,i)){i=e.data.rect,o=!0;break}const s=Ni.normalizeRect([i[0],e[3]-i[1]+e[1],i[2],e[3]-i[3]+e[1]]),l=o?i[2]-i[0]+5:0,c=s[0]+l,d=s[1];this.#T=[100*(c-a)/t,100*(d-r)/n];const{style:m}=this.#ue;m.left=`${this.#T[0]}%`,m.top=`${this.#T[1]}%`}#Za(){this.#ir=!this.#ir,this.#ir?(this.#Ja(),this.#ue.addEventListener("click",this.#Qa),this.#ue.addEventListener("keydown",this.#Ga)):(this.#Ya(),this.#ue.removeEventListener("click",this.#Qa),this.#ue.removeEventListener("keydown",this.#Ga))}#Ja(){this.#sr||this.render(),this.isVisible?this.#ir&&this.#ue.classList.add("focused"):(this.#br(),this.#ue.hidden=!1,this.#ue.style.zIndex=parseInt(this.#ue.style.zIndex)+1e3)}#Ya(){this.#ue.classList.remove("focused"),!this.#ir&&this.isVisible&&(this.#ue.hidden=!0,this.#ue.style.zIndex=parseInt(this.#ue.style.zIndex)-1e3)}forceHide(){this.#mr=this.isVisible,this.#mr&&(this.#ue.hidden=!0)}maybeShow(){this.#mr&&(this.#sr||this.#Ja(),this.#mr=!1,this.#ue.hidden=!1)}get isVisible(){return!1===this.#ue.hidden}}class Pc extends Ec{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=To.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const n=document.createElement("span");n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class Lc extends Ec{#fr=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const e=this.data,{width:t,height:n}=wc(e.rect),a=this.svgFactory.create(t,n,!0),r=this.#fr=this.svgFactory.createElement("svg:line");return r.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),r.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),r.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),r.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),r.setAttribute("stroke-width",e.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),a.append(r),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#fr}addHighlightArea(){this.container.classList.add("highlightArea")}}class Uc extends Ec{#vr=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const e=this.data,{width:t,height:n}=wc(e.rect),a=this.svgFactory.create(t,n,!0),r=e.borderStyle.width,o=this.#vr=this.svgFactory.createElement("svg:rect");return o.setAttribute("x",r/2),o.setAttribute("y",r/2),o.setAttribute("width",t-r),o.setAttribute("height",n-r),o.setAttribute("stroke-width",r||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),a.append(o),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#vr}addHighlightArea(){this.container.classList.add("highlightArea")}}class Fc extends Ec{#yr=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const e=this.data,{width:t,height:n}=wc(e.rect),a=this.svgFactory.create(t,n,!0),r=e.borderStyle.width,o=this.#yr=this.svgFactory.createElement("svg:ellipse");return o.setAttribute("cx",t/2),o.setAttribute("cy",n/2),o.setAttribute("rx",t/2-r/2),o.setAttribute("ry",n/2-r/2),o.setAttribute("stroke-width",r||1),o.setAttribute("stroke","transparent"),o.setAttribute("fill","transparent"),a.append(o),this.container.append(a),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#yr}addHighlightArea(){this.container.classList.add("highlightArea")}}class zc extends Ec{#xr=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,vertices:t,borderStyle:n,popupRef:a}}=this;if(!t)return this.container;const{width:r,height:o}=wc(e),i=this.svgFactory.create(r,o,!0);let s=[];for(let n=0,a=t.length;n<a;n+=2){const a=t[n]-e[0],r=e[3]-t[n+1];s.push(`${a},${r}`)}s=s.join(" ");const l=this.#xr=this.svgFactory.createElement(this.svgElementName);return l.setAttribute("points",s),l.setAttribute("stroke-width",n.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),i.append(l),this.container.append(i),!a&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#xr}addHighlightArea(){this.container.classList.add("highlightArea")}}class Oc extends zc{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class Wc extends Ec{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class qc extends Ec{#wr=null;#kr=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?To.HIGHLIGHT:To.INK}#Er(e,t){switch(e){case 90:return{transform:`rotate(90) translate(${-t[0]},${t[1]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};case 180:return{transform:`rotate(180) translate(${-t[2]},${t[1]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]};case 270:return{transform:`rotate(270) translate(${-t[2]},${t[3]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};default:return{transform:`translate(${-t[0]},${t[3]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]}}}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,rotation:t,inkLists:n,borderStyle:a,popupRef:r}}=this,{transform:o,width:i,height:s}=this.#Er(t,e),l=this.svgFactory.create(i,s,!0),c=this.#wr=this.svgFactory.createElement("svg:g");l.append(c),c.setAttribute("stroke-width",a.width||1),c.setAttribute("stroke-linecap","round"),c.setAttribute("stroke-linejoin","round"),c.setAttribute("stroke-miterlimit",10),c.setAttribute("stroke","transparent"),c.setAttribute("fill","transparent"),c.setAttribute("transform",o);for(let e=0,t=n.length;e<t;e++){const t=this.svgFactory.createElement(this.svgElementName);this.#kr.push(t),t.setAttribute("points",n[e].join(",")),c.append(t)}return!r&&this.hasPopupData&&this._createPopup(),this.container.append(l),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);const{thickness:t,points:n,rect:a}=e,r=this.#wr;if(t>=0&&r.setAttribute("stroke-width",t||1),n)for(let e=0,t=this.#kr.length;e<t;e++)this.#kr[e].setAttribute("points",n[e].join(","));if(a){const{transform:e,width:t,height:n}=this.#Er(this.data.rotation,a);r.parentElement.setAttribute("viewBox",`0 0 ${t} ${n}`),r.setAttribute("transform",e)}}getElementsToTriggerPopup(){return this.#kr}addHighlightArea(){this.container.classList.add("highlightArea")}}class Hc extends Ec{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=To.HIGHLIGHT}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),this.container}}class jc extends Ec{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class Vc extends Ec{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class Gc extends Ec{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class Kc extends Ec{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=To.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class $c extends Ec{#Sr=null;constructor(e){super(e,{isRenderable:!0});const{file:t}=this.data;this.filename=t.filename,this.content=t.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...t})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:t}=this;let n;t.hasAppearance||0===t.fillAlpha?n=document.createElement("div"):(n=document.createElement("img"),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?"paperclip":"pushpin"}.svg`,t.fillAlpha&&t.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(100*t.fillAlpha)}%);`)),n.addEventListener("dblclick",this.#Cr.bind(this)),this.#Sr=n;const{isMac:a}=Di.platform;return e.addEventListener("keydown",e=>{"Enter"===e.key&&(a?e.metaKey:e.ctrlKey)&&this.#Cr()}),!t.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea"),e.append(n),e}getElementsToTriggerPopup(){return this.#Sr}addHighlightArea(){this.container.classList.add("highlightArea")}#Cr(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class Yc{#Tr=null;#Ar=null;#Dr=new Map;#_r=null;constructor({div:e,accessibilityManager:t,annotationCanvasMap:n,annotationEditorUIManager:a,page:r,viewport:o,structTreeLayer:i}){this.div=e,this.#Tr=t,this.#Ar=n,this.#_r=i||null,this.page=r,this.viewport=o,this.zIndex=0,this._annotationEditorUIManager=a}hasEditableAnnotations(){return this.#Dr.size>0}async#Nr(e,t){const n=e.firstChild||e,a=n.id=`${Bi}${t}`,r=await(this.#_r?.getAriaAttributes(a));if(r)for(const[e,t]of r)n.setAttribute(e,t);this.div.append(e),this.#Tr?.moveElementInDOM(this.div,e,n,!1)}async render(e){const{annotations:t}=e,n=this.div;Zi(n,this.viewport);const a=new Map,r={data:null,layer:n,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new fc,annotationStorage:e.annotationStorage||new ys,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const e of t){if(e.noHTML)continue;const t=e.annotationType===Jo;if(t){const t=a.get(e.id);if(!t)continue;r.elements=t}else{const{width:t,height:n}=wc(e.rect);if(t<=0||n<=0)continue}r.data=e;const n=kc.create(r);if(!n.isRenderable)continue;if(!t&&e.popupRef){const t=a.get(e.popupRef);t?t.push(n):a.set(e.popupRef,[n])}const o=n.render();e.hidden&&(o.style.visibility="hidden"),await this.#Nr(o,e.id),n._isEditable&&(this.#Dr.set(n.data.id,n),this._annotationEditorUIManager?.renderAnnotationElement(n))}this.#Mr()}update({viewport:e}){const t=this.div;this.viewport=e,Zi(t,{rotation:e.rotation}),this.#Mr(),t.hidden=!1}#Mr(){if(!this.#Ar)return;const e=this.div;for(const[t,n]of this.#Ar){const a=e.querySelector(`[data-annotation-id="${t}"]`);if(!a)continue;n.className="annotationContent";const{firstChild:r}=a;r?"CANVAS"===r.nodeName?r.replaceWith(n):r.classList.contains("annotationContent")?r.after(n):r.before(n):a.append(n)}this.#Ar.clear()}getEditableAnnotations(){return Array.from(this.#Dr.values())}getEditableAnnotation(e){return this.#Dr.get(e)}}const Xc=/\r\n?|\n/g;class Jc extends ps{#er;#Ir="";#Rr=`${this.id}-editor`;#Br=null;#ur;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const e=Jc.prototype,t=e=>e.isEmpty(),n=cs.TRANSLATE_SMALL,a=cs.TRANSLATE_BIG;return bi(this,"_keyboardManager",new ss([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-n,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-a,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[n,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[a,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-a],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,n],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,a],checker:t}]]))}static _type="freetext";static _editorType=To.FREETEXT;constructor(e){super({...e,name:"freeTextEditor"}),this.#er=e.color||Jc._defaultColor||ps._defaultLineColor,this.#ur=e.fontSize||Jc._defaultFontSize}static initialize(e,t){ps.initialize(e,t);const n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case Ao.FREETEXT_SIZE:Jc._defaultFontSize=t;break;case Ao.FREETEXT_COLOR:Jc._defaultColor=t}}updateParams(e,t){switch(e){case Ao.FREETEXT_SIZE:this.#Pr(t);break;case Ao.FREETEXT_COLOR:this.#Lr(t)}}static get defaultPropertiesToUpdate(){return[[Ao.FREETEXT_SIZE,Jc._defaultFontSize],[Ao.FREETEXT_COLOR,Jc._defaultColor||ps._defaultLineColor]]}get propertiesToUpdate(){return[[Ao.FREETEXT_SIZE,this.#ur],[Ao.FREETEXT_COLOR,this.#er]]}#Pr(e){const t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--scale-factor))`,this.translate(0,-(e-this.#ur)*this.parentScale),this.#ur=e,this.#Ur()},n=this.#ur;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ao.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#Lr(e){const t=e=>{this.#er=this.editorDiv.style.color=e},n=this.#er;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ao.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){const e=this.parentScale;return[-Jc._internalPadding*e,-(Jc._internalPadding+this.#ur)*e]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(To.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#Br=new AbortController;const e=this._uiManager.combinedSignal(this.#Br);this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#Rr),this._isDraggable=!0,this.#Br?.abort(),this.#Br=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#Fr(){const e=[];this.editorDiv.normalize();let t=null;for(const n of this.editorDiv.childNodes)t?.nodeType===Node.TEXT_NODE&&"BR"===n.nodeName||(e.push(Jc.#zr(n)),t=n);return e.join("\n")}#Ur(){const[e,t]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:e,div:t}=this,a=t.style.display,r=t.classList.contains("hidden");t.classList.remove("hidden"),t.style.display="hidden",e.div.append(this.div),n=t.getBoundingClientRect(),t.remove(),t.style.display=a,t.classList.toggle("hidden",r)}this.rotation%180==this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#Ir,t=this.#Ir=this.#Fr().trimEnd();if(e===t)return;const n=e=>{this.#Ir=e,e?(this.#Or(),this._uiManager.rebuild(this),this.#Ur()):this.remove()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),this.#Ur()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&"Enter"===e.key&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){Jc._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#Rr),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#ur}px * var(--scale-factor))`,n.color=this.#er,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),as(this,this.div,["dblclick","keydown"]),this.width){const[n,a]=this.parentDimensions;if(this.annotationElementId){const{position:r}=this._initialData;let[o,i]=this.getInitialTranslation();[o,i]=this.pageTranslationToScreen(o,i);const[s,l]=this.pageDimensions,[c,d]=this.pageTranslation;let m,p;switch(this.rotation){case 0:m=e+(r[0]-c)/s,p=t+this.height-(r[1]-d)/l;break;case 90:m=e+(r[0]-c)/s,p=t-(r[1]-d)/l,[o,i]=[i,-o];break;case 180:m=e-this.width+(r[0]-c)/s,p=t-(r[1]-d)/l,[o,i]=[-o,-i];break;case 270:m=e+(r[0]-c-this.height*l)/s,p=t+(r[1]-d-this.width*s)/l,[o,i]=[-i,o]}this.setAt(m*n,p*a,o,i)}else this.setAt(e*n,t*a,this.width*n,this.height*a);this.#Or(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#zr(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(Xc,"")}editorDivPaste(e){const t=e.clipboardData||window.clipboardData,{types:n}=t;if(1===n.length&&"text/plain"===n[0])return;e.preventDefault();const a=Jc.#Wr(t.getData("text")||"").replaceAll(Xc,"\n");if(!a)return;const r=window.getSelection();if(!r.rangeCount)return;this.editorDiv.normalize(),r.deleteFromDocument();const o=r.getRangeAt(0);if(!a.includes("\n"))return o.insertNode(document.createTextNode(a)),this.editorDiv.normalize(),void r.collapseToStart();const{startContainer:i,startOffset:s}=o,l=[],c=[];if(i.nodeType===Node.TEXT_NODE){const e=i.parentElement;if(c.push(i.nodeValue.slice(s).replaceAll(Xc,"")),e!==this.editorDiv){let t=l;for(const n of this.editorDiv.childNodes)n!==e?t.push(Jc.#zr(n)):t=c}l.push(i.nodeValue.slice(0,s).replaceAll(Xc,""))}else if(i===this.editorDiv){let e=l,t=0;for(const n of this.editorDiv.childNodes)t++===s&&(e=c),e.push(Jc.#zr(n))}this.#Ir=`${l.join("\n")}${a}${c.join("\n")}`,this.#Or();const d=new Range;let m=l.reduce((e,t)=>e+t.length,0);for(const{firstChild:e}of this.editorDiv.childNodes)if(e.nodeType===Node.TEXT_NODE){const t=e.nodeValue.length;if(m<=t){d.setStart(e,m),d.setEnd(e,m);break}m-=t}r.removeAllRanges(),r.addRange(d)}#Or(){if(this.editorDiv.replaceChildren(),this.#Ir)for(const e of this.#Ir.split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}#qr(){return this.#Ir.replaceAll(" "," ")}static#Wr(e){return e.replaceAll(" "," ")}get contentDiv(){return this.editorDiv}static async deserialize(e,t,n){let a=null;if(e instanceof Pc){const{data:{defaultAppearanceData:{fontSize:t,fontColor:n},rect:r,rotation:o,id:i,popupRef:s},textContent:l,textPosition:c,parent:{page:{pageNumber:d}}}=e;if(!l||0===l.length)return null;a=e={annotationType:To.FREETEXT,color:Array.from(n),fontSize:t,value:l.join("\n"),position:c,pageIndex:d-1,rect:r.slice(0),rotation:o,id:i,deleted:!1,popupRef:s}}const r=await super.deserialize(e,t,n);return r.#ur=e.fontSize,r.#er=Ni.makeHexColor(...e.color),r.#Ir=Jc.#Wr(e.value),r.annotationElementId=e.id||null,r._initialData=a,r}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const t=Jc._internalPadding*this.parentScale,n=this.getRect(t,t),a=ps._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#er),r={annotationType:To.FREETEXT,color:a,fontSize:this.#ur,value:this.#qr(),pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?r:this.annotationElementId&&!this.#Hr(r)?null:(r.id=this.annotationElementId,r)}#Hr(e){const{value:t,fontSize:n,color:a,pageIndex:r}=this._initialData;return this._hasBeenMoved||e.value!==t||e.fontSize!==n||e.color.some((e,t)=>e!==a[t])||e.pageIndex!==r}renderAnnotationElement(e){const t=super.renderAnnotationElement(e);if(this.deleted)return t;const{style:n}=t;n.fontSize=`calc(${this.#ur}px * var(--scale-factor))`,n.color=this.#er,t.replaceChildren();for(const e of this.#Ir.split("\n")){const n=document.createElement("div");n.append(e?document.createTextNode(e):document.createElement("br")),t.append(n)}const a=Jc._internalPadding*this.parentScale;return e.updateEdited({rect:this.getRect(a,a),popupContent:this.#Ir}),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}class Qc{static PRECISION=1e-4;toSVGPath(){ui("Abstract method `toSVGPath` must be implemented.")}get box(){ui("Abstract getter `box` must be implemented.")}serialize(e,t){ui("Abstract method `serialize` must be implemented.")}static _rescale(e,t,n,a,r,o){o||=new Float32Array(e.length);for(let i=0,s=e.length;i<s;i+=2)o[i]=t+e[i]*a,o[i+1]=n+e[i+1]*r;return o}static _rescaleAndSwap(e,t,n,a,r,o){o||=new Float32Array(e.length);for(let i=0,s=e.length;i<s;i+=2)o[i]=t+e[i+1]*a,o[i+1]=n+e[i]*r;return o}static _translate(e,t,n,a){a||=new Float32Array(e.length);for(let r=0,o=e.length;r<o;r+=2)a[r]=t+e[r],a[r+1]=n+e[r+1];return a}static svgRound(e){return Math.round(1e4*e)}static _normalizePoint(e,t,n,a,r){switch(r){case 90:return[1-t/n,e/a];case 180:return[1-e/n,1-t/a];case 270:return[t/n,1-e/a];default:return[e/n,t/a]}}static _normalizePagePoint(e,t,n){switch(n){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,n,a,r,o){return[(e+5*n)/6,(t+5*a)/6,(5*n+r)/6,(5*a+o)/6,(n+r)/2,(a+o)/2]}}class Zc{#jr;#Vr=[];#Gr;#Kr;#$r=[];#Yr=new Float32Array(18);#Xr;#Jr;#Qr;#Zr;#eo;#to;#no=[];static#ao=8;static#ro=2;static#oo=Zc.#ao+Zc.#ro;constructor({x:e,y:t},n,a,r,o,i=0){this.#jr=n,this.#to=r*a,this.#Kr=o,this.#Yr.set([NaN,NaN,NaN,NaN,e,t],6),this.#Gr=i,this.#Zr=Zc.#ao*a,this.#Qr=Zc.#oo*a,this.#eo=a,this.#no.push(e,t)}isEmpty(){return isNaN(this.#Yr[8])}#io(){const e=this.#Yr.subarray(4,6),t=this.#Yr.subarray(16,18),[n,a,r,o]=this.#jr;return[(this.#Xr+(e[0]-t[0])/2-n)/r,(this.#Jr+(e[1]-t[1])/2-a)/o,(this.#Xr+(t[0]-e[0])/2-n)/r,(this.#Jr+(t[1]-e[1])/2-a)/o]}add({x:e,y:t}){this.#Xr=e,this.#Jr=t;const[n,a,r,o]=this.#jr;let[i,s,l,c]=this.#Yr.subarray(8,12);const d=e-l,m=t-c,p=Math.hypot(d,m);if(p<this.#Qr)return!1;const u=p-this.#Zr,g=u/p,h=g*d,b=g*m;let f=i,v=s;i=l,s=c,l+=h,c+=b,this.#no?.push(e,t);const y=h/u,x=-b/u*this.#to,w=y*this.#to;if(this.#Yr.set(this.#Yr.subarray(2,8),0),this.#Yr.set([l+x,c+w],4),this.#Yr.set(this.#Yr.subarray(14,18),12),this.#Yr.set([l-x,c-w],16),isNaN(this.#Yr[6]))return 0===this.#$r.length&&(this.#Yr.set([i+x,s+w],2),this.#$r.push(NaN,NaN,NaN,NaN,(i+x-n)/r,(s+w-a)/o),this.#Yr.set([i-x,s-w],14),this.#Vr.push(NaN,NaN,NaN,NaN,(i-x-n)/r,(s-w-a)/o)),this.#Yr.set([f,v,i,s,l,c],6),!this.isEmpty();this.#Yr.set([f,v,i,s,l,c],6);return Math.abs(Math.atan2(v-s,f-i)-Math.atan2(b,h))<Math.PI/2?([i,s,l,c]=this.#Yr.subarray(2,6),this.#$r.push(NaN,NaN,NaN,NaN,((i+l)/2-n)/r,((s+c)/2-a)/o),[i,s,f,v]=this.#Yr.subarray(14,18),this.#Vr.push(NaN,NaN,NaN,NaN,((f+i)/2-n)/r,((v+s)/2-a)/o),!0):([f,v,i,s,l,c]=this.#Yr.subarray(0,6),this.#$r.push(((f+5*i)/6-n)/r,((v+5*s)/6-a)/o,((5*i+l)/6-n)/r,((5*s+c)/6-a)/o,((i+l)/2-n)/r,((s+c)/2-a)/o),[l,c,i,s,f,v]=this.#Yr.subarray(12,18),this.#Vr.push(((f+5*i)/6-n)/r,((v+5*s)/6-a)/o,((5*i+l)/6-n)/r,((5*s+c)/6-a)/o,((i+l)/2-n)/r,((s+c)/2-a)/o),!0)}toSVGPath(){if(this.isEmpty())return"";const e=this.#$r,t=this.#Vr;if(isNaN(this.#Yr[6])&&!this.isEmpty())return this.#so();const n=[];n.push(`M${e[4]} ${e[5]}`);for(let t=6;t<e.length;t+=6)isNaN(e[t])?n.push(`L${e[t+4]} ${e[t+5]}`):n.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);this.#lo(n);for(let e=t.length-6;e>=6;e-=6)isNaN(t[e])?n.push(`L${t[e+4]} ${t[e+5]}`):n.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);return this.#co(n),n.join(" ")}#so(){const[e,t,n,a]=this.#jr,[r,o,i,s]=this.#io();return`M${(this.#Yr[2]-e)/n} ${(this.#Yr[3]-t)/a} L${(this.#Yr[4]-e)/n} ${(this.#Yr[5]-t)/a} L${r} ${o} L${i} ${s} L${(this.#Yr[16]-e)/n} ${(this.#Yr[17]-t)/a} L${(this.#Yr[14]-e)/n} ${(this.#Yr[15]-t)/a} Z`}#co(e){const t=this.#Vr;e.push(`L${t[4]} ${t[5]} Z`)}#lo(e){const[t,n,a,r]=this.#jr,o=this.#Yr.subarray(4,6),i=this.#Yr.subarray(16,18),[s,l,c,d]=this.#io();e.push(`L${(o[0]-t)/a} ${(o[1]-n)/r} L${s} ${l} L${c} ${d} L${(i[0]-t)/a} ${(i[1]-n)/r}`)}newFreeDrawOutline(e,t,n,a,r,o){return new ed(e,t,n,a,r,o)}getOutlines(){const e=this.#$r,t=this.#Vr,n=this.#Yr,[a,r,o,i]=this.#jr,s=new Float32Array((this.#no?.length??0)+2);for(let e=0,t=s.length-2;e<t;e+=2)s[e]=(this.#no[e]-a)/o,s[e+1]=(this.#no[e+1]-r)/i;if(s[s.length-2]=(this.#Xr-a)/o,s[s.length-1]=(this.#Jr-r)/i,isNaN(n[6])&&!this.isEmpty())return this.#do(s);const l=new Float32Array(this.#$r.length+24+this.#Vr.length);let c=e.length;for(let t=0;t<c;t+=2)isNaN(e[t])?l[t]=l[t+1]=NaN:(l[t]=e[t],l[t+1]=e[t+1]);c=this.#mo(l,c);for(let e=t.length-6;e>=6;e-=6)for(let n=0;n<6;n+=2)isNaN(t[e+n])?(l[c]=l[c+1]=NaN,c+=2):(l[c]=t[e+n],l[c+1]=t[e+n+1],c+=2);return this.#po(l,c),this.newFreeDrawOutline(l,s,this.#jr,this.#eo,this.#Gr,this.#Kr)}#do(e){const t=this.#Yr,[n,a,r,o]=this.#jr,[i,s,l,c]=this.#io(),d=new Float32Array(36);return d.set([NaN,NaN,NaN,NaN,(t[2]-n)/r,(t[3]-a)/o,NaN,NaN,NaN,NaN,(t[4]-n)/r,(t[5]-a)/o,NaN,NaN,NaN,NaN,i,s,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,(t[16]-n)/r,(t[17]-a)/o,NaN,NaN,NaN,NaN,(t[14]-n)/r,(t[15]-a)/o],0),this.newFreeDrawOutline(d,e,this.#jr,this.#eo,this.#Gr,this.#Kr)}#po(e,t){const n=this.#Vr;return e.set([NaN,NaN,NaN,NaN,n[4],n[5]],t),t+6}#mo(e,t){const n=this.#Yr.subarray(4,6),a=this.#Yr.subarray(16,18),[r,o,i,s]=this.#jr,[l,c,d,m]=this.#io();return e.set([NaN,NaN,NaN,NaN,(n[0]-r)/i,(n[1]-o)/s,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,d,m,NaN,NaN,NaN,NaN,(a[0]-r)/i,(a[1]-o)/s],t),t+24}}class ed extends Qc{#jr;#uo=new Float32Array(4);#Gr;#Kr;#no;#eo;#go;constructor(e,t,n,a,r,o){super(),this.#go=e,this.#no=t,this.#jr=n,this.#eo=a,this.#Gr=r,this.#Kr=o,this.lastPoint=[NaN,NaN],this.#ho(o);const[i,s,l,c]=this.#uo;for(let t=0,n=e.length;t<n;t+=2)e[t]=(e[t]-i)/l,e[t+1]=(e[t+1]-s)/c;for(let e=0,n=t.length;e<n;e+=2)t[e]=(t[e]-i)/l,t[e+1]=(t[e+1]-s)/c}toSVGPath(){const e=[`M${this.#go[4]} ${this.#go[5]}`];for(let t=6,n=this.#go.length;t<n;t+=6)isNaN(this.#go[t])?e.push(`L${this.#go[t+4]} ${this.#go[t+5]}`):e.push(`C${this.#go[t]} ${this.#go[t+1]} ${this.#go[t+2]} ${this.#go[t+3]} ${this.#go[t+4]} ${this.#go[t+5]}`);return e.push("Z"),e.join(" ")}serialize([e,t,n,a],r){const o=n-e,i=a-t;let s,l;switch(r){case 0:s=Qc._rescale(this.#go,e,a,o,-i),l=Qc._rescale(this.#no,e,a,o,-i);break;case 90:s=Qc._rescaleAndSwap(this.#go,e,t,o,i),l=Qc._rescaleAndSwap(this.#no,e,t,o,i);break;case 180:s=Qc._rescale(this.#go,n,t,-o,i),l=Qc._rescale(this.#no,n,t,-o,i);break;case 270:s=Qc._rescaleAndSwap(this.#go,n,a,-o,-i),l=Qc._rescaleAndSwap(this.#no,n,a,-o,-i)}return{outline:Array.from(s),points:[Array.from(l)]}}#ho(e){const t=this.#go;let n=t[4],a=t[5],r=n,o=a,i=n,s=a,l=n,c=a;const d=e?Math.max:Math.min;for(let e=6,m=t.length;e<m;e+=6){if(isNaN(t[e]))r=Math.min(r,t[e+4]),o=Math.min(o,t[e+5]),i=Math.max(i,t[e+4]),s=Math.max(s,t[e+5]),c<t[e+5]?(l=t[e+4],c=t[e+5]):c===t[e+5]&&(l=d(l,t[e+4]));else{const m=Ni.bezierBoundingBox(n,a,...t.slice(e,e+6));r=Math.min(r,m[0]),o=Math.min(o,m[1]),i=Math.max(i,m[2]),s=Math.max(s,m[3]),c<m[3]?(l=m[2],c=m[3]):c===m[3]&&(l=d(l,m[2]))}n=t[e+4],a=t[e+5]}const m=this.#uo;m[0]=r-this.#Gr,m[1]=o-this.#Gr,m[2]=i-r+2*this.#Gr,m[3]=s-o+2*this.#Gr,this.lastPoint=[l,c]}get box(){return this.#uo}newOutliner(e,t,n,a,r,o=0){return new Zc(e,t,n,a,r,o)}getNewOutline(e,t){const[n,a,r,o]=this.#uo,[i,s,l,c]=this.#jr,d=r*l,m=o*c,p=n*l+i,u=a*c+s,g=this.newOutliner({x:this.#no[0]*d+p,y:this.#no[1]*m+u},this.#jr,this.#eo,e,this.#Kr,t??this.#Gr);for(let e=2;e<this.#no.length;e+=2)g.add({x:this.#no[e]*d+p,y:this.#no[e+1]*m+u});return g.getOutlines()}}class td{#jr;#bo;#fo=[];#vo=[];constructor(e,t=0,n=0,a=!0){let r=1/0,o=-1/0,i=1/0,s=-1/0;const l=1e-4;for(const{x:n,y:a,width:c,height:d}of e){const e=Math.floor((n-t)/l)*l,m=Math.ceil((n+c+t)/l)*l,p=Math.floor((a-t)/l)*l,u=Math.ceil((a+d+t)/l)*l,g=[e,p,u,!0],h=[m,p,u,!1];this.#fo.push(g,h),r=Math.min(r,e),o=Math.max(o,m),i=Math.min(i,p),s=Math.max(s,u)}const c=o-r+2*n,d=s-i+2*n,m=r-n,p=i-n,u=this.#fo.at(a?-1:-2),g=[u[0],u[2]];for(const e of this.#fo){const[t,n,a]=e;e[0]=(t-m)/c,e[1]=(n-p)/d,e[2]=(a-p)/d}this.#jr=new Float32Array([m,p,c,d]),this.#bo=g}getOutlines(){this.#fo.sort((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2]);const e=[];for(const t of this.#fo)t[3]?(e.push(...this.#yo(t)),this.#xo(t)):(this.#wo(t),e.push(...this.#yo(t)));return this.#ko(e)}#ko(e){const t=[],n=new Set;for(const n of e){const[e,a,r]=n;t.push([e,a,n],[e,r,n])}t.sort((e,t)=>e[1]-t[1]||e[0]-t[0]);for(let e=0,a=t.length;e<a;e+=2){const a=t[e][2],r=t[e+1][2];a.push(r),r.push(a),n.add(a),n.add(r)}const a=[];let r;for(;n.size>0;){const e=n.values().next().value;let[t,o,i,s,l]=e;n.delete(e);let c=t,d=o;for(r=[t,i],a.push(r);;){let e;if(n.has(s))e=s;else{if(!n.has(l))break;e=l}n.delete(e),[t,o,i,s,l]=e,c!==t&&(r.push(c,d,t,d===o?o:i),c=t),d=d===o?i:o}r.push(c,d)}return new nd(a,this.#jr,this.#bo)}#Eo(e){const t=this.#vo;let n=0,a=t.length-1;for(;n<=a;){const r=n+a>>1,o=t[r][0];if(o===e)return r;o<e?n=r+1:a=r-1}return a+1}#xo([,e,t]){const n=this.#Eo(e);this.#vo.splice(n,0,[e,t])}#wo([,e,t]){const n=this.#Eo(e);for(let a=n;a<this.#vo.length;a++){const[n,r]=this.#vo[a];if(n!==e)break;if(n===e&&r===t)return void this.#vo.splice(a,1)}for(let a=n-1;a>=0;a--){const[n,r]=this.#vo[a];if(n!==e)break;if(n===e&&r===t)return void this.#vo.splice(a,1)}}#yo(e){const[t,n,a]=e,r=[[t,n,a]],o=this.#Eo(a);for(let e=0;e<o;e++){const[n,a]=this.#vo[e];for(let e=0,o=r.length;e<o;e++){const[,i,s]=r[e];if(!(a<=i||s<=n))if(i>=n)if(s>a)r[e][1]=a;else{if(1===o)return[];r.splice(e,1),e--,o--}else r[e][2]=n,s>a&&r.push([t,a,s])}}return r}}class nd extends Qc{#jr;#So;constructor(e,t,n){super(),this.#So=e,this.#jr=t,this.lastPoint=n}toSVGPath(){const e=[];for(const t of this.#So){let[n,a]=t;e.push(`M${n} ${a}`);for(let r=2;r<t.length;r+=2){const o=t[r],i=t[r+1];o===n?(e.push(`V${i}`),a=i):i===a&&(e.push(`H${o}`),n=o)}e.push("Z")}return e.join(" ")}serialize([e,t,n,a],r){const o=[],i=n-e,s=a-t;for(const t of this.#So){const n=new Array(t.length);for(let r=0;r<t.length;r+=2)n[r]=e+t[r]*i,n[r+1]=a-t[r+1]*s;o.push(n)}return o}get box(){return this.#jr}get classNamesForOutlining(){return["highlightOutline"]}}class ad extends Zc{newFreeDrawOutline(e,t,n,a,r,o){return new rd(e,t,n,a,r,o)}}class rd extends ed{newOutliner(e,t,n,a,r,o=0){return new ad(e,t,n,a,r,o)}}class od{#Co=null;#To=null;#Ao;#Do=null;#_o=!1;#No=!1;#o=null;#Mo;#Io=null;#h=null;#Ro;static#Bo=null;static get _keyboardManager(){return bi(this,"_keyboardManager",new ss([[["Escape","mac+Escape"],od.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],od.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],od.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],od.prototype._moveToPrevious],[["Home","mac+Home"],od.prototype._moveToBeginning],[["End","mac+End"],od.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:t=null}){e?(this.#No=!1,this.#Ro=Ao.HIGHLIGHT_COLOR,this.#o=e):(this.#No=!0,this.#Ro=Ao.HIGHLIGHT_DEFAULT_COLOR),this.#h=e?._uiManager||t,this.#Mo=this.#h._eventBus,this.#Ao=e?.color||this.#h?.highlightColors.values().next().value||"#dbeafe",od.#Bo||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const e=this.#Co=document.createElement("button");e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.setAttribute("aria-haspopup",!0);const t=this.#h._signal;e.addEventListener("click",this.#Po.bind(this),{signal:t}),e.addEventListener("keydown",this.#Ka.bind(this),{signal:t});const n=this.#To=document.createElement("span");return n.className="swatch",n.setAttribute("aria-hidden",!0),n.style.backgroundColor=this.#Ao,e.append(n),e}renderMainDropdown(){const e=this.#Do=this.#Lo();return e.setAttribute("aria-orientation","horizontal"),e.setAttribute("aria-labelledby","highlightColorPickerLabel"),e}#Lo(){const e=document.createElement("div"),t=this.#h._signal;e.addEventListener("contextmenu",Gi,{signal:t}),e.className="dropdown",e.role="listbox",e.setAttribute("aria-multiselectable",!1),e.setAttribute("aria-orientation","vertical"),e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[n,a]of this.#h.highlightColors){const r=document.createElement("button");r.tabIndex="0",r.role="option",r.setAttribute("data-color",a),r.title=n,r.setAttribute("data-l10n-id",od.#Bo[n]);const o=document.createElement("span");r.append(o),o.className="swatch",o.style.backgroundColor=a,r.setAttribute("aria-selected",a===this.#Ao),r.addEventListener("click",this.#Uo.bind(this,a),{signal:t}),e.append(r)}return e.addEventListener("keydown",this.#Ka.bind(this),{signal:t}),e}#Uo(e,t){t.stopPropagation(),this.#Mo.dispatch("switchannotationeditorparams",{source:this,type:this.#Ro,value:e})}_colorSelectFromKeyboard(e){if(e.target===this.#Co)return void this.#Po(e);const t=e.target.getAttribute("data-color");t&&this.#Uo(t,e)}_moveToNext(e){this.#Fo?e.target!==this.#Co?e.target.nextSibling?.focus():this.#Do.firstChild?.focus():this.#Po(e)}_moveToPrevious(e){e.target!==this.#Do?.firstChild&&e.target!==this.#Co?(this.#Fo||this.#Po(e),e.target.previousSibling?.focus()):this.#Fo&&this._hideDropdownFromKeyboard()}_moveToBeginning(e){this.#Fo?this.#Do.firstChild?.focus():this.#Po(e)}_moveToEnd(e){this.#Fo?this.#Do.lastChild?.focus():this.#Po(e)}#Ka(e){od._keyboardManager.exec(this,e)}#Po(e){if(this.#Fo)return void this.hideDropdown();if(this.#_o=0===e.detail,this.#Io||(this.#Io=new AbortController,window.addEventListener("pointerdown",this.#c.bind(this),{signal:this.#h.combinedSignal(this.#Io)})),this.#Do)return void this.#Do.classList.remove("hidden");const t=this.#Do=this.#Lo();this.#Co.append(t)}#c(e){this.#Do?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#Do?.classList.add("hidden"),this.#Io?.abort(),this.#Io=null}get#Fo(){return this.#Do&&!this.#Do.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#No||(this.#Fo?(this.hideDropdown(),this.#Co.focus({preventScroll:!0,focusVisible:this.#_o})):this.#o?.unselect())}updateColor(e){if(this.#To&&(this.#To.style.backgroundColor=e),!this.#Do)return;const t=this.#h.highlightColors.values();for(const n of this.#Do.children)n.setAttribute("aria-selected",t.next().value===e)}destroy(){this.#Co?.remove(),this.#Co=null,this.#To=null,this.#Do?.remove(),this.#Do=null}}class id extends ps{#zo=null;#Oo=0;#Wo;#qo=null;#r=null;#Ho=null;#jo=null;#Vo=0;#Go=null;#Ko=null;#y=null;#$o=!1;#bo=null;#Yo;#Xo=null;#Jo="";#to;#Qo="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=To.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const e=id.prototype;return bi(this,"_keyboardManager",new ss([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:"highlightEditor"}),this.color=e.color||id._defaultColor,this.#to=e.thickness||id._defaultThickness,this.#Yo=e.opacity||id._defaultOpacity,this.#Wo=e.boxes||null,this.#Qo=e.methodOfCreation||"",this.#Jo=e.text||"",this._isDraggable=!1,e.highlightId>-1?(this.#$o=!0,this.#Zo(e),this.#ei()):this.#Wo&&(this.#zo=e.anchorNode,this.#Oo=e.anchorOffset,this.#jo=e.focusNode,this.#Vo=e.focusOffset,this.#ti(),this.#ei(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#$o?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#to,methodOfCreation:this.#Qo}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}#ti(){const e=new td(this.#Wo,.001);this.#Ko=e.getOutlines(),[this.x,this.y,this.width,this.height]=this.#Ko.box;const t=new td(this.#Wo,.0025,.001,"ltr"===this._uiManager.direction);this.#Ho=t.getOutlines();const{lastPoint:n}=this.#Ho;this.#bo=[(n[0]-this.x)/this.width,(n[1]-this.y)/this.height]}#Zo({highlightOutlines:e,highlightId:t,clipPathId:n}){this.#Ko=e;if(this.#Ho=e.getNewOutline(this.#to/2+1.5,.0025),t>=0)this.#y=t,this.#qo=n,this.parent.drawLayer.finalizeDraw(t,{bbox:e.box,path:{d:e.toSVGPath()}}),this.#Xo=this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:this.#Ho.box,path:{d:this.#Ho.toSVGPath()}},!0);else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(this.#y,{bbox:id.#ni(this.#Ko.box,(t-this.rotation+360)%360),path:{d:e.toSVGPath()}}),this.parent.drawLayer.updateProperties(this.#Xo,{bbox:id.#ni(this.#Ho.box,t),path:{d:this.#Ho.toSVGPath()}})}const[a,r,o,i]=e.box;switch(this.rotation){case 0:this.x=a,this.y=r,this.width=o,this.height=i;break;case 90:{const[e,t]=this.parentDimensions;this.x=r,this.y=1-a,this.width=o*t/e,this.height=i*e/t;break}case 180:this.x=1-a,this.y=1-r,this.width=o,this.height=i;break;case 270:{const[e,t]=this.parentDimensions;this.x=1-r,this.y=a,this.width=o*t/e,this.height=i*e/t;break}}const{lastPoint:s}=this.#Ho;this.#bo=[(s[0]-a)/o,(s[1]-r)/i]}static initialize(e,t){ps.initialize(e,t),id._defaultColor||=t.highlightColors?.values().next().value||"#bfdbfe"}static updateDefaultParams(e,t){switch(e){case Ao.HIGHLIGHT_DEFAULT_COLOR:id._defaultColor=t;break;case Ao.HIGHLIGHT_THICKNESS:id._defaultThickness=t}}translateInPage(e,t){}get toolbarPosition(){return this.#bo}updateParams(e,t){switch(e){case Ao.HIGHLIGHT_COLOR:this.#Lr(t);break;case Ao.HIGHLIGHT_THICKNESS:this.#ai(t)}}static get defaultPropertiesToUpdate(){return[[Ao.HIGHLIGHT_DEFAULT_COLOR,id._defaultColor],[Ao.HIGHLIGHT_THICKNESS,id._defaultThickness]]}get propertiesToUpdate(){return[[Ao.HIGHLIGHT_COLOR,this.color||id._defaultColor],[Ao.HIGHLIGHT_THICKNESS,this.#to||id._defaultThickness],[Ao.HIGHLIGHT_FREE,this.#$o]]}#Lr(e){const t=(e,t)=>{this.color=e,this.#Yo=t,this.parent?.drawLayer.updateProperties(this.#y,{root:{fill:e,"fill-opacity":t}}),this.#r?.updateColor(e)},n=this.color,a=this.#Yo;this.addCommands({cmd:t.bind(this,e,id._defaultOpacity),undo:t.bind(this,n,a),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ao.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(e)},!0)}#ai(e){const t=this.#to,n=e=>{this.#to=e,this.#ri(e)};this.addCommands({cmd:n.bind(this,e),undo:n.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Ao.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)}async addEditToolbar(){const e=await super.addEditToolbar();return e?(this._uiManager.highlightColors&&(this.#r=new od({editor:this}),e.addColorPicker(this.#r)),e):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#oi())}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,this.#oi())}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this.#ii(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#ei(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?this.#ii():e&&(this.#ei(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),t&&this.select()}#ri(e){if(!this.#$o)return;this.#Zo({highlightOutlines:this.#Ko.getNewOutline(e/2)}),this.fixAndSetPosition();const[t,n]=this.parentDimensions;this.setDims(this.width*t,this.height*n)}#ii(){null!==this.#y&&this.parent&&(this.parent.drawLayer.remove(this.#y),this.#y=null,this.parent.drawLayer.remove(this.#Xo),this.#Xo=null)}#ei(e=this.parent){null===this.#y&&(({id:this.#y,clipPathId:this.#qo}=e.drawLayer.draw({bbox:this.#Ko.box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.#Yo},rootClass:{highlight:!0,free:this.#$o},path:{d:this.#Ko.toSVGPath()}},!1,!0)),this.#Xo=e.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:this.#$o},bbox:this.#Ho.box,path:{d:this.#Ho.toSVGPath()}},this.#$o),this.#Go&&(this.#Go.style.clipPath=this.#qo))}static#ni([e,t,n,a],r){switch(r){case 90:return[1-t-a,e,a,n];case 180:return[1-e-n,1-t-a,n,a];case 270:return[t,1-e-n,a,n]}return[e,t,n,a]}rotate(e){const{drawLayer:t}=this.parent;let n;this.#$o?(e=(e-this.rotation+360)%360,n=id.#ni(this.#Ko.box,e)):n=id.#ni([this.x,this.y,this.width,this.height],e),t.updateProperties(this.#y,{bbox:n,root:{"data-main-rotation":e}}),t.updateProperties(this.#Xo,{bbox:id.#ni(this.#Ho.box,e),root:{"data-main-rotation":e}})}render(){if(this.div)return this.div;const e=super.render();this.#Jo&&(e.setAttribute("aria-label",this.#Jo),e.setAttribute("role","mark")),this.#$o?e.classList.add("free"):this.div.addEventListener("keydown",this.#si.bind(this),{signal:this._uiManager._signal});const t=this.#Go=document.createElement("div");e.append(t),t.setAttribute("aria-hidden","true"),t.className="internal",t.style.clipPath=this.#qo;const[n,a]=this.parentDimensions;return this.setDims(this.width*n,this.height*a),as(this,this.#Go,["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#Xo,{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(this.#Xo,{rootClass:{hovered:!1}})}#si(e){id._keyboardManager.exec(this,e)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#li(!0);break;case 1:case 3:this.#li(!1)}}#li(e){if(!this.#zo)return;const t=window.getSelection();e?t.setPosition(this.#zo,this.#Oo):t.setPosition(this.#jo,this.#Vo)}select(){super.select(),this.#Xo&&this.parent?.drawLayer.updateProperties(this.#Xo,{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),this.#Xo&&(this.parent?.drawLayer.updateProperties(this.#Xo,{rootClass:{selected:!1}}),this.#$o||this.#li(!1))}get _mustFixPosition(){return!this.#$o}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.updateProperties(this.#y,{rootClass:{hidden:!e}}),this.parent.drawLayer.updateProperties(this.#Xo,{rootClass:{hidden:!e}}))}#oi(){return this.#$o?this.rotation:0}#ci(){if(this.#$o)return null;const[e,t]=this.pageDimensions,[n,a]=this.pageTranslation,r=this.#Wo,o=new Float32Array(8*r.length);let i=0;for(const{x:s,y:l,width:c,height:d}of r){const r=s*e+n,m=(1-l)*t+a;o[i]=o[i+4]=r,o[i+1]=o[i+3]=m,o[i+2]=o[i+6]=r+c*e,o[i+5]=o[i+7]=m-d*t,i+=8}return o}#di(e){return this.#Ko.serialize(e,this.#oi())}static startHighlighting(e,t,{target:n,x:a,y:r}){const{x:o,y:i,width:s,height:l}=n.getBoundingClientRect(),c=new AbortController,d=e.combinedSignal(c),m=t=>{c.abort(),this.#mi(e,t)};window.addEventListener("blur",m,{signal:d}),window.addEventListener("pointerup",m,{signal:d}),window.addEventListener("pointerdown",Ki,{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",Gi,{signal:d}),n.addEventListener("pointermove",this.#pi.bind(this,e),{signal:d}),this._freeHighlight=new ad({x:a,y:r},[o,i,s,l],e.scale,this._defaultThickness/2,t,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0))}static#pi(e,t){this._freeHighlight.add(t)&&e.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})}static#mi(e,t){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(t,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(e,t,n){let a=null;if(e instanceof Hc){const{data:{quadPoints:t,rect:n,rotation:r,id:o,color:i,opacity:s,popupRef:l},parent:{page:{pageNumber:c}}}=e;a=e={annotationType:To.HIGHLIGHT,color:Array.from(i),opacity:s,quadPoints:t,boxes:null,pageIndex:c-1,rect:n.slice(0),rotation:r,id:o,deleted:!1,popupRef:l}}else if(e instanceof qc){const{data:{inkLists:t,rect:n,rotation:r,id:o,color:i,borderStyle:{rawWidth:s},popupRef:l},parent:{page:{pageNumber:c}}}=e;a=e={annotationType:To.HIGHLIGHT,color:Array.from(i),thickness:s,inkLists:t,boxes:null,pageIndex:c-1,rect:n.slice(0),rotation:r,id:o,deleted:!1,popupRef:l}}const{color:r,quadPoints:o,inkLists:i,opacity:s}=e,l=await super.deserialize(e,t,n);l.color=Ni.makeHexColor(...r),l.#Yo=s||1,i&&(l.#to=e.thickness),l.annotationElementId=e.id||null,l._initialData=a;const[c,d]=l.pageDimensions,[m,p]=l.pageTranslation;if(o){const e=l.#Wo=[];for(let t=0;t<o.length;t+=8)e.push({x:(o[t]-m)/c,y:1-(o[t+1]-p)/d,width:(o[t+2]-o[t])/c,height:(o[t+1]-o[t+5])/d});l.#ti(),l.#ei(),l.rotate(l.rotation)}else if(i){l.#$o=!0;const e=i[0],n={x:e[0]-m,y:d-(e[1]-p)},a=new ad(n,[0,0,c,d],1,l.#to/2,!0,.001);for(let t=0,r=e.length;t<r;t+=2)n.x=e[t]-m,n.y=d-(e[t+1]-p),a.add(n);const{id:r,clipPathId:o}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:l.color,"fill-opacity":l._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:a.toSVGPath()}},!0,!0);l.#Zo({highlightOutlines:a.getOutlines(),highlightId:r,clipPathId:o}),l.#ei()}return l}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();const t=this.getRect(0,0),n=ps._colorManager.convert(this.color),a={annotationType:To.HIGHLIGHT,color:n,opacity:this.#Yo,thickness:this.#to,quadPoints:this.#ci(),outlines:this.#di(t),pageIndex:this.pageIndex,rect:t,rotation:this.#oi(),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!this.#Hr(a)?null:(a.id=this.annotationElementId,a)}#Hr(e){const{color:t}=this._initialData;return e.color.some((e,n)=>e!==t[n])}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class sd{#ui=Object.create(null);updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(const[t,n]of Object.entries(e))this.updateProperty(t,n)}updateSVGProperty(e,t){this.#ui[e]=t}toSVGProperties(){const e=this.#ui;return this.#ui=Object.create(null),{root:e}}reset(){this.#ui=Object.create(null)}updateAll(e=this){this.updateProperties(e)}clone(){ui("Not implemented")}}class ld extends ps{#gi=null;#hi;_drawId=null;static _currentDrawId=-1;static _currentParent=null;static#bi=null;static#fi=null;static#vi=null;static#yi=NaN;static#xi=null;static#wi=null;static#ki=NaN;static _INNER_MARGIN=3;constructor(e){super(e),this.#hi=e.mustBeCommitted||!1,e.drawOutlines&&(this.#Ei(e),this.#ei())}#Ei({drawOutlines:e,drawId:t,drawingOptions:n}){this.#gi=e,this._drawingOptions||=n,t>=0?(this._drawId=t,this.parent.drawLayer.finalizeDraw(t,e.defaultProperties)):this._drawId=this.#Si(e,this.parent),this.#Ci(e.box)}#Si(e,t){const{id:n}=t.drawLayer.draw(ld._mergeSVGProperties(this._drawingOptions.toSVGProperties(),e.defaultSVGProperties),!1,!1);return n}static _mergeSVGProperties(e,t){const n=new Set(Object.keys(e));for(const[a,r]of Object.entries(t))n.has(a)?Object.assign(e[a],r):e[a]=r;return e}static getDefaultDrawingOptions(e){ui("Not implemented")}static get typesMap(){ui("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(e,t){const n=this.typesMap.get(e);n&&this._defaultDrawingOptions.updateProperty(n,t),this._currentParent&&(ld.#bi.updateProperty(n,t),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,t){const n=this.constructor.typesMap.get(e);n&&this._updateProperty(e,n,t)}static get defaultPropertiesToUpdate(){const e=[],t=this._defaultDrawingOptions;for(const[n,a]of this.typesMap)e.push([n,t[a]]);return e}get propertiesToUpdate(){const e=[],{_drawingOptions:t}=this;for(const[n,a]of this.constructor.typesMap)e.push([n,t[a]]);return e}_updateProperty(e,t,n){const a=this._drawingOptions,r=a[t],o=e=>{a.updateProperty(t,e);const n=this.#gi.updateProperty(t,e);n&&this.#Ci(n),this.parent?.drawLayer.updateProperties(this._drawId,a.toSVGProperties())};this.addCommands({cmd:o.bind(this,n),undo:o.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,ld._mergeSVGProperties(this.#gi.getPathResizingSVGProperties(this.#Ti()),{bbox:this.#Ai()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,ld._mergeSVGProperties(this.#gi.getPathResizedSVGProperties(this.#Ti()),{bbox:this.#Ai()}))}_onTranslating(e,t){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#Ai(e,t)})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,ld._mergeSVGProperties(this.#gi.getPathTranslatedSVGProperties(this.#Ti(),this.parentDimensions),{bbox:this.#Ai()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#hi&&(this.#hi=!1,this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){this.#ii(),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#ei(),this.#Ci(this.#gi.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),this.#ii()):e&&(this._uiManager.addShouldRescale(this),this.#ei(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),t&&this.select()}#ii(){null!==this._drawId&&this.parent&&(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())}#ei(e=this.parent){null!==this._drawId&&this.parent===e||(null===this._drawId?(this._drawingOptions.updateAll(),this._drawId=this.#Si(this.#gi,e)):this.parent.drawLayer.updateParent(this._drawId,e.drawLayer))}#Di([e,t,n,a]){const{parentDimensions:[r,o],rotation:i}=this;switch(i){case 90:return[t,1-e,n*(o/r),a*(r/o)];case 180:return[1-e,1-t,n,a];case 270:return[1-t,e,n*(o/r),a*(r/o)];default:return[e,t,n,a]}}#Ti(){const{x:e,y:t,width:n,height:a,parentDimensions:[r,o],rotation:i}=this;switch(i){case 90:return[1-t,e,n*(r/o),a*(o/r)];case 180:return[1-e,1-t,n,a];case 270:return[t,1-e,n*(r/o),a*(o/r)];default:return[e,t,n,a]}}#Ci(e){if([this.x,this.y,this.width,this.height]=this.#Di(e),this.div){this.fixAndSetPosition();const[e,t]=this.parentDimensions;this.setDims(this.width*e,this.height*t)}this._onResized()}#Ai(){const{x:e,y:t,width:n,height:a,rotation:r,parentRotation:o,parentDimensions:[i,s]}=this;switch((4*r+o)/90){case 1:return[1-t-a,e,a,n];case 2:return[1-e-n,1-t-a,n,a];case 3:return[t,1-e-n,a,n];case 4:return[e,t-n*(i/s),a*(s/i),n*(i/s)];case 5:return[1-t,e,n*(i/s),a*(s/i)];case 6:return[1-e-a*(s/i),1-t,a*(s/i),n*(i/s)];case 7:return[t-n*(i/s),1-e-a*(s/i),n*(i/s),a*(s/i)];case 8:return[e-n,t-a,n,a];case 9:return[1-t,e-n,a,n];case 10:return[1-e,1-t,n,a];case 11:return[t-a,1-e,a,n];case 12:return[e-a*(s/i),t,a*(s/i),n*(i/s)];case 13:return[1-t-n*(i/s),e-a*(s/i),n*(i/s),a*(s/i)];case 14:return[1-e,1-t-n*(i/s),a*(s/i),n*(i/s)];case 15:return[t,1-e,n*(i/s),a*(s/i)];default:return[e,t,n,a]}}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,ld._mergeSVGProperties({bbox:this.#Ai()},this.#gi.updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&this.#Ci(this.#gi.updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;const e=super.render();e.classList.add("draw");const t=document.createElement("div");e.append(t),t.setAttribute("aria-hidden","true"),t.className="internal";const[n,a]=this.parentDimensions;return this.setDims(this.width*n,this.height*a),this._uiManager.addShouldRescale(this),this.disableEditing(),e}static createDrawerInstance(e,t,n,a,r){ui("Not implemented")}static startDrawing(e,t,n,a){const{target:r,offsetX:o,offsetY:i,pointerId:s,pointerType:l}=a;if(ld.#xi&&ld.#xi!==l)return;const{viewport:{rotation:c}}=e,{width:d,height:m}=r.getBoundingClientRect(),p=ld.#fi=new AbortController,u=e.combinedSignal(p);ld.#yi||=s,ld.#xi??=l,window.addEventListener("pointerup",e=>{ld.#yi===e.pointerId?this._endDraw(e):ld.#wi?.delete(e.pointerId)},{signal:u}),window.addEventListener("pointercancel",e=>{ld.#yi===e.pointerId?this._currentParent.endDrawingSession():ld.#wi?.delete(e.pointerId)},{signal:u}),window.addEventListener("pointerdown",e=>{ld.#xi===e.pointerType&&((ld.#wi||=new Set).add(e.pointerId),ld.#bi.isCancellable()&&(ld.#bi.removeLastElement(),ld.#bi.isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:u}),window.addEventListener("contextmenu",Gi,{signal:u}),r.addEventListener("pointermove",this._drawMove.bind(this),{signal:u}),r.addEventListener("touchmove",e=>{e.timeStamp===ld.#ki&&Ki(e)},{signal:u}),e.toggleDrawing(),t._editorUndoBar?.hide(),ld.#bi?e.drawLayer.updateProperties(this._currentDrawId,ld.#bi.startNew(o,i,d,m,c)):(t.updateUIForDefaultProperties(this),ld.#bi=this.createDrawerInstance(o,i,d,m,c),ld.#vi=this.getDefaultDrawingOptions(),this._currentParent=e,({id:this._currentDrawId}=e.drawLayer.draw(this._mergeSVGProperties(ld.#vi.toSVGProperties(),ld.#bi.defaultSVGProperties),!0,!1)))}static _drawMove(e){if(ld.#ki=-1,!ld.#bi)return;const{offsetX:t,offsetY:n,pointerId:a}=e;ld.#yi===a&&(ld.#wi?.size>=1?this._endDraw(e):(this._currentParent.drawLayer.updateProperties(this._currentDrawId,ld.#bi.add(t,n)),ld.#ki=e.timeStamp,Ki(e)))}static _cleanup(e){e&&(this._currentDrawId=-1,this._currentParent=null,ld.#bi=null,ld.#vi=null,ld.#xi=null,ld.#ki=NaN),ld.#fi&&(ld.#fi.abort(),ld.#fi=null,ld.#yi=NaN,ld.#wi=null)}static _endDraw(e){const t=this._currentParent;if(t){if(t.toggleDrawing(!0),this._cleanup(!1),e&&t.drawLayer.updateProperties(this._currentDrawId,ld.#bi.end(e.offsetX,e.offsetY)),this.supportMultipleDrawings){const e=ld.#bi,n=this._currentDrawId,a=e.getLastElement();return void t.addCommands({cmd:()=>{t.drawLayer.updateProperties(n,e.setLastElement(a))},undo:()=>{t.drawLayer.updateProperties(n,e.removeLastElement())},mustExec:!1,type:Ao.DRAW_STEP})}this.endDrawing(!1)}}static endDrawing(e){const t=this._currentParent;if(!t)return null;if(t.toggleDrawing(!0),t.cleanUndoStack(Ao.DRAW_STEP),!ld.#bi.isEmpty()){const{pageDimensions:[n,a],scale:r}=t,o=t.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:ld.#bi.getOutlines(n*r,a*r,r,this._INNER_MARGIN),drawingOptions:ld.#vi,mustBeCommitted:!e});return this._cleanup(!0),o}return t.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,t,n,a,r,o){ui("Not implemented")}static async deserialize(e,t,n){const{rawDims:{pageWidth:a,pageHeight:r,pageX:o,pageY:i}}=t.viewport,s=this.deserializeDraw(o,i,a,r,this._INNER_MARGIN,e),l=await super.deserialize(e,t,n);return l.createDrawingOptions(e),l.#Ei({drawOutlines:s}),l.#ei(),l.onScaleChanging(),l.rotate(),l}serializeDraw(e){const[t,n]=this.pageTranslation,[a,r]=this.pageDimensions;return this.#gi.serialize([t,n,a,r],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class cd{#Yr=new Float64Array(6);#fr;#_i;#Bn;#to;#no;#Ni="";#Mi=0;#So=new dd;#Ii;#Ri;constructor(e,t,n,a,r,o){this.#Ii=n,this.#Ri=a,this.#Bn=r,this.#to=o,[e,t]=this.#Bi(e,t);const i=this.#fr=[NaN,NaN,NaN,NaN,e,t];this.#no=[e,t],this.#_i=[{line:i,points:this.#no}],this.#Yr.set(i,0)}updateProperty(e,t){"stroke-width"===e&&(this.#to=t)}#Bi(e,t){return Qc._normalizePoint(e,t,this.#Ii,this.#Ri,this.#Bn)}isEmpty(){return!this.#_i||0===this.#_i.length}isCancellable(){return this.#no.length<=10}add(e,t){[e,t]=this.#Bi(e,t);const[n,a,r,o]=this.#Yr.subarray(2,6),i=e-r,s=t-o;return Math.hypot(this.#Ii*i,this.#Ri*s)<=2?null:(this.#no.push(e,t),isNaN(n)?(this.#Yr.set([r,o,e,t],2),this.#fr.push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(this.#Yr[0])&&this.#fr.splice(6,6),this.#Yr.set([n,a,r,o,e,t],0),this.#fr.push(...Qc.createBezierPoints(n,a,r,o,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){const n=this.add(e,t);return n||(2===this.#no.length?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,n,a,r){this.#Ii=n,this.#Ri=a,this.#Bn=r,[e,t]=this.#Bi(e,t);const o=this.#fr=[NaN,NaN,NaN,NaN,e,t];this.#no=[e,t];const i=this.#_i.at(-1);return i&&(i.line=new Float32Array(i.line),i.points=new Float32Array(i.points)),this.#_i.push({line:o,points:this.#no}),this.#Yr.set(o,0),this.#Mi=0,this.toSVGPath(),null}getLastElement(){return this.#_i.at(-1)}setLastElement(e){return this.#_i?(this.#_i.push(e),this.#fr=e.line,this.#no=e.points,this.#Mi=0,{path:{d:this.toSVGPath()}}):this.#So.setLastElement(e)}removeLastElement(){if(!this.#_i)return this.#So.removeLastElement();this.#_i.pop(),this.#Ni="";for(let e=0,t=this.#_i.length;e<t;e++){const{line:t,points:n}=this.#_i[e];this.#fr=t,this.#no=n,this.#Mi=0,this.toSVGPath()}return{path:{d:this.#Ni}}}toSVGPath(){const e=Qc.svgRound(this.#fr[4]),t=Qc.svgRound(this.#fr[5]);if(2===this.#no.length)return this.#Ni=`${this.#Ni} M ${e} ${t} Z`,this.#Ni;if(this.#no.length<=6){const n=this.#Ni.lastIndexOf("M");this.#Ni=`${this.#Ni.slice(0,n)} M ${e} ${t}`,this.#Mi=6}if(4===this.#no.length){const e=Qc.svgRound(this.#fr[10]),t=Qc.svgRound(this.#fr[11]);return this.#Ni=`${this.#Ni} L ${e} ${t}`,this.#Mi=12,this.#Ni}const n=[];0===this.#Mi&&(n.push(`M ${e} ${t}`),this.#Mi=6);for(let e=this.#Mi,t=this.#fr.length;e<t;e+=6){const[t,a,r,o,i,s]=this.#fr.slice(e,e+6).map(Qc.svgRound);n.push(`C${t} ${a} ${r} ${o} ${i} ${s}`)}return this.#Ni+=n.join(" "),this.#Mi=this.#fr.length,this.#Ni}getOutlines(e,t,n,a){const r=this.#_i.at(-1);return r.line=new Float32Array(r.line),r.points=new Float32Array(r.points),this.#So.build(this.#_i,e,t,n,this.#Bn,this.#to,a),this.#Yr=null,this.#fr=null,this.#_i=null,this.#Ni=null,this.#So}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}}class dd extends Qc{#uo;#Pi=0;#Gr;#_i;#Ii;#Ri;#Li;#Bn;#to;build(e,t,n,a,r,o,i){this.#Ii=t,this.#Ri=n,this.#Li=a,this.#Bn=r,this.#to=o,this.#Gr=i??0,this.#_i=e,this.#Ui()}setLastElement(e){return this.#_i.push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#_i.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){const e=[];for(const{line:t}of this.#_i)if(e.push(`M${Qc.svgRound(t[4])} ${Qc.svgRound(t[5])}`),6!==t.length)if(12!==t.length)for(let n=6,a=t.length;n<a;n+=6){const[a,r,o,i,s,l]=t.subarray(n,n+6).map(Qc.svgRound);e.push(`C${a} ${r} ${o} ${i} ${s} ${l}`)}else e.push(`L${Qc.svgRound(t[10])} ${Qc.svgRound(t[11])}`);else e.push("Z");return e.join("")}serialize([e,t,n,a],r){const o=[],i=[],[s,l,c,d]=this.#Fi();let m,p,u,g,h,b,f,v,y;switch(this.#Bn){case 0:y=Qc._rescale,m=e,p=t+a,u=n,g=-a,h=e+s*n,b=t+(1-l-d)*a,f=e+(s+c)*n,v=t+(1-l)*a;break;case 90:y=Qc._rescaleAndSwap,m=e,p=t,u=n,g=a,h=e+l*n,b=t+s*a,f=e+(l+d)*n,v=t+(s+c)*a;break;case 180:y=Qc._rescale,m=e+n,p=t,u=-n,g=a,h=e+(1-s-c)*n,b=t+l*a,f=e+(1-s)*n,v=t+(l+d)*a;break;case 270:y=Qc._rescaleAndSwap,m=e+n,p=t+a,u=-n,g=-a,h=e+(1-l-d)*n,b=t+(1-s-c)*a,f=e+(1-l)*n,v=t+(1-s)*a}for(const{line:e,points:t}of this.#_i)o.push(y(e,m,p,u,g,r?new Array(e.length):null)),i.push(y(t,m,p,u,g,r?new Array(t.length):null));return{lines:o,points:i,rect:[h,b,f,v]}}static deserialize(e,t,n,a,r,{paths:{lines:o,points:i},rotation:s,thickness:l}){const c=[];let d,m,p,u,g;switch(s){case 0:g=Qc._rescale,d=-e/n,m=t/a+1,p=1/n,u=-1/a;break;case 90:g=Qc._rescaleAndSwap,d=-t/a,m=-e/n,p=1/a,u=1/n;break;case 180:g=Qc._rescale,d=e/n+1,m=-t/a,p=-1/n,u=1/a;break;case 270:g=Qc._rescaleAndSwap,d=t/a+1,m=e/n+1,p=-1/a,u=-1/n}if(!o){o=[];for(const e of i){const t=e.length;if(2===t){o.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1]]));continue}if(4===t){o.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1],NaN,NaN,NaN,NaN,e[2],e[3]]));continue}const n=new Float32Array(3*(t-2));o.push(n);let[a,r,i,s]=e.subarray(0,4);n.set([NaN,NaN,NaN,NaN,a,r],0);for(let o=4;o<t;o+=2){const t=e[o],l=e[o+1];n.set(Qc.createBezierPoints(a,r,i,s,t,l),3*(o-2)),[a,r,i,s]=[i,s,t,l]}}}for(let e=0,t=o.length;e<t;e++)c.push({line:g(o[e].map(e=>e??NaN),d,m,p,u),points:g(i[e].map(e=>e??NaN),d,m,p,u)});const h=new dd;return h.build(c,n,a,1,s,l,r),h}#zi(e=this.#to){const t=this.#Gr+e/2*this.#Li;return this.#Bn%180==0?[t/this.#Ii,t/this.#Ri]:[t/this.#Ri,t/this.#Ii]}#Fi(){const[e,t,n,a]=this.#uo,[r,o]=this.#zi(0);return[e+r,t+o,n-2*r,a-2*o]}#Ui(){const e=this.#uo=new Float32Array([1/0,1/0,-1/0,-1/0]);for(const{line:t}of this.#_i){if(t.length<=12){for(let n=4,a=t.length;n<a;n+=6){const[a,r]=t.subarray(n,n+2);e[0]=Math.min(e[0],a),e[1]=Math.min(e[1],r),e[2]=Math.max(e[2],a),e[3]=Math.max(e[3],r)}continue}let n=t[4],a=t[5];for(let r=6,o=t.length;r<o;r+=6){const[o,i,s,l,c,d]=t.subarray(r,r+6);Ni.bezierBoundingBox(n,a,o,i,s,l,c,d,e),n=c,a=d}}const[t,n]=this.#zi();e[0]=Math.min(1,Math.max(0,e[0]-t)),e[1]=Math.min(1,Math.max(0,e[1]-n)),e[2]=Math.min(1,Math.max(0,e[2]+t)),e[3]=Math.min(1,Math.max(0,e[3]+n)),e[2]-=e[0],e[3]-=e[1]}get box(){return this.#uo}updateProperty(e,t){return"stroke-width"===e?this.#ai(t):null}#ai(e){const[t,n]=this.#zi();this.#to=e;const[a,r]=this.#zi(),[o,i]=[a-t,r-n],s=this.#uo;return s[0]-=o,s[1]-=i,s[2]+=2*o,s[3]+=2*i,s}updateParentDimensions([e,t],n){const[a,r]=this.#zi();this.#Ii=e,this.#Ri=t,this.#Li=n;const[o,i]=this.#zi(),s=o-a,l=i-r,c=this.#uo;return c[0]-=s,c[1]-=l,c[2]+=2*s,c[3]+=2*l,c}updateRotation(e){return this.#Pi=e,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#uo.map(Qc.svgRound).join(" ")}get defaultProperties(){const[e,t]=this.#uo;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Qc.svgRound(e)} ${Qc.svgRound(t)}`}}}get rotationTransform(){const[,,e,t]=this.#uo;let n=0,a=0,r=0,o=0,i=0,s=0;switch(this.#Pi){case 90:a=t/e,r=-e/t,i=e;break;case 180:n=-1,o=-1,i=e,s=t;break;case 270:a=-t/e,r=e/t,s=t;break;default:return""}return`matrix(${n} ${a} ${r} ${o} ${Qc.svgRound(i)} ${Qc.svgRound(s)})`}getPathResizingSVGProperties([e,t,n,a]){const[r,o]=this.#zi(),[i,s,l,c]=this.#uo;if(Math.abs(l-r)<=Qc.PRECISION||Math.abs(c-o)<=Qc.PRECISION){const r=e+n/2-(i+l/2),o=t+a/2-(s+c/2);return{path:{"transform-origin":`${Qc.svgRound(e)} ${Qc.svgRound(t)}`,transform:`${this.rotationTransform} translate(${r} ${o})`}}}const d=(n-2*r)/(l-2*r),m=(a-2*o)/(c-2*o),p=l/n,u=c/a;return{path:{"transform-origin":`${Qc.svgRound(i)} ${Qc.svgRound(s)}`,transform:`${this.rotationTransform} scale(${p} ${u}) translate(${Qc.svgRound(r)} ${Qc.svgRound(o)}) scale(${d} ${m}) translate(${Qc.svgRound(-r)} ${Qc.svgRound(-o)})`}}}getPathResizedSVGProperties([e,t,n,a]){const[r,o]=this.#zi(),i=this.#uo,[s,l,c,d]=i;if(i[0]=e,i[1]=t,i[2]=n,i[3]=a,Math.abs(c-r)<=Qc.PRECISION||Math.abs(d-o)<=Qc.PRECISION){const r=e+n/2-(s+c/2),o=t+a/2-(l+d/2);for(const{line:e,points:t}of this.#_i)Qc._translate(e,r,o,e),Qc._translate(t,r,o,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Qc.svgRound(e)} ${Qc.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}const m=(n-2*r)/(c-2*r),p=(a-2*o)/(d-2*o),u=-m*(s+r)+e+r,g=-p*(l+o)+t+o;if(1!==m||1!==p||0!==u||0!==g)for(const{line:e,points:t}of this.#_i)Qc._rescale(e,u,g,m,p,e),Qc._rescale(t,u,g,m,p,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${Qc.svgRound(e)} ${Qc.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,t],n){const[a,r]=n,o=this.#uo,i=e-o[0],s=t-o[1];if(this.#Ii===a&&this.#Ri===r)for(const{line:e,points:t}of this.#_i)Qc._translate(e,i,s,e),Qc._translate(t,i,s,t);else{const e=this.#Ii/a,t=this.#Ri/r;this.#Ii=a,this.#Ri=r;for(const{line:n,points:a}of this.#_i)Qc._rescale(n,i,s,e,t,n),Qc._rescale(a,i,s,e,t,a);o[2]*=e,o[3]*=t}return o[0]=e,o[1]=t,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${Qc.svgRound(e)} ${Qc.svgRound(t)}`}}}get defaultSVGProperties(){const e=this.#uo;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${Qc.svgRound(e[0])} ${Qc.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}}class md extends sd{#Oi;constructor(e){super(),this.#Oi=e,super.updateProperties({fill:"none",stroke:ps._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,t){"stroke-width"===e&&(t??=this["stroke-width"],t*=this.#Oi.realScale),super.updateSVGProperty(e,t)}clone(){const e=new md(this.#Oi);return e.updateAll(this),e}}class pd extends ld{static _type="ink";static _editorType=To.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:"inkEditor"}),this._willKeepAspectRatio=!0}static initialize(e,t){ps.initialize(e,t),this._defaultDrawingOptions=new md(t.viewParameters)}static getDefaultDrawingOptions(e){const t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return bi(this,"typesMap",new Map([[Ao.INK_THICKNESS,"stroke-width"],[Ao.INK_COLOR,"stroke"],[Ao.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(e,t,n,a,r){return new cd(e,t,n,a,r,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(e,t,n,a,r,o){return dd.deserialize(e,t,n,a,r,o)}static async deserialize(e,t,n){let a=null;if(e instanceof qc){const{data:{inkLists:t,rect:n,rotation:r,id:o,color:i,opacity:s,borderStyle:{rawWidth:l},popupRef:c},parent:{page:{pageNumber:d}}}=e;a=e={annotationType:To.INK,color:Array.from(i),thickness:l,opacity:s,paths:{points:t},boxes:null,pageIndex:d-1,rect:n.slice(0),rotation:r,id:o,deleted:!1,popupRef:c}}const r=await super.deserialize(e,t,n);return r.annotationElementId=e.id||null,r._initialData=a,r}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();const{_drawId:e,_drawingOptions:t,parent:n}=this;t.updateSVGProperty("stroke-width"),n.drawLayer.updateProperties(e,t.toSVGProperties())}static onScaleChangingWhenDrawing(){const e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:e,thickness:t,opacity:n}){this._drawingOptions=pd.getDefaultDrawingOptions({stroke:Ni.makeHexColor(...e),"stroke-width":t,"stroke-opacity":n})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const{lines:t,points:n,rect:a}=this.serializeDraw(e),{_drawingOptions:{stroke:r,"stroke-opacity":o,"stroke-width":i}}=this,s={annotationType:To.INK,color:ps._colorManager.convert(r),opacity:o,thickness:i,paths:{lines:t,points:n},pageIndex:this.pageIndex,rect:a,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?s:this.annotationElementId&&!this.#Hr(s)?null:(s.id=this.annotationElementId,s)}#Hr(e){const{color:t,thickness:n,opacity:a,pageIndex:r}=this._initialData;return this._hasBeenMoved||this._hasBeenResized||e.color.some((e,n)=>e!==t[n])||e.thickness!==n||e.opacity!==a||e.pageIndex!==r}renderAnnotationElement(e){const{points:t,rect:n}=this.serializeDraw(!1);return e.updateEdited({rect:n,thickness:this._drawingOptions["stroke-width"],points:t}),null}}class ud extends ps{#Wi=null;#qi=null;#Hi=null;#ji=null;#Vi=null;#Gi="";#Ki=null;#$i=null;#Yi=!1;#Xi=!1;static _type="stamp";static _editorType=To.STAMP;constructor(e){super({...e,name:"stampEditor"}),this.#ji=e.bitmapUrl,this.#Vi=e.bitmapFile}static initialize(e,t){ps.initialize(e,t)}static get supportedTypes(){return bi(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(e=>`image/${e}`))}static get supportedTypesStr(){return bi(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,t){t.pasteEditor(To.STAMP,{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){const t=e.get("hasAltText");return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}#Ji(e,t=!1){e?(this.#Wi=e.bitmap,t||(this.#qi=e.id,this.#Yi=e.isSvg),e.file&&(this.#Gi=e.file.name),this.#Qi()):this.remove()}#Zi(){if(this.#Hi=null,this._uiManager.enableWaiting(!1),this.#Ki){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#Wi)return this._editToolbar.hide(),void this._uiManager.editAltText(this,!0);if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#Wi){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(e=null,t=!0){if(this.hasAltTextData())return null;const{mlManager:n}=this._uiManager;if(!n)throw new Error("No ML.");if(!await n.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:a,width:r,height:o}=e||this.copyCanvas(null,null,!0).imageData,i=await n.guess({name:"altText",request:{data:a,width:r,height:o,channels:a.length/(r*o)}});if(!i)throw new Error("No response from the AI service.");if(i.error)throw new Error("Error from the AI service.");if(i.cancel)return null;if(!i.output)throw new Error("No valid response from the AI service.");const s=i.output;return await this.setGuessedAltText(s),t&&!this.hasAltTextData()&&(this.altTextData={alt:s,decorative:!1}),s}#es(){if(this.#qi)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#qi).then(e=>this.#Ji(e,!0)).finally(()=>this.#Zi());if(this.#ji){const e=this.#ji;return this.#ji=null,this._uiManager.enableWaiting(!0),void(this.#Hi=this._uiManager.imageManager.getFromUrl(e).then(e=>this.#Ji(e)).finally(()=>this.#Zi()))}if(this.#Vi){const e=this.#Vi;return this.#Vi=null,this._uiManager.enableWaiting(!0),void(this.#Hi=this._uiManager.imageManager.getFromFile(e).then(e=>this.#Ji(e)).finally(()=>this.#Zi()))}const e=document.createElement("input");e.type="file",e.accept=ud.supportedTypesStr;const t=this._uiManager._signal;this.#Hi=new Promise(n=>{e.addEventListener("change",async()=>{if(e.files&&0!==e.files.length){this._uiManager.enableWaiting(!0);const t=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#Ji(t)}else this.remove();n()},{signal:t}),e.addEventListener("cancel",()=>{this.remove(),n()},{signal:t})}).finally(()=>this.#Zi()),e.click()}remove(){this.#qi&&(this.#Wi=null,this._uiManager.imageManager.deleteId(this.#qi),this.#Ki?.remove(),this.#Ki=null,this.#$i&&(clearTimeout(this.#$i),this.#$i=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#qi&&null===this.#Ki&&this.#es(),this.isAttachedToDOM||this.parent.add(this))):this.#qi&&this.#es()}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(this.#Hi||this.#Wi||this.#ji||this.#Vi||this.#qi)}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;if(this.width&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.div.setAttribute("role","figure"),this.addAltTextButton(),this.#Wi?this.#Qi():this.#es(),this.width&&!this.annotationElementId){const[n,a]=this.parentDimensions;this.setAt(e*n,t*a,this.width*n,this.height*a)}return this._uiManager.addShouldRescale(this),this.div}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;null!==this.#$i&&clearTimeout(this.#$i);this.#$i=setTimeout(()=>{this.#$i=null,this.#ts()},200)}#Qi(){const{div:e}=this;let{width:t,height:n}=this.#Wi;const[a,r]=this.pageDimensions,o=.75;if(this.width)t=this.width*a,n=this.height*r;else if(t>o*a||n>o*r){const e=Math.min(o*a/t,o*r/n);t*=e,n*=e}const[i,s]=this.parentDimensions;this.setDims(t*i/a,n*s/r),this._uiManager.enableWaiting(!1);const l=this.#Ki=document.createElement("canvas");l.setAttribute("role","img"),this.addContainer(l),this.width=t/a,this.height=n/r,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(e.hidden=!1),this.#ts(),this.#Xi||(this.parent.addUndoableEditor(this),this.#Xi=!0),this._reportTelemetry({action:"inserted_image"}),this.#Gi&&l.setAttribute("aria-label",this.#Gi)}copyCanvas(e,t,n=!1){e||(e=224);const{width:a,height:r}=this.#Wi,o=new es;let i=this.#Wi,s=a,l=r,c=null;if(t){if(a>t||r>t){const e=Math.min(t/a,t/r);s=Math.floor(a*e),l=Math.floor(r*e)}c=document.createElement("canvas");const e=c.width=Math.ceil(s*o.sx),n=c.height=Math.ceil(l*o.sy);this.#Yi||(i=this.#ns(e,n));const d=c.getContext("2d");d.filter=this._uiManager.hcmFilter;let m="white",p="#cfcfd8";"none"!==this._uiManager.hcmFilter?p="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(m="#8f8f9d",p="#42414d");const u=15,g=u*o.sx,h=u*o.sy,b=new OffscreenCanvas(2*g,2*h),f=b.getContext("2d");f.fillStyle=m,f.fillRect(0,0,2*g,2*h),f.fillStyle=p,f.fillRect(0,0,g,h),f.fillRect(g,h,g,h),d.fillStyle=d.createPattern(b,"repeat"),d.fillRect(0,0,e,n),d.drawImage(i,0,0,i.width,i.height,0,0,e,n)}let d=null;if(n){let t,n;if(o.symmetric&&i.width<e&&i.height<e)t=i.width,n=i.height;else if(i=this.#Wi,a>e||r>e){const o=Math.min(e/a,e/r);t=Math.floor(a*o),n=Math.floor(r*o),this.#Yi||(i=this.#ns(t,n))}const s=new OffscreenCanvas(t,n).getContext("2d",{willReadFrequently:!0});s.drawImage(i,0,0,i.width,i.height,0,0,t,n),d={width:t,height:n,data:s.getImageData(0,0,t,n).data}}return{canvas:c,width:s,height:l,imageData:d}}#ns(e,t){const{width:n,height:a}=this.#Wi;let r=n,o=a,i=this.#Wi;for(;r>2*e||o>2*t;){const n=r,a=o;r>2*e&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2)),o>2*t&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));const s=new OffscreenCanvas(r,o);s.getContext("2d").drawImage(i,0,0,n,a,0,0,r,o),i=s.transferToImageBitmap()}return i}#ts(){const[e,t]=this.parentDimensions,{width:n,height:a}=this,r=new es,o=Math.ceil(n*e*r.sx),i=Math.ceil(a*t*r.sy),s=this.#Ki;if(!s||s.width===o&&s.height===i)return;s.width=o,s.height=i;const l=this.#Yi?this.#Wi:this.#ns(o,i),c=s.getContext("2d");c.filter=this._uiManager.hcmFilter,c.drawImage(l,0,0,l.width,l.height,0,0,o,i)}getImageForAltText(){return this.#Ki}#as(e){if(e){if(this.#Yi){const e=this._uiManager.imageManager.getSvgUrl(this.#qi);if(e)return e}const e=document.createElement("canvas");({width:e.width,height:e.height}=this.#Wi);return e.getContext("2d").drawImage(this.#Wi,0,0),e.toDataURL()}if(this.#Yi){const[e,t]=this.pageDimensions,n=Math.round(this.width*e*Li.PDF_TO_CSS_UNITS),a=Math.round(this.height*t*Li.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(n,a);return r.getContext("2d").drawImage(this.#Wi,0,0,this.#Wi.width,this.#Wi.height,0,0,n,a),r.transferToImageBitmap()}return structuredClone(this.#Wi)}static async deserialize(e,t,n){let a=null;if(e instanceof Kc){const{data:{rect:r,rotation:o,id:i,structParent:s,popupRef:l},container:c,parent:{page:{pageNumber:d}}}=e,m=c.querySelector("canvas"),p=n.imageManager.getFromCanvas(c.id,m);m.remove();const u=(await t._structTree.getAriaAttributes(`${Bi}${i}`))?.get("aria-label")||"";a=e={annotationType:To.STAMP,bitmapId:p.id,bitmap:p.bitmap,pageIndex:d-1,rect:r.slice(0),rotation:o,id:i,deleted:!1,accessibilityData:{decorative:!1,altText:u},isSvg:!1,structParent:s,popupRef:l}}const r=await super.deserialize(e,t,n),{rect:o,bitmap:i,bitmapUrl:s,bitmapId:l,isSvg:c,accessibilityData:d}=e;l&&n.imageManager.isValidId(l)?(r.#qi=l,i&&(r.#Wi=i)):r.#ji=s,r.#Yi=c;const[m,p]=r.pageDimensions;return r.width=(o[2]-o[0])/m,r.height=(o[3]-o[1])/p,r.annotationElementId=e.id||null,d&&(r.altTextData=d),r._initialData=a,r.#Xi=!!a,r}serialize(e=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const n={annotationType:To.STAMP,bitmapId:this.#qi,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#Yi,structTreeParentId:this._structTreeParentId};if(e)return n.bitmapUrl=this.#as(!0),n.accessibilityData=this.serializeAltText(!0),n;const{decorative:a,altText:r}=this.serializeAltText(!1);if(!a&&r&&(n.accessibilityData={type:"Figure",alt:r}),this.annotationElementId){const e=this.#Hr(n);if(e.isSame)return null;e.isSameAltText?delete n.accessibilityData:n.accessibilityData.structParent=this._initialData.structParent??-1}if(n.id=this.annotationElementId,null===t)return n;t.stamps||=new Map;const o=this.#Yi?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(t.stamps.has(this.#qi)){if(this.#Yi){const e=t.stamps.get(this.#qi);o>e.area&&(e.area=o,e.serialized.bitmap.close(),e.serialized.bitmap=this.#as(!1))}}else t.stamps.set(this.#qi,{area:o,serialized:n}),n.bitmap=this.#as(!1);return n}#Hr(e){const{pageIndex:t,accessibilityData:{altText:n}}=this._initialData,a=e.pageIndex===t,r=(e.accessibilityData?.alt||"")===n;return{isSame:!this._hasBeenMoved&&!this._hasBeenResized&&a&&r,isSameAltText:r}}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}}class gd{#Tr;#rs=!1;#os=null;#is=null;#ss=null;#ls=new Map;#cs=!1;#ds=!1;#ms=!1;#ps=null;#us=null;#gs=null;#hs=null;#h;static _initialized=!1;static#W=new Map([Jc,pd,ud,id].map(e=>[e._editorType,e]));constructor({uiManager:e,pageIndex:t,div:n,structTreeLayer:a,accessibilityManager:r,annotationLayer:o,drawLayer:i,textLayer:s,viewport:l,l10n:c}){const d=[...gd.#W.values()];if(!gd._initialized){gd._initialized=!0;for(const t of d)t.initialize(c,e)}e.registerEditorTypes(d),this.#h=e,this.pageIndex=t,this.div=n,this.#Tr=r,this.#os=o,this.viewport=l,this.#gs=s,this.drawLayer=i,this._structTree=a,this.#h.addLayer(this)}get isEmpty(){return 0===this.#ls.size}get isInvisible(){return this.isEmpty&&this.#h.getMode()===To.NONE}updateToolbar(e){this.#h.updateToolbar(e)}updateMode(e=this.#h.getMode()){switch(this.#bs(),e){case To.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case To.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case To.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:t}=this.div;for(const n of gd.#W.values())t.toggle(`${n._type}Editing`,e===n._editorType);this.div.hidden=!1}hasTextLayer(e){return e===this.#gs?.div}setEditingState(e){this.#h.setEditingState(e)}addCommands(e){this.#h.addCommands(e)}cleanUndoStack(e){this.#h.cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#os?.div.classList.toggle("disabled",!e)}async enable(){this.#ms=!0,this.div.tabIndex=0,this.togglePointerEvents(!0);const e=new Set;for(const t of this.#ls.values())t.enableEditing(),t.show(!0),t.annotationElementId&&(this.#h.removeChangedExistingAnnotation(t),e.add(t.annotationElementId));if(!this.#os)return void(this.#ms=!1);const t=this.#os.getEditableAnnotations();for(const n of t){if(n.hide(),this.#h.isDeletedAnnotationElement(n.data.id))continue;if(e.has(n.data.id))continue;const t=await this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}this.#ms=!1}disable(){this.#ds=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,t=new Map;for(const n of this.#ls.values())n.disableEditing(),n.annotationElementId&&(null===n.serialize()?(t.set(n.annotationElementId,n),this.getEditableAnnotation(n.annotationElementId)?.show(),n.remove()):e.set(n.annotationElementId,n));if(this.#os){const n=this.#os.getEditableAnnotations();for(const a of n){const{id:n}=a.data;if(this.#h.isDeletedAnnotationElement(n))continue;let r=t.get(n);r?(r.resetAnnotationElement(a),r.show(!1),a.show()):(r=e.get(n),r&&(this.#h.addChangedExistingAnnotation(r),r.renderAnnotationElement(a)&&r.show(!1)),a.show())}}this.#bs(),this.isEmpty&&(this.div.hidden=!0);const{classList:n}=this.div;for(const e of gd.#W.values())n.remove(`${e._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#ds=!1}getEditableAnnotation(e){return this.#os?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#h.getActive()!==e&&this.#h.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#gs?.div&&!this.#hs){this.#hs=new AbortController;const e=this.#h.combinedSignal(this.#hs);this.#gs.div.addEventListener("pointerdown",this.#fs.bind(this),{signal:e}),this.#gs.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#gs?.div&&this.#hs&&(this.#hs.abort(),this.#hs=null,this.#gs.div.classList.remove("highlighting"))}#fs(e){this.#h.unselectAll();const{target:t}=e;if(t===this.#gs.div||("img"===t.getAttribute("role")||t.classList.contains("endOfContent"))&&this.#gs.div.contains(t)){const{isMac:t}=Di.platform;if(0!==e.button||e.ctrlKey&&t)return;this.#h.showAllEditors("highlight",!0,!0),this.#gs.div.classList.add("free"),this.toggleDrawing(),id.startHighlighting(this,"ltr"===this.#h.direction,{target:this.#gs.div,x:e.x,y:e.y}),this.#gs.div.addEventListener("pointerup",()=>{this.#gs.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#h._signal}),e.preventDefault()}}enableClick(){if(this.#is)return;this.#is=new AbortController;const e=this.#h.combinedSignal(this.#is);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e});const t=this.pointerup.bind(this);this.div.addEventListener("pointerup",t,{signal:e}),this.div.addEventListener("pointercancel",t,{signal:e})}disableClick(){this.#is?.abort(),this.#is=null}attach(e){this.#ls.set(e.id,e);const{annotationElementId:t}=e;t&&this.#h.isDeletedAnnotationElement(t)&&this.#h.removeDeletedAnnotationElement(e)}detach(e){this.#ls.delete(e.id),this.#Tr?.removePointerInTextLayer(e.contentDiv),!this.#ds&&e.annotationElementId&&this.#h.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#h.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#h.addDeletedAnnotationElement(e.annotationElementId),ps.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(e.parent!==this||!e.isAttachedToDOM){if(this.changeParent(e),this.#h.addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!this.#ms),this.#h.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;const{activeElement:t}=document;e.div.contains(t)&&!this.#ss&&(e._focusEventsAllowed=!1,this.#ss=setTimeout(()=>{this.#ss=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#h._signal}),t.focus())},0)),e._structTreeParentId=this.#Tr?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getNextId(){return this.#h.getId()}get#vs(){return gd.#W.get(this.#h.getMode())}combinedSignal(e){return this.#h.combinedSignal(e)}#ys(e){const t=this.#vs;return t?new t.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#vs?.canCreateNewEmptyEditor()}pasteEditor(e,t){this.#h.updateToolbar(e),this.#h.updateMode(e);const{offsetX:n,offsetY:a}=this.#xs(),r=this.getNextId(),o=this.#ys({parent:this,id:r,x:n,y:a,uiManager:this.#h,isCentered:!0,...t});o&&this.add(o)}async deserialize(e){return await(gd.#W.get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,this.#h))||null}createAndAddNewEditor(e,t,n={}){const a=this.getNextId(),r=this.#ys({parent:this,id:a,x:e.offsetX,y:e.offsetY,uiManager:this.#h,isCentered:t,...n});return r&&this.add(r),r}#xs(){const{x:e,y:t,width:n,height:a}=this.div.getBoundingClientRect(),r=Math.max(0,e),o=Math.max(0,t),i=(r+Math.min(window.innerWidth,e+n))/2-e,s=(o+Math.min(window.innerHeight,t+a))/2-t,[l,c]=this.viewport.rotation%180==0?[i,s]:[s,i];return{offsetX:l,offsetY:c}}addNewEditor(){this.createAndAddNewEditor(this.#xs(),!0)}setSelected(e){this.#h.setSelected(e)}toggleSelected(e){this.#h.toggleSelected(e)}unselect(e){this.#h.unselect(e)}pointerup(e){const{isMac:t}=Di.platform;0!==e.button||e.ctrlKey&&t||e.target===this.div&&this.#cs&&(this.#cs=!1,this.#vs?.isDrawer&&this.#vs.supportMultipleDrawings||(this.#rs?this.#h.getMode()!==To.STAMP?this.createAndAddNewEditor(e,!1):this.#h.unselectAll():this.#rs=!0))}pointerdown(e){if(this.#h.getMode()===To.HIGHLIGHT&&this.enableTextSelection(),this.#cs)return void(this.#cs=!1);const{isMac:t}=Di.platform;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;if(this.#cs=!0,this.#vs?.isDrawer)return void this.startDrawingSession(e);const n=this.#h.getActive();this.#rs=!n||n.isEmpty()}startDrawingSession(e){if(this.div.focus(),this.#ps)return void this.#vs.startDrawing(this,this.#h,!1,e);this.#h.setCurrentDrawingSession(this),this.#ps=new AbortController;const t=this.#h.combinedSignal(this.#ps);this.div.addEventListener("blur",({relatedTarget:e})=>{e&&!this.div.contains(e)&&(this.#us=null,this.commitOrRemove())},{signal:t}),this.#vs.startDrawing(this,this.#h,!1,e)}pause(e){if(e){const{activeElement:e}=document;return void(this.div.contains(e)&&(this.#us=e))}this.#us&&setTimeout(()=>{this.#us?.focus(),this.#us=null},0)}endDrawingSession(e=!1){return this.#ps?(this.#h.setCurrentDrawingSession(null),this.#ps.abort(),this.#ps=null,this.#us=null,this.#vs.endDrawing(e)):null}findNewParent(e,t,n){const a=this.#h.findParent(t,n);return null!==a&&a!==this&&(a.changeParent(e),!0)}commitOrRemove(){return!!this.#ps&&(this.endDrawingSession(),!0)}onScaleChanging(){this.#ps&&this.#vs.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#h.getActive()?.parent===this&&(this.#h.commitOrRemove(),this.#h.setActiveEditor(null)),this.#ss&&(clearTimeout(this.#ss),this.#ss=null);for(const e of this.#ls.values())this.#Tr?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#ls.clear(),this.#h.removeLayer(this)}#bs(){for(const e of this.#ls.values())e.isEmpty()&&e.remove()}render({viewport:e}){this.viewport=e,Zi(this.div,e);for(const e of this.#h.getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:e}){this.#h.commitOrRemove(),this.#bs();const t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,Zi(this.div,{rotation:n}),t!==n)for(const e of this.#ls.values())e.rotate(n)}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return this.#h.viewParameters.realScale}}class hd{#rr=null;#y=0;#ws=new Map;#ks=new Map;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(this.#rr){if(this.#rr!==e){if(this.#ws.size>0)for(const t of this.#ws.values())t.remove(),e.append(t);this.#rr=e}}else this.#rr=e}static get _svgFactory(){return bi(this,"_svgFactory",new fc)}static#Es(e,[t,n,a,r]){const{style:o}=e;o.top=100*n+"%",o.left=100*t+"%",o.width=100*a+"%",o.height=100*r+"%"}#Ss(){const e=hd._svgFactory.create(1,1,!0);return this.#rr.append(e),e.setAttribute("aria-hidden",!0),e}#Cs(e,t){const n=hd._svgFactory.createElement("clipPath");e.append(n);const a=`clip_${t}`;n.setAttribute("id",a),n.setAttribute("clipPathUnits","objectBoundingBox");const r=hd._svgFactory.createElement("use");return n.append(r),r.setAttribute("href",`#${t}`),r.classList.add("clip"),a}#Ts(e,t){for(const[n,a]of Object.entries(t))null===a?e.removeAttribute(n):e.setAttribute(n,a)}draw(e,t=!1,n=!1){const a=this.#y++,r=this.#Ss(),o=hd._svgFactory.createElement("defs");r.append(o);const i=hd._svgFactory.createElement("path");o.append(i);const s=`path_p${this.pageIndex}_${a}`;i.setAttribute("id",s),i.setAttribute("vector-effect","non-scaling-stroke"),t&&this.#ks.set(a,i);const l=n?this.#Cs(o,s):null,c=hd._svgFactory.createElement("use");return r.append(c),c.setAttribute("href",`#${s}`),this.updateProperties(r,e),this.#ws.set(a,r),{id:a,clipPathId:`url(#${l})`}}drawOutline(e,t){const n=this.#y++,a=this.#Ss(),r=hd._svgFactory.createElement("defs");a.append(r);const o=hd._svgFactory.createElement("path");r.append(o);const i=`path_p${this.pageIndex}_${n}`;let s;if(o.setAttribute("id",i),o.setAttribute("vector-effect","non-scaling-stroke"),t){const e=hd._svgFactory.createElement("mask");r.append(e),s=`mask_p${this.pageIndex}_${n}`,e.setAttribute("id",s),e.setAttribute("maskUnits","objectBoundingBox");const t=hd._svgFactory.createElement("rect");e.append(t),t.setAttribute("width","1"),t.setAttribute("height","1"),t.setAttribute("fill","white");const a=hd._svgFactory.createElement("use");e.append(a),a.setAttribute("href",`#${i}`),a.setAttribute("stroke","none"),a.setAttribute("fill","black"),a.setAttribute("fill-rule","nonzero"),a.classList.add("mask")}const l=hd._svgFactory.createElement("use");a.append(l),l.setAttribute("href",`#${i}`),s&&l.setAttribute("mask",`url(#${s})`);const c=l.cloneNode();return a.append(c),l.classList.add("mainOutline"),c.classList.add("secondaryOutline"),this.updateProperties(a,e),this.#ws.set(n,a),n}finalizeDraw(e,t){this.#ks.delete(e),this.updateProperties(e,t)}updateProperties(e,t){if(!t)return;const{root:n,bbox:a,rootClass:r,path:o}=t,i="number"==typeof e?this.#ws.get(e):e;if(i){if(n&&this.#Ts(i,n),a&&hd.#Es(i,a),r){const{classList:e}=i;for(const[t,n]of Object.entries(r))e.toggle(t,n)}if(o){const e=i.firstChild.firstChild;this.#Ts(e,o)}}}updateParent(e,t){if(t===this)return;const n=this.#ws.get(e);n&&(t.#rr.append(n),this.#ws.delete(e),t.#ws.set(e,n))}remove(e){this.#ks.delete(e),null!==this.#rr&&(this.#ws.get(e).remove(),this.#ws.delete(e))}destroy(){this.#rr=null;for(const e of this.#ws.values())e.remove();this.#ws.clear(),this.#ks.clear()}}globalThis.pdfjsTestingUtils={HighlightOutliner:td};var bd=po.AbortException,fd=po.AnnotationEditorLayer,vd=po.AnnotationEditorParamsType,yd=po.AnnotationEditorType,xd=po.AnnotationEditorUIManager,wd=po.AnnotationLayer,kd=po.AnnotationMode,Ed=po.ColorPicker,Sd=po.DOMSVGFactory,Cd=po.DrawLayer,Td=po.FeatureTest,Ad=po.GlobalWorkerOptions,Dd=po.ImageKind,_d=po.InvalidPDFException,Nd=po.MissingPDFException,Md=po.OPS,Id=po.OutputScale,Rd=po.PDFDataRangeTransport,Bd=po.PDFDateString,Pd=po.PDFWorker,Ld=po.PasswordResponses,Ud=po.PermissionFlag,Fd=po.PixelsPerInch,zd=po.RenderingCancelledException,Od=po.TextLayer,Wd=po.TouchManager,qd=po.UnexpectedResponseException,Hd=po.Util,jd=po.VerbosityLevel,Vd=po.XfaLayer,Gd=po.build,Kd=po.createValidAbsoluteUrl,$d=po.fetchData,Yd=po.getDocument,Xd=po.getFilenameFromUrl,Jd=po.getPdfFilenameFromUrl,Qd=po.getXfaPageViewport,Zd=po.isDataScheme,em=po.isPdfFile,tm=po.noContextMenu,nm=po.normalizeUnicode,am=po.setLayerDimensions,rm=po.shadow,om=po.stopEvent,im=po.version,sm=r(306),lm=r.t(sm,2);try{"undefined"!=typeof chrome&&chrome.runtime?.getURL&&(r.p=chrome.runtime.getURL(""))}catch{}const cm=10485760;async function dm(t,n={}){const a=n.maxBytes??cm;if(t.size>a){const e=Math.round(a/1048576);throw new Error(`File is too large (${(t.size/1048576).toFixed(1)} MB). Max ${e} MB.`)}const r=function(e){switch((e.split(".").pop()||"").toLowerCase()){case"pdf":return"pdf";case"docx":return"docx";case"txt":return"txt";case"csv":return"csv";case"md":case"markdown":return"md";default:return null}}(t.name);if(!r)throw new Error("Unsupported file type. Use PDF, DOCX, TXT, CSV, or MD.");let o="";switch(r){case"pdf":o=await async function(t){const n=e;if(n.GlobalWorkerOptions)try{const e="undefined"!=typeof chrome&&chrome.runtime?.getURL?chrome.runtime.getURL("pdf.worker.min.mjs"):"pdf.worker.min.mjs";n.GlobalWorkerOptions.workerSrc=e}catch{n.GlobalWorkerOptions.workerSrc="pdf.worker.min.mjs"}const a=await t.arrayBuffer();let r;try{r=await n.getDocument({data:a,disableWorker:!0,isEvalSupported:!1,useSystemFonts:!1}).promise}catch(e){if("PasswordException"===e?.name)throw new Error("This PDF is password-protected.");throw new Error(`Could not read PDF: ${e?.message||"unknown error"}`)}const o=[],i=r.numPages||0;for(let e=1;e<=i;e++)try{const t=await r.getPage(e),n=((await t.getTextContent()).items||[]).map(e=>"string"==typeof e.str?e.str:"").join(" ");n.trim()&&o.push(n)}catch(e){}return o.join("\n\n")}(t);break;case"docx":o=await async function(e){const t=lm,n=await e.arrayBuffer();try{const e=await t.extractRawText({arrayBuffer:n});return(e?.value||"").trim()}catch(e){throw new Error(`Could not read DOCX: ${e?.message||"unknown error"}`)}}(t);break;case"txt":case"csv":o=await async function(e){return mm(e)}(t);break;case"md":o=await async function(e){const t=await mm(e);return t.replace(/^#+\s+/gm,"").replace(/^\s*[-*+]\s+/gm,"").replace(/^\s*\d+\.\s+/gm,"").replace(/\*\*(.+?)\*\*/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/__(.+?)__/g,"$1").replace(/_(.+?)_/g,"$1").replace(/`{3}[\s\S]*?`{3}/g," ").replace(/`([^`]+)`/g,"$1").replace(/!\[[^\]]*\]\([^)]+\)/g,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/^>\s+/gm,"").replace(/\n{3,}/g,"\n\n").trim()}(t);break;default:throw new Error(`Unsupported file type: ${r}`)}if(o=(o||"").trim(),!o)throw new Error("No readable text found in this file. (Scanned PDFs without an OCR layer are not supported.)");return{type:r,text:o,sizeKB:Math.max(1,Math.round(t.size/1024))}}function mm(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>t(a.result||""),a.onerror=()=>n(a.error||new Error("FileReader failed")),a.readAsText(e,"utf-8")})}const pm=({type:e})=>{const t=e.toUpperCase();return a.createElement("span",{style:{display:"inline-block",padding:"1px 6px",fontSize:"10px",fontWeight:700,letterSpacing:"0.3px",color:"var(--lion-primary)",background:"rgba(var(--lion-primary-rgb), 0.12)",borderRadius:"var(--lion-radius-sm, 4px)"}},t)},um=({isDarkMode:e,onChange:t})=>{const[n,r]=(0,a.useState)([]),[,o]=(0,a.useState)(0),[i,l]=(0,a.useState)(""),[c,d]=(0,a.useState)(!1),[m,p]=(0,a.useState)(null),[u,g]=(0,a.useState)(""),[h,b]=(0,a.useState)(""),[f,v]=(0,a.useState)(!1),[y,x]=(0,a.useState)(!1),[w,k]=(0,a.useState)(null),[E,S]=(0,a.useState)(null),[C,T]=(0,a.useState)(!1),A=a.useRef(null);(0,a.useEffect)(()=>{const e=()=>o(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]);const D=async()=>{const e=await $r.getSources();r(e.sort((e,t)=>t.createdAt-e.createdAt))};(0,a.useEffect)(()=>{D()},[]);const _=e?la:ca,N={bgPrimary:_.bgPrimary,bgSecondary:_.bgSecondary,bgTertiary:_.bgTertiary,textPrimary:_.textPrimary,textMuted:_.textMuted,border:_.borderLight,inputBg:e?"#262626":"#ffffff"},M=e=>{if(!e)return null;let t="";try{t=new URL(e).hostname.toLowerCase()}catch{return null}return t.endsWith("chromewebstore.google.com")?(0,s.t)("aiBot.kb.blockedChromeStore")||'Chrome Web Store blocks automated requests. Open the listing in your browser, copy the description text, and paste it into "Paste Plain Text" below.':t.endsWith("docs.google.com")||t.endsWith("drive.google.com")||t.endsWith("sheets.google.com")?(0,s.t)("aiBot.kb.blockedGoogle")||"Google Docs / Drive / Sheets pages require sign-in and cannot be scraped. Export to PDF/DOCX/TXT and upload it instead.":t.endsWith("linkedin.com")||t.endsWith("facebook.com")||t.endsWith("instagram.com")||t.endsWith("x.com")||t.endsWith("twitter.com")?(0,s.t)("aiBot.kb.blockedSocial")||'Social networks block automated requests. Copy the relevant text and paste it into "Paste Plain Text" below.':t.endsWith("notion.site")||t.endsWith("notion.so")?(0,s.t)("aiBot.kb.blockedNotion")||"Notion pages are JS-rendered and return little text. Export the page as Markdown/PDF and upload it instead.":null},I=M(i.trim()),R=async()=>{const e=i.trim();if(!e)return;const n=M(e);if(n)p(n);else{d(!0),p(null);try{const{title:n,text:a}=await async function(e){const t=(e||"").trim();if(!t)throw new Error("URL is required");if(!/^https?:\/\//i.test(t))throw new Error("URL must start with http:// or https://");const n="undefined"!=typeof chrome&&chrome.runtime?chrome.runtime:null;if(!n||"function"!=typeof n.sendMessage)throw new Error("Extension messaging is not available in this context");return new Promise((e,a)=>{let r=!1;const o=setTimeout(()=>{r||(r=!0,a(new Error("URL scrape timed out (30s)")))},3e4);try{n.sendMessage({type:"SCRAPE_URL",url:t},t=>{if(r)return;r=!0,clearTimeout(o);const n="undefined"!=typeof chrome&&chrome.runtime?.lastError;n?a(new Error(n.message||"Messaging error")):t?t.success&&t.data?e(t.data):a(new Error(t.error||"Scrape failed")):a(new Error("No response from background"))})}catch(e){if(r)return;r=!0,clearTimeout(o),a(e)}})}(e),r=Xr(a,500);if(0===r.length)return void p((0,s.t)("aiBot.kb.errorEmpty")||"No readable text found at that URL.");await $r.addSource({type:"url",title:n||e,sourceRef:e,chunks:r,sizeKB:Math.round(a.length/1024)}),l(""),await D(),t?.()}catch(t){const n=M(e),a=t?.message||"Scrape failed",r=n||("Failed to fetch"===a?(0,s.t)("aiBot.kb.errorBlocked")||'Could not reach that URL. The site may block automated requests, require login, or be JS-rendered. Try copying the text into "Paste Plain Text" below.':a);p(r)}finally{d(!1)}}},B=async e=>{const n=Array.from(e);if(0!==n.length){x(!0),k(null),S(null);try{let e=0;const a=[];for(const t of n)try{S(`${(0,s.t)("aiBot.kb.parsingFile")||"Parsing"}: ${t.name}`);const n=await dm(t),r=Xr(n.text,500);if(0===r.length){a.push(`${t.name}: ${(0,s.t)("aiBot.kb.errorEmpty")||"No readable text found."}`);continue}await $r.addSource({type:n.type,title:t.name,sourceRef:t.name,chunks:r,sizeKB:n.sizeKB}),e++}catch(e){a.push(`${t.name}: ${e?.message||"parse failed"}`)}a.length>0&&k(a.join("\n")),e>0&&(await D(),t?.())}finally{x(!1),S(null),A.current&&(A.current.value="")}}},P={width:"100%",padding:"10px 12px",borderRadius:"var(--lion-radius-md, 8px)",border:`1px solid ${N.border}`,background:N.inputBg,color:N.textPrimary,fontSize:"14px",outline:"none",boxSizing:"border-box",fontFamily:"inherit"},L={padding:"16px",background:N.bgSecondary,border:`1px solid ${N.border}`,borderRadius:"var(--lion-radius-lg, 12px)",marginBottom:"16px"},U={fontSize:"15px",fontWeight:700,color:N.textPrimary,marginBottom:"12px"},F={marginTop:"4px",fontSize:"11px",color:N.textMuted};return a.createElement("div",{style:{padding:"16px"}},a.createElement("div",{style:L},a.createElement("div",{style:U},(0,s.t)("aiBot.kb.urlTitle")||"Add a Website URL"),a.createElement("div",{style:{display:"flex",gap:"8px"}},a.createElement("input",{type:"url",value:i,onChange:e=>l(e.target.value),placeholder:(0,s.t)("aiBot.kb.urlPlaceholder")||"https://example.com/about",style:{...P,flex:1},onKeyDown:e=>{"Enter"!==e.key||c||R()}}),a.createElement("button",{type:"button",onClick:R,disabled:c||!i.trim()||!!I,title:I||void 0,style:{padding:"0 18px",borderRadius:"var(--lion-radius-md, 8px)",border:"none",background:"var(--lion-btn-primary-gradient, var(--lion-primary))",color:"#ffffff",fontSize:"13px",fontWeight:600,cursor:c||!i.trim()||I?"not-allowed":"pointer",opacity:c||!i.trim()||I?.6:1,boxShadow:"var(--lion-btn-primary-shadow)",whiteSpace:"nowrap"}},c?(0,s.t)("aiBot.kb.scraping")||"Scraping…":(0,s.t)("aiBot.kb.addUrl")||"Add URL")),a.createElement("div",{style:F},(0,s.t)("aiBot.kb.urlHelp")||"We fetch the page and extract its visible text. Single-page only — JS-rendered SPAs may return little content."),I&&!m&&a.createElement("div",{style:{marginTop:"8px",padding:"8px 10px",background:"var(--lion-warning-light)",color:"var(--lion-warning)",border:"1px solid var(--lion-warning)",borderRadius:"var(--lion-radius-md, 8px)",fontSize:"12px",display:"flex",alignItems:"flex-start",gap:"6px"}},a.createElement("span",{style:{flexShrink:0}},"⚠️"),a.createElement("span",{style:{color:N.textPrimary}},I)),m&&a.createElement("div",{style:{marginTop:"8px",padding:"8px 10px",background:"var(--lion-error-light)",color:"var(--lion-error)",border:"1px solid var(--lion-error)",borderRadius:"var(--lion-radius-md, 8px)",fontSize:"12px"}},m)),a.createElement("div",{style:L},a.createElement("div",{style:U},(0,s.t)("aiBot.kb.uploadTitle")||"Upload Documents"),a.createElement("div",{onClick:()=>!y&&A.current?.click(),onDragOver:e=>{e.preventDefault(),y||T(!0)},onDragLeave:()=>T(!1),onDrop:e=>{if(e.preventDefault(),T(!1),y)return;const t=e.dataTransfer?.files;t&&t.length>0&&B(t)},style:{padding:"24px 16px",textAlign:"center",background:C?"rgba(var(--lion-primary-rgb), 0.08)":N.inputBg,border:`2px dashed ${C?"var(--lion-primary)":N.border}`,borderRadius:"var(--lion-radius-lg, 12px)",cursor:y?"progress":"pointer",transition:"background 0.15s, border-color 0.15s"}},a.createElement("div",{style:{fontSize:"32px",marginBottom:"6px"}},"📄"),a.createElement("div",{style:{fontSize:"13px",fontWeight:600,color:N.textPrimary,marginBottom:"4px"}},y?E||(0,s.t)("aiBot.kb.parsing")||"Parsing…":(0,s.t)("aiBot.kb.uploadPrompt")||"Click to choose a file, or drag & drop here"),a.createElement("div",{style:{fontSize:"11px",color:N.textMuted}},(0,s.t)("aiBot.kb.uploadFormats")||"PDF, DOCX, TXT, CSV, MD"," · ",(0,s.t)("aiBot.kb.uploadMaxSize")||`Max ${Math.round(10)} MB per file`),a.createElement("input",{ref:A,type:"file",accept:".pdf,.docx,.txt,.csv,.md,.markdown",multiple:!0,disabled:y,onChange:e=>{e.target.files&&B(e.target.files)},style:{display:"none"}})),w&&a.createElement("div",{style:{marginTop:"8px",padding:"8px 10px",background:"var(--lion-error-light)",color:"var(--lion-error)",border:"1px solid var(--lion-error)",borderRadius:"var(--lion-radius-md, 8px)",fontSize:"12px",whiteSpace:"pre-wrap"}},w)),a.createElement("div",{style:L},a.createElement("div",{style:U},(0,s.t)("aiBot.kb.plainTextTitle")||"Paste Plain Text"),a.createElement("div",{style:{marginBottom:"10px"}},a.createElement("input",{type:"text",value:u,onChange:e=>g(e.target.value),placeholder:(0,s.t)("aiBot.kb.textTitlePlaceholder")||'Title (optional, e.g. "Refund Policy")',style:P})),a.createElement("textarea",{value:h,onChange:e=>b(e.target.value),placeholder:(0,s.t)("aiBot.kb.textBodyPlaceholder")||"Paste any text the AI should know about — pricing, FAQs, policies, instructions…",rows:8,style:{...P,resize:"vertical",minHeight:"160px"}}),a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"10px"}},a.createElement("span",{style:{fontSize:"11px",color:N.textMuted}},h.length," ",(0,s.t)("aiBot.kb.charsLabel")||"chars"),a.createElement("button",{type:"button",onClick:async()=>{const e=h.trim();if(e){v(!0);try{const n=Xr(e,500),a=u.trim()||`Text snippet ${(new Date).toLocaleString()}`;await $r.addSource({type:"text",title:a,sourceRef:"plain-text",chunks:n,sizeKB:Math.round(e.length/1024)}),g(""),b(""),await D(),t?.()}finally{v(!1)}}},disabled:f||!h.trim(),style:{padding:"8px 18px",borderRadius:"var(--lion-radius-md, 8px)",border:"none",background:"var(--lion-btn-primary-gradient, var(--lion-primary))",color:"#ffffff",fontSize:"13px",fontWeight:600,cursor:f||!h.trim()?"not-allowed":"pointer",opacity:f||!h.trim()?.6:1,boxShadow:"var(--lion-btn-primary-shadow)"}},f?(0,s.t)("aiBot.kb.saving")||"Saving…":(0,s.t)("aiBot.kb.saveText")||"Save Text"))),a.createElement("div",null,a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"10px"}},a.createElement("div",{style:{fontSize:"15px",fontWeight:700,color:N.textPrimary}},(0,s.t)("aiBot.kb.trainingSources")||"Training Sources"),a.createElement("div",{style:{fontSize:"12px",color:N.textMuted}},n.length," ",1===n.length?(0,s.t)("aiBot.kb.sourceSingular")||"source":(0,s.t)("aiBot.kb.sourcePlural")||"sources")),0===n.length?a.createElement("div",{style:{padding:"32px 16px",textAlign:"center",border:`1px dashed ${N.border}`,borderRadius:"var(--lion-radius-lg, 12px)",color:N.textMuted,fontSize:"13px"}},(0,s.t)("aiBot.kb.empty")||"No training sources yet. Add a URL or paste plain text above."):a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px"}},n.map(e=>a.createElement("div",{key:e.id,style:{padding:"12px 14px",background:N.bgPrimary,border:`1px solid ${N.border}`,borderRadius:"var(--lion-radius-md, 8px)",opacity:e.enabled?1:.55}},a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"8px"}},a.createElement("div",{style:{flex:1,minWidth:0}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"4px"}},a.createElement(pm,{type:e.type}),a.createElement("span",{style:{fontSize:"13px",fontWeight:700,color:N.textPrimary,wordBreak:"break-word"}},e.title)),a.createElement("div",{style:{fontSize:"11px",color:N.textMuted,wordBreak:"break-all"}},e.sourceRef),a.createElement("div",{style:{fontSize:"11px",color:N.textMuted,marginTop:"4px"}},e.chunks.length," ",1===e.chunks.length?(0,s.t)("aiBot.kb.chunkSingular")||"chunk":(0,s.t)("aiBot.kb.chunkPlural")||"chunks"," · ",e.sizeKB," KB")),a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px",flexShrink:0}},a.createElement("label",{style:{display:"inline-flex",alignItems:"center",gap:"6px",cursor:"pointer"}},a.createElement("input",{type:"checkbox",checked:e.enabled,onChange:()=>(async e=>{await $r.toggleSource(e.id,!e.enabled),await D(),t?.()})(e),style:{accentColor:"var(--lion-primary)"}}),a.createElement("span",{style:{fontSize:"11px",color:N.textMuted}},e.enabled?(0,s.t)("aiBot.qa.on")||"On":(0,s.t)("aiBot.qa.off")||"Off")),a.createElement("button",{type:"button",onClick:()=>(async e=>{window.confirm((0,s.t)("aiBot.kb.deleteConfirm")||"Delete this source?")&&(await $r.deleteSource(e.id),await D(),t?.())})(e),style:{padding:"4px 10px",fontSize:"11px",fontWeight:600,color:"var(--lion-error)",background:"var(--lion-error-light)",border:"1px solid var(--lion-error)",borderRadius:"var(--lion-radius-sm, 4px)",cursor:"pointer"}},(0,s.t)("aiBot.qa.delete")||"Delete"))))))))},gm=({isDarkMode:e,onChange:t})=>{const[n,r]=(0,a.useState)(Qr),[o,i]=(0,a.useState)(""),[l,c]=(0,a.useState)(!1),[d,m]=(0,a.useState)(!1),[,p]=(0,a.useState)(0);(0,a.useEffect)(()=>{const e=()=>p(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{(async()=>{const e=await no.getRules();r(e),i((e.triggerPhrases||[]).join("\n"))})()},[]);const u=e?la:ca,g={bgPrimary:u.bgPrimary,bgSecondary:u.bgSecondary,textPrimary:u.textPrimary,textMuted:u.textMuted,border:u.borderLight,inputBg:e?"#262626":"#ffffff"},h={width:"100%",padding:"10px 12px",borderRadius:"var(--lion-radius-md, 8px)",border:`1px solid ${g.border}`,background:g.inputBg,color:g.textPrimary,fontSize:"14px",outline:"none",boxSizing:"border-box",fontFamily:"inherit"},b={display:"block",marginBottom:"6px",fontSize:"13px",fontWeight:600,color:g.textPrimary},f={marginTop:"4px",fontSize:"11px",color:g.textMuted},v={padding:"16px",background:g.bgSecondary,border:`1px solid ${g.border}`,borderRadius:"var(--lion-radius-lg, 12px)",marginBottom:"16px"};return a.createElement("div",{style:{padding:"16px"}},a.createElement("div",{style:{...v,display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px"}},a.createElement("div",{style:{flex:1}},a.createElement("div",{style:{fontSize:"15px",fontWeight:700,color:g.textPrimary}},(0,s.t)("aiBot.esc.enableAuto")||"Enable Auto-Escalation"),a.createElement("div",{style:{fontSize:"12px",color:g.textMuted,marginTop:"4px"}},(0,s.t)("aiBot.esc.enableAutoDesc")||"Automatically hand off to a human when the AI cannot help or the customer asks for one.")),a.createElement("input",{type:"checkbox",checked:n.enabled,onChange:e=>r({...n,enabled:e.target.checked}),style:{width:"20px",height:"20px",accentColor:"var(--lion-primary)",cursor:"pointer"}})),a.createElement("div",{style:v},a.createElement("label",{style:b},(0,s.t)("aiBot.esc.maxAttempts")||"Max Failed Attempts"),a.createElement("select",{value:n.maxFailedAttempts,onChange:e=>r({...n,maxFailedAttempts:parseInt(e.target.value,10)}),style:h,disabled:!n.enabled},[1,2,3,4,5,6,7,8,9,10].map(e=>a.createElement("option",{key:e,value:e},e))),a.createElement("div",{style:f},(0,s.t)("aiBot.esc.maxAttemptsHelp")||"Hand off after this many consecutive fallback replies (24h window).")),a.createElement("div",{style:v},a.createElement("label",{style:b},(0,s.t)("aiBot.esc.triggerPhrases")||"Trigger Phrases (one per line)"),a.createElement("textarea",{value:o,onChange:e=>i(e.target.value),placeholder:"talk to human\nspeak to manager\nreal person\nlive agent",rows:5,style:{...h,resize:"vertical",minHeight:"110px",fontFamily:"monospace"},disabled:!n.enabled}),a.createElement("div",{style:f},(0,s.t)("aiBot.esc.triggerPhrasesHelp")||"When any of these phrases appears in an incoming message, the bot escalates immediately. Case-insensitive substring match.")),a.createElement("div",{style:v},a.createElement("label",{style:b},(0,s.t)("aiBot.esc.message")||"Escalation Message"),a.createElement("textarea",{value:n.escalationMessage,onChange:e=>r({...n,escalationMessage:e.target.value}),placeholder:Qr.escalationMessage,rows:3,style:{...h,resize:"vertical",minHeight:"70px"},disabled:!n.enabled}),a.createElement("div",{style:f},(0,s.t)("aiBot.esc.messageHelp")||"Sent to the customer right before the bot stops replying so a human can take over.")),a.createElement("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"12px"}},l&&a.createElement("span",{style:{fontSize:"12px",color:"var(--lion-success)",fontWeight:600}},(0,s.t)("aiBot.behavior.saved")||"✓ Saved"),a.createElement("button",{type:"button",onClick:async()=>{m(!0);try{const e=o.split("\n").map(e=>e.trim()).filter(Boolean);await no.saveRules({...n,triggerPhrases:e}),c(!0),setTimeout(()=>c(!1),1800),t?.()}finally{m(!1)}},disabled:d,style:{padding:"10px 22px",borderRadius:"var(--lion-radius-md, 8px)",border:"none",background:"var(--lion-btn-primary-gradient, var(--lion-primary))",color:"#ffffff",fontSize:"14px",fontWeight:600,cursor:d?"not-allowed":"pointer",opacity:d?.6:1,boxShadow:"var(--lion-btn-primary-shadow)"}},d?(0,s.t)("aiBot.kb.saving")||"Saving…":(0,s.t)("aiBot.esc.saveRules")||"Save Escalation Rules")))},hm=({colors:e,text:t})=>a.createElement("div",{style:{padding:"20px",textAlign:"center",border:`1px dashed ${e.border}`,borderRadius:"var(--lion-radius-md, 8px)",color:e.textMuted,fontSize:"13px"}},t),bm=({isDarkMode:e})=>{const[t,n]=(0,a.useState)([]),[r,o]=(0,a.useState)([]),[i,l]=(0,a.useState)(null),[c,d]=(0,a.useState)(null),[m,p]=(0,a.useState)(null),[,u]=(0,a.useState)(0);(0,a.useEffect)(()=>{const e=()=>u(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{(async()=>{const[e,t,a]=await Promise.all([$r.getQAPairs(),$r.getSources(),no.getRules()]);n(e),o(t),l(a)})()},[]);const g=e?la:ca,h={bgPrimary:g.bgPrimary,bgSecondary:g.bgSecondary,bgTertiary:g.bgTertiary,textPrimary:g.textPrimary,textMuted:g.textMuted,border:g.borderLight},b=t.filter(e=>e.enabled),f=r.filter(e=>e.enabled),v=f.reduce((e,t)=>e+(t.chunks?.length||0),0),y={flex:1,padding:"14px",background:h.bgSecondary,border:`1px solid ${h.border}`,borderRadius:"var(--lion-radius-lg, 12px)",textAlign:"center"},x={fontSize:"14px",fontWeight:700,color:h.textPrimary,marginBottom:"10px",marginTop:"20px"};return a.createElement("div",{style:{padding:"16px"}},a.createElement("div",{style:{display:"flex",gap:"12px",marginBottom:"8px"}},a.createElement("div",{style:y},a.createElement("div",{style:{fontSize:"24px",fontWeight:800,color:"var(--lion-primary)"}},b.length,a.createElement("span",{style:{fontSize:"13px",color:h.textMuted}},t.length!==b.length?` / ${t.length}`:"")),a.createElement("div",{style:{fontSize:"12px",color:h.textMuted,fontWeight:600}},(0,s.t)("aiBot.preview.qaPairsLabel")||"Q&A Pairs")),a.createElement("div",{style:y},a.createElement("div",{style:{fontSize:"24px",fontWeight:800,color:"var(--lion-primary)"}},f.length,a.createElement("span",{style:{fontSize:"13px",color:h.textMuted}},r.length!==f.length?` / ${r.length}`:"")),a.createElement("div",{style:{fontSize:"12px",color:h.textMuted,fontWeight:600}},(0,s.t)("aiBot.preview.sourcesLabel")||"Sources")),a.createElement("div",{style:y},a.createElement("div",{style:{fontSize:"24px",fontWeight:800,color:"var(--lion-primary)"}},v),a.createElement("div",{style:{fontSize:"12px",color:h.textMuted,fontWeight:600}},(0,s.t)("aiBot.preview.chunksLabel")||"Chunks"))),a.createElement("div",{style:{fontSize:"12px",color:h.textMuted,marginTop:"6px"}},(0,s.t)("aiBot.preview.helpText")||"This is exactly what the AI has access to right now. Disabled items are not used."),i&&a.createElement(a.Fragment,null,a.createElement("div",{style:x},(0,s.t)("aiBot.preview.escalationSummary")||"Escalation"),a.createElement("div",{style:{padding:"12px 14px",background:h.bgSecondary,border:`1px solid ${h.border}`,borderRadius:"var(--lion-radius-md, 8px)",fontSize:"13px",color:h.textPrimary,lineHeight:1.6}},a.createElement("div",null,a.createElement("strong",null,(0,s.t)("aiBot.preview.escStatus")||"Status",":")," ",a.createElement("span",{style:{color:i.enabled?"var(--lion-success)":h.textMuted,fontWeight:600}},i.enabled?(0,s.t)("aiBot.qa.enabled")||"Enabled":(0,s.t)("aiBot.qa.disabled")||"Disabled")),i.enabled&&a.createElement(a.Fragment,null,a.createElement("div",null,a.createElement("strong",null,(0,s.t)("aiBot.preview.escThreshold")||"After",":")," ",i.maxFailedAttempts," ",(0,s.t)("aiBot.preview.escFailed")||"consecutive fallback replies"),a.createElement("div",null,a.createElement("strong",null,(0,s.t)("aiBot.preview.escPhrases")||"Trigger phrases",":")," ",i.triggerPhrases.length>0?i.triggerPhrases.map(e=>`"${e}"`).join(", "):(0,s.t)("aiBot.preview.escNoPhrases")||"none")))),a.createElement("div",{style:x},(0,s.t)("aiBot.preview.qaPairsTitle")||"Q&A Pairs"," (",b.length,")"),0===b.length?a.createElement(hm,{colors:h,text:(0,s.t)("aiBot.preview.noQa")||"No enabled Q&A pairs."}):a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},b.map(e=>{const t=m===e.id;return a.createElement("div",{key:e.id,onClick:()=>p(t?null:e.id),style:{padding:"10px 12px",background:h.bgPrimary,border:`1px solid ${h.border}`,borderRadius:"var(--lion-radius-md, 8px)",cursor:"pointer"}},a.createElement("div",{style:{fontSize:"13px",fontWeight:600,color:h.textPrimary}},"Q: ",e.question),t&&a.createElement("div",{style:{marginTop:"6px",fontSize:"12px",color:h.textMuted}},"A: ",e.answer,e.category&&a.createElement("span",{style:{marginLeft:"8px",padding:"1px 6px",fontSize:"10px",fontWeight:700,color:"var(--lion-primary)",background:"rgba(var(--lion-primary-rgb), 0.12)",borderRadius:"999px"}},e.category)))})),a.createElement("div",{style:x},(0,s.t)("aiBot.preview.sourcesTitle")||"Training Sources"," (",f.length,")"),0===f.length?a.createElement(hm,{colors:h,text:(0,s.t)("aiBot.preview.noSources")||"No enabled sources."}):a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},f.map(e=>{const t=c===e.id;return a.createElement("div",{key:e.id,style:{background:h.bgPrimary,border:`1px solid ${h.border}`,borderRadius:"var(--lion-radius-md, 8px)",overflow:"hidden"}},a.createElement("div",{onClick:()=>d(t?null:e.id),style:{padding:"10px 12px",cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px"}},a.createElement("div",{style:{flex:1,minWidth:0}},a.createElement("div",{style:{fontSize:"13px",fontWeight:600,color:h.textPrimary,wordBreak:"break-word"}},a.createElement("span",{style:{display:"inline-block",marginRight:"6px",padding:"1px 6px",fontSize:"10px",fontWeight:700,color:"var(--lion-primary)",background:"rgba(var(--lion-primary-rgb), 0.12)",borderRadius:"var(--lion-radius-sm, 4px)"}},e.type.toUpperCase()),e.title),a.createElement("div",{style:{fontSize:"11px",color:h.textMuted,marginTop:"2px"}},e.chunks.length," ",1===e.chunks.length?(0,s.t)("aiBot.kb.chunkSingular")||"chunk":(0,s.t)("aiBot.kb.chunkPlural")||"chunks"," · ",e.sizeKB," KB")),a.createElement("span",{style:{fontSize:"14px",color:h.textMuted}},t?"▾":"▸")),t&&a.createElement("div",{style:{padding:"10px 12px",background:h.bgTertiary,borderTop:`1px solid ${h.border}`,maxHeight:"300px",overflowY:"auto"}},e.chunks.map((t,n)=>a.createElement("div",{key:n,style:{padding:"6px 0",fontSize:"12px",color:h.textMuted,borderBottom:n<e.chunks.length-1?`1px dashed ${h.border}`:"none",whiteSpace:"pre-wrap",wordBreak:"break-word"}},a.createElement("span",{style:{color:"var(--lion-primary)",fontWeight:700,marginRight:"6px"}},"#",n+1),t))))})))},fm="wa_ai_bot_test_chat_history";class vm{static getSessions(){try{const e=localStorage.getItem(fm);if(e){const t=JSON.parse(e);return Array.isArray(t)?t:[]}}catch(e){}return[]}static saveSessions(e){try{localStorage.setItem(fm,JSON.stringify(e))}catch(e){}}static addSession(e){const t=this.getSessions();t.unshift(e);const n=t.slice(0,10);return this.saveSessions(n),n}static updateSession(e,t){const n=this.getSessions(),a=n.findIndex(t=>t.id===e);if(-1!==a){n[a].messages=t,n[a].updatedAt=Date.now();const e=t.find(e=>"user"===e.role);e&&(n[a].title=e.content.substring(0,50)+(e.content.length>50?"...":"")),this.saveSessions(n)}return n}static deleteSession(e){const t=this.getSessions().filter(t=>t.id!==e);return this.saveSessions(t),t}static clearAll(){localStorage.removeItem(fm)}}const ym=({isOpen:e,onClose:t})=>{const[n,r]=(0,a.useState)(Sr.getSettings()),[o,i]=(0,a.useState)(!1),[l,c]=(0,a.useState)(null),[d,m]=(0,a.useState)("talkToAi"),[p,u]=(0,a.useState)([]),[g,h]=(0,a.useState)(""),[b,f]=(0,a.useState)(!1),v=(0,a.useRef)(null),[y,x]=(0,a.useState)(""),[w,k]=(0,a.useState)("aiBot"),[E,S]=(0,a.useState)([]),[C,T]=(0,a.useState)(null),[D,N]=(0,a.useState)(""),[M,R]=(0,a.useState)(!1),[B,P]=(0,a.useState)(null),[L,U]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{const e=()=>{const e=_();U("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]);const F={bgPrimary:L?"#1a1a1a":ca.bgPrimary,bgSecondary:L?"#262626":ca.bgSecondary,bgTertiary:L?"#333333":"#f3f4f6",textPrimary:L?"#ffffff":ca.textPrimary,textSecondary:L?"#a0a0a0":ca.textSecondary,textMuted:L?"#888888":ca.textMuted,borderLight:L?"#3a3a3a":ca.borderLight,inputBg:L?"#262626":"#ffffff",cardBg:L?"#262626":"#ffffff"},[z,O]=(0,a.useState)({qaCount:0,sourceCount:0,chunkCount:0}),[W,q]=(0,a.useState)(!1),H=async()=>{const[e,t]=await Promise.all([$r.getStats(),no.getRules()]);O(e),q(t.enabled)};(0,a.useEffect)(()=>{e&&(r(Sr.getSettings()),i(!1),$r.warmCache().then(()=>{H()}).catch(e=>{}))},[e]),(0,a.useEffect)(()=>{const e=()=>{r({...Sr.getSettings()})};return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{v.current&&v.current.scrollIntoView({behavior:"smooth"})},[p]);(0,a.useEffect)(()=>{e&&"talkToAi"===d&&S(vm.getSessions())},[e,d]);const j=E.filter(e=>{if(!D.trim())return!0;const t=D.toLowerCase();return!!e.title.toLowerCase().includes(t)||e.messages.some(e=>e.content.toLowerCase().includes(t))}),V=()=>{if(!y.trim())return;const e=n.stopKeywords?.keywords||[],t=y.trim().toLowerCase();e.includes(t)||r(n=>({...n,stopKeywords:{...n.stopKeywords,keywords:[...e,t]}})),x("")},G=async()=>{if(!g.trim()||b)return;const e={id:`msg-${Date.now()}`,role:"user",content:g.trim(),timestamp:Date.now()};let t=C;if(!t){const n={id:`session-${Date.now()}`,title:e.content.substring(0,50)+(e.content.length>50?"...":""),messages:[],createdAt:Date.now(),updatedAt:Date.now()},a=vm.addSession(n);S(a),t=n.id,T(t)}const a=[...p,e];u(a),h(""),f(!0);const r=vm.updateSession(t,a);S(r);try{const r=Gn.getSettings();if(!r.enabled||!r.apiKey)throw new Error((0,s.t)("aiBot.aiNotConfigured")||"AI not configured. Please set up AI API key first.");const o=n.contextMessageCount||30,i=p.slice(-o).map(e=>({role:e.role,content:e.content})),l=await Jr.processMessageWithSettings("test-preview@c.us","Test User",e.content,i,null,n,"global"===w);if(!l||!l.reply)throw new Error((0,s.t)("aiBot.noResponse")||"No response from AI");{const e={id:`msg-${Date.now()}`,role:"assistant",content:l.reply,timestamp:Date.now()},n=[...a,e];u(n);const r=vm.updateSession(t,n);S(r)}}catch(e){const n={id:`msg-${Date.now()}`,role:"assistant",content:`⚠️ ${e.message||"Error processing message"}`,timestamp:Date.now(),isError:!0},r=[...a,n];u(r);const o=vm.updateSession(t,r);S(o)}finally{f(!1)}},K=(e,t)=>{r(n=>({...n,[e]:t}))},$=(e,t)=>{r(n=>({...n,schedule:{...n.schedule,[e]:t}}))},Y=(e,t,n)=>{r(a=>({...a,schedule:{...a.schedule,[e]:{...a.schedule[e],[t]:n}}}))},X=e=>{r(t=>{const n={...t.schedule};return["monday","tuesday","wednesday","thursday","friday"].forEach(t=>{n[t]={...n[t],enabled:e}}),{...t,schedule:n}})},J=e=>{r(t=>{const n={...t.schedule};return["saturday","sunday"].forEach(t=>{n[t]={...n[t],enabled:e}}),{...t,schedule:n}})},Q=(e,t)=>{r(n=>({...n,replyTiming:{...n.replyTiming,[e]:t}}))},Z=(e,t)=>{r(n=>({...n,actionToggles:{...n.actionToggles,[e]:t}}))},ee=(e,t)=>{r(n=>({...n,actionPrompts:{...n.actionPrompts,[e]:t}}))},te=(e,t)=>{r(n=>({...n,appointmentConfig:{...n.appointmentConfig,[e]:t}}))};if(!e)return null;const ne=({checked:e,onChange:t,label:n,description:r})=>a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 0",borderBottom:`1px solid ${F.borderLight}`}},a.createElement("div",null,a.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:F.textPrimary}},n),r&&a.createElement("div",{style:{fontSize:"12px",color:F.textSecondary,marginTop:"2px"}},r)),a.createElement("button",{onClick:()=>t(!e),style:{width:"44px",height:"24px",borderRadius:"12px",border:"none",backgroundColor:e?ca.primary:F.borderLight,cursor:"pointer",position:"relative",transition:"background-color 0.2s"}},a.createElement("span",{style:{position:"absolute",top:"2px",left:e?"22px":"2px",width:"20px",height:"20px",borderRadius:"10px",backgroundColor:"#ffffff",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}}))),ae=({title:e,icon:t,infoTooltip:n})=>a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginBottom:"16px",paddingBottom:"12px",borderBottom:`1px solid ${F.borderLight}`}},a.createElement("div",{style:{width:"32px",height:"32px",borderRadius:"8px",backgroundColor:L?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15)":ca.primaryLight,display:"flex",alignItems:"center",justifyContent:"center"}},t),a.createElement("span",{style:{fontSize:"16px",fontWeight:600,color:F.textPrimary}},e),n&&a.createElement("div",{style:{position:"relative",display:"inline-flex",alignItems:"center",cursor:"help"},title:n},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},a.createElement("circle",{cx:"12",cy:"12",r:"10",stroke:F.textSecondary,strokeWidth:"2"}),a.createElement("path",{d:"M12 16v-4M12 8h.01",stroke:F.textSecondary,strokeWidth:"2",strokeLinecap:"round"}))));return a.createElement(a.Fragment,null,a.createElement("style",null,"\n        .chat-message-wrapper:hover .message-actions {\n          opacity: 1 !important;\n        }\n        @keyframes aiBotOverlayFade {\n          from { opacity: 0; }\n          to { opacity: 1; }\n        }\n        @keyframes aiBotModalPop {\n          from { opacity: 0; transform: translateY(8px) scale(0.985); }\n          to { opacity: 1; transform: translateY(0) scale(1); }\n        }\n        .ai-bot-modal .ai-bot-close-btn:hover {\n          background: rgba(239, 68, 68, 0.1) !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n          color: #ef4444 !important;\n          transform: rotate(90deg);\n        }\n        .ai-bot-modal .ai-nav-item {\n          transition: all 0.15s ease;\n        }\n        .ai-bot-modal .ai-nav-item:hover:not(.active) {\n          background: rgba(255,255,255,0.05);\n          color: #ffffff;\n        }\n        .ai-bot-modal .ai-input:focus {\n          outline: none;\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 4px rgba(var(--lion-primary-rgb), 0.12);\n        }\n        .ai-bot-modal .ai-primary-btn:hover:not(:disabled) {\n          transform: translateY(-1px);\n          box-shadow: 0 10px 22px rgba(var(--lion-primary-rgb), 0.42) !important;\n        }\n        .ai-bot-modal .ai-scroll::-webkit-scrollbar { width: 5px; }\n        .ai-bot-modal .ai-scroll::-webkit-scrollbar-thumb {\n          background: rgba(0,0,0,0.15);\n          border-radius: 5px;\n        }\n      "),a.createElement("div",{className:"ai-bot-overlay",style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.55)",backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,animation:"aiBotOverlayFade 0.18s ease"},onClick:e=>{e.target===e.currentTarget&&t()}},a.createElement("div",{className:"ai-bot-modal",style:{backgroundColor:F.bgPrimary,borderRadius:"16px",width:"92%",maxWidth:"1080px",height:"88vh",maxHeight:"720px",overflow:"hidden",boxShadow:"0 24px 60px rgba(0, 0, 0, 0.25), 0 8px 20px rgba(0, 0, 0, 0.08)",border:`1px solid ${F.borderLight}`,display:"flex",flexDirection:"column",animation:"aiBotModalPop 0.2s ease"}},a.createElement("div",{style:{padding:"20px 24px",borderBottom:`1px solid ${F.borderLight}`,display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:0,background:F.bgPrimary}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"14px",flex:1,minWidth:0}},a.createElement("div",{style:{width:"42px",height:"42px",borderRadius:"12px",background:"var(--lion-primary)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:"0 6px 16px rgba(var(--lion-primary-rgb), 0.32)"}},a.createElement("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#ffffff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),a.createElement("circle",{cx:"12",cy:"5",r:"2"}),a.createElement("path",{d:"M12 7v4"}),a.createElement("line",{x1:"8",y1:"16",x2:"8",y2:"16"}),a.createElement("line",{x1:"16",y1:"16",x2:"16",y2:"16"}))),a.createElement("div",{style:{flex:1,minWidth:0}},a.createElement("h2",{style:{margin:0,fontSize:"20px",fontWeight:700,color:F.textPrimary,letterSpacing:"-0.2px"}},(0,s.t)("aiBot.title")||"AI Bot"),a.createElement("p",{style:{margin:"4px 0 0",fontSize:"13px",color:F.textSecondary,lineHeight:1.4}},(0,s.t)("aiBot.subtitle")||"Configure automated AI responses"))),a.createElement("button",{className:"ai-bot-close-btn",onClick:t,"aria-label":"Close",style:{background:F.bgSecondary,border:`1px solid ${F.borderLight}`,cursor:"pointer",width:"36px",height:"36px",color:F.textSecondary,borderRadius:"10px",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.15s ease",flexShrink:0,marginLeft:"12px"}},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})))),a.createElement("div",{style:{display:"flex",gap:"10px",padding:"12px 22px",borderBottom:`1px solid ${F.borderLight}`,background:F.bgSecondary,flexShrink:0}},[{label:(0,s.t)("aiBot.preview.qaPairsLabel")||"Q&A Pairs",value:z.qaCount},{label:(0,s.t)("aiBot.preview.sourcesLabel")||"Sources",value:z.sourceCount},{label:(0,s.t)("aiBot.preview.chunksLabel")||"Chunks",value:z.chunkCount},{label:(0,s.t)("aiBot.tab.escalation")||"Escalation",value:W?(0,s.t)("aiBot.esc.statusOn")||"On":(0,s.t)("aiBot.esc.statusOff")||"Off",isStatus:!0,statusOn:W}].map((e,t)=>a.createElement("div",{key:t,style:{flex:1,padding:"10px 12px",background:F.bgPrimary,border:`1px solid ${F.borderLight}`,borderRadius:"10px",display:"flex",flexDirection:"column",gap:"2px",minWidth:0}},a.createElement("div",{style:{fontSize:"18px",fontWeight:800,color:e.isStatus?e.statusOn?"var(--lion-success, #10b981)":F.textMuted:"var(--lion-primary)",lineHeight:1.2}},e.value),a.createElement("div",{style:{fontSize:"11px",fontWeight:600,color:F.textMuted,textTransform:"uppercase",letterSpacing:"0.4px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},e.label)))),a.createElement("div",{style:{display:"flex",flex:1,minHeight:0,overflow:"hidden"}},a.createElement("nav",{style:{width:"210px",background:"linear-gradient(180deg, #1C2333 0%, #0F172A 100%)",borderRight:"1px solid rgba(255,255,255,0.06)",padding:"16px 10px",display:"flex",flexDirection:"column",gap:"4px",flexShrink:0}},a.createElement("div",{style:{padding:"4px 10px 10px",fontSize:"11px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.8px",color:"rgba(255,255,255,0.55)"}},(0,s.t)("aiBot.menu")||"Menu"),a.createElement("button",{className:"ai-nav-item "+("talkToAi"===d?"active":""),onClick:()=>m("talkToAi"),style:{padding:"10px 12px",borderRadius:"8px",border:"none",background:"talkToAi"===d?"var(--lion-primary)":"transparent",color:"talkToAi"===d?"#ffffff":"rgba(255,255,255,0.75)",textAlign:"left",cursor:"pointer",fontSize:"13px",fontWeight:"talkToAi"===d?600:500,display:"flex",alignItems:"center",gap:"10px",boxShadow:"talkToAi"===d?"0 4px 12px rgba(var(--lion-primary-rgb), 0.3)":"none"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2v10z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),(0,s.t)("aiBot.tab.testChat")||(0,s.t)("aiBot.talkToAI")||"Test Chat"),a.createElement("button",{className:"ai-nav-item "+("qaPairs"===d?"active":""),onClick:()=>m("qaPairs"),style:{padding:"10px 12px",borderRadius:"8px",border:"none",background:"qaPairs"===d?"var(--lion-primary)":"transparent",color:"qaPairs"===d?"#ffffff":"rgba(255,255,255,0.75)",textAlign:"left",cursor:"pointer",fontSize:"13px",fontWeight:"qaPairs"===d?600:500,display:"flex",alignItems:"center",gap:"10px",boxShadow:"qaPairs"===d?"0 4px 12px rgba(var(--lion-primary-rgb), 0.3)":"none"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("line",{x1:"12",y1:"17",x2:"12.01",y2:"17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),a.createElement("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"})),(0,s.t)("aiBot.tab.qaPairs")||"Q&A Pairs",z.qaCount>0&&a.createElement("span",{style:{marginLeft:"auto",fontSize:"10px",padding:"1px 6px",borderRadius:"999px",background:"rgba(255,255,255,0.18)"}},z.qaCount)),a.createElement("button",{className:"ai-nav-item "+("aiBehavior"===d?"active":""),onClick:()=>m("aiBehavior"),style:{padding:"10px 12px",borderRadius:"8px",border:"none",background:"aiBehavior"===d?"var(--lion-primary)":"transparent",color:"aiBehavior"===d?"#ffffff":"rgba(255,255,255,0.75)",textAlign:"left",cursor:"pointer",fontSize:"13px",fontWeight:"aiBehavior"===d?600:500,display:"flex",alignItems:"center",gap:"10px",boxShadow:"aiBehavior"===d?"0 4px 12px rgba(var(--lion-primary-rgb), 0.3)":"none"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M12 2L2 7l10 5 10-5-10-5z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M2 17l10 5 10-5M2 12l10 5 10-5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),(0,s.t)("aiBot.tab.aiBehavior")||"AI Behavior"),a.createElement("button",{className:"ai-nav-item "+("trainingData"===d?"active":""),onClick:()=>m("trainingData"),style:{padding:"10px 12px",borderRadius:"8px",border:"none",background:"trainingData"===d?"var(--lion-primary)":"transparent",color:"trainingData"===d?"#ffffff":"rgba(255,255,255,0.55)",textAlign:"left",cursor:"pointer",fontSize:"13px",fontWeight:"trainingData"===d?600:500,display:"flex",alignItems:"center",gap:"10px",boxShadow:"trainingData"===d?"0 4px 12px rgba(var(--lion-primary-rgb), 0.3)":"none"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),(0,s.t)("aiBot.tab.trainingData")||"Training Data",z.sourceCount>0&&a.createElement("span",{style:{marginLeft:"auto",fontSize:"10px",padding:"1px 6px",borderRadius:"999px",background:"rgba(255,255,255,0.18)"}},z.sourceCount)),a.createElement("button",{className:"ai-nav-item "+("escalation"===d?"active":""),onClick:()=>m("escalation"),style:{padding:"10px 12px",borderRadius:"8px",border:"none",background:"escalation"===d?"var(--lion-primary)":"transparent",color:"escalation"===d?"#ffffff":"rgba(255,255,255,0.55)",textAlign:"left",cursor:"pointer",fontSize:"13px",fontWeight:"escalation"===d?600:500,display:"flex",alignItems:"center",gap:"10px",boxShadow:"escalation"===d?"0 4px 12px rgba(var(--lion-primary-rgb), 0.3)":"none"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M16 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("circle",{cx:"8.5",cy:"7",r:"4",stroke:"currentColor",strokeWidth:"2"})),(0,s.t)("aiBot.tab.escalation")||"Escalation"),a.createElement("button",{className:"ai-nav-item "+("dataPreview"===d?"active":""),onClick:()=>m("dataPreview"),style:{padding:"10px 12px",borderRadius:"8px",border:"none",background:"dataPreview"===d?"var(--lion-primary)":"transparent",color:"dataPreview"===d?"#ffffff":"rgba(255,255,255,0.55)",textAlign:"left",cursor:"pointer",fontSize:"13px",fontWeight:"dataPreview"===d?600:500,display:"flex",alignItems:"center",gap:"10px",boxShadow:"dataPreview"===d?"0 4px 12px rgba(var(--lion-primary-rgb), 0.3)":"none"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("polyline",{points:"14 2 14 8 20 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),(0,s.t)("aiBot.tab.dataPreview")||"Data Preview"),a.createElement("button",{className:"ai-nav-item "+("promptSettings"===d?"active":""),onClick:()=>m("promptSettings"),style:{padding:"10px 12px",borderRadius:"8px",border:"none",background:"promptSettings"===d?"var(--lion-primary)":"transparent",color:"promptSettings"===d?"#ffffff":"rgba(255,255,255,0.75)",textAlign:"left",cursor:"pointer",fontSize:"13px",fontWeight:"promptSettings"===d?600:500,display:"flex",alignItems:"center",gap:"10px",boxShadow:"promptSettings"===d?"0 4px 12px rgba(var(--lion-primary-rgb), 0.3)":"none"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),(0,s.t)("aiBot.tab.actionPrompts")||"Action Prompts"),a.createElement("button",{className:"ai-nav-item "+("settings"===d?"active":""),onClick:()=>m("settings"),style:{padding:"10px 12px",borderRadius:"8px",border:"none",background:"settings"===d?"var(--lion-primary)":"transparent",color:"settings"===d?"#ffffff":"rgba(255,255,255,0.75)",textAlign:"left",cursor:"pointer",fontSize:"13px",fontWeight:"settings"===d?600:500,display:"flex",alignItems:"center",gap:"10px",boxShadow:"settings"===d?"0 4px 12px rgba(var(--lion-primary-rgb), 0.3)":"none"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M12 15a3 3 0 100-6 3 3 0 000 6z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 0 2 2 0 010 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),(0,s.t)("aiBot.tab.scheduleTiming")||"Schedule & Timing")),a.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"}},"talkToAi"===d?a.createElement("div",{style:{display:"flex",height:"100%",background:F.bgPrimary}},a.createElement("div",{style:{width:"220px",borderRight:`1px solid ${F.borderLight}`,display:"flex",flexDirection:"column",background:F.bgSecondary,flexShrink:0}},a.createElement("div",{style:{padding:"12px",borderBottom:`1px solid ${F.borderLight}`}},a.createElement("div",{style:{display:"flex",gap:"6px",marginBottom:"10px"}},a.createElement("button",{onClick:()=>{u([]),h(""),T(null)},style:{flex:1,padding:"9px 12px",borderRadius:"10px",border:"1px solid var(--lion-primary)40",background:"rgba(var(--lion-primary-rgb), 0.08)",color:ca.primary,fontSize:"12px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",transition:"all 0.15s ease",letterSpacing:"0.2px"}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M12 5v14M5 12h14",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})),(0,s.t)("aiBot.newChat")||"New Chat"),a.createElement("button",{onClick:()=>E.length>0&&R(!0),disabled:0===E.length,style:{padding:"9px 10px",borderRadius:"10px",border:`1px solid ${F.borderLight}`,background:F.bgPrimary,color:F.textSecondary,fontSize:"12px",fontWeight:500,cursor:0===E.length?"not-allowed":"pointer",opacity:0===E.length?.5:1,transition:"all 0.15s ease",display:"flex",alignItems:"center",justifyContent:"center"},title:(0,s.t)("aiBot.clearAll")||"Clear All"},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M3 6h18M8 6V4a2 2 0 012-2h4a2 2 0 012 2v2m3 0v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6h14z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))),a.createElement("div",{style:{position:"relative"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",style:{position:"absolute",left:"10px",top:"50%",transform:"translateY(-50%)",color:F.textSecondary}},a.createElement("circle",{cx:"11",cy:"11",r:"8",stroke:"currentColor",strokeWidth:"2"}),a.createElement("path",{d:"M21 21l-4.35-4.35",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})),a.createElement("input",{className:"ai-input",type:"text",value:D,onChange:e=>N(e.target.value),placeholder:(0,s.t)("aiBot.searchChats")||"Search chats...",style:{width:"100%",padding:"9px 12px 9px 32px",borderRadius:"10px",border:`1px solid ${F.borderLight}`,fontSize:"12px",outline:"none",background:F.inputBg,color:F.textPrimary,boxSizing:"border-box",transition:"all 0.15s ease"}}))),a.createElement("div",{style:{flex:1,overflowY:"auto",padding:"8px"}},0===j.length?a.createElement("div",{style:{padding:"24px 16px",textAlign:"center",color:F.textSecondary}},a.createElement("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",style:{marginBottom:"8px",opacity:.5}},a.createElement("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2v10z",stroke:"currentColor",strokeWidth:"1.5"})),a.createElement("p",{style:{fontSize:"13px",margin:0}},D?(0,s.t)("aiBot.noSearchResults")||"No chats found":(0,s.t)("aiBot.noChatsYet")||"No chat history yet")):j.map(e=>a.createElement("div",{key:e.id,onClick:()=>(e=>{const t=E.find(t=>t.id===e);t&&(T(e),u(t.messages))})(e.id),style:{padding:"12px",marginBottom:"4px",borderRadius:"8px",cursor:"pointer",background:C===e.id?L?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15)":ca.primaryLight:"transparent",borderLeft:C===e.id?"3px solid var(--lion-primary)":"3px solid transparent",transition:"all 0.15s"},onMouseEnter:t=>{C!==e.id&&(t.currentTarget.style.background=L?"rgba(255,255,255,0.05)":"rgba(0,0,0,0.03)")},onMouseLeave:t=>{C!==e.id&&(t.currentTarget.style.background="transparent")}},a.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"}},a.createElement("div",{style:{flex:1,minWidth:0}},a.createElement("div",{style:{fontSize:"13px",fontWeight:500,color:F.textPrimary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginBottom:"4px"}},e.title||(0,s.t)("aiBot.newChat")||"New Chat"),a.createElement("div",{style:{fontSize:"11px",color:F.textSecondary}},(e=>{const t=new Date(e),n=new Date,a=new Date(n);return a.setDate(a.getDate()-1),t.toDateString()===n.toDateString()?(0,s.t)("aiBot.today")||"Today":t.toDateString()===a.toDateString()?(0,s.t)("aiBot.yesterday")||"Yesterday":t.toLocaleDateString()})(e.updatedAt)," · ",e.messages.length," ",(0,s.t)("aiBot.messages")||"messages")),a.createElement("button",{onClick:t=>((e,t)=>{t.stopPropagation();const n=vm.deleteSession(e);S(n),C===e&&(T(null),u([]))})(e.id,t),style:{padding:"4px",borderRadius:"4px",border:"none",background:"transparent",color:F.textSecondary,cursor:"pointer",opacity:.6,transition:"all 0.15s"},onMouseEnter:e=>{e.currentTarget.style.color=ca.error,e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.color=F.textSecondary,e.currentTarget.style.opacity="0.6"},title:(0,s.t)("aiBot.deleteChat")||"Delete chat"},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M3 6h18M8 6V4a2 2 0 012-2h4a2 2 0 012 2v2m3 0v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6h14z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))))))),a.createElement("div",{style:{padding:"12px 16px",borderTop:`1px solid ${F.borderLight}`,fontSize:"12px",color:F.textSecondary,textAlign:"center"}},E.length,"/",10," ",(0,s.t)("aiBot.chatsStored")||"chats stored")),a.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",minWidth:0}},a.createElement("div",{style:{padding:"14px 20px",borderBottom:`1px solid ${F.borderLight}`,background:F.bgPrimary,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",flexShrink:0}},a.createElement("div",{style:{flex:1,minWidth:0}},a.createElement("h3",{style:{margin:0,fontSize:"15px",fontWeight:700,color:F.textPrimary,letterSpacing:"-0.1px"}},(0,s.t)("aiBot.testYourBot")||"Test Your AI Bot"),a.createElement("p",{style:{margin:"2px 0 0",fontSize:"12px",color:F.textSecondary,lineHeight:1.4}},(0,s.t)("aiBot.testDescription")||"Messages use current settings (unsaved changes included)"),a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"10px",flexWrap:"wrap"}},a.createElement("span",{style:{fontSize:"10px",color:F.textSecondary,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.6px"}},(0,s.t)("aiBot.responseMode")||"Response Mode"),a.createElement("div",{style:{display:"flex",borderRadius:"999px",padding:"3px",background:F.bgSecondary,border:`1px solid ${F.borderLight}`,gap:"2px"}},a.createElement("button",{onClick:()=>k("aiBot"),style:{padding:"5px 14px",border:"none",borderRadius:"999px",background:"aiBot"===w?F.bgPrimary:"transparent",color:"aiBot"===w?ca.primary:F.textSecondary,fontSize:"11px",fontWeight:600,cursor:"pointer",transition:"all 0.15s ease",boxShadow:"aiBot"===w?"0 1px 3px rgba(0,0,0,0.08)":"none",letterSpacing:"0.2px"}},(0,s.t)("aiBot.aiBotPrompt")||"AI Bot Prompt"),a.createElement("button",{onClick:()=>k("global"),style:{padding:"5px 14px",border:"none",borderRadius:"999px",background:"global"===w?F.bgPrimary:"transparent",color:"global"===w?ca.primary:F.textSecondary,fontSize:"11px",fontWeight:600,cursor:"pointer",transition:"all 0.15s ease",boxShadow:"global"===w?"0 1px 3px rgba(0,0,0,0.08)":"none",letterSpacing:"0.2px"}},(0,s.t)("aiBot.globalChatGPT")||"Global ChatGPT")))),a.createElement("button",{onClick:()=>{u([]),h(""),T(null)},style:{padding:"8px 14px",borderRadius:"10px",border:`1px solid ${F.borderLight}`,background:F.bgSecondary,color:F.textSecondary,fontSize:"12px",fontWeight:600,cursor:"pointer",transition:"all 0.15s ease",alignSelf:"flex-start",flexShrink:0,letterSpacing:"0.2px"}},(0,s.t)("aiBot.clearChat")||"Clear Chat")),a.createElement("div",{style:{flex:1,overflowY:"auto",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"16px",background:F.bgSecondary}},0===p.length?a.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:F.textSecondary,textAlign:"center",padding:"40px"}},a.createElement("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",style:{marginBottom:"16px",opacity:.5}},a.createElement("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2v10z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),a.createElement("p",{style:{fontSize:"14px",margin:0}},(0,s.t)("aiBot.noMessages")||"Type a message to test how your AI Bot will respond")):p.map(e=>{return a.createElement("div",{key:e.id,className:"chat-message-wrapper",style:{maxWidth:"80%",alignSelf:"user"===e.role?"flex-end":"flex-start",position:"relative"}},a.createElement("div",{style:{padding:"12px 16px",borderRadius:"16px",background:"user"===e.role?"var(--lion-primary)":e.isError?"rgba(239, 68, 68, 0.1)":F.cardBg,color:"user"===e.role?"#ffffff":e.isError?ca.error:F.textPrimary,borderBottomRightRadius:"user"===e.role?"4px":"16px",borderBottomLeftRadius:"assistant"===e.role?"4px":"16px",border:"assistant"!==e.role||e.isError?"none":`1px solid ${F.borderLight}`}},a.createElement("div",{id:`msg-content-${e.id}`,style:{fontSize:"14px",lineHeight:1.5,whiteSpace:"pre-wrap",userSelect:"text"}},e.content),a.createElement("div",{style:{fontSize:"11px",marginTop:"6px",opacity:.7,textAlign:"user"===e.role?"right":"left"}},(t=e.timestamp,new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})))),!e.isError&&a.createElement("div",{className:"message-actions",style:{display:"flex",gap:"4px",marginTop:"4px",opacity:0,transition:"opacity 0.2s",justifyContent:"user"===e.role?"flex-end":"flex-start"}},a.createElement("button",{onClick:()=>(async(e,t)=>{try{await navigator.clipboard.writeText(t),P(e),setTimeout(()=>P(null),2e3)}catch(e){}})(e.id,e.content),title:(0,s.t)("aiBot.copy")||"Copy",style:{padding:"4px 8px",borderRadius:"4px",border:`1px solid ${F.borderLight}`,background:B===e.id?ca.success:F.cardBg,color:B===e.id?"#ffffff":F.textSecondary,cursor:"pointer",fontSize:"11px",display:"flex",alignItems:"center",gap:"4px"}},B===e.id?"✓":"📋"," ",B===e.id?(0,s.t)("aiBot.copied")||"Copied!":(0,s.t)("aiBot.copy")||"Copy")));var t}),b&&a.createElement("div",{style:{alignSelf:"flex-start",padding:"12px 16px",background:F.cardBg,borderRadius:"16px",borderBottomLeftRadius:"4px",color:F.textSecondary,fontStyle:"italic",fontSize:"14px",border:`1px solid ${F.borderLight}`}},(0,s.t)("aiBot.aiTyping")||"AI is typing..."),a.createElement("div",{ref:v})),a.createElement("div",{style:{padding:"12px 20px",borderTop:`1px solid ${F.borderLight}`,display:"flex",gap:"10px",background:F.bgPrimary,flexShrink:0}},a.createElement("textarea",{className:"ai-input",value:g,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),G())},placeholder:(0,s.t)("aiBot.typeTestMessage")||"Type a test message...",disabled:b,style:{flex:1,padding:"11px 14px",border:`1px solid ${F.borderLight}`,borderRadius:"10px",resize:"none",fontSize:"13px",fontFamily:"inherit",minHeight:"42px",maxHeight:"120px",outline:"none",transition:"all 0.15s ease",background:F.inputBg,color:F.textPrimary,boxSizing:"border-box"}}),a.createElement("button",{className:"ai-primary-btn",onClick:G,disabled:b||!g.trim(),style:{padding:"0 20px",background:b||!g.trim()?F.borderLight:"var(--lion-primary)",color:b||!g.trim()?F.textSecondary:"#ffffff",border:"1px solid transparent",borderRadius:"10px",cursor:b||!g.trim()?"not-allowed":"pointer",fontWeight:600,fontSize:"13px",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"8px",boxShadow:b||!g.trim()?"none":"0 6px 16px rgba(var(--lion-primary-rgb), 0.32)",letterSpacing:"0.2px",alignSelf:"flex-start",height:"42px"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),(0,s.t)("aiBot.send")||"Send")))):"qaPairs"===d?a.createElement("div",{style:{flex:1,overflowY:"auto",minHeight:0,background:F.bgPrimary}},a.createElement(ro,{isDarkMode:L,onChange:H})):"aiBehavior"===d?a.createElement("div",{style:{flex:1,overflowY:"auto",minHeight:0,background:F.bgPrimary}},a.createElement(so,{isDarkMode:L,botSettings:n,onBotSettingsChange:e=>r(e),onChange:H})):"trainingData"===d?a.createElement("div",{style:{flex:1,overflowY:"auto",minHeight:0,background:F.bgPrimary}},a.createElement(um,{isDarkMode:L,onChange:H})):"escalation"===d?a.createElement("div",{style:{flex:1,overflowY:"auto",minHeight:0,background:F.bgPrimary}},a.createElement(gm,{isDarkMode:L})):"dataPreview"===d?a.createElement("div",{style:{flex:1,overflowY:"auto",minHeight:0,background:F.bgPrimary}},a.createElement(bm,{isDarkMode:L})):"promptSettings"===d?a.createElement("div",{style:{padding:"24px 28px",flex:1,overflowY:"auto",minHeight:0}},a.createElement("div",{style:{marginBottom:"28px",padding:"12px 14px",background:"var(--lion-info-light)",border:"1px solid var(--lion-info)",borderRadius:"10px",fontSize:"13px",color:F.textPrimary}},"ℹ️ ",(0,s.t)("aiBot.businessPromptMoved")||"Business Prompt has moved to the AI Behavior tab. Edit it there — your existing prompt is preserved."),a.createElement("div",{style:{marginBottom:"28px",padding:"12px 14px",background:"var(--lion-info-light)",border:"1px solid var(--lion-info)",borderRadius:"10px",fontSize:"13px",color:F.textPrimary}},"ℹ️ ",(0,s.t)("aiBot.fallbackMoved")||"Fallback Reply has moved to the AI Behavior tab. Your existing message is preserved automatically."),a.createElement("div",{style:{marginBottom:"28px"}},a.createElement(ae,{title:(0,s.t)("aiBot.actionPrompts")||"Action Prompts",icon:a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M9 11l3 3L22 4",stroke:ca.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11",stroke:ca.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))}),a.createElement("p",{style:{fontSize:"13px",color:F.textSecondary,marginBottom:"16px"}},(0,s.t)("aiBot.actionPromptsDesc")||"Configure custom prompts for different AI actions"),a.createElement(ne,{checked:n.actionToggles.normalReply,onChange:e=>Z("normalReply",e),label:(0,s.t)("aiBot.actionNormalReply")||"Send Replies",description:(0,s.t)("aiBot.actionNormalReplyDesc")||"AI can send text messages"}),a.createElement("div",{style:{marginBottom:"16px"}},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 0",borderBottom:`1px solid ${F.borderLight}`}},a.createElement("div",null,a.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:F.textPrimary}},(0,s.t)("aiBot.actionTabs")||"Update Tabs"),a.createElement("div",{style:{fontSize:"12px",color:F.textSecondary,marginTop:"2px"}},(0,s.t)("aiBot.actionTabsDesc")||"Add/remove contacts from custom tabs")),a.createElement("button",{onClick:()=>Z("updateTabs",!n.actionToggles.updateTabs),style:{width:"44px",height:"24px",borderRadius:"12px",border:"none",backgroundColor:n.actionToggles.updateTabs?ca.primary:F.borderLight,cursor:"pointer",position:"relative",transition:"background-color 0.2s"}},a.createElement("span",{style:{position:"absolute",top:"2px",left:n.actionToggles.updateTabs?"22px":"2px",width:"20px",height:"20px",borderRadius:"10px",backgroundColor:"#ffffff",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}}))),a.createElement("div",{style:{padding:"12px 0"}},a.createElement("label",{style:{display:"block",fontSize:"12px",fontWeight:500,color:F.textSecondary,marginBottom:"6px"}},(0,s.t)("aiBot.tabsPromptLabel")||"Custom instructions for tab management:"),a.createElement("textarea",{value:n.actionPrompts.updateTabs,onChange:e=>ee("updateTabs",e.target.value),placeholder:(0,s.t)("aiBot.tabsPromptPlaceholder")||'E.g., If user asks about SEO services, add to "SEO Leads" tab. If user mentions web development, add to "Web Dev Leads" tab.',style:{width:"100%",minHeight:"80px",padding:"10px 12px",borderRadius:"8px",border:`1px solid ${F.borderLight}`,backgroundColor:F.inputBg,fontSize:"13px",color:F.textPrimary,resize:"vertical",fontFamily:"inherit",outline:"none"}}))),a.createElement(ne,{checked:n.actionToggles.updateProfile,onChange:e=>Z("updateProfile",e),label:(0,s.t)("aiBot.actionProfile")||"Update Profile",description:(0,s.t)("aiBot.actionProfileDesc")||"Extract and save contact info from conversation"}),a.createElement("div",{style:{marginBottom:"16px"}},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 0",borderBottom:`1px solid ${F.borderLight}`}},a.createElement("div",null,a.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:F.textPrimary}},(0,s.t)("aiBot.actionAppointment")||"Create Appointments"),a.createElement("div",{style:{fontSize:"12px",color:F.textSecondary,marginTop:"2px"}},(0,s.t)("aiBot.actionAppointmentDesc")||"Schedule appointments from conversation")),a.createElement("button",{onClick:()=>Z("createAppointment",!n.actionToggles.createAppointment),style:{width:"44px",height:"24px",borderRadius:"12px",border:"none",backgroundColor:n.actionToggles.createAppointment?ca.primary:F.borderLight,cursor:"pointer",position:"relative",transition:"background-color 0.2s"}},a.createElement("span",{style:{position:"absolute",top:"2px",left:n.actionToggles.createAppointment?"22px":"2px",width:"20px",height:"20px",borderRadius:"10px",backgroundColor:"#ffffff",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}}))),a.createElement("div",{style:{padding:"12px 0"}},a.createElement("div",{style:{marginBottom:"16px"}},a.createElement("label",{style:{display:"block",fontSize:"12px",fontWeight:500,color:F.textSecondary,marginBottom:"6px"}},(0,s.t)("aiBot.meetingLinkLabel")||"Google Meet Link:"),a.createElement("input",{type:"text",value:n.appointmentConfig?.meetLink||"",onChange:e=>te("meetLink",e.target.value),placeholder:(0,s.t)("aiBot.meetingLinkPlaceholder")||"https://meet.google.com/xxx-xxxx-xxx",style:{width:"100%",padding:"10px 12px",borderRadius:"8px",border:`1px solid ${F.borderLight}`,backgroundColor:F.inputBg,fontSize:"13px",color:F.textPrimary,outline:"none"}}),a.createElement("p",{style:{fontSize:"11px",color:F.textSecondary,marginTop:"4px"}},(0,s.t)("aiBot.meetingLinkDesc")||"This link will be used for all AI-created appointments")),a.createElement("div",{style:{marginBottom:"16px"}},a.createElement("label",{style:{display:"block",fontSize:"12px",fontWeight:500,color:F.textSecondary,marginBottom:"6px"}},(0,s.t)("aiBot.messageTemplateLabel")||"Message Template:"),a.createElement("div",{style:{display:"flex",gap:"6px",marginBottom:"8px",flexWrap:"wrap"}},[{token:"{name}",label:(0,s.t)("aiBot.varName")||"Name"},{token:"{date}",label:(0,s.t)("aiBot.varDate")||"Date"},{token:"{time}",label:(0,s.t)("aiBot.varTime")||"Time"},{token:"{link}",label:(0,s.t)("aiBot.varLink")||"Link"}].map(e=>a.createElement("button",{key:e.token,onClick:()=>(e=>{const t=document.getElementById("appointmentMessageTemplate");if(t){const a=t.selectionStart,r=t.selectionEnd,o=n.appointmentConfig?.messageTemplate||"",i=o.substring(0,a)+e+o.substring(r);te("messageTemplate",i),setTimeout(()=>{t.focus(),t.setSelectionRange(a+e.length,a+e.length)},0)}else te("messageTemplate",(n.appointmentConfig?.messageTemplate||"")+e)})(e.token),style:{padding:"4px 10px",borderRadius:"14px",border:`1px solid ${F.borderLight}`,backgroundColor:F.cardBg,color:F.textSecondary,fontSize:"12px",cursor:"pointer",transition:"all 0.2s"}},e.label))),a.createElement("textarea",{id:"appointmentMessageTemplate",value:n.appointmentConfig?.messageTemplate||"",onChange:e=>te("messageTemplate",e.target.value),placeholder:(0,s.t)("aiBot.messageTemplatePlaceholder")||"Olá {name}, seu compromisso está agendado para {date} às {time}. Participe aqui: {link}",style:{width:"100%",minHeight:"80px",padding:"10px 12px",borderRadius:"8px",border:`1px solid ${F.borderLight}`,backgroundColor:F.inputBg,fontSize:"13px",color:F.textPrimary,resize:"vertical",fontFamily:"inherit",outline:"none"}}),a.createElement("p",{style:{fontSize:"11px",color:F.textSecondary,marginTop:"4px"}},(0,s.t)("aiBot.messageTemplateDesc")||"This message will be sent as appointment reminder")),a.createElement("div",{style:{marginBottom:"16px"}},a.createElement("label",{style:{display:"block",fontSize:"12px",fontWeight:500,color:F.textSecondary,marginBottom:"6px"}},(0,s.t)("aiBot.officeHoursLabel")||"Office Hours (Appointment Timing):"),a.createElement("div",{style:{display:"flex",gap:"12px",alignItems:"center"}},a.createElement("div",{style:{flex:1}},a.createElement("label",{style:{fontSize:"11px",color:F.textSecondary,marginBottom:"4px",display:"block"}},(0,s.t)("aiBot.startTime")||"Start"),a.createElement("input",{type:"time",value:n.appointmentConfig?.officeHoursStart||"09:00",onChange:e=>te("officeHoursStart",e.target.value),style:{width:"100%",padding:"8px 10px",borderRadius:"6px",border:`1px solid ${F.borderLight}`,backgroundColor:F.inputBg,fontSize:"13px",color:F.textPrimary,outline:"none"}})),a.createElement("span",{style:{color:F.textSecondary,marginTop:"18px"}},(0,s.t)("aiBot.to")||"to"),a.createElement("div",{style:{flex:1}},a.createElement("label",{style:{fontSize:"11px",color:F.textSecondary,marginBottom:"4px",display:"block"}},(0,s.t)("aiBot.endTime")||"End"),a.createElement("input",{type:"time",value:n.appointmentConfig?.officeHoursEnd||"19:00",onChange:e=>te("officeHoursEnd",e.target.value),style:{width:"100%",padding:"8px 10px",borderRadius:"6px",border:`1px solid ${F.borderLight}`,backgroundColor:F.inputBg,fontSize:"13px",color:F.textPrimary,outline:"none"}}))),a.createElement("p",{style:{fontSize:"11px",color:F.textSecondary,marginTop:"4px"}},(0,s.t)("aiBot.officeHoursDesc")||"AI will only schedule appointments within these hours")),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px",marginBottom:"16px",borderRadius:"8px",backgroundColor:n.appointmentConfig?.sendMessageImmediately?L?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15)":ca.primaryLight:F.bgSecondary,border:`1px solid ${n.appointmentConfig?.sendMessageImmediately?ca.primary:F.borderLight}`}},a.createElement("div",null,a.createElement("div",{style:{fontSize:"13px",fontWeight:500,color:F.textPrimary}},(0,s.t)("aiBot.sendMessageNow")||"Send message immediately"),a.createElement("div",{style:{fontSize:"11px",color:F.textSecondary,marginTop:"2px"}},(0,s.t)("aiBot.sendMessageNowDesc")||"Send appointment message right after creating")),a.createElement("button",{onClick:()=>te("sendMessageImmediately",!n.appointmentConfig?.sendMessageImmediately),style:{width:"40px",height:"22px",borderRadius:"11px",border:"none",backgroundColor:n.appointmentConfig?.sendMessageImmediately?ca.primary:F.borderLight,cursor:"pointer",position:"relative",transition:"background-color 0.2s"}},a.createElement("span",{style:{position:"absolute",top:"2px",left:n.appointmentConfig?.sendMessageImmediately?"20px":"2px",width:"18px",height:"18px",borderRadius:"9px",backgroundColor:"#ffffff",transition:"left 0.2s",boxShadow:"0 1px 2px rgba(0,0,0,0.2)"}}))),a.createElement("div",null,a.createElement("label",{style:{display:"block",fontSize:"12px",fontWeight:500,color:F.textSecondary,marginBottom:"6px"}},(0,s.t)("aiBot.appointmentPromptLabel")||"Custom AI instructions:"),a.createElement("textarea",{value:n.actionPrompts.createAppointment,onChange:e=>ee("createAppointment",e.target.value),placeholder:(0,s.t)("aiBot.appointmentPromptPlaceholder")||"E.g., When scheduling appointments, always suggest slots between 10 AM - 6 PM. Minimum notice: 24 hours.",style:{width:"100%",minHeight:"60px",padding:"10px 12px",borderRadius:"8px",border:`1px solid ${F.borderLight}`,backgroundColor:F.inputBg,fontSize:"13px",color:F.textPrimary,resize:"vertical",fontFamily:"inherit",outline:"none"}})))))):a.createElement("div",{style:{padding:"24px 28px",flex:1,overflowY:"auto",minHeight:0}},a.createElement("div",{style:{backgroundColor:n.enabled?L?"rgba(16, 185, 129, 0.15)":ca.successLight:F.bgSecondary,border:`1px solid ${n.enabled?ca.success:F.borderLight}`,borderRadius:"12px",padding:"16px 20px",marginBottom:"24px"}},a.createElement(ne,{checked:n.enabled,onChange:e=>K("enabled",e),label:(0,s.t)("aiBot.enableBot")||"Enable AI Bot",description:(0,s.t)("aiBot.enableBotDesc")||"Automatically respond to incoming messages"})),a.createElement("div",{style:{backgroundColor:n.replyInGroups?L?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15)":ca.primaryLight:F.bgSecondary,border:`1px solid ${n.replyInGroups?ca.primary:F.borderLight}`,borderRadius:"12px",padding:"16px 20px",marginBottom:"24px"}},a.createElement(ne,{checked:n.replyInGroups||!1,onChange:e=>K("replyInGroups",e),label:(0,s.t)("aiBot.replyInGroups")||"Reply in Groups",description:(0,s.t)("aiBot.replyInGroupsDesc")||"Allow AI Bot to respond in group chats (disabled by default)"})),a.createElement("div",{style:{marginBottom:"24px",padding:"12px 14px",background:"var(--lion-info-light)",border:"1px solid var(--lion-info)",borderRadius:"12px",fontSize:"13px",color:F.textPrimary}},"ℹ️ ",(0,s.t)("aiBot.generalKnowledgeMoved")||'"Allow AI to use General Knowledge" toggle has moved to the AI Behavior tab.'),a.createElement("div",{style:{marginBottom:"28px"}},a.createElement(ae,{title:(0,s.t)("aiBot.schedule")||"Bot Hours",icon:a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none"},a.createElement("circle",{cx:"12",cy:"12",r:"10",stroke:ca.primary,strokeWidth:"2"}),a.createElement("path",{d:"M12 6v6l4 2",stroke:ca.primary,strokeWidth:"2",strokeLinecap:"round"}))}),a.createElement(ne,{checked:n.schedule.enabled,onChange:e=>$("enabled",e),label:(0,s.t)("aiBot.scheduleEnabled")||"Enable Schedule",description:(0,s.t)("aiBot.scheduleEnabledDesc")||"Bot only responds during specified days and hours"}),n.schedule.enabled&&a.createElement("div",{style:{marginTop:"16px"}},a.createElement("div",{style:{marginBottom:"16px"}},a.createElement("label",{style:{display:"block",fontSize:"13px",fontWeight:500,color:F.textSecondary,marginBottom:"6px"}},(0,s.t)("aiBot.timezone")||"Timezone"),a.createElement("select",{value:n.schedule.timezone,onChange:e=>$("timezone",e.target.value),style:{width:"100%",padding:"10px 14px",borderRadius:"8px",border:`1px solid ${F.borderLight}`,backgroundColor:F.inputBg,fontSize:"14px",color:F.textPrimary,outline:"none",cursor:"pointer"}},["Asia","Middle East","Europe","Americas","Africa","Oceania"].map(e=>a.createElement("optgroup",{key:e,label:e},kr.filter(t=>t.region===e).map(e=>a.createElement("option",{key:e.value,value:e.value},e.label)))))),a.createElement("div",{style:{display:"flex",gap:"8px",marginBottom:"16px",flexWrap:"wrap"}},a.createElement("button",{onClick:()=>X(!0),style:{padding:"6px 12px",borderRadius:"6px",border:"1px solid var(--lion-primary)",backgroundColor:"transparent",color:ca.primary,fontSize:"12px",fontWeight:500,cursor:"pointer"}},(0,s.t)("aiBot.enableWeekdays")||"Enable Weekdays"),a.createElement("button",{onClick:()=>X(!1),style:{padding:"6px 12px",borderRadius:"6px",border:`1px solid ${F.borderLight}`,backgroundColor:"transparent",color:F.textSecondary,fontSize:"12px",fontWeight:500,cursor:"pointer"}},(0,s.t)("aiBot.disableWeekdays")||"Disable Weekdays"),a.createElement("button",{onClick:()=>J(!0),style:{padding:"6px 12px",borderRadius:"6px",border:"1px solid var(--lion-primary)",backgroundColor:"transparent",color:ca.primary,fontSize:"12px",fontWeight:500,cursor:"pointer"}},(0,s.t)("aiBot.enableWeekends")||"Enable Weekends"),a.createElement("button",{onClick:()=>J(!1),style:{padding:"6px 12px",borderRadius:"6px",border:`1px solid ${F.borderLight}`,backgroundColor:"transparent",color:F.textSecondary,fontSize:"12px",fontWeight:500,cursor:"pointer"}},(0,s.t)("aiBot.disableWeekends")||"Disable Weekends")),a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"16px",padding:"10px 12px",backgroundColor:L?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15)":ca.primaryLight,borderRadius:"8px"}},a.createElement("span",{style:{fontSize:"12px",color:F.textSecondary,whiteSpace:"nowrap"}},(0,s.t)("aiBot.applyToAll")||"Apply to all:"),a.createElement("input",{type:"time",defaultValue:"09:00",id:"applyAllStart",style:{padding:"6px 8px",borderRadius:"6px",border:`1px solid ${F.borderLight}`,backgroundColor:F.inputBg,fontSize:"13px",color:F.textPrimary,outline:"none",width:"100px"}}),a.createElement("span",{style:{color:F.textSecondary}},"-"),a.createElement("input",{type:"time",defaultValue:"18:00",id:"applyAllEnd",style:{padding:"6px 8px",borderRadius:"6px",border:`1px solid ${F.borderLight}`,backgroundColor:F.inputBg,fontSize:"13px",color:F.textPrimary,outline:"none",width:"100px"}}),a.createElement("button",{onClick:()=>{const e=document.getElementById("applyAllStart"),t=document.getElementById("applyAllEnd");var n,a;e&&t&&(n=e.value,a=t.value,r(e=>{const t={...e.schedule};return Er.forEach(({key:e})=>{t[e]={...t[e],startTime:n,endTime:a}}),{...e,schedule:t}}))},style:{padding:"6px 12px",borderRadius:"6px",border:"none",backgroundColor:ca.primary,color:"#ffffff",fontSize:"12px",fontWeight:500,cursor:"pointer",whiteSpace:"nowrap"}},(0,s.t)("aiBot.apply")||"Apply")),a.createElement("div",{style:{border:`1px solid ${F.borderLight}`,borderRadius:"10px",overflow:"hidden"}},a.createElement("div",{style:{display:"grid",gridTemplateColumns:"100px 60px 1fr 1fr",gap:"8px",padding:"10px 12px",backgroundColor:F.bgSecondary,borderBottom:`1px solid ${F.borderLight}`,fontSize:"12px",fontWeight:600,color:F.textSecondary}},a.createElement("span",null,(0,s.t)("aiBot.day")||"Day"),a.createElement("span",{style:{textAlign:"center"}},(0,s.t)("aiBot.active")||"Active"),a.createElement("span",null,(0,s.t)("aiBot.startTime")||"Start"),a.createElement("span",null,(0,s.t)("aiBot.endTime")||"End")),Er.map(({key:e,full:t},r)=>{const o=n.schedule[e],i="saturday"===e||"sunday"===e;return a.createElement("div",{key:e,style:{display:"grid",gridTemplateColumns:"100px 60px 1fr 1fr",gap:"8px",padding:"10px 12px",alignItems:"center",backgroundColor:i?L?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.05)":"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.03)":"transparent",borderBottom:r<Er.length-1?`1px solid ${F.borderLight}`:"none"}},a.createElement("span",{style:{fontSize:"13px",fontWeight:500,color:o.enabled?F.textPrimary:F.textSecondary}},(0,s.t)(`aiBot.${e}`)||t),a.createElement("div",{style:{display:"flex",justifyContent:"center"}},a.createElement("button",{onClick:()=>Y(e,"enabled",!o.enabled),style:{width:"36px",height:"20px",borderRadius:"10px",border:"none",backgroundColor:o.enabled?ca.primary:F.borderLight,cursor:"pointer",position:"relative",transition:"background-color 0.2s"}},a.createElement("span",{style:{position:"absolute",top:"2px",left:o.enabled?"18px":"2px",width:"16px",height:"16px",borderRadius:"8px",backgroundColor:"#ffffff",transition:"left 0.2s",boxShadow:"0 1px 2px rgba(0,0,0,0.2)"}}))),a.createElement("input",{type:"time",value:o.startTime,onChange:t=>Y(e,"startTime",t.target.value),disabled:!o.enabled,style:{padding:"6px 8px",borderRadius:"6px",border:`1px solid ${F.borderLight}`,backgroundColor:o.enabled?F.inputBg:F.bgSecondary,fontSize:"13px",color:o.enabled?F.textPrimary:F.textSecondary,outline:"none",opacity:o.enabled?1:.6}}),a.createElement("input",{type:"time",value:o.endTime,onChange:t=>Y(e,"endTime",t.target.value),disabled:!o.enabled,style:{padding:"6px 8px",borderRadius:"6px",border:`1px solid ${F.borderLight}`,backgroundColor:o.enabled?F.inputBg:F.bgSecondary,fontSize:"13px",color:o.enabled?F.textPrimary:F.textSecondary,outline:"none",opacity:o.enabled?1:.6}}))})),a.createElement("div",{style:{marginTop:"12px",padding:"10px 12px",backgroundColor:F.bgSecondary,borderRadius:"8px",fontSize:"12px",color:F.textSecondary}},a.createElement("span",{style:{fontWeight:500}},(0,s.t)("aiBot.currentStatus")||"Current Status:")," ",(()=>{const e=Sr.getCurrentDayKey(n.schedule.timezone),t=n.schedule[e],r=new Date,o=new Intl.DateTimeFormat("en-US",{timeZone:n.schedule.timezone,hour:"2-digit",minute:"2-digit",hour12:!0}).format(r),i=new Intl.DateTimeFormat("en-US",{timeZone:n.schedule.timezone,weekday:"long"}).format(r);return t.enabled?a.createElement("span",null,i,", ",o," (",n.schedule.timezone.split("/")[1],")"," - ",a.createElement("span",{style:{color:ca.primary,fontWeight:500}},t.startTime," - ",t.endTime)):a.createElement("span",{style:{color:F.textSecondary}},(0,s.t)("aiBot.botOffToday")||`Bot is OFF on ${i}`)})()))),a.createElement("div",{style:{marginBottom:"28px"}},a.createElement(ae,{title:(0,s.t)("aiBot.replyTiming")||"Reply Timing",icon:a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:ca.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))}),a.createElement("p",{style:{fontSize:"13px",color:F.textSecondary,marginBottom:"16px"}},(0,s.t)("aiBot.replyTimingDesc")||"Random delay before AI responds (makes it feel more natural)"),a.createElement("div",{style:{display:"flex",gap:"16px"}},a.createElement("div",{style:{flex:1}},a.createElement("label",{style:{display:"block",fontSize:"13px",fontWeight:500,color:F.textSecondary,marginBottom:"6px"}},(0,s.t)("aiBot.minDelay")||"Min Delay (seconds)"),a.createElement("input",{type:"number",min:1,max:n.replyTiming.maxDelay-1,value:n.replyTiming.minDelay,onChange:e=>Q("minDelay",Math.max(1,parseInt(e.target.value)||1)),style:{width:"100%",padding:"10px 14px",borderRadius:"8px",border:`1px solid ${F.borderLight}`,backgroundColor:F.inputBg,fontSize:"14px",color:F.textPrimary,outline:"none"}})),a.createElement("div",{style:{flex:1}},a.createElement("label",{style:{display:"block",fontSize:"13px",fontWeight:500,color:F.textSecondary,marginBottom:"6px"}},(0,s.t)("aiBot.maxDelay")||"Max Delay (seconds)"),a.createElement("input",{type:"number",min:n.replyTiming.minDelay+1,max:60,value:n.replyTiming.maxDelay,onChange:e=>Q("maxDelay",Math.min(60,parseInt(e.target.value)||15)),style:{width:"100%",padding:"10px 14px",borderRadius:"8px",border:`1px solid ${F.borderLight}`,backgroundColor:F.inputBg,fontSize:"14px",color:F.textPrimary,outline:"none"}})))),a.createElement("div",{style:{marginBottom:"16px"}},a.createElement(ae,{title:(0,s.t)("aiBot.contextMessages")||"Context Messages",icon:a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2v10z",stroke:ca.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))}),a.createElement("p",{style:{fontSize:"13px",color:F.textSecondary,marginBottom:"12px"}},(0,s.t)("aiBot.contextMessagesDesc")||"Number of previous messages to include for AI context"),a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"16px"}},a.createElement("input",{type:"range",min:10,max:50,value:n.contextMessageCount,onChange:e=>K("contextMessageCount",parseInt(e.target.value)),style:{flex:1,height:"6px",borderRadius:"3px",appearance:"none",background:`linear-gradient(to right, var(--lion-primary) 0%, var(--lion-primary) ${(n.contextMessageCount-10)/40*100}%, ${F.borderLight} ${(n.contextMessageCount-10)/40*100}%, ${F.borderLight} 100%)`,cursor:"pointer"}}),a.createElement("span",{style:{minWidth:"50px",textAlign:"center",fontSize:"14px",fontWeight:600,color:ca.primary,backgroundColor:L?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15)":ca.primaryLight,padding:"6px 12px",borderRadius:"6px"}},n.contextMessageCount))),a.createElement("div",{style:{marginBottom:"16px"}},a.createElement(ae,{title:(0,s.t)("aiBot.stopKeywords")||"Stop Keywords",icon:a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",stroke:ca.primary,strokeWidth:"2"}),a.createElement("path",{d:"M15 9l-6 6M9 9l6 6",stroke:ca.primary,strokeWidth:"2",strokeLinecap:"round"})),infoTooltip:(0,s.t)("aiBot.stopKeywordsInfo")||"When customer sends any of these keywords, AI Bot will stop responding and blacklist them."}),a.createElement("div",{style:{marginBottom:"14px",padding:"10px 12px",background:"var(--lion-info-light)",border:"1px solid var(--lion-info)",borderRadius:"10px",fontSize:"12px",color:F.textPrimary,lineHeight:1.5}},"ℹ️ ",(0,s.t)("aiBot.stopKeywordsRecommend")||"For new setups we recommend the Escalation tab — it adds an attempt counter and trigger phrases on top of keyword stops. This section still works for keyword-only stops."),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 0",borderBottom:`1px solid ${F.borderLight}`,marginBottom:"16px"}},a.createElement("div",{style:{flex:1}},a.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:F.textPrimary}},(0,s.t)("aiBot.enableStopKeywords")||"Enable Stop Keywords"),a.createElement("div",{style:{fontSize:"12px",color:F.textSecondary,marginTop:"2px"}},(0,s.t)("aiBot.enableStopKeywordsDesc")||"Automatically stop AI Bot when customer requests human assistance")),a.createElement("div",{onClick:()=>r(e=>({...e,stopKeywords:{...e.stopKeywords,enabled:!e.stopKeywords?.enabled}})),style:{width:"44px",height:"24px",borderRadius:"12px",backgroundColor:n.stopKeywords?.enabled?ca.primary:F.borderLight,position:"relative",cursor:"pointer",transition:"background-color 0.2s"}},a.createElement("div",{style:{position:"absolute",width:"20px",height:"20px",borderRadius:"50%",backgroundColor:"#ffffff",top:"2px",left:n.stopKeywords?.enabled?"22px":"2px",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)"}}))),n.stopKeywords?.enabled&&a.createElement(a.Fragment,null,a.createElement("div",{style:{marginBottom:"16px"}},a.createElement("label",{style:{fontSize:"13px",fontWeight:500,color:F.textSecondary,display:"block",marginBottom:"8px"}},(0,s.t)("aiBot.keywords")||"Keywords"),a.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginBottom:"12px"}},n.stopKeywords?.keywords?.map((e,t)=>a.createElement("div",{key:t,style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:L?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.25)":ca.primaryLight,borderRadius:"16px",fontSize:"13px",color:L?"#ffffff":ca.primary,fontWeight:500,border:L?"1px solid rgba(var(--lion-primary-rgb, 37, 99, 235), 0.4)":"none"}},e,a.createElement("button",{onClick:()=>(e=>{const t=n.stopKeywords?.keywords||[];r(n=>({...n,stopKeywords:{...n.stopKeywords,keywords:t.filter((t,n)=>n!==e)}}))})(t),style:{background:"none",border:"none",padding:"0",cursor:"pointer",color:L?"#ffffff":ca.primary,fontSize:"14px",lineHeight:1,opacity:.7},onMouseEnter:e=>{e.target.style.opacity="1"},onMouseLeave:e=>{e.target.style.opacity="0.7"}},"✕"))),(!n.stopKeywords?.keywords||0===n.stopKeywords.keywords.length)&&a.createElement("span",{style:{fontSize:"13px",color:F.textSecondary,fontStyle:"italic"}},(0,s.t)("aiBot.noKeywords")||"No keywords added yet")),a.createElement("div",{style:{display:"flex",gap:"8px"}},a.createElement("input",{type:"text",value:y,onChange:e=>x(e.target.value),placeholder:(0,s.t)("aiBot.enterKeyword")||"Enter keyword...",onKeyDown:e=>"Enter"===e.key&&V(),style:{flex:1,padding:"10px 14px",borderRadius:"8px",border:`1px solid ${F.borderLight}`,backgroundColor:F.inputBg,fontSize:"14px",color:F.textPrimary,outline:"none"}}),a.createElement("button",{onClick:V,style:{padding:"10px 16px",borderRadius:"8px",border:"none",backgroundColor:ca.primary,color:"#ffffff",fontSize:"14px",fontWeight:500,cursor:"pointer",whiteSpace:"nowrap"}},(0,s.t)("aiBot.add")||"+ Add"))),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",backgroundColor:F.bgSecondary,borderRadius:"8px",marginBottom:"16px"}},a.createElement("div",{style:{flex:1}},a.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:F.textPrimary}},(0,s.t)("aiBot.smartDetection")||"Smart Detection"),a.createElement("div",{style:{fontSize:"12px",color:F.textSecondary,marginTop:"2px"}},(0,s.t)("aiBot.smartDetectionDesc")||"AI automatically detects frustration or human assistance requests")),a.createElement("div",{onClick:()=>r(e=>({...e,stopKeywords:{...e.stopKeywords,smartDetection:!e.stopKeywords?.smartDetection}})),style:{width:"44px",height:"24px",borderRadius:"12px",backgroundColor:n.stopKeywords?.smartDetection?ca.primary:F.borderLight,position:"relative",cursor:"pointer",transition:"background-color 0.2s"}},a.createElement("div",{style:{position:"absolute",width:"20px",height:"20px",borderRadius:"50%",backgroundColor:"#ffffff",top:"2px",left:n.stopKeywords?.smartDetection?"22px":"2px",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.2)"}}))),a.createElement("div",null,a.createElement("label",{style:{fontSize:"13px",fontWeight:500,color:F.textSecondary,display:"block",marginBottom:"8px"}},(0,s.t)("aiBot.stopMessage")||"Stop Message"),a.createElement("textarea",{value:n.stopKeywords?.stopMessage||"",onChange:e=>r(t=>({...t,stopKeywords:{...t.stopKeywords,stopMessage:e.target.value}})),placeholder:(0,s.t)("aiBot.stopMessagePlaceholder")||"Message sent when stop keyword detected...",rows:3,style:{width:"100%",padding:"12px 14px",borderRadius:"8px",border:`1px solid ${F.borderLight}`,backgroundColor:F.inputBg,fontSize:"14px",color:F.textPrimary,resize:"vertical",fontFamily:"inherit",outline:"none"}}),a.createElement("p",{style:{fontSize:"12px",color:F.textSecondary,marginTop:"6px"}},(0,s.t)("aiBot.stopMessageHint")||"This message will be sent to the customer when a stop keyword is detected."))))))),a.createElement("div",{style:{padding:"14px 24px",borderTop:`1px solid ${F.borderLight}`,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"10px",flexShrink:0,background:F.bgSecondary}},a.createElement("button",{onClick:t,style:{padding:"10px 22px",borderRadius:"10px",border:`1px solid ${F.borderLight}`,backgroundColor:F.bgPrimary,color:F.textPrimary,fontSize:"13px",fontWeight:600,cursor:"pointer",transition:"all 0.15s ease",letterSpacing:"0.2px"}},(0,s.t)("common.cancel")||"Cancel"),a.createElement("button",{className:"ai-primary-btn",onClick:()=>{Sr.saveSettings(n),i(!0),setTimeout(()=>i(!1),2e3)},style:{padding:"10px 22px",borderRadius:"10px",border:"1px solid transparent",background:o?"linear-gradient(135deg, var(--lion-success), var(--lion-success)dd)":"var(--lion-primary)",color:"#ffffff",fontSize:"13px",fontWeight:600,cursor:"pointer",transition:"all 0.15s ease",display:"flex",alignItems:"center",gap:"8px",boxShadow:o?"0 6px 16px var(--lion-success)55":"0 6px 16px rgba(var(--lion-primary-rgb), 0.32)",letterSpacing:"0.2px"}},o?a.createElement(a.Fragment,null,a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),(0,s.t)("common.saved")||"Saved"):(0,s.t)("common.save")||"Save"))),M&&a.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10001},onClick:()=>R(!1)},a.createElement("div",{style:{backgroundColor:F.bgPrimary,borderRadius:"16px",padding:"24px",maxWidth:"400px",width:"90%",boxShadow:"0 20px 60px rgba(0,0,0,0.3)"},onClick:e=>e.stopPropagation()},a.createElement("div",{style:{textAlign:"center",marginBottom:"20px"}},a.createElement("div",{style:{width:"48px",height:"48px",borderRadius:"50%",backgroundColor:"rgba(239, 68, 68, 0.1)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px"}},a.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},a.createElement("path",{d:"M3 6h18M8 6V4a2 2 0 012-2h4a2 2 0 012 2v2m3 0v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6h14z",stroke:ca.error,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))),a.createElement("h3",{style:{margin:"0 0 8px",fontSize:"18px",fontWeight:600,color:F.textPrimary}},(0,s.t)("aiBot.clearAllTitle")||"Clear All Chats?"),a.createElement("p",{style:{margin:0,fontSize:"14px",color:F.textSecondary,lineHeight:1.5}},(0,s.t)("aiBot.clearAllDesc")||"This will permanently delete all your chat history. This action cannot be undone.")),a.createElement("div",{style:{display:"flex",gap:"12px"}},a.createElement("button",{onClick:()=>R(!1),style:{flex:1,padding:"12px",borderRadius:"10px",border:`1px solid ${F.borderLight}`,backgroundColor:F.bgPrimary,color:F.textSecondary,fontSize:"14px",fontWeight:500,cursor:"pointer"}},(0,s.t)("common.cancel")||"Cancel"),a.createElement("button",{onClick:()=>{vm.clearAll(),S([]),T(null),u([]),R(!1)},style:{flex:1,padding:"12px",borderRadius:"10px",border:"none",backgroundColor:ca.error,color:"#ffffff",fontSize:"14px",fontWeight:500,cursor:"pointer"}},(0,s.t)("aiBot.clearAll")||"Clear All"))))))},xm=["#7C3AED","#3b82f6","#22c55e","#a855f7","#ec4899","#0ea5e9","#06b6d4","#ef4444","#7C3AED","#14b8a6"],wm=["📁","🎯","📧","💌","🔔","📢","📣","⚡","🌟","✨","🤖","💰","🎁","📦","🚀","💡","📝","🏷️","📌","❤️"];const km=[{value:1,key:"mon",label:"Monday"},{value:2,key:"tue",label:"Tuesday"},{value:3,key:"wed",label:"Wednesday"},{value:4,key:"thu",label:"Thursday"},{value:5,key:"fri",label:"Friday"},{value:6,key:"sat",label:"Saturday"},{value:7,key:"sun",label:"Sunday"}],Em=[{value:1,key:"jan",label:"January"},{value:2,key:"feb",label:"February"},{value:3,key:"mar",label:"March"},{value:4,key:"apr",label:"April"},{value:5,key:"may",label:"May"},{value:6,key:"jun",label:"June"},{value:7,key:"jul",label:"July"},{value:8,key:"aug",label:"August"},{value:9,key:"sep",label:"September"},{value:10,key:"oct",label:"October"},{value:11,key:"nov",label:"November"},{value:12,key:"dec",label:"December"}],Sm={groupActionsEnabled:!1,addToGroups:[],removeFromGroups:[],tabActionsEnabled:!1,addToTabs:[],removeFromTabs:[],labelsActionsEnabled:!1,addLabels:[],removeLabels:[],kanbanActionsEnabled:!1,addToKanban:null,removeFromKanban:null},Cm={name:"",isActive:!0,funnelSettings:{type:"labels",selectedIds:[]},trigger:{type:"on_enter"},actions:[],postActions:Sm,steps:[],rules:{cancelOnReply:!0,allowGroups:!1,customSignature:!1}};function Tm(){return`followup_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function Am(){return`action_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function Dm(){return`msg_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function _m(){return`queue_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}const Nm={mode:"specific",scheduleType:"weekly",weekdays:[],monthlyDates:[],yearlyDates:[],specificDates:[],calendarDates:[],specificTime:"10:00",messageModePerDay:"same",dayMessages:{}};const Mm="wa_followups",Im="wa_followup_categories",Rm="wa_followup_contacts",Bm="wa_followup_queue",Pm="wa_followup_needs_auto_entry";async function Lm(){try{const e=(await n().storage.local.get(Mm))[Mm]||[];return e.map(e=>function(e){if(!e||!e.id)return null;const t={on_enter:"on_enter",on_leave:"on_leave",after_time:"after_time",dispararAoEntrar:"on_enter",dispararAoSair:"on_leave",aposHorario:"after_time",dispararApós:"after_time",onEnter:"on_enter",onLeave:"on_leave",afterTime:"after_time"}[e.trigger?.type||e.triggerType||"on_enter"]||"on_enter";return{id:e.id,name:e.name||e.nome||"Unnamed Follow-up",isActive:e.isActive??e.active??!1,createdAt:e.createdAt||Date.now(),updatedAt:e.updatedAt||Date.now(),funnelSettings:e.funnelSettings||{type:e.targetLabels?.length>0?"labels":"tabs",selectedIds:e.targetLabels||e.targetTabs||[]},trigger:{type:t,timeConfig:e.trigger?.timeConfig},actions:Array.isArray(e.actions)?e.actions.filter(e=>e&&e.type):[],postActions:e.postActions||{groupActionsEnabled:!1,addToGroup:[],removeFromGroup:[],tabActionsEnabled:!1,addToTab:[],removeFromTab:[],labelActionsEnabled:!1,addLabel:[],removeLabel:[],kanbanActionsEnabled:!1,addToKanban:[]},rules:e.rules||{cancelOnReply:!0,allowGroups:!1,customSignature:!1},categoryId:e.categoryId,steps:e.steps}}(e)).filter(e=>null!==e)}catch(e){return[]}}async function Um(e){return(await Lm()).find(t=>t.id===e)||null}async function Fm(){return(await Lm()).filter(e=>e.isActive)}async function zm(e){const t=await Lm(),a=Date.now();let r,o=null;if(e.id){const n=t.findIndex(t=>t.id===e.id);n>=0?(o={...t[n]},r={...t[n],...e,updatedAt:a},t[n]=r):(r={...Cm,...e,createdAt:e.createdAt||a,updatedAt:a},t.push(r))}else r={...Cm,...e,id:Tm(),createdAt:a,updatedAt:a},t.push(r);if(await n().storage.local.set({[Mm]:t}),o&&r.id)await async function(e,t){const a=e.trigger,r=t.trigger,o=a.type!==r.type||JSON.stringify(a.timeConfig)!==JSON.stringify(r.timeConfig),i=JSON.stringify(e.funnelSettings)!==JSON.stringify(t.funnelSettings),s=JSON.stringify(e.actions)!==JSON.stringify(t.actions);if(!(o||i||s))return;await async function(e){const t=await Km(),a=t.filter(t=>t.followUpId===e&&("pending"===t.status||"processing"===t.status));if(a.length>0){const a=t.filter(t=>!(t.followUpId===e&&("pending"===t.status||"processing"===t.status)));await n().storage.local.set({[Bm]:a})}return a.length}(t.id);const l="specific"===r.timeConfig?.mode&&(r.timeConfig?.weekdays&&r.timeConfig.weekdays.length>0||r.timeConfig?.monthlyDates&&r.timeConfig.monthlyDates.length>0||r.timeConfig?.calendarDates&&r.timeConfig.calendarDates.length>0);if("after_time"===r.type||l){const e=await async function(e){const t=(await jm()).filter(t=>t.followUpId===e.id&&"active"===t.status);if(0===t.length)return 0;const a=[...new Set(t.map(e=>e.contactId))];const r=await Km(),o=function(e){const t=e.timeConfig,n="specific"===t?.mode&&(t?.weekdays&&t.weekdays.length>0||t?.monthlyDates&&t.monthlyDates.length>0||t?.yearlyDates&&t.yearlyDates.length>0||t?.specificDates&&t.specificDates.length>0||t?.calendarDates&&t.calendarDates.length>0);if(("on_enter"===e.type||"on_leave"===e.type)&&!n)return Date.now()+1e3;if("after_time"===e.type&&"relative"===t?.mode){const e=t.relativeDays||1;switch(t.relativeUnit||"days"){case"minutes":return Date.now()+60*e*1e3;case"hours":return Date.now()+60*e*60*1e3;default:const[n,a]=(t.relativeTime||"12:00").split(":").map(Number),r=new Date;return r.setDate(r.getDate()+e),r.setHours(n,a,0,0),r.getTime()}}if("specific"===t?.mode){const[e,n]=(t.specificTime||"12:00").split(":").map(Number);switch(t.scheduleType||"weekly"){case"weekly":{const a=t.weekdays||[];if(a.length>0){const t=new Date,r=t.getDay()||7;let o=8;for(const i of a){let a=i-r;if(a<0&&(a+=7),0===a){const r=new Date;r.setHours(e,n,0,0),t>=r&&(a=7)}a<o&&(o=a)}const i=new Date;return i.setDate(i.getDate()+o),i.setHours(e,n,0,0),i.getTime()}break}case"monthly":case"daily":{const a=t.calendarDates||[],r=t.monthlyDates||t.specificDates||[];if(a.length>0){const t=Date.now();for(const r of a){const[a,o,i]=r.split("-").map(Number),s=new Date(a,o-1,i,e,n,0,0);if(s.getTime()>t)return s.getTime()}}else if(r.length>0){const t=new Date,a=t.getDate();for(const o of r.sort((e,t)=>e-t)){if(o>a){const t=new Date;return t.setDate(o),t.setHours(e,n,0,0),t.getTime()}if(o===a){const a=new Date;if(a.setHours(e,n,0,0),t<a)return a.getTime()}}const o=r[0],i=new Date;return i.setMonth(i.getMonth()+1),i.setDate(o),i.setHours(e,n,0,0),i.getTime()}break}case"yearly":{const a=t.yearlyDates||[],r=new Date;for(const{month:t,day:o}of a){const a=new Date(r.getFullYear(),t-1,o,e,n,0,0);if(a>r)return a.getTime()}if(a.length>0){const{month:t,day:o}=a[0];return new Date(r.getFullYear()+1,t-1,o,e,n,0,0).getTime()}break}}const a=new Date,r=new Date;return r.setHours(e,n,0,0),r<=a&&r.setDate(r.getDate()+1),r.getTime()}if("after_time"===e.type&&t){const[e,n]=(t.specificTime||t.relativeTime||"12:00").split(":").map(Number),a=new Date,r=new Date;return r.setHours(e,n,0,0),r<=a&&r.setDate(r.getDate()+1),r.getTime()}return Date.now()+1e3}(e.trigger),i=e.trigger.timeConfig;let s,l=!1;if("specific"===i?.mode&&"weekly"===i?.scheduleType&&i?.weekdays?.length){s={1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat",7:"sun"}[i.weekdays[0]],l=!0}else if("specific"===i?.mode&&("monthly"===i?.scheduleType||"daily"===i?.scheduleType)){const e=i?.monthlyDates||i?.calendarDates?.map(e=>parseInt(e.split("-")[2],10));e?.length&&(s=String(e[0]),l=!0)}let c=0;for(const t of a){if(!r.some(n=>!(n.contactId!==t||n.followUpId!==e.id||"pending"!==n.status&&"processing"!==n.status||s&&n.scheduleKey!==s))){const n={id:_m(),contactId:t,followUpId:e.id,stepId:"trigger",scheduledAt:o,status:"pending",attempts:0,scheduleKey:s,isRecurring:l};r.push(n),c++}}c>0&&await n().storage.local.set({[Bm]:r});return c}(t);(0===e||i)&&await n().storage.local.set({[Pm]:{followUpId:t.id,timestamp:Date.now()}})}}(o,r);else if(!o&&r.isActive){const e=r.trigger,t="specific"===e.timeConfig?.mode&&(e.timeConfig?.weekdays&&e.timeConfig.weekdays.length>0||e.timeConfig?.monthlyDates&&e.timeConfig.monthlyDates.length>0||e.timeConfig?.calendarDates&&e.timeConfig.calendarDates.length>0);("after_time"===e.type||t)&&await n().storage.local.set({[Pm]:{followUpId:r.id,timestamp:Date.now()}})}return r}async function Om(e){const t=(await Lm()).filter(t=>t.id!==e);await n().storage.local.set({[Mm]:t}),await async function(e){const t=(await jm()).filter(t=>t.followUpId!==e);await n().storage.local.set({[Rm]:t})}(e),await async function(e){const t=(await Km()).filter(t=>t.followUpId!==e);await n().storage.local.set({[Bm]:t})}(e)}async function Wm(){try{const e=await n().storage.local.get(Im);return(e[Im]||[]).sort((e,t)=>e.sortOrder-t.sortOrder)}catch(e){return[]}}async function qm(e){try{const t=await Wm(),a=t.findIndex(t=>t.id===e.id);return a>=0?t[a]=e:(void 0!==e.sortOrder&&0!==e.sortOrder||(e.sortOrder=t.length),t.push(e)),await n().storage.local.set({[Im]:t}),e}catch(e){throw e}}async function Hm(e,t){try{const n=await Um(e);if(!n)return;const a=await async function(e){const t=await Lm();if("all"===e||null===e)return t;if("uncategorized"===e)return t.filter(e=>!e.categoryId);return t.filter(t=>t.categoryId===e)}(t);n.categoryId=t||void 0,n.sortOrder=a.length,await zm(n)}catch(e){throw e}}async function jm(){try{return(await n().storage.local.get(Rm))[Rm]||[]}catch(e){return[]}}async function Vm(e,t){const n=(await jm()).filter(n=>n.contactId===e&&n.followUpId===t);if(0===n.length)return null;n.sort((e,t)=>t.enteredAt-e.enteredAt);const a=n.find(e=>"active"===e.status);return a||n[0]}async function Gm(e){const t=await jm();let a;if(e.id){const n=t.findIndex(t=>t.id===e.id);if(!(n>=0))throw new Error(`Contact state with ID ${e.id} not found`);a={...t[n],...e},t[n]=a}else a={id:`state_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,contactId:e.contactId||"",followUpId:e.followUpId||"",currentStepIndex:0,enteredAt:Date.now(),status:"active",hasReplied:!1,history:[],...e},t.push(a);return await n().storage.local.set({[Rm]:t}),a}async function Km(){try{return(await n().storage.local.get(Bm))[Bm]||[]}catch(e){return[]}}async function $m(e,t,a,r,o,i){const s=await Km();if(o){if(s.find(n=>n.contactId===e&&n.followUpId===t&&n.scheduleKey===o&&("pending"===n.status||"processing"===n.status)))return null}const l={id:_m(),contactId:e,followUpId:t,stepId:a,scheduledAt:r,status:"pending",attempts:0,scheduleKey:o,isRecurring:i};return s.push(l),await n().storage.local.set({[Bm]:s}),l}async function Ym(e,t){const a=await Km(),r=a.findIndex(t=>t.id===e);r>=0&&(a[r]={...a[r],...t},await n().storage.local.set({[Bm]:a}))}async function Xm(){const e=await Km(),t=Date.now()-6048e5,a=e.filter(e=>"pending"===e.status||e.scheduledAt>t);a.length!==e.length&&await n().storage.local.set({[Bm]:a})}async function Jm(){const e=await Km(),t=Date.now()-6e5;let a=0;for(const n of e)if("processing"===n.status&&n.lastAttemptAt&&n.lastAttemptAt<t){const e=n.attempts+1;e>=3?(n.status="failed",n.error="Stuck in processing state - max retries exceeded"):(n.status="pending",n.scheduledAt=Date.now()+6e4,n.attempts=e),a++}return a>0&&await n().storage.local.set({[Bm]:e}),a}async function Qm(e,t){if(!e.isRecurring||!e.scheduleKey)return null;if(!t.isActive)return null;const n=t.trigger.timeConfig;if(!n||"specific"!==n.mode)return null;const[a,r]=(n.specificTime||"12:00").split(":").map(Number),o=n.scheduleType||"weekly",i=function(e,t,n,a){const r=new Date;switch(t){case"weekly":{let t=({mon:1,tue:2,wed:3,thu:4,fri:5,sat:6,sun:7}[e]||1)-(r.getDay()||7);t<=0&&(t+=7);const o=new Date(r);return o.setDate(o.getDate()+t),o.setHours(n,a,0,0),o.getTime()}case"monthly":case"daily":{const t=parseInt(e,10),o=r.getDate(),i=new Date(r);return o>=t&&i.setMonth(i.getMonth()+1),i.setDate(t),i.setHours(n,a,0,0),i.getTime()}case"yearly":{const[t,o]=e.split("-").map(Number),i=r.getMonth()+1,s=r.getDate(),l=new Date(r);return(i>t||i===t&&s>=o)&&l.setFullYear(l.getFullYear()+1),l.setMonth(t-1),l.setDate(o),l.setHours(n,a,0,0),l.getTime()}default:return r.getTime()+864e5}}(e.scheduleKey,o,a,r),s=await $m(e.contactId,e.followUpId,e.stepId,i,e.scheduleKey,!0);return s}async function Zm(e,t){try{const a=await Lm(),r=a.findIndex(t=>t.id===e);-1!==r&&(a[r].lastExecutedAt=t,await n().storage.local.set({[Mm]:a}))}catch(e){}}const ep=({followUps:e,selectedId:t,loading:n,onSelect:r,onCreateNew:o,onDelete:i,onToggleActive:l,onDuplicate:c})=>a.createElement(a.Fragment,null,a.createElement("style",null,"\n  .followup-list-container {\n    display: flex;\n    flex-direction: column;\n    height: 100%;\n  }\n\n  .followup-list-header {\n    padding: 14px 16px;\n    border-bottom: 1px solid var(--lion-border-light);\n    flex-shrink: 0;\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n  }\n\n  .followup-list-title {\n    font-size: 13px;\n    font-weight: 700;\n    color: var(--lion-text-primary);\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n  }\n\n  /* === V3 CREATE ICON BUTTON (Compact) === */\n  .followup-create-icon-btn {\n    width: 34px;\n    height: 34px;\n    border-radius: 10px;\n    background: var(--lion-primary);\n    color: #ffffff;\n    border: none;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s ease;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n    padding: 0;\n    flex-shrink: 0;\n  }\n\n  .followup-create-icon-btn:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35);\n  }\n\n  /* === V3 LIST ITEMS === */\n  .followup-list-items {\n    flex: 1;\n    overflow-y: auto;\n    padding: 14px;\n  }\n\n  .followup-list-items::-webkit-scrollbar {\n    width: 6px;\n  }\n  .followup-list-items::-webkit-scrollbar-track {\n    background: transparent;\n  }\n  .followup-list-items::-webkit-scrollbar-thumb {\n    background: var(--lion-border-medium, #d1d5db);\n    border-radius: 3px;\n  }\n\n  .followup-list-empty {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    height: 100%;\n    min-height: 300px;\n    color: var(--lion-text-muted);\n    text-align: center;\n    padding: 24px;\n  }\n\n  .followup-list-empty-icon {\n    width: 52px;\n    height: 52px;\n    margin-bottom: 16px;\n    opacity: 0.3;\n    color: var(--lion-text-muted);\n  }\n\n  .followup-create-empty-btn {\n    display: inline-flex;\n    align-items: center;\n    gap: 6px;\n    padding: 10px 20px;\n    background: var(--lion-primary);\n    color: #ffffff;\n    border: none;\n    border-radius: 10px;\n    font-size: 13px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.15s ease;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .followup-create-empty-btn:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35);\n  }\n\n  .followup-list-loading {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    height: 100px;\n    color: var(--lion-text-muted);\n    font-size: 13px;\n  }\n\n  /* === V3 FOLLOW-UP CARD === */\n  .followup-item {\n    background: var(--lion-bg-primary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 12px;\n    padding: 14px;\n    margin-bottom: 10px;\n    cursor: pointer;\n    transition: all 0.15s ease;\n    position: relative;\n    border-left: 3px solid transparent;\n  }\n\n  .followup-item:hover {\n    border-color: var(--lion-border-medium, #d1d5db);\n    border-left-color: var(--lion-primary);\n    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);\n  }\n\n  .followup-item.selected {\n    border-color: var(--lion-primary);\n    border-left-color: var(--lion-primary);\n    background: rgba(var(--lion-primary-rgb), 0.04);\n    box-shadow: 0 2px 12px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  .followup-item-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    margin-bottom: 8px;\n  }\n\n  .followup-item-name {\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--lion-text-primary);\n    flex: 1;\n    white-space: nowrap;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    margin-right: 8px;\n  }\n\n  .followup-item-status {\n    display: flex;\n    align-items: center;\n    gap: 4px;\n    font-size: 11px;\n    font-weight: 600;\n    padding: 3px 10px;\n    border-radius: 12px;\n  }\n\n  .followup-item-status.active {\n    background: rgba(16, 185, 129, 0.1);\n    color: var(--lion-success);\n  }\n\n  .followup-item-status.paused {\n    background: rgba(107, 114, 128, 0.08);\n    color: var(--lion-text-muted);\n  }\n\n  .followup-item-status-dot {\n    width: 6px;\n    height: 6px;\n    border-radius: 50%;\n    background: currentColor;\n  }\n\n  .followup-item-info {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    font-size: 11px;\n    color: var(--lion-text-muted);\n    margin-bottom: 8px;\n    flex-wrap: wrap;\n  }\n\n  .followup-item-info-item {\n    display: flex;\n    align-items: center;\n    gap: 4px;\n  }\n\n  .followup-item-info-item svg {\n    width: 12px;\n    height: 12px;\n  }\n\n  /* === V3 ACTION BUTTONS === */\n  .followup-item-actions {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    margin-top: 10px;\n    padding-top: 10px;\n    border-top: 1px solid var(--lion-border-light);\n  }\n\n  .followup-item-action {\n    flex: 1;\n    padding: 6px 8px;\n    background: var(--lion-bg-secondary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 8px;\n    font-size: 11px;\n    font-weight: 500;\n    color: var(--lion-text-secondary);\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    gap: 4px;\n    transition: all 0.15s ease;\n  }\n\n  .followup-item-action:hover {\n    background: var(--lion-bg-tertiary);\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .followup-item-action.toggle-active {\n    background: rgba(16, 185, 129, 0.08);\n    border-color: rgba(16, 185, 129, 0.3);\n    color: var(--lion-success);\n  }\n\n  .followup-item-action.toggle-pause {\n    background: rgba(245, 158, 11, 0.08);\n    border-color: rgba(245, 158, 11, 0.3);\n    color: var(--lion-warning);\n  }\n\n  .followup-item-action.delete {\n    color: var(--lion-error);\n  }\n\n  .followup-item-action.delete:hover {\n    background: rgba(239, 68, 68, 0.08);\n    border-color: rgba(239, 68, 68, 0.3);\n  }\n\n  .followup-item-action svg {\n    width: 12px;\n    height: 12px;\n  }\n\n  .followup-item-funnel-type {\n    display: inline-flex;\n    align-items: center;\n    gap: 4px;\n    font-size: 10px;\n    font-weight: 600;\n    padding: 2px 8px;\n    background: rgba(var(--lion-primary-rgb), 0.06);\n    border-radius: 6px;\n    color: var(--lion-primary);\n    text-transform: uppercase;\n    letter-spacing: 0.3px;\n  }\n"),a.createElement("div",{className:"followup-list-container"},a.createElement("div",{className:"followup-list-header"},a.createElement("span",{className:"followup-list-title"},e.length," ",(0,s.t)("followUp.followUps")||"Follow-ups"),a.createElement("button",{className:"followup-create-icon-btn",onClick:o,title:(0,s.t)("followUp.createNew")||"Create New"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",width:"16",height:"16"},a.createElement("path",{d:"M12 5v14M5 12h14"})))),a.createElement("div",{className:"followup-list-items"},n?a.createElement("div",{className:"followup-list-loading"},(0,s.t)("followUp.loading")||"Loading..."):0===e.length?a.createElement("div",{className:"followup-list-empty"},a.createElement("svg",{className:"followup-list-empty-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("polyline",{points:"12 6 12 12 16 14"}),a.createElement("path",{d:"M20 4L20 8L16 8"})),a.createElement("div",{style:{fontSize:"15px",fontWeight:600,color:"var(--lion-text-secondary)",marginBottom:"4px"}},(0,s.t)("followUp.noFollowUps")||"No follow-ups yet"),a.createElement("div",{style:{fontSize:"12px",color:"var(--lion-text-muted)",marginBottom:"16px"}},(0,s.t)("followUp.createFirst")||"Create your first follow-up sequence"),a.createElement("button",{className:"followup-create-empty-btn",onClick:o},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",width:"16",height:"16"},a.createElement("path",{d:"M12 5v14M5 12h14"})),(0,s.t)("followUp.createNew")||"Create New")):e.map(e=>a.createElement("div",{key:e.id,className:"followup-item "+(t===e.id?"selected":""),onClick:t=>{t.stopPropagation(),r(e)}},a.createElement("div",{className:"followup-item-header"},a.createElement("div",{className:"followup-item-name"},e.name),a.createElement("div",{className:"followup-item-status "+(e.isActive?"active":"paused")},a.createElement("span",{className:"followup-item-status-dot"}),e.isActive?(0,s.t)("followUp.active")||"Active":(0,s.t)("followUp.paused")||"Paused")),a.createElement("div",{className:"followup-item-info"},a.createElement("span",{className:"followup-item-funnel-type"},(e=>{switch(e){case"labels":return(0,s.t)("followUp.labels")||"Labels";case"tabs":return(0,s.t)("followUp.customTabs")||"Custom Tabs";case"groups":return(0,s.t)("followUp.groups")||"Groups";case"kanban":return(0,s.t)("followUp.kanban")||"Kanban";default:return e}})(e.funnelSettings.type)),a.createElement("span",{className:"followup-item-info-item"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M22 11.08V12a10 10 0 11-5.93-9.14"})),(e=>{switch(e.type){case"on_enter":return(0,s.t)("followUp.onEnter")||"On Enter";case"on_leave":return(0,s.t)("followUp.onLeave")||"On Leave";case"after_time":return(0,s.t)("followUp.afterTime")||"After Time";default:return e.type}})(e.trigger)),a.createElement("span",{className:"followup-item-info-item"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})),e.actions.length," ",(0,s.t)("followUp.actionsCount")||"actions")),a.createElement("div",{className:"followup-item-actions",onClick:e=>e.stopPropagation()},a.createElement("button",{className:"followup-item-action "+(e.isActive?"toggle-pause":"toggle-active"),onClick:()=>l(e.id),title:e.isActive?(0,s.t)("followUp.pause")||"Pause":(0,s.t)("followUp.activate")||"Activate"},e.isActive?a.createElement(a.Fragment,null,a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),a.createElement("rect",{x:"14",y:"4",width:"4",height:"16"})),(0,s.t)("followUp.pause")||"Pause"):a.createElement(a.Fragment,null,a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polygon",{points:"5 3 19 12 5 21 5 3"})),(0,s.t)("followUp.activate")||"Activate")),a.createElement("button",{className:"followup-item-action",onClick:()=>c(e.id),title:(0,s.t)("followUp.duplicate")||"Duplicate"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),a.createElement("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"}))),a.createElement("button",{className:"followup-item-action delete",onClick:()=>i(e.id),title:(0,s.t)("followUp.delete")||"Delete"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"3 6 5 6 21 6"}),a.createElement("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})))))))));var tp=r(5773);const np=[{value:"none",label:"Message Only"},{value:"image/video",label:"Message + Images/Videos"},{value:"document",label:"Message + Documents"},{value:"audio",label:"Message + Audio"},{value:"contact",label:"Message + Contacts"},{value:"poll",label:"Message + Poll"},{value:"list",label:"Message + List"},{value:"product",label:"Message + Products"},{value:"fluxo",label:"Trigger Fluxo (Chatbot)"}],ap=["@firstname","@lastname","@contactname","@whatsappname","@variable1"],rp=({action:e,index:t,onUpdate:n,onRemove:r})=>{const[o,i]=(0,a.useState)(new Set([0])),[l,c]=(0,a.useState)([]),[d,m]=(0,a.useState)([]);(0,a.useEffect)(()=>{(async()=>{try{await tp.FluxoStorage.restoreFromBrowserStorage(),c(tp.FluxoStorage.getFlows()),m(tp.FluxoStorage.getCategories())}catch(e){}})()},[]);const p=e.templateConfig?.messages||[],u=()=>{const e={id:Dm(),message:"",attachmentType:"none",attachments:[],delay:{min:3,max:5}};n({templateConfig:{messages:[...p,e]}}),i(e=>new Set([...e,p.length]))},g=(e,t)=>{const a=[...p];a[e]={...a[e],...t},n({templateConfig:{messages:a}})};return 0===p.length?(u(),null):a.createElement(a.Fragment,null,a.createElement("style",null,"\n  .action-builder {\n    background: var(--lion-bg-primary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 14px;\n    overflow: hidden;\n    margin-bottom: 12px;\n  }\n\n  .action-builder ::-webkit-scrollbar {\n    width: 6px;\n    height: 6px;\n  }\n\n  .action-builder ::-webkit-scrollbar-track {\n    background: transparent;\n    border-radius: 3px;\n  }\n\n  .action-builder ::-webkit-scrollbar-thumb {\n    background: var(--lion-border-light);\n    border-radius: 3px;\n  }\n\n  .action-builder ::-webkit-scrollbar-thumb:hover {\n    background: var(--lion-border-medium, #d1d5db);\n  }\n\n  .action-message-item {\n    border-bottom: 1px solid var(--lion-border-light);\n  }\n\n  .action-message-item:last-child {\n    border-bottom: none;\n  }\n\n  .action-message-header {\n    display: flex;\n    align-items: center;\n    padding: 12px 16px;\n    background: var(--lion-bg-secondary);\n    gap: 10px;\n    cursor: pointer;\n  }\n\n  .action-message-header:hover {\n    background: var(--lion-bg-tertiary);\n  }\n\n  .action-message-number {\n    width: 24px;\n    height: 24px;\n    border-radius: 50%;\n    background: var(--lion-primary);\n    color: white;\n    font-size: 12px;\n    font-weight: 600;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    flex-shrink: 0;\n  }\n\n  .action-message-title {\n    flex: 1;\n    font-size: 13px;\n    font-weight: 600;\n    color: var(--lion-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .action-message-title svg {\n    width: 16px;\n    height: 16px;\n    color: var(--lion-primary);\n  }\n\n  .action-message-chevron {\n    width: 18px;\n    height: 18px;\n    color: var(--lion-text-muted);\n    transition: transform 0.15s ease;\n  }\n\n  .action-message-chevron.expanded {\n    transform: rotate(180deg);\n  }\n\n  .action-message-remove {\n    width: 28px;\n    height: 28px;\n    border: none;\n    background: transparent;\n    border-radius: 6px;\n    color: var(--lion-text-muted);\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s ease;\n  }\n\n  .action-message-remove:hover {\n    background: rgba(239, 68, 68, 0.1);\n    color: var(--lion-error);\n  }\n\n  .action-message-remove svg {\n    width: 16px;\n    height: 16px;\n  }\n\n  .action-message-content {\n    padding: 16px;\n    display: none;\n  }\n\n  .action-message-content.expanded {\n    display: block;\n  }\n\n  .action-form-group {\n    margin-bottom: 14px;\n  }\n\n  .action-form-group:last-child {\n    margin-bottom: 0;\n  }\n\n  .action-form-label {\n    display: block;\n    font-size: 12px;\n    font-weight: 700;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    color: var(--lion-text-secondary);\n    margin-bottom: 6px;\n  }\n\n  .action-form-select {\n    width: 100%;\n    padding: 10px 12px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 13px;\n    color: var(--lion-text-primary) !important;\n    background: var(--lion-bg-secondary) !important;\n    cursor: pointer;\n    transition: border-color 0.15s ease, box-shadow 0.15s ease;\n  }\n\n  .action-form-select:hover {\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .action-form-select:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n    background: var(--lion-bg-primary) !important;\n  }\n\n  .action-form-textarea {\n    width: 100%;\n    padding: 12px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 13px;\n    color: var(--lion-text-primary) !important;\n    background: var(--lion-bg-secondary) !important;\n    resize: vertical;\n    min-height: 100px;\n    font-family: inherit;\n    line-height: 1.5;\n    transition: border-color 0.15s ease, box-shadow 0.15s ease;\n  }\n\n  .action-form-textarea:hover {\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .action-form-textarea:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n    background: var(--lion-bg-primary) !important;\n  }\n\n  .action-form-textarea::placeholder {\n    color: var(--lion-text-muted);\n  }\n\n  .action-variables-row {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 6px;\n    margin-top: 8px;\n  }\n\n  .action-variables-label {\n    font-size: 11px;\n    color: var(--lion-text-muted);\n    margin-right: 4px;\n  }\n\n  .action-variable-chip {\n    padding: 4px 10px;\n    background: var(--lion-primary) !important;\n    border: none;\n    border-radius: 20px;\n    font-size: 11px;\n    font-weight: 500;\n    color: #ffffff !important;\n    cursor: pointer;\n    box-shadow: 0 1px 4px rgba(var(--lion-primary-rgb), 0.2);\n    transition: all 0.15s ease;\n  }\n\n  .action-variable-chip:hover {\n    background: var(--lion-primary-hover) !important;\n    color: white;\n    box-shadow: 0 2px 6px rgba(var(--lion-primary-rgb), 0.3);\n  }\n\n  .action-delay-row {\n    display: grid;\n    grid-template-columns: 1fr 1fr;\n    gap: 12px;\n    margin-top: 14px;\n    padding-top: 14px;\n    border-top: 1px solid var(--lion-border-light);\n  }\n\n  .action-form-input {\n    width: 100%;\n    padding: 10px 12px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 13px;\n    color: var(--lion-text-primary) !important;\n    background: var(--lion-bg-secondary) !important;\n    transition: border-color 0.15s ease, box-shadow 0.15s ease;\n  }\n\n  .action-form-input:hover {\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .action-form-input:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n    background: var(--lion-bg-primary) !important;\n  }\n\n  .action-add-message-btn {\n    width: 100%;\n    padding: 14px;\n    background: var(--lion-primary);\n    border: none;\n    border-radius: 10px;\n    color: #ffffff !important;\n    font-size: 13px;\n    font-weight: 600;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    gap: 8px;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n    transition: all 0.15s ease;\n  }\n\n  .action-add-message-btn:hover {\n    background: var(--lion-primary-hover);\n    box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.3);\n  }\n\n  .action-add-message-btn svg {\n    width: 16px;\n    height: 16px;\n  }\n\n  .action-attachment-section {\n    margin-top: 14px;\n    padding-top: 14px;\n    border-top: 1px solid var(--lion-border-light);\n  }\n"),a.createElement("div",{className:"action-builder"},p.map((e,r)=>a.createElement("div",{key:e.id,className:"action-message-item"},a.createElement("div",{className:"action-message-header",onClick:()=>(e=>{i(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})})(r)},a.createElement("span",{className:"action-message-number"},r+1),a.createElement("div",{className:"action-message-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})),(0,s.t)("followUp.message")||"Message"," ",r+1),a.createElement("svg",{className:"action-message-chevron "+(o.has(r)?"expanded":""),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M6 9l6 6 6-6"})),p.length>1&&a.createElement("button",{className:"action-message-remove",onClick:e=>{e.stopPropagation(),(e=>{if(p.length<=1)return;const t=p.filter((t,n)=>n!==e);n({templateConfig:{messages:t}})})(r)},title:(0,s.t)("followUp.removeMessage")||"Remove Message"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})))),a.createElement("div",{className:"action-message-content "+(o.has(r)?"expanded":"")},a.createElement("div",{className:"action-form-group"},a.createElement("label",{className:"action-form-label"},(0,s.t)("followUp.templatesType")||"Templates Type"),a.createElement("select",{className:"action-form-select",value:e.attachmentType,onChange:e=>((e,t)=>{const n={attachmentType:t};"image/video"!==t&&"document"!==t&&"audio"!==t&&(n.attachments=[]),"contact"!==t&&(n.selectedContact=[]),"poll"!==t&&(n.pollData=null),"list"!==t&&(n.listData=null),"product"!==t&&(n.selectedProducts=[]),"fluxo"!==t&&(n.selectedFlowId=void 0,n.selectedCategoryId=void 0),g(e,n)})(r,e.target.value)},np.map(e=>a.createElement("option",{key:e.value,value:e.value},(0,s.t)(`templates.attachmentType.${"none"===e.value?"none":e.value.replace("/","")}`)||e.label)))),"fluxo"!==e.attachmentType&&a.createElement("div",{className:"action-form-group"},a.createElement("label",{className:"action-form-label"},(0,s.t)("followUp.messageText")||"Message Text"),a.createElement("textarea",{id:`followup-textarea-${t}-${r}`,className:"action-form-textarea",value:e.message,onChange:e=>g(r,{message:e.target.value}),placeholder:(0,s.t)("followUp.messagePlaceholder")||"Type your message here..."}),a.createElement("div",{className:"action-variables-row"},a.createElement("span",{className:"action-variables-label"},(0,s.t)("followUp.clickToInsert")||"Click to insert variable:"),ap.map(e=>a.createElement("span",{key:e,className:"action-variable-chip",onClick:()=>((e,n)=>{const a=p[e];if(!a)return;const r=document.getElementById(`followup-textarea-${t}-${e}`);if(!r)return void g(e,{message:a.message+" "+n});const o=r.selectionStart||a.message.length,i=a.message.substring(0,o),s=a.message.substring(o);g(e,{message:i+n+" "+s}),setTimeout(()=>{r.focus(),r.setSelectionRange(o+n.length+1,o+n.length+1)},0)})(r,e)},e)))),((e,t)=>{const n=e.attachmentType;return"none"===n?null:a.createElement("div",{className:"action-attachment-section"},("image/video"===n||"document"===n||"audio"===n)&&a.createElement(Ln,{attachments:e.attachments||[],attachmentType:n,onChange:e=>g(t,{attachments:e})}),"contact"===n&&a.createElement(On,{selectedContacts:e.selectedContact||[],onChange:e=>g(t,{selectedContact:e})}),"poll"===n&&a.createElement(Un,{pollData:e.pollData||null,onChange:e=>g(t,{pollData:e})}),"list"===n&&a.createElement(Fn,{listData:e.listData||null,onChange:e=>g(t,{listData:e})}),"product"===n&&a.createElement(Wn,{selectedProducts:e.selectedProducts||[],onChange:e=>g(t,{selectedProducts:e})}),"fluxo"===n&&a.createElement(a.Fragment,null,a.createElement("div",{className:"action-form-group"},a.createElement("label",{className:"action-form-label"},(0,s.t)("followUp.fluxoCategory")||"Category"),a.createElement("select",{className:"action-form-select",value:e.selectedCategoryId||"all",onChange:e=>g(t,{selectedCategoryId:"all"===e.target.value?void 0:e.target.value,selectedFlowId:void 0})},a.createElement("option",{value:"all"},(0,s.t)("followUp.allCategories")||"All Categories"),d.map(e=>a.createElement("option",{key:e.id,value:e.id},e.icon," ",e.name)),a.createElement("option",{value:"uncategorized"},(0,s.t)("followUp.uncategorized")||"Uncategorized"))),a.createElement("div",{className:"action-form-group"},a.createElement("label",{className:"action-form-label"},(0,s.t)("followUp.selectFluxo")||"Select Fluxo"),a.createElement("select",{className:"action-form-select",value:e.selectedFlowId||"",onChange:e=>g(t,{selectedFlowId:e.target.value})},a.createElement("option",{value:""},(0,s.t)("followUp.chooseFluxo")||"-- Choose a Fluxo --"),l.filter(t=>{const n=e.selectedCategoryId;return!n||"all"===n||("uncategorized"===n?!t.categoryId:t.categoryId===n)}).map(e=>a.createElement("option",{key:e.id,value:e.id},e.name," ",e.isActive?"✓":"(inactive)")))),a.createElement("p",{style:{fontSize:"12px",color:"var(--lion-text-muted)",marginTop:"8px"}},(0,s.t)("followUp.fluxoInfo")||"The selected chatbot flow will be triggered when this follow-up executes.")))})(e,r),"fluxo"!==e.attachmentType&&a.createElement("div",{className:"action-delay-row"},a.createElement("div",{className:"action-form-group"},a.createElement("label",{className:"action-form-label"},(0,s.t)("followUp.minDelay")||"Min Delay (sec)"),a.createElement("input",{type:"number",className:"action-form-input",value:e.delay.min,min:0,onChange:t=>g(r,{delay:{...e.delay,min:parseInt(t.target.value)||0}})})),a.createElement("div",{className:"action-form-group"},a.createElement("label",{className:"action-form-label"},(0,s.t)("followUp.maxDelay")||"Max Delay (sec)"),a.createElement("input",{type:"number",className:"action-form-input",value:e.delay.max,min:0,onChange:t=>g(r,{delay:{...e.delay,max:parseInt(t.target.value)||0}})})))))),a.createElement("div",{style:{padding:"12px 16px"}},a.createElement("button",{className:"action-add-message-btn",onClick:u},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M12 5v14M5 12h14"})),(0,s.t)("followUp.addMessage")||"+ Add Message"))))},op=({type:e,selectedIds:t,onChange:r,crmId:o,onCrmChange:i})=>{const[l,c]=(0,a.useState)(!1),[d,m]=(0,a.useState)([]),[p,u]=(0,a.useState)([]),[g,h]=(0,a.useState)(!1),[b,f]=(0,a.useState)(""),v=(0,a.useRef)(null);(0,a.useEffect)(()=>{const e=e=>{v.current&&!v.current.contains(e.target)&&c(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,a.useEffect)(()=>{l&&y()},[l,e,o]),(0,a.useEffect)(()=>{y()},[e]);const y=async()=>{h(!0);try{switch(e){case"labels":await x();break;case"tabs":await k();break;case"groups":await E();break;case"kanban":await C()}}catch(e){}finally{h(!1)}},x=async()=>{try{let e=[];const t=localStorage.getItem("kanban_labels");if(t)try{e=JSON.parse(t)}catch(e){}e&&0!==e.length||(e=await w(),e.length>0&&localStorage.setItem("kanban_labels",JSON.stringify(e))),m(e.map(e=>({id:e.id,name:e.name,color:e.hexColor||e.color||"#6b7280"})))}catch(e){m([])}},w=()=>new Promise(e=>{const t=n=>{document.removeEventListener("getAllLabelsResponse",t),n.detail?.success&&n.detail?.labels?e(n.detail.labels):e([])};document.addEventListener("getAllLabelsResponse",t),document.dispatchEvent(new CustomEvent("getAllLabelsRequest")),setTimeout(()=>{document.removeEventListener("getAllLabelsResponse",t),e([])},3e3)}),k=async()=>{try{let e=[];try{const t=(await n().storage.local.get("wa_extension_tabs")).wa_extension_tabs;t?.tabs&&(e=t.tabs)}catch(e){}const t=e.filter(e=>!e.isPermanent&&!e.isSystemFilter&&!["all","one-to-one","groups","unread","unsaved"].includes(e.id));m(t.map(e=>({id:e.id,name:e.title,color:ca.primary})))}catch(e){m([])}},E=async()=>{try{const e=await S();m(e.map(e=>({id:e.id,name:e.name,color:"#10b981"})))}catch(e){m([])}},S=()=>new Promise(e=>{const t=n=>{document.removeEventListener("getAllGroupsResponse",t),n.detail?.success&&n.detail?.groups?e(n.detail.groups):e([])};document.addEventListener("getAllGroupsResponse",t),document.dispatchEvent(new CustomEvent("getAllGroupsRequest")),setTimeout(()=>{document.removeEventListener("getAllGroupsResponse",t),e([])},5e3)}),C=async()=>{try{let e={crms:[],stages:[]};try{const t=await n().storage.local.get("wa_kanban_crm_data_sync");t.wa_kanban_crm_data_sync&&(e=t.wa_kanban_crm_data_sync)}catch(e){}const t=(e.crms||[]).filter(e=>"user"===e.type).map(e=>({id:e.id,name:e.name}));u(t),!o&&t.length>0&&i&&i(t[0].id);const a=o||(t.length>0?t[0].id:null);if(a){let n=[];Array.isArray(e.stages)?n=e.stages.filter(e=>e.crmId===a):e.stages&&"object"==typeof e.stages&&(n=e.stages[a]||[]),n=n.sort((e,t)=>(e.position||0)-(t.position||0));const r=t.find(e=>e.id===a);m(n.map(e=>({id:e.id,name:e.name,color:e.color||"#6b7280",crmId:e.crmId||a,crmName:r?.name})))}else m([])}catch(e){m([]),u([])}},T=d.filter(e=>e.name.toLowerCase().includes(b.toLowerCase())),A=d.filter(e=>t.includes(e.id));return a.createElement(a.Fragment,null,a.createElement("style",null,"\n  .funnel-selector {\n    position: relative;\n  }\n\n  .funnel-selector-trigger {\n    width: 100%;\n    min-height: 42px;\n    padding: 8px 12px;\n    background: var(--lion-bg-primary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    flex-wrap: wrap;\n    gap: 6px;\n    transition: all 0.15s ease;\n  }\n\n  .funnel-selector-trigger:hover {\n    border-color: var(--lion-primary);\n  }\n\n  .funnel-selector-trigger.open {\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  .funnel-selector-placeholder {\n    color: var(--lion-text-muted);\n    font-size: 13px;\n  }\n\n  .funnel-selector-tag {\n    display: inline-flex;\n    align-items: center;\n    gap: 4px;\n    padding: 4px 10px;\n    background: var(--lion-primary);\n    border: none;\n    border-radius: 20px;\n    font-size: 12px;\n    color: #ffffff !important;\n    font-weight: 500;\n    letter-spacing: 0.01em;\n    box-shadow: 0 1px 3px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .funnel-selector-tag-color {\n    width: 8px;\n    height: 8px;\n    border-radius: 50%;\n    flex-shrink: 0;\n  }\n\n  .funnel-selector-tag-remove {\n    width: 14px;\n    height: 14px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    cursor: pointer;\n    opacity: 0.8;\n    transition: opacity 0.15s ease;\n  }\n\n  .funnel-selector-tag-remove:hover {\n    opacity: 1;\n  }\n\n  .funnel-selector-tag-remove svg {\n    width: 10px;\n    height: 10px;\n  }\n\n  .funnel-selector-dropdown {\n    position: absolute;\n    top: 100%;\n    left: 0;\n    right: 0;\n    margin-top: 4px;\n    background: var(--lion-bg-primary, #ffffff);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 16px;\n    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);\n    z-index: 99999;\n    max-height: 300px;\n    overflow: hidden;\n    display: flex;\n    flex-direction: column;\n  }\n\n  .funnel-selector-search {\n    padding: 10px;\n    border-bottom: 1px solid var(--lion-border-light);\n  }\n\n  .funnel-selector-search input {\n    width: 100%;\n    padding: 8px 10px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 13px;\n    color: var(--lion-text-primary) !important;\n    background: var(--lion-bg-secondary) !important;\n    transition: all 0.15s ease;\n  }\n\n  .funnel-selector-search input::placeholder {\n    color: var(--lion-text-muted);\n  }\n\n  .funnel-selector-search input:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  .funnel-selector-crm-select {\n    padding: 10px;\n    border-bottom: 1px solid var(--lion-border-light);\n  }\n\n  .funnel-selector-crm-select select {\n    width: 100%;\n    padding: 8px 10px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 13px;\n    color: var(--lion-text-primary) !important;\n    background: var(--lion-bg-secondary) !important;\n    cursor: pointer;\n    transition: all 0.15s ease;\n  }\n\n  .funnel-selector-crm-select select:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  .funnel-selector-list {\n    flex: 1;\n    overflow-y: auto;\n    padding: 6px;\n    scrollbar-width: thin;\n    scrollbar-color: var(--lion-border-medium) transparent;\n  }\n\n  .funnel-selector-list::-webkit-scrollbar {\n    width: 6px;\n  }\n\n  .funnel-selector-list::-webkit-scrollbar-track {\n    background: transparent;\n  }\n\n  .funnel-selector-list::-webkit-scrollbar-thumb {\n    background: var(--lion-border-medium);\n    border-radius: 3px;\n  }\n\n  .funnel-selector-item {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    padding: 10px 12px;\n    border-radius: 8px;\n    cursor: pointer;\n    transition: all 0.15s ease;\n  }\n\n  .funnel-selector-item:hover {\n    background: var(--lion-bg-secondary);\n  }\n\n  .funnel-selector-item.selected {\n    background: var(--lion-primary-light);\n  }\n\n  .funnel-selector-item:active {\n    transform: scale(0.99);\n  }\n\n  .funnel-selector-checkbox {\n    width: 18px;\n    height: 18px;\n    border: 2px solid var(--lion-border-medium, var(--lion-border-light));\n    border-radius: 5px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    flex-shrink: 0;\n    transition: all 0.15s ease;\n    background: var(--lion-bg-primary);\n  }\n\n  .funnel-selector-item:hover .funnel-selector-checkbox {\n    border-color: var(--lion-primary);\n  }\n\n  .funnel-selector-item.selected .funnel-selector-checkbox {\n    background: var(--lion-primary);\n    border-color: var(--lion-primary);\n    box-shadow: 0 1px 3px rgba(var(--lion-primary-rgb), 0.3);\n  }\n\n  .funnel-selector-checkbox svg {\n    width: 11px;\n    height: 11px;\n    color: white;\n    opacity: 0;\n    transition: opacity 0.15s ease;\n  }\n\n  .funnel-selector-item.selected .funnel-selector-checkbox svg {\n    opacity: 1;\n  }\n\n  .funnel-selector-item-color {\n    width: 12px;\n    height: 12px;\n    border-radius: 50%;\n    flex-shrink: 0;\n  }\n\n  .funnel-selector-item-name {\n    flex: 1;\n    font-size: 13px;\n    color: var(--lion-text-primary);\n    white-space: nowrap;\n    overflow: hidden;\n    text-overflow: ellipsis;\n  }\n\n  .funnel-selector-item-crm {\n    font-size: 11px;\n    color: var(--lion-text-muted);\n    padding: 2px 6px;\n    background: var(--lion-bg-tertiary);\n    border-radius: 4px;\n  }\n\n  .funnel-selector-empty {\n    padding: 24px;\n    text-align: center;\n    color: var(--lion-text-muted);\n    font-size: 13px;\n  }\n\n  .funnel-selector-loading {\n    padding: 24px;\n    text-align: center;\n    color: var(--lion-text-muted);\n    font-size: 13px;\n  }\n"),a.createElement("div",{className:"funnel-selector",ref:v},a.createElement("div",{className:"funnel-selector-trigger "+(l?"open":""),onClick:e=>{e.stopPropagation(),c(!l)}},0===A.length?a.createElement("span",{className:"funnel-selector-placeholder"},(()=>{switch(e){case"labels":return(0,s.t)("followUp.selectLabels")||"Select labels...";case"tabs":return(0,s.t)("followUp.selectTabs")||"Select tabs...";case"groups":return(0,s.t)("followUp.selectGroups")||"Select groups...";case"kanban":return(0,s.t)("followUp.selectKanbanStage")||"Select Kanban stages...";default:return"Select..."}})()):A.map(e=>a.createElement("span",{key:e.id,className:"funnel-selector-tag"},e.color&&a.createElement("span",{className:"funnel-selector-tag-color",style:{backgroundColor:e.color}}),e.name,a.createElement("span",{className:"funnel-selector-tag-remove",onClick:n=>((e,n)=>{e.stopPropagation(),r(t.filter(e=>e!==n))})(n,e.id)},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 6L6 18M6 6l12 12"})))))),l&&a.createElement("div",{className:"funnel-selector-dropdown"},"kanban"===e&&p.length>0&&a.createElement("div",{className:"funnel-selector-crm-select"},a.createElement("select",{value:o||"",onChange:e=>{i&&(i(e.target.value),r([]))}},p.map(e=>a.createElement("option",{key:e.id,value:e.id},e.name)))),a.createElement("div",{className:"funnel-selector-search"},a.createElement("input",{type:"text",placeholder:(0,s.t)("followUp.search")||"Search...",value:b,onChange:e=>f(e.target.value),autoFocus:!0})),a.createElement("div",{className:"funnel-selector-list"},g?a.createElement("div",{className:"funnel-selector-loading"},(0,s.t)("followUp.loading")||"Loading..."):0===T.length?a.createElement("div",{className:"funnel-selector-empty"},(()=>{switch(e){case"labels":return(0,s.t)("followUp.noLabels")||"No labels found";case"tabs":return(0,s.t)("followUp.noTabs")||"No custom tabs found";case"groups":return(0,s.t)("followUp.noGroups")||"No groups found";case"kanban":return(0,s.t)("followUp.noStages")||"No stages found";default:return"No items found"}})()):T.map(e=>a.createElement("div",{key:e.id,className:"funnel-selector-item "+(t.includes(e.id)?"selected":""),onClick:()=>{return n=e.id,void(t.includes(n)?r(t.filter(e=>e!==n)):r([...t,n]));var n}},a.createElement("div",{className:"funnel-selector-checkbox"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))),e.color&&a.createElement("span",{className:"funnel-selector-item-color",style:{backgroundColor:e.color}}),a.createElement("span",{className:"funnel-selector-item-name"},e.name),e.crmName&&a.createElement("span",{className:"funnel-selector-item-crm"},e.crmName)))))))},ip=[{value:"none",label:"Message Only"},{value:"image/video",label:"Message + Images/Videos"},{value:"document",label:"Message + Documents"},{value:"audio",label:"Message + Audio"},{value:"contact",label:"Message + Contacts"},{value:"poll",label:"Message + Poll"},{value:"list",label:"Message + List"},{value:"product",label:"Message + Products"},{value:"fluxo",label:"Trigger Fluxo (Chatbot)"}],sp=["@firstname","@lastname","@contactname","@whatsappname","@variable1"],lp=[{value:"daily",icon:"📅",labelKey:"followUp.schedule.daily",descKey:"followUp.schedule.dailyDesc",tooltipTitle:"Daily Schedule",tooltipContent:"Select specific dates from calendar. Messages will be sent only on selected dates each month/year.",tooltipExample:"Example: Select Jan 5, Jan 15, Feb 10 → Messages sent only on these exact dates"},{value:"weekly",icon:"📆",labelKey:"followUp.schedule.weekly",descKey:"followUp.schedule.weeklyDesc",tooltipTitle:"Weekly Schedule",tooltipContent:"Select weekdays (Mon, Tue, Wed...). Messages repeat every week on selected days automatically.",tooltipExample:"Example: Select Mon, Wed, Fri → Messages sent every Monday, Wednesday, Friday"},{value:"monthly",icon:"🗓️",labelKey:"followUp.schedule.monthly",descKey:"followUp.schedule.monthlyDesc",tooltipTitle:"Monthly Schedule",tooltipContent:"Select dates from calendar. Best for recurring monthly messages on specific dates.",tooltipExample:"Example: Select 1st, 15th of each month → Messages sent on 1st and 15th every month"},{value:"yearly",icon:"🎯",labelKey:"followUp.schedule.yearly",descKey:"followUp.schedule.yearlyDesc",tooltipTitle:"Yearly Schedule",tooltipContent:"Select month + day combinations. Perfect for annual events like birthdays, anniversaries.",tooltipExample:"Example: Select March 25, Dec 31 → Messages sent on these dates every year"}],cp=({timeConfig:e,onChange:t,defaultActions:n,onActionsChange:r})=>{const[o,i]=(0,a.useState)(1),[l,c]=(0,a.useState)(()=>({...Nm,...e,mode:"specific"})),[d,m]=(0,a.useState)({}),[p,u]=(0,a.useState)([]),[g,h]=(0,a.useState)([]),[b,f]=(0,a.useState)(!1),[v,y]=(0,a.useState)(()=>new Date);(0,a.useEffect)(()=>{(async()=>{try{await tp.FluxoStorage.restoreFromBrowserStorage(),u(tp.FluxoStorage.getFlows()),h(tp.FluxoStorage.getCategories())}catch(e){}})()},[]),(0,a.useEffect)(()=>{t(l)},[l]);const x=e=>{c(t=>({...t,...e}))},w=()=>{const e=l.yearlyDates||[];x({yearlyDates:[...e,{month:1,day:1}]})},k=(e,t,n)=>{const a=[...l.yearlyDates||[]];a[e]={...a[e],[t]:n},x({yearlyDates:a})},E=()=>{switch(l.scheduleType){case"weekly":return(l.weekdays||[]).map(e=>function(e){const t=km.find(t=>t.value===e);return t?t.key:"mon"}(e));case"monthly":case"daily":return l.calendarDates||[];case"yearly":return(l.yearlyDates||[]).map(e=>{return t=e.month,n=e.day,`${t}-${n}`;var t,n});default:return[]}};(0,a.useEffect)(()=>{if("different"===l.messageModePerDay){const e=E(),t=l.dayMessages||{},n={};e.forEach(e=>{t[e]?n[e]=t[e]:n[e]={messages:[{id:Dm(),message:"",attachmentType:"none",attachments:[],delay:{min:3,max:5}}]}}),x({dayMessages:n})}},[l.messageModePerDay,l.weekdays,l.monthlyDates,l.specificDates,l.yearlyDates]);return a.createElement(a.Fragment,null,a.createElement("style",null,"\n  .schedule-wizard {\n    background: var(--lion-bg-primary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 12px;\n    overflow: visible;\n  }\n\n  .schedule-wizard-header {\n    background: var(--lion-primary);\n    padding: 16px 20px;\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n  }\n\n  .schedule-wizard-title {\n    color: white;\n    font-size: 15px;\n    font-weight: 600;\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .schedule-wizard-steps {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .schedule-step-indicator {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n  }\n\n  .schedule-step-dot {\n    width: 24px;\n    height: 24px;\n    border-radius: 50%;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    font-size: 12px;\n    font-weight: 600;\n    transition: all 0.15s ease;\n  }\n\n  .schedule-step-dot.active {\n    background: var(--lion-primary);\n    color: #ffffff;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .schedule-step-dot.completed {\n    background: var(--lion-primary);\n    color: #ffffff;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .schedule-step-dot.pending {\n    background: rgba(255,255,255,0.15);\n    color: rgba(255,255,255,0.6);\n  }\n\n  .schedule-step-line {\n    width: 20px;\n    height: 2px;\n    background: var(--lion-border-light);\n  }\n\n  .schedule-step-line.completed {\n    background: var(--lion-primary);\n  }\n\n  .schedule-wizard-content {\n    padding: 20px;\n    min-height: 280px;\n    overflow: visible;\n  }\n\n  .schedule-wizard-footer {\n    padding: 16px 20px;\n    background: var(--lion-bg-secondary);\n    border-top: 1px solid var(--lion-border-light);\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n  }\n\n  /* Step 1: Schedule Type Cards */\n  .schedule-type-grid {\n    display: grid;\n    grid-template-columns: repeat(2, 1fr);\n    gap: 12px;\n    overflow: visible;\n  }\n\n  .schedule-type-card {\n    padding: 16px;\n    border: 2px solid var(--lion-border-light);\n    border-radius: 14px;\n    cursor: pointer;\n    transition: all 0.15s ease;\n    background: var(--lion-bg-secondary);\n    text-align: center;\n  }\n\n  .schedule-type-card:hover {\n    border-color: var(--lion-primary);\n    transform: translateY(-2px);\n    box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.15);\n  }\n\n  .schedule-type-card.selected {\n    border-color: var(--lion-primary);\n    background: rgba(var(--lion-primary-rgb), 0.04);\n  }\n\n  .schedule-type-icon {\n    font-size: 28px;\n    margin-bottom: 8px;\n  }\n\n  .schedule-type-title {\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--lion-text-primary);\n    margin-bottom: 4px;\n  }\n\n  .schedule-type-desc {\n    font-size: 11px;\n    color: var(--lion-text-muted);\n  }\n\n  /* Schedule Type Info Icon */\n  .schedule-type-info {\n    position: absolute;\n    top: 8px;\n    right: 8px;\n    width: 18px;\n    height: 18px;\n    cursor: help;\n    z-index: 10;\n  }\n\n  .schedule-type-info svg {\n    width: 18px;\n    height: 18px;\n    color: var(--lion-text-muted);\n    transition: color 0.15s ease;\n  }\n\n  .schedule-type-info:hover svg {\n    color: var(--lion-primary);\n  }\n\n  .schedule-type-card {\n    position: relative;\n    overflow: visible;\n    z-index: 1;\n  }\n\n  /* When hovering info icon, bring card to front so tooltip shows above other cards */\n  .schedule-type-card:has(.schedule-type-info:hover) {\n    z-index: 100;\n  }\n\n  /* Info Tooltip - Absolute positioning relative to info icon */\n  .schedule-info-tooltip {\n    position: absolute;\n    width: 280px;\n    padding: 14px 16px;\n    background: var(--lion-text-primary);\n    color: #ffffff;\n    font-size: 12px;\n    line-height: 1.5;\n    border-radius: 10px;\n    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);\n    z-index: 99999;\n    opacity: 0;\n    visibility: hidden;\n    transition: opacity 0.15s ease, visibility 0.15s ease;\n    pointer-events: none;\n    text-align: left;\n    white-space: normal;\n    top: 28px;\n    right: -8px;\n  }\n\n  .schedule-type-info:hover .schedule-info-tooltip {\n    opacity: 1;\n    visibility: visible;\n  }\n\n  .schedule-info-tooltip-title {\n    font-weight: 600;\n    font-size: 13px;\n    margin-bottom: 8px;\n    color: var(--lion-primary);\n  }\n\n  .schedule-info-tooltip-content {\n    color: var(--lion-border-light);\n    margin-bottom: 10px;\n  }\n\n  .schedule-info-tooltip-example {\n    padding: 10px;\n    background: rgba(255, 255, 255, 0.08);\n    border-radius: 6px;\n    font-size: 11px;\n  }\n\n  .schedule-info-tooltip-example-title {\n    font-weight: 600;\n    color: var(--lion-warning);\n    margin-bottom: 4px;\n  }\n\n  /* All tooltips get consistent positioning */\n  .schedule-type-card .schedule-info-tooltip {\n    right: -8px;\n    left: auto;\n  }\n\n  /* Message Mode Info */\n  .message-mode-info {\n    display: inline-flex;\n    align-items: center;\n    margin-left: 6px;\n    cursor: help;\n    position: relative;\n  }\n\n  .message-mode-info svg {\n    width: 16px;\n    height: 16px;\n    color: var(--lion-text-muted);\n    transition: color 0.15s ease;\n  }\n\n  .message-mode-info:hover svg {\n    color: var(--lion-primary);\n  }\n\n  .message-mode-info .schedule-info-tooltip {\n    top: 24px;\n    left: 0;\n    right: auto;\n  }\n\n  .message-mode-info:hover .schedule-info-tooltip {\n    opacity: 1;\n    visibility: visible;\n  }\n\n  /* Step 2: Day Selection */\n  .weekday-grid {\n    display: flex;\n    gap: 8px;\n    flex-wrap: wrap;\n    justify-content: center;\n    margin-bottom: 16px;\n  }\n\n  .weekday-chip {\n    width: 60px;\n    height: 50px;\n    border: 2px solid var(--lion-border-light);\n    border-radius: 10px;\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    cursor: pointer;\n    transition: all 0.15s ease;\n    background: var(--lion-bg-secondary);\n  }\n\n  .weekday-chip:hover {\n    border-color: var(--lion-primary);\n    background: var(--lion-primary-light);\n  }\n\n  .weekday-chip.selected {\n    border-color: var(--lion-primary);\n    background: var(--lion-primary);\n    color: #ffffff;\n    box-shadow: 0 2px 6px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .weekday-chip.selected .weekday-short,\n  .weekday-chip.selected .weekday-full {\n    color: white;\n  }\n\n  .weekday-short {\n    font-size: 13px;\n    font-weight: 600;\n    color: var(--lion-text-primary);\n  }\n\n  .weekday-full {\n    font-size: 9px;\n    color: var(--lion-text-muted);\n    margin-top: 2px;\n  }\n\n  /* Calendar View */\n  .calendar-container {\n    border: 1px solid var(--lion-border-light);\n    border-radius: 12px;\n    overflow: hidden;\n    background: var(--lion-bg-primary);\n    max-width: 400px;\n    margin: 0 auto;\n  }\n\n  .calendar-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 8px 12px;\n    background: var(--lion-bg-secondary);\n    border-bottom: 1px solid var(--lion-border-light);\n  }\n\n  .calendar-nav-btn {\n    width: 28px;\n    height: 28px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 8px;\n    background: var(--lion-bg-primary);\n    color: var(--lion-text-primary);\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s ease;\n  }\n\n  .calendar-nav-btn:hover {\n    border-color: var(--lion-primary);\n    color: var(--lion-primary);\n  }\n\n  .calendar-title {\n    font-size: 13px;\n    font-weight: 700;\n    color: var(--lion-text-primary);\n  }\n\n  .calendar-weekdays {\n    display: grid;\n    grid-template-columns: repeat(7, 1fr);\n    padding: 6px 8px;\n    background: var(--lion-bg-secondary);\n    border-bottom: 1px solid var(--lion-border-light);\n  }\n\n  .calendar-weekday {\n    text-align: center;\n    font-size: 10px;\n    font-weight: 600;\n    color: var(--lion-text-muted);\n    text-transform: uppercase;\n  }\n\n  .calendar-weekday.weekend {\n    color: var(--lion-error);\n  }\n\n  .calendar-grid {\n    display: grid;\n    grid-template-columns: repeat(7, 1fr);\n    gap: 3px;\n    padding: 6px 8px;\n  }\n\n  .calendar-date {\n    border: 1px solid transparent;\n    border-radius: 6px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    cursor: pointer;\n    font-size: 12px;\n    font-weight: 500;\n    color: var(--lion-text-primary);\n    background: var(--lion-bg-secondary);\n    transition: all 0.15s ease;\n    height: 30px;\n  }\n\n  .calendar-date:hover {\n    border-color: var(--lion-primary);\n    background: var(--lion-primary-light);\n  }\n\n  .calendar-date.selected {\n    border-color: var(--lion-primary);\n    background: var(--lion-primary);\n    color: #ffffff;\n    box-shadow: 0 2px 6px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .calendar-date.other-month {\n    color: var(--lion-text-muted);\n    opacity: 0.5;\n  }\n\n  .calendar-date.today {\n    border-color: var(--lion-primary);\n    font-weight: 700;\n  }\n\n  .calendar-date.weekend {\n    color: var(--lion-error);\n  }\n\n  .calendar-date.weekend.selected {\n    color: white;\n  }\n\n  .calendar-info {\n    padding: 8px 12px;\n    background: var(--lion-primary-light);\n    font-size: 11px;\n    color: var(--lion-text-secondary);\n    text-align: center;\n    border-top: 1px solid var(--lion-border-light);\n  }\n\n  /* Monthly Date Grid - Fallback */\n  .date-grid {\n    display: grid;\n    grid-template-columns: repeat(7, 1fr);\n    gap: 6px;\n  }\n\n  .date-chip {\n    aspect-ratio: 1;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 8px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    cursor: pointer;\n    font-size: 13px;\n    font-weight: 500;\n    color: var(--lion-text-primary);\n    background: var(--lion-bg-secondary);\n    transition: all 0.15s ease;\n  }\n\n  .date-chip:hover {\n    border-color: var(--lion-primary);\n    background: var(--lion-primary-light);\n  }\n\n  .date-chip.selected {\n    border-color: var(--lion-primary);\n    background: var(--lion-primary);\n    color: #ffffff;\n    box-shadow: 0 2px 6px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  /* Yearly Date List */\n  .yearly-dates-list {\n    display: flex;\n    flex-direction: column;\n    gap: 10px;\n  }\n\n  .yearly-date-item {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    padding: 12px;\n    background: var(--lion-bg-secondary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n  }\n\n  .yearly-date-selectors {\n    display: flex;\n    gap: 10px;\n    flex: 1;\n  }\n\n  .yearly-date-select {\n    flex: 1;\n    padding: 8px 12px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 13px;\n    background: var(--lion-bg-primary);\n    color: var(--lion-text-primary);\n    transition: border-color 0.15s ease, box-shadow 0.15s ease;\n  }\n\n  .yearly-date-select:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  .yearly-date-remove {\n    padding: 8px 12px;\n    background: var(--lion-error);\n    color: white;\n    border: none;\n    border-radius: 8px;\n    cursor: pointer;\n    font-size: 12px;\n    transition: all 0.15s ease;\n  }\n\n  .yearly-date-remove:hover {\n    opacity: 0.9;\n  }\n\n  .add-yearly-date-btn {\n    padding: 12px;\n    border: 2px dashed var(--lion-border-light);\n    border-radius: 10px;\n    background: transparent;\n    color: var(--lion-text-muted);\n    cursor: pointer;\n    font-size: 13px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    gap: 8px;\n    transition: all 0.15s ease;\n  }\n\n  .add-yearly-date-btn:hover {\n    border-color: var(--lion-primary);\n    color: var(--lion-primary);\n    background: var(--lion-primary-light);\n  }\n\n  /* Step 3: Time & Messages */\n  .time-config-section {\n    margin-bottom: 20px;\n  }\n\n  .time-config-label {\n    font-size: 12px;\n    font-weight: 700;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    color: var(--lion-text-secondary);\n    margin-bottom: 8px;\n    display: block;\n  }\n\n  .time-input {\n    padding: 10px 14px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 14px;\n    background: var(--lion-bg-secondary);\n    color: var(--lion-text-primary);\n    width: 150px;\n    transition: border-color 0.15s ease, box-shadow 0.15s ease;\n  }\n\n  .time-input:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  .message-mode-section {\n    margin-top: 20px;\n    padding-top: 20px;\n    border-top: 1px solid var(--lion-border-light);\n  }\n\n  .message-mode-options {\n    display: flex;\n    flex-direction: column;\n    gap: 10px;\n  }\n\n  .message-mode-option {\n    display: flex;\n    align-items: flex-start;\n    gap: 12px;\n    padding: 14px;\n    border: 2px solid var(--lion-border-light);\n    border-radius: 10px;\n    cursor: pointer;\n    transition: all 0.15s ease;\n    background: var(--lion-bg-secondary);\n  }\n\n  .message-mode-option:hover {\n    border-color: var(--lion-primary);\n  }\n\n  .message-mode-option.selected {\n    border-color: var(--lion-primary);\n    background: var(--lion-primary-light);\n  }\n\n  .message-mode-radio {\n    width: 18px;\n    height: 18px;\n    accent-color: var(--lion-primary);\n    margin-top: 2px;\n  }\n\n  .message-mode-content {\n    flex: 1;\n  }\n\n  .message-mode-title {\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--lion-text-primary);\n    margin-bottom: 2px;\n  }\n\n  .message-mode-desc {\n    font-size: 12px;\n    color: var(--lion-text-muted);\n  }\n\n  /* Day Messages (when different mode) */\n  .day-messages-container {\n    margin-top: 16px;\n    display: flex;\n    flex-direction: column;\n    gap: 12px;\n  }\n\n  .day-message-card {\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    overflow: hidden;\n  }\n\n  .day-message-header {\n    padding: 12px 16px;\n    background: var(--lion-bg-secondary);\n    border-bottom: 1px solid var(--lion-border-light);\n    font-size: 14px;\n    font-weight: 600;\n    color: var(--lion-text-primary);\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    cursor: pointer;\n  }\n\n  .day-message-header-icon {\n    transition: transform 0.15s ease;\n  }\n\n  .day-message-header-icon.expanded {\n    transform: rotate(180deg);\n  }\n\n  .day-message-content {\n    padding: 16px;\n    background: var(--lion-bg-primary);\n  }\n\n  .day-message-content.collapsed {\n    display: none;\n  }\n\n  /* Day Message Editor Styles */\n  .day-msg-form-group {\n    margin-bottom: 14px;\n  }\n\n  .day-msg-form-group:last-child {\n    margin-bottom: 0;\n  }\n\n  .day-msg-label {\n    display: block;\n    font-size: 12px;\n    font-weight: 700;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    color: var(--lion-text-secondary);\n    margin-bottom: 6px;\n  }\n\n  .day-msg-select {\n    width: 100%;\n    padding: 10px 12px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 13px;\n    color: var(--lion-text-primary) !important;\n    background: var(--lion-bg-secondary) !important;\n    cursor: pointer;\n    transition: border-color 0.15s ease, box-shadow 0.15s ease;\n  }\n\n  .day-msg-select:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  .day-msg-textarea {\n    width: 100%;\n    padding: 12px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 13px;\n    color: var(--lion-text-primary) !important;\n    background: var(--lion-bg-secondary) !important;\n    resize: vertical;\n    min-height: 100px;\n    font-family: inherit;\n    line-height: 1.5;\n    transition: border-color 0.15s ease, box-shadow 0.15s ease;\n  }\n\n  .day-msg-textarea:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  .day-msg-textarea::placeholder {\n    color: var(--lion-text-muted);\n  }\n\n  .day-msg-variables-row {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 6px;\n    margin-top: 8px;\n    align-items: center;\n  }\n\n  .day-msg-variables-label {\n    font-size: 11px;\n    color: var(--lion-text-muted);\n    margin-right: 4px;\n  }\n\n  .day-msg-variable-chip {\n    padding: 4px 10px;\n    background: var(--lion-primary) !important;\n    border: 1px solid var(--lion-primary);\n    border-radius: 20px;\n    font-size: 11px;\n    font-weight: 500;\n    color: #ffffff !important;\n    cursor: pointer;\n    transition: all 0.15s ease;\n  }\n\n  .day-msg-variable-chip:hover {\n    background: var(--lion-primary-hover) !important;\n  }\n\n  .day-msg-attachment-section {\n    margin-top: 14px;\n    padding-top: 14px;\n    border-top: 1px solid var(--lion-border-light);\n  }\n\n  .day-msg-delay-row {\n    display: grid;\n    grid-template-columns: 1fr 1fr;\n    gap: 12px;\n    margin-top: 14px;\n    padding-top: 14px;\n    border-top: 1px solid var(--lion-border-light);\n  }\n\n  .day-msg-input {\n    width: 100%;\n    padding: 10px 12px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 13px;\n    color: var(--lion-text-primary) !important;\n    background: var(--lion-bg-secondary) !important;\n    transition: border-color 0.15s ease, box-shadow 0.15s ease;\n  }\n\n  .day-msg-input:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  /* Selection Summary */\n  .selection-summary {\n    padding: 12px 16px;\n    background: var(--lion-primary-light);\n    border-radius: 8px;\n    margin-top: 16px;\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .selection-summary-label {\n    font-size: 12px;\n    color: var(--lion-text-secondary);\n  }\n\n  .selection-summary-tags {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 6px;\n  }\n\n  .selection-tag {\n    padding: 4px 8px;\n    background: var(--lion-primary);\n    color: white;\n    border-radius: 4px;\n    font-size: 11px;\n    font-weight: 500;\n  }\n\n  /* Wizard Buttons */\n  .wizard-btn {\n    padding: 10px 20px;\n    border-radius: 10px;\n    font-size: 14px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.15s ease;\n    display: flex;\n    align-items: center;\n    gap: 6px;\n  }\n\n  .wizard-btn-secondary {\n    background: var(--lion-bg-tertiary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    color: var(--lion-text-secondary);\n  }\n\n  .wizard-btn-secondary:hover {\n    background: var(--lion-bg-secondary);\n    border-color: var(--lion-text-muted);\n  }\n\n  .wizard-btn-primary {\n    background: var(--lion-primary);\n    border: none;\n    color: #ffffff;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .wizard-btn-primary:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.3);\n  }\n\n  .wizard-btn-primary:disabled {\n    opacity: 0.5;\n    cursor: not-allowed;\n    transform: none;\n    box-shadow: none;\n  }\n\n  /* Slim scrollbar styling */\n  .schedule-wizard-content::-webkit-scrollbar {\n    width: 4px;\n  }\n\n  .schedule-wizard-content::-webkit-scrollbar-track {\n    background: transparent;\n  }\n\n  .schedule-wizard-content::-webkit-scrollbar-thumb {\n    background: var(--lion-border-light);\n    border-radius: 4px;\n  }\n\n  .schedule-wizard-content::-webkit-scrollbar-thumb:hover {\n    background: var(--lion-text-muted);\n  }\n\n  .day-messages-container::-webkit-scrollbar {\n    width: 4px;\n  }\n\n  .day-messages-container::-webkit-scrollbar-track {\n    background: transparent;\n  }\n\n  .day-messages-container::-webkit-scrollbar-thumb {\n    background: var(--lion-border-light);\n    border-radius: 4px;\n  }\n\n  .day-messages-container::-webkit-scrollbar-thumb:hover {\n    background: var(--lion-text-muted);\n  }\n"),a.createElement("div",{className:"schedule-wizard"},a.createElement("div",{className:"schedule-wizard-header"},a.createElement("div",{className:"schedule-wizard-title"},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"})),(0,s.t)("followUp.scheduleWizard.title")||"Schedule Configuration"),a.createElement("div",{className:"schedule-wizard-steps"},[1,2,3].map((e,t)=>a.createElement("div",{key:e,className:"schedule-step-indicator"},t>0&&a.createElement("div",{className:"schedule-step-line "+(o>e-1?"completed":"")}),a.createElement("div",{className:"schedule-step-dot "+(o===e?"active":o>e?"completed":"pending")},o>e?"✓":e))))),a.createElement("div",{className:"schedule-wizard-content"},1===o&&a.createElement("div",null,a.createElement("div",{style:{marginBottom:"16px",fontSize:"14px",color:"var(--lion-text-secondary)"}},(0,s.t)("followUp.scheduleWizard.step1")||"Step 1: Schedule Type"),a.createElement("div",{className:"schedule-type-grid"},lp.map(e=>a.createElement("div",{key:e.value,className:"schedule-type-card "+(l.scheduleType===e.value?"selected":""),onClick:()=>x({scheduleType:e.value})},a.createElement("span",{className:"schedule-type-info",onClick:e=>e.stopPropagation()},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("path",{d:"M12 16v-4M12 8h.01"})),a.createElement("div",{className:"schedule-info-tooltip"},a.createElement("div",{className:"schedule-info-tooltip-title"},e.tooltipTitle),a.createElement("div",{className:"schedule-info-tooltip-content"},e.tooltipContent),a.createElement("div",{className:"schedule-info-tooltip-example"},a.createElement("div",{className:"schedule-info-tooltip-example-title"},"Example:"),a.createElement("div",null,e.tooltipExample)))),a.createElement("div",{className:"schedule-type-icon"},e.icon),a.createElement("div",{className:"schedule-type-title"},(0,s.t)(e.labelKey)||e.value),a.createElement("div",{className:"schedule-type-desc"},(0,s.t)(e.descKey)||""))))),2===o&&(()=>{const e=(()=>{switch(l.scheduleType){case"weekly":return(l.weekdays||[]).map(e=>{const t=km.find(t=>t.value===e);return t?(0,s.t)(`followUp.weekday.${t.key}`)||t.label:""});case"monthly":case"daily":const e=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return(l.calendarDates||[]).map(t=>{const[,n,a]=t.split("-").map(Number),r=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"][n-1];return`${a} ${(0,s.t)(`followUp.month.${r}`)?.slice(0,3)||e[n-1]}`});case"yearly":return(l.yearlyDates||[]).map(e=>{const t=Em.find(t=>t.value===e.month);return`${t?(0,s.t)(`followUp.month.${t.key}`)||t.label:""} ${e.day}`});default:return[]}})();return a.createElement("div",null,a.createElement("div",{style:{marginBottom:"16px",fontSize:"14px",color:"var(--lion-text-secondary)"}},(0,s.t)("followUp.scheduleWizard.step2")||"Step 2: Select Days"),"weekly"===l.scheduleType&&a.createElement("div",{className:"weekday-grid"},km.map(e=>a.createElement("div",{key:e.value,className:"weekday-chip "+(l.weekdays?.includes(e.value)?"selected":""),onClick:()=>(e=>{const t=l.weekdays||[],n=t.includes(e)?t.filter(t=>t!==e):[...t,e].sort((e,t)=>e-t);x({weekdays:n})})(e.value)},a.createElement("span",{className:"weekday-short"},(0,s.t)(`followUp.weekday.${e.key}`)||e.key.toUpperCase().slice(0,3)),a.createElement("span",{className:"weekday-full"},(0,s.t)(`followUp.weekday.${e.key}`)||e.label)))),("monthly"===l.scheduleType||"daily"===l.scheduleType)&&(()=>{const e=v.getFullYear(),t=v.getMonth(),n=new Date(e,t,1).getDay(),r=new Date(e,t+1,0).getDate(),o=new Date(e,t,0).getDate(),i=new Date,c=i.getFullYear()===e&&i.getMonth()===t,d=[];for(let e=n-1;e>=0;e--)d.push({date:o-e,isCurrentMonth:!1,isWeekend:!1});for(let e=1;e<=r;e++){const t=(n+e-1)%7;d.push({date:e,isCurrentMonth:!0,isWeekend:0===t||6===t})}const m=42-d.length;for(let e=1;e<=m;e++)d.push({date:e,isCurrentMonth:!1,isWeekend:!1});const p=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"][t];return a.createElement("div",{className:"calendar-container"},a.createElement("div",{className:"calendar-header"},a.createElement("button",{className:"calendar-nav-btn",onClick:()=>y(new Date(e,t-1,1))},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M15 18l-6-6 6-6"}))),a.createElement("span",{className:"calendar-title"},(0,s.t)(`followUp.month.${p}`)||["January","February","March","April","May","June","July","August","September","October","November","December"][t]," ",e),a.createElement("button",{className:"calendar-nav-btn",onClick:()=>y(new Date(e,t+1,1))},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M9 18l6-6-6-6"})))),a.createElement("div",{className:"calendar-weekdays"},["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map((e,t)=>a.createElement("div",{key:e,className:"calendar-weekday "+(0===t||6===t?"weekend":"")},(0,s.t)(`followUp.weekday.${["sun","mon","tue","wed","thu","fri","sat"][t]}`)?.slice(0,3)||e))),a.createElement("div",{className:"calendar-grid"},d.map((n,r)=>{const o=n.isCurrentMonth&&(n=>{const a=`${e}-${String(t+1).padStart(2,"0")}-${String(n).padStart(2,"0")}`;return(l.calendarDates||[]).includes(a)})(n.date),s=c&&n.isCurrentMonth&&n.date===i.getDate();return a.createElement("div",{key:r,className:`calendar-date ${o?"selected":""} ${n.isCurrentMonth?"":"other-month"} ${s?"today":""} ${n.isCurrentMonth&&n.isWeekend?"weekend":""}`,onClick:()=>{n.isCurrentMonth&&(e=>{const t=v.getFullYear(),n=v.getMonth(),a=`${t}-${String(n+1).padStart(2,"0")}-${String(e).padStart(2,"0")}`,r=l.calendarDates||[],o=r.includes(a)?r.filter(e=>e!==a):[...r,a].sort();x({calendarDates:o})})(n.date)}},n.date)})),a.createElement("div",{className:"calendar-info"},(0,s.t)("followUp.calendarSelectInfo")||"Select specific dates from the calendar. Navigate months using arrows."))})(),"yearly"===l.scheduleType&&a.createElement("div",{className:"yearly-dates-list"},(l.yearlyDates||[]).map((e,t)=>a.createElement("div",{key:t,className:"yearly-date-item"},a.createElement("div",{className:"yearly-date-selectors"},a.createElement("select",{className:"yearly-date-select",value:e.month,onChange:e=>k(t,"month",parseInt(e.target.value))},Em.map(e=>a.createElement("option",{key:e.value,value:e.value},(0,s.t)(`followUp.month.${e.key}`)||e.label))),a.createElement("select",{className:"yearly-date-select",value:e.day,onChange:e=>k(t,"day",parseInt(e.target.value))},Array.from({length:31},(e,t)=>t+1).map(e=>a.createElement("option",{key:e,value:e},e)))),a.createElement("button",{className:"yearly-date-remove",onClick:()=>(e=>{const t=[...l.yearlyDates||[]];t.splice(e,1),x({yearlyDates:t})})(t)},(0,s.t)("followUp.removeDate")||"Remove"))),a.createElement("button",{className:"add-yearly-date-btn",onClick:w},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M12 5v14M5 12h14"})),(0,s.t)("followUp.addDate")||"Add Date")),e.length>0&&a.createElement("div",{className:"selection-summary"},a.createElement("span",{className:"selection-summary-label"},(0,s.t)("followUp.selectedDays")||"Selected",":"),a.createElement("div",{className:"selection-summary-tags"},e.map((e,t)=>a.createElement("span",{key:t,className:"selection-tag"},e)))))})(),3===o&&(()=>{const e=E();return a.createElement("div",null,a.createElement("div",{style:{marginBottom:"16px",fontSize:"14px",color:"var(--lion-text-secondary)"}},(0,s.t)("followUp.scheduleWizard.step3")||"Step 3: Time & Messages"),a.createElement("div",{className:"time-config-section"},a.createElement("label",{className:"time-config-label"},(0,s.t)("followUp.sendTime")||"Send Time"),a.createElement("input",{type:"time",className:"time-input",value:l.specificTime||"10:00",onChange:e=>x({specificTime:e.target.value})})),a.createElement("div",{className:"message-mode-section"},a.createElement("label",{className:"time-config-label"},(0,s.t)("followUp.messageMode")||"Message Mode"),a.createElement("div",{className:"message-mode-options"},a.createElement("div",{className:"message-mode-option "+("same"===l.messageModePerDay?"selected":""),onClick:()=>x({messageModePerDay:"same"})},a.createElement("input",{type:"radio",className:"message-mode-radio",checked:"same"===l.messageModePerDay,onChange:()=>x({messageModePerDay:"same"})}),a.createElement("div",{className:"message-mode-content"},a.createElement("div",{className:"message-mode-title",style:{display:"flex",alignItems:"center"}},(0,s.t)("followUp.sameMessage")||"Same Message for All Days",a.createElement("span",{className:"message-mode-info",onClick:e=>e.stopPropagation()},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("path",{d:"M12 16v-4M12 8h.01"})),a.createElement("div",{className:"schedule-info-tooltip"},a.createElement("div",{className:"schedule-info-tooltip-title"},"Same Message for All Days"),a.createElement("div",{className:"schedule-info-tooltip-content"},'All selected days will send the SAME message. Configure your message in the "Actions" section below after clicking "Done".'),a.createElement("div",{className:"schedule-info-tooltip-example"},a.createElement("div",{className:"schedule-info-tooltip-example-title"},"How to use:"),a.createElement("div",null,'1. Click "Done" to finish schedule setup',a.createElement("br",null),'2. Go to "Actions" section below',a.createElement("br",null),"3. Add your message there"))))),a.createElement("div",{className:"message-mode-desc"},(0,s.t)("followUp.sameMessageDesc")||"Use the same message configuration for every selected day"))),a.createElement("div",{className:"message-mode-option "+("different"===l.messageModePerDay?"selected":""),onClick:()=>x({messageModePerDay:"different"})},a.createElement("input",{type:"radio",className:"message-mode-radio",checked:"different"===l.messageModePerDay,onChange:()=>x({messageModePerDay:"different"})}),a.createElement("div",{className:"message-mode-content"},a.createElement("div",{className:"message-mode-title",style:{display:"flex",alignItems:"center"}},(0,s.t)("followUp.differentMessages")||"Different Message per Day",a.createElement("span",{className:"message-mode-info",onClick:e=>e.stopPropagation()},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("path",{d:"M12 16v-4M12 8h.01"})),a.createElement("div",{className:"schedule-info-tooltip"},a.createElement("div",{className:"schedule-info-tooltip-title"},"Different Message per Day"),a.createElement("div",{className:"schedule-info-tooltip-content"},"Configure UNIQUE messages for each selected day. Each day can have its own text, media, and delay settings."),a.createElement("div",{className:"schedule-info-tooltip-example"},a.createElement("div",{className:"schedule-info-tooltip-example-title"},"How to use:"),a.createElement("div",null,"Expand each day card below and write different messages for each day.",a.createElement("br",null),'Example: Mon → "Hello!", Wed → "Reminder!", Fri → "Special offer!"'))))),a.createElement("div",{className:"message-mode-desc"},(0,s.t)("followUp.differentMessagesDesc")||"Configure separate messages for each selected day"))))),"different"===l.messageModePerDay&&e.length>0&&a.createElement("div",{className:"day-messages-container"},e.map(e=>{const t=l.dayMessages?.[e]?.messages[0]||{id:Dm(),message:"",attachmentType:"none",attachments:[],delay:{min:3,max:5}},n=t=>{const n={...l.dayMessages};n[e]||(n[e]={messages:[{id:Dm(),message:"",attachmentType:"none",attachments:[],delay:{min:3,max:5}}]}),n[e].messages[0]={...n[e].messages[0],...t},x({dayMessages:n})};return a.createElement("div",{key:e,className:"day-message-card"},a.createElement("div",{className:"day-message-header",onClick:()=>(e=>{m(t=>({...t,[e]:!t[e]}))})(e)},a.createElement("span",null,(0,s.t)("followUp.messageFor")||"Message for"," ",(e=>{switch(l.scheduleType){case"weekly":const t=km.find(t=>t.key===e);return t?(0,s.t)(`followUp.weekday.${e}`)||t.label:e;case"monthly":case"daily":const n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],[,a,r]=e.split("-").map(Number),o=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"][a-1];return`${r} ${(0,s.t)(`followUp.month.${o}`)?.slice(0,3)||n[a-1]}`;case"yearly":const[i,l]=e.split("-").map(Number),c=Em.find(e=>e.value===i);return`${c?(0,s.t)(`followUp.month.${c.key}`)||c.label:""} ${l}`;default:return e}})(e)),a.createElement("svg",{className:"day-message-header-icon "+(d[e]?"expanded":""),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M6 9l6 6 6-6"}))),a.createElement("div",{className:"day-message-content "+(d[e]?"":"collapsed")},a.createElement("div",{className:"day-msg-form-group"},a.createElement("label",{className:"day-msg-label"},(0,s.t)("followUp.templatesType")||"Message Type"),a.createElement("select",{className:"day-msg-select",value:t.attachmentType,onChange:e=>(e=>{const t={attachmentType:e};"image/video"!==e&&"document"!==e&&"audio"!==e&&(t.attachments=[]),"contact"!==e&&(t.selectedContact=[]),"poll"!==e&&(t.pollData=null),"list"!==e&&(t.listData=null),"product"!==e&&(t.selectedProducts=[]),"fluxo"!==e&&(t.selectedFlowId=void 0,t.selectedCategoryId=void 0),n(t)})(e.target.value)},ip.map(e=>a.createElement("option",{key:e.value,value:e.value},(0,s.t)(`templates.attachmentType.${"none"===e.value?"none":e.value.replace("/","")}`)||e.label)))),"fluxo"!==t.attachmentType&&a.createElement("div",{className:"day-msg-form-group"},a.createElement("label",{className:"day-msg-label"},(0,s.t)("followUp.messageText")||"Message Text"),a.createElement("textarea",{id:`day-msg-textarea-${e}`,className:"day-msg-textarea",value:t.message,onChange:e=>n({message:e.target.value}),placeholder:(0,s.t)("followUp.messagePlaceholder")||"Type your message here..."}),a.createElement("div",{className:"day-msg-variables-row"},a.createElement("span",{className:"day-msg-variables-label"},(0,s.t)("followUp.clickToInsert")||"Click to insert:"),sp.map(r=>a.createElement("span",{key:r,className:"day-msg-variable-chip",onClick:()=>(a=>{const r=document.getElementById(`day-msg-textarea-${e}`);if(!r)return void n({message:t.message+" "+a});const o=r.selectionStart||t.message.length,i=t.message.substring(0,o),s=t.message.substring(o);n({message:i+a+" "+s}),setTimeout(()=>{r.focus(),r.setSelectionRange(o+a.length+1,o+a.length+1)},0)})(r)},r)))),"none"!==t.attachmentType&&a.createElement("div",{className:"day-msg-attachment-section"},("image/video"===t.attachmentType||"document"===t.attachmentType||"audio"===t.attachmentType)&&a.createElement(Ln,{attachments:t.attachments||[],attachmentType:t.attachmentType,onChange:e=>n({attachments:e})}),"contact"===t.attachmentType&&a.createElement(On,{selectedContacts:t.selectedContact||[],onChange:e=>n({selectedContact:e})}),"poll"===t.attachmentType&&a.createElement(Un,{pollData:t.pollData||null,onChange:e=>n({pollData:e})}),"list"===t.attachmentType&&a.createElement(Fn,{listData:t.listData||null,onChange:e=>n({listData:e})}),"product"===t.attachmentType&&a.createElement(Wn,{selectedProducts:t.selectedProducts||[],onChange:e=>n({selectedProducts:e})}),"fluxo"===t.attachmentType&&a.createElement(a.Fragment,null,a.createElement("div",{className:"day-msg-form-group"},a.createElement("label",{className:"day-msg-label"},(0,s.t)("followUp.fluxoCategory")||"Category"),a.createElement("select",{className:"day-msg-select",value:t.selectedCategoryId||"all",onChange:e=>n({selectedCategoryId:"all"===e.target.value?void 0:e.target.value,selectedFlowId:void 0})},a.createElement("option",{value:"all"},(0,s.t)("followUp.allCategories")||"All Categories"),g.map(e=>a.createElement("option",{key:e.id,value:e.id},e.icon," ",e.name)),a.createElement("option",{value:"uncategorized"},(0,s.t)("followUp.uncategorized")||"Uncategorized"))),a.createElement("div",{className:"day-msg-form-group"},a.createElement("label",{className:"day-msg-label"},(0,s.t)("followUp.selectFluxo")||"Select Fluxo"),a.createElement("select",{className:"day-msg-select",value:t.selectedFlowId||"",onChange:e=>n({selectedFlowId:e.target.value})},a.createElement("option",{value:""},(0,s.t)("followUp.chooseFluxo")||"-- Choose a Fluxo --"),p.filter(e=>{const n=t.selectedCategoryId;return!n||"all"===n||("uncategorized"===n?!e.categoryId:e.categoryId===n)}).map(e=>a.createElement("option",{key:e.id,value:e.id},e.name," ",e.isActive?"✓":"(inactive)")))))),"fluxo"!==t.attachmentType&&a.createElement("div",{className:"day-msg-delay-row"},a.createElement("div",{className:"day-msg-form-group"},a.createElement("label",{className:"day-msg-label"},(0,s.t)("followUp.minDelay")||"Min Delay (sec)"),a.createElement("input",{type:"number",className:"day-msg-input",value:t.delay.min,min:0,onChange:e=>n({delay:{...t.delay,min:parseInt(e.target.value)||0}})})),a.createElement("div",{className:"day-msg-form-group"},a.createElement("label",{className:"day-msg-label"},(0,s.t)("followUp.maxDelay")||"Max Delay (sec)"),a.createElement("input",{type:"number",className:"day-msg-input",value:t.delay.max,min:0,onChange:e=>n({delay:{...t.delay,max:parseInt(e.target.value)||0}})})))))})))})()),a.createElement("div",{className:"schedule-wizard-footer"},a.createElement("div",null,o>1&&a.createElement("button",{className:"wizard-btn wizard-btn-secondary",onClick:()=>i(e=>e-1)},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M19 12H5M12 19l-7-7 7-7"})),(0,s.t)("followUp.scheduleWizard.back")||"Back")),a.createElement("div",null,o<3?a.createElement("button",{className:"wizard-btn wizard-btn-primary",onClick:()=>i(e=>e+1),disabled:!(()=>{if(1===o)return!!l.scheduleType;if(2===o)switch(l.scheduleType){case"weekly":return(l.weekdays?.length||0)>0;case"monthly":case"daily":return(l.calendarDates?.length||0)>0;case"yearly":return(l.yearlyDates?.length||0)>0;default:return!1}return!0})()},(0,s.t)("followUp.scheduleWizard.next")||"Avançar",a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M5 12h14M12 5l7 7-7 7"}))):a.createElement("button",{className:"wizard-btn wizard-btn-primary",onClick:()=>{f(!0),setTimeout(()=>f(!1),2e3)},style:b?{background:"#10b981"}:{}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"20 6 9 17 4 12"})),b?(0,s.t)("followUp.scheduleWizard.saved")||"Saved!":(0,s.t)("followUp.scheduleWizard.done")||"Done")))))},dp=({checked:e,onChange:t,label:n})=>a.createElement("label",{className:"followup-toggle-switch"},a.createElement("div",{className:"followup-toggle-track "+(e?"checked":"")},a.createElement("div",{className:"followup-toggle-thumb"})),a.createElement("input",{type:"checkbox",checked:e,onChange:e=>t(e.target.checked),style:{display:"none"}}),a.createElement("span",{className:"followup-toggle-label"},n)),mp=({postActions:e,onChange:t})=>{const[n,o]=(0,a.useState)([]),[i,l]=(0,a.useState)([]),[c,m]=(0,a.useState)([]),[p,u]=(0,a.useState)([]);(0,a.useEffect)(()=>{const e=d.TabsStorage.getTabs();l(e.map(e=>({id:e.id,title:e.title})));const t=e=>{const t=e;t.detail?.groups&&o(t.detail.groups.map(e=>({id:e.id,name:e.name})))};document.addEventListener("getAllGroupsResponse",t),document.dispatchEvent(new CustomEvent("getAllGroupsRequest"));return(async()=>{try{const e=await Promise.resolve().then(r.t.bind(r,6815,23)),t=(await e.default.storage.local.get("wa_kanban_crm_data_sync")).wa_kanban_crm_data_sync;if(t){const e=t.crms?.find(e=>"whatsapp_labels"===e.type);if(e&&t.stages?.[e.id]){const n=t.stages[e.id].filter(e=>e.whatsappLabelId).map(e=>({id:e.whatsappLabelId,name:e.name}));m(n)}const n=(t.crms||[]).filter(e=>"whatsapp_labels"!==e.type&&"custom_tabs"!==e.type).map(e=>({id:e.id,name:e.name,stages:(t.stages?.[e.id]||[]).map(e=>({id:e.id,name:e.name}))}));u(n)}}catch(e){}})(),()=>{document.removeEventListener("getAllGroupsResponse",t)}},[]);const g=n=>{t({...e,...n})};return a.createElement(a.Fragment,null,a.createElement("style",null,"\n  .followup-post-actions-container {\n    margin-top: 0;\n  }\n\n  .followup-post-actions-content {\n    padding: 16px;\n    background: var(--lion-bg-secondary);\n  }\n\n  .followup-action-toggle-section {\n    margin-bottom: 16px;\n    padding: 16px;\n    background: var(--lion-bg-primary);\n    border-radius: 14px;\n    border: 1px solid var(--lion-border-light);\n  }\n\n  .followup-action-toggle-section:last-child {\n    margin-bottom: 0;\n  }\n\n  .followup-sub-actions {\n    margin-top: 16px;\n    padding: 16px;\n    background: var(--lion-bg-secondary);\n    border-radius: 14px;\n    border: 1px solid var(--lion-border-light);\n  }\n\n  .followup-sub-action-row {\n    margin-bottom: 16px;\n  }\n\n  .followup-sub-action-row:last-child {\n    margin-bottom: 0;\n  }\n\n  .followup-sub-action-label {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    margin-bottom: 10px;\n    font-size: 13px;\n    font-weight: 700;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    color: var(--lion-text-secondary);\n    cursor: pointer;\n  }\n\n  .followup-sub-checkbox {\n    width: 18px;\n    height: 18px;\n    cursor: pointer;\n    accent-color: var(--lion-primary);\n  }\n\n  .followup-multi-select,\n  .followup-single-select {\n    width: 100%;\n    padding: 10px;\n    border: 1px solid var(--lion-border-medium);\n    border-radius: 10px;\n    font-size: 14px;\n    outline: none;\n    transition: border-color 0.2s, box-shadow 0.2s;\n    background: var(--lion-bg-secondary);\n    color: var(--lion-text-primary);\n  }\n\n  .followup-multi-select {\n    min-height: 100px;\n  }\n\n  .followup-multi-select:focus,\n  .followup-single-select:focus {\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  /* Toggle Switch Styles */\n  .followup-toggle-switch {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    cursor: pointer;\n    user-select: none;\n  }\n\n  .followup-toggle-track {\n    position: relative;\n    width: 44px;\n    height: 24px;\n    background: var(--lion-border-medium);\n    border-radius: 12px;\n    transition: background 0.3s ease, box-shadow 0.3s ease;\n  }\n\n  .followup-toggle-track.checked {\n    background: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.15);\n  }\n\n  .followup-toggle-thumb {\n    position: absolute;\n    top: 2px;\n    left: 2px;\n    width: 20px;\n    height: 20px;\n    background: white;\n    border-radius: 50%;\n    transition: left 0.3s ease, box-shadow 0.3s ease;\n    box-shadow: 0 1px 3px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.1);\n  }\n\n  .followup-toggle-track.checked .followup-toggle-thumb {\n    left: 22px;\n    box-shadow: 0 1px 3px rgba(var(--lion-primary-rgb), 0.3), 0 1px 2px rgba(0,0,0,0.1);\n  }\n\n  .followup-toggle-label {\n    font-size: 13px;\n    font-weight: 700;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    color: var(--lion-text-secondary);\n  }\n"),a.createElement("div",{className:"followup-post-actions-container"},a.createElement("div",{className:"followup-post-actions-content"},a.createElement("div",{className:"followup-action-toggle-section"},a.createElement(dp,{checked:e?.groupActionsEnabled||!1,onChange:e=>g({groupActionsEnabled:e}),label:(0,s.t)("followUp.groupActions")||"Group Actions"}),e?.groupActionsEnabled&&a.createElement("div",{className:"followup-sub-actions"},a.createElement("div",{className:"followup-sub-action-row"},a.createElement("label",{className:"followup-sub-action-label"},a.createElement("input",{type:"checkbox",checked:(e?.addToGroups?.length||0)>0,onChange:e=>{e.target.checked||g({addToGroups:[]})},className:"followup-sub-checkbox"}),(0,s.t)("followUp.addToGroups")||"Add to Groups"),a.createElement("select",{multiple:!0,value:e?.addToGroups||[],onChange:e=>{const t=Array.from(e.target.selectedOptions,e=>e.value);g({addToGroups:t})},className:"followup-multi-select"},0===n.length?a.createElement("option",{disabled:!0},(0,s.t)("followUp.noGroupsAvailable")||"No groups available"):n.map(e=>a.createElement("option",{key:e.id,value:e.id},e.name)))),a.createElement("div",{className:"followup-sub-action-row"},a.createElement("label",{className:"followup-sub-action-label"},a.createElement("input",{type:"checkbox",checked:(e?.removeFromGroups?.length||0)>0,onChange:e=>{e.target.checked||g({removeFromGroups:[]})},className:"followup-sub-checkbox"}),(0,s.t)("followUp.removeFromGroups")||"Remove from Groups"),a.createElement("select",{multiple:!0,value:e?.removeFromGroups||[],onChange:e=>{const t=Array.from(e.target.selectedOptions,e=>e.value);g({removeFromGroups:t})},className:"followup-multi-select"},0===n.length?a.createElement("option",{disabled:!0},(0,s.t)("followUp.noGroupsAvailable")||"No groups available"):n.map(e=>a.createElement("option",{key:e.id,value:e.id},e.name)))))),a.createElement("div",{className:"followup-action-toggle-section"},a.createElement(dp,{checked:e?.tabActionsEnabled||!1,onChange:e=>g({tabActionsEnabled:e}),label:(0,s.t)("followUp.customTabActions")||"Custom Tab Actions"}),e?.tabActionsEnabled&&a.createElement("div",{className:"followup-sub-actions"},a.createElement("div",{className:"followup-sub-action-row"},a.createElement("label",{className:"followup-sub-action-label"},a.createElement("input",{type:"checkbox",checked:(e?.addToTabs?.length||0)>0,onChange:e=>{e.target.checked||g({addToTabs:[]})},className:"followup-sub-checkbox"}),(0,s.t)("followUp.addToTabs")||"Add to Tabs"),a.createElement("select",{multiple:!0,value:e?.addToTabs||[],onChange:e=>{const t=Array.from(e.target.selectedOptions,e=>e.value);g({addToTabs:t})},className:"followup-multi-select"},0===i.length?a.createElement("option",{disabled:!0},(0,s.t)("followUp.noTabsAvailable")||"No tabs available"):i.map(e=>a.createElement("option",{key:e.id,value:e.id},e.title)))),a.createElement("div",{className:"followup-sub-action-row"},a.createElement("label",{className:"followup-sub-action-label"},a.createElement("input",{type:"checkbox",checked:(e?.removeFromTabs?.length||0)>0,onChange:e=>{e.target.checked||g({removeFromTabs:[]})},className:"followup-sub-checkbox"}),(0,s.t)("followUp.removeFromTabs")||"Remove from Tabs"),a.createElement("select",{multiple:!0,value:e?.removeFromTabs||[],onChange:e=>{const t=Array.from(e.target.selectedOptions,e=>e.value);g({removeFromTabs:t})},className:"followup-multi-select"},0===i.length?a.createElement("option",{disabled:!0},(0,s.t)("followUp.noTabsAvailable")||"No tabs available"):i.map(e=>a.createElement("option",{key:e.id,value:e.id},e.title)))))),a.createElement("div",{className:"followup-action-toggle-section"},a.createElement(dp,{checked:e?.labelsActionsEnabled||!1,onChange:e=>g({labelsActionsEnabled:e}),label:(0,s.t)("followUp.labelsActions")||"Labels Actions"}),e?.labelsActionsEnabled&&a.createElement("div",{className:"followup-sub-actions"},a.createElement("div",{className:"followup-sub-action-row"},a.createElement("label",{className:"followup-sub-action-label"},a.createElement("input",{type:"checkbox",checked:(e?.addLabels?.length||0)>0,onChange:e=>{e.target.checked||g({addLabels:[]})},className:"followup-sub-checkbox"}),(0,s.t)("followUp.addLabels")||"Add Labels"),a.createElement("select",{multiple:!0,value:e?.addLabels||[],onChange:e=>{const t=Array.from(e.target.selectedOptions,e=>e.value);g({addLabels:t})},className:"followup-multi-select"},0===c.length?a.createElement("option",{disabled:!0},(0,s.t)("followUp.noLabelsAvailable")||"No labels available"):c.map(e=>a.createElement("option",{key:e.id,value:e.id},e.name)))),a.createElement("div",{className:"followup-sub-action-row"},a.createElement("label",{className:"followup-sub-action-label"},a.createElement("input",{type:"checkbox",checked:(e?.removeLabels?.length||0)>0,onChange:e=>{e.target.checked||g({removeLabels:[]})},className:"followup-sub-checkbox"}),(0,s.t)("followUp.removeLabels")||"Remove Labels"),a.createElement("select",{multiple:!0,value:e?.removeLabels||[],onChange:e=>{const t=Array.from(e.target.selectedOptions,e=>e.value);g({removeLabels:t})},className:"followup-multi-select"},0===c.length?a.createElement("option",{disabled:!0},(0,s.t)("followUp.noLabelsAvailable")||"No labels available"):c.map(e=>a.createElement("option",{key:e.id,value:e.id},e.name)))))),a.createElement("div",{className:"followup-action-toggle-section"},a.createElement(dp,{checked:e?.kanbanActionsEnabled||!1,onChange:e=>g({kanbanActionsEnabled:e}),label:(0,s.t)("followUp.kanbanBoardActions")||"Kanban Board Actions"}),e?.kanbanActionsEnabled&&a.createElement("div",{className:"followup-sub-actions"},a.createElement("div",{className:"followup-sub-action-row"},a.createElement("label",{className:"followup-sub-action-label"},a.createElement("input",{type:"checkbox",checked:null!==e?.addToKanban,onChange:e=>{e.target.checked||g({addToKanban:null})},className:"followup-sub-checkbox"}),(0,s.t)("followUp.addToKanban")||"Add to Stage"),a.createElement("select",{value:e?.addToKanban?`${e.addToKanban.crmId}|${e.addToKanban.stageId}`:"",onChange:e=>{if(e.target.value){const[t,n]=e.target.value.split("|");g({addToKanban:{crmId:t,stageId:n}})}else g({addToKanban:null})},className:"followup-single-select"},a.createElement("option",{value:""},(0,s.t)("followUp.selectStage")||"Select Stage..."),0===p.length?a.createElement("option",{disabled:!0},(0,s.t)("followUp.noKanbanAvailable")||"No Kanban boards available"):p.map(e=>a.createElement("optgroup",{key:e.id,label:e.name},e.stages.map(t=>a.createElement("option",{key:t.id,value:`${e.id}|${t.id}`},t.name)))))),a.createElement("div",{className:"followup-sub-action-row"},a.createElement("label",{className:"followup-sub-action-label"},a.createElement("input",{type:"checkbox",checked:null!==e?.removeFromKanban,onChange:e=>{e.target.checked||g({removeFromKanban:null})},className:"followup-sub-checkbox"}),(0,s.t)("followUp.removeFromKanban")||"Remove from Stage"),a.createElement("select",{value:e?.removeFromKanban?`${e.removeFromKanban.crmId}|${e.removeFromKanban.stageId}`:"",onChange:e=>{if(e.target.value){const[t,n]=e.target.value.split("|");g({removeFromKanban:{crmId:t,stageId:n}})}else g({removeFromKanban:null})},className:"followup-single-select"},a.createElement("option",{value:""},(0,s.t)("followUp.selectStage")||"Select Stage..."),0===p.length?a.createElement("option",{disabled:!0},(0,s.t)("followUp.noKanbanAvailable")||"No Kanban boards available"):p.map(e=>a.createElement("optgroup",{key:e.id,label:e.name},e.stages.map(t=>a.createElement("option",{key:t.id,value:`${e.id}|${t.id}`},t.name)))))))))))},pp=({title:e,content:t,example:n})=>{const r=a.useRef(null),o=a.useRef(null),[i,s]=a.useState({}),[l,c]=a.useState("arrow-left");return a.createElement("span",{className:"followup-info-icon",ref:r,onClick:e=>e.stopPropagation(),onMouseEnter:()=>{if(!r.current)return;const e=r.current.getBoundingClientRect(),t=280,n=16,a=window.innerWidth-e.right,o=window.innerHeight-e.bottom,i=e.top;let l={},d="arrow-left";a>=296?(l={left:e.right+12,top:e.top+e.height/2,transform:"translateY(-50%)"},d="arrow-left"):o>=216?(l={left:Math.max(n,Math.min(e.left+e.width/2-140,window.innerWidth-t-n)),top:e.bottom+12},d="arrow-up"):i>=216?(l={left:Math.max(n,Math.min(e.left+e.width/2-140,window.innerWidth-t-n)),bottom:window.innerHeight-e.top+12,top:"auto"},d="arrow-down"):(l={right:n,top:Math.max(n,e.top-100)},d="arrow-left"),s(l),c(d)}},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("path",{d:"M12 16v-4M12 8h.01"})),a.createElement("div",{className:"followup-info-tooltip",ref:o,style:i},a.createElement("div",{className:"followup-info-tooltip-title"},e),a.createElement("div",{className:"followup-info-tooltip-content"},t),n&&a.createElement("div",{className:"followup-info-tooltip-example"},a.createElement("div",{className:"followup-info-tooltip-example-title"},n.title),a.createElement("div",null,n.text)),a.createElement("div",{className:`followup-info-tooltip-arrow ${l}`})))},up=({followUp:e,isNew:t,onSave:n,onCancel:r,categories:o=[]})=>{if(!e)return a.createElement("div",{style:{padding:"20px",color:"red"}},"Error: No follow-up data provided");const[i,l]=(0,a.useState)(e),[c,d]=(0,a.useState)(1),[m,p]=(0,a.useState)("idle"),u=[{num:1,label:(0,s.t)("followUp.wizardStep1")||"Setup"},{num:2,label:(0,s.t)("followUp.wizardStep2")||"Messages"},{num:3,label:(0,s.t)("followUp.wizardStep3")||"Schedule"},{num:4,label:(0,s.t)("followUp.wizardStep4")||"Actions"},{num:5,label:(0,s.t)("followUp.wizardStep5")||"Rules"}];(0,a.useEffect)(()=>{if(t&&0===e.actions.length){const t={id:Am(),type:"template",templateConfig:{messages:[{id:Dm(),message:"",attachmentType:"none",attachments:[],delay:{min:3,max:5}}]}};l({...e,actions:[t]})}else l(e)},[e,t]);const g=e=>{l(t=>({...t,...e}))},h=e=>{l(t=>({...t,funnelSettings:{...t.funnelSettings,...e}}))},b=e=>{l(t=>({...t,trigger:{...t.trigger,...e}}))},f=e=>{l(t=>({...t,rules:{...t.rules,...e}}))},v=[{value:"labels",label:(0,s.t)("followUp.labels")||"Labels"},{value:"tabs",label:(0,s.t)("followUp.customTabs")||"Custom Tabs"},{value:"groups",label:(0,s.t)("followUp.groups")||"Groups"},{value:"kanban",label:(0,s.t)("followUp.kanban")||"Kanban"}],y=[{value:"on_enter",label:(0,s.t)("followUp.onEnter")||"On Enter",desc:(0,s.t)("followUp.onEnterDesc")||"Trigger when contact enters the funnel"},{value:"on_leave",label:(0,s.t)("followUp.onLeave")||"On Leave",desc:(0,s.t)("followUp.onLeaveDesc")||"Trigger when contact leaves the funnel"},{value:"after_time",label:(0,s.t)("followUp.afterTime")||"After Time",desc:(0,s.t)("followUp.afterTimeDesc")||"Trigger after a specific time period"}];return a.createElement(a.Fragment,null,a.createElement("style",null,'\n  /* === V3 EDITOR LAYOUT === */\n  .followup-editor {\n    display: flex;\n    flex-direction: column;\n    height: 100%;\n    overflow: hidden;\n  }\n\n  .followup-editor-scroll {\n    flex: 1;\n    overflow-y: auto;\n    padding: 24px 28px;\n    background: var(--lion-bg-secondary);\n  }\n\n  .followup-editor-scroll::-webkit-scrollbar {\n    width: 8px;\n  }\n  .followup-editor-scroll::-webkit-scrollbar-track {\n    background: transparent;\n  }\n  .followup-editor-scroll::-webkit-scrollbar-thumb {\n    background: var(--lion-border-medium, #d1d5db);\n    border-radius: 4px;\n  }\n\n  /* === V3 FOOTER === */\n  .followup-editor-footer {\n    padding: 18px 28px;\n    background: var(--lion-bg-primary);\n    border-top: 1px solid var(--lion-border-light);\n    display: flex;\n    justify-content: flex-end;\n    gap: 12px;\n    flex-shrink: 0;\n  }\n\n  /* === V3 SECTION CARDS === */\n  .followup-section {\n    background: var(--lion-bg-primary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 14px;\n    margin-bottom: 16px;\n    overflow: visible;\n  }\n\n  .followup-section-header {\n    padding: 16px 20px;\n    background: var(--lion-bg-primary);\n    border-bottom: 1px solid var(--lion-border-light);\n    border-radius: 14px 14px 0 0;\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    cursor: pointer;\n    user-select: none;\n    transition: background 0.15s ease;\n  }\n\n  .followup-section-header:hover {\n    background: var(--lion-bg-secondary);\n  }\n\n  .followup-section-title {\n    font-size: 13px;\n    font-weight: 700;\n    color: var(--lion-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n  }\n\n  .followup-section-title svg {\n    width: 18px;\n    height: 18px;\n    color: var(--lion-primary);\n  }\n\n  .followup-section-chevron {\n    width: 16px;\n    height: 16px;\n    color: var(--lion-text-muted);\n    transition: transform 0.2s ease;\n  }\n\n  .followup-section-chevron.expanded {\n    transform: rotate(180deg);\n  }\n\n  .followup-section-content {\n    padding: 20px;\n  }\n\n  .followup-section-content.collapsed {\n    display: none;\n  }\n\n  /* === V3 FORM FIELDS === */\n  .followup-form-group {\n    margin-bottom: 16px;\n  }\n\n  .followup-form-group:last-child {\n    margin-bottom: 0;\n  }\n\n  .followup-form-label {\n    display: block;\n    font-size: 12px;\n    font-weight: 700;\n    color: var(--lion-text-secondary);\n    margin-bottom: 8px;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n  }\n\n  .followup-form-input,\n  .followup-form-select {\n    width: 100%;\n    padding: 10px 14px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 13px;\n    font-family: inherit;\n    color: var(--lion-text-primary) !important;\n    background: var(--lion-bg-secondary) !important;\n    transition: all 0.15s ease;\n  }\n\n  .followup-form-input:hover,\n  .followup-form-select:hover {\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .followup-form-input:focus,\n  .followup-form-select:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n    background: var(--lion-bg-primary) !important;\n  }\n\n  .followup-form-input::placeholder {\n    color: var(--lion-text-muted);\n  }\n\n  /* === V3 RADIO OPTIONS === */\n  .followup-radio-group {\n    display: flex;\n    flex-direction: column;\n    gap: 8px;\n  }\n\n  .followup-radio-option {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    padding: 12px 14px;\n    background: var(--lion-bg-secondary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    cursor: pointer;\n    transition: all 0.15s ease;\n  }\n\n  .followup-radio-option:hover {\n    border-color: var(--lion-primary);\n  }\n\n  .followup-radio-option.selected {\n    border-color: var(--lion-primary);\n    background: rgba(var(--lion-primary-rgb), 0.04);\n  }\n\n  .followup-radio-option input[type="radio"] {\n    width: 16px;\n    height: 16px;\n    accent-color: var(--lion-primary);\n  }\n\n  .followup-radio-label {\n    flex: 1;\n  }\n\n  .followup-radio-title {\n    font-size: 13px;\n    font-weight: 600;\n    color: var(--lion-text-primary);\n  }\n\n  .followup-radio-desc {\n    font-size: 11px;\n    color: var(--lion-text-muted);\n    margin-top: 2px;\n  }\n\n  /* === V3 TABS === */\n  .followup-tabs {\n    display: flex;\n    gap: 4px;\n    margin-bottom: 14px;\n    border-bottom: 1px solid var(--lion-border-light);\n    padding-bottom: 8px;\n  }\n\n  .followup-tab {\n    padding: 8px 16px;\n    font-size: 12px;\n    font-weight: 600;\n    color: var(--lion-text-muted);\n    background: transparent;\n    border: none;\n    border-radius: 8px;\n    cursor: pointer;\n    transition: all 0.15s ease;\n    text-transform: uppercase;\n    letter-spacing: 0.3px;\n  }\n\n  .followup-tab:hover {\n    color: var(--lion-text-primary);\n    background: var(--lion-bg-secondary);\n  }\n\n  .followup-tab.active {\n    color: #ffffff;\n    background: var(--lion-primary);\n    box-shadow: 0 2px 6px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  /* === V3 CHECKBOXES === */\n  .followup-checkbox-group {\n    display: flex;\n    flex-direction: column;\n    gap: 10px;\n  }\n\n  .followup-checkbox-option {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    cursor: pointer;\n    padding: 8px 0;\n  }\n\n  .followup-checkbox-option input[type="checkbox"] {\n    width: 16px;\n    height: 16px;\n    accent-color: var(--lion-primary);\n    cursor: pointer;\n  }\n\n  .followup-checkbox-label {\n    font-size: 13px;\n    color: var(--lion-text-primary);\n    font-weight: 500;\n  }\n\n  .followup-time-config {\n    display: grid;\n    grid-template-columns: 1fr 1fr;\n    gap: 12px;\n    margin-top: 12px;\n  }\n\n  /* === V3 PRIMARY BUTTON (Gradient) === */\n  .followup-btn-primary {\n    padding: 10px 24px;\n    background: var(--lion-primary);\n    color: #ffffff;\n    border: none;\n    border-radius: 10px;\n    font-size: 13px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.15s ease;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    gap: 8px;\n    min-width: 140px;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .followup-btn-primary:hover:not(:disabled) {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35);\n  }\n\n  .followup-btn-primary:disabled {\n    opacity: 0.5;\n    cursor: not-allowed;\n    transform: none;\n    box-shadow: none;\n  }\n\n  .followup-btn-primary.saving {\n    background: var(--lion-primary);\n  }\n\n  .followup-btn-primary.success {\n    background: var(--lion-success);\n  }\n\n  @keyframes spin {\n    from { transform: rotate(0deg); }\n    to { transform: rotate(360deg); }\n  }\n\n  .followup-btn-spinner {\n    width: 16px;\n    height: 16px;\n    border: 2px solid rgba(255, 255, 255, 0.3);\n    border-top-color: #ffffff;\n    border-radius: 50%;\n    animation: spin 0.8s linear infinite;\n  }\n\n  @keyframes checkmark-pop {\n    0% { transform: scale(0); opacity: 0; }\n    50% { transform: scale(1.2); }\n    100% { transform: scale(1); opacity: 1; }\n  }\n\n  .followup-btn-checkmark {\n    animation: checkmark-pop 0.3s ease-out forwards;\n  }\n\n  /* === V3 SECONDARY BUTTON === */\n  .followup-btn-secondary {\n    padding: 10px 24px;\n    background: var(--lion-bg-tertiary, #f4f4f5);\n    color: var(--lion-text-muted);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 13px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.15s ease;\n  }\n\n  .followup-btn-secondary:hover {\n    background: var(--lion-border-light);\n    color: var(--lion-text-secondary);\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  /* === V3 ADD STEP BUTTON === */\n  .followup-add-step-btn {\n    width: 100%;\n    padding: 12px;\n    background: transparent;\n    border: 1px dashed var(--lion-border-light);\n    border-radius: 10px;\n    color: var(--lion-text-muted);\n    font-size: 13px;\n    font-weight: 500;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    gap: 8px;\n    transition: all 0.15s ease;\n    margin-top: 12px;\n  }\n\n  .followup-add-step-btn:hover {\n    border-color: var(--lion-primary);\n    color: var(--lion-primary);\n    background: rgba(var(--lion-primary-rgb), 0.04);\n  }\n\n  .followup-add-step-btn svg {\n    width: 18px;\n    height: 18px;\n  }\n\n  .followup-signature-input {\n    margin-top: 8px;\n  }\n\n  .followup-select-placeholder {\n    padding: 24px;\n    text-align: center;\n    color: var(--lion-text-muted);\n    font-size: 13px;\n    background: var(--lion-bg-secondary);\n    border-radius: 10px;\n    border: 1px dashed var(--lion-border-light);\n  }\n\n  /* === V3 INFO TOOLTIP === */\n  .followup-info-icon {\n    position: relative;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    width: 18px;\n    height: 18px;\n    margin-left: 6px;\n    cursor: help;\n  }\n\n  .followup-info-icon svg {\n    width: 16px;\n    height: 16px;\n    color: var(--lion-text-muted);\n    transition: color 0.15s ease;\n  }\n\n  .followup-info-icon:hover svg {\n    color: var(--lion-primary);\n  }\n\n  .followup-info-tooltip {\n    position: fixed;\n    width: 280px;\n    padding: 14px 16px;\n    background: var(--lion-sidebar-start);\n    color: #ffffff;\n    font-size: 12px;\n    line-height: 1.5;\n    border-radius: 12px;\n    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);\n    z-index: 99999;\n    opacity: 0;\n    visibility: hidden;\n    transition: opacity 0.2s ease, visibility 0.2s ease;\n    pointer-events: none;\n    white-space: normal;\n    word-wrap: break-word;\n  }\n\n  .followup-info-icon:hover .followup-info-tooltip {\n    opacity: 1;\n    visibility: visible;\n  }\n\n  .followup-info-tooltip-arrow {\n    position: absolute;\n    border: 8px solid transparent;\n  }\n\n  .followup-info-tooltip-arrow.arrow-left {\n    left: -16px;\n    top: 50%;\n    transform: translateY(-50%);\n    border-right-color: var(--lion-sidebar-start);\n  }\n\n  .followup-info-tooltip-arrow.arrow-down {\n    bottom: -16px;\n    left: 50%;\n    transform: translateX(-50%);\n    border-top-color: var(--lion-sidebar-start);\n  }\n\n  .followup-info-tooltip-arrow.arrow-up {\n    top: -16px;\n    left: 50%;\n    transform: translateX(-50%);\n    border-bottom-color: var(--lion-sidebar-start);\n  }\n\n  .followup-info-tooltip-title {\n    font-weight: 600;\n    font-size: 13px;\n    margin-bottom: 8px;\n    color: var(--lion-primary);\n  }\n\n  .followup-info-tooltip-content {\n    color: rgba(255, 255, 255, 0.85);\n  }\n\n  .followup-info-tooltip-example {\n    margin-top: 10px;\n    padding: 10px;\n    background: rgba(255, 255, 255, 0.08);\n    border-radius: 8px;\n    font-size: 11px;\n  }\n\n  .followup-info-tooltip-example-title {\n    font-weight: 600;\n    color: var(--lion-warning);\n    margin-bottom: 4px;\n  }\n\n  /* === V3 WIZARD STEP INDICATOR === */\n  .followup-wizard-steps {\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    padding: 20px 28px;\n    border-bottom: 1px solid var(--lion-border-light);\n    background: var(--lion-bg-primary);\n    flex-shrink: 0;\n    gap: 0;\n  }\n\n  .followup-step {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    gap: 6px;\n    cursor: pointer;\n    flex-shrink: 0;\n  }\n\n  .followup-step-circle {\n    width: 32px;\n    height: 32px;\n    border-radius: 50%;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    font-size: 13px;\n    font-weight: 700;\n    background: var(--lion-bg-tertiary, #f4f4f5);\n    color: var(--lion-text-muted);\n    border: 2px solid var(--lion-border-light);\n    transition: all 0.15s ease;\n  }\n\n  .followup-step.active .followup-step-circle {\n    background: var(--lion-primary);\n    color: #ffffff;\n    border-color: transparent;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.3);\n  }\n\n  .followup-step.completed .followup-step-circle {\n    background: var(--lion-primary);\n    color: #ffffff;\n    border-color: transparent;\n  }\n\n  .followup-step-label {\n    font-size: 11px;\n    font-weight: 600;\n    color: var(--lion-text-muted);\n    text-transform: uppercase;\n    letter-spacing: 0.3px;\n    white-space: nowrap;\n  }\n\n  .followup-step.active .followup-step-label {\n    color: var(--lion-primary);\n  }\n\n  .followup-step.completed .followup-step-label {\n    color: var(--lion-text-secondary);\n  }\n\n  .followup-step-line {\n    width: 40px;\n    height: 2px;\n    background: var(--lion-border-light);\n    margin: 0 4px;\n    margin-bottom: 20px;\n    flex-shrink: 0;\n  }\n\n  .followup-step-line.active {\n    background: var(--lion-primary);\n  }\n'),a.createElement("div",{className:"followup-editor"},a.createElement("div",{className:"followup-wizard-steps"},u.map((e,t)=>a.createElement(a.Fragment,{key:e.num},t>0&&a.createElement("div",{className:"followup-step-line "+(e.num<=c?"active":"")}),a.createElement("div",{className:`followup-step ${e.num===c?"active":""} ${e.num<c?"completed":""}`,onClick:()=>d(e.num)},a.createElement("div",{className:"followup-step-circle"},e.num<c?a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3"},a.createElement("polyline",{points:"20 6 9 17 4 12"})):e.num),a.createElement("span",{className:"followup-step-label"},e.label))))),a.createElement("div",{className:"followup-editor-scroll"},1===c&&a.createElement(a.Fragment,null,a.createElement("div",{className:"followup-section"},a.createElement("div",{className:"followup-section-content"},a.createElement("div",{className:"followup-form-group"},a.createElement("label",{className:"followup-form-label",style:{display:"flex",alignItems:"center"}},(0,s.t)("followUp.name")||"Follow-up Name",a.createElement(pp,{title:(0,s.t)("followUp.tooltip.nameTitle")||"Follow-up Name",content:(0,s.t)("followUp.tooltip.nameContent")||"Give a descriptive name to identify this follow-up sequence."})),a.createElement("input",{type:"text",className:"followup-form-input",value:i.name,onChange:e=>g({name:e.target.value}),placeholder:(0,s.t)("followUp.namePlaceholder")||"Enter follow-up name..."})),o.length>0&&a.createElement("div",{className:"followup-form-group"},a.createElement("label",{className:"followup-form-label",style:{display:"flex",alignItems:"center"}},(0,s.t)("crm.category")||"Category"),a.createElement("select",{className:"followup-form-input",value:i.categoryId||"",onChange:e=>g({categoryId:e.target.value||void 0})},a.createElement("option",{value:""},(0,s.t)("crm.uncategorized")||"Uncategorized"),o.map(e=>a.createElement("option",{key:e.id,value:e.id},e.icon," ",e.name)))))),a.createElement("div",{className:"followup-section"},a.createElement("div",{className:"followup-section-header",style:{cursor:"default"}},a.createElement("div",{className:"followup-section-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M22 3H2l8 9.46V19l4 2v-8.54L22 3z"})),(0,s.t)("followUp.funnelSettings")||"Funnel Settings")),a.createElement("div",{className:"followup-section-content"},a.createElement("div",{className:"followup-tabs"},v.map(e=>a.createElement("button",{key:e.value,className:"followup-tab "+(i.funnelSettings.type===e.value?"active":""),onClick:()=>h({type:e.value,selectedIds:[]})},e.label))),a.createElement(op,{type:i.funnelSettings.type,selectedIds:i.funnelSettings.selectedIds,onChange:e=>h({selectedIds:e}),crmId:i.funnelSettings.crmId,onCrmChange:e=>h({crmId:e,selectedIds:[]})}))),a.createElement("div",{className:"followup-section"},a.createElement("div",{className:"followup-section-header",style:{cursor:"default"}},a.createElement("div",{className:"followup-section-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})),(0,s.t)("followUp.triggerSettings")||"Follow-up Trigger")),a.createElement("div",{className:"followup-section-content"},a.createElement("div",{className:"followup-radio-group"},y.map(e=>a.createElement("label",{key:e.value,className:"followup-radio-option "+(i.trigger.type===e.value?"selected":"")},a.createElement("input",{type:"radio",name:"trigger",checked:i.trigger.type===e.value,onChange:()=>b({type:e.value})}),a.createElement("div",{className:"followup-radio-label"},a.createElement("div",{className:"followup-radio-title"},e.label),a.createElement("div",{className:"followup-radio-desc"},e.desc))))),"after_time"===i.trigger.type&&a.createElement("div",{style:{marginTop:"16px"}},a.createElement("div",{className:"followup-time-config"},a.createElement("div",{className:"followup-form-group",style:{flex:1}},a.createElement("label",{className:"followup-form-label"},(0,s.t)("followUp.value")||"Value"),a.createElement("input",{type:"number",className:"followup-form-input",value:i.trigger.timeConfig?.relativeDays||1,min:1,onChange:e=>b({timeConfig:{...i.trigger.timeConfig,mode:"relative",relativeDays:parseInt(e.target.value)||1}})})),a.createElement("div",{className:"followup-form-group",style:{flex:1}},a.createElement("label",{className:"followup-form-label"},(0,s.t)("followUp.unit")||"Unit"),a.createElement("select",{className:"followup-form-select",value:i.trigger.timeConfig?.relativeUnit||"days",onChange:e=>b({timeConfig:{...i.trigger.timeConfig,mode:"relative",relativeUnit:e.target.value}})},a.createElement("option",{value:"minutes"},(0,s.t)("followUp.minutes")||"Minutes"),a.createElement("option",{value:"hours"},(0,s.t)("followUp.hours")||"Hours"),a.createElement("option",{value:"days"},(0,s.t)("followUp.days")||"Days"))),"days"===(i.trigger.timeConfig?.relativeUnit||"days")&&a.createElement("div",{className:"followup-form-group",style:{flex:1}},a.createElement("label",{className:"followup-form-label"},(0,s.t)("followUp.time")||"Time"),a.createElement("input",{type:"time",className:"followup-form-input",value:i.trigger.timeConfig?.relativeTime||"12:00",onChange:e=>b({timeConfig:{...i.trigger.timeConfig,mode:"relative",relativeTime:e.target.value}})}))))))),2===c&&a.createElement("div",{className:"followup-section"},a.createElement("div",{className:"followup-section-header",style:{cursor:"default"}},a.createElement("div",{className:"followup-section-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})),(0,s.t)("followUp.messagesTitle")||"Messages"," (",i.actions.length,")")),a.createElement("div",{className:"followup-section-content"},"specific"===i.trigger.timeConfig?.mode&&"different"===i.trigger.timeConfig?.messageModePerDay?a.createElement("div",{style:{padding:"24px",background:"var(--lion-primary-light)",borderRadius:"10px",textAlign:"center",border:"1px dashed var(--lion-primary)"}},a.createElement("div",{style:{fontSize:"14px",fontWeight:600,color:"var(--lion-text-primary)",marginBottom:"8px"}},(0,s.t)("followUp.messagesConfiguredInSchedule")||"Messages Configured in Schedule"),a.createElement("div",{style:{fontSize:"13px",color:"var(--lion-text-muted)"}},(0,s.t)("followUp.messagesConfiguredInScheduleDesc")||"Messages are configured in the Schedule step for each selected day.")):a.createElement(a.Fragment,null,(i.actions||[]).filter(e=>e&&e.id&&e.type).map((e,t)=>a.createElement(rp,{key:e.id,action:e,index:t,onUpdate:e=>((e,t)=>{l(n=>({...n,actions:n.actions.map((n,a)=>a===e?{...n,...t}:n)}))})(t,e),onRemove:()=>(e=>{l(t=>({...t,actions:t.actions.filter((t,n)=>n!==e)}))})(t)})),a.createElement("button",{className:"followup-add-step-btn",onClick:()=>(()=>{const e={id:Am(),type:"template",templateConfig:{messages:[{id:Dm(),message:"",attachmentType:"none",attachments:[],delay:{min:3,max:5}}]}};l(t=>({...t,actions:[...t.actions,e]}))})()},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M12 5v14M5 12h14"})),(0,s.t)("followUp.addMessage")||"+ Add Message")))),3===c&&a.createElement(a.Fragment,null,a.createElement("div",{className:"followup-section"},a.createElement("div",{className:"followup-section-content"},a.createElement("label",{className:"followup-checkbox-option",style:{padding:"12px",background:"var(--lion-bg-secondary)",borderRadius:"10px"}},a.createElement("input",{type:"checkbox",checked:"specific"===i.trigger.timeConfig?.mode,onChange:e=>{e.target.checked?b({timeConfig:{...i.trigger.timeConfig,mode:"specific",scheduleType:i.trigger.timeConfig?.scheduleType||"weekly"}}):b({timeConfig:{...i.trigger.timeConfig,mode:"relative"}})}}),a.createElement("span",{style:{fontWeight:600}},(0,s.t)("followUp.enableSchedule")||"Enable Advanced Schedule"),a.createElement("span",{style:{marginLeft:"8px",fontSize:"12px",color:"var(--lion-text-muted)"}},(0,s.t)("followUp.enableScheduleDesc")||"(Send only on specific days/dates)")))),"specific"===i.trigger.timeConfig?.mode&&a.createElement(cp,{timeConfig:i.trigger.timeConfig,onChange:e=>b({timeConfig:e}),defaultActions:i.actions,onActionsChange:e=>l(t=>({...t,actions:e}))}),"specific"!==i.trigger.timeConfig?.mode&&a.createElement("div",{style:{padding:"24px",background:"var(--lion-bg-primary)",borderRadius:"14px",textAlign:"center",color:"var(--lion-text-muted)",fontSize:"13px",border:"1px solid var(--lion-border-light)"}},(0,s.t)("followUp.scheduleDisabledInfo")||"Enable Advanced Schedule above to configure specific days/dates for sending messages.")),4===c&&a.createElement("div",{className:"followup-section"},a.createElement("div",{className:"followup-section-header",style:{cursor:"default"}},a.createElement("div",{className:"followup-section-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})),(0,s.t)("followUp.postActionsTitle")||"Post Actions")),a.createElement("div",{className:"followup-section-content",style:{padding:0}},a.createElement(mp,{postActions:i.postActions||Sm,onChange:e=>g({postActions:e})}))),5===c&&a.createElement("div",{className:"followup-section"},a.createElement("div",{className:"followup-section-header",style:{cursor:"default"}},a.createElement("div",{className:"followup-section-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"3"}),a.createElement("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-2 2 2 2 0 01-2-2v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83 0 2 2 0 010-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 01-2-2 2 2 0 012-2h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 010-2.83 2 2 0 012.83 0l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 012-2 2 2 0 012 2v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 0 2 2 0 010 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 012 2 2 2 0 01-2 2h-.09a1.65 1.65 0 00-1.51 1z"})),(0,s.t)("followUp.rulesTitle")||"Trigger Rules")),a.createElement("div",{className:"followup-section-content"},a.createElement("div",{className:"followup-checkbox-group"},a.createElement("label",{className:"followup-checkbox-option"},a.createElement("input",{type:"checkbox",checked:i.rules.cancelOnReply,onChange:e=>f({cancelOnReply:e.target.checked})}),a.createElement("span",{className:"followup-checkbox-label"},(0,s.t)("followUp.cancelOnReply")||"Cancel if client responds")),a.createElement("label",{className:"followup-checkbox-option"},a.createElement("input",{type:"checkbox",checked:i.rules.allowGroups,onChange:e=>f({allowGroups:e.target.checked})}),a.createElement("span",{className:"followup-checkbox-label"},(0,s.t)("followUp.allowGroups")||"Allow replying in groups")),a.createElement("label",{className:"followup-checkbox-option"},a.createElement("input",{type:"checkbox",checked:i.rules.customSignature,onChange:e=>f({customSignature:e.target.checked})}),a.createElement("span",{className:"followup-checkbox-label"},(0,s.t)("followUp.customSignature")||"Customize signature"))),i.rules.customSignature&&a.createElement("div",{className:"followup-form-group followup-signature-input"},a.createElement("label",{className:"followup-form-label"},(0,s.t)("followUp.signatureText")||"Signature Text"),a.createElement("input",{type:"text",className:"followup-form-input",value:i.rules.signatureText||"",onChange:e=>f({signatureText:e.target.value}),placeholder:(0,s.t)("followUp.signaturePlaceholder")||"Enter your signature..."})),a.createElement("div",{className:"followup-form-group",style:{marginTop:"16px"}},a.createElement("label",{className:"followup-form-label"},(0,s.t)("followUp.maxExecutions")||"Max times per contact"),a.createElement("input",{type:"number",className:"followup-form-input",min:"0",value:i.rules.maxExecutions??0,onChange:e=>f({maxExecutions:parseInt(e.target.value)||0}),style:{width:"120px"}}),a.createElement("span",{style:{fontSize:"11px",color:"var(--lion-text-muted)",marginTop:"4px",display:"block"}},"0 = Unlimited, 1 = Once only, 2+ = Multiple times")),a.createElement("div",{className:"followup-form-group",style:{marginTop:"12px"}},a.createElement("label",{className:"followup-form-label"},(0,s.t)("followUp.cooldownDays")||"Cooldown (days)"),a.createElement("input",{type:"number",className:"followup-form-input",min:"0",value:i.rules.cooldownDays??0,onChange:e=>f({cooldownDays:parseInt(e.target.value)||0}),style:{width:"120px"}}),a.createElement("span",{style:{fontSize:"11px",color:"var(--lion-text-muted)",marginTop:"4px",display:"block"}},"0 = No cooldown"))))),a.createElement("div",{className:"followup-editor-footer"},1===c?a.createElement("button",{className:"followup-btn-secondary",onClick:r},(0,s.t)("followUp.backToList")||"← Back to List"):a.createElement("button",{className:"followup-btn-secondary",onClick:()=>d(e=>Math.max(e-1,1))},(0,s.t)("followUp.back")||"← Back"),a.createElement("div",{style:{flex:1}}),c<5?a.createElement("button",{className:"followup-btn-primary",onClick:()=>d(e=>Math.min(e+1,5))},(0,s.t)("followUp.next")||"Next →"):a.createElement("button",{className:`followup-btn-primary ${"saving"===m?"saving":""} ${"success"===m?"success":""}`,onClick:async()=>{if("saving"===m)return;if(!i.name.trim())return void alert((0,s.t)("followUp.nameRequired")||"Please enter a name for the follow-up");if(0===i.funnelSettings.selectedIds.length){const e="labels"===i.funnelSettings.type?"Label":"tabs"===i.funnelSettings.type?"Custom Tab":"groups"===i.funnelSettings.type?"Group":"Kanban Stage";return alert((0,s.t)("followUp.funnelRequiredDetailed")||`Please select at least one ${e} in the Funnel Settings section. This determines which contacts will receive this follow-up.`),void d(1)}const e="specific"===i.trigger.timeConfig?.mode&&"different"===i.trigger.timeConfig?.messageModePerDay&&Object.keys(i.trigger.timeConfig?.dayMessages||{}).length>0;if(0!==i.actions.length||e){p("saving");try{await new Promise(e=>setTimeout(e,500)),n(i),p("success"),setTimeout(()=>{r()},600)}catch(e){p("idle")}}else alert((0,s.t)("followUp.actionsRequired")||"Please add at least one action")},disabled:"idle"!==m},"saving"===m?a.createElement(a.Fragment,null,a.createElement("span",{className:"followup-btn-spinner"}),(0,s.t)("followUp.saving")||"Saving..."):"success"===m?a.createElement(a.Fragment,null,a.createElement("svg",{className:"followup-btn-checkmark",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3"},a.createElement("polyline",{points:"20 6 9 17 4 12"})),(0,s.t)("followUp.saved")||"Saved!"):t?(0,s.t)("followUp.create")||"Create Follow-up":(0,s.t)("followUp.save")||"Save Changes"))))},gp={sidebar:{width:"100%",height:"100%",background:"var(--lion-bg-primary)",display:"flex",flexDirection:"column",overflow:"hidden"},section:{padding:"12px"},categoriesSection:{flex:1,overflowY:"auto",padding:"8px 12px"},divider:{height:"1px",background:"var(--lion-border-light)",margin:"0 16px"},item:{display:"flex",alignItems:"center",gap:"10px",padding:"12px 14px",borderRadius:"10px",cursor:"pointer",color:"var(--lion-text-secondary)",transition:"all 0.2s ease",position:"relative",marginBottom:"4px"},itemHover:{background:"var(--lion-bg-secondary)",color:"var(--lion-text-primary)"},itemActive:{background:"var(--lion-primary)",color:"#ffffff"},itemDropTarget:{background:"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.2)",border:"2px dashed var(--lion-primary)"},icon:{fontSize:"18px",width:"24px",textAlign:"center"},name:{flex:1,fontSize:"14px",fontWeight:500,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},count:{fontSize:"12px",background:"var(--lion-bg-tertiary, rgba(0,0,0,0.06))",padding:"2px 8px",borderRadius:"10px",minWidth:"24px",textAlign:"center",color:"var(--lion-text-muted)"},countActive:{background:"rgba(255, 255, 255, 0.25)",color:"#ffffff"},colorDot:{width:"8px",height:"8px",borderRadius:"50%",flexShrink:0},actions:{display:"flex",gap:"4px",position:"absolute",right:"8px"},actionBtn:{background:"transparent",border:"none",cursor:"pointer",padding:"2px",fontSize:"12px",opacity:.7,transition:"opacity 0.2s"},footer:{padding:"12px",borderTop:"1px solid var(--lion-border-light)",marginTop:"auto"},addBtn:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",width:"100%",padding:"10px 12px",background:"var(--lion-primary)",color:"#ffffff",border:"none",borderRadius:"10px",fontSize:"13px",fontWeight:600,cursor:"pointer",transition:"all 0.15s ease"}},hp=({id:e,isActive:t,children:n,onClick:r})=>{const{setNodeRef:o,isOver:i}=Qt({id:`followup-category-drop-${e}`,data:{type:"followup-category",categoryId:"uncategorized"===e?null:e}}),[s,l]=a.useState(!1),c={...gp.item,...s&&!t?gp.itemHover:{},...t?gp.itemActive:{},...i?gp.itemDropTarget:{}};return a.createElement("div",{ref:o,style:c,onClick:r,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1)},n)},bp=({isActive:e,children:t,onClick:n})=>{const[r,o]=a.useState(!1),i={...gp.item,...r&&!e?gp.itemHover:{},...e?gp.itemActive:{}};return a.createElement("div",{style:i,onClick:n,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1)},t)},fp=({categories:e,selectedCategoryId:t,followUpCounts:n,totalFollowUps:r,uncategorizedCount:o,onSelectCategory:i,onAddCategory:l,onEditCategory:c,onDeleteCategory:d})=>{const[m,p]=a.useState(null);return a.createElement("div",{style:gp.sidebar},a.createElement("div",{style:gp.section},a.createElement(bp,{isActive:"all"===t,onClick:()=>i("all")},a.createElement("span",{style:gp.icon},"📋"),a.createElement("span",{style:gp.name},(0,s.t)("crm.allFollowUps")||"All Follow-Ups"),a.createElement("span",{style:{...gp.count,..."all"===t?gp.countActive:{}}},r))),e.length>0&&a.createElement("div",{style:gp.divider}),a.createElement("div",{style:gp.categoriesSection},e.map(e=>a.createElement("div",{key:e.id,onMouseEnter:()=>p(e.id),onMouseLeave:()=>p(null),style:{position:"relative"}},a.createElement(hp,{id:e.id,isActive:t===e.id,onClick:()=>i(e.id)},a.createElement("span",{style:gp.icon},e.icon),a.createElement("span",{style:gp.name},e.name),m!==e.id&&a.createElement(a.Fragment,null,a.createElement("span",{style:{...gp.count,...t===e.id?gp.countActive:{}}},n[e.id]||0),a.createElement("span",{style:{...gp.colorDot,background:e.color}})),m===e.id&&a.createElement("div",{style:gp.actions},a.createElement("button",{style:gp.actionBtn,onClick:t=>{t.stopPropagation(),c(e)},title:(0,s.t)("crm.edit")||"Edit"},"✏️"),a.createElement("button",{style:gp.actionBtn,onClick:t=>{t.stopPropagation(),d(e.id)},title:(0,s.t)("crm.delete")||"Delete"},"🗑️")))))),a.createElement("div",{style:gp.divider}),a.createElement("div",{style:gp.section},a.createElement(hp,{id:"uncategorized",isActive:"uncategorized"===t,onClick:()=>i("uncategorized")},a.createElement("span",{style:gp.icon},"📁"),a.createElement("span",{style:gp.name},(0,s.t)("crm.uncategorized")||"Uncategorized"),a.createElement("span",{style:{...gp.count,..."uncategorized"===t?gp.countActive:{}}},o))),a.createElement("div",{style:gp.footer},a.createElement("button",{style:gp.addBtn,onClick:l,onMouseEnter:e=>{e.currentTarget.style.boxShadow="0 4px 12px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.3)",e.currentTarget.style.transform="translateY(-1px)"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="none",e.currentTarget.style.transform="none"}},a.createElement("span",{style:{fontSize:"18px"}},"+"),a.createElement("span",null,(0,s.t)("crm.addFollowUpCategory")||"Add Category"))))},vp=({isOpen:e,onClose:t,onSave:n,onDelete:r,category:o,existingCategories:i})=>{const[l,c]=(0,a.useState)(""),[d,m]=(0,a.useState)(wm[0]),[p,u]=(0,a.useState)(xm[0]),[g,h]=(0,a.useState)(""),[b,f]=(0,a.useState)(""),[v,y]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{const e=()=>{const e=_();y("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]);const x=!!o;(0,a.useEffect)(()=>{if(e){if(o)c(o.name),m(o.icon),u(o.color),h(xm.includes(o.color)?"":o.color);else{const e=i.length;c(""),m(wm[e%wm.length]),u(xm[e%xm.length]),h("")}f("")}},[e,o,i.length]);return e?a.createElement(a.Fragment,null,a.createElement("style",null,"\n  .followup-cat-overlay {\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background: rgba(0, 0, 0, 0.55);\n    backdrop-filter: blur(6px);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    z-index: 100001;\n    animation: fadeIn 0.2s ease;\n  }\n\n  @keyframes fadeIn {\n    from { opacity: 0; }\n    to { opacity: 1; }\n  }\n\n  @keyframes slideUp {\n    from { transform: translateY(20px); opacity: 0; }\n    to { transform: translateY(0); opacity: 1; }\n  }\n\n  .followup-cat-modal {\n    background: var(--lion-bg-primary);\n    border-radius: 16px;\n    border: 1px solid var(--lion-border-light);\n    width: 420px;\n    max-width: 90vw;\n    max-height: 85vh;\n    overflow: hidden;\n    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05);\n    animation: slideUp 0.3s ease;\n  }\n\n  .followup-cat-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 16px 20px;\n    background: var(--lion-bg-primary);\n    border-bottom: 1px solid var(--lion-border-light);\n    color: var(--lion-text-primary);\n  }\n\n  .followup-cat-header-title {\n    font-size: 16px;\n    font-weight: 600;\n    margin: 0;\n  }\n\n  .followup-cat-close-btn {\n    background: var(--lion-bg-tertiary);\n    border: none;\n    color: var(--lion-text-muted);\n    width: 36px;\n    height: 36px;\n    border-radius: 10px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    font-size: 14px;\n    transition: all 0.2s;\n  }\n\n  .followup-cat-close-btn:hover {\n    background: rgba(239, 68, 68, 0.1);\n    color: var(--lion-error);\n  }\n\n  .followup-cat-body {\n    padding: 20px;\n    overflow-y: auto;\n    max-height: calc(85vh - 140px);\n  }\n\n  .followup-cat-form-group {\n    margin-bottom: 18px;\n  }\n\n  .followup-cat-label {\n    display: block;\n    font-size: 13px;\n    font-weight: 700;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n    color: var(--lion-text-secondary);\n    margin-bottom: 8px;\n  }\n\n  .followup-cat-input {\n    width: 100%;\n    padding: 10px 12px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 14px;\n    color: var(--lion-text-primary) !important;\n    background: var(--lion-bg-secondary) !important;\n    outline: none;\n    transition: border-color 0.2s, box-shadow 0.2s;\n    box-sizing: border-box;\n  }\n\n  .followup-cat-input:focus {\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n  }\n\n  .followup-cat-input::placeholder {\n    color: var(--lion-text-muted);\n  }\n\n  .followup-cat-error {\n    color: var(--lion-error);\n    font-size: 12px;\n    margin-top: 6px;\n    display: block;\n  }\n\n  .followup-cat-icon-picker {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 8px;\n  }\n\n  .followup-cat-icon-option {\n    width: 36px;\n    height: 36px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    font-size: 18px;\n    border: 2px solid var(--lion-border-light);\n    border-radius: 10px;\n    cursor: pointer;\n    background: var(--lion-bg-secondary);\n    transition: all 0.2s;\n  }\n\n  .followup-cat-icon-option:hover {\n    border-color: var(--lion-primary);\n  }\n\n  .followup-cat-icon-option.selected {\n    border-color: var(--lion-primary);\n    background: var(--lion-primary-light);\n  }\n\n  .followup-cat-color-picker {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 8px;\n    align-items: center;\n  }\n\n  .followup-cat-color-option {\n    width: 28px;\n    height: 28px;\n    border-radius: 50%;\n    cursor: pointer;\n    border: 3px solid transparent;\n    transition: all 0.2s;\n  }\n\n  .followup-cat-color-option:hover {\n    transform: scale(1.1);\n  }\n\n  .followup-cat-color-option.selected {\n    border: 3px solid var(--lion-text-primary);\n    transform: scale(1.1);\n  }\n\n  .followup-cat-custom-color {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    margin-left: 8px;\n  }\n\n  .followup-cat-custom-color-input {\n    width: 28px;\n    height: 28px;\n    border-radius: 50%;\n    border: none;\n    cursor: pointer;\n    padding: 0;\n  }\n\n  .followup-cat-custom-color-label {\n    font-size: 12px;\n    color: var(--lion-text-muted);\n  }\n\n  .followup-cat-preview {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    padding: 12px 14px;\n    background: var(--lion-bg-secondary);\n    border-radius: 10px;\n    border: 1px solid var(--lion-border-light);\n  }\n\n  .followup-cat-preview-icon {\n    font-size: 20px;\n  }\n\n  .followup-cat-preview-name {\n    flex: 1;\n    font-size: 14px;\n    font-weight: 500;\n    color: var(--lion-text-primary);\n  }\n\n  .followup-cat-preview-dot {\n    width: 10px;\n    height: 10px;\n    border-radius: 50%;\n  }\n\n  .followup-cat-footer {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 16px 20px;\n    background: var(--lion-bg-secondary);\n    border-top: 1px solid var(--lion-border-light);\n  }\n\n  .followup-cat-footer-right {\n    display: flex;\n    gap: 10px;\n    margin-left: auto;\n  }\n\n  .followup-cat-btn-primary {\n    padding: 10px 20px;\n    background: var(--lion-primary);\n    color: #ffffff;\n    border: none;\n    border-radius: 10px;\n    font-size: 14px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.2s;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .followup-cat-btn-primary:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.3);\n  }\n\n  .followup-cat-btn-secondary {\n    padding: 10px 20px;\n    background: var(--lion-bg-primary);\n    color: var(--lion-text-secondary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    font-size: 14px;\n    font-weight: 500;\n    cursor: pointer;\n    transition: all 0.2s;\n  }\n\n  .followup-cat-btn-secondary:hover {\n    background: var(--lion-bg-tertiary);\n  }\n\n  .followup-cat-btn-danger {\n    padding: 10px 20px;\n    background: rgba(239, 68, 68, 0.1);\n    color: var(--lion-error);\n    border: 1px solid rgba(239, 68, 68, 0.2);\n    border-radius: 10px;\n    font-size: 14px;\n    font-weight: 500;\n    cursor: pointer;\n    transition: all 0.2s;\n  }\n\n  .followup-cat-btn-danger:hover {\n    background: rgba(239, 68, 68, 0.2);\n  }\n"),a.createElement("div",{className:"followup-cat-overlay "+(v?"lion-dark":""),onClick:t},a.createElement("div",{className:"followup-cat-modal",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"followup-cat-header"},a.createElement("h2",{className:"followup-cat-header-title"},x?(0,s.t)("crm.editFollowUpCategory")||"Edit Category":(0,s.t)("crm.createFollowUpCategory")||"Create Category"),a.createElement("button",{className:"followup-cat-close-btn",onClick:t},"✕")),a.createElement("div",{className:"followup-cat-body"},a.createElement("div",{className:"followup-cat-form-group"},a.createElement("label",{className:"followup-cat-label"},(0,s.t)("crm.followUpCategoryName")||"Name"),a.createElement("input",{type:"text",className:"followup-cat-input",value:l,onChange:e=>{c(e.target.value),f("")},placeholder:(0,s.t)("crm.enterFollowUpCategoryName")||"Enter category name",autoFocus:!0}),b&&a.createElement("span",{className:"followup-cat-error"},b)),a.createElement("div",{className:"followup-cat-form-group"},a.createElement("label",{className:"followup-cat-label"},(0,s.t)("crm.categoryIcon")||"Icon"),a.createElement("div",{className:"followup-cat-icon-picker"},wm.map(e=>a.createElement("button",{key:e,type:"button",className:"followup-cat-icon-option "+(d===e?"selected":""),onClick:()=>m(e)},e)))),a.createElement("div",{className:"followup-cat-form-group"},a.createElement("label",{className:"followup-cat-label"},(0,s.t)("crm.categoryColor")||"Color"),a.createElement("div",{className:"followup-cat-color-picker"},xm.map(e=>a.createElement("button",{key:e,type:"button",className:"followup-cat-color-option "+(p!==e||g?"":"selected"),style:{backgroundColor:e},onClick:()=>{u(e),h("")}})),a.createElement("div",{className:"followup-cat-custom-color"},a.createElement("input",{type:"color",className:"followup-cat-custom-color-input",value:g||p,onChange:e=>{h(e.target.value),u(e.target.value)},title:(0,s.t)("crm.customColor")||"Custom color"}),a.createElement("span",{className:"followup-cat-custom-color-label"},(0,s.t)("crm.custom")||"Custom")))),a.createElement("div",{className:"followup-cat-form-group"},a.createElement("label",{className:"followup-cat-label"},(0,s.t)("crm.preview")||"Preview"),a.createElement("div",{className:"followup-cat-preview"},a.createElement("span",{className:"followup-cat-preview-icon"},d),a.createElement("span",{className:"followup-cat-preview-name"},l||(0,s.t)("crm.followUpCategoryName")||"Name"),a.createElement("span",{className:"followup-cat-preview-dot",style:{backgroundColor:g||p}})))),a.createElement("div",{className:"followup-cat-footer"},x&&r&&a.createElement("button",{type:"button",className:"followup-cat-btn-danger",onClick:()=>{o&&r&&confirm((0,s.t)("crm.confirmDeleteFollowUpCategory")||"Delete this category? Follow-ups will be moved to Uncategorized.")&&(r(o.id),t())}},(0,s.t)("crm.delete")||"Delete"),a.createElement("div",{className:"followup-cat-footer-right"},a.createElement("button",{type:"button",className:"followup-cat-btn-secondary",onClick:t},(0,s.t)("crm.cancel")||"Cancel"),a.createElement("button",{type:"button",className:"followup-cat-btn-primary",onClick:()=>{const e=l.trim();if(!e)return void f((0,s.t)("crm.followUpCategoryNameRequired")||"Category name is required");if(i.some(t=>t.name.toLowerCase()===e.toLowerCase()&&t.id!==o?.id))return void f((0,s.t)("crm.followUpCategoryNameExists")||"A category with this name already exists");n({...o||{},name:e,icon:d,color:g||p}),t()}},x?(0,s.t)("crm.save")||"Save":(0,s.t)("crm.createCategoryBtn")||"Create Category")))))):null},yp=`\n  ${ma}\n\n  /* === V3 BACKDROP === */\n  .followup-modal-overlay {\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background: rgba(0, 0, 0, 0.55);\n    backdrop-filter: blur(6px);\n    -webkit-backdrop-filter: blur(6px);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    z-index: 10000;\n    animation: fadeIn 0.2s ease;\n  }\n\n  @keyframes fadeIn {\n    from { opacity: 0; }\n    to { opacity: 1; }\n  }\n\n  /* === V3 MODAL CONTAINER === */\n  .followup-modal {\n    background: var(--lion-bg-primary);\n    border-radius: 16px;\n    border: 1px solid var(--lion-border-light);\n    width: 92%;\n    max-width: 1100px;\n    height: 88vh;\n    max-height: 720px;\n    overflow: hidden;\n    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05);\n    animation: slideUp 0.3s ease;\n    display: flex;\n    flex-direction: column;\n  }\n\n  @keyframes slideUp {\n    from { transform: translateY(20px); opacity: 0; }\n    to { transform: translateY(0); opacity: 1; }\n  }\n\n  /* === V3 HEADER (Clean, no gradient) === */\n  .followup-modal-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 20px 28px;\n    background: var(--lion-bg-primary);\n    border-bottom: 1px solid var(--lion-border-light);\n    flex-shrink: 0;\n  }\n\n  .followup-modal-title {\n    font-size: 20px;\n    font-weight: 700;\n    letter-spacing: -0.01em;\n    color: var(--lion-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 10px;\n  }\n\n  .followup-modal-title svg {\n    width: 22px;\n    height: 22px;\n    color: var(--lion-primary);\n  }\n\n  /* === V3 CLOSE BUTTON === */\n  .followup-close-btn {\n    width: 36px;\n    height: 36px;\n    border-radius: 10px;\n    background: var(--lion-bg-tertiary, #f4f4f5);\n    border: 1px solid var(--lion-border-light);\n    color: var(--lion-text-muted);\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s ease;\n    padding: 0;\n  }\n\n  .followup-close-btn:hover {\n    background: rgba(239, 68, 68, 0.1);\n    color: var(--lion-error);\n    border-color: rgba(239, 68, 68, 0.3);\n  }\n\n  .followup-close-btn svg {\n    width: 18px;\n    height: 18px;\n  }\n\n  /* === 3-PANEL LAYOUT === */\n  .followup-modal-content {\n    display: flex;\n    flex: 1;\n    overflow: hidden;\n  }\n\n  .followup-category-sidebar {\n    width: 210px;\n    min-width: 210px;\n    display: flex;\n    flex-direction: column;\n    overflow: hidden;\n    border-right: 1px solid var(--lion-border-light);\n  }\n\n  .followup-list-main {\n    flex: 1;\n    background: var(--lion-bg-secondary);\n    display: flex;\n    flex-direction: column;\n    overflow: hidden;\n    min-width: 0;\n  }\n\n  .followup-main {\n    flex: 1;\n    overflow-y: auto;\n    padding: 0;\n    display: flex;\n    flex-direction: column;\n    min-width: 0;\n    background: var(--lion-bg-secondary);\n  }\n\n  .followup-main-fullwidth {\n    width: 100%;\n  }\n\n  /* V3 Scrollbar for main */\n  .followup-main::-webkit-scrollbar {\n    width: 8px;\n  }\n  .followup-main::-webkit-scrollbar-track {\n    background: transparent;\n  }\n  .followup-main::-webkit-scrollbar-thumb {\n    background: var(--lion-border-medium, #d1d5db);\n    border-radius: 4px;\n  }\n  .followup-main::-webkit-scrollbar-thumb:hover {\n    background: var(--lion-text-light, #9ca3af);\n  }\n\n  /* Responsive - Larger screens */\n  @media (min-width: 1200px) {\n    .followup-category-sidebar {\n      width: 220px;\n      min-width: 220px;\n    }\n  }\n\n  /* Responsive - Stack layout */\n  @media (max-width: 900px) {\n    .followup-modal-content {\n      flex-direction: column;\n    }\n    .followup-category-sidebar {\n      width: 100%;\n      min-width: 100%;\n      max-height: 120px;\n      border-right: none;\n      border-bottom: 1px solid var(--lion-border-light);\n    }\n    .followup-list-main {\n      flex: 1;\n      overflow-y: auto;\n    }\n    .followup-main {\n      flex: 1;\n      overflow-y: auto;\n    }\n  }\n\n  /* === V3 EMPTY STATE === */\n  .followup-empty-state {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    height: 100%;\n    color: var(--lion-text-muted);\n    padding: 40px;\n    text-align: center;\n  }\n\n  .followup-empty-icon {\n    width: 72px;\n    height: 72px;\n    margin-bottom: 20px;\n    opacity: 0.35;\n    color: var(--lion-text-muted);\n  }\n\n  .followup-empty-title {\n    font-size: 17px;\n    font-weight: 700;\n    color: var(--lion-text-secondary);\n    margin-bottom: 8px;\n  }\n\n  .followup-empty-text {\n    font-size: 13px;\n    color: var(--lion-text-muted);\n    max-width: 300px;\n    line-height: 1.5;\n  }\n`,xp=({isOpen:e,onClose:t})=>{const[r,o]=(0,a.useState)([]),[l,c]=(0,a.useState)(null),[d,m]=(0,a.useState)(!1),[p,u]=(0,a.useState)(!0),[,g]=(0,a.useState)(0),[h,b]=(0,a.useState)([]),[f,v]=(0,a.useState)("all"),[y,x]=(0,a.useState)(!1),[w,k]=(0,a.useState)(null),[E,S]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)}),C=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=document.getElementById("followup-modal-portal");return e||(e=document.createElement("div"),e.id="followup-modal-portal",document.body.appendChild(e)),C.current=e,()=>{}},[]),(0,a.useEffect)(()=>{},[e]),(0,a.useEffect)(()=>{const e=()=>{const e=_();S("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]),(0,a.useEffect)(()=>{const e=()=>g(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{e&&(T(),D())},[e]),(0,a.useEffect)(()=>{},[l,d]);const T=async()=>{u(!0);try{const e=await Lm();o(e)}catch(e){}finally{u(!1)}},D=async()=>{try{const e=await Wm();b(e)}catch(e){}},N=(0,a.useMemo)(()=>{const e={};return h.forEach(t=>{e[t.id]=0}),r.forEach(t=>{t.categoryId&&e.hasOwnProperty(t.categoryId)&&e[t.categoryId]++}),e},[r,h]),M=(0,a.useMemo)(()=>r.filter(e=>!e.categoryId||!h.some(t=>t.id===e.categoryId)).length,[r,h]),R=(0,a.useMemo)(()=>"all"===f?r:"uncategorized"===f?r.filter(e=>!e.categoryId||!h.some(t=>t.id===e.categoryId)):r.filter(e=>e.categoryId===f),[r,h,f]),B=async e=>{if(confirm((0,s.t)("crm.confirmDeleteFollowUpCategory")||"Delete this category? Follow-ups will be moved to Uncategorized."))try{await async function(e){try{const t=(await Wm()).filter(t=>t.id!==e);await n().storage.local.set({[Im]:t});const a=await Lm();let r=!1;a.forEach(t=>{t.categoryId===e&&(t.categoryId=void 0,t.sortOrder=void 0,r=!0)}),r&&await n().storage.local.set({[Mm]:a})}catch(e){throw e}}(e),await D(),await T(),f===e&&v("all")}catch(e){}};if(!e)return null;const P=C.current||document.getElementById("followup-modal-portal");if(!P)return null;const L=a.createElement(Gt,{onDragEnd:async e=>{const{active:t,over:n}=e;if(!n)return;const a=t.id,r=n.data.current;if("followup-category"===r?.type){const e=r.categoryId;await Hm(a,e),await T()}},collisionDetection:_e},a.createElement("style",null,yp),a.createElement("div",{className:"followup-modal-overlay "+(E?"lion-dark":""),onClick:e=>{e.target===e.currentTarget&&t()}},a.createElement("div",{className:"followup-modal",onClick:e=>{e.stopPropagation()}},a.createElement("div",{className:"followup-modal-header"},a.createElement("div",{className:"followup-modal-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("polyline",{points:"12 6 12 12 16 14"}),a.createElement("path",{d:"M20 4L20 8L16 8"})),(0,s.t)("followUp.title")||"Follow Up"),a.createElement("button",{className:"followup-close-btn",onClick:t},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 6L6 18M6 6l12 12"})))),a.createElement("div",{className:"followup-modal-content"},l||d?a.createElement("div",{className:"followup-main followup-main-fullwidth"},a.createElement(up,{followUp:l,isNew:d,onSave:async e=>{try{const t=await zm(e);await T(),c(t),m(!1)}catch(e){}},onCancel:()=>{c(null),m(!1)},categories:h})):a.createElement(a.Fragment,null,a.createElement("div",{className:"followup-category-sidebar"},a.createElement(fp,{categories:h,selectedCategoryId:f,followUpCounts:N,totalFollowUps:r.length,uncategorizedCount:M,onSelectCategory:v,onAddCategory:()=>{k(null),x(!0)},onEditCategory:e=>{k(e),x(!0)},onDeleteCategory:B})),a.createElement("div",{className:"followup-list-main"},a.createElement(ep,{followUps:R,selectedId:null,loading:p,onSelect:e=>{c(e),m(!1)},onCreateNew:()=>{const e={...Cm,id:Tm(),name:"",createdAt:Date.now(),updatedAt:Date.now(),categoryId:"all"!==f&&"uncategorized"!==f?f:void 0,actions:[{id:Am(),type:"template",templateConfig:{messages:[{id:Dm(),message:"",attachmentType:"none",attachments:[],delay:{min:3,max:5}}]}}]};c(e),m(!0)},onDelete:async e=>{if(confirm((0,s.t)("followUp.confirmDelete")||"Are you sure you want to delete this follow-up?"))try{await Om(e),await T(),l?.id===e&&(c(null),m(!1))}catch(e){}},onToggleActive:async e=>{try{const t=await async function(e){const t=await Um(e);return t?(t.isActive=!t.isActive,await zm(t)):null}(e);t&&(await T(),l?.id===e&&c(t))}catch(e){}},onDuplicate:async e=>{try{const t=await async function(e){const t=await Um(e);if(!t)return null;const n={...t,id:void 0,name:`${t.name} (Copy)`,isActive:!1,actions:t.actions.map(e=>({...e,id:Am()})),steps:t.steps?.map(e=>({...e,id:`step_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,actions:e.actions.map(e=>({...e,id:Am()}))}))};return await zm(n)}(e);t&&(await T(),c(t),m(!1))}catch(e){}}})))))),a.createElement(vp,{isOpen:y,onClose:()=>{x(!1),k(null)},onSave:async e=>{try{if(w)await qm({...w,...e});else{const r=(t=e.name,n=e.icon,a=e.color,{id:`followup_cat_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,name:t,icon:n||wm[Math.floor(Math.random()*wm.length)],color:a||xm[Math.floor(Math.random()*xm.length)],sortOrder:0,isExpanded:!0,createdAt:Date.now()});await qm(r)}await D(),x(!1),k(null)}catch(e){}var t,n,a},onDelete:w?()=>B(w.id):void 0,category:w,existingCategories:h}));return i.createPortal(L,P)},wp="wa_schedules",kp=[{value:1,key:"mon",label:"Monday"},{value:2,key:"tue",label:"Tuesday"},{value:3,key:"wed",label:"Wednesday"},{value:4,key:"thu",label:"Thursday"},{value:5,key:"fri",label:"Friday"},{value:6,key:"sat",label:"Saturday"},{value:7,key:"sun",label:"Sunday"}],Ep=[{value:1,key:"jan",label:"January"},{value:2,key:"feb",label:"February"},{value:3,key:"mar",label:"March"},{value:4,key:"apr",label:"April"},{value:5,key:"may",label:"May"},{value:6,key:"jun",label:"June"},{value:7,key:"jul",label:"July"},{value:8,key:"aug",label:"August"},{value:9,key:"sep",label:"September"},{value:10,key:"oct",label:"October"},{value:11,key:"nov",label:"November"},{value:12,key:"dec",label:"December"}],Sp={isActive:!0,mode:"once",templateType:"none",message:"",runAnytime:!0,endType:"never",executionCount:0,archiveChat:!1,blockChat:!1,autoSendIfMissed:!1,webhookEnabled:!1,postActions:{groupActionsEnabled:!1,addToGroups:[],removeFromGroups:[],tabActionsEnabled:!1,addToTabs:[],removeFromTabs:[],labelsActionsEnabled:!1,addLabels:[],removeLabels:[],kanbanActionsEnabled:!1,addToKanban:null,removeFromKanban:null}};function Cp(){return`time_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}async function Tp(){try{return(await n().storage.local.get(wp))[wp]||[]}catch(e){return[]}}async function Ap(e){const t=await Tp(),a=Date.now();let r;if(e.id){const n=t.findIndex(t=>t.id===e.id);n>=0?(r={...t[n],...e,updatedAt:a},"lastExecutedAt"in e&&void 0===e.lastExecutedAt&&delete r.lastExecutedAt,"executionCount"in e&&0===e.executionCount&&(r.executionCount=0),t[n]=r):(r={...Sp,...e,createdAt:e.createdAt||a,updatedAt:a},t.push(r))}else r={...Sp,...e,id:`schedule_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,createdAt:a,updatedAt:a},t.push(r);return"repeated"===r.mode&&r.isActive&&(r.nextExecutionAt=_p(r)),await n().storage.local.set({[wp]:t}),r}async function Dp(e){const t=(await Tp()).filter(t=>t.id!==e);await n().storage.local.set({[wp]:t})}function _p(e){const t=new Date,n=e.lastExecutedAt?new Date(e.lastExecutedAt):t;if(!e.repeatedType)return t.getTime();switch(e.repeatedType){case"minute":{const t=e.repeatInterval||1;return n.getTime()+60*t*1e3}case"hour":{const t=e.repeatInterval||1;return n.getTime()+60*t*60*1e3}case"daily":{const n=e.timeEntries||[];if(0===n.length)return t.getTime()+864e5;const a=[...n].sort((e,t)=>{const[n,a]=e.time.split(":").map(Number),[r,o]=t.time.split(":").map(Number);return 60*n+a-(60*r+o)});for(const e of a){const[n,a]=e.time.split(":").map(Number),r=new Date(t);if(r.setHours(n,a,0,0),r>t)return r.getTime()}const[r,o]=a[0].time.split(":").map(Number),i=new Date(t);return i.setDate(i.getDate()+1),i.setHours(r,o,0,0),i.getTime()}case"weekly":{const n=e.timeEntries||[];if(0===n.length)return t.getTime()+6048e5;const a=n.reduce((e,t)=>{const n=t.day||1;return e[n]||(e[n]=[]),e[n].push(t),e},{}),r=t.getDay()||7;for(let e=0;e<7;e++){const n=(r-1+e)%7+1;if(a[n]){const r=a[n].sort((e,t)=>{const[n,a]=e.time.split(":").map(Number),[r,o]=t.time.split(":").map(Number);return 60*n+a-(60*r+o)});for(const n of r){const[a,r]=n.time.split(":").map(Number),o=new Date(t);if(o.setDate(o.getDate()+e),o.setHours(a,r,0,0),o>t)return o.getTime()}}}const o=Math.min(...Object.keys(a).map(Number)),i=a[o][0],[s,l]=i.time.split(":").map(Number),c=(o-r+7)%7||7,d=new Date(t);return d.setDate(d.getDate()+c),d.setHours(s,l,0,0),d.getTime()}case"monthly":{const n=e.timeEntries||[];if(0===n.length)return t.getTime()+2592e6;const a=n.reduce((e,t)=>{const n=t.date||1;return e[n]||(e[n]=[]),e[n].push(t),e},{}),r=t.getDate(),o=Object.keys(a).map(Number).sort((e,t)=>e-t);for(const e of o)if(e>=r){const n=a[e].sort((e,t)=>{const[n,a]=e.time.split(":").map(Number),[r,o]=t.time.split(":").map(Number);return 60*n+a-(60*r+o)});for(const a of n){const[n,r]=a.time.split(":").map(Number),o=new Date(t);if(o.setDate(e),o.setHours(n,r,0,0),o>t)return o.getTime()}}const i=o[0],s=a[i][0],[l,c]=s.time.split(":").map(Number),d=new Date(t);return d.setMonth(d.getMonth()+1),d.setDate(i),d.setHours(l,c,0,0),d.getTime()}case"yearly":{const n=e.timeEntries||[];if(0===n.length)return t.getTime()+31536e6;const a=n.map(e=>({...e,month:e.month||1,date:e.date||1})).sort((e,t)=>{if(e.month!==t.month)return e.month-t.month;if(e.date!==t.date)return e.date-t.date;const[n,a]=e.time.split(":").map(Number),[r,o]=t.time.split(":").map(Number);return 60*n+a-(60*r+o)});for(const e of a){const[n,a]=e.time.split(":").map(Number),r=new Date(t);if(r.setMonth(e.month-1),r.setDate(e.date),r.setHours(n,a,0,0),r>t)return r.getTime()}const r=a[0],[o,i]=r.time.split(":").map(Number),s=new Date(t);return s.setFullYear(s.getFullYear()+1),s.setMonth(r.month-1),s.setDate(r.date),s.setHours(o,i,0,0),s.getTime()}default:return t.getTime()+864e5}}const Np=`\n  ${ma}\n\n  /* === V3 BACKDROP === */\n  .schedule-modal-overlay {\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background: rgba(0, 0, 0, 0.55);\n    backdrop-filter: blur(6px);\n    -webkit-backdrop-filter: blur(6px);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    z-index: 10000;\n    animation: scheduleModalFadeIn 0.2s ease;\n  }\n\n  @keyframes scheduleModalFadeIn {\n    from { opacity: 0; }\n    to { opacity: 1; }\n  }\n\n  /* === V3 MODAL CONTAINER === */\n  .schedule-modal {\n    background: var(--lion-bg-primary);\n    border-radius: 16px;\n    border: 1px solid var(--lion-border-light);\n    width: 92%;\n    max-width: 920px;\n    height: 88vh;\n    max-height: 720px;\n    overflow: hidden;\n    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05);\n    animation: scheduleModalSlideUp 0.3s ease;\n    display: flex;\n    flex-direction: column;\n  }\n\n  @keyframes scheduleModalSlideUp {\n    from { transform: translateY(20px); opacity: 0; }\n    to { transform: translateY(0); opacity: 1; }\n  }\n\n  /* === V3 HEADER (Clean, no gradient) === */\n  .schedule-modal-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 20px 28px;\n    background: var(--lion-bg-primary);\n    border-bottom: 1px solid var(--lion-border-light);\n    flex-shrink: 0;\n  }\n\n  .schedule-modal-title {\n    font-size: 20px;\n    font-weight: 700;\n    letter-spacing: -0.01em;\n    color: var(--lion-text-primary);\n    display: flex;\n    align-items: center;\n    gap: 10px;\n  }\n\n  .schedule-modal-title svg {\n    width: 22px;\n    height: 22px;\n    color: var(--lion-primary);\n  }\n\n  /* === V3 CLOSE BUTTON === */\n  .schedule-close-btn {\n    width: 36px;\n    height: 36px;\n    border-radius: 10px;\n    background: var(--lion-bg-tertiary, #f4f4f5);\n    border: 1px solid var(--lion-border-light);\n    color: var(--lion-text-muted);\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.2s ease;\n    padding: 0;\n  }\n\n  .schedule-close-btn:hover {\n    background: rgba(239, 68, 68, 0.1);\n    color: var(--lion-error);\n    border-color: rgba(239, 68, 68, 0.3);\n  }\n\n  .schedule-close-btn svg {\n    width: 18px;\n    height: 18px;\n  }\n\n  /* === MODAL CONTENT === */\n  .schedule-modal-content {\n    flex: 1;\n    overflow-y: auto;\n    padding: 0;\n  }\n\n  /* V3 Scrollbar */\n  .schedule-modal-content::-webkit-scrollbar {\n    width: 8px;\n  }\n\n  .schedule-modal-content::-webkit-scrollbar-track {\n    background: transparent;\n  }\n\n  .schedule-modal-content::-webkit-scrollbar-thumb {\n    background: var(--lion-border-medium, #d1d5db);\n    border-radius: 4px;\n  }\n\n  .schedule-modal-content::-webkit-scrollbar-thumb:hover {\n    background: var(--lion-text-light, #9ca3af);\n  }\n\n  /* === LIST VIEW STYLES === */\n  .schedule-list-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 18px 28px;\n    border-bottom: 1px solid var(--lion-border-light);\n  }\n\n  .schedule-list-title {\n    font-size: 15px;\n    font-weight: 700;\n    color: var(--lion-text-primary);\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n  }\n\n  /* === V3 ADD BUTTON (Gradient) === */\n  .schedule-add-btn {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    padding: 10px 18px;\n    background: var(--lion-primary);\n    color: #ffffff;\n    border: none;\n    border-radius: 10px;\n    cursor: pointer;\n    font-size: 13px;\n    font-weight: 600;\n    transition: all 0.15s ease;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .schedule-add-btn:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35);\n  }\n\n  /* === V3 SCHEDULE LIST === */\n  .schedule-list {\n    padding: 20px 28px;\n    display: flex;\n    flex-direction: column;\n    gap: 12px;\n  }\n\n  /* === V3 SCHEDULE CARD === */\n  .schedule-card {\n    background: var(--lion-bg-primary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 14px;\n    padding: 18px;\n    display: flex;\n    align-items: flex-start;\n    gap: 14px;\n    transition: all 0.15s ease;\n  }\n\n  .schedule-card:hover {\n    border-color: var(--lion-border-medium, #d1d5db);\n    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);\n  }\n\n  .schedule-card-icon {\n    width: 42px;\n    height: 42px;\n    border-radius: 12px;\n    background: var(--lion-primary);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    color: #ffffff;\n    flex-shrink: 0;\n    font-size: 18px;\n  }\n\n  .schedule-card-content {\n    flex: 1;\n    min-width: 0;\n  }\n\n  .schedule-card-header {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    margin-bottom: 4px;\n  }\n\n  .schedule-card-name {\n    font-weight: 600;\n    color: var(--lion-text-primary);\n    font-size: 15px;\n  }\n\n  .schedule-card-message {\n    color: var(--lion-text-muted);\n    font-size: 13px;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    margin-bottom: 10px;\n  }\n\n  .schedule-card-info {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    font-size: 12px;\n    color: var(--lion-text-muted);\n    flex-wrap: wrap;\n  }\n\n  .schedule-card-badge {\n    display: inline-flex;\n    align-items: center;\n    gap: 4px;\n    padding: 3px 10px;\n    background: rgba(var(--lion-primary-rgb), 0.08);\n    color: var(--lion-primary);\n    border-radius: 6px;\n    font-size: 11px;\n    font-weight: 600;\n  }\n\n  .schedule-card-actions {\n    display: flex;\n    gap: 6px;\n    flex-shrink: 0;\n  }\n\n  .schedule-card-btn {\n    width: 34px;\n    height: 34px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 8px;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s ease;\n    background: var(--lion-bg-secondary);\n    color: var(--lion-text-muted);\n  }\n\n  .schedule-card-btn:hover {\n    background: var(--lion-bg-primary);\n    color: var(--lion-text-primary);\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .schedule-card-btn.duplicate:hover {\n    background: rgba(59, 130, 246, 0.1);\n    color: var(--lion-info);\n    border-color: rgba(59, 130, 246, 0.3);\n  }\n\n  .schedule-card-btn.delete:hover {\n    background: rgba(239, 68, 68, 0.1);\n    color: var(--lion-error);\n    border-color: rgba(239, 68, 68, 0.3);\n  }\n\n  .schedule-empty {\n    display: flex;\n    flex-direction: column;\n    align-items: center;\n    justify-content: center;\n    padding: 60px 20px;\n    color: var(--lion-text-muted);\n    text-align: center;\n  }\n\n  .schedule-empty-icon {\n    width: 64px;\n    height: 64px;\n    margin-bottom: 16px;\n    opacity: 0.4;\n    color: var(--lion-text-muted);\n  }\n\n  /* === V3 EDITOR VIEW === */\n  .schedule-editor {\n    padding: 24px 28px;\n    background: var(--lion-bg-secondary);\n  }\n\n  /* === V3 MODE TABS (Once/Repeated) === */\n  .schedule-mode-tabs {\n    display: flex;\n    gap: 8px;\n    margin-bottom: 24px;\n  }\n\n  .schedule-mode-tab {\n    flex: 1;\n    padding: 12px 16px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    background: var(--lion-bg-primary);\n    color: var(--lion-text-secondary);\n    font-weight: 600;\n    font-size: 13px;\n    cursor: pointer;\n    transition: all 0.15s ease;\n    text-align: center;\n  }\n\n  .schedule-mode-tab:hover {\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .schedule-mode-tab.active {\n    border-color: transparent;\n    background: var(--lion-primary);\n    color: #ffffff;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  /* === V3 FORM SECTIONS (White cards) === */\n  .schedule-columns {\n    display: grid;\n    grid-template-columns: 1fr 1fr;\n    gap: 20px;\n  }\n\n  @media (max-width: 700px) {\n    .schedule-columns {\n      grid-template-columns: 1fr;\n    }\n  }\n\n  .schedule-column {\n    background: var(--lion-bg-primary);\n    border-radius: 14px;\n    padding: 20px;\n    border: 1px solid var(--lion-border-light);\n    display: flex;\n    flex-direction: column;\n    gap: 16px;\n  }\n\n  .schedule-field {\n    display: flex;\n    flex-direction: column;\n    gap: 8px;\n  }\n\n  /* === V3 LABELS (Uppercase) === */\n  .schedule-field-label {\n    font-size: 12px;\n    font-weight: 700;\n    color: var(--lion-text-secondary);\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n  }\n\n  .schedule-field-label .required {\n    color: var(--lion-error);\n  }\n\n  /* === V3 INFO TOOLTIP === */\n  .schedule-info-icon {\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    width: 16px;\n    height: 16px;\n    border-radius: 50%;\n    background: var(--lion-border-light);\n    color: var(--lion-text-muted);\n    font-size: 10px;\n    font-weight: 600;\n    cursor: help;\n    position: relative;\n    flex-shrink: 0;\n    transition: all 0.2s ease;\n  }\n\n  .schedule-info-icon:hover {\n    background: var(--lion-primary);\n    color: #ffffff;\n  }\n\n  .schedule-info-tooltip {\n    position: absolute;\n    bottom: calc(100% + 8px);\n    left: 0;\n    transform: none;\n    background: var(--lion-sidebar-start);\n    color: #ffffff;\n    padding: 10px 14px;\n    border-radius: 10px;\n    font-size: 12px;\n    font-weight: 400;\n    line-height: 1.5;\n    width: 280px;\n    max-width: 90vw;\n    text-align: left;\n    z-index: 10001;\n    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n    opacity: 0;\n    visibility: hidden;\n    transition: all 0.2s ease;\n    pointer-events: none;\n  }\n\n  .schedule-info-tooltip::after {\n    content: '';\n    position: absolute;\n    top: 100%;\n    left: 8px;\n    transform: none;\n    border: 6px solid transparent;\n    border-top-color: var(--lion-sidebar-start);\n  }\n\n  .schedule-info-icon:hover .schedule-info-tooltip {\n    opacity: 1;\n    visibility: visible;\n  }\n\n  /* === V3 FORM INPUTS (Focus rings, 10px radius) === */\n  .schedule-select {\n    padding: 10px 14px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    background: var(--lion-bg-secondary);\n    color: var(--lion-text-primary);\n    font-size: 13px;\n    font-family: inherit;\n    cursor: pointer;\n    appearance: none;\n    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");\n    background-repeat: no-repeat;\n    background-position: right 12px center;\n    padding-right: 36px;\n    transition: all 0.15s ease;\n  }\n\n  .schedule-select:hover {\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .schedule-input {\n    padding: 10px 14px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    background: var(--lion-bg-secondary);\n    color: var(--lion-text-primary);\n    font-size: 13px;\n    font-family: inherit;\n    transition: all 0.15s ease;\n  }\n\n  .schedule-input:hover {\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .schedule-input:focus, .schedule-select:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n    background: var(--lion-bg-primary);\n  }\n\n  .schedule-textarea {\n    padding: 12px 14px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    background: var(--lion-bg-secondary);\n    color: var(--lion-text-primary);\n    font-size: 13px;\n    min-height: 120px;\n    resize: vertical;\n    font-family: inherit;\n    transition: all 0.15s ease;\n  }\n\n  .schedule-textarea:hover {\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .schedule-textarea:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n    background: var(--lion-bg-primary);\n  }\n\n  .schedule-textarea::placeholder,\n  .schedule-input::placeholder {\n    color: var(--lion-text-muted);\n  }\n\n  .schedule-toolbar {\n    display: flex;\n    gap: 4px;\n    margin-top: 8px;\n    flex-wrap: wrap;\n  }\n\n  .schedule-toolbar-btn {\n    padding: 6px 10px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 8px;\n    background: var(--lion-bg-secondary);\n    color: var(--lion-text-secondary);\n    font-size: 13px;\n    cursor: pointer;\n    transition: all 0.15s ease;\n  }\n\n  .schedule-toolbar-btn:hover {\n    background: var(--lion-bg-primary);\n    border-color: var(--lion-primary);\n    color: var(--lion-primary);\n  }\n\n  /* === V3 VARIABLE CHIPS === */\n  .schedule-variables-row {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 6px;\n    margin-top: 10px;\n    align-items: center;\n  }\n\n  .schedule-variables-label {\n    font-size: 11px;\n    color: var(--lion-text-muted);\n    margin-right: 4px;\n    font-weight: 500;\n  }\n\n  .schedule-variable-chip {\n    padding: 4px 12px;\n    background: var(--lion-primary) !important;\n    border: none;\n    border-radius: 20px;\n    font-size: 11px;\n    font-weight: 600;\n    color: #ffffff !important;\n    cursor: pointer;\n    transition: all 0.15s ease;\n    box-shadow: 0 1px 4px rgba(var(--lion-primary-rgb), 0.2);\n  }\n\n  .schedule-variable-chip:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 3px 8px rgba(var(--lion-primary-rgb), 0.3);\n  }\n\n  /* === SELECT TEMPLATE (mirrors Bulk Message "Select Templates") === */\n  .schedule-select-template-btn {\n    display: inline-flex;\n    align-items: center;\n    gap: 4px;\n    padding: 6px 12px;\n    background: linear-gradient(135deg, rgba(var(--lion-primary-rgb), 0.08) 0%, rgba(var(--lion-primary-rgb), 0.14) 100%);\n    border: 1px solid var(--lion-primary);\n    border-radius: 8px;\n    color: var(--lion-primary);\n    font-size: 12px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.15s ease;\n  }\n\n  .schedule-select-template-btn:hover {\n    background: var(--lion-primary);\n    color: #ffffff;\n  }\n\n  .schedule-template-selector {\n    background: var(--lion-bg-primary);\n    border: 2px solid var(--lion-border-light);\n    border-radius: 10px;\n    max-height: 250px;\n    overflow-y: auto;\n    margin: 8px 0 12px 0;\n    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n  }\n\n  .schedule-template-option {\n    padding: 12px 16px;\n    border-bottom: 1px solid var(--lion-border-light);\n    cursor: pointer;\n    transition: all 0.2s;\n  }\n\n  .schedule-template-option:hover {\n    background: rgba(var(--lion-primary-rgb), 0.06);\n    border-left: 3px solid var(--lion-primary);\n    padding-left: 13px;\n  }\n\n  .schedule-template-option:last-child {\n    border-bottom: none;\n  }\n\n  .schedule-template-option-header {\n    display: flex;\n    justify-content: space-between;\n    align-items: center;\n    margin-bottom: 4px;\n  }\n\n  .schedule-template-name {\n    font-weight: 600;\n    color: var(--lion-text-primary);\n    font-size: 14px;\n  }\n\n  .schedule-template-type-badge {\n    font-size: 16px;\n    opacity: 0.9;\n  }\n\n  .schedule-template-preview {\n    font-size: 12px;\n    color: var(--lion-text-muted);\n    line-height: 1.4;\n    display: block;\n  }\n\n  .schedule-no-templates {\n    padding: 24px;\n    text-align: center;\n    color: var(--lion-text-muted);\n    font-size: 14px;\n  }\n\n  /* === V3 ATTACHMENT SECTION === */\n  .schedule-attachment-section {\n    margin-top: 16px;\n    padding: 16px;\n    background: var(--lion-bg-secondary);\n    border-radius: 10px;\n    border: 1px solid var(--lion-border-light);\n  }\n\n  /* === V3 POST ACTIONS SECTION === */\n  .schedule-section {\n    padding: 20px 28px;\n    border-top: 1px solid var(--lion-border-light);\n    background: var(--lion-bg-secondary);\n  }\n\n  .schedule-section-title {\n    font-size: 13px;\n    font-weight: 700;\n    color: var(--lion-text-primary);\n    margin-bottom: 14px;\n    text-transform: uppercase;\n    letter-spacing: 0.5px;\n  }\n\n  .schedule-toggles {\n    display: grid;\n    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n    gap: 8px;\n  }\n\n  .schedule-toggle {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n    padding: 10px 14px;\n    background: var(--lion-bg-primary);\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    cursor: pointer;\n    transition: all 0.15s ease;\n  }\n\n  .schedule-toggle:hover {\n    border-color: var(--lion-primary);\n  }\n\n  .schedule-toggle.active {\n    background: rgba(var(--lion-primary-rgb), 0.06);\n    border-color: var(--lion-primary);\n  }\n\n  .schedule-toggle-label {\n    font-size: 13px;\n    color: var(--lion-text-primary);\n    flex: 1;\n  }\n\n  .schedule-checkbox {\n    width: 18px;\n    height: 18px;\n    border-radius: 5px;\n    border: 2px solid var(--lion-border-light);\n    background: transparent;\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s ease;\n  }\n\n  .schedule-checkbox.checked {\n    background: var(--lion-primary);\n    border-color: var(--lion-primary);\n  }\n\n  /* === V3 TIME ENTRIES === */\n  .schedule-time-entries {\n    display: flex;\n    flex-direction: column;\n    gap: 8px;\n    margin-top: 8px;\n  }\n\n  .schedule-time-entry {\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .schedule-time-entry .schedule-select,\n  .schedule-time-entry .schedule-input {\n    flex: 1;\n  }\n\n  .schedule-remove-btn {\n    width: 34px;\n    height: 34px;\n    border: 1px solid rgba(239, 68, 68, 0.2);\n    border-radius: 8px;\n    background: rgba(239, 68, 68, 0.08);\n    color: var(--lion-error);\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s ease;\n  }\n\n  .schedule-remove-btn:hover {\n    background: rgba(239, 68, 68, 0.15);\n    border-color: rgba(239, 68, 68, 0.35);\n  }\n\n  .schedule-add-time-btn {\n    display: flex;\n    align-items: center;\n    gap: 6px;\n    padding: 10px 14px;\n    border: 1px dashed var(--lion-border-light);\n    border-radius: 10px;\n    background: transparent;\n    color: var(--lion-text-muted);\n    cursor: pointer;\n    font-size: 13px;\n    font-weight: 500;\n    transition: all 0.15s ease;\n    margin-top: 8px;\n  }\n\n  .schedule-add-time-btn:hover {\n    border-color: var(--lion-primary);\n    color: var(--lion-primary);\n    background: rgba(var(--lion-primary-rgb), 0.04);\n  }\n\n  /* === V3 FOOTER === */\n  .schedule-footer {\n    display: flex;\n    justify-content: flex-end;\n    gap: 12px;\n    padding: 18px 28px;\n    border-top: 1px solid var(--lion-border-light);\n    background: var(--lion-bg-primary);\n    flex-shrink: 0;\n  }\n\n  .schedule-btn {\n    padding: 10px 20px;\n    border-radius: 10px;\n    font-size: 13px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.15s ease;\n    display: flex;\n    align-items: center;\n    gap: 8px;\n  }\n\n  .schedule-btn-secondary {\n    background: var(--lion-bg-tertiary, #f4f4f5);\n    border: 1px solid var(--lion-border-light);\n    color: var(--lion-text-muted);\n  }\n\n  .schedule-btn-secondary:hover {\n    background: var(--lion-border-light);\n    color: var(--lion-text-secondary);\n    border-color: var(--lion-border-medium, #d1d5db);\n  }\n\n  .schedule-btn-primary {\n    background: var(--lion-primary);\n    border: none;\n    color: #ffffff;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .schedule-btn-primary:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35);\n  }\n\n  .schedule-btn-primary:disabled {\n    opacity: 0.5;\n    cursor: not-allowed;\n    transform: none;\n    box-shadow: none;\n  }\n\n  /* === V3 RADIO BUTTONS === */\n  .schedule-radio-group {\n    display: flex;\n    flex-direction: column;\n    gap: 10px;\n  }\n\n  .schedule-radio {\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    cursor: pointer;\n    padding: 6px 0;\n  }\n\n  .schedule-radio-dot {\n    width: 18px;\n    height: 18px;\n    border-radius: 50%;\n    border: 2px solid var(--lion-border-medium, #d1d5db);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s ease;\n  }\n\n  .schedule-radio.active .schedule-radio-dot {\n    border-color: var(--lion-primary);\n  }\n\n  .schedule-radio.active .schedule-radio-dot::after {\n    content: '';\n    width: 10px;\n    height: 10px;\n    border-radius: 50%;\n    background: var(--lion-primary);\n  }\n\n  .schedule-radio-label {\n    font-size: 13px;\n    color: var(--lion-text-primary);\n    font-weight: 500;\n  }\n\n  /* === V3 CONTACT SELECTOR MODAL === */\n  .schedule-contact-modal-overlay {\n    position: fixed;\n    top: 0;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    background: rgba(0, 0, 0, 0.55);\n    backdrop-filter: blur(6px);\n    -webkit-backdrop-filter: blur(6px);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    z-index: 100002;\n  }\n\n  .schedule-contact-modal {\n    background: var(--lion-bg-primary);\n    border-radius: 16px;\n    border: 1px solid var(--lion-border-light);\n    width: 500px;\n    max-width: 90vw;\n    max-height: 80vh;\n    display: flex;\n    flex-direction: column;\n    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05);\n  }\n\n  .schedule-contact-modal-header {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 20px 24px;\n    background: var(--lion-bg-primary);\n    border-bottom: 1px solid var(--lion-border-light);\n    border-radius: 16px 16px 0 0;\n  }\n\n  .schedule-contact-modal-header h3 {\n    margin: 0;\n    font-size: 18px;\n    font-weight: 700;\n    color: var(--lion-text-primary);\n    letter-spacing: -0.01em;\n  }\n\n  .schedule-contact-modal-close {\n    width: 34px;\n    height: 34px;\n    border-radius: 10px;\n    background: var(--lion-bg-tertiary, #f4f4f5);\n    border: 1px solid var(--lion-border-light);\n    color: var(--lion-text-muted);\n    cursor: pointer;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    transition: all 0.15s ease;\n    padding: 0;\n  }\n\n  .schedule-contact-modal-close:hover {\n    background: rgba(239, 68, 68, 0.1);\n    color: var(--lion-error);\n    border-color: rgba(239, 68, 68, 0.3);\n  }\n\n  .schedule-contact-modal-search {\n    padding: 16px 24px;\n    border-bottom: 1px solid var(--lion-border-light);\n  }\n\n  .schedule-contact-modal-search input {\n    width: 100%;\n    padding: 10px 14px;\n    border: 1px solid var(--lion-border-light);\n    border-radius: 10px;\n    background: var(--lion-bg-secondary);\n    color: var(--lion-text-primary);\n    font-size: 13px;\n    font-family: inherit;\n    transition: all 0.15s ease;\n  }\n\n  .schedule-contact-modal-search input:focus {\n    outline: none;\n    border-color: var(--lion-primary);\n    box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n    background: var(--lion-bg-primary);\n  }\n\n  .schedule-contact-modal-search input::placeholder {\n    color: var(--lion-text-muted);\n  }\n\n  .schedule-contact-modal-tabs {\n    display: flex;\n    padding: 0 24px;\n    border-bottom: 1px solid var(--lion-border-light);\n  }\n\n  .schedule-contact-modal-tab {\n    padding: 12px 20px;\n    background: none;\n    border: none;\n    color: var(--lion-text-muted);\n    font-size: 13px;\n    font-weight: 500;\n    cursor: pointer;\n    border-bottom: 2px solid transparent;\n    transition: all 0.15s;\n  }\n\n  .schedule-contact-modal-tab:hover {\n    color: var(--lion-text-secondary);\n  }\n\n  .schedule-contact-modal-tab.active {\n    color: var(--lion-text-primary);\n    border-bottom-color: var(--lion-primary);\n    font-weight: 600;\n  }\n\n  .schedule-contact-modal-tab .count {\n    margin-left: 6px;\n    padding: 2px 8px;\n    background: var(--lion-bg-secondary);\n    border-radius: 10px;\n    font-size: 11px;\n    color: var(--lion-text-muted);\n  }\n\n  .schedule-contact-modal-tab.active .count {\n    background: var(--lion-primary);\n    color: #ffffff;\n  }\n\n  /* V3 Contact List Scrollbar */\n  .schedule-contact-modal-list {\n    flex: 1;\n    overflow-y: auto;\n    padding: 8px 0;\n  }\n\n  .schedule-contact-modal-list::-webkit-scrollbar {\n    width: 6px;\n  }\n\n  .schedule-contact-modal-list::-webkit-scrollbar-track {\n    background: transparent;\n  }\n\n  .schedule-contact-modal-list::-webkit-scrollbar-thumb {\n    background: var(--lion-border-medium, #d1d5db);\n    border-radius: 3px;\n  }\n\n  .schedule-contact-item {\n    display: flex;\n    align-items: center;\n    gap: 12px;\n    padding: 10px 24px;\n    cursor: pointer;\n    transition: all 0.15s ease;\n    border-left: 3px solid transparent;\n  }\n\n  .schedule-contact-item:hover {\n    background: var(--lion-bg-secondary);\n  }\n\n  .schedule-contact-item.selected {\n    background: rgba(var(--lion-primary-rgb), 0.06);\n    border-left-color: var(--lion-primary);\n  }\n\n  .schedule-contact-checkbox {\n    width: 20px;\n    height: 20px;\n    border: 2px solid var(--lion-border-medium, #d1d5db);\n    border-radius: 5px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    flex-shrink: 0;\n    transition: all 0.15s ease;\n    background: transparent;\n  }\n\n  .schedule-contact-item:hover .schedule-contact-checkbox {\n    border-color: var(--lion-primary);\n  }\n\n  .schedule-contact-item.selected .schedule-contact-checkbox {\n    background: var(--lion-primary);\n    border-color: var(--lion-primary);\n  }\n\n  .schedule-contact-item.selected .schedule-contact-name {\n    color: var(--lion-primary);\n    font-weight: 600;\n  }\n\n  .schedule-contact-item.selected .schedule-contact-phone {\n    color: rgba(var(--lion-primary-rgb), 0.7);\n  }\n\n  .schedule-contact-avatar {\n    width: 40px;\n    height: 40px;\n    border-radius: 50%;\n    background: var(--lion-bg-secondary);\n    border: 1px solid var(--lion-border-light);\n    display: flex;\n    align-items: center;\n    justify-content: center;\n    font-size: 18px;\n    flex-shrink: 0;\n  }\n\n  .schedule-contact-info {\n    flex: 1;\n    min-width: 0;\n  }\n\n  .schedule-contact-name {\n    font-size: 14px;\n    font-weight: 500;\n    color: var(--lion-text-primary);\n    white-space: nowrap;\n    overflow: hidden;\n    text-overflow: ellipsis;\n  }\n\n  .schedule-contact-phone {\n    font-size: 12px;\n    color: var(--lion-text-muted);\n  }\n\n  .schedule-contact-modal-footer {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    padding: 16px 24px;\n    border-top: 1px solid var(--lion-border-light);\n  }\n\n  .schedule-contact-modal-footer .selected-count {\n    font-size: 13px;\n    color: var(--lion-primary);\n    font-weight: 600;\n  }\n\n  .schedule-contact-modal-footer .btn-group {\n    display: flex;\n    gap: 10px;\n  }\n\n  .schedule-contact-modal-footer button {\n    padding: 10px 18px;\n    border-radius: 10px;\n    font-size: 13px;\n    font-weight: 600;\n    cursor: pointer;\n    transition: all 0.15s ease;\n  }\n\n  .schedule-contact-modal-footer .btn-cancel {\n    background: var(--lion-bg-tertiary, #f4f4f5);\n    border: 1px solid var(--lion-border-light);\n    color: var(--lion-text-muted);\n  }\n\n  .schedule-contact-modal-footer .btn-cancel:hover {\n    background: var(--lion-border-light);\n    color: var(--lion-text-secondary);\n  }\n\n  .schedule-contact-modal-footer .btn-add {\n    background: var(--lion-primary);\n    border: none;\n    color: #ffffff;\n    box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n  }\n\n  .schedule-contact-modal-footer .btn-add:hover {\n    transform: translateY(-1px);\n    box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35);\n  }\n\n  .schedule-no-results {\n    padding: 40px 20px;\n    text-align: center;\n    color: var(--lion-text-muted);\n    font-size: 13px;\n  }\n`,Mp=[{value:"none",label:"Message Only"},{value:"image/video",label:"Message + Images/Videos"},{value:"document",label:"Message + Documents"},{value:"audio",label:"Message + Audio"},{value:"contact",label:"Message + Contacts"},{value:"poll",label:"Message + Poll"},{value:"list",label:"Message + List"},{value:"product",label:"Message + Products"},{value:"fluxo",label:"Trigger Fluxo (Chatbot)"}],Ip=["@firstname","@lastname","@contactname","@whatsappname","@variable1"],Rp=[{value:"minute",label:"Minute"},{value:"hour",label:"Hour"},{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"yearly",label:"Yearly"}],Bp=({tooltip:e})=>a.createElement("span",{className:"schedule-info-icon"},"i",a.createElement("span",{className:"schedule-info-tooltip"},e)),Pp=({isOpen:e,onClose:t})=>{const[n,r]=(0,a.useState)([]),[o,i]=(0,a.useState)("list"),[l,c]=(0,a.useState)(null),[d,m]=(0,a.useState)(!0),[,p]=(0,a.useState)(0),[u,g]=(0,a.useState)("once"),[h,b]=(0,a.useState)(""),[f,v]=(0,a.useState)(""),[y,x]=(0,a.useState)("contact"),[w,k]=(0,a.useState)("none"),[E,S]=(0,a.useState)(""),[C,T]=(0,a.useState)([]),[D,N]=(0,a.useState)([]),[M,R]=(0,a.useState)(null),[B,P]=(0,a.useState)(null),[L,U]=(0,a.useState)([]),[F,z]=(0,a.useState)(""),[O,W]=(0,a.useState)(""),[q,H]=(0,a.useState)("daily"),[j,V]=(0,a.useState)(1),[G,K]=(0,a.useState)([]),[$,Y]=(0,a.useState)(!0),[X,J]=(0,a.useState)("09:00"),[Q,Z]=(0,a.useState)("18:00"),[ee,te]=(0,a.useState)("never"),[ne,ae]=(0,a.useState)(10),[re,oe]=(0,a.useState)(""),[ie,se]=(0,a.useState)(Sm),[le,ce]=(0,a.useState)([]),[de,me]=(0,a.useState)([]),[pe,ue]=(0,a.useState)(""),[ge,he]=(0,a.useState)(!1),[be,fe]=(0,a.useState)("contacts"),[ve,ye]=(0,a.useState)([]),[xe,we]=(0,a.useState)([]),[ke,Ee]=(0,a.useState)([]),[Se,Ce]=(0,a.useState)(!1),[Te,Ae]=(0,a.useState)(""),[De,_e]=(0,a.useState)(void 0),[Ne,Me]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{const e=()=>{const e=_();Me("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]),(0,a.useEffect)(()=>{const e=()=>p(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{e&&(Re(),Be(),Pe(),Ie())},[e]);const Ie=async()=>{try{const e=(await Mn.TemplatesStorage.getTemplatesAsync()||[]).filter(e=>!1!==e.isActive);Ee(e)}catch(e){Ee([])}},Re=async()=>{m(!0);try{const e=await Tp();r(e)}catch(e){}finally{m(!1)}},Be=async()=>{const[e,t]=await Promise.all([new Promise(e=>{const t=setTimeout(()=>{document.removeEventListener("waContactsResponse",n),e([])},15e3),n=a=>{const r=a;clearTimeout(t),document.removeEventListener("waContactsResponse",n),r.detail?.success?e(r.detail?.contacts||[]):e([])};document.addEventListener("waContactsResponse",n),document.dispatchEvent(new CustomEvent("getWAContacts"))}),new Promise(e=>{const t=setTimeout(()=>{document.removeEventListener("getAllGroupsResponse",n),e([])},1e4),n=a=>{const r=a;clearTimeout(t),document.removeEventListener("getAllGroupsResponse",n),e(r.detail?.groups||[])};document.addEventListener("getAllGroupsResponse",n),document.dispatchEvent(new CustomEvent("getAllGroupsRequest"))})]);ce(e),me(t)},Pe=async()=>{try{await tp.FluxoStorage.restoreFromBrowserStorage();const e=tp.FluxoStorage.getFlows(),t=tp.FluxoStorage.getCategories();ye(e),we(t)}catch(e){}},Le=e=>{if(e.messages&&e.messages.length>0){const t=e.messages[0],n=t?.attachmentType;return n&&["image/video","document","audio","contact","poll","list","product"].includes(n)?n:"none"}if(e.sendAttachment){const t=e.sendAttachmentType;if(t&&["image/video","document","audio","contact","poll","list","product"].includes(t))return t}return"none"},Ue=async e=>{let t="",n="none",a=[],r=[],o=null,i=null,s=[];if(e.messages&&e.messages.length>0){const l=e.messages[0];t=l?.message||"",n=Le(e),a=l?.attachments||[],r=l?.selectedContact||[],o=l?.pollData||null,i=l?.listData||null,s=l?.selectedProducts||[]}else t=e.message||e.content||"",n=Le(e),a=e.attachemnt||[],r=e.selectedContact||[],o=e.pollData||null,i=e.listData||null,s=e.selectedProducts||[];const l=await(async e=>{const t=[];if(!e||0===e.length)return t;for(const n of e)if(!n.file||n.base64Url&&n.base64Url.startsWith("data:"))t.push(n);else try{const e=await Mn.TemplatesStorage.getMedia(n.file);e&&e.base64?t.push({...n,base64Url:e.base64,file:e.base64}):t.push(n)}catch(e){t.push(n)}return t})(a);k(n),S(t),T(l),N(r),R(o),P(i),U(s),Ce(!1)},Fe=()=>{g("once"),b(""),v(""),x("contact"),k("none"),S(""),T([]),N([]),R(null),P(null),U([]),z(""),W(""),H("daily"),V(1),K([]),Y(!0),J("09:00"),Z("18:00"),te("never"),ae(10),oe(""),se(Sm),Ae(""),he(!1),ue(""),Ce(!1)},ze=(e,t,n)=>{K(G.map(a=>a.id===e?{...a,[t]:n}:a))},Oe=(0,a.useMemo)(()=>{if(!pe)return le;const e=pe.toLowerCase();return le.filter(t=>(t.name||"").toLowerCase().includes(e)||(t.phoneNumber||"").includes(e))},[le,pe]),We=(0,a.useMemo)(()=>{if(!pe)return de;const e=pe.toLowerCase();return de.filter(t=>(t.name||t.subject||"").toLowerCase().includes(e))},[de,pe]);return e?a.createElement(a.Fragment,null,a.createElement("style",null,Np),a.createElement("div",{className:"schedule-modal-overlay "+(Ne?"lion-dark":""),onClick:e=>e.target===e.currentTarget&&t()},a.createElement("div",{className:"schedule-modal"},a.createElement("div",{className:"schedule-modal-header"},a.createElement("div",{className:"schedule-modal-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"})),"list"===o?(0,s.t)("schedule.title")||"Scheduled Messages":l?(0,s.t)("schedule.editSchedule")||"Edit Schedule":(0,s.t)("schedule.addSchedule")||"Add Schedule"),a.createElement("button",{className:"schedule-close-btn",onClick:t},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 6L6 18M6 6l12 12"})))),a.createElement("div",{className:"schedule-modal-content"},"list"===o?a.createElement(a.Fragment,null,a.createElement("div",{className:"schedule-list-header"},a.createElement("div",{className:"schedule-list-title"},n.length," ",(0,s.t)("schedule.schedulesCount")||"Schedules"),a.createElement("button",{className:"schedule-add-btn",onClick:()=>{Fe(),c(null),i("editor")}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M12 5v14M5 12h14"})),(0,s.t)("schedule.addSchedule")||"Add Schedule")),d?a.createElement("div",{className:"schedule-empty"},a.createElement("div",{className:"schedule-empty-icon"},"⏳"),a.createElement("div",null,(0,s.t)("common.loading")||"Loading...")):0===n.length?a.createElement("div",{className:"schedule-empty"},a.createElement("svg",{className:"schedule-empty-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},a.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"})),a.createElement("div",{style:{fontSize:"16px",fontWeight:500,marginBottom:"8px"}},(0,s.t)("schedule.noSchedules")||"No Scheduled Messages"),a.createElement("div",{style:{fontSize:"14px"}},(0,s.t)("schedule.noSchedulesDesc")||"Create your first scheduled message to get started.")):a.createElement("div",{className:"schedule-list"},n.map(e=>a.createElement("div",{key:e.id,className:"schedule-card"},a.createElement("div",{className:"schedule-card-icon"},"once"===e.mode?"📅":"🔄"),a.createElement("div",{className:"schedule-card-content"},a.createElement("div",{className:"schedule-card-header"},a.createElement("span",{className:"schedule-card-name"},e.targetName),!e.isActive&&a.createElement("span",{className:"schedule-card-badge",style:{background:"var(--lion-bg-tertiary, rgba(107, 114, 128, 0.1))",color:"var(--lion-text-muted)"}},(0,s.t)("schedule.inactive")||"Inactive")),a.createElement("div",{className:"schedule-card-message"},"fluxo"===e.templateType?`Fluxo: ${ve.find(t=>t.id===e.fluxoFlowId)?.name||e.fluxoFlowId}`:`"${e.message.substring(0,50)}${e.message.length>50?"...":""}"`),a.createElement("div",{className:"schedule-card-info"},a.createElement("span",{className:"schedule-card-badge"},"once"===e.mode?a.createElement(a.Fragment,null,"📅 ",e.scheduledAt?new Date(e.scheduledAt).toLocaleString():""):a.createElement(a.Fragment,null,"🔄 ",Rp.find(t=>t.value===e.repeatedType)?.label||e.repeatedType)),a.createElement("span",{className:"schedule-card-badge"},Mp.find(t=>t.value===e.templateType)?.label||e.templateType))),a.createElement("div",{className:"schedule-card-actions"},a.createElement("button",{className:"schedule-card-btn",onClick:()=>(e=>{if(c(e),g(e.mode),b(e.targetId),v(e.targetName),x(e.targetType),k(e.templateType),S(e.message),T(e.attachments||[]),N(e.selectedContacts||[]),R(e.pollData||null),P(e.listData||null),U(e.selectedProducts||[]),e.scheduledAt){const t=new Date(e.scheduledAt);z(t.toISOString().split("T")[0]),W(t.toTimeString().substring(0,5))}H(e.repeatedType||"daily"),V(e.repeatInterval||1),K(e.timeEntries||[]),Y(!1!==e.runAnytime),J(e.runBetweenStart||"09:00"),Z(e.runBetweenEnd||"18:00"),te(e.endType||"never"),ae(e.endAfterCount||10),e.endDate&&oe(new Date(e.endDate).toISOString().split("T")[0]),se(e.postActions||Sm),Ae(e.fluxoFlowId||""),i("editor")})(e),title:(0,s.t)("common.edit")||"Edit"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"}))),a.createElement("button",{className:"schedule-card-btn duplicate",onClick:()=>(async e=>{const t={isActive:!0,targetId:e.targetId,targetName:e.targetName,targetType:e.targetType,mode:e.mode,templateType:e.templateType,message:e.message,attachments:e.attachments?[...e.attachments]:void 0,selectedContacts:e.selectedContacts?[...e.selectedContacts]:void 0,pollData:e.pollData?{...e.pollData}:void 0,listData:e.listData?{...e.listData}:void 0,selectedProducts:e.selectedProducts?[...e.selectedProducts]:void 0,fluxoFlowId:e.fluxoFlowId,postActions:e.postActions?{...e.postActions}:Sm,scheduledAt:e.scheduledAt,repeatedType:e.repeatedType,repeatInterval:e.repeatInterval,timeEntries:e.timeEntries?e.timeEntries.map(e=>({...e,id:Cp()})):void 0,runAnytime:e.runAnytime,runBetweenStart:e.runBetweenStart,runBetweenEnd:e.runBetweenEnd,endType:e.endType,endAfterCount:e.endAfterCount,endDate:e.endDate,lastExecutedAt:void 0,executionCount:0};await Ap(t),await Re()})(e),title:(0,s.t)("common.duplicate")||"Duplicate"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),a.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))),a.createElement("button",{className:"schedule-card-btn delete",onClick:()=>(async e=>{confirm((0,s.t)("schedule.confirmDelete")||"Are you sure you want to delete this schedule?")&&(await Dp(e),await Re())})(e.id),title:(0,s.t)("common.delete")||"Delete"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"3 6 5 6 21 6"}),a.createElement("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})))))))):a.createElement(a.Fragment,null,a.createElement("div",{className:"schedule-editor"},a.createElement("div",{className:"schedule-mode-tabs"},a.createElement("button",{className:"schedule-mode-tab "+("once"===u?"active":""),onClick:()=>g("once")},(0,s.t)("schedule.once")||"Once"),a.createElement("button",{className:"schedule-mode-tab "+("repeated"===u?"active":""),onClick:()=>g("repeated")},(0,s.t)("schedule.repeated")||"Repeated")),a.createElement("div",{className:"schedule-columns"},a.createElement("div",{className:"schedule-column"},a.createElement("div",{className:"schedule-field"},a.createElement("label",{className:"schedule-field-label"},(0,s.t)("schedule.scheduleFor")||"Schedule For"," ",a.createElement("span",{className:"required"},"*"),a.createElement(Bp,{tooltip:(0,s.t)("schedule.tooltip.scheduleFor")||"Select a contact or group to send the scheduled message to."})),a.createElement("div",{className:"schedule-select",onClick:()=>he(!0),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"8px"}},f?a.createElement(a.Fragment,null,a.createElement("span",null,"group"===y?"👥":"👤"),a.createElement("span",null,f)):(0,s.t)("schedule.selectTarget")||"Select Contact or Group")),ge&&a.createElement("div",{className:"schedule-contact-modal-overlay",onClick:()=>he(!1)},a.createElement("div",{className:"schedule-contact-modal",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"schedule-contact-modal-header"},a.createElement("h3",null,(0,s.t)("schedule.selectTarget")||"Select Contact or Group"),a.createElement("button",{className:"schedule-contact-modal-close",onClick:()=>he(!1)},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})))),a.createElement("div",{className:"schedule-contact-modal-search"},a.createElement("input",{type:"text",placeholder:(0,s.t)("schedule.searchContacts")||"Search contacts by name or phone...",value:pe,onChange:e=>ue(e.target.value),autoFocus:!0})),a.createElement("div",{className:"schedule-contact-modal-tabs"},a.createElement("button",{className:"schedule-contact-modal-tab "+("contacts"===be?"active":""),onClick:()=>fe("contacts")},"Contacts ",a.createElement("span",{className:"count"},Oe.length)),a.createElement("button",{className:"schedule-contact-modal-tab "+("groups"===be?"active":""),onClick:()=>fe("groups")},"Groups ",a.createElement("span",{className:"count"},We.length))),a.createElement("div",{className:"schedule-contact-modal-list"},"contacts"===be?Oe.length>0?Oe.map(e=>a.createElement("div",{key:e.id,className:"schedule-contact-item "+(h===e.id?"selected":""),onClick:()=>{(e=>{b(e.id),v(e.name||e.phoneNumber),x("contact"),he(!1)})(e),he(!1)}},a.createElement("div",{className:"schedule-contact-checkbox"},h===e.id&&a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"#ffffff",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),a.createElement("div",{className:"schedule-contact-avatar"},"👤"),a.createElement("div",{className:"schedule-contact-info"},a.createElement("div",{className:"schedule-contact-name"},e.name||e.phoneNumber),a.createElement("div",{className:"schedule-contact-phone"},e.phoneNumber)))):a.createElement("div",{className:"schedule-no-results"},pe?"No contacts found":"Loading contacts..."):We.length>0?We.map(e=>a.createElement("div",{key:e.id,className:"schedule-contact-item "+(h===e.id?"selected":""),onClick:()=>{(e=>{b(e.id),v(e.name),x("group"),he(!1)})(e),he(!1)}},a.createElement("div",{className:"schedule-contact-checkbox"},h===e.id&&a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"#ffffff",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),a.createElement("div",{className:"schedule-contact-avatar"},"👥"),a.createElement("div",{className:"schedule-contact-info"},a.createElement("div",{className:"schedule-contact-name"},e.name),a.createElement("div",{className:"schedule-contact-phone"},e.participantCount||0," members")))):a.createElement("div",{className:"schedule-no-results"},pe?"No groups found":"Loading groups...")),a.createElement("div",{className:"schedule-contact-modal-footer"},a.createElement("div",{className:"selected-count"},f?`Selected: ${f}`:"No selection"),a.createElement("div",{className:"btn-group"},a.createElement("button",{className:"btn-cancel",onClick:()=>he(!1)},"Cancel"))))),a.createElement("div",{className:"schedule-field"},a.createElement("label",{className:"schedule-field-label"},(0,s.t)("followUp.templatesType")||"Templates Type",a.createElement(Bp,{tooltip:(0,s.t)("schedule.tooltip.templateType")||"Choose the type of message: text only, with media, poll, list, or trigger a Fluxo chatbot flow."})),a.createElement("select",{className:"schedule-select",value:w,onChange:e=>k(e.target.value)},Mp.map(e=>a.createElement("option",{key:e.value,value:e.value},(0,s.t)(`templates.attachmentType.${"none"===e.value?"none":e.value.replace("/","")}`)||e.label)))),"fluxo"===w&&a.createElement(a.Fragment,null,a.createElement("div",{className:"schedule-field"},a.createElement("label",{className:"schedule-field-label"},(0,s.t)("followUp.fluxoCategory")||"Category"),a.createElement("select",{className:"schedule-select",value:De||"all",onChange:e=>{_e("all"===e.target.value?void 0:e.target.value),Ae("")}},a.createElement("option",{value:"all"},(0,s.t)("followUp.allCategories")||"All Categories"),xe.map(e=>a.createElement("option",{key:e.id,value:e.id},e.icon," ",e.name)),a.createElement("option",{value:"uncategorized"},(0,s.t)("followUp.uncategorized")||"Uncategorized"))),a.createElement("div",{className:"schedule-field"},a.createElement("label",{className:"schedule-field-label"},(0,s.t)("followUp.selectFluxo")||"Select Fluxo"," ",a.createElement("span",{className:"required"},"*")),a.createElement("select",{className:"schedule-select",value:Te,onChange:e=>Ae(e.target.value)},a.createElement("option",{value:""},(0,s.t)("followUp.chooseFluxo")||"-- Choose a Fluxo --"),ve.filter(e=>!De||"all"===De||("uncategorized"===De?!e.categoryId:e.categoryId===De)).map(e=>a.createElement("option",{key:e.id,value:e.id},e.name," ",e.isActive?"✓":"(inactive)")))),a.createElement("p",{style:{fontSize:"12px",color:"var(--lion-text-muted)",marginTop:"8px"}},(0,s.t)("followUp.fluxoInfo")||"The selected chatbot flow will be triggered when this schedule executes.")),"fluxo"!==w&&a.createElement("div",{className:"schedule-field"},a.createElement("label",{className:"schedule-field-label",style:{display:"flex",alignItems:"center",gap:"8px"}},a.createElement("span",null,(0,s.t)("followUp.messageText")||"Message Text"," ",a.createElement("span",{className:"required"},"*")),a.createElement(Bp,{tooltip:(0,s.t)("schedule.tooltip.message")||"Type your message. Use variables like {{name}} or {{phone}} for personalization."}),a.createElement("button",{type:"button",className:"schedule-select-template-btn",onClick:()=>Ce(!Se),style:{marginLeft:"auto"}},"📄 ",(0,s.t)("broadcast.selectTemplates")||"Select Template")),Se&&a.createElement("div",{className:"schedule-template-selector"},0===ke.length?a.createElement("div",{className:"schedule-no-templates"},(0,s.t)("broadcast.noTemplates")||"No templates available"):ke.map(e=>{const t=e.messages&&e.messages.length>0,n=t?e.messages[0]:null,r=t?n?.message||"":e.message||e.content||"",o=t?n?.attachmentType||"none":e.sendAttachment&&e.sendAttachmentType||"none",i=t?e.messages.length:1;return a.createElement("div",{key:e.id,className:"schedule-template-option",onClick:()=>Ue(e)},a.createElement("div",{className:"schedule-template-option-header"},a.createElement("span",{className:"schedule-template-name"},e.templeteName||e.name,i>1&&a.createElement("span",{style:{marginLeft:"6px",fontSize:"11px",color:"var(--lion-primary)"}},"(",i,")")),a.createElement("span",{className:"schedule-template-type-badge"},"image/video"===o?"🖼️":"document"===o?"📄":"audio"===o?"🎵":"contact"===o?"👤":"poll"===o?"📊":"list"===o?"📋":"product"===o?"🛍️":"📝")),a.createElement("span",{className:"schedule-template-preview"},(r||"").substring(0,60),(r||"").length>60?"...":""))})),a.createElement("textarea",{id:"schedule-message-textarea",className:"schedule-textarea",value:E,onChange:e=>S(e.target.value),placeholder:(0,s.t)("followUp.messagePlaceholder")||"Type your message here..."}),a.createElement("div",{className:"schedule-variables-row"},a.createElement("span",{className:"schedule-variables-label"},(0,s.t)("followUp.clickToInsert")||"Click to insert variable:"),Ip.map(e=>a.createElement("span",{key:e,className:"schedule-variable-chip",onClick:()=>(e=>{const t=document.getElementById("schedule-message-textarea");if(!t)return void S(E+" "+e);const n=t.selectionStart||E.length,a=E.substring(0,n),r=E.substring(n);S(a+e+" "+r),setTimeout(()=>{t.focus(),t.setSelectionRange(n+e.length+1,n+e.length+1)},0)})(e)},e)))),"none"===w||"fluxo"===w?null:a.createElement("div",{className:"schedule-attachment-section"},("image/video"===w||"document"===w||"audio"===w)&&a.createElement(Ln,{attachments:C,attachmentType:w,onChange:T}),"contact"===w&&a.createElement(On,{selectedContacts:D,onChange:N}),"poll"===w&&a.createElement(Un,{pollData:M,onChange:R}),"list"===w&&a.createElement(Fn,{listData:B,onChange:P}),"product"===w&&a.createElement(Wn,{selectedProducts:L,onChange:U}))),a.createElement("div",{className:"schedule-column"},a.createElement("div",{className:"schedule-field"},a.createElement("label",{className:"schedule-field-label"},(0,s.t)("schedule.scheduleDateTime")||"Schedule Date & Time"," ",a.createElement("span",{className:"required"},"*"),a.createElement(Bp,{tooltip:(0,s.t)("schedule.tooltip.dateTime")||"Set when the message should be sent. For repeated schedules, this is the starting date/time."})),a.createElement("div",{style:{display:"flex",gap:"8px"}},a.createElement("input",{type:"date",className:"schedule-input",value:F,onChange:e=>z(e.target.value),style:{flex:1}}),a.createElement("input",{type:"time",className:"schedule-input",value:O,onChange:e=>W(e.target.value),style:{flex:1}}))),"repeated"===u&&a.createElement(a.Fragment,null,a.createElement("div",{className:"schedule-field"},a.createElement("label",{className:"schedule-field-label"},(0,s.t)("schedule.repeatedType")||"Repeated Type",a.createElement(Bp,{tooltip:(0,s.t)("schedule.tooltip.repeatedType")||"Choose how often to repeat: every X minutes/hours, daily, weekly, monthly, or yearly."})),a.createElement("select",{className:"schedule-select",value:q,onChange:e=>{H(e.target.value),K([])}},Rp.map(e=>a.createElement("option",{key:e.value,value:e.value},(0,s.t)(`schedule.repeatedType_${e.value}`)||e.label)))),("minute"===q||"hour"===q)&&a.createElement("div",{className:"schedule-field"},a.createElement("label",{className:"schedule-field-label"},"minute"===q?(0,s.t)("schedule.everyMinutes")||"Every X Minutes":(0,s.t)("schedule.everyHours")||"Every X Hours"),a.createElement("input",{type:"number",className:"schedule-input",value:j,onChange:e=>V(parseInt(e.target.value)||1),min:"1"})),("daily"===q||"weekly"===q||"monthly"===q||"yearly"===q)&&a.createElement("div",{className:"schedule-field"},a.createElement("label",{className:"schedule-field-label"},(0,s.t)("schedule.scheduleTime")||"Schedule Times",a.createElement(Bp,{tooltip:(0,s.t)("schedule.tooltip.scheduleTimes")||"Add multiple times when the message should be sent. Click + to add more time slots."})),a.createElement("div",{className:"schedule-time-entries"},G.map(e=>a.createElement("div",{key:e.id,className:"schedule-time-entry"},"weekly"===q&&a.createElement("select",{className:"schedule-select",value:e.day||1,onChange:t=>ze(e.id,"day",parseInt(t.target.value))},kp.map(e=>a.createElement("option",{key:e.value,value:e.value},(0,s.t)(`schedule.weekday_${e.key}`)||e.label))),"monthly"===q&&a.createElement("select",{className:"schedule-select",value:e.date||1,onChange:t=>ze(e.id,"date",parseInt(t.target.value))},Array.from({length:31},(e,t)=>t+1).map(e=>a.createElement("option",{key:e,value:e},e))),"yearly"===q&&a.createElement(a.Fragment,null,a.createElement("select",{className:"schedule-select",value:e.month||1,onChange:t=>ze(e.id,"month",parseInt(t.target.value))},Ep.map(e=>a.createElement("option",{key:e.value,value:e.value},(0,s.t)(`schedule.month_${e.key}`)||e.label))),a.createElement("select",{className:"schedule-select",value:e.date||1,onChange:t=>ze(e.id,"date",parseInt(t.target.value))},Array.from({length:31},(e,t)=>t+1).map(e=>a.createElement("option",{key:e,value:e},e)))),a.createElement("input",{type:"time",className:"schedule-input",value:e.time,onChange:t=>ze(e.id,"time",t.target.value)}),a.createElement("button",{className:"schedule-remove-btn",onClick:()=>{return t=e.id,void K(G.filter(e=>e.id!==t));var t}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 6L6 18M6 6l12 12"})))))),a.createElement("button",{className:"schedule-add-time-btn",onClick:()=>{const e={id:Cp(),time:"12:00"};"weekly"===q?e.day=1:"monthly"===q?e.date=1:"yearly"===q&&(e.month=1,e.date=1),K([...G,e])}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M12 5v14M5 12h14"})),(0,s.t)("schedule.addTime")||"Add Time")),a.createElement("div",{className:"schedule-field"},a.createElement("label",{className:"schedule-field-label"},(0,s.t)("schedule.startAndEndTime")||"Start and end time",a.createElement(Bp,{tooltip:(0,s.t)("schedule.tooltip.runBetween")||"Restrict messages to specific hours. e.g., only send between 9 AM - 6 PM."})),a.createElement("div",{className:"schedule-radio-group"},a.createElement("div",{className:"schedule-radio "+($?"active":""),onClick:()=>Y(!0)},a.createElement("div",{className:"schedule-radio-dot"}),a.createElement("span",{className:"schedule-radio-label"},(0,s.t)("schedule.runAnytime")||"Run anytime")),a.createElement("div",{className:"schedule-radio "+($?"":"active"),onClick:()=>Y(!1)},a.createElement("div",{className:"schedule-radio-dot"}),a.createElement("span",{className:"schedule-radio-label"},(0,s.t)("schedule.runBetween")||"Run between time period"))),!$&&a.createElement("div",{style:{display:"flex",gap:"8px",marginTop:"8px"}},a.createElement("input",{type:"time",className:"schedule-input",value:X,onChange:e=>J(e.target.value)}),a.createElement("span",{style:{alignSelf:"center",color:"var(--lion-text-muted)"}},"to"),a.createElement("input",{type:"time",className:"schedule-input",value:Q,onChange:e=>Z(e.target.value)}))),a.createElement("div",{className:"schedule-field"},a.createElement("label",{className:"schedule-field-label"},(0,s.t)("schedule.endSchedule")||"End Schedule Repeating on",a.createElement(Bp,{tooltip:(0,s.t)("schedule.tooltip.endSchedule")||"Choose when to stop repeating: Never, after X times, or on a specific date."})),a.createElement("div",{className:"schedule-radio-group"},a.createElement("div",{className:"schedule-radio "+("never"===ee?"active":""),onClick:()=>te("never")},a.createElement("div",{className:"schedule-radio-dot"}),a.createElement("span",{className:"schedule-radio-label"},(0,s.t)("schedule.never")||"Never")),a.createElement("div",{className:"schedule-radio "+("count"===ee?"active":""),onClick:()=>te("count")},a.createElement("div",{className:"schedule-radio-dot"}),a.createElement("span",{className:"schedule-radio-label"},(0,s.t)("schedule.afterCount")||"Number of times repeating")),"count"===ee&&a.createElement("input",{type:"number",className:"schedule-input",value:ne,onChange:e=>ae(parseInt(e.target.value)||1),min:"1",style:{marginLeft:"26px",width:"100px"}}),a.createElement("div",{className:"schedule-radio "+("date"===ee?"active":""),onClick:()=>te("date")},a.createElement("div",{className:"schedule-radio-dot"}),a.createElement("span",{className:"schedule-radio-label"},(0,s.t)("schedule.completeOnDate")||"Complete On Date")),"date"===ee&&a.createElement("input",{type:"date",className:"schedule-input",value:re,onChange:e=>oe(e.target.value),style:{marginLeft:"26px"}}))))))),a.createElement(mp,{postActions:ie,onChange:se}),a.createElement("div",{className:"schedule-footer"},a.createElement("button",{className:"schedule-btn schedule-btn-secondary",onClick:()=>{i("list"),Fe()}},(0,s.t)("common.cancel")||"Cancel"),a.createElement("button",{className:"schedule-btn schedule-btn-primary",onClick:async()=>{if(!h)return void alert((0,s.t)("schedule.selectTarget")||"Please select a contact or group");const e=("image/video"===w||"document"===w||"audio"===w)&&C&&C.length>0;if(!E&&"fluxo"!==w&&!e)return void alert((0,s.t)("schedule.enterMessage")||"Please enter a message or attach media");if(!F||!O)return void alert((0,s.t)("schedule.selectDateTime")||"Please select date and time");const t={id:l?.id,isActive:!0,targetId:h,targetName:f,targetType:y,mode:u,templateType:w,message:E,attachments:"image/video"===w||"document"===w||"audio"===w?C:void 0,selectedContacts:"contact"===w?D:void 0,pollData:"poll"===w?M:void 0,listData:"list"===w?B:void 0,selectedProducts:"product"===w?L:void 0,fluxoFlowId:"fluxo"===w?Te:void 0,postActions:ie,lastExecutedAt:void 0,executionCount:l?0:void 0},n=`${F}T${O}`;t.scheduledAt=new Date(n).getTime(),"repeated"===u&&(t.repeatedType=q,t.repeatInterval=j,t.timeEntries=G,t.runAnytime=$,t.runBetweenStart=X,t.runBetweenEnd=Q,t.endType=ee,t.endAfterCount=ne,re&&(t.endDate=new Date(re).getTime())),await Ap(t),await Re(),i("list"),Fe()}},(0,s.t)("common.save")||"Save"))))))):null},Lp={tabs:{icon:"tabs",titleKey:"tabs.manageTabs",fallback:"Tabs",visibilityKey:"tabs"},template:{icon:"template",titleKey:"templates.manageTemplates",fallback:"Templates",visibilityKey:"templates"},quickReply:{icon:"quick-reply",titleKey:"quickReply.title",fallback:"Quick Reply",visibilityKey:"quickReply"},broadcast:{icon:"broadcast",titleKey:"broadcastTitle",fallback:"Broadcast",visibilityKey:"broadcast"},schedule:{icon:"schedule",titleKey:"schedule.title",fallback:"Schedule",visibilityKey:"schedule"},followUp:{icon:"follow-up",titleKey:"followUp.title",fallback:"Follow Up",visibilityKey:"followUp"},kanban:{icon:"kanban",titleKey:"kanbanTitle",fallback:"Kanban",visibilityKey:"kanban"},calendar:{icon:"calendar",titleKey:"calendar.title",fallback:"Calendar",visibilityKey:"calendar"},status:{icon:"status",titleKey:"status.title",fallback:"Status",visibilityKey:"status"},aiBot:{icon:"ai-bot",titleKey:"aiBot.title",fallback:"AI Bot",visibilityKey:"aiBot"},chatbotFlow:{icon:"chatbot-flow",titleKey:"crm.chatbotFlow",fallback:"Chatbot",visibilityKey:"chatbotFlow"},webhook:{icon:"webhook",titleKey:"webhook.title",fallback:"Webhook",visibilityKey:"webhook"},api:{icon:"api",titleKey:"api.configureAPI",fallback:"API",visibilityKey:"api"},validator:{icon:"validator",titleKey:"bulkValidator.title",fallback:"Validator",visibilityKey:"validator"},gmapsExtractor:{icon:"gmaps-extractor",titleKey:"gmaps.featureTitle",fallback:"G Map Extractor",visibilityKey:"gmapsExtractor"}},Up=["ai-bot","chatbot-flow","follow-up","schedule","gmaps-extractor"],Fp=e=>{const t=Up.includes(e)?"svg":"png";return n().runtime.getURL(`icons/features/${e}.${t}`)},zp=({isAnyModalOpen:e,activeFeatureId:t,openFeatureIds:n,featureVisibility:r,pinnedFeatures:o,aiEnabled:i,aiBotEnabled:s,aiBotActive:l,t:c,onSwitchFeature:d})=>{const[m,p]=(0,a.useState)("undefined"==typeof window||window.innerWidth>=900);if((0,a.useEffect)(()=>{const e=()=>p(window.innerWidth>=900);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!e||!m||!r.featureDock)return null;const u=o.map(e=>({id:e,meta:Lp[e]})).filter(e=>!!e.meta).filter(e=>r[e.meta.visibilityKey]).filter(e=>"aiBot"!==e.id||i);if(0===u.length)return null;const g=new Set(n);return a.createElement(a.Fragment,null,a.createElement("style",null,"\n        @keyframes featureDockSlideIn {\n          from { opacity: 0; transform: translate(-20px, -50%); }\n          to   { opacity: 1; transform: translate(0, -50%); }\n        }\n        .feature-dock-btn {\n          position: relative;\n          width: 44px;\n          height: 44px;\n          border-radius: 12px;\n          border: 1px solid transparent;\n          background-color: transparent;\n          padding: 0;\n          cursor: pointer;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.15s ease;\n        }\n        .feature-dock-btn:hover {\n          background-color: rgba(var(--lion-primary-rgb), 0.1);\n          border-color: rgba(var(--lion-primary-rgb), 0.3);\n        }\n        .feature-dock-btn.open {\n          background-color: rgba(var(--lion-primary-rgb), 0.08);\n          border-color: rgba(var(--lion-primary-rgb), 0.2);\n        }\n        .feature-dock-btn.active {\n          background-color: rgba(var(--lion-primary-rgb), 0.16);\n          border-color: var(--lion-primary);\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.25);\n        }\n        .feature-dock-btn .feature-dock-icon {\n          width: 24px;\n          height: 24px;\n          display: block;\n          flex-shrink: 0;\n          pointer-events: none;\n          background-color: #52525b;\n          -webkit-mask-position: center;\n          mask-position: center;\n          -webkit-mask-repeat: no-repeat;\n          mask-repeat: no-repeat;\n          -webkit-mask-size: contain;\n          mask-size: contain;\n          transition: background-color 0.15s ease, transform 0.15s ease;\n        }\n        .feature-dock-btn:hover .feature-dock-icon,\n        .feature-dock-btn.active .feature-dock-icon {\n          background-color: var(--lion-primary);\n        }\n        .feature-dock-btn:hover .feature-dock-icon {\n          transform: scale(1.08);\n        }\n        .feature-dock-open-dot {\n          position: absolute;\n          bottom: 4px;\n          right: 4px;\n          width: 6px;\n          height: 6px;\n          border-radius: 50%;\n          background: var(--lion-primary);\n          border: 1.5px solid #ffffff;\n          pointer-events: none;\n        }\n        .feature-dock-badge {\n          position: absolute;\n          top: 4px;\n          right: 4px;\n          width: 8px;\n          height: 8px;\n          border-radius: 50%;\n          border: 1.5px solid #ffffff;\n          pointer-events: none;\n        }\n        .feature-dock-tooltip {\n          position: absolute;\n          left: calc(100% + 10px);\n          top: 50%;\n          transform: translateY(-50%);\n          background: #1f2937;\n          color: #ffffff;\n          padding: 5px 10px;\n          border-radius: 8px;\n          font-size: 12px;\n          font-weight: 600;\n          white-space: nowrap;\n          opacity: 0;\n          pointer-events: none;\n          transition: opacity 0.15s ease;\n          box-shadow: 0 4px 12px rgba(0,0,0,0.2);\n          z-index: 1;\n        }\n        .feature-dock-tooltip::before {\n          content: '';\n          position: absolute;\n          left: -4px;\n          top: 50%;\n          transform: translateY(-50%);\n          width: 0;\n          height: 0;\n          border-top: 5px solid transparent;\n          border-bottom: 5px solid transparent;\n          border-right: 5px solid #1f2937;\n        }\n        .feature-dock-btn:hover .feature-dock-tooltip {\n          opacity: 1;\n        }\n        /* Dark mode overrides for the toolbar shell */\n        .lion-dark .feature-dock-toolbar {\n          background: rgba(26, 26, 26, 0.98) !important;\n          border-color: rgba(255, 255, 255, 0.08) !important;\n        }\n        .lion-dark .feature-dock-tooltip {\n          background: #ffffff;\n          color: #1f2937;\n        }\n        .lion-dark .feature-dock-tooltip::before {\n          border-right-color: #ffffff;\n        }\n      "),a.createElement("div",{className:"feature-dock-toolbar",role:"toolbar","aria-label":"Feature switcher",style:{position:"fixed",left:"12px",top:"50%",transform:"translateY(-50%)",zIndex:2147483647,display:"flex",flexDirection:"column",gap:"6px",padding:"8px",background:"rgba(255, 255, 255, 0.98)",border:"1px solid rgba(0, 0, 0, 0.08)",borderRadius:"16px",boxShadow:"0 10px 30px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",animation:"featureDockSlideIn 0.22s ease"}},u.map(({id:e,meta:n})=>{const r=t===e,o=g.has(e),i=c(n.titleKey,n.fallback)||n.fallback,m="aiBot"===e&&s,p="feature-dock-btn"+(r?" active":o?" open":"");return a.createElement("button",{key:e,type:"button",className:p,onClick:()=>(e=>{d(e)})(e),"aria-label":i,"aria-pressed":r},a.createElement("span",{className:"feature-dock-icon",style:{WebkitMaskImage:`url(${Fp(n.icon)})`,maskImage:`url(${Fp(n.icon)})`}}),o&&!r&&a.createElement("span",{className:"feature-dock-open-dot"}),m&&a.createElement("span",{className:"feature-dock-badge",style:{background:l?"var(--lion-success)":"var(--lion-primary)"}}),a.createElement("span",{className:"feature-dock-tooltip"},i))})))},Op="wa_pinned_features",Wp=["broadcast","kanban","template","chatbotFlow"],qp=["tabs","template","quickReply","broadcast","schedule","followUp","kanban","calendar","status","aiBot","chatbotFlow","webhook","api","validator","gmapsExtractor"];function Hp(){try{const e=localStorage.getItem(Op);if(!e)return Wp;const t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>"string"==typeof e&&qp.includes(e)):Wp}catch{return Wp}}function jp(e){try{const t=e.filter(e=>qp.includes(e)).slice(0,14);localStorage.setItem(Op,JSON.stringify(t)),window.dispatchEvent(new CustomEvent("wa-pinned-features-changed",{detail:t}))}catch(e){}}function Vp(e){jp(Hp().filter(t=>t!==e))}const Gp="#7C3AED",Kp="#3b82f6",$p="#7C3AED",Yp="#10b981",Xp="#ec4899",Jp="#06b6d4",Qp="#ef4444",Zp="#7C3AED",eu="#14b8a6",tu="#0ea5e9",nu="#f43f5e",au="#7C3AED",ru="#059669",ou="#0ea5e9",iu={communication:{titleKey:"tools.category.communication",fallback:"Communication"},management:{titleKey:"tools.category.management",fallback:"Management"},automation:{titleKey:"tools.category.automation",fallback:"Automation"},validation:{titleKey:"tools.category.validation",fallback:"Validation"}},su=({anchorRect:e,featureVisibility:t,aiEnabled:n,aiBotEnabled:r,aiBotActive:o,t:s,pinnedFeatures:l,onPinChange:c,onClose:d,onFeatureSettingsClick:m,onTabsClick:p,onTemplateClick:u,onQuickReplyClick:g,onKanbanClick:h,onChatbotFlowClick:b,onFollowUpClick:f,onBroadcastClick:v,onScheduleClick:y,onCalendarClick:x,onStatusClick:w,onValidatorClick:k,onWebhookClick:E,onApiConfigClick:S,onAIBotClick:C,onGmapsExtractorClick:T})=>{const A=(0,a.useRef)(null),[D,_]=a.useState(!1);(0,a.useEffect)(()=>{const e=e=>{"Escape"===e.key&&d()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[d]),(0,a.useEffect)(()=>{const e=e=>{if(A.current&&A.current.contains(e.target))return;e.target.closest(".wa-tools-launcher-btn")||d()},t=setTimeout(()=>{document.addEventListener("mousedown",e)},150);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[d]);const N=[{id:"broadcast",visibilityKey:"broadcast",titleKey:"broadcastTitle",fallbackTitle:"Broadcast",onClick:v,category:"communication",color:Gp,iconFile:"broadcast"},{id:"template",visibilityKey:"templates",titleKey:"templates.manageTemplates",fallbackTitle:"Templates",onClick:u,category:"communication",color:Kp,iconFile:"template"},{id:"quickReply",visibilityKey:"quickReply",titleKey:"quickReply.title",fallbackTitle:"Quick Reply",onClick:g,category:"communication",color:Jp,iconFile:"quick-reply"},{id:"schedule",visibilityKey:"schedule",titleKey:"schedule.title",fallbackTitle:"Schedule",onClick:y,category:"communication",color:$p,iconFile:"schedule"},{id:"followUp",visibilityKey:"followUp",titleKey:"followUp.title",fallbackTitle:"Follow Up",onClick:f,category:"communication",color:Xp,iconFile:"follow-up"},{id:"kanban",visibilityKey:"kanban",titleKey:"kanbanTitle",fallbackTitle:"Kanban",onClick:h,category:"management",color:Yp,iconFile:"kanban"},{id:"calendar",visibilityKey:"calendar",titleKey:"calendar.title",fallbackTitle:"Calendar",onClick:x,category:"management",color:Qp,iconFile:"calendar"},{id:"tabs",visibilityKey:"tabs",titleKey:"tabs.manageTabs",fallbackTitle:"Manage Tabs",onClick:p,category:"management",color:Zp,iconFile:"tabs"},{id:"status",visibilityKey:"status",titleKey:"status.title",fallbackTitle:"Status",onClick:w,category:"management",color:eu,iconFile:"status"},{id:"chatbotFlow",visibilityKey:"chatbotFlow",titleKey:"crm.chatbotFlow",fallbackTitle:"Chatbot Flow",onClick:b,category:"automation",color:au,iconFile:"chatbot-flow"},{id:"webhook",visibilityKey:"webhook",titleKey:"webhook.title",fallbackTitle:"Webhook",onClick:E,category:"automation",color:nu,iconFile:"webhook"},{id:"api",visibilityKey:"api",titleKey:"api.configureAPI",fallbackTitle:"API Config",onClick:S,category:"automation",color:ou,iconFile:"api"},{id:"validator",visibilityKey:"validator",titleKey:"bulkValidator.title",fallbackTitle:"Bulk Validator",onClick:k,category:"validation",color:ru,iconFile:"validator"},{id:"gmapsExtractor",visibilityKey:"gmapsExtractor",titleKey:"gmaps.featureTitle",fallbackTitle:"Maps Extractor",onClick:T,category:"management",color:Qp,iconFile:"gmaps-extractor"}];n&&N.push({id:"aiBot",visibilityKey:"aiBot",titleKey:"aiBot.title",fallbackTitle:"AI Bot",onClick:C,category:"automation",color:tu,iconFile:"ai-bot",badge:r?a.createElement("span",{className:"wa-tools-item-badge",style:{background:o?"var(--lion-success)":"var(--lion-primary)"},title:o?"AI Bot Active":"AI Bot Outside Hours"}):void 0});const M=N.filter(e=>t[e.visibilityKey]),I={communication:[],management:[],automation:[],validation:[]};M.forEach(e=>I[e.category].push(e));const R={position:"fixed",top:e?`${e.bottom+8}px`:"100px",left:e?`${Math.max(16,e.right-400)}px`:"auto",right:e?"auto":"20px",margin:0,zIndex:2147483647,pointerEvents:"auto",width:"400px",maxHeight:"600px",background:"var(--lion-bg-primary, #ffffff)",border:"1px solid var(--lion-border-light, #e5e7eb)",borderRadius:"16px",boxShadow:"0 24px 60px rgba(0, 0, 0, 0.18), 0 10px 20px rgba(0, 0, 0, 0.08)",overflow:"hidden",display:"flex",flexDirection:"column"},B=a.createElement(a.Fragment,null,a.createElement("div",{className:"wa-tools-panel",ref:A,style:{...R,outline:D?"2px dashed var(--lion-primary, #7C3AED)":"none",outlineOffset:"-2px"},onClick:e=>e.stopPropagation(),onDragOver:e=>{e.dataTransfer.types.includes("feature-id")&&(e.preventDefault(),e.dataTransfer.dropEffect="move",_(!0))},onDragLeave:e=>{const t=e.currentTarget.getBoundingClientRect();(e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom)&&_(!1)},onDrop:e=>{e.preventDefault(),_(!1);const t=e.dataTransfer.getData("feature-id");"header"===e.dataTransfer.getData("source")&&t&&(Vp(t),c())}},a.createElement("div",{style:{padding:"18px 20px 14px",borderBottom:"1px solid var(--lion-border-light, #e5e7eb)",background:"var(--lion-bg-primary, #ffffff)"}},a.createElement("h3",{style:{margin:0,fontSize:"17px",fontWeight:700,color:"var(--lion-text-primary, #1f2937)",display:"flex",alignItems:"center",gap:"10px"}},a.createElement("span",{style:{width:"30px",height:"30px",borderRadius:"8px",background:"linear-gradient(135deg, var(--lion-primary, #7C3AED) 0%, var(--lion-primary-hover, #6D28D9) 100%)",color:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 2px 8px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.35)"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z"}))),s("tools.allTools","All Tools")),a.createElement("p",{style:{margin:"6px 0 0 40px",fontSize:"12px",color:"var(--lion-text-muted, #6b7280)"}},s("tools.subtitle","Click to open • Drag to header to pin"))),a.createElement("div",{style:{flex:1,overflowY:"auto",padding:"14px 16px 10px"}},Object.entries(I).map(([e,t])=>{if(0===t.length)return null;const n=iu[e];return a.createElement("div",{key:e,style:{marginBottom:"18px"}},a.createElement("h4",{style:{margin:"0 0 10px 6px",fontSize:"10px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.8px",color:"var(--lion-text-muted, #6b7280)",display:"flex",alignItems:"center",gap:"6px"}},a.createElement("span",{style:{width:"4px",height:"4px",borderRadius:"50%",background:"var(--lion-primary, #7C3AED)"}}),s(n.titleKey,n.fallback)),a.createElement("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"8px"}},t.map(e=>{const t=l.includes(e.id);return a.createElement("button",{key:e.id,onClick:()=>(e=>{e.onClick(),d()})(e),title:s("tools.itemTooltip","{name} — click to open or drag to header to pin").replace("{name}",s(e.titleKey,e.fallbackTitle)),draggable:!0,onDragStart:t=>{t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("feature-id",e.id),t.dataTransfer.setData("source","tools"),t.currentTarget.style.opacity="0.4"},onDragEnd:e=>{e.currentTarget.style.opacity="1"},style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"14px 8px",background:t?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.08)":"var(--lion-bg-secondary, #fafafa)",border:"1px solid "+(t?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.35)":"transparent"),borderRadius:"12px",cursor:"grab",transition:"all 0.2s ease",textAlign:"center",position:"relative",fontFamily:"inherit"},onMouseEnter:e=>{t||(e.currentTarget.style.background="rgba(var(--lion-primary-rgb, 37, 99, 235), 0.05)",e.currentTarget.style.borderColor="rgba(var(--lion-primary-rgb, 37, 99, 235), 0.2)"),e.currentTarget.style.transform="translateY(-2px)"},onMouseLeave:e=>{t?(e.currentTarget.style.background="rgba(var(--lion-primary-rgb, 37, 99, 235), 0.08)",e.currentTarget.style.borderColor="rgba(var(--lion-primary-rgb, 37, 99, 235), 0.35)"):(e.currentTarget.style.background="var(--lion-bg-secondary, #fafafa)",e.currentTarget.style.borderColor="transparent"),e.currentTarget.style.transform="translateY(0)"}},a.createElement("div",{style:{width:"48px",height:"48px",borderRadius:"12px",background:`linear-gradient(135deg, ${e.color} 0%, ${e.color}dd 100%)`,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:`0 3px 10px ${e.color}40`,position:"relative"}},a.createElement("img",{src:Fp(e.iconFile),alt:e.fallbackTitle,style:{width:"26px",height:"26px",objectFit:"contain",filter:"brightness(0) saturate(100%) invert(100%)"}}),e.badge),a.createElement("span",{style:{fontSize:"11px",fontWeight:600,color:"var(--lion-text-primary, #1f2937)",lineHeight:1.3,minHeight:"28px",display:"flex",alignItems:"center",justifyContent:"center"}},s(e.titleKey,e.fallbackTitle)),t&&a.createElement("span",{title:s("tools.pinnedTooltip","Pinned in header (drag to Tools to unpin)"),style:{position:"absolute",top:"6px",right:"6px",width:"20px",height:"20px",background:"var(--lion-primary, #7C3AED)",border:"2px solid #ffffff",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",color:"#ffffff",pointerEvents:"none",boxShadow:"0 2px 6px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.45)"}},a.createElement("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M16 9V4l1 0c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1l1 0v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3z"}))))})))})),a.createElement("div",{style:{padding:"12px 16px",borderTop:"1px solid var(--lion-border-light, #e5e7eb)",background:"var(--lion-bg-secondary, #fafafa)"}},a.createElement("button",{onClick:()=>{d(),m()},style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",width:"100%",padding:"10px 14px",background:"var(--lion-bg-primary, #ffffff)",border:"1px solid var(--lion-border-light, #e5e7eb)",borderRadius:"10px",color:"var(--lion-text-secondary, #374151)",fontSize:"12px",fontWeight:600,cursor:"pointer",transition:"all 0.15s ease",fontFamily:"inherit"},onMouseEnter:e=>{e.currentTarget.style.borderColor="var(--lion-primary)",e.currentTarget.style.color="var(--lion-primary)"},onMouseLeave:e=>{e.currentTarget.style.borderColor="var(--lion-border-light, #e5e7eb)",e.currentTarget.style.color="var(--lion-text-secondary, #374151)"}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94 0 .31.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"})),s("tools.featureSettings","Feature Settings")))));return(0,i.createPortal)(B,document.body)},lu=e=>{const{activeView:t,onTabChange:n,featureVisibility:r,aiEnabled:o=!1,aiBotEnabled:i=!1,aiBotActive:s=!1,pinnedFeatures:l=[],onPinChange:c,t:m=e=>e}=e,[p,u]=(0,a.useState)([]),[g,h]=(0,a.useState)(null),[b,f]=(0,a.useState)({}),[v,y]=(0,a.useState)(0),[x,w]=(0,a.useState)(!1),[k,E]=(0,a.useState)(null),[S,C]=(0,a.useState)(!1),T=(0,a.useRef)(null),[D,N]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)}),[M,R]=(0,a.useState)(()=>"true"===localStorage.getItem("wa_tabbar_hidden"));(0,a.useEffect)(()=>{"tabs"===t&&B();const e=()=>{B()},a=e=>{const t=e,{tabId:n,activeChats:a,totalRequested:r}=t.detail||{};n&&f(e=>({...e,[n]:{active:a,total:r}}))},r=e=>{const t=e,{tabId:n}=t.detail||{};n&&n!==g&&(h(n),d.TabsStorage.setActiveTab(n))},o=()=>{y(e=>e+1),B()},i=()=>{const e=_();N("dark"===A(e.mode))},s=e=>{const t=e,{hidden:n}=t.detail||{};R(n)},l=e=>{const t=e,{tabId:a}=t.detail||{};a===g&&(h("all"),d.TabsStorage.setActiveTab("all"),n?.("all")),B()};return document.addEventListener("wa-tab-data-updated",e),document.addEventListener("wa-tab-deleted",l),window.addEventListener("wa-tab-filter-stats",a),window.addEventListener("wa-tab-changed",r),window.addEventListener("languageChanged",o),window.addEventListener(I,i),window.addEventListener("lionThemeApplied",i),window.addEventListener("wa-tabbar-visibility",s),()=>{document.removeEventListener("wa-tab-data-updated",e),document.removeEventListener("wa-tab-deleted",l),window.removeEventListener("wa-tab-filter-stats",a),window.removeEventListener("wa-tab-changed",r),window.removeEventListener("languageChanged",o),window.removeEventListener(I,i),window.removeEventListener("lionThemeApplied",i),window.removeEventListener("wa-tabbar-visibility",s)}},[t,g]);const B=()=>{const e=d.TabsStorage.getTabs().filter(e=>!e.hidden);u(e);const t=d.TabsStorage.getActiveTabId();h(t)};if("tabs"!==t||M)return null;const P=r&&e.onBroadcastClick;return a.createElement("div",{className:"tab-bar-v2 "+(D?"lion-dark":""),style:{position:"relative"}},a.createElement("div",{className:"tab-bar-v2-scroll"},(p||[]).map(e=>{const t=b[e.id],r=t&&t.total>0,o=r&&t.active<t.total;return a.createElement("button",{key:e.id,className:"tab-item-v2 "+(g===e.id?"active":""),onClick:()=>(e=>{h(e),d.TabsStorage.setActiveTab(e),n?.(e);const t=p.find(t=>t.id===e);t&&("all"===t.id||t.isPermanent)&&f({}),window.dispatchEvent(new CustomEvent("wa-tab-changed",{detail:{tabId:e}}))})(e.id)},a.createElement("span",{className:"tab-title-v2"},e.title),r?a.createElement("span",{className:"tab-count-v2 "+(o?"has-missing":"")},t.active,"/",t.total):(e.chats?.length||0)>0?a.createElement("span",{className:"tab-count-v2"},e.chats?.length||0):null)})),P&&a.createElement("div",{className:"tab-bar-v2-right",style:{position:"relative"}},a.createElement("div",{className:"tab-bar-v2-divider"}),a.createElement("button",{ref:T,className:"wa-tools-launcher-btn "+(x||S?"active":""),onClick:e=>{if(e.stopPropagation(),!x&&T.current){const e=T.current.getBoundingClientRect();E(e)}w(!x)},onDragEnter:e=>{(e.dataTransfer.types.includes("feature-id")||0===e.dataTransfer.types.length)&&(e.preventDefault(),C(!0))},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move",C(!0)},onDragLeave:e=>{const t=e.currentTarget.getBoundingClientRect();(e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom)&&C(!1)},onDrop:e=>{e.preventDefault(),e.stopPropagation(),C(!1);const t=e.dataTransfer.getData("feature-id");"header"===e.dataTransfer.getData("source")&&t&&(Vp(t),c?.())},title:S?"Drop here to unpin from header":"All Tools",style:S?{outline:"2px dashed var(--lion-primary, #7C3AED)",outlineOffset:"2px",transform:"scale(1.05)"}:void 0},a.createElement("svg",{viewBox:"0 0 24 24",fill:"currentColor"},a.createElement("path",{d:"M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z"})),a.createElement("span",null,"Tools")),x&&r&&a.createElement(su,{anchorRect:k,featureVisibility:r,aiEnabled:o,aiBotEnabled:i,aiBotActive:s,t:m,pinnedFeatures:l,onPinChange:()=>c?.(),onClose:()=>w(!1),onFeatureSettingsClick:e.onFeatureSettingsClick||(()=>{}),onTabsClick:e.onTabsClick||(()=>{}),onTemplateClick:e.onTemplateClick||(()=>{}),onQuickReplyClick:e.onQuickReplyClick||(()=>{}),onKanbanClick:e.onKanbanClick||(()=>{}),onChatbotFlowClick:e.onChatbotFlowClick||(()=>{}),onFollowUpClick:e.onFollowUpClick||(()=>{}),onBroadcastClick:e.onBroadcastClick||(()=>{}),onScheduleClick:e.onScheduleClick||(()=>{}),onCalendarClick:e.onCalendarClick||(()=>{}),onStatusClick:e.onStatusClick||(()=>{}),onValidatorClick:e.onValidatorClick||(()=>{}),onWebhookClick:e.onWebhookClick||(()=>{}),onApiConfigClick:e.onApiConfigClick||(()=>{}),onAIBotClick:e.onAIBotClick||(()=>{}),onGmapsExtractorClick:e.onGmapsExtractorClick||(()=>{})})))},cu=({activeView:e})=>{const[t,n]=(0,a.useState)(null),[r,o]=(0,a.useState)(!1);(0,a.useEffect)(()=>{const e=e=>{const t=e,{activeChats:a,totalRequested:r,missingChats:o,tabId:i}=t.detail||{};n(o>0?{activeChats:a,totalRequested:r,missingChats:o,tabId:i}:null)};return window.addEventListener("wa-tab-filter-stats",e),()=>{window.removeEventListener("wa-tab-filter-stats",e)}},[]);return"tabs"===e&&t?a.createElement("div",{className:"wa-info-banner"},a.createElement("div",{className:"banner-content"},a.createElement("span",{className:"banner-icon"},"ℹ️"),a.createElement("span",{className:"banner-text"},"Showing ",a.createElement("strong",null,t.activeChats)," of ",a.createElement("strong",null,t.totalRequested)," contacts.")),a.createElement("style",null,"\n        .wa-info-banner {\n          position: relative;\n          width: 100%;\n          background: linear-gradient(135deg, var(--lion-info-light) 0%, #bbdefb 100%);\n          border-bottom: 1px solid var(--lion-info);\n          padding: 12px 16px;\n          display: flex;\n          align-items: center;\n          animation: slideDown 0.3s ease-out;\n          z-index: 99;\n        }\n\n        @keyframes slideDown {\n          from {\n            opacity: 0;\n            transform: translateY(-10px);\n          }\n          to {\n            opacity: 1;\n            transform: translateY(0);\n          }\n        }\n\n        .banner-content {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          width: 100%;\n        }\n\n        .banner-icon {\n          font-size: 18px;\n          flex-shrink: 0;\n        }\n\n        .banner-text {\n          color: var(--lion-info);\n          font-size: 13px;\n          line-height: 1.4;\n          flex: 1;\n        }\n\n        .banner-text strong {\n          font-weight: 600;\n          color: var(--lion-info);\n        }\n\n        .banner-action-btn {\n          padding: 6px 16px;\n          background: var(--lion-info);\n          color: white;\n          border: none;\n          border-radius: 6px;\n          font-size: 13px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s ease;\n          white-space: nowrap;\n          flex-shrink: 0;\n        }\n\n        .banner-action-btn:hover:not(:disabled) {\n          background: var(--lion-info);\n          transform: translateY(-1px);\n          box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);\n        }\n\n        .banner-action-btn:active:not(:disabled) {\n          transform: translateY(0);\n        }\n\n        .banner-action-btn:disabled {\n          opacity: 0.6;\n          cursor: not-allowed;\n        }\n      ")):null};var du=r(3538);const mu="wa_blur_settings",pu={blurMessages:!1,blurProfileNames:!1,blurDisplayPhotos:!1,blurConversation:!1,displayOnHover:!1};class uu{static getSettings(){try{const e=localStorage.getItem(mu);if(!e)return{...pu};const t=JSON.parse(e);return{...pu,...t}}catch(e){return{...pu}}}static saveSettings(e){try{localStorage.setItem(mu,JSON.stringify(e))}catch(e){}}static resetSettings(){try{localStorage.removeItem(mu)}catch(e){}}static isAnyBlurEnabled(){const e=this.getSettings();return e.blurMessages||e.blurProfileNames||e.blurDisplayPhotos||e.blurConversation}}function gu(e){const t=document.getElementById("wa-blur-privacy-styles");t&&t.remove();let n="";if(e.blurMessages&&(n+="\n      /* Message preview - in ._ak8k container (default WhatsApp) */\n      ._ak8k span,\n      ._ak8k ._ao3e,\n      /* Also target by structure */\n      div._ak8j div._ak8k span,\n      /* Custom tabs/labels chat list - message preview */\n      #wa-compact-list span.last-message,\n      #wa-compact-list .chat-footer span,\n      .chat-footer .last-message,\n      span.last-message,\n      /* Current WhatsApp Web test IDs for message previews */\n      [data-testid=\"cell-frame-secondary\"],\n      [data-testid=\"cell-frame-secondary\"] * {\n        filter: blur(5px) !important;\n        transition: filter 0.2s ease;\n      }\n    "),e.blurProfileNames&&(n+='\n      /* Contact names - in ._ak8q container (default WhatsApp chat list) */\n      ._ak8q span,\n      ._ak8q ._ao3e,\n      /* Also target by structure */\n      div._ak8o div._ak8q span,\n      /* Chat header contact name (top of conversation) */\n      #main > header span._ao3e,\n      #main > header div > div > div > div > span,\n      [data-testid="conversation-info-header-chat-title"],\n      [data-testid="conversation-header"] span[title],\n      header span[dir="auto"][title],\n      /* Custom tabs/labels chat list - contact names */\n      #wa-compact-list span.chat-name,\n      #wa-compact-list .chat-header span,\n      .chat-header .chat-name,\n      span.chat-name,\n      /* Current WhatsApp Web test IDs for contact list names */\n      [data-testid="cell-frame-title"],\n      [data-testid="cell-frame-title"] *,\n      [data-testid="list-item-title"],\n      [data-testid="list-item-title"] * {\n        filter: blur(5px) !important;\n        transition: filter 0.2s ease;\n      }\n    '),e.blurDisplayPhotos&&(n+='\n      /* Blur profile pictures in chat list (default WhatsApp) */\n      [data-testid="cell-frame-container"] img[draggable="false"],\n      ._ak8h img,\n      [data-testid="default-user"] img,\n      [data-testid="chat-avatar"] img,\n      /* Header profile picture */\n      header img[draggable="false"],\n      ._amig img,\n      /* Custom tabs/labels chat list - avatars */\n      #wa-compact-list img.chat-avatar,\n      #wa-compact-list .chat-avatar-container img,\n      .chat-avatar-container img,\n      img.chat-avatar {\n        filter: blur(8px) !important;\n        transition: filter 0.2s ease;\n      }\n    '),e.blurConversation&&(n+='\n      /* Blur entire conversation panel */\n      [data-testid="conversation-panel-messages"],\n      .copyable-area[data-tab="8"],\n      ._amjy {\n        filter: blur(6px) !important;\n        transition: filter 0.3s ease;\n      }\n    ',e.displayOnHover&&(n+='\n        /* Unblur conversation on hover */\n        [data-testid="conversation-panel-messages"]:hover,\n        .copyable-area[data-tab="8"]:hover,\n        ._amjy:hover {\n          filter: none !important;\n        }\n      ')),n){const e=document.createElement("style");e.id="wa-blur-privacy-styles",e.textContent=n,document.head.appendChild(e)}}let hu=null,bu=null,fu=null,vu=null,yu=0;async function xu(){try{const e=Date.now();if(vu&&e-yu<3e4)return vu;const t=await n().runtime.sendMessage({action:"checkLicense"});if(!t)return vu=[],yu=e,[];if(!t.validationToken)return t.isValid&&t.featuresEnabled?(vu=t.featuresEnabled,yu=e,t.featuresEnabled):(vu=[],yu=e,[]);/* FLOWhatsapp v2.0: Firebase validation — token is the license key, features from background */;const r=t.featuresEnabled||["basic","tabs","templates","quickReply","kanban","chatbotFlow","followUp","broadcast","schedule","calendar","status","validator","webhook","api","aiBot","gmapsExtractor"];return vu=r,yu=e,r}catch(e){return vu=[],yu=Date.now(),[]}}async function wu(e){const t=await xu();return 0!==t.length&&e.some(e=>t.includes(e))}const ku=[{id:"tabs",icon:"tabs",iconType:"png",titleKey:"feature.tabs"},{id:"templates",icon:"template",iconType:"png",titleKey:"feature.templates"},{id:"quickReply",icon:"quick-reply",iconType:"png",titleKey:"feature.quickReply"},{id:"kanban",icon:"kanban",iconType:"png",titleKey:"feature.kanban"},{id:"chatbotFlow",icon:"chatbot-flow",iconType:"svg",titleKey:"feature.chatbotFlow"},{id:"followUp",icon:"follow-up",iconType:"svg",titleKey:"feature.followUp"},{id:"broadcast",icon:"broadcast",iconType:"png",titleKey:"feature.broadcast"},{id:"schedule",icon:"schedule",iconType:"svg",titleKey:"feature.schedule"},{id:"calendar",icon:"calendar",iconType:"png",titleKey:"feature.calendar"},{id:"status",icon:"status",iconType:"png",titleKey:"feature.status"},{id:"validator",icon:"validator",iconType:"png",titleKey:"feature.validator"},{id:"webhook",icon:"webhook",iconType:"png",titleKey:"feature.webhook"},{id:"api",icon:"api",iconType:"png",titleKey:"feature.api"},{id:"aiBot",icon:"ai-bot",iconType:"svg",titleKey:"feature.aiBot"},{id:"gmapsExtractor",icon:"gmaps-extractor",iconType:"svg",titleKey:"feature.gmapsExtractor"}],Eu={tabs:!0,templates:!0,quickReply:!0,kanban:!0,chatbotFlow:!0,followUp:!0,broadcast:!0,schedule:!0,calendar:!0,status:!0,validator:!0,webhook:!0,api:!0,aiBot:!0,gmapsExtractor:!0,featureDock:!0},Su="wa_feature_visibility";class Cu{static getSettings(){try{const e=localStorage.getItem(Su);if(e){const t=JSON.parse(e);return{...Eu,...t}}}catch(e){}return{...Eu}}static saveSettings(e){try{localStorage.setItem(Su,JSON.stringify(e)),window.dispatchEvent(new CustomEvent("featureVisibilityChanged",{detail:e}))}catch(e){}}static isVisible(e){return this.getSettings()[e]??!0}static toggle(e){const t=this.getSettings();return t[e]=!t[e],this.saveSettings(t),t[e]}static setVisibility(e,t){const n=this.getSettings();n[e]=t,this.saveSettings(n)}static resetToDefaults(){this.saveSettings({...Eu})}static getEnabledCount(){const e=this.getSettings();return Object.values(e).filter(Boolean).length}static getTotalCount(){return ku.length}}const Tu=({onClose:e,onOpenFeature:t})=>{const[r,o]=(0,a.useState)(Eu),[,i]=(0,a.useState)(0),[l,c]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{const e=Cu.getSettings();o(e);const t=()=>{i(e=>e+1)};return window.addEventListener("languageChanged",t),()=>{window.removeEventListener("languageChanged",t)}},[]),(0,a.useEffect)(()=>{const e=()=>{const e=_();c("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]);const d=e=>{const t={...r,[e]:!r[e]};o(t),Cu.saveSettings(t)};return(0,a.useEffect)(()=>{const t=t=>{"Escape"===t.key&&e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),a.createElement("div",{className:"fv-modal-overlay "+(l?"lion-dark":""),onClick:e},a.createElement("div",{className:"fv-modal",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"fv-modal-header"},a.createElement("h2",{className:"fv-modal-title"},(0,s.t)("settings.menuFeatures")),a.createElement("button",{className:"fv-close-btn",onClick:e},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),a.createElement("p",{className:"fv-modal-desc"},(0,s.t)("settings.menuFeaturesDesc")),a.createElement("div",{className:"fv-feature-list"},ku.map(e=>{return a.createElement("div",{key:e.id,className:"fv-feature-item"},a.createElement("div",{className:"fv-feature-left"},a.createElement("img",{src:(o=e.icon,i=e.iconType,n().runtime.getURL(`icons/features/${o}.${i}`)),alt:(0,s.t)(e.titleKey),className:"fv-feature-icon"}),a.createElement("span",{className:"fv-feature-name"},(0,s.t)(e.titleKey))),a.createElement("div",{className:"fv-feature-right"},t&&a.createElement("button",{className:"fv-open-btn",onClick:()=>{return n=e.id,void(t&&t(n));var n}},(0,s.t)("feature.open")),a.createElement("label",{className:"fv-toggle"},a.createElement("input",{type:"checkbox",checked:r[e.id],onChange:()=>d(e.id)}),a.createElement("span",{className:"fv-toggle-slider"}))));var o,i}),a.createElement("div",{className:"fv-section-header"},(0,s.t)("settings.interfaceOptions")),a.createElement("div",{className:"fv-feature-item"},a.createElement("div",{className:"fv-feature-left"},a.createElement("div",{className:"fv-feature-icon fv-icon-dock","aria-hidden":!0},a.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("rect",{x:"3",y:"4",width:"6",height:"16",rx:"2"}),a.createElement("rect",{x:"13",y:"4",width:"8",height:"16",rx:"2"}))),a.createElement("div",{className:"fv-feature-text"},a.createElement("span",{className:"fv-feature-name"},(0,s.t)("settings.featureDockLabel")),a.createElement("span",{className:"fv-feature-desc"},(0,s.t)("settings.featureDockDesc")))),a.createElement("div",{className:"fv-feature-right"},a.createElement("label",{className:"fv-toggle"},a.createElement("input",{type:"checkbox",checked:r.featureDock,onChange:()=>d("featureDock")}),a.createElement("span",{className:"fv-toggle-slider"}))))),a.createElement("style",null,'\n          .fv-modal-overlay {\n            position: fixed;\n            top: 0;\n            left: 0;\n            right: 0;\n            bottom: 0;\n            background: rgba(0, 0, 0, 0.5);\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            z-index: 99999;\n            backdrop-filter: blur(2px);\n          }\n\n          .fv-modal {\n            background: #ffffff;\n            border-radius: 16px;\n            width: 420px;\n            max-width: 95vw;\n            max-height: 85vh;\n            overflow: hidden;\n            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n            animation: fvSlideIn 0.2s ease-out;\n          }\n\n          @keyframes fvSlideIn {\n            from {\n              opacity: 0;\n              transform: scale(0.95) translateY(-10px);\n            }\n            to {\n              opacity: 1;\n              transform: scale(1) translateY(0);\n            }\n          }\n\n          .fv-modal-header {\n            display: flex;\n            align-items: center;\n            justify-content: space-between;\n            padding: 20px 24px 0;\n          }\n\n          .fv-modal-title {\n            font-size: 20px;\n            font-weight: 600;\n            color: #1f2937;\n            margin: 0;\n          }\n\n          .fv-close-btn {\n            background: none;\n            border: none;\n            padding: 8px;\n            cursor: pointer;\n            color: #6b7280;\n            border-radius: 8px;\n            transition: all 0.15s ease;\n          }\n\n          .fv-close-btn:hover {\n            background: #f3f4f6;\n            color: #374151;\n          }\n\n          .fv-modal-desc {\n            font-size: 14px;\n            color: #6b7280;\n            margin: 8px 24px 16px;\n          }\n\n          .fv-feature-list {\n            padding: 0 16px 16px;\n            max-height: calc(85vh - 120px);\n            overflow-y: auto;\n          }\n\n          .fv-feature-list::-webkit-scrollbar {\n            width: 6px;\n          }\n\n          .fv-feature-list::-webkit-scrollbar-track {\n            background: transparent;\n          }\n\n          .fv-feature-list::-webkit-scrollbar-thumb {\n            background: #d1d5db;\n            border-radius: 3px;\n          }\n\n          .fv-feature-item {\n            display: flex;\n            align-items: center;\n            justify-content: space-between;\n            padding: 12px 16px;\n            border-radius: 12px;\n            transition: background 0.15s ease;\n          }\n\n          .fv-feature-item:hover {\n            background: #f9fafb;\n          }\n\n          .fv-feature-left {\n            display: flex;\n            align-items: center;\n            gap: 14px;\n          }\n\n          .fv-feature-icon {\n            width: 24px;\n            height: 24px;\n            object-fit: contain;\n            /* PNG/SVG feature icons are pure white silhouettes designed for dark UIs.\n               In light mode invert them to dark so they\'re visible on white bg. */\n            filter: brightness(0);\n          }\n\n          .fv-feature-name {\n            font-size: 15px;\n            font-weight: 500;\n            color: #1f2937;\n          }\n\n          .fv-section-header {\n            font-size: 11px;\n            font-weight: 700;\n            letter-spacing: 0.5px;\n            text-transform: uppercase;\n            color: #6b7280;\n            padding: 18px 16px 8px;\n            margin-top: 8px;\n            border-top: 1px solid #e5e7eb;\n          }\n\n          .fv-feature-text {\n            display: flex;\n            flex-direction: column;\n            gap: 2px;\n          }\n\n          .fv-feature-desc {\n            font-size: 12px;\n            color: #6b7280;\n            font-weight: 400;\n          }\n\n          .fv-icon-dock {\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            color: var(--lion-primary);\n          }\n\n          .fv-feature-right {\n            display: flex;\n            align-items: center;\n            gap: 12px;\n          }\n\n          .fv-open-btn {\n            padding: 6px 14px;\n            background: transparent;\n            border: 1.5px solid var(--lion-primary);\n            color: var(--lion-primary);\n            border-radius: 20px;\n            font-size: 13px;\n            font-weight: 500;\n            cursor: pointer;\n            transition: all 0.15s ease;\n          }\n\n          .fv-open-btn:hover {\n            background: var(--lion-primary-light);\n          }\n\n          /* Toggle Switch - Green like Cheetah CRM */\n          .fv-toggle {\n            position: relative;\n            display: inline-block;\n            width: 44px;\n            height: 24px;\n          }\n\n          .fv-toggle input {\n            opacity: 0;\n            width: 0;\n            height: 0;\n          }\n\n          .fv-toggle-slider {\n            position: absolute;\n            cursor: pointer;\n            top: 0;\n            left: 0;\n            right: 0;\n            bottom: 0;\n            background-color: #d1d5db;\n            border-radius: 24px;\n            transition: all 0.25s ease;\n          }\n\n          .fv-toggle-slider::before {\n            position: absolute;\n            content: "";\n            height: 18px;\n            width: 18px;\n            left: 3px;\n            bottom: 3px;\n            background-color: white;\n            border-radius: 50%;\n            transition: all 0.25s ease;\n            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);\n          }\n\n          .fv-toggle input:checked + .fv-toggle-slider {\n            background-color: #22c55e;\n          }\n\n          .fv-toggle input:checked + .fv-toggle-slider::before {\n            transform: translateX(20px);\n          }\n\n          .fv-toggle input:focus + .fv-toggle-slider {\n            box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);\n          }\n\n          /* Dark mode support */\n          .fv-modal-overlay.lion-dark .fv-modal {\n            background: #1a1a1a !important;\n          }\n\n          .fv-modal-overlay.lion-dark .fv-modal-title {\n            color: #ffffff !important;\n          }\n\n          .fv-modal-overlay.lion-dark .fv-modal-desc {\n            color: #a0a0a0 !important;\n          }\n\n          .fv-modal-overlay.lion-dark .fv-close-btn {\n            color: #a0a0a0 !important;\n          }\n\n          .fv-modal-overlay.lion-dark .fv-close-btn:hover {\n            background: #262626 !important;\n            color: #ffffff !important;\n          }\n\n          .fv-modal-overlay.lion-dark .fv-feature-item:hover {\n            background: #262626 !important;\n          }\n\n          .fv-modal-overlay.lion-dark .fv-feature-name {\n            color: #ffffff !important;\n          }\n\n          .fv-modal-overlay.lion-dark .fv-toggle-slider {\n            background-color: #404040 !important;\n          }\n\n          .fv-modal-overlay.lion-dark .fv-feature-list::-webkit-scrollbar-thumb {\n            background: #404040 !important;\n          }\n\n          .fv-modal-overlay.lion-dark .fv-feature-icon {\n            filter: brightness(0) invert(1);\n          }\n\n          .fv-modal-overlay.lion-dark .fv-icon-dock {\n            filter: none;\n            color: var(--lion-primary) !important;\n          }\n\n          .fv-modal-overlay.lion-dark .fv-section-header {\n            color: #a0a0a0 !important;\n            border-top-color: #2a2a2a !important;\n          }\n\n          .fv-modal-overlay.lion-dark .fv-feature-desc {\n            color: #a0a0a0 !important;\n          }\n\n          .fv-modal-overlay.lion-dark .fv-open-btn {\n            background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15) !important;\n            border-color: var(--lion-primary) !important;\n            color: #ffffff !important;\n          }\n\n          .fv-modal-overlay.lion-dark .fv-open-btn:hover {\n            background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.3) !important;\n          }\n        ')))};var Au=r(1396),Du=r.n(Au),_u=r(9066);function Nu(e){if(!e||!e.startsWith("U2FsdGVk"))try{return JSON.parse(e)}catch{return e}try{const t=Du().AES.decrypt(e,"ffce211a-7b07-4d91-ba5d-c40bb4034a83").toString(Du().enc.Utf8);return t?JSON.parse(t):null}catch(e){return null}}function Mu(e){if(!e||"object"!=typeof e)return!1;return["respostasRapidas","respostasRapidasAcao","autoatendimento","userTabs","FollowUp","fluxo","agendamentos"].some(t=>t in e)&&!("version"in e&&("features"in e||"data"in e))}function Iu(e,t){if("init"===e||"start"===e)return"start";const n=t||e;return{"send-text":"send_text","send-image":"send_image","send-video":"send_video","send-audio":"send_audio","send-document":"send_document","send-file":"send_document","send-location":"send_text","send-contact":"send_text","send-list":"send_list","send-buttons":"responses","wait-response":"responses",responses:"responses",condition:"responses",delay:"smart_wait","add-label":"label_action","remove-label":"label_action","add-tab":"tab_action","remove-tab":"tab_action","close-chat":"send_text","http-request":"send_text","set-variable":"send_text","ai-response":"send_text"}[n?.toLowerCase()]||"send_text"}function Ru(e){const t={},n=e.data||{},a=e.send?.data||n;if((a.message||n.message)&&(t.message=a.message||n.message),(a.base64||n.base64)&&(t.mediaBase64=a.base64||n.base64),(a.caption||n.caption)&&(t.mediaCaption=a.caption||n.caption),(a.fileName||n.fileName)&&(t.mediaFilename=a.fileName||n.fileName),a.waitTime||n.waitTime){const e=a.waitTime||n.waitTime;t.delay=e.value||1,"minutos"!==e.unit&&"minutes"!==e.unit||(t.delay=60*(e.value||1))}return(a.options||n.options)&&(t.options=a.options||n.options),(a.listTitle||n.listTitle)&&(t.listTitle=a.listTitle||n.listTitle),(a.listButtonText||n.listButtonText)&&(t.listButtonText=a.listButtonText||n.listButtonText),(a.sections||n.sections)&&(t.sections=a.sections||n.sections),"init"===e.type&&(t.label="Start"),t}function Bu(e){return{txt:"none",text:"none",img:"image/video",image:"image/video",audio:"audio",video:"image/video",doc:"document",document:"document"}[e?.toLowerCase()]||"none"}function Pu(e){const t=(e||"").toLowerCase();return"img"===t||"image"===t||"imagem"===t||"video"===t?"image/video":"audio"===t?"audio":"doc"===t||"document"===t?"document":"none"}function Lu(e){const t=(e||"").replace(/\D/g,"");return t.includes("@")?t:`${t}@c.us`}async function Uu(e,t){const n={success:!0,imported:{templates:0,contacts:0,tabs:0,flows:0,followups:0,schedules:0,webhooks:0,aiSettings:!1,kanbanBoards:0,kanbanStages:0,statusItems:0,reminders:0},warnings:[]};try{const a=e.crm?Nu(e.crm):null,r=e.userTabs?Nu(e.userTabs):null,o=e.fluxo?Nu(e.fluxo):null,i=e.respostasRapidas?Nu(e.respostasRapidas):null,s=e.notifications?Nu(e.notifications):null,l=Object.keys(t.crmData).length;let c=function(e,t){if(!e||!Array.isArray(e))return t;const n={...t};for(const t of e){const e=t.phone||t.id||"";if(!e)continue;const a=e.replace(/\D/g,""),r=a.includes("@")?a:`${a}@c.us`;if(n[r]){const e=n[r];!e.profile.name&&t.name&&(e.profile.name=t.name),!e.profile.email&&t.email&&(e.profile.email=t.email),t.notes&&(e.notes.map(e=>e.content).includes(t.notes)||e.notes.push({id:h("note"),topic:"Imported from Cheetah CRM",content:t.notes,createdAt:Date.now(),updatedAt:Date.now()})),e.updatedAt=Date.now()}else{const o=g(r,t.name||e,a);t.email&&(o.profile.email=t.email),t.notes&&o.notes.push({id:h("note"),topic:"Imported Notes",content:t.notes,createdAt:Date.now(),updatedAt:Date.now()});const i=["id","name","phone","email","notes"];for(const[e,n]of Object.entries(t))!i.includes(e)&&n&&"string"==typeof n&&o.profile.customFields.push({id:h("cf"),label:e,value:n,createdAt:Date.now()});n[r]=o}}return n}(a,t.crmData);n.imported.contacts=Object.keys(c).length-l;const d=function(e,t){if(!e||!Array.isArray(e))return{contacts:t,imported:0};const n={};for(const[e,a]of Object.entries(t))n[e]={...a,reminders:[...a.reminders]};let a=0;for(const t of e){if(!t.user_id)continue;const e=(t.date||"").split("-").map(Number),r=(t.time||"").split(":").map(Number);if(3!==e.length||r.length<2)continue;let o;if(o=e[0]>31?new Date(e[0],e[1]-1,e[2],r[0],r[1]).getTime():new Date(e[2],e[1]-1,e[0],r[0],r[1]).getTime(),isNaN(o))continue;const i=Lu(t.user_id);n[i]||(n[i]=g(i,t.user_id,t.user_id)),n[i].reminders.find(e=>e.topic===t.title&&Math.abs(e.datetime-o)<6e4)||(n[i].reminders.push({id:t.id||h("reminder"),topic:t.title||"Imported Reminder",details:t.desc||"",datetime:o,status:t.read?"completed":"pending",createdAt:Date.now(),notified:t.read,repeatInterval:0}),a++)}return{contacts:n,imported:a}}(s,c);c=d.contacts,n.imported.reminders=d.imported;const m=e.perfil?Nu(e.perfil):null;if(m){const e=function(e,t){if(!e)return{contacts:t,imported:0};const n={...t};let a=0;Object.keys(n);const r=Array.isArray(e)?e:[e];for(const e of r){if(!e||"object"!=typeof e)continue;const t=e.userID||e.userId||e.phone||e.id||"";if(!t)continue;const r=`${String(t).replace(/\D/g,"")}@c.us`,o=e.valNegocio||e.valorNegocio||[];if(!Array.isArray(o)||0===o.length)continue;if(!n[r])continue;const i=n[r];for(const e of o){const t=parseFloat(e.valor||e.value||0);if(t<=0)continue;let n=Date.now();if(e.data){const t=e.data.split("/").map(Number);if(3===t.length){const[e,a,r]=t;e&&a&&r&&(n=new Date(r,a-1,e).getTime())}}if(i.incomes.find(n=>n.amount===t&&n.description?.includes("Cheetah")&&n.description?.includes(e.id||"")))continue;const r=e.descricao?`${e.descricao.trim()} (Imported from Cheetah CRM - ID: ${e.id})`:`Imported from Cheetah CRM (Business Value - ID: ${e.id})`;i.incomes.push({id:h("income"),amount:t,category:"sale",paymentMethod:"other",description:r,date:n,status:"completed",createdAt:Date.now(),updatedAt:Date.now()}),a++}}return{contacts:n,imported:a}}(m,c);c=e.contacts,n.imported.incomes=e.imported}const p=function(e){if(!e||!Array.isArray(e))return[];const t=new Map;for(const n of e){const e=n.funil?.abas||[];for(const n of e)if(n.id&&n.tag&&!t.has(n.id)){const e={id:n.id,tag:n.tag,type:n.type||"aba",chats:n.chats||[]};t.set(n.id,e)}}return Array.from(t.values())}(e.FollowUp||null);let u=r&&Array.isArray(r)?[...r]:[];for(const e of p)u.some(t=>t.id===e.id)||u.push(e);const b=t.tabs.length,f=function(e,t){if(!e||!Array.isArray(e))return t;const n=[...t],a=new Set(t.map(e=>(e.title||e.name||e.tag||"").toLowerCase()));for(const t of e){const e=t.tag||"Imported Tab";if(a.has(e.toLowerCase()))continue;const r=(t.chats||[]).map(e=>{const t="string"==typeof e?e:e.id||e.phone||"";if(!t)return null;const n=String(t).replace(/\D/g,"");return n?{id:n.includes("@")?n:`${n}@c.us`,name:"object"==typeof e&&e.name?e.name:n,type:"individual",selected:!1}:null}).filter(Boolean),o={id:t.id||h("tab"),title:e,details:"Imported from Cheetah CRM",chats:r,isPermanent:!1,isSystemFilter:!1,createdAt:Date.now(),updatedAt:Date.now()};n.push(o),a.add(e.toLowerCase())}return n}(u,t.tabs);n.imported.tabs=f.length-b;const v=t.flows.length;let y=function(e,t){if(!e||!Array.isArray(e))return t;const n=[...t],a=new Set(t.map(e=>e.name?.toLowerCase()));for(const t of e){if(a.has(t.nome?.toLowerCase()))continue;const e=t.id||h("flow"),r=Date.now(),o={..._u.Jg};for(const e of t.acionamento||[])"message_Received"===e.type&&e.text?o.keywords.push(e.text):"first_Message"===e.type?o.firstMessageEver=!0:"any_message"===e.type&&(o.anyMessage=!0);const i={..._u.$q};t.regras?.responderGrupos?.propriedades?.active&&(i.allowGroups=!0),t.regras?.responderEtiqueta?.propriedades?.active&&(i.respondOnlyToTags=t.regras.responderEtiqueta.propriedades.labelID||[]),t.regras?.notResponderEtiqueta?.propriedades?.active&&(i.dontRespondToTags=t.regras.notResponderEtiqueta.propriedades.labelID||[],i.dontRespondIfTagged=!0);const s=[{id:"start",type:"start",position:{x:400,y:100},data:{label:"Start"}}],l=[];let c="start",d=250;for(let e=0;e<(t.acao||[]).length;e++){const n=t.acao[e],a=n.id||h("node");let r="send_text";const o={};switch(n.type){case"txt":r="send_text",o.message=n.propriedades?.mensagem||"",o.delay=n.propriedades?.aguarde||1;break;case"img":case"image":r="send_image",o.mediaBase64=n.propriedades?.base64||"",o.mediaCaption=n.propriedades?.caption||"",o.delay=n.propriedades?.aguarde||2;break;case"audio":r="send_audio",o.mediaBase64=n.propriedades?.base64||"",o.delay=n.propriedades?.aguarde||2;break;case"video":r="send_video",o.mediaBase64=n.propriedades?.base64||"",o.mediaCaption=n.propriedades?.caption||"",o.delay=n.propriedades?.aguarde||2;break;case"doc":case"document":r="send_document",o.mediaBase64=n.propriedades?.base64||"",o.mediaFilename=n.propriedades?.base64Name||"document",o.delay=n.propriedades?.aguarde||2;break;default:r="send_text",o.message=n.propriedades?.mensagem||""}s.push({id:a,type:r,position:{x:400,y:d},data:o}),l.push({id:`${c}-${a}`,source:c,target:a}),c=a,d+=150}const m={id:e,name:t.nome||"Imported Flow",isActive:t.active||!1,createdAt:r,updatedAt:r,triggers:o,reactivationInterval:0,reactivationUnit:"minutes",rules:i,nodes:s,edges:l};n.push(m),a.add(m.name.toLowerCase())}return n}(e.autoatendimento,t.flows);y=function(e,t){if(!e)return t;const n=e.workflows||e;if(!Array.isArray(n))return t;const a=[...t],r=new Set(t.map(e=>e.name?.toLowerCase()));for(const e of n){if(!e.name||r.has(e.name?.toLowerCase()))continue;const t=[],n=[];let o=null;if(e.nodes&&Array.isArray(e.nodes))for(const n of e.nodes){const e=Iu(n.type,n.data?.type),a={id:n.id,type:e,position:n.position||{x:400,y:200},data:Ru(n)};t.push(a),"start"===e&&(o=n.id)}if(e.edges&&Array.isArray(e.edges))for(const t of e.edges){const e=t.source===o,a={id:t.id||h("edge"),source:t.source,target:t.target};!e&&t.sourceHandle&&("on-response"===t.sourceHandle?a.sourceHandle="response":"on-timeout"===t.sourceHandle&&(a.sourceHandle="timeout")),n.push(a)}const i=t.find(e=>"start"===e.type),s=n.find(e=>e.source===o);if(i&&!s){const e=t.find(e=>"start"!==e.type);e&&n.unshift({id:h("edge"),source:i.id,target:e.id})}else if(s&&!t.some(e=>e.id===s.target)){const e=t.find(e=>"start"!==e.type);e&&(s.target=e.id)}const l={..._u.Jg};if(e.acionamentos&&Array.isArray(e.acionamentos))for(const t of e.acionamentos)if(t.data?.active)switch(t.type){case"porPalavraChave":t.data.chaves&&(l.keywords=[...l.keywords,...t.data.chaves]);break;case"aoReceberMensagem":l.anyMessage=!0;break;case"primeiraMensagemDoCliente":l.firstMessageEver=!0;break;case"primeiraMensagemDoClienteNoDia":l.firstMessageDay=!0}const c=e.cooldown?.value||0,d="minutos"===e.cooldown?.unit?"minutes":"horas"===e.cooldown?.unit?"hours":"minutes",m={id:e.id||h("flow"),name:e.name,isActive:e.active||!1,createdAt:Date.now(),updatedAt:Date.now(),triggers:l,reactivationInterval:c,reactivationUnit:d,rules:_u.$q,nodes:t,edges:n};a.push(m),r.add(m.name.toLowerCase())}return a}(o,y),n.imported.flows=y.length-v;const x=t.followups.length,w=function(e,t,n){if(!e||!Array.isArray(e))return t;const a={};if(n&&Array.isArray(n))for(const e of n){const t=(e.title||e.name||e.tag||"").toLowerCase().trim();t&&e.id&&(a[t]=e.id)}const r=[...t],o=new Set(t.map(e=>e.name?.toLowerCase()));for(const t of e){if(o.has(t.nome?.toLowerCase()))continue;const e={dispararAoEntrar:"on_enter",dispararAoSair:"on_leave",onEnter:"on_enter",onLeave:"on_leave",afterTime:"after_time"},n=t.acionamento?.timing||{days:0,hours:0,minutes:5};let i=n.minutes||5,s="minutes";n.days>0?(i=n.days,s="days"):n.hours>0&&(i=n.hours,s="hours");const l={mode:"relative",relativeDays:i,relativeUnit:s,relativeTime:"10:00"};let c="tabs",d=[];if(t.funil?.etiquetas&&t.funil.etiquetas.length>0)c="labels",d=t.funil.etiquetas;else if(t.funil?.abas&&t.funil.abas.length>0){c="tabs",d=[];for(const e of t.funil.abas){const t=a[(e.tag||"").toLowerCase().trim()];t?d.push(t):d.push(e.id)}}const m=(t.acao||[]).map(e=>{const t=Bu(e.type),n=e.propriedades?.base64?[{name:e.propriedades.base64Name||"imported_file",caption:"",type:"local",base64Url:e.propriedades.base64,file:e.propriedades.base64}]:[],a=[{id:Dm(),message:e.propriedades?.mensagem||"",attachmentType:t,attachments:n,delay:{min:e.propriedades?.aguarde||1,max:(e.propriedades?.aguarde||1)+2}}];return{id:e.id||Am(),type:"template",templateConfig:{messages:a}}}),p=e[t.acionamento?.type]||"on_enter",u={id:t.id||Tm(),name:t.nome||"Imported Follow-up",isActive:t.active||!1,createdAt:Date.now(),updatedAt:Date.now(),funnelSettings:{type:c,selectedIds:d},trigger:{type:p,timeConfig:l},actions:m,postActions:{...Sm},rules:{cancelOnReply:!0,allowGroups:t.regras?.responderGrupos?.propriedades?.active||!1,customSignature:!1}};r.push(u),o.add(u.name.toLowerCase())}return r}(e.FollowUp,t.followups,f);n.imported.followups=w.length-x;const k=t.schedules.length,E=function(e,t){if(!e||!Array.isArray(e))return t;const n=[...t],a=new Set(t.map(e=>e.id));for(const t of e){if(a.has(t.id))continue;const[e,r,o]=(t.data||"").split("-").map(Number),[i,s]=(t.hora||"").split(":").map(Number);if(!e||!r||!o||isNaN(i)||isNaN(s))continue;const l=new Date(e,r-1,o,i,s).getTime();if(isNaN(l))continue;const c=t.base64?Pu(t.tipo):"none",d=t.base64?[{name:t.base64Name||"imported_file",caption:"",type:"local",base64Url:t.base64,file:t.base64}]:[],m={id:h("msg"),attachmentType:c,content:t.mensagem||"",attachments:d,selectedContacts:[],pollData:null,listData:null,selectedProducts:[]},p={id:t.id||h("broadcast"),name:t.titulo||"Imported Schedule",contacts:t.userID?[Lu(t.userID)]:[],messages:[m],sendRandomMessage:!1,minDelay:1,maxDelay:3,allowDuplicates:!1,enableLinkPreview:!0,scheduledTime:l,createdAt:Date.now(),status:l>Date.now()?"scheduled":"completed",progress:{sent:0,failed:0,total:1},results:[]};n.push(p)}return n}(e.agendamentos,t.schedules);n.imported.schedules=E.length-k;const S=t.templates.length,C=function(e,t,n){if(!(e&&Array.isArray(e)||t&&Array.isArray(t)))return n;const a=[...n],r=new Set(n.map(e=>(e.templeteName||e.shortcut||"").toLowerCase()));let o=0;const i=e=>({txt:"none",text:"none",img:"image/video",image:"image/video",imagem:"image/video",audio:"audio",video:"image/video",doc:"document",document:"document"}[e?.toLowerCase()]||"none");if(e&&Array.isArray(e))for(const n of e){const e=n.atalho||n.shortcut||"",s=n.mensagem||n.message||"";if(!e&&!s)continue;const l=e||`Quick Reply ${o+1}`;if(r.has(l.toLowerCase()))continue;const c=t?.find(e=>e.id===n.id),d=c?.acao||[],m=d.length>0?d.map(e=>{const t=i(e.type);return{id:e.id||h("msg"),message:e.propriedades?.mensagem||s,attachmentType:t,attachments:e.propriedades?.base64?[{name:e.propriedades.base64Name||"imported_file",caption:e.propriedades.caption||"",type:"local",base64Url:e.propriedades.base64,file:e.propriedades.base64}]:[],delay:{min:e.propriedades?.aguarde||1,max:(e.propriedades?.aguarde||1)+2}}}):[{id:h("msg"),message:s,attachmentType:n.base64?i(n.tipo||"image"):"none",attachments:n.base64?[{name:n.base64Name||"imported_file",caption:"",type:"local",base64Url:n.base64,file:n.base64}]:[],delay:{min:1,max:3}}],p=m.some(e=>"none"!==e.attachmentType),u=m[0]?.attachmentType||"none",g={id:n.id||h("tpl"),templeteName:l,message:s,templeteType:"personalized",messageType:"quick_reply",dynamicValueCount:0,dynamicValueData:[],sendAttachment:p,sendAttachmentType:u,attachemnt:m[0]?.attachments||[],selectedContact:[],buttonsData:null,pollData:null,listData:null,selectedProducts:[],quickReplyData:{isQuickReply:!0,settings:{pinToShortcut:!0,editBeforeSend:!1,sendConfirmation:!1,shuffleMessages:!1,mentionAll:!1},messages:m.map(e=>({id:e.id,message:e.message,delay:e.delay,attachmentType:e.attachmentType,attachments:e.attachments})),postActions:{groupActionsEnabled:!1,addToGroups:[],removeFromGroups:[],tabActionsEnabled:!1,addToTabs:[],removeFromTabs:[],labelsActionsEnabled:!1,addLabels:[],removeLabels:[],kanbanActionsEnabled:!1,addToKanban:null,removeFromKanban:null}},messages:m,categoryId:"cat_quick_reply",sortOrder:o,isActive:!0,createdAt:Date.now(),modifiedAt:Date.now()};a.push(g),r.add(l.toLowerCase()),o++}if(t&&Array.isArray(t))for(const e of t){if(a.some(t=>t.id===e.id))continue;const t=e.acao||[];if(0===t.length)continue;const n=t[0]?.propriedades?.mensagem||"",s=n.substring(0,30)||`Quick Reply ${o+1}`;if(r.has(s.toLowerCase()))continue;const l=t.map(e=>{const t=i(e.type);return{id:e.id||h("msg"),message:e.propriedades?.mensagem||"",attachmentType:t,attachments:e.propriedades?.base64?[{name:e.propriedades.base64Name||"imported_file",caption:e.propriedades.caption||"",type:"local",base64Url:e.propriedades.base64,file:e.propriedades.base64}]:[],delay:{min:e.propriedades?.aguarde||1,max:(e.propriedades?.aguarde||1)+2}}}),c=l.some(e=>"none"!==e.attachmentType),d=l[0]?.attachmentType||"none",m={id:e.id||h("tpl"),templeteName:s,message:n,templeteType:"personalized",messageType:"quick_reply",dynamicValueCount:0,dynamicValueData:[],sendAttachment:c,sendAttachmentType:d,attachemnt:l[0]?.attachments||[],selectedContact:[],buttonsData:null,pollData:null,listData:null,selectedProducts:[],quickReplyData:{isQuickReply:!0,settings:{pinToShortcut:!0,editBeforeSend:!1,sendConfirmation:!1,shuffleMessages:!1,mentionAll:!1},messages:l.map(e=>({id:e.id,message:e.message,delay:e.delay,attachmentType:e.attachmentType,attachments:e.attachments})),postActions:{groupActionsEnabled:!1,addToGroups:[],removeFromGroups:[],tabActionsEnabled:!1,addToTabs:[],removeFromTabs:[],labelsActionsEnabled:!1,addLabels:[],removeLabels:[],kanbanActionsEnabled:!1,addToKanban:null,removeFromKanban:null}},messages:l,categoryId:"cat_quick_reply",sortOrder:o,isActive:!0,createdAt:Date.now(),modifiedAt:Date.now()};a.push(m),r.add(s.toLowerCase()),o++}return a}(i,e.respostasRapidasAcao,t.templates);n.imported.templates=C.length-S;const T=function(e,t){if(!e)return t;const n={...t};if(e.keyGPT&&!n.chatgptApiKey&&(n.chatgptApiKey=e.keyGPT),e.keyGemini&&!n.geminiApiKey&&(n.geminiApiKey=e.keyGemini),e.keyGroq&&!n.groqApiKey&&(n.groqApiKey=e.keyGroq),!n.provider&&e.activeIA){const t={gemini:"gemini",gpt:"chatgpt",openai:"chatgpt",groq:"deepseek"};n.provider=t[e.activeIA.toLowerCase()]||"chatgpt"}return n}(e.IA,t.aiSettings);n.imported.aiSettings=JSON.stringify(T)!==JSON.stringify(t.aiSettings);const A=function(e,t){if(!e)return t;const n={...t};return e.url&&!n.messages?.url&&(n.messages={active:!0,url:e.url,events:["incoming","outgoing"]}),n}(e.webhook,t.webhookSettings);n.imported.webhooks=e.webhook?1:0;const D={crms:[],stages:{},assignments:[],activeCrmId:null,chatsCache:{},lastSync:0},_=t.kanbanData||D,N=function(e,t){if(!e)return t;Array.isArray(e)&&e.length;let n=[];if(Array.isArray(e)?n=e:e.quadros&&Array.isArray(e.quadros)?n=e.quadros:e.id&&(e.list||e.etapas)&&(n=[e]),0===n.length)return t;const a={crms:[...t.crms||[]],stages:{...t.stages||{}},assignments:[...t.assignments||[]],activeCrmId:t.activeCrmId||null,chatsCache:{...t.chatsCache||{}},lastSync:Date.now()};for(const e of n){if(!e.name&&!e.nome)continue;const t=e.name||e.nome||"Imported Board",n=a.crms.find(e=>e.name.toLowerCase()===t.toLowerCase());let r;n?r=n.id:(r=e.id||h("crm"),a.crms.push({id:r,name:t,type:"user",isDefault:!1,position:a.crms.length,createdAt:Date.now(),updatedAt:Date.now()}));const o=e.list||e.etapas||e.stages||[];o.length;const i=o.map((e,t)=>({id:e.id||h("stage"),crmId:r,name:e.name||e.nome||`Stage ${t+1}`,position:t+1,color:e.hexColor||e.color||e.cor||"#7C3AED",isSystemGenerated:!1})),s=a.stages[r]||[],l=s.some(e=>"inbox"===e.name.toLowerCase()||e.isSystemGenerated)?null:{id:h("stage"),crmId:r,name:"INBOX",position:0,color:"#6b7280",isSystemGenerated:!0},c=i.map(e=>e.name.toLowerCase()),d=s.filter(e=>!c.includes(e.name.toLowerCase()));a.stages[r]=[...l?[l]:[],...d,...i],a.stages[r].forEach((e,t)=>{e.position=t});for(const e of o){const t=e.chats||[];if(0===t.length)continue;const n=(e.name||e.nome||"").toLowerCase().trim(),o=a.stages[r]?.find(e=>(e.name||"").toLowerCase().trim()===n);if(o)for(const e of t){const t=e.id||e.phone||e;if(!t)continue;const n=Lu(String(t));a.assignments.some(e=>e.chatId===n&&e.crmId===r)||a.assignments.push({id:h("assignment"),chatId:n,stageId:o.id,crmId:r,assignedAt:Date.now(),dealValue:e.valor||e.value||0})}}const m=e.contatos||e.contacts||[];for(const e of m){const t=e.id||e.phone||e.telefone;if(!t)continue;const n=Lu(String(t)),o=e.etapaId||e.stageId||e.stage;a.assignments.some(e=>e.chatId===n&&e.crmId===r)||a.assignments.push({id:h("assignment"),chatId:n,stageId:o||a.stages[r]?.[0]?.id||"",crmId:r,assignedAt:Date.now(),dealValue:e.valor||e.value||0})}}return a}(a,_);n.imported.kanbanBoards=N.crms.length-_.crms.length,n.imported.kanbanStages=Object.values(N.stages).flat().length-Object.values(_.stages).flat().length;const M=t.statusItems||[],I=function(e,t){if(!e||!Array.isArray(e))return t;const n=[...t],a=new Set(t.map(e=>e.id)),r={texto:"text",text:"text",imagem:"image",image:"image",video:"video",audio:"audio"};for(const t of e){if(a.has(t.id))continue;let e;if(t.data&&t.hora)try{const[n,a,r]=t.data.split("-").map(Number),[o,i]=t.hora.split(":").map(Number);n&&a&&r&&!isNaN(o)&&!isNaN(i)&&(e=new Date(n,a-1,r,o,i).getTime())}catch(e){}const o="texto"===t.type?t.texto||"":t.base64||t.texto||"";let i="pending";t.programar&&e&&(i="scheduled");const s={id:t.id||h("status"),name:t.name||"Imported Status",type:r[t.type]||"text",content:o,caption:"texto"!==t.type?t.texto:void 0,backgroundColor:t.color||"#4A4A4A",scheduledAt:e,autoRepost:t.repostar||!1,createdAt:Date.now(),status:i};n.push(s)}return n}(e.status,M);n.imported.statusItems=I.length-M.length,n.convertedData={crmData:c,tabs:f,flows:y,followups:w,schedules:E,templates:C,aiSettings:T,webhookSettings:A,kanbanData:N,statusItems:I}}catch(e){n.success=!1,n.error=e.message||"Unknown error during import"}return n}const Fu=["wa_kanban_crm_data","wa_crm_data","wa_crm_data_sync","wa_crm_status_items","wa_crm_status_id_map","wa_crm_hidden_status_ids","wa_status_items","wa_crm_currency","wa_crm_appointment_templates","wa_crm_custom_income_categories","wa_crm_custom_expense_categories","wa_crm_custom_payment_methods","wa_crm_custom_transaction_statuses","wa_crm_hidden_income_categories","wa_crm_hidden_expense_categories","wa_crm_hidden_payment_methods","wa_crm_hidden_transaction_statuses","wa_chatbot_flows","chatbot_flows","wa_chatbot_flow_categories","fluxo_global_settings","wa_fluxo_conversation_states","wa_fluxo_first_message_tracker","wa_fluxo_onboarding_completed","fluxo_conversation_states","fluxo_trigger_history","fluxo_pause_states","fluxo_flow_trigger_history","fluxo_first_message_tracking","wa_tabs","wa_extension_tabs","wa_custom_tabs","wa_kanban_crm_data_sync","kanban_chats","kanban_tabs","kanban_labels","kanban_labels_timestamp","kanban_chats_timestamp","kanban_profile_pics_cache","wa_kanban_crm_list","wa_templates","wa_template_categories","wa_template_media","wa_quick_replies","wa_quick_replies_v2","wa_templates_last_sync","encrypted_templates","encrypted_quick_replies","wa_followups","wa_followup_categories","wa_followup_contacts","wa_followup_queue","wa_followup_needs_auto_entry","wa_followup_sequences","wa_reminders","wa_appointments","wa_schedules","wa_active_broadcast","wa_broadcast_history","wa_scheduled_broadcasts","wa_active_campaign","wa_bulk_validator_campaigns","waBroadcastHistory","wa_last_broadcast","wa_agent_settings","wa_agent_active_services","wa_agent_service_chat_ids","wa_ai_settings","wa_ai_bot_settings","wa_ai_bot_queue","wa_ai_bot_test_chat_history","wa_spoken_language","wa_signature_settings","team_settings","wa_team_settings","webhook_settings","lion_crm_theme_settings","lion_crm_theme_sync","wa_theme_settings","wa_feature_visibility","wa_blur_settings","wa_tabbar_hidden","wa_header_collapsed","wa_language","wa_ui_language","api_polling_settings","bulk_validator_campaigns","wa_crm_todos_sync","wa_crm_todos","wa_auto_backup_enabled","wa_auto_backup_destination","wa_last_auto_backup_date","wa_groups_cache","last_storage_sync","wa_session_data"],zu=["wa_","kanban","crm","fluxo","chatbot","followup","schedule","broadcast","agent","webhook","signature","team","lion","template","api_","bulk_","currency","categories","payment","transaction","hidden_","cache","timestamp","language","auto_backup","quick_repl","todo","encrypted","reminder","appointment","session","theme","blur","feature","tabs","labels","status","campaign","sync"],Ou=["wa_kanban_db","wa_extension_db","wa_template_media_db","FluxoMediaDB","WaBroadcastDB"],Wu=["wa_kanban_db","wa_extension_db","kanban_db","wa_crm_db","wa_contacts_db","wa_templates_db","wa_broadcast_db","whatsapp_extension_db","WaBroadcastDB","WaExtensionDB","WaKanbanDB"],qu=["wa_templates","wa_template_media","wa_kanban_crm_data","wa_extension_tabs","wa_quick_replies","wa_templates_last_sync","wa_phone_hash","wa_active_broadcast","wa_broadcast_history","wa_scheduled_broadcasts","wa_broadcast_media","wa_active_campaign","wa_custom_tabs","wa_settings","wa_preferences","wa_user_settings"];async function Hu(e){const t={};for(const n of e)try{const e=await new Promise((e,t)=>{const a=indexedDB.open(n);a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)}),a=Array.from(e.objectStoreNames);t[n]={};for(const r of a){const a=e.transaction(r,"readonly").objectStore(r),o=await new Promise((e,t)=>{const n=a.getAll();n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)});o&&o.length>0&&(t[n][r]=o)}e.close()}catch(e){}return t}function ju(e,t){const n=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),a=URL.createObjectURL(n),r=document.createElement("a");r.href=a,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(a)}function Vu(e,t){const n={};let a=!1;return e.forEach(e=>{if(t.some(t=>e.toLowerCase().includes(t)))try{const t=localStorage.getItem(e);t&&(n[`local_${e}`]=JSON.parse(t),a=!0)}catch{n[`local_${e}`]=localStorage.getItem(e),a=!0}}),{data:n,hasData:a}}function Gu(e,t,n){let a=!1;return Object.keys(e).forEach(r=>{t.some(e=>r.toLowerCase().includes(e))&&(n[`chrome_${r}`]=e[r],a=!0)}),a}async function Ku(e){for(const t of Object.keys(e)){let a=e[t];if(t.startsWith("local_")){const e=t.replace("local_","");"string"==typeof a?localStorage.setItem(e,a):localStorage.setItem(e,JSON.stringify(a))}if(t.startsWith("chrome_")){const e=t.replace("chrome_","");if("string"==typeof a)try{a=JSON.parse(a)}catch(e){}await n().storage.local.set({[e]:a})}}}function $u(e,t){Object.keys(e).forEach(n=>{let a=e[n];if(n.startsWith("local_")){const e=n.replace("local_","");"string"==typeof a?localStorage.setItem(e,a):localStorage.setItem(e,JSON.stringify(a))}else t.includes(n)&&("string"==typeof a?localStorage.setItem(n,a):localStorage.setItem(n,JSON.stringify(a)))})}const Yu=({isLicensed:e,currentPhone:t,currentTheme:n,planName:r,expiryDate:o,profilePicUrl:i,pushName:s,t:l,onLicenseKeyClick:c,onSettingsClick:d,onFeatureSettingsClick:m,onTutorialClick:p,onLanguageClick:u,onBackupClick:g,onPrivacyClick:h,onContactClick:b,onWebsiteClick:f,onClose:v})=>{const y="dark"===n,x=(e,t,n,r=!1)=>a.createElement("button",{className:"wa-menu-item "+(r?"wa-menu-item-locked":""),onClick:()=>{r||(v(),n())},style:r?{opacity:.5,cursor:"not-allowed"}:{}},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:e})),a.createElement("span",null,t),r&&a.createElement("span",{style:{marginLeft:"auto",fontSize:"12px"}},"🔒")),w="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9z",k="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94L14.4 2.81c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z",E="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z",S="M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z",C="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z",T="M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z",A="M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-2 16l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z",D="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 9h-2V5h2v6zm0 4h-2v-2h2v2z",_="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z",N="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z";return a.createElement("div",{className:"wa-profile-dropdown "+(y?"lion-dark":"")},a.createElement("div",{className:"wa-profile-dropdown-header"},a.createElement("div",{className:"wa-profile-avatar"},i?a.createElement("img",{src:i,alt:"Profile",style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%"}}):a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:N}))),a.createElement("div",{className:"wa-profile-info"},e?a.createElement(a.Fragment,null,a.createElement("div",{className:"wa-device-name"},s||l("profile.deviceName")),a.createElement("div",{className:"wa-signature-name"},t),a.createElement("div",{className:"wa-plan-name"},r),a.createElement("div",{className:"wa-expiry-date"},l("profile.expires"),": ",o)):a.createElement(a.Fragment,null,a.createElement("div",{className:"wa-device-name"},l("profile.notActivated")||"Not Activated"),a.createElement("div",{className:"wa-plan-name",style:{color:ca.primary}},l("profile.activateToContinue")||"Activate License")))),a.createElement("div",{className:"wa-dropdown-divider"}),a.createElement("div",{className:"wa-dropdown-menu"},x(w,l("profile.manageLicenseKey"),c),x(k,l("profile.settings"),d,!e),x(E,l("settings.menuFeatures"),m,!e),x(S,l("profile.watchTutorial"),p),a.createElement("div",{className:"wa-dropdown-divider"}),x(C,l("profile.language"),u),x(T,l("backup.title"),g,!e),x(A,l("profile.privacyPolicy"),h),x(D,l("profile.contactUs"),b),x(_,l("profile.website")||"Website",f)))},Xu=({onViewChange:e,onCRMSelect:t})=>{const[n,r]=(0,a.useState)(!1),[o,s]=(0,a.useState)("tabs"),[l,c]=(0,a.useState)([]),[m,p]=(0,a.useState)({}),[u,g]=(0,a.useState)(!1),[h,b]=(0,a.useState)(null),f=(0,a.useRef)(null),v=(0,a.useRef)(null),[y,x]=(0,a.useState)(()=>"true"===localStorage.getItem("wa_tabbar_hidden"));(0,a.useEffect)(()=>{const e=d.TabsStorage.getActiveView();s(e),w()},[]),(0,a.useEffect)(()=>{n&&w()},[n]);const w=async()=>{try{await du.KanbanStorage.initializeDefaultCRMsAsync();const e=await du.KanbanStorage.getCRMsAsync();let t=!1;const n=e.filter(e=>"whatsapp_labels"===e.type?!t&&(t=!0,!0):"custom_tabs"!==e.type&&!e.isDefault);c(n);const a={};for(const e of n){const t=await du.KanbanStorage.getStagesAsync(e.id);a[e.id]=t.length}p(a)}catch(e){}};(0,a.useEffect)(()=>{const e=e=>{const t=e.target;f.current&&f.current.contains(t)||t.closest(".view-switcher-dropdown")||(r(!1),g(!1))};if(n){const t=setTimeout(()=>{document.addEventListener("mousedown",e)},100);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}}},[n]);const k=async t=>{if("kanban"!==t){if("hidden"===t){const e=!y;return x(e),localStorage.setItem("wa_tabbar_hidden",String(e)),window.dispatchEvent(new CustomEvent("wa-tabbar-visibility",{detail:{hidden:e}})),void r(!1)}s(t),d.TabsStorage.setActiveView(t),r(!1),g(!1),e?.(t)}else g(!u)},E=e=>{switch(e){case"tabs":return a.createElement("svg",{viewBox:"0 0 24 24",className:"view-icon"},a.createElement("path",{fill:"currentColor",d:"M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z"}));case"kanban":return a.createElement("svg",{viewBox:"0 0 24 24",className:"view-icon"},a.createElement("path",{fill:"currentColor",d:"M4 6h4v12H4V6zm6 0h4v16h-4V6zm6 0h4v8h-4V6z"}));case"hidden":return y?a.createElement("svg",{viewBox:"0 0 24 24",className:"view-icon"},a.createElement("path",{fill:"currentColor",d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})):a.createElement("svg",{viewBox:"0 0 24 24",className:"view-icon"},a.createElement("path",{fill:"currentColor",d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}))}},S=e=>{switch(e){case"tabs":return"Abas";case"kanban":return"Kanban (CRM)";case"hidden":return y?"Mostrar Barra de Abas":"Ocultar Barra de Abas"}},C=n&&h&&(0,i.createPortal)(a.createElement("div",{className:"view-switcher-dropdown",style:{position:"fixed",top:`${h.bottom+8}px`,left:`${h.left}px`,zIndex:2147483640}},a.createElement("div",{className:"view-switcher-header"},"ALTERAR VISUALIZAÇÃO"),a.createElement("button",{className:"view-option "+("tabs"===o?"active":""),onClick:()=>k("tabs")},E("tabs"),a.createElement("span",null,S("tabs")),"tabs"===o&&a.createElement("svg",{viewBox:"0 0 24 24",className:"check-icon"},a.createElement("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"}))),a.createElement("button",{className:"view-option "+(u?"expanded":""),onClick:()=>k("kanban")},E("kanban"),a.createElement("span",null,S("kanban")),a.createElement("svg",{viewBox:"0 0 24 24",className:"expand-icon "+(u?"rotated":"")},a.createElement("path",{fill:"currentColor",d:"M7 10l5 5 5-5z"}))),u&&a.createElement("div",{className:"crm-submenu"},(l||[]).map(e=>{return a.createElement("button",{key:e.id,className:"crm-option",onClick:()=>(async e=>{r(!1),g(!1),await du.KanbanStorage.setActiveCrmIdAsync(e.id),t?.(e.id,e.name)})(e)},a.createElement("svg",{viewBox:"0 0 24 24",className:"crm-icon"},a.createElement("path",{fill:"currentColor",d:"M4 6h4v12H4V6zm6 0h4v16h-4V6zm6 0h4v8h-4V6z"})),a.createElement("div",{className:"crm-info"},a.createElement("span",{className:"crm-name"},(e=>"whatsapp_labels"===e.type?"WhatsApp Labels":"custom_tabs"===e.type?"Custom Tabs":e.name)(e)),a.createElement("span",{className:"crm-stages"},(n=e.id,m[n]||0)," stages")),e.isDefault&&a.createElement("span",{className:"crm-badge"},"Default"));var n})),a.createElement("button",{className:"view-option",onClick:()=>k("hidden")},E("hidden"),a.createElement("span",null,S("hidden")))),document.body);return a.createElement("div",{className:"view-switcher",ref:f},a.createElement("button",{ref:v,className:"view-switcher-btn",onClick:()=>{!n&&v.current&&b(v.current.getBoundingClientRect()),r(!n)},title:"Alterar Visualização"},E(o),a.createElement("svg",{viewBox:"0 0 24 24",className:"chevron-icon"},a.createElement("path",{fill:"currentColor",d:"M7 10l5 5 5-5z"}))),C,a.createElement("style",null,`\n        ${ma}\n\n        .view-switcher {\n          position: relative;\n        }\n\n        .view-switcher-btn {\n          background: var(--lion-bg-secondary, #fafafa);\n          border: 1px solid var(--lion-border-light, #e5e7eb);\n          color: var(--lion-text-secondary, #374151);\n          width: 38px;\n          height: 38px;\n          padding: 0;\n          border-radius: 10px;\n          cursor: pointer;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 2px;\n          transition: all 0.2s ease;\n        }\n\n        .view-switcher-btn:hover {\n          background: var(--lion-primary-light, #eff6ff);\n          border-color: var(--lion-primary, #7C3AED);\n          color: var(--lion-primary, #7C3AED);\n        }\n\n        .view-icon {\n          width: 20px;\n          height: 20px;\n        }\n\n        .chevron-icon {\n          width: 10px;\n          height: 10px;\n          opacity: 0.7;\n          margin-left: -2px;\n        }\n\n        .view-switcher-dropdown {\n          /* Position is set inline via portal with fixed positioning */\n          background: var(--lion-bg-primary, #ffffff);\n          border-radius: 12px;\n          box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.08);\n          border: 1px solid var(--lion-border-light, #e5e7eb);\n          min-width: 240px;\n          overflow: hidden;\n          animation: dropdownSlide 0.2s ease;\n        }\n\n        @keyframes dropdownSlide {\n          from {\n            opacity: 0;\n            transform: translateY(-8px);\n          }\n          to {\n            opacity: 1;\n            transform: translateY(0);\n          }\n        }\n\n        .view-switcher-header {\n          padding: 12px 16px;\n          font-size: 12px;\n          font-weight: 600;\n          color: var(--lion-text-muted);\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n          border-bottom: 1px solid var(--lion-border-light);\n        }\n\n        .view-option {\n          width: 100%;\n          padding: 12px 16px;\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          background: none;\n          border: none;\n          cursor: pointer;\n          transition: all 0.15s ease;\n          font-size: 14px;\n          color: var(--lion-text-primary);\n          text-align: left;\n        }\n\n        .view-option:hover:not(:disabled) {\n          background: var(--lion-bg-secondary);\n        }\n\n        .view-switcher-dropdown .view-option.active {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          font-weight: 600 !important;\n        }\n\n        .view-switcher-dropdown .view-option.active svg,\n        .view-switcher-dropdown .view-option.active span,\n        .view-switcher-dropdown .view-option.active .view-icon,\n        .view-switcher-dropdown .view-option.active .check-icon {\n          color: #ffffff !important;\n          fill: #ffffff !important;\n        }\n\n        .view-switcher-dropdown .view-option.active:hover {\n          background: var(--lion-primary-hover) !important;\n          color: #ffffff !important;\n        }\n\n        .view-option.expanded {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .view-option svg.view-icon {\n          width: 20px;\n          height: 20px;\n          color: var(--lion-text-muted);\n          flex-shrink: 0;\n        }\n\n        .view-option span {\n          flex: 1;\n        }\n\n        .check-icon {\n          width: 18px;\n          height: 18px;\n          color: var(--lion-primary);\n          flex-shrink: 0;\n        }\n\n        .expand-icon {\n          width: 18px;\n          height: 18px;\n          color: var(--lion-text-muted);\n          flex-shrink: 0;\n          transition: transform 0.2s ease;\n        }\n\n        .expand-icon.rotated {\n          transform: rotate(180deg);\n        }\n\n        /* CRM Submenu */\n        .crm-submenu {\n          background: var(--lion-bg-secondary);\n          border-top: 1px solid var(--lion-border-light);\n          border-bottom: 1px solid var(--lion-border-light);\n          max-height: 300px;\n          overflow-y: auto;\n        }\n\n        .crm-option {\n          width: 100%;\n          padding: 10px 16px 10px 32px;\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          background: none;\n          border: none;\n          cursor: pointer;\n          transition: all 0.15s ease;\n          text-align: left;\n        }\n\n        .crm-option:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .crm-option:not(:last-child) {\n          border-bottom: 1px solid var(--lion-bg-tertiary);\n        }\n\n        .crm-icon {\n          width: 18px;\n          height: 18px;\n          color: var(--lion-text-muted);\n          flex-shrink: 0;\n        }\n\n        .crm-info {\n          flex: 1;\n          display: flex;\n          flex-direction: column;\n          gap: 2px;\n        }\n\n        .crm-name {\n          font-size: 13px;\n          font-weight: 500;\n          color: var(--lion-text-secondary);\n        }\n\n        .crm-stages {\n          font-size: 11px;\n          color: var(--lion-text-muted);\n        }\n\n        .crm-badge {\n          font-size: 10px;\n          padding: 2px 6px;\n          background: var(--lion-border-light);\n          color: var(--lion-text-muted);\n          border-radius: 4px;\n          font-weight: 500;\n        }\n\n        .external-icon {\n          width: 16px;\n          height: 16px;\n          color: var(--lion-text-muted);\n          flex-shrink: 0;\n        }\n\n        .view-option:hover .external-icon {\n          color: var(--lion-text-muted);\n        }\n      `))},Ju=({isHeaderCollapsed:e,onToggleCollapse:t,licenseStatus:r,currentPhone:o,currentTheme:i,featureVisibility:s,aiEnabled:l,aiBotEnabled:c,aiBotActive:d,broadcastProgress:m,hasTabsAccess:p,planName:u,pinnedFeatures:g,t:h,supportedLanguages:b,onViewChange:f,onCRMSelect:v,onExpandLicense:y,onTabsClick:x,onTemplateClick:w,onQuickReplyClick:k,onKanbanClick:E,onChatbotFlowClick:S,onFollowUpClick:C,onBroadcastClick:T,onScheduleClick:A,onCalendarClick:D,onStatusClick:_,onValidatorClick:N,onWebhookClick:M,onApiConfigClick:I,onAIBotClick:R,onGmapsExtractorClick:B,onLicenseKeyClick:P,onSettingsClick:L,onFeatureSettingsClick:U,onTutorialClick:F,onLanguageClick:z,onBackupClick:O,onPrivacyClick:W,onContactClick:q,onWebsiteClick:H,onBroadcastProgressClick:j,CircularProgress:V})=>{const G=n().runtime.getManifest(),K=G.name||"",$=K.includes("<<")?"Extension":K,Y=$.length>12?$.slice(0,12)+"...":$,X=G.version||"1.0",[J,Q]=(0,a.useState)(!1),[Z,ee]=(0,a.useState)(null),[te,ne]=(0,a.useState)(!1),[ae,re]=(0,a.useState)(!1),[oe,ie]=(0,a.useState)(!1),[se,le]=(0,a.useState)(!1),[ce,de]=(0,a.useState)(""),[me,pe]=(0,a.useState)(""),ue=(0,a.useRef)(null),ge=(0,a.useRef)(null);(0,a.useEffect)(()=>{const e=e=>{const t=e.detail;t?.profilePicture&&de(t.profilePicture),t?.pushName&&pe(t.pushName)};return document.addEventListener("waExtensionUserProfile",e),()=>document.removeEventListener("waExtensionUserProfile",e)},[]),(0,a.useEffect)(()=>{if(!J)return;const e=e=>{ue.current&&!ue.current.contains(e.target)&&Q(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[J]);const he=()=>{const e=ge.current;if(!e)return re(!1),ie(!1),void le(!1);const{scrollLeft:t,scrollWidth:n,clientWidth:a}=e,r=n>a+1;le(r),re(t>2),ie(r&&t+a<n-2)};(0,a.useEffect)(()=>{he();const e=setTimeout(he,50),t=setTimeout(he,200),n=setTimeout(he,500),a=ge.current;if(!a)return()=>{clearTimeout(e),clearTimeout(t),clearTimeout(n)};a.addEventListener("scroll",he),window.addEventListener("resize",he);const r=new ResizeObserver(he);r.observe(a),a.parentElement&&r.observe(a.parentElement),Array.from(a.children).forEach(e=>{e instanceof HTMLElement&&r.observe(e)});const o=new MutationObserver(he);return o.observe(a,{childList:!0,subtree:!1}),()=>{clearTimeout(e),clearTimeout(t),clearTimeout(n),a.removeEventListener("scroll",he),window.removeEventListener("resize",he),r.disconnect(),o.disconnect()}},[g]);const be=e=>{const t=ge.current;if(!t)return;t.scrollBy({left:"left"===e?-200:200,behavior:"smooth"}),setTimeout(he,50),setTimeout(he,200),setTimeout(he,400)},fe=r?.isValid||!1,ve=new Date(Date.now()+24*(r?.expiryDays||0)*60*60*1e3).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}),ye={tabs:x,template:w,quickReply:k,broadcast:T,schedule:A,followUp:C,kanban:E,calendar:D,status:_,aiBot:R,chatbotFlow:S,webhook:M,api:I,validator:N,gmapsExtractor:B},xe=g.filter(e=>{const t=Lp[e];return!!t&&(!("aiBot"===e&&!l)&&s[t.visibilityKey])});return a.createElement(a.Fragment,null,a.createElement("button",{className:"wa-header-toggle-btn "+(e?"collapsed":""),onClick:t,title:e?"Show Header":"Hide Header"},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor"},e?a.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}):a.createElement("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}))),a.createElement("div",{className:"wa-header-bar "+(e?"collapsed":"")},a.createElement("div",{className:"wa-header-left"},a.createElement("div",{className:"wa-brand-block"},a.createElement("img",{src:n().runtime.getURL("icons/logo.png"),alt:$,className:"wa-brand-logo",onError:e=>{e.target.src=n().runtime.getURL("icons/icon-48.png")}}),a.createElement("div",{className:"wa-brand-info"},a.createElement("span",{className:"wa-brand-text",title:$},Y),a.createElement("span",{className:"wa-brand-version"},"v",X))),a.createElement("div",{className:"wa-brand-divider"}),p&&a.createElement(Xu,{onViewChange:f,onCRMSelect:v}),fe&&p&&a.createElement("div",{className:"wa-pinned-actions-wrapper",style:{display:"flex",alignItems:"center",flex:"1 1 0",minWidth:0,height:"40px",position:"relative",gap:"2px"}},se&&ae&&a.createElement("button",{type:"button",onClick:()=>be("left"),title:"Scroll left",className:"wa-header-scroll-arrow",style:{flexShrink:0,width:"28px",height:"32px",background:"var(--lion-bg-primary)",border:"1px solid var(--lion-border-light)",borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,transition:"all 0.15s ease",boxShadow:"0 1px 3px rgba(0,0,0,0.06)"},onMouseEnter:e=>{e.currentTarget.style.background="var(--lion-primary-light)",e.currentTarget.style.borderColor="var(--lion-primary)";const t=e.currentTarget.querySelector("svg");t&&(t.style.fill="var(--lion-primary)")},onMouseLeave:e=>{e.currentTarget.style.background="var(--lion-bg-primary)",e.currentTarget.style.borderColor="var(--lion-border-light)";const t=e.currentTarget.querySelector("svg");t&&(t.style.fill="var(--lion-text-secondary)")}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",style:{fill:"var(--lion-text-secondary)",pointerEvents:"none"}},a.createElement("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}))),a.createElement("div",{ref:ge,className:"wa-pinned-actions","data-drop-target":"header",onDragEnter:e=>{(e.dataTransfer.types.includes("feature-id")||0===e.dataTransfer.types.length)&&(e.preventDefault(),ne(!0))},onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="move",ne(!0);const t=Array.from(e.currentTarget.querySelectorAll("button.wa-pinned-action"));let n=t.length;for(let a=0;a<t.length;a++){const r=t[a].getBoundingClientRect(),o=r.left+r.width/2;if(e.clientX<o){n=a;break}}ee(n)},onDragLeave:e=>{const t=e.currentTarget.getBoundingClientRect();(e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom)&&(ne(!1),ee(null))},onDrop:e=>{e.preventDefault(),e.stopPropagation();const t=e.dataTransfer.getData("feature-id");ne(!1);const n=Z;if(ee(null),!t)return;!function(e,t){const n=Hp().filter(t=>t!==e),a=Math.max(0,Math.min(t,n.length));if(n.splice(a,0,e),n.length>14)for(let t=0;t<n.length;t++)if(n[t]!==e){n.splice(t,1);break}jp(n)}(t,null!==n?n:xe.length)},style:{flex:"1 1 0",minWidth:0,minHeight:"40px",height:"40px",background:te?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.1)":void 0,borderRadius:"10px",transition:"background 0.2s ease, border-color 0.2s ease",border:te?"2px dashed var(--lion-primary, #7C3AED)":"2px dashed transparent",padding:"0 8px",display:"flex",alignItems:"center",gap:"4px",justifyContent:"flex-start",overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none"}},0===xe.length&&a.createElement("span",{style:{fontSize:"11px",color:te?"var(--lion-primary)":"var(--lion-text-muted)",fontWeight:600,padding:"0 12px",whiteSpace:"nowrap",pointerEvents:"none"}},te?"⬇ Drop here to pin":"Drag features from Tools here"),xe.map((e,t)=>{const n=Lp[e],r=ye[e];if(!n||!r)return null;const o="aiBot"===e,i=Z===t;return a.createElement(a.Fragment,{key:e},i&&a.createElement("div",{style:{width:"3px",height:"32px",background:"var(--lion-primary)",borderRadius:"2px",flexShrink:0,boxShadow:"0 0 10px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.7)",pointerEvents:"none"}}),a.createElement("button",{className:"wa-pinned-action",onClick:r,title:`${h(n.titleKey,n.fallback)} — arraste para reordenar ou arraste para Ferramentas para desafixar`,style:{position:"relative"},draggable:!0,onDragStart:t=>{t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("feature-id",e),t.dataTransfer.setData("source","header"),t.currentTarget.style.opacity="0.4"},onDragEnd:e=>{e.currentTarget.style.opacity="1",ee(null),ne(!1)}},a.createElement("span",{className:"wa-pinned-action-icon",role:"img","aria-label":n.fallback,style:{WebkitMaskImage:`url(${Fp(n.icon)})`,maskImage:`url(${Fp(n.icon)})`}}),a.createElement("span",{className:"wa-pinned-action-label"},h(n.titleKey,n.fallback)),o&&c&&a.createElement("span",{className:"wa-pinned-action-badge",style:{background:d?"var(--lion-success)":"var(--lion-primary)"},title:d?"AI Bot Active":"AI Bot Outside Hours"})))}),Z===xe.length&&xe.length>0&&a.createElement("div",{style:{width:"3px",height:"32px",background:"var(--lion-primary)",borderRadius:"2px",flexShrink:0,boxShadow:"0 0 10px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.7)",pointerEvents:"none"}})),se&&oe&&a.createElement("button",{type:"button",onClick:()=>be("right"),title:"Scroll right",className:"wa-header-scroll-arrow",style:{flexShrink:0,width:"28px",height:"32px",background:"var(--lion-bg-primary)",border:"1px solid var(--lion-border-light)",borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",padding:0,transition:"all 0.15s ease",boxShadow:"0 1px 3px rgba(0,0,0,0.06)"},onMouseEnter:e=>{e.currentTarget.style.background="var(--lion-primary-light)",e.currentTarget.style.borderColor="var(--lion-primary)";const t=e.currentTarget.querySelector("svg");t&&(t.style.fill="var(--lion-primary)")},onMouseLeave:e=>{e.currentTarget.style.background="var(--lion-bg-primary)",e.currentTarget.style.borderColor="var(--lion-border-light)";const t=e.currentTarget.querySelector("svg");t&&(t.style.fill="var(--lion-text-secondary)")}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",style:{fill:"var(--lion-text-secondary)",pointerEvents:"none"}},a.createElement("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}))))),a.createElement("div",{className:"wa-header-right"},m&&m.isActive&&a.createElement("button",{className:"wa-broadcast-progress-btn",onClick:j,title:`Broadcasting: ${m.sent}/${m.total} (${m.percentage}%)`},a.createElement("div",{className:"progress-circle-container"},a.createElement(V,{percentage:m.percentage,size:32}),a.createElement("span",{className:"progress-text"},m.percentage,"%"))),!fe&&a.createElement("button",{className:"wa-header-btn wa-btn-activate",onClick:y},a.createElement("svg",{className:"wa-plus-icon",viewBox:"0 0 24 24",width:"15",height:"15"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),h("header.activateLicense")),a.createElement("div",{className:"wa-profile-container",ref:ue},a.createElement("button",{className:"wa-profile-btn "+(ce?"wa-profile-btn-has-pic":""),onClick:()=>Q(!J),title:me||h("profile.title")||"Profile"},ce?a.createElement("img",{src:ce,alt:"Profile",className:"wa-profile-pic",onError:()=>de("")}):a.createElement("svg",{className:"wa-profile-icon",viewBox:"0 0 24 24",width:"22",height:"22"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"}))),J&&a.createElement(Yu,{isLicensed:fe,currentPhone:o,currentTheme:i,planName:u,expiryDate:ve,profilePicUrl:ce,pushName:me,t:h,onLicenseKeyClick:P,onSettingsClick:L,onFeatureSettingsClick:U,onTutorialClick:F,onLanguageClick:z,onBackupClick:O,onPrivacyClick:W,onContactClick:q,onWebsiteClick:H,onClose:()=>Q(!1)})))))},Qu=({licenseStatus:e,currentPhone:t,currentTheme:n,licenseKey:r,loading:o,error:i,trialStatus:s,t:l,onLicenseKeyChange:c,onActivate:d,onDeactivate:m,onClose:p})=>{const[instCode,setInstCode]=(0,a.useState)("Carregando...");(0,a.useEffect)(()=>{chrome.storage.local.get("flowhatsapp_device_id",e=>{const t=e&&e.flowhatsapp_device_id;t&&setInstCode("FH-INST-"+t.replace(/-/g,"").substring(0,8).toUpperCase())})},[]);const u="dark"===n;return e?.isValid?a.createElement("div",{className:"wa-license-panel "+(u?"lion-dark":"")},a.createElement("div",{className:"wa-panel-content"},a.createElement("div",{className:"wa-panel-header"},a.createElement("h3",{className:"wa-panel-title"},a.createElement("svg",{className:"wa-title-icon",viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"})),l("licenseInfo.title")),a.createElement("button",{className:"wa-close-btn",onClick:p,title:l("common.close")},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"wa-info-grid"},a.createElement("div",{className:"wa-info-card"},a.createElement("div",{className:"wa-info-label"},l("licenseInfo.phoneNumber")),a.createElement("div",{className:"wa-info-value"},e.phoneNumber)),a.createElement("div",{className:"wa-info-card"},a.createElement("div",{className:"wa-info-label"},l("licenseInfo.expiresIn")),a.createElement("div",{className:"wa-info-value wa-value-highlight"},e.expiryDays," ",l("license.days"))),a.createElement("div",{className:"wa-info-card wa-card-full"},a.createElement("div",{className:"wa-info-label"},l("licenseInfo.status")),a.createElement("div",{className:"wa-info-value wa-value-success"},a.createElement("svg",{className:"wa-inline-icon",viewBox:"0 0 24 24"},a.createElement("circle",{cx:"12",cy:"12",r:"10",fill:"currentColor",opacity:"0.2"}),a.createElement("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})),e.message))),e.featuresEnabled&&e.featuresEnabled.length>0&&a.createElement("div",{className:"wa-features-section"},a.createElement("div",{className:"wa-section-label"},l("features.enabledFeatures")),a.createElement("div",{className:"wa-features-grid"},e.featuresEnabled.map(e=>a.createElement("div",{key:e,className:"wa-feature-card"},a.createElement("svg",{className:"wa-feature-icon",viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),a.createElement("span",{className:"wa-feature-name"},e.charAt(0).toUpperCase()+e.slice(1)))))),a.createElement("div",{className:"wa-panel-actions"},a.createElement("button",{className:"wa-btn wa-btn-danger",onClick:m},l("license.deactivateLicense"))))):a.createElement("div",{className:"wa-license-panel "+(u?"lion-dark":"")},a.createElement("div",{className:"wa-panel-content"},a.createElement("div",{className:"wa-panel-header"},a.createElement("h3",{className:"wa-panel-title"},a.createElement("svg",{className:"wa-title-icon",viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9z"})),l("license.activateTitle")),a.createElement("button",{className:"wa-close-btn",onClick:p,title:l("common.close")},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),t&&a.createElement("div",{className:"wa-phone-detected"},a.createElement("svg",{className:"wa-phone-icon",viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z"})),a.createElement("div",null,a.createElement("div",{className:"wa-phone-label"},l("license.phoneDetected")),a.createElement("div",{className:"wa-phone-value"},t))),a.createElement("div",{className:"wa-phone-detected",style:{marginTop:"10px",background:"rgba(37,99,235,0.06)",border:"1px solid rgba(37,99,235,0.15)"}},a.createElement("svg",{className:"wa-phone-icon",style:{color:"#7C3AED"},viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2h-4zM4 6h16v10H4V6z"})),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"}},a.createElement("div",null,a.createElement("div",{className:"wa-phone-label",style:{color:"#1e293b"}},"Código de Instalação (Gerado pela Extensão)"),a.createElement("div",{className:"wa-phone-value",style:{fontFamily:"monospace",color:"#7C3AED",userSelect:"all"}},instCode)),a.createElement("button",{title:"Copiar código",onClick:(()=>{let copied=!1;return()=>{if(copied)return;navigator.clipboard.writeText(instCode).then(()=>{copied=!0;const btn=document.activeElement;if(btn){const prev=btn.innerHTML;btn.innerHTML='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>';setTimeout(()=>{btn.innerHTML=prev;copied=!1;},1500)}}).catch(()=>{});}})(),style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"6px 10px",background:"rgba(37,99,235,0.1)",border:"1px solid rgba(37,99,235,0.3)",borderRadius:"8px",cursor:"pointer",color:"#7C3AED",transition:"all 0.15s",flexShrink:0}},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),a.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))))),"loading"===s&&a.createElement("div",{className:"wa-alert wa-alert-info",style:{textAlign:"center",padding:"20px 16px"}},a.createElement("svg",{className:"wa-spinner",viewBox:"0 0 24 24",style:{width:"24px",height:"24px",marginBottom:"8px"}},a.createElement("circle",{className:"wa-spinner-circle",cx:"12",cy:"12",r:"10",fill:"none",strokeWidth:"3"})),a.createElement("div",{style:{fontWeight:600,fontSize:"14px",marginTop:"8px"}},l("trial.starting"))),"activated"===s&&a.createElement("div",{className:"wa-alert",style:{background:ca.primaryLight,border:`1px solid ${ca.primary}`,color:ca.primary,textAlign:"center",padding:"20px 16px"}},a.createElement("svg",{viewBox:"0 0 24 24",style:{width:"28px",height:"28px",marginBottom:"8px"}},a.createElement("path",{fill:ca.primary,d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),a.createElement("div",{style:{fontWeight:600,fontSize:"14px",marginTop:"8px"}},l("trial.activated")),a.createElement("div",{style:{fontSize:"12px",marginTop:"4px",opacity:.8}},l("trial.daysRemaining").replace("{0}","7"))),"exists"===s&&a.createElement("div",{className:"wa-alert wa-alert-info",style:{marginBottom:"12px"}},a.createElement("svg",{className:"wa-alert-icon",viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})),a.createElement("span",null,l("trial.alreadyUsed"))),"loading"!==s&&"activated"!==s&&a.createElement(a.Fragment,null,a.createElement("div",{className:"wa-form-group"},a.createElement("label",{className:"wa-form-label"},l("license.licenseKey"),a.createElement("span",{className:"wa-form-required"},"*")),a.createElement("textarea",{className:"wa-form-textarea",placeholder:l("license.pasteLicenseHere"),value:r,onChange:e=>c(e.target.value),rows:4,disabled:o}),a.createElement("div",{className:"wa-form-hint"},l("license.completeLicenseKey"))),i&&a.createElement("div",{className:"wa-alert wa-alert-error"},a.createElement("svg",{className:"wa-alert-icon",viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})),a.createElement("span",null,i)),!t&&a.createElement("div",{className:"wa-alert wa-alert-info"},a.createElement("svg",{className:"wa-alert-icon",viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})),a.createElement("span",null,l("license.waitForWhatsApp"))),a.createElement("div",{className:"wa-panel-actions"},a.createElement("button",{className:"wa-btn wa-btn-secondary",onClick:p,disabled:o},l("common.cancel")),a.createElement("button",{className:"wa-btn wa-btn-primary",onClick:d,disabled:o||!r.trim()||!t},o?a.createElement(a.Fragment,null,a.createElement("svg",{className:"wa-spinner",viewBox:"0 0 24 24"},a.createElement("circle",{className:"wa-spinner-circle",cx:"12",cy:"12",r:"10",fill:"none",strokeWidth:"3"})),l("license.validating")):l("license.activateLicenseBtn"))))))},Zu=({licenseStatus:e,currentTheme:t,planName:n,t:r,onClose:o,onDeactivate:i,onChangeKey:s})=>{const l="dark"===t,c=new Date(Date.now()+24*e.expiryDays*60*60*1e3),d=`${e.phoneNumber}:${c.toISOString().split("T")[0]}:premium`;return a.createElement(a.Fragment,null,a.createElement("div",{className:"wa-modal-backdrop",onClick:o}),a.createElement("div",{className:"wa-plan-modal "+(l?"lion-dark":"")},a.createElement("div",{className:"wa-plan-modal-content"},a.createElement("div",{className:"wa-plan-modal-header"},a.createElement("h2",{className:"wa-plan-modal-title"},r("planDetails.title")),a.createElement("button",{className:"wa-modal-close",onClick:o},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"wa-plan-modal-body"},a.createElement("div",{className:"wa-plan-info-row"},a.createElement("span",{className:"wa-plan-label"},r("planDetails.licenceKey")," :"),a.createElement("div",{className:"wa-plan-value-with-copy"},a.createElement("span",{className:"wa-plan-value"},d),a.createElement("button",{className:"wa-copy-btn",onClick:()=>navigator.clipboard.writeText(d),title:r("common.copy")},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}))))),a.createElement("div",{className:"wa-plan-info-row"},a.createElement("span",{className:"wa-plan-label"},r("planDetails.planName")," :"),a.createElement("span",{className:"wa-plan-value"},n)),a.createElement("div",{className:"wa-plan-info-row"},a.createElement("span",{className:"wa-plan-label"},r("planDetails.endDate")," :"),a.createElement("span",{className:"wa-plan-value"},c.toLocaleDateString("en-GB",{day:"2-digit",month:"long",year:"numeric"})))),a.createElement("div",{className:"wa-plan-modal-footer"},a.createElement("button",{className:"wa-modal-btn wa-modal-btn-secondary",onClick:o},r("common.close")),a.createElement("button",{className:"wa-modal-btn wa-modal-btn-danger",onClick:()=>{o(),i()}},r("planDetails.removeKey")),a.createElement("button",{className:"wa-modal-btn wa-modal-btn-primary",onClick:()=>{o(),s()}},r("planDetails.changeKey"))))))},eg=`\n  /* Theme Variables */\n  ${ma}\n\n\n        /* CSS Variables - Layout */\n        :root {\n          --wa-header-height: 48px;\n          --wa-tab-bar-height: 36px;\n        }\n\n        /* Ensure full width layout - minimal approach */\n        html, body {\n          width: 100% !important;\n          max-width: 100% !important;\n          overflow-x: hidden !important;\n          margin: 0 !important;\n          padding: 0 !important;\n        }\n\n        #app {\n          width: 100% !important;\n          max-width: 100% !important;\n          margin: 0 !important;\n          padding: 0 !important;\n        }\n\n        /* Hide WhatsApp's top notification/announcement bars only */\n        div[data-testid="announcement-banner"],\n        div[data-testid="privacy-policy-banner"],\n        div[data-testid="popup-controls-ok"] {\n          display: none !important;\n          height: 0 !important;\n          overflow: hidden !important;\n        }\n\n        /* Header Container - WA Workflow exact approach */\n        #wa-extension-header-root {\n          position: fixed;\n          width: 100%;\n          height: auto;\n          z-index: 500;\n          left: 0;\n          top: 0;\n          pointer-events: none;\n          background: white;\n        }\n\n        /* Base Container */\n        .wa-extension-header {\n          position: relative;\n          width: 100%;\n          font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;\n          pointer-events: auto;\n        }\n\n        /* Header Bar - CRM Dark Theme */\n        .wa-header-bar {\n          background: var(--lion-header-gradient);\n          color: var(--lion-sidebar-text);\n          padding: 0 10px;\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          height: var(--wa-header-height);\n          position: relative;\n          top: 0;\n          left: 0;\n          right: 0;\n          width: 100%;\n          z-index: 250;\n          box-shadow: 0 1px 3px rgba(0,0,0,0.15);\n          border-bottom: 1px solid var(--lion-sidebar-border);\n          box-sizing: border-box;\n          transition: transform 0.3s ease, opacity 0.3s ease;\n        }\n\n        /* Header collapsed state */\n        .wa-header-bar.collapsed {\n          transform: translateY(-100%);\n          opacity: 0;\n          pointer-events: none;\n        }\n\n        .wa-extension-header.collapsed {\n          height: 0;\n          overflow: visible;\n        }\n\n        /* Toggle Button - Always visible on left edge */\n        .wa-header-toggle-btn {\n          position: absolute;\n          left: 0;\n          top: 50%;\n          transform: translateY(-50%);\n          width: 20px;\n          height: 56px;\n          background: linear-gradient(135deg, var(--lion-sidebar-start) 0%, var(--lion-sidebar-end) 100%);\n          border: none;\n          border-radius: 0 8px 8px 0;\n          cursor: pointer;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 260;\n          transition: all 0.3s ease;\n          color: white;\n          box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);\n        }\n\n        .wa-header-toggle-btn:hover {\n          width: 26px;\n          background: var(--lion-primary);\n        }\n\n        .wa-header-toggle-btn svg {\n          transition: transform 0.3s ease;\n        }\n\n        /* When collapsed, position toggle at top left corner */\n        .wa-header-toggle-btn.collapsed {\n          top: 8px;\n          transform: translateY(0);\n          height: 40px;\n          border-radius: 0 8px 8px 0;\n          box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.3);\n        }\n\n        .wa-header-left {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          flex: 1;\n          height: 100%;\n        }\n\n        .wa-brand {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          font-weight: 600;\n          font-size: 16px;\n        }\n\n        .wa-lock-icon {\n          width: 24px;\n          height: 24px;\n          stroke-width: 2;\n        }\n\n        .wa-brand-text {\n          font-weight: 700;\n          letter-spacing: -0.5px;\n        }\n\n        .wa-features-pills {\n          display: flex;\n          gap: 4px;\n          flex-wrap: wrap;\n        }\n\n        .wa-feature-pill {\n          background: rgba(255, 255, 255, 0.1);\n          padding: 2px 8px;\n          border-radius: 10px;\n          font-size: 10px;\n          font-weight: 500;\n          text-transform: capitalize;\n          border: 1px solid rgba(255, 255, 255, 0.15);\n          color: rgba(255, 255, 255, 0.7);\n        }\n\n        .wa-header-right {\n          display: flex;\n          align-items: center;\n          gap: 4px;\n          height: 100%;\n          flex-shrink: 0;\n        }\n\n        .wa-status-badge {\n          display: flex;\n          align-items: center;\n          gap: 4px;\n          padding: 3px 10px;\n          border-radius: 14px;\n          font-size: 11px;\n          font-weight: 500;\n        }\n\n        .wa-status-active {\n          background: rgba(255, 255, 255, 0.12);\n          border: 1px solid rgba(255, 255, 255, 0.2);\n        }\n\n        .wa-check-icon {\n          width: 14px;\n          height: 14px;\n        }\n\n        /* Header Buttons */\n        .wa-header-btn {\n          background: rgba(255, 255, 255, 0.08);\n          border: 1px solid rgba(255, 255, 255, 0.12);\n          color: rgba(255, 255, 255, 0.75);\n          padding: 6px 12px;\n          border-radius: 8px;\n          font-size: 12px;\n          font-weight: 500;\n          cursor: pointer;\n          display: flex;\n          align-items: center;\n          gap: 5px;\n          transition: all 0.15s ease;\n        }\n\n        .wa-header-btn:hover {\n          background: rgba(255, 255, 255, 0.18);\n          color: #ffffff;\n          border-color: rgba(255, 255, 255, 0.25);\n        }\n\n        .wa-btn-expand {\n          padding: 6px;\n        }\n\n        .wa-chevron {\n          width: 16px;\n          height: 16px;\n          transition: transform 0.3s ease;\n        }\n\n        .wa-chevron-up {\n          transform: rotate(180deg);\n        }\n\n        .wa-plus-icon {\n          width: 15px;\n          height: 15px;\n        }\n\n        .wa-tabs-icon {\n          width: 15px;\n          height: 15px;\n        }\n\n        /* Icon-only buttons */\n        .wa-btn-icon-only {\n          width: 36px;\n          height: 36px;\n          padding: 0;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          border-radius: 8px;\n          background: transparent;\n          border: none;\n        }\n\n        .wa-btn-icon-only:hover {\n          background: rgba(255, 255, 255, 0.12);\n        }\n\n        .wa-btn-icon-only .wa-icon {\n          width: 24px;\n          height: 24px;\n          opacity: 0.85;\n        }\n\n        .wa-btn-icon-only:hover .wa-icon {\n          opacity: 1;\n        }\n\n        .wa-btn-icon-only .wa-icon-img {\n          width: 24px;\n          height: 24px;\n          object-fit: contain;\n          opacity: 0.85;\n        }\n\n        .wa-btn-icon-only:hover .wa-icon-img {\n          opacity: 1;\n        }\n\n        /* Broadcast Progress Button */\n        .wa-broadcast-progress-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.2);\n          border: 1px solid var(--lion-primary);\n          border-radius: 8px;\n          padding: 4px;\n          cursor: pointer;\n          transition: all 0.2s ease;\n          animation: progressPulse 2s ease-in-out infinite;\n        }\n\n        .wa-broadcast-progress-btn:hover {\n          background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.35);\n          transform: scale(1.05);\n        }\n\n        .progress-circle-container {\n          position: relative;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 32px;\n          height: 32px;\n        }\n\n        .progress-text {\n          position: absolute;\n          font-size: 9px;\n          font-weight: 700;\n          color: white;\n        }\n\n        @keyframes progressPulse {\n          0%, 100% { box-shadow: 0 0 0 0 rgba(var(--lion-primary-rgb, 37, 99, 235), 0.5); }\n          50% { box-shadow: 0 0 0 6px rgba(var(--lion-primary-rgb, 37, 99, 235), 0); }\n        }\n\n        /* Overflow Dropdown Menu (More features) */\n        .wa-overflow-dropdown {\n          position: absolute;\n          top: calc(100% + 8px);\n          right: 0;\n          width: 220px;\n          background: var(--lion-sidebar-start);\n          border: 1px solid rgba(255, 255, 255, 0.15);\n          border-radius: 10px;\n          box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);\n          z-index: 10001;\n          animation: dropdownSlide 0.2s ease;\n          overflow: hidden;\n          padding: 4px 0;\n        }\n\n        .wa-overflow-menu-item {\n          width: 100%;\n          padding: 10px 14px;\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          background: none;\n          border: none;\n          cursor: pointer;\n          transition: background 0.15s ease;\n          font-size: 13px;\n          color: rgba(255, 255, 255, 0.85);\n          text-align: left;\n          font-family: inherit;\n        }\n\n        .wa-overflow-menu-item:hover {\n          background: rgba(255, 255, 255, 0.1);\n        }\n\n        .wa-overflow-icon {\n          width: 20px;\n          height: 20px;\n          object-fit: contain;\n          opacity: 0.85;\n        }\n\n        .wa-overflow-menu-item svg {\n          width: 20px;\n          height: 20px;\n          flex-shrink: 0;\n        }\n\n        .wa-overflow-divider {\n          height: 1px;\n          background: rgba(255, 255, 255, 0.1);\n          margin: 4px 0;\n        }\n\n        /* Profile Container & Button */\n        .wa-profile-container {\n          position: relative;\n        }\n\n        .wa-profile-btn {\n          background: transparent;\n          border: none;\n          color: white;\n          width: 36px;\n          height: 36px;\n          border-radius: 8px;\n          cursor: pointer;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.2s ease;\n          padding: 0;\n          opacity: 0.85;\n        }\n\n        .wa-profile-btn:hover {\n          background: rgba(255, 255, 255, 0.12);\n          opacity: 1;\n        }\n\n        .wa-profile-icon {\n          width: 24px;\n          height: 24px;\n        }\n\n        .wa-profile-btn-has-pic {\n          border-radius: 50%;\n          overflow: hidden;\n          padding: 0;\n          width: 32px;\n          height: 32px;\n          border: 2px solid rgba(255, 255, 255, 0.5);\n          opacity: 1;\n        }\n\n        .wa-profile-btn-has-pic:hover {\n          border-color: rgba(255, 255, 255, 0.9);\n          box-shadow: 0 0 0 2px rgba(var(--lion-primary-rgb), 0.3);\n        }\n\n        .wa-profile-pic {\n          width: 100%;\n          height: 100%;\n          object-fit: cover;\n          border-radius: 50%;\n        }\n\n        /* Profile Dropdown */\n        .wa-profile-dropdown {\n          position: absolute;\n          top: calc(100% + 12px);\n          right: 0;\n          width: 280px;\n          background: white;\n          border-radius: 12px;\n          box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);\n          border: 1px solid #e9edef;\n          z-index: 10000;\n          animation: dropdownSlide 0.2s ease;\n          overflow: hidden;\n        }\n\n        @keyframes dropdownSlide {\n          from {\n            opacity: 0;\n            transform: translateY(-8px);\n          }\n          to {\n            opacity: 1;\n            transform: translateY(0);\n          }\n        }\n\n        .wa-profile-dropdown-header {\n          padding: 16px;\n          background: var(--lion-header-gradient);\n          color: var(--lion-sidebar-text);\n          display: flex;\n          align-items: center;\n          gap: 12px;\n        }\n\n        .wa-profile-avatar {\n          width: 48px;\n          height: 48px;\n          border-radius: 50%;\n          background: rgba(255, 255, 255, 0.2);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          border: 2px solid rgba(255, 255, 255, 0.4);\n          flex-shrink: 0;\n        }\n\n        .wa-profile-avatar svg {\n          width: 28px;\n          height: 28px;\n        }\n\n        .wa-profile-info {\n          flex: 1;\n          min-width: 0;\n        }\n\n        .wa-device-name {\n          font-size: 14px;\n          font-weight: 600;\n          margin-bottom: 4px;\n        }\n\n        .wa-signature-name {\n          font-size: 12px;\n          opacity: 0.9;\n          overflow: hidden;\n          text-overflow: ellipsis;\n          white-space: nowrap;\n          margin-bottom: 6px;\n        }\n\n        .wa-plan-name {\n          font-size: 11px;\n          font-weight: 600;\n          opacity: 0.85;\n          margin-bottom: 3px;\n        }\n\n        .wa-expiry-date {\n          font-size: 10px;\n          opacity: 0.8;\n        }\n\n        .wa-dropdown-divider {\n          height: 1px;\n          background: #e9edef;\n          margin: 0;\n        }\n\n        .wa-dropdown-menu {\n          padding: 8px 0;\n        }\n\n        .wa-menu-item {\n          width: 100%;\n          padding: 12px 16px;\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          background: none;\n          border: none;\n          cursor: pointer;\n          transition: all 0.15s ease;\n          font-size: 14px;\n          color: #1f2937;\n          text-align: left;\n        }\n\n        .wa-menu-item:hover {\n          background: #f7f8fa;\n        }\n\n        .wa-menu-item svg {\n          width: 20px;\n          height: 20px;\n          color: #6b7280;\n          flex-shrink: 0;\n        }\n\n        .wa-menu-item span {\n          flex: 1;\n          font-weight: 500;\n        }\n\n        /* ========== PROFILE DROPDOWN DARK MODE ========== */\n        .wa-profile-dropdown.lion-dark {\n          background: #1a1a1a !important;\n          border-color: #3a3a3a !important;\n        }\n\n        .wa-profile-dropdown.lion-dark .wa-dropdown-divider {\n          background: #3a3a3a !important;\n        }\n\n        .wa-profile-dropdown.lion-dark .wa-menu-item {\n          color: #ffffff !important;\n        }\n\n        .wa-profile-dropdown.lion-dark .wa-menu-item:hover {\n          background: #262626 !important;\n        }\n\n        .wa-profile-dropdown.lion-dark .wa-menu-item svg {\n          color: #a0a0a0 !important;\n        }\n\n        /* License Panel - Dark mode */\n        .wa-license-panel.lion-dark {\n          background: #1a1a1a !important;\n          border-top-color: #3a3a3a !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-panel-title {\n          color: #ffffff !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-close-btn {\n          color: #a0a0a0 !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-close-btn:hover {\n          background: #333333 !important;\n          color: #ffffff !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-info-card {\n          background: #262626 !important;\n          border-color: #3a3a3a !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-info-label {\n          color: #a0a0a0 !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-info-value {\n          color: #ffffff !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-section-label {\n          color: #a0a0a0 !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-feature-card {\n          background: #262626 !important;\n          border-color: #3a3a3a !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-feature-name {\n          color: #ffffff !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-phone-detected {\n          background: #262626 !important;\n          border-color: #3a3a3a !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-phone-label {\n          color: #a0a0a0 !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-phone-value {\n          color: #ffffff !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-license-input {\n          background: #262626 !important;\n          border-color: #3a3a3a !important;\n          color: #ffffff !important;\n        }\n\n        .wa-license-panel.lion-dark .wa-license-input::placeholder {\n          color: #666666 !important;\n        }\n\n        /* License Panel - Overlay mode */\n        .wa-license-panel {\n          position: fixed;\n          top: 60px; /* Below the header which is at top: 0 */\n          left: 0;\n          right: 0;\n          background: #f7f8fa;\n          border-top: 1px solid #e9edef;\n          box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n          z-index: 2147483000;\n          max-height: calc(100vh - 120px);\n          overflow-y: auto;\n          animation: slideDown 0.3s ease;\n          pointer-events: auto;\n        }\n\n        @keyframes slideDown {\n          from {\n            opacity: 0;\n            transform: translateY(-10px);\n          }\n          to {\n            opacity: 1;\n            transform: translateY(0);\n          }\n        }\n\n        .wa-panel-content {\n          max-width: 800px;\n          margin: 0 auto;\n          padding: 24px;\n        }\n\n        .wa-panel-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          margin-bottom: 24px;\n        }\n\n        .wa-panel-title {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          font-size: 20px;\n          font-weight: 600;\n          color: #1f2937;\n          margin: 0;\n        }\n\n        .wa-title-icon {\n          width: 24px;\n          height: 24px;\n        }\n\n        .wa-close-btn {\n          background: transparent;\n          border: none;\n          color: #6b7280;\n          cursor: pointer;\n          padding: 4px;\n          border-radius: 6px;\n          transition: all 0.2s;\n          display: flex;\n          align-items: center;\n        }\n\n        .wa-close-btn:hover {\n          background: #e5e7eb;\n          color: #1f2937;\n        }\n\n        .wa-close-btn svg {\n          width: 20px;\n          height: 20px;\n        }\n\n        /* Info Grid */\n        .wa-info-grid {\n          display: grid;\n          grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n          gap: 16px;\n          margin-bottom: 24px;\n        }\n\n        .wa-info-card {\n          background: white;\n          padding: 16px;\n          border-radius: 12px;\n          border: 1px solid #e5e7eb;\n        }\n\n        .wa-card-full {\n          grid-column: 1 / -1;\n        }\n\n        .wa-info-label {\n          font-size: 12px;\n          font-weight: 500;\n          color: #6b7280;\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n          margin-bottom: 8px;\n        }\n\n        .wa-info-value {\n          font-size: 16px;\n          font-weight: 600;\n          color: #1f2937;\n        }\n\n        .wa-value-highlight {\n          color: var(--lion-primary);\n        }\n\n        .wa-value-success {\n          color: #059669;\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .wa-inline-icon {\n          width: 20px;\n          height: 20px;\n        }\n\n        /* Features Section */\n        .wa-features-section {\n          margin-bottom: 24px;\n        }\n\n        .wa-section-label {\n          font-size: 14px;\n          font-weight: 600;\n          color: #374151;\n          margin-bottom: 12px;\n        }\n\n        .wa-features-grid {\n          display: grid;\n          grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));\n          gap: 12px;\n        }\n\n        .wa-feature-card {\n          background: white;\n          padding: 12px 16px;\n          border-radius: 10px;\n          border: 1px solid #e5e7eb;\n          display: flex;\n          align-items: center;\n          gap: 10px;\n        }\n\n        .wa-feature-icon {\n          width: 20px;\n          height: 20px;\n          color: #059669;\n        }\n\n        .wa-feature-name {\n          font-size: 14px;\n          font-weight: 500;\n          color: #1f2937;\n        }\n\n        /* Phone Detected */\n        .wa-phone-detected {\n          background: white;\n          padding: 16px;\n          border-radius: 12px;\n          border: 1px solid #e5e7eb;\n          display: flex;\n          align-items: center;\n          gap: 14px;\n          margin-bottom: 20px;\n        }\n\n        .wa-phone-icon {\n          width: 40px;\n          height: 40px;\n          color: var(--lion-primary);\n          flex-shrink: 0;\n        }\n\n        .wa-phone-label {\n          font-size: 12px;\n          font-weight: 500;\n          color: #6b7280;\n          margin-bottom: 4px;\n        }\n\n        .wa-phone-value {\n          font-size: 16px;\n          font-weight: 600;\n          color: #1f2937;\n        }\n\n        /* Form Elements */\n        .wa-form-group {\n          margin-bottom: 20px;\n        }\n\n        .wa-form-label {\n          display: block;\n          font-size: 14px;\n          font-weight: 600;\n          color: var(--lion-text-secondary);\n          margin-bottom: 8px;\n        }\n\n        .wa-form-required {\n          color: var(--lion-error);\n          margin-left: 4px;\n        }\n\n        .wa-form-textarea {\n          width: 100%;\n          padding: 12px 16px;\n          border: 2px solid var(--lion-border-light);\n          border-radius: 10px;\n          font-family: 'Courier New', monospace;\n          font-size: 13px;\n          resize: vertical;\n          transition: all 0.2s;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-primary);\n        }\n\n        .wa-form-textarea::placeholder {\n          color: var(--lion-text-muted);\n        }\n\n        .wa-form-textarea:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.1);\n        }\n\n        .wa-form-textarea:disabled {\n          background: var(--lion-bg-secondary);\n          cursor: not-allowed;\n        }\n\n        .wa-form-hint {\n          font-size: 12px;\n          color: var(--lion-text-muted);\n          margin-top: 6px;\n        }\n\n        /* Alerts */\n        .wa-alert {\n          padding: 12px 16px;\n          border-radius: 10px;\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          margin-bottom: 16px;\n          font-size: 14px;\n        }\n\n        .wa-alert-icon {\n          width: 20px;\n          height: 20px;\n          flex-shrink: 0;\n        }\n\n        .wa-alert-error {\n          background: #fef2f2;\n          color: #dc2626;\n          border: 1px solid #fecaca;\n        }\n\n        .wa-alert-info {\n          background: #eff6ff;\n          color: #7C3AED;\n          border: 1px solid #bfdbfe;\n        }\n\n        /* Panel Actions */\n        .wa-panel-actions {\n          display: flex;\n          gap: 12px;\n          justify-content: flex-end;\n          padding-top: 16px;\n          border-top: 1px solid #e5e7eb;\n        }\n\n        .wa-btn {\n          padding: 10px 20px;\n          border-radius: 8px;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n          border: none;\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          justify-content: center;\n        }\n\n        .wa-btn:disabled {\n          opacity: 0.5;\n          cursor: not-allowed;\n        }\n\n        .wa-btn-primary {\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        .wa-btn-primary:hover:not(:disabled) {\n          transform: translateY(-2px);\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.3);\n        }\n\n        .wa-btn-secondary {\n          background: white;\n          color: #374151;\n          border: 1px solid #d1d5db;\n        }\n\n        .wa-btn-secondary:hover:not(:disabled) {\n          background: #f9fafb;\n          border-color: #9ca3af;\n        }\n\n        .wa-btn-danger {\n          background: var(--lion-error);\n          color: white;\n        }\n\n        .wa-btn-danger:hover:not(:disabled) {\n          background: #dc2626;\n          transform: translateY(-2px);\n          box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);\n        }\n\n        /* Spinner */\n        .wa-spinner {\n          width: 16px;\n          height: 16px;\n          animation: spin 1s linear infinite;\n        }\n\n        .wa-spinner-circle {\n          stroke: currentColor;\n          stroke-linecap: round;\n          stroke-dasharray: 50;\n          stroke-dashoffset: 25;\n        }\n\n        @keyframes spin {\n          to {\n            transform: rotate(360deg);\n          }\n        }\n\n        /* Security Footer */\n        .wa-security-footer {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 8px;\n          margin-top: 20px;\n          padding-top: 16px;\n          border-top: 1px solid #e5e7eb;\n          font-size: 12px;\n          color: #6b7280;\n        }\n\n        .wa-security-icon {\n          width: 16px;\n          height: 16px;\n        }\n\n        /* Responsive */\n        @media (max-width: 640px) {\n          .wa-panel-content {\n            padding: 16px;\n          }\n\n          .wa-info-grid {\n            grid-template-columns: 1fr;\n          }\n\n          .wa-features-grid {\n            grid-template-columns: 1fr;\n          }\n\n          .wa-panel-actions {\n            flex-direction: column;\n          }\n\n          .wa-btn {\n            width: 100%;\n          }\n        }\n\n        /* Backdrop for overlay panel */\n        .wa-backdrop {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.4);\n          z-index: 9998;\n          animation: fadeIn 0.3s ease;\n        }\n\n        @keyframes fadeIn {\n          from {\n            opacity: 0;\n          }\n          to {\n            opacity: 1;\n          }\n        }\n\n        /* Plan Details Modal */\n        .wa-modal-backdrop {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.5);\n          z-index: 10000;\n          animation: fadeIn 0.2s ease;\n        }\n\n        .wa-plan-modal {\n          position: fixed;\n          top: 50%;\n          left: 50%;\n          transform: translate(-50%, -50%);\n          background: white;\n          border-radius: 16px;\n          box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n          z-index: 10001;\n          width: 90%;\n          max-width: 500px;\n          animation: modalSlide 0.3s ease;\n        }\n\n        @keyframes modalSlide {\n          from {\n            opacity: 0;\n            transform: translate(-50%, -48%);\n          }\n          to {\n            opacity: 1;\n            transform: translate(-50%, -50%);\n          }\n        }\n\n        .wa-plan-modal-content {\n          display: flex;\n          flex-direction: column;\n        }\n\n        .wa-plan-modal-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 24px 24px 20px 24px;\n          border-bottom: 1px solid #e5e7eb;\n        }\n\n        .wa-plan-modal-title {\n          font-size: 20px;\n          font-weight: 600;\n          color: #1f2937;\n          margin: 0;\n        }\n\n        .wa-modal-close {\n          background: transparent;\n          border: none;\n          color: #6b7280;\n          cursor: pointer;\n          padding: 4px;\n          border-radius: 6px;\n          transition: all 0.2s;\n          display: flex;\n          align-items: center;\n        }\n\n        .wa-modal-close:hover {\n          background: #f3f4f6;\n          color: #1f2937;\n        }\n\n        .wa-modal-close svg {\n          width: 24px;\n          height: 24px;\n        }\n\n        .wa-plan-modal-body {\n          padding: 24px;\n          display: flex;\n          flex-direction: column;\n          gap: 20px;\n        }\n\n        .wa-plan-info-row {\n          display: flex;\n          flex-direction: column;\n          gap: 8px;\n        }\n\n        .wa-plan-label {\n          font-size: 13px;\n          font-weight: 500;\n          color: #6b7280;\n        }\n\n        .wa-plan-value {\n          font-size: 15px;\n          font-weight: 500;\n          color: #1f2937;\n        }\n\n        .wa-plan-value-with-copy {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          background: #f9fafb;\n          padding: 10px 12px;\n          border-radius: 8px;\n          border: 1px solid #e5e7eb;\n        }\n\n        .wa-plan-value-with-copy .wa-plan-value {\n          flex: 1;\n          word-break: break-all;\n          font-family: 'Courier New', monospace;\n          font-size: 13px;\n        }\n\n        .wa-copy-btn {\n          background: transparent;\n          border: none;\n          color: #6b7280;\n          cursor: pointer;\n          padding: 6px;\n          border-radius: 6px;\n          transition: all 0.2s;\n          display: flex;\n          align-items: center;\n          flex-shrink: 0;\n        }\n\n        .wa-copy-btn:hover {\n          background: #e5e7eb;\n          color: #1f2937;\n        }\n\n        .wa-copy-btn svg {\n          width: 18px;\n          height: 18px;\n        }\n\n        .wa-plan-modal-footer {\n          padding: 20px 24px;\n          border-top: 1px solid #e5e7eb;\n          display: flex;\n          gap: 12px;\n          justify-content: flex-end;\n        }\n\n        .wa-modal-btn {\n          padding: 10px 20px;\n          border-radius: 8px;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n          border: none;\n        }\n\n        .wa-modal-btn-secondary {\n          background: #f3f4f6;\n          color: #374151;\n        }\n\n        .wa-modal-btn-secondary:hover {\n          background: #e5e7eb;\n        }\n\n        .wa-modal-btn-danger {\n          background: var(--lion-error);\n          color: white;\n        }\n\n        .wa-modal-btn-danger:hover {\n          background: #dc2626;\n          transform: translateY(-1px);\n          box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);\n        }\n\n        .wa-modal-btn-primary {\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        .wa-modal-btn-primary:hover {\n          background: var(--lion-primary-hover);\n          transform: translateY(-1px);\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.3);\n        }\n\n        /* ========== PLAN MODAL DARK MODE ========== */\n        .wa-plan-modal.lion-dark {\n          background: #1a1a1a !important;\n        }\n\n        .wa-plan-modal.lion-dark .wa-plan-modal-header {\n          border-bottom-color: #3a3a3a !important;\n        }\n\n        .wa-plan-modal.lion-dark .wa-plan-modal-title {\n          color: #ffffff !important;\n        }\n\n        .wa-plan-modal.lion-dark .wa-modal-close {\n          color: #a0a0a0 !important;\n        }\n\n        .wa-plan-modal.lion-dark .wa-modal-close:hover {\n          background: #333333 !important;\n          color: #ffffff !important;\n        }\n\n        .wa-plan-modal.lion-dark .wa-plan-label {\n          color: #a0a0a0 !important;\n        }\n\n        .wa-plan-modal.lion-dark .wa-plan-value {\n          color: #ffffff !important;\n        }\n\n        .wa-plan-modal.lion-dark .wa-plan-value-with-copy {\n          background: #262626 !important;\n          border-color: #3a3a3a !important;\n        }\n\n        .wa-plan-modal.lion-dark .wa-copy-btn {\n          color: #a0a0a0 !important;\n        }\n\n        .wa-plan-modal.lion-dark .wa-copy-btn:hover {\n          background: #333333 !important;\n          color: #ffffff !important;\n        }\n\n        .wa-plan-modal.lion-dark .wa-plan-modal-footer {\n          border-top-color: #3a3a3a !important;\n        }\n\n        .wa-plan-modal.lion-dark .wa-modal-btn-secondary {\n          background: #333333 !important;\n          color: #ffffff !important;\n        }\n\n        .wa-plan-modal.lion-dark .wa-modal-btn-secondary:hover {\n          background: #444444 !important;\n        }\n\n        /* Language Modal */\n        .wa-language-modal {\n          position: fixed;\n          top: 50%;\n          left: 50%;\n          transform: translate(-50%, -50%);\n          background: white;\n          border-radius: 16px;\n          box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n          z-index: 10001;\n          width: 90%;\n          max-width: 600px;\n          animation: modalSlide 0.3s ease;\n          max-height: 80vh;\n          overflow: hidden;\n          display: flex;\n          flex-direction: column;\n          pointer-events: auto;\n        }\n\n        .wa-language-modal-content {\n          display: flex;\n          flex-direction: column;\n          height: 100%;\n        }\n\n        .wa-language-modal-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 24px;\n          border-bottom: 1px solid #e5e7eb;\n          flex-shrink: 0;\n        }\n\n        .wa-language-modal-title {\n          font-size: 20px;\n          font-weight: 600;\n          color: #1f2937;\n          margin: 0;\n        }\n\n        .wa-language-modal-body {\n          padding: 24px;\n          overflow-y: auto;\n          flex: 1;\n        }\n\n        .wa-language-grid {\n          display: grid;\n          grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));\n          gap: 12px;\n        }\n\n        .wa-language-item {\n          position: relative;\n          background: white;\n          border: 2px solid #e5e7eb;\n          border-radius: 12px;\n          padding: 16px 12px;\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          gap: 8px;\n          cursor: pointer;\n          transition: all 0.2s ease;\n          text-align: center;\n          pointer-events: auto;\n        }\n\n        .wa-language-item:hover {\n          border-color: var(--lion-primary-hover);\n          background: var(--lion-primary-light, #eff6ff);\n          transform: translateY(-2px);\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15);\n        }\n\n        .wa-language-active {\n          border-color: var(--lion-primary) !important;\n          background: var(--lion-primary-light, #eff6ff) !important;\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.1) !important;\n        }\n\n        .wa-language-flag {\n          width: 48px;\n          height: 48px;\n          background: var(--lion-primary);\n          color: white;\n          border-radius: 50%;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          font-size: 14px;\n          font-weight: 700;\n          letter-spacing: -0.5px;\n        }\n\n        .wa-language-name {\n          font-size: 13px;\n          font-weight: 500;\n          color: #1f2937;\n          line-height: 1.3;\n        }\n\n        .wa-language-choose {\n          color: var(--lion-primary-hover);\n          font-weight: 600;\n          font-size: 12px;\n        }\n\n        .wa-language-check {\n          position: absolute;\n          top: 8px;\n          right: 8px;\n          width: 20px;\n          height: 20px;\n          color: var(--lion-primary-hover);\n        }\n\n        @media (max-width: 640px) {\n          .wa-language-grid {\n            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));\n            gap: 10px;\n          }\n\n          .wa-language-item {\n            padding: 14px 10px;\n          }\n\n          .wa-language-flag {\n            width: 40px;\n            height: 40px;\n            font-size: 12px;\n          }\n\n          .wa-language-name {\n            font-size: 12px;\n          }\n        }\n\n        /* Language Modal - Dark mode */\n        .wa-language-modal.lion-dark {\n          background: #1a1a1a !important;\n        }\n\n        .wa-language-modal.lion-dark .wa-language-modal-header {\n          border-bottom: 1px solid #3a3a3a !important;\n        }\n\n        .wa-language-modal.lion-dark .wa-language-modal-title {\n          color: #ffffff !important;\n        }\n\n        .wa-language-modal.lion-dark .wa-modal-close {\n          color: #a0a0a0 !important;\n        }\n\n        .wa-language-modal.lion-dark .wa-modal-close:hover {\n          background: #262626 !important;\n          color: #ffffff !important;\n        }\n\n        .wa-language-modal.lion-dark .wa-language-item {\n          background: #262626 !important;\n          border-color: #3a3a3a !important;\n        }\n\n        .wa-language-modal.lion-dark .wa-language-item:hover {\n          background: #333333 !important;\n          border-color: var(--lion-primary) !important;\n        }\n\n        .wa-language-modal.lion-dark .wa-language-active {\n          background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15) !important;\n          border-color: var(--lion-primary) !important;\n        }\n\n        .wa-language-modal.lion-dark .wa-language-name {\n          color: #ffffff !important;\n        }\n\n        /* CRM Stages Bar Styles */\n        .wa-crm-stages-bar {\n          position: fixed;\n          top: 60px;\n          left: 0;\n          right: 0;\n          height: 36px;\n          background: var(--lion-bg-primary);\n          border-bottom: 1px solid var(--lion-border-light);\n          display: flex;\n          align-items: center;\n          padding: 0 10px;\n          gap: 8px;\n          z-index: 9998;\n        }\n\n        .wa-crm-back-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 24px;\n          height: 24px;\n          border: none;\n          background: var(--lion-bg-tertiary);\n          border-radius: 6px;\n          cursor: pointer;\n          color: var(--lion-text-muted);\n          transition: all 0.15s ease;\n          flex-shrink: 0;\n        }\n\n        .wa-crm-back-btn:hover {\n          background: var(--lion-border-light);\n          color: var(--lion-text-primary);\n        }\n\n        .wa-crm-name {\n          font-size: 11px;\n          font-weight: 600;\n          color: var(--lion-text-secondary);\n          flex-shrink: 0;\n          padding-right: 8px;\n          border-right: 1px solid var(--lion-border-light);\n          letter-spacing: 0.01em;\n        }\n\n        .wa-crm-stages-list {\n          display: flex;\n          align-items: center;\n          gap: 5px;\n          overflow-x: auto;\n          overflow-y: hidden;\n          flex: 1;\n          padding: 2px 0;\n          scrollbar-width: none;\n        }\n\n        .wa-crm-stages-list::-webkit-scrollbar {\n          display: none;\n        }\n\n        .wa-crm-stage-btn {\n          display: flex;\n          align-items: center;\n          gap: 5px;\n          padding: 3px 10px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 14px;\n          cursor: pointer;\n          transition: all 0.15s ease;\n          white-space: nowrap;\n          flex-shrink: 0;\n        }\n\n        .wa-crm-stage-btn:hover {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-medium);\n        }\n\n        .wa-crm-stage-btn.active {\n          background: var(--lion-primary);\n          border-color: var(--lion-primary) !important;\n        }\n\n        .wa-stage-color-dot {\n          width: 8px;\n          height: 8px;\n          border-radius: 50%;\n          flex-shrink: 0;\n        }\n\n        .wa-crm-stage-btn.active .wa-stage-color-dot {\n          box-shadow: 0 0 0 2px rgba(255,255,255,0.4);\n        }\n\n        .wa-stage-name {\n          font-size: 11px;\n          font-weight: 500;\n          color: var(--lion-text-muted);\n          letter-spacing: 0.01em;\n        }\n\n        .wa-crm-stage-btn:hover .wa-stage-name {\n          color: var(--lion-text-secondary);\n        }\n\n        .wa-crm-stage-btn.active .wa-stage-name {\n          color: #ffffff;\n          font-weight: 600;\n        }\n\n        /* CRM Stages Bar - Dark Mode */\n        .lion-dark .wa-crm-stages-bar {\n          background: #1a1a1a;\n          border-bottom-color: #2a2a2a;\n        }\n\n        .lion-dark .wa-crm-back-btn {\n          background: #2a2a2a;\n          color: #a0a0a0;\n        }\n\n        .lion-dark .wa-crm-back-btn:hover {\n          background: #3a3a3a;\n          color: #ffffff;\n        }\n\n        .lion-dark .wa-crm-name {\n          color: #e0e0e0;\n          border-right-color: #2a2a2a;\n        }\n\n        .lion-dark .wa-crm-stage-btn {\n          background: #262626;\n          border-color: #3a3a3a;\n        }\n\n        .lion-dark .wa-crm-stage-btn:hover {\n          background: #2a2a2a;\n        }\n\n        .lion-dark .wa-stage-name {\n          color: #a0a0a0;\n        }\n\n        .lion-dark .wa-crm-stage-btn:hover .wa-stage-name {\n          color: #e0e0e0;\n        }\n\n        .lion-dark .wa-crm-stage-btn.active .wa-stage-name {\n          color: #ffffff;\n        }\n\n        /* Missed Schedule Popup Styles */\n        .missed-schedule-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.6);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 99999;\n          backdrop-filter: blur(4px);\n        }\n\n        .missed-schedule-popup {\n          background: white;\n          border-radius: 20px;\n          padding: 32px;\n          width: 420px;\n          max-width: 90vw;\n          box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n          animation: missedPopupSlideIn 0.3s ease-out;\n          pointer-events: auto;\n          position: relative;\n          z-index: 100000;\n        }\n\n        @keyframes missedPopupSlideIn {\n          from {\n            opacity: 0;\n            transform: scale(0.9) translateY(-20px);\n          }\n          to {\n            opacity: 1;\n            transform: scale(1) translateY(0);\n          }\n        }\n\n        .missed-schedule-header {\n          text-align: center;\n          margin-bottom: 24px;\n        }\n\n        .missed-schedule-icon {\n          margin-bottom: 16px;\n        }\n\n        .missed-schedule-header h2 {\n          font-size: 22px;\n          font-weight: 600;\n          color: var(--lion-sidebar-start);\n          margin: 0 0 8px 0;\n        }\n\n        .missed-schedule-header p {\n          font-size: 14px;\n          color: #64748b;\n          margin: 0;\n          line-height: 1.5;\n        }\n\n        .missed-schedule-info {\n          display: flex;\n          justify-content: space-around;\n          background: #dbeafe;\n          border: 1px solid #60a5fa;\n          border-radius: 12px;\n          padding: 20px;\n          margin-bottom: 24px;\n        }\n\n        .missed-schedule-stat {\n          text-align: center;\n        }\n\n        .missed-schedule-stat .stat-value {\n          display: block;\n          font-size: 24px;\n          font-weight: 700;\n          color: #1e3a8a;\n        }\n\n        .missed-schedule-stat.warning .stat-value {\n          color: #dc2626;\n        }\n\n        .missed-schedule-stat .stat-label {\n          display: block;\n          font-size: 11px;\n          color: #1e3a8a;\n          margin-top: 4px;\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n        }\n\n        .missed-schedule-actions {\n          display: flex;\n          flex-direction: column;\n          gap: 12px;\n        }\n\n        .missed-schedule-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 8px;\n          padding: 14px 24px;\n          border-radius: 12px;\n          font-size: 15px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n          border: none;\n          pointer-events: auto;\n          position: relative;\n          z-index: 100001;\n        }\n\n        .missed-schedule-btn.primary {\n          background: linear-gradient(135deg, #0ea5e9, #6D28D9);\n          color: white;\n        }\n\n        .missed-schedule-btn.primary:hover {\n          transform: translateY(-2px);\n          box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);\n        }\n\n        .missed-schedule-btn.secondary {\n          background: #f1f5f9;\n          color: #64748b;\n        }\n\n        .missed-schedule-btn.secondary:hover {\n          background: #e2e8f0;\n          color: #475569;\n        }\n\n        .missed-schedule-btn.dismiss {\n          background: transparent;\n          color: #94a3b8;\n          border: 1px dashed #cbd5e1;\n          padding: 10px 24px;\n          font-size: 13px;\n        }\n\n        .missed-schedule-btn.dismiss:hover {\n          background: #f8fafc;\n          color: #64748b;\n          border-color: #94a3b8;\n        }\n\n        /* AI Settings Modal */\n        .wa-ai-settings-modal {\n          position: fixed;\n          top: 50%;\n          left: 50%;\n          transform: translate(-50%, -50%);\n          background: white;\n          border-radius: 16px;\n          box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n          z-index: 200001;\n          width: 90%;\n          max-width: 450px;\n          animation: modalSlide 0.3s ease;\n        }\n\n        .wa-ai-settings-content {\n          display: flex;\n          flex-direction: column;\n        }\n\n        .wa-ai-settings-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 20px 24px 16px 24px;\n          border-bottom: 1px solid #e5e7eb;\n        }\n\n        .wa-ai-settings-title {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          font-size: 18px;\n          font-weight: 600;\n          color: #1f2937;\n        }\n\n        .wa-ai-help-btn {\n          background: transparent;\n          border: none;\n          color: #9ca3af;\n          cursor: pointer;\n          padding: 4px;\n          display: flex;\n          align-items: center;\n          transition: color 0.2s;\n        }\n\n        .wa-ai-help-btn:hover {\n          color: #6b7280;\n        }\n\n        .wa-ai-settings-body {\n          padding: 20px 24px;\n          display: flex;\n          flex-direction: column;\n          gap: 20px;\n        }\n\n        .wa-ai-form-group {\n          display: flex;\n          flex-direction: column;\n          gap: 8px;\n        }\n\n        .wa-ai-form-label {\n          font-size: 13px;\n          font-weight: 600;\n          color: #374151;\n        }\n\n        .wa-ai-platform-options {\n          display: flex;\n          gap: 10px;\n        }\n\n        .wa-ai-platform-option {\n          flex: 1;\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          gap: 8px;\n          padding: 14px 10px;\n          border: 2px solid #e5e7eb;\n          border-radius: 12px;\n          cursor: pointer;\n          transition: all 0.2s;\n          background: #fafafa;\n        }\n\n        .wa-ai-platform-option:hover {\n          border-color: #d1d5db;\n          background: #f5f5f5;\n        }\n\n        .wa-ai-platform-option.active {\n          border-color: var(--lion-primary);\n          background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.05);\n        }\n\n        .wa-ai-platform-option input {\n          display: none;\n        }\n\n        .wa-ai-platform-icon {\n          width: 36px;\n          height: 36px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          background: white;\n          border-radius: 10px;\n          box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);\n        }\n\n        .wa-ai-platform-name {\n          font-size: 11px;\n          font-weight: 600;\n          color: #6b7280;\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n        }\n\n        .wa-ai-platform-option.active .wa-ai-platform-name {\n          color: var(--lion-primary);\n        }\n\n        .wa-ai-input {\n          padding: 12px 14px;\n          border: 1px solid #e5e7eb;\n          border-radius: 10px;\n          font-size: 14px;\n          color: #1f2937;\n          transition: border-color 0.2s, box-shadow 0.2s;\n          background: #fafafa;\n        }\n\n        .wa-ai-input:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.1);\n          background: white;\n        }\n\n        .wa-ai-input::placeholder {\n          color: #9ca3af;\n        }\n\n        .wa-required {\n          color: var(--lion-error);\n        }\n\n        .wa-ai-note {\n          font-size: 12px;\n          color: #6b7280;\n          line-height: 1.5;\n          padding: 10px 12px;\n          background: #f9fafb;\n          border-radius: 8px;\n          border-left: 3px solid var(--lion-primary);\n        }\n\n        .wa-ai-note a {\n          color: var(--lion-primary);\n          text-decoration: none;\n        }\n\n        .wa-ai-note a:hover {\n          text-decoration: underline;\n        }\n\n        .wa-ai-toggle-group {\n          flex-direction: row;\n          justify-content: space-between;\n          align-items: center;\n          padding: 12px 16px;\n          background: #f9fafb;\n          border-radius: 10px;\n        }\n\n        .wa-ai-toggle {\n          width: 48px;\n          height: 26px;\n          border-radius: 13px;\n          background: #d1d5db;\n          border: none;\n          cursor: pointer;\n          position: relative;\n          transition: background 0.3s;\n          padding: 0;\n        }\n\n        .wa-ai-toggle.active {\n          background: var(--lion-primary);\n        }\n\n        .wa-ai-toggle-knob {\n          position: absolute;\n          top: 3px;\n          left: 3px;\n          width: 20px;\n          height: 20px;\n          border-radius: 50%;\n          background: white;\n          box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n          transition: transform 0.3s;\n        }\n\n        .wa-ai-toggle.active .wa-ai-toggle-knob {\n          transform: translateX(22px);\n        }\n\n        .wa-ai-settings-footer {\n          padding: 16px 24px;\n          border-top: 1px solid #e5e7eb;\n          display: flex;\n          gap: 12px;\n          justify-content: flex-end;\n        }\n\n        .wa-ai-btn {\n          padding: 10px 20px;\n          border-radius: 10px;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n          border: none;\n        }\n\n        .wa-ai-btn-secondary {\n          background: #f3f4f6;\n          color: #374151;\n        }\n\n        .wa-ai-btn-secondary:hover {\n          background: #e5e7eb;\n        }\n\n        .wa-ai-btn-primary {\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        .wa-ai-btn-primary:hover {\n          background: var(--lion-primary-hover);\n          transform: translateY(-1px);\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.3);\n        }\n\n        /* ============================================ */\n        /* ========== NEW REDESIGN STYLES v2 ========== */\n        /* ============================================ */\n\n        /* Override root container background */\n        #wa-extension-header-root {\n          background: var(--lion-header-bg) !important;\n        }\n\n        /* === HEADER BAR (Tier 1) - Clean White/Dark === */\n        .wa-extension-header .wa-header-bar {\n          background: var(--lion-header-bg) !important;\n          color: var(--lion-header-text) !important;\n          height: 52px !important;\n          padding: 0 16px !important;\n          box-shadow: none !important;\n          border-bottom: 1px solid var(--lion-header-border) !important;\n          gap: 12px;\n        }\n\n        /* === Toggle Button - Subtle orange accent === */\n        .wa-extension-header .wa-header-toggle-btn {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          width: 18px !important;\n          box-shadow: 1px 0 6px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.25) !important;\n        }\n\n        .wa-extension-header .wa-header-toggle-btn:hover {\n          width: 24px !important;\n          background: var(--lion-primary-hover) !important;\n        }\n\n        /* === BRAND BLOCK - Logo + Brand Text === */\n        .wa-brand-block {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          padding: 0 4px 0 10px;\n          height: 100%;\n          flex-shrink: 0;\n        }\n\n        .wa-brand-logo {\n          width: 32px;\n          height: 32px;\n          border-radius: 8px;\n          object-fit: contain;\n          background: var(--lion-primary);\n          padding: 3px;\n          box-shadow: 0 2px 6px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.25);\n          flex-shrink: 0;\n        }\n\n        .wa-brand-info {\n          display: flex;\n          flex-direction: column;\n          justify-content: center;\n          line-height: 1;\n        }\n\n        .wa-brand-text {\n          font-size: 15px;\n          font-weight: 700;\n          color: var(--lion-header-text);\n          letter-spacing: -0.3px;\n          white-space: nowrap;\n        }\n\n        .wa-brand-version {\n          font-size: 10px;\n          font-weight: 600;\n          color: var(--lion-header-text-muted);\n          letter-spacing: 0.3px;\n          margin-top: 1px;\n        }\n\n        .wa-brand-divider {\n          width: 1px;\n          height: 24px;\n          background: var(--lion-header-border);\n          margin: 0 4px;\n        }\n\n        /* === PINNED ACTIONS - Icon + Label Buttons === */\n        .wa-pinned-actions {\n          display: flex;\n          align-items: center;\n          gap: 4px;\n          height: 100%;\n          flex: 1 1 0;\n          min-width: 0;\n          overflow-x: auto;\n          overflow-y: hidden;\n          scrollbar-width: none;\n          -ms-overflow-style: none;\n        }\n\n        .wa-pinned-actions::-webkit-scrollbar {\n          display: none;\n        }\n\n        .wa-pinned-action {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          padding: 8px 12px;\n          background: transparent;\n          border: 1px solid transparent;\n          border-radius: 8px;\n          color: var(--lion-header-text-muted);\n          cursor: pointer;\n          transition: all 0.15s ease;\n          font-size: 13px;\n          font-weight: 500;\n          white-space: nowrap;\n          height: 36px;\n          flex-shrink: 0;\n        }\n\n        .wa-pinned-action:hover {\n          background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.08);\n          color: var(--lion-primary);\n          border-color: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.2);\n        }\n\n        .wa-pinned-action .wa-pinned-action-icon {\n          width: 18px;\n          height: 18px;\n          flex-shrink: 0;\n          display: block;\n          background-color: #52525b; /* neutral gray silhouette */\n          -webkit-mask-position: center;\n          mask-position: center;\n          -webkit-mask-repeat: no-repeat;\n          mask-repeat: no-repeat;\n          -webkit-mask-size: contain;\n          mask-size: contain;\n          transition: background-color 0.15s ease;\n        }\n\n        .wa-pinned-action:hover .wa-pinned-action-icon {\n          /* On hover, tint to brand primary — driven by CSS var, not filter */\n          background-color: var(--lion-primary);\n        }\n\n        .lion-dark .wa-pinned-action .wa-pinned-action-icon {\n          background-color: #bfbfbf; /* light gray silhouette in dark mode */\n        }\n\n        .lion-dark .wa-pinned-action:hover .wa-pinned-action-icon {\n          background-color: var(--lion-primary);\n        }\n\n        .wa-pinned-action-label {\n          font-size: 13px;\n          font-weight: 500;\n        }\n\n        /* Active state indicator (badge dot) */\n        .wa-pinned-action-badge {\n          position: absolute;\n          top: 4px;\n          right: 4px;\n          width: 8px;\n          height: 8px;\n          border-radius: 50%;\n          background: var(--lion-success);\n          border: 2px solid var(--lion-header-bg);\n        }\n\n        /* === Right Section - Must stay visible === */\n        .wa-extension-header .wa-header-right {\n          gap: 8px;\n          flex-shrink: 0 !important;\n          flex-grow: 0 !important;\n          z-index: 2;\n        }\n\n        /* === Header Left - Must constrain its width === */\n        .wa-extension-header .wa-header-left {\n          min-width: 0 !important;\n          overflow: hidden;\n        }\n\n        /* Prevent brand block from shrinking */\n        .wa-extension-header .wa-brand-block {\n          flex-shrink: 0;\n        }\n\n        .wa-extension-header .wa-brand-divider {\n          flex-shrink: 0;\n        }\n\n        /* === Activate License Button === */\n        .wa-extension-header .wa-btn-activate {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          padding: 9px 16px !important;\n          border-radius: 8px !important;\n          font-weight: 600 !important;\n          font-size: 13px !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.3) !important;\n          border: none !important;\n        }\n\n        .wa-extension-header .wa-btn-activate:hover {\n          transform: translateY(-1px);\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.4) !important;\n        }\n\n        /* === Profile Button === */\n        .wa-extension-header .wa-profile-btn {\n          width: 38px !important;\n          height: 38px !important;\n          background: var(--lion-bg-secondary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          color: var(--lion-header-text) !important;\n          border-radius: 10px !important;\n        }\n\n        .wa-extension-header .wa-profile-btn:hover {\n          background: var(--lion-primary-light) !important;\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        .lion-dark .wa-extension-header .wa-profile-btn {\n          background: var(--lion-bg-tertiary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .lion-dark .wa-extension-header .wa-profile-btn:hover {\n          background: rgba(var(--lion-primary-rgb), 0.15) !important;\n        }\n\n        /* Profile button with user photo */\n        .wa-extension-header .wa-profile-btn.wa-profile-btn-has-pic {\n          border-radius: 50% !important;\n          width: 34px !important;\n          height: 34px !important;\n          padding: 0 !important;\n          overflow: hidden !important;\n          border: 2px solid var(--lion-border-light) !important;\n          background: var(--lion-bg-secondary) !important;\n        }\n\n        .wa-extension-header .wa-profile-btn.wa-profile-btn-has-pic:hover {\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 2px rgba(var(--lion-primary-rgb), 0.2) !important;\n          background: transparent !important;\n        }\n\n        .lion-dark .wa-extension-header .wa-profile-btn.wa-profile-btn-has-pic {\n          border-color: var(--lion-border-medium) !important;\n          background: transparent !important;\n        }\n\n        .lion-dark .wa-extension-header .wa-profile-btn.wa-profile-btn-has-pic:hover {\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 2px rgba(var(--lion-primary-rgb), 0.25) !important;\n        }\n\n        /* === Broadcast Progress Button === */\n        .wa-extension-header .wa-broadcast-progress-btn {\n          background: rgba(var(--lion-primary-rgb), 0.1) !important;\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.3) !important;\n          color: var(--lion-primary) !important;\n          border-radius: 10px !important;\n          padding: 4px 8px !important;\n          min-width: 40px !important;\n          min-height: 40px !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n        }\n\n        .wa-extension-header .wa-broadcast-progress-btn:hover {\n          background: rgba(var(--lion-primary-rgb), 0.18) !important;\n        }\n\n        .lion-dark .wa-extension-header .wa-broadcast-progress-btn {\n          background: rgba(var(--lion-primary-rgb), 0.15) !important;\n        }\n\n        .wa-extension-header .progress-circle-container {\n          position: relative !important;\n          display: flex !important;\n          align-items: center !important;\n          justify-content: center !important;\n        }\n\n        .wa-extension-header .progress-text {\n          position: absolute !important;\n          font-size: 9px !important;\n          font-weight: 700 !important;\n          color: var(--lion-primary) !important;\n        }\n\n        /* === TOOLS LAUNCHER BUTTON (in tab bar) === */\n        .wa-tools-launcher-btn {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          padding: 6px 12px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          color: var(--lion-text-secondary);\n          cursor: pointer;\n          font-size: 12px;\n          font-weight: 600;\n          transition: all 0.15s ease;\n          height: 28px;\n          flex-shrink: 0;\n        }\n\n        .wa-tools-launcher-btn:hover {\n          background: var(--lion-primary-light);\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n\n        .wa-tools-launcher-btn.active {\n          background: var(--lion-primary);\n          border-color: var(--lion-primary);\n          color: #ffffff;\n        }\n\n        .wa-tools-launcher-btn svg {\n          width: 14px;\n          height: 14px;\n        }\n\n        .lion-dark .wa-tools-launcher-btn {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-light);\n          color: var(--lion-text-secondary);\n        }\n\n        .lion-dark .wa-tools-launcher-btn:hover {\n          background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15);\n        }\n\n        /* === TOOLS PANEL (popup) === */\n        .wa-tools-panel-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          z-index: 9998;\n        }\n\n        .wa-tools-panel {\n          position: absolute;\n          top: 100%;\n          right: 16px;\n          margin-top: 8px;\n          width: 380px;\n          max-height: 560px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 14px;\n          box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.08);\n          z-index: 9999;\n          overflow: hidden;\n          display: flex;\n          flex-direction: column;\n          animation: toolsPanelOpen 220ms cubic-bezier(0.16, 1, 0.3, 1);\n          transform-origin: top right;\n        }\n\n        @keyframes toolsPanelOpen {\n          from {\n            opacity: 0;\n            transform: scale(0.95) translateY(-8px);\n          }\n          to {\n            opacity: 1;\n            transform: scale(1) translateY(0);\n          }\n        }\n\n        .wa-tools-panel-header {\n          padding: 16px 20px 12px;\n          border-bottom: 1px solid var(--lion-border-light);\n          background: linear-gradient(135deg, var(--lion-primary-light) 0%, rgba(255, 255, 255, 0) 100%);\n        }\n\n        .lion-dark .wa-tools-panel-header {\n          background: linear-gradient(135deg, rgba(var(--lion-primary-rgb, 37, 99, 235), 0.1) 0%, rgba(0, 0, 0, 0) 100%);\n        }\n\n        .wa-tools-panel-title {\n          font-size: 16px;\n          font-weight: 700;\n          color: var(--lion-text-primary);\n          margin: 0;\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .wa-tools-panel-title svg {\n          width: 18px;\n          height: 18px;\n          color: var(--lion-primary);\n        }\n\n        .wa-tools-panel-subtitle {\n          font-size: 12px;\n          color: var(--lion-text-muted);\n          margin: 4px 0 0 26px;\n        }\n\n        .wa-tools-panel-body {\n          flex: 1;\n          overflow-y: auto;\n          padding: 12px 16px 8px;\n        }\n\n        .wa-tools-panel-body::-webkit-scrollbar {\n          width: 6px;\n        }\n\n        .wa-tools-panel-body::-webkit-scrollbar-thumb {\n          background: var(--lion-border-medium);\n          border-radius: 3px;\n        }\n\n        .wa-tools-category {\n          margin-bottom: 16px;\n        }\n\n        .wa-tools-category-title {\n          font-size: 11px;\n          font-weight: 700;\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n          color: var(--lion-text-muted);\n          margin: 0 0 8px 4px;\n          display: flex;\n          align-items: center;\n          gap: 6px;\n        }\n\n        .wa-tools-category-title::before {\n          content: '';\n          width: 4px;\n          height: 4px;\n          border-radius: 50%;\n          background: var(--lion-primary);\n        }\n\n        .wa-tools-grid {\n          display: grid;\n          grid-template-columns: repeat(3, 1fr);\n          gap: 6px;\n        }\n\n        .wa-tools-item {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          gap: 6px;\n          padding: 12px 8px;\n          background: transparent;\n          border: 1px solid transparent;\n          border-radius: 10px;\n          cursor: pointer;\n          transition: all 0.15s ease;\n          text-align: center;\n          position: relative;\n        }\n\n        .wa-tools-item:hover {\n          background: var(--lion-primary-light);\n          border-color: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.2);\n          transform: translateY(-1px);\n        }\n\n        .lion-dark .wa-tools-item:hover {\n          background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.1);\n        }\n\n        .wa-tools-item.pinned {\n          background: var(--lion-primary-light);\n          border-color: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.3);\n        }\n\n        .lion-dark .wa-tools-item.pinned {\n          background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.12);\n        }\n\n        .wa-tools-item-icon {\n          width: 36px;\n          height: 36px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          background: var(--lion-bg-secondary);\n          border-radius: 10px;\n          transition: all 0.15s ease;\n          position: relative;\n        }\n\n        .wa-tools-item:hover .wa-tools-item-icon {\n          background: var(--lion-bg-primary);\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15);\n        }\n\n        .wa-tools-item-icon img {\n          width: 22px;\n          height: 22px;\n          object-fit: contain;\n        }\n\n        .wa-tools-item-label {\n          font-size: 11px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          line-height: 1.2;\n        }\n\n        .wa-tools-item-badge {\n          position: absolute;\n          top: 4px;\n          right: 4px;\n          width: 8px;\n          height: 8px;\n          border-radius: 50%;\n          background: var(--lion-success);\n          border: 2px solid var(--lion-bg-primary);\n        }\n\n        .wa-tools-item-pin-btn {\n          position: absolute;\n          top: 4px;\n          left: 4px;\n          width: 18px;\n          height: 18px;\n          background: rgba(255, 255, 255, 0.9);\n          border: none;\n          border-radius: 50%;\n          cursor: pointer;\n          display: none;\n          align-items: center;\n          justify-content: center;\n          padding: 0;\n          color: var(--lion-text-muted);\n        }\n\n        .wa-tools-item:hover .wa-tools-item-pin-btn {\n          display: flex;\n        }\n\n        .wa-tools-item.pinned .wa-tools-item-pin-btn {\n          display: flex;\n          background: var(--lion-primary);\n          color: #ffffff;\n        }\n\n        .wa-tools-item-pin-btn svg {\n          width: 10px;\n          height: 10px;\n        }\n\n        .lion-dark .wa-tools-item-pin-btn {\n          background: var(--lion-bg-primary);\n        }\n\n        .wa-tools-panel-footer {\n          padding: 10px 16px;\n          border-top: 1px solid var(--lion-border-light);\n          background: var(--lion-bg-secondary);\n        }\n\n        .wa-tools-panel-footer-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 8px;\n          width: 100%;\n          padding: 8px 12px;\n          background: transparent;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          color: var(--lion-text-secondary);\n          font-size: 12px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.15s ease;\n        }\n\n        .wa-tools-panel-footer-btn:hover {\n          background: var(--lion-bg-primary);\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n\n        .wa-tools-panel-footer-btn svg {\n          width: 14px;\n          height: 14px;\n        }\n\n        /* === TAB BAR - Segmented Control Style === */\n        .tab-bar-v2 {\n          display: flex;\n          align-items: center;\n          width: 100%;\n          height: 42px;\n          background: var(--lion-tab-bar-bg);\n          border-bottom: 1px solid var(--lion-tab-bar-border);\n          padding: 0 16px;\n          gap: 12px;\n          box-sizing: border-box;\n          pointer-events: auto !important;\n        }\n\n        .tab-bar-v2 * {\n          pointer-events: auto !important;\n        }\n\n        /* Ensure the CRM stages bar also gets clicks */\n        .wa-crm-stages-bar {\n          pointer-events: auto !important;\n        }\n\n        .wa-crm-stages-bar * {\n          pointer-events: auto !important;\n        }\n\n        .tab-bar-v2-scroll {\n          display: flex;\n          align-items: center;\n          gap: 4px;\n          flex: 1;\n          overflow-x: auto;\n          scrollbar-width: none;\n          -ms-overflow-style: none;\n          padding: 4px 0;\n          min-width: 0;\n        }\n\n        .tab-bar-v2-scroll::-webkit-scrollbar {\n          display: none;\n        }\n\n        .tab-item-v2 {\n          display: inline-flex;\n          align-items: center;\n          gap: 6px;\n          padding: 6px 14px;\n          background: transparent;\n          border: 1px solid transparent;\n          color: var(--lion-text-muted);\n          border-radius: 8px;\n          font-size: 12px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.15s ease;\n          white-space: nowrap;\n          flex-shrink: 0;\n          height: 30px;\n          position: relative;\n        }\n\n        .tab-item-v2:hover {\n          background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.08);\n          color: var(--lion-primary);\n        }\n\n        .tab-item-v2.active {\n          background: var(--lion-primary);\n          border-color: var(--lion-primary);\n          color: #ffffff;\n          box-shadow: 0 2px 6px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.3);\n        }\n\n        .tab-item-v2.active:hover {\n          background: var(--lion-primary-hover);\n          color: #ffffff;\n        }\n\n        .tab-count-v2 {\n          display: inline-flex;\n          align-items: center;\n          justify-content: center;\n          min-width: 18px;\n          height: 18px;\n          padding: 0 5px;\n          background: var(--lion-bg-tertiary);\n          border-radius: 9px;\n          font-size: 10px;\n          font-weight: 700;\n          color: var(--lion-text-muted);\n          flex-shrink: 0;\n        }\n\n        .tab-item-v2.active .tab-count-v2 {\n          background: rgba(255, 255, 255, 0.25);\n          color: #ffffff;\n        }\n\n        .tab-count-v2.has-missing {\n          background: var(--lion-warning-light);\n          color: var(--lion-warning);\n        }\n\n        .tab-bar-v2-right {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          flex-shrink: 0;\n        }\n\n        .tab-bar-v2-divider {\n          width: 1px;\n          height: 20px;\n          background: var(--lion-border-light);\n        }\n\n        /* === PROFILE DROPDOWN - Themed === */\n        .wa-extension-header .wa-profile-dropdown {\n          background: var(--lion-bg-primary) !important;\n          border: 1px solid var(--lion-border-light) !important;\n          box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08) !important;\n          border-radius: 12px !important;\n        }\n\n        .wa-extension-header .wa-profile-dropdown-header {\n          background: var(--lion-primary) !important;\n        }\n\n        /* === MISSED SCHEDULE POPUP - Themed === */\n        .missed-schedule-btn.primary {\n          background: var(--lion-primary) !important;\n          border-color: var(--lion-primary) !important;\n        }\n\n        .missed-schedule-btn.primary:hover {\n          background: var(--lion-primary-hover) !important;\n        }\n\n        /* === CRM STAGES BAR - Themed === */\n        .wa-crm-stages-bar {\n          background: var(--lion-tab-bar-bg);\n          border-bottom: 1px solid var(--lion-tab-bar-border);\n          padding: 6px 16px;\n          display: flex;\n          align-items: center;\n          gap: 10px;\n        }\n\n        .wa-crm-back-btn {\n          width: 28px;\n          height: 28px;\n          border-radius: 6px;\n          background: transparent;\n          border: 1px solid var(--lion-border-light);\n          color: var(--lion-text-secondary);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          transition: all 0.15s ease;\n        }\n\n        .wa-crm-back-btn:hover {\n          background: var(--lion-primary-light);\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n\n        .wa-crm-name {\n          font-size: 13px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n        }\n\n        .wa-crm-stage-btn {\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          padding: 4px 10px;\n          border-radius: 6px;\n          font-size: 11px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.15s ease;\n          display: inline-flex;\n          align-items: center;\n          gap: 6px;\n          color: var(--lion-text-secondary);\n        }\n\n        .wa-crm-stage-btn.active {\n          background: var(--lion-primary-light);\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n\n        /* === Responsive === */\n        @media (max-width: 900px) {\n          .wa-brand-info {\n            display: none;\n          }\n          .wa-pinned-action-label {\n            display: none;\n          }\n          .wa-pinned-action {\n            padding: 8px;\n          }\n        }\n`,tg=e=>{const{settingsTab:t,aiProvider:r,aiApiKey:o,aiEnabled:s,aiKeyValidating:l,aiKeyStatus:c,aiKeyCopied:d,showAiKey:m,spokenLanguage:p,blurSettings:u,themeMode:g,currentTheme:h,t:b,setSettingsTab:f,setAiProvider:v,setAiApiKey:y,setAiEnabled:x,setShowAiKey:w,setAiKeyStatus:k,setSpokenLanguage:E,saveAISettings:S,validateAIKey:C,copyAIKey:T,handleBlurSettingChange:A,handleThemeModeChange:D,selectedUILanguage:_,language:N,changeLanguage:M,onClose:I}=e;return(0,i.createPortal)(a.createElement(a.Fragment,null,a.createElement("style",null,"\n            .wa-settings-backdrop {\n              position: fixed;\n              top: 0;\n              left: 0;\n              right: 0;\n              bottom: 0;\n              background: rgba(0, 0, 0, 0.7);\n              z-index: 999998;\n            }\n            .wa-settings-container {\n              position: fixed;\n              top: 50%;\n              left: 50%;\n              transform: translate(-50%, -50%);\n              background: var(--lion-bg-primary);\n              border-radius: 16px;\n              box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n              z-index: 999999;\n              width: 90%;\n              max-width: 800px;\n              height: 500px;\n              display: flex;\n              overflow: hidden;\n              animation: settingsSlide 0.3s ease;\n            }\n            @keyframes settingsSlide {\n              from { opacity: 0; transform: translate(-50%, -48%); }\n              to { opacity: 1; transform: translate(-50%, -50%); }\n            }\n            .wa-settings-sidebar {\n              width: 220px;\n              background: var(--lion-bg-secondary);\n              border-right: 1px solid var(--lion-border-light);\n              display: flex;\n              flex-direction: column;\n            }\n            .wa-settings-sidebar-header {\n              padding: 20px;\n              border-bottom: 1px solid var(--lion-border-light);\n            }\n            .wa-settings-sidebar-title {\n              font-size: 18px;\n              font-weight: 700;\n              color: var(--lion-text-primary);\n              display: flex;\n              align-items: center;\n              gap: 10px;\n            }\n            .wa-settings-sidebar-title svg {\n              color: var(--lion-primary);\n            }\n            .wa-settings-menu {\n              flex: 1;\n              padding: 12px;\n            }\n            .wa-settings-menu-item {\n              display: flex;\n              align-items: center;\n              gap: 12px;\n              padding: 14px 16px;\n              border-radius: 10px;\n              cursor: pointer;\n              transition: all 0.2s;\n              margin-bottom: 4px;\n              border: none;\n              background: transparent;\n              width: 100%;\n              text-align: left;\n            }\n            .wa-settings-menu-item:hover {\n              background: var(--lion-bg-tertiary);\n            }\n            .wa-settings-menu-item.active {\n              background: linear-gradient(135deg, rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15), rgba(var(--lion-primary-rgb, 37, 99, 235), 0.05));\n              border-left: 3px solid var(--lion-primary);\n            }\n            .wa-settings-menu-icon {\n              width: 36px;\n              height: 36px;\n              border-radius: 10px;\n              display: flex;\n              align-items: center;\n              justify-content: center;\n              background: var(--lion-bg-tertiary);\n              color: var(--lion-text-muted);\n            }\n            .wa-settings-menu-item.active .wa-settings-menu-icon {\n              background: var(--lion-primary);\n              color: white;\n            }\n            .wa-settings-menu-text {\n              flex: 1;\n            }\n            .wa-settings-menu-label {\n              font-size: 14px;\n              font-weight: 600;\n              color: var(--lion-text-secondary);\n            }\n            .wa-settings-menu-item.active .wa-settings-menu-label {\n              color: var(--lion-text-primary);\n            }\n            .wa-settings-menu-desc {\n              font-size: 11px;\n              color: var(--lion-text-muted);\n              margin-top: 2px;\n            }\n            .wa-settings-content {\n              flex: 1;\n              display: flex;\n              flex-direction: column;\n              background: var(--lion-bg-primary);\n            }\n            .wa-settings-header {\n              display: flex;\n              justify-content: space-between;\n              align-items: center;\n              padding: 20px 24px;\n              border-bottom: 1px solid var(--lion-border-light);\n            }\n            .wa-settings-title {\n              font-size: 20px;\n              font-weight: 700;\n              color: var(--lion-text-primary);\n            }\n            .wa-settings-close {\n              width: 36px;\n              height: 36px;\n              border-radius: 10px;\n              background: var(--lion-bg-tertiary);\n              border: none;\n              color: var(--lion-text-muted);\n              cursor: pointer;\n              display: flex;\n              align-items: center;\n              justify-content: center;\n              transition: all 0.2s;\n            }\n            .wa-settings-close:hover {\n              background: var(--lion-bg-tertiary);\n              color: var(--lion-text-primary);\n            }\n            .wa-settings-body {\n              flex: 1;\n              padding: 24px;\n              overflow-y: auto;\n            }\n            .wa-settings-section {\n              margin-bottom: 24px;\n            }\n            .wa-settings-section-title {\n              font-size: 13px;\n              font-weight: 600;\n              color: var(--lion-text-muted);\n              text-transform: uppercase;\n              letter-spacing: 0.5px;\n              margin-bottom: 16px;\n            }\n            .wa-settings-platforms {\n              display: flex;\n              gap: 12px;\n              margin-bottom: 20px;\n            }\n            .wa-settings-platform {\n              flex: 1;\n              display: flex;\n              flex-direction: column;\n              align-items: center;\n              gap: 10px;\n              padding: 16px 12px;\n              border: 2px solid var(--lion-border-light);\n              border-radius: 12px;\n              cursor: pointer;\n              background: var(--lion-bg-secondary);\n              transition: all 0.2s;\n            }\n            .wa-settings-platform:hover {\n              border-color: var(--lion-border-medium);\n              background: var(--lion-bg-tertiary);\n            }\n            .wa-settings-platform.active {\n              border-color: var(--lion-primary);\n              background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.1);\n            }\n            .wa-settings-platform input { display: none; }\n            .wa-settings-platform-icon {\n              width: 44px;\n              height: 44px;\n              display: flex;\n              align-items: center;\n              justify-content: center;\n              background: var(--lion-bg-primary);\n              border-radius: 12px;\n            }\n            .wa-settings-platform-name {\n              font-size: 12px;\n              font-weight: 600;\n              color: var(--lion-text-muted);\n              text-transform: uppercase;\n            }\n            .wa-settings-platform.active .wa-settings-platform-name {\n              color: var(--lion-text-primary);\n            }\n            .wa-settings-input-group {\n              margin-bottom: 16px;\n            }\n            .wa-settings-label {\n              font-size: 13px;\n              font-weight: 600;\n              color: var(--lion-text-secondary);\n              margin-bottom: 8px;\n              display: block;\n            }\n            .wa-settings-input-row {\n              display: flex;\n              align-items: center;\n              gap: 8px;\n              padding: 10px 14px;\n              border: 1px solid var(--lion-border-light);\n              border-radius: 10px;\n              background: var(--lion-bg-secondary);\n              transition: all 0.2s;\n            }\n            .wa-settings-input-row:focus-within {\n              border-color: var(--lion-primary);\n              box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.1);\n            }\n            .wa-settings-input-row.valid {\n              border-color: var(--lion-success);\n            }\n            .wa-settings-input-row.invalid {\n              border-color: var(--lion-error);\n            }\n            .wa-settings-input {\n              flex: 1;\n              background: transparent;\n              border: none;\n              outline: none;\n              font-size: 14px;\n              color: var(--lion-text-primary);\n            }\n            .wa-settings-input::placeholder { color: var(--lion-text-muted); }\n            .wa-settings-input-btn {\n              width: 32px;\n              height: 32px;\n              border: none;\n              border-radius: 6px;\n              background: var(--lion-bg-tertiary);\n              color: var(--lion-text-muted);\n              cursor: pointer;\n              display: flex;\n              align-items: center;\n              justify-content: center;\n              transition: all 0.2s;\n            }\n            .wa-settings-input-btn:hover {\n              background: var(--lion-bg-hover);\n              color: var(--lion-text-primary);\n            }\n            .wa-settings-validate-btn {\n              padding: 8px 16px;\n              border: none;\n              border-radius: 8px;\n              background: var(--lion-primary);\n              color: white;\n              font-size: 13px;\n              font-weight: 600;\n              cursor: pointer;\n              transition: all 0.2s;\n            }\n            .wa-settings-validate-btn:hover {\n              background: var(--lion-primary-hover);\n            }\n            .wa-settings-validate-btn:disabled {\n              opacity: 0.5;\n              cursor: not-allowed;\n            }\n            .wa-settings-status {\n              display: flex;\n              align-items: center;\n              gap: 8px;\n              padding: 10px 14px;\n              border-radius: 8px;\n              font-size: 13px;\n              font-weight: 500;\n              margin-top: 12px;\n            }\n            .wa-settings-status.valid {\n              background: rgba(34, 197, 94, 0.1);\n              color: var(--lion-success);\n            }\n            .wa-settings-status.invalid {\n              background: rgba(239, 68, 68, 0.1);\n              color: var(--lion-error);\n            }\n            .wa-settings-note {\n              font-size: 12px;\n              color: var(--lion-text-muted);\n              line-height: 1.6;\n              padding: 12px 14px;\n              background: var(--lion-bg-secondary);\n              border-radius: 8px;\n              border-left: 3px solid var(--lion-primary);\n              margin-top: 12px;\n            }\n            .wa-settings-toggle-row {\n              display: flex;\n              justify-content: space-between;\n              align-items: center;\n              padding: 14px 16px;\n              background: var(--lion-bg-secondary);\n              border-radius: 10px;\n              margin-top: 16px;\n            }\n            .wa-settings-toggle-label {\n              font-size: 14px;\n              font-weight: 600;\n              color: var(--lion-text-secondary);\n            }\n            .wa-settings-toggle {\n              width: 48px;\n              height: 26px;\n              border-radius: 13px;\n              background: var(--lion-bg-hover);\n              border: none;\n              cursor: pointer;\n              position: relative;\n              transition: background 0.3s;\n              padding: 0;\n            }\n            .wa-settings-toggle.active { background: var(--lion-primary); }\n            .wa-settings-toggle-knob {\n              position: absolute;\n              top: 3px;\n              left: 3px;\n              width: 20px;\n              height: 20px;\n              border-radius: 50%;\n              background: white;\n              box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);\n              transition: transform 0.3s;\n            }\n            .wa-settings-toggle.active .wa-settings-toggle-knob {\n              transform: translateX(22px);\n            }\n            .wa-settings-footer {\n              padding: 16px 24px;\n              border-top: 1px solid var(--lion-border-light);\n              display: flex;\n              gap: 12px;\n              justify-content: flex-end;\n            }\n            .wa-settings-btn {\n              padding: 12px 24px;\n              border-radius: 10px;\n              font-size: 14px;\n              font-weight: 600;\n              cursor: pointer;\n              border: none;\n              transition: all 0.2s;\n            }\n            .wa-settings-btn-secondary {\n              background: var(--lion-bg-tertiary);\n              color: var(--lion-text-secondary);\n            }\n            .wa-settings-btn-secondary:hover {\n              background: var(--lion-bg-hover);\n            }\n            .wa-settings-btn-primary {\n              background: var(--lion-primary);\n              color: white;\n            }\n            .wa-settings-btn-primary:hover {\n              background: var(--lion-primary-hover);\n              transform: translateY(-1px);\n              box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.3);\n            }\n            .wa-settings-languages {\n              display: grid;\n              grid-template-columns: repeat(2, 1fr);\n              gap: 10px;\n            }\n            .wa-settings-lang-item {\n              display: flex;\n              align-items: center;\n              gap: 12px;\n              padding: 14px 16px;\n              border: 2px solid var(--lion-border-light);\n              border-radius: 10px;\n              cursor: pointer;\n              background: var(--lion-bg-secondary);\n              transition: all 0.2s;\n            }\n            .wa-settings-lang-item:hover {\n              border-color: var(--lion-border-medium);\n              background: var(--lion-bg-tertiary);\n            }\n            .wa-settings-lang-item.active {\n              border-color: var(--lion-primary);\n              background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.1);\n            }\n            .wa-settings-lang-flag {\n              font-size: 24px;\n            }\n            .wa-settings-lang-name {\n              font-size: 14px;\n              font-weight: 500;\n              color: var(--lion-text-secondary);\n            }\n            .wa-settings-lang-item.active .wa-settings-lang-name {\n              color: var(--lion-primary);\n            }\n            .wa-settings-lang-native {\n              font-size: 12px;\n              color: var(--lion-text-muted);\n            }\n            .wa-settings-spoken-hint {\n              font-size: 13px;\n              color: var(--lion-text-muted);\n              margin-bottom: 16px;\n              padding: 10px 14px;\n              background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.08);\n              border-radius: 8px;\n              border-left: 3px solid var(--lion-primary);\n            }\n            .wa-settings-spinner {\n              width: 16px;\n              height: 16px;\n              border: 2px solid transparent;\n              border-top-color: currentColor;\n              border-radius: 50%;\n              animation: settingsSpin 0.8s linear infinite;\n            }\n            @keyframes settingsSpin {\n              to { transform: rotate(360deg); }\n            }\n          "),a.createElement("div",{className:"wa-settings-backdrop",onClick:()=>I()}),a.createElement("div",{className:"wa-settings-container"},a.createElement("div",{className:"wa-settings-sidebar"},a.createElement("div",{className:"wa-settings-sidebar-header"},a.createElement("div",{className:"wa-settings-sidebar-title"},a.createElement("svg",{viewBox:"0 0 24 24",width:"22",height:"22"},a.createElement("path",{fill:"currentColor",d:"M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"})),b("profile.settings"))),a.createElement("div",{className:"wa-settings-menu"},a.createElement("button",{className:"wa-settings-menu-item "+("ai-api"===t?"active":""),onClick:()=>f("ai-api")},a.createElement("div",{className:"wa-settings-menu-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M21 11.5v-1c0-.8-.7-1.5-1.5-1.5H16v6h1.5v-2h1.1l.9 2H21l-1.1-2.5c.6-.3 1.1-.9 1.1-1.5zm-4.5 1v-2H19v2h-1.5zM5 11.5v-1c0-.8-.7-1.5-1.5-1.5H0v6h1.5v-2h1.1l.9 2H5L3.9 12.5c.6-.3 1.1-.9 1.1-1.5zm-3.5 1v-2H3v2H1.5zM13 9h-3v6h3c.8 0 1.5-.7 1.5-1.5v-3c0-.8-.7-1.5-1.5-1.5zm0 4.5h-1.5v-3H13v3z"}))),a.createElement("div",{className:"wa-settings-menu-text"},a.createElement("div",{className:"wa-settings-menu-label"},b("aiSettings.title")),a.createElement("div",{className:"wa-settings-menu-desc"},b("aiSettings.configureAI")))),a.createElement("button",{className:"wa-settings-menu-item "+("spoken-language"===t?"active":""),onClick:()=>f("spoken-language")},a.createElement("div",{className:"wa-settings-menu-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M9 13c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0 8c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4zm-6 4c.22-.72 3.31-2 6-2 2.7 0 5.8 1.29 6 2H3zm15-9h6v2h-6zm-2 4h8v2h-8zm2 4h6v2h-6z"}))),a.createElement("div",{className:"wa-settings-menu-text"},a.createElement("div",{className:"wa-settings-menu-label"},b("settings.whatLanguageSpeak")),a.createElement("div",{className:"wa-settings-menu-desc"},b("settings.translateMessages")))),a.createElement("button",{className:"wa-settings-menu-item "+("blur-settings"===t?"active":""),onClick:()=>f("blur-settings")},a.createElement("div",{className:"wa-settings-menu-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z"}))),a.createElement("div",{className:"wa-settings-menu-text"},a.createElement("div",{className:"wa-settings-menu-label"},b("settings.blurSettings")),a.createElement("div",{className:"wa-settings-menu-desc"},b("settings.blurDescription")))),a.createElement("button",{className:"wa-settings-menu-item "+("theme"===t?"active":""),onClick:()=>f("theme")},a.createElement("div",{className:"wa-settings-menu-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"dark"===h?"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z":"M6.76 4.84l-1.8-1.79-1.41 1.41 1.79 1.79 1.42-1.41zM4 10.5H1v2h3v-2zm9-9.95h-2V3.5h2V.55zm7.45 3.91l-1.41-1.41-1.79 1.79 1.41 1.41 1.79-1.79zm-3.21 13.7l1.79 1.8 1.41-1.41-1.8-1.79-1.4 1.4zM20 10.5v2h3v-2h-3zm-8-5c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm-1 16.95h2V19.5h-2v2.95zm-7.45-3.91l1.41 1.41 1.79-1.8-1.41-1.41-1.79 1.8z"}))),a.createElement("div",{className:"wa-settings-menu-text"},a.createElement("div",{className:"wa-settings-menu-label"},b("settings.theme")),a.createElement("div",{className:"wa-settings-menu-desc"},b("settings.themeDescription")))))),a.createElement("div",{className:"wa-settings-content"},a.createElement("div",{className:"wa-settings-header"},a.createElement("div",{className:"wa-settings-title"},b("ai-api"===t?"aiSettings.title":"blur-settings"===t?"settings.blurSettings":"theme"===t?"settings.theme":"settings.whatLanguageSpeak")),a.createElement("button",{className:"wa-settings-close",onClick:()=>I()},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"wa-settings-body"},"ai-api"===t&&a.createElement(a.Fragment,null,a.createElement("div",{className:"wa-settings-section"},a.createElement("div",{className:"wa-settings-section-title"},b("aiSettings.platformType")),a.createElement("div",{className:"wa-settings-platforms"},a.createElement("label",{className:"wa-settings-platform "+("gemini"===r?"active":"")},a.createElement("input",{type:"radio",name:"platform",checked:"gemini"===r,onChange:()=>v("gemini")}),a.createElement("span",{className:"wa-settings-platform-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:"#4285f4",d:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"}))),a.createElement("span",{className:"wa-settings-platform-name"},b("aiSettings.geminiAI"))),a.createElement("label",{className:"wa-settings-platform "+("chatgpt"===r?"active":"")},a.createElement("input",{type:"radio",name:"platform",checked:"chatgpt"===r,onChange:()=>v("chatgpt")}),a.createElement("span",{className:"wa-settings-platform-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:"#10a37f",d:"M22.282 9.821a5.985 5.985 0 0 0-.516-4.91 6.046 6.046 0 0 0-6.51-2.9A6.065 6.065 0 0 0 4.981 4.18a5.985 5.985 0 0 0-3.998 2.9 6.046 6.046 0 0 0 .743 7.097 5.98 5.98 0 0 0 .51 4.911 6.051 6.051 0 0 0 6.515 2.9A5.985 5.985 0 0 0 13.26 24a6.056 6.056 0 0 0 5.772-4.206 5.99 5.99 0 0 0 3.997-2.9 6.056 6.056 0 0 0-.747-7.073z"}))),a.createElement("span",{className:"wa-settings-platform-name"},b("aiSettings.chatgpt"))),a.createElement("label",{className:"wa-settings-platform "+("deepseek"===r?"active":"")},a.createElement("input",{type:"radio",name:"platform",checked:"deepseek"===r,onChange:()=>v("deepseek")}),a.createElement("span",{className:"wa-settings-platform-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("circle",{cx:"12",cy:"12",r:"10",fill:"#5865f2"}),a.createElement("text",{x:"12",y:"16",textAnchor:"middle",fill:"white",fontSize:"10",fontWeight:"bold"},"DS"))),a.createElement("span",{className:"wa-settings-platform-name"},b("aiSettings.deepseek"))))),a.createElement("div",{className:"wa-settings-section"},a.createElement("div",{className:"wa-settings-section-title"},b("aiSettings.apiKey")),a.createElement("div",{className:`wa-settings-input-row ${"valid"===c?"valid":""} ${"invalid"===c?"invalid":""}`},a.createElement("input",{type:m?"text":"password",className:"wa-settings-input",placeholder:b("aiSettings.enterApiKey"),value:o,onChange:e=>{y(e.target.value),k("idle")}}),a.createElement("button",{className:"wa-settings-input-btn",onClick:()=>w(!m)},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:m?"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27z":"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}))),a.createElement("button",{className:"wa-settings-input-btn",onClick:T,disabled:!o},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:d?"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z":"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}))),a.createElement("button",{className:"wa-settings-validate-btn",onClick:C,disabled:!o||l},l?a.createElement("div",{className:"wa-settings-spinner"}):b("aiSettings.validate"))),"valid"===c&&a.createElement("div",{className:"wa-settings-status valid"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),a.createElement("span",null,b("aiSettings.validKey"))),"invalid"===c&&a.createElement("div",{className:"wa-settings-status invalid"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})),a.createElement("span",null,b("aiSettings.invalidKey"))),a.createElement("div",{className:"wa-settings-note"},a.createElement("strong",null,b("aiSettings.note")),a.createElement("br",null),"chatgpt"===r&&b("aiSettings.chatgptNote"),"gemini"===r&&b("aiSettings.geminiNote"),"deepseek"===r&&b("aiSettings.deepseekNote"))),a.createElement("div",{className:"wa-settings-toggle-row"},a.createElement("span",{className:"wa-settings-toggle-label"},b("aiSettings.enableAITools")),a.createElement("button",{className:"wa-settings-toggle "+(s?"active":""),onClick:()=>x(!s)},a.createElement("div",{className:"wa-settings-toggle-knob"})))),"spoken-language"===t&&a.createElement(a.Fragment,null,a.createElement("div",{className:"wa-settings-section"},a.createElement("div",{className:"wa-settings-section-title"},b("settings.selectSpokenLanguage")),a.createElement("div",{className:"wa-settings-spoken-hint"},b("settings.spokenLanguageHint")),a.createElement("div",{className:"wa-settings-languages"},Object.entries({en:{flag:"🇺🇸",name:"English",nativeName:"English"},es:{flag:"🇪🇸",name:"Spanish",nativeName:"Español"},fr:{flag:"🇫🇷",name:"French",nativeName:"Français"},de:{flag:"🇩🇪",name:"German",nativeName:"Deutsch"},it:{flag:"🇮🇹",name:"Italian",nativeName:"Italiano"},pt:{flag:"🇧🇷",name:"Portuguese",nativeName:"Português"},ru:{flag:"🇷🇺",name:"Russian",nativeName:"Русский"},zh:{flag:"🇨🇳",name:"Chinese",nativeName:"中文"},ja:{flag:"🇯🇵",name:"Japanese",nativeName:"日本語"},ko:{flag:"🇰🇷",name:"Korean",nativeName:"한국어"},ar:{flag:"🇸🇦",name:"Arabic",nativeName:"العربية"},hi:{flag:"🇮🇳",name:"Hindi",nativeName:"हिन्दी"},bn:{flag:"🇧🇩",name:"Bengali",nativeName:"বাংলা"},ur:{flag:"🇵🇰",name:"Urdu",nativeName:"اردو"},tr:{flag:"🇹🇷",name:"Turkish",nativeName:"Türkçe"},nl:{flag:"🇳🇱",name:"Dutch",nativeName:"Nederlands"},pl:{flag:"🇵🇱",name:"Polish",nativeName:"Polski"},vi:{flag:"🇻🇳",name:"Vietnamese",nativeName:"Tiếng Việt"},th:{flag:"🇹🇭",name:"Thai",nativeName:"ไทย"},id:{flag:"🇮🇩",name:"Indonesian",nativeName:"Bahasa Indonesia"},ms:{flag:"🇲🇾",name:"Malay",nativeName:"Bahasa Melayu"},he:{flag:"🇮🇱",name:"Hebrew",nativeName:"עברית"},el:{flag:"🇬🇷",name:"Greek",nativeName:"Ελληνικά"},sv:{flag:"🇸🇪",name:"Swedish",nativeName:"Svenska"},uk:{flag:"🇺🇦",name:"Ukrainian",nativeName:"Українська"}}).map(([e,t])=>a.createElement("div",{key:e,className:"wa-settings-lang-item "+(p===e?"active":""),onClick:()=>E(e)},a.createElement("span",{className:"wa-settings-lang-flag"},t.flag),a.createElement("div",null,a.createElement("div",{className:"wa-settings-lang-name"},t.name),a.createElement("div",{className:"wa-settings-lang-native"},t.nativeName))))))),"blur-settings"===t&&a.createElement(a.Fragment,null,a.createElement("div",{className:"wa-settings-section"},a.createElement("div",{className:"wa-settings-spoken-hint"},b("settings.blurDescription")),a.createElement("div",{className:"wa-settings-toggle-row"},a.createElement("span",{className:"wa-settings-toggle-label"},b("settings.blurMessages")),a.createElement("button",{className:"wa-settings-toggle "+(u.blurMessages?"active":""),onClick:()=>A("blurMessages",!u.blurMessages)},a.createElement("div",{className:"wa-settings-toggle-knob"}))),a.createElement("div",{className:"wa-settings-toggle-row"},a.createElement("span",{className:"wa-settings-toggle-label"},b("settings.blurProfileNames")),a.createElement("button",{className:"wa-settings-toggle "+(u.blurProfileNames?"active":""),onClick:()=>A("blurProfileNames",!u.blurProfileNames)},a.createElement("div",{className:"wa-settings-toggle-knob"}))),a.createElement("div",{className:"wa-settings-toggle-row"},a.createElement("span",{className:"wa-settings-toggle-label"},b("settings.blurDisplayPhotos")),a.createElement("button",{className:"wa-settings-toggle "+(u.blurDisplayPhotos?"active":""),onClick:()=>A("blurDisplayPhotos",!u.blurDisplayPhotos)},a.createElement("div",{className:"wa-settings-toggle-knob"}))),a.createElement("div",{className:"wa-settings-toggle-row"},a.createElement("span",{className:"wa-settings-toggle-label"},b("settings.blurConversation")),a.createElement("button",{className:"wa-settings-toggle "+(u.blurConversation?"active":""),onClick:()=>A("blurConversation",!u.blurConversation)},a.createElement("div",{className:"wa-settings-toggle-knob"}))),u.blurConversation&&a.createElement("div",{className:"wa-settings-toggle-row",style:{marginLeft:"24px",opacity:.9}},a.createElement("span",{className:"wa-settings-toggle-label"},b("settings.displayOnHover")),a.createElement("button",{className:"wa-settings-toggle "+(u.displayOnHover?"active":""),onClick:()=>A("displayOnHover",!u.displayOnHover)},a.createElement("div",{className:"wa-settings-toggle-knob"}))))),"theme"===t&&a.createElement(a.Fragment,null,a.createElement("div",{className:"wa-settings-section"},a.createElement("div",{className:"wa-settings-spoken-hint"},b("settings.themeDescription")),a.createElement("div",{className:"wa-settings-theme-options",style:{display:"flex",flexDirection:"column",gap:"12px",marginTop:"16px"}},a.createElement("label",{className:"wa-settings-theme-option "+("light"===g?"active":""),style:{display:"flex",alignItems:"center",gap:"12px",padding:"14px 16px",borderRadius:"10px",cursor:"pointer",border:"light"===g?"2px solid var(--lion-primary, #6D28D9)":"2px solid var(--lion-border-light, #e5e7eb)",background:"light"===g?"var(--lion-primary-light, #eff6ff)":"var(--lion-bg-secondary, #f9fafb)",transition:"all 0.2s ease"}},a.createElement("input",{type:"radio",name:"themeMode",checked:"light"===g,onChange:()=>D("light"),style:{display:"none"}}),a.createElement("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:"#ffffff",border:"2px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"center"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"22",height:"22"},a.createElement("path",{fill:"#0ea5e9",d:"M6.76 4.84l-1.8-1.79-1.41 1.41 1.79 1.79 1.42-1.41zM4 10.5H1v2h3v-2zm9-9.95h-2V3.5h2V.55zm7.45 3.91l-1.41-1.41-1.79 1.79 1.41 1.41 1.79-1.79zm-3.21 13.7l1.79 1.8 1.41-1.41-1.8-1.79-1.4 1.4zM20 10.5v2h3v-2h-3zm-8-5c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6-2.69-6-6-6zm-1 16.95h2V19.5h-2v2.95zm-7.45-3.91l1.41 1.41 1.79-1.8-1.41-1.41-1.79 1.8z"}))),a.createElement("div",{style:{flex:1}},a.createElement("div",{style:{fontWeight:600,fontSize:"14px",color:"var(--lion-text-primary, #1f2937)"}},b("settings.lightMode")),a.createElement("div",{style:{fontSize:"12px",color:"var(--lion-text-muted, #6b7280)",marginTop:"2px"}},b("settings.lightModeDesc"))),"light"===g&&a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"var(--lion-primary, #6D28D9)",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),a.createElement("label",{className:"wa-settings-theme-option "+("dark"===g?"active":""),style:{display:"flex",alignItems:"center",gap:"12px",padding:"14px 16px",borderRadius:"10px",cursor:"pointer",border:"dark"===g?"2px solid var(--lion-primary, #6D28D9)":"2px solid var(--lion-border-light, #e5e7eb)",background:"dark"===g?"var(--lion-primary-light, #eff6ff)":"var(--lion-bg-secondary, #f9fafb)",transition:"all 0.2s ease"}},a.createElement("input",{type:"radio",name:"themeMode",checked:"dark"===g,onChange:()=>D("dark"),style:{display:"none"}}),a.createElement("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:"#1a1a1a",border:"2px solid #3f3f3f",display:"flex",alignItems:"center",justifyContent:"center"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"22",height:"22"},a.createElement("path",{fill:"#60a5fa",d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z"}))),a.createElement("div",{style:{flex:1}},a.createElement("div",{style:{fontWeight:600,fontSize:"14px",color:"var(--lion-text-primary, #1f2937)"}},b("settings.darkMode")),a.createElement("div",{style:{fontSize:"12px",color:"var(--lion-text-muted, #6b7280)",marginTop:"2px"}},b("settings.darkModeDesc"))),"dark"===g&&a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"var(--lion-primary, #6D28D9)",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),a.createElement("label",{className:"wa-settings-theme-option "+("system"===g?"active":""),style:{display:"flex",alignItems:"center",gap:"12px",padding:"14px 16px",borderRadius:"10px",cursor:"pointer",border:"system"===g?"2px solid var(--lion-primary, #6D28D9)":"2px solid var(--lion-border-light, #e5e7eb)",background:"system"===g?"var(--lion-primary-light, #eff6ff)":"var(--lion-bg-secondary, #f9fafb)",transition:"all 0.2s ease"}},a.createElement("input",{type:"radio",name:"themeMode",checked:"system"===g,onChange:()=>D("system"),style:{display:"none"}}),a.createElement("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:"linear-gradient(135deg, #ffffff 50%, #1a1a1a 50%)",border:"2px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"center"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"22",height:"22"},a.createElement("path",{fill:"#6b7280",d:"M20 3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h3l-1 1v2h12v-2l-1-1h3c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 13H4V5h16v11z"}))),a.createElement("div",{style:{flex:1}},a.createElement("div",{style:{fontWeight:600,fontSize:"14px",color:"var(--lion-text-primary, #1f2937)"}},b("settings.systemMode")),a.createElement("div",{style:{fontSize:"12px",color:"var(--lion-text-muted, #6b7280)",marginTop:"2px"}},b("settings.systemModeHint"))),"system"===g&&a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"var(--lion-primary, #6D28D9)",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})))),a.createElement("div",{style:{marginTop:"20px",padding:"12px 16px",borderRadius:"8px",background:"var(--lion-bg-tertiary, #f3f4f6)",display:"flex",alignItems:"center",gap:"10px"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"var(--lion-text-muted, #6b7280)",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})),a.createElement("span",{style:{fontSize:"13px",color:"var(--lion-text-muted, #6b7280)"}},b("settings.currentTheme"),": ",a.createElement("strong",{style:{color:"var(--lion-text-primary, #1f2937)"}},b("dark"===h?"settings.darkMode":"settings.lightMode"))))))),a.createElement("div",{className:"wa-settings-footer"},a.createElement("button",{className:"wa-settings-btn wa-settings-btn-secondary",onClick:()=>I()},b("aiSettings.close")),a.createElement("button",{className:"wa-settings-btn wa-settings-btn-primary",onClick:()=>{S(),_!==N&&M(_),n().storage.local.set({wa_spoken_language:p}),localStorage.setItem("wa_spoken_language",p),Yn(p),window.dispatchEvent(new CustomEvent("spokenLanguageChanged",{detail:p}))}},b("aiSettings.save")))))),document.body)},ng=e=>{const{backupMode:t,backupFeatures:r,autoBackupEnabled:o,autoBackupDestination:i,importFile:s,importFeatures:l,cheetahImportResult:c,cheetahImporting:d,currentTheme:m,t:p,setBackupMode:u,setBackupFeatures:g,setAutoBackupEnabled:h,setAutoBackupDestination:b,setImportFile:f,setImportFeatures:v,setCheetahImportResult:y,handleFeatureExport:x,handleFeatureImport:w,handleCheetahImport:k,handleImportFileUpload:E,getFeatureName:S,onClose:C}=e,T=n().runtime.getManifest().name||"",A=T.includes("<<")?"Extension":T;return a.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",zIndex:2147483647,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"all",isolation:"isolate"},onClick:e=>{e.stopPropagation(),e.preventDefault(),e.nativeEvent.stopImmediatePropagation()},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onMouseUp:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerUp:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onTouchStart:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onTouchEnd:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},a.createElement("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,width:"100%",height:"100%",background:"rgba(0, 0, 0, 0.85)",zIndex:1,pointerEvents:"all"},onClick:e=>{e.stopPropagation(),e.preventDefault(),e.nativeEvent.stopImmediatePropagation(),C(),f(null),v({})},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}}),a.createElement("div",{style:{position:"relative",background:"dark"===m?"#1a1a1a":"#ffffff",borderRadius:"16px",padding:"0",width:"400px",maxWidth:"90vw",maxHeight:"80vh",overflow:"hidden",zIndex:2,boxShadow:"0 20px 60px rgba(0,0,0,0.5)",border:"dark"===m?"1px solid #3a3a3a":"1px solid #e5e7eb",pointerEvents:"all",isolation:"isolate"},onClick:e=>{e.stopPropagation(),e.preventDefault(),e.nativeEvent.stopImmediatePropagation()},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onMouseUp:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerUp:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},a.createElement("div",{style:{padding:"20px 24px",borderBottom:"dark"===m?"1px solid #3a3a3a":"1px solid #e5e7eb",display:"flex",justifyContent:"space-between",alignItems:"center"}},a.createElement("h2",{style:{margin:0,color:"dark"===m?"#fff":"#1f2937",fontSize:"18px",fontWeight:"600"}},p("backup.title")),a.createElement("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),C(),f(null),v({})},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},style:{background:"none",border:"none",color:"dark"===m?"#888":"#6b7280",cursor:"pointer",padding:"4px",pointerEvents:"all"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{style:{display:"flex",borderBottom:"dark"===m?"1px solid #3a3a3a":"1px solid #e5e7eb"}},a.createElement("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),u("export")},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},style:{flex:1,padding:"14px",background:"export"===t?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15)":"transparent",border:"none",borderBottom:"export"===t?"2px solid var(--lion-primary)":"2px solid transparent",color:"export"===t?"dark"===m?"#ffffff":"#1f2937":"dark"===m?"#888":"#6b7280",cursor:"pointer",fontWeight:"600",fontSize:"14px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18",style:{pointerEvents:"none",color:"var(--lion-primary)"}},a.createElement("path",{fill:"currentColor",d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z"})),p("backup.export")),a.createElement("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),u("import")},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},style:{flex:1,padding:"14px",background:"import"===t?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15)":"transparent",border:"none",borderBottom:"import"===t?"2px solid var(--lion-primary)":"2px solid transparent",color:"import"===t?"dark"===m?"#ffffff":"#1f2937":"dark"===m?"#888":"#6b7280",cursor:"pointer",fontWeight:"600",fontSize:"14px",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18",style:{pointerEvents:"none",color:"var(--lion-primary)"}},a.createElement("path",{fill:"currentColor",d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6-.67l-2.59 2.58L9 12.5l5-5 5 5-1.41 1.41L15 11.33V20h-2v-8.67z"})),p("backup.import")),!1),a.createElement("div",{style:{padding:"20px 24px",maxHeight:"400px",overflowY:"auto",pointerEvents:"all"},onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},"export"===t?a.createElement(a.Fragment,null,a.createElement("div",{style:{background:"dark"===m?"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.08)":"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.05)",borderRadius:"12px",padding:"16px",marginBottom:"20px",border:"dark"===m?"1px solid rgba(var(--lion-primary-rgb, 37, 99, 235), 0.2)":"1px solid rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15)"}},a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o?"16px":"0"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},a.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"dark"===m?"#fff":"#1f2937"}},p("backup.autoBackup")),a.createElement("div",{style:{position:"relative",display:"inline-flex"}},a.createElement("div",{title:p("backup.autoBackupInfo"),style:{cursor:"help",display:"flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",borderRadius:"50%",background:"dark"===m?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)",color:"dark"===m?"#aaa":"#6b7280",fontSize:"12px",fontWeight:"600"}},"i"))),a.createElement("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),h(!o)},style:{width:"44px",height:"24px",borderRadius:"12px",border:"none",background:o?"var(--lion-primary)":"dark"===m?"#444":"#d1d5db",cursor:"pointer",position:"relative",transition:"background 0.2s"}},a.createElement("span",{style:{position:"absolute",top:"2px",left:o?"22px":"2px",width:"20px",height:"20px",borderRadius:"50%",background:"#fff",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}}))),o&&a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px"}},a.createElement("span",{style:{fontSize:"13px",color:"dark"===m?"#aaa":"#6b7280",marginBottom:"4px"}},p("backup.autoBackupDestination")),a.createElement("div",{style:{display:"flex",gap:"8px"}},a.createElement("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),b("whatsapp")},style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"10px 12px",borderRadius:"8px",border:"whatsapp"===i?"2px solid var(--lion-primary)":"dark"===m?"1px solid #3a3a3a":"1px solid #e5e7eb",background:"whatsapp"===i?"var(--lion-primary)":"dark"===m?"#2a2a2a":"#f9fafb",cursor:"pointer",color:"whatsapp"===i?"#ffffff":"dark"===m?"#ccc":"#6b7280",fontSize:"12px",fontWeight:"whatsapp"===i?"600":"500"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},a.createElement("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"})),p("backup.autoBackupWhatsApp")),a.createElement("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),b("download")},style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"10px 12px",borderRadius:"8px",border:"download"===i?"2px solid var(--lion-primary)":"dark"===m?"1px solid #3a3a3a":"1px solid #e5e7eb",background:"download"===i?"var(--lion-primary)":"dark"===m?"#2a2a2a":"#f9fafb",cursor:"pointer",color:"download"===i?"#ffffff":"dark"===m?"#ccc":"#6b7280",fontSize:"12px",fontWeight:"download"===i?"600":"500"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},a.createElement("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z"})),p("backup.autoBackupDownload"))))),a.createElement("p",{style:{color:"dark"===m?"#aaa":"#6b7280",fontSize:"13px",margin:"0 0 16px",lineHeight:"1.5"}},"Select the features you want to export. Your data will be downloaded as a JSON file."),a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"12px"}},[{key:"kanbanData",name:p("backup.kanbanCRM"),icon:"📊"},{key:"customTabs",name:p("backup.customTabs"),icon:"📑"},{key:"templates",name:p("backup.templatesQuickReplies"),icon:"📝"},{key:"broadcastHistory",name:p("backup.broadcastHistory"),icon:"📢"},{key:"settings",name:p("backup.settings"),icon:"⚙️"},{key:"crmProfileData",name:p("backup.crmProfileData"),icon:"👤"},{key:"calendarData",name:p("backup.calendarData"),icon:"📅"},{key:"statusData",name:p("backup.statusData"),icon:"🏷️"},{key:"webhookSettings",name:p("backup.webhookSettings"),icon:"🔗"},{key:"aiBotSettings",name:p("backup.aiBotSettings"),icon:"🤖"},{key:"aiApiSettings",name:p("backup.aiApiSettings"),icon:"🔑"},{key:"spokenLanguage",name:p("backup.spokenLanguage"),icon:"🗣️"},{key:"chatbotFlows",name:p("backup.chatbotFlows"),icon:"🔄"},{key:"followupData",name:p("backup.followupData"),icon:"📨"},{key:"scheduledMessages",name:p("backup.scheduledMessages"),icon:"📅"},{key:"scheduledBroadcasts",name:p("backup.scheduledBroadcasts"),icon:"⏰"},{key:"fluxoAdvanced",name:p("backup.fluxoAdvanced"),icon:"🔧"},{key:"conversationStates",name:p("backup.conversationStates"),icon:"💬"},{key:"bulkValidatorData",name:p("backup.bulkValidatorData"),icon:"✅"},{key:"quickReplies",name:p("backup.quickReplies"),icon:"⚡"},{key:"crmTodos",name:p("backup.crmTodos"),icon:"✔️"},{key:"signatureSettings",name:p("backup.signatureSettings"),icon:"✍️"},{key:"teamSettings",name:p("backup.teamSettings"),icon:"👥"},{key:"blurSettings",name:p("backup.blurSettings"),icon:"🔒"},{key:"featureVisibility",name:p("backup.featureVisibility"),icon:"👁️"},{key:"themeSettings",name:p("backup.themeSettings"),icon:"🎨"},{key:"uiStateSettings",name:p("backup.uiStateSettings"),icon:"📐"},{key:"apiPollingSettings",name:p("backup.apiPollingSettings"),icon:"🔄"},{key:"agentSettings",name:p("backup.agentSettings"),icon:"🎧"}].map(e=>a.createElement("div",{key:e.key,role:"button",tabIndex:0,onClick:t=>{t.preventDefault(),t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),g(t=>({...t,[e.key]:!t[e.key]}))},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",background:"dark"===m?"rgba(255,255,255,0.05)":"#f9fafb",borderRadius:"10px",cursor:"pointer",transition:"background 0.2s",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"all"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px",pointerEvents:"none"}},a.createElement("span",{style:{fontSize:"20px"}},e.icon),a.createElement("span",{style:{color:"dark"===m?"#fff":"#1f2937",fontSize:"14px"}},e.name)),a.createElement("div",{style:{width:"44px",height:"24px",background:r[e.key]?"var(--lion-primary)":"dark"===m?"#444":"#d1d5db",borderRadius:"12px",position:"relative",cursor:"pointer",transition:"background 0.2s",pointerEvents:"none"}},a.createElement("div",{style:{width:"20px",height:"20px",background:"#fff",borderRadius:"50%",position:"absolute",top:"2px",left:r[e.key]?"22px":"2px",transition:"left 0.2s",pointerEvents:"none"}}))))),a.createElement("button",{type:"button",onClick:async e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),await x()},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},disabled:!Object.values(r).some(e=>e),style:{width:"100%",marginTop:"20px",padding:"14px",background:Object.values(r).some(e=>e)?"var(--lion-primary)":"dark"===m?"#444":"#d1d5db",color:"#fff",border:"none",borderRadius:"10px",fontSize:"15px",fontWeight:"600",cursor:Object.values(r).some(e=>e)?"pointer":"not-allowed",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20",style:{pointerEvents:"none"}},a.createElement("path",{fill:"currentColor",d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z"})),p("backup.exportNow"))):"import"===t?a.createElement(a.Fragment,null,s?a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px 16px",background:"rgba(var(--lion-primary-rgb, 37, 99, 235), 0.1)",borderRadius:"10px",marginBottom:"16px"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24",style:{color:"var(--lion-primary)"}},a.createElement("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})),a.createElement("div",null,a.createElement("div",{style:{color:"var(--lion-primary)",fontSize:"14px",fontWeight:"600"}},p("backup.fileLoaded")),a.createElement("div",{style:{color:"dark"===m?"#888":"#6b7280",fontSize:"12px"}},s.date?new Date(s.date).toLocaleString():"Unknown date")),a.createElement("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),f(null),v({})},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},style:{marginLeft:"auto",background:"none",border:"none",color:"dark"===m?"#888":"#6b7280",cursor:"pointer",padding:"4px",pointerEvents:"all"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("p",{style:{color:"dark"===m?"#aaa":"#6b7280",fontSize:"13px",margin:"0 0 16px",lineHeight:"1.5"}},"Select features to import:"),a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"12px"}},0===Object.keys(l).length?a.createElement("div",{style:{color:"dark"===m?"#888":"#6b7280",textAlign:"center",padding:"20px"}},"No compatible features found in backup file."):Object.keys(l).map(e=>a.createElement("div",{key:e,role:"button",tabIndex:0,onClick:t=>{t.preventDefault(),t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),v(t=>({...t,[e]:!t[e]}))},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",background:"dark"===m?"rgba(255,255,255,0.05)":"#f9fafb",borderRadius:"10px",cursor:"pointer",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"all"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px",pointerEvents:"none"}},a.createElement("span",{style:{fontSize:"20px"}},"kanbanData"===e?"📊":"customTabs"===e?"📑":"templates"===e?"📝":"broadcastHistory"===e?"📢":"⚙️"),a.createElement("span",{style:{color:"dark"===m?"#fff":"#1f2937",fontSize:"14px"}},S(e))),a.createElement("div",{style:{width:"44px",height:"24px",background:l[e]?"var(--lion-primary)":"dark"===m?"#444":"#d1d5db",borderRadius:"12px",position:"relative",cursor:"pointer",transition:"background 0.2s",pointerEvents:"none"}},a.createElement("div",{style:{width:"20px",height:"20px",background:"#fff",borderRadius:"50%",position:"absolute",top:"2px",left:l[e]?"22px":"2px",transition:"left 0.2s",pointerEvents:"none"}}))))),a.createElement("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),w()},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},disabled:!Object.values(l).some(e=>e),style:{width:"100%",marginTop:"20px",padding:"14px",background:Object.values(l).some(e=>e)?"var(--lion-primary)":"dark"===m?"#444":"#d1d5db",color:"#fff",border:"none",borderRadius:"10px",fontSize:"15px",fontWeight:"600",cursor:Object.values(l).some(e=>e)?"pointer":"not-allowed",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20",style:{pointerEvents:"none"}},a.createElement("path",{fill:"currentColor",d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6-.67l-2.59 2.58L9 12.5l5-5 5 5-1.41 1.41L15 11.33V20h-2v-8.67z"})),p("backup.importNow"))):a.createElement(a.Fragment,null,a.createElement("p",{style:{color:"dark"===m?"#aaa":"#6b7280",fontSize:"13px",margin:"0 0 16px",lineHeight:"1.5"}},p("backup.importHint").replace("{brand}",A)),a.createElement("label",{onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"40px 20px",border:"dark"===m?"2px dashed #444":"2px dashed #d1d5db",borderRadius:"12px",cursor:"pointer",transition:"border-color 0.2s",pointerEvents:"all"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"48",height:"48",style:{color:"dark"===m?"#666":"#9ca3af",marginBottom:"12px"}},a.createElement("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"})),a.createElement("span",{style:{color:"dark"===m?"#888":"#6b7280",fontSize:"14px",marginBottom:"8px"}},"Click to upload backup file"),a.createElement("span",{style:{color:"dark"===m?"#666":"#9ca3af",fontSize:"12px"}},"JSON file only"),a.createElement("input",{type:"file",accept:".json",onChange:E,style:{display:"none"}})))):a.createElement(a.Fragment,null,s?a.createElement(a.Fragment,null,a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px 16px",background:"rgba(59, 130, 246, 0.1)",borderRadius:"10px",marginBottom:"16px"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24",style:{color:"#3b82f6"}},a.createElement("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})),a.createElement("div",null,a.createElement("div",{style:{color:"#3b82f6",fontSize:"14px",fontWeight:"600"}},p("backup.cheetahDetected")),a.createElement("div",{style:{color:"dark"===m?"#888":"#6b7280",fontSize:"12px"}},"Cheetah CRM backup ready to import")),a.createElement("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),f(null)},style:{marginLeft:"auto",background:"none",border:"none",color:"dark"===m?"#888":"#6b7280",cursor:"pointer",padding:"4px"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{style:{background:"rgba(245, 158, 11, 0.1)",border:"1px solid rgba(245, 158, 11, 0.3)",borderRadius:"10px",padding:"12px 16px",marginBottom:"16px",display:"flex",alignItems:"flex-start",gap:"10px"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20",style:{color:"#0ea5e9",flexShrink:0,marginTop:"2px"}},a.createElement("path",{fill:"currentColor",d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})),a.createElement("div",{style:{color:"dark"===m?"#60a5fa":"#1e3a8a",fontSize:"13px",lineHeight:"1.5"}},a.createElement("strong",null,p("backup.mergeWarning")),a.createElement("br",null),p("backup.mergeWarningDesc"))),a.createElement("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),k()},disabled:d,style:{width:"100%",padding:"14px 20px",background:d?"#9ca3af":"#3b82f6",color:"#fff",border:"none",borderRadius:"10px",fontSize:"15px",fontWeight:"600",cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}},d?a.createElement(a.Fragment,null,a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",style:{animation:"spin 1s linear infinite"}},a.createElement("path",{fill:"currentColor",d:"M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8z"})),p("backup.importing")):a.createElement(a.Fragment,null,a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M5 20h14v-2H5v2zm0-10h4v6h6v-6h4l-7-7-7 7z"})),p("backup.importCheetah")))):a.createElement(a.Fragment,null,a.createElement("p",{style:{color:"dark"===m?"#aaa":"#6b7280",fontSize:"13px",margin:"0 0 16px",lineHeight:"1.5"}},p("backup.cheetahImportDesc")),a.createElement("label",{onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onMouseDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onPointerDown:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"40px 20px",border:"2px dashed #3b82f6",borderRadius:"12px",cursor:"pointer",transition:"border-color 0.2s",pointerEvents:"all",background:"dark"===m?"rgba(59, 130, 246, 0.05)":"rgba(59, 130, 246, 0.03)"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"48",height:"48",style:{color:"#3b82f6",marginBottom:"12px"}},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),a.createElement("span",{style:{color:"#3b82f6",fontSize:"14px",marginBottom:"8px",fontWeight:"600"}},"Click to upload Cheetah CRM backup"),a.createElement("span",{style:{color:"dark"===m?"#666":"#9ca3af",fontSize:"12px"}},"JSON file only"),a.createElement("input",{type:"file",accept:".json",onChange:e=>{const t=e.target.files?.[0];if(!t)return;const n=new FileReader;n.onload=e=>{try{const t=JSON.parse(e.target?.result);Mu(t)?f(t):alert("This does not appear to be a valid Cheetah CRM backup file. Please select a valid Cheetah CRM backup.")}catch(e){alert("Invalid JSON file. Please select a valid backup file.")}},n.readAsText(t)},style:{display:"none"}})),a.createElement("div",{style:{marginTop:"20px",background:"dark"===m?"rgba(255,255,255,0.05)":"#f9fafb",borderRadius:"10px",padding:"16px"}},a.createElement("div",{style:{color:"dark"===m?"#fff":"#1f2937",fontSize:"14px",fontWeight:"600",marginBottom:"12px"}},p("backup.dataToImport")),a.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"}},["CRM Contacts","Custom Tabs","Quick Replies","Chatbot Flows","Follow-ups","Schedules","Webhooks","AI Settings"].map(e=>a.createElement("span",{key:e,style:{padding:"4px 10px",background:"rgba(59, 130, 246, 0.15)",color:"#3b82f6",borderRadius:"6px",fontSize:"12px",fontWeight:"500"}},e)))))))))},ag=({currentTheme:e,language:t,supportedLanguages:n,t:r,changeLanguage:o,onClose:i})=>a.createElement(a.Fragment,null,a.createElement("div",{className:"wa-modal-backdrop",onClick:i}),a.createElement("div",{className:"wa-language-modal "+("dark"===e?"lion-dark":"")},a.createElement("div",{className:"wa-language-modal-content"},a.createElement("div",{className:"wa-language-modal-header"},a.createElement("h2",{className:"wa-language-modal-title"},r("profile.language")),a.createElement("button",{className:"wa-modal-close",onClick:i},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"wa-language-modal-body"},a.createElement("div",{className:"wa-language-grid"},Object.entries(n).map(([e,n])=>a.createElement("button",{key:e,className:"wa-language-item "+(t===e?"wa-language-active":""),onClick:async()=>{await o(e)}},a.createElement("div",{className:"wa-language-flag",title:n},e.toUpperCase()),a.createElement("div",{className:"wa-language-name"},n,t===e&&a.createElement("span",{className:"wa-language-choose"}," · ",r("common.choose"))),t===e&&a.createElement("svg",{className:"wa-language-check",viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"}))))))))),rg=({missedSchedule:e,t,onResume:n,onCancel:r,onDismiss:o})=>a.createElement("div",{className:"missed-schedule-overlay"},a.createElement("div",{className:"missed-schedule-popup"},a.createElement("div",{className:"missed-schedule-header"},a.createElement("div",{className:"missed-schedule-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"48",height:"48"},a.createElement("path",{fill:"#0ea5e9",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))),a.createElement("h2",null,t("missedSchedule.title")),a.createElement("p",null,t("missedSchedule.description"))),a.createElement("div",{className:"missed-schedule-info"},a.createElement("div",{className:"missed-schedule-stat"},a.createElement("span",{className:"stat-value"},e.total),a.createElement("span",{className:"stat-label"},"Contacts")),a.createElement("div",{className:"missed-schedule-stat"},a.createElement("span",{className:"stat-value"},e.messages?.length||1),a.createElement("span",{className:"stat-label"},"Messages")),a.createElement("div",{className:"missed-schedule-stat warning"},a.createElement("span",{className:"stat-value"},e.startedAt?new Date(e.startedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"--:--"),a.createElement("span",{className:"stat-label"},"Scheduled Time"))),a.createElement("div",{className:"missed-schedule-actions"},a.createElement("button",{className:"missed-schedule-btn primary",onClick:e=>{e.stopPropagation(),e.preventDefault(),n()}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})),t("missedSchedule.sendNow")),a.createElement("button",{className:"missed-schedule-btn secondary",onClick:e=>{e.stopPropagation(),e.preventDefault(),r()}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),t("missedSchedule.cancelDiscard")),a.createElement("button",{className:"missed-schedule-btn dismiss",onClick:e=>{e.stopPropagation(),e.preventDefault(),o()}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),t("missedSchedule.dismiss"))))),og=({activeCRM:e,crmStages:t,activeStageId:n,onStageClick:r,onBackToTabs:o})=>a.createElement("div",{className:"wa-crm-stages-bar tab-bar-v2",style:{display:"flex",alignItems:"center",width:"100%",height:"42px",background:"var(--lion-tab-bar-bg)",borderBottom:"1px solid var(--lion-tab-bar-border)",padding:"0 16px",gap:"10px",boxSizing:"border-box"}},a.createElement("button",{onClick:o,title:"Back to Tabs",style:{flexShrink:0,width:"28px",height:"30px",background:"var(--lion-bg-primary, #ffffff)",border:"1px solid var(--lion-border-light, #e5e7eb)",borderRadius:"8px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--lion-text-secondary, #374151)",padding:0,transition:"all 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.background="var(--lion-primary-light, #eff6ff)",e.currentTarget.style.borderColor="var(--lion-primary, #7C3AED)",e.currentTarget.style.color="var(--lion-primary, #7C3AED)"},onMouseLeave:e=>{e.currentTarget.style.background="var(--lion-bg-primary, #ffffff)",e.currentTarget.style.borderColor="var(--lion-border-light, #e5e7eb)",e.currentTarget.style.color="var(--lion-text-secondary, #374151)"}},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},a.createElement("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}))),a.createElement("span",{style:{flexShrink:0,fontSize:"13px",fontWeight:700,color:"var(--lion-text-primary, #1f2937)",whiteSpace:"nowrap",paddingRight:"4px",borderRight:"1px solid var(--lion-border-light, #e5e7eb)",marginRight:"4px",height:"20px",display:"inline-flex",alignItems:"center"}},e.name),a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"4px",flex:1,overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none",padding:"4px 0",minWidth:0}},(t||[]).map(e=>{const t=n===e.id,o=e.color||"#6b7280";return a.createElement("button",{key:e.id,onClick:()=>r(e.id),title:e.name,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 14px",background:t?o:"transparent",border:`1px solid ${t?o:"transparent"}`,color:t?"#ffffff":"var(--lion-text-muted, #6b7280)",borderRadius:"8px",fontSize:"12px",fontWeight:600,cursor:"pointer",transition:"all 0.15s ease",whiteSpace:"nowrap",flexShrink:0,height:"30px",boxShadow:t?`0 2px 6px ${o}40`:"none",fontFamily:"inherit"},onMouseEnter:e=>{t||(e.currentTarget.style.background=`${o}15`,e.currentTarget.style.color=o)},onMouseLeave:e=>{t||(e.currentTarget.style.background="transparent",e.currentTarget.style.color="var(--lion-text-muted, #6b7280)")}},a.createElement("span",{style:{width:"8px",height:"8px",borderRadius:"50%",background:t?"#ffffff":o,flexShrink:0}}),a.createElement("span",null,e.name))})));const ig=()=>{a.useEffect(()=>()=>{},[]);const{t:e,language:t,changeLanguage:r,supportedLanguages:o}=(()=>{const e=(0,a.useContext)(l);if(!e)throw new Error("useI18n must be used within I18nProvider");return e})(),[s,c]=(0,a.useState)(!1),[d,m]=(0,a.useState)(null),[p,u]=(0,a.useState)(""),[g,h]=(0,a.useState)(!1),[b,f]=(0,a.useState)(""),[k,C]=(0,a.useState)(""),[_,I]=(0,a.useState)("none"),[R,B]=(0,a.useState)(!1),[L,U]=(0,a.useState)(!1),[F,z]=(0,a.useState)(!1),[O,W]=(0,a.useState)(!1),[q,H]=(0,a.useState)("export"),[j,V]=(0,a.useState)({kanbanData:!0,customTabs:!0,templates:!0,broadcastHistory:!0,settings:!0,crmProfileData:!0,calendarData:!0,statusData:!0,webhookSettings:!0,aiBotSettings:!0,aiApiSettings:!0,spokenLanguage:!0,chatbotFlows:!0,followupData:!0,scheduledMessages:!0,scheduledBroadcasts:!0,fluxoAdvanced:!0,conversationStates:!0,bulkValidatorData:!0,quickReplies:!0,crmTodos:!0,signatureSettings:!0,teamSettings:!0,blurSettings:!0,featureVisibility:!0,themeSettings:!0,uiStateSettings:!0,apiPollingSettings:!0,agentSettings:!0}),[G,K]=(0,a.useState)(()=>"true"===localStorage.getItem("wa_auto_backup_enabled")),[$,Y]=(0,a.useState)(()=>{const e=localStorage.getItem("wa_auto_backup_destination");return"whatsapp"===e||"download"===e?e:"whatsapp"}),[X,J]=(0,a.useState)(null),[Q,Z]=(0,a.useState)({}),[ee,te]=(0,a.useState)("lion"),[ne,ae]=(0,a.useState)(null),[re,oe]=(0,a.useState)(!1),[ie,se]=(0,a.useState)(!1),[le,ce]=(0,a.useState)(!1),[de,me]=(0,a.useState)(!1),[pe,ue]=(0,a.useState)(!1),[ge,he]=(0,a.useState)(!1),[be,fe]=(0,a.useState)(!1),[ve,ye]=(0,a.useState)(!1),[xe,we]=(0,a.useState)(!1),[ke,Ee]=(0,a.useState)(null),[Se,Ce]=(0,a.useState)(!1),[Te,Ae]=(0,a.useState)(!1),[De,_e]=(0,a.useState)(!1),[Ne,Me]=(0,a.useState)(!1),[Ie,Re]=(0,a.useState)(!1),[Be,Pe]=(0,a.useState)(Eu),[Le,Ue]=(0,a.useState)(()=>Hp()),[Fe,ze]=(0,a.useState)(!1),[Oe,We]=(0,a.useState)(!1),[qe,He]=(0,a.useState)("ai-api"),[je,Ve]=(0,a.useState)("system"),[Ge,Ke]=(0,a.useState)("light"),[$e,Ye]=(0,a.useState)("pt"),[Xe,Je]=(0,a.useState)(()=>"true"===localStorage.getItem("wa_header_collapsed")),[Qe,Ze]=(0,a.useState)("pt"),[et,tt]=(0,a.useState)("chatgpt"),[nt,at]=(0,a.useState)(""),[rt,ot]=(0,a.useState)(!1),[it,st]=(0,a.useState)(!1),[lt,ct]=(0,a.useState)("idle"),[dt,mt]=(0,a.useState)(!1),[pt,ut]=(0,a.useState)(!1),[gt,ht]=(0,a.useState)({blurMessages:!1,blurProfileNames:!1,blurDisplayPhotos:!1,blurConversation:!1,displayOnHover:!1}),[bt,ft]=(0,a.useState)("tabs"),[vt,yt]=(0,a.useState)(null),[xt,wt]=(0,a.useState)(()=>"true"===localStorage.getItem("wa_tabbar_hidden")),[kt,Et]=(0,a.useState)(null),[St,Ct]=(0,a.useState)([]),[Tt,At]=(0,a.useState)(null),[Dt,_t]=(0,a.useState)(null),[Nt,Mt]=(0,a.useState)(!1),[It,Rt]=(0,a.useState)(null),Bt=()=>{if(!d?.isValid)return!1;const e=d.featuresEnabled||[];return e.includes("basic")||e.includes("advance")||e.includes("advanced")||e.includes("premium")},Pt=()=>{if(!d?.featuresEnabled||0===d.featuresEnabled.length)return e("profile.premium");const t=d.featuresEnabled;return t.includes("premium")?e("profile.premium"):t.includes("advance")||t.includes("advanced")?"Advanced":t.includes("basic")?"Basic":t.length>1?t.map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" + "):t[0].charAt(0).toUpperCase()+t[0].slice(1)},Lt=async e=>new Promise(t=>{const n=setTimeout(()=>{window.removeEventListener("message",a),t([])},1e4),a=async r=>{if(r.source!==window)return;if("KANBAN_LABELS_RESPONSE"!==r.data.type)return;window.removeEventListener("message",a),clearTimeout(n);const o=r.data.labels||[];if(o.length>0){const n=[{id:`stage-inbox-${e}`,crmId:e,name:"INBOX",color:"#808080",position:0,isSystemGenerated:!0},...o.map((t,n)=>({id:`stage-label-${t.id}`,crmId:e,name:t.name||`Label ${t.id}`,color:t.hexColor||t.color||"#6b7280",position:n+1,whatsappLabelId:t.id?.toString()||t._serialized}))];try{await du.KanbanStorage.setStagesAsync(e,n)}catch(e){}t(n)}else{const n={id:`stage-inbox-${e}`,crmId:e,name:"INBOX",color:"#808080",position:0,isSystemGenerated:!0};try{await du.KanbanStorage.setStagesAsync(e,[n])}catch(e){}t([n])}};window.addEventListener("message",a),window.postMessage({type:"KANBAN_FETCH_LABELS",source:"content-script"},"*")}),Ut=()=>{Et(null),Ct([]),At(null),ft("tabs")};(0,a.useEffect)(()=>{localStorage.setItem("wa_header_collapsed",String(Xe))},[Xe]),(0,a.useEffect)(()=>{(async()=>{try{const e=await n().storage.local.get("gmaps_broadcast_payload");e?.gmaps_broadcast_payload&&me(!0)}catch{}})();const e=(e,t)=>{if("local"!==t)return;const n=e.gmaps_broadcast_payload;n&&n.newValue&&me(!0)};try{n().storage.onChanged.addListener(e)}catch{}return()=>{try{n().storage.onChanged.removeListener(e)}catch{}}},[]),(0,a.useEffect)(()=>{const e=document.querySelector("#app");if(e){const t=e.style.paddingTop,n=e.style.boxSizing,a="tabs"===bt&&Bt()&&!xt;let r="56px";return Xe?r="0px":(a||"kanban"===bt&&kt)&&(r="96px"),e.style.setProperty("padding-top",r,"important"),e.style.setProperty("box-sizing","border-box","important"),document.body.classList.add("wa-extension-active"),a?document.body.classList.add("wa-tabs-active"):document.body.classList.remove("wa-tabs-active"),()=>{e.style.paddingTop=t,e.style.boxSizing=n,document.body.classList.remove("wa-extension-active"),document.body.classList.remove("wa-tabs-active")}}},[bt,d,kt,St,xt,Xe]),(0,a.useEffect)(()=>{const e=Gn.getSettings();tt(e.provider),at(e.apiKey),ot(e.enabled),Ye(t),n().storage.local.get("wa_spoken_language").then(e=>{const t=e.wa_spoken_language||"pt";Ze(t),localStorage.setItem("wa_spoken_language",t),Yn(t)});const a=uu.getSettings();ht(a),gu(a);const r=Cu.getSettings();Pe(r)},[t]),(0,a.useEffect)(()=>{const e=e=>{const t=e;t.detail&&Pe(t.detail)};return window.addEventListener("featureVisibilityChanged",e),()=>{window.removeEventListener("featureVisibilityChanged",e)}},[]),(0,a.useEffect)(()=>{const e=e=>{const t=e;t.detail&&Ue(t.detail)};return window.addEventListener("wa-pinned-features-changed",e),()=>{window.removeEventListener("wa-pinned-features-changed",e)}},[]),(0,a.useEffect)(()=>{const e=e=>{const t=e;t.detail&&wt(t.detail.hidden)};return window.addEventListener("wa-tabbar-visibility",e),()=>{window.removeEventListener("wa-tabbar-visibility",e)}},[]),(0,a.useEffect)(()=>{localStorage.setItem("wa_auto_backup_enabled",G?"true":"false"),localStorage.setItem("wa_auto_backup_destination",$)},[G,$]),(0,a.useEffect)(()=>{const e=()=>{const e=Sr.isEnabled(),t=Sr.isWithinSchedule();ze(e),We(e&&t)};e();const t=()=>{e()};document.addEventListener("aiBotSettingsChanged",t);const n=setInterval(e,6e4);return()=>{document.removeEventListener("aiBotSettingsChanged",t),clearInterval(n)}},[]);const Ft=async()=>{ke||await(async()=>{try{const e=await n().runtime.sendMessage({action:"getApiCredentials"});e&&e.success&&Ee({phoneHash:e.phoneHash,licenseSignature:e.licenseSignature})}catch(e){}})(),we(!0)};(0,a.useEffect)(()=>{zt(),Ot();const e=e=>{"licenseUpdated"===e.action&&zt()};return n().runtime.onMessage.addListener(e),()=>{n().runtime.onMessage.removeListener(e)}},[]),(0,a.useEffect)(()=>{const e=e=>{const t=e.target;R&&!t.closest(".wa-profile-container")&&B(!1)};return R&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[R]),(0,a.useEffect)(()=>{(async()=>{const e=await D();Ve(e.mode);const t=A(e.mode);Ke(t),N("dark"===t)})();const e=M(e=>{D().then(t=>{"system"===t.mode&&(Ke(e?"dark":"light"),N(e))})}),t=e=>{const t=e.detail;Ve(t.mode);const n=A(t.mode);Ke(n)};return window.addEventListener("lionThemeChanged",t),()=>{e&&e.disconnect(),window.removeEventListener("lionThemeChanged",t)}},[]);(0,a.useEffect)(()=>{const e=setTimeout(async()=>{try{const e=(await n().storage.local.get("wa_active_campaign")).wa_active_campaign;e&&!0===e.isMissedSchedule&&(_t(e),Mt(!0))}catch(e){}},3e3),t=(e,t)=>{if("local"===t&&e.wa_active_campaign){const t=e.wa_active_campaign.newValue;t&&!0===t.isMissedSchedule&&(_t(t),Mt(!0))}};return n().storage.onChanged.addListener(t),()=>{clearTimeout(e),n().storage.onChanged.removeListener(t)}},[]);(0,a.useEffect)(()=>{const e=e=>{const{preSelectQuickReply:t}=e.detail||{};ce(!0),t&&sessionStorage.setItem("preSelectQuickReply","true")};return window.addEventListener("openTemplateManager",e),()=>{window.removeEventListener("openTemplateManager",e)}},[]),(0,a.useEffect)(()=>{const e=async()=>{try{const e=(await n().storage.local.get("wa_active_campaign")).wa_active_campaign;if(e&&("running"===e.status||"paused"===e.status)&&e.total>0){const t=Math.round(e.sent/e.total*100);Rt({isActive:!0,sent:e.sent,failed:e.failed,total:e.total,percentage:t})}else Rt(null)}catch(e){}};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[]);const zt=async()=>{try{const e=await async function(){try{const e=await n().runtime.sendMessage({action:"checkLicense"});if(!e)return{isValid:!1,features:[],expiryDays:0,phoneNumber:"",message:"No response from background"};if(e.validationToken){const t=await xu();return{isValid:t.length>0,features:t,expiryDays:e.expiryDays||0,phoneNumber:e.phoneNumber||"",message:e.message||""}}return{isValid:e.isValid||!1,features:e.featuresEnabled||[],expiryDays:e.expiryDays||0,phoneNumber:e.phoneNumber||"",message:e.message||""}}catch(e){return{isValid:!1,features:[],expiryDays:0,phoneNumber:"",message:String(e)}}}();e.isValid&&(m({isValid:e.isValid,phoneNumber:e.phoneNumber,expiryDays:e.expiryDays,message:e.message,featuresEnabled:e.features}),C(e.phoneNumber))}catch(e){if(e.message&&e.message.includes("Extension context invalidated"))return}},Ot=async()=>{try{const e=document.documentElement.getAttribute("data-wa-phone");e&&C(e);const t=e=>{const t=e.detail?.phoneNumber;t&&C(t)};document.addEventListener("waExtensionPhoneDetected",t)}catch(e){}},Wt=async e=>{const t=(()=>{const e=cr[0];return/^\d+$/.test(e)?e:""})();if(t){I("loading");try{const a=await n().runtime.sendMessage({action:"requestAutoTrial",phoneNumber:e,adminId:t});if(a.success&&a.isValid){const t="wa_auto_trial_attempted_"+e;localStorage.setItem(t,"true"),I("activated"),m({isValid:!0,phoneNumber:a.phoneNumber,expiryDays:a.expiryDays,message:a.message,featuresEnabled:a.featuresEnabled})}else if(a.existing){const t="wa_auto_trial_attempted_"+e;localStorage.setItem(t,"true"),I("exists")}else I("error")}catch(e){I("error")}}};(0,a.useEffect)(()=>{if(k&&!d?.isValid&&"none"===_){const e="wa_auto_trial_attempted_"+k;localStorage.getItem(e)||Wt(k)}},[k,d,_]);const qt=t=>function(e,t){return{kanbanData:t("backup.kanbanCRM"),customTabs:t("backup.customTabs"),templates:t("backup.templatesQuickReplies"),broadcastHistory:t("backup.broadcastHistory"),settings:t("backup.settings"),crmProfileData:t("backup.crmProfileData"),calendarData:t("backup.calendarData"),statusData:t("backup.statusData"),webhookSettings:t("backup.webhookSettings"),aiBotSettings:t("backup.aiBotSettings"),aiApiSettings:t("backup.aiApiSettings"),spokenLanguage:t("backup.spokenLanguage"),chatbotFlows:t("backup.chatbotFlows"),followupData:t("backup.followupData"),scheduledBroadcasts:t("backup.scheduledBroadcasts"),fluxoAdvanced:t("backup.fluxoAdvanced"),conversationStates:t("backup.conversationStates"),bulkValidatorData:t("backup.bulkValidatorData"),quickReplies:t("backup.quickReplies"),crmTodos:t("backup.crmTodos"),signatureSettings:t("backup.signatureSettings"),teamSettings:t("backup.teamSettings"),blurSettings:t("backup.blurSettings"),featureVisibility:t("backup.featureVisibility"),themeSettings:t("backup.themeSettings"),uiStateSettings:t("backup.uiStateSettings"),apiPollingSettings:t("backup.apiPollingSettings"),agentSettings:t("backup.agentSettings")}[e]||e}(t,e),Ht=async()=>{if(confirm("Deactivating license will:\n\n1. Download a backup of your data\n2. Clear all extension data\n3. Remove your license\n\nDo you want to continue?")){h(!0);try{const{backup:e,filename:t}=await async function(){const e={version:"1.0",timestamp:Date.now(),date:(new Date).toISOString(),data:{}};try{const t=await n().storage.local.get(null),{license:a,...r}=t;e.data.chromeStorage=r}catch(e){}try{const t=await Hu(Ou);e.data.indexedDB=t}catch(e){}try{const t={};for(const e of Fu){const n=localStorage.getItem(e);if(n)try{t[e]=JSON.parse(n)}catch(a){t[e]=n}}for(let e=0;e<localStorage.length;e++){const n=localStorage.key(e);if(n&&!Fu.includes(n)&&zu.some(e=>n.toLowerCase().includes(e))){const e=localStorage.getItem(n);if(e)try{t[n]=JSON.parse(e)}catch(a){t[n]=e}}}e.data.localStorage=t}catch(e){}return{backup:e,filename:`wa_extension_backup_${(new Date).toISOString().split("T")[0]}.json`}}();if(ju(e,t),!confirm("Backup file downloaded!\n\nPlease save it safely.\n\nClick OK to clear all data and deactivate license.\nClick Cancel to keep your data."))return void h(!1);await n().runtime.sendMessage({action:"licenseDeactivated"}).catch(()=>{}),await async function(){try{await n().storage.local.clear();for(const e of Wu)try{await new Promise(t=>{const n=indexedDB.deleteDatabase(e);n.onsuccess=()=>{t()},n.onerror=()=>{t()},n.onblocked=()=>{t()}})}catch(e){}for(const e of qu)null!==localStorage.getItem(e)&&localStorage.removeItem(e);const e=[];for(let t=localStorage.length-1;t>=0;t--){const n=localStorage.key(t);n&&(n.startsWith("wa_")||n.startsWith("WA_")||n.toLowerCase().includes("kanban")||n.toLowerCase().includes("broadcast")||n.toLowerCase().includes("template")||n.toLowerCase().includes("extension"))&&e.push(n)}for(const t of e)localStorage.removeItem(t);try{const e=[];for(let t=sessionStorage.length-1;t>=0;t--){const n=sessionStorage.key(t);n&&(n.startsWith("wa_")||n.startsWith("WA_"))&&e.push(n)}for(const t of e)sessionStorage.removeItem(t)}catch(e){}}catch(e){}}(),await n().runtime.sendMessage({action:"licenseDeactivated"}),m(null),u(""),c(!1),alert("Licença desativada e todos os dados foram apagados.\n\nVocê pode restaurar seus dados importando o arquivo de backup.")}catch(e){alert("Falha ao desativar a licença. Por favor, tente novamente.")}finally{h(!1)}}},[jt,Vt]=(0,a.useState)([]),Gt=jt.length>0?jt[jt.length-1]:null,Kt=jt.length>0;(0,a.useEffect)(()=>{const e=new Set;ie&&e.add("tabs"),le&&e.add("true"===sessionStorage.getItem("preSelectQuickReply")?"quickReply":"template"),de&&e.add("broadcast"),pe&&e.add("validator"),ge&&e.add("calendar"),be&&e.add("status"),ve&&e.add("webhook"),xe&&e.add("api"),Te&&e.add("aiBot"),Ne&&e.add("schedule"),De&&e.add("followUp"),Vt(t=>{const n=t.filter(t=>e.has(t)),a=new Set(n),r=Array.from(e).filter(e=>!a.has(e)),o=[...n,...r];return o.length===t.length&&o.every((e,n)=>e===t[n])?t:o})},[ie,le,de,pe,ge,be,ve,xe,Te,Ne,De]);const $t=e=>{const t=jt.indexOf(e);return-1===t?1e4:1e4+t+1};return a.createElement(a.Fragment,null,Nt&&Dt&&a.createElement(rg,{missedSchedule:Dt,t:e,onResume:()=>{Dt&&(n().storage.local.get("wa_active_campaign").then(e=>{const t=e.wa_active_campaign;t&&(t.isMissedSchedule=!1,n().storage.local.set({wa_active_campaign:t}))}),Mt(!1),me(!0))},onCancel:async()=>{if(!Dt)return;const e=(await n().storage.local.get("wa_broadcast_history")).wa_broadcast_history||[],t={id:Dt.id,name:`Broadcast ${new Date(Dt.startedAt).toLocaleDateString()}`,contacts:Dt.total,messages:Dt.messages?.length||1,sentCount:Dt.sent||0,failedCount:Dt.failed||0,startedAt:Dt.startedAt,completedAt:Date.now(),status:"cancelled",results:Dt.results||[]};e.unshift(t),e.length>100&&e.splice(100),await n().storage.local.set({wa_broadcast_history:e});const a=((await n().storage.local.get("wa_scheduled_broadcasts")).wa_scheduled_broadcasts||[]).filter(e=>e.id!==Dt.id);await n().storage.local.set({wa_scheduled_broadcasts:a}),await n().storage.local.remove("wa_active_campaign"),Mt(!1),_t(null)},onDismiss:()=>Mt(!1)}),a.createElement("div",{className:"wa-extension-header "+(Xe?"collapsed":"")},a.createElement(Ju,{isHeaderCollapsed:Xe,onToggleCollapse:()=>Je(!Xe),licenseStatus:d,currentPhone:k,currentTheme:Ge,featureVisibility:Be,aiEnabled:rt,aiBotEnabled:Fe,aiBotActive:Oe,broadcastProgress:It,hasTabsAccess:Bt(),planName:Pt(),pinnedFeatures:Le,t:e,supportedLanguages:o,onViewChange:e=>{ft(e),"tabs"===e&&Ut()},onCRMSelect:async(e,t)=>{Et({id:e,name:t}),ft("kanban");try{let t=await du.KanbanStorage.getStagesAsync(e);"crm-whatsapp-labels"===e&&0===t.length&&(t=await Lt(e)),Ct(t),t.length>0&&At(t[0].id)}catch(e){}},onExpandLicense:()=>c(!s),onTabsClick:()=>se(!0),onTemplateClick:()=>ce(!0),onQuickReplyClick:()=>{sessionStorage.setItem("preSelectQuickReply","true"),ce(!0)},onKanbanClick:()=>{n().runtime.sendMessage({action:"openKanban"}).catch(e=>{})},onChatbotFlowClick:()=>{n().runtime.sendMessage({action:"openFluxo"}).catch(e=>{})},onFollowUpClick:()=>_e(!0),onBroadcastClick:()=>me(!0),onScheduleClick:()=>Me(!0),onCalendarClick:()=>he(!0),onStatusClick:()=>fe(!0),onValidatorClick:()=>ue(!0),onWebhookClick:()=>ye(!0),onApiConfigClick:Ft,onAIBotClick:()=>Ae(!0),onGmapsExtractorClick:()=>{n().runtime.sendMessage({action:"GMAPS_OPEN_MAPS_TAB"})},onLicenseKeyClick:()=>c(!0),onSettingsClick:()=>Ce(!0),onFeatureSettingsClick:()=>Re(!0),onTutorialClick:()=>{},onLanguageClick:()=>z(!0),onBackupClick:()=>W(!0),onPrivacyClick:()=>{const e=(()=>{const e=ur[0];return gr(e)?"":e})();e&&window.open(e,"_blank")},onContactClick:()=>{},onWebsiteClick:()=>{},onBroadcastProgressClick:()=>me(!0),CircularProgress:({percentage:e,size:t=32})=>{const n=(t-3)/2,r=2*Math.PI*n,o=r-e/100*r;return a.createElement("svg",{width:t,height:t,style:{transform:"rotate(-90deg)"}},a.createElement("circle",{cx:t/2,cy:t/2,r:n,fill:"transparent",stroke:"rgba(255, 255, 255, 0.3)",strokeWidth:3}),a.createElement("circle",{cx:t/2,cy:t/2,r:n,fill:"transparent",stroke:"var(--lion-primary)",strokeWidth:3,strokeDasharray:r,strokeDashoffset:o,strokeLinecap:"round",style:{transition:"stroke-dashoffset 0.3s ease"}}))}})),s&&a.createElement(Qu,{licenseStatus:d,currentPhone:k,currentTheme:Ge,licenseKey:p,loading:g,error:b,trialStatus:_,t:e,onLicenseKeyChange:e=>u(e),onActivate:async()=>{h(!0),f("");try{if(!k)return f(e("license.waitForWhatsApp")),void h(!1);let t=p.trim(),a;if(!t)return f(e("errors.invalidFormat")),void h(!1);try{a=await n().runtime.sendMessage({action:"activateLicense",license:t,phoneNumber:k})}catch(t){if(t.message&&t.message.includes("Extension context invalidated"))return f(e("errors.extensionUpdated")),void h(!1);throw t}a&&a.success&&a.isValid?(m({isValid:a.isValid,phoneNumber:a.phoneNumber,expiryDays:a.expiryDays,message:a.message,featuresEnabled:a.featuresEnabled}),u(""),f(""),c(!1)):f(a?.message||e("errors.invalidFormat"))}catch(t){f(e("errors.invalidFormat")+": "+t.message)}finally{h(!1)}},onDeactivate:Ht,onClose:()=>c(!1)}),Bt()&&"tabs"===bt&&!Xe&&a.createElement(lu,{activeView:bt,onTabChange:e=>yt(e),featureVisibility:Be,aiEnabled:rt,aiBotEnabled:Fe,aiBotActive:Oe,pinnedFeatures:Le,onPinChange:()=>Ue(Hp()),t:e,onTabsClick:()=>se(!0),onTemplateClick:()=>ce(!0),onQuickReplyClick:()=>{sessionStorage.setItem("preSelectQuickReply","true"),ce(!0)},onKanbanClick:()=>{n().runtime.sendMessage({action:"openKanban"}).catch(e=>{})},onChatbotFlowClick:()=>{n().runtime.sendMessage({action:"openFluxo"}).catch(e=>{})},onFollowUpClick:()=>_e(!0),onBroadcastClick:()=>me(!0),onScheduleClick:()=>Me(!0),onCalendarClick:()=>he(!0),onStatusClick:()=>fe(!0),onValidatorClick:()=>ue(!0),onWebhookClick:()=>ye(!0),onApiConfigClick:Ft,onAIBotClick:()=>Ae(!0),onGmapsExtractorClick:()=>{n().runtime.sendMessage({action:"GMAPS_OPEN_MAPS_TAB"})},onFeatureSettingsClick:()=>Re(!0)}),Bt()&&"kanban"===bt&&kt&&!Xe&&a.createElement(og,{activeCRM:kt,crmStages:St,activeStageId:Tt,onStageClick:e=>{At(e);const t=St.find(t=>t.id===e);t&&window.dispatchEvent(new CustomEvent("wa-crm-stage-filter",{detail:{stageId:e,stageName:t.name,crmId:kt?.id,labelId:t.whatsappLabelId,customTabId:t.customTabId}}))},onBackToTabs:Ut}),Bt()&&a.createElement(cu,{activeView:bt}),Bt()&&(0,i.createPortal)(a.createElement(a.Fragment,null,a.createElement("div",{style:{position:"relative",zIndex:$t("tabs")}},a.createElement(P,{isOpen:ie,onClose:()=>se(!1)})),a.createElement("div",{style:{position:"relative",zIndex:$t("true"===sessionStorage.getItem("preSelectQuickReply")?"quickReply":"template")}},a.createElement(ga,{isOpen:le,onClose:()=>ce(!1)})),a.createElement("div",{style:{position:"relative",zIndex:$t("broadcast")}},a.createElement(za,{isOpen:de,onClose:()=>me(!1)})),a.createElement("div",{style:{position:"relative",zIndex:$t("validator")}},a.createElement(Ha,{isOpen:pe,onClose:()=>ue(!1)})),a.createElement("div",{style:{position:"relative",zIndex:$t("calendar")}},a.createElement(Ya,{isOpen:ge,onClose:()=>he(!1)})),a.createElement("div",{style:{position:"relative",zIndex:$t("status")}},a.createElement(tr,{isOpen:be,onClose:()=>fe(!1)})),a.createElement("div",{style:{position:"relative",zIndex:$t("webhook")}},a.createElement(or,{isOpen:ve,onClose:()=>ye(!1)})),ke&&a.createElement("div",{style:{position:"relative",zIndex:$t("api")}},a.createElement(fr,{isOpen:xe,onClose:()=>we(!1),phoneHash:ke.phoneHash,licenseSignature:ke.licenseSignature})),a.createElement("div",{style:{position:"relative",zIndex:$t("aiBot")}},a.createElement(ym,{isOpen:Te,onClose:()=>Ae(!1)})),a.createElement("div",{style:{position:"relative",zIndex:$t("schedule")}},a.createElement(Pp,{isOpen:Ne,onClose:()=>Me(!1)}))),document.body),(0,i.createPortal)(a.createElement("div",{style:{position:"relative",zIndex:$t("followUp")}},a.createElement(xp,{isOpen:De,onClose:()=>_e(!1)})),document.body),Bt()&&(0,i.createPortal)(a.createElement(zp,{isAnyModalOpen:Kt,activeFeatureId:Gt,openFeatureIds:jt,featureVisibility:Be,pinnedFeatures:Le,aiEnabled:rt,aiBotEnabled:Fe,aiBotActive:Oe,t:e,onSwitchFeature:e=>{if("kanban"===e)return void n().runtime.sendMessage({action:"openKanban"}).catch(e=>{});if("chatbotFlow"===e)return void n().runtime.sendMessage({action:"openFluxo"}).catch(e=>{});switch((e=>{Vt(t=>[...t.filter(t=>t!==e),e])})(e),e){case"tabs":se(!0);break;case"template":sessionStorage.removeItem("preSelectQuickReply"),ce(!0);break;case"quickReply":sessionStorage.setItem("preSelectQuickReply","true"),ce(!0);break;case"broadcast":me(!0);break;case"validator":ue(!0);break;case"calendar":he(!0);break;case"status":fe(!0);break;case"webhook":ye(!0);break;case"api":Ft();break;case"aiBot":Ae(!0);break;case"schedule":Me(!0);break;case"followUp":_e(!0)}}}),document.body),Ie&&(0,i.createPortal)(a.createElement(Tu,{onClose:()=>Re(!1),onOpenFeature:e=>{switch(Re(!1),e){case"tabs":se(!0);break;case"templates":ce(!0);break;case"quickReply":sessionStorage.setItem("preSelectQuickReply","true"),ce(!0);break;case"kanban":n().runtime.sendMessage({action:"openKanban"});break;case"chatbotFlow":n().runtime.sendMessage({action:"openFluxo"});break;case"followUp":_e(!0);break;case"broadcast":me(!0);break;case"schedule":Me(!0);break;case"calendar":he(!0);break;case"status":fe(!0);break;case"validator":ue(!0);break;case"webhook":ye(!0);break;case"api":Ft();break;case"aiBot":Ae(!0)}}}),document.body),a.createElement("style",null,eg),s&&a.createElement("div",{className:"wa-backdrop",onClick:()=>c(!1)}),L&&d?.isValid&&(0,i.createPortal)(a.createElement(Zu,{licenseStatus:d,currentTheme:Ge,planName:Pt(),t:e,onClose:()=>U(!1),onDeactivate:Ht,onChangeKey:()=>c(!0)}),document.body),F&&(0,i.createPortal)(a.createElement(ag,{currentTheme:Ge,language:t,supportedLanguages:o,t:e,changeLanguage:r,onClose:()=>z(!1)}),document.body),Se&&(0,i.createPortal)(a.createElement(tg,{settingsTab:qe,aiProvider:et,aiApiKey:nt,aiEnabled:rt,aiKeyValidating:it,aiKeyStatus:lt,aiKeyCopied:dt,showAiKey:pt,spokenLanguage:Qe,blurSettings:gt,themeMode:je,currentTheme:Ge,t:e,setSettingsTab:He,setAiProvider:tt,setAiApiKey:at,setAiEnabled:ot,setShowAiKey:e=>ut(e),setAiKeyStatus:ct,setSpokenLanguage:Ze,saveAISettings:()=>{Gn.saveSettings({provider:et,apiKey:nt,enabled:rt}),window.dispatchEvent(new CustomEvent("aiSettingsChanged")),Ce(!1)},validateAIKey:async()=>{if(nt.trim()){st(!0),ct("idle");try{let e=!1;if("chatgpt"===et){e=(await fetch("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${nt}`}})).ok}else if("gemini"===et){e=(await fetch(`https://generativelanguage.googleapis.com/v1beta/models?key=${nt}`)).ok}else if("deepseek"===et){e=(await fetch("https://api.deepseek.com/v1/models",{headers:{Authorization:`Bearer ${nt}`}})).ok}ct(e?"valid":"invalid")}catch(e){ct("invalid")}finally{st(!1)}}else ct("invalid")},copyAIKey:()=>{navigator.clipboard.writeText(nt),mt(!0),setTimeout(()=>mt(!1),2e3)},handleBlurSettingChange:(e,t)=>{const n={...gt,[e]:t};"blurConversation"!==e||t||(n.displayOnHover=!1),ht(n),uu.saveSettings(n),gu(n),window.dispatchEvent(new CustomEvent("blurSettingsChanged",{detail:n}))},handleThemeModeChange:async e=>{Ve(e),await(async e=>{const t={mode:e,lastUpdated:Date.now()};if(E())try{localStorage.setItem(y,JSON.stringify(t))}catch(e){}if(S())try{await chrome.storage.local.set({[x]:t})}catch(e){}"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(w,{detail:t}));const n=A(e);N("dark"===n),"system"!==e&&T("dark"===n)})(e);const t=A(e);Ke(t);const n=e=>{if("SET_WHATSAPP_THEME_RESPONSE"===e.data?.type){window.removeEventListener("message",n);const t=e.data.method||"";["Store.Settings.setTheme","Store.Theme.setTheme","Store.Prefs.theme","WPP.whatsapp.setTheme","WAWebUserPrefsGeneral.setTheme"].some(e=>t.includes(e))}};window.addEventListener("message",n),setTimeout(()=>{window.removeEventListener("message",n)},2e3)},selectedUILanguage:$e,language:t,changeLanguage:r,onClose:()=>Ce(!1)}),document.body),O&&(0,i.createPortal)(a.createElement(ng,{backupMode:q,backupFeatures:j,autoBackupEnabled:G,autoBackupDestination:$,importFile:X,importFeatures:Q,cheetahImportResult:ne,cheetahImporting:re,currentTheme:Ge,t:e,setBackupMode:H,setBackupFeatures:V,setAutoBackupEnabled:K,setAutoBackupDestination:Y,setImportFile:J,setImportFeatures:Z,setCheetahImportResult:ae,handleFeatureExport:async()=>{const e=await async function(e){const t={version:"2.0",timestamp:Date.now(),date:(new Date).toISOString(),features:{},featureList:[]};try{const a=await n().storage.local.get(null),r=[];for(let e=0;e<localStorage.length;e++){const t=localStorage.key(e);t&&r.push(t)}if(e.kanbanData){const e=["kanban","crm","pipeline","stages","contacts","deals"],{data:n,hasData:o}=Vu(r,e);let i=o;i=Gu(a,e,n)||i;try{const e=["wa_kanban_db","wa_extension_db"],t=await Hu(e);for(const[e,a]of Object.entries(t))for(const[t,r]of Object.entries(a))r&&r.length>0&&(n[`indexedDB_${e}_${t}`]=r,i=!0)}catch(e){}i&&(t.features.kanbanData=n,t.featureList.push("kanbanData"))}if(e.customTabs){const e=["tabs","customTab","tab_","chatFilter","filter"],{data:n,hasData:o}=Vu(r,e);let i=o;i=Gu(a,e,n)||i,i&&(t.features.customTabs=n,t.featureList.push("customTabs"))}if(e.templates){const e=["template","quickRepl","quick_repl","message_template"],{data:n,hasData:o}=Vu(r,e);let i=o;i=Gu(a,e,n)||i,i&&(t.features.templates=n,t.featureList.push("templates"))}if(e.broadcastHistory){const e=["broadcast","scheduled","bulk","mass_message"],{data:n,hasData:o}=Vu(r,e);let i=o;i=Gu(a,e,n)||i,i&&(t.features.broadcastHistory=n,t.featureList.push("broadcastHistory"))}if(e.settings){const e=["settings","preference","config","option","theme"],{data:n,hasData:o}=Vu(r,e);let i=o;i=Gu(a,e,n)||i;const{license:s,...l}=a;Object.keys(l).length>0&&(n.chrome_all_settings=l,i=!0),i&&(t.features.settings=n,t.featureList.push("settings"))}if(e.crmProfileData){const e={};let n=!1;const r=localStorage.getItem("wa_crm_data");if(r)try{e.wa_crm_data=JSON.parse(r),n=!0}catch{}const o=localStorage.getItem("wa_crm_currency");if(o)try{e.wa_crm_currency=JSON.parse(o),n=!0}catch{}const i=localStorage.getItem("wa_crm_appointment_templates");if(i)try{e.wa_crm_appointment_templates=JSON.parse(i),n=!0}catch{}["wa_crm_custom_income_categories","wa_crm_custom_expense_categories","wa_crm_custom_transaction_statuses","wa_crm_hidden_income_categories","wa_crm_hidden_expense_categories","wa_crm_hidden_transaction_statuses"].forEach(t=>{const a=localStorage.getItem(t);if(a)try{e[t]=JSON.parse(a),n=!0}catch{}}),a.wa_crm_data_sync&&(e.wa_crm_data_sync=a.wa_crm_data_sync,n=!0),n&&(t.features.crmProfileData=e,t.featureList.push("crmProfileData"))}if(e.calendarData){const e={reminders:[],appointments:[]};let n=!1;const a=localStorage.getItem("wa_crm_data");if(a)try{const t=JSON.parse(a);t.contacts&&Object.entries(t.contacts).forEach(([t,a])=>{a.reminders?.length&&(e.reminders.push({contactId:t,contactName:a.name,reminders:a.reminders}),n=!0),a.appointments?.length&&(e.appointments.push({contactId:t,contactName:a.name,appointments:a.appointments}),n=!0)})}catch{}n&&(t.features.calendarData=e,t.featureList.push("calendarData"))}if(e.statusData){const e=localStorage.getItem("wa_crm_status_items");if(e)try{t.features.statusData={wa_crm_status_items:JSON.parse(e)},t.featureList.push("statusData")}catch{}}if(e.webhookSettings){const e=localStorage.getItem("webhook_settings");if(e)try{t.features.webhookSettings={webhook_settings:JSON.parse(e)},t.featureList.push("webhookSettings")}catch{}}if(e.aiBotSettings){const e={};let n=!1;a.wa_ai_bot_settings&&(e.wa_ai_bot_settings=a.wa_ai_bot_settings,n=!0),a.wa_ai_bot_queue&&(e.wa_ai_bot_queue=a.wa_ai_bot_queue,n=!0),n&&(t.features.aiBotSettings=e,t.featureList.push("aiBotSettings"))}if(e.aiApiSettings){const e=localStorage.getItem("wa_ai_settings");if(e)try{t.features.aiApiSettings={wa_ai_settings:JSON.parse(e)},t.featureList.push("aiApiSettings")}catch{}}if(e.spokenLanguage){const e={};let n=!1;a.wa_spoken_language&&(e.chrome_wa_spoken_language=a.wa_spoken_language,n=!0);const r=localStorage.getItem("wa_spoken_language");r&&(e.local_wa_spoken_language=r,n=!0),n&&(t.features.spokenLanguage=e,t.featureList.push("spokenLanguage"))}if(e.chatbotFlows){const e={};let n=!1;const r=localStorage.getItem("wa_chatbot_flows");if(r)try{e.local_wa_chatbot_flows=JSON.parse(r),n=!0}catch{}a.wa_chatbot_flows&&(e.chrome_wa_chatbot_flows=a.wa_chatbot_flows,n=!0),a.fluxo_global_settings&&(e.chrome_fluxo_global_settings=a.fluxo_global_settings,n=!0),n&&(t.features.chatbotFlows=e,t.featureList.push("chatbotFlows"))}if(e.followupData){const e={};let n=!1;const r=["wa_followups","wa_followup_categories","wa_followup_contacts","wa_followup_queue"];for(const t of r)a[t]&&(e[t]=a[t],n=!0);n&&(t.features.followupData=e,t.featureList.push("followupData"))}if(e.scheduledMessages){const e={};let n=!1;a.wa_schedules&&(e.chrome_wa_schedules=a.wa_schedules,n=!0);const r=localStorage.getItem("wa_schedules");if(r)try{e.local_wa_schedules=JSON.parse(r),n=!0}catch{}n&&(t.features.scheduledMessages=e,t.featureList.push("scheduledMessages"))}if(e.scheduledBroadcasts){const e={};let n=!1;const r=["wa_scheduled_broadcasts","wa_active_broadcast","wa_active_campaign"];for(const t of r)a[t]&&(e[t]=a[t],n=!0);n&&(t.features.scheduledBroadcasts=e,t.featureList.push("scheduledBroadcasts"))}if(e.fluxoAdvanced){const e={};let n=!1;const r=["fluxo_global_settings","fluxo_trigger_history","fluxo_flow_trigger_history","fluxo_pause_states","fluxo_first_message_tracking","wa_fluxo_onboarding_completed","wa_chatbot_flow_categories"];for(const t of r){const a=localStorage.getItem(t);if(a)try{e[`local_${t}`]=JSON.parse(a),n=!0}catch{e[`local_${t}`]=a,n=!0}}for(const t of r)a[t]&&(e[`chrome_${t}`]=a[t],n=!0);n&&(t.features.fluxoAdvanced=e,t.featureList.push("fluxoAdvanced"))}if(e.conversationStates){const e={};let n=!1;const a=["wa_fluxo_conversation_states","fluxo_conversation_states","wa_fluxo_first_message_tracker"];for(const t of a){const a=localStorage.getItem(t);if(a)try{e[`local_${t}`]=JSON.parse(a),n=!0}catch{}}n&&(t.features.conversationStates=e,t.featureList.push("conversationStates"))}if(e.bulkValidatorData){const e=localStorage.getItem("bulk_validator_campaigns");if(e)try{t.features.bulkValidatorData={bulk_validator_campaigns:JSON.parse(e)},t.featureList.push("bulkValidatorData")}catch{}}if(e.quickReplies){const e={};let n=!1;const r=localStorage.getItem("wa_quick_replies");if(r)try{e.local_wa_quick_replies=JSON.parse(r),n=!0}catch{}a.encrypted_quick_replies&&(e.chrome_encrypted_quick_replies=a.encrypted_quick_replies,n=!0),n&&(t.features.quickReplies=e,t.featureList.push("quickReplies"))}if(e.crmTodos){const e={};let n=!1;const r=localStorage.getItem("wa_crm_todos");if(r)try{e.local_wa_crm_todos=JSON.parse(r),n=!0}catch{}a.wa_crm_todos_sync&&(e.chrome_wa_crm_todos_sync=a.wa_crm_todos_sync,n=!0),n&&(t.features.crmTodos=e,t.featureList.push("crmTodos"))}if(e.signatureSettings){const e=localStorage.getItem("wa_signature_settings");if(e)try{t.features.signatureSettings={wa_signature_settings:JSON.parse(e)},t.featureList.push("signatureSettings")}catch{}}if(e.teamSettings){const e={};let n=!1;const r=localStorage.getItem("team_settings");if(r)try{e.local_team_settings=JSON.parse(r),n=!0}catch{}const o=localStorage.getItem("wa_team_settings");if(o)try{e.local_wa_team_settings=JSON.parse(o),n=!0}catch{}a.team_settings&&(e.chrome_team_settings=a.team_settings,n=!0),n&&(t.features.teamSettings=e,t.featureList.push("teamSettings"))}if(e.blurSettings){const e=localStorage.getItem("wa_blur_settings");if(e)try{t.features.blurSettings={wa_blur_settings:JSON.parse(e)},t.featureList.push("blurSettings")}catch{}}if(e.featureVisibility){const e=localStorage.getItem("wa_feature_visibility");if(e)try{t.features.featureVisibility={wa_feature_visibility:JSON.parse(e)},t.featureList.push("featureVisibility")}catch{}}if(e.themeSettings){const e={};let n=!1;const r=localStorage.getItem("lion_crm_theme_settings");if(r)try{e.local_lion_crm_theme_settings=JSON.parse(r),n=!0}catch{}a.lion_crm_theme_sync&&(e.chrome_lion_crm_theme_sync=a.lion_crm_theme_sync,n=!0),n&&(t.features.themeSettings=e,t.featureList.push("themeSettings"))}if(e.uiStateSettings){const e={};let n=!1;const a=localStorage.getItem("wa_header_collapsed");null!==a&&(e.wa_header_collapsed=a,n=!0);const r=localStorage.getItem("wa_tabbar_hidden");null!==r&&(e.wa_tabbar_hidden=r,n=!0),n&&(t.features.uiStateSettings=e,t.featureList.push("uiStateSettings"))}if(e.apiPollingSettings&&a.api_polling_settings&&(t.features.apiPollingSettings={api_polling_settings:a.api_polling_settings},t.featureList.push("apiPollingSettings")),e.agentSettings){const e={};let n=!1;const r=localStorage.getItem("wa_agent_settings");if(r)try{e.local_wa_agent_settings=JSON.parse(r),n=!0}catch{}const o=localStorage.getItem("wa_agent_active_services");if(o)try{e.local_wa_agent_active_services=JSON.parse(o),n=!0}catch{}a.wa_agent_settings&&(e.chrome_wa_agent_settings=a.wa_agent_settings,n=!0),n&&(t.features.agentSettings=e,t.featureList.push("agentSettings"))}try{const e=await Hu(Ou);Object.keys(e).length>0&&(t.indexedDB=e)}catch(e){}const o={};["wa_auto_backup_enabled","wa_auto_backup_destination","wa_last_auto_backup_date"].forEach(e=>{const t=localStorage.getItem(e);t&&(o[`local_${e}`]=t)}),Object.keys(o).length>0&&(t.features.autoBackupMeta=o,t.featureList.push("autoBackupMeta"));const i={};["lion_crm_theme_settings","lion_crm_theme_sync","system-theme-mode"].forEach(e=>{const t=localStorage.getItem(e);if(t)try{i[`local_${e}`]=JSON.parse(t)}catch{i[`local_${e}`]=t}a[e]&&(i[`chrome_${e}`]=a[e])}),Object.keys(i).length>0&&(t.features.themeExtended=i,t.featureList.push("themeExtended"));const s={};["wa_chatbot_flow_categories","wa_fluxo_onboarding_completed","wa_fluxo_first_message_tracker"].forEach(e=>{const t=localStorage.getItem(e);if(t)try{s[`local_${e}`]=JSON.parse(t)}catch{s[`local_${e}`]=t}a[e]&&(s[`chrome_${e}`]=a[e])}),Object.keys(s).length>0&&(t.features.fluxoExtra=s,t.featureList.push("fluxoExtra"));const l={},c=localStorage.getItem("wa_template_categories");if(c)try{l.local_wa_template_categories=JSON.parse(c)}catch{l.local_wa_template_categories=c}a.wa_template_categories&&(l.chrome_wa_template_categories=a.wa_template_categories),Object.keys(l).length>0&&(t.features.templateCategories=l,t.featureList.push("templateCategories"));const d={},m=localStorage.getItem("wa_groups_cache");if(m)try{d.local_wa_groups_cache=JSON.parse(m)}catch{d.local_wa_groups_cache=m}a.wa_groups_cache&&(d.chrome_wa_groups_cache=a.wa_groups_cache),Object.keys(d).length>0&&(t.features.groupsCache=d,t.featureList.push("groupsCache"));const p={},u=localStorage.getItem("wa_session_data");if(u)try{p.local_wa_session_data=JSON.parse(u)}catch{p.local_wa_session_data=u}a.wa_session_data&&(p.chrome_wa_session_data=a.wa_session_data),Object.keys(p).length>0&&(t.features.sessionData=p,t.featureList.push("sessionData"));const g={};["kanban_chats","kanban_labels","kanban_tabs","kanban_profile_pics_cache","kanban_labels_timestamp","kanban_chats_timestamp"].forEach(e=>{const t=localStorage.getItem(e);if(t)try{g[`local_${e}`]=JSON.parse(t)}catch{g[`local_${e}`]=t}a[e]&&(g[`chrome_${e}`]=a[e])}),Object.keys(g).length>0&&(t.features.kanbanExtended=g,t.featureList.push("kanbanExtended")),t.data={chromeStorage:{},localStorage:{}};const{license:h,...b}=a;t.data.chromeStorage=b;const f={};for(let e=0;e<localStorage.length;e++){const t=localStorage.key(e);if(t){const e=localStorage.getItem(t);if(e)try{f[t]=JSON.parse(e)}catch{f[t]=e}}}if(t.data.localStorage=f,0===t.featureList.length){const{license:e,...n}=a;Object.keys(n).length>0&&(t.features.allChromeStorage=n,t.featureList.push("settings"));const o={};r.forEach(e=>{try{const t=localStorage.getItem(e);t&&(o[e]=JSON.parse(t))}catch{o[e]=localStorage.getItem(e)}}),Object.keys(o).length>0&&(t.features.allLocalStorage=o,t.featureList.includes("settings")||t.featureList.push("settings"))}return 0===t.featureList.length?{success:!1,featureList:[],error:"No data found to export. The extension storage is empty."}:(ju(t,`wa_backup_${(new Date).toISOString().split("T")[0]}_${Date.now()}.json`),{success:!0,featureList:t.featureList})}catch(e){return{success:!1,featureList:[],error:"Falha ao exportar. Por favor, tente novamente."}}}(j);e.success?(W(!1),alert("Exportação concluída!\n\nFuncionalidades exportadas:\n"+e.featureList.map(e=>"• "+qt(e)).join("\n"))):alert(e.error||"Falha ao exportar. Por favor, tente novamente.")},handleFeatureImport:async()=>{const e=await async function(e,t){if(!e)return{success:!1,imported:[],error:"Por favor, envie um arquivo de backup válido primeiro."};try{const a=[],r=!!e.data,o=!!e.features;if(r){if(t.settings&&e.data.chromeStorage&&(await n().storage.local.set(e.data.chromeStorage),a.push("settings")),t.kanbanData&&e.data.chromeStorage){const t=Object.keys(e.data.chromeStorage).filter(e=>e.toLowerCase().includes("kanban")||e.toLowerCase().includes("crm"));if(t.length>0){const r={};t.forEach(t=>r[t]=e.data.chromeStorage[t]),await n().storage.local.set(r),a.includes("kanbanData")||a.push("kanbanData")}}if(e.data.localStorage&&Object.keys(e.data.localStorage).forEach(n=>{const r=e.data.localStorage[n];t.customTabs&&(n.includes("tabs")||n.includes("tab"))&&(localStorage.setItem(n,JSON.stringify(r)),a.includes("customTabs")||a.push("customTabs")),t.kanbanData&&(n.includes("kanban")||n.includes("crm"))&&(localStorage.setItem(n,JSON.stringify(r)),a.includes("kanbanData")||a.push("kanbanData")),t.templates&&(n.includes("template")||n.includes("quick_repl"))&&(localStorage.setItem(n,JSON.stringify(r)),a.includes("templates")||a.push("templates")),t.crmProfileData&&n.includes("wa_crm_data")&&(localStorage.setItem(n,JSON.stringify(r)),a.includes("crmProfileData")||a.push("crmProfileData")),t.calendarData&&n.includes("wa_crm_data")&&(a.includes("calendarData")||a.push("calendarData")),t.statusData&&n.includes("wa_crm_status_items")&&(localStorage.setItem(n,JSON.stringify(r)),a.includes("statusData")||a.push("statusData")),t.webhookSettings&&n.includes("webhook_settings")&&(localStorage.setItem(n,JSON.stringify(r)),a.includes("webhookSettings")||a.push("webhookSettings")),t.aiApiSettings&&n.includes("wa_ai_settings")&&(localStorage.setItem(n,JSON.stringify(r)),a.includes("aiApiSettings")||a.push("aiApiSettings")),t.spokenLanguage&&n.includes("wa_spoken_language")&&(localStorage.setItem(n,JSON.stringify(r)),a.includes("spokenLanguage")||a.push("spokenLanguage")),t.settings&&localStorage.setItem(n,JSON.stringify(r))}),t.aiBotSettings&&e.data.chromeStorage){const t=Object.keys(e.data.chromeStorage).filter(e=>e.includes("wa_ai_bot_settings")||e.includes("wa_ai_bot_queue"));if(t.length>0){const r={};t.forEach(t=>r[t]=e.data.chromeStorage[t]),await n().storage.local.set(r),a.includes("aiBotSettings")||a.push("aiBotSettings")}}t.spokenLanguage&&e.data.chromeStorage&&e.data.chromeStorage.wa_spoken_language&&(await n().storage.local.set({wa_spoken_language:e.data.chromeStorage.wa_spoken_language}),a.includes("spokenLanguage")||a.push("spokenLanguage")),t.kanbanData&&e.data.indexedDB&&(await n().storage.local.set({wa_indexeddb_backup:e.data.indexedDB}),a.includes("kanbanData")||a.push("kanbanData"))}if(o){if(t.kanbanData&&e.features.kanbanData){const t=e.features.kanbanData;for(const e of Object.keys(t)){if(e.startsWith("local_")){const n=e.replace("local_",""),a=t[e];"string"==typeof a?localStorage.setItem(n,a):localStorage.setItem(n,JSON.stringify(a))}if(e.startsWith("chrome_")){const a=e.replace("chrome_","");let r=t[e];if("string"==typeof r)try{r=JSON.parse(r)}catch(e){}if(await n().storage.local.set({[a]:r}),"wa_kanban_crm_data_sync"===a){if(r?.crms&&Array.isArray(r.crms)){const e=new Map,t=new Map,n=[];for(const a of r.crms)if("whatsapp_labels"===a.type||"custom_tabs"===a.type)t.has(a.type)?n.push(a.id):t.set(a.type,a.id);else if("user"===a.type){const t=(a.name||"").toLowerCase().trim();e.has(t)?n.push(a.id):e.set(t,a.id)}if(n.length>0){r.crms=r.crms.filter(e=>!n.includes(e.id));for(const e of n)delete r.stages[e]}}localStorage.setItem("wa_kanban_crm_data",JSON.stringify(r))}}}const r=localStorage.getItem("wa_kanban_crm_data");if(r)try{const e=JSON.parse(r);await n().storage.local.set({wa_kanban_crm_data_sync:e})}catch(e){}a.push("kanbanData")}if(t.customTabs&&e.features.customTabs){const t=e.features.customTabs;let r=[];if(Object.keys(t).forEach(e=>{let n=t[e];if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}"local_wa_tabs"===e||"chrome_wa_tabs"===e?Array.isArray(n)?r=n.map(e=>{if(e.title&&e.chats)return e;const t=(e.chatIds||[]).map(e=>({id:e,name:e.replace("@c.us","").replace("@g.us",""),type:e.includes("@g.us")?"group":"individual",selected:!1}));return{id:e.id,title:e.name||e.title||"Imported Tab",details:e.details||`Imported tab (${t.length} chats)`,chats:t,isPermanent:!1,isSystemFilter:!1,createdAt:e.createdAt||Date.now(),updatedAt:e.updatedAt||Date.now()}}):n&&n.tabs&&Array.isArray(n.tabs)&&(r=n.tabs):"local_wa_extension_tabs"!==e&&"chrome_wa_extension_tabs"!==e||n&&n.tabs&&Array.isArray(n.tabs)&&(r=n.tabs)}),r.length>0){const e=(await n().storage.local.get("wa_extension_tabs")).wa_extension_tabs||{tabs:[],activeTabId:"all",activeView:"tabs"},t=[...e.tabs];for(const e of r)e.isPermanent||e.isSystemFilter||t.some(t=>t.id===e.id)||t.push(e);await n().storage.local.set({wa_extension_tabs:{...e,tabs:t}})}Object.keys(t).forEach(e=>{if(e.startsWith("local_")){const n=e.replace("local_",""),a=t[e];"string"==typeof a?localStorage.setItem(n,a):localStorage.setItem(n,JSON.stringify(a))}}),a.push("customTabs")}if(t.templates&&e.features.templates){const t=e.features.templates;let r=[];if(Object.keys(t).forEach(e=>{let n=t[e];if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}Array.isArray(n)&&(r=[...r,...n])}),r.length>0){const e=[...(await n().storage.local.get("wa_templates")).wa_templates||[]];for(const t of r)e.some(e=>e.id===t.id)||e.push(t);await n().storage.local.set({wa_templates:e})}Object.keys(t).forEach(e=>{if(e.startsWith("local_")){const n=e.replace("local_",""),a=t[e];"string"==typeof a?localStorage.setItem(n,a):localStorage.setItem(n,JSON.stringify(a))}}),a.push("templates")}if(t.broadcastHistory&&e.features.broadcastHistory&&(await Ku(e.features.broadcastHistory),a.push("broadcastHistory")),t.settings&&e.features.settings){const t=e.features.settings;t.chrome_all_settings&&await n().storage.local.set(t.chrome_all_settings);for(const e of Object.keys(t)){if(e.startsWith("local_")){const n=e.replace("local_",""),a=t[e];"string"==typeof a?localStorage.setItem(n,a):localStorage.setItem(n,JSON.stringify(a))}if(e.startsWith("chrome_")&&"chrome_all_settings"!==e){const a=e.replace("chrome_","");await n().storage.local.set({[a]:t[e]})}}a.push("settings")}if(t.crmProfileData&&e.features.crmProfileData){const t=e.features.crmProfileData;["wa_crm_data","wa_crm_currency","wa_crm_appointment_templates","wa_crm_custom_income_categories","wa_crm_custom_expense_categories","wa_crm_custom_transaction_statuses","wa_crm_hidden_income_categories","wa_crm_hidden_expense_categories","wa_crm_hidden_transaction_statuses"].forEach(e=>{t[e]&&localStorage.setItem(e,JSON.stringify(t[e]))}),t.wa_crm_data_sync&&await n().storage.local.set({wa_crm_data_sync:t.wa_crm_data_sync}),a.push("crmProfileData")}if(t.calendarData&&e.features.calendarData&&a.push("calendarData"),t.statusData&&e.features.statusData){const t=e.features.statusData;t.wa_crm_status_items&&localStorage.setItem("wa_crm_status_items",JSON.stringify(t.wa_crm_status_items)),a.push("statusData")}if(t.webhookSettings&&e.features.webhookSettings){const t=e.features.webhookSettings;t.webhook_settings&&localStorage.setItem("webhook_settings",JSON.stringify(t.webhook_settings)),a.push("webhookSettings")}if(t.aiBotSettings&&e.features.aiBotSettings&&(await n().storage.local.set(e.features.aiBotSettings),a.push("aiBotSettings")),t.aiApiSettings&&e.features.aiApiSettings){const t=e.features.aiApiSettings;t.wa_ai_settings&&localStorage.setItem("wa_ai_settings",JSON.stringify(t.wa_ai_settings)),a.push("aiApiSettings")}if(t.spokenLanguage&&e.features.spokenLanguage){const t=e.features.spokenLanguage;t.chrome_wa_spoken_language&&await n().storage.local.set({wa_spoken_language:t.chrome_wa_spoken_language}),t.local_wa_spoken_language&&localStorage.setItem("wa_spoken_language",t.local_wa_spoken_language),a.push("spokenLanguage")}if(t.chatbotFlows&&e.features.chatbotFlows){const t=e.features.chatbotFlows;if(t.local_chatbot_flows){let e=t.local_chatbot_flows;"string"==typeof e?localStorage.setItem("chatbot_flows",e):localStorage.setItem("chatbot_flows",JSON.stringify(e))}if(t.local_wa_chatbot_flows){let e=t.local_wa_chatbot_flows;"string"==typeof e?localStorage.setItem("wa_chatbot_flows",e):localStorage.setItem("wa_chatbot_flows",JSON.stringify(e))}if(t.chrome_wa_chatbot_flows){let e=t.chrome_wa_chatbot_flows;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}await n().storage.local.set({wa_chatbot_flows:e}),localStorage.setItem("wa_chatbot_flows",JSON.stringify(e))}if(t.chrome_fluxo_global_settings){let e=t.chrome_fluxo_global_settings;if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}await n().storage.local.set({fluxo_global_settings:e}),localStorage.setItem("fluxo_global_settings",JSON.stringify(e))}if(t.local_fluxo_global_settings){let e=t.local_fluxo_global_settings;"string"==typeof e?localStorage.setItem("fluxo_global_settings",e):localStorage.setItem("fluxo_global_settings",JSON.stringify(e))}a.push("chatbotFlows")}if(t.followupData&&e.features.followupData){const t=e.features.followupData;for(const e of Object.keys(t)){let a=t[e];if("string"==typeof a)try{a=JSON.parse(a)}catch(e){continue}if(e.startsWith("local_")){const t=e.replace("local_","");localStorage.setItem(t,JSON.stringify(a))}else if(e.startsWith("chrome_")){const t=e.replace("chrome_","");await n().storage.local.set({[t]:a})}else await n().storage.local.set({[e]:a})}a.push("followupData")}if(t.scheduledBroadcasts&&e.features.scheduledBroadcasts){const t=e.features.scheduledBroadcasts;for(const e of["wa_scheduled_broadcasts","wa_active_broadcast","wa_active_campaign"])t[e]&&await n().storage.local.set({[e]:t[e]});a.push("scheduledBroadcasts")}if(t.fluxoAdvanced&&e.features.fluxoAdvanced&&(await Ku(e.features.fluxoAdvanced),a.push("fluxoAdvanced")),t.conversationStates&&e.features.conversationStates&&($u(e.features.conversationStates,[]),a.push("conversationStates")),t.bulkValidatorData&&e.features.bulkValidatorData&&($u(e.features.bulkValidatorData,["bulk_validator_campaigns"]),a.push("bulkValidatorData")),t.quickReplies&&e.features.quickReplies&&(await Ku(e.features.quickReplies),a.push("quickReplies")),t.crmTodos&&e.features.crmTodos&&(await Ku(e.features.crmTodos),a.push("crmTodos")),t.signatureSettings&&e.features.signatureSettings&&($u(e.features.signatureSettings,["wa_signature_settings"]),a.push("signatureSettings")),t.teamSettings&&e.features.teamSettings&&(await Ku(e.features.teamSettings),a.push("teamSettings")),t.blurSettings&&e.features.blurSettings&&($u(e.features.blurSettings,["wa_blur_settings"]),a.push("blurSettings")),t.featureVisibility&&e.features.featureVisibility&&($u(e.features.featureVisibility,["wa_feature_visibility"]),a.push("featureVisibility")),t.themeSettings&&e.features.themeSettings&&(await Ku(e.features.themeSettings),a.push("themeSettings")),t.uiStateSettings&&e.features.uiStateSettings&&($u(e.features.uiStateSettings,["wa_header_collapsed","wa_tabbar_hidden"]),a.push("uiStateSettings")),t.apiPollingSettings&&e.features.apiPollingSettings){const t=e.features.apiPollingSettings;for(const e of Object.keys(t)){let a=t[e];if(e.startsWith("local_")){const t=e.replace("local_","");"string"==typeof a?localStorage.setItem(t,a):localStorage.setItem(t,JSON.stringify(a))}else if("api_polling_settings"===e){if("string"==typeof a)try{a=JSON.parse(a)}catch(e){}await n().storage.local.set({[e]:a})}}a.push("apiPollingSettings")}if(t.agentSettings&&e.features.agentSettings){const t=e.features.agentSettings;await Ku(t),t.chrome_wa_agent_settings&&await n().storage.local.set({wa_agent_settings:t.chrome_wa_agent_settings}),a.push("agentSettings")}e.features.allChromeStorage&&(await n().storage.local.set(e.features.allChromeStorage),a.includes("settings")||a.push("settings")),e.features.allLocalStorage&&Object.keys(e.features.allLocalStorage).forEach(t=>{localStorage.setItem(t,JSON.stringify(e.features.allLocalStorage[t]))})}return 0===a.length?{success:!1,imported:[],error:"Nenhuma funcionalidade foi importada. Por favor, selecione pelo menos uma."}:{success:!0,imported:a}}catch(e){return{success:!1,imported:[],error:"Falha ao importar. Por favor, tente novamente."}}}(X,Q);e.success?(W(!1),J(null),Z({}),alert("Importação concluída!\n\nFuncionalidades importadas:\n"+e.imported.map(e=>"• "+qt(e)).join("\n")+"\n\nPor favor, atualize a página para ver as alterações.")):alert(e.error||"Falha ao importar. Por favor, tente novamente.")},handleCheetahImport:async()=>{try{oe(!0);const e=await async function(e){if(!e)return{success:!1,error:"Por favor, envie um arquivo de backup válido do Cheetah CRM primeiro."};try{const t=v.getAllContacts(),a={};t.forEach(e=>{a[e.id]=e});const r=JSON.parse(localStorage.getItem("wa_tabs")||"[]"),o=JSON.parse(localStorage.getItem("wa_chatbot_flows")||"[]"),i=JSON.parse(localStorage.getItem("wa_followup_sequences")||"[]");let s=[];try{s=((await n().storage.local.get("wa_scheduled_broadcasts")).wa_scheduled_broadcasts||[]).filter(e=>e&&e.contacts&&Array.isArray(e.contacts)&&e.messages&&Array.isArray(e.messages))}catch(e){}const l=JSON.parse(localStorage.getItem("saved_templates")||"[]"),c=JSON.parse(localStorage.getItem("wa_ai_settings")||"{}"),d=JSON.parse(localStorage.getItem("webhook_settings")||"{}"),m={crms:[],stages:{},assignments:[],activeCrmId:null,chatsCache:{},lastSync:0},p=JSON.parse(localStorage.getItem("wa_kanban_crm_data")||JSON.stringify(m)),u=JSON.parse(localStorage.getItem("wa_crm_status_items")||"[]"),g={crmData:a,tabs:r,flows:o,followups:i,schedules:s,templates:l,aiSettings:c,webhookSettings:d,kanbanData:p,statusItems:u},h=await Uu(e,g);if(h.success&&h.convertedData){const t=h.convertedData;if(t.tabs&&Array.isArray(t.tabs)&&t.tabs.length>0)try{const e=(await n().storage.local.get("wa_extension_tabs")).wa_extension_tabs||{tabs:[],activeTabId:"all",activeView:"tabs"},a=[...e.tabs];for(const e of t.tabs)e.isPermanent||e.isSystemFilter||a.some(t=>t.id===e.id)||a.push(e);await n().storage.local.set({wa_extension_tabs:{...e,tabs:a}})}catch(e){}if(t.flows&&t.flows.length>0){localStorage.setItem("wa_chatbot_flows",JSON.stringify(t.flows));try{await n().storage.local.set({wa_chatbot_flows:t.flows,wa_chatbot_flow_categories:[]})}catch(e){}}if(t.followups&&t.followups.length>0)try{await n().storage.local.set({wa_followups:t.followups})}catch(e){}if(e.agendamentos&&Array.isArray(e.agendamentos)&&e.agendamentos.length>0){let n=0;for(const a of e.agendamentos){if(!a.userID)continue;const[e,r,o]=(a.data||"").split("-").map(Number),[i,s]=(a.hora||"").split(":").map(Number);if(!e||!r||!o||isNaN(i)||isNaN(s))continue;const l=new Date(e,r-1,o,i,s).getTime();if(isNaN(l))continue;const c=String(a.userID).replace(/\D/g,""),d=`${c}@c.us`;t.crmData[d]||(t.crmData[d]={id:d,profile:{name:c,phone:c,email:"",company:"",address:"",notes:"",customFields:{}},notes:[],reminders:[],appointments:[],incomes:[],expenses:[],tabs:[],createdAt:Date.now(),updatedAt:Date.now()});const m=t.crmData[d];m.appointments=m.appointments||[],m.appointments.some(e=>e.id===a.id)||(m.appointments.push({id:a.id||`appt-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,title:a.titulo||"Imported Appointment",datetime:l,attendees:[{id:d,name:m.profile?.name||c,phone:c,messageSent:!1,reminderSent:!1}],message:a.mensagem||"",meetLink:"",reminderBefore:30,status:l>Date.now()?"scheduled":"completed",createdAt:Date.now(),updatedAt:Date.now(),useSameMessage:!0,meetingStartMessage:"",attendeeReminderSent:!1,userReminderNotified:!1,meetingStartNotified:!1,attendeeMeetingStartSent:!1}),n++)}}if(t.templates&&t.templates.length>0)try{const e=[...(await n().storage.local.get("wa_templates")).wa_templates||[]];for(const n of t.templates)e.some(e=>e.id===n.id)||e.push(n);await n().storage.local.set({wa_templates:e})}catch(e){}if(t.aiSettings&&Object.keys(t.aiSettings).length>0&&localStorage.setItem("wa_ai_settings",JSON.stringify(t.aiSettings)),t.webhookSettings&&Object.keys(t.webhookSettings).length>0&&localStorage.setItem("webhook_settings",JSON.stringify(t.webhookSettings)),t.crmData&&Object.keys(t.crmData).length>0)for(const e of Object.values(t.crmData))try{v.saveContact(e)}catch(e){}if(t.kanbanData&&t.kanbanData.crms&&t.kanbanData.crms.length>0){localStorage.setItem("wa_kanban_crm_data",JSON.stringify(t.kanbanData));try{await n().storage.local.set({wa_kanban_crm_data_sync:t.kanbanData})}catch(e){}}t.statusItems&&t.statusItems.length>0&&localStorage.setItem("wa_crm_status_items",JSON.stringify(t.statusItems))}return{success:h.success,result:h}}catch(e){return{success:!1,error:"Falha ao importar do Cheetah CRM. Por favor, tente novamente."}}}(X);if(e.success&&e.result){ae(e.result);const t=e.result,n=[];t.imported.contacts>0&&n.push("• "+t.imported.contacts+" contatos"),t.imported.tabs>0&&n.push("• "+t.imported.tabs+" abas"),t.imported.templates>0&&n.push("• "+t.imported.templates+" modelos"),t.imported.flows>0&&n.push("• "+t.imported.flows+" fluxos de chatbot"),t.imported.followups>0&&n.push("• "+t.imported.followups+" lembretes de acompanhamento"),t.imported.schedules>0&&n.push("• "+t.imported.schedules+" agendamentos"),t.imported.webhooks>0&&n.push("• "+t.imported.webhooks+" configurações de webhook"),t.imported.aiSettings&&n.push("• AI settings"),t.imported.kanbanBoards>0&&n.push("• "+t.imported.kanbanBoards+" Kanban boards"),t.imported.kanbanStages>0&&n.push("• "+t.imported.kanbanStages+" Kanban stages"),t.imported.statusItems>0&&n.push("• "+t.imported.statusItems+" status items"),t.imported.reminders>0&&n.push("• "+t.imported.reminders+" reminders");const a=t.warnings.length>0?"\n\nWarnings:\n"+t.warnings.slice(0,5).join("\n")+(t.warnings.length>5?"\n... e mais "+(t.warnings.length-5)+" itens":""):"";alert("Importação do Cheetah CRM concluída!\n\nImportados:\n"+n.join("\n")+a+"\n\nPor favor, atualize a página para ver as alterações.")}else alert("Falha na Importação do Cheetah CRM!\n\n"+(e.error||"Ocorreu um erro desconhecido"))}catch(e){alert("Falha ao importar do Cheetah CRM. Por favor, tente novamente.")}finally{oe(!1),W(!1),J(null),te("lion"),ae(null)}},handleImportFileUpload:e=>{!function(e,t){const n=e.target.files?.[0];if(!n)return;const a=new FileReader;a.onload=e=>{try{const n=JSON.parse(e.target?.result);if(Mu(n))return void alert('This appears to be a Cheetah CRM backup file. Please use the "Cheetah CRM" tab to import this backup.');t.setImportFile(n);const a={};if(n.featureList&&Array.isArray(n.featureList))n.featureList.forEach(e=>{a[e]=!0});else if(n.features&&Object.keys(n.features).length>0){const e=["kanbanData","customTabs","templates","broadcastHistory","settings","allChromeStorage","allLocalStorage","crmProfileData","calendarData","statusData","webhookSettings","aiBotSettings","aiApiSettings","spokenLanguage","chatbotFlows","followupData","scheduledBroadcasts","fluxoAdvanced","conversationStates","bulkValidatorData","quickReplies","crmTodos","signatureSettings","teamSettings","blurSettings","featureVisibility","themeSettings","uiStateSettings","apiPollingSettings","agentSettings"];Object.keys(n.features).forEach(t=>{e.includes(t)&&(a[t]=!0)})}else if(n.data){if(n.data.chromeStorage&&Object.keys(n.data.chromeStorage).length>0){const e=Object.keys(n.data.chromeStorage);e.some(e=>e.toLowerCase().includes("kanban")||e.toLowerCase().includes("crm"))&&(a.kanbanData=!0),e.some(e=>e.toLowerCase().includes("template"))&&(a.templates=!0),e.some(e=>e.toLowerCase().includes("broadcast")||e.toLowerCase().includes("scheduled"))&&(a.broadcastHistory=!0),e.some(e=>e.includes("wa_crm_data_sync"))&&(a.crmProfileData=!0),e.some(e=>e.includes("wa_ai_bot_settings")||e.includes("wa_ai_bot_queue"))&&(a.aiBotSettings=!0),e.some(e=>e.includes("wa_spoken_language"))&&(a.spokenLanguage=!0),a.settings=!0}if(n.data.localStorage&&Object.keys(n.data.localStorage).length>0){const e=Object.keys(n.data.localStorage);e.some(e=>e.includes("tabs")||e.includes("tab"))&&(a.customTabs=!0),e.some(e=>e.includes("kanban")||e.includes("crm"))&&(a.kanbanData=!0),e.some(e=>e.includes("template")||e.includes("quick_repl"))&&(a.templates=!0),e.some(e=>e.includes("wa_crm_data"))&&(a.crmProfileData=!0,a.calendarData=!0),e.some(e=>e.includes("wa_crm_status_items"))&&(a.statusData=!0),e.some(e=>e.includes("webhook_settings"))&&(a.webhookSettings=!0),e.some(e=>e.includes("wa_ai_settings"))&&(a.aiApiSettings=!0),e.some(e=>e.includes("wa_spoken_language"))&&(a.spokenLanguage=!0)}n.data.indexedDB&&Object.keys(n.data.indexedDB).length>0&&(a.kanbanData=!0)}0===Object.keys(a).length&&(n.data||n.features)&&(a.kanbanData=!0,a.customTabs=!0,a.templates=!0,a.broadcastHistory=!0,a.settings=!0,a.crmProfileData=!0,a.calendarData=!0,a.statusData=!0,a.webhookSettings=!0,a.aiBotSettings=!0,a.aiApiSettings=!0,a.spokenLanguage=!0),t.setImportFeatures(a)}catch(e){alert("Invalid backup file. Please select a valid JSON backup file."),t.setImportFile(null),t.setImportFeatures({})}},a.readAsText(n)}(e,{setImportFile:J,setImportFeatures:Z})},getFeatureName:qt,onClose:()=>W(!1)}),document.body))},sg=()=>a.createElement(c,null,a.createElement(ig,null));function lg(){const e=()=>{const e=document.querySelector("#app")||document.querySelector('[data-testid="app"]');if(!e)return!1;if(!(document.querySelector("header")||document.querySelector('[role="banner"]')||document.querySelector('div[data-testid*="filter"]')||e.querySelector('div[role="textbox"]')))return!1;if(document.getElementById("wa-extension-header-root"))return!0;const t=document.createElement("div");t.id="wa-extension-header-root",e.insertBefore(t,e.firstChild);return o.createRoot(t).render(a.createElement(sg,null)),!0};if(e())return;const t=new MutationObserver(()=>{e()&&t.disconnect()});t.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>e(),2e3),setTimeout(()=>e(),5e3)}var cg=r(5180);class dg{static async initWasm(){if(!this.wasmModule)try{await new Promise((e,t)=>{const n=()=>{this.wasmModule={encryptPayload:e=>new Promise((t,n)=>{const a="enc_"+Date.now()+"_"+Math.random(),r=e=>{const o=e;o.detail.id===a&&(document.removeEventListener("wasmEncryptResponse",r),o.detail.error?n(new Error(o.detail.error)):t(o.detail.result))};document.addEventListener("wasmEncryptResponse",r),document.dispatchEvent(new CustomEvent("wasmEncrypt",{detail:{id:a,plaintext:e}})),setTimeout(()=>{document.removeEventListener("wasmEncryptResponse",r),n(new Error("Encrypt timeout"))},5e3)}),decryptPayload:(e,t)=>new Promise((t,n)=>{const a="dec_"+Date.now()+"_"+Math.random(),r=e=>{const o=e;o.detail.id===a&&(document.removeEventListener("wasmDecryptResponse",r),o.detail.error?n(new Error(o.detail.error)):t(o.detail.result))};document.addEventListener("wasmDecryptResponse",r),document.dispatchEvent(new CustomEvent("wasmDecrypt",{detail:{id:a,encryptedData:e}})),setTimeout(()=>{document.removeEventListener("wasmDecryptResponse",r),n(new Error("Decrypt timeout"))},5e3)})},document.removeEventListener("wasmCryptoReady",n),a&&clearInterval(a),r&&clearTimeout(r),e()};document.addEventListener("wasmCryptoReady",n);const a=setInterval(()=>{0},1e3),r=setTimeout(()=>{document.removeEventListener("wasmCryptoReady",n),clearInterval(a),t(new Error("WASM initialization timeout"))},6e4)})}catch(e){throw e}}static async encrypt(e){this.wasmModule||await this.initWasm();try{const t=JSON.stringify(e),n=await this.wasmModule.encryptPayload(t);return{encrypted_data:n.encrypted_data,nonce:n.nonce,timestamp:Date.now()}}catch(e){throw e}}static async decrypt(e){this.wasmModule||await this.initWasm();try{const t=await this.wasmModule.decryptPayload(e.encrypted_data,e.nonce);return JSON.parse(t)}catch(e){throw e}}static async saveToStorage(e,t){try{const a=await this.encrypt(t);await n().storage.local.set({[e]:a,[`${e}_timestamp`]:Date.now()})}catch(e){throw e}}static async loadFromStorage(e){try{const t=await n().storage.local.get([e]);if(!t[e])return null;return await this.decrypt(t[e])}catch(e){return null}}static async saveTemplates(e){await this.saveToStorage(this.STORAGE_KEYS.TEMPLATES,e)}static async loadTemplates(){return await this.loadFromStorage(this.STORAGE_KEYS.TEMPLATES)||[]}static async addTemplate(e){const t=await this.loadTemplates();e.created_at=Date.now(),e.modified_at=Date.now(),e.id||(e.id=`tmpl_${Date.now()}_${Math.random().toString(36).substr(2,9)}`),t.push(e),await this.saveTemplates(t)}static async updateTemplate(e,t){const n=await this.loadTemplates(),a=n.findIndex(t=>t.id===e);if(-1===a)throw new Error(`Template not found: ${e}`);n[a]={...n[a],...t,modified_at:Date.now()},await this.saveTemplates(n)}static async deleteTemplate(e){const t=await this.loadTemplates(),n=t.filter(t=>t.id!==e);if(n.length===t.length)throw new Error(`Template not found: ${e}`);await this.saveTemplates(n)}static async getTemplate(e){return(await this.loadTemplates()).find(t=>t.id===e)||null}static async saveQuickReplies(e){await this.saveToStorage(this.STORAGE_KEYS.QUICK_REPLIES,e)}static async loadQuickReplies(){return await this.loadFromStorage(this.STORAGE_KEYS.QUICK_REPLIES)||[]}static async addQuickReply(e){const t=await this.loadQuickReplies();e.created_at=Date.now(),e.modified_at=Date.now(),e.id||(e.id=`qr_${Date.now()}_${Math.random().toString(36).substr(2,9)}`),t.push(e),await this.saveQuickReplies(t)}static async updateQuickReply(e,t){const n=await this.loadQuickReplies(),a=n.findIndex(t=>t.id===e);if(-1===a)throw new Error(`Quick reply not found: ${e}`);n[a]={...n[a],...t,modified_at:Date.now()},await this.saveQuickReplies(n)}static async deleteQuickReply(e){const t=await this.loadQuickReplies(),n=t.filter(t=>t.id!==e);if(n.length===t.length)throw new Error(`Quick reply not found: ${e}`);await this.saveQuickReplies(n)}static async getQuickReply(e){return(await this.loadQuickReplies()).find(t=>t.id===e)||null}static async getPinnedQuickReplies(){return(await this.loadQuickReplies()).filter(e=>!0===e.settings?.pinToShortcut)}static async clearQuickReplies(){await n().storage.local.remove([this.STORAGE_KEYS.QUICK_REPLIES,`${this.STORAGE_KEYS.QUICK_REPLIES}_timestamp`]),"undefined"!=typeof localStorage&&localStorage.removeItem("encrypted_quick_replies")}static async clearAll(){await n().storage.local.remove([this.STORAGE_KEYS.TEMPLATES,this.STORAGE_KEYS.QUICK_REPLIES,this.STORAGE_KEYS.LAST_SYNC,`${this.STORAGE_KEYS.TEMPLATES}_timestamp`,`${this.STORAGE_KEYS.QUICK_REPLIES}_timestamp`])}static async getStats(){const e=await this.loadTemplates(),t=await this.loadQuickReplies(),a=await n().storage.local.get([this.STORAGE_KEYS.LAST_SYNC]);return{templates:e.length,quickReplies:t.length,lastSync:a[this.STORAGE_KEYS.LAST_SYNC]||null}}static async exportData(){return{templates:await this.loadTemplates(),quickReplies:await this.loadQuickReplies(),exportedAt:Date.now()}}static async importData(e){e.templates&&await this.saveTemplates(e.templates),e.quickReplies&&await this.saveQuickReplies(e.quickReplies)}static async migrateFromLocalStorage(){try{const e=await this.getStats();if(e.templates>0||e.quickReplies>0)return;const t=localStorage.getItem("wa_templates"),a=localStorage.getItem("wa_quick_replies");let r=0;if(t)try{const e=JSON.parse(t);Array.isArray(e)&&e.length>0&&(await this.saveTemplates(e),r+=e.length)}catch(e){}if(a)try{const e=JSON.parse(a);Array.isArray(e)&&e.length>0&&(await this.saveQuickReplies(e),r+=e.length)}catch(e){}r>0&&await n().storage.local.set({migration_completed:Date.now()})}catch(e){throw e}}}dg.wasmModule=null,dg.STORAGE_KEYS={TEMPLATES:"encrypted_templates",QUICK_REPLIES:"encrypted_quick_replies",LAST_SYNC:"last_storage_sync"},"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{dg.initWasm().catch(console.error)}):dg.initWasm().catch(console.error));const mg="webhook_settings";function pg(){try{const e=localStorage.getItem(mg);return e?JSON.parse(e):{}}catch(e){return{}}}function ug(e){return pg()[e]||null}function gg(e){const t=ug(e);return!!t&&(t.active&&!!t.url)}function hg(e,t,n){const a=pg(),r=a[e];if(!r)return;const o={timestamp:Date.now(),status:t,data:"failed"===t?{error:n}:void 0};r.lastUploads=[o,...r.lastUploads||[]].slice(0,30),a[e]=r,function(e){try{localStorage.setItem(mg,JSON.stringify(e)),"undefined"!=typeof chrome&&chrome.storage&&chrome.storage.local.set({[mg]:e})}catch(e){}}(a)}async function bg(e,t,n){if(!gg(e))return!1;const a=ug(e);if(!a||!a.url)return!1;const r=function(e,t,n){const a={};return e.dataFields.forEach(e=>{if(e.enabled)switch(e.id){case"event_details":a.event={type:t.eventType,name:t.eventName,timestamp:t.timestamp,data:t.data};break;case"number":a.number=n.number;break;case"name":a.name=n.name,a.pushname=n.pushname;break;case"picture":a.profilePicUrl=n.profilePicUrl||null;break;case"labels":a.labels=n.labels||[];break;case"contact_profile":a.contactProfile=n.contactProfile||null;break;case"registered_user":a.isRegisteredUser=n.isRegisteredUser??null;break;case"appointment_time":t.data?.appointmentTime&&(a.appointmentTime=t.data.appointmentTime);break;case"meeting_link":t.data?.meetingLink&&(a.meetingLink=t.data.meetingLink);break;case"crm_data":t.data?.crmData&&(a.crmData=t.data.crmData);break;case"notes":t.data?.notes&&(a.notes=t.data.notes);break;case"transactions":t.data?.transactions&&(a.transactions=t.data.transactions);break;case"message_content":t.data?.messageContent&&(a.messageContent=t.data.messageContent);break;case"media_url":t.data?.mediaUrl&&(a.mediaUrl=t.data.mediaUrl);break;case"timestamp":a.timestamp=t.timestamp}}),a}(a,t,n);try{const t=await fetch(a.url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(t.ok)return hg(e,"success"),!0;{const n=await t.text();return hg(e,"failed",`HTTP ${t.status}: ${n}`),!1}}catch(t){return hg(e,"failed",t.message),!1}}const fg=new class{constructor(){this.quickReplies=[],this.currentChatId=null,this.isInitialized=!1,this.quickReplyButtonsContainer=null,this.lastTemplateCount=0,this.lastTemplateHash="",this.pollingInterval=null,this.selectedCategoryId="all",this.categories=[],this.pendingSendTimers=new Map,this.expandBtnReinsertObserver=null,this.playIcon='<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>',this.pauseIcon='<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><rect x="6" y="4" width="4" height="16"></rect><rect x="14" y="4" width="4" height="16"></rect></svg>',this.loadingIcon='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" class="qr-spin"><circle cx="12" cy="12" r="10" opacity="0.3"></circle><path d="M12 2a10 10 0 0 1 10 10"></path></svg>',this.checkIcon='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>',this.errorIcon='<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>'}async init(){if(!this.isInitialized)try{this.attachChatListener(),await dg.initWasm(),await dg.clearQuickReplies(),await this.migrateOldData(),await this.loadQuickReplies(),await this.waitForWPP(),this.attachInputListener(),this.monitorChatFooter(),this.attachStorageListener(),window.addEventListener("languageChanged",()=>{this.renderQuickReplyButtons()}),window.addEventListener(I,()=>{this.renderQuickReplyButtons()}),window.addEventListener("lionThemeApplied",()=>{this.renderQuickReplyButtons()}),this.isInitialized=!0}catch(e){throw e}}async migrateOldData(){try{if((await dg.getStats()).quickReplies>0)return;await dg.migrateFromLocalStorage();(await dg.getStats()).quickReplies}catch(e){}}async buildStageToLabelMap(){const e={};try{if("undefined"!=typeof chrome&&chrome.storage){const t=(await chrome.storage.local.get("wa_kanban_crm_data_sync")).wa_kanban_crm_data_sync;if(t){const n=t.crms?.find(e=>"whatsapp_labels"===e.type);n&&t.stages?.[n.id]&&t.stages[n.id].forEach(t=>{t.id&&t.whatsappLabelId&&(e[t.id]=t.whatsappLabelId)})}}}catch(e){}return e}migratePostActionsLabels(e,t){if(!e||0===Object.keys(t).length)return e;const n={...e};return n.addLabels&&Array.isArray(n.addLabels)&&(n.addLabels=n.addLabels.map(e=>{if(e.startsWith("stage-")&&t[e]){return t[e]}return e})),n.removeLabels&&Array.isArray(n.removeLabels)&&(n.removeLabels=n.removeLabels.map(e=>{if(e.startsWith("stage-")&&t[e]){return t[e]}return e})),n}async loadQuickReplies(){try{this.quickReplies=[];try{const{TemplatesStorage:e}=await Promise.resolve().then(r.bind(r,1872)),t=await e.getCategoriesAsync();this.categories=t.filter(e=>"cat_all"!==e.id&&"cat_quick_reply"!==e.id&&"cat_uncategorized"!==e.id).map(e=>({id:e.id,name:e.name,icon:e.icon,color:e.color}));const n=(await e.getTemplatesAsync()).filter(e=>"quick_reply"===e.messageType&&!1!==e.isActive).sort((e,t)=>(e.sortOrder??999)-(t.sortOrder??999));this.lastTemplateCount=n.length,this.lastTemplateHash=this.generateTemplateHash(n);const a=await this.buildStageToLabelMap();this.quickReplies=n.map(e=>{let t=e.quickReplyData?.postActions||{};t=this.migratePostActionsLabels(t,a);const n=e.messages&&e.messages.length>0;let r;return r=n?e.messages.map((t,n)=>({id:t.id||`${e.id}_msg_${n+1}`,message:t.message||"",delay:t.delay||{min:3,max:5},attachmentType:t.attachmentType||"none",attachments:t.attachments||[],selectedContact:t.selectedContact||[],pollData:t.pollData||null,listData:t.listData||null,selectedProducts:t.selectedProducts||[]})):[{id:`${e.id}_msg_1`,message:e.message||"",delay:{min:0,max:0},attachmentType:e.sendAttachment?e.sendAttachmentType:"none",attachments:e.sendAttachment&&e.attachemnt||[],selectedContact:e.selectedContact||[],pollData:e.pollData||null,listData:e.listData||null,selectedProducts:e.selectedProducts||[]}],{id:e.id,title:e.templeteName||"Untitled",categoryId:e.categoryId||null,messages:r,settings:e.quickReplyData?.settings||{pinToShortcut:!1,editBeforeSend:!1,sendConfirmation:!1,shuffleMessages:!1,mentionAll:!1},postActions:t,created_at:e.createdAt||Date.now(),modified_at:e.modifiedAt||Date.now(),templateData:n?{sendAttachment:"none"!==r[0].attachmentType,sendAttachmentType:r[0].attachmentType||"none",attachemnt:r[0].attachments||[],selectedContact:r[0].selectedContact||[],pollData:r[0].pollData||null,listData:r[0].listData||null,buttonsData:null,selectedProducts:r[0].selectedProducts||[]}:{sendAttachment:e.sendAttachment||!1,sendAttachmentType:e.sendAttachmentType||"none",attachemnt:e.attachemnt||[],selectedContact:e.selectedContact||[],pollData:e.pollData||null,listData:e.listData||null,buttonsData:e.buttonsData||null,selectedProducts:e.selectedProducts||[]}}})}catch(e){this.quickReplies=[]}}catch(e){this.quickReplies=[]}}async saveQuickReply(e){try{await dg.addQuickReply(e),await this.loadQuickReplies(),this.currentChatId&&this.renderQuickReplyButtons()}catch(e){throw e}}async updateQuickReply(e,t){try{await dg.updateQuickReply(e,t),await this.loadQuickReplies(),this.currentChatId&&this.renderQuickReplyButtons()}catch(e){throw e}}async deleteQuickReply(e){try{await dg.deleteQuickReply(e),await this.loadQuickReplies(),this.currentChatId&&this.renderQuickReplyButtons()}catch(e){throw e}}getQuickReplies(){return this.quickReplies}getPinnedQuickReplies(){return this.quickReplies.filter(e=>!0===e.settings?.pinToShortcut)}waitForWPP(){return new Promise(e=>{let t=0;const n=setInterval(()=>{t++;if(void 0!==window.WPP&&window.WPP?.chat&&"function"==typeof window.WPP.chat.get)return clearInterval(n),void e();t>=600&&(clearInterval(n),e())},100)})}attachChatListener(){document.addEventListener("waActiveChatChanged",e=>{const{type:t,chatId:n}=e.detail;"open"===t&&n?(this.currentChatId=n,setTimeout(()=>{this.renderQuickReplyButtons()},1e3)):"close"===t&&(this.currentChatId=null,this.hideQuickReplyButtons())}),setInterval(()=>{this.currentChatId&&!document.getElementById("qr-buttons-container-v2")&&this.renderQuickReplyButtons()},3e3)}attachInputListener(){const e=()=>{const t=document.querySelector('[contenteditable="true"][data-tab="10"]');t?t.addEventListener("input",()=>{const e=t.textContent||"";e.startsWith("/")&&this.handleSlashCommand(e)}):setTimeout(e,1e3)};e()}handleSlashCommand(e){const t=e.substring(1).toLowerCase().trim();if(!t)return;this.quickReplies.find(e=>e.title.toLowerCase().includes(t))}monitorChatFooter(){let e=!1;new MutationObserver(()=>{e||this.currentChatId&&!this.quickReplyButtonsContainer&&(e=!0,requestAnimationFrame(()=>{e=!1,this.currentChatId&&!this.quickReplyButtonsContainer&&this.renderQuickReplyButtons()}))}).observe(document.body,{childList:!0,subtree:!0})}renderQuickReplyButtons(){const e=_(),t="dark"===A(e.mode),n=document.getElementById("qr-buttons-container-v2");n&&(n.remove(),this.quickReplyButtonsContainer=null);const a=this.findChatFooter();if(!a)return;let r=this.quickReplies;"all"!==this.selectedCategoryId&&(r=this.quickReplies.filter(e=>e.categoryId===this.selectedCategoryId));const o=document.createElement("div");o.id="qr-buttons-container-v2",o.style.cssText=`\n      position: relative;\n      padding: 10px 90px 10px 16px;\n      min-height: 52px;\n      background: ${t?"#1a1a1a":"#ffffff"};\n      border-top: 1px solid ${t?"#2a2a2a":"#f0f0f0"};\n      border-bottom: 1px solid ${t?"#2a2a2a":"#f0f0f0"};\n      z-index: 9999;\n      box-sizing: border-box;\n      margin-bottom: 0;\n      margin-top: -7px;\n      width: 100%;\n    `;const i=document.createElement("div");if(i.id="qr-buttons-scroll-row",i.style.cssText="\n      display: flex;\n      flex-direction: row;\n      flex-wrap: nowrap;\n      align-items: center;\n      gap: 8px;\n      overflow-x: auto;\n      overflow-y: hidden;\n      white-space: nowrap;\n      width: 100%;\n      box-sizing: border-box;\n      scrollbar-width: thin;\n    ",o.appendChild(i),!document.getElementById("qr-animations")){const e=document.createElement("style");e.id="qr-animations",e.textContent="\n        @keyframes pulse {\n          0% { transform: scale(1); opacity: 1; }\n          50% { transform: scale(1.03); opacity: 0.9; }\n          100% { transform: scale(1); opacity: 1; }\n        }\n        @keyframes qr-spin {\n          0% { transform: rotate(0deg); }\n          100% { transform: rotate(360deg); }\n        }\n        .qr-spin {\n          animation: qr-spin 1s linear infinite;\n        }\n      ",document.head.appendChild(e)}const l=document.createElement("span");l.textContent=(0,s.t)("quickReply.title","Quick Reply"),l.style.cssText=`\n      font-size: 11px;\n      font-weight: 700;\n      color: ${t?"#ffffff":"#6b7280"};\n      text-transform: uppercase;\n      letter-spacing: 0.5px;\n      margin-right: 8px;\n      flex-shrink: 0;\n    `,i.appendChild(l);const c="wa_quick_reply_collapsed",d='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="18 15 12 9 6 15"></polyline></svg>';if(this.categories.length>0){const e=document.createElement("select");e.id="qr-category-filter",e.style.cssText=`\n        padding: 5px 10px;\n        border-radius: 8px;\n        border: 1px solid ${t?"#3a3a3a":"#e5e7eb"};\n        background: ${t?"#262626":"#ffffff"};\n        font-size: 11px;\n        font-weight: 500;\n        color: ${t?"#ffffff":"#374151"};\n        cursor: pointer;\n        outline: none;\n        flex-shrink: 0;\n        max-width: 140px;\n      `;const n=document.createElement("option");n.value="all",n.textContent=(0,s.t)("quickReply.allCategories","All Categories"),e.appendChild(n),this.categories.forEach(t=>{const n=document.createElement("option");n.value=t.id,n.textContent=`${t.icon} ${t.name}`,e.appendChild(n)}),e.value=this.selectedCategoryId,e.addEventListener("change",()=>{this.selectedCategoryId=e.value,this.renderQuickReplyButtons()}),i.appendChild(e);const a=document.createElement("span");a.style.cssText=`\n        width: 1px;\n        height: 18px;\n        background: ${t?"#3a3a3a":"#e5e7eb"};\n        margin: 0 4px;\n        flex-shrink: 0;\n      `,i.appendChild(a)}r.forEach(e=>{const n=e.settings?.editBeforeSend||!1,a=this.pendingSendTimers.has(e.id),r=document.createElement("div");r.id=`qr-chip-${e.id}`,r.style.cssText=`\n        display: inline-flex;\n        align-items: stretch;\n        gap: 0;\n        background: ${t?"#262626":"#ffffff"};\n        border-radius: 10px;\n        overflow: hidden;\n        flex: 0 0 auto;\n        width: auto;\n        transition: all 0.15s ease;\n        border: 1px solid ${t?"#3a3a3a":"#e5e7eb"};\n        height: 32px;\n      `;const o=document.createElement("button");if(o.className="qr-chip-title",o.innerHTML=`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="flex-shrink: 0;"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg><span style="overflow: hidden; text-overflow: ellipsis;">${this.escapeHtml(e.title)}</span>`,o.title=e.title,o.style.cssText=`\n        display: flex;\n        align-items: center;\n        gap: 8px;\n        padding: 0 14px;\n        background: transparent;\n        border: none;\n        color: ${t?"#e5e7eb":"#374151"};\n        font-size: 12px;\n        font-weight: 600;\n        font-family: inherit;\n        cursor: pointer;\n        white-space: nowrap;\n        max-width: 160px;\n        transition: color 0.15s;\n      `,o.addEventListener("mouseenter",()=>{o.style.color="var(--lion-primary)"}),o.addEventListener("mouseleave",()=>{o.style.color=t?"#e5e7eb":"#374151"}),o.addEventListener("click",t=>{t.stopPropagation(),n?(this.cancelPendingSend(e.id),this.showEditBeforeSendDialog(e)):this.handleSendButtonClick(e)}),r.appendChild(o),n){const n=document.createElement("button");n.className="qr-chip-edit",n.innerHTML='<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>',n.title=(0,s.t)("actionSidebar.editAndSend")||"Edit & Send",n.style.cssText=`\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          padding: 0 10px;\n          background: transparent;\n          border: none;\n          color: ${t?"#a0a0a0":"#6b7280"};\n          cursor: pointer;\n          transition: all 0.15s;\n          border-left: 1px solid ${t?"#3a3a3a":"#f0f0f0"};\n        `,n.addEventListener("mouseenter",()=>{n.style.background="rgba(var(--lion-primary-rgb), 0.08)",n.style.color="var(--lion-primary)"}),n.addEventListener("mouseleave",()=>{n.style.background="transparent",n.style.color=t?"#a0a0a0":"#6b7280"}),n.addEventListener("click",t=>{t.stopPropagation(),this.cancelPendingSend(e.id),this.showEditBeforeSendDialog(e)}),r.appendChild(n)}const l=document.createElement("button");l.className="qr-chip-send",l.id=`qr-send-${e.id}`;l.innerHTML=a?'<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><rect x="6" y="4" width="4" height="16"></rect><rect x="14" y="4" width="4" height="16"></rect></svg>':'<svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>',l.title=a?(0,s.t)("actionSidebar.clickToCancel")||"Click to cancel":(0,s.t)("actionSidebar.send")||"Send",l.style.cssText=`\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        padding: 0 12px;\n        background: rgba(var(--lion-primary-rgb), 0.1);\n        border: none;\n        color: var(--lion-primary);\n        cursor: pointer;\n        transition: all 0.15s;\n        border-left: 1px solid ${t?"#3a3a3a":"#f0f0f0"};\n      `,l.addEventListener("mouseenter",()=>{l.style.background="rgba(var(--lion-primary-rgb), 0.2)"}),l.addEventListener("mouseleave",()=>{l.style.background="rgba(var(--lion-primary-rgb), 0.1)"}),l.addEventListener("click",t=>{t.stopPropagation(),this.handleSendButtonClick(e)}),r.appendChild(l),r.addEventListener("mouseenter",()=>{r.style.borderColor="var(--lion-primary)",r.style.boxShadow="0 2px 8px rgba(var(--lion-primary-rgb), 0.15)"}),r.addEventListener("mouseleave",()=>{r.style.borderColor=t?"#3a3a3a":"#e5e7eb",r.style.boxShadow="none"}),i.appendChild(r)});const m=document.createElement("button");m.innerHTML=`<span style="display:inline-flex;flex-direction:row;align-items:center;gap:5px;white-space:nowrap;pointer-events:none;"><svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="display:inline-block!important;flex-shrink:0;"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg><span style="white-space:nowrap;">${(0,s.t)("quickReply.addButton","+ Adicionar").replace(/^\+\s*/,"")}</span></span>`,m.style.cssText="\n      position: absolute;\n      right: 16px;\n      top: 50%;\n      transform: translateY(-50%);\n      display: inline-flex;\n      flex-direction: row;\n      align-items: center;\n      gap: 5px;\n      white-space: nowrap;\n      padding: 7px 14px;\n      background: var(--lion-primary);\n      color: white;\n      border: none;\n      border-radius: 10px;\n      cursor: pointer;\n      font-size: 12px;\n      font-weight: 600;\n      transition: transform 0.15s, box-shadow 0.15s;\n      flex-shrink: 0;\n      box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n      z-index: 2;\n    ",m.addEventListener("mouseenter",()=>{m.style.transform="translateY(calc(-50% - 1px))",m.style.boxShadow="0 4px 14px rgba(var(--lion-primary-rgb), 0.35)"}),m.addEventListener("mouseleave",()=>{m.style.transform="translateY(-50%)",m.style.boxShadow="0 2px 8px rgba(var(--lion-primary-rgb), 0.25)"}),m.addEventListener("click",()=>{const e=new CustomEvent("openTemplateManager",{detail:{preSelectQuickReply:!0}});window.dispatchEvent(e)}),o.appendChild(m),a.appendChild(o),this.quickReplyButtonsContainer=o;const p=document.getElementById("qr-collapse-toggle");p&&p.remove(),document.querySelectorAll("#qr-expand-floating").forEach(e=>e.remove());const u=document.createElement("button");u.id="qr-expand-floating",u.title=(0,s.t)("quickReply.expand","Show Quick Reply"),u.setAttribute("aria-label",u.title),u.innerHTML=d;const g=t?"#262626":"#ffffff",h=t?"#3a3a3a":"#e5e7eb",b=t?"#d4d4d8":"#52525b";u.style.cssText=`\n      display: none;\n      align-items: center;\n      justify-content: center;\n      align-self: center;\n      width: 28px;\n      height: 28px;\n      margin: 0 8px;\n      padding: 0;\n      background: ${g};\n      color: ${b};\n      border: 1px solid ${h};\n      border-radius: 50%;\n      cursor: pointer;\n      flex-shrink: 0;\n      vertical-align: middle;\n      box-sizing: border-box;\n      line-height: 0;\n      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n      transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;\n    `,u.addEventListener("mouseenter",()=>{u.style.background="rgba(var(--lion-primary-rgb), 0.08)",u.style.borderColor="var(--lion-primary)",u.style.color="var(--lion-primary)"}),u.addEventListener("mouseleave",()=>{u.style.background=g,u.style.borderColor=h,u.style.color=b}),u.addEventListener("click",e=>{e.stopPropagation();const t="1"!==localStorage.getItem(c);localStorage.setItem(c,t?"1":"0"),w(t)});const f=()=>{const e=a.querySelector(".action-sidebar-trigger");if(!e)return!1;const t=e.parentElement;if(!t)return!1;const n=e.getBoundingClientRect();return n.width>0&&n.height>0&&(u.style.width=`${Math.round(n.width)}px`,u.style.height=`${Math.round(n.height)}px`),t.insertBefore(u,e),!0},v=()=>{const e=a.querySelector('[data-icon="ptt-filled"]')||a.querySelector('[data-icon="ptt"]')||a.querySelector('button[aria-label*="voice message" i]')||a.querySelector('button[aria-label*="Voice" i]');if(!e)return!1;const t="BUTTON"===e.tagName?e:e.closest("button");if(!t)return!1;const n=t.parentElement;if(!n)return!1;const r=t.getBoundingClientRect();return r.width>0&&r.height>0&&(u.style.width=`${Math.round(r.width)}px`,u.style.height=`${Math.round(r.height)}px`),n.insertBefore(u,t),!0};f()||v()||(u.style.position="absolute",u.style.right="90px",u.style.bottom="16px","static"===getComputedStyle(a).position&&(a.style.position="relative"),a.appendChild(u)),this.expandBtnReinsertObserver&&(this.expandBtnReinsertObserver.disconnect(),this.expandBtnReinsertObserver=null);let y=!1,x=!1;this.expandBtnReinsertObserver=new MutationObserver(()=>{x||y||document.body.contains(u)||(y=!0,requestAnimationFrame(()=>{if(y=!1,!document.body.contains(u)){x=!0;try{document.querySelectorAll("#qr-expand-floating").forEach(e=>{e!==u&&e.remove()}),f()||v()}finally{requestAnimationFrame(()=>{x=!1})}}}))}),this.expandBtnReinsertObserver.observe(a,{childList:!0,subtree:!0});const w=e=>{o.style.display=e?"none":"",e||Array.from(o.children).forEach(e=>{e.style.display=""}),u.style.display="inline-flex",u.style.alignItems="center",u.style.justifyContent="center",u.innerHTML=e?d:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';const t=e?(0,s.t)("quickReply.expand","Show Quick Reply"):(0,s.t)("quickReply.collapse","Hide Quick Reply");u.title=t,u.setAttribute("aria-label",t);const n=a.querySelector('[data-icon="ptt-filled"]')||a.querySelector('[data-icon="ptt"]')||a.querySelector('button[aria-label*="voice message" i]')||a.querySelector('button[aria-label*="Voice" i]'),r=n?"BUTTON"===n.tagName?n:n.closest("button"):null,i=(r||n)?.getBoundingClientRect();i&&i.width>0&&i.height>0&&(u.style.width=`${Math.round(i.width)}px`,u.style.height=`${Math.round(i.height)}px`)},k="1"===localStorage.getItem(c);w(k)}findChatFooter(){const e=['footer[data-testid="conversation-compose-box-container"]',"footer.copyable-area",'div[data-testid="conversation-panel-wrapper"] footer','div[role="application"] footer','footer[class*="copyable"]','div[data-testid="conversation-panel-body"] ~ footer','div[contenteditable="true"][data-tab="10"]',"footer"];for(let t=0;t<e.length;t++){const n=e[t],a=document.querySelector(n);if(a){if(!n.includes("contenteditable"))return a;{const e=a.closest("footer");if(e)return e}}}return document.querySelectorAll("footer").forEach((e,t)=>{}),null}hideQuickReplyButtons(){const e=document.getElementById("qr-buttons-container-v2");e&&(e.remove(),this.quickReplyButtonsContainer=null)}async sendQuickReply(e){try{if(!this.currentChatId)return;if(!e.messages||0===e.messages.length)return;if(e.settings.editBeforeSend)return void this.showEditBeforeSendDialog(e);for(let t=0;t<e.messages.length;t++){const n=e.messages[t],a={sendAttachment:"none"!==n.attachmentType,sendAttachmentType:n.attachmentType||"none",attachemnt:n.attachments||[],selectedContact:n.selectedContact||[],pollData:n.pollData||null,listData:n.listData||null,buttonsData:null,selectedProducts:n.selectedProducts||[]},r={...e,templateData:a};if(await this.sendMessage(n.message,r),t<e.messages.length-1){const e=n.delay||{min:3,max:5},t=1e3*(Math.random()*(e.max-e.min)+e.min);await new Promise(e=>setTimeout(e,t))}}await this.triggerQuickReplyWebhook(e,e.messages.map(e=>e.message).join(" | "))}catch(e){}}async triggerQuickReplyWebhook(e,t){localStorage.getItem("webhook_settings");try{if(!gg("quick_response"))return;const n=await this.getWebhookContactData();if(!n)return;const a=e?.templateData,r=a?.attachemnt?.map(e=>({name:e.name,type:e.type,caption:e.caption}))||[];await async function(e,t,n,a){return bg("quick_response",{eventType:"quick_response",eventName:t,timestamp:Date.now(),data:{messageContent:n,attachments:a||[]}},e)}(n,e.title,t,r)}catch(e){}}async getWebhookContactData(){try{if(!this.currentChatId||!window.WPP?.contact)return null;const e=window.WPP,t=await e.contact.get(this.currentChatId);let n;try{e.contact?.getProfilePictureUrl&&(n=await e.contact.getProfilePictureUrl(this.currentChatId))}catch(e){}let a,r,o=[];try{if(e.labels?.getLabelsFromChat){const t=await e.labels.getLabelsFromChat(this.currentChatId);o=t?.map(e=>e.name||e.id)||[]}}catch(e){}try{if(e.contact?.checkExists){const t=this.currentChatId.split("@")[0],n=await e.contact.checkExists(t);a=n?.exists||!1}}catch(e){}try{const e=localStorage.getItem("wa_crm_data");if(e){const t=JSON.parse(e),n=t.contacts?.[this.currentChatId];n?.profile&&(r={email:n.profile.email,address:n.profile.address,notes:n.profile.details,customFields:n.profile.customFields})}}catch(e){}return{number:this.currentChatId.split("@")[0],name:t.name||t.pushname||"",pushname:t.pushname||"",profilePicUrl:n,labels:o,isGroup:this.currentChatId.includes("@g.us"),contactProfile:r,isRegisteredUser:a}}catch(e){return null}}async processMessageVariables(e){try{const t=await this.getContactData();return t&&(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/@firstname/gi,t.firstname||"")).replace(/@lastname/gi,t.lastname||"")).replace(/@contactname/gi,t.contactname||"")).replace(/@whatsappname/gi,t.whatsappname||"")).replace(/\{\{firstname\}\}/gi,t.firstname||"")).replace(/\{\{lastname\}\}/gi,t.lastname||"")).replace(/\{\{contactname\}\}/gi,t.contactname||"")).replace(/\{\{whatsappname\}\}/gi,t.whatsappname||"")),e}catch(t){return e}}async getContactData(){try{if(!this.currentChatId||!window.WPP?.contact)return null;const e=await window.WPP.contact.get(this.currentChatId);return{firstname:e.firstName||"",lastname:e.lastName||"",contactname:e.name||"",whatsappname:e.pushname||""}}catch(e){return null}}insertMessageToInput(e){const t=document.querySelector('[contenteditable="true"][data-tab="10"]');t&&(t.focus(),document.execCommand("insertText",!1,e))}escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}showEditBeforeSendDialog(e){const t=e.messages[0].message||"",n=document.getElementById("quick-reply-edit-dialog");n&&n.remove();const a=document.createElement("div");a.id="quick-reply-edit-dialog",a.innerHTML=`\n      <div class="qr-edit-overlay">\n        <div class="qr-edit-modal">\n          <div class="qr-edit-header">\n            <span class="qr-edit-title">✏️ ${this.escapeHtml(e.title||"Quick Reply")}</span>\n            <button class="qr-edit-close" title="Close">×</button>\n          </div>\n          <div class="qr-edit-body">\n            <textarea class="qr-edit-textarea" placeholder="Type your message...">${this.escapeHtml(t)}</textarea>\n          </div>\n          <div class="qr-edit-footer">\n            <button class="qr-edit-cancel">${(0,s.t)("actionSidebar.cancel")||"Cancel"}</button>\n            <button class="qr-edit-send">\n              <span>▶</span>\n              ${(0,s.t)("actionSidebar.send")||"Send"}\n            </button>\n          </div>\n        </div>\n      </div>\n      <style>\n        .qr-edit-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.5);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 999999;\n          animation: qr-fade-in 0.2s ease;\n        }\n        @keyframes qr-fade-in {\n          from { opacity: 0; }\n          to { opacity: 1; }\n        }\n        .qr-edit-modal {\n          background: ${ca.bgPrimary};\n          border-radius: 12px;\n          width: 400px;\n          max-width: 90vw;\n          box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n          animation: qr-slide-up 0.2s ease;\n          overflow: hidden;\n        }\n        @keyframes qr-slide-up {\n          from { transform: translateY(20px); opacity: 0; }\n          to { transform: translateY(0); opacity: 1; }\n        }\n        .qr-edit-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 16px 20px;\n          background: ${ca.primary};\n          color: white;\n        }\n        .qr-edit-title {\n          font-size: 16px;\n          font-weight: 600;\n        }\n        .qr-edit-close {\n          background: none;\n          border: none;\n          color: white;\n          font-size: 24px;\n          cursor: pointer;\n          padding: 0;\n          width: 32px;\n          height: 32px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          border-radius: 50%;\n          transition: background 0.2s;\n        }\n        .qr-edit-close:hover {\n          background: rgba(255, 255, 255, 0.2);\n        }\n        .qr-edit-body {\n          padding: 20px;\n        }\n        .qr-edit-textarea {\n          width: 100%;\n          min-height: 120px;\n          padding: 14px;\n          border: 2px solid ${ca.borderLight};\n          border-radius: 10px;\n          font-size: 14px;\n          font-family: inherit;\n          resize: vertical;\n          transition: border-color 0.2s;\n          box-sizing: border-box;\n        }\n        .qr-edit-textarea:focus {\n          outline: none;\n          border-color: ${ca.primary};\n        }\n        .qr-edit-footer {\n          display: flex;\n          justify-content: flex-end;\n          gap: 12px;\n          padding: 16px 20px;\n          background: ${ca.bgSecondary};\n          border-top: 1px solid ${ca.borderLight};\n        }\n        .qr-edit-cancel {\n          padding: 10px 20px;\n          border: 1px solid ${ca.borderMedium};\n          border-radius: 8px;\n          background: ${ca.bgPrimary};\n          color: ${ca.textSecondary};\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n        .qr-edit-cancel:hover {\n          background: ${ca.bgTertiary};\n        }\n        .qr-edit-send {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          padding: 10px 24px;\n          border: none;\n          border-radius: 8px;\n          background: ${ca.primary};\n          color: white;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n        .qr-edit-send:hover {\n          transform: translateY(-1px);\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.4);\n        }\n        .qr-edit-send:disabled {\n          opacity: 0.6;\n          cursor: not-allowed;\n          transform: none;\n        }\n      </style>\n    `,document.body.appendChild(a);const r=a.querySelector(".qr-edit-textarea");r?.focus(),r?.setSelectionRange(r.value.length,r.value.length);const o=a.querySelector(".qr-edit-close");o?.addEventListener("click",()=>a.remove());const i=a.querySelector(".qr-edit-cancel");i?.addEventListener("click",()=>a.remove()),a.querySelector(".qr-edit-overlay")?.addEventListener("click",e=>{e.target===a.querySelector(".qr-edit-overlay")&&a.remove()});const l=a.querySelector(".qr-edit-send");l?.addEventListener("click",async()=>{const t=r?.value||"";if(t.trim()){l.disabled=!0,l.innerHTML="⏳ Sending...";try{const n={...e,messages:[{...e.messages[0],message:t}],settings:{...e.settings,editBeforeSend:!1}};let r=t;(r.includes("{{")||r.includes("@"))&&(r=await this.processMessageVariables(r)),n.messages[0].message=r,await this.sendQuickReply(n),a.remove()}catch(e){l.disabled=!1,l.innerHTML=`<span>▶</span> ${(0,s.t)("actionSidebar.send")||"Send"}`}}else r?.focus()});const c=e=>{"Escape"===e.key&&(a.remove(),document.removeEventListener("keydown",c))};document.addEventListener("keydown",c),r?.addEventListener("keydown",e=>{"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),l?.click())})}handleSendButtonClick(e){const t=document.getElementById(`qr-send-${e.id}`),n=document.getElementById(`qr-chip-${e.id}`);if(!t||!n)return;if(this.pendingSendTimers.has(e.id))return void this.cancelPendingSend(e.id);if(e.settings?.editBeforeSend)return void this.showEditBeforeSendDialog(e);t.innerHTML=this.pauseIcon,t.title=(0,s.t)("actionSidebar.clickToCancel")||"Click to cancel",n.style.animation="pulse 0.6s infinite";const a=setTimeout(()=>{this.executeSend(e)},3e3);this.pendingSendTimers.set(e.id,{timer:a,quickReply:e})}cancelPendingSend(e){const t=this.pendingSendTimers.get(e);if(t){clearTimeout(t.timer),this.pendingSendTimers.delete(e);const n=document.getElementById(`qr-send-${e}`),a=document.getElementById(`qr-chip-${e}`);n&&(n.innerHTML=this.playIcon,n.title=(0,s.t)("actionSidebar.send")||"Send"),a&&(a.style.animation="none")}}async executeSend(e){this.pendingSendTimers.delete(e.id);const t=document.getElementById(`qr-send-${e.id}`),n=document.getElementById(`qr-chip-${e.id}`),a=n?.querySelector(".qr-chip-title"),r=`<span style="opacity: 0.9;">💬</span> ${this.escapeHtml(e.title)}`;t&&(t.innerHTML=this.loadingIcon,t.style.pointerEvents="none"),n&&(n.style.animation="pulse 0.6s infinite"),a&&(a.innerHTML=`<span style="opacity: 0.9;">⏳</span> ${(0,s.t)("actionSidebar.sending")||"Sending"}...`);try{await this.sendQuickReply(e),t&&(t.innerHTML=this.checkIcon),a&&(a.innerHTML='<span style="opacity: 0.9;">✅</span> Sent!'),n&&(n.style.animation="none",n.style.background=`linear-gradient(135deg, ${ca.success} 0%, #059669 100%)`),setTimeout(()=>{t&&(t.innerHTML=this.playIcon,t.style.pointerEvents="auto"),a&&(a.innerHTML=r),n&&(n.style.background=`${ca.primary}`)},1500)}catch(e){t&&(t.innerHTML=this.errorIcon),a&&(a.innerHTML='<span style="opacity: 0.9;">❌</span> Failed'),n&&(n.style.animation="none",n.style.background=`linear-gradient(135deg, ${ca.error} 0%, #dc2626 100%)`),setTimeout(()=>{t&&(t.innerHTML=this.playIcon,t.style.pointerEvents="auto"),a&&(a.innerHTML=r),n&&(n.style.background=`${ca.primary}`)},2e3)}}async sendMessage(e,t){if(!this.currentChatId)throw new Error("No active chat");let n=t?.templateData||null;if(n&&n.attachemnt&&n.attachemnt.length>0){const{mediaDB:e}=await Promise.resolve().then(r.bind(r,1132));for(let t=0;t<n.attachemnt.length;t++){const a=n.attachemnt[t];if(a.file&&(!a.base64Url||!a.base64Url.startsWith("data:"))){const r=a.file;try{const o=await e.getMedia(r);if(!o||!o.data)throw new Error(`Media file not found: ${a.name}. Please re-upload the file.`);n.attachemnt[t].base64Url=o.data}catch(e){throw new Error(`Failed to load media: ${a.name}`)}}}}return new Promise((a,r)=>{const o=`send_message_${Date.now()}`,i=e=>{e.data&&"sendMessageResponse"===e.data.type&&e.data.messageId===o&&(window.removeEventListener("message",i),e.data.success?a():r(new Error(e.data.error||"Failed to send message")))};window.addEventListener("message",i);const s=t?{id:t.id,title:t.title,created_at:t.created_at,modified_at:t.modified_at,settings:t.settings,postActions:t.postActions}:null;window.postMessage({type:"sendQuickReply",messageId:o,chatId:this.currentChatId,message:e,templateData:n,quickReplyInfo:s},"*"),setTimeout(()=>{window.removeEventListener("message",i),r(new Error("Send message timeout"))},2e4)})}async exportQuickReplies(){const e=await dg.exportData();return JSON.stringify(e,null,2)}async importQuickReplies(e){try{const t=JSON.parse(e);await dg.importData(t),await this.loadQuickReplies()}catch(e){throw e}}attachStorageListener(){this.startStoragePolling(),"undefined"!=typeof chrome&&chrome.storage&&chrome.storage.onChanged.addListener(async(e,t)=>{"local"===t&&e.wa_templates&&await this.forceReloadAndRender()}),window.addEventListener("wa-template-saved",async()=>{await this.forceReloadAndRender()}),window.addEventListener("wa-template-deleted",async()=>{await this.loadQuickReplies(),this.currentChatId&&this.renderQuickReplyButtons()}),window.addEventListener("wa-template-reordered",async()=>{await this.forceReloadAndRender()})}generateTemplateHash(e){return e.map(e=>`${e.id}:${e.templeteName}:${e.message}:${e.modifiedAt||0}:${e.isActive}:${e.sortOrder??999}`).sort().join("|")}startStoragePolling(){this.pollingInterval&&clearInterval(this.pollingInterval),this.pollingInterval=setInterval(async()=>{try{if("undefined"==typeof chrome||!chrome.storage)return;const e=await chrome.storage.local.get("wa_templates"),t=(e.wa_templates||[]).filter(e=>"quick_reply"===e.messageType&&!1!==e.isActive),n=t.length,a=this.generateTemplateHash(t);n===this.lastTemplateCount&&a===this.lastTemplateHash||(this.lastTemplateCount=n,this.lastTemplateHash=a,await this.forceReloadAndRender())}catch(e){}},1500)}async forceReloadAndRender(){if(await new Promise(e=>setTimeout(e,100)),await this.loadQuickReplies(),this.lastTemplateCount=this.quickReplies.length,this.currentChatId){const e=document.getElementById("qr-buttons-container-v2");e&&(e.remove(),this.quickReplyButtonsContainer=null),this.renderQuickReplyButtons()}}async getStats(){return await dg.getStats()}},vg="chats",yg="labels",xg="tabs";const wg=new class{constructor(){this.db=null}async init(){return new Promise((e,t)=>{const n=indexedDB.open("WhatsAppKanbanDB",1);n.onerror=()=>{t(n.error)},n.onsuccess=()=>{this.db=n.result,e()},n.onupgradeneeded=e=>{const t=e.target.result;if(!t.objectStoreNames.contains(vg)){const e=t.createObjectStore(vg,{keyPath:"id"});e.createIndex("updatedAt","updatedAt",{unique:!1}),e.createIndex("lastMessageTime","lastMessageTime",{unique:!1})}if(!t.objectStoreNames.contains(yg)){t.createObjectStore(yg,{keyPath:"id"}).createIndex("name","name",{unique:!1})}if(!t.objectStoreNames.contains(xg)){t.createObjectStore(xg,{keyPath:"id"}).createIndex("position","position",{unique:!1})}}})}async saveChats(e){return this.db||await this.init(),new Promise((t,n)=>{const a=this.db.transaction([vg],"readwrite"),r=a.objectStore(vg);a.onerror=()=>n(a.error),a.oncomplete=()=>{t()},e.forEach(e=>{r.put({...e,updatedAt:Date.now()})})})}async getAllChats(){return this.db||await this.init(),new Promise((e,t)=>{const n=this.db.transaction([vg],"readonly").objectStore(vg).getAll();n.onerror=()=>t(n.error),n.onsuccess=()=>{e(n.result)}})}async getChat(e){return this.db||await this.init(),new Promise((t,n)=>{const a=this.db.transaction([vg],"readonly").objectStore(vg).get(e);a.onerror=()=>n(a.error),a.onsuccess=()=>t(a.result)})}async deleteChat(e){return this.db||await this.init(),new Promise((t,n)=>{const a=this.db.transaction([vg],"readwrite").objectStore(vg).delete(e);a.onerror=()=>n(a.error),a.onsuccess=()=>{t()}})}async clearChats(){return this.db||await this.init(),new Promise((e,t)=>{const n=this.db.transaction([vg],"readwrite").objectStore(vg).clear();n.onerror=()=>t(n.error),n.onsuccess=()=>{e()}})}async saveLabels(e){return this.db||await this.init(),new Promise((t,n)=>{const a=this.db.transaction([yg],"readwrite"),r=a.objectStore(yg);a.onerror=()=>n(a.error),a.oncomplete=()=>{t()},e.forEach(e=>{r.put({...e,updatedAt:Date.now()})})})}async getAllLabels(){return this.db||await this.init(),new Promise((e,t)=>{const n=this.db.transaction([yg],"readonly").objectStore(yg).getAll();n.onerror=()=>t(n.error),n.onsuccess=()=>{e(n.result)}})}async saveTabs(e){return this.db||await this.init(),new Promise((t,n)=>{const a=this.db.transaction([xg],"readwrite"),r=a.objectStore(xg);a.onerror=()=>n(a.error),a.oncomplete=()=>{t()},e.forEach(e=>{r.put({...e,updatedAt:Date.now()})})})}async getAllTabs(){return this.db||await this.init(),new Promise((e,t)=>{const n=this.db.transaction([xg],"readonly").objectStore(xg).getAll();n.onerror=()=>t(n.error),n.onsuccess=()=>{e(n.result)}})}async getLastSyncTime(){const e=await this.getAllChats();return 0===e.length?0:Math.max(...e.map(e=>e.updatedAt||0))}};const kg=new class{constructor(){this.syncInterval=null,this.isSyncing=!1}async startAutoSync(){try{await wg.init()}catch(e){return}this.syncAllData(),this.syncInterval=window.setInterval(()=>{this.syncAllData()},3e4),window.addEventListener("whatsapp-kanban-sync",()=>{this.syncAllData()}),this.setupLabelServiceListener()}setupLabelServiceListener(){window.addEventListener("message",async e=>{if(e.source===window){if("LABEL_SERVICE_SYNC_TO_STORAGE"===e.data?.type){const t=e.data.labels;if(t&&Array.isArray(t))try{await chrome.storage.local.set({kanban_labels:t,kanban_labels_timestamp:Date.now()})}catch(e){}}if("LABEL_SERVICE_UPDATE"===e.data?.type){const{action:t,chatId:n,labelId:a,labels:r}=e.data;if("refresh"===t&&r)try{await chrome.storage.local.set({kanban_labels:r,kanban_labels_timestamp:Date.now()})}catch(e){}}}})}stopAutoSync(){this.syncInterval&&(clearInterval(this.syncInterval),this.syncInterval=null)}async syncAllData(){if(!this.isSyncing){this.isSyncing=!0;try{await Promise.all([this.syncChats(),this.syncLabels(),this.syncTabs()])}catch(e){}finally{this.isSyncing=!1}}}async syncChats(){return new Promise(e=>{window.postMessage({type:"KANBAN_FETCH_CHATS",source:"content-script"},"*");const t=async n=>{if(n.source!==window)return;if("KANBAN_CHATS_RESPONSE"!==n.data.type)return;window.removeEventListener("message",t);const a=n.data.chats||[];if(a.length>0){await wg.saveChats(a);try{await chrome.storage.local.set({kanban_chats:a,kanban_chats_timestamp:Date.now()})}catch(e){}}e()};window.addEventListener("message",t),setTimeout(()=>{window.removeEventListener("message",t),e()},6e4)})}async syncLabels(){return new Promise(e=>{window.postMessage({type:"KANBAN_FETCH_LABELS",source:"content-script"},"*");const t=async n=>{if(n.source!==window)return;if("KANBAN_LABELS_RESPONSE"!==n.data.type)return;window.removeEventListener("message",t);const a=n.data.labels||[];if(a.length>0){const e={};a.forEach(t=>{t.id&&t.chatIds&&(e[t.id]=t.chatIds)}),a.forEach(e=>{e.chatIds});try{await chrome.storage.local.set({kanban_labels:a,kanban_labels_timestamp:Date.now(),kanban_label_chats:e})}catch(e){}}e()};window.addEventListener("message",t),setTimeout(()=>{window.removeEventListener("message",t),e()},6e4)})}async syncTabs(){try{const e=await chrome.storage.local.get(["kanban_tabs"]),t=(e.kanban_tabs||[]).map((e,t)=>({id:e.id||`tab_${t}`,name:e.title||e.name||"Custom Tab",position:"number"==typeof e.position?e.position:t,visible:!0!==e.hidden,chatCount:e.chats?.length||0}));t.length>0&&await wg.saveTabs(t)}catch(e){}}},Eg="wa_agent_settings",Sg="wa_agent_active_services",Cg={enabled:!1,agentName:"",status:"offline",lastHeartbeat:0};class Tg{static getSettings(){try{const e=localStorage.getItem(Eg);if(e){const t=JSON.parse(e);return{...Cg,...t}}}catch(e){}return Cg}static saveSettings(e){try{const t={...this.getSettings(),...e};localStorage.setItem(Eg,JSON.stringify(t)),n().storage.local.set({[Eg]:t}).catch(e=>{}),window.dispatchEvent(new CustomEvent("agentSettingsChanged",{detail:t}))}catch(e){}}static isAgentMode(){const e=this.getSettings();return e.enabled&&!!e.agentName.trim()}static getAgentName(){return this.getSettings().agentName}static setAgentName(e){this.saveSettings({agentName:e})}static getStatus(){return this.getSettings().status}static setStatus(e){this.saveSettings({status:e})}static setEnabled(e){this.saveSettings({enabled:e,status:e?"online":"offline",lastHeartbeat:e?Date.now():0})}static updateHeartbeat(){this.saveSettings({lastHeartbeat:Date.now()})}static getActiveServices(){try{const e=localStorage.getItem(Sg);if(e)return JSON.parse(e)}catch(e){}return[]}static saveActiveServices(e){try{localStorage.setItem(Sg,JSON.stringify(e)),window.dispatchEvent(new CustomEvent("activeServicesChanged",{detail:e}))}catch(e){}}static addActiveService(e){const t=this.getActiveServices();t.find(t=>t.transferId===e.transferId)||(t.push(e),this.saveActiveServices(t))}static removeActiveService(e){const t=this.getActiveServices().filter(t=>t.transferId!==e);this.saveActiveServices(t)}static getActiveServiceForChat(e){return this.getActiveServices().find(t=>t.chatId===e)||null}static hasActiveServiceForChat(e){return null!==this.getActiveServiceForChat(e)}static getPriorityColor(e){switch(e){case"urgent":return ca.error;case"high":return ca.primary;case"medium":return ca.warning;case"low":return ca.success;default:return ca.textMuted}}static getPriorityLabel(e){switch(e){case"urgent":return"Urgent";case"high":return"High";case"medium":return"Medium";case"low":return"Low";default:return"Unknown"}}static clearAll(){try{localStorage.removeItem(Eg),localStorage.removeItem(Sg),n().storage.local.remove([Eg,Sg]).catch(e=>{}),window.dispatchEvent(new CustomEvent("agentSettingsChanged",{detail:Cg}))}catch(e){}}static syncToBackground(){try{const e=this.getSettings();e.enabled&&e.agentName&&(n().storage.local.set({[Eg]:e}).catch(e=>{}),n().runtime.sendMessage({type:"AGENT_SYNC",settings:e}).catch(()=>{}))}catch(e){}}}const Ag=({chatId:e,chatName:t,onClose:r,onTransfer:o})=>{const[i,l]=(0,a.useState)([]),[c,d]=(0,a.useState)(""),[m,p]=(0,a.useState)(""),[u,g]=(0,a.useState)("medium"),[h,b]=(0,a.useState)(!0),[f,v]=(0,a.useState)(!1),[y,x]=(0,a.useState)(null),[w,k]=(0,a.useState)("");(0,a.useEffect)(()=>{E()},[]);const E=async()=>{b(!0),x(null);try{const e=Tg.getAgentName();if(k(e),!e)return x((0,s.t)("agent.notRegistered")||"Agent not registered. Please enable agent mode first."),void b(!1);const t=await n().runtime.sendMessage({type:"AGENT_LIST_ONLINE",includeBusy:!0,agentName:e});t.success&&t.agents?(l(t.agents),0===t.agents.length&&x((0,s.t)("agent.noAgentsOnline")||"No agents online")):x(t.error||"Failed to fetch agents")}catch(e){x(e.message||"Network error")}finally{b(!1)}},S=e=>{switch(e){case"urgent":return ca.error;case"high":return ca.primary;case"medium":return ca.warning;case"low":return ca.success;default:return ca.textMuted}};return a.createElement(a.Fragment,null,a.createElement("style",null,"\n        .transfer-modal-backdrop {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.7);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 999999;\n        }\n        .transfer-modal {\n          background: #111b21;\n          border: 1px solid #2a3942;\n          border-radius: 12px;\n          padding: 20px;\n          width: 400px;\n          max-width: 90vw;\n          max-height: 80vh;\n          overflow-y: auto;\n          box-shadow: 0 8px 32px rgba(0,0,0,0.5);\n        }\n        .transfer-modal-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          margin-bottom: 20px;\n        }\n        .transfer-modal-title {\n          color: #e9edef;\n          font-size: 18px;\n          font-weight: 600;\n          display: flex;\n          align-items: center;\n          gap: 10px;\n        }\n        .transfer-modal-close {\n          background: none;\n          border: none;\n          color: #8696a0;\n          cursor: pointer;\n          padding: 4px;\n          border-radius: 4px;\n        }\n        .transfer-modal-close:hover {\n          background: rgba(255,255,255,0.1);\n          color: #e9edef;\n        }\n        .transfer-chat-info {\n          background: #202c33;\n          padding: 12px;\n          border-radius: 8px;\n          margin-bottom: 16px;\n        }\n        .transfer-chat-label {\n          color: #8696a0;\n          font-size: 11px;\n          text-transform: uppercase;\n          margin-bottom: 4px;\n        }\n        .transfer-chat-name {\n          color: #e9edef;\n          font-size: 14px;\n          font-weight: 500;\n        }\n        .transfer-form-group {\n          margin-bottom: 16px;\n        }\n        .transfer-form-label {\n          display: block;\n          color: #8696a0;\n          font-size: 12px;\n          margin-bottom: 8px;\n        }\n        .transfer-select {\n          width: 100%;\n          padding: 10px 12px;\n          background: #2a3942;\n          border: 1px solid #3b4a54;\n          border-radius: 8px;\n          color: #e9edef;\n          font-size: 14px;\n          outline: none;\n          cursor: pointer;\n        }\n        .transfer-select:focus {\n          border-color: var(--lion-primary);\n        }\n        .transfer-select option {\n          background: #2a3942;\n          color: #e9edef;\n        }\n        .transfer-textarea {\n          width: 100%;\n          padding: 10px 12px;\n          background: #2a3942;\n          border: 1px solid #3b4a54;\n          border-radius: 8px;\n          color: #e9edef;\n          font-size: 14px;\n          outline: none;\n          resize: vertical;\n          min-height: 80px;\n          font-family: inherit;\n        }\n        .transfer-textarea:focus {\n          border-color: var(--lion-primary);\n        }\n        .transfer-textarea::placeholder {\n          color: #8696a0;\n        }\n        .transfer-priority-options {\n          display: flex;\n          gap: 8px;\n          flex-wrap: wrap;\n        }\n        .transfer-priority-btn {\n          flex: 1;\n          min-width: 80px;\n          padding: 8px 12px;\n          background: #2a3942;\n          border: 2px solid transparent;\n          border-radius: 6px;\n          color: #8696a0;\n          font-size: 12px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s;\n          text-align: center;\n        }\n        .transfer-priority-btn:hover {\n          background: #3b4a54;\n        }\n        .transfer-priority-btn.selected {\n          border-color: currentColor;\n          color: inherit;\n        }\n        .transfer-error {\n          background: rgba(239, 68, 68, 0.1);\n          border: 1px solid #ef4444;\n          border-radius: 8px;\n          padding: 10px 12px;\n          color: #ef4444;\n          font-size: 13px;\n          margin-bottom: 16px;\n        }\n        .transfer-loading {\n          text-align: center;\n          padding: 40px 20px;\n          color: #8696a0;\n        }\n        .transfer-loading-spinner {\n          width: 32px;\n          height: 32px;\n          border: 3px solid #2a3942;\n          border-top-color: var(--lion-primary);\n          border-radius: 50%;\n          animation: transferSpin 1s linear infinite;\n          margin: 0 auto 16px;\n        }\n        @keyframes transferSpin {\n          to { transform: rotate(360deg); }\n        }\n        .transfer-actions {\n          display: flex;\n          gap: 12px;\n          margin-top: 20px;\n        }\n        .transfer-btn {\n          flex: 1;\n          padding: 12px 16px;\n          border: none;\n          border-radius: 8px;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n        .transfer-btn-cancel {\n          background: #2a3942;\n          color: #e9edef;\n        }\n        .transfer-btn-cancel:hover {\n          background: #3b4a54;\n        }\n        .transfer-btn-submit {\n          background: var(--lion-primary);\n          color: white;\n        }\n        .transfer-btn-submit:hover:not(:disabled) {\n          background: var(--lion-primary-hover);\n        }\n        .transfer-btn-submit:disabled {\n          opacity: 0.5;\n          cursor: not-allowed;\n        }\n        .agent-option-status {\n          display: inline-block;\n          width: 8px;\n          height: 8px;\n          border-radius: 50%;\n          margin-right: 6px;\n        }\n        .agent-option-status.online {\n          background: var(--lion-success);\n        }\n        .agent-option-status.busy {\n          background: var(--lion-warning);\n        }\n      "),a.createElement("div",{className:"transfer-modal-backdrop",onClick:r},a.createElement("div",{className:"transfer-modal",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"transfer-modal-header"},a.createElement("div",{className:"transfer-modal-title"},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--lion-primary)",strokeWidth:"2"},a.createElement("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"})),(0,s.t)("agent.transferToAgent")||"Transfer to Agent"),a.createElement("button",{className:"transfer-modal-close",onClick:r},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 6L6 18M6 6l12 12"})))),a.createElement("div",{className:"transfer-chat-info"},a.createElement("div",{className:"transfer-chat-label"},(0,s.t)("agent.chat")||"Chat"),a.createElement("div",{className:"transfer-chat-name"},t||e)),h?a.createElement("div",{className:"transfer-loading"},a.createElement("div",{className:"transfer-loading-spinner"}),a.createElement("div",null,(0,s.t)("crm.loading")||"Loading...")):a.createElement(a.Fragment,null,y&&a.createElement("div",{className:"transfer-error"},y),a.createElement("div",{className:"transfer-form-group"},a.createElement("label",{className:"transfer-form-label"},(0,s.t)("agent.selectAgent")||"Select Agent"," *"),a.createElement("select",{className:"transfer-select",value:c,onChange:e=>d(e.target.value)},a.createElement("option",{value:""},(0,s.t)("agent.chooseAgent")||"-- Choose an Agent --"),i.map(e=>a.createElement("option",{key:e.agent_name,value:e.agent_name},e.agent_name," (","online"===e.status?"🟢":"🟡"," ",e.status,") - ",e.available_slots," slots")))),a.createElement("div",{className:"transfer-form-group"},a.createElement("label",{className:"transfer-form-label"},(0,s.t)("agent.reason")||"Reason"),a.createElement("textarea",{className:"transfer-textarea",placeholder:(0,s.t)("agent.reasonPlaceholder")||"Why are you transferring this chat?",value:m,onChange:e=>p(e.target.value),maxLength:500})),a.createElement("div",{className:"transfer-form-group"},a.createElement("label",{className:"transfer-form-label"},(0,s.t)("agent.priority")||"Priority"),a.createElement("div",{className:"transfer-priority-options"},["low","medium","high","urgent"].map(e=>a.createElement("button",{key:e,type:"button",className:"transfer-priority-btn "+(u===e?"selected":""),style:{color:u===e?S(e):void 0},onClick:()=>g(e)},(0,s.t)(`agent.priority${e.charAt(0).toUpperCase()+e.slice(1)}`)||e.charAt(0).toUpperCase()+e.slice(1))))),a.createElement("div",{className:"transfer-actions"},a.createElement("button",{className:"transfer-btn transfer-btn-cancel",onClick:r,disabled:f},(0,s.t)("crm.cancel")||"Cancel"),a.createElement("button",{className:"transfer-btn transfer-btn-submit",onClick:async()=>{if(c)if(w){v(!0),x(null);try{const a=await n().runtime.sendMessage({type:"TRANSFER_CREATE",agentName:w,data:{chatId:e,chatName:t,toAgentName:c,reason:m,priority:u}});a.success?(window.postMessage({type:"PIN_CHAT",chatId:e},"*"),o(!0,(0,s.t)("agent.transferSuccess")||"Chat transferred successfully"),r()):x(a.error||"Transfer failed")}catch(e){x(e.message||"Network error")}finally{v(!1)}}else x((0,s.t)("agent.notRegistered")||"Agent not registered");else x((0,s.t)("agent.selectAgent")||"Please select an agent")},disabled:!c||f||0===i.length},f?a.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"}},a.createElement("span",{className:"transfer-loading-spinner",style:{width:"16px",height:"16px",margin:0}}),(0,s.t)("crm.loading")||"Loading..."):(0,s.t)("agent.transfer")||"Transfer"))))))},Dg=[{id:"event_details",label:"Event Details",enabled:!0},{id:"number",label:"Number",enabled:!0},{id:"name",label:"Name",enabled:!0},{id:"email",label:"Email",enabled:!0},{id:"gender",label:"Gender",enabled:!1},{id:"date_of_birth",label:"Date of Birth",enabled:!1},{id:"address",label:"Address",enabled:!1},{id:"details",label:"Details",enabled:!1},{id:"custom_fields",label:"Custom Fields",enabled:!0}],_g=async(e,t,n,a)=>{try{const r=localStorage.getItem("webhook_settings");if(!r)return;const o=JSON.parse(r).contact_profile;if(!o||!o.active||!o.url)return;const i={};(o.dataFields&&o.dataFields.length>0?o.dataFields:Dg).forEach(a=>{if(a.enabled)switch(a.id){case"event_details":i.event={type:"contact_profile",action:e,timestamp:Date.now()};break;case"number":i.number=t.id.split("@")[0];break;case"name":i.name=n.name||t.profile.name;break;case"email":i.email=n.email||null;break;case"gender":i.gender=n.gender||null;break;case"date_of_birth":i.dateOfBirth=n.dateOfBirth||null;break;case"address":i.address=n.address||null;break;case"details":i.details=n.details||null;break;case"custom_fields":i.customFields=t.profile.customFields||[]}}),i.profile={name:n.name||t.profile.name,phone:t.profile.phone,email:n.email||null,gender:n.gender||null,dateOfBirth:n.dateOfBirth||null,address:n.address||null,details:n.details||null,language:n.language||null,customFields:t.profile.customFields||[]},a&&(i.customFieldAction=a),"undefined"!=typeof chrome&&chrome.runtime&&chrome.runtime.sendMessage({type:"SEND_WEBHOOK",url:o.url,payload:i,eventType:"contact_profile"})}catch(e){}},Ng=({contact:e,onUpdate:t})=>{const[r,o]=(0,a.useState)(!1),[i,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(""),[m,p]=(0,a.useState)(""),[,u]=(0,a.useState)(0),[g,h]=(0,a.useState)(!1),[b,f]=(0,a.useState)(null),[y,x]=(0,a.useState)(!1),[w,k]=(0,a.useState)(null),[E,S]=(0,a.useState)(!1),[C,T]=(0,a.useState)(e.profile.aiBotBlacklisted||!1),[D,N]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{const e=()=>{const e=_();N("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]),(0,a.useEffect)(()=>{T(e.profile.aiBotBlacklisted||!1)},[e.id,e.profile.aiBotBlacklisted]),(0,a.useEffect)(()=>{x(Tg.isAgentMode());const e=()=>{x(Tg.isAgentMode())};return window.addEventListener("agentSettingsChanged",e),()=>window.removeEventListener("agentSettingsChanged",e)},[]),(0,a.useEffect)(()=>{const t=t=>{if("INCOMING_TRANSFERS"===t.type){const n=(t.activeServices||[]).find(t=>t.chat_id===e.id);k(n?.id||null)}};return n().runtime.onMessage.addListener(t),()=>n().runtime.onMessage.removeListener(t)},[e.id]),(0,a.useEffect)(()=>{const e=()=>{u(e=>e+1)};return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{if(e.id.includes("@lid")){const n=e.profile.phone||"";if(n.length>13&&!n.match(/^\+?(1|7|20|27|30|31|32|33|34|36|39|40|41|43|44|45|46|47|48|49|51|52|53|54|55|56|57|58|60|61|62|63|64|65|66|81|82|84|86|90|91|92|93|94|95|98)/)||!n){const a=`resolve_phone_crm_${Date.now()}`,r=setTimeout(()=>{window.removeEventListener("message",o)},5e3),o=i=>{if("RESOLVE_PHONE_FROM_ID_RESPONSE"===i.data?.type&&i.data?.requestId===a){clearTimeout(r),window.removeEventListener("message",o);const a=i.data.phone;a&&a!==n&&a.length<=16&&(v.updateProfile(e.id,{phone:a}),t())}};window.addEventListener("message",o),window.postMessage({type:"RESOLVE_PHONE_FROM_ID",contactId:e.id,requestId:a},"*")}}},[e.id]);const[M,R]=(0,a.useState)({name:e.profile.name,email:e.profile.email,gender:e.profile.gender,dateOfBirth:e.profile.dateOfBirth,details:e.profile.details,address:e.profile.address,language:e.profile.language||"Portuguese"});(0,a.useEffect)(()=>{const n=n=>{n.detail.contactId===e.id&&(R(e=>({...e,language:n.detail.language})),t())};return window.addEventListener("crm-language-changed",n),()=>window.removeEventListener("crm-language-changed",n)},[e.id,t]);const B=["",...Kn.map(e=>e.name)],P=[{value:"",label:(0,s.t)("crm.select")},{value:"Male",label:(0,s.t)("crm.male")},{value:"Female",label:(0,s.t)("crm.female")},{value:"Other",label:(0,s.t)("crm.other")}],L=[{label:(0,s.t)("crm.fullName"),key:"name",value:e.profile.name},{label:(0,s.t)("crm.phoneNumber"),key:"phone",value:e.profile.phone,readOnly:!0},{label:(0,s.t)("crm.email"),key:"email",value:e.profile.email},{label:(0,s.t)("crm.gender"),key:"gender",value:e.profile.gender,type:"select",options:P},{label:(0,s.t)("crm.dateOfBirth"),key:"dateOfBirth",value:e.profile.dateOfBirth,type:"date"},{label:(0,s.t)("crm.details"),key:"details",value:e.profile.details,type:"textarea"},{label:(0,s.t)("crm.address"),key:"address",value:e.profile.address,type:"textarea"},{label:(0,s.t)("crm.language"),key:"language",value:e.profile.language||"Portuguese",type:"select",options:B.map(e=>({value:e,label:e||(0,s.t)("crm.select")}))}];return a.createElement("div",{className:"crm-profile-tab "+(D?"lion-dark":"")},a.createElement("div",{className:"crm-section-header"},a.createElement("h4",{className:"crm-section-title"},(0,s.t)("crm.userDetails")),a.createElement("div",{className:"crm-section-actions"},a.createElement("button",{className:"crm-btn crm-btn-link",onClick:()=>l(!0)},(0,s.t)("crm.addCustomAttribute")),r?a.createElement(a.Fragment,null,a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>{R({name:e.profile.name,email:e.profile.email,gender:e.profile.gender,dateOfBirth:e.profile.dateOfBirth,details:e.profile.details,address:e.profile.address,language:e.profile.language||"Portuguese"}),o(!1)}},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:()=>{v.updateProfile(e.id,M),_g("updated",e,M),o(!1),t()}},(0,s.t)("crm.save"))):a.createElement("button",{className:"crm-btn crm-btn-link",onClick:()=>o(!0)},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"})),(0,s.t)("crm.edit")))),a.createElement("div",{className:"crm-profile-fields"},L.map(e=>a.createElement("div",{key:e.key,className:"crm-profile-field"},a.createElement("div",{className:"crm-profile-field-label"},e.label),r&&!e.readOnly?"select"===e.type?a.createElement("select",{className:"crm-form-select",value:M[e.key]||"",onChange:t=>R({...M,[e.key]:t.target.value})},e.options?.map(e=>a.createElement("option",{key:e.value,value:e.value},e.label))):"textarea"===e.type?a.createElement("textarea",{className:"crm-form-textarea",value:M[e.key]||"",onChange:t=>R({...M,[e.key]:t.target.value}),rows:2}):"date"===e.type?a.createElement("input",{type:"date",className:"crm-form-input",value:M[e.key]||"",onChange:t=>R({...M,[e.key]:t.target.value})}):a.createElement("input",{type:"text",className:"crm-form-input",value:M[e.key]||"",onChange:t=>R({...M,[e.key]:t.target.value})}):a.createElement("div",{className:"crm-profile-field-value"},e.value||"-"))),Gn.isEnabled()&&Sr.isEnabled()&&a.createElement("div",{className:"crm-profile-field crm-aibot-toggle"},a.createElement("div",{className:"crm-profile-field-label"},(0,s.t)("crm.aiBotBlacklist")||"AI Bot"),a.createElement("div",{className:"crm-profile-field-value",style:{display:"flex",alignItems:"center",gap:"12px"}},a.createElement("button",{onClick:()=>{const n=!C;T(n),v.setAIBotBlacklisted(e.id,n),t()},style:{width:"44px",height:"24px",borderRadius:"12px",border:"none",backgroundColor:C?ca.borderLight:"var(--lion-primary)",cursor:"pointer",position:"relative",transition:"background-color 0.3s ease"}},a.createElement("span",{style:{position:"absolute",top:"2px",left:C?"2px":"22px",width:"20px",height:"20px",borderRadius:"10px",backgroundColor:"#fff",transition:"left 0.3s ease",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})),a.createElement("span",{style:{fontSize:"13px",color:C?ca.error:ca.success,transition:"color 0.3s ease"}},C?(0,s.t)("crm.aiBotDisabled")||"Disabled for this contact":(0,s.t)("crm.aiBotEnabled")||"Enabled for this contact"))),e.profile.customFields.map(n=>a.createElement("div",{key:n.id,className:"crm-profile-field crm-custom-field"},a.createElement("div",{className:"crm-profile-field-label"},n.label,r&&a.createElement("button",{className:"crm-delete-field-btn",onClick:()=>(n=>{if(confirm((0,s.t)("crm.deleteFieldConfirm"))){const a=e.profile.customFields.find(e=>e.id===n);v.deleteCustomField(e.id,n),a&&_g("custom_field_deleted",e,e.profile,{fieldId:n,label:a.label,value:a.value}),t()}})(n.id),title:"Delete field"},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})))),r?a.createElement("input",{type:"text",className:"crm-form-input",value:n.value,onChange:a=>((n,a)=>{const r=e.profile.customFields.find(e=>e.id===n);v.updateCustomField(e.id,n,{value:a}),r&&_g("custom_field_updated",e,e.profile,{fieldId:n,label:r.label,value:a}),t()})(n.id,a.target.value)}):a.createElement("div",{className:"crm-profile-field-value"},n.value||"-")))),y&&a.createElement("div",{className:"crm-transfer-section"},b&&a.createElement("div",{className:`crm-transfer-message ${b.type}`},b.text),w?a.createElement("button",{className:"crm-btn crm-btn-end-service",onClick:async()=>{S(!0);try{const t=await n().runtime.sendMessage({type:"TRANSFER_END_SERVICE",transferId:w,chatId:e.id});t.success?(window.postMessage({type:"UNPIN_CHAT",chatId:e.id},"*"),f({type:"success",text:(0,s.t)("agent.serviceEnded")||"Service ended successfully"}),k(null)):f({type:"error",text:t.error||"Failed to end service"})}catch(e){f({type:"error",text:e.message||"Error ending service"})}finally{S(!1),setTimeout(()=>f(null),5e3)}},disabled:E},E?a.createElement("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},a.createElement("span",{className:"crm-spinner"}),(0,s.t)("crm.loading")||"Loading..."):a.createElement(a.Fragment,null,a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),a.createElement("polyline",{points:"22 4 12 14.01 9 11.01"})),(0,s.t)("agent.endService")||"End Service")):a.createElement("button",{className:"crm-btn crm-btn-transfer",onClick:()=>h(!0)},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"})),(0,s.t)("agent.transferToAgent")||"Transfer to Agent")),g&&a.createElement(Ag,{chatId:e.id,chatName:e.profile.name||e.profile.phone,onClose:()=>h(!1),onTransfer:(e,t)=>{f({type:e?"success":"error",text:t}),setTimeout(()=>f(null),5e3)}}),i&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>l(!1)}),a.createElement("div",{className:"crm-sub-modal"},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h3",{className:"crm-sub-modal-title"},(0,s.t)("crm.addField")),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>l(!1)},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"crm-sub-modal-body"},a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.fieldLabel")),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.fieldLabel"),value:c,onChange:e=>d(e.target.value),autoFocus:!0})),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.fieldValue")),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.fieldValue"),value:m,onChange:e=>p(e.target.value)}))),a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>l(!1)},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:()=>{c.trim()&&(v.addCustomField(e.id,c.trim(),m.trim()),_g("custom_field_added",e,e.profile,{label:c.trim(),value:m.trim()}),d(""),p(""),l(!1),t())},disabled:!c.trim()},(0,s.t)("common.add"))))),a.createElement("style",null,`\n        ${ma}\n\n        .crm-profile-fields {\n          display: flex;\n          flex-direction: column;\n          gap: 0;\n        }\n\n        .crm-profile-field {\n          padding: 16px 0;\n          border-bottom: 1px solid var(--lion-bg-tertiary);\n        }\n\n        .crm-profile-field:last-child {\n          border-bottom: none;\n        }\n\n        .crm-profile-field-label {\n          font-size: 13px;\n          color: var(--lion-text-muted);\n          margin-bottom: 4px;\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .crm-profile-field-value {\n          font-size: 15px;\n          color: var(--lion-text-primary);\n          font-weight: 500;\n        }\n\n        .crm-custom-field {\n          background: var(--lion-primary-light);\n          margin: 0 -20px;\n          padding: 16px 20px;\n        }\n\n        .crm-delete-field-btn {\n          background: transparent;\n          border: none;\n          color: var(--lion-error);\n          cursor: pointer;\n          padding: 2px;\n          border-radius: 4px;\n          display: flex;\n          align-items: center;\n          opacity: 0.7;\n          transition: all 0.2s;\n        }\n\n        .crm-delete-field-btn:hover {\n          opacity: 1;\n          background: var(--lion-error-light);\n        }\n\n        /* Transfer to Agent Section */\n        .crm-transfer-section {\n          margin-top: 20px;\n          padding: 16px 0;\n          border-top: 1px solid var(--lion-bg-tertiary);\n        }\n\n        .crm-btn-transfer {\n          width: 100%;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 10px;\n          padding: 14px 20px;\n          background: var(--lion-primary);\n          border: none;\n          border-radius: 10px;\n          color: white;\n          font-size: 15px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.3);\n        }\n\n        .crm-btn-transfer:hover {\n          background: linear-gradient(135deg, var(--lion-primary-hover) 0%, #dc2626 100%);\n          transform: translateY(-1px);\n          box-shadow: 0 6px 16px rgba(var(--lion-primary-rgb), 0.4);\n        }\n\n        .crm-btn-transfer:active {\n          transform: translateY(0);\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.3);\n        }\n\n        .crm-btn-end-service {\n          width: 100%;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 10px;\n          padding: 14px 20px;\n          background: linear-gradient(135deg, var(--lion-success) 0%, #059669 100%);\n          border: none;\n          border-radius: 10px;\n          color: white;\n          font-size: 15px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n          box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);\n        }\n\n        .crm-btn-end-service:hover {\n          background: linear-gradient(135deg, #059669 0%, #047857 100%);\n          transform: translateY(-1px);\n          box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);\n        }\n\n        .crm-btn-end-service:active {\n          transform: translateY(0);\n          box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);\n        }\n\n        .crm-btn-end-service:disabled {\n          opacity: 0.6;\n          cursor: not-allowed;\n          transform: none;\n        }\n\n        .crm-spinner {\n          width: 16px;\n          height: 16px;\n          border: 2px solid rgba(255,255,255,0.3);\n          border-top-color: white;\n          border-radius: 50%;\n          animation: crm-spin 1s linear infinite;\n        }\n\n        @keyframes crm-spin {\n          to { transform: rotate(360deg); }\n        }\n\n        .crm-transfer-message {\n          padding: 12px 16px;\n          border-radius: 8px;\n          font-size: 13px;\n          margin-bottom: 12px;\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .crm-transfer-message.success {\n          background: var(--lion-success-light);\n          border: 1px solid var(--lion-success);\n          color: var(--lion-success);\n        }\n\n        .crm-transfer-message.error {\n          background: var(--lion-error-light);\n          border: 1px solid var(--lion-error);\n          color: var(--lion-error);\n        }\n\n        /* ========== DARK MODE OVERRIDES ========== */\n        .crm-profile-tab.lion-dark .crm-section-title {\n          color: #ffffff !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-profile-field-label {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-profile-field-value {\n          color: #ffffff !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-form-input,\n        .crm-profile-tab.lion-dark .crm-form-select,\n        .crm-profile-tab.lion-dark .crm-form-textarea {\n          background: var(--lion-bg-secondary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-form-input::placeholder,\n        .crm-profile-tab.lion-dark .crm-form-textarea::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-custom-field {\n          background: rgba(6, 78, 168, 0.15) !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-sub-modal {\n          background: var(--lion-bg-primary) !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-sub-modal-header {\n          border-bottom-color: var(--lion-border-light) !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-sub-modal-title {\n          color: #ffffff !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-sub-modal-close {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-sub-modal-close:hover {\n          color: #ffffff !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-form-label {\n          color: #e0e0e0 !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-sub-modal-footer {\n          border-top-color: var(--lion-border-light) !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-btn-secondary {\n          background: var(--lion-bg-tertiary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-btn-link {\n          color: #ffffff !important;\n          background: rgba(var(--lion-primary-rgb), 0.2) !important;\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.4) !important;\n          border-radius: 6px !important;\n          padding: 6px 12px !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-btn-link:hover {\n          background: rgba(var(--lion-primary-rgb), 0.35) !important;\n          border-color: rgba(var(--lion-primary-rgb), 0.6) !important;\n        }\n\n        .crm-profile-tab.lion-dark .crm-form-select option {\n          background: #1a1a1a !important;\n          color: #ffffff !important;\n        }\n      `))};const Mg=e=>{const[,t]=(0,a.useState)(0);(0,a.useEffect)(()=>{const n=()=>{t(e=>e+1),e?.()};return window.addEventListener("languageChanged",n),()=>window.removeEventListener("languageChanged",n)},[e])},Ig=e=>{try{const t=localStorage.getItem("webhook_settings");if(!t)return null;const n=JSON.parse(t)[e];return n&&n.active&&n.url?n:null}catch(e){return null}},Rg=(e,t,n)=>{try{"undefined"!=typeof chrome&&chrome.runtime&&chrome.runtime.sendMessage({type:"SEND_WEBHOOK",url:e,payload:t,eventType:n})}catch(e){}},Bg=(e,t,n)=>e&&e.profile?{fullName:e.profile.name||t||null,phone:e.profile.phone||n||null,email:e.profile.email||null,gender:e.profile.gender||null,dateOfBirth:e.profile.dateOfBirth||null,details:e.profile.details||null,address:e.profile.address||null,language:e.profile.language||null,customFields:e.profile.customFields||[]}:{fullName:t||null,phone:n||null,email:null,gender:null,dateOfBirth:null,details:null,address:null,language:null,customFields:[]},Pg=(e,t)=>e.dataFields&&e.dataFields.length>0?e.dataFields:t,Lg=[{id:"event_details",label:"Event Details",enabled:!0},{id:"number",label:"Number",enabled:!0},{id:"name",label:"Name",enabled:!0},{id:"label_id",label:"Label ID",enabled:!0},{id:"label_name",label:"Label Name",enabled:!0},{id:"label_color",label:"Label Color",enabled:!1},{id:"all_labels",label:"All Contact Labels",enabled:!1},{id:"contact_profile",label:"Contact Profile",enabled:!1}],Ug=[{id:"event_details",label:"Event Details",enabled:!0},{id:"number",label:"Number",enabled:!0},{id:"name",label:"Name",enabled:!0},{id:"tab_id",label:"Tab ID",enabled:!0},{id:"tab_name",label:"Tab Name",enabled:!0},{id:"tab_color",label:"Tab Color",enabled:!1},{id:"all_tabs",label:"All Contact Tabs",enabled:!1},{id:"contact_profile",label:"Contact Profile",enabled:!1}],Fg=[{id:"event_details",label:"Event Details",enabled:!0},{id:"number",label:"Number",enabled:!0},{id:"name",label:"Name",enabled:!0},{id:"stage_id",label:"Stage ID",enabled:!0},{id:"stage_name",label:"Stage Name",enabled:!0},{id:"previous_stage",label:"Previous Stage",enabled:!1},{id:"contact_profile",label:"Contact Profile",enabled:!1}],zg=async(e,t,n,a)=>{try{const r=Ig("custom_tabs");if(!r)return;const o=Pg(r,Ug),i={tab:{id:n.tabId,name:n.tabName,color:n.tabColor||null}},s=d.TabsStorage.getTabs();o.forEach(r=>{if(r.enabled)switch(r.id){case"event_details":i.event={type:"custom_tabs",action:e,timestamp:Date.now()};break;case"number":i.number=t.id.split("@")[0];break;case"name":i.name=t.name;break;case"tab_id":i.tabId=n.tabId;break;case"tab_name":i.tabName=n.tabName;break;case"tab_color":i.tabColor=n.tabColor||null;break;case"all_tabs":const r=s.filter(e=>e.chats?.some(e=>e.id===t.id));i.allTabs=r.map(e=>({id:e.id,name:e.title,color:e.labelColor||null}));break;case"contact_profile":i.contactProfile=Bg(a,t.name,t.id.split("@")[0])}}),Rg(r.url,i,"custom_tabs")}catch(e){}},Og=({contact:e,onUpdate:t})=>{const[n,r]=(0,a.useState)([]),[o,i]=(0,a.useState)(!1),[l,c]=(0,a.useState)(!1),[m,p]=(0,a.useState)(""),[u,g]=(0,a.useState)("");Mg(),(0,a.useEffect)(()=>{h()},[]);const h=()=>{const e=d.TabsStorage.getTabs();r(e.filter(e=>!e.isPermanent))},b=()=>d.TabsStorage.getTabs().filter(t=>{const n=(t.chats||[]).some(t=>t.id===e.id),a=e.tabs.includes(t.id);return n||a}),f=b(),y=(()=>{const e=b().map(e=>e.id);return n.filter(t=>!e.includes(t.id))})();return a.createElement("div",{className:"crm-tabs-tab"},a.createElement("div",{className:"crm-tabs-header"},a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:()=>c(!0)},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),(0,s.t)("crm.createTab")),a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>i(!0),disabled:0===y.length},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h10v4h8v10z"})),(0,s.t)("crm.addToTab"))),a.createElement("div",{className:"crm-section-title-bar"},a.createElement("h4",null,(0,s.t)("crm.contactTabs"))),a.createElement("div",{className:"crm-table-header"},a.createElement("div",{className:"crm-table-header-cell",style:{flex:1}},(0,s.t)("crm.tableTabName")),a.createElement("div",{className:"crm-table-header-cell",style:{flex:1}},(0,s.t)("crm.tableContactsInTab")),a.createElement("div",{className:"crm-table-header-cell",style:{width:80,textAlign:"center"}},(0,s.t)("crm.tableAction"))),f.length>0?a.createElement("div",{className:"crm-table-body"},f.map(n=>a.createElement("div",{key:n.id,className:"crm-table-row"},a.createElement("div",{className:"crm-table-cell",style:{flex:1}},a.createElement("div",{className:"crm-tab-name"},a.createElement("span",{className:"crm-tab-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h10v4h8v10z"}))),n.title)),a.createElement("div",{className:"crm-table-cell",style:{flex:1,color:ca.textMuted}},(n.chats||[]).length," ",(0,s.t)("crm.contacts")),a.createElement("div",{className:"crm-table-cell",style:{width:80,textAlign:"center"}},!n.isPermanent&&a.createElement("button",{className:"crm-action-btn crm-action-delete",onClick:()=>(n=>{if(confirm((0,s.t)("crm.confirmRemoveFromTab","Remove contact from this tab?"))){const a=d.TabsStorage.getTab(n);if(v.removeContactFromTab(e.id,n),a){const t=(a.chats||[]).filter(t=>t.id!==e.id);d.TabsStorage.updateTab(n,{chats:t}),zg("tab_removed",{id:e.id,name:e.profile.name},{tabId:a.id,tabName:a.title,tabColor:a.labelColor},e),window.postMessage({type:"WA_TAB_CHANGED_FOR_FOLLOWUP",chatId:e.id,tabId:a.id,action:"remove"},"*"),document.dispatchEvent(new CustomEvent("waTabChanged",{detail:{chatId:e.id,tabId:a.id,action:"remove"}}))}t(),h()}})(n.id),title:"Remove from tab"},a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}))))))):a.createElement("div",{className:"crm-empty-state"},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14zM9 8h6v2H9zm0 4h6v2H9z"})),a.createElement("div",{className:"crm-empty-state-text"},(0,s.t)("crm.noTabs"))),l&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>c(!1)}),a.createElement("div",{className:"crm-sub-modal"},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h3",{className:"crm-sub-modal-title"},(0,s.t)("crm.createTab")),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>c(!1)},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"crm-sub-modal-body"},a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.tabName")),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.tabName"),value:u,onChange:e=>g(e.target.value),autoFocus:!0}))),a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>c(!1)},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:()=>{if(u.trim()){const n=d.TabsStorage.addTab({title:u.trim(),details:"",chats:[{id:e.id,name:e.profile.name,type:"individual"}],isPermanent:!1});v.addContactToTab(e.id,n.id),zg("tab_created",{id:e.id,name:e.profile.name},{tabId:n.id,tabName:n.title,tabColor:n.labelColor},e),window.postMessage({type:"WA_TAB_CHANGED_FOR_FOLLOWUP",chatId:e.id,tabId:n.id,action:"add"},"*"),document.dispatchEvent(new CustomEvent("waTabChanged",{detail:{chatId:e.id,tabId:n.id,action:"add"}})),g(""),c(!1),t(),h()}},disabled:!u.trim()},(0,s.t)("crm.createTab"))))),o&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>i(!1)}),a.createElement("div",{className:"crm-sub-modal"},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h3",{className:"crm-sub-modal-title"},(0,s.t)("crm.addToTab")),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>i(!1)},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"crm-sub-modal-body"},y.length>0?a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.tabName")),a.createElement("select",{className:"crm-form-select",value:m,onChange:e=>p(e.target.value)},a.createElement("option",{value:""},(0,s.t)("crm.select")),y.map(e=>a.createElement("option",{key:e.id,value:e.id},e.title," (",(e.chats||[]).length," ",(0,s.t)("crm.contacts"),")")))):a.createElement("div",{className:"crm-empty-state",style:{padding:"30px"}},a.createElement("p",{style:{color:ca.textMuted}},(0,s.t)("crm.noTabs")),a.createElement("button",{className:"crm-btn crm-btn-primary",style:{marginTop:"16px"},onClick:()=>{i(!1),c(!0)}},(0,s.t)("crm.createTab")))),y.length>0&&a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>i(!1)},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:()=>{if(m){v.addContactToTab(e.id,m);const n=d.TabsStorage.getTab(m);if(n){const t=n.chats||[];if(!t.some(t=>t.id===e.id)){const n={id:e.id,name:e.profile.name,type:"individual"},a=[...t,n];d.TabsStorage.updateTab(m,{chats:a})}zg("tab_added",{id:e.id,name:e.profile.name},{tabId:n.id,tabName:n.title,tabColor:n.labelColor},e),window.postMessage({type:"WA_TAB_CHANGED_FOR_FOLLOWUP",chatId:e.id,tabId:n.id,action:"add"},"*");const a=new CustomEvent("waTabChanged",{detail:{chatId:e.id,tabId:n.id,action:"add"}});document.dispatchEvent(a)}p(""),i(!1),t(),h()}},disabled:!m},(0,s.t)("crm.addToTab"))))),a.createElement("style",null,`\n        ${ma}\n\n        .crm-tabs-header {\n          display: flex;\n          gap: 12px;\n          margin-bottom: 24px;\n        }\n\n        .crm-section-title-bar {\n          margin-bottom: 16px;\n        }\n\n        .crm-section-title-bar h4 {\n          margin: 0;\n          font-size: 15px;\n          font-weight: 600;\n          color: var(--lion-text-secondary);\n        }\n\n        .crm-tabs-tab .crm-table-body {\n          border: 1px solid var(--lion-border-light);\n          border-radius: 10px;\n          overflow: hidden;\n        }\n\n        .crm-tab-name {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          font-weight: 500;\n        }\n\n        .crm-tab-icon {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          color: var(--lion-primary);\n        }\n\n        .crm-action-btn {\n          background: transparent;\n          border: none;\n          padding: 8px;\n          border-radius: 8px;\n          cursor: pointer;\n          transition: all 0.2s;\n          display: inline-flex;\n          align-items: center;\n          justify-content: center;\n        }\n\n        .crm-action-delete {\n          color: var(--lion-error);\n        }\n\n        .crm-action-delete:hover {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n        }\n\n        .crm-info-box {\n          display: flex;\n          align-items: flex-start;\n          gap: 12px;\n          padding: 16px;\n          background: var(--lion-info-light);\n          border-radius: 10px;\n          color: var(--lion-info);\n          font-size: 14px;\n          line-height: 1.5;\n        }\n\n        .crm-info-box svg {\n          flex-shrink: 0;\n          margin-top: 2px;\n        }\n      `))};const Wg=()=>{const[e,t]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});return(0,a.useEffect)(()=>{const e=()=>{const e=_();t("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]),e},qg=async(e,t,n)=>{try{const a=Ig("notes");if(!a)return;const r={};(a.dataFields||[]).forEach(a=>{if(a.enabled)switch(a.id){case"event_details":r.event={type:"notes",action:e,timestamp:Date.now()};break;case"number":r.number=t.id.split("@")[0];break;case"name":r.name=t.profile.name;break;case"note_topic":r.noteTopic=n.topic;break;case"note_content":const a=n.content.replace(/<[^>]*>/g,"");r.noteContent=a,r.noteContentHtml=n.content;break;case"note_timestamp":r.noteCreatedAt=n.createdAt||Date.now(),r.noteUpdatedAt=n.updatedAt||Date.now();break;case"contact_profile":r.contactProfile={fullName:t.profile.name||null,phone:t.profile.phone||null,email:t.profile.email||null,gender:t.profile.gender||null,dateOfBirth:t.profile.dateOfBirth||null,details:t.profile.details||null,address:t.profile.address||null}}}),r.note={id:n.id||null,topic:n.topic,content:n.content.replace(/<[^>]*>/g,""),contentHtml:n.content,createdAt:n.createdAt||Date.now(),updatedAt:n.updatedAt||Date.now()},Rg(a.url,r,"notes")}catch(e){}},Hg=({contact:e,onUpdate:t})=>{const[n,r]=(0,a.useState)(!1),[o,i]=(0,a.useState)(null),[l,c]=(0,a.useState)(""),[d,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(""),g=(0,a.useRef)(null);Mg();const h=Wg();(0,a.useEffect)(()=>{const n=n=>{n.detail?.contactId!==e.id&&n.detail?.contactId||t()};return document.addEventListener("wa-crm-contact-updated",n),document.addEventListener("wa-crm-data-synced",n),()=>{document.removeEventListener("wa-crm-contact-updated",n),document.removeEventListener("wa-crm-data-synced",n)}},[e.id,t]);const b=(e,t)=>{document.execCommand(e,!1,t),g.current?.focus()},f=e.notes.filter(e=>e.topic.toLowerCase().includes(l.toLowerCase())||e.content.toLowerCase().includes(l.toLowerCase()));return a.createElement("div",{className:"crm-notes-tab "+(h?"lion-dark":"")},a.createElement("div",{className:"crm-notes-header"},a.createElement("div",{className:"crm-search-box"},a.createElement("svg",{className:"crm-search-icon",viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),a.createElement("input",{type:"text",className:"crm-search-input",placeholder:(0,s.t)("crm.searchNotes"),value:l,onChange:e=>c(e.target.value)})),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:()=>{m(""),u(""),g.current&&(g.current.innerHTML=""),i(null),r(!0)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),(0,s.t)("crm.addNote"))),a.createElement("div",{className:"crm-table-header"},a.createElement("div",{className:"crm-table-header-cell",style:{width:24}},a.createElement("input",{type:"checkbox",disabled:!0})),a.createElement("div",{className:"crm-table-header-cell",style:{flex:1}},(0,s.t)("crm.tableName")),a.createElement("div",{className:"crm-table-header-cell",style:{flex:1}},(0,s.t)("crm.tableModifiedDate")),a.createElement("div",{className:"crm-table-header-cell",style:{width:100,textAlign:"center"}},(0,s.t)("crm.tableAction"))),f.length>0?a.createElement("div",{className:"crm-table-body"},f.map(n=>{return a.createElement("div",{key:n.id,className:"crm-table-row"},a.createElement("div",{className:"crm-table-cell",style:{width:24}},a.createElement("input",{type:"checkbox"})),a.createElement("div",{className:"crm-table-cell",style:{flex:1,fontWeight:500}},n.topic),a.createElement("div",{className:"crm-table-cell",style:{flex:1,color:ca.textMuted}},(o=n.updatedAt,new Date(o).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}))),a.createElement("div",{className:"crm-table-cell crm-action-cell",style:{width:100}},a.createElement("button",{className:"crm-action-btn crm-action-edit",onClick:()=>(e=>{m(e.topic),i(e),r(!0),setTimeout(()=>{g.current&&(g.current.innerHTML=e.content,u(g.current.innerText||""))},100)})(n),title:"Edit"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}))),a.createElement("button",{className:"crm-action-btn crm-action-delete",onClick:()=>(n=>{if(confirm((0,s.t)("crm.deleteNoteConfirm"))){const a=e.notes.find(e=>e.id===n);v.deleteNote(e.id,n),a&&qg("deleted",e,{id:n,topic:a.topic,content:a.content,createdAt:a.createdAt,updatedAt:a.updatedAt}),t()}})(n.id),title:"Delete"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})))));var o})):a.createElement("div",{className:"crm-empty-state"},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"})),a.createElement("div",{className:"crm-empty-state-text"},(0,s.t)("crm.noNotes")),a.createElement("div",{style:{color:"var(--lion-text-muted)",fontSize:13,marginTop:4}},(0,s.t)("crm.addFirstNote"))),n&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>r(!1)}),a.createElement("div",{className:"crm-sub-modal",style:{maxWidth:600}},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h3",{className:"crm-sub-modal-title"},o?(0,s.t)("crm.editNote"):(0,s.t)("crm.addNote")),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>r(!1)},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"crm-sub-modal-body"},a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.topic")),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.topic"),value:d,onChange:e=>m(e.target.value),autoFocus:!0})),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.content")),a.createElement("div",{className:"crm-editor-toolbar"},a.createElement("button",{className:"crm-editor-btn",onClick:()=>b("bold"),title:"Bold"},a.createElement("strong",null,"B")),a.createElement("button",{className:"crm-editor-btn",onClick:()=>b("italic"),title:"Italic"},a.createElement("em",null,"I")),a.createElement("button",{className:"crm-editor-btn",onClick:()=>b("underline"),title:"Underline"},a.createElement("u",null,"U")),a.createElement("button",{className:"crm-editor-btn",onClick:()=>b("strikeThrough"),title:"Strikethrough"},a.createElement("s",null,"S")),a.createElement("span",{className:"crm-editor-separator"}),a.createElement("button",{className:"crm-editor-btn",onClick:()=>b("insertOrderedList"),title:"Numbered List"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2v1zm1-9h1V4H2v1h1v3zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2v1zm5-6v2h14V5H7zm0 14h14v-2H7v2zm0-6h14v-2H7v2z"}))),a.createElement("button",{className:"crm-editor-btn",onClick:()=>b("insertUnorderedList"),title:"Bullet List"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5zm0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5zM7 19h14v-2H7v2zm0-6h14v-2H7v2zm0-8v2h14V5H7z"}))),a.createElement("span",{className:"crm-editor-separator"}),a.createElement("button",{className:"crm-editor-btn",onClick:()=>b("justifyLeft"),title:"Align Left"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"}))),a.createElement("button",{className:"crm-editor-btn",onClick:()=>b("justifyCenter"),title:"Align Center"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"}))),a.createElement("button",{className:"crm-editor-btn",onClick:()=>b("justifyRight"),title:"Align Right"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"}))),a.createElement("div",{style:{marginLeft:"auto"}},a.createElement(Qn,{text:p,onRegenerate:e=>{g.current&&(g.current.innerText=e,u(e))},size:"small",variant:"toolbar",language:Xn()}))),a.createElement("div",{ref:g,className:"crm-editor-content",contentEditable:!0,"data-placeholder":(0,s.t)("crm.content"),onInput:e=>u(e.target.innerText||"")}))),a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>r(!1)},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:()=>{const n=g.current?.innerHTML||"";if(d.trim()){if(o)v.updateNote(e.id,o.id,{topic:d,content:n}),qg("updated",e,{id:o.id,topic:d,content:n,createdAt:o.createdAt,updatedAt:Date.now()});else{const t=v.addNote(e.id,d,n);qg("created",e,{id:t?.id,topic:d,content:n,createdAt:Date.now(),updatedAt:Date.now()})}r(!1),m(""),i(null),t()}else alert((0,s.t)("crm.pleaseEnterTopic","Please enter a topic"))}},(0,s.t)("crm.save"))))),a.createElement("style",null,`\n        ${ma}\n\n        .crm-notes-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          margin-bottom: 16px;\n          gap: 16px;\n        }\n\n        .crm-notes-header .crm-search-box {\n          flex: 1;\n          max-width: 300px;\n          margin-bottom: 0;\n        }\n\n        .crm-notes-tab .crm-table-body {\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          overflow: hidden;\n        }\n\n        .crm-action-cell {\n          display: flex;\n          justify-content: center;\n          gap: 4px;\n        }\n\n        .crm-action-btn {\n          background: transparent;\n          border: none;\n          padding: 6px;\n          border-radius: 6px;\n          cursor: pointer;\n          transition: all 0.2s;\n          display: inline-flex;\n          align-items: center;\n          justify-content: center;\n        }\n\n        .crm-action-edit {\n          color: var(--lion-text-muted);\n        }\n\n        .crm-action-edit:hover {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        .crm-action-delete {\n          color: var(--lion-primary);\n        }\n\n        .crm-action-delete:hover {\n          background: var(--lion-primary-light);\n          color: var(--lion-primary-hover);\n        }\n\n        .crm-editor-separator {\n          width: 1px;\n          height: 20px;\n          background: var(--lion-border-light);\n          margin: 0 4px;\n        }\n\n        .crm-editor-content:empty:before {\n          content: attr(data-placeholder);\n          color: var(--lion-text-light);\n          pointer-events: none;\n        }\n\n        .crm-editor-content {\n          font-family: inherit;\n        }\n\n        .crm-editor-content:focus {\n          outline: none;\n        }\n\n        /* ========== DARK MODE OVERRIDES ========== */\n        .crm-notes-tab.lion-dark .crm-search-input {\n          background: var(--lion-bg-secondary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-search-input::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-table-header {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-table-header-cell {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-table-body {\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-table-row {\n          background: var(--lion-bg-primary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-table-row:hover {\n          background: var(--lion-bg-secondary) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-table-cell {\n          color: #ffffff !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-empty-state {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-empty-state-text {\n          color: #ffffff !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-sub-modal {\n          background: var(--lion-bg-primary) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-sub-modal-header {\n          border-bottom-color: var(--lion-border-light) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-sub-modal-title {\n          color: #ffffff !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-sub-modal-close {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-sub-modal-close:hover {\n          color: #ffffff !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-form-label {\n          color: #e0e0e0 !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-form-input {\n          background: var(--lion-bg-secondary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-form-input::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-editor-toolbar {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-editor-btn {\n          color: #e0e0e0 !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-editor-btn:hover {\n          background: var(--lion-bg-tertiary) !important;\n          color: #ffffff !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-editor-content {\n          background: var(--lion-bg-secondary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-editor-content:empty:before {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-sub-modal-footer {\n          border-top-color: var(--lion-border-light) !important;\n        }\n\n        .crm-notes-tab.lion-dark .crm-btn-secondary {\n          background: var(--lion-bg-tertiary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n      `))},jg=async(e,t,n)=>{try{const a=Ig("reminder");if(!a)return;const r={};(a.dataFields||[]).forEach(a=>{if(a.enabled)switch(a.id){case"event_details":r.event={type:"reminder",action:e,timestamp:Date.now()};break;case"number":r.number=t.id.split("@")[0];break;case"name":r.name=t.profile.name;break;case"reminder_topic":r.reminderTopic=n.topic;break;case"reminder_time":r.reminderTime=n.datetime,r.reminderTimeFormatted=new Date(n.datetime).toLocaleString();break;case"reminder_details":r.reminderDetails=n.details||null;break;case"contact_profile":r.contactProfile={fullName:t.profile.name||null,phone:t.profile.phone||null,email:t.profile.email||null,gender:t.profile.gender||null,dateOfBirth:t.profile.dateOfBirth||null,details:t.profile.details||null,address:t.profile.address||null,language:t.profile.language||null}}}),r.reminder={id:n.id||null,topic:n.topic,datetime:n.datetime,datetimeFormatted:new Date(n.datetime).toLocaleString(),details:n.details||null,repeatInterval:n.repeatInterval||null,status:n.status||"pending",snoozeCount:n.snoozeCount||0},Rg(a.url,r,"reminder")}catch(e){}},Vg=({contact:e,onUpdate:t})=>{const[n,r]=(0,a.useState)(!1),[o,i]=(0,a.useState)(null),[l,c]=(0,a.useState)("");Mg();const[d,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(""),[g,h]=(0,a.useState)(""),[b,f]=(0,a.useState)(0),y=[{value:0,label:(0,s.t)("crm.noRepeat")},{value:5,label:(0,s.t)("crm.every5Min")},{value:10,label:(0,s.t)("crm.every10Min")},{value:15,label:(0,s.t)("crm.every15Min")},{value:30,label:(0,s.t)("crm.every30Min")},{value:60,label:(0,s.t)("crm.every1Hour")}],x=e=>{m((e=>{const t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}T${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`})(e.datetime)),u(e.topic),h(e.details),f(e.repeatInterval||0),i(e),r(!0)},w=()=>{m(""),u(""),h(""),f(0),i(null)},k=e=>{switch(e){case"pending":return"crm-status-pending";case"completed":return"crm-status-completed";case"dismissed":return"crm-status-dismissed";case"snoozed":return"crm-status-snoozed";case"stopped":return"crm-status-stopped";default:return""}},E=e.reminders.filter(e=>e.topic.toLowerCase().includes(l.toLowerCase())||e.details.toLowerCase().includes(l.toLowerCase()));return a.createElement("div",{className:"crm-reminder-tab"},a.createElement("div",{className:"crm-reminder-header"},a.createElement("div",{className:"crm-search-box"},a.createElement("svg",{className:"crm-search-icon",viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),a.createElement("input",{type:"text",className:"crm-search-input",placeholder:(0,s.t)("crm.search"),value:l,onChange:e=>c(e.target.value)})),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:()=>{m((()=>{const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}T${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`})()),u(`Follow up with ${e.profile.name}`),h(""),f(0),i(null),r(!0)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),(0,s.t)("crm.addReminder"))),a.createElement("div",{className:"crm-table-header"},a.createElement("div",{className:"crm-table-header-cell",style:{width:24}},a.createElement("input",{type:"checkbox",disabled:!0})),a.createElement("div",{className:"crm-table-header-cell",style:{flex:1,minWidth:120}},(0,s.t)("crm.tableTopic")),a.createElement("div",{className:"crm-table-header-cell",style:{width:160,minWidth:160}},(0,s.t)("crm.tableReminderDate")),a.createElement("div",{className:"crm-table-header-cell",style:{width:110,minWidth:110}},(0,s.t)("crm.tableRepeatSnooze")),a.createElement("div",{className:"crm-table-header-cell",style:{width:90,minWidth:90}},(0,s.t)("crm.tableStatus")),a.createElement("div",{className:"crm-table-header-cell",style:{width:80,textAlign:"center"}},(0,s.t)("crm.tableAction"))),E.length>0?a.createElement("div",{className:"crm-table-body"},E.map(n=>{const r=(e=>{const t=Date.now();return e.isStopped||"stopped"===e.status?{status:(0,s.t)("crm.stopped"),isDue:!1}:"completed"===e.status?{status:(0,s.t)("crm.completed"),isDue:!1}:"dismissed"===e.status?{status:(0,s.t)("crm.dismissed"),isDue:!1}:e.datetime<=t?{status:(0,s.t)("crm.due"),isDue:!0}:{status:(0,s.t)("crm.pending"),isDue:!1}})(n);return a.createElement("div",{key:n.id,className:"crm-table-row"},a.createElement("div",{className:"crm-table-cell",style:{width:24}},a.createElement("input",{type:"checkbox"})),a.createElement("div",{className:"crm-table-cell",style:{flex:1,minWidth:120,fontWeight:500}},n.topic,n.snoozeCount&&n.snoozeCount>0&&a.createElement("span",{className:"crm-snooze-badge",title:`Snoozed ${n.snoozeCount} times`},"🔁 ",n.snoozeCount)),a.createElement("div",{className:"crm-table-cell",style:{width:160,minWidth:160,color:ca.textMuted}},(i=n.datetime,new Date(i).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}))),a.createElement("div",{className:"crm-table-cell",style:{width:110,minWidth:110}},n.repeatInterval&&n.repeatInterval>0?a.createElement("span",{className:"crm-repeat-badge"},"🔄 ",void 0===(o=n.repeatInterval)||0===o?"":60===o?"1h":`${o}m`):a.createElement("span",{style:{color:ca.sidebarTextMuted,fontSize:"12px"}},(0,s.t)("crm.none"))),a.createElement("div",{className:"crm-table-cell",style:{width:90,minWidth:90}},a.createElement("span",{className:`crm-status-badge ${r.isDue?"crm-status-due":k(n.status)}`},r.status)),a.createElement("div",{className:"crm-table-cell crm-action-cell",style:{width:80}},a.createElement("button",{className:"crm-action-btn crm-action-edit",onClick:()=>x(n),title:"Edit"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}))),a.createElement("button",{className:"crm-action-btn crm-action-delete",onClick:()=>(n=>{if(confirm((0,s.t)("crm.confirmDeleteReminder","Delete this reminder?"))){const a=e.reminders?.find(e=>e.id===n);v.deleteReminder(e.id,n),a&&jg("deleted",e,{id:n,topic:a.topic,datetime:a.datetime,details:a.details,repeatInterval:a.repeatInterval,status:a.status,snoozeCount:a.snoozeCount}),t()}})(n.id),title:"Delete"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})))));var o,i})):a.createElement("div",{className:"crm-empty-state"},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"})),a.createElement("div",{className:"crm-empty-state-text"},(0,s.t)("crm.noReminders")),a.createElement("div",{style:{color:"var(--lion-text-muted)",fontSize:13,marginTop:4}},(0,s.t)("crm.addFirstReminder"))),n&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>r(!1)}),a.createElement("div",{className:"crm-sub-modal"},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h3",{className:"crm-sub-modal-title"},o?(0,s.t)("crm.editReminder"):(0,s.t)("crm.addReminder")),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>r(!1)},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"crm-sub-modal-body"},a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.dateTime")),a.createElement("input",{type:"datetime-local",className:"crm-form-input",value:d,onChange:e=>m(e.target.value)})),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.reminderTopic")),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.reminderTopic"),value:p,onChange:e=>u(e.target.value)})),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.details")),a.createElement("textarea",{className:"crm-form-textarea",placeholder:(0,s.t)("crm.details"),value:g,onChange:e=>h(e.target.value),rows:4}),a.createElement("div",{style:{marginTop:"8px"}},a.createElement(Qn,{text:g,onRegenerate:e=>h(e),size:"small",variant:"toolbar",language:Xn()}))),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.repeatInterval")),a.createElement("select",{className:"crm-form-select",value:b,onChange:e=>f(Number(e.target.value))},y.map(e=>a.createElement("option",{key:e.value,value:e.value},e.label))))),a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>r(!1)},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:()=>{if(!p.trim())return void alert("Please enter a topic");const n=new Date(d).getTime();if(o)v.updateReminder(e.id,o.id,{topic:p,details:g,datetime:n,repeatInterval:b}),jg("updated",e,{id:o.id,topic:p,datetime:n,details:g,repeatInterval:b,status:o.status,snoozeCount:o.snoozeCount});else{const t=v.addReminder(e.id,p,g,n,b);jg("created",e,{id:t?.id,topic:p,datetime:n,details:g,repeatInterval:b,status:"pending"})}r(!1),w(),t()}},(0,s.t)("crm.save"))))),a.createElement("style",null,`\n        ${ma}\n\n        .crm-reminder-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          margin-bottom: 16px;\n          gap: 16px;\n        }\n\n        .crm-reminder-header .crm-search-box {\n          flex: 1;\n          max-width: 300px;\n          margin-bottom: 0;\n        }\n\n        .crm-reminder-tab .crm-table-body {\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          overflow: hidden;\n        }\n\n        .crm-action-cell {\n          display: flex;\n          justify-content: center;\n          gap: 4px;\n        }\n\n        .crm-action-btn {\n          background: transparent;\n          border: none;\n          padding: 6px;\n          border-radius: 6px;\n          cursor: pointer;\n          transition: all 0.2s;\n          display: inline-flex;\n          align-items: center;\n          justify-content: center;\n        }\n\n        .crm-action-edit {\n          color: var(--lion-text-muted);\n        }\n\n        .crm-action-edit:hover {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        .crm-action-delete {\n          color: var(--lion-primary);\n        }\n\n        .crm-action-delete:hover {\n          background: var(--lion-primary-light);\n          color: var(--lion-primary-hover);\n        }\n\n        .crm-status-select {\n          padding: 4px 8px;\n          border-radius: 12px;\n          border: none;\n          font-size: 12px;\n          font-weight: 500;\n          cursor: pointer;\n          appearance: none;\n          -webkit-appearance: none;\n          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");\n          background-repeat: no-repeat;\n          background-position: right 4px center;\n          padding-right: 20px;\n        }\n\n        .crm-status-select.crm-status-pending {\n          background-color: var(--lion-warning-light);\n          color: var(--lion-warning);\n        }\n\n        .crm-status-select.crm-status-completed {\n          background-color: var(--lion-success-light);\n          color: var(--lion-success);\n        }\n\n        .crm-status-select.crm-status-dismissed {\n          background-color: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n        }\n\n        .crm-status-badge {\n          display: inline-block;\n          padding: 4px 10px;\n          border-radius: 12px;\n          font-size: 12px;\n          font-weight: 500;\n        }\n\n        .crm-status-badge.crm-status-pending {\n          background-color: var(--lion-warning-light);\n          color: var(--lion-warning);\n        }\n\n        .crm-status-badge.crm-status-due {\n          background-color: var(--lion-primary-light);\n          color: var(--lion-primary);\n          animation: pulse 1.5s infinite;\n        }\n\n        .crm-status-badge.crm-status-completed {\n          background-color: var(--lion-success-light);\n          color: var(--lion-success);\n        }\n\n        .crm-status-badge.crm-status-dismissed,\n        .crm-status-badge.crm-status-stopped {\n          background-color: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n        }\n\n        .crm-status-badge.crm-status-snoozed {\n          background-color: var(--lion-info-light);\n          color: var(--lion-info);\n        }\n\n        .crm-repeat-badge {\n          display: inline-flex;\n          align-items: center;\n          gap: 4px;\n          padding: 2px 8px;\n          border-radius: 8px;\n          font-size: 11px;\n          font-weight: 500;\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-secondary);\n        }\n\n        .crm-snooze-badge {\n          display: inline-flex;\n          align-items: center;\n          gap: 2px;\n          margin-left: 8px;\n          padding: 2px 6px;\n          border-radius: 6px;\n          font-size: 10px;\n          font-weight: 500;\n          background: var(--lion-info-light);\n          color: var(--lion-info);\n        }\n\n        .crm-form-select {\n          width: 100%;\n          padding: 10px 12px;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          font-size: 14px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-primary);\n          cursor: pointer;\n        }\n\n        .crm-form-select:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 3px var(--lion-primary-light);\n        }\n\n        .crm-form-hint {\n          display: block;\n          margin-top: 6px;\n          font-size: 12px;\n          color: var(--lion-text-muted);\n        }\n\n        @keyframes pulse {\n          0%, 100% {\n            opacity: 1;\n          }\n          50% {\n            opacity: 0.6;\n          }\n        }\n      `))},Gg=async(e,t,n)=>{try{const a=localStorage.getItem("webhook_settings");if(!a)return;const r=JSON.parse(a).appointment;if(!r||!r.active||!r.url)return;const o={};(r.dataFields||[]).forEach(a=>{if(a.enabled)switch(a.id){case"event_details":o.event={type:"appointment",action:e,timestamp:Date.now()};break;case"number":o.number=t.id.split("@")[0];break;case"name":o.name=t.profile.name;break;case"appointment_time":o.appointmentTime=n.datetime,o.appointmentTimeFormatted=new Date(n.datetime).toLocaleString();break;case"meeting_link":o.meetingLink=n.meetLink||null;break;case"contact_profile":o.contactProfile={fullName:t.profile.name||null,phone:t.profile.phone||null,email:t.profile.email||null,gender:t.profile.gender||null,dateOfBirth:t.profile.dateOfBirth||null,details:t.profile.details||null,address:t.profile.address||null,language:t.profile.language||null}}}),o.appointment={id:n.id||null,title:n.title,datetime:n.datetime,datetimeFormatted:new Date(n.datetime).toLocaleString(),meetLink:n.meetLink||null,message:n.message||null,reminderBefore:n.reminderBefore||null,status:n.status||"scheduled"},"undefined"!=typeof chrome&&chrome.runtime&&chrome.runtime.sendMessage({type:"SEND_WEBHOOK",url:r.url,payload:o,eventType:"appointment"})}catch(e){}},Kg=({contact:e,onUpdate:t})=>{const[n,r]=(0,a.useState)(!1),[o,i]=(0,a.useState)(null),[l,c]=(0,a.useState)(""),[,d]=(0,a.useState)(0);(0,a.useEffect)(()=>{const e=()=>{d(e=>e+1)};return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]);const[m,p]=(0,a.useState)(""),[u,g]=(0,a.useState)(""),[h,b]=(0,a.useState)(""),[f,y]=(0,a.useState)(""),[x,w]=(0,a.useState)(30),[k,E]=(0,a.useState)(!1),[S,C]=(0,a.useState)(!1),[T,A]=(0,a.useState)(!0),[D,_]=(0,a.useState)(""),[N,M]=(0,a.useState)(!1),[I,R]=(0,a.useState)([]),[B,P]=(0,a.useState)(null),[L,U]=(0,a.useState)(""),[F,z]=(0,a.useState)(""),[O,W]=(0,a.useState)(""),[q,H]=(0,a.useState)("");(0,a.useEffect)(()=>{R(v.getAppointmentTemplates())},[N]);const j="Olá {name},\n\nEste é um lembrete para a nossa reunião agendada:\n\n📅 Data: {date}\n🕐 Horário: {time}\n\n📹 Link da reunião: {link}\n\nEstamos ansiosos para falar com você!",V="Olá {name}! 🔔\n\nSua reunião está começando agora!\n\n📹 Entre aqui: {link}\n\nAté logo!",G={id:e.id,name:e.profile.name,phone:e.profile.phone},K=e=>{p(e.title),g((e=>{const t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}T${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`})(e.datetime)),b(e.message),y(e.meetLink),w(e.reminderBefore),A(!1!==e.useSameMessage),_(e.meetingStartMessage||V),i(e),r(!0)},$=()=>{p(""),g(""),b(""),y(""),w(30),i(null),E(!1),A(!0),_("")},Y=e=>{b(h+e)},X=e=>{_(D+e)},J=e=>{z(F+e)},[Q,Z]=(0,a.useState)(""),ee=e=>{switch(e){case"scheduled":return"crm-status-scheduled";case"completed":return"crm-status-completed";case"cancelled":return"crm-status-cancelled";case"missed":return"crm-status-missed";default:return""}},te=(e.appointments||[]).filter(e=>e.title.toLowerCase().includes(l.toLowerCase()));return a.createElement("div",{className:"crm-appointment-tab"},a.createElement("div",{className:"crm-appointment-header"},a.createElement("div",{className:"crm-search-box"},a.createElement("svg",{className:"crm-search-icon",viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),a.createElement("input",{type:"text",className:"crm-search-input",placeholder:(0,s.t)("crm.searchAppointments"),value:l,onChange:e=>c(e.target.value)})),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:()=>{p(""),g((()=>{const e=new Date;return e.setMinutes(e.getMinutes()+30),`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}T${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`})()),b(j),y(""),w(30),A(!0),_(V),i(null),r(!0)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),(0,s.t)("crm.addAppointment"))),a.createElement("div",{className:"crm-table-header"},a.createElement("div",{className:"crm-table-header-cell",style:{width:24}},a.createElement("input",{type:"checkbox",disabled:!0})),a.createElement("div",{className:"crm-table-header-cell",style:{flex:1}},(0,s.t)("crm.tableTitle")),a.createElement("div",{className:"crm-table-header-cell",style:{flex:1}},(0,s.t)("crm.tableDateTime")),a.createElement("div",{className:"crm-table-header-cell",style:{width:80}},(0,s.t)("crm.tableAttendee")),a.createElement("div",{className:"crm-table-header-cell",style:{width:80}},(0,s.t)("crm.reminder")),a.createElement("div",{className:"crm-table-header-cell",style:{width:100}},(0,s.t)("crm.tableStatus")),a.createElement("div",{className:"crm-table-header-cell",style:{width:100,textAlign:"center"}},(0,s.t)("crm.tableAction"))),te.length>0?a.createElement("div",{className:"crm-table-body"},te.map(n=>{return a.createElement("div",{key:n.id,className:"crm-table-row"},a.createElement("div",{className:"crm-table-cell",style:{width:24}},a.createElement("input",{type:"checkbox"})),a.createElement("div",{className:"crm-table-cell",style:{flex:1,fontWeight:500}},a.createElement("div",null,n.title),n.meetLink&&a.createElement("a",{href:n.meetLink,target:"_blank",rel:"noopener noreferrer",className:"crm-meet-link"},"📹 ",(0,s.t)("crm.joinMeet"))),a.createElement("div",{className:"crm-table-cell",style:{flex:1,color:ca.textMuted}},(o=n.datetime,new Date(o).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}))),a.createElement("div",{className:"crm-table-cell",style:{width:80}},a.createElement("span",{className:"crm-attendee-count"},"👥 ",n.attendees.length)),a.createElement("div",{className:"crm-table-cell",style:{width:80}},a.createElement("span",{className:"crm-reminder-badge"},"🔔 ",1440===(r=n.reminderBefore)?"1 day":r>=60?r/60+"h":`${r}m`)),a.createElement("div",{className:"crm-table-cell",style:{width:100}},a.createElement("select",{className:`crm-status-select ${ee(n.status)}`,value:n.status,onChange:a=>((n,a)=>{const r=e.appointments?.find(e=>e.id===n);v.updateAppointmentStatus(e.id,n,a),r&&Gg("status_changed",e,{id:n,title:r.title,datetime:r.datetime,meetLink:r.meetLink,message:r.message,reminderBefore:r.reminderBefore,status:a}),t()})(n.id,a.target.value)},a.createElement("option",{value:"scheduled"},(0,s.t)("crm.scheduled")),a.createElement("option",{value:"completed"},(0,s.t)("crm.completed")),a.createElement("option",{value:"cancelled"},(0,s.t)("crm.cancelled")),a.createElement("option",{value:"missed"},(0,s.t)("crm.missed")))),a.createElement("div",{className:"crm-table-cell crm-action-cell",style:{width:100}},a.createElement("button",{className:"crm-action-btn crm-action-edit",onClick:()=>K(n),title:"Edit"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}))),a.createElement("button",{className:"crm-action-btn crm-action-delete",onClick:()=>(n=>{if(confirm((0,s.t)("crm.deleteAppointmentConfirm"))){const a=e.appointments?.find(e=>e.id===n);v.deleteAppointment(e.id,n),a&&Gg("deleted",e,{id:n,title:a.title,datetime:a.datetime,meetLink:a.meetLink,message:a.message,reminderBefore:a.reminderBefore,status:a.status}),t()}})(n.id),title:"Delete"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})))));var r,o})):a.createElement("div",{className:"crm-empty-state"},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM9 10H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm-8 4H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2z"})),a.createElement("div",{className:"crm-empty-state-text"},(0,s.t)("crm.noAppointmentsFound"))),n&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>r(!1)}),a.createElement("div",{className:"crm-sub-modal crm-appointment-modal"},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h3",{className:"crm-sub-modal-title"},o?(0,s.t)("crm.editAppointment"):(0,s.t)("crm.addAppointment")),a.createElement("div",{className:"crm-modal-header-actions"},a.createElement("button",{className:"crm-template-settings-btn",onClick:()=>{P(null),U(""),z(j),W(""),M(!0)},title:"Template Settings"},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19.14,12.94c0.04-0.31,0.06-0.63,0.06-0.94c0-0.31-0.02-0.63-0.06-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.37,4.82,11.69,4.82,12c0,0.31,0.02,0.63,0.06,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"}))),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>r(!1)},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))))),a.createElement("div",{className:"crm-sub-modal-body crm-appointment-modal-body"},a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.titleLabel")," ",a.createElement("span",{style:{color:ca.error}},"*")),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.productDemoCall"),value:m,onChange:e=>p(e.target.value)})),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.scheduleDateTime")," ",a.createElement("span",{style:{color:ca.error}},"*")),a.createElement("input",{type:"datetime-local",className:"crm-form-input",value:u,onChange:e=>g(e.target.value)})),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.attendee")),a.createElement("div",{className:"crm-attendee-display"},a.createElement("div",{className:"crm-attendee-avatar"},e.profile.name.charAt(0).toUpperCase()),a.createElement("div",{className:"crm-attendee-info"},a.createElement("div",{className:"crm-attendee-name"},e.profile.name),a.createElement("div",{className:"crm-attendee-phone"},e.profile.phone)))),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.googleMeetLink")),a.createElement("div",{className:"crm-meet-link-group"},a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.pasteGoogleMeetLink"),value:f,onChange:e=>y(e.target.value)}),a.createElement("button",{type:"button",className:"crm-btn crm-btn-secondary crm-generate-link-btn",onClick:()=>{window.open("https://meet.google.com/new","_blank"),f&&"https://meet.google.com/new"!==f||y("")}},(0,s.t)("crm.generateLink"))),a.createElement("span",{className:"crm-form-hint"},(0,s.t)("crm.generateLinkHint"))),I.length>0&&a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.chooseTemplate")),a.createElement("select",{className:"crm-form-select",value:q,onChange:e=>(e=>{const t=I.find(t=>t.id===e);t&&(b(t.message),t.meetLink&&y(t.meetLink)),H(e)})(e.target.value)},a.createElement("option",{value:""},(0,s.t)("crm.selectTemplate")),I.map(e=>a.createElement("option",{key:e.id,value:e.id},e.name)))),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.messageTemplate")),a.createElement("div",{className:"crm-variable-buttons"},a.createElement("button",{type:"button",className:"crm-variable-btn",onClick:()=>Y("{name}")},"{name}"),a.createElement("button",{type:"button",className:"crm-variable-btn",onClick:()=>Y("{date}")},"{date}"),a.createElement("button",{type:"button",className:"crm-variable-btn",onClick:()=>Y("{time}")},"{time}"),a.createElement("button",{type:"button",className:"crm-variable-btn",onClick:()=>Y("{link}")},"{link}")),a.createElement("textarea",{className:"crm-form-textarea",placeholder:(0,s.t)("crm.messageTemplatePlaceholder"),value:h,onChange:e=>b(e.target.value),rows:6}),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"8px"}},a.createElement(Qn,{text:h,onRegenerate:e=>b(e),size:"small",variant:"toolbar",language:Xn()}),a.createElement("span",{className:"crm-form-hint",style:{margin:0}},(0,s.t)("crm.reminderMessageHint")))),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-checkbox-label",style:{marginBottom:"12px"}},a.createElement("input",{type:"checkbox",checked:T,onChange:e=>A(e.target.checked),className:"crm-checkbox"}),a.createElement("span",{className:"crm-checkbox-text"},(0,s.t)("crm.useSameMessage"))),!T&&a.createElement(a.Fragment,null,I.length>0&&a.createElement("div",{style:{marginBottom:"12px"}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.chooseTemplate")),a.createElement("select",{className:"crm-form-select",value:Q,onChange:e=>(e=>{const t=I.find(t=>t.id===e);t&&_(t.message),Z(e)})(e.target.value)},a.createElement("option",{value:""},(0,s.t)("crm.selectTemplate")),I.map(e=>a.createElement("option",{key:e.id,value:e.id},e.name)))),a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.meetingStartMessageLabel")),a.createElement("div",{className:"crm-variable-buttons"},a.createElement("button",{type:"button",className:"crm-variable-btn",onClick:()=>X("{name}")},"{name}"),a.createElement("button",{type:"button",className:"crm-variable-btn",onClick:()=>X("{date}")},"{date}"),a.createElement("button",{type:"button",className:"crm-variable-btn",onClick:()=>X("{time}")},"{time}"),a.createElement("button",{type:"button",className:"crm-variable-btn",onClick:()=>X("{link}")},"{link}")),a.createElement("textarea",{className:"crm-form-textarea",placeholder:(0,s.t)("crm.meetingStartPlaceholder"),value:D,onChange:e=>_(e.target.value),rows:4}),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"8px"}},a.createElement(Qn,{text:D,onRegenerate:e=>_(e),size:"small",variant:"toolbar",language:Xn()}),a.createElement("span",{className:"crm-form-hint",style:{margin:0}},(0,s.t)("crm.meetingStartHint"))))),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.sendReminderLabel")),a.createElement("select",{className:"crm-form-select",value:x,onChange:e=>w(Number(e.target.value))},[{value:5,labelKey:"crm.before5Min"},{value:10,labelKey:"crm.before10Min"},{value:15,labelKey:"crm.before15Min"},{value:30,labelKey:"crm.before30Min"},{value:60,labelKey:"crm.before1Hour"},{value:120,labelKey:"crm.before2Hours"},{value:1440,labelKey:"crm.before1Day"}].map(e=>a.createElement("option",{key:e.value,value:e.value},(0,s.t)(e.labelKey)))),a.createElement("span",{className:"crm-form-hint"},(0,s.t)("crm.reminderTimeHint"))),a.createElement("div",{className:"crm-form-group crm-send-now-group"},a.createElement("label",{className:"crm-checkbox-label"},a.createElement("input",{type:"checkbox",checked:k,onChange:e=>E(e.target.checked),className:"crm-checkbox"}),a.createElement("span",{className:"crm-checkbox-text"},(0,s.t)("crm.sendMessageNowTo")," ",e.profile.name)),a.createElement("span",{className:"crm-form-hint"},(0,s.t)("crm.sendNowHint")))),a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>r(!1)},(0,s.t)("crm.discard")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:async()=>{if(!m.trim())return void alert((0,s.t)("crm.pleaseEnterTitle"));const n=new Date(u).getTime();if(n<=Date.now())return void alert((0,s.t)("crm.pleaseSelectFutureDate"));const a=[G];if(o)v.updateAppointment(e.id,o.id,{title:m,datetime:n,attendees:a,message:h,meetLink:f,reminderBefore:x,useSameMessage:T,meetingStartMessage:T?h:D}),Gg("updated",e,{id:o.id,title:m,datetime:n,meetLink:f,message:h,reminderBefore:x,status:o.status});else{const t=v.addAppointment(e.id,m,n,a,h,f,x,T,T?h:D);Gg("created",e,{id:t?.id,title:m,datetime:n,meetLink:f,message:h,reminderBefore:x,status:"scheduled"})}if(k&&h.trim()){C(!0);try{await(async(e,t,n,a,r)=>{const o=new Date(n),i=o.toLocaleDateString("pt-BR",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),s=o.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit",hour12:!0}),l=r.replace(/\{name\}/g,t||"there").replace(/\{date\}/g,i).replace(/\{time\}/g,s).replace(/\{link\}/g,a||"");window.postMessage({type:"SEND_APPOINTMENT_MESSAGE_NOW",attendeeId:e,attendeeName:t,message:l},"*")})(e.id,e.profile.name,n,f,h)}catch(e){}C(!1)}r(!1),$(),t()},disabled:S},S?(0,s.t)("crm.sending"):k?(0,s.t)("crm.saveAndSend"):(0,s.t)("crm.save"))))),N&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>M(!1)}),a.createElement("div",{className:"crm-sub-modal crm-template-modal"},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h3",{className:"crm-sub-modal-title"},(0,s.t)("crm.appointmentTemplates")),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>M(!1)},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"crm-template-modal-content"},a.createElement("div",{className:"crm-template-list-section"},a.createElement("div",{className:"crm-template-list-header"},a.createElement("span",{className:"crm-template-list-title"},(0,s.t)("crm.savedTemplates")),a.createElement("button",{className:"crm-btn crm-btn-small crm-btn-primary",onClick:()=>{P(null),U(""),z(j),W("")}},(0,s.t)("crm.newTemplate"))),a.createElement("div",{className:"crm-template-list"},0===I.length?a.createElement("div",{className:"crm-template-empty"},(0,s.t)("crm.noTemplatesYet")):I.map(e=>a.createElement("div",{key:e.id,className:"crm-template-item "+(B?.id===e.id?"active":""),onClick:()=>(e=>{P(e),U(e.name),z(e.message),W(e.meetLink||"")})(e)},a.createElement("div",{className:"crm-template-item-name"},e.name),a.createElement("div",{className:"crm-template-item-preview"},e.message.substring(0,50),"..."),a.createElement("button",{className:"crm-template-delete-btn",onClick:t=>{var n;t.stopPropagation(),n=e.id,confirm((0,s.t)("crm.deleteTemplateConfirm"))&&(v.deleteAppointmentTemplate(n),R(v.getAppointmentTemplates()),B?.id===n&&(P(null),U(""),z(j),W("")))},title:"Delete"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}))))))),a.createElement("div",{className:"crm-template-editor-section"},a.createElement("div",{className:"crm-template-editor-header"},B?(0,s.t)("crm.editTemplateTitle"):(0,s.t)("crm.newTemplateTitle")),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.templateName")),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.templateNamePlaceholder"),value:L,onChange:e=>U(e.target.value)})),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.meetLinkOptional")),a.createElement("div",{className:"crm-meet-link-group"},a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.pasteGoogleMeetLink"),value:O,onChange:e=>W(e.target.value)}),a.createElement("button",{type:"button",className:"crm-btn crm-btn-secondary crm-generate-link-btn",onClick:()=>{window.open("https://meet.google.com/new","_blank")}},(0,s.t)("crm.generateLink")))),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.messageTemplate")),a.createElement("div",{className:"crm-variable-buttons"},a.createElement("button",{type:"button",className:"crm-variable-btn",onClick:()=>J("{name}")},"{name}"),a.createElement("button",{type:"button",className:"crm-variable-btn",onClick:()=>J("{date}")},"{date}"),a.createElement("button",{type:"button",className:"crm-variable-btn",onClick:()=>J("{time}")},"{time}"),a.createElement("button",{type:"button",className:"crm-variable-btn",onClick:()=>J("{link}")},"{link}")),a.createElement("textarea",{className:"crm-form-textarea",placeholder:(0,s.t)("crm.messageTemplatePlaceholder"),value:F,onChange:e=>z(e.target.value),rows:8}),a.createElement("div",{style:{marginTop:"8px"}},a.createElement(Qn,{text:F,onRegenerate:e=>z(e),size:"small",variant:"toolbar",language:Xn()}))),a.createElement("div",{className:"crm-template-editor-actions"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>{P(null),U(""),z(j),W("")}},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:()=>{L.trim()?F.trim()?(B?v.updateAppointmentTemplate(B.id,L,F,O||void 0):v.saveAppointmentTemplate(L,F,O||void 0),R(v.getAppointmentTemplates()),P(null),U(""),z(j),W("")):alert((0,s.t)("crm.pleaseEnterMessageTemplate")):alert((0,s.t)("crm.pleaseEnterTemplateName"))}},B?(0,s.t)("crm.updateTemplate"):(0,s.t)("crm.saveTemplate"))))))),a.createElement("style",null,`\n        ${ma}\n\n        .crm-appointment-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          margin-bottom: 16px;\n          gap: 16px;\n        }\n\n        .crm-appointment-header .crm-search-box {\n          flex: 1;\n          max-width: 300px;\n          margin-bottom: 0;\n        }\n\n        .crm-appointment-tab .crm-table-body {\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          overflow: hidden;\n        }\n\n        .crm-meet-link {\n          display: inline-block;\n          font-size: 12px;\n          color: var(--lion-primary);\n          text-decoration: none;\n          margin-top: 4px;\n        }\n\n        .crm-meet-link:hover {\n          text-decoration: underline;\n        }\n\n        .crm-attendee-count {\n          display: inline-flex;\n          align-items: center;\n          gap: 4px;\n          padding: 2px 8px;\n          border-radius: 8px;\n          font-size: 12px;\n          font-weight: 500;\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-secondary);\n        }\n\n        .crm-reminder-badge {\n          display: inline-flex;\n          align-items: center;\n          gap: 4px;\n          padding: 2px 8px;\n          border-radius: 8px;\n          font-size: 11px;\n          font-weight: 500;\n          background: var(--lion-warning-light);\n          color: var(--lion-warning);\n        }\n\n        .crm-status-select.crm-status-scheduled {\n          background-color: var(--lion-info-light);\n          color: var(--lion-info);\n        }\n\n        .crm-status-select.crm-status-completed {\n          background-color: var(--lion-success-light);\n          color: var(--lion-success);\n        }\n\n        .crm-status-select.crm-status-cancelled {\n          background-color: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n        }\n\n        .crm-status-select.crm-status-missed {\n          background-color: var(--lion-error-light);\n          color: var(--lion-error);\n        }\n\n        .crm-appointment-modal {\n          max-width: 600px;\n          max-height: 90vh;\n        }\n\n        .crm-appointment-modal-body {\n          max-height: 60vh;\n          overflow-y: auto;\n        }\n\n        .crm-attendee-display {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          padding: 12px 16px;\n          background: var(--lion-bg-secondary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 10px;\n        }\n\n        .crm-attendee-avatar {\n          width: 40px;\n          height: 40px;\n          background: var(--lion-primary);\n          color: white;\n          border-radius: 50%;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          font-size: 16px;\n          font-weight: 600;\n        }\n\n        .crm-attendee-info {\n          flex: 1;\n        }\n\n        .crm-attendee-name {\n          font-size: 14px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-attendee-phone {\n          font-size: 12px;\n          color: var(--lion-text-muted);\n          margin-top: 2px;\n        }\n\n        .crm-meet-link-group {\n          display: flex;\n          gap: 8px;\n        }\n\n        .crm-meet-link-group .crm-form-input {\n          flex: 1;\n        }\n\n        .crm-generate-link-btn {\n          white-space: nowrap;\n        }\n\n        .crm-variable-buttons {\n          display: flex;\n          gap: 8px;\n          margin-bottom: 8px;\n          flex-wrap: wrap;\n        }\n\n        .crm-variable-btn {\n          padding: 4px 10px;\n          border: 1px solid var(--lion-border-medium);\n          border-radius: 6px;\n          background: var(--lion-bg-secondary);\n          color: var(--lion-text-secondary);\n          font-size: 12px;\n          font-family: monospace;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .crm-variable-btn:hover {\n          background: var(--lion-primary-light);\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n\n        .crm-action-cell {\n          display: flex;\n          justify-content: center;\n          gap: 4px;\n        }\n\n        .crm-action-btn {\n          background: transparent;\n          border: none;\n          padding: 6px;\n          border-radius: 6px;\n          cursor: pointer;\n          transition: all 0.2s;\n          display: inline-flex;\n          align-items: center;\n          justify-content: center;\n        }\n\n        .crm-action-edit {\n          color: var(--lion-text-muted);\n        }\n\n        .crm-action-edit:hover {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        .crm-action-delete {\n          color: var(--lion-primary);\n        }\n\n        .crm-action-delete:hover {\n          background: var(--lion-primary-light);\n          color: var(--lion-primary-hover);\n        }\n\n        .crm-form-select {\n          width: 100%;\n          padding: 10px 12px;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          font-size: 14px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-primary);\n          cursor: pointer;\n        }\n\n        .crm-form-select:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 3px var(--lion-primary-light);\n        }\n\n        .crm-form-hint {\n          display: block;\n          margin-top: 6px;\n          font-size: 12px;\n          color: var(--lion-text-muted);\n        }\n\n        .crm-status-select {\n          padding: 4px 8px;\n          border-radius: 12px;\n          border: none;\n          font-size: 12px;\n          font-weight: 500;\n          cursor: pointer;\n          appearance: none;\n          -webkit-appearance: none;\n          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");\n          background-repeat: no-repeat;\n          background-position: right 4px center;\n          padding-right: 20px;\n        }\n\n        .crm-send-now-group {\n          background: var(--lion-primary-light);\n          padding: 12px 16px;\n          border-radius: 10px;\n          border: 1px solid var(--lion-primary);\n        }\n\n        .crm-checkbox-label {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          cursor: pointer;\n        }\n\n        .crm-checkbox {\n          width: 18px;\n          height: 18px;\n          accent-color: var(--lion-primary);\n          cursor: pointer;\n        }\n\n        .crm-checkbox-text {\n          font-size: 14px;\n          font-weight: 500;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-send-now-group .crm-form-hint {\n          margin-left: 28px;\n        }\n\n        /* Modal Header Actions */\n        .crm-modal-header-actions {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .crm-template-settings-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 32px;\n          height: 32px;\n          padding: 0;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .crm-template-settings-btn:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n          background: var(--lion-primary-light);\n        }\n\n        /* Template Modal */\n        .crm-template-modal {\n          max-width: 900px !important;\n          width: 90vw;\n          max-height: 80vh;\n        }\n\n        .crm-template-modal-content {\n          display: flex;\n          gap: 20px;\n          padding: 16px;\n          max-height: calc(80vh - 120px);\n          overflow: hidden;\n        }\n\n        .crm-template-list-section {\n          width: 280px;\n          flex-shrink: 0;\n          display: flex;\n          flex-direction: column;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 10px;\n          background: var(--lion-bg-secondary);\n        }\n\n        .crm-template-list-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 12px;\n          border-bottom: 1px solid var(--lion-border-light);\n        }\n\n        .crm-template-list-title {\n          font-size: 13px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-btn-small {\n          padding: 4px 10px !important;\n          font-size: 12px !important;\n        }\n\n        .crm-template-list {\n          flex: 1;\n          overflow-y: auto;\n          padding: 8px;\n        }\n\n        .crm-template-empty {\n          padding: 20px;\n          text-align: center;\n          color: var(--lion-text-muted);\n          font-size: 13px;\n        }\n\n        .crm-template-item {\n          position: relative;\n          padding: 10px 12px;\n          border-radius: 8px;\n          cursor: pointer;\n          transition: all 0.2s;\n          border: 1px solid transparent;\n          margin-bottom: 6px;\n        }\n\n        .crm-template-item:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .crm-template-item.active {\n          background: var(--lion-primary-light);\n          border-color: var(--lion-primary);\n        }\n\n        .crm-template-item-name {\n          font-size: 13px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          margin-bottom: 4px;\n        }\n\n        .crm-template-item-preview {\n          font-size: 11px;\n          color: var(--lion-text-muted);\n          white-space: nowrap;\n          overflow: hidden;\n          text-overflow: ellipsis;\n          padding-right: 24px;\n        }\n\n        .crm-template-delete-btn {\n          position: absolute;\n          right: 8px;\n          top: 50%;\n          transform: translateY(-50%);\n          background: transparent;\n          border: none;\n          padding: 4px;\n          border-radius: 4px;\n          cursor: pointer;\n          color: var(--lion-text-muted);\n          opacity: 0;\n          transition: all 0.2s;\n        }\n\n        .crm-template-item:hover .crm-template-delete-btn {\n          opacity: 1;\n        }\n\n        .crm-template-delete-btn:hover {\n          color: var(--lion-error);\n          background: var(--lion-error-light);\n        }\n\n        .crm-template-editor-section {\n          flex: 1;\n          display: flex;\n          flex-direction: column;\n          overflow-y: auto;\n        }\n\n        .crm-template-editor-header {\n          font-size: 15px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          margin-bottom: 16px;\n          padding-bottom: 10px;\n          border-bottom: 1px solid var(--lion-border-light);\n        }\n\n        .crm-template-editor-actions {\n          display: flex;\n          justify-content: flex-end;\n          gap: 10px;\n          margin-top: 16px;\n          padding-top: 16px;\n          border-top: 1px solid var(--lion-border-light);\n        }\n      `))},$g=[{code:"BRL",symbol:"R$",locale:"pt-BR",name:"Real Brasileiro"},{code:"USD",symbol:"$",locale:"en-US",name:"US Dollar"},{code:"EUR",symbol:"€",locale:"de-DE",name:"Euro"},{code:"GBP",symbol:"£",locale:"en-GB",name:"British Pound"},{code:"AED",symbol:"د.إ",locale:"ar-AE",name:"UAE Dirham"},{code:"SAR",symbol:"﷼",locale:"ar-SA",name:"Saudi Riyal"},{code:"QAR",symbol:"ر.ق",locale:"ar-QA",name:"Qatari Riyal"},{code:"KWD",symbol:"د.ك",locale:"ar-KW",name:"Kuwaiti Dinar"},{code:"BHD",symbol:"د.ب",locale:"ar-BH",name:"Bahraini Dinar"},{code:"OMR",symbol:"ر.ع",locale:"ar-OM",name:"Omani Rial"},{code:"JPY",symbol:"¥",locale:"ja-JP",name:"Japanese Yen"},{code:"CNY",symbol:"¥",locale:"zh-CN",name:"Chinese Yuan"},{code:"KRW",symbol:"₩",locale:"ko-KR",name:"South Korean Won"},{code:"HKD",symbol:"HK$",locale:"zh-HK",name:"Hong Kong Dollar"},{code:"TWD",symbol:"NT$",locale:"zh-TW",name:"Taiwan Dollar"},{code:"SGD",symbol:"S$",locale:"en-SG",name:"Singapore Dollar"},{code:"MYR",symbol:"RM",locale:"ms-MY",name:"Malaysian Ringgit"},{code:"THB",symbol:"฿",locale:"th-TH",name:"Thai Baht"},{code:"IDR",symbol:"Rp",locale:"id-ID",name:"Indonesian Rupiah"},{code:"PHP",symbol:"₱",locale:"en-PH",name:"Philippine Peso"},{code:"VND",symbol:"₫",locale:"vi-VN",name:"Vietnamese Dong"},{code:"PKR",symbol:"₨",locale:"ur-PK",name:"Pakistani Rupee"},{code:"BDT",symbol:"৳",locale:"bn-BD",name:"Bangladeshi Taka"},{code:"NPR",symbol:"रू",locale:"ne-NP",name:"Nepalese Rupee"},{code:"LKR",symbol:"Rs",locale:"si-LK",name:"Sri Lankan Rupee"},{code:"CAD",symbol:"C$",locale:"en-CA",name:"Canadian Dollar"},{code:"MXN",symbol:"MX$",locale:"es-MX",name:"Mexican Peso"},{code:"BRL",symbol:"R$",locale:"pt-BR",name:"Brazilian Real"},{code:"ARS",symbol:"AR$",locale:"es-AR",name:"Argentine Peso"},{code:"CLP",symbol:"CL$",locale:"es-CL",name:"Chilean Peso"},{code:"COP",symbol:"CO$",locale:"es-CO",name:"Colombian Peso"},{code:"PEN",symbol:"S/",locale:"es-PE",name:"Peruvian Sol"},{code:"AUD",symbol:"A$",locale:"en-AU",name:"Australian Dollar"},{code:"NZD",symbol:"NZ$",locale:"en-NZ",name:"New Zealand Dollar"},{code:"ZAR",symbol:"R",locale:"en-ZA",name:"South African Rand"},{code:"NGN",symbol:"₦",locale:"en-NG",name:"Nigerian Naira"},{code:"KES",symbol:"KSh",locale:"en-KE",name:"Kenyan Shilling"},{code:"EGP",symbol:"E£",locale:"ar-EG",name:"Egyptian Pound"},{code:"MAD",symbol:"د.م",locale:"ar-MA",name:"Moroccan Dirham"},{code:"GHS",symbol:"GH₵",locale:"en-GH",name:"Ghanaian Cedi"},{code:"TZS",symbol:"TSh",locale:"sw-TZ",name:"Tanzanian Shilling"},{code:"UGX",symbol:"USh",locale:"en-UG",name:"Ugandan Shilling"},{code:"CHF",symbol:"CHF",locale:"de-CH",name:"Swiss Franc"},{code:"SEK",symbol:"kr",locale:"sv-SE",name:"Swedish Krona"},{code:"NOK",symbol:"kr",locale:"nb-NO",name:"Norwegian Krone"},{code:"DKK",symbol:"kr",locale:"da-DK",name:"Danish Krone"},{code:"PLN",symbol:"zł",locale:"pl-PL",name:"Polish Zloty"},{code:"CZK",symbol:"Kč",locale:"cs-CZ",name:"Czech Koruna"},{code:"HUF",symbol:"Ft",locale:"hu-HU",name:"Hungarian Forint"},{code:"RUB",symbol:"₽",locale:"ru-RU",name:"Russian Ruble"},{code:"TRY",symbol:"₺",locale:"tr-TR",name:"Turkish Lira"},{code:"UAH",symbol:"₴",locale:"uk-UA",name:"Ukrainian Hryvnia"},{code:"ILS",symbol:"₪",locale:"he-IL",name:"Israeli Shekel"}],Yg=[{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"quarterly",label:"Quarterly (3 months)"},{value:"yearly",label:"Yearly"}],Xg=async(e,t,n)=>{try{const a=Ig("income");if(!a)return;const r={};(a.dataFields||[]).forEach(a=>{if(a.enabled)switch(a.id){case"event_details":r.event={type:"income",action:e,timestamp:Date.now()};break;case"number":r.number=t.id.split("@")[0];break;case"name":r.name=t.profile.name;break;case"amount":r.amount=n.amount,r.amountFormatted=v.formatCurrency(n.amount);break;case"category":r.category=n.category;break;case"payment_method":r.paymentMethod=n.paymentMethod;break;case"description":r.description=n.description;break;case"reference":r.reference=n.reference||null;break;case"transaction_date":r.transactionDate=n.date,r.transactionDateFormatted=new Date(n.date).toLocaleDateString();break;case"status":r.status=n.status;break;case"contact_profile":r.contactProfile={fullName:t.profile.name||null,phone:t.profile.phone||null,email:t.profile.email||null}}}),r.income={id:n.id||null,amount:n.amount,amountFormatted:v.formatCurrency(n.amount),category:n.category,paymentMethod:n.paymentMethod,description:n.description,reference:n.reference||null,date:n.date,dateFormatted:new Date(n.date).toLocaleDateString(),status:n.status,isRecurring:n.isRecurring||!1,recurringInterval:n.recurringInterval||null},Rg(a.url,r,"income")}catch(e){}},Jg=({contact:e,onUpdate:t})=>{const[n,r]=(0,a.useState)(!1),[o,i]=(0,a.useState)(null),[l,c]=(0,a.useState)(""),[d,m]=(0,a.useState)(!1),[p,u]=(0,a.useState)(v.getCurrencySettings()),[g,h]=(0,a.useState)("");Mg();const b=Wg();(0,a.useEffect)(()=>{v.syncCustomOptionsToExtensionStorage()},[]);const[f,y]=(0,a.useState)(v.getCustomIncomeCategories()),[x,w]=(0,a.useState)(v.getCustomTransactionStatuses()),[k,E]=(0,a.useState)(v.getCustomPaymentMethods()),[S,C]=(0,a.useState)(v.getHiddenIncomeCategories()),[T,A]=(0,a.useState)(v.getHiddenTransactionStatuses()),[D,_]=(0,a.useState)(v.getHiddenPaymentMethods()),[N,M]=(0,a.useState)(!1),[I,R]=(0,a.useState)(!1),[B,P]=(0,a.useState)(!1),[L,U]=(0,a.useState)(""),[F,z]=(0,a.useState)(""),[O,W]=(0,a.useState)(""),[q,H]=(0,a.useState)(!1),[j,V]=(0,a.useState)(!1),[G,K]=(0,a.useState)(!1);(0,a.useEffect)(()=>{u(v.getCurrencySettings())},[d]),(0,a.useEffect)(()=>{const n=n=>{n.detail?.contactId!==e.id&&n.detail?.contactId||t()};return document.addEventListener("wa-crm-contact-updated",n),document.addEventListener("wa-crm-data-synced",n),()=>{document.removeEventListener("wa-crm-contact-updated",n),document.removeEventListener("wa-crm-data-synced",n)}},[e.id,t]);const[$,Y]=(0,a.useState)("all"),[X,J]=(0,a.useState)("all"),[Q,Z]=(0,a.useState)("all"),[ee,te]=(0,a.useState)(""),[ne,ae]=(0,a.useState)("payment"),[re,oe]=(0,a.useState)("cash"),[ie,se]=(0,a.useState)(""),[le,ce]=(0,a.useState)(""),[de,me]=(0,a.useState)(""),[pe,ue]=(0,a.useState)("completed"),[ge,he]=(0,a.useState)(!1),[be,fe]=(0,a.useState)("monthly"),[ve,ye]=(0,a.useState)(""),[xe,we]=(0,a.useState)(!0),ke=[{value:"payment",label:(0,s.t)("crm.paymentReceived")},{value:"sale",label:(0,s.t)("crm.sale")},{value:"service",label:(0,s.t)("crm.serviceFee")},{value:"commission",label:(0,s.t)("crm.commission")},{value:"refund",label:(0,s.t)("crm.refundReceived")},{value:"other",label:(0,s.t)("crm.other")}],Ee=(0,a.useMemo)(()=>[...ke.filter(e=>!S.includes(e.value)),...f.map(e=>({value:e.id,label:e.label,isCustom:!0}))],[f,S]),Se=[{value:"cash",label:(0,s.t)("crm.cash")},{value:"bank_transfer",label:(0,s.t)("crm.bankTransfer")},{value:"upi",label:(0,s.t)("crm.upi")},{value:"pix",label:(0,s.t)("crm.pix")},{value:"card",label:(0,s.t)("crm.card")},{value:"cheque",label:(0,s.t)("crm.cheque")},{value:"other",label:(0,s.t)("crm.other")}],Ce=(0,a.useMemo)(()=>[...Se.filter(e=>!D.includes(e.value)),...k.map(e=>({value:e.id,label:e.label,isCustom:!0}))],[k,D]),Te=[{value:"completed",label:(0,s.t)("crm.completed")},{value:"pending",label:(0,s.t)("crm.pending")},{value:"cancelled",label:(0,s.t)("crm.cancelled")}],Ae=(0,a.useMemo)(()=>[...Te.filter(e=>!T.includes(e.value)),...x.map(e=>({value:e.id,label:e.label,isCustom:!0}))],[x,T]),De=()=>{L.trim()&&(v.addCustomIncomeCategory(L.trim()),y(v.getCustomIncomeCategories()),U(""),M(!1))},_e=e=>{v.deleteCustomIncomeCategory(e),y(v.getCustomIncomeCategories()),ne===e&&ae("payment")},Ne=()=>{F.trim()&&(v.addCustomTransactionStatus(F.trim()),w(v.getCustomTransactionStatuses()),z(""),R(!1))},Me=e=>{v.deleteCustomTransactionStatus(e),w(v.getCustomTransactionStatuses()),pe===e&&ue("completed")},Ie=()=>{O.trim()&&(v.addCustomPaymentMethod(O.trim()),E(v.getCustomPaymentMethods()),W(""),P(!1))},Re=e=>{v.deleteCustomPaymentMethod(e),E(v.getCustomPaymentMethods()),re===e&&oe("cash")},Be=(e,t)=>{const n=new Date(e);switch(t){case"daily":n.setDate(n.getDate()+1);break;case"weekly":n.setDate(n.getDate()+7);break;case"monthly":n.setMonth(n.getMonth()+1);break;case"quarterly":n.setMonth(n.getMonth()+3);break;case"yearly":n.setFullYear(n.getFullYear()+1)}return n.getTime()},Pe=e=>v.formatCurrency(e),Le=(0,a.useMemo)(()=>{let t=e.incomes||[];if(l){const e=l.toLowerCase();t=t.filter(t=>t.description.toLowerCase().includes(e)||t.reference?.toLowerCase().includes(e))}if("all"!==$&&(t=t.filter(e=>e.category===$)),"all"!==X&&(t=t.filter(e=>e.status===X)),"all"!==Q){const e=Date.now(),n=864e5;let a=0;switch(Q){case"today":a=e-n;break;case"week":a=e-7*n;break;case"month":a=e-30*n;break;case"year":a=e-365*n}t=t.filter(e=>e.date>=a)}return t.sort((e,t)=>t.date-e.date)},[e.incomes,l,$,X,Q]),Ue=(0,a.useMemo)(()=>{const t=e.incomes||[];return{completed:t.filter(e=>"completed"===e.status).reduce((e,t)=>e+t.amount,0),pending:t.filter(e=>"pending"===e.status).reduce((e,t)=>e+t.amount,0),filteredTotal:Le.filter(e=>"completed"===e.status).reduce((e,t)=>e+t.amount,0)}},[e.incomes,Le]),Fe=e=>{switch(e){case"completed":return"crm-status-completed";case"pending":return"crm-status-pending";case"cancelled":return"crm-status-cancelled";default:return""}};return a.createElement("div",{className:"crm-income-tab "+(b?"lion-dark":"")},a.createElement("div",{className:"crm-currency-settings-row"},a.createElement("button",{className:"crm-currency-btn",onClick:()=>m(!0),title:"Currency Settings"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94L14.4 2.81c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"})),a.createElement("span",null,p.symbol," ",p.code))),a.createElement("div",{className:"crm-income-summary"},a.createElement("div",{className:"crm-summary-card crm-summary-total"},a.createElement("div",{className:"crm-summary-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1.41 16.09V20h-2.67v-1.93c-1.71-.36-3.16-1.46-3.27-3.4h1.96c.1 1.05.82 1.87 2.65 1.87 1.96 0 2.4-.98 2.4-1.59 0-.83-.44-1.61-2.67-2.14-2.48-.6-4.18-1.62-4.18-3.67 0-1.72 1.39-2.84 3.11-3.21V4h2.67v1.95c1.86.45 2.79 1.86 2.85 3.39H14.3c-.05-1.11-.64-1.87-2.22-1.87-1.5 0-2.4.68-2.4 1.64 0 .84.65 1.39 2.67 1.91s4.18 1.39 4.18 3.91c-.01 1.83-1.38 2.83-3.12 3.16z"}))),a.createElement("div",{className:"crm-summary-content"},a.createElement("div",{className:"crm-summary-label"},(0,s.t)("crm.totalIncome")),a.createElement("div",{className:"crm-summary-value"},Pe(Ue.completed)))),a.createElement("div",{className:"crm-summary-card crm-summary-pending"},a.createElement("div",{className:"crm-summary-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm.5-13H11v6l5.2 3.2.8-1.3-4.5-2.7V7z"}))),a.createElement("div",{className:"crm-summary-content"},a.createElement("div",{className:"crm-summary-label"},(0,s.t)("crm.pending")),a.createElement("div",{className:"crm-summary-value"},Pe(Ue.pending)))),a.createElement("div",{className:"crm-summary-card crm-summary-filtered"},a.createElement("div",{className:"crm-summary-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:"currentColor",d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}))),a.createElement("div",{className:"crm-summary-content"},a.createElement("div",{className:"crm-summary-label"},(0,s.t)("crm.filteredTotal")),a.createElement("div",{className:"crm-summary-value"},Pe(Ue.filteredTotal))))),a.createElement("div",{className:"crm-income-filters"},a.createElement("div",{className:"crm-search-box"},a.createElement("svg",{className:"crm-search-icon",viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),a.createElement("input",{type:"text",className:"crm-search-input",placeholder:(0,s.t)("crm.search"),value:l,onChange:e=>c(e.target.value)})),a.createElement("div",{className:"crm-filter-with-add"},a.createElement("select",{className:"crm-filter-select",value:$,onChange:e=>Y(e.target.value)},a.createElement("option",{value:"all"},(0,s.t)("crm.allCategories")),Ee.map(e=>a.createElement("option",{key:e.value,value:e.value},e.label,e.isCustom?" ✦":""))),a.createElement("button",{type:"button",className:"crm-filter-add-btn",onClick:()=>M(!0),title:(0,s.t)("crm.addCustomCategory")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})))),a.createElement("div",{className:"crm-filter-with-add"},a.createElement("select",{className:"crm-filter-select",value:X,onChange:e=>J(e.target.value)},a.createElement("option",{value:"all"},(0,s.t)("crm.allStatus")),Ae.map(e=>a.createElement("option",{key:e.value,value:e.value},e.label,e.isCustom?" ✦":""))),a.createElement("button",{type:"button",className:"crm-filter-add-btn",onClick:()=>R(!0),title:(0,s.t)("crm.addCustomStatus")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})))),a.createElement("select",{className:"crm-filter-select",value:Q,onChange:e=>Z(e.target.value)},a.createElement("option",{value:"all"},(0,s.t)("crm.all")),a.createElement("option",{value:"today"},(0,s.t)("crm.today")),a.createElement("option",{value:"week"},(0,s.t)("crm.thisWeek")),a.createElement("option",{value:"month"},(0,s.t)("crm.thisMonth")),a.createElement("option",{value:"year"},(0,s.t)("crm.thisYear"))),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:()=>{te(""),ae("payment"),oe("cash"),se(""),ce(""),me((()=>{const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`})()),ue("completed"),he(!1),fe("monthly"),ye(""),we(!0),i(null),r(!0)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),(0,s.t)("crm.addIncome"))),a.createElement("div",{className:"crm-table-header"},a.createElement("div",{className:"crm-table-header-cell",style:{flex:1}},(0,s.t)("crm.tableDescription")),a.createElement("div",{className:"crm-table-header-cell",style:{width:120}},(0,s.t)("crm.tableCategory")),a.createElement("div",{className:"crm-table-header-cell",style:{width:100}},(0,s.t)("crm.tableAmount")),a.createElement("div",{className:"crm-table-header-cell",style:{width:100}},(0,s.t)("crm.tablePayment")),a.createElement("div",{className:"crm-table-header-cell",style:{width:100}},(0,s.t)("crm.tableDate")),a.createElement("div",{className:"crm-table-header-cell",style:{width:90}},(0,s.t)("crm.tableStatus")),a.createElement("div",{className:"crm-table-header-cell",style:{width:80,textAlign:"center"}},(0,s.t)("crm.tableAction"))),Le.length>0?a.createElement("div",{className:"crm-table-body"},Le.map(n=>{return a.createElement("div",{key:n.id,className:"crm-table-row"},a.createElement("div",{className:"crm-table-cell",style:{flex:1}},a.createElement("div",{className:"crm-income-description"},n.description,n.isRecurring&&a.createElement("span",{className:"crm-recurring-badge"},"🔄 ",Yg.find(e=>e.value===n.recurringInterval)?.label||"Recurring")),n.reference&&a.createElement("div",{className:"crm-income-reference"},"Ref: ",n.reference)),a.createElement("div",{className:"crm-table-cell",style:{width:120}},a.createElement("span",{className:"crm-category-badge"},(d=n.category,Ee.find(e=>e.value===d)?.label||d))),a.createElement("div",{className:"crm-table-cell crm-amount-cell",style:{width:100}},Pe(n.amount)),a.createElement("div",{className:"crm-table-cell",style:{width:100,color:ca.textMuted,fontSize:12}},(c=n.paymentMethod,Ce.find(e=>e.value===c)?.label||c)),a.createElement("div",{className:"crm-table-cell",style:{width:100,color:ca.textMuted,fontSize:12}},(l=n.date,new Date(l).toLocaleDateString("pt-BR",{year:"numeric",month:"short",day:"numeric"}))),a.createElement("div",{className:"crm-table-cell",style:{width:90}},a.createElement("span",{className:`crm-status-badge ${Fe(n.status)}`},(o=n.status,Ae.find(e=>e.value===o)?.label||o))),a.createElement("div",{className:"crm-table-cell crm-action-cell",style:{width:80}},a.createElement("button",{className:"crm-action-btn crm-action-edit",onClick:()=>(e=>{te(e.amount.toString()),ae(e.category),oe(e.paymentMethod),se(e.description),ce(e.reference||"");const t=new Date(e.date),n=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");if(me(`${n}-${a}-${o}`),ue(e.status),he(e.isRecurring||!1),fe(e.recurringInterval||"monthly"),e.recurringEndDate){const t=new Date(e.recurringEndDate),n=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");ye(`${n}-${a}-${r}`),we(!1)}else ye(""),we(!0);i(e),r(!0)})(n),title:"Edit"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}))),a.createElement("button",{className:"crm-action-btn crm-action-delete",onClick:()=>(n=>{if(confirm((0,s.t)("crm.deleteIncomeConfirm"))){const a=(e.incomes||[]).find(e=>e.id===n);v.deleteIncome(e.id,n),a&&Xg("deleted",e,{id:n,amount:a.amount,category:a.category,paymentMethod:a.paymentMethod,description:a.description,reference:a.reference,date:a.date,status:a.status,isRecurring:a.isRecurring,recurringInterval:a.recurringInterval}),window.dispatchEvent(new CustomEvent("crm-income-updated",{detail:{contactId:e.id,action:"deleted"}})),t()}})(n.id),title:"Delete"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})))));var o,l,c,d})):a.createElement("div",{className:"crm-empty-state"},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1.41 16.09V20h-2.67v-1.93c-1.71-.36-3.16-1.46-3.27-3.4h1.96c.1 1.05.82 1.87 2.65 1.87 1.96 0 2.4-.98 2.4-1.59 0-.83-.44-1.61-2.67-2.14-2.48-.6-4.18-1.62-4.18-3.67 0-1.72 1.39-2.84 3.11-3.21V4h2.67v1.95c1.86.45 2.79 1.86 2.85 3.39H14.3c-.05-1.11-.64-1.87-2.22-1.87-1.5 0-2.4.68-2.4 1.64 0 .84.65 1.39 2.67 1.91s4.18 1.39 4.18 3.91c-.01 1.83-1.38 2.83-3.12 3.16z"})),a.createElement("div",{className:"crm-empty-state-text"},(0,s.t)("crm.noIncomeRecords"))),d&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>{m(!1),h("")}}),a.createElement("div",{className:"crm-sub-modal crm-currency-modal"},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h4",null,(0,s.t)("crm.currencySettings")),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>{m(!1),h("")}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})))),a.createElement("div",{className:"crm-currency-search"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),a.createElement("input",{type:"text",placeholder:(0,s.t)("crm.searchCurrency"),value:g,onChange:e=>h(e.target.value),autoFocus:!0})),a.createElement("div",{className:"crm-currency-list"},$g.filter(e=>""===g||e.name.toLowerCase().includes(g.toLowerCase())||e.code.toLowerCase().includes(g.toLowerCase())||e.symbol.includes(g)).map(e=>a.createElement("button",{key:e.code,className:"crm-currency-option "+(p.code===e.code?"active":""),onClick:()=>{(e=>{v.setCurrencySettings(e.code,e.symbol,e.locale),u({code:e.code,symbol:e.symbol,locale:e.locale}),m(!1)})(e),h("")}},a.createElement("span",{className:"crm-currency-symbol"},e.symbol),a.createElement("span",{className:"crm-currency-name"},e.name),a.createElement("span",{className:"crm-currency-code"},e.code),p.code===e.code&&a.createElement("svg",{className:"crm-currency-check",viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})))),0===$g.filter(e=>""===g||e.name.toLowerCase().includes(g.toLowerCase())||e.code.toLowerCase().includes(g.toLowerCase())||e.symbol.includes(g)).length&&a.createElement("div",{className:"crm-currency-no-results"},(0,s.t)("crm.noCurrenciesFound"))))),n&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>r(!1)}),a.createElement("div",{className:"crm-sub-modal"},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h3",{className:"crm-sub-modal-title"},o?(0,s.t)("crm.editIncomeTitle"):(0,s.t)("crm.addIncomeTitle")),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>r(!1)},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"crm-sub-modal-body"},a.createElement("div",{className:"crm-form-row"},a.createElement("div",{className:"crm-form-group",style:{flex:1}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.amount")," ",a.createElement("span",{style:{color:ca.error}},"*")),a.createElement("input",{type:"number",className:"crm-form-input",placeholder:(0,s.t)("crm.enterAmount"),value:ee,onChange:e=>te(e.target.value),min:"0",step:"0.01"})),a.createElement("div",{className:"crm-form-group",style:{flex:1}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.date")),a.createElement("input",{type:"date",className:"crm-form-input",value:de,onChange:e=>me(e.target.value)}))),a.createElement("div",{className:"crm-form-row"},a.createElement("div",{className:"crm-form-group",style:{flex:1}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.category")),a.createElement("div",{className:"crm-custom-dropdown-container"},a.createElement("div",{className:"crm-custom-dropdown-trigger",onClick:()=>H(!q)},a.createElement("span",null,Ee.find(e=>e.value===ne)?.label||ne),a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M7 10l5 5 5-5z"}))),q&&a.createElement("div",{className:"crm-custom-dropdown-menu"},Ee.map(e=>a.createElement("div",{key:e.value,className:"crm-custom-dropdown-item "+(ne===e.value?"selected":"")},a.createElement("span",{className:"crm-custom-dropdown-item-label",onClick:()=>{ae(e.value),H(!1)}},e.label,e.isCustom?" ✦":""),a.createElement("button",{type:"button",className:"crm-custom-dropdown-delete",onClick:t=>{t.stopPropagation(),((e,t)=>{if(t)_e(e);else if(v.hideIncomeCategory(e),C(v.getHiddenIncomeCategories()),ne===e){const t=ke.filter(t=>t.value!==e&&!S.includes(t.value));t.length>0?ae(t[0].value):f.length>0&&ae(f[0].id)}})(e.value,e.isCustom||!1)},title:(0,s.t)("crm.delete")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))))),a.createElement("div",{className:"crm-custom-dropdown-item crm-custom-dropdown-add",onClick:()=>{H(!1),M(!0)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),a.createElement("span",null,(0,s.t)("crm.addCustomCategory")))))),a.createElement("div",{className:"crm-form-group",style:{flex:1}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.paymentMethod")),a.createElement("div",{className:"crm-custom-dropdown-container"},a.createElement("div",{className:"crm-custom-dropdown-trigger",onClick:()=>K(!G)},a.createElement("span",null,Ce.find(e=>e.value===re)?.label||re),a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M7 10l5 5 5-5z"}))),G&&a.createElement("div",{className:"crm-custom-dropdown-menu"},Ce.map(e=>a.createElement("div",{key:e.value,className:"crm-custom-dropdown-item "+(re===e.value?"selected":"")},a.createElement("span",{className:"crm-custom-dropdown-item-label",onClick:()=>{oe(e.value),K(!1)}},e.label,e.isCustom?" ✦":""),a.createElement("button",{type:"button",className:"crm-custom-dropdown-delete",onClick:t=>{t.stopPropagation(),((e,t)=>{if(t)Re(e);else if(v.hidePaymentMethod(e),_(v.getHiddenPaymentMethods()),re===e){const t=Se.filter(t=>t.value!==e&&!D.includes(t.value));t.length>0?oe(t[0].value):k.length>0&&oe(k[0].id)}})(e.value,e.isCustom||!1)},title:(0,s.t)("crm.delete")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))))),a.createElement("div",{className:"crm-custom-dropdown-item crm-custom-dropdown-add",onClick:()=>{K(!1),P(!0)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),a.createElement("span",null,(0,s.t)("crm.addCustomPaymentMethod"))))))),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.description")," ",a.createElement("span",{style:{color:ca.error}},"*")),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.paymentDescription"),value:ie,onChange:e=>se(e.target.value)})),a.createElement("div",{className:"crm-form-row"},a.createElement("div",{className:"crm-form-group",style:{flex:1}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.referenceInvoice")),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.invoicePlaceholder"),value:le,onChange:e=>ce(e.target.value)})),a.createElement("div",{className:"crm-form-group",style:{flex:1}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.status")),a.createElement("div",{className:"crm-custom-dropdown-container"},a.createElement("div",{className:"crm-custom-dropdown-trigger",onClick:()=>V(!j)},a.createElement("span",null,Ae.find(e=>e.value===pe)?.label||pe),a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M7 10l5 5 5-5z"}))),j&&a.createElement("div",{className:"crm-custom-dropdown-menu"},Ae.map(e=>a.createElement("div",{key:e.value,className:"crm-custom-dropdown-item "+(pe===e.value?"selected":"")},a.createElement("span",{className:"crm-custom-dropdown-item-label",onClick:()=>{ue(e.value),V(!1)}},e.label,e.isCustom?" ✦":""),a.createElement("button",{type:"button",className:"crm-custom-dropdown-delete",onClick:t=>{t.stopPropagation(),((e,t)=>{if(t)Me(e);else if(v.hideTransactionStatus(e),A(v.getHiddenTransactionStatuses()),pe===e){const t=Te.filter(t=>t.value!==e&&!T.includes(t.value));t.length>0?ue(t[0].value):x.length>0&&ue(x[0].id)}})(e.value,e.isCustom||!1)},title:(0,s.t)("crm.delete")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))))),a.createElement("div",{className:"crm-custom-dropdown-item crm-custom-dropdown-add",onClick:()=>{V(!1),R(!0)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),a.createElement("span",null,(0,s.t)("crm.addCustomStatus"))))))),a.createElement("div",{className:"crm-recurring-section"},a.createElement("div",{className:"crm-recurring-header"},a.createElement("label",{className:"crm-toggle-label"},a.createElement("span",{className:"crm-recurring-icon"},"🔄"),a.createElement("span",null,(0,s.t)("crm.recurringTransaction")||"Recurring Transaction")),a.createElement("label",{className:"crm-toggle-switch"},a.createElement("input",{type:"checkbox",checked:ge,onChange:e=>he(e.target.checked)}),a.createElement("span",{className:"crm-toggle-slider"}))),ge&&a.createElement("div",{className:"crm-recurring-options"},a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.repeatEvery")||"Repeat Every"),a.createElement("select",{className:"crm-form-select",value:be,onChange:e=>fe(e.target.value)},Yg.map(e=>a.createElement("option",{key:e.value,value:e.value},e.label)))),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-checkbox-label"},a.createElement("input",{type:"checkbox",checked:xe,onChange:e=>we(e.target.checked)}),a.createElement("span",null,(0,s.t)("crm.neverEnds")||"Never ends"))),!xe&&a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.endDate")||"End Date"),a.createElement("input",{type:"date",className:"crm-form-input",value:ve,onChange:e=>ye(e.target.value),min:de}))))),a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>r(!1)},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:()=>{const n=parseFloat(ee);if(!n||n<=0)return void alert((0,s.t)("crm.validAmountRequired"));if(!ie.trim())return void alert((0,s.t)("crm.descriptionRequired"));const a=new Date(de+"T00:00:00").getTime(),i=ge?{isRecurring:!0,recurringInterval:be,recurringEndDate:xe?void 0:ve?new Date(ve+"T00:00:00").getTime():void 0,nextOccurrence:Be(a,be)}:{isRecurring:!1,recurringInterval:void 0,recurringEndDate:void 0,nextOccurrence:void 0};if(o)v.updateIncome(e.id,o.id,{amount:n,category:ne,paymentMethod:re,description:ie,reference:le||void 0,date:a,status:pe,...i}),Xg("updated",e,{id:o.id,amount:n,category:ne,paymentMethod:re,description:ie,reference:le||void 0,date:a,status:pe,isRecurring:i.isRecurring,recurringInterval:i.recurringInterval}),window.dispatchEvent(new CustomEvent("crm-income-updated",{detail:{contactId:e.id,action:"updated"}}));else{const t=v.addIncome(e.id,n,ne,re,ie,a,le||void 0,pe,i.isRecurring?i:void 0);Xg("created",e,{id:t?.id,amount:n,category:ne,paymentMethod:re,description:ie,reference:le||void 0,date:a,status:pe,isRecurring:i.isRecurring,recurringInterval:i.recurringInterval}),window.dispatchEvent(new CustomEvent("crm-income-updated",{detail:{contactId:e.id,action:"created"}}))}r(!1),t()}},o?(0,s.t)("crm.update"):(0,s.t)("crm.addIncomeBtn"))))),N&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-overlay",onClick:()=>M(!1)}),a.createElement("div",{className:"crm-sub-modal",style:{maxWidth:"360px"}},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h4",null,(0,s.t)("crm.addCategory")||"Add Custom Category"),a.createElement("button",{className:"crm-close-btn",onClick:()=>M(!1)},"×")),a.createElement("div",{className:"crm-sub-modal-body"},a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.categoryName")||"Category Name"),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.enterCategoryName")||"Enter category name",value:L,onChange:e=>U(e.target.value),onKeyPress:e=>"Enter"===e.key&&De()})),f.length>0&&a.createElement("div",{style:{marginTop:"16px"}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.customCategories")||"Custom Categories"),a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginTop:"8px"}},f.map(e=>a.createElement("div",{key:e.id,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",background:"var(--lion-bg-secondary)",borderRadius:"6px"}},a.createElement("span",null,e.label),a.createElement("button",{onClick:()=>_e(e.id),style:{background:"none",border:"none",color:ca.error,cursor:"pointer",padding:"4px"},title:(0,s.t)("crm.delete")||"Delete"},"×")))))),a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>M(!1)},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:De},(0,s.t)("crm.add")||"Add")))),I&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-overlay",onClick:()=>R(!1)}),a.createElement("div",{className:"crm-sub-modal",style:{maxWidth:"360px"}},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h4",null,(0,s.t)("crm.addStatus")||"Add Custom Status"),a.createElement("button",{className:"crm-close-btn",onClick:()=>R(!1)},"×")),a.createElement("div",{className:"crm-sub-modal-body"},a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.statusName")||"Status Name"),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.enterStatusName")||"Enter status name",value:F,onChange:e=>z(e.target.value),onKeyPress:e=>"Enter"===e.key&&Ne()})),x.length>0&&a.createElement("div",{style:{marginTop:"16px"}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.customStatuses")||"Custom Statuses"),a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginTop:"8px"}},x.map(e=>a.createElement("div",{key:e.id,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",background:"var(--lion-bg-secondary)",borderRadius:"6px"}},a.createElement("span",null,e.label),a.createElement("button",{onClick:()=>Me(e.id),style:{background:"none",border:"none",color:ca.error,cursor:"pointer",padding:"4px"},title:(0,s.t)("crm.delete")||"Delete"},"×")))))),a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>R(!1)},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:Ne},(0,s.t)("crm.add")||"Add")))),B&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-overlay",onClick:()=>P(!1)}),a.createElement("div",{className:"crm-sub-modal",style:{maxWidth:"360px"}},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h4",null,(0,s.t)("crm.addCustomPaymentMethod")||"Add Custom Payment Method"),a.createElement("button",{className:"crm-close-btn",onClick:()=>P(!1)},"×")),a.createElement("div",{className:"crm-sub-modal-body"},a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.paymentMethodName")||"Payment Method Name"),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.enterPaymentMethodName")||"Enter payment method name",value:O,onChange:e=>W(e.target.value),onKeyPress:e=>"Enter"===e.key&&Ie()})),k.length>0&&a.createElement("div",{style:{marginTop:"16px"}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.customPaymentMethods")||"Custom Payment Methods"),a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginTop:"8px"}},k.map(e=>a.createElement("div",{key:e.id,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",background:"var(--lion-bg-secondary)",borderRadius:"6px"}},a.createElement("span",null,e.label),a.createElement("button",{onClick:()=>Re(e.id),style:{background:"none",border:"none",color:ca.error,cursor:"pointer",padding:"4px"},title:(0,s.t)("crm.delete")||"Delete"},"×")))))),a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>P(!1)},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:Ie},(0,s.t)("crm.add")||"Add")))),a.createElement("style",null,`\n        ${ma}\n\n        .crm-currency-settings-row {\n          display: flex;\n          justify-content: flex-end;\n          margin-bottom: 12px;\n        }\n\n        .crm-currency-btn {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          padding: 6px 12px;\n          background: var(--lion-bg-secondary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 6px;\n          color: var(--lion-text-secondary);\n          font-size: 12px;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .crm-currency-btn:hover {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n\n        .crm-currency-modal {\n          max-width: 360px;\n          max-height: 400px;\n        }\n\n        .crm-currency-list {\n          display: flex;\n          flex-direction: column;\n          gap: 4px;\n          padding: 12px;\n          max-height: 320px;\n          overflow-y: auto;\n        }\n\n        .crm-currency-option {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          padding: 10px 12px;\n          background: var(--lion-bg-secondary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          cursor: pointer;\n          transition: all 0.2s;\n          text-align: left;\n        }\n\n        .crm-currency-option:hover {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-primary);\n        }\n\n        .crm-currency-option.active {\n          background: rgba(var(--lion-primary-rgb), 0.1);\n          border-color: var(--lion-primary);\n        }\n\n        .crm-currency-symbol {\n          width: 28px;\n          height: 28px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          background: var(--lion-bg-tertiary);\n          border-radius: 6px;\n          font-weight: 600;\n          font-size: 14px;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-currency-option.active .crm-currency-symbol {\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        .crm-currency-name {\n          flex: 1;\n          font-size: 13px;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-currency-code {\n          font-size: 11px;\n          color: var(--lion-text-muted);\n          font-weight: 500;\n        }\n\n        .crm-currency-check {\n          color: var(--lion-primary);\n          margin-left: auto;\n        }\n\n        .crm-currency-search {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          padding: 8px 12px;\n          margin: 0 12px 8px 12px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n        }\n\n        .crm-currency-search svg {\n          color: var(--lion-text-muted);\n          flex-shrink: 0;\n        }\n\n        .crm-currency-search input {\n          flex: 1;\n          border: none;\n          background: transparent;\n          font-size: 13px;\n          color: var(--lion-text-primary);\n          outline: none;\n        }\n\n        .crm-currency-search input::placeholder {\n          color: var(--lion-text-muted);\n        }\n\n        .crm-currency-no-results {\n          padding: 20px;\n          text-align: center;\n          color: var(--lion-text-muted);\n          font-size: 13px;\n        }\n\n        .crm-income-summary {\n          display: grid;\n          grid-template-columns: repeat(3, 1fr);\n          gap: 16px;\n          margin-bottom: 20px;\n        }\n\n        .crm-summary-card {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          padding: 16px;\n          border-radius: 12px;\n          background: var(--lion-bg-secondary);\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .crm-summary-card.crm-summary-total {\n          background: linear-gradient(135deg, var(--lion-success-light) 0%, rgba(16, 185, 129, 0.05) 100%);\n          border-color: rgba(16, 185, 129, 0.3);\n        }\n\n        .crm-summary-card.crm-summary-total .crm-summary-icon {\n          color: var(--lion-success);\n        }\n\n        .crm-summary-card.crm-summary-pending {\n          background: linear-gradient(135deg, rgba(var(--lion-primary-rgb), 0.1) 0%, rgba(var(--lion-primary-rgb), 0.05) 100%);\n          border-color: rgba(var(--lion-primary-rgb), 0.3);\n        }\n\n        .crm-summary-card.crm-summary-pending .crm-summary-icon {\n          color: var(--lion-primary);\n        }\n\n        .crm-summary-card.crm-summary-filtered .crm-summary-icon {\n          color: var(--lion-text-muted);\n        }\n\n        .crm-summary-icon {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 48px;\n          height: 48px;\n          border-radius: 12px;\n          background: var(--lion-bg-primary);\n        }\n\n        .crm-summary-label {\n          font-size: 12px;\n          color: var(--lion-text-muted);\n          margin-bottom: 4px;\n        }\n\n        .crm-summary-value {\n          font-size: 18px;\n          font-weight: 700;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-income-filters {\n          display: flex;\n          gap: 12px;\n          margin-bottom: 16px;\n          flex-wrap: wrap;\n          align-items: center;\n        }\n\n        .crm-income-filters .crm-search-box {\n          flex: 1;\n          min-width: 200px;\n          margin-bottom: 0;\n        }\n\n        .crm-filter-select {\n          padding: 8px 12px;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          font-size: 13px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-primary);\n          cursor: pointer;\n        }\n\n        .crm-filter-select:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n        }\n\n        .crm-filter-with-add {\n          display: flex;\n          align-items: center;\n          gap: 4px;\n        }\n\n        .crm-filter-add-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 28px;\n          height: 28px;\n          padding: 0;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 6px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          transition: all 0.2s;\n          flex-shrink: 0;\n        }\n\n        .crm-filter-add-btn:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n          background: rgba(var(--lion-primary-rgb), 0.1);\n        }\n\n        .crm-income-tab .crm-table-body {\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          overflow: hidden;\n        }\n\n        .crm-income-description {\n          font-weight: 500;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-income-reference {\n          font-size: 11px;\n          color: var(--lion-text-muted);\n          margin-top: 2px;\n        }\n\n        .crm-category-badge {\n          display: inline-block;\n          padding: 2px 8px;\n          border-radius: 6px;\n          font-size: 11px;\n          font-weight: 500;\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-secondary);\n        }\n\n        .crm-amount-cell {\n          font-weight: 600;\n          color: var(--lion-success) !important;\n        }\n\n        .crm-status-badge {\n          display: inline-block;\n          padding: 2px 8px;\n          border-radius: 10px;\n          font-size: 11px;\n          font-weight: 500;\n          text-transform: capitalize;\n        }\n\n        .crm-status-completed {\n          background: var(--lion-success-light);\n          color: var(--lion-success);\n        }\n\n        .crm-status-pending {\n          background: rgba(var(--lion-primary-rgb), 0.15);\n          color: var(--lion-primary);\n        }\n\n        .crm-status-cancelled {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n        }\n\n        .crm-form-row {\n          display: flex;\n          gap: 16px;\n        }\n\n        .crm-action-cell {\n          display: flex;\n          justify-content: center;\n          gap: 4px;\n        }\n\n        .crm-action-btn {\n          background: transparent;\n          border: none;\n          padding: 6px;\n          border-radius: 6px;\n          cursor: pointer;\n          transition: all 0.2s;\n          display: inline-flex;\n          align-items: center;\n          justify-content: center;\n        }\n\n        .crm-action-edit {\n          color: var(--lion-text-muted);\n        }\n\n        .crm-action-edit:hover {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        .crm-action-delete {\n          color: var(--lion-error);\n        }\n\n        .crm-action-delete:hover {\n          background: var(--lion-error-light);\n        }\n\n        /* Custom Category/Status Add Button */\n        .crm-select-with-add {\n          display: flex;\n          gap: 8px;\n          align-items: center;\n        }\n\n        .crm-select-with-add .crm-form-select {\n          flex: 1;\n        }\n\n        .crm-add-custom-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 36px;\n          height: 36px;\n          padding: 0;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          transition: all 0.2s;\n          flex-shrink: 0;\n        }\n\n        .crm-add-custom-btn:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n          background: rgba(var(--lion-primary-rgb), 0.1);\n        }\n\n        /* Sub Modal Overlay */\n        .crm-sub-modal-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.5);\n          z-index: 10003;\n        }\n\n        .crm-close-btn {\n          background: transparent;\n          border: none;\n          font-size: 20px;\n          cursor: pointer;\n          color: var(--lion-text-muted);\n          padding: 4px 8px;\n          border-radius: 4px;\n        }\n\n        .crm-close-btn:hover {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        /* Custom Dropdown with Delete */\n        .crm-custom-dropdown-container {\n          position: relative;\n          width: 100%;\n        }\n\n        .crm-custom-dropdown-trigger {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 10px 12px;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-primary);\n          cursor: pointer;\n          font-size: 14px;\n          transition: all 0.2s;\n        }\n\n        .crm-custom-dropdown-trigger:hover {\n          border-color: var(--lion-primary);\n        }\n\n        .crm-custom-dropdown-trigger svg {\n          color: var(--lion-text-muted);\n        }\n\n        .crm-custom-dropdown-menu {\n          position: absolute;\n          top: 100%;\n          left: 0;\n          right: 0;\n          margin-top: 4px;\n          background: var(--lion-bg-secondary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n          z-index: 100;\n          max-height: 200px;\n          overflow-y: auto;\n        }\n\n        .crm-custom-dropdown-item {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 10px 12px;\n          cursor: pointer;\n          transition: all 0.15s;\n        }\n\n        .crm-custom-dropdown-item:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .crm-custom-dropdown-item.selected {\n          background: rgba(var(--lion-primary-rgb), 0.1);\n        }\n\n        .crm-custom-dropdown-item.selected .crm-custom-dropdown-item-label {\n          color: var(--lion-primary);\n          font-weight: 500;\n        }\n\n        .crm-custom-dropdown-item-label {\n          flex: 1;\n          font-size: 14px;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-custom-dropdown-delete {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 24px;\n          height: 24px;\n          padding: 0;\n          border: none;\n          background: transparent;\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          border-radius: 4px;\n          transition: all 0.15s;\n          margin-left: 8px;\n        }\n\n        .crm-custom-dropdown-delete:hover {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n        }\n\n        .crm-custom-dropdown-add {\n          border-top: 1px solid var(--lion-border-light);\n          color: var(--lion-primary);\n          gap: 8px;\n        }\n\n        .crm-custom-dropdown-add span {\n          color: var(--lion-primary);\n          font-size: 13px;\n        }\n\n        .crm-custom-dropdown-add:hover {\n          background: rgba(var(--lion-primary-rgb), 0.1);\n        }\n\n        /* Recurring Transaction Styles */\n        .crm-recurring-section {\n          margin-top: 16px;\n          padding: 16px;\n          background: var(--lion-bg-secondary);\n          border-radius: 10px;\n          border: 1px solid var(--lion-border);\n        }\n\n        .crm-recurring-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n        }\n\n        .crm-toggle-label {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          font-weight: 500;\n          color: var(--lion-text);\n        }\n\n        .crm-recurring-icon {\n          font-size: 18px;\n        }\n\n        .crm-toggle-switch {\n          position: relative;\n          display: inline-block;\n          width: 48px;\n          height: 26px;\n          cursor: pointer;\n          flex-shrink: 0;\n        }\n\n        .crm-toggle-switch input {\n          opacity: 0;\n          width: 0;\n          height: 0;\n          position: absolute;\n        }\n\n        .crm-toggle-slider {\n          position: absolute;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: #ccc;\n          border-radius: 26px;\n          transition: 0.3s;\n        }\n\n        .crm-toggle-slider:before {\n          content: '';\n          position: absolute;\n          width: 20px;\n          height: 20px;\n          left: 3px;\n          top: 3px;\n          background: white;\n          border-radius: 50%;\n          transition: 0.3s;\n          box-shadow: 0 2px 4px rgba(0,0,0,0.2);\n        }\n\n        .crm-toggle-switch input:checked + .crm-toggle-slider {\n          background: var(--lion-primary);\n        }\n\n        .crm-toggle-switch input:checked + .crm-toggle-slider:before {\n          transform: translateX(22px);\n        }\n\n        .crm-recurring-options {\n          margin-top: 16px;\n          padding-top: 16px;\n          border-top: 1px solid var(--lion-border);\n          display: flex;\n          flex-direction: column;\n          gap: 12px;\n        }\n\n        .crm-checkbox-label {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          cursor: pointer;\n          font-size: 14px;\n          color: var(--lion-text-secondary);\n        }\n\n        .crm-checkbox-label input[type="checkbox"] {\n          width: 16px;\n          height: 16px;\n          accent-color: var(--lion-primary);\n        }\n\n        .crm-recurring-badge {\n          display: inline-flex;\n          align-items: center;\n          gap: 4px;\n          font-size: 11px;\n          color: var(--lion-primary);\n          background: rgba(var(--lion-primary-rgb), 0.1);\n          padding: 2px 6px;\n          border-radius: 4px;\n          margin-left: 8px;\n        }\n\n        /* ========== DARK MODE OVERRIDES ========== */\n        .crm-income-tab.lion-dark .crm-summary-card {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-summary-label {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-summary-value {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-summary-icon {\n          background: var(--lion-bg-tertiary) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-search-input {\n          background: var(--lion-bg-secondary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-search-input::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-filter-select {\n          background: var(--lion-bg-secondary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-table-header {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-table-header-cell {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-table-body {\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-table-row {\n          background: var(--lion-bg-primary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-table-row:hover {\n          background: var(--lion-bg-secondary) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-table-cell {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-income-description {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-income-reference {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-category-badge {\n          background: var(--lion-bg-tertiary) !important;\n          color: #e0e0e0 !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-empty-state {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-empty-state-text {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-sub-modal {\n          background: var(--lion-bg-primary) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-sub-modal-header {\n          border-bottom-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-sub-modal-title {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-sub-modal-close {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-sub-modal-close:hover {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-form-label {\n          color: #e0e0e0 !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-form-input,\n        .crm-income-tab.lion-dark .crm-form-select {\n          background: var(--lion-bg-secondary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-form-input::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-sub-modal-footer {\n          border-top-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-btn-secondary {\n          background: var(--lion-bg-tertiary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-currency-modal {\n          background: var(--lion-bg-primary) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-currency-item {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-currency-item:hover {\n          background: var(--lion-bg-secondary) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-currency-symbol {\n          background: var(--lion-bg-tertiary) !important;\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-currency-name {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-currency-code {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-currency-search {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-currency-search input {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-currency-search input::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-custom-dropdown-trigger {\n          background: var(--lion-bg-secondary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-custom-dropdown-menu {\n          background: var(--lion-bg-primary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-custom-dropdown-item {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-custom-dropdown-item:hover {\n          background: var(--lion-bg-secondary) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-custom-dropdown-item.selected {\n          background: rgba(6, 78, 168, 0.15) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-custom-dropdown-item-label {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-custom-dropdown-item.selected .crm-custom-dropdown-item-label {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-custom-dropdown-add {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-custom-dropdown-add span {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-filter-select option {\n          background: #1a1a1a !important;\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-custom-add-modal {\n          background: var(--lion-bg-primary) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-custom-item {\n          background: var(--lion-bg-tertiary) !important;\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-recurring-section {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-toggle-label {\n          color: #ffffff !important;\n        }\n\n        .crm-income-tab.lion-dark .crm-checkbox-label {\n          color: #e0e0e0 !important;\n        }\n      `))},Qg=async(e,t,n)=>{try{const a=Ig("expense");if(!a)return;const r={};(a.dataFields||[]).forEach(a=>{if(a.enabled)switch(a.id){case"event_details":r.event={type:"expense",action:e,timestamp:Date.now()};break;case"number":r.number=t.id.split("@")[0];break;case"name":r.name=t.profile.name;break;case"amount":r.amount=n.amount,r.amountFormatted=v.formatCurrency(n.amount);break;case"category":r.category=n.category;break;case"payment_method":r.paymentMethod=n.paymentMethod;break;case"description":r.description=n.description;break;case"reference":r.reference=n.reference||null;break;case"transaction_date":r.transactionDate=n.date,r.transactionDateFormatted=new Date(n.date).toLocaleDateString();break;case"status":r.status=n.status;break;case"contact_profile":r.contactProfile={fullName:t.profile.name||null,phone:t.profile.phone||null,email:t.profile.email||null}}}),r.expense={id:n.id||null,amount:n.amount,amountFormatted:v.formatCurrency(n.amount),category:n.category,paymentMethod:n.paymentMethod,description:n.description,reference:n.reference||null,date:n.date,dateFormatted:new Date(n.date).toLocaleDateString(),status:n.status,isRecurring:n.isRecurring||!1,recurringInterval:n.recurringInterval||null},Rg(a.url,r,"expense")}catch(e){}},Zg=({contact:e,onUpdate:t})=>{const[n,r]=(0,a.useState)(!1),[o,i]=(0,a.useState)(null),[l,c]=(0,a.useState)(""),[d,m]=(0,a.useState)(!1),[p,u]=(0,a.useState)(v.getCurrencySettings()),[g,h]=(0,a.useState)("");Mg();const b=Wg(),[f,y]=(0,a.useState)(v.getCustomExpenseCategories()),[x,w]=(0,a.useState)(v.getCustomTransactionStatuses()),[k,E]=(0,a.useState)(v.getCustomPaymentMethods()),[S,C]=(0,a.useState)(v.getHiddenExpenseCategories()),[T,A]=(0,a.useState)(v.getHiddenTransactionStatuses()),[D,_]=(0,a.useState)(v.getHiddenPaymentMethods()),[N,M]=(0,a.useState)(!1),[I,R]=(0,a.useState)(!1),[B,P]=(0,a.useState)(!1),[L,U]=(0,a.useState)(""),[F,z]=(0,a.useState)(""),[O,W]=(0,a.useState)(""),[q,H]=(0,a.useState)(!1),[j,V]=(0,a.useState)(!1),[G,K]=(0,a.useState)(!1);(0,a.useEffect)(()=>{u(v.getCurrencySettings())},[d]);const[$,Y]=(0,a.useState)("all"),[X,J]=(0,a.useState)("all"),[Q,Z]=(0,a.useState)("all"),[ee,te]=(0,a.useState)(""),[ne,ae]=(0,a.useState)("purchase"),[re,oe]=(0,a.useState)("cash"),[ie,se]=(0,a.useState)(""),[le,ce]=(0,a.useState)(""),[de,me]=(0,a.useState)(""),[pe,ue]=(0,a.useState)("completed"),[ge,he]=(0,a.useState)(!1),[be,fe]=(0,a.useState)("monthly"),[ve,ye]=(0,a.useState)(""),[xe,we]=(0,a.useState)(!0),ke=[{value:"purchase",label:(0,s.t)("crm.purchase")},{value:"service",label:(0,s.t)("crm.serviceCost")},{value:"travel",label:(0,s.t)("crm.travel")},{value:"marketing",label:(0,s.t)("crm.marketing")},{value:"commission",label:(0,s.t)("crm.commissionPaid")},{value:"refund",label:(0,s.t)("crm.refundGiven")},{value:"other",label:(0,s.t)("crm.other")}],Ee=(0,a.useMemo)(()=>[...ke.filter(e=>!S.includes(e.value)),...f.map(e=>({value:e.id,label:e.label,isCustom:!0}))],[f,S]),Se=[{value:"cash",label:(0,s.t)("crm.cash")},{value:"bank_transfer",label:(0,s.t)("crm.bankTransfer")},{value:"upi",label:(0,s.t)("crm.upi")},{value:"pix",label:(0,s.t)("crm.pix")},{value:"card",label:(0,s.t)("crm.card")},{value:"cheque",label:(0,s.t)("crm.cheque")},{value:"other",label:(0,s.t)("crm.other")}],Ce=(0,a.useMemo)(()=>[...Se.filter(e=>!D.includes(e.value)),...k.map(e=>({value:e.id,label:e.label,isCustom:!0}))],[k,D]),Te=[{value:"completed",label:(0,s.t)("crm.completed")},{value:"pending",label:(0,s.t)("crm.pending")},{value:"cancelled",label:(0,s.t)("crm.cancelled")}],Ae=(0,a.useMemo)(()=>[...Te.filter(e=>!T.includes(e.value)),...x.map(e=>({value:e.id,label:e.label,isCustom:!0}))],[x,T]),De=()=>{L.trim()&&(v.addCustomExpenseCategory(L.trim()),y(v.getCustomExpenseCategories()),U(""),M(!1))},_e=e=>{v.deleteCustomExpenseCategory(e),y(v.getCustomExpenseCategories()),ne===e&&ae("purchase")},Ne=()=>{F.trim()&&(v.addCustomTransactionStatus(F.trim()),w(v.getCustomTransactionStatuses()),z(""),R(!1))},Me=e=>{v.deleteCustomTransactionStatus(e),w(v.getCustomTransactionStatuses()),pe===e&&ue("completed")},Ie=()=>{O.trim()&&(v.addCustomPaymentMethod(O.trim()),E(v.getCustomPaymentMethods()),W(""),P(!1))},Re=e=>{v.deleteCustomPaymentMethod(e),E(v.getCustomPaymentMethods()),re===e&&oe("cash")},Be=(e,t)=>{const n=new Date(e);switch(t){case"daily":n.setDate(n.getDate()+1);break;case"weekly":n.setDate(n.getDate()+7);break;case"monthly":n.setMonth(n.getMonth()+1);break;case"quarterly":n.setMonth(n.getMonth()+3);break;case"yearly":n.setFullYear(n.getFullYear()+1)}return n.getTime()},Pe=e=>v.formatCurrency(e),Le=(0,a.useMemo)(()=>{let t=e.expenses||[];if(l){const e=l.toLowerCase();t=t.filter(t=>t.description.toLowerCase().includes(e)||t.reference?.toLowerCase().includes(e))}if("all"!==$&&(t=t.filter(e=>e.category===$)),"all"!==X&&(t=t.filter(e=>e.status===X)),"all"!==Q){const e=Date.now(),n=864e5;let a=0;switch(Q){case"today":a=e-n;break;case"week":a=e-7*n;break;case"month":a=e-30*n;break;case"year":a=e-365*n}t=t.filter(e=>e.date>=a)}return t.sort((e,t)=>t.date-e.date)},[e.expenses,l,$,X,Q]),Ue=(0,a.useMemo)(()=>{const t=e.expenses||[];return{completed:t.filter(e=>"completed"===e.status).reduce((e,t)=>e+t.amount,0),pending:t.filter(e=>"pending"===e.status).reduce((e,t)=>e+t.amount,0),filteredTotal:Le.filter(e=>"completed"===e.status).reduce((e,t)=>e+t.amount,0)}},[e.expenses,Le]),Fe=e=>{switch(e){case"completed":return"crm-status-completed";case"pending":return"crm-status-pending";case"cancelled":return"crm-status-cancelled";default:return""}};return a.createElement("div",{className:"crm-expense-tab "+(b?"lion-dark":"")},a.createElement("div",{className:"crm-expense-summary"},a.createElement("div",{className:"crm-summary-card crm-summary-total"},a.createElement("div",{className:"crm-summary-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1.41 16.09V20h-2.67v-1.93c-1.71-.36-3.16-1.46-3.27-3.4h1.96c.1 1.05.82 1.87 2.65 1.87 1.96 0 2.4-.98 2.4-1.59 0-.83-.44-1.61-2.67-2.14-2.48-.6-4.18-1.62-4.18-3.67 0-1.72 1.39-2.84 3.11-3.21V4h2.67v1.95c1.86.45 2.79 1.86 2.85 3.39H14.3c-.05-1.11-.64-1.87-2.22-1.87-1.5 0-2.4.68-2.4 1.64 0 .84.65 1.39 2.67 1.91s4.18 1.39 4.18 3.91c-.01 1.83-1.38 2.83-3.12 3.16z"}))),a.createElement("div",{className:"crm-summary-content"},a.createElement("div",{className:"crm-summary-label"},(0,s.t)("crm.totalExpense")),a.createElement("div",{className:"crm-summary-value"},Pe(Ue.completed)))),a.createElement("div",{className:"crm-summary-card crm-summary-pending"},a.createElement("div",{className:"crm-summary-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm.5-13H11v6l5.2 3.2.8-1.3-4.5-2.7V7z"}))),a.createElement("div",{className:"crm-summary-content"},a.createElement("div",{className:"crm-summary-label"},(0,s.t)("crm.pending")),a.createElement("div",{className:"crm-summary-value"},Pe(Ue.pending)))),a.createElement("div",{className:"crm-summary-card crm-summary-filtered"},a.createElement("div",{className:"crm-summary-icon"},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:"currentColor",d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}))),a.createElement("div",{className:"crm-summary-content"},a.createElement("div",{className:"crm-summary-label"},(0,s.t)("crm.filteredTotal")),a.createElement("div",{className:"crm-summary-value"},Pe(Ue.filteredTotal))))),a.createElement("div",{className:"crm-expense-filters"},a.createElement("div",{className:"crm-search-box"},a.createElement("svg",{className:"crm-search-icon",viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),a.createElement("input",{type:"text",className:"crm-search-input",placeholder:(0,s.t)("crm.search"),value:l,onChange:e=>c(e.target.value)})),a.createElement("div",{className:"crm-filter-with-add"},a.createElement("select",{className:"crm-filter-select",value:$,onChange:e=>Y(e.target.value)},a.createElement("option",{value:"all"},(0,s.t)("crm.allCategories")),Ee.map(e=>a.createElement("option",{key:e.value,value:e.value},e.label,e.isCustom?" ✦":""))),a.createElement("button",{type:"button",className:"crm-filter-add-btn",onClick:()=>M(!0),title:(0,s.t)("crm.addCustomCategory")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})))),a.createElement("div",{className:"crm-filter-with-add"},a.createElement("select",{className:"crm-filter-select",value:X,onChange:e=>J(e.target.value)},a.createElement("option",{value:"all"},(0,s.t)("crm.allStatus")),Ae.map(e=>a.createElement("option",{key:e.value,value:e.value},e.label,e.isCustom?" ✦":""))),a.createElement("button",{type:"button",className:"crm-filter-add-btn",onClick:()=>R(!0),title:(0,s.t)("crm.addCustomStatus")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})))),a.createElement("select",{className:"crm-filter-select",value:Q,onChange:e=>Z(e.target.value)},a.createElement("option",{value:"all"},(0,s.t)("crm.all")),a.createElement("option",{value:"today"},(0,s.t)("crm.today")),a.createElement("option",{value:"week"},(0,s.t)("crm.thisWeek")),a.createElement("option",{value:"month"},(0,s.t)("crm.thisMonth")),a.createElement("option",{value:"year"},(0,s.t)("crm.thisYear"))),a.createElement("button",{className:"crm-btn crm-btn-expense",onClick:()=>{te(""),ae("purchase"),oe("cash"),se(""),ce(""),me((()=>{const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`})()),ue("completed"),he(!1),fe("monthly"),ye(""),we(!0),i(null),r(!0)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),(0,s.t)("crm.addExpense")),a.createElement("button",{className:"crm-currency-settings-btn",onClick:()=>m(!0),title:"Currency Settings"},a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M19.14,12.94c0.04-0.31,0.06-0.63,0.06-0.94c0-0.31-0.02-0.63-0.06-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.37,4.82,11.69,4.82,12c0,0.31,0.02,0.63,0.06,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"})))),a.createElement("div",{className:"crm-table-header"},a.createElement("div",{className:"crm-table-header-cell",style:{flex:1}},(0,s.t)("crm.tableDescription")),a.createElement("div",{className:"crm-table-header-cell",style:{width:120}},(0,s.t)("crm.tableCategory")),a.createElement("div",{className:"crm-table-header-cell",style:{width:100}},(0,s.t)("crm.tableAmount")),a.createElement("div",{className:"crm-table-header-cell",style:{width:100}},(0,s.t)("crm.tablePayment")),a.createElement("div",{className:"crm-table-header-cell",style:{width:100}},(0,s.t)("crm.tableDate")),a.createElement("div",{className:"crm-table-header-cell",style:{width:90}},(0,s.t)("crm.tableStatus")),a.createElement("div",{className:"crm-table-header-cell",style:{width:80,textAlign:"center"}},(0,s.t)("crm.tableAction"))),Le.length>0?a.createElement("div",{className:"crm-table-body"},Le.map(n=>{return a.createElement("div",{key:n.id,className:"crm-table-row"},a.createElement("div",{className:"crm-table-cell",style:{flex:1}},a.createElement("div",{className:"crm-expense-description"},n.description,n.isRecurring&&a.createElement("span",{className:"crm-recurring-badge"},"🔄 ",Yg.find(e=>e.value===n.recurringInterval)?.label||"Recurring")),n.reference&&a.createElement("div",{className:"crm-expense-reference"},(0,s.t)("crm.ref"),": ",n.reference)),a.createElement("div",{className:"crm-table-cell",style:{width:120}},a.createElement("span",{className:"crm-category-badge"},(d=n.category,Ee.find(e=>e.value===d)?.label||d))),a.createElement("div",{className:"crm-table-cell crm-amount-cell",style:{width:100}},Pe(n.amount)),a.createElement("div",{className:"crm-table-cell",style:{width:100,color:ca.textMuted,fontSize:12}},(c=n.paymentMethod,Ce.find(e=>e.value===c)?.label||c)),a.createElement("div",{className:"crm-table-cell",style:{width:100,color:ca.textMuted,fontSize:12}},(l=n.date,new Date(l).toLocaleDateString("pt-BR",{year:"numeric",month:"short",day:"numeric"}))),a.createElement("div",{className:"crm-table-cell",style:{width:90}},a.createElement("span",{className:`crm-status-badge ${Fe(n.status)}`},(o=n.status,Ae.find(e=>e.value===o)?.label||o))),a.createElement("div",{className:"crm-table-cell crm-action-cell",style:{width:80}},a.createElement("button",{className:"crm-action-btn crm-action-edit",onClick:()=>(e=>{te(e.amount.toString()),ae(e.category),oe(e.paymentMethod),se(e.description),ce(e.reference||"");const t=new Date(e.date),n=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");if(me(`${n}-${a}-${o}`),ue(e.status),he(e.isRecurring||!1),fe(e.recurringInterval||"monthly"),e.recurringEndDate){const t=new Date(e.recurringEndDate),n=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");ye(`${n}-${a}-${r}`),we(!1)}else ye(""),we(!0);i(e),r(!0)})(n),title:"Edit"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}))),a.createElement("button",{className:"crm-action-btn crm-action-delete",onClick:()=>(n=>{if(confirm((0,s.t)("crm.deleteExpenseConfirm"))){const a=(e.expenses||[]).find(e=>e.id===n);v.deleteExpense(e.id,n),a&&Qg("deleted",e,{id:n,amount:a.amount,category:a.category,paymentMethod:a.paymentMethod,description:a.description,reference:a.reference,date:a.date,status:a.status,isRecurring:a.isRecurring,recurringInterval:a.recurringInterval}),window.dispatchEvent(new CustomEvent("crm-expense-updated",{detail:{contactId:e.id,action:"deleted"}})),t()}})(n.id),title:"Delete"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})))));var o,l,c,d})):a.createElement("div",{className:"crm-empty-state"},a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1.41 16.09V20h-2.67v-1.93c-1.71-.36-3.16-1.46-3.27-3.4h1.96c.1 1.05.82 1.87 2.65 1.87 1.96 0 2.4-.98 2.4-1.59 0-.83-.44-1.61-2.67-2.14-2.48-.6-4.18-1.62-4.18-3.67 0-1.72 1.39-2.84 3.11-3.21V4h2.67v1.95c1.86.45 2.79 1.86 2.85 3.39H14.3c-.05-1.11-.64-1.87-2.22-1.87-1.5 0-2.4.68-2.4 1.64 0 .84.65 1.39 2.67 1.91s4.18 1.39 4.18 3.91c-.01 1.83-1.38 2.83-3.12 3.16z"})),a.createElement("div",{className:"crm-empty-state-text"},(0,s.t)("crm.noExpenseRecords"))),n&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>r(!1)}),a.createElement("div",{className:"crm-sub-modal"},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h3",{className:"crm-sub-modal-title"},o?(0,s.t)("crm.editExpenseTitle"):(0,s.t)("crm.addExpenseTitle")),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>r(!1)},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"crm-sub-modal-body"},a.createElement("div",{className:"crm-form-row"},a.createElement("div",{className:"crm-form-group",style:{flex:1}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.amount")," ",a.createElement("span",{style:{color:ca.error}},"*")),a.createElement("input",{type:"number",className:"crm-form-input",placeholder:(0,s.t)("crm.enterAmount"),value:ee,onChange:e=>te(e.target.value),min:"0",step:"0.01"})),a.createElement("div",{className:"crm-form-group",style:{flex:1}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.date")),a.createElement("input",{type:"date",className:"crm-form-input",value:de,onChange:e=>me(e.target.value)}))),a.createElement("div",{className:"crm-form-row"},a.createElement("div",{className:"crm-form-group",style:{flex:1}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.category")),a.createElement("div",{className:"crm-custom-dropdown-container"},a.createElement("div",{className:"crm-custom-dropdown-trigger",onClick:()=>H(!q)},a.createElement("span",null,Ee.find(e=>e.value===ne)?.label||ne),a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M7 10l5 5 5-5z"}))),q&&a.createElement("div",{className:"crm-custom-dropdown-menu"},Ee.map(e=>a.createElement("div",{key:e.value,className:"crm-custom-dropdown-item "+(ne===e.value?"selected":"")},a.createElement("span",{className:"crm-custom-dropdown-item-label",onClick:()=>{ae(e.value),H(!1)}},e.label,e.isCustom?" ✦":""),a.createElement("button",{type:"button",className:"crm-custom-dropdown-delete",onClick:t=>{t.stopPropagation(),((e,t)=>{if(t)_e(e);else if(v.hideExpenseCategory(e),C(v.getHiddenExpenseCategories()),ne===e){const t=ke.filter(t=>t.value!==e&&!S.includes(t.value));t.length>0?ae(t[0].value):f.length>0&&ae(f[0].id)}})(e.value,e.isCustom||!1)},title:(0,s.t)("crm.delete")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))))),a.createElement("div",{className:"crm-custom-dropdown-item crm-custom-dropdown-add",onClick:()=>{H(!1),M(!0)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),a.createElement("span",null,(0,s.t)("crm.addCustomCategory")))))),a.createElement("div",{className:"crm-form-group",style:{flex:1}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.paymentMethod")),a.createElement("div",{className:"crm-custom-dropdown-container"},a.createElement("div",{className:"crm-custom-dropdown-trigger",onClick:()=>K(!G)},a.createElement("span",null,Ce.find(e=>e.value===re)?.label||re),a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M7 10l5 5 5-5z"}))),G&&a.createElement("div",{className:"crm-custom-dropdown-menu"},Ce.map(e=>a.createElement("div",{key:e.value,className:"crm-custom-dropdown-item "+(re===e.value?"selected":"")},a.createElement("span",{className:"crm-custom-dropdown-item-label",onClick:()=>{oe(e.value),K(!1)}},e.label,e.isCustom?" ✦":""),a.createElement("button",{type:"button",className:"crm-custom-dropdown-delete",onClick:t=>{t.stopPropagation(),((e,t)=>{if(t)Re(e);else if(v.hidePaymentMethod(e),_(v.getHiddenPaymentMethods()),re===e){const t=Se.filter(t=>t.value!==e&&!D.includes(t.value));t.length>0?oe(t[0].value):k.length>0&&oe(k[0].id)}})(e.value,e.isCustom||!1)},title:(0,s.t)("crm.delete")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))))),a.createElement("div",{className:"crm-custom-dropdown-item crm-custom-dropdown-add",onClick:()=>{K(!1),P(!0)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),a.createElement("span",null,(0,s.t)("crm.addCustomPaymentMethod"))))))),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.description")," ",a.createElement("span",{style:{color:ca.error}},"*")),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.expenseDescription"),value:ie,onChange:e=>se(e.target.value)})),a.createElement("div",{className:"crm-form-row"},a.createElement("div",{className:"crm-form-group",style:{flex:1}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.referenceBill")),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.billPlaceholder"),value:le,onChange:e=>ce(e.target.value)})),a.createElement("div",{className:"crm-form-group",style:{flex:1}},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.status")),a.createElement("div",{className:"crm-custom-dropdown-container"},a.createElement("div",{className:"crm-custom-dropdown-trigger",onClick:()=>V(!j)},a.createElement("span",null,Ae.find(e=>e.value===pe)?.label||pe),a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M7 10l5 5 5-5z"}))),j&&a.createElement("div",{className:"crm-custom-dropdown-menu"},Ae.map(e=>a.createElement("div",{key:e.value,className:"crm-custom-dropdown-item "+(pe===e.value?"selected":"")},a.createElement("span",{className:"crm-custom-dropdown-item-label",onClick:()=>{ue(e.value),V(!1)}},e.label,e.isCustom?" ✦":""),a.createElement("button",{type:"button",className:"crm-custom-dropdown-delete",onClick:t=>{t.stopPropagation(),((e,t)=>{if(t)Me(e);else if(v.hideTransactionStatus(e),A(v.getHiddenTransactionStatuses()),pe===e){const t=Te.filter(t=>t.value!==e&&!T.includes(t.value));t.length>0?ue(t[0].value):x.length>0&&ue(x[0].id)}})(e.value,e.isCustom||!1)},title:(0,s.t)("crm.delete")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}))))),a.createElement("div",{className:"crm-custom-dropdown-item crm-custom-dropdown-add",onClick:()=>{V(!1),R(!0)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),a.createElement("span",null,(0,s.t)("crm.addCustomStatus"))))))),a.createElement("div",{className:"crm-recurring-section"},a.createElement("div",{className:"crm-recurring-header"},a.createElement("label",{className:"crm-toggle-label"},a.createElement("span",{className:"crm-recurring-icon"},"🔄"),a.createElement("span",null,(0,s.t)("crm.recurringTransaction")||"Recurring Transaction")),a.createElement("label",{className:"crm-toggle-switch"},a.createElement("input",{type:"checkbox",checked:ge,onChange:e=>he(e.target.checked)}),a.createElement("span",{className:"crm-toggle-slider"}))),ge&&a.createElement("div",{className:"crm-recurring-options"},a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.repeatEvery")||"Repeat Every"),a.createElement("select",{className:"crm-form-select",value:be,onChange:e=>fe(e.target.value)},Yg.map(e=>a.createElement("option",{key:e.value,value:e.value},e.label)))),a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-checkbox-label"},a.createElement("input",{type:"checkbox",checked:xe,onChange:e=>we(e.target.checked)}),a.createElement("span",null,(0,s.t)("crm.neverEnds")||"Never ends"))),!xe&&a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.endDate")||"End Date"),a.createElement("input",{type:"date",className:"crm-form-input",value:ve,onChange:e=>ye(e.target.value),min:de}))))),a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>r(!1)},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-expense",onClick:()=>{const n=parseFloat(ee);if(!n||n<=0)return void alert((0,s.t)("crm.validAmountRequired"));if(!ie.trim())return void alert((0,s.t)("crm.descriptionRequired"));const a=new Date(de+"T00:00:00").getTime(),i=ge?{isRecurring:!0,recurringInterval:be,recurringEndDate:xe?void 0:ve?new Date(ve+"T00:00:00").getTime():void 0,nextOccurrence:Be(a,be)}:{isRecurring:!1,recurringInterval:void 0,recurringEndDate:void 0,nextOccurrence:void 0};if(o)v.updateExpense(e.id,o.id,{amount:n,category:ne,paymentMethod:re,description:ie,reference:le||void 0,date:a,status:pe,...i}),Qg("updated",e,{id:o.id,amount:n,category:ne,paymentMethod:re,description:ie,reference:le||void 0,date:a,status:pe,isRecurring:i.isRecurring,recurringInterval:i.recurringInterval}),window.dispatchEvent(new CustomEvent("crm-expense-updated",{detail:{contactId:e.id,action:"updated"}}));else{const t=v.addExpense(e.id,n,ne,re,ie,a,le||void 0,pe,i.isRecurring?i:void 0);Qg("created",e,{id:t?.id,amount:n,category:ne,paymentMethod:re,description:ie,reference:le||void 0,date:a,status:pe,isRecurring:i.isRecurring,recurringInterval:i.recurringInterval}),window.dispatchEvent(new CustomEvent("crm-expense-updated",{detail:{contactId:e.id,action:"created"}}))}r(!1),t()}},o?(0,s.t)("crm.update"):(0,s.t)("crm.addExpenseBtn"))))),d&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>{m(!1),h("")}}),a.createElement("div",{className:"crm-currency-modal"},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h3",{className:"crm-sub-modal-title"},(0,s.t)("crm.currencySettings")),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>{m(!1),h("")}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"crm-currency-search"},a.createElement("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},a.createElement("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})),a.createElement("input",{type:"text",placeholder:(0,s.t)("crm.searchCurrency"),value:g,onChange:e=>h(e.target.value),autoFocus:!0})),a.createElement("div",{className:"crm-currency-list"},$g.filter(e=>""===g||e.name.toLowerCase().includes(g.toLowerCase())||e.code.toLowerCase().includes(g.toLowerCase())||e.symbol.includes(g)).map(e=>a.createElement("div",{key:e.code,className:"crm-currency-item "+(p.code===e.code?"selected":""),onClick:()=>{(e=>{v.setCurrencySettings(e.code,e.symbol,e.locale),u({code:e.code,symbol:e.symbol,locale:e.locale}),m(!1)})(e),h("")}},a.createElement("div",{className:"crm-currency-symbol"},e.symbol),a.createElement("div",{className:"crm-currency-info"},a.createElement("div",{className:"crm-currency-name"},e.name),a.createElement("div",{className:"crm-currency-code"},e.code)),p.code===e.code&&a.createElement("svg",{className:"crm-currency-check",viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})))),0===$g.filter(e=>""===g||e.name.toLowerCase().includes(g.toLowerCase())||e.code.toLowerCase().includes(g.toLowerCase())||e.symbol.includes(g)).length&&a.createElement("div",{className:"crm-currency-no-results"},(0,s.t)("crm.noCurrenciesFound"))))),N&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>{M(!1),U("")}}),a.createElement("div",{className:"crm-custom-add-modal"},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h3",{className:"crm-sub-modal-title"},(0,s.t)("crm.addCustomCategory")),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>{M(!1),U("")}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"crm-sub-modal-body"},a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.categoryName")),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.enterCategoryName"),value:L,onChange:e=>U(e.target.value),autoFocus:!0,onKeyDown:e=>"Enter"===e.key&&De()})),f.length>0&&a.createElement("div",{className:"crm-custom-list"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.existingCustomCategories")),a.createElement("div",{className:"crm-custom-items"},f.map(e=>a.createElement("div",{key:e.id,className:"crm-custom-item"},a.createElement("span",null,e.label),a.createElement("button",{className:"crm-custom-delete-btn",onClick:()=>_e(e.id),title:(0,s.t)("crm.delete")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))))))),a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>{M(!1),U("")}},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:De,disabled:!L.trim()},(0,s.t)("crm.add"))))),I&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>{R(!1),z("")}}),a.createElement("div",{className:"crm-custom-add-modal"},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h3",{className:"crm-sub-modal-title"},(0,s.t)("crm.addCustomStatus")),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>{R(!1),z("")}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"crm-sub-modal-body"},a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.statusName")),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.enterStatusName"),value:F,onChange:e=>z(e.target.value),autoFocus:!0,onKeyDown:e=>"Enter"===e.key&&Ne()})),x.length>0&&a.createElement("div",{className:"crm-custom-list"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.existingCustomStatuses")),a.createElement("div",{className:"crm-custom-items"},x.map(e=>a.createElement("div",{key:e.id,className:"crm-custom-item"},a.createElement("span",null,e.label),a.createElement("button",{className:"crm-custom-delete-btn",onClick:()=>Me(e.id),title:(0,s.t)("crm.delete")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))))))),a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>{R(!1),z("")}},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:Ne,disabled:!F.trim()},(0,s.t)("crm.add"))))),B&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-sub-modal-backdrop",onClick:()=>{P(!1),W("")}}),a.createElement("div",{className:"crm-custom-add-modal"},a.createElement("div",{className:"crm-sub-modal-header"},a.createElement("h3",{className:"crm-sub-modal-title"},(0,s.t)("crm.addCustomPaymentMethod")),a.createElement("button",{className:"crm-sub-modal-close",onClick:()=>{P(!1),W("")}},a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"crm-sub-modal-body"},a.createElement("div",{className:"crm-form-group"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.paymentMethodName")||"Payment Method Name"),a.createElement("input",{type:"text",className:"crm-form-input",placeholder:(0,s.t)("crm.enterPaymentMethodName")||"Enter payment method name",value:O,onChange:e=>W(e.target.value),autoFocus:!0,onKeyDown:e=>"Enter"===e.key&&Ie()})),k.length>0&&a.createElement("div",{className:"crm-custom-list"},a.createElement("label",{className:"crm-form-label"},(0,s.t)("crm.customPaymentMethods")||"Custom Payment Methods"),a.createElement("div",{className:"crm-custom-items"},k.map(e=>a.createElement("div",{key:e.id,className:"crm-custom-item"},a.createElement("span",null,e.label),a.createElement("button",{className:"crm-custom-delete-btn",onClick:()=>Re(e.id),title:(0,s.t)("crm.delete")},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))))))),a.createElement("div",{className:"crm-sub-modal-footer"},a.createElement("button",{className:"crm-btn crm-btn-secondary",onClick:()=>{P(!1),W("")}},(0,s.t)("crm.cancel")),a.createElement("button",{className:"crm-btn crm-btn-primary",onClick:Ie,disabled:!O.trim()},(0,s.t)("crm.add"))))),a.createElement("style",null,`\n        ${ma}\n\n        .crm-expense-summary {\n          display: grid;\n          grid-template-columns: repeat(3, 1fr);\n          gap: 16px;\n          margin-bottom: 20px;\n        }\n\n        .crm-summary-card {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          padding: 16px;\n          border-radius: 12px;\n          background: var(--lion-bg-secondary);\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .crm-summary-card.crm-summary-total {\n          background: linear-gradient(135deg, var(--lion-error-light) 0%, rgba(239, 68, 68, 0.05) 100%);\n          border-color: rgba(239, 68, 68, 0.3);\n        }\n\n        .crm-summary-card.crm-summary-total .crm-summary-icon {\n          color: var(--lion-error);\n        }\n\n        .crm-summary-card.crm-summary-pending {\n          background: linear-gradient(135deg, rgba(var(--lion-primary-rgb), 0.1) 0%, rgba(var(--lion-primary-rgb), 0.05) 100%);\n          border-color: rgba(var(--lion-primary-rgb), 0.3);\n        }\n\n        .crm-summary-card.crm-summary-pending .crm-summary-icon {\n          color: var(--lion-primary);\n        }\n\n        .crm-summary-card.crm-summary-filtered .crm-summary-icon {\n          color: var(--lion-text-muted);\n        }\n\n        .crm-summary-icon {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 48px;\n          height: 48px;\n          border-radius: 12px;\n          background: var(--lion-bg-primary);\n        }\n\n        .crm-summary-label {\n          font-size: 12px;\n          color: var(--lion-text-muted);\n          margin-bottom: 4px;\n        }\n\n        .crm-summary-value {\n          font-size: 18px;\n          font-weight: 700;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-expense-filters {\n          display: flex;\n          gap: 12px;\n          margin-bottom: 16px;\n          flex-wrap: wrap;\n          align-items: center;\n        }\n\n        .crm-expense-filters .crm-search-box {\n          flex: 1;\n          min-width: 200px;\n          margin-bottom: 0;\n        }\n\n        .crm-filter-select {\n          padding: 8px 12px;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          font-size: 13px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-primary);\n          cursor: pointer;\n        }\n\n        .crm-filter-select:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n        }\n\n        .crm-filter-with-add {\n          display: flex;\n          align-items: center;\n          gap: 4px;\n        }\n\n        .crm-filter-add-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 28px;\n          height: 28px;\n          padding: 0;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 6px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          transition: all 0.2s;\n          flex-shrink: 0;\n        }\n\n        .crm-filter-add-btn:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n          background: rgba(var(--lion-primary-rgb), 0.1);\n        }\n\n        .crm-btn-expense {\n          background: var(--lion-error) !important;\n          color: white !important;\n        }\n\n        .crm-btn-expense:hover {\n          background: #dc2626 !important;\n        }\n\n        .crm-expense-tab .crm-table-body {\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          overflow: hidden;\n        }\n\n        .crm-expense-description {\n          font-weight: 500;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-expense-reference {\n          font-size: 11px;\n          color: var(--lion-text-muted);\n          margin-top: 2px;\n        }\n\n        .crm-category-badge {\n          display: inline-block;\n          padding: 2px 8px;\n          border-radius: 6px;\n          font-size: 11px;\n          font-weight: 500;\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-secondary);\n        }\n\n        .crm-amount-cell {\n          font-weight: 600;\n          color: var(--lion-error) !important;\n        }\n\n        .crm-status-badge {\n          display: inline-block;\n          padding: 2px 8px;\n          border-radius: 10px;\n          font-size: 11px;\n          font-weight: 500;\n          text-transform: capitalize;\n        }\n\n        .crm-status-completed {\n          background: var(--lion-success-light);\n          color: var(--lion-success);\n        }\n\n        .crm-status-pending {\n          background: rgba(var(--lion-primary-rgb), 0.15);\n          color: var(--lion-primary);\n        }\n\n        .crm-status-cancelled {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-muted);\n        }\n\n        .crm-form-row {\n          display: flex;\n          gap: 16px;\n        }\n\n        .crm-action-cell {\n          display: flex;\n          justify-content: center;\n          gap: 4px;\n        }\n\n        .crm-action-btn {\n          background: transparent;\n          border: none;\n          padding: 6px;\n          border-radius: 6px;\n          cursor: pointer;\n          transition: all 0.2s;\n          display: inline-flex;\n          align-items: center;\n          justify-content: center;\n        }\n\n        .crm-action-edit {\n          color: var(--lion-text-muted);\n        }\n\n        .crm-action-edit:hover {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        .crm-action-delete {\n          color: var(--lion-error);\n        }\n\n        .crm-action-delete:hover {\n          background: var(--lion-error-light);\n        }\n\n        /* Currency Settings Styles */\n        .crm-currency-settings-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 36px;\n          height: 36px;\n          padding: 0;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .crm-currency-settings-btn:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n          background: rgba(var(--lion-primary-rgb), 0.1);\n        }\n\n        .crm-currency-modal {\n          position: fixed;\n          top: 50%;\n          left: 50%;\n          transform: translate(-50%, -50%);\n          background: var(--lion-bg-secondary);\n          border-radius: 12px;\n          width: 400px;\n          max-height: 500px;\n          z-index: 10003;\n          box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);\n          display: flex;\n          flex-direction: column;\n        }\n\n        .crm-currency-list {\n          padding: 8px;\n          overflow-y: auto;\n          max-height: 400px;\n        }\n\n        .crm-currency-item {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          padding: 12px;\n          border-radius: 8px;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .crm-currency-item:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .crm-currency-item.selected {\n          background: rgba(var(--lion-primary-rgb), 0.1);\n          border: 1px solid var(--lion-primary);\n        }\n\n        .crm-currency-symbol {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 40px;\n          height: 40px;\n          background: var(--lion-bg-primary);\n          border-radius: 8px;\n          font-size: 18px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-currency-info {\n          flex: 1;\n        }\n\n        .crm-currency-name {\n          font-size: 14px;\n          font-weight: 500;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-currency-code {\n          font-size: 12px;\n          color: var(--lion-text-muted);\n        }\n\n        .crm-currency-check {\n          color: var(--lion-primary);\n        }\n\n        .crm-currency-search {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          padding: 8px 12px;\n          margin: 0 12px 8px 12px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n        }\n\n        .crm-currency-search svg {\n          color: var(--lion-text-muted);\n          flex-shrink: 0;\n        }\n\n        .crm-currency-search input {\n          flex: 1;\n          border: none;\n          background: transparent;\n          font-size: 13px;\n          color: var(--lion-text-primary);\n          outline: none;\n        }\n\n        .crm-currency-search input::placeholder {\n          color: var(--lion-text-muted);\n        }\n\n        .crm-currency-no-results {\n          padding: 20px;\n          text-align: center;\n          color: var(--lion-text-muted);\n          font-size: 13px;\n        }\n\n        /* Custom Category/Status Add Button */\n        .crm-select-with-add {\n          display: flex;\n          gap: 8px;\n          align-items: center;\n        }\n\n        .crm-select-with-add .crm-form-select {\n          flex: 1;\n        }\n\n        .crm-add-custom-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 36px;\n          height: 36px;\n          padding: 0;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          transition: all 0.2s;\n          flex-shrink: 0;\n        }\n\n        .crm-add-custom-btn:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n          background: rgba(var(--lion-primary-rgb), 0.1);\n        }\n\n        /* Custom Add Modal */\n        .crm-custom-add-modal {\n          position: fixed;\n          top: 50%;\n          left: 50%;\n          transform: translate(-50%, -50%);\n          background: var(--lion-bg-secondary);\n          border-radius: 12px;\n          width: 380px;\n          z-index: 10004;\n          box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);\n        }\n\n        .crm-custom-list {\n          margin-top: 16px;\n        }\n\n        .crm-custom-items {\n          display: flex;\n          flex-wrap: wrap;\n          gap: 8px;\n          margin-top: 8px;\n        }\n\n        .crm-custom-item {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          padding: 6px 10px;\n          background: var(--lion-bg-tertiary);\n          border-radius: 6px;\n          font-size: 13px;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-custom-delete-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          padding: 2px;\n          border: none;\n          background: transparent;\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          border-radius: 4px;\n          transition: all 0.2s;\n        }\n\n        .crm-custom-delete-btn:hover {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n        }\n\n        /* Custom Dropdown with Delete */\n        .crm-custom-dropdown-container {\n          position: relative;\n          width: 100%;\n        }\n\n        .crm-custom-dropdown-trigger {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 10px 12px;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-primary);\n          cursor: pointer;\n          font-size: 14px;\n          transition: all 0.2s;\n        }\n\n        .crm-custom-dropdown-trigger:hover {\n          border-color: var(--lion-primary);\n        }\n\n        .crm-custom-dropdown-trigger svg {\n          color: var(--lion-text-muted);\n        }\n\n        .crm-custom-dropdown-menu {\n          position: absolute;\n          top: 100%;\n          left: 0;\n          right: 0;\n          margin-top: 4px;\n          background: var(--lion-bg-secondary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n          z-index: 100;\n          max-height: 200px;\n          overflow-y: auto;\n        }\n\n        .crm-custom-dropdown-item {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 10px 12px;\n          cursor: pointer;\n          transition: all 0.15s;\n        }\n\n        .crm-custom-dropdown-item:hover {\n          background: var(--lion-bg-tertiary);\n        }\n\n        .crm-custom-dropdown-item.selected {\n          background: rgba(var(--lion-primary-rgb), 0.1);\n        }\n\n        .crm-custom-dropdown-item.selected .crm-custom-dropdown-item-label {\n          color: var(--lion-primary);\n          font-weight: 500;\n        }\n\n        .crm-custom-dropdown-item-label {\n          flex: 1;\n          font-size: 14px;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-custom-dropdown-delete {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 24px;\n          height: 24px;\n          padding: 0;\n          border: none;\n          background: transparent;\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          border-radius: 4px;\n          transition: all 0.15s;\n          margin-left: 8px;\n        }\n\n        .crm-custom-dropdown-delete:hover {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n        }\n\n        .crm-custom-dropdown-add {\n          border-top: 1px solid var(--lion-border-light);\n          color: var(--lion-primary);\n          gap: 8px;\n        }\n\n        .crm-custom-dropdown-add span {\n          color: var(--lion-primary);\n          font-size: 13px;\n        }\n\n        .crm-custom-dropdown-add:hover {\n          background: rgba(var(--lion-primary-rgb), 0.1);\n        }\n\n        /* Recurring Transaction Styles */\n        .crm-recurring-section {\n          margin-top: 16px;\n          padding: 16px;\n          background: var(--lion-bg-secondary);\n          border-radius: 10px;\n          border: 1px solid var(--lion-border);\n        }\n\n        .crm-recurring-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n        }\n\n        .crm-toggle-label {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          font-weight: 500;\n          color: var(--lion-text);\n        }\n\n        .crm-recurring-icon {\n          font-size: 18px;\n        }\n\n        .crm-toggle-switch {\n          position: relative;\n          display: inline-block;\n          width: 48px;\n          height: 26px;\n          cursor: pointer;\n          flex-shrink: 0;\n        }\n\n        .crm-toggle-switch input {\n          opacity: 0;\n          width: 0;\n          height: 0;\n          position: absolute;\n        }\n\n        .crm-toggle-slider {\n          position: absolute;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: #ccc;\n          border-radius: 26px;\n          transition: 0.3s;\n        }\n\n        .crm-toggle-slider:before {\n          content: '';\n          position: absolute;\n          width: 20px;\n          height: 20px;\n          left: 3px;\n          top: 3px;\n          background: white;\n          border-radius: 50%;\n          transition: 0.3s;\n          box-shadow: 0 2px 4px rgba(0,0,0,0.2);\n        }\n\n        .crm-toggle-switch input:checked + .crm-toggle-slider {\n          background: var(--lion-primary);\n        }\n\n        .crm-toggle-switch input:checked + .crm-toggle-slider:before {\n          transform: translateX(22px);\n        }\n\n        .crm-recurring-options {\n          margin-top: 16px;\n          padding-top: 16px;\n          border-top: 1px solid var(--lion-border);\n          display: flex;\n          flex-direction: column;\n          gap: 12px;\n        }\n\n        .crm-checkbox-label {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          cursor: pointer;\n          font-size: 14px;\n          color: var(--lion-text-secondary);\n        }\n\n        .crm-checkbox-label input[type="checkbox"] {\n          width: 16px;\n          height: 16px;\n          accent-color: var(--lion-primary);\n        }\n\n        .crm-recurring-badge {\n          display: inline-flex;\n          align-items: center;\n          gap: 4px;\n          font-size: 11px;\n          color: var(--lion-primary);\n          background: rgba(var(--lion-primary-rgb), 0.1);\n          padding: 2px 6px;\n          border-radius: 4px;\n          margin-left: 8px;\n        }\n\n        /* ========== DARK MODE OVERRIDES ========== */\n        .crm-expense-tab.lion-dark .crm-summary-card {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-summary-label {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-summary-value {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-summary-icon {\n          background: var(--lion-bg-tertiary) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-search-input {\n          background: var(--lion-bg-secondary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-search-input::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-filter-select {\n          background: var(--lion-bg-secondary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-table-header {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-table-header-cell {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-table-body {\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-table-row {\n          background: var(--lion-bg-primary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-table-row:hover {\n          background: var(--lion-bg-secondary) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-table-cell {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-expense-description {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-expense-reference {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-category-badge {\n          background: var(--lion-bg-tertiary) !important;\n          color: #e0e0e0 !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-empty-state {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-empty-state-text {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-sub-modal {\n          background: var(--lion-bg-primary) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-sub-modal-header {\n          border-bottom-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-sub-modal-title {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-sub-modal-close {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-sub-modal-close:hover {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-form-label {\n          color: #e0e0e0 !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-form-input,\n        .crm-expense-tab.lion-dark .crm-form-select {\n          background: var(--lion-bg-secondary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-form-input::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-sub-modal-footer {\n          border-top-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-btn-secondary {\n          background: var(--lion-bg-tertiary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-currency-modal {\n          background: var(--lion-bg-primary) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-currency-item {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-currency-item:hover {\n          background: var(--lion-bg-secondary) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-currency-symbol {\n          background: var(--lion-bg-tertiary) !important;\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-currency-name {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-currency-code {\n          color: #a0a0a0 !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-currency-search {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-currency-search input {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-currency-search input::placeholder {\n          color: var(--lion-text-muted) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-custom-dropdown-trigger {\n          background: var(--lion-bg-secondary) !important;\n          color: #ffffff !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-custom-dropdown-menu {\n          background: var(--lion-bg-primary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-custom-dropdown-item {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-custom-dropdown-item:hover {\n          background: var(--lion-bg-secondary) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-custom-dropdown-item.selected {\n          background: rgba(6, 78, 168, 0.15) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-custom-dropdown-item-label {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-custom-dropdown-item.selected .crm-custom-dropdown-item-label {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-custom-dropdown-add {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-custom-dropdown-add span {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-filter-select option {\n          background: #1a1a1a !important;\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-custom-add-modal {\n          background: var(--lion-bg-primary) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-custom-item {\n          background: var(--lion-bg-tertiary) !important;\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-recurring-section {\n          background: var(--lion-bg-secondary) !important;\n          border-color: var(--lion-border-light) !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-toggle-label {\n          color: #ffffff !important;\n        }\n\n        .crm-expense-tab.lion-dark .crm-checkbox-label {\n          color: #e0e0e0 !important;\n        }\n      `))},eh=[{value:"none",label:"Message Only"},{value:"image/video",label:"Message + Images/Videos"},{value:"document",label:"Message + Documents"},{value:"audio",label:"Message + Audio"},{value:"contact",label:"Message + Contacts"},{value:"poll",label:"Message + Poll"},{value:"list",label:"Message + List"},{value:"product",label:"Message + Products"},{value:"fluxo",label:"Trigger Fluxo (Chatbot)"}],th=["@firstname","@lastname","@contactname","@whatsappname","@variable1"],nh=[{value:"minute",label:"Minute"},{value:"hour",label:"Hour"},{value:"daily",label:"Daily"},{value:"weekly",label:"Weekly"},{value:"monthly",label:"Monthly"},{value:"yearly",label:"Yearly"}],ah=({tooltip:e})=>a.createElement("span",{className:"crm-schedule-info-icon"},"i",a.createElement("span",{className:"crm-schedule-info-tooltip"},e)),rh=({contact:e,onUpdate:t})=>{const[n,r]=(0,a.useState)([]),[o,i]=(0,a.useState)("list"),[l,c]=(0,a.useState)(null),[d,m]=(0,a.useState)(!0),[,p]=(0,a.useState)(0),[u,g]=(0,a.useState)("once"),[h,b]=(0,a.useState)("none"),[f,v]=(0,a.useState)(""),[y,x]=(0,a.useState)([]),[w,k]=(0,a.useState)([]),[E,S]=(0,a.useState)(null),[C,T]=(0,a.useState)(null),[D,N]=(0,a.useState)([]),[M,R]=(0,a.useState)(""),[B,P]=(0,a.useState)(""),[L,U]=(0,a.useState)("daily"),[F,z]=(0,a.useState)(1),[O,W]=(0,a.useState)([]),[q,H]=(0,a.useState)(!0),[j,V]=(0,a.useState)("09:00"),[G,K]=(0,a.useState)("18:00"),[$,Y]=(0,a.useState)("never"),[X,J]=(0,a.useState)(10),[Q,Z]=(0,a.useState)(""),[ee,te]=(0,a.useState)(Sm),[ne,ae]=(0,a.useState)([]),[re,oe]=(0,a.useState)([]),[ie,se]=(0,a.useState)(""),[le,ce]=(0,a.useState)(void 0),[de,me]=(0,a.useState)(()=>{const e=_();return"dark"===A(e.mode)});(0,a.useEffect)(()=>{const e=()=>{const e=_();me("dark"===A(e.mode))};return window.addEventListener(I,e),window.addEventListener("lionThemeApplied",e),()=>{window.removeEventListener(I,e),window.removeEventListener("lionThemeApplied",e)}},[]),(0,a.useEffect)(()=>{const e=()=>p(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{pe(),ue()},[e.id]);const pe=async()=>{m(!0);try{const t=await Tp(),n=e.profile.phone||e.id.split("@")[0],a=t.filter(t=>t.targetId===e.id||t.targetId===n||t.targetId.includes(n));r(a)}catch(e){}finally{m(!1)}},ue=async()=>{try{await tp.FluxoStorage.restoreFromBrowserStorage();const e=tp.FluxoStorage.getFlows(),t=tp.FluxoStorage.getCategories();ae(e),oe(t)}catch(e){}},ge=()=>{g("once"),b("none"),v(""),x([]),k([]),S(null),T(null),N([]),R(""),P(""),U("daily"),z(1),W([]),H(!0),V("09:00"),K("18:00"),Y("never"),J(10),Z(""),te(Sm),se("")},he=()=>{i("list"),ge()},be=(e,t,n)=>{W(O.map(a=>a.id===e?{...a,[t]:n}:a))};return a.createElement("div",{className:"crm-schedule-tab "+(de?"lion-dark":"")},a.createElement("style",null,`\n        ${ma}\n\n        .crm-schedule-tab {\n          height: 100%;\n          display: flex;\n          flex-direction: column;\n        }\n\n        /* List View */\n        .crm-schedule-list-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          margin-bottom: 16px;\n        }\n\n        .crm-schedule-list-title {\n          font-size: 14px;\n          font-weight: 500;\n          color: var(--lion-text-muted);\n        }\n\n        .crm-schedule-add-btn {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          padding: 8px 16px;\n          background: var(--lion-primary);\n          color: white;\n          border: none;\n          border-radius: 8px;\n          cursor: pointer;\n          font-size: 14px;\n          font-weight: 500;\n          transition: all 0.2s ease;\n        }\n\n        .crm-schedule-add-btn:hover {\n          background: var(--lion-primary-hover);\n        }\n\n        .crm-schedule-list {\n          display: flex;\n          flex-direction: column;\n          gap: 12px;\n        }\n\n        .crm-schedule-card {\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 12px;\n          padding: 16px;\n          display: flex;\n          align-items: flex-start;\n          gap: 12px;\n        }\n\n        .crm-schedule-card:hover {\n          border-color: var(--lion-primary);\n        }\n\n        .crm-schedule-card-icon {\n          width: 40px;\n          height: 40px;\n          border-radius: 50%;\n          background: var(--lion-primary);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          color: white;\n          flex-shrink: 0;\n          font-size: 18px;\n        }\n\n        .crm-schedule-card-content {\n          flex: 1;\n          min-width: 0;\n        }\n\n        .crm-schedule-card-header {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          margin-bottom: 4px;\n        }\n\n        .crm-schedule-card-type {\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          font-size: 14px;\n        }\n\n        .crm-schedule-card-message {\n          color: var(--lion-text-muted);\n          font-size: 13px;\n          overflow: hidden;\n          text-overflow: ellipsis;\n          white-space: nowrap;\n          margin-bottom: 8px;\n        }\n\n        .crm-schedule-card-info {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          flex-wrap: wrap;\n        }\n\n        .crm-schedule-card-badge {\n          display: inline-flex;\n          align-items: center;\n          gap: 4px;\n          padding: 2px 8px;\n          background: rgba(var(--lion-primary-rgb), 0.1);\n          color: var(--lion-primary);\n          border-radius: 4px;\n          font-size: 11px;\n          font-weight: 500;\n        }\n\n        .crm-schedule-card-badge.inactive {\n          background: rgba(107, 114, 128, 0.1);\n          color: #6b7280;\n        }\n\n        .crm-schedule-card-actions {\n          display: flex;\n          gap: 8px;\n          flex-shrink: 0;\n        }\n\n        .crm-schedule-card-btn {\n          width: 32px;\n          height: 32px;\n          border: none;\n          border-radius: 8px;\n          cursor: pointer;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.2s ease;\n          background: transparent;\n          color: var(--lion-text-muted);\n        }\n\n        .crm-schedule-card-btn:hover {\n          background: var(--lion-bg-secondary);\n          color: var(--lion-text-primary);\n        }\n\n        .crm-schedule-card-btn.delete:hover {\n          background: rgba(239, 68, 68, 0.1);\n          color: var(--lion-error);\n        }\n\n        .crm-schedule-empty {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          justify-content: center;\n          padding: 60px 20px;\n          color: var(--lion-text-muted);\n          text-align: center;\n          background: var(--lion-bg-primary);\n          border-radius: 12px;\n          border: 2px dashed var(--lion-border-light);\n        }\n\n        .crm-schedule-empty-icon {\n          width: 64px;\n          height: 64px;\n          margin-bottom: 16px;\n          opacity: 0.5;\n        }\n\n        /* Editor View */\n        .crm-schedule-editor {\n          display: flex;\n          flex-direction: column;\n          gap: 20px;\n        }\n\n        .crm-schedule-editor-header {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          margin-bottom: 8px;\n        }\n\n        .crm-schedule-back-btn {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          padding: 8px 12px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          cursor: pointer;\n          font-size: 14px;\n          color: var(--lion-text-secondary);\n          transition: all 0.2s ease;\n        }\n\n        .crm-schedule-back-btn:hover {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n\n        .crm-schedule-editor-title {\n          font-size: 18px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-schedule-mode-tabs {\n          display: flex;\n          gap: 8px;\n        }\n\n        .crm-schedule-mode-tab {\n          flex: 1;\n          padding: 12px;\n          border: 2px solid var(--lion-border-light);\n          border-radius: 10px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-secondary);\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s ease;\n          text-align: center;\n        }\n\n        .crm-schedule-mode-tab.active {\n          border-color: var(--lion-primary);\n          background: var(--lion-primary);\n          color: #ffffff;\n        }\n\n        .crm-schedule-columns {\n          display: grid;\n          grid-template-columns: 1fr 1fr;\n          gap: 24px;\n        }\n\n        @media (max-width: 700px) {\n          .crm-schedule-columns {\n            grid-template-columns: 1fr;\n          }\n        }\n\n        .crm-schedule-column {\n          display: flex;\n          flex-direction: column;\n          gap: 16px;\n        }\n\n        .crm-schedule-field {\n          display: flex;\n          flex-direction: column;\n          gap: 6px;\n        }\n\n        .crm-schedule-field-label {\n          font-size: 13px;\n          font-weight: 500;\n          color: var(--lion-text-secondary);\n          display: flex;\n          align-items: center;\n          gap: 6px;\n        }\n\n        .crm-schedule-field-label .required {\n          color: var(--lion-error);\n        }\n\n        .crm-schedule-info-icon {\n          display: inline-flex;\n          align-items: center;\n          justify-content: center;\n          width: 16px;\n          height: 16px;\n          border-radius: 50%;\n          background: var(--lion-border-light);\n          color: var(--lion-text-muted);\n          font-size: 10px;\n          font-weight: 600;\n          cursor: help;\n          position: relative;\n          flex-shrink: 0;\n          transition: all 0.2s ease;\n        }\n\n        .crm-schedule-info-icon:hover {\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        .crm-schedule-info-tooltip {\n          position: absolute;\n          bottom: calc(100% + 8px);\n          left: 0;\n          background: var(--lion-sidebar-start);\n          color: white;\n          padding: 10px 14px;\n          border-radius: 8px;\n          font-size: 12px;\n          font-weight: 400;\n          line-height: 1.5;\n          width: 250px;\n          max-width: 90vw;\n          text-align: left;\n          z-index: 10001;\n          box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);\n          opacity: 0;\n          visibility: hidden;\n          transition: all 0.2s ease;\n          pointer-events: none;\n        }\n\n        .crm-schedule-info-tooltip::after {\n          content: '';\n          position: absolute;\n          top: 100%;\n          left: 8px;\n          border: 6px solid transparent;\n          border-top-color: var(--lion-sidebar-start);\n        }\n\n        .crm-schedule-info-icon:hover .crm-schedule-info-tooltip {\n          opacity: 1;\n          visibility: visible;\n        }\n\n        .crm-schedule-select {\n          padding: 10px 12px;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-primary);\n          font-size: 14px;\n          cursor: pointer;\n          appearance: none;\n          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");\n          background-repeat: no-repeat;\n          background-position: right 12px center;\n          padding-right: 36px;\n        }\n\n        .crm-schedule-input {\n          padding: 10px 12px;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-primary);\n          font-size: 14px;\n        }\n\n        .crm-schedule-input:focus, .crm-schedule-select:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n        }\n\n        .crm-schedule-textarea {\n          padding: 12px;\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-primary);\n          font-size: 14px;\n          min-height: 100px;\n          resize: vertical;\n          font-family: inherit;\n        }\n\n        .crm-schedule-textarea:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n        }\n\n        .crm-schedule-variables-row {\n          display: flex;\n          flex-wrap: wrap;\n          gap: 6px;\n          margin-top: 8px;\n        }\n\n        .crm-schedule-variables-label {\n          font-size: 11px;\n          color: var(--lion-text-muted);\n          margin-right: 4px;\n        }\n\n        .crm-schedule-variable-chip {\n          padding: 4px 10px;\n          background: var(--lion-primary) !important;\n          border: 1px solid var(--lion-primary);\n          border-radius: 20px;\n          font-size: 11px;\n          font-weight: 500;\n          color: #ffffff !important;\n          cursor: pointer;\n          transition: all 0.2s ease;\n        }\n\n        .crm-schedule-variable-chip:hover {\n          background: var(--lion-primary-hover) !important;\n        }\n\n        .crm-schedule-attachment-section {\n          margin-top: 16px;\n          padding: 16px;\n          background: var(--lion-bg-primary);\n          border-radius: 8px;\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .crm-schedule-time-entries {\n          display: flex;\n          flex-direction: column;\n          gap: 8px;\n          margin-top: 8px;\n        }\n\n        .crm-schedule-time-entry {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .crm-schedule-time-entry .crm-schedule-select,\n        .crm-schedule-time-entry .crm-schedule-input {\n          flex: 1;\n        }\n\n        .crm-schedule-remove-btn {\n          width: 32px;\n          height: 32px;\n          border: none;\n          border-radius: 6px;\n          background: rgba(239, 68, 68, 0.1);\n          color: var(--lion-error);\n          cursor: pointer;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.2s ease;\n        }\n\n        .crm-schedule-remove-btn:hover {\n          background: rgba(239, 68, 68, 0.2);\n        }\n\n        .crm-schedule-add-time-btn {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          padding: 8px 12px;\n          border: 1px dashed var(--lion-border-light);\n          border-radius: 8px;\n          background: transparent;\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          font-size: 13px;\n          transition: all 0.2s ease;\n          margin-top: 8px;\n        }\n\n        .crm-schedule-add-time-btn:hover {\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n\n        .crm-schedule-radio-group {\n          display: flex;\n          flex-direction: column;\n          gap: 8px;\n        }\n\n        .crm-schedule-radio {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          cursor: pointer;\n        }\n\n        .crm-schedule-radio-dot {\n          width: 18px;\n          height: 18px;\n          border-radius: 50%;\n          border: 2px solid var(--lion-border-light);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n        }\n\n        .crm-schedule-radio.active .crm-schedule-radio-dot {\n          border-color: var(--lion-primary);\n        }\n\n        .crm-schedule-radio.active .crm-schedule-radio-dot::after {\n          content: '';\n          width: 10px;\n          height: 10px;\n          border-radius: 50%;\n          background: var(--lion-primary);\n        }\n\n        .crm-schedule-radio-label {\n          font-size: 13px;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-schedule-footer {\n          display: flex;\n          justify-content: flex-end;\n          gap: 12px;\n          margin-top: 20px;\n          padding-top: 20px;\n          border-top: 1px solid var(--lion-border-light);\n        }\n\n        .crm-schedule-btn {\n          padding: 10px 24px;\n          border-radius: 8px;\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s ease;\n        }\n\n        .crm-schedule-btn-secondary {\n          background: transparent;\n          border: 1px solid var(--lion-border-light);\n          color: var(--lion-text-secondary);\n        }\n\n        .crm-schedule-btn-secondary:hover {\n          background: var(--lion-bg-secondary);\n          border-color: var(--lion-text-muted);\n        }\n\n        .crm-schedule-btn-primary {\n          background: var(--lion-primary);\n          border: none;\n          color: white;\n        }\n\n        .crm-schedule-btn-primary:hover {\n          background: var(--lion-primary-hover);\n        }\n\n        .crm-schedule-target-info {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          padding: 12px;\n          background: var(--lion-bg-primary);\n          border: 1px solid var(--lion-border-light);\n          border-radius: 8px;\n          margin-bottom: 16px;\n        }\n\n        .crm-schedule-target-avatar {\n          width: 40px;\n          height: 40px;\n          border-radius: 50%;\n          background: var(--lion-primary);\n          color: white;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          font-size: 16px;\n          font-weight: 600;\n        }\n\n        .crm-schedule-target-name {\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          font-size: 14px;\n        }\n\n        .crm-schedule-target-phone {\n          font-size: 12px;\n          color: var(--lion-text-muted);\n        }\n      `),"list"===o?a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-schedule-list-header"},a.createElement("div",{className:"crm-schedule-list-title"},n.length," ",(0,s.t)("schedule.schedulesCount")||"scheduled message(s)"),a.createElement("button",{className:"crm-schedule-add-btn",onClick:()=>{ge(),c(null),i("editor")}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M12 5v14M5 12h14"})),(0,s.t)("crm.addScheduleMessage")||"Add Schedule")),d?a.createElement("div",{className:"crm-schedule-empty"},a.createElement("div",{style:{fontSize:"24px",marginBottom:"8px"}},"⏳"),a.createElement("div",null,(0,s.t)("common.loading")||"Loading...")):0===n.length?a.createElement("div",{className:"crm-schedule-empty"},a.createElement("svg",{className:"crm-schedule-empty-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},a.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),a.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),a.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),a.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"})),a.createElement("div",{style:{fontSize:"16px",fontWeight:500,marginBottom:"8px"}},(0,s.t)("crm.noScheduledMessages")||"No Scheduled Messages"),a.createElement("div",{style:{fontSize:"14px"}},(0,s.t)("crm.noScheduledMessagesDesc")||"Schedule messages for this contact.")):a.createElement("div",{className:"crm-schedule-list"},n.map(e=>a.createElement("div",{key:e.id,className:"crm-schedule-card"},a.createElement("div",{className:"crm-schedule-card-icon"},"once"===e.mode?"📅":"🔄"),a.createElement("div",{className:"crm-schedule-card-content"},a.createElement("div",{className:"crm-schedule-card-header"},a.createElement("span",{className:"crm-schedule-card-type"},"once"===e.mode?(0,s.t)("schedule.once")||"Once":(0,s.t)("schedule.repeated")||"Repeated"),!e.isActive&&a.createElement("span",{className:"crm-schedule-card-badge inactive"},(0,s.t)("schedule.inactive")||"Inactive")),a.createElement("div",{className:"crm-schedule-card-message"},"fluxo"===e.templateType?`Fluxo: ${ne.find(t=>t.id===e.fluxoFlowId)?.name||e.fluxoFlowId}`:`"${e.message.substring(0,50)}${e.message.length>50?"...":""}"`),a.createElement("div",{className:"crm-schedule-card-info"},a.createElement("span",{className:"crm-schedule-card-badge"},"once"===e.mode?a.createElement(a.Fragment,null,"📅 ",e.scheduledAt?new Date(e.scheduledAt).toLocaleString():""):a.createElement(a.Fragment,null,"🔄 ",nh.find(t=>t.value===e.repeatedType)?.label||e.repeatedType)),a.createElement("span",{className:"crm-schedule-card-badge"},eh.find(t=>t.value===e.templateType)?.label||e.templateType))),a.createElement("div",{className:"crm-schedule-card-actions"},a.createElement("button",{className:"crm-schedule-card-btn",onClick:()=>(e=>{if(c(e),g(e.mode),b(e.templateType),v(e.message),x(e.attachments||[]),k(e.selectedContacts||[]),S(e.pollData||null),T(e.listData||null),N(e.selectedProducts||[]),e.scheduledAt){const t=new Date(e.scheduledAt);R(t.toISOString().split("T")[0]),P(t.toTimeString().substring(0,5))}U(e.repeatedType||"daily"),z(e.repeatInterval||1),W(e.timeEntries||[]),H(!1!==e.runAnytime),V(e.runBetweenStart||"09:00"),K(e.runBetweenEnd||"18:00"),Y(e.endType||"never"),J(e.endAfterCount||10),e.endDate&&Z(new Date(e.endDate).toISOString().split("T")[0]),te(e.postActions||Sm),se(e.fluxoFlowId||""),i("editor")})(e),title:(0,s.t)("common.edit")||"Edit"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"}))),a.createElement("button",{className:"crm-schedule-card-btn delete",onClick:()=>(async e=>{confirm((0,s.t)("schedule.confirmDelete")||"Are you sure you want to delete this schedule?")&&(await Dp(e),await pe())})(e.id),title:(0,s.t)("common.delete")||"Delete"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polyline",{points:"3 6 5 6 21 6"}),a.createElement("path",{d:"M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"})))))))):a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-schedule-editor"},a.createElement("div",{className:"crm-schedule-editor-header"},a.createElement("button",{className:"crm-schedule-back-btn",onClick:he},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M19 12H5M12 19l-7-7 7-7"})),(0,s.t)("common.back")||"Back"),a.createElement("span",{className:"crm-schedule-editor-title"},l?(0,s.t)("schedule.editSchedule")||"Edit Schedule":(0,s.t)("crm.addScheduleMessage")||"Add Schedule")),a.createElement("div",{className:"crm-schedule-target-info"},a.createElement("div",{className:"crm-schedule-target-avatar"},(e.profile.name||e.profile.phone||"?").charAt(0).toUpperCase()),a.createElement("div",null,a.createElement("div",{className:"crm-schedule-target-name"},e.profile.name||e.profile.phone||e.id.split("@")[0]),a.createElement("div",{className:"crm-schedule-target-phone"},e.profile.phone||e.id.split("@")[0]))),a.createElement("div",{className:"crm-schedule-mode-tabs"},a.createElement("button",{className:"crm-schedule-mode-tab "+("once"===u?"active":""),onClick:()=>g("once")},(0,s.t)("schedule.once")||"Once"),a.createElement("button",{className:"crm-schedule-mode-tab "+("repeated"===u?"active":""),onClick:()=>g("repeated")},(0,s.t)("schedule.repeated")||"Repeated")),a.createElement("div",{className:"crm-schedule-columns"},a.createElement("div",{className:"crm-schedule-column"},a.createElement("div",{className:"crm-schedule-field"},a.createElement("label",{className:"crm-schedule-field-label"},(0,s.t)("followUp.templatesType")||"Template Type",a.createElement(ah,{tooltip:(0,s.t)("schedule.tooltip.templateType")||"Choose the type of message to send."})),a.createElement("select",{className:"crm-schedule-select",value:h,onChange:e=>b(e.target.value)},eh.map(e=>a.createElement("option",{key:e.value,value:e.value},(0,s.t)(`templates.attachmentType.${"none"===e.value?"none":e.value.replace("/","")}`)||e.label)))),"fluxo"===h&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-schedule-field"},a.createElement("label",{className:"crm-schedule-field-label"},(0,s.t)("followUp.fluxoCategory")||"Category"),a.createElement("select",{className:"crm-schedule-select",value:le||"all",onChange:e=>{ce("all"===e.target.value?void 0:e.target.value),se("")}},a.createElement("option",{value:"all"},(0,s.t)("followUp.allCategories")||"All Categories"),re.map(e=>a.createElement("option",{key:e.id,value:e.id},e.icon," ",e.name)),a.createElement("option",{value:"uncategorized"},(0,s.t)("followUp.uncategorized")||"Uncategorized"))),a.createElement("div",{className:"crm-schedule-field"},a.createElement("label",{className:"crm-schedule-field-label"},(0,s.t)("followUp.selectFluxo")||"Select Fluxo"," ",a.createElement("span",{className:"required"},"*")),a.createElement("select",{className:"crm-schedule-select",value:ie,onChange:e=>se(e.target.value)},a.createElement("option",{value:""},(0,s.t)("followUp.chooseFluxo")||"-- Choose a Fluxo --"),ne.filter(e=>!le||"all"===le||("uncategorized"===le?!e.categoryId:e.categoryId===le)).map(e=>a.createElement("option",{key:e.id,value:e.id},e.name," ",e.isActive?"✓":"(inactive)")))),a.createElement("p",{style:{fontSize:"12px",color:"var(--lion-text-muted)",marginTop:"8px"}},(0,s.t)("followUp.fluxoInfo")||"The selected chatbot flow will be triggered when this schedule executes.")),"fluxo"!==h&&a.createElement("div",{className:"crm-schedule-field"},a.createElement("label",{className:"crm-schedule-field-label"},(0,s.t)("followUp.messageText")||"Message"," ",a.createElement("span",{className:"required"},"*"),a.createElement(ah,{tooltip:(0,s.t)("schedule.tooltip.message")||"Type your message. Use variables for personalization."})),a.createElement("textarea",{id:"crm-schedule-message-textarea",className:"crm-schedule-textarea",value:f,onChange:e=>v(e.target.value),placeholder:(0,s.t)("followUp.messagePlaceholder")||"Type your message here..."}),a.createElement("div",{className:"crm-schedule-variables-row"},a.createElement("span",{className:"crm-schedule-variables-label"},(0,s.t)("followUp.clickToInsert")||"Insert variable:"),th.map(e=>a.createElement("span",{key:e,className:"crm-schedule-variable-chip",onClick:()=>(e=>{const t=document.getElementById("crm-schedule-message-textarea");if(!t)return void v(f+" "+e);const n=t.selectionStart||f.length,a=f.substring(0,n),r=f.substring(n);v(a+e+" "+r),setTimeout(()=>{t.focus(),t.setSelectionRange(n+e.length+1,n+e.length+1)},0)})(e)},e)))),"none"===h||"fluxo"===h?null:a.createElement("div",{className:"crm-schedule-attachment-section"},("image/video"===h||"document"===h||"audio"===h)&&a.createElement(Ln,{attachments:y,attachmentType:h,onChange:x}),"contact"===h&&a.createElement(On,{selectedContacts:w,onChange:k}),"poll"===h&&a.createElement(Un,{pollData:E,onChange:S}),"list"===h&&a.createElement(Fn,{listData:C,onChange:T}),"product"===h&&a.createElement(Wn,{selectedProducts:D,onChange:N}))),a.createElement("div",{className:"crm-schedule-column"},a.createElement("div",{className:"crm-schedule-field"},a.createElement("label",{className:"crm-schedule-field-label"},(0,s.t)("schedule.scheduleDateTime")||"Schedule Date & Time"," ",a.createElement("span",{className:"required"},"*"),a.createElement(ah,{tooltip:(0,s.t)("schedule.tooltip.dateTime")||"When to send the message."})),a.createElement("div",{style:{display:"flex",gap:"8px"}},a.createElement("input",{type:"date",className:"crm-schedule-input",value:M,onChange:e=>R(e.target.value),style:{flex:1}}),a.createElement("input",{type:"time",className:"crm-schedule-input",value:B,onChange:e=>P(e.target.value),style:{flex:1}}))),"repeated"===u&&a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-schedule-field"},a.createElement("label",{className:"crm-schedule-field-label"},(0,s.t)("schedule.repeatedType")||"Repeat Frequency",a.createElement(ah,{tooltip:(0,s.t)("schedule.tooltip.repeatedType")||"How often to repeat the message."})),a.createElement("select",{className:"crm-schedule-select",value:L,onChange:e=>{U(e.target.value),W([])}},nh.map(e=>a.createElement("option",{key:e.value,value:e.value},(0,s.t)(`schedule.repeatedType_${e.value}`)||e.label)))),("minute"===L||"hour"===L)&&a.createElement("div",{className:"crm-schedule-field"},a.createElement("label",{className:"crm-schedule-field-label"},"minute"===L?(0,s.t)("schedule.everyMinutes")||"Every X Minutes":(0,s.t)("schedule.everyHours")||"Every X Hours"),a.createElement("input",{type:"number",className:"crm-schedule-input",value:F,onChange:e=>z(parseInt(e.target.value)||1),min:"1"})),("daily"===L||"weekly"===L||"monthly"===L||"yearly"===L)&&a.createElement("div",{className:"crm-schedule-field"},a.createElement("label",{className:"crm-schedule-field-label"},(0,s.t)("schedule.scheduleTime")||"Schedule Times",a.createElement(ah,{tooltip:(0,s.t)("schedule.tooltip.scheduleTimes")||"Add times when the message should be sent."})),a.createElement("div",{className:"crm-schedule-time-entries"},O.map(e=>a.createElement("div",{key:e.id,className:"crm-schedule-time-entry"},"weekly"===L&&a.createElement("select",{className:"crm-schedule-select",value:e.day||1,onChange:t=>be(e.id,"day",parseInt(t.target.value))},kp.map(e=>a.createElement("option",{key:e.value,value:e.value},(0,s.t)(`schedule.weekday_${e.key}`)||e.label))),"monthly"===L&&a.createElement("select",{className:"crm-schedule-select",value:e.date||1,onChange:t=>be(e.id,"date",parseInt(t.target.value))},Array.from({length:31},(e,t)=>t+1).map(e=>a.createElement("option",{key:e,value:e},e))),"yearly"===L&&a.createElement(a.Fragment,null,a.createElement("select",{className:"crm-schedule-select",value:e.month||1,onChange:t=>be(e.id,"month",parseInt(t.target.value))},Ep.map(e=>a.createElement("option",{key:e.value,value:e.value},(0,s.t)(`schedule.month_${e.key}`)||e.label))),a.createElement("select",{className:"crm-schedule-select",value:e.date||1,onChange:t=>be(e.id,"date",parseInt(t.target.value))},Array.from({length:31},(e,t)=>t+1).map(e=>a.createElement("option",{key:e,value:e},e)))),a.createElement("input",{type:"time",className:"crm-schedule-input",value:e.time,onChange:t=>be(e.id,"time",t.target.value)}),a.createElement("button",{className:"crm-schedule-remove-btn",onClick:()=>{return t=e.id,void W(O.filter(e=>e.id!==t));var t}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 6L6 18M6 6l12 12"})))))),a.createElement("button",{className:"crm-schedule-add-time-btn",onClick:()=>{const e={id:Cp(),time:"12:00"};"weekly"===L?e.day=1:"monthly"===L?e.date=1:"yearly"===L&&(e.month=1,e.date=1),W([...O,e])}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M12 5v14M5 12h14"})),(0,s.t)("schedule.addTime")||"Add Time")),a.createElement("div",{className:"crm-schedule-field"},a.createElement("label",{className:"crm-schedule-field-label"},(0,s.t)("schedule.startAndEndTime")||"Active Hours",a.createElement(ah,{tooltip:(0,s.t)("schedule.tooltip.runBetween")||"Restrict to specific hours."})),a.createElement("div",{className:"crm-schedule-radio-group"},a.createElement("div",{className:"crm-schedule-radio "+(q?"active":""),onClick:()=>H(!0)},a.createElement("div",{className:"crm-schedule-radio-dot"}),a.createElement("span",{className:"crm-schedule-radio-label"},(0,s.t)("schedule.runAnytime")||"Run anytime")),a.createElement("div",{className:"crm-schedule-radio "+(q?"":"active"),onClick:()=>H(!1)},a.createElement("div",{className:"crm-schedule-radio-dot"}),a.createElement("span",{className:"crm-schedule-radio-label"},(0,s.t)("schedule.runBetween")||"Run between"))),!q&&a.createElement("div",{style:{display:"flex",gap:"8px",marginTop:"8px"}},a.createElement("input",{type:"time",className:"crm-schedule-input",value:j,onChange:e=>V(e.target.value)}),a.createElement("span",{style:{alignSelf:"center",color:"var(--lion-text-muted)"}},"to"),a.createElement("input",{type:"time",className:"crm-schedule-input",value:G,onChange:e=>K(e.target.value)}))),a.createElement("div",{className:"crm-schedule-field"},a.createElement("label",{className:"crm-schedule-field-label"},(0,s.t)("schedule.endSchedule")||"End Condition",a.createElement(ah,{tooltip:(0,s.t)("schedule.tooltip.endSchedule")||"When to stop repeating."})),a.createElement("div",{className:"crm-schedule-radio-group"},a.createElement("div",{className:"crm-schedule-radio "+("never"===$?"active":""),onClick:()=>Y("never")},a.createElement("div",{className:"crm-schedule-radio-dot"}),a.createElement("span",{className:"crm-schedule-radio-label"},(0,s.t)("schedule.never")||"Never")),a.createElement("div",{className:"crm-schedule-radio "+("count"===$?"active":""),onClick:()=>Y("count")},a.createElement("div",{className:"crm-schedule-radio-dot"}),a.createElement("span",{className:"crm-schedule-radio-label"},(0,s.t)("schedule.afterCount")||"After X times")),"count"===$&&a.createElement("input",{type:"number",className:"crm-schedule-input",value:X,onChange:e=>J(parseInt(e.target.value)||1),min:"1",style:{marginLeft:"26px",width:"100px"}}),a.createElement("div",{className:"crm-schedule-radio "+("date"===$?"active":""),onClick:()=>Y("date")},a.createElement("div",{className:"crm-schedule-radio-dot"}),a.createElement("span",{className:"crm-schedule-radio-label"},(0,s.t)("schedule.completeOnDate")||"On date")),"date"===$&&a.createElement("input",{type:"date",className:"crm-schedule-input",value:Q,onChange:e=>Z(e.target.value),style:{marginLeft:"26px"}})))))),a.createElement(mp,{postActions:ee,onChange:te}),a.createElement("div",{className:"crm-schedule-footer"},a.createElement("button",{className:"crm-schedule-btn crm-schedule-btn-secondary",onClick:he},(0,s.t)("common.cancel")||"Cancel"),a.createElement("button",{className:"crm-schedule-btn crm-schedule-btn-primary",onClick:async()=>{const t=("image/video"===h||"document"===h||"audio"===h)&&y&&y.length>0;if(!f&&"fluxo"!==h&&!t)return void alert((0,s.t)("schedule.enterMessage")||"Please enter a message or attach media");if(!M||!B)return void alert((0,s.t)("schedule.selectDateTime")||"Please select date and time");const n=e.id,a=e.profile.name||e.profile.phone||e.id.split("@")[0],r={id:l?.id,isActive:!0,targetId:n,targetName:a,targetType:"contact",mode:u,templateType:h,message:f,attachments:"image/video"===h||"document"===h||"audio"===h?y:void 0,selectedContacts:"contact"===h?w:void 0,pollData:"poll"===h?E:void 0,listData:"list"===h?C:void 0,selectedProducts:"product"===h?D:void 0,fluxoFlowId:"fluxo"===h?ie:void 0,postActions:ee,lastExecutedAt:void 0,executionCount:l?0:void 0},o=`${M}T${B}`;r.scheduledAt=new Date(o).getTime(),"repeated"===u&&(r.repeatedType=L,r.repeatInterval=F,r.timeEntries=O,r.runAnytime=q,r.runBetweenStart=j,r.runBetweenEnd=G,r.endType=$,r.endAfterCount=X,Q&&(r.endDate=new Date(Q).getTime())),await Ap(r),await pe(),i("list"),ge()}},(0,s.t)("common.save")||"Save")))))},oh="lion_anti_revoke_settings",ih="lion_anti_revoke_chat_index",sh={enabled:!1,ttlDays:7,maxPerChat:500};class lh{static getSettings(){try{const e=localStorage.getItem(oh);if(!e)return{...sh};const t=JSON.parse(e);return{...sh,...t}}catch(e){return{...sh}}}static setSettings(e){const t={...this.getSettings(),...e};try{localStorage.setItem(oh,JSON.stringify(t))}catch(e){}return t}static getChatKey(e){return`lion_anti_revoke_${e}`}static getChatIndex(){try{const e=localStorage.getItem(ih);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}static addToChatIndex(e){const t=this.getChatIndex();if(!t.includes(e)){t.push(e);try{localStorage.setItem(ih,JSON.stringify(t))}catch{}}}static removeFromChatIndex(e){const t=this.getChatIndex().filter(t=>t!==e);try{localStorage.setItem(ih,JSON.stringify(t))}catch{}}static getMessagesForChat(e){if(!e)return[];try{const t=localStorage.getItem(this.getChatKey(e));if(!t)return[];const n=JSON.parse(t);return Array.isArray(n)?n:[]}catch(e){return[]}}static writeMessagesForChat(e,t){if(e)try{0===t.length?(localStorage.removeItem(this.getChatKey(e)),this.removeFromChatIndex(e)):(localStorage.setItem(this.getChatKey(e),JSON.stringify(t)),this.addToChatIndex(e))}catch(e){}}static saveMessage(e){if(!e||!e.chatId||!e.msgId)return;const t=this.getSettings();if(!t.enabled)return;const n=this.getMessagesForChat(e.chatId);if(n.some(t=>t.msgId===e.msgId))return;const a=Date.now(),r=24*t.ttlDays*60*60*1e3;let o=n.filter(e=>a-e.timestamp<r);o.push(e),o.length>t.maxPerChat&&(o=o.slice(o.length-t.maxPerChat)),this.writeMessagesForChat(e.chatId,o)}static markAsRevoked(e,t,n,a){if(!e||!t)return!1;const r=this.getMessagesForChat(e),o=r.findIndex(e=>e.msgId===t);return-1!==o&&(r[o]={...r[o],revoked:!0,revokedAt:n,revokeType:a},this.writeMessagesForChat(e,r),!0)}static getRevokedMessages(e){const t=e?[e]:this.getChatIndex(),n=[];for(const e of t){const t=this.getMessagesForChat(e).filter(e=>e.revoked);n.push(...t)}return n.sort((e,t)=>(t.revokedAt??t.timestamp)-(e.revokedAt??e.timestamp))}static getRevokedCount(e){return this.getRevokedMessages(e).length}static clearChat(e){this.writeMessagesForChat(e,[])}static clearAll(){const e=this.getChatIndex();for(const t of e)try{localStorage.removeItem(this.getChatKey(t))}catch{}try{localStorage.removeItem(ih)}catch{}}static cleanup(){const e=this.getSettings(),t=Date.now(),n=24*e.ttlDays*60*60*1e3,a=this.getChatIndex();for(const e of a){const a=this.getMessagesForChat(e),r=a.filter(e=>t-e.timestamp<n);r.length!==a.length&&this.writeMessagesForChat(e,r)}}static exportToCSV(e){const t=e=>{const t=String(e??"");return t.includes(",")||t.includes('"')||t.includes("\n")?`"${t.replace(/"/g,'""')}"`:t},n=e.map(e=>[e.chatId,e.sender,e.senderId,e.body,e.type,e.isGroup?"Yes":"No",new Date(e.timestamp).toISOString(),e.revokedAt?new Date(e.revokedAt).toISOString():"",e.revokeType??""].map(t).join(","));return[["Chat ID","Sender","Sender ID","Message","Type","Is Group","Original Time","Revoked At","Revoke Type"].join(","),...n].join("\n")}}const ch=({contact:e})=>{Mg(),Wg();const[t,n]=(0,a.useState)(()=>lh.getSettings()),[r,o]=(0,a.useState)("contact"),[i,l]=(0,a.useState)([]),[c,d]=(0,a.useState)(""),m=()=>{const t="contact"===r?e.id:void 0;l(lh.getRevokedMessages(t))};(0,a.useEffect)(()=>{m();const e=()=>m();return window.addEventListener("lionAntiRevokeUpdated",e),()=>window.removeEventListener("lionAntiRevokeUpdated",e)},[r,e.id]);const p=(0,a.useMemo)(()=>{if(!c.trim())return i;const e=c.trim().toLowerCase();return i.filter(t=>(t.body||"").toLowerCase().includes(e)||(t.sender||"").toLowerCase().includes(e))},[i,c]),u=e=>{if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return"—"}};return a.createElement("div",{className:"crm-deleted-tab"},a.createElement("style",null,`\n        ${ma}\n        .crm-deleted-tab {\n          padding: 16px;\n          color: var(--lion-text-primary);\n        }\n        .dm-banner {\n          padding: 12px 14px;\n          border-radius: 8px;\n          margin-bottom: 14px;\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          gap: 12px;\n          font-size: 13px;\n        }\n        .dm-banner.on {\n          background: ${ca.primaryLight};\n          border: 1px solid ${ca.primary};\n          color: ${ca.textPrimary};\n        }\n        .dm-banner.off {\n          background: ${ca.bgSecondary};\n          border: 1px solid ${ca.borderLight};\n          color: ${ca.textSecondary};\n        }\n        .dm-banner .desc { flex: 1; line-height: 1.4; }\n\n        .dm-chat-tip {\n          display: flex;\n          align-items: flex-start;\n          gap: 8px;\n          padding: 8px 12px;\n          margin-bottom: 14px;\n          background: ${ca.bgSecondary};\n          border: 1px dashed ${ca.borderLight};\n          border-radius: 6px;\n          font-size: 12px;\n          line-height: 1.4;\n          color: ${ca.textMuted};\n        }\n        .dm-chat-tip svg {\n          flex-shrink: 0;\n          margin-top: 1px;\n          color: ${ca.primary};\n        }\n        .dm-toggle-btn {\n          background: ${ca.primary};\n          color: #fff;\n          border: none;\n          border-radius: 6px;\n          padding: 7px 14px;\n          cursor: pointer;\n          font-weight: 600;\n          font-size: 13px;\n          white-space: nowrap;\n        }\n        .dm-toggle-btn.off { background: ${ca.textMuted}; }\n        .dm-toggle-btn:hover { opacity: 0.9; }\n\n        .dm-controls {\n          display: flex;\n          flex-wrap: wrap;\n          align-items: center;\n          gap: 8px;\n          margin-bottom: 12px;\n        }\n        .dm-scope {\n          display: inline-flex;\n          border: 1px solid ${ca.borderLight};\n          border-radius: 6px;\n          overflow: hidden;\n        }\n        .dm-scope button {\n          background: transparent;\n          border: none;\n          padding: 6px 12px;\n          cursor: pointer;\n          color: ${ca.textSecondary};\n          font-size: 12px;\n        }\n        .dm-scope button.active {\n          background: ${ca.primary};\n          color: #fff;\n        }\n        .dm-search {\n          flex: 1;\n          min-width: 180px;\n          padding: 7px 10px;\n          border: 1px solid ${ca.borderLight};\n          border-radius: 6px;\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-primary);\n          font-size: 13px;\n        }\n        .dm-action-btn {\n          background: var(--lion-bg-primary);\n          border: 1px solid ${ca.borderLight};\n          color: ${ca.textPrimary};\n          border-radius: 6px;\n          padding: 7px 12px;\n          font-size: 12px;\n          cursor: pointer;\n        }\n        .dm-action-btn:hover { border-color: ${ca.primary}; color: ${ca.primary}; }\n        .dm-action-btn.danger:hover { border-color: ${ca.error}; color: ${ca.error}; }\n\n        .dm-count {\n          color: ${ca.textMuted};\n          font-size: 12px;\n          margin-bottom: 10px;\n        }\n\n        .dm-empty {\n          padding: 40px 20px;\n          text-align: center;\n          color: ${ca.textMuted};\n          background: ${ca.bgSecondary};\n          border-radius: 8px;\n          border: 1px dashed ${ca.borderLight};\n        }\n        .dm-empty .emoji { font-size: 36px; display: block; margin-bottom: 8px; }\n\n        .dm-list { display: flex; flex-direction: column; gap: 10px; }\n        .dm-card {\n          background: var(--lion-bg-primary);\n          border: 1px solid ${ca.borderLight};\n          border-left: 3px solid ${ca.primary};\n          border-radius: 8px;\n          padding: 12px 14px;\n        }\n        .dm-card-header {\n          display: flex;\n          justify-content: space-between;\n          gap: 8px;\n          margin-bottom: 6px;\n          flex-wrap: wrap;\n        }\n        .dm-sender {\n          font-weight: 600;\n          color: ${ca.textPrimary};\n          font-size: 13px;\n        }\n        .dm-meta {\n          font-size: 11px;\n          color: ${ca.textMuted};\n        }\n        .dm-body {\n          font-size: 14px;\n          color: ${ca.textPrimary};\n          white-space: pre-wrap;\n          word-break: break-word;\n          margin-bottom: 8px;\n        }\n        .dm-body.empty {\n          color: ${ca.textMuted};\n          font-style: italic;\n        }\n        .dm-footer {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          gap: 8px;\n          font-size: 11px;\n          color: ${ca.textMuted};\n        }\n        .dm-badge {\n          background: ${ca.primaryLight};\n          color: ${ca.primary};\n          padding: 2px 8px;\n          border-radius: 999px;\n          font-size: 10px;\n          font-weight: 600;\n          text-transform: uppercase;\n        }\n        .dm-copy {\n          background: none;\n          border: none;\n          color: ${ca.primary};\n          cursor: pointer;\n          font-size: 11px;\n        }\n      `),a.createElement("div",{className:"dm-banner "+(t.enabled?"on":"off")},a.createElement("div",{className:"desc"},a.createElement("strong",null,t.enabled?(0,s.t)("crm.antiRevokeEnabled")||"Anti-Revoke is ON":(0,s.t)("crm.antiRevokeDisabled")||"Anti-Revoke is OFF"),a.createElement("div",{style:{fontSize:12,marginTop:4}},(0,s.t)("crm.antiRevokeDescription")||"Save copies of incoming messages locally so you can see them even if the sender deletes them.")),a.createElement("button",{className:"dm-toggle-btn "+(t.enabled?"":"off"),onClick:()=>{const e=lh.setSettings({enabled:!t.enabled});n(e),window.dispatchEvent(new CustomEvent("lionAntiRevokeUpdated"))}},t.enabled?(0,s.t)("crm.disable")||"Disable":(0,s.t)("crm.enable")||"Enable")),t.enabled&&a.createElement("div",{className:"dm-chat-tip"},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},a.createElement("path",{d:"M3 12a9 9 0 1 0 3-6.7"}),a.createElement("polyline",{points:"3 4 3 10 9 10"})),a.createElement("span",null,(0,s.t)("crm.antiRevokeChatTip")||"Tip: You can also click the recover icon directly on a deleted message in chat for a quick reveal.")),a.createElement("div",{className:"dm-controls"},a.createElement("div",{className:"dm-scope"},a.createElement("button",{className:"contact"===r?"active":"",onClick:()=>o("contact")},(0,s.t)("crm.onlyThisContact")||"Only this contact"),a.createElement("button",{className:"all"===r?"active":"",onClick:()=>o("all")},(0,s.t)("crm.allContacts")||"All contacts")),a.createElement("input",{className:"dm-search",placeholder:(0,s.t)("crm.searchMessages")||"Search messages…",value:c,onChange:e=>d(e.target.value)}),a.createElement("button",{className:"dm-action-btn",onClick:()=>{if(0===i.length)return;const e=lh.exportToCSV(i),t=new Blob([e],{type:"text/csv;charset=utf-8;"}),n=URL.createObjectURL(t),a=document.createElement("a"),r=(new Date).toISOString().split("T")[0];a.href=n,a.download=`lion-crm-deleted-messages-${r}.csv`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n)},disabled:0===i.length},(0,s.t)("crm.exportCSV")||"Export CSV"),a.createElement("button",{className:"dm-action-btn danger",onClick:()=>{const t="contact"===r?(0,s.t)("crm.confirmClearChatHistory")||"Clear recovered messages for this contact?":(0,s.t)("crm.confirmClearAllHistory")||"Clear ALL recovered messages across every chat?";confirm(t)&&("contact"===r?lh.clearChat(e.id):lh.clearAll(),m())},disabled:0===i.length},(0,s.t)("crm.clearHistory")||"Clear history")),a.createElement("div",{className:"dm-count"},((0,s.t)("crm.recoveredCount")||"{count} recovered message(s)").replace("{count}",String(p.length))),0===p.length?a.createElement("div",{className:"dm-empty"},a.createElement("span",{className:"emoji"},"🦁"),a.createElement("div",null,t.enabled?(0,s.t)("crm.noDeletedMessages")||"No deleted messages recovered yet. We’re watching — if anyone deletes a message, we’ll keep a copy here.":(0,s.t)("crm.antiRevokeNotEnabledHint")||"Enable Anti-Revoke above to start saving incoming messages.")):a.createElement("div",{className:"dm-list"},p.map(e=>a.createElement("div",{key:`${e.chatId}-${e.msgId}`,className:"dm-card"},a.createElement("div",{className:"dm-card-header"},a.createElement("span",{className:"dm-sender"},e.sender||e.senderId||e.chatId,e.isGroup&&a.createElement("span",{className:"dm-badge",style:{marginLeft:8}},(0,s.t)("crm.group")||"Group")),a.createElement("span",{className:"dm-meta"},u(e.timestamp))),e.body?a.createElement("div",{className:"dm-body"},e.body):a.createElement("div",{className:"dm-body empty"},(0,s.t)("crm.noTextContent")||"(no text — media message)"),a.createElement("div",{className:"dm-footer"},a.createElement("span",null,a.createElement("span",{className:"dm-badge"},(e=>{const t=`crm.msgType_${e}`,n=(0,s.t)(t);return n===t?e:n})(e.type)),a.createElement("span",{style:{marginLeft:8}},(0,s.t)("crm.revokedAt")||"Deleted at",": ",u(e.revokedAt))),e.body&&a.createElement("button",{className:"dm-copy",onClick:()=>(async e=>{try{await navigator.clipboard.writeText(e.body||"")}catch{}})(e)},(0,s.t)("crm.copyMessage")||"Copy"))))))},dh=({isOpen:e,onClose:t,contactId:n,contactName:r,contactPhone:o,contactImage:i,initialTab:l})=>{const[c,d]=(0,a.useState)(l||"profile"),[m,p]=(0,a.useState)(null),[,u]=(0,a.useState)(0);(0,a.useEffect)(()=>{const e=()=>{u(e=>e+1)};return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{const e=e=>{e.detail?.contactId!==n&&e.detail?.contactId||g()};return document.addEventListener("wa-crm-contact-updated",e),document.addEventListener("wa-crm-data-synced",e),()=>{document.removeEventListener("wa-crm-contact-updated",e),document.removeEventListener("wa-crm-data-synced",e)}},[n]),(0,a.useEffect)(()=>{e&&l&&d(l)},[e,l]),(0,a.useEffect)(()=>{e&&n&&g()},[e,n]);const g=()=>{const e=v.getOrCreateContact(n,r,o);p(e)},h=()=>{g()};if(!e||!m)return null;const b=[{id:"profile",label:(0,s.t)("crm.profile"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}))},{id:"tabs",label:(0,s.t)("crm.tabs"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h10v4h8v10z"}))},{id:"notes",label:(0,s.t)("crm.notes"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2zm0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19v10z"}))},{id:"reminder",label:(0,s.t)("crm.reminder"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"}))},{id:"appointment",label:(0,s.t)("crm.appointment"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM9 10H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm-8 4H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2z"}))},{id:"income",label:(0,s.t)("crm.income"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z"}))},{id:"expense",label:(0,s.t)("crm.expense"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M15 16h3c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1h-3c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm1-6h1v4h-1v-4zm-7 6h3c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm1-6h1v4h-1v-4zM5 8h2v8H5zM2 4v16h20V4H2zm18 14H4V6h16v12z"}))},{id:"schedule",label:(0,s.t)("crm.scheduleTab"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"}))},{id:"deletedMessages",label:(0,s.t)("crm.deletedMessagesTab"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"20",height:"20"},a.createElement("path",{fill:"currentColor",d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}))}],f=e=>{e.stopPropagation()};return a.createElement(a.Fragment,null,a.createElement("div",{className:"crm-modal-backdrop",onClick:t,onMouseDown:f}),a.createElement("div",{className:"crm-modal",onClick:f,onMouseDown:f},a.createElement("div",{className:"crm-modal-sidebar"},a.createElement("div",{className:"crm-sidebar-header"},a.createElement("div",{className:"crm-modal-avatar"},i?a.createElement("img",{src:i,alt:r}):a.createElement("div",{className:"crm-avatar-placeholder"},r.charAt(0).toUpperCase())),a.createElement("div",{className:"crm-sidebar-contact-info"},a.createElement("h3",{className:"crm-sidebar-name"},m.profile.name||r),a.createElement("div",{className:"crm-sidebar-phone"},m.profile.phone||o,a.createElement("button",{className:"crm-copy-btn",onClick:()=>navigator.clipboard.writeText(m.profile.phone||o),title:"Copy phone number"},a.createElement("svg",{viewBox:"0 0 24 24",width:"12",height:"12"},a.createElement("path",{fill:"currentColor",d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})))))),a.createElement("div",{className:"crm-sidebar-tabs"},b.map(e=>a.createElement("button",{key:e.id,className:"crm-sidebar-tab "+(c===e.id?"active":""),onClick:()=>d(e.id)},a.createElement("span",{className:"crm-sidebar-tab-icon"},e.icon),a.createElement("span",{className:"crm-sidebar-tab-label"},e.label))))),a.createElement("div",{className:"crm-modal-main"},a.createElement("div",{className:"crm-modal-header"},a.createElement("h2",{className:"crm-modal-title"},b.find(e=>e.id===c)?.label),a.createElement("button",{className:"crm-modal-close-btn",onClick:t},a.createElement("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})))),a.createElement("div",{className:"crm-modal-content"},"profile"===c&&a.createElement(Ng,{contact:m,onUpdate:h}),"tabs"===c&&a.createElement(Og,{contact:m,onUpdate:h}),"notes"===c&&a.createElement(Hg,{contact:m,onUpdate:h}),"reminder"===c&&a.createElement(Vg,{contact:m,onUpdate:h}),"appointment"===c&&a.createElement(Kg,{contact:m,onUpdate:h}),"income"===c&&a.createElement(Jg,{contact:m,onUpdate:h}),"expense"===c&&a.createElement(Zg,{contact:m,onUpdate:h}),"schedule"===c&&a.createElement(rh,{contact:m,onUpdate:h}),"deletedMessages"===c&&a.createElement(ch,{contact:m,onUpdate:h})))),a.createElement("style",null,`\n        ${ma}\n\n        .crm-modal-backdrop {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.6);\n          z-index: 10000;\n          animation: crmFadeIn 0.2s ease;\n        }\n\n        .crm-modal {\n          position: fixed;\n          top: 50%;\n          left: 50%;\n          transform: translate(-50%, -50%);\n          background: var(--lion-bg-primary);\n          border-radius: var(--lion-radius-xl);\n          box-shadow: 0 25px 100px rgba(0, 0, 0, 0.4);\n          z-index: 10001;\n          width: 95%;\n          max-width: 950px;\n          height: 85vh;\n          max-height: 650px;\n          display: flex;\n          flex-direction: row;\n          animation: crmModalSlide 0.3s ease;\n          overflow: hidden;\n        }\n\n        @keyframes crmFadeIn {\n          from { opacity: 0; }\n          to { opacity: 1; }\n        }\n\n        @keyframes crmModalSlide {\n          from {\n            opacity: 0;\n            transform: translate(-50%, -48%);\n          }\n          to {\n            opacity: 1;\n            transform: translate(-50%, -50%);\n          }\n        }\n\n        /* Left Sidebar */\n        .crm-modal-sidebar {\n          width: 240px;\n          background: var(--lion-sidebar-gradient);\n          display: flex;\n          flex-direction: column;\n          flex-shrink: 0;\n        }\n\n        .crm-sidebar-header {\n          padding: 24px 20px;\n          border-bottom: 1px solid rgba(255,255,255,0.1);\n        }\n\n        .crm-modal-avatar {\n          width: 64px;\n          height: 64px;\n          border-radius: 50%;\n          overflow: hidden;\n          margin-bottom: 12px;\n          border: 3px solid rgba(255,255,255,0.2);\n        }\n\n        .crm-modal-avatar img {\n          width: 100%;\n          height: 100%;\n          object-fit: cover;\n        }\n\n        .crm-avatar-placeholder {\n          width: 100%;\n          height: 100%;\n          background: var(--lion-btn-primary-gradient);\n          color: white;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          font-size: 24px;\n          font-weight: 700;\n        }\n\n        .crm-sidebar-contact-info {\n          color: white;\n        }\n\n        .crm-sidebar-name {\n          margin: 0;\n          font-size: 16px;\n          font-weight: 600;\n          color: white;\n          line-height: 1.3;\n          word-break: break-word;\n        }\n\n        .crm-sidebar-phone {\n          font-size: 13px;\n          color: rgba(255,255,255,0.6);\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          margin-top: 4px;\n        }\n\n        .crm-copy-btn {\n          background: transparent;\n          border: none;\n          color: rgba(255,255,255,0.4);\n          cursor: pointer;\n          padding: 4px;\n          border-radius: 4px;\n          display: flex;\n          align-items: center;\n          transition: all 0.2s;\n        }\n\n        .crm-copy-btn:hover {\n          color: white;\n          background: rgba(255,255,255,0.1);\n        }\n\n        /* Sidebar Tabs */\n        .crm-sidebar-tabs {\n          flex: 1;\n          padding: 16px 12px;\n          display: flex;\n          flex-direction: column;\n          gap: 4px;\n          overflow-y: auto;\n          overflow-x: hidden;\n          min-height: 0;\n        }\n\n        /* Custom scrollbar for sidebar tabs */\n        .crm-sidebar-tabs::-webkit-scrollbar {\n          width: 4px;\n        }\n\n        .crm-sidebar-tabs::-webkit-scrollbar-track {\n          background: rgba(255, 255, 255, 0.05);\n          border-radius: 4px;\n        }\n\n        .crm-sidebar-tabs::-webkit-scrollbar-thumb {\n          background: rgba(255, 255, 255, 0.2);\n          border-radius: 4px;\n        }\n\n        .crm-sidebar-tabs::-webkit-scrollbar-thumb:hover {\n          background: rgba(255, 255, 255, 0.3);\n        }\n\n        .crm-sidebar-tab {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          padding: 14px 16px;\n          background: transparent;\n          border: none;\n          color: rgba(255,255,255,0.7);\n          font-size: 15px;\n          font-weight: 500;\n          cursor: pointer;\n          border-radius: 10px;\n          transition: all 0.2s;\n          text-align: left;\n        }\n\n        .crm-sidebar-tab:hover {\n          background: rgba(255,255,255,0.1);\n          color: white;\n        }\n\n        .crm-sidebar-tab.active {\n          background: var(--lion-primary);\n          color: white;\n          font-weight: 600;\n        }\n\n        .crm-sidebar-tab-icon {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          opacity: 0.8;\n        }\n\n        .crm-sidebar-tab.active .crm-sidebar-tab-icon {\n          opacity: 1;\n        }\n\n        /* Right Main Content */\n        .crm-modal-main {\n          flex: 1;\n          display: flex;\n          flex-direction: column;\n          background: var(--lion-bg-secondary);\n          min-width: 0;\n        }\n\n        .crm-modal-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 20px 28px;\n          background: var(--lion-bg-primary);\n          border-bottom: 1px solid var(--lion-border-light);\n          flex-shrink: 0;\n        }\n\n        .crm-modal-title {\n          margin: 0;\n          font-size: 22px;\n          font-weight: 700;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-modal-close-btn {\n          background: transparent;\n          border: none;\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          padding: 8px;\n          border-radius: 8px;\n          transition: all 0.2s;\n          display: flex;\n          align-items: center;\n        }\n\n        .crm-modal-close-btn:hover {\n          background: var(--lion-bg-tertiary);\n          color: var(--lion-text-primary);\n        }\n\n        /* Content */\n        .crm-modal-content {\n          flex: 1;\n          overflow-y: auto;\n          padding: 28px;\n        }\n\n        /* Common CRM styles */\n        .crm-section-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          margin-bottom: 20px;\n        }\n\n        .crm-section-title {\n          font-size: 17px;\n          font-weight: 600;\n          color: var(--lion-text-primary);\n          margin: 0;\n        }\n\n        .crm-section-actions {\n          display: flex;\n          gap: 8px;\n        }\n\n        .crm-btn {\n          display: inline-flex;\n          align-items: center;\n          gap: 8px;\n          padding: 12px 24px;\n          border-radius: 10px;\n          font-size: 15px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n          border: none;\n        }\n\n        .crm-btn-primary {\n          background: var(--lion-primary);\n          color: white;\n          box-shadow: var(--lion-btn-primary-shadow);\n        }\n\n        .crm-btn-primary:hover {\n          background: var(--lion-primary-hover);\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.4);\n          transform: translateY(-1px);\n        }\n\n        .crm-btn-secondary {\n          background: var(--lion-bg-primary);\n          color: var(--lion-text-secondary);\n          border: 2px solid var(--lion-border-light);\n        }\n\n        .crm-btn-secondary:hover {\n          background: var(--lion-bg-tertiary);\n          border-color: var(--lion-border-medium);\n        }\n\n        .crm-btn-link {\n          background: transparent;\n          color: var(--lion-primary);\n          padding: 4px 8px;\n        }\n\n        .crm-btn-link:hover {\n          background: var(--lion-primary-light);\n        }\n\n        .crm-btn-danger {\n          background: var(--lion-error-light);\n          color: var(--lion-error);\n        }\n\n        .crm-btn-danger:hover {\n          background: #fecaca;\n        }\n\n        /* Form Elements */\n        .crm-form-group {\n          margin-bottom: 24px;\n        }\n\n        .crm-form-group:last-child {\n          margin-bottom: 0;\n        }\n\n        .crm-form-label {\n          display: block;\n          font-size: 14px;\n          font-weight: 600;\n          color: var(--lion-text-secondary);\n          margin-bottom: 10px;\n        }\n\n        .crm-form-input,\n        .crm-form-textarea,\n        .crm-form-select {\n          width: 100%;\n          padding: 14px 16px;\n          border: 2px solid var(--lion-border-light);\n          border-radius: 10px;\n          font-size: 15px;\n          color: var(--lion-text-primary);\n          transition: all 0.2s;\n          box-sizing: border-box;\n          background: var(--lion-bg-primary);\n        }\n\n        .crm-form-input::placeholder,\n        .crm-form-textarea::placeholder {\n          color: var(--lion-text-light);\n        }\n\n        .crm-form-input:focus,\n        .crm-form-textarea:focus,\n        .crm-form-select:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 4px rgba(var(--lion-primary-rgb), 0.1);\n        }\n\n        .crm-form-textarea {\n          min-height: 120px;\n          resize: vertical;\n          line-height: 1.5;\n        }\n\n        /* Table */\n        .crm-table {\n          width: 100%;\n          border-collapse: collapse;\n        }\n\n        .crm-table-header {\n          display: flex;\n          background: var(--lion-bg-primary);\n          border-radius: 10px;\n          padding: 14px 16px;\n          margin-bottom: 8px;\n          border: 1px solid var(--lion-border-light);\n        }\n\n        .crm-table-header-cell {\n          font-size: 12px;\n          font-weight: 700;\n          color: var(--lion-text-muted);\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n        }\n\n        .crm-table-row {\n          display: flex;\n          align-items: center;\n          padding: 16px;\n          background: var(--lion-bg-primary);\n          border-radius: 10px;\n          margin-bottom: 8px;\n          border: 1px solid var(--lion-border-light);\n          transition: all 0.2s;\n        }\n\n        .crm-table-row:hover {\n          border-color: var(--lion-primary);\n          box-shadow: 0 2px 8px rgba(0,0,0,0.05);\n        }\n\n        .crm-table-cell {\n          font-size: 14px;\n          color: var(--lion-text-secondary);\n        }\n\n        /* Empty State */\n        .crm-empty-state {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          justify-content: center;\n          padding: 60px 20px;\n          color: var(--lion-text-light);\n          background: var(--lion-bg-primary);\n          border-radius: 12px;\n          border: 2px dashed var(--lion-border-light);\n        }\n\n        .crm-empty-state svg {\n          width: 64px;\n          height: 64px;\n          margin-bottom: 16px;\n          opacity: 0.4;\n        }\n\n        .crm-empty-state-text {\n          font-size: 15px;\n          color: var(--lion-text-muted);\n          font-weight: 500;\n        }\n\n        /* Search Box */\n        .crm-search-box {\n          position: relative;\n          margin-bottom: 0;\n        }\n\n        .crm-search-input {\n          width: 100%;\n          padding: 12px 16px 12px 44px;\n          border: 2px solid var(--lion-border-light);\n          border-radius: 10px;\n          font-size: 14px;\n          color: var(--lion-text-primary);\n          background: var(--lion-bg-primary);\n          box-sizing: border-box;\n        }\n\n        .crm-search-input:focus {\n          outline: none;\n          border-color: var(--lion-primary);\n        }\n\n        .crm-search-icon {\n          position: absolute;\n          left: 16px;\n          top: 50%;\n          transform: translateY(-50%);\n          color: var(--lion-text-light);\n        }\n\n        /* Sub-modal */\n        .crm-sub-modal-backdrop {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.6);\n          z-index: 10002;\n        }\n\n        .crm-sub-modal {\n          position: fixed;\n          top: 50%;\n          left: 50%;\n          transform: translate(-50%, -50%);\n          background: var(--lion-bg-primary);\n          border-radius: 16px;\n          box-shadow: 0 25px 100px rgba(0, 0, 0, 0.4);\n          z-index: 10003;\n          width: 90%;\n          max-width: 520px;\n          max-height: min(60vh, 450px);\n          display: flex;\n          flex-direction: column;\n          animation: crmModalSlide 0.2s ease;\n          overflow: hidden;\n        }\n\n        .crm-sub-modal-header {\n          padding: 16px 20px;\n          border-bottom: 1px solid var(--lion-border-light);\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          background: var(--lion-bg-secondary);\n          border-radius: 16px 16px 0 0;\n          flex-shrink: 0;\n        }\n\n        .crm-sub-modal-title {\n          margin: 0;\n          font-size: 20px;\n          font-weight: 700;\n          color: var(--lion-text-primary);\n        }\n\n        .crm-sub-modal-close {\n          background: transparent;\n          border: none;\n          color: var(--lion-text-muted);\n          cursor: pointer;\n          padding: 8px;\n          border-radius: 8px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.2s;\n        }\n\n        .crm-sub-modal-close:hover {\n          background: var(--lion-border-light);\n          color: var(--lion-text-primary);\n        }\n\n        .crm-sub-modal-body {\n          padding: 20px;\n          overflow-y: auto;\n          flex: 1;\n          min-height: 0;\n        }\n\n        .crm-sub-modal-footer {\n          padding: 14px 20px;\n          border-top: 1px solid var(--lion-border-light);\n          display: flex;\n          justify-content: flex-end;\n          gap: 16px;\n          background: var(--lion-bg-secondary);\n          border-radius: 0 0 16px 16px;\n          flex-shrink: 0;\n        }\n\n        /* Rich Text Editor Toolbar */\n        .crm-editor-toolbar {\n          display: flex;\n          flex-wrap: wrap;\n          gap: 4px;\n          padding: 12px;\n          border: 2px solid var(--lion-border-light);\n          border-bottom: none;\n          border-radius: 10px 10px 0 0;\n          background: var(--lion-bg-secondary);\n        }\n\n        .crm-editor-btn {\n          background: transparent;\n          border: none;\n          padding: 8px 10px;\n          border-radius: 6px;\n          cursor: pointer;\n          color: var(--lion-text-muted);\n          transition: all 0.2s;\n        }\n\n        .crm-editor-btn:hover {\n          background: var(--lion-border-light);\n          color: var(--lion-text-primary);\n        }\n\n        .crm-editor-btn.active {\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        .crm-editor-content {\n          min-height: 150px;\n          padding: 16px;\n          border: 2px solid var(--lion-border-light);\n          border-top: none;\n          border-radius: 0 0 10px 10px;\n          outline: none;\n          font-size: 15px;\n          line-height: 1.6;\n        }\n\n        .crm-editor-content:focus {\n          border-color: var(--lion-primary);\n        }\n\n        /* Status Badge */\n        .crm-status-badge {\n          display: inline-flex;\n          align-items: center;\n          padding: 6px 12px;\n          border-radius: 20px;\n          font-size: 13px;\n          font-weight: 600;\n        }\n\n        .crm-status-pending {\n          background: #dbeafe;\n          color: #6D28D9;\n        }\n\n        .crm-status-completed {\n          background: #d1fae5;\n          color: #059669;\n        }\n\n        .crm-status-dismissed {\n          background: #f3f4f6;\n          color: #6b7280;\n        }\n\n        \n        /* ============================================================ */\n        /* ============== CRM V3 OVERRIDES (LIGHT) ==================== */\n        /* Mirrors BroadcastV2V3Overrides.ts for CRM Modal + tabs       */\n        /* Note: .crm-modal-backdrop and .crm-modal are SIBLINGS,       */\n        /* not parent-child, so scope selectors off .crm-modal itself.  */\n        /* ============================================================ */\n\n        /* === MODAL BACKDROP (blur + dim) === */\n        .crm-modal-backdrop {\n          background: rgba(0, 0, 0, 0.55) !important;\n          backdrop-filter: blur(6px) !important;\n          -webkit-backdrop-filter: blur(6px) !important;\n        }\n\n        /* === MODAL CONTAINER === */\n        .crm-modal {\n          border-radius: 16px !important;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0,0,0,0.05) !important;\n          overflow: hidden !important;\n          border: 1px solid #e5e7eb !important;\n        }\n\n        /* === MAIN CONTENT HEADER === */\n        .crm-modal .crm-modal-header {\n          background: #ffffff !important;\n          background-image: none !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n          color: #1f2937 !important;\n          padding: 20px 28px !important;\n          box-shadow: none !important;\n        }\n\n        .crm-modal .crm-modal-header .crm-modal-title,\n        .crm-modal .crm-modal-header h2 {\n          color: #1f2937 !important;\n          font-size: 19px !important;\n          font-weight: 700 !important;\n        }\n\n        .crm-modal .crm-modal-close-btn {\n          background: #f4f4f5 !important;\n          border: 1px solid #e5e7eb !important;\n          color: #52525b !important;\n          border-radius: 10px !important;\n          width: 36px !important;\n          height: 36px !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .crm-modal .crm-modal-close-btn:hover {\n          background: rgba(239, 68, 68, 0.1) !important;\n          color: #ef4444 !important;\n          border-color: rgba(239, 68, 68, 0.3) !important;\n        }\n\n        /* === MAIN CONTENT AREA === */\n        .crm-modal .crm-modal-content {\n          background: #fafafa !important;\n        }\n\n        /* === CARDS (generic container blocks inside tabs) === */\n        .crm-modal .crm-card,\n        .crm-modal .crm-info-card,\n        .crm-modal .crm-section-card {\n          background: #ffffff !important;\n          border: 1px solid #f0f0f0 !important;\n          border-radius: 14px !important;\n          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;\n        }\n\n        /* === BUTTONS — primary (gradient) === */\n        .crm-modal .crm-btn-primary,\n        .crm-modal .crm-save-btn,\n        .crm-modal .crm-add-btn {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          border: none !important;\n          border-radius: 10px !important;\n          padding: 10px 18px !important;\n          font-weight: 600 !important;\n          font-size: 13px !important;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25) !important;\n          transition: all 0.15s ease !important;\n          cursor: pointer !important;\n        }\n\n        .crm-modal .crm-btn-primary:hover,\n        .crm-modal .crm-save-btn:hover,\n        .crm-modal .crm-add-btn:hover {\n          transform: translateY(-1px) !important;\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35) !important;\n        }\n\n        /* === BUTTONS — secondary === */\n        .crm-modal .crm-btn-secondary,\n        .crm-modal .crm-cancel-btn {\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          color: #374151 !important;\n          border-radius: 10px !important;\n          padding: 10px 16px !important;\n          font-weight: 600 !important;\n          font-size: 13px !important;\n          box-shadow: none !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .crm-modal .crm-btn-secondary:hover,\n        .crm-modal .crm-cancel-btn:hover {\n          background: var(--lion-primary-light, #eff6ff) !important;\n          border-color: var(--lion-primary) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        /* === BUTTONS — danger === */\n        .crm-modal .crm-btn-danger,\n        .crm-modal .crm-delete-btn {\n          background: rgba(239, 68, 68, 0.08) !important;\n          color: #ef4444 !important;\n          border: 1px solid rgba(239, 68, 68, 0.2) !important;\n          border-radius: 10px !important;\n          font-weight: 600 !important;\n          padding: 10px 14px !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .crm-modal .crm-btn-danger:hover,\n        .crm-modal .crm-delete-btn:hover {\n          background: rgba(239, 68, 68, 0.15) !important;\n          border-color: rgba(239, 68, 68, 0.35) !important;\n        }\n\n        /* === INPUTS / TEXTAREAS / SELECTS === */\n        .crm-modal input[type="text"],\n        .crm-modal input[type="number"],\n        .crm-modal input[type="tel"],\n        .crm-modal input[type="email"],\n        .crm-modal input[type="date"],\n        .crm-modal input[type="time"],\n        .crm-modal input[type="datetime-local"],\n        .crm-modal input[type="search"],\n        .crm-modal textarea,\n        .crm-modal select {\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          border-radius: 10px !important;\n          padding: 10px 14px !important;\n          color: #1f2937 !important;\n          font-size: 13px !important;\n          transition: all 0.15s ease !important;\n          box-shadow: none !important;\n        }\n\n        .crm-modal input:focus,\n        .crm-modal textarea:focus,\n        .crm-modal select:focus {\n          outline: none !important;\n          border-color: var(--lion-primary) !important;\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12) !important;\n        }\n\n        .crm-modal input::placeholder,\n        .crm-modal textarea::placeholder {\n          color: #9ca3af !important;\n        }\n\n        /* === FORM LABELS ONLY (not sidebar tab labels) === */\n        .crm-modal .crm-form-label,\n        .crm-modal .crm-field-label {\n          text-transform: uppercase !important;\n          letter-spacing: 0.5px !important;\n          font-size: 11px !important;\n          font-weight: 700 !important;\n          color: #6b7280 !important;\n          margin-bottom: 6px !important;\n          display: block !important;\n        }\n\n        /* === BADGES === */\n        .crm-modal .crm-badge,\n        .crm-modal .crm-count-badge {\n          background: rgba(var(--lion-primary-rgb), 0.1) !important;\n          color: var(--lion-primary) !important;\n          font-weight: 700 !important;\n          border-radius: 999px !important;\n          padding: 3px 12px !important;\n          font-size: 11px !important;\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.2) !important;\n        }\n\n        /* === NESTED MODALS (add/edit forms within tabs) === */\n        .crm-modal .crm-inner-modal,\n        .crm-modal .crm-add-modal,\n        .crm-modal .crm-edit-modal {\n          background: #ffffff !important;\n          border: 1px solid #f0f0f0 !important;\n          border-radius: 16px !important;\n          box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2) !important;\n        }\n\n        .crm-modal .crm-inner-overlay,\n        .crm-modal .crm-add-overlay,\n        .crm-modal .crm-edit-overlay {\n          background: rgba(0, 0, 0, 0.55) !important;\n          backdrop-filter: blur(4px) !important;\n          -webkit-backdrop-filter: blur(4px) !important;\n        }\n\n        /* === DROPDOWNS === */\n        .crm-modal .crm-dropdown,\n        .crm-modal .crm-select-menu {\n          background: #ffffff !important;\n          border: 1px solid #e5e7eb !important;\n          border-radius: 12px !important;\n          box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0,0,0,0.06) !important;\n          padding: 6px !important;\n        }\n\n        .crm-modal .crm-dropdown-item {\n          padding: 10px 14px !important;\n          border-radius: 8px !important;\n          color: #374151 !important;\n          font-size: 13px !important;\n          cursor: pointer !important;\n          transition: background 0.1s ease !important;\n        }\n\n        .crm-modal .crm-dropdown-item:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          color: var(--lion-primary) !important;\n        }\n\n        /* === DIVIDERS === */\n        .crm-modal hr,\n        .crm-modal .crm-divider {\n          border: none !important;\n          border-top: 1px solid #f0f0f0 !important;\n          margin: 16px 0 !important;\n        }\n\n        /* ============================================================ */\n        /* === SIDEBAR V3 (light) — mirrors BroadcastModal sidebar ==== */\n        /* ============================================================ */\n\n        .crm-modal .crm-modal-sidebar {\n          background: #fafafa !important;\n          border-right: 1px solid #f0f0f0 !important;\n          border-radius: 16px 0 0 16px !important;\n        }\n\n        .crm-modal .crm-sidebar-header {\n          background: #ffffff !important;\n          border-bottom: 1px solid #f0f0f0 !important;\n          color: #1f2937 !important;\n        }\n\n        .crm-modal .crm-sidebar-contact-info {\n          color: #1f2937 !important;\n        }\n\n        .crm-modal .crm-sidebar-name {\n          color: #1f2937 !important;\n        }\n\n        .crm-modal .crm-sidebar-phone {\n          color: #6b7280 !important;\n        }\n\n        .crm-modal .crm-copy-btn {\n          color: #9ca3af !important;\n          background: transparent !important;\n        }\n\n        .crm-modal .crm-copy-btn:hover {\n          color: var(--lion-primary) !important;\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n        }\n\n        .crm-modal .crm-sidebar-tabs {\n          padding: 16px 10px !important;\n        }\n\n        .crm-modal .crm-sidebar-tab {\n          color: #52525b !important;\n          font-weight: 600 !important;\n          border-radius: 10px !important;\n          padding: 11px 14px !important;\n          font-size: 13px !important;\n          background: transparent !important;\n          border: 1px solid transparent !important;\n          transition: all 0.15s ease !important;\n        }\n\n        .crm-modal .crm-sidebar-tab:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08) !important;\n          color: var(--lion-primary) !important;\n          border-color: rgba(var(--lion-primary-rgb), 0.15) !important;\n        }\n\n        .crm-modal .crm-sidebar-tab.active {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.28) !important;\n          border-color: transparent !important;\n        }\n\n        .crm-modal .crm-sidebar-tab.active svg,\n        .crm-modal .crm-sidebar-tab.active .crm-sidebar-tab-icon svg {\n          color: #ffffff !important;\n          fill: #ffffff !important;\n        }\n\n        /* ============================================================ */\n        /* ============== CRM V3 OVERRIDES (DARK MODE) ================ */\n        /* ============================================================ */\n\n        .lion-dark .crm-modal,\n        .crm-modal.lion-dark {\n          border-color: #2a2a2a !important;\n        }\n\n        .lion-dark .crm-modal .crm-modal-header,\n        .crm-modal.lion-dark .crm-modal-header {\n          background: #1a1a1a !important;\n          border-bottom-color: #2a2a2a !important;\n          color: #ffffff !important;\n        }\n\n        .lion-dark .crm-modal .crm-modal-header .crm-modal-title,\n        .lion-dark .crm-modal .crm-modal-header h2,\n        .crm-modal.lion-dark .crm-modal-header .crm-modal-title,\n        .crm-modal.lion-dark .crm-modal-header h2 {\n          color: #ffffff !important;\n        }\n\n        .lion-dark .crm-modal .crm-modal-content,\n        .crm-modal.lion-dark .crm-modal-content {\n          background: #0f0f0f !important;\n        }\n\n        .lion-dark .crm-modal .crm-card,\n        .lion-dark .crm-modal .crm-info-card,\n        .lion-dark .crm-modal .crm-section-card,\n        .crm-modal.lion-dark .crm-card,\n        .crm-modal.lion-dark .crm-info-card,\n        .crm-modal.lion-dark .crm-section-card {\n          background: #1f1f1f !important;\n          border-color: #2a2a2a !important;\n        }\n\n        .lion-dark .crm-modal input[type="text"],\n        .lion-dark .crm-modal input[type="number"],\n        .lion-dark .crm-modal input[type="tel"],\n        .lion-dark .crm-modal input[type="email"],\n        .lion-dark .crm-modal input[type="date"],\n        .lion-dark .crm-modal input[type="time"],\n        .lion-dark .crm-modal textarea,\n        .lion-dark .crm-modal select,\n        .crm-modal.lion-dark input[type="text"],\n        .crm-modal.lion-dark input[type="number"],\n        .crm-modal.lion-dark input[type="tel"],\n        .crm-modal.lion-dark input[type="email"],\n        .crm-modal.lion-dark input[type="date"],\n        .crm-modal.lion-dark input[type="time"],\n        .crm-modal.lion-dark textarea,\n        .crm-modal.lion-dark select {\n          background: #262626 !important;\n          border-color: #2a2a2a !important;\n          color: #ffffff !important;\n        }\n\n        .lion-dark .crm-modal input::placeholder,\n        .lion-dark .crm-modal textarea::placeholder,\n        .crm-modal.lion-dark input::placeholder,\n        .crm-modal.lion-dark textarea::placeholder {\n          color: #6b7280 !important;\n        }\n\n        .lion-dark .crm-modal .crm-form-label,\n        .lion-dark .crm-modal .crm-field-label,\n        .crm-modal.lion-dark .crm-form-label,\n        .crm-modal.lion-dark .crm-field-label {\n          color: #a0a0a0 !important;\n        }\n\n        .lion-dark .crm-modal .crm-btn-secondary,\n        .lion-dark .crm-modal .crm-cancel-btn,\n        .crm-modal.lion-dark .crm-btn-secondary,\n        .crm-modal.lion-dark .crm-cancel-btn {\n          background: #262626 !important;\n          border-color: #2a2a2a !important;\n          color: #ffffff !important;\n        }\n\n        .lion-dark .crm-modal .crm-modal-close-btn,\n        .crm-modal.lion-dark .crm-modal-close-btn {\n          background: #262626 !important;\n          border-color: #2a2a2a !important;\n          color: #a0a0a0 !important;\n        }\n\n        .lion-dark .crm-modal hr,\n        .lion-dark .crm-modal .crm-divider,\n        .crm-modal.lion-dark hr,\n        .crm-modal.lion-dark .crm-divider {\n          border-top-color: #2a2a2a !important;\n        }\n\n        /* === SIDEBAR (dark) === */\n        .lion-dark .crm-modal .crm-modal-sidebar,\n        .crm-modal.lion-dark .crm-modal-sidebar {\n          background: #18181b !important;\n          border-right-color: #27272a !important;\n        }\n\n        .lion-dark .crm-modal .crm-sidebar-header,\n        .crm-modal.lion-dark .crm-sidebar-header {\n          background: #1a1a1a !important;\n          border-bottom-color: #27272a !important;\n          color: #fafafa !important;\n        }\n\n        .lion-dark .crm-modal .crm-sidebar-contact-info,\n        .lion-dark .crm-modal .crm-sidebar-name,\n        .crm-modal.lion-dark .crm-sidebar-contact-info,\n        .crm-modal.lion-dark .crm-sidebar-name {\n          color: #fafafa !important;\n        }\n\n        .lion-dark .crm-modal .crm-sidebar-phone,\n        .crm-modal.lion-dark .crm-sidebar-phone {\n          color: #a1a1aa !important;\n        }\n\n        .lion-dark .crm-modal .crm-copy-btn,\n        .crm-modal.lion-dark .crm-copy-btn {\n          color: #71717a !important;\n        }\n\n        .lion-dark .crm-modal .crm-sidebar-tab,\n        .crm-modal.lion-dark .crm-sidebar-tab {\n          color: #a1a1aa !important;\n          background: transparent !important;\n        }\n\n        .lion-dark .crm-modal .crm-sidebar-tab:hover,\n        .crm-modal.lion-dark .crm-sidebar-tab:hover {\n          background: rgba(var(--lion-primary-rgb), 0.12) !important;\n          color: var(--lion-primary) !important;\n          border-color: rgba(var(--lion-primary-rgb), 0.25) !important;\n        }\n\n        .lion-dark .crm-modal .crm-sidebar-tab.active,\n        .crm-modal.lion-dark .crm-sidebar-tab.active {\n          background: var(--lion-primary) !important;\n          color: #ffffff !important;\n        }\n\n      `))},mh=({contactId:e,contactName:t,contactPhone:n,contactImage:r})=>{const[o,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(null),[,m]=(0,a.useState)(0),[p,u]=(0,a.useState)(()=>document.documentElement.classList.contains("lion-dark"));(0,a.useEffect)(()=>{const e=()=>{m(e=>e+1)};return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{const e=()=>u(document.documentElement.classList.contains("lion-dark"));return window.addEventListener("lionThemeApplied",e),window.addEventListener("themeChanged",e),()=>{window.removeEventListener("lionThemeApplied",e),window.removeEventListener("themeChanged",e)}},[]),(0,a.useEffect)(()=>{let e=document.getElementById("wa-crm-modal-root");return e||(e=document.createElement("div"),e.id="wa-crm-modal-root",document.body.appendChild(e)),d(e),()=>{}},[]),(0,a.useEffect)(()=>{const t=t=>{const{chatId:n}=t.detail;n===e&&(window.__CRM_MODAL_OPEN__=!0,l(!0))};return document.addEventListener("openCRMFromKanban",t),()=>{document.removeEventListener("openCRMFromKanban",t)}},[e]);const g=e=>{e.stopPropagation(),e.preventDefault(),e.nativeEvent.stopImmediatePropagation()};return a.createElement(a.Fragment,null,a.createElement("button",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"6px 12px",background:p?"#262626":"#ffffff",border:"1px solid "+(p?"#3a3a3a":"#e5e7eb"),borderRadius:"10px",fontSize:"11px",fontWeight:700,color:p?"#e5e7eb":"#52525b",cursor:"pointer",fontFamily:"inherit",whiteSpace:"nowrap",verticalAlign:"middle",lineHeight:"20px",marginLeft:"4px",letterSpacing:"0.3px",transition:"all 0.15s"},onClick:e=>{g(e),window.__CRM_MODAL_OPEN__=!0,l(!0)},onMouseDown:g,onMouseUp:g,onTouchStart:g,onTouchEnd:g,onMouseEnter:e=>{e.currentTarget.style.background="rgba(var(--lion-primary-rgb), 0.12)",e.currentTarget.style.borderColor="var(--lion-primary)",e.currentTarget.style.color="var(--lion-primary)"},onMouseLeave:e=>{e.currentTarget.style.background=p?"#262626":"#ffffff",e.currentTarget.style.borderColor=p?"#3a3a3a":"#e5e7eb",e.currentTarget.style.color=p?"#e5e7eb":"#52525b"},title:(0,s.t)("crm.openCRM")},(0,s.t)("crm.button")),o&&c&&i.createPortal(a.createElement(dh,{isOpen:o,onClose:()=>{l(!1),setTimeout(()=>{window.__CRM_MODAL_OPEN__=!1},100)},contactId:e,contactName:t,contactPhone:n,contactImage:r}),c))};function ph(e={}){const{chatId:t,autoRefresh:n=!0}=e,[r,o]=(0,a.useState)([]),[i,s]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,m]=(0,a.useState)(null),p=(0,a.useRef)(new Set),u=(0,a.useCallback)(()=>{window.postMessage({type:"LABEL_SERVICE_GET_ALL"},"*")},[]),g=(0,a.useCallback)(e=>{window.postMessage({type:"LABEL_SERVICE_GET_CHAT_LABELS",chatId:e},"*")},[]),h=(0,a.useCallback)((e,n)=>{e===t&&s(e=>e.includes(n)?e:[...e,n]);const a=`add:${e}:${n}`;p.current.add(a),window.postMessage({type:"LABEL_SERVICE_ADD",chatId:e,labelId:n},"*")},[t]),b=(0,a.useCallback)((e,n)=>{e===t&&s(e=>e.filter(e=>e!==n));const a=`remove:${e}:${n}`;p.current.add(a),window.postMessage({type:"LABEL_SERVICE_REMOVE",chatId:e,labelId:n},"*")},[t]),f=(0,a.useCallback)((e,t)=>{i.includes(t)?b(e,t):h(e,t)},[i,h,b]),v=(0,a.useCallback)(()=>{c(!0),window.postMessage({type:"LABEL_SERVICE_REFRESH"},"*")},[]),y=(0,a.useCallback)(e=>{g(e)},[g]);(0,a.useEffect)(()=>{const e=e=>{if(e.source!==window)return;const n=e.data;if(n){if("LABEL_SERVICE_RESPONSE"===n.type){const{action:e,labels:a,labelIds:r,success:i}=n;if("getAll"!==e&&"refresh"!==e||(a&&o(a),c(!1),m(null)),"getChatLabels"===e&&n.chatId===t&&r&&s(r),"add"===e||"remove"===e){const a=`${e}:${n.chatId}:${n.labelId}`;p.current.delete(a),i||m(n.error||`Failed to ${e} label`),n.chatId===t&&t&&g(t)}}"LABEL_SERVICE_UPDATE"===n.type&&(n.labels&&o(n.labels),n.chatId!==t||!t||"add"!==n.action&&"remove"!==n.action||g(t))}};return window.addEventListener("message",e),n&&(u(),t&&g(t)),()=>window.removeEventListener("message",e)},[t,n,u,g]);const x=r.filter(e=>i.includes(e.id));return{allLabels:r,chatLabels:i,chatLabelObjects:x,loading:l,error:d,addLabel:h,removeLabel:b,toggleLabel:f,refresh:v,refreshChatLabels:y}}const uh=async(e,t,n)=>{try{chrome.runtime.sendMessage({type:"UPDATE_KANBAN_CHAT_LABEL",chatId:e,labelId:t,action:n})}catch(e){}},gh=async(e,t,n,a,r,o)=>{try{const i=Ig("labels");if(!i)return;const s=Pg(i,Lg),l={label:{id:a.labelId,name:a.labelName,color:a.labelColor}};s.forEach(i=>{if(i.enabled)switch(i.id){case"event_details":l.event={type:"labels",action:e,timestamp:Date.now()};break;case"number":l.number=t.split("@")[0];break;case"name":l.name=n;break;case"label_id":l.labelId=a.labelId;break;case"label_name":l.labelName=a.labelName;break;case"label_color":l.labelColor=a.labelColor;break;case"all_labels":const i=r.filter(e=>o.includes(e.id));l.allLabels=i.map(e=>({id:e.id,name:e.name,color:e.color}));break;case"contact_profile":const s=v.getContact(t);l.contactProfile=Bg(s,n,t.split("@")[0])}}),Rg(i.url,l,"labels")}catch(e){}},hh=async(e,t,n,a)=>{try{const r=Ig("custom_tabs");if(!r)return;const o=Pg(r,Ug),i={tab:{id:a.tabId,name:a.tabName,color:a.tabColor||null}},s=d.TabsStorage.getTabs();o.forEach(r=>{if(r.enabled)switch(r.id){case"event_details":i.event={type:"custom_tabs",action:e,timestamp:Date.now()};break;case"number":i.number=t.split("@")[0];break;case"name":i.name=n;break;case"tab_id":i.tabId=a.tabId;break;case"tab_name":i.tabName=a.tabName;break;case"tab_color":i.tabColor=a.tabColor||null;break;case"all_tabs":const r=s.filter(e=>e.chats?.some(e=>e.id===t));i.allTabs=r.map(e=>({id:e.id,name:e.title,color:e.labelColor||null}));break;case"contact_profile":const o=v.getContact(t);i.contactProfile=Bg(o,n,t.split("@")[0])}}),Rg(r.url,i,"custom_tabs")}catch(e){}},bh=async(e,t,n,a)=>{try{const r=localStorage.getItem("webhook_settings");if(!r)return;const o=JSON.parse(r).kanban;if(!o||!o.active||!o.url)return;const i={};(o.dataFields||Fg).forEach(r=>{if(r.enabled)switch(r.id){case"event_details":i.event={type:"kanban",action:e,timestamp:Date.now()};break;case"number":i.number=t.split("@")[0];break;case"name":i.name=n;break;case"stage_info":i.stage={crmId:a.crmId,crmName:a.crmName,fromStageId:a.fromStageId||null,fromStageName:a.fromStageName||null,toStageId:a.toStageId||null,toStageName:a.toStageName||null};break;case"contact_profile":const r=v.getContact(t);i.contactProfile=Bg(r,n,t.split("@")[0])}}),Rg(o.url,i,"kanban")}catch(e){}},fh=({contactId:e,contactName:t,contactImage:r})=>{const[o,i]=(0,a.useState)(!1),l=(0,a.useRef)(null),[c,m]=(0,a.useState)(new Set(["labels"])),[p,u]=(0,a.useState)([]),[g,h]=(0,a.useState)([]),[b,f]=(0,a.useState)([]),[y,x]=(0,a.useState)(()=>document.documentElement.classList.contains("lion-dark"));(0,a.useEffect)(()=>{const e=()=>x(document.documentElement.classList.contains("lion-dark"));return window.addEventListener("lionThemeApplied",e),window.addEventListener("themeChanged",e),()=>{window.removeEventListener("lionThemeApplied",e),window.removeEventListener("themeChanged",e)}},[]),Mg();const{allLabels:w,chatLabels:k,loading:E,addLabel:S,removeLabel:C,refresh:T,refreshChatLabels:A}=ph({chatId:e,autoRefresh:!0}),D=(0,a.useCallback)(async()=>{try{try{const e=(await n().storage.local.get("wa_extension_tabs")).wa_extension_tabs;if(e?.tabs){const t=e.tabs.filter(e=>!e.isPermanent&&!e.isSystemFilter&&!["all","one-to-one","groups","unread","unsaved"].includes(e.id));u(t)}}catch(e){const t=d.TabsStorage.getTabs();u(t.filter(e=>!e.isPermanent&&!e.isSystemFilter))}const t=(await n().storage.local.get("wa_kanban_crm_data_sync")).wa_kanban_crm_data_sync||{crms:[],stages:{},assignments:[]},a=(t.crms||[]).filter(e=>"user"===e.type).map(e=>({...e,stages:(t.stages?.[e.id]||[]).filter(e=>!e.isSystemGenerated&&"INBOX"!==e.name).sort((e,t)=>e.position-t.position)})).filter(e=>e.stages.length>0);h(a),f((t.assignments||[]).filter(t=>t.chatId===e)),L(!0)}catch(e){L(!0)}},[e]);(0,a.useEffect)(()=>{o&&(T(),A(e),D())},[o,e,T,A,D]),(0,a.useEffect)(()=>{const e=(e,t)=>{"local"===t&&(e.wa_kanban_crm_data_sync||e.wa_extension_tabs)&&o&&D()};return n().storage.onChanged.addListener(e),()=>n().storage.onChanged.removeListener(e)},[o,D]),(0,a.useEffect)(()=>{const e=e=>{l.current&&!l.current.contains(e.target)&&i(!1)};return o&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[o]);const _=e=>k.includes(e),N=t=>{const n=p.find(e=>e.id===t);return n?.chats?.some(t=>t.id===e)||!1},M=(n,a)=>{const r=(o=n.id,b.find(e=>e.crmId===o));var o;if(r?.stageId===a.id)chrome.runtime.sendMessage({type:"KANBAN_REMOVE_FROM_CRM",chatId:e,crmId:n.id}),bh("card_removed",e,t,{crmId:n.id,crmName:n.name,fromStageId:a.id,fromStageName:a.name}),f(e=>e.filter(e=>!(e.crmId===n.id)));else{chrome.runtime.sendMessage({type:"KANBAN_MOVE_TO_STAGE",chatId:e,stageId:a.id,crmId:n.id});const o=r?n.stages.find(e=>e.id===r.stageId):null;bh("card_moved",e,t,{crmId:n.id,crmName:n.name,fromStageId:o?.id,fromStageName:o?.name,toStageId:a.id,toStageName:a.name}),f(t=>[...t.filter(e=>e.crmId!==n.id),{chatId:e,stageId:a.id,crmId:n.id,assignedAt:Date.now()}])}},I=e=>{e.stopPropagation(),e.preventDefault(),e.nativeEvent.stopImmediatePropagation()},R=()=>a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),a.createElement("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"})),B=({expanded:e})=>a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",flexShrink:0}},a.createElement("path",{d:"M7 10l5 5 5-5z"})),[P,L]=(p.length>0||g.length,(0,a.useState)(!1)),U=e=>a.createElement("div",{style:{width:"18px",height:"18px",borderRadius:"4px",border:e?"2px solid var(--lion-primary)":"2px solid #d1d5db",background:e?ca.primary:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 0.15s"}},e&&a.createElement("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polyline",{points:"20 6 9 17 4 12"}))),F=e=>a.createElement("div",{style:{width:"12px",height:"12px",borderRadius:"50%",background:e||ca.primary,flexShrink:0}}),z=(e,t,n)=>{const r=c.has(e);return a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",cursor:"pointer",borderBottom:"1px solid var(--lion-sidebar-border)",background:r?"rgba(var(--lion-primary-rgb), 0.05)":"transparent",transition:"background 0.15s"},onClick:()=>(e=>{m(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})})(e),onMouseEnter:e=>{e.currentTarget.style.background="rgba(var(--lion-primary-rgb), 0.08)"},onMouseLeave:e=>{e.currentTarget.style.background=r?"rgba(var(--lion-primary-rgb), 0.05)":"transparent"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},n,a.createElement("span",{style:{fontSize:"11px",fontWeight:600,color:ca.primary,textTransform:"uppercase",letterSpacing:"0.5px"}},t)),a.createElement(B,{expanded:r}))};return a.createElement("div",{ref:l,style:{position:"relative",display:"inline-flex"}},a.createElement("button",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",padding:"6px 10px",background:y?"#262626":"#ffffff",border:"1px solid "+(y?"#3a3a3a":"#e5e7eb"),borderRadius:"10px",fontSize:"11px",fontWeight:600,color:y?"#e5e7eb":"#52525b",cursor:"pointer",fontFamily:"inherit",whiteSpace:"nowrap",verticalAlign:"middle",lineHeight:"20px",marginLeft:"4px",transition:"all 0.15s"},onClick:e=>{I(e),i(!o)},onMouseDown:I,onMouseUp:I,onTouchStart:I,onTouchEnd:I,onMouseEnter:e=>{e.currentTarget.style.background="rgba(var(--lion-primary-rgb), 0.12)",e.currentTarget.style.borderColor="var(--lion-primary)",e.currentTarget.style.color="var(--lion-primary)"},onMouseLeave:e=>{e.currentTarget.style.background=y?"#262626":"#ffffff",e.currentTarget.style.borderColor=y?"#3a3a3a":"#e5e7eb",e.currentTarget.style.color=y?"#e5e7eb":"#52525b"},title:(0,s.t)("crm.addToLabel")},a.createElement(R,null)),o&&a.createElement("div",{style:{position:"absolute",top:"calc(100% + 75px)",left:"-45px",background:y?"#1f1f1f":"#ffffff",border:"1px solid "+(y?"#3a3a3a":"#e5e7eb"),borderRadius:"12px",boxShadow:y?"0 12px 30px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.3)":"0 12px 30px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.06)",minWidth:"240px",maxHeight:"400px",overflowY:"auto",zIndex:1e4},onClick:I},a.createElement("div",{style:{padding:"12px 14px",borderBottom:"1px solid "+(y?"#2a2a2a":"#f0f0f0"),borderRadius:"12px 12px 0 0",fontSize:"13px",fontWeight:700,color:"var(--lion-primary)",display:"flex",alignItems:"center",gap:"8px",background:y?"#1f1f1f":"#ffffff"}},a.createElement(R,null),(0,s.t)("crm.labelsAndStages")),z("labels",(0,s.t)("crm.whatsappLabels")),c.has("labels")&&a.createElement(a.Fragment,null,E?a.createElement("div",{style:{padding:"14px 12px",fontSize:"11px",color:ca.textMuted,textAlign:"center"}},"Loading..."):0===w.length?a.createElement("div",{style:{padding:"14px 12px",fontSize:"11px",color:ca.textMuted,textAlign:"center"}},(0,s.t)("crm.noLabelsAvailable")):w.map(n=>{const r=_(n.id);return a.createElement("div",{key:n.id,style:{display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",cursor:"pointer",transition:"background 0.1s",borderBottom:"1px solid var(--lion-sidebar-border)",background:r?"rgba(var(--lion-primary-rgb), 0.08)":"transparent"},onClick:()=>(n=>{const a=_(n),r=w.find(e=>e.id===n);if(a){C(e,n);const a=k.filter(e=>e!==n);uh(e,n,"remove"),r&&gh("label_removed",e,t,{labelId:r.id,labelName:r.name,labelColor:r.color},w,a)}else{S(e,n);const a=[...k,n];uh(e,n,"add"),r&&gh("label_added",e,t,{labelId:r.id,labelName:r.name,labelColor:r.color},w,a)}})(n.id),onMouseEnter:e=>{e.currentTarget.style.background=r?"rgba(var(--lion-primary-rgb), 0.15)":"rgba(var(--lion-primary-rgb), 0.06)"},onMouseLeave:e=>{e.currentTarget.style.background=r?"rgba(var(--lion-primary-rgb), 0.08)":"transparent"}},U(r),F(n.color),a.createElement("span",{style:{fontSize:"13px",color:r?"var(--lion-primary)":y?"#e5e7eb":"#1f2937",fontWeight:r?500:400,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n.name))})),p.length>0&&a.createElement(a.Fragment,null,z("customTabs",(0,s.t)("crm.customTabs")),c.has("customTabs")&&p.map(n=>{const r=N(n.id);return a.createElement("div",{key:n.id,style:{display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",cursor:"pointer",transition:"background 0.1s",borderBottom:"1px solid var(--lion-sidebar-border)",background:r?"rgba(var(--lion-primary-rgb), 0.08)":"transparent"},onClick:()=>(n=>{if(N(n.id)){const a=(n.chats||[]).filter(t=>t.id!==e);d.TabsStorage.updateTab(n.id,{chats:a}),v.removeContactFromTab(e,n.id),chrome.runtime.sendMessage({type:"KANBAN_REMOVE_FROM_CRM",chatId:e,crmId:"custom_tabs"}),window.postMessage({type:"WA_TAB_CHANGED_FOR_FOLLOWUP",chatId:e,tabId:n.id,action:"remove"},"*"),hh("tab_removed",e,t,{tabId:n.id,tabName:n.title,tabColor:n.labelColor}),u(e=>e.map(e=>e.id===n.id?{...e,chats:a}:e))}else{const a={id:e,name:t,type:"individual"},r=[...n.chats||[],a];d.TabsStorage.updateTab(n.id,{chats:r}),v.addContactToTab(e,n.id),window.postMessage({type:"WA_TAB_CHANGED_FOR_FOLLOWUP",chatId:e,tabId:n.id,action:"add"},"*"),hh("tab_added",e,t,{tabId:n.id,tabName:n.title,tabColor:n.labelColor}),u(e=>e.map(e=>e.id===n.id?{...e,chats:r}:e))}})(n),onMouseEnter:e=>{e.currentTarget.style.background=r?"rgba(var(--lion-primary-rgb), 0.15)":"rgba(var(--lion-primary-rgb), 0.06)"},onMouseLeave:e=>{e.currentTarget.style.background=r?"rgba(var(--lion-primary-rgb), 0.08)":"transparent"}},U(r),F(n.labelColor||ca.primary),a.createElement("span",{style:{fontSize:"13px",color:r?"var(--lion-primary)":y?"#e5e7eb":"#1f2937",fontWeight:r?500:400,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n.title))})),g.map(e=>a.createElement(a.Fragment,{key:e.id},z(`crm_${e.id}`,e.name),c.has(`crm_${e.id}`)&&e.stages.map(t=>{const n=(r=e.id,o=t.id,b.some(e=>e.crmId===r&&e.stageId===o));var r,o;return a.createElement("div",{key:t.id,style:{display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",cursor:"pointer",transition:"background 0.1s",borderBottom:"1px solid var(--lion-sidebar-border)",background:n?"rgba(var(--lion-primary-rgb), 0.08)":"transparent"},onClick:()=>M(e,t),onMouseEnter:e=>{e.currentTarget.style.background=n?"rgba(var(--lion-primary-rgb), 0.15)":"rgba(var(--lion-primary-rgb), 0.06)"},onMouseLeave:e=>{e.currentTarget.style.background=n?"rgba(var(--lion-primary-rgb), 0.08)":"transparent"}},U(n),F(t.color),a.createElement("span",{style:{fontSize:"13px",color:n?"var(--lion-primary)":y?"#e5e7eb":"#1f2937",fontWeight:n?500:400,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.name))})))))},vh="Hi! I'm sharing contact details with you:\n\nName: {{name}}\nPhone: {{phone}}\nEmail: {{email}}\n\nLabels: {{labels}}\nTabs: {{tabs}}\n\nShared on {{today}} at {{time}}",yh=[{key:"{{name}}",label:"Name",description:"Full name of the contact"},{key:"{{firstname}}",label:"First Name",description:"First name only"},{key:"{{phone}}",label:"Phone",description:"Contact phone number"},{key:"{{email}}",label:"Email",description:"Contact email address"},{key:"{{gender}}",label:"Gender",description:"Contact gender"},{key:"{{dateOfBirth}}",label:"Birthday",description:"Contact birthday"},{key:"{{address}}",label:"Address",description:"Contact address"},{key:"{{details}}",label:"Details",description:"Profile details/notes"},{key:"{{language}}",label:"Language",description:"Preferred language"},{key:"{{labels}}",label:"Labels",description:"WhatsApp labels (comma-separated)"},{key:"{{tabs}}",label:"Tabs",description:"Custom tabs (comma-separated)"},{key:"{{today}}",label:"Today",description:"Current date"},{key:"{{time}}",label:"Time",description:"Current time"}],xh="team_settings";class wh{static getSettings(){try{const e=localStorage.getItem(xh);if(e){return JSON.parse(e)}}catch(e){}return{members:[],version:1}}static saveSettings(e){try{localStorage.setItem(xh,JSON.stringify(e)),this.syncToChromeStorage(e)}catch(e){}}static syncToChromeStorage(e){try{chrome.storage.local.set({[xh]:e},()=>{chrome.runtime.lastError})}catch(e){}}static getMembers(){return this.getSettings().members||[]}static getMember(e){return this.getMembers().find(t=>t.id===e)||null}static addMember(e,t,n=vh,a){const r=this.getSettings(),o=Date.now(),i={id:"tm_"+Date.now().toString(36)+Math.random().toString(36).substr(2,9),name:e,phone:t.replace(/[^0-9+]/g,""),department:a,template:n,createdAt:o,updatedAt:o};return r.members.push(i),this.saveSettings(r),i}static updateMember(e,t){const n=this.getSettings(),a=n.members.findIndex(t=>t.id===e);return-1!==a&&(t.phone&&(t.phone=t.phone.replace(/[^0-9+]/g,"")),n.members[a]={...n.members[a],...t,updatedAt:Date.now()},this.saveSettings(n),!0)}static deleteMember(e){const t=this.getSettings(),n=t.members.length;return t.members=t.members.filter(t=>t.id!==e),t.members.length!==n&&(this.saveSettings(t),!0)}static clearAll(){this.saveSettings({members:[],version:1})}static exportSettings(){return JSON.stringify(this.getSettings(),null,2)}static importSettings(e){try{const t=JSON.parse(e);if(t.members&&Array.isArray(t.members))return this.saveSettings(t),!0}catch(e){}return!1}static async getSettingsAsync(){return new Promise(e=>{try{chrome.storage.local.get([xh],t=>{if(chrome.runtime.lastError)return void e({members:[],version:1});const n=t[xh];e(n||{members:[],version:1})})}catch(t){e({members:[],version:1})}})}}const kh=async(e,t,n)=>{const a=v.getContact(e),r=a?.profile,o=await Eh(e),i=Sh(e),s=new Date,l=s.toLocaleDateString("pt-BR",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),c=s.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit",hour12:!0}),d={};if(r?.customFields)for(const e of r.customFields)d[e.label]=e.value;const m=r?.name||t||"",p=m.split(" ")[0]||m;let u=r?.phone||n||"";return(!u||u.includes("lid")||u.match(/^\+?\d{15,}$/))&&(u=await((e,t)=>new Promise(n=>{const a=`resolve_phone_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,r=setTimeout(()=>{window.removeEventListener("message",o);let a=e.split("@")[0];t&&t.match(/^\+?[\d\s\-()]{10,}$/)&&(a=t.replace(/[\s\-()]/g,"")),n(a.startsWith("+")?a:"+"+a)},3e3),o=t=>{if("RESOLVE_PHONE_FROM_ID_RESPONSE"===t.data?.type&&t.data?.requestId===a){clearTimeout(r),window.removeEventListener("message",o);const a=t.data.phone||e.split("@")[0];n(a)}};window.addEventListener("message",o),window.postMessage({type:"RESOLVE_PHONE_FROM_ID",contactId:e,contactName:t,requestId:a},"*")}))(e,t)),{name:m,firstname:p,phone:u,email:r?.email||"",gender:r?.gender||"",dateOfBirth:r?.dateOfBirth||"",address:r?.address||"",details:r?.details||"",language:r?.language||"",labels:o.length>0?o.join(", "):"None",tabs:i.length>0?i.join(", "):"None",today:l,time:c,customFields:d}},Eh=e=>new Promise(t=>{const n=setTimeout(()=>{t([])},3e3),a=r=>{r.source===window&&"TEAM_SHARE_LABELS_RESPONSE"===r.data?.type&&r.data.chatId===e&&(clearTimeout(n),window.removeEventListener("message",a),t(r.data.labelNames||[]))};window.addEventListener("message",a),window.postMessage({type:"TEAM_SHARE_GET_LABELS",chatId:e},"*")}),Sh=e=>{try{const t=d.TabsStorage.getTabs(),n=[];for(const a of t)a.isPermanent||a.isSystemFilter||a.chats&&a.chats.some(t=>t.id===e)&&n.push(a.title);return n}catch(e){return[]}},Ch=(e,t)=>{let n=e;return n=n.replace(/\{\{name\}\}/gi,t.name||""),n=n.replace(/\{\{firstname\}\}/gi,t.firstname||""),n=n.replace(/\{\{phone\}\}/gi,t.phone||""),n=n.replace(/\{\{email\}\}/gi,t.email||""),n=n.replace(/\{\{gender\}\}/gi,t.gender||""),n=n.replace(/\{\{dateOfBirth\}\}/gi,t.dateOfBirth||""),n=n.replace(/\{\{address\}\}/gi,t.address||""),n=n.replace(/\{\{details\}\}/gi,t.details||""),n=n.replace(/\{\{language\}\}/gi,t.language||""),n=n.replace(/\{\{labels\}\}/gi,t.labels||"None"),n=n.replace(/\{\{tabs\}\}/gi,t.tabs||"None"),n=n.replace(/\{\{today\}\}/gi,t.today||""),n=n.replace(/\{\{time\}\}/gi,t.time||""),n=n.replace(/\{\{customField:([^}]+)\}\}/gi,(e,n)=>t.customFields[n]||""),n=n.replace(/\n\s*\n\s*\n/g,"\n\n"),n},Th=({onClose:e})=>{const[t,n]=(0,a.useState)([]),[r,o]=(0,a.useState)(null),[i,l]=(0,a.useState)(!1),[,c]=(0,a.useState)(0),[d,m]=(0,a.useState)(""),[p,u]=(0,a.useState)(""),[g,h]=(0,a.useState)(""),[b,f]=(0,a.useState)(vh),[v,y]=(0,a.useState)(!1),[x,w]=(0,a.useState)([]),[k,E]=(0,a.useState)(""),[S,C]=(0,a.useState)(!1),T=x.filter(e=>e.name.toLowerCase().includes(k.toLowerCase())||e.phone.includes(k));(0,a.useEffect)(()=>{A()},[]),(0,a.useEffect)(()=>{const e=()=>c(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]);const A=()=>{const e=wh.getMembers();n(e)},D=e=>{o(e.id),l(!1),m(e.name),u(e.phone),h(e.department||""),f(e.template)},_=e=>{const t=e.trim().split(" ").filter(e=>e.length>0);return t.length>=2?(t[0][0]+t[t.length-1][0]).toUpperCase():e.substring(0,2).toUpperCase()},N=t.find(e=>e.id===r),M=i||N;return a.createElement("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.55)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2147483e3},onClick:t=>{t.target===t.currentTarget&&e()}},a.createElement("div",{style:{background:"#ffffff",borderRadius:"14px",width:"860px",maxWidth:"95vw",height:"580px",maxHeight:"90vh",display:"flex",flexDirection:"column",boxShadow:"0 25px 70px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0,0,0,0.05)",overflow:"hidden",border:"1px solid #e5e7eb"}},a.createElement("div",{style:{padding:"14px 18px",background:"#ffffff",borderBottom:"1px solid #f0f0f0",display:"flex",alignItems:"center",justifyContent:"space-between"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px"}},a.createElement("div",{style:{backgroundColor:"rgba(var(--lion-primary-rgb), 0.1)",width:"32px",height:"32px",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--lion-primary)"}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"9",cy:"7",r:"4"}),a.createElement("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),a.createElement("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}))),a.createElement("h2",{style:{margin:0,fontSize:"15px",fontWeight:700,color:"#1f2937"}},(0,s.t)("team.settings"))),a.createElement("button",{onClick:e,style:{background:"#ffffff",border:"1px solid #e5e7eb",color:"#52525b",cursor:"pointer",width:"30px",height:"30px",padding:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px",transition:"all 0.15s"},onMouseEnter:e=>{e.currentTarget.style.background="rgba(239, 68, 68, 0.1)",e.currentTarget.style.borderColor="rgba(239, 68, 68, 0.3)",e.currentTarget.style.color="#ef4444"},onMouseLeave:e=>{e.currentTarget.style.background="#ffffff",e.currentTarget.style.borderColor="#e5e7eb",e.currentTarget.style.color="#52525b"}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))),a.createElement("div",{style:{display:"flex",flex:1,overflow:"hidden"}},a.createElement("div",{style:{width:"240px",borderRight:"1px solid #f0f0f0",display:"flex",flexDirection:"column",background:"#fafafa"}},a.createElement("div",{style:{padding:"14px"}},a.createElement("button",{onClick:()=>{o(null),l(!0),m(""),u(""),h(""),f(vh)},style:{width:"100%",padding:"10px 14px",background:"var(--lion-primary)",border:"none",borderRadius:"10px",color:"#ffffff",fontSize:"13px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",boxShadow:"0 2px 8px rgba(var(--lion-primary-rgb), 0.25)",transition:"all 0.15s"},onMouseEnter:e=>{e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 4px 14px rgba(var(--lion-primary-rgb), 0.35)"},onMouseLeave:e=>{e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 2px 8px rgba(var(--lion-primary-rgb), 0.25)"}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"})),(0,s.t)("team.addMember"))),a.createElement("div",{style:{flex:1,overflowY:"auto",padding:"0 16px 16px"}},0===t.length?a.createElement("div",{style:{padding:"40px 16px",textAlign:"center",color:"#6b7280",fontSize:"14px"}},(0,s.t)("team.noMembers")):t.map(e=>{const t=r===e.id;return a.createElement("div",{key:e.id,style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 12px",borderRadius:"14px",background:t?"rgba(6, 78, 168, 0.2)":"transparent",marginBottom:"8px",transition:"all 0.15s",border:t?"2px solid var(--lion-primary)":"2px solid transparent"},onMouseEnter:e=>{t||(e.currentTarget.style.background="rgba(var(--lion-primary-rgb), 0.06)")},onMouseLeave:e=>{e.currentTarget.style.background=t?"rgba(6, 78, 168, 0.2)":"transparent"}},a.createElement("div",{style:{width:"42px",height:"42px",borderRadius:"12px",background:t?ca.primary:"#f4f4f5",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px",fontWeight:700,color:t?"#fff":"#52525b",flexShrink:0}},_(e.name)),a.createElement("div",{style:{flex:1,overflow:"hidden",cursor:"pointer"},onClick:()=>D(e)},a.createElement("div",{style:{fontSize:"14px",fontWeight:600,color:"#1f2937",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.name),e.department&&a.createElement("div",{style:{fontSize:"12px",color:"#6b7280",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginTop:"2px"}},e.department)),a.createElement("div",{style:{display:"flex",gap:"6px",flexShrink:0}},a.createElement("button",{onClick:t=>{t.stopPropagation(),D(e)},title:(0,s.t)("team.editMember"),style:{width:"32px",height:"32px",borderRadius:"8px",background:"#f4f4f5",border:"none",color:"#6b7280",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.15s"},onMouseEnter:e=>{e.currentTarget.style.background=ca.primary,e.currentTarget.style.color="#fff"},onMouseLeave:e=>{e.currentTarget.style.background="#f4f4f5",e.currentTarget.style.color="#6b7280"}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))),a.createElement("button",{onClick:t=>{t.stopPropagation(),confirm((0,s.t)("team.deleteConfirm"))&&(wh.deleteMember(e.id),r===e.id&&(o(null),m(""),u(""),h(""),f(vh)),A())},title:(0,s.t)("team.deleteMember"),style:{width:"32px",height:"32px",borderRadius:"8px",background:"#f4f4f5",border:"none",color:"#6b7280",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.15s"},onMouseEnter:e=>{e.currentTarget.style.background=ca.error,e.currentTarget.style.color="#fff"},onMouseLeave:e=>{e.currentTarget.style.background="#f4f4f5",e.currentTarget.style.color="#6b7280"}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polyline",{points:"3 6 5 6 21 6"}),a.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})))))}))),a.createElement("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",background:"#ffffff"}},M?a.createElement("div",{style:{flex:1,overflowY:"auto",padding:"28px"}},a.createElement("h3",{style:{margin:"0 0 28px",fontSize:"20px",fontWeight:700,color:"#1f2937"}},i?(0,s.t)("team.addMember"):(0,s.t)("team.editMember")),a.createElement("div",{style:{marginBottom:"20px"}},a.createElement("label",{style:{display:"block",fontSize:"14px",color:"#6b7280",marginBottom:"10px",fontWeight:500}},(0,s.t)("team.memberName")," *"),a.createElement("input",{type:"text",value:d,onChange:e=>m(e.target.value),placeholder:(0,s.t)("team.namePlaceholder"),style:{width:"100%",padding:"14px 18px",background:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"12px",color:"#1f2937",fontSize:"15px",outline:"none",boxSizing:"border-box"}})),a.createElement("div",{style:{marginBottom:"20px"}},a.createElement("label",{style:{display:"block",fontSize:"14px",color:"#6b7280",marginBottom:"10px",fontWeight:500}},(0,s.t)("team.memberPhone")," *"),a.createElement("div",{style:{display:"flex",gap:"10px"}},a.createElement("input",{type:"text",value:p,onChange:e=>u(e.target.value),placeholder:(0,s.t)("team.phonePlaceholder"),style:{flex:1,padding:"14px 18px",background:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"12px",color:"#1f2937",fontSize:"15px",outline:"none",boxSizing:"border-box"}}),a.createElement("button",{type:"button",onClick:()=>{y(!0),E(""),(()=>{C(!0),w([]);const e=setTimeout(()=>{C(!1)},5e3),t=n=>{if(n.source===window&&"TEAM_CONTACTS_RESPONSE"===n.data?.type){clearTimeout(e),window.removeEventListener("message",t);const a=(n.data.contacts||[]).filter(e=>!e.isGroup).map(e=>({id:e.id,name:e.name||e.pushname||e.id.split("@")[0],phone:"+"+e.id.split("@")[0],isGroup:e.isGroup||!1}));w(a),C(!1)}};window.addEventListener("message",t),window.postMessage({type:"TEAM_GET_CONTACTS"},"*")})()},title:(0,s.t)("team.selectContact"),style:{padding:"14px 16px",background:ca.primary,border:"none",borderRadius:"12px",color:"#fff",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.background=ca.primaryHover},onMouseLeave:e=>{e.currentTarget.style.background=ca.primary}},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"9",cy:"7",r:"4"}),a.createElement("line",{x1:"23",y1:"11",x2:"17",y2:"11"}),a.createElement("line",{x1:"20",y1:"8",x2:"20",y2:"14"})))),a.createElement("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:"6px"}},(0,s.t)("team.phoneHint"))),a.createElement("div",{style:{marginBottom:"20px"}},a.createElement("label",{style:{display:"block",fontSize:"14px",color:"#6b7280",marginBottom:"10px",fontWeight:500}},(0,s.t)("team.department")),a.createElement("input",{type:"text",value:g,onChange:e=>h(e.target.value),placeholder:(0,s.t)("team.departmentPlaceholder"),style:{width:"100%",padding:"14px 18px",background:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"12px",color:"#1f2937",fontSize:"15px",outline:"none",boxSizing:"border-box"}})),a.createElement("div",{style:{marginBottom:"20px"}},a.createElement("label",{style:{display:"block",fontSize:"14px",color:"#6b7280",marginBottom:"10px",fontWeight:500}},(0,s.t)("team.template")," *"),a.createElement("textarea",{value:b,onChange:e=>f(e.target.value),placeholder:(0,s.t)("team.templatePlaceholder"),rows:5,style:{width:"100%",padding:"14px 18px",background:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"12px",color:"#1f2937",fontSize:"15px",outline:"none",resize:"vertical",fontFamily:"inherit",boxSizing:"border-box"}}),a.createElement("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:"8px"}},(0,s.t)("team.variableHint"))),a.createElement("div",{style:{marginBottom:"24px"}},a.createElement("label",{style:{display:"block",fontSize:"14px",color:"#6b7280",marginBottom:"12px",fontWeight:500}},(0,s.t)("team.insertVariable")),a.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"}},yh.map(e=>a.createElement("button",{key:e.key,onClick:()=>{return t=e.key,void f(e=>e+t);var t},title:e.description,style:{padding:"8px 14px",background:"#f4f4f5",border:"none",borderRadius:"10px",color:"#374151",fontSize:"13px",cursor:"pointer",transition:"all 0.15s"},onMouseEnter:e=>{e.currentTarget.style.background=ca.primary,e.currentTarget.style.color="#fff"},onMouseLeave:e=>{e.currentTarget.style.background="#f4f4f5",e.currentTarget.style.color="#374151"}},e.label)))),a.createElement("div",{style:{marginBottom:"28px"}},a.createElement("label",{style:{display:"block",fontSize:"14px",color:"#6b7280",marginBottom:"12px",fontWeight:500}},(0,s.t)("team.preview")),a.createElement("div",{style:{padding:"16px",background:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"12px",color:"#374151",fontSize:"14px",whiteSpace:"pre-wrap",maxHeight:"120px",overflowY:"auto",lineHeight:1.6}},((e,t="Maria Silva")=>{const n={name:t,firstname:t.split(" ")[0],phone:"+5511999999999",email:"contato@exemplo.com",gender:"Masculino",dateOfBirth:"15 Jan 1990",address:"Rua das Flores, 123, Sao Paulo",details:"Cliente importante",language:"Portuguese",labels:"VIP, Cliente",tabs:"Vendas, Oportunidade quente",today:(new Date).toLocaleDateString("pt-BR",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),time:(new Date).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit",hour12:!0}),customFields:{}};return Ch(e,n)})(b,"Maria Silva"))),a.createElement("div",{style:{display:"flex",gap:"14px",justifyContent:"flex-end"}},!i&&r&&a.createElement("button",{onClick:()=>{r&&confirm((0,s.t)("team.deleteConfirm"))&&(wh.deleteMember(r),o(null),m(""),u(""),h(""),f(vh),A())},style:{padding:"14px 24px",background:"transparent",border:"2px solid var(--lion-error)",borderRadius:"12px",color:ca.error,fontSize:"15px",fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.background=ca.error,e.currentTarget.style.color="#fff"},onMouseLeave:e=>{e.currentTarget.style.background="transparent",e.currentTarget.style.color=ca.error}},a.createElement(()=>a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polyline",{points:"3 6 5 6 21 6"}),a.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})),null),(0,s.t)("team.deleteMember")),a.createElement("button",{onClick:e,style:{padding:"14px 28px",background:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"10px",color:"#374151",fontSize:"13px",fontWeight:600,cursor:"pointer",transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.background="var(--lion-primary-light, #eff6ff)",e.currentTarget.style.borderColor="var(--lion-primary)",e.currentTarget.style.color="var(--lion-primary)"},onMouseLeave:e=>{e.currentTarget.style.background="var(--lion-bg-primary, #ffffff)",e.currentTarget.style.borderColor="var(--lion-border-light, #e5e7eb)",e.currentTarget.style.color="var(--lion-text-secondary, #374151)"}},(0,s.t)("team.cancel")),a.createElement("button",{onClick:()=>{if(d.trim()&&p.trim()){if(i){const e=wh.addMember(d.trim(),p.trim(),b,g.trim()||void 0);o(e.id),l(!1)}else r&&wh.updateMember(r,{name:d.trim(),phone:p.trim(),department:g.trim()||void 0,template:b});A()}},disabled:!d.trim()||!p.trim(),style:{padding:"14px 36px",background:d.trim()&&p.trim()?"var(--lion-primary)":"#e5e7eb",border:"none",borderRadius:"10px",color:d.trim()&&p.trim()?"#ffffff":"#9ca3af",fontSize:"15px",fontWeight:600,cursor:d.trim()&&p.trim()?"pointer":"not-allowed",opacity:d.trim()&&p.trim()?1:.5,boxShadow:d.trim()&&p.trim()?"0 4px 15px rgba(6, 78, 168, 0.4)":"none",transition:"all 0.2s"}},(0,s.t)("team.save")))):a.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"#6b7280",fontSize:"16px"}},a.createElement("div",{style:{textAlign:"center"}},a.createElement("div",{style:{width:"80px",height:"80px",background:"#f4f4f5",borderRadius:"20px",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 20px"}},a.createElement("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"#9ca3af",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"9",cy:"7",r:"4"}),a.createElement("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),a.createElement("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}))),(0,s.t)("team.clickToAdd")))))),v&&a.createElement("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.55)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2147483647},onClick:e=>{e.target===e.currentTarget&&(y(!1),E(""))}},a.createElement("div",{style:{background:"#ffffff",borderRadius:"16px",width:"450px",maxWidth:"90vw",maxHeight:"70vh",display:"flex",flexDirection:"column",boxShadow:"0 25px 70px rgba(0, 0, 0, 0.2)",border:"1px solid #e5e7eb",overflow:"hidden"}},a.createElement("div",{style:{padding:"16px 20px",background:"#ffffff",borderBottom:"1px solid #f0f0f0",display:"flex",alignItems:"center",justifyContent:"space-between"}},a.createElement("h3",{style:{margin:0,fontSize:"18px",fontWeight:600,color:"#1f2937"}},(0,s.t)("team.selectContact")),a.createElement("button",{onClick:()=>{y(!1),E("")},style:{background:"#ef4444",border:"none",color:"#fff",cursor:"pointer",padding:"8px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"8px"}},a.createElement(()=>a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),null))),a.createElement("div",{style:{padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},a.createElement("input",{type:"text",value:k,onChange:e=>E(e.target.value),placeholder:(0,s.t)("team.searchContact"),autoFocus:!0,style:{width:"100%",padding:"12px 16px",background:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"10px",color:"#1f2937",fontSize:"14px",outline:"none",boxSizing:"border-box"}})),a.createElement("div",{style:{flex:1,overflowY:"auto",padding:"8px 12px"}},S?a.createElement("div",{style:{padding:"40px 20px",textAlign:"center",color:"#6b7280"}},a.createElement("div",{style:{width:"40px",height:"40px",border:"3px solid #f0f0f0",borderTopColor:ca.primary,borderRadius:"50%",margin:"0 auto 16px",animation:"spin 1s linear infinite"}}),(0,s.t)("team.loadingContacts"),a.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }")):0===T.length?a.createElement("div",{style:{padding:"40px 20px",textAlign:"center",color:"#6b7280"}},0===x.length?(0,s.t)("team.noContactsFound"):(0,s.t)("team.noSearchResults")):T.map(e=>a.createElement("div",{key:e.id,onClick:()=>(e=>{m(e.name),u(e.phone),y(!1),E("")})(e),style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px 14px",borderRadius:"10px",cursor:"pointer",marginBottom:"4px",transition:"all 0.15s"},onMouseEnter:e=>{e.currentTarget.style.background="rgba(var(--lion-primary-rgb), 0.08)"},onMouseLeave:e=>{e.currentTarget.style.background="transparent"}},a.createElement("div",{style:{width:"42px",height:"42px",borderRadius:"50%",background:"#f4f4f5",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"14px",fontWeight:600,color:"#52525b",flexShrink:0}},_(e.name)),a.createElement("div",{style:{flex:1,overflow:"hidden"}},a.createElement("div",{style:{fontSize:"14px",fontWeight:600,color:"#1f2937",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.name),a.createElement("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:"2px"}},e.phone)),a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#9ca3af",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polyline",{points:"9 18 15 12 9 6"}))))))))},Ah=({contactId:e,contactName:t,contactPhone:n})=>{const[r,o]=(0,a.useState)(!1),[l,c]=(0,a.useState)([]),[d,m]=(0,a.useState)(null),[p,u]=(0,a.useState)(!1),[,g]=(0,a.useState)(0),h=(0,a.useRef)(null),[b,f]=(0,a.useState)(null),[v,y]=(0,a.useState)(""),x=(0,a.useRef)(null),[w,k]=(0,a.useState)(()=>document.documentElement.classList.contains("lion-dark"));(0,a.useEffect)(()=>{const e=()=>k(document.documentElement.classList.contains("lion-dark"));return window.addEventListener("lionThemeApplied",e),window.addEventListener("themeChanged",e),()=>{window.removeEventListener("lionThemeApplied",e),window.removeEventListener("themeChanged",e)}},[]),(0,a.useEffect)(()=>{if(r){const e=wh.getMembers();c(e)}},[r]),(0,a.useEffect)(()=>{const e=()=>g(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{const e=e=>{e.source===window&&"TEAM_SHARE_SEND_RESPONSE"===e.data?.type&&setTimeout(()=>{m(null)},1e3)};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[]);const E=async a=>{m(a.id);try{const r=await kh(e,t,n),o=Ch(a.template,r);window.postMessage({type:"TEAM_SHARE_SEND_MESSAGE",teamMemberPhone:a.phone,message:o,requestId:`${a.id}_${Date.now()}`},"*")}catch(e){m(null)}},S=()=>{f(null),y("")};return a.createElement(a.Fragment,null,a.createElement("div",{ref:h,style:{position:"relative",display:"inline-flex"}},a.createElement("button",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",padding:"6px 10px",background:w?"#262626":"#ffffff",border:"1px solid "+(w?"#3a3a3a":"#e5e7eb"),borderRadius:"10px",fontSize:"11px",fontWeight:600,color:w?"#e5e7eb":"#52525b",cursor:"pointer",fontFamily:"inherit",whiteSpace:"nowrap",verticalAlign:"middle",lineHeight:"20px",marginLeft:"4px",transition:"all 0.15s"},onClick:e=>{e.stopPropagation(),e.preventDefault(),o(!r)},onMouseEnter:e=>{e.currentTarget.style.background="rgba(var(--lion-primary-rgb), 0.12)",e.currentTarget.style.borderColor="var(--lion-primary)",e.currentTarget.style.color="var(--lion-primary)"},onMouseLeave:e=>{e.currentTarget.style.background=w?"#262626":"#ffffff",e.currentTarget.style.borderColor=w?"#3a3a3a":"#e5e7eb",e.currentTarget.style.color=w?"#e5e7eb":"#52525b"},title:(0,s.t)("team.shareWith")},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"9",cy:"7",r:"4"}),a.createElement("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),a.createElement("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})))),a.createElement("style",null,"\n        @keyframes spin {\n          from { transform: rotate(0deg); }\n          to { transform: rotate(360deg); }\n        }\n      "),r&&i.createPortal(a.createElement(()=>{const r=()=>{o(!1),u(!0)};return a.createElement("div",{style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.75)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2147483646},onClick:()=>o(!1)},a.createElement("div",{style:{position:"relative",backgroundColor:"#ffffff",borderRadius:"14px",boxShadow:"0 25px 70px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0,0,0,0.05)",width:"340px",maxHeight:"80vh",zIndex:2147483647,border:"1px solid #e5e7eb",overflow:"hidden"},onClick:e=>e.stopPropagation()},a.createElement("div",{style:{backgroundColor:"#ffffff",padding:"14px 16px",display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #f0f0f0"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0}},a.createElement("div",{style:{width:"32px",height:"32px",backgroundColor:"rgba(var(--lion-primary-rgb), 0.1)",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--lion-primary)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"9",cy:"7",r:"4"}),a.createElement("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),a.createElement("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}))),a.createElement("div",{style:{minWidth:0}},a.createElement("div",{style:{fontSize:"14px",fontWeight:700,color:"#1f2937",lineHeight:1.3}},(0,s.t)("team.popupTitle")||"Share with Team"),a.createElement("div",{style:{fontSize:"11px",color:"#6b7280",marginTop:"1px"}},(0,s.t)("team.popupSubtitle")||"Send contact details instantly"))),a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexShrink:0}},a.createElement("button",{onClick:e=>{e.stopPropagation(),r()},style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"8px",width:"30px",height:"30px",padding:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#52525b",transition:"all 0.15s"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(var(--lion-primary-rgb), 0.08)",e.currentTarget.style.borderColor="var(--lion-primary)",e.currentTarget.style.color="var(--lion-primary)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ffffff",e.currentTarget.style.borderColor="#e5e7eb",e.currentTarget.style.color="#52525b"},title:"Team Settings"},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("circle",{cx:"12",cy:"12",r:"3"}),a.createElement("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}))),a.createElement("button",{onClick:e=>{e.stopPropagation(),o(!1)},style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"8px",width:"30px",height:"30px",padding:0,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#52525b",transition:"all 0.15s"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(239, 68, 68, 0.1)",e.currentTarget.style.borderColor="rgba(239, 68, 68, 0.3)",e.currentTarget.style.color="#ef4444"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ffffff",e.currentTarget.style.borderColor="#e5e7eb",e.currentTarget.style.color="#52525b"},title:"Close"},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))))),a.createElement("div",{style:{backgroundColor:"#ffffff"}},0===l.length?a.createElement("div",{style:{padding:"28px 24px",textAlign:"center"}},a.createElement("div",{style:{width:"56px",height:"56px",backgroundColor:"rgba(var(--lion-primary-rgb), 0.1)",borderRadius:"14px",margin:"0 auto 14px",display:"flex",alignItems:"center",justifyContent:"center"}},a.createElement("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"var(--lion-primary)",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"9",cy:"7",r:"4"}),a.createElement("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),a.createElement("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}))),a.createElement("h2",{style:{fontSize:"15px",fontWeight:700,color:"#1f2937",margin:"0 0 6px 0"}},(0,s.t)("team.noTeamMembers")||"No Team Members"),a.createElement("p",{style:{fontSize:"12px",color:"#6b7280",margin:"0 0 18px 0",lineHeight:"1.5"}},(0,s.t)("team.noTeamMembersDesc")||"Add your team members to quickly share contact details via WhatsApp"),a.createElement("button",{onClick:e=>{e.stopPropagation(),r()},style:{background:"var(--lion-primary)",border:"none",borderRadius:"10px",padding:"10px 18px",fontSize:"13px",fontWeight:600,color:"#ffffff",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"8px",boxShadow:"0 2px 8px rgba(var(--lion-primary-rgb), 0.25)",transition:"all 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.transform="translateY(-1px)",e.currentTarget.style.boxShadow="0 4px 14px rgba(var(--lion-primary-rgb), 0.35)"},onMouseLeave:e=>{e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="0 2px 8px rgba(var(--lion-primary-rgb), 0.25)"}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"})),(0,s.t)("team.addMember")||"Add Team Member")):a.createElement(a.Fragment,null,a.createElement("div",{style:{padding:"12px 0",maxHeight:"400px",overflowY:"auto"}},l.map(r=>{const o=d===r.id,i=b===r.id;return a.createElement("div",{key:r.id,style:{margin:"4px 12px"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"16px",padding:"16px 24px",borderRadius:i?"16px 16px 0 0":"16px",cursor:o?"default":"pointer",backgroundColor:i?"rgba(var(--lion-primary-rgb), 0.1)":"transparent",transition:"all 0.2s",opacity:o?.6:1},onMouseEnter:e=>{o||i||(e.currentTarget.style.backgroundColor="rgba(var(--lion-primary-rgb), 0.08)")},onMouseLeave:e=>{i||(e.currentTarget.style.backgroundColor="transparent")}},a.createElement("div",{style:{width:"52px",height:"52px",backgroundColor:ca.primary,borderRadius:"16px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"18px",fontWeight:700,color:"#fff",boxShadow:"0 4px 12px rgba(6, 78, 168, 0.3)",flexShrink:0}},o?a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"2",style:{animation:"spin 1s linear infinite"}},a.createElement("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),a.createElement("path",{d:"M12 2a10 10 0 0 1 10 10",strokeLinecap:"round"})):(e=>{const t=e.trim().split(" ").filter(e=>e.length>0);return t.length>=2?(t[0][0]+t[t.length-1][0]).toUpperCase():e.substring(0,2).toUpperCase()})(r.name)),a.createElement("div",{style:{flex:1,minWidth:0}},a.createElement("div",{style:{fontSize:"16px",fontWeight:600,color:"#1f2937"}},r.name),r.department&&a.createElement("div",{style:{fontSize:"13px",color:"#6b7280",marginTop:"4px"}},r.department)),!o&&a.createElement("div",{style:{display:"flex",gap:"8px"}},a.createElement("button",{onClick:e=>((e,t)=>{e.stopPropagation(),f(t.id),y(t.template)})(e,r),title:(0,s.t)("team.editTemplate"),style:{width:"40px",height:"40px",backgroundColor:i?ca.primary:"#f4f4f5",border:"none",borderRadius:"10px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:e=>{i||(e.currentTarget.style.backgroundColor="rgba(var(--lion-primary-rgb), 0.15)")},onMouseLeave:e=>{i||(e.currentTarget.style.backgroundColor="#f4f4f5")}},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:i?"#fff":ca.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),a.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))),a.createElement("button",{onClick:a=>{a.stopPropagation(),(async a=>{if(!d){m(a.id);try{const r=await kh(e,t,n),o=Ch(a.template,r);window.postMessage({type:"TEAM_SHARE_SEND_MESSAGE",teamMemberPhone:a.phone,message:o,requestId:`${a.id}_${Date.now()}`},"*")}catch(e){m(null)}}})(r)},title:(0,s.t)("team.send"),style:{width:"40px",height:"40px",backgroundColor:"rgba(6, 78, 168, 0.2)",border:"none",borderRadius:"10px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=ca.primary;const t=e.currentTarget.querySelector("svg");t&&(t.style.stroke="#fff")},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(6, 78, 168, 0.2)";const t=e.currentTarget.querySelector("svg");t&&(t.style.stroke=ca.primary)}},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:ca.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),a.createElement("polygon",{points:"22 2 15 22 11 13 2 9 22 2"}))))),i&&a.createElement("div",{style:{padding:"16px 20px",backgroundColor:"#ffffff",borderRadius:"0 0 16px 16px",borderTop:"1px solid rgba(var(--lion-primary-rgb), 0.25)"}},a.createElement("textarea",{ref:x,defaultValue:r.template,placeholder:(0,s.t)("team.templatePlaceholder"),rows:5,style:{width:"100%",backgroundColor:"#fafafa",border:"1px solid #e5e7eb",borderRadius:"10px",padding:"12px",fontSize:"14px",color:"#1f2937",resize:"none",fontFamily:"inherit",outline:"none",boxSizing:"border-box",lineHeight:"1.5",minHeight:"120px"},onFocus:e=>{e.target.style.borderColor=ca.primary},onBlur:e=>{e.target.style.borderColor="#e5e7eb"},autoFocus:!0}),a.createElement("div",{style:{marginTop:"10px"}},a.createElement("div",{style:{fontSize:"11px",color:"#6b7280",marginBottom:"6px"}},(0,s.t)("team.insertVariable"),":"),a.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px"}},yh.slice(0,8).map(e=>a.createElement("button",{key:e.key,onClick:()=>(e=>{const t=x.current;if(t){const n=t.selectionStart,a=t.selectionEnd,r=t.value,o=r.slice(0,n)+e+r.slice(a);t.value=o,t.focus();const i=n+e.length;t.setSelectionRange(i,i)}})(e.key),title:e.description,style:{backgroundColor:"#f4f4f5",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 8px",fontSize:"11px",color:"#52525b",cursor:"pointer",transition:"all 0.15s"},onMouseEnter:e=>{e.currentTarget.style.borderColor=ca.primary,e.currentTarget.style.color=ca.primary},onMouseLeave:e=>{e.currentTarget.style.borderColor="#e5e7eb",e.currentTarget.style.color="#52525b"}},e.label)))),a.createElement("div",{style:{display:"flex",gap:"10px",marginTop:"14px"}},a.createElement("button",{onClick:()=>(async e=>{const t=x.current?.value||v;t.trim()&&(wh.updateMember(e.id,{template:t}),c(n=>n.map(n=>n.id===e.id?{...n,template:t}:n)),await E({...e,template:t}),f(null),y(""))})(r),style:{flex:1,backgroundColor:ca.primary,border:"none",borderRadius:"10px",padding:"10px 16px",fontSize:"13px",fontWeight:600,color:"#fff",cursor:"pointer",transition:"all 0.2s",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=ca.primaryHover},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=ca.primary}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),a.createElement("polyline",{points:"17 21 17 13 7 13 7 21"}),a.createElement("polyline",{points:"7 3 7 8 15 8"})),(0,s.t)("team.saveAndSend")),a.createElement("button",{onClick:()=>(async e=>{const t=x.current?.value||v;t.trim()&&(await E({...e,template:t}),f(null),y(""))})(r),style:{flex:1,backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"10px",padding:"10px 16px",fontSize:"13px",fontWeight:600,color:"#374151",cursor:"pointer",transition:"all 0.2s",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="var(--lion-primary-light, #eff6ff)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="var(--lion-bg-primary, #ffffff)"}},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),a.createElement("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})),(0,s.t)("team.sendOnce")),a.createElement("button",{onClick:S,style:{backgroundColor:"transparent",border:"1px solid #e5e7eb",borderRadius:"10px",padding:"10px 16px",fontSize:"13px",fontWeight:600,color:"#6b7280",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.borderColor="#ef4444",e.currentTarget.style.color="#ef4444"},onMouseLeave:e=>{e.currentTarget.style.borderColor="#e5e7eb",e.currentTarget.style.color="#6b7280"}},(0,s.t)("team.cancel")))))})),a.createElement("div",{onClick:e=>{e.stopPropagation(),r()},style:{padding:"18px 24px",backgroundColor:"#fafafa",borderTop:"1px solid #f0f0f0",borderRadius:"0 0 18px 18px",display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(var(--lion-primary-rgb), 0.12)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#fafafa"}},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:ca.primary,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),a.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"})),a.createElement("span",{style:{fontSize:"15px",fontWeight:600,color:ca.primary}},(0,s.t)("team.addMember")||"Add Team Member"))))))},null),document.body),p&&i.createPortal(a.createElement(Th,{onClose:()=>{u(!1),c(wh.getMembers())}}),document.body))};let Dh=null,_h=null,Nh=null,Mh=!1,Ih=!1;const Rh=async()=>{try{return await wu(["basic","advanced","advance","premium"])}catch(e){return!1}},Bh=async()=>{try{const e=document.querySelector("#main header");if(!e)return null;const t=e.querySelector('[data-testid="conversation-info-header-chat-title"]')||e.querySelector("span[title]")||e.querySelector("span._ao3e")||e.querySelector('span[dir="auto"]'),n=t?.textContent?.trim()||"";if(!n)return null;const a=e.querySelector('img[draggable="false"]'),r=a?.src||void 0;let o="",i=n;const s=await new Promise(e=>{const t=setTimeout(()=>{document.removeEventListener("getCurrentOpenChatResponse",n),e(null)},2e3),n=a=>{const r=a;clearTimeout(t),document.removeEventListener("getCurrentOpenChatResponse",n),r.detail.success&&r.detail.chat?e({id:r.detail.chat.id,name:r.detail.chat.name||""}):e(null)};document.addEventListener("getCurrentOpenChatResponse",n),document.dispatchEvent(new CustomEvent("getCurrentOpenChat"))});if(s&&s.id&&(o=s.id,i=s.name||n),!o)try{const t=e.querySelector('[data-testid="conversation-info-header"]')||e,n=Object.keys(t).find(e=>e.startsWith("__reactFiber$")||e.startsWith("__reactInternalInstance$"));if(n){let e=t[n],a=25;for(;e&&a-- >0;){const t=e.memoizedProps||e.pendingProps;if(t){const e=t.chat||t.contact||t.data;if(e&&e.id){const t=e.id._serialized||e.id.toString?.()||e.id;if(t&&t.includes("@")){o=t;break}}if(t.jid&&"string"==typeof t.jid&&t.jid.includes("@")){o=t.jid;break}}e=e.return}}}catch(e){}if(!o){const e=document.querySelector('[aria-selected="true"][data-testid="cell-frame-container"]')||document.querySelector('[tabindex="-1"][data-testid="cell-frame-container"]');if(e){const t=e.getAttribute("data-id");t&&t.includes("@")&&(o=t)}}if(!o)try{const t=e.querySelector('[data-testid="conversation-info-header-chat-subtitle"]')||e.querySelector('span[title*="+"]')||e.querySelector("._ao3e + span");if(t){const e=(t.textContent?.trim()||"").match(/\+?(\d[\d\s-]{8,})/);e&&(o=e[1].replace(/[\s-]/g,"")+"@c.us")}}catch(e){}if(!o){const e=window.location.hash.match(/\/chat\/([^\/\?]+)/);if(e&&e[1]){const t=decodeURIComponent(e[1]);t.includes("@")&&(o=t)}}if(!o){n.match(/^\+?[\d\s-]{10,}$/)&&(o=n.replace(/[\s+-]/g,"")+"@c.us")}if(!o){const e=t?.getAttribute("title");if(e){const t=e.match(/\+?(\d[\d\s-]{8,})/);t&&(o=t[1].replace(/[\s-]/g,"")+"@c.us")}}o||(o="unknown-"+Ph(n));let l=await(async(e,t)=>{if(e.includes("@c.us")){const t=e.match(/^(\d+)@/);if(t)return"+"+t[1]}if(e.includes("@lid"))return new Promise(n=>{const a=`resolve_phone_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,r=setTimeout(()=>{window.removeEventListener("message",o);let a=e.split("@")[0];t&&t.match(/^\+?[\d\s\-()]{10,}$/)&&(a=t.replace(/[\s\-()]/g,"")),n(a.startsWith("+")?a:"+"+a)},3e3),o=t=>{if("RESOLVE_PHONE_FROM_ID_RESPONSE"===t.data?.type&&t.data?.requestId===a){clearTimeout(r),window.removeEventListener("message",o);const a=t.data.phone||e.split("@")[0];n(a)}};window.addEventListener("message",o),window.postMessage({type:"RESOLVE_PHONE_FROM_ID",contactId:e,contactName:t,requestId:a},"*")});const n=e.match(/^(\d+)/);return n?"+"+n[1]:e})(o,n);if(n.match(/^\+?[\d\s-]{10,}$/)){const e=n.replace(/[\s-]/g,"");l=e.startsWith("+")?e:"+"+e;const t=e.replace(/\+/g,"");o.startsWith(t)||(o=t+"@c.us")}return{id:o,name:i,phone:l,image:r}}catch(e){return null}},Ph=e=>{let t=0;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t&=t}return Math.abs(t).toString(36)},Lh=async()=>{Mh=!0;try{if(!Ih)return;const e=document.querySelector("#main header");if(!e)return;const t=await Bh();if(!t)return;const n=document.getElementById("wa-crm-button-container");if(n){if(n.getAttribute("data-contact-id")===t.id)return;Dh&&(Dh.unmount(),Dh=null),n.remove()}_h=t.id;const r=document.createElement("div");r.id="wa-crm-button-container",r.setAttribute("data-contact-id",t.id),(()=> { const actions=e.querySelector('[data-testid="conversation-menu-button"]')?.parentElement||e.querySelector('div[role="button"]')?.parentElement||e.lastElementChild; if(actions&&actions.parentNode===e){r.style.cssText="display:flex;align-items:center;gap:8px;margin-right:16px;margin-left:12px;z-index:1000;";e.insertBefore(r,actions)}else{e.style.position="relative";r.style.cssText="position:absolute;right:120px;top:50%;transform:translateY(-50%);z-index:1000;display:flex;align-items:center;gap:8px;";e.appendChild(r)} })(),Dh=o.createRoot(r),Dh.render(a.createElement(a.Fragment,null,a.createElement(mh,{contactId:t.id,contactName:t.name,contactPhone:t.phone,contactImage:t.image}),a.createElement(fh,{contactId:t.id,contactName:t.name,contactImage:t.image}),a.createElement(Ah,{contactId:t.id,contactName:t.name,contactPhone:t.phone,contactImage:t.image})))}catch(e){}finally{setTimeout(()=>{Mh=!1},200)}},Uh=async()=>{if(Ih=await Rh(),!Ih)return void setInterval(async()=>{const e=Ih;Ih=await Rh(),!e&&Ih&&Lh()},1e4);const e=()=>{document.querySelector("#main header")&&Lh()};setTimeout(e,2e3),setTimeout(e,4e3),setTimeout(e,6e3),Nh=new MutationObserver(()=>{if(Mh||window.__CRM_MODAL_OPEN__)return;const e=document.getElementById("wa-crm-button-container");document.querySelector("#main header")&&!e&&Lh()});const t=document.querySelector("#app");t&&Nh.observe(t,{childList:!0,subtree:!0}),setInterval(async()=>{if(Mh||window.__CRM_MODAL_OPEN__)return;const e=document.getElementById("wa-crm-button-container");if(document.querySelector("#main header"))if(e){const t=e.getAttribute("data-contact-id"),n=await Bh();n&&t!==n.id&&Lh()}else Lh()},1500)},Fh="lionChatMessagesReply",zh=(e,t=50,n=8e3)=>new Promise((a,r)=>{if(!e)return void r(new Error("chatId required"));const o="undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`lion-${Date.now()}-${Math.random().toString(36).slice(2,10)}`;let i=!1;const s=()=>{document.removeEventListener(Fh,l),c&&clearTimeout(c)},l=e=>{const t=e.detail||{};if(t.requestId===o&&!i)if(i=!0,s(),t.success){const e=Array.isArray(t.messages)?t.messages:[];a(e)}else r(new Error(t.error||"Failed to fetch chat messages"))},c=setTimeout(()=>{i||(i=!0,s(),r(new Error("timeout")))},n);document.addEventListener(Fh,l),document.dispatchEvent(new CustomEvent("lionFetchChatMessages",{detail:{chatId:e,count:t,requestId:o}}))}),Oh=()=>"undefined"!=typeof navigator&&(navigator.platform.toUpperCase().indexOf("MAC")>=0||navigator.userAgent.toUpperCase().indexOf("MAC")>=0)?"⌃":"Alt",Wh=({onResult:e,getSelectedText:t,getInputText:n,setInputText:r,sendMessage:o,contactId:i,initialLanguage:l="English",onLanguageChange:c,isKanbanContext:d=!1,isDarkMode:m=!0,inputText:p,onInputTextChange:u})=>{const[g,h]=(0,a.useState)(!1),[b,f]=(0,a.useState)(!1),[v,y]=(0,a.useState)(null),[x,w]=(0,a.useState)(!1),[k,E]=(0,a.useState)(l),[S,C]=(0,a.useState)(""),[T,A]=(0,a.useState)(!1),[D,_]=(0,a.useState)(""),[N,M]=(0,a.useState)(null),[I,R]=(0,a.useState)(""),[B,P]=(0,a.useState)({top:0,left:0}),[,L]=(0,a.useState)(0),U=(0,a.useRef)(null),F=(0,a.useRef)(null);(0,a.useEffect)(()=>{const e=()=>{L(e=>e+1)};return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{const e=async()=>{if(d){const e=await Gn.isEnabledAsync();h(e)}else h(Gn.isEnabled())};e();const t=t=>{"wa_ai_settings"===t.key&&e()},n=()=>e();return window.addEventListener("storage",t),window.addEventListener("aiSettingsChanged",n),()=>{window.removeEventListener("storage",t),window.removeEventListener("aiSettingsChanged",n)}},[d]),(0,a.useEffect)(()=>{E(l)},[l]),(0,a.useEffect)(()=>{const e=e=>{U.current&&!U.current.contains(e.target)&&w(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const z=(0,a.useCallback)(()=>{D&&(o?.(D),A(!1),_(""),M(null),d?u?.(""):r?.(""))},[D,o,r,d,u]),O=(0,a.useCallback)(()=>{const e=t?.();if(e?.trim())return e.trim();if(d&&p)return p.trim();const a=n?.();return a?.trim()?a.trim():window.getSelection()?.toString().trim()||""},[t,n,d,p]),W=(0,a.useCallback)(async()=>{if(!d){if(!i)return R((0,s.t)("chatTools.conversationSummaryNoChat")||"Open a chat to summarize it"),void setTimeout(()=>R(""),2500);f(!0),y("conversationSummary"),R(""),A(!1),M(null);try{let t;try{t=await zh(i,50)}catch(e){return R((0,s.t)("chatTools.conversationSummaryFailed")||"Failed to fetch chat messages"),void setTimeout(()=>R(""),3e3)}if(!t||0===t.length)return R((0,s.t)("chatTools.conversationSummaryEmpty")||"No messages to summarize in this chat"),void setTimeout(()=>R(""),3e3);const n=(e=>{if(!Array.isArray(e)||0===e.length)return"";const t=e.slice().sort((e,t)=>(e.timestamp||0)-(t.timestamp||0)),n=[];for(const e of t){const t=(e.content||"").replace(/\s+$/g,"").replace(/^\s+/g,"");if(!t)continue;const a=e.fromMe?"Me":"User";n.push(`${a}: ${t}`)}let a=n.join("\n");if(a.length>6e3){a=a.slice(a.length-6e3);const e=a.indexOf("\n");e>0&&(a=a.slice(e+1))}return a})(t);if(!n)return R((0,s.t)("chatTools.conversationSummaryEmpty")||"No messages to summarize in this chat"),void setTimeout(()=>R(""),3e3);const a=(e=>{if(!Array.isArray(e)||0===e.length)return null;const t=e.slice().sort((e,t)=>(e.timestamp||0)-(t.timestamp||0)).filter(e=>!e.fromMe&&(e.content||"").trim());if(0===t.length)return null;const n=new Date;n.setHours(0,0,0,0);const a=n.getTime(),r=t.filter(e=>(e.timestamp||0)>=a);return r.length>0?r.map(e=>(e.content||"").trim()).join("\n"):(t[t.length-1].content||"").trim()||null})(t),r=a?`${n}\n\n---\nLATEST_INCOMING_MESSAGES_FROM_CONTACT:\n${a.slice(0,1200)}`:n,o=Xn()||"English",l=await Jn.summarizeConversation(r,o,d);l.success&&l.result?(_(l.result),M("conversationSummary"),A(!0),e?.(l.result,"conversationSummary")):(R(l.error||"Failed"),setTimeout(()=>R(""),3e3))}catch(e){R(e instanceof Error?e.message:"Error"),setTimeout(()=>R(""),3e3)}finally{f(!1),y(null)}}},[i,d,e]),q=(0,a.useCallback)(async t=>{if("conversationSummary"===t)return void W();const n=O();if(!n)return R((0,s.t)("chatTools.selectTextFirst")),void setTimeout(()=>R(""),2500);f(!0),y(t),R(""),A(!1),M(null);try{const a="translate"===t?await Jn.translate(n,k,d):await Jn.processText(n,t,{useAsyncSettings:d});a.success&&a.result?(_(a.result),M(t),A(!0),e?.(a.result,t)):R(a.error||"Failed")}catch(e){R(e instanceof Error?e.message:"Error")}finally{f(!1),y(null)}},[O,k,e,d,W]),H=(0,a.useCallback)(async()=>{const e=O();f(!0),y("suggest");try{const t=await Jn.suggest(e||"Start a friendly chat",d);t.success&&t.result?d?u?.(t.result):r?.(t.result):t.error&&(R(t.error),setTimeout(()=>R(""),3e3))}catch(e){R("Failed to suggest"),setTimeout(()=>R(""),3e3)}finally{f(!1),y(null)}},[O,r,d,u]);(0,a.useEffect)(()=>{if(!d)return window.__CHAT_TOOLS_HANDLERS__={handleSuggest:H,handleTool:e=>q(e),handleSendMessage:z,getState:()=>({showResult:T,result:D,isProcessing:b,showLanguageDropdown:x})},()=>{delete window.__CHAT_TOOLS_HANDLERS__}},[H,q,z,T,D,b,x,d]),(0,a.useEffect)(()=>{if(!d)return;const e=navigator.platform.toUpperCase().indexOf("MAC")>=0,t=t=>{if(!(e?t.ctrlKey:t.altKey))return;if(b)return;if("Enter"===t.key&&T&&D)return t.preventDefault(),void z();let n=!1;switch(t.key){case"1":H(),n=!0;break;case"2":q("spelling"),n=!0;break;case"3":q("translate"),n=!0;break;case"4":q("summarize"),n=!0;break;case"5":q("enlarge"),n=!0;break;case"6":q("friendly"),n=!0;break;case"7":q("formal"),n=!0}n&&(t.preventDefault(),t.stopPropagation())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[d,b,T,D,H,q,z]);(0,a.useCallback)(()=>{D&&(d?u?.(D):r?.(D),A(!1),_(""),M(null))},[D,d,u,r]);const j=Kn.filter(e=>e.name.toLowerCase().includes(S.toLowerCase()));return g||d?a.createElement("div",{className:"wa-ct-container"},a.createElement("style",null,"\n        .wa-ct-container {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          padding: 8px 16px 8px 90px;\n          background: #ffffff;\n          border-bottom: 1px solid #f0f0f0;\n          overflow: visible;\n          position: relative;\n        }\n\n        .wa-ct-btn {\n          display: inline-flex;\n          align-items: center;\n          gap: 4px;\n          padding: 5px 10px;\n          border: 1px solid #e5e7eb;\n          border-radius: 8px;\n          background: #ffffff;\n          color: #52525b;\n          font-size: 11px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.15s;\n          white-space: nowrap;\n          flex-shrink: 0;\n        }\n        .wa-ct-btn:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08);\n          color: var(--lion-primary);\n          border-color: var(--lion-primary);\n        }\n        .wa-ct-btn:active { transform: scale(0.96); }\n        .wa-ct-btn.active { opacity: 0.6; cursor: wait; }\n        .wa-ct-btn svg { width: 13px; height: 13px; flex-shrink: 0; }\n\n        .wa-ct-btn.suggest {\n          background: rgba(var(--lion-primary-rgb), 0.1);\n          color: var(--lion-primary);\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.25);\n          font-weight: 600;\n        }\n        .wa-ct-btn.suggest:hover {\n          background: rgba(var(--lion-primary-rgb), 0.18);\n          color: var(--lion-primary);\n          border-color: var(--lion-primary);\n        }\n\n        .wa-ct-divider {\n          width: 1px;\n          height: 18px;\n          background: #e5e7eb;\n          flex-shrink: 0;\n        }\n\n        .wa-ct-lang-wrap { position: static; }\n\n        .wa-ct-lang-selector {\n          display: flex;\n          align-items: center;\n          gap: 4px;\n          padding: 5px 10px;\n          background: #ffffff;\n          border: 1px solid #e5e7eb;\n          border-radius: 8px;\n          color: #374151;\n          font-size: 11px;\n          cursor: pointer;\n          transition: all 0.15s;\n          white-space: nowrap;\n        }\n        .wa-ct-lang-selector:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08);\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n        .wa-ct-lang-text { max-width: 80px; overflow: hidden; text-overflow: ellipsis; }\n\n        .wa-ct-lang-dropdown {\n          position: fixed;\n          background: #ffffff;\n          border: 1px solid #e5e7eb;\n          border-radius: 12px;\n          box-shadow: 0 12px 30px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.06);\n          width: 220px;\n          max-height: 300px;\n          overflow: hidden;\n          z-index: 999999;\n        }\n\n        .wa-ct-lang-search {\n          padding: 8px;\n          border-bottom: 1px solid #f0f0f0;\n          background: #ffffff;\n          position: sticky;\n          top: 0;\n        }\n        .wa-ct-lang-search input {\n          width: 100%;\n          padding: 6px 10px;\n          border: 1px solid #e5e7eb;\n          border-radius: 8px;\n          background: #ffffff;\n          color: #1f2937;\n          font-size: 12px;\n          outline: none;\n        }\n        .wa-ct-lang-search input:focus { border-color: var(--lion-primary); }\n        .wa-ct-lang-search input::placeholder { color: #9ca3af; }\n\n        .wa-ct-lang-list {\n          max-height: 160px;\n          overflow-y: auto;\n          padding: 4px;\n        }\n        .wa-ct-lang-item {\n          padding: 7px 10px;\n          font-size: 12px;\n          color: #374151;\n          border-radius: 8px;\n          cursor: pointer;\n          transition: background 0.15s;\n        }\n        .wa-ct-lang-item:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08);\n          color: var(--lion-primary);\n        }\n        .wa-ct-lang-item.selected {\n          background: rgba(var(--lion-primary-rgb), 0.12);\n          color: var(--lion-primary);\n        }\n\n        .wa-ct-error {\n          position: absolute;\n          bottom: calc(100% + 4px);\n          left: 10px;\n          right: 10px;\n          padding: 6px 10px;\n          background: var(--lion-error);\n          color: white;\n          font-size: 11px;\n          border-radius: 8px;\n          text-align: center;\n          animation: ctSlideUp 0.2s ease;\n          z-index: 100;\n        }\n\n        .wa-ct-result {\n          position: absolute;\n          bottom: calc(100% + 4px);\n          left: 10px;\n          right: 10px;\n          background: #ffffff;\n          border: 1px solid #e5e7eb;\n          border-radius: 12px;\n          box-shadow: 0 12px 30px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.06);\n          z-index: 100;\n          max-height: 180px;\n          overflow: hidden;\n          display: flex;\n          flex-direction: column;\n        }\n        /* Conversation Summary results are usually longer than text rewrites,\n           so give the panel more room to breathe. Header + footer stay pinned;\n           only the body area scrolls. */\n        .wa-ct-result.tall { max-height: 420px; }\n        .wa-ct-result.tall .wa-ct-result-body { max-height: 320px; flex: 1 1 auto; }\n        .wa-ct-result-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 8px 12px;\n          border-bottom: 1px solid #f0f0f0;\n          flex-shrink: 0;\n        }\n        .wa-ct-result-title {\n          font-size: 11px;\n          font-weight: 600;\n          color: var(--lion-primary);\n          text-transform: uppercase;\n        }\n        .wa-ct-result-close {\n          background: none;\n          border: none;\n          color: #9ca3af;\n          cursor: pointer;\n          padding: 2px;\n          display: flex;\n        }\n        .wa-ct-result-close:hover { color: #52525b; }\n        .wa-ct-result-body {\n          padding: 10px 12px;\n          max-height: 100px;\n          overflow-y: auto;\n          font-size: 12px;\n          color: #374151;\n          line-height: 1.4;\n          white-space: pre-wrap;\n        }\n        .wa-ct-result-actions {\n          display: flex;\n          gap: 8px;\n          padding: 8px 12px;\n          border-top: 1px solid #f0f0f0;\n          flex-shrink: 0;\n          background: #ffffff;\n        }\n        .wa-ct-result-btn {\n          flex: 1;\n          padding: 6px 10px;\n          border: 1px solid #e5e7eb;\n          border-radius: 8px;\n          font-size: 11px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.15s;\n        }\n        .wa-ct-result-btn.copy { background: #ffffff; color: #374151; }\n        .wa-ct-result-btn.copy:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08);\n          color: var(--lion-primary);\n          border-color: var(--lion-primary);\n        }\n        .wa-ct-result-btn.use { background: #ffffff; color: #374151; }\n        .wa-ct-result-btn.use:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08);\n          color: var(--lion-primary);\n          border-color: var(--lion-primary);\n        }\n        .wa-ct-result-btn.send {\n          background: var(--lion-primary);\n          color: white;\n          border: none;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n        }\n        .wa-ct-result-btn.send:hover {\n          transform: translateY(-1px);\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35);\n        }\n\n        .wa-ct-spinner {\n          width: 12px;\n          height: 12px;\n          border: 2px solid transparent;\n          border-top-color: currentColor;\n          border-radius: 50%;\n          animation: ctSpin 0.7s linear infinite;\n        }\n\n        @keyframes ctSpin { to { transform: rotate(360deg); } }\n        @keyframes ctSlideUp {\n          from { opacity: 0; transform: translateY(4px); }\n          to { opacity: 1; transform: translateY(0); }\n        }\n\n        /* ============================================================ */\n        /* ============== DARK MODE (WhatsApp dark theme) ============= */\n        /* Applied via .lion-dark class on <html>/<body>. CSS cascade   */\n        /* handles live theme-change re-render automatically.           */\n        /* ============================================================ */\n\n        .lion-dark .wa-ct-container {\n          background: #1a1a1a;\n          border-bottom: 1px solid #2a2a2a;\n        }\n\n        .lion-dark .wa-ct-btn {\n          background: #262626;\n          border: 1px solid #3a3a3a;\n          color: #e5e7eb;\n        }\n        .lion-dark .wa-ct-btn:hover {\n          background: rgba(var(--lion-primary-rgb), 0.12);\n          color: var(--lion-primary);\n          border-color: var(--lion-primary);\n        }\n\n        .lion-dark .wa-ct-btn.suggest {\n          background: rgba(var(--lion-primary-rgb), 0.14);\n          color: var(--lion-primary);\n          border: 1px solid rgba(var(--lion-primary-rgb), 0.35);\n        }\n        .lion-dark .wa-ct-btn.suggest:hover {\n          background: rgba(var(--lion-primary-rgb), 0.22);\n          color: var(--lion-primary);\n          border-color: var(--lion-primary);\n        }\n\n        .lion-dark .wa-ct-divider {\n          background: #3a3a3a;\n        }\n\n        .lion-dark .wa-ct-lang-selector {\n          background: #262626;\n          border: 1px solid #3a3a3a;\n          color: #e5e7eb;\n        }\n        .lion-dark .wa-ct-lang-selector:hover {\n          background: rgba(var(--lion-primary-rgb), 0.12);\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n\n        .lion-dark .wa-ct-lang-dropdown {\n          background: #1f1f1f;\n          border: 1px solid #3a3a3a;\n          box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.3);\n        }\n\n        .lion-dark .wa-ct-lang-search {\n          background: #1f1f1f;\n          border-bottom: 1px solid #2a2a2a;\n        }\n        .lion-dark .wa-ct-lang-search input {\n          background: #262626;\n          border: 1px solid #3a3a3a;\n          color: #e5e7eb;\n        }\n        .lion-dark .wa-ct-lang-search input::placeholder {\n          color: #6b7280;\n        }\n\n        .lion-dark .wa-ct-lang-item {\n          color: #e5e7eb;\n        }\n        .lion-dark .wa-ct-lang-item:hover {\n          background: rgba(var(--lion-primary-rgb), 0.12);\n          color: var(--lion-primary);\n        }\n        .lion-dark .wa-ct-lang-item.selected {\n          background: rgba(var(--lion-primary-rgb), 0.18);\n          color: var(--lion-primary);\n        }\n\n        .lion-dark .wa-ct-result {\n          background: #1f1f1f;\n          border: 1px solid #3a3a3a;\n          box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.3);\n        }\n        .lion-dark .wa-ct-result-header {\n          border-bottom: 1px solid #2a2a2a;\n        }\n        .lion-dark .wa-ct-result-body {\n          color: #e5e7eb;\n        }\n        .lion-dark .wa-ct-result-close {\n          color: #6b7280;\n        }\n        .lion-dark .wa-ct-result-close:hover {\n          color: #e5e7eb;\n        }\n        .lion-dark .wa-ct-result-actions {\n          border-top: 1px solid #2a2a2a;\n          background: #1f1f1f;\n        }\n        .lion-dark .wa-ct-result-btn.copy,\n        .lion-dark .wa-ct-result-btn.use {\n          background: #262626;\n          color: #e5e7eb;\n          border: 1px solid #3a3a3a;\n        }\n        .lion-dark .wa-ct-result-btn.copy:hover,\n        .lion-dark .wa-ct-result-btn.use:hover {\n          background: rgba(var(--lion-primary-rgb), 0.12);\n          color: var(--lion-primary);\n          border-color: var(--lion-primary);\n        }\n      "),I&&a.createElement("div",{className:"wa-ct-error"},I),T&&D&&a.createElement("div",{className:"wa-ct-result "+("conversationSummary"===N?"tall":"")},a.createElement("div",{className:"wa-ct-result-header"},a.createElement("span",{className:"wa-ct-result-title"},"conversationSummary"===N?(0,s.t)("chatTools.conversationSummaryResultTitle")||"Conversation Summary":(0,s.t)("chatTools.aiResult")),a.createElement("button",{className:"wa-ct-result-close",onClick:()=>{A(!1),M(null)}},a.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},a.createElement("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})))),a.createElement("div",{className:"wa-ct-result-body",dir:"auto"},D),a.createElement("div",{className:"wa-ct-result-actions"},a.createElement("button",{className:"wa-ct-result-btn copy",onClick:()=>navigator.clipboard.writeText(D)},(0,s.t)("chatTools.copy")),"conversationSummary"!==N&&a.createElement("button",{className:"wa-ct-result-btn send",onClick:z,title:`${(0,s.t)("chatTools.sendTitle")} (${Oh()}+Return)`},(0,s.t)("chatTools.send")))),a.createElement("button",{className:"wa-ct-btn suggest "+("suggest"===v?"active":""),onClick:H,disabled:b,title:`${(0,s.t)("chatTools.suggestTitle")} (${Oh()}+1)`},"suggest"===v?a.createElement("div",{className:"wa-ct-spinner"}):a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7z"})),(0,s.t)("chatTools.suggest")),a.createElement("div",{className:"wa-ct-divider"}),a.createElement("button",{className:"wa-ct-btn "+("spelling"===v?"active":""),onClick:()=>q("spelling"),disabled:b,title:`${(0,s.t)("chatTools.spellingTitle")} (${Oh()}+2)`},"spelling"===v?a.createElement("div",{className:"wa-ct-spinner"}):a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M12.45 16h2.09L9.43 3H7.57L2.46 16h2.09l1.12-3h5.64l1.14 3zm-6.02-5L8.5 5.48 10.57 11H6.43zm15.16.59l-8.09 8.09L9.83 16l-1.41 1.41 5.09 5.09L23 13l-1.41-1.41z"})),(0,s.t)("chatTools.spelling")),a.createElement("button",{className:"wa-ct-btn "+("translate"===v?"active":""),onClick:()=>q("translate"),disabled:b,title:`${(0,s.t)("chatTools.translateTitle")} ${k} (${Oh()}+3)`},"translate"===v?a.createElement("div",{className:"wa-ct-spinner"}):a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03A17.52 17.52 0 0014.07 6H17V4h-7V2H8v2H1v2h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"})),(0,s.t)("chatTools.translate")),a.createElement("div",{className:"wa-ct-lang-wrap",ref:U},a.createElement("div",{ref:F,className:"wa-ct-lang-selector",onClick:()=>{if(!x&&F.current){const e=F.current.getBoundingClientRect();P({top:e.top-310,left:e.left})}w(!x)}},a.createElement("span",{className:"wa-ct-lang-text"},k),a.createElement("svg",{viewBox:"0 0 24 24",width:"12",height:"12"},a.createElement("path",{fill:"currentColor",d:"M7 10l5 5 5-5z"}))),x&&a.createElement("div",{className:"wa-ct-lang-dropdown",style:{top:B.top,left:B.left}},a.createElement("div",{className:"wa-ct-lang-search"},a.createElement("input",{type:"text",placeholder:(0,s.t)("chatTools.searchLanguage"),value:S,onChange:e=>C(e.target.value),autoFocus:!0})),a.createElement("div",{className:"wa-ct-lang-list"},j.map(e=>a.createElement("div",{key:e.code,className:"wa-ct-lang-item "+(k===e.name?"selected":""),onClick:()=>{E(e.name),w(!1),C(""),c?.(e.name),window.dispatchEvent(new CustomEvent("crm-language-changed",{detail:{contactId:i,language:e.name}}))}},e.name))))),a.createElement("div",{className:"wa-ct-divider"}),a.createElement("button",{className:"wa-ct-btn "+("summarize"===v?"active":""),onClick:()=>q("summarize"),disabled:b,title:`${(0,s.t)("chatTools.summarizeTitle")} (${Oh()}+4)`},"summarize"===v?a.createElement("div",{className:"wa-ct-spinner"}):a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M14 17H4v2h10v-2zm6-8H4v2h16V9zM4 15h16v-2H4v2zM4 5v2h16V5H4z"})),(0,s.t)("chatTools.summarize")),a.createElement("button",{className:"wa-ct-btn "+("enlarge"===v?"active":""),onClick:()=>q("enlarge"),disabled:b,title:`${(0,s.t)("chatTools.enlargeTitle")} (${Oh()}+5)`},"enlarge"===v?a.createElement("div",{className:"wa-ct-spinner"}):a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M4 4h6v2H4v4H2V6c0-1.1.9-2 2-2zm16 0c1.1 0 2 .9 2 2v4h-2V6h-6V4h6zM4 14H2v4c0 1.1.9 2 2 2h6v-2H4v-4zm16 4v-4h2v4c0 1.1-.9 2-2 2h-6v-2h6z"})),(0,s.t)("chatTools.enlarge")),a.createElement("div",{className:"wa-ct-divider"}),a.createElement("button",{className:"wa-ct-btn "+("friendly"===v?"active":""),onClick:()=>q("friendly"),disabled:b,title:`${(0,s.t)("chatTools.friendlyTitle")} (${Oh()}+6)`},"friendly"===v?a.createElement("div",{className:"wa-ct-spinner"}):a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z"})),(0,s.t)("chatTools.friendly")),a.createElement("button",{className:"wa-ct-btn "+("formal"===v?"active":""),onClick:()=>q("formal"),disabled:b,title:`${(0,s.t)("chatTools.formalTitle")} (${Oh()}+7)`},"formal"===v?a.createElement("div",{className:"wa-ct-spinner"}):a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M12 3L1 9l4 2.18v6L12 21l7-3.82v-6l2-1.09V17h2V9L12 3zm6.82 6L12 12.72 5.18 9 12 5.28 18.82 9zM17 15.99l-5 2.73-5-2.73v-3.72L12 15l5-2.73v3.72z"})),(0,s.t)("chatTools.formal")),!d&&!!i&&a.createElement("button",{className:"wa-ct-btn "+("conversationSummary"===v?"active":""),onClick:()=>q("conversationSummary"),disabled:b,title:`${(0,s.t)("chatTools.conversationSummaryTitle")||"Summarize this conversation"} (${Oh()}+8)`},"conversationSummary"===v?a.createElement("div",{className:"wa-ct-spinner"}):a.createElement("svg",{viewBox:"0 0 24 24"},a.createElement("path",{fill:"currentColor",d:"M21 6h-2v9H6v2c0 .55.45 1 1 1h11l4 4V7c0-.55-.45-1-1-1zm-4 6V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14l4-4h10c.55 0 1-.45 1-1z"})),"conversationSummary"===v?(0,s.t)("chatTools.conversationSummarizing")||"Summarizing chat…":(0,s.t)("chatTools.conversationSummary")||"Chat Summary")):null};let qh=null,Hh=null,jh=!1,Vh=!1,Gh=null,Kh="English",$h=!1;const Yh=async()=>{try{return await wu(["basic","advanced","advance","premium"])}catch(e){return!1}},Xh=()=>document.querySelector("#main footer"),Jh=()=>{const e=document.querySelector('#main footer [contenteditable="true"]')||document.querySelector('[data-tab="10"]')||document.querySelector('footer [role="textbox"]')||document.querySelector('footer div[contenteditable="true"]');if(e){return(e.textContent||e.innerText||"").trim()}return""},Qh=async e=>{const t=document.querySelector('#main footer [contenteditable="true"]')||document.querySelector('[data-tab="10"]')||document.querySelector('footer [role="textbox"]')||document.querySelector('footer div[contenteditable="true"]');if(t){if(t.focus(),!e){const e=window.getSelection(),n=document.createRange();return n.selectNodeContents(t),e?.removeAllRanges(),e?.addRange(n),t.dispatchEvent(new KeyboardEvent("keydown",{key:"a",code:"KeyA",keyCode:65,which:65,ctrlKey:!0,bubbles:!0,cancelable:!0})),void setTimeout(()=>{document.execCommand("delete",!1),t.innerHTML="";const e=document.createElement("p");e.innerHTML="<br>",t.appendChild(e),t.dispatchEvent(new KeyboardEvent("keydown",{key:"Backspace",code:"Backspace",keyCode:8,which:8,bubbles:!0,cancelable:!0})),t.dispatchEvent(new InputEvent("input",{bubbles:!0,cancelable:!0,inputType:"deleteContentBackward",data:null})),t.dispatchEvent(new CompositionEvent("compositionend",{bubbles:!0,data:""}))},10)}document.execCommand("selectAll",!1);try{const t=await navigator.clipboard.readText().catch(()=>"");await navigator.clipboard.writeText(e),document.execCommand("paste"),setTimeout(async()=>{try{await navigator.clipboard.writeText(t)}catch(e){}},100)}catch(t){document.execCommand("insertText",!1,e)}t.dispatchEvent(new Event("input",{bubbles:!0}))}},Zh=()=>{const e=window.getSelection();return e&&e.toString().trim()?e.toString().trim():""},eb=(e,t)=>{},tb=()=>new Promise(e=>{const t=setTimeout(()=>{e(null)},2e3),n=a=>{if("CHAT_TOOLS_CHAT_ID_RESPONSE"===a.data?.type){clearTimeout(t),window.removeEventListener("message",n);const r=a.data.payload?.chatId||null;e(r)}};window.addEventListener("message",n),window.postMessage({type:"CHAT_TOOLS_GET_CHAT_ID"},"*")}),nb=e=>{const t=Ea.appendSignature(e);window.postMessage({type:"CHAT_TOOLS_SEND_MESSAGE",payload:{message:t}},"*")},ab=async()=>{if(Gn.isEnabled()){if(Vh){jh=!0;try{const e=Xh();if(!e)return;if(document.getElementById("wa-chat-tools-container"))return;const t=e.querySelector("._ak1r"),n=document.createElement("div");if(n.id="wa-chat-tools-container",t)n.style.cssText="\n        width: 100%;\n        flex-basis: 100%;\n        order: -1;\n        z-index: 100;\n      ",t.style.flexWrap="wrap",t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n);else{const t=e.querySelector('[contenteditable="true"]');let a=null;if(t){let n=t.parentElement;for(;n&&n!==e;){if(n.parentElement===e){a=n;break}n=n.parentElement}}n.style.cssText="\n        display: block;\n        width: 100%;\n        z-index: 100;\n        flex: none;\n      ",a&&a.parentElement?a.parentElement.insertBefore(n,a):e.firstChild?e.insertBefore(n,e.firstChild):e.appendChild(n)}const r=await tb();Gh=r,Kh=Gh?(e=>{try{const t=v.getContact(e);if(t?.profile?.language)return t.profile.language}catch(e){}return"English"})(Gh):"English";const i=e=>{Kh=e,Gh&&((e,t)=>{try{const n=e.replace("@c.us","").replace("@g.us","");v.getOrCreateContact(e,"",n),v.updateProfile(e,{language:t}),v.getContact(e)}catch(e){}})(Gh,e)};qh=o.createRoot(n),qh.render(a.createElement(Wh,{onResult:eb,getSelectedText:Zh,getInputText:Jh,setInputText:Qh,sendMessage:nb,contactId:Gh||void 0,initialLanguage:Kh,onLanguageChange:i}))}catch(e){}finally{setTimeout(()=>{jh=!1},200)}}}else rb()},rb=()=>{const e=document.getElementById("wa-chat-tools-container");e&&(qh&&(qh.unmount(),qh=null),e.remove())},ob=async()=>{if((()=>{if($h)return;$h=!0;const e=navigator.platform.toUpperCase().indexOf("MAC")>=0||navigator.userAgent.toUpperCase().indexOf("MAC")>=0;window.addEventListener("keydown",t=>{if(!(e?t.ctrlKey:t.altKey))return;if(e&&(t.altKey||t.metaKey))return;if(!e&&(t.metaKey||t.ctrlKey))return;if(!Gn.isEnabled())return;const n=window.__CHAT_TOOLS_HANDLERS__;if(!n)return;const a=n.getState();if("Enter"===t.key&&a.showResult&&a.result)return t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),void n.handleSendMessage();if(a.isProcessing||a.showLanguageDropdown)return;let r=!1;switch(t.key){case"1":n.handleSuggest(),r=!0;break;case"2":n.handleTool("spelling"),r=!0;break;case"3":n.handleTool("translate"),r=!0;break;case"4":n.handleTool("summarize"),r=!0;break;case"5":n.handleTool("enlarge"),r=!0;break;case"6":n.handleTool("friendly"),r=!0;break;case"7":n.handleTool("formal"),r=!0;break;case"8":n.handleTool("conversationSummary"),r=!0}r&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())},!0)})(),window.addEventListener("message",e=>{e.source===window&&"CHAT_TOOLS_MESSAGE_SENT"===e.data?.type&&(()=>{const e=document.querySelector('#main footer [contenteditable="true"]')||document.querySelector('[data-tab="10"]')||document.querySelector('footer [role="textbox"]')||document.querySelector('footer div[contenteditable="true"]');if(e){e.focus();const t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t?.removeAllRanges(),t?.addRange(n),e.dispatchEvent(new KeyboardEvent("keydown",{key:"a",code:"KeyA",keyCode:65,which:65,ctrlKey:!0,bubbles:!0,cancelable:!0})),setTimeout(()=>{document.execCommand("delete",!1),e.innerHTML="";const t=document.createElement("p");t.innerHTML="<br>",e.appendChild(t),e.dispatchEvent(new KeyboardEvent("keydown",{key:"Backspace",code:"Backspace",keyCode:8,which:8,bubbles:!0,cancelable:!0})),e.dispatchEvent(new KeyboardEvent("keyup",{key:"Backspace",code:"Backspace",keyCode:8,which:8,bubbles:!0,cancelable:!0})),e.dispatchEvent(new InputEvent("input",{bubbles:!0,cancelable:!0,inputType:"deleteContentBackward",data:null})),e.dispatchEvent(new CompositionEvent("compositionend",{bubbles:!0,data:""}))},10)}})()}),Vh=await Yh(),!Vh)return void setInterval(async()=>{const e=Vh;Vh=await Yh(),!e&&Vh&&ab()},1e4);const e=()=>{Xh()&&Gn.isEnabled()&&ab()};setTimeout(e,2e3),setTimeout(e,4e3),setTimeout(e,6e3),Hh=new MutationObserver(async()=>{if(jh)return;const e=Xh(),t=document.getElementById("wa-chat-tools-container");if(e&&!t&&Gn.isEnabled())ab();else if(t&&!Gn.isEnabled())rb();else if(e&&t&&Gn.isEnabled()){const e=await tb();e&&e!==Gh&&(rb(),ab())}});const t=document.querySelector("#app");t&&Hh.observe(t,{childList:!0,subtree:!0}),setInterval(()=>{if(jh)return;const e=Xh(),t=document.getElementById("wa-chat-tools-container");e&&!t&&Gn.isEnabled()?ab():t&&!Gn.isEnabled()&&rb()},2e3),window.addEventListener("storage",e=>{"wa_ai_settings"===e.key&&(Gn.isEnabled()?ab():rb())}),window.addEventListener("aiSettingsChanged",()=>{Gn.isEnabled()?ab():rb()})},ib=({onNavigateToChat:e})=>{const[t,r]=(0,a.useState)(!1),[o,i]=(0,a.useState)([]),[l,c]=(0,a.useState)([]),[d,m]=(0,a.useState)([]),[p,u]=(0,a.useState)(!1),[g,h]=(0,a.useState)(!1),[,b]=(0,a.useState)(0),f=(0,a.useRef)(null),v=(0,a.useRef)(new Set);(0,a.useEffect)(()=>{const e=()=>b(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{u(Tg.isAgentMode());const e=()=>{u(Tg.isAgentMode())};return window.addEventListener("agentSettingsChanged",e),()=>window.removeEventListener("agentSettingsChanged",e)},[]),(0,a.useEffect)(()=>{const e=e=>{if("INCOMING_TRANSFERS"===e.type){const t=e.transfers||[],n=e.activeServices||[],a=e.sentTransfers||[],r=new Set(t.map(e=>e.id));v.current=r,i(t.filter(e=>"pending"===e.status||"accepted"===e.status)),c(n),m(a)}};return n().runtime.onMessage.addListener(e),()=>n().runtime.onMessage.removeListener(e)},[]),(0,a.useEffect)(()=>{const e=e=>{f.current&&!f.current.contains(e.target)&&r(!1)};return t&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[t]);const y=e=>{switch(e){case"urgent":return ca.error;case"high":return ca.primary;case"medium":return ca.warning;case"low":return ca.success;default:return ca.textMuted}},x=e=>{let t=e;!e||e.includes("Z")||e.includes("+")||(t=e.replace(" ","T")+"Z");return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})};if(!p)return null;const w=o.length+l.length+d.length,k=e=>{switch(e){case"pending":return ca.warning;case"accepted":return ca.info;case"declined":return ca.error;case"in_service":case"completed":return ca.success;case"cancelled":return ca.textMuted;default:return ca.sidebarTextMuted}};return a.createElement(a.Fragment,null,a.createElement("style",null,"\n        .sq-widget {\n          position: fixed;\n          bottom: 80px;\n          right: 20px;\n          z-index: 9999;\n          font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n          pointer-events: auto;\n        }\n        .sq-badge {\n          width: 56px;\n          height: 56px;\n          border-radius: 50%;\n          background: var(--lion-primary);\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb), 0.4);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          transition: all 0.2s;\n          position: relative;\n        }\n        .sq-badge:hover {\n          transform: scale(1.05);\n          box-shadow: 0 6px 16px rgba(var(--lion-primary-rgb), 0.5);\n        }\n        .sq-badge-icon {\n          color: white;\n        }\n        .sq-count {\n          position: absolute;\n          top: -4px;\n          right: -4px;\n          min-width: 22px;\n          height: 22px;\n          background: #ef4444;\n          border-radius: 11px;\n          color: white;\n          font-size: 12px;\n          font-weight: 600;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          padding: 0 6px;\n          animation: sq-pulse 2s infinite;\n        }\n        @keyframes sq-pulse {\n          0%, 100% { transform: scale(1); }\n          50% { transform: scale(1.1); }\n        }\n        .sq-panel {\n          position: absolute;\n          bottom: 70px;\n          right: 0;\n          width: 340px;\n          max-height: 450px;\n          background: #111b21;\n          border: 1px solid #2a3942;\n          border-radius: 12px;\n          box-shadow: 0 8px 32px rgba(0,0,0,0.5);\n          overflow: hidden;\n        }\n        .sq-header {\n          padding: 16px;\n          border-bottom: 1px solid #2a3942;\n          background: #202c33;\n        }\n        .sq-title {\n          color: #e9edef;\n          font-size: 16px;\n          font-weight: 600;\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n        .sq-content {\n          max-height: 350px;\n          overflow-y: auto;\n        }\n        .sq-section {\n          padding: 12px 16px;\n        }\n        .sq-section-title {\n          color: #8696a0;\n          font-size: 11px;\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n          margin-bottom: 10px;\n          display: flex;\n          align-items: center;\n          gap: 6px;\n        }\n        .sq-item {\n          background: #202c33;\n          border-radius: 8px;\n          padding: 12px;\n          margin-bottom: 8px;\n        }\n        .sq-item-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          margin-bottom: 8px;\n        }\n        .sq-item-name {\n          color: #e9edef;\n          font-size: 14px;\n          font-weight: 500;\n        }\n        .sq-priority {\n          padding: 2px 8px;\n          border-radius: 4px;\n          font-size: 10px;\n          font-weight: 600;\n          text-transform: uppercase;\n        }\n        .sq-item-meta {\n          color: #8696a0;\n          font-size: 12px;\n          margin-bottom: 8px;\n        }\n        .sq-item-reason {\n          color: #aebac1;\n          font-size: 12px;\n          font-style: italic;\n          margin-bottom: 10px;\n          padding: 8px;\n          background: rgba(255,255,255,0.05);\n          border-radius: 6px;\n        }\n        .sq-item-actions {\n          display: flex;\n          gap: 8px;\n        }\n        .sq-btn {\n          flex: 1;\n          padding: 8px 12px;\n          border: none;\n          border-radius: 6px;\n          font-size: 12px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n        .sq-btn-accept {\n          background: var(--lion-success);\n          color: white;\n        }\n        .sq-btn-accept:hover { background: var(--lion-success); filter: brightness(0.9); }\n        .sq-btn-decline {\n          background: #3b4a54;\n          color: #e9edef;\n        }\n        .sq-btn-decline:hover { background: #4a5c68; }\n        .sq-btn-start {\n          background: var(--lion-primary);\n          color: white;\n        }\n        .sq-btn-start:hover { background: var(--lion-primary-hover); }\n        .sq-btn-end {\n          background: var(--lion-error);\n          color: white;\n        }\n        .sq-btn-end:hover { background: var(--lion-error); filter: brightness(0.9); }\n        .sq-btn:disabled {\n          opacity: 0.5;\n          cursor: not-allowed;\n        }\n        .sq-empty {\n          padding: 30px 20px;\n          text-align: center;\n          color: #8696a0;\n        }\n        .sq-empty-icon {\n          margin-bottom: 12px;\n          opacity: 0.5;\n        }\n\n        /* Notification Popup */\n        .sq-notification {\n          position: fixed;\n          top: 20px;\n          right: 20px;\n          width: 360px;\n          background: #111b21;\n          border: 2px solid var(--lion-primary);\n          border-radius: 12px;\n          box-shadow: 0 8px 32px rgba(0,0,0,0.6);\n          z-index: 2147483647;\n          animation: sq-slide-in 0.3s ease-out;\n          pointer-events: auto;\n        }\n        @keyframes sq-slide-in {\n          from { transform: translateX(100%); opacity: 0; }\n          to { transform: translateX(0); opacity: 1; }\n        }\n        .sq-notif-header {\n          padding: 14px 16px;\n          background: var(--lion-primary);\n          border-radius: 10px 10px 0 0;\n          display: flex;\n          align-items: center;\n          gap: 10px;\n        }\n        .sq-notif-title {\n          color: white;\n          font-size: 15px;\n          font-weight: 600;\n          flex: 1;\n        }\n        .sq-notif-close {\n          background: none;\n          border: none;\n          color: white;\n          cursor: pointer;\n          padding: 4px;\n          opacity: 0.8;\n        }\n        .sq-notif-close:hover { opacity: 1; }\n        .sq-notif-body {\n          padding: 16px;\n        }\n        .sq-notif-chat {\n          color: #e9edef;\n          font-size: 16px;\n          font-weight: 500;\n          margin-bottom: 8px;\n        }\n        .sq-notif-from {\n          color: #8696a0;\n          font-size: 13px;\n          margin-bottom: 12px;\n        }\n        .sq-notif-reason {\n          background: #202c33;\n          padding: 10px 12px;\n          border-radius: 8px;\n          color: #aebac1;\n          font-size: 13px;\n          font-style: italic;\n          margin-bottom: 16px;\n        }\n        .sq-notif-actions {\n          display: flex;\n          gap: 10px;\n        }\n      "),a.createElement("div",{className:"sq-widget",ref:f},a.createElement("div",{className:"sq-badge",onClick:()=>r(!t)},a.createElement("svg",{className:"sq-badge-icon",width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"9",cy:"7",r:"4"}),a.createElement("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),a.createElement("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})),w>0&&a.createElement("span",{className:"sq-count"},w)),t&&a.createElement("div",{className:"sq-panel"},a.createElement("div",{className:"sq-header"},a.createElement("div",{className:"sq-title"},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--lion-primary)",strokeWidth:"2"},a.createElement("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"})),(0,s.t)("agent.serviceQueue")||"Service Queue")),a.createElement("div",{className:"sq-content"},0===w?a.createElement("div",{className:"sq-empty"},a.createElement("div",{className:"sq-empty-icon"},a.createElement("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("path",{d:"M8 15h8M9 9h.01M15 9h.01"}))),a.createElement("div",null,(0,s.t)("agent.noActiveServices")||"No active services or pending transfers")):a.createElement(a.Fragment,null,o.length>0&&a.createElement("div",{className:"sq-section"},a.createElement("div",{className:"sq-section-title"},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("polyline",{points:"12,6 12,12 16,14"})),(0,s.t)("agent.pendingTransfers")||"Pending Transfers"," (",o.length,")"),o.map(t=>a.createElement("div",{key:t.id,className:"sq-item"},a.createElement("div",{className:"sq-item-header"},a.createElement("span",{className:"sq-item-name"},t.chat_name||t.chat_id),a.createElement("span",{className:"sq-priority",style:{background:`${y(t.priority)}20`,color:y(t.priority)}},(e=>{switch(e){case"urgent":return(0,s.t)("agent.priorityUrgent")||"Urgent";case"high":return(0,s.t)("agent.priorityHigh")||"High";case"medium":return(0,s.t)("agent.priorityMedium")||"Medium";case"low":return(0,s.t)("agent.priorityLow")||"Low";default:return e}})(t.priority))),a.createElement("div",{className:"sq-item-meta"},(0,s.t)("agent.from")||"From",": ",t.from_agent_name," • ",x(t.created_at)),t.reason&&a.createElement("div",{className:"sq-item-reason"},'"',t.reason,'"'),a.createElement("div",{className:"sq-item-actions"},"pending"===t.status?a.createElement(a.Fragment,null,a.createElement("button",{className:"sq-btn sq-btn-accept",onClick:()=>(async e=>{h(!0);try{await n().runtime.sendMessage({type:"TRANSFER_ACCEPT",transferId:e})}catch(e){}finally{h(!1)}})(t.id),disabled:g},(0,s.t)("agent.accept")||"Accept"),a.createElement("button",{className:"sq-btn sq-btn-decline",onClick:()=>(async e=>{h(!0);try{await n().runtime.sendMessage({type:"TRANSFER_DECLINE",transferId:e})}catch(e){}finally{h(!1)}})(t.id),disabled:g},(0,s.t)("agent.decline")||"Decline")):a.createElement("button",{className:"sq-btn sq-btn-start",onClick:()=>(async(t,a)=>{h(!0);try{(await n().runtime.sendMessage({type:"TRANSFER_START_SERVICE",transferId:t})).success&&(e&&e(a),r(!1))}catch(e){}finally{h(!1)}})(t.id,t.chat_id),disabled:g},(0,s.t)("agent.startService")||"Start Service"))))),l.length>0&&a.createElement("div",{className:"sq-section"},a.createElement("div",{className:"sq-section-title"},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:ca.success,strokeWidth:"2"},a.createElement("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),a.createElement("polyline",{points:"22,4 12,14.01 9,11.01"})),(0,s.t)("agent.activeServices")||"Active Services"," (",l.length,")"),l.map(e=>a.createElement("div",{key:e.id,className:"sq-item"},a.createElement("div",{className:"sq-item-header"},a.createElement("span",{className:"sq-item-name"},e.chat_name||e.chat_id),a.createElement("span",{className:"sq-priority",style:{background:"var(--lion-success)20",color:ca.success}},(0,s.t)("agent.statusInService")||"In Service")),a.createElement("div",{className:"sq-item-meta"},(0,s.t)("agent.from")||"From",": ",e.from_agent_name," • ",(0,s.t)("agent.started")||"Started",": ",x(e.started_at)),a.createElement("div",{className:"sq-item-actions"},a.createElement("button",{className:"sq-btn sq-btn-end",onClick:()=>(async(e,t)=>{h(!0);try{(await n().runtime.sendMessage({type:"TRANSFER_END_SERVICE",transferId:e,chatId:t})).success&&window.postMessage({type:"UNPIN_CHAT",chatId:t},"*")}catch(e){}finally{h(!1)}})(e.id,e.chat_id),disabled:g},(0,s.t)("agent.endService")||"End Service"))))),d.length>0&&a.createElement("div",{className:"sq-section"},a.createElement("div",{className:"sq-section-title"},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--lion-primary)",strokeWidth:"2"},a.createElement("path",{d:"M22 2L11 13"}),a.createElement("path",{d:"M22 2l-7 20-4-9-9-4 20-7z"})),(0,s.t)("agent.sentTransfers")||"Sent Transfers"," (",d.length,")"),d.map(e=>a.createElement("div",{key:e.id,className:"sq-item"},a.createElement("div",{className:"sq-item-header"},a.createElement("span",{className:"sq-item-name"},e.chat_name||e.chat_id),a.createElement("span",{className:"sq-priority",style:{background:`${k(e.status)}20`,color:k(e.status)}},(e=>{switch(e){case"pending":return(0,s.t)("agent.statusPending")||"Pending";case"accepted":return(0,s.t)("agent.statusAccepted")||"Accepted";case"declined":return(0,s.t)("agent.statusDeclined")||"Declined";case"in_service":return(0,s.t)("agent.statusInService")||"In Service";case"completed":return(0,s.t)("agent.statusCompleted")||"Completed";case"cancelled":return(0,s.t)("agent.statusCancelled")||"Cancelled";default:return e}})(e.status))),a.createElement("div",{className:"sq-item-meta"},(0,s.t)("agent.to")||"To",": ",e.to_agent_name," • ",x(e.created_at)),e.reason&&a.createElement("div",{className:"sq-item-reason",style:{fontSize:"11px",color:"#8696a0",marginTop:"4px",fontStyle:"italic"}},'"',e.reason,'"')))))))))};let sb=null,lb=null,cb=null,db=!1,mb=!1;const pb=async()=>{try{return await wu(["basic","advanced","advance","premium"])}catch(e){return!1}},ub=()=>{const[e,t]=(0,a.useState)(!1),[r,o]=(0,a.useState)(""),[i,l]=(0,a.useState)(!1),[,c]=(0,a.useState)(0),d=(0,a.useRef)(null),[m,p]=(0,a.useState)(!1),[u,g]=(0,a.useState)(""),[h,b]=(0,a.useState)(!1);(0,a.useEffect)(()=>{const e=Ea.getSettings();o(e.signature),l(e.enabled);const t=Tg.getSettings();p(t.enabled),g(t.agentName)},[]),(0,a.useEffect)(()=>{const e=()=>c(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{const e=()=>{t(!0)};return window.addEventListener("openSignatureModal",e),()=>window.removeEventListener("openSignatureModal",e)},[]),(0,a.useEffect)(()=>{const n=e=>{d.current&&!d.current.contains(e.target)&&t(!1)};return e&&document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[e]);return a.createElement(a.Fragment,null,a.createElement("style",null,`\n        .wa-signature-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 36px;\n          height: 36px;\n          border: 1px solid ${i?"var(--lion-primary)":"#e5e7eb"};\n          border-radius: 10px;\n          background: ${i?"rgba(var(--lion-primary-rgb), 0.1)":"#ffffff"};\n          color: ${i?"var(--lion-primary)":"#52525b"};\n          cursor: pointer;\n          transition: all 0.15s;\n          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n        }\n        .wa-signature-btn:hover {\n          background: rgba(var(--lion-primary-rgb), 0.08);\n          border-color: var(--lion-primary);\n          color: var(--lion-primary);\n        }\n        .wa-signature-btn svg {\n          width: 18px;\n          height: 18px;\n        }\n\n        .wa-signature-backdrop {\n          position: fixed;\n          inset: 0;\n          background: rgba(0, 0, 0, 0.55);\n          backdrop-filter: blur(6px);\n          -webkit-backdrop-filter: blur(6px);\n          z-index: 999998;\n          animation: waSigFade 0.15s ease;\n        }\n        @keyframes waSigFade {\n          from { opacity: 0; }\n          to { opacity: 1; }\n        }\n        .wa-signature-modal {\n          position: fixed;\n          top: 50%;\n          left: 50%;\n          transform: translate(-50%, -50%);\n          background: #ffffff;\n          border: 1px solid #e5e7eb;\n          border-radius: 16px;\n          padding: 20px;\n          width: 440px;\n          max-width: 92vw;\n          max-height: 85vh;\n          overflow-y: auto;\n          box-shadow: 0 25px 80px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0,0,0,0.05);\n          z-index: 999999;\n          box-sizing: border-box;\n          animation: waSigSlide 0.2s ease;\n        }\n        @keyframes waSigSlide {\n          from { opacity: 0; transform: translate(-50%, -48%); }\n          to { opacity: 1; transform: translate(-50%, -50%); }\n        }\n        .wa-signature-modal * {\n          box-sizing: border-box;\n        }\n        .wa-signature-modal-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          margin-bottom: 12px;\n        }\n        .wa-signature-modal-title {\n          color: #1f2937;\n          font-size: 14px;\n          font-weight: 700;\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n        .wa-signature-modal-title svg {\n          width: 16px;\n          height: 16px;\n          color: var(--lion-primary);\n        }\n        .wa-signature-modal-close {\n          background: #ffffff;\n          border: 1px solid #e5e7eb;\n          color: #52525b;\n          cursor: pointer;\n          width: 26px;\n          height: 26px;\n          padding: 0;\n          border-radius: 8px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          transition: all 0.15s;\n        }\n        .wa-signature-modal-close:hover {\n          background: rgba(239, 68, 68, 0.1);\n          border-color: rgba(239, 68, 68, 0.3);\n          color: #ef4444;\n        }\n\n        .wa-signature-section-label {\n          font-size: 11px;\n          font-weight: 700;\n          color: var(--lion-primary);\n          text-transform: uppercase;\n          letter-spacing: 0.5px;\n          margin-bottom: 8px;\n          padding: 0 2px;\n        }\n\n        .wa-signature-toggle-row {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          margin-bottom: 8px;\n          padding: 10px 12px;\n          background: #fafafa;\n          border: 1px solid #f0f0f0;\n          border-radius: 10px;\n        }\n        .wa-signature-toggle-label {\n          color: #374151;\n          font-size: 13px;\n          font-weight: 500;\n        }\n        .wa-signature-toggle {\n          position: relative;\n          width: 40px;\n          height: 22px;\n          background: #e5e7eb;\n          border-radius: 11px;\n          cursor: pointer;\n          transition: background 0.2s;\n          flex-shrink: 0;\n        }\n        .wa-signature-toggle.active {\n          background: var(--lion-primary);\n        }\n        .wa-signature-toggle-knob {\n          position: absolute;\n          top: 2px;\n          left: 2px;\n          width: 18px;\n          height: 18px;\n          background: white;\n          border-radius: 50%;\n          transition: transform 0.2s;\n          box-shadow: 0 1px 3px rgba(0,0,0,0.15);\n        }\n        .wa-signature-toggle.active .wa-signature-toggle-knob {\n          transform: translateX(18px);\n        }\n\n        .wa-signature-input-group {\n          margin-bottom: 10px;\n        }\n        .wa-signature-input-label {\n          display: block;\n          color: #6b7280;\n          font-size: 11px;\n          font-weight: 600;\n          margin-bottom: 5px;\n          text-transform: uppercase;\n          letter-spacing: 0.3px;\n        }\n        .wa-signature-input {\n          width: 100%;\n          padding: 9px 12px;\n          background: #ffffff;\n          border: 1px solid #e5e7eb;\n          border-radius: 10px;\n          color: #1f2937;\n          font-size: 13px;\n          outline: none;\n          transition: all 0.15s;\n          box-sizing: border-box;\n        }\n        .wa-signature-input:focus {\n          border-color: var(--lion-primary);\n          box-shadow: 0 0 0 3px rgba(var(--lion-primary-rgb), 0.12);\n        }\n        .wa-signature-input::placeholder {\n          color: #9ca3af;\n        }\n        .wa-signature-input:disabled {\n          background: #f4f4f5;\n          color: #9ca3af;\n          cursor: not-allowed;\n          border-color: #e5e7eb;\n        }\n        .wa-signature-input:disabled::placeholder {\n          color: #d1d5db;\n        }\n\n        .wa-signature-preview {\n          padding: 10px 12px;\n          background: #fafafa;\n          border: 1px solid #f0f0f0;\n          border-radius: 10px;\n          margin-bottom: 10px;\n          overflow: hidden;\n        }\n        .wa-signature-preview-label {\n          color: #6b7280;\n          font-size: 10px;\n          font-weight: 600;\n          text-transform: uppercase;\n          letter-spacing: 0.3px;\n          margin-bottom: 4px;\n        }\n        .wa-signature-preview-text {\n          color: #374151;\n          font-size: 12px;\n          white-space: pre-wrap;\n          word-break: break-word;\n          overflow: hidden;\n        }\n        .wa-signature-preview-msg {\n          color: #6b7280;\n          margin-bottom: 4px;\n        }\n        .wa-signature-preview-sig {\n          color: var(--lion-primary);\n          display: block;\n          overflow: hidden;\n          text-overflow: ellipsis;\n        }\n        .wa-signature-preview-line {\n          color: var(--lion-primary);\n          font-size: 10px;\n          display: block;\n          overflow: hidden;\n          letter-spacing: -2px;\n        }\n\n        .wa-signature-btn-save {\n          width: 100%;\n          padding: 10px;\n          background: var(--lion-primary);\n          border: none;\n          border-radius: 10px;\n          color: white;\n          font-size: 13px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.15s;\n          box-shadow: 0 2px 8px rgba(var(--lion-primary-rgb), 0.25);\n        }\n        .wa-signature-btn-save:hover {\n          transform: translateY(-1px);\n          box-shadow: 0 4px 14px rgba(var(--lion-primary-rgb), 0.35);\n        }\n      `),a.createElement("button",{className:"wa-signature-btn "+(i?"active":""),onClick:()=>t(!e),title:i?`${(0,s.t)("signature.title")}: ${r}`:(0,s.t)("signature.title")||"Signature"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),a.createElement("path",{d:"m15 5 4 4"}))),e&&a.createElement(a.Fragment,null,a.createElement("div",{className:"wa-signature-backdrop",onClick:()=>t(!1)}),a.createElement("div",{className:"wa-signature-modal",ref:d},a.createElement("div",{className:"wa-signature-modal-header"},a.createElement("div",{className:"wa-signature-modal-title"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),a.createElement("path",{d:"m15 5 4 4"})),(0,s.t)("signature.title")||"Signature"),a.createElement("button",{className:"wa-signature-modal-close",onClick:()=>t(!1)},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 6L6 18M6 6l12 12"})))),a.createElement("div",{className:"wa-signature-section-label"},(0,s.t)("signature.title")||"Signature"),a.createElement("div",{className:"wa-signature-toggle-row"},a.createElement("span",{className:"wa-signature-toggle-label"},(0,s.t)("signature.enableSignature")||"Enable Signature"),a.createElement("div",{className:"wa-signature-toggle "+(i?"active":""),onClick:()=>{const e=!i;l(e),Ea.setEnabled(e),window.dispatchEvent(new CustomEvent("signatureSettingsChanged"))}},a.createElement("div",{className:"wa-signature-toggle-knob"}))),a.createElement("div",{className:"wa-signature-input-group"},a.createElement("label",{className:"wa-signature-input-label"},(0,s.t)("signature.yourSignature")||"Your Signature"),a.createElement("input",{type:"text",className:"wa-signature-input",placeholder:(0,s.t)("signature.placeholder")||"e.g., - Maria Silva",value:r,onChange:e=>o(e.target.value),maxLength:100,disabled:!i})),r&&a.createElement("div",{className:"wa-signature-preview"},a.createElement("div",{className:"wa-signature-preview-label"},(0,s.t)("signature.preview")||"Preview"),a.createElement("div",{className:"wa-signature-preview-text"},i&&a.createElement("span",{className:"wa-signature-preview-sig",style:{fontWeight:"bold"}},r,":"),a.createElement("span",{className:"wa-signature-preview-msg"},"Hello, this is a message"))),a.createElement("div",{className:"wa-signature-section-label",style:{marginTop:"6px"}},(0,s.t)("agent.agentMode")||"Agent Mode"),a.createElement("div",{className:"wa-signature-toggle-row"},a.createElement("span",{className:"wa-signature-toggle-label"},(0,s.t)("agent.identifyAsAgent")||"Identify as Agent"),a.createElement("div",{className:"wa-signature-toggle "+(m?"active":""),onClick:async()=>{const e=!m;if(p(e),e&&u.trim()){Tg.saveSettings({enabled:!0,agentName:u.trim(),status:"online",lastHeartbeat:Date.now()});try{await n().runtime.sendMessage({type:"AGENT_REGISTER",agentName:u.trim(),status:"online"})}catch(e){}}else{Tg.saveSettings({enabled:!1,status:"offline",lastHeartbeat:0});try{await n().runtime.sendMessage({type:"AGENT_UNREGISTER"})}catch(e){}}}},a.createElement("div",{className:"wa-signature-toggle-knob"}))),a.createElement("div",{className:"wa-signature-input-group"},a.createElement("label",{className:"wa-signature-input-label"},(0,s.t)("agent.agentName")||"Agent Name"),a.createElement("input",{type:"text",className:"wa-signature-input",placeholder:(0,s.t)("agent.namePlaceholder")||"e.g., Ram, Support Team 1",value:u,onChange:e=>{return t=e.target.value,g(t),void Tg.setAgentName(t);var t},maxLength:50,disabled:!m})),a.createElement("button",{className:"wa-signature-btn-save",onClick:()=>{Ea.saveSettings({signature:r,enabled:i}),t(!1),window.dispatchEvent(new CustomEvent("signatureSettingsChanged"))}},(0,s.t)("signature.save")||"Save"))))},gb=async()=>{if(document.querySelector("#main"))if(db){if(!document.getElementById("wa-signature-container"))try{const e=document.createElement("div");e.id="wa-signature-container",e.style.cssText="\n      position: fixed;\n      bottom: 423px;\n      right: 24px;\n      z-index: 99999;\n      display: flex;\n      align-items: center;\n      justify-content: center;\n    ",document.body.appendChild(e),sb=o.createRoot(e),sb.render(a.createElement(ub,null))}catch(e){}}else bb()},hb=()=>{const e=document.getElementById("wa-signature-container"),t=document.querySelector("#main");e&&(e.style.display=t?"block":"none")},bb=()=>{const e=document.getElementById("wa-signature-container");e&&(sb&&(sb.unmount(),sb=null),e.remove())},fb=e=>{window.postMessage({type:"KANBAN_OPEN_CHAT",chatId:e},"*")},vb=()=>{if(document.getElementById("wa-service-queue-container"))return;const e=document.createElement("div");e.id="wa-service-queue-container",document.body.appendChild(e),lb=o.createRoot(e),lb.render(a.createElement(ib,{onNavigateToChat:fb}))},yb=e=>e.innerText||e.textContent||"",xb=e=>{try{e.focus();const t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t?.removeAllRanges(),t?.addRange(n),document.execCommand("selectAll",!1),document.execCommand("delete",!1),e.innerHTML="";const a=document.createElement("p");a.innerHTML="<br>",e.appendChild(a),e.dispatchEvent(new InputEvent("input",{bubbles:!0,cancelable:!0,inputType:"deleteContentBackward",data:null})),e.dispatchEvent(new CompositionEvent("compositionend",{bubbles:!0,data:""}))}catch(e){}},wb=()=>{if(mb)return;const e=(e,t)=>{const n=Ea.appendSignature(t);window.postMessage({type:"SIGNATURE_SEND_MESSAGE",payload:{message:n}},"*"),xb(e),setTimeout(()=>xb(e),50),setTimeout(()=>xb(e),150),setTimeout(()=>xb(e),300)};document.addEventListener("click",t=>{const n=t.target;if(!(n.closest('[data-icon="send"]')||n.closest('button[aria-label*="Send"]')||n.closest('button[aria-label*="Enviar"]')||n.closest('span[data-icon="send"]')))return;if(!Ea.isEnabled())return;const a=(()=>{const e=document.querySelector("#main footer");return e?e.querySelector('[contenteditable="true"][data-tab="10"]')||e.querySelector('[contenteditable="true"]'):null})();if(!a)return;const r=yb(a).trim();r&&(a.querySelector('[data-lexical-mention], span[contenteditable="false"]')||a.closest('[role="dialog"]')||(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e(a,r)))},!0),document.addEventListener("keydown",t=>{if("Enter"!==t.key||t.shiftKey)return;const n=t.target;if(!n.getAttribute("contenteditable")||!n.closest("#main footer"))return;if(!Ea.isEnabled())return;const a=yb(n).trim();a&&(n.querySelector('[data-lexical-mention], span[contenteditable="false"]')||n.closest('[role="dialog"]')||(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),e(n,a)))},!0),mb=!0},kb=async()=>{var e,t;e="🚀 SIGNATURE INJECTOR STARTING",window.postMessage({type:"SIGNATURE_INJECTOR_LOG",message:e,data:t,timestamp:(new Date).toISOString()},"*");try{try{db=await Promise.race([pb(),new Promise(e=>setTimeout(()=>{e(!0)},5e3))])}catch(e){db=!0}wb(),setInterval(async()=>{const e=db;try{db=await pb()}catch(e){db=!0}!e&&db?(gb(),vb()):e&&!db&&(bb(),(()=>{const e=document.getElementById("wa-service-queue-container");e&&(lb&&(lb.unmount(),lb=null),e.remove())})())},1e4),setTimeout(()=>{gb()},1e3),setTimeout(()=>{gb()},3e3),setTimeout(()=>{gb()},5e3),setTimeout(vb,2e3),cb=new MutationObserver(()=>{const e=document.getElementById("wa-signature-container");document.querySelector("#main")&&!e&&gb(),hb();document.getElementById("wa-service-queue-container")||vb()});const e=document.querySelector("#app");e?cb.observe(e,{childList:!0,subtree:!0}):setTimeout(()=>{const e=document.querySelector("#app");e&&cb&&cb.observe(e,{childList:!0,subtree:!0})},5e3),setInterval(()=>{const e=document.getElementById("wa-signature-container");document.querySelector("#main")&&!e&&gb(),hb();document.getElementById("wa-service-queue-container")||vb()},2e3)}catch(e){}};let Eb=null,Sb=null,Cb=null,Tb=null,Ab=!1;const Db={startedAt:0,initialLicense:null,currentLicense:null,injectAttempts:0,injectSuccess:0,injectSkipped:{license:0,noBody:0,noMain:0,badRect:0},lastInject:null,lastInjectError:null,containerInDom:!1,recheckCount:0};window.__crmLogoDiag=Db;const _b=async()=>{try{return await wu(["basic","advanced","advance","premium"])}catch(e){return!1}},Nb=async()=>{try{const e=document.querySelector("#main header");if(!e)return null;const t=e.querySelector('[data-testid="conversation-info-header-chat-title"]')||e.querySelector("span[title]")||e.querySelector('span[dir="auto"]'),n=t?.textContent?.trim()||"";if(!n)return null;const a=e.querySelector('img[draggable="false"]'),r=a?.src||void 0;let o="",i=n;const s=await(async()=>new Promise(e=>{const t=setTimeout(()=>e(null),2e3),n=a=>{"WPP_ACTIVE_CHAT_RESPONSE"===a.data?.type&&(clearTimeout(t),window.removeEventListener("message",n),e(a.data.chat))};window.addEventListener("message",n),window.postMessage({type:"WPP_GET_ACTIVE_CHAT"},"*")}))();if(s&&s.id&&(o=s.id,i=s.name||n),!o){const e=window.location.hash.match(/@(\d+)/);e&&(o=`${e[1]}@c.us`)}if(!o)return null;const l=o.replace("@c.us","").replace("@g.us","");return{id:o,name:i,phone:l,image:r}}catch(e){return null}},Mb=()=>{const[e,t]=(0,a.useState)(!1),[r,o]=(0,a.useState)(!1),[l,c]=(0,a.useState)("profile"),[d,m]=(0,a.useState)(null),[p,u]=(0,a.useState)(null),[,g]=(0,a.useState)(0),h=[{id:"profile",label:(0,s.t)("crm.profile"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}))},{id:"tabs",label:(0,s.t)("crm.tabs"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h10v4h8v10z"}))},{id:"notes",label:(0,s.t)("crm.notes"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M19 3H4.99c-1.11 0-1.98.89-1.98 2L3 19c0 1.1.88 2 1.99 2H19c1.1 0 2-.9 2-2V5c0-1.11-.9-2-2-2zm0 12h-4c0 1.66-1.35 3-3 3s-3-1.34-3-3H4.99V5H19v10z"}))},{id:"reminder",label:(0,s.t)("crm.reminder"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"}))},{id:"appointment",label:(0,s.t)("crm.appointment"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM9 10H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm-8 4H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2z"}))},{id:"income",label:(0,s.t)("crm.income"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z"}))},{id:"expense",label:(0,s.t)("crm.expense"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M15 16h3c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1h-3c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm1-6h1v4h-1v-4zm-7 6h3c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1zm1-6h1v4h-1v-4zM5 8h2v8H5zM2 4v16h20V4H2zm18 14H4V6h16v12z"}))},{id:"schedule",label:(0,s.t)("crm.scheduleTab"),icon:a.createElement("svg",{viewBox:"0 0 24 24",width:"18",height:"18"},a.createElement("path",{fill:"currentColor",d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"}))}];(0,a.useEffect)(()=>{let e=document.getElementById("wa-crm-modal-root");e||(e=document.createElement("div"),e.id="wa-crm-modal-root",document.body.appendChild(e)),m(e)},[]),(0,a.useEffect)(()=>{const e=()=>{g(e=>e+1)};return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]),(0,a.useEffect)(()=>{const e=e=>{const t=document.getElementById("wa-crm-logo-container");t&&!t.contains(e.target)&&o(!1)},t=e=>{"Escape"===e.key&&o(!1)};return r&&(document.addEventListener("click",e),document.addEventListener("keydown",t)),()=>{document.removeEventListener("click",e),document.removeEventListener("keydown",t)}},[r]),(0,a.useEffect)(()=>{const e=async()=>{const e=await Nb();e&&u(e)};e();const t=setInterval(e,2e3);return()=>clearInterval(t)},[]);return a.createElement(a.Fragment,null,a.createElement("style",null,"\n        .wa-crm-logo-btn {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 48px;\n          height: 48px;\n          border: none;\n          border-radius: 50%;\n          background: #111b21;\n          cursor: pointer;\n          transition: all 0.2s;\n          box-shadow: 0 4px 12px rgba(0,0,0,0.3);\n          padding: 0;\n          overflow: hidden;\n        }\n        .wa-crm-logo-btn:hover {\n          transform: scale(1.08);\n          box-shadow: 0 6px 20px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.3);\n        }\n        .wa-crm-logo-btn:active {\n          transform: scale(0.95);\n        }\n        .wa-crm-logo-btn img {\n          width: 40px;\n          height: 40px;\n          object-fit: contain;\n          border-radius: 50%;\n        }\n\n        /* Dropdown Menu Styles — theme-aware (light/dark + whitelabel brand) */\n        .wa-crm-dropdown-menu {\n          position: absolute;\n          bottom: 60px;\n          left: 0;\n          width: 200px;\n          background: var(--lion-bg-primary, #ffffff);\n          border-radius: 12px;\n          box-shadow: 0 8px 32px rgba(0,0,0,0.18);\n          padding: 8px;\n          animation: slideUp 0.2s ease;\n          z-index: 101;\n          border: 1px solid var(--lion-border-light, #e5e7eb);\n        }\n\n        .wa-crm-dropdown-item {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          width: 100%;\n          padding: 12px 14px;\n          background: transparent;\n          border: none;\n          color: var(--lion-text-primary, #1f2937);\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n          border-radius: 8px;\n          transition: all 0.2s;\n          text-align: left;\n        }\n\n        .wa-crm-dropdown-item:hover {\n          background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.12);\n          color: var(--lion-primary, #7C3AED);\n        }\n\n        .wa-crm-dropdown-icon {\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          width: 20px;\n          height: 20px;\n          color: var(--lion-text-secondary, #374151);\n          opacity: 0.85;\n        }\n\n        .wa-crm-dropdown-item:hover .wa-crm-dropdown-icon {\n          color: var(--lion-primary, #7C3AED);\n          opacity: 1;\n        }\n\n        @keyframes slideUp {\n          from {\n            opacity: 0;\n            transform: translateY(10px);\n          }\n          to {\n            opacity: 1;\n            transform: translateY(0);\n          }\n        }\n      "),r&&p&&a.createElement("div",{className:"wa-crm-dropdown-menu"},h.map(e=>a.createElement("button",{key:e.id,className:"wa-crm-dropdown-item",onClick:()=>{return n=e.id,c(n),o(!1),window.__CRM_MODAL_OPEN__=!0,void t(!0);var n}},a.createElement("span",{className:"wa-crm-dropdown-icon"},e.icon),a.createElement("span",null,e.label)))),a.createElement("button",{className:"wa-crm-logo-btn",onClick:async e=>{e.stopPropagation();const t=await Nb();t&&(u(t),o(e=>!e))},title:"Open CRM"},a.createElement("img",{src:n().runtime.getURL("icons/logo.png"),alt:"CRM",draggable:!1,onError:e=>{const t=e.target;if(!t.dataset.fallback)return t.dataset.fallback="1",void(t.src=n().runtime.getURL("icons/icon-48.png"));"1"===t.dataset.fallback&&(t.dataset.fallback="2",t.src=n().runtime.getURL("icons/icon-128.png"))}})),e&&d&&p&&i.createPortal(a.createElement(dh,{isOpen:e,onClose:()=>{t(!1),setTimeout(()=>{window.__CRM_MODAL_OPEN__=!1},100)},contactId:p.id,contactName:p.name,contactPhone:p.phone,contactImage:p.image,initialTab:l}),d))},Ib="wa_crm_logo_position",Rb=()=>{try{const e=localStorage.getItem(Ib);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.left&&"number"==typeof t?.bottom)return{left:t.left,bottom:t.bottom}}catch{}return null},Bb=(e,t)=>{const n=Math.max(0,window.innerWidth-48),a=Math.max(0,window.innerHeight-48);return{left:Math.min(Math.max(0,e),n),bottom:Math.min(Math.max(0,t),a)}},Pb=e=>{if(e.__dragAttached)return;e.__dragAttached=!0;let t=null,n=0,a=0,r=0,o=0,i=!1;const s=n=>{if(null===t||n.pointerId!==t)return;if(i)try{e.releasePointerCapture(t)}catch{}const a=i;if(t=null,e.style.cursor="grab",a){const t=e.getBoundingClientRect();(e=>{try{localStorage.setItem(Ib,JSON.stringify(e))}catch{}})({left:Math.round(t.left),bottom:Math.round(window.innerHeight-t.bottom)});const n=t=>{t.stopPropagation(),t.preventDefault(),e.removeEventListener("click",n,!0)};e.addEventListener("click",n,!0)}};e.addEventListener("pointerdown",s=>{if(void 0!==s.button&&0!==s.button)return;t=s.pointerId,n=s.clientX,a=s.clientY;const l=e.getBoundingClientRect();r=l.left,o=window.innerHeight-l.bottom,i=!1}),e.addEventListener("pointermove",s=>{if(null===t||s.pointerId!==t)return;const l=s.clientX-n,c=s.clientY-a;if(!i&&Math.hypot(l,c)<4)return;if(!i){i=!0,e.style.cursor="grabbing",e.style.transition="none";try{e.setPointerCapture(t)}catch{}}const d=Bb(r+l,o-c);e.style.left=`${d.left}px`,e.style.bottom=`${d.bottom}px`}),e.addEventListener("pointerup",s),e.addEventListener("pointercancel",s)},Lb=async()=>{if(Db.injectAttempts++,Db.currentLicense=Ab,!Ab)return void Db.injectSkipped.license++;if(!document.body)return void Db.injectSkipped.noBody++;const e=document.querySelector("#main");if(!e)return Db.injectSkipped.noMain++,Ub(),void(Db.containerInDom=!1);const t=(e=>{const t=Rb();if(t)return Bb(t.left,t.bottom);let n;if(e){const t=e.getBoundingClientRect();n=t.width>0&&t.left>0?Math.round(t.left+-10):Math.round(.3*window.innerWidth)+-10}else n=Math.round(.3*window.innerWidth)+-10;return{left:n,bottom:230}})(e),n=e.getBoundingClientRect(),r=null!==Rb(),i=document.getElementById("wa-crm-logo-container");if(i&&document.body.contains(i))return i.style.display="",r||(i.style.left=`${t.left}px`,i.style.bottom=`${t.bottom}px`),Db.containerInDom=!0,void(Db.lastInject={left:t.left,bottom:t.bottom,mainLeft:n.left,mainBottom:n.bottom});if(i){if(Eb){try{Eb.unmount()}catch{}Eb=null}i.remove()}try{const e=document.createElement("div");e.id="wa-crm-logo-container",e.style.cssText=`\n      position: fixed;\n      left: ${t.left}px;\n      bottom: ${t.bottom}px;\n      z-index: 1000;\n      pointer-events: auto;\n      cursor: grab;\n      touch-action: none;\n      user-select: none;\n    `,document.body.appendChild(e),Pb(e),Eb=o.createRoot(e),Eb.render(a.createElement(Mb,null)),Db.injectSuccess++,Db.containerInDom=!0,Db.lastInject={left:t.left,bottom:t.bottom,mainLeft:n.left,mainBottom:n.bottom},Db.lastInjectError=null}catch(e){Db.lastInjectError=e instanceof Error?e.message:String(e)}},Ub=()=>{const e=document.getElementById("wa-crm-logo-container");if(e){if(Eb){try{Eb.unmount()}catch{}Eb=null}e.remove()}},Fb=async()=>{Db.startedAt=Date.now(),Ab=await _b(),Db.initialLicense=Ab,Db.currentLicense=Ab,setTimeout(Lb,2e3),setTimeout(Lb,4e3),setTimeout(Lb,8e3);const e=()=>{Ab&&Lb()};Sb=new MutationObserver(e);const t=document.querySelector("#app");if(t)Sb.observe(t,{childList:!0,subtree:!0});else{const e=window.setInterval(()=>{const t=document.querySelector("#app");t&&Sb&&(Sb.observe(t,{childList:!0,subtree:!0}),clearInterval(e))},1e3);setTimeout(()=>clearInterval(e),3e4)}Cb=window.setInterval(e,2e3),window.addEventListener("resize",e);let n=0;const a=async()=>{const e=Ab;Ab=await _b(),Db.currentLicense=Ab,!e&&Ab?Lb():e&&!Ab&&Ub(),n++,Db.recheckCount=n,15===n&&null!==Tb&&(clearInterval(Tb),Tb=window.setInterval(a,1e4))};Tb=window.setInterval(a,2e3)};let zb=null,Ob=!1,Wb="en",qb=null,Hb=!1;new Map;const jb={en:"English",es:"Spanish",fr:"French",de:"German",it:"Italian",pt:"Portuguese",ru:"Russian",zh:"Chinese",ja:"Japanese",ko:"Korean",ar:"Arabic",hi:"Hindi",bn:"Bengali",ur:"Urdu",tr:"Turkish",nl:"Dutch",pl:"Polish",vi:"Vietnamese",th:"Thai",id:"Indonesian",ms:"Malay",he:"Hebrew",el:"Greek",sv:"Swedish",uk:"Ukrainian"},Vb=(new Map,(e,t)=>{const n=document.createElement("button");n.className="wa-msg-translate-btn",n.innerHTML='\n    <svg viewBox="0 0 24 24" width="16" height="16">\n      <path fill="currentColor" d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v2h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"/>\n    </svg>\n  ',n.title=`Translate to ${jb[Wb]||Wb}`;let a=!1,r="",o="",i=[],s=[];return n.addEventListener("click",async t=>{if(t.stopPropagation(),t.preventDefault(),a)return i.forEach((e,t)=>{s[t]&&(e.innerHTML=s[t])}),n.classList.remove("translated"),n.title=`Translate to ${jb[Wb]||Wb}`,void(a=!1);if(!o){const t=e.querySelectorAll("span.selectable-text.copyable-text");i=[],s=[];let n="";t.forEach(e=>{const t=e;i.push(t),s.push(t.innerHTML);const a=t.innerText?.trim();a&&(n+=a+"\n\n")}),o=n.trim()}if(!o)return;n.classList.add("loading");const l=n.innerHTML;n.innerHTML='<div class="wa-translate-spinner"></div>';try{if(r||(r=await(async(e,t)=>{const n=Gn.getSettings();if(!n.enabled||!n.apiKey)throw new Error("AI not configured. Please set up AI API key in Settings.");const a=`Translate the following text to ${jb[t]||t}. Only respond with the translation, no explanations:\n\n${e}`;try{if("gemini"===n.provider){const e=await fetch(`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent?key=${n.apiKey}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({contents:[{parts:[{text:a}]}],generationConfig:{temperature:.3,maxOutputTokens:2048}})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error?.message||`Gemini API error: ${e.status}`)}const t=await e.json();if(t.candidates?.[0]?.content?.parts?.[0]?.text)return t.candidates[0].content.parts[0].text.trim();throw new Error("Gemini returned empty response. Check your API key and quota.")}if("chatgpt"===n.provider){const e=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.apiKey}`},body:JSON.stringify({model:"gpt-4o-mini",messages:[{role:"user",content:a}],temperature:.3,max_tokens:2048})}),t=await e.json();if(t.choices?.[0]?.message?.content)return t.choices[0].message.content.trim();throw new Error("Invalid ChatGPT response")}if("deepseek"===n.provider){const e=await fetch("https://api.deepseek.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.apiKey}`},body:JSON.stringify({model:"deepseek-chat",messages:[{role:"user",content:a}],temperature:.3,max_tokens:2048})}),t=await e.json();if(t.choices?.[0]?.message?.content)return t.choices[0].message.content.trim();throw new Error("Invalid DeepSeek response")}throw new Error("Unknown AI provider")}catch(e){throw e}})(o,Wb)),i.length>0){const e=r.split("\n").map(e=>e.trim()).filter(e=>e.length>0).join("<br>");i[0].innerHTML=`<span>${e}</span>`;for(let e=1;e<i.length;e++)i[e].innerHTML=""}n.classList.add("translated"),n.title="Click to show original",a=!0}catch(e){alert(e.message||"Translation failed")}finally{n.classList.remove("loading"),n.innerHTML=l}}),n}),Gb=e=>{if(e.querySelector(".wa-msg-translate-btn"))return;const t=e.querySelector("span.selectable-text.copyable-text");if(!t||!t.textContent?.trim())return;const n=Vb(e),a=e.querySelector('[data-testid="react-btn"]')||e.querySelector('span[data-icon="react"]')?.closest("span")||e.querySelector('[aria-label*="React"]');if(a&&a.parentElement)return void a.parentElement.insertBefore(n,a.nextSibling);const r=e.querySelector(".copyable-area")?.parentElement?.parentElement||e.querySelector("[data-pre-plain-text]")?.closest("div[class]")?.parentElement;if(r)return void r.appendChild(n);const o=e.querySelector("div > div");o?o.appendChild(n):e.appendChild(n)},Kb=()=>{qb&&clearTimeout(qb),qb=setTimeout(()=>{$b()},300)},$b=()=>{if(Ob&&!Hb){Hb=!0;try{const e=document.querySelector('#main [role="application"]')||document.querySelector("#main");if(!e)return void(Hb=!1);const t=e.querySelectorAll(".message-in");let n=0;for(const e of Array.from(t)){if(n>=20)break;e.querySelector(".wa-msg-translate-btn")||(Gb(e),n++)}}finally{Hb=!1}}},Yb=async()=>{try{Ob=await(async()=>{try{return await wu(["basic","advanced","advance","premium"])}catch(e){return!1}})()}catch(e){Ob=!1}Ob=!0,Wb=localStorage.getItem("wa_spoken_language")||"pt",window.addEventListener("spokenLanguageChanged",e=>{Wb=e.detail||"pt"}),(()=>{if(document.getElementById("wa-msg-translate-styles"))return;const e=document.createElement("style");e.id="wa-msg-translate-styles",e.textContent="\n    .wa-msg-translate-btn {\n      display: inline-flex;\n      align-items: center;\n      justify-content: center;\n      width: 26px;\n      height: 26px;\n      padding: 4px;\n      margin-left: 4px;\n      background: #ffffff;\n      border: none;\n      border-radius: 50%;\n      color: #8696a0;\n      cursor: pointer;\n      transition: all 0.2s ease;\n      flex-shrink: 0;\n      opacity: 0.85;\n      box-shadow: 0 1px 2px rgba(0,0,0,0.1);\n      vertical-align: middle;\n    }\n\n    .wa-msg-translate-btn:hover {\n      color: var(--lion-primary);\n      opacity: 1;\n      background: #eff6ff;\n      transform: scale(1.1);\n      box-shadow: 0 2px 6px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.25);\n    }\n\n    .wa-msg-translate-btn.loading {\n      opacity: 1;\n      pointer-events: none;\n    }\n\n    .wa-msg-translate-btn.translated {\n      color: var(--lion-primary);\n      opacity: 1;\n      background: #eff6ff;\n    }\n\n    .wa-msg-translate-btn.translated:hover {\n      background: #dbeafe;\n    }\n\n    .wa-translate-spinner {\n      width: 14px;\n      height: 14px;\n      border: 2px solid transparent;\n      border-top-color: var(--lion-primary);\n      border-radius: 50%;\n      animation: waTranslateSpin 0.8s linear infinite;\n    }\n\n    @keyframes waTranslateSpin {\n      to { transform: rotate(360deg); }\n    }\n  ",document.head.appendChild(e)})(),setTimeout(()=>{Kb()},2e3),zb=new MutationObserver(e=>{let t=!1;for(const n of e){for(const e of Array.from(n.addedNodes))if(e instanceof HTMLElement&&(e.classList?.contains("message-in")||e.querySelector?.(".message-in"))){t=!0;break}if(t)break}t&&Kb()});const e=document.querySelector('#main [role="application"]')||document.querySelector("#main .copyable-area")||document.querySelector("#main");e&&zb.observe(e,{childList:!0,subtree:!0}),setInterval(Kb,1e4)},Xb=({transfer:e,onClose:t,onStartService:r})=>{const[o,i]=(0,a.useState)(!1),[l,c]=(0,a.useState)(null),[,d]=(0,a.useState)(0);(0,a.useEffect)(()=>{const e=()=>d(e=>e+1);return window.addEventListener("languageChanged",e),()=>window.removeEventListener("languageChanged",e)},[]);const m=e=>{switch(e){case"urgent":return ca.error;case"high":return ca.primary;case"medium":return ca.warning;case"low":return ca.success;default:return ca.textMuted}};return a.createElement(a.Fragment,null,a.createElement("style",null,"\n        .incoming-transfer-card {\n          position: fixed;\n          bottom: 20px;\n          right: 20px;\n          width: 360px;\n          background: #111b21;\n          border: 1px solid #2a3942;\n          border-radius: 12px;\n          box-shadow: 0 8px 32px rgba(0,0,0,0.5);\n          z-index: 2147483647;\n          animation: slideInRight 0.3s ease-out;\n          overflow: hidden;\n          pointer-events: auto;\n        }\n\n        @keyframes slideInRight {\n          from {\n            transform: translateX(100%);\n            opacity: 0;\n          }\n          to {\n            transform: translateX(0);\n            opacity: 1;\n          }\n        }\n\n        .incoming-transfer-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 14px 16px;\n          background: var(--lion-primary);\n        }\n\n        .incoming-transfer-title {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          color: white;\n          font-size: 14px;\n          font-weight: 600;\n        }\n\n        .incoming-transfer-close {\n          background: rgba(255,255,255,0.2);\n          border: none;\n          color: white;\n          cursor: pointer;\n          padding: 4px;\n          border-radius: 4px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n        }\n\n        .incoming-transfer-close:hover {\n          background: rgba(255,255,255,0.3);\n        }\n\n        .incoming-transfer-body {\n          padding: 16px;\n        }\n\n        .incoming-transfer-info {\n          display: flex;\n          flex-direction: column;\n          gap: 12px;\n        }\n\n        .incoming-transfer-row {\n          display: flex;\n          align-items: flex-start;\n          gap: 12px;\n        }\n\n        .incoming-transfer-icon {\n          flex-shrink: 0;\n          width: 32px;\n          height: 32px;\n          background: #202c33;\n          border-radius: 8px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n        }\n\n        .incoming-transfer-row-content {\n          flex: 1;\n          min-width: 0;\n        }\n\n        .incoming-transfer-label {\n          font-size: 11px;\n          color: #8696a0;\n          text-transform: uppercase;\n          margin-bottom: 2px;\n        }\n\n        .incoming-transfer-value {\n          font-size: 14px;\n          color: #e9edef;\n          font-weight: 500;\n          word-break: break-word;\n        }\n\n        .incoming-transfer-priority {\n          display: inline-flex;\n          align-items: center;\n          gap: 6px;\n          padding: 4px 10px;\n          border-radius: 12px;\n          font-size: 12px;\n          font-weight: 600;\n        }\n\n        .incoming-transfer-reason {\n          background: #202c33;\n          padding: 10px 12px;\n          border-radius: 8px;\n          margin-top: 8px;\n        }\n\n        .incoming-transfer-reason-label {\n          font-size: 11px;\n          color: #8696a0;\n          text-transform: uppercase;\n          margin-bottom: 4px;\n        }\n\n        .incoming-transfer-reason-text {\n          font-size: 13px;\n          color: #e9edef;\n          line-height: 1.4;\n        }\n\n        .incoming-transfer-error {\n          background: rgba(239, 68, 68, 0.1);\n          border: 1px solid #ef4444;\n          border-radius: 8px;\n          padding: 10px 12px;\n          color: #ef4444;\n          font-size: 13px;\n          margin-top: 12px;\n        }\n\n        .incoming-transfer-actions {\n          display: flex;\n          gap: 10px;\n          padding: 16px;\n          border-top: 1px solid #2a3942;\n        }\n\n        .incoming-transfer-btn {\n          flex: 1;\n          padding: 12px 16px;\n          border: none;\n          border-radius: 8px;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          gap: 8px;\n        }\n\n        .incoming-transfer-btn-dismiss {\n          background: #2a3942;\n          color: #e9edef;\n        }\n\n        .incoming-transfer-btn-dismiss:hover {\n          background: #3b4a54;\n        }\n\n        .incoming-transfer-btn-start {\n          background: var(--lion-primary);\n          color: white;\n        }\n\n        .incoming-transfer-btn-start:hover:not(:disabled) {\n          background: linear-gradient(135deg, var(--lion-primary-hover) 0%, #dc2626 100%);\n        }\n\n        .incoming-transfer-btn-start:disabled {\n          opacity: 0.5;\n          cursor: not-allowed;\n        }\n\n        .incoming-transfer-spinner {\n          width: 16px;\n          height: 16px;\n          border: 2px solid rgba(255,255,255,0.3);\n          border-top-color: white;\n          border-radius: 50%;\n          animation: spin 1s linear infinite;\n        }\n\n        @keyframes spin {\n          to { transform: rotate(360deg); }\n        }\n\n        .incoming-transfer-pulse {\n          animation: pulse 2s ease-in-out infinite;\n        }\n\n        @keyframes pulse {\n          0%, 100% { opacity: 1; }\n          50% { opacity: 0.7; }\n        }\n      "),a.createElement("div",{className:"incoming-transfer-card"},a.createElement("div",{className:"incoming-transfer-header"},a.createElement("div",{className:"incoming-transfer-title"},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"})),a.createElement("span",{className:"incoming-transfer-pulse"},(0,s.t)("agent.incomingTransfer")||"Incoming Transfer")),a.createElement("button",{className:"incoming-transfer-close",onClick:t},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 6L6 18M6 6l12 12"})))),a.createElement("div",{className:"incoming-transfer-body"},a.createElement("div",{className:"incoming-transfer-info"},a.createElement("div",{className:"incoming-transfer-row"},a.createElement("div",{className:"incoming-transfer-icon"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--lion-primary)",strokeWidth:"2"},a.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"12",cy:"7",r:"4"}))),a.createElement("div",{className:"incoming-transfer-row-content"},a.createElement("div",{className:"incoming-transfer-label"},(0,s.t)("agent.fromAgent")||"From Agent"),a.createElement("div",{className:"incoming-transfer-value"},e.fromAgentName))),a.createElement("div",{className:"incoming-transfer-row"},a.createElement("div",{className:"incoming-transfer-icon"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--lion-primary)",strokeWidth:"2"},a.createElement("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}))),a.createElement("div",{className:"incoming-transfer-row-content"},a.createElement("div",{className:"incoming-transfer-label"},(0,s.t)("agent.chat")||"Chat"),a.createElement("div",{className:"incoming-transfer-value"},e.chatName))),a.createElement("div",{className:"incoming-transfer-row"},a.createElement("div",{className:"incoming-transfer-icon"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"var(--lion-primary)",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("polyline",{points:"12 6 12 12 16 14"}))),a.createElement("div",{className:"incoming-transfer-row-content"},a.createElement("div",{className:"incoming-transfer-label"},(0,s.t)("agent.priority")||"Priority"),a.createElement("div",{className:"incoming-transfer-priority",style:{backgroundColor:`${m(e.priority)}20`,color:m(e.priority)}},a.createElement("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:m(e.priority)}}),(e=>{switch(e){case"urgent":return(0,s.t)("agent.priorityUrgent")||"Urgent";case"high":return(0,s.t)("agent.priorityHigh")||"High";case"medium":return(0,s.t)("agent.priorityMedium")||"Medium";case"low":return(0,s.t)("agent.priorityLow")||"Low";default:return e}})(e.priority),a.createElement("span",{style:{color:"#8696a0",marginLeft:"8px"}},(e=>{let t=e;!e||e.includes("Z")||e.includes("+")||(t=e.replace(" ","T")+"Z");return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})(e.createdAt))))),e.reason&&a.createElement("div",{className:"incoming-transfer-reason"},a.createElement("div",{className:"incoming-transfer-reason-label"},(0,s.t)("agent.reason")||"Reason"),a.createElement("div",{className:"incoming-transfer-reason-text"},e.reason))),l&&a.createElement("div",{className:"incoming-transfer-error"},l)),a.createElement("div",{className:"incoming-transfer-actions"},a.createElement("button",{className:"incoming-transfer-btn incoming-transfer-btn-dismiss",onClick:t,disabled:o},(0,s.t)("crm.dismiss")||"Dismiss"),a.createElement("button",{className:"incoming-transfer-btn incoming-transfer-btn-start",onClick:async()=>{i(!0),c(null);try{const a=await n().runtime.sendMessage({type:"TRANSFER_ACCEPT",transferId:e.id});if(!a.success)return c(a.error||"Failed to accept transfer"),void i(!1);const o=await n().runtime.sendMessage({type:"TRANSFER_START_SERVICE",transferId:e.id});o.success?(window.postMessage({type:"NAVIGATE_TO_CHAT",chatId:e.chatId},"*"),Tg.addActiveService({transferId:e.id,chatId:e.chatId,chatName:e.chatName,fromAgentName:e.fromAgentName,reason:e.reason,priority:e.priority,startedAt:(new Date).toISOString()}),r(e.id,e.chatId),t()):c(o.error||"Failed to start service")}catch(e){c(e.message||"Network error")}finally{i(!1)}},disabled:o},o?a.createElement(a.Fragment,null,a.createElement("span",{className:"incoming-transfer-spinner"}),(0,s.t)("crm.loading")||"Loading..."):a.createElement(a.Fragment,null,a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("polygon",{points:"5 3 19 12 5 21 5 3"})),(0,s.t)("agent.startService")||"Start Service")))))},Jb=({service:e,onEndService:t})=>{const[r,o]=(0,a.useState)(!1),[i,l]=(0,a.useState)(null),[c,d]=(0,a.useState)("00:00"),[m,p]=(0,a.useState)(!1);(0,a.useEffect)(()=>{const t=new Date(e.startedAt).getTime(),n=()=>{const e=Date.now()-t,n=Math.floor(e/6e4),a=Math.floor(e%6e4/1e3);d(`${n.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`)};n();const a=setInterval(n,1e3);return()=>clearInterval(a)},[e.startedAt]);const u=e=>{switch(e){case"urgent":return ca.error;case"high":return ca.primary;case"medium":return ca.warning;case"low":return ca.success;default:return ca.textMuted}};return a.createElement(a.Fragment,null,a.createElement("style",null,`\n        .active-service-banner {\n          position: relative;\n          background: linear-gradient(135deg, #111b21 0%, #1a252d 100%);\n          border-bottom: 2px solid ${u(e.priority)};\n          padding: ${m?"8px 16px":"12px 16px"};\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          gap: 16px;\n          transition: all 0.2s;\n          z-index: 100;\n        }\n\n        .active-service-left {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          flex: 1;\n          min-width: 0;\n        }\n\n        .active-service-icon {\n          flex-shrink: 0;\n          width: 36px;\n          height: 36px;\n          background: ${u(e.priority)}20;\n          border: 2px solid ${u(e.priority)};\n          border-radius: 50%;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          animation: pulse 2s ease-in-out infinite;\n        }\n\n        @keyframes pulse {\n          0%, 100% { transform: scale(1); opacity: 1; }\n          50% { transform: scale(1.05); opacity: 0.8; }\n        }\n\n        .active-service-info {\n          flex: 1;\n          min-width: 0;\n        }\n\n        .active-service-title {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          font-size: 13px;\n          font-weight: 600;\n          color: #e9edef;\n        }\n\n        .active-service-priority-badge {\n          display: inline-flex;\n          align-items: center;\n          gap: 4px;\n          padding: 2px 8px;\n          border-radius: 10px;\n          font-size: 11px;\n          font-weight: 600;\n          background: ${u(e.priority)}20;\n          color: ${u(e.priority)};\n        }\n\n        .active-service-priority-dot {\n          width: 6px;\n          height: 6px;\n          border-radius: 50%;\n          background: ${u(e.priority)};\n        }\n\n        .active-service-meta {\n          display: ${m?"none":"flex"};\n          align-items: center;\n          gap: 12px;\n          margin-top: 4px;\n          font-size: 12px;\n          color: #8696a0;\n        }\n\n        .active-service-meta-item {\n          display: flex;\n          align-items: center;\n          gap: 4px;\n        }\n\n        .active-service-timer {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          padding: 4px 10px;\n          background: rgba(var(--lion-primary-rgb), 0.1);\n          border-radius: 12px;\n          font-size: 13px;\n          font-weight: 600;\n          color: var(--lion-primary);\n          font-family: monospace;\n        }\n\n        .active-service-timer-dot {\n          width: 6px;\n          height: 6px;\n          border-radius: 50%;\n          background: var(--lion-primary);\n          animation: blink 1s ease-in-out infinite;\n        }\n\n        @keyframes blink {\n          0%, 100% { opacity: 1; }\n          50% { opacity: 0.3; }\n        }\n\n        .active-service-actions {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .active-service-btn-minimize {\n          background: none;\n          border: none;\n          color: #8696a0;\n          cursor: pointer;\n          padding: 4px;\n          border-radius: 4px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n        }\n\n        .active-service-btn-minimize:hover {\n          background: rgba(255,255,255,0.1);\n          color: #e9edef;\n        }\n\n        .active-service-btn-end {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          padding: 8px 16px;\n          background: #ef4444;\n          border: none;\n          border-radius: 6px;\n          color: white;\n          font-size: 13px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .active-service-btn-end:hover:not(:disabled) {\n          background: #dc2626;\n        }\n\n        .active-service-btn-end:disabled {\n          opacity: 0.5;\n          cursor: not-allowed;\n        }\n\n        .active-service-error {\n          position: absolute;\n          bottom: -28px;\n          left: 50%;\n          transform: translateX(-50%);\n          background: #ef4444;\n          color: white;\n          padding: 4px 12px;\n          border-radius: 4px;\n          font-size: 12px;\n          white-space: nowrap;\n          z-index: 10;\n        }\n\n        .active-service-spinner {\n          width: 14px;\n          height: 14px;\n          border: 2px solid rgba(255,255,255,0.3);\n          border-top-color: white;\n          border-radius: 50%;\n          animation: spin 1s linear infinite;\n        }\n\n        @keyframes spin {\n          to { transform: rotate(360deg); }\n        }\n\n        .active-service-reason {\n          display: ${m?"none":"block"};\n          margin-top: 8px;\n          padding: 8px 12px;\n          background: rgba(255,255,255,0.05);\n          border-radius: 6px;\n          border-left: 3px solid ${u(e.priority)};\n        }\n\n        .active-service-reason-label {\n          font-size: 10px;\n          color: #8696a0;\n          text-transform: uppercase;\n          margin-bottom: 2px;\n        }\n\n        .active-service-reason-text {\n          font-size: 12px;\n          color: #e9edef;\n          line-height: 1.4;\n        }\n      `),a.createElement("div",{className:"active-service-banner"},a.createElement("div",{className:"active-service-left"},a.createElement("div",{className:"active-service-icon"},a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:u(e.priority),strokeWidth:"2"},a.createElement("path",{d:"M16 17.01V10h-2v7.01h-3L15 21l4-3.99h-3zM9 3L5 6.99h3V14h2V6.99h3L9 3z"}))),a.createElement("div",{className:"active-service-info"},a.createElement("div",{className:"active-service-title"},(0,s.t)("agent.activeService")||"Active Service",a.createElement("span",{className:"active-service-priority-badge"},a.createElement("span",{className:"active-service-priority-dot"}),(e=>{switch(e){case"urgent":return(0,s.t)("agent.priorityUrgent")||"Urgent";case"high":return(0,s.t)("agent.priorityHigh")||"High";case"medium":return(0,s.t)("agent.priorityMedium")||"Medium";case"low":return(0,s.t)("agent.priorityLow")||"Low";default:return e}})(e.priority))),a.createElement("div",{className:"active-service-meta"},a.createElement("div",{className:"active-service-meta-item"},a.createElement("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"12",cy:"7",r:"4"})),(0,s.t)("agent.from")||"From",": ",e.fromAgentName),a.createElement("div",{className:"active-service-meta-item"},a.createElement("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})),e.chatName)),e.reason&&a.createElement("div",{className:"active-service-reason"},a.createElement("div",{className:"active-service-reason-label"},(0,s.t)("agent.reason")||"Reason"),a.createElement("div",{className:"active-service-reason-text"},e.reason)))),a.createElement("div",{className:"active-service-timer"},a.createElement("span",{className:"active-service-timer-dot"}),c),a.createElement("div",{className:"active-service-actions"},a.createElement("button",{className:"active-service-btn-minimize",onClick:()=>p(!m),title:m?"Expand":"Minimize"},a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},m?a.createElement("polyline",{points:"15 3 21 3 21 9"}):a.createElement("polyline",{points:"4 14 10 14 10 20"}),a.createElement("line",{x1:m?"21":"10",y1:m?"3":"14",x2:m?"14":"3",y2:m?"10":"21"}))),a.createElement("button",{className:"active-service-btn-end",onClick:async()=>{o(!0),l(null);try{const a=await n().runtime.sendMessage({type:"TRANSFER_END_SERVICE",transferId:e.transferId});a.success?(window.postMessage({type:"UNPIN_CHAT",chatId:e.chatId},"*"),Tg.removeActiveService(e.transferId),t()):l(a.error||"Failed to end service")}catch(e){l(e.message||"Network error")}finally{o(!1)}},disabled:r},r?a.createElement(a.Fragment,null,a.createElement("span",{className:"active-service-spinner"}),(0,s.t)("crm.loading")||"Loading..."):a.createElement(a.Fragment,null,a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("rect",{x:"6",y:"6",width:"12",height:"12"})),(0,s.t)("agent.endService")||"End Service"))),i&&a.createElement("div",{className:"active-service-error"},i)))},Qb=({onClose:e})=>{const[t,r]=(0,a.useState)("sent"),[o,i]=(0,a.useState)("all"),[l,c]=(0,a.useState)([]),[d,m]=(0,a.useState)(!0),[p,u]=(0,a.useState)(null);(0,a.useEffect)(()=>{g()},[t,o]);const g=async()=>{m(!0),u(null);try{const e=await n().runtime.sendMessage({type:"TRANSFER_HISTORY",direction:t,status:"all"===o?void 0:o,limit:50});e.success?c(e.transfers||[]):u(e.error||"Failed to fetch history")}catch(e){u(e.message||"Network error")}finally{m(!1)}},h=e=>{switch(e){case"urgent":return ca.error;case"high":return ca.primary;case"medium":return ca.warning;case"low":return ca.success;default:return ca.textMuted}},b=e=>{switch(e){case"pending":return ca.warning;case"accepted":return ca.info;case"in_service":return ca.primary;case"completed":return ca.success;case"declined":return ca.error;default:return ca.textMuted}};return a.createElement(a.Fragment,null,a.createElement("style",null,"\n        .history-modal-backdrop {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.7);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 999999;\n        }\n\n        .history-modal {\n          background: #111b21;\n          border: 1px solid #2a3942;\n          border-radius: 12px;\n          width: 600px;\n          max-width: 95vw;\n          max-height: 80vh;\n          display: flex;\n          flex-direction: column;\n          overflow: hidden;\n          box-shadow: 0 8px 32px rgba(0,0,0,0.5);\n        }\n\n        .history-modal-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          padding: 16px 20px;\n          border-bottom: 1px solid #2a3942;\n        }\n\n        .history-modal-title {\n          display: flex;\n          align-items: center;\n          gap: 10px;\n          color: #e9edef;\n          font-size: 16px;\n          font-weight: 600;\n        }\n\n        .history-modal-close {\n          background: none;\n          border: none;\n          color: #8696a0;\n          cursor: pointer;\n          padding: 4px;\n          border-radius: 4px;\n        }\n\n        .history-modal-close:hover {\n          background: rgba(255,255,255,0.1);\n          color: #e9edef;\n        }\n\n        .history-tabs {\n          display: flex;\n          border-bottom: 1px solid #2a3942;\n        }\n\n        .history-tab {\n          flex: 1;\n          padding: 12px 20px;\n          background: none;\n          border: none;\n          color: #8696a0;\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n          position: relative;\n          transition: all 0.2s;\n        }\n\n        .history-tab:hover {\n          color: #e9edef;\n          background: rgba(255,255,255,0.05);\n        }\n\n        .history-tab.active {\n          color: var(--lion-primary);\n        }\n\n        .history-tab.active::after {\n          content: '';\n          position: absolute;\n          bottom: 0;\n          left: 0;\n          right: 0;\n          height: 2px;\n          background: var(--lion-primary);\n        }\n\n        .history-filters {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          padding: 12px 20px;\n          background: #0b141a;\n          border-bottom: 1px solid #2a3942;\n        }\n\n        .history-filter-label {\n          color: #8696a0;\n          font-size: 12px;\n        }\n\n        .history-filter-select {\n          padding: 6px 12px;\n          background: #2a3942;\n          border: 1px solid #3b4a54;\n          border-radius: 6px;\n          color: #e9edef;\n          font-size: 13px;\n          cursor: pointer;\n          outline: none;\n        }\n\n        .history-filter-select:focus {\n          border-color: var(--lion-primary);\n        }\n\n        .history-content {\n          flex: 1;\n          overflow-y: auto;\n          padding: 12px;\n        }\n\n        .history-loading {\n          display: flex;\n          flex-direction: column;\n          align-items: center;\n          justify-content: center;\n          padding: 40px;\n          color: #8696a0;\n        }\n\n        .history-spinner {\n          width: 32px;\n          height: 32px;\n          border: 3px solid #2a3942;\n          border-top-color: var(--lion-primary);\n          border-radius: 50%;\n          animation: spin 1s linear infinite;\n          margin-bottom: 12px;\n        }\n\n        @keyframes spin {\n          to { transform: rotate(360deg); }\n        }\n\n        .history-error {\n          text-align: center;\n          padding: 40px;\n          color: #ef4444;\n        }\n\n        .history-empty {\n          text-align: center;\n          padding: 40px;\n          color: #8696a0;\n        }\n\n        .history-empty-icon {\n          width: 48px;\n          height: 48px;\n          margin: 0 auto 12px;\n          opacity: 0.5;\n        }\n\n        .history-list {\n          display: flex;\n          flex-direction: column;\n          gap: 8px;\n        }\n\n        .history-item {\n          background: #202c33;\n          border: 1px solid #2a3942;\n          border-radius: 10px;\n          padding: 14px 16px;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n\n        .history-item:hover {\n          background: #2a3942;\n          border-color: var(--lion-primary);\n        }\n\n        .history-item-header {\n          display: flex;\n          align-items: center;\n          justify-content: space-between;\n          margin-bottom: 8px;\n        }\n\n        .history-item-chat {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          font-size: 14px;\n          font-weight: 500;\n          color: #e9edef;\n        }\n\n        .history-item-time {\n          font-size: 12px;\n          color: #8696a0;\n        }\n\n        .history-item-meta {\n          display: flex;\n          align-items: center;\n          gap: 12px;\n          margin-bottom: 8px;\n        }\n\n        .history-item-agent {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          font-size: 12px;\n          color: #8696a0;\n        }\n\n        .history-item-badges {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n        }\n\n        .history-item-badge {\n          display: inline-flex;\n          align-items: center;\n          gap: 4px;\n          padding: 3px 8px;\n          border-radius: 10px;\n          font-size: 11px;\n          font-weight: 500;\n        }\n\n        .history-item-badge-dot {\n          width: 6px;\n          height: 6px;\n          border-radius: 50%;\n        }\n\n        .history-item-reason {\n          font-size: 12px;\n          color: #8696a0;\n          padding: 8px 10px;\n          background: rgba(0,0,0,0.2);\n          border-radius: 6px;\n          border-left: 2px solid #3b4a54;\n        }\n\n        .history-item-duration {\n          display: flex;\n          align-items: center;\n          gap: 6px;\n          margin-top: 8px;\n          font-size: 12px;\n          color: #8696a0;\n        }\n      "),a.createElement("div",{className:"history-modal-backdrop",onClick:e},a.createElement("div",{className:"history-modal",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"history-modal-header"},a.createElement("div",{className:"history-modal-title"},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"var(--lion-primary)",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("polyline",{points:"12 6 12 12 16 14"})),(0,s.t)("agent.transferHistory")||"Transfer History"),a.createElement("button",{className:"history-modal-close",onClick:e},a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M18 6L6 18M6 6l12 12"})))),a.createElement("div",{className:"history-tabs"},a.createElement("button",{className:"history-tab "+("sent"===t?"active":""),onClick:()=>r("sent")},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginRight:"6px"}},a.createElement("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),a.createElement("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})),(0,s.t)("agent.sent")||"Sent"),a.createElement("button",{className:"history-tab "+("received"===t?"active":""),onClick:()=>r("received")},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{marginRight:"6px"}},a.createElement("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),a.createElement("path",{d:"M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"})),(0,s.t)("agent.received")||"Received")),a.createElement("div",{className:"history-filters"},a.createElement("span",{className:"history-filter-label"},(0,s.t)("agent.status")||"Status",":"),a.createElement("select",{className:"history-filter-select",value:o,onChange:e=>i(e.target.value)},a.createElement("option",{value:"all"},(0,s.t)("agent.all")||"All"),a.createElement("option",{value:"pending"},(0,s.t)("agent.statusPending")||"Pending"),a.createElement("option",{value:"in_service"},(0,s.t)("agent.statusInService")||"In Service"),a.createElement("option",{value:"completed"},(0,s.t)("agent.statusCompleted")||"Completed"),a.createElement("option",{value:"declined"},(0,s.t)("agent.statusDeclined")||"Declined"),a.createElement("option",{value:"expired"},(0,s.t)("agent.statusExpired")||"Expired"))),a.createElement("div",{className:"history-content"},d?a.createElement("div",{className:"history-loading"},a.createElement("div",{className:"history-spinner"}),a.createElement("div",null,(0,s.t)("crm.loading")||"Loading...")):p?a.createElement("div",{className:"history-error"},p):0===l.length?a.createElement("div",{className:"history-empty"},a.createElement("div",{className:"history-empty-icon"},a.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},a.createElement("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),a.createElement("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),a.createElement("line",{x1:"9",y1:"21",x2:"9",y2:"9"}))),a.createElement("div",null,(0,s.t)("agent.noTransfers")||"No transfers found")):a.createElement("div",{className:"history-list"},l.map(n=>a.createElement("div",{key:n.id,className:"history-item",onClick:()=>{return t=n.chat_id,window.postMessage({type:"NAVIGATE_TO_CHAT",chatId:t},"*"),void e();var t}},a.createElement("div",{className:"history-item-header"},a.createElement("div",{className:"history-item-chat"},a.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--lion-primary)",strokeWidth:"2"},a.createElement("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})),n.chat_name),a.createElement("div",{className:"history-item-time"},(e=>{const t=new Date(e),n=(new Date).getTime()-t.getTime(),a=Math.floor(n/864e5);return 0===a?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):1===a?(0,s.t)("crm.yesterday")||"Yesterday":a<7?t.toLocaleDateString([],{weekday:"short"}):t.toLocaleDateString([],{month:"short",day:"numeric"})})(n.created_at))),a.createElement("div",{className:"history-item-meta"},a.createElement("div",{className:"history-item-agent"},a.createElement("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),a.createElement("circle",{cx:"12",cy:"7",r:"4"})),"sent"===t?a.createElement("span",null,(0,s.t)("agent.to")||"To",": ",n.to_agent_name):a.createElement("span",null,(0,s.t)("agent.from")||"From",": ",n.from_agent_name))),a.createElement("div",{className:"history-item-badges"},a.createElement("span",{className:"history-item-badge",style:{backgroundColor:`${h(n.priority)}20`,color:h(n.priority)}},a.createElement("span",{className:"history-item-badge-dot",style:{backgroundColor:h(n.priority)}}),(e=>{switch(e){case"urgent":return(0,s.t)("agent.priorityUrgent")||"Urgent";case"high":return(0,s.t)("agent.priorityHigh")||"High";case"medium":return(0,s.t)("agent.priorityMedium")||"Medium";case"low":return(0,s.t)("agent.priorityLow")||"Low";default:return e}})(n.priority)),a.createElement("span",{className:"history-item-badge",style:{backgroundColor:`${b(n.status)}20`,color:b(n.status)}},a.createElement("span",{className:"history-item-badge-dot",style:{backgroundColor:b(n.status)}}),(e=>{switch(e){case"pending":return(0,s.t)("agent.statusPending")||"Pending";case"accepted":return(0,s.t)("agent.statusAccepted")||"Accepted";case"in_service":return(0,s.t)("agent.statusInService")||"In Service";case"completed":return(0,s.t)("agent.statusCompleted")||"Completed";case"declined":return(0,s.t)("agent.statusDeclined")||"Declined";case"expired":return(0,s.t)("agent.statusExpired")||"Expired";default:return e}})(n.status))),n.reason&&a.createElement("div",{className:"history-item-reason"},n.reason),("in_service"===n.status||"completed"===n.status)&&n.started_at&&a.createElement("div",{className:"history-item-duration"},a.createElement("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2"},a.createElement("circle",{cx:"12",cy:"12",r:"10"}),a.createElement("polyline",{points:"12 6 12 12 16 14"})),(0,s.t)("agent.duration")||"Duration",": ",((e,t)=>{if(!e)return"-";const n=new Date(e).getTime(),a=(t?new Date(t).getTime():Date.now())-n,r=Math.floor(a/6e4),o=Math.floor(r/60);return o>0?`${o}h ${r%60}m`:`${r}m`})(n.started_at,n.completed_at)))))))))},Zb="wa-agent-transfer-container",ef=()=>{const[e,t]=(0,a.useState)([]),[r,o]=(0,a.useState)([]),[i,s]=(0,a.useState)(!1),[l,c]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(!Tg.isAgentMode())return;o(Tg.getActiveServices());const e=e=>{if("INCOMING_TRANSFERS"===e.type&&e.transfers){const n=e.transfers.map(e=>({id:e.id,chatId:e.chat_id||e.chatId,chatName:e.chat_name||e.chatName||e.chat_id||"Unknown Chat",fromAgentName:e.from_agent_name||e.fromAgentName||"Unknown Agent",fromAgentPhoneHash:e.from_agent_phone_hash||e.fromAgentPhoneHash||"",reason:e.reason||"",priority:e.priority||"medium",status:e.status||"pending",createdAt:e.created_at||e.createdAt||(new Date).toISOString()}));t(n)}};n().runtime.onMessage.addListener(e);const a=()=>{Tg.isAgentMode()||(t([]),o([]))};window.addEventListener("agentSettingsChanged",a);const r=e=>{o(e.detail)};window.addEventListener("activeServicesChanged",r);const i=()=>{s(!0)};return window.addEventListener("showTransferHistoryModal",i),()=>{n().runtime.onMessage.removeListener(e),window.removeEventListener("agentSettingsChanged",a),window.removeEventListener("activeServicesChanged",r),window.removeEventListener("showTransferHistoryModal",i)}},[]),(0,a.useEffect)(()=>{const e=()=>{try{const e=window.location.href.match(/\/([^/]+)(?:@[cg]\.us)?$/);if(e&&e[1]){const t=e[1].includes("@")?e[1]:`${e[1]}@c.us`;t!==l&&c(t)}}catch(e){}};e();const t=new MutationObserver(()=>{e()}),n=document.querySelector("#main");n&&t.observe(n,{childList:!0,subtree:!0});const a=setInterval(e,2e3);return()=>{t.disconnect(),clearInterval(a)}},[l]);const d=(0,a.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),m=(0,a.useCallback)((e,n)=>{t(t=>t.filter(t=>t.id!==e)),o(Tg.getActiveServices())},[]),p=(0,a.useCallback)(()=>{o(Tg.getActiveServices())},[]),u=l?r.find(e=>e.chatId===l):null;return Tg.isAgentMode()?a.createElement(a.Fragment,null,u&&a.createElement(Jb,{service:u,onEndService:p}),e.map(e=>a.createElement(Xb,{key:e.id,transfer:e,onClose:()=>d(e.id),onStartService:m})),i&&a.createElement(Qb,{onClose:()=>s(!1)})):null};let tf=null;function nf(){const e=function(){let e=document.getElementById(Zb);return e||(e=document.createElement("div"),e.id=Zb,e.style.cssText="\n      position: fixed;\n      top: 0;\n      left: 0;\n      width: 0;\n      height: 0;\n      z-index: 999998;\n      pointer-events: none;\n    ",document.body.appendChild(e)),e}();tf||(tf=(0,o.createRoot)(e)),tf.render(a.createElement(ef,null))}function af(){document.body?(window.addEventListener("message",e=>{if(e.source===window){if("NAVIGATE_TO_CHAT"===e.data?.type){const t=e.data.chatId;window.postMessage({type:"OPEN_CHAT",chatId:t},"*")}"SHOW_TRANSFER_HISTORY_MODAL"===e.data?.type&&window.dispatchEvent(new Event("showTransferHistoryModal"))}}),nf(),window.addEventListener("agentSettingsChanged",()=>{nf()}),setInterval(()=>{document.getElementById(Zb)||nf()},5e3),setTimeout(()=>{Tg.isAgentMode()&&Tg.syncToBackground()},2e3)):setTimeout(af,500)}const rf="wa_ai_bot_queue";class of{static getContactQueues(){try{const e=localStorage.getItem(rf);if(e)return JSON.parse(e)}catch(e){}return[]}static saveQueues(e){try{localStorage.setItem(rf,JSON.stringify(e))}catch(e){}}static getContactQueue(e){return this.getContactQueues().find(t=>t.chatId===e)}static addMessage(e,t,n,a="text",r){const o=this.getContactQueues();let i=o.find(t=>t.chatId===e);const s=r?1e3*r:Date.now(),l={id:`${e}_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,chatId:e,contactName:t,messageContent:n,messageType:a,timestamp:s,status:"pending",retryCount:0};return i?(i.messages.push(l),i.contactName=t,i.messages.length>100&&(i.messages=i.messages.filter(e=>"pending"===e.status||"processing"===e.status).concat(i.messages.filter(e=>"completed"===e.status||"failed"===e.status).slice(-20)))):(i={chatId:e,contactName:t,messages:[l],isProcessing:!1},o.push(i)),this.saveQueues(o),document.dispatchEvent(new CustomEvent("aiBotQueueUpdated",{detail:{chatId:e,messageId:l.id}})),l}static getNextPendingMessage(e){const t=this.getContactQueue(e);if(t)return t.messages.find(e=>"pending"===e.status)}static getAllPendingMessages(){const e=this.getContactQueues(),t=[];for(const n of e)t.push(...n.messages.filter(e=>"pending"===e.status));return t.sort((e,t)=>e.timestamp-t.timestamp)}static updateMessageStatus(e,t,n){const a=this.getContactQueues();for(const r of a){const a=r.messages.find(t=>t.id===e);if(a){a.status=t,"completed"!==t&&"failed"!==t||(a.processedAt=Date.now()),n&&(a.error=n),"failed"===t&&a.retryCount++;break}}this.saveQueues(a)}static setProcessing(e,t){const n=this.getContactQueues(),a=n.find(t=>t.chatId===e);a&&(a.isProcessing=t,t||(a.lastProcessedAt=Date.now()),this.saveQueues(n))}static isProcessing(e){const t=this.getContactQueue(e);return t?.isProcessing||!1}static retryMessage(e){const t=this.getContactQueues();for(const n of t){const a=n.messages.find(t=>t.id===e);if(a&&"failed"===a.status)return a.retryCount<3&&(a.status="pending",a.error=void 0,this.saveQueues(t),!0)}return!1}static removeMessage(e){const t=this.getContactQueues();for(const n of t){const t=n.messages.findIndex(t=>t.id===e);if(-1!==t){n.messages.splice(t,1);break}}this.saveQueues(t)}static cleanupOldMessages(e=24){const t=this.getContactQueues(),n=Date.now()-60*e*60*1e3;for(const e of t)e.messages=e.messages.filter(e=>"pending"===e.status||"processing"===e.status||(e.processedAt||e.timestamp)>n);const a=t.filter(e=>e.messages.length>0);this.saveQueues(a)}static getStats(){const e=this.getContactQueues();let t=0,n=0,a=0,r=0;for(const o of e)for(const e of o.messages)switch(e.status){case"pending":t++;break;case"processing":n++;break;case"completed":a++;break;case"failed":r++}return{totalContacts:e.length,totalPending:t,totalProcessing:n,totalCompleted:a,totalFailed:r}}static clearAll(){localStorage.removeItem(rf)}static getContactsWithPendingMessages(){return this.getContactQueues().filter(e=>e.messages.some(e=>"pending"===e.status)&&!e.isProcessing).map(e=>e.chatId)}}const sf=()=>{const e=(()=>{try{const e=n().runtime.getManifest().name||"";return e.includes("<<")?"Extension":e}catch{return"Extension"}})();return((0,s.t)("crm.lionRecovered")||"{brand} recovered").replace("{brand}",e)},lf="lion-ar-btn",cf="data-lion-ar-btn",df="lion-ar-styles";let mf=null,pf=null,uf=!1;const gf=(...e)=>{},hf=e=>{const t=e.querySelector(".wa-msg-translate-btn-inject, .wa-msg-translate-btn");if(t&&t.parentElement)return{parent:t.parentElement,before:t.nextSibling};const n=e.querySelector('[data-testid="react-btn"]')||e.querySelector('span[data-icon="react"]')?.closest("span")||e.querySelector('[aria-label*="React"]');if(n&&n.parentElement)return{parent:n.parentElement,before:n.nextSibling};const a=e.querySelector(".copyable-text")||e.querySelector("[data-pre-plain-text]")?.parentElement;return a?{parent:a,before:null}:{parent:e,before:null}},bf='\n<svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" aria-hidden="true">\n  <path d="M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/>\n</svg>'.trim(),ff=(e,t)=>{const n=document.createElement("button");n.className=lf,n.setAttribute("data-lion-msgid",t.msgId),n.title=sf(),n.innerHTML=bf;let a=!1,r=[],o=[];const i=()=>{const t=(()=>{const t=Array.from(e.querySelectorAll("span.selectable-text.copyable-text"));if(t.length>0)return t;const n=e.querySelector("em, i");if(n)return[n];const a=Array.from(e.querySelectorAll('span[data-testid="selectable-text"]'));if(a.length>0)return a;const r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let o=null,i=r.nextNode();for(;i;){const e=(i.textContent||"").trim().toLowerCase();if(e){for(const t of yf)if(e.includes(t)){o=i;break}if(o)break}i=r.nextNode()}if(o&&o.parentElement){let e=o.parentElement,t=0;for(;e&&t<4;){const n=(e.textContent||"").trim();if(n&&n.length<120)return[e];e=e.parentElement,t++}return[o.parentElement]}return[]})();return 0!==t.length&&(r=t,o=t.map(e=>e.innerHTML),!0)};return n.addEventListener("click",e=>{if(e.stopPropagation(),e.preventDefault(),(0===r.length||r.some(e=>!document.contains(e)))&&!i())return void 0;if(a)return r.forEach((e,t)=>{null!=o[t]&&document.contains(e)&&(e.innerHTML=o[t])}),n.classList.remove("active"),n.title=sf(),void(a=!1);const l=!(!t.body||!t.body.trim())?t.body:(0,s.t)("crm.noTextContent")||"(no text — media message)",c=(d=l,d.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")).split("\n").join("<br>");var d;r[0].innerHTML=`<span class="lion-ar-recovered-text">${c}</span>`;for(let e=1;e<r.length;e++)r[e].innerHTML="";n.classList.add("active"),n.title=(0,s.t)("crm.clickToShowOriginal")||"Click to show original",a=!0}),n},vf=e=>{let t=e;for(let e=0;e<8&&t;e++){if(t.matches?.('.message-in, [class*="message-in"]')||t.querySelector?.(".wa-msg-translate-btn")||t.querySelector?.('span[data-icon="react"]')||t.querySelector?.('[aria-label*="React"]')||t.querySelector?.('[data-testid="react-btn"]'))return t;t=t.parentElement}return e},yf=["this message was deleted","you deleted this message","esta mensaje fue eliminado","este mensaje fue eliminado","eliminaste este mensaje","此消息已删除","已删除此消息","このメッセージは削除されました","diese nachricht wurde gelöscht","du hast diese nachricht gelöscht","ce message a été supprimé","vous avez supprimé ce message","تم حذف هذه الرسالة","esta mensagem foi apagada","você apagou esta mensagem","сообщение удалено","это сообщение было удалено"],xf=e=>{if(!e)return!1;if(e.querySelector('span[data-icon*="prohibited" i]'))return!0;if(e.querySelector('svg[aria-label*="forbidden" i]'))return!0;const t=(e.textContent||"").trim().toLowerCase();if(!t)return!1;const n=t.replace(/\s*\d{1,2}[:.]\d{2}\s*(am|pm|a\.m\.|p\.m\.)?\s*$/i,"").trim();for(const e of yf)if(n.includes(e))return!0;return!1},wf=()=>{if(!uf){uf=!0;try{const e=lh.getSettings();if(!e.enabled)return;const t=document.querySelector("#main");if(!t)return void 0;(e=>{e.querySelectorAll(`.${lf}`).forEach(e=>{let t=e.parentElement;for(let e=0;e<10&&t&&!t.matches?.('.message-in, [class*="message-in"]')&&!t.querySelector?.("[data-id]");e++)t=t.parentElement;t&&!xf(t)&&(e.remove(),t.removeAttribute(cf),t.removeAttribute("data-lion-ar-matched-msgid"))})})(t);const n=(()=>{const e=document.querySelector("#main");if(!e)return null;const t=e.querySelector("[data-id]");if(t){const e=t.getAttribute("data-id")||"";if(e.includes("_")){const t=e.split("_");if(t.length>=3)return t.slice(1,-1).join("_")}}return null})();let a=lh.getRevokedMessages(n||void 0);if(a=a.slice().sort((e,t)=>e.timestamp-t.timestamp),0===a.length)return;const r=(e=>{const t=[],n=new Set,a=e.querySelectorAll("[data-id]");return a.forEach(e=>{const a=vf(e);a&&!n.has(a)&&(n.add(a),xf(a)&&t.push(a))}),t})(t);if(0===r.length)return;const o=Math.min(r.length,a.length),i=r.length-o,s=a.length-o;let l=0,c=0,d=0;for(let e=0;e<o;e++){const t=r[e+i],n=a[e+s],o=t.querySelector(".wa-msg-translate-btn-inject, .wa-msg-translate-btn"),m=t.querySelector(`.${lf}`);if(m){if(o&&o.parentElement){m.parentElement===o.parentElement||(o.parentElement.insertBefore(m,o.nextSibling),c++)}t.setAttribute(cf,"1");continue}const p=hf(t);if(!p){d++;continue}const u=ff(t,n);p.parent.insertBefore(u,p.before),t.setAttribute(cf,"1"),t.setAttribute("data-lion-ar-matched-msgid",n.msgId),l++,gf(n.body?.slice(0,40))}}finally{uf=!1}}},kf=()=>{pf&&clearTimeout(pf),pf=setTimeout(wf,150)},Ef=()=>{lh.getSettings(),lh.getRevokedCount(),(()=>{if(document.getElementById(df))return;const e=document.createElement("style");e.id=df,e.textContent=`\n    .${lf} {\n      display: inline-flex;\n      align-items: center;\n      justify-content: center;\n      width: 28px;\n      height: 28px;\n      padding: 5px;\n      margin-left: 4px;\n      background: transparent;\n      border: none;\n      border-radius: 50%;\n      color: #6b7280;\n      cursor: pointer;\n      transition: all 0.15s ease;\n      flex-shrink: 0;\n      opacity: 0.7;\n      vertical-align: middle;\n      position: relative;\n      z-index: 10;\n    }\n    .${lf}:hover {\n      color: var(--lion-primary, ${ca.primary});\n      opacity: 1;\n      background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.1);\n    }\n    .${lf}.active {\n      color: var(--lion-primary, ${ca.primary});\n      background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.15);\n      opacity: 1;\n    }\n    .${lf}.active:hover {\n      background: rgba(var(--lion-primary-rgb, 37, 99, 235), 0.25);\n    }\n    .${lf} svg {\n      display: block;\n    }\n    .lion-ar-recovered-text {\n      color: #111b21;\n      font-style: normal;\n      font-weight: normal;\n      opacity: 1;\n      white-space: pre-wrap;\n      word-break: break-word;\n    }\n    /* WhatsApp dark theme support — match WA's own message text color */\n    body[data-theme="dark"] .lion-ar-recovered-text,\n    [class*="dark"] .lion-ar-recovered-text {\n      color: #e9edef;\n    }\n  `,document.head.appendChild(e)})(),setTimeout(()=>{wf()},1500),setTimeout(()=>{wf()},4e3),mf&&mf.disconnect(),mf=new MutationObserver(e=>{let t=!1;for(const n of e){if(t)break;for(const e of Array.from(n.addedNodes))if(e instanceof HTMLElement&&(e.hasAttribute?.("data-id")||e.querySelector?.("[data-id]")||e.matches?.('.message-in, [class*="message-in"]')||e.querySelector?.('.message-in, [class*="message-in"]')||e.matches?.(".wa-msg-translate-btn, .wa-msg-translate-btn-inject")||e.querySelector?.(".wa-msg-translate-btn, .wa-msg-translate-btn-inject"))){t=!0;break}}t&&kf()});const e=()=>{const t=document.querySelector("#main");t?mf?.observe(t,{childList:!0,subtree:!0}):setTimeout(e,2e3)};e(),window.addEventListener("lionAntiRevokeUpdated",()=>{setTimeout(wf,100),setTimeout(wf,400),setTimeout(wf,900),setTimeout(wf,1800)}),window.addEventListener("storage",e=>{"lion_anti_revoke_settings"===e.key&&kf()}),document.addEventListener("click",()=>{setTimeout(kf,500)},{capture:!0})};async function Sf(e,t,n){const a=Sr.getSettings();switch(a.actionToggles.normalReply&&n.reply&&await async function(e,t){return new Promise((n,a)=>{const r=setTimeout(()=>{document.removeEventListener("AI_BOT_SEND_REPLY_RESPONSE",o),a(new Error("Send reply timeout"))},3e4),o=t=>{const{chatId:i,success:s,error:l}=t.detail;i===e&&(clearTimeout(r),document.removeEventListener("AI_BOT_SEND_REPLY_RESPONSE",o),s?n():a(new Error(l||"Failed to send reply")))};document.addEventListener("AI_BOT_SEND_REPLY_RESPONSE",o),window.postMessage({type:"AI_BOT_SEND_REPLY",chatId:e,message:t},"*")})}(e,n.reply),n.action){case"UPDATE_TABS":a.actionToggles.updateTabs&&n.actionData&&await async function(e,t,n){try{const a=d.TabsStorage.getTabs();let r=n.tabId?a.find(e=>e.id===n.tabId):a.find(e=>e.title.toLowerCase()===n.tabName?.toLowerCase());const o=n.tabAction||"add";if(!r&&n.createIfNotExists&&n.tabName&&"add"===o){r=d.TabsStorage.addTab({title:n.tabName,details:`Auto-created for ${n.tabName} leads`,chats:[],isPermanent:!1})}if(!r)return;const i=r.chats||[];if("add"===o){if(!i.some(t=>t.id===e)){const n={id:e,name:t,type:"individual"},a=[...i,n];d.TabsStorage.updateTab(r.id,{chats:a})}}else{const t=i.filter(t=>t.id!==e);d.TabsStorage.updateTab(r.id,{chats:t})}!function(e,t,n,a,r){try{const o=localStorage.getItem("webhook_settings");if(!o)return;const i=JSON.parse(o).custom_tabs;if(!i||!i.active||!i.url)return;const s=v.getContact(e),l=s?.profile?.name||t,c={},m=i.dataFields&&i.dataFields.length>0?i.dataFields:Cf;c.tab={id:n,name:a,color:null},m.forEach(t=>{if(t.enabled)switch(t.id){case"event_details":c.event={type:"custom_tabs",action:`ai_bot_${r}`,timestamp:Date.now()};break;case"number":c.number=e.split("@")[0];break;case"name":c.name=l;break;case"tab_id":c.tabId=n;break;case"tab_name":c.tabName=a;break;case"tab_color":c.tabColor=null;break;case"all_tabs":const t=d.TabsStorage.getTabs().filter(t=>t.chats?.some(t=>t.id===e));c.allTabs=t.map(e=>({id:e.id,name:e.title,color:e.labelColor||null}));break;case"contact_profile":s&&s.profile&&(c.contactProfile={fullName:s.profile.name||l,phone:s.profile.phone||e.split("@")[0],email:s.profile.email||null,gender:s.profile.gender||null,dateOfBirth:s.profile.dateOfBirth||null,details:s.profile.details||null,address:s.profile.address||null,language:s.profile.language||null,customFields:s.profile.customFields||[]})}}),chrome.runtime.sendMessage({type:"SEND_WEBHOOK",url:i.url,payload:c,eventType:"custom_tabs"})}catch(e){}}(e,t,r.id,r.title,o)}catch(e){}}(e,t,n.actionData);break;case"CREATE_APPOINTMENT":a.actionToggles.createAppointment&&n.actionData&&await async function(e,t,n){try{if(!n.appointmentTitle||!n.appointmentDateTime)return;const a=new Date(n.appointmentDateTime).getTime();if(isNaN(a))return;const r=Sr.getSettings().appointmentConfig||{meetLink:"",messageTemplate:""},o=e.split("@")[0],i=v.getContact(e),s=i?.profile?.name||t,l=new Date(a),c=l.toLocaleDateString("pt-BR",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),d=l.toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit",hour12:!0});let m=r.messageTemplate||"Appointment: {name} on {date} at {time}";m=m.replace(/\{name\}/g,s).replace(/\{date\}/g,c).replace(/\{time\}/g,d).replace(/\{link\}/g,r.meetLink||"");const p=r.meetLink||"";v.addAppointment(e,n.appointmentTitle,a,[{id:e,name:s,phone:o}],m,p,15),function(e,t,n){try{const a=localStorage.getItem("webhook_settings");if(!a)return;const r=JSON.parse(a).appointment;if(!r||!r.active||!r.url)return;chrome.runtime.sendMessage({type:"SEND_WEBHOOK",url:r.url,payload:{event:{type:"appointment",action:"ai_bot_created",timestamp:Date.now()},number:e.split("@")[0],name:t,appointmentTime:n.datetime,appointmentTimeFormatted:new Date(n.datetime).toLocaleString(),meetingLink:n.meetLink||null,appointment:{title:n.title,datetime:n.datetime,datetimeFormatted:new Date(n.datetime).toLocaleString(),meetLink:n.meetLink,message:n.message}},eventType:"appointment"})}catch(e){}}(e,s,{title:n.appointmentTitle,datetime:a,meetLink:p,message:m});(r.sendMessageImmediately??!0)&&m.trim()&&window.postMessage({type:"SEND_APPOINTMENT_MESSAGE_NOW",attendeeId:e,attendeeName:s,message:m},"*")}catch(e){}}(e,t,n.actionData);break;case"UPDATE_PROFILE":a.actionToggles.updateProfile&&n.actionData?.extractedData&&await async function(e,t){try{const n=e.split("@")[0],a=t.name||n,r=v.getOrCreateContact(e,a,n);if(!r)return;const o={};if(t.name&&(o.name=t.name),t.email&&(o.email=t.email),t.gender&&(o.gender=t.gender),t.dateOfBirth&&(o.dateOfBirth=t.dateOfBirth),t.address&&(o.address=t.address),t.language&&(o.language=t.language),t.details&&(o.details=t.details),t.customFields&&t.customFields.length>0){const e=r.profile?.customFields||[],n=new Map,a=e=>e.toLowerCase().replace(/[^a-z0-9]/g,"").replace(/name$/,"").replace(/id$/,"").replace(/handle$/,"").replace(/url$/,"").replace(/link$/,"");for(const t of e){const e=a(t.label);n.set(e,t)}for(const e of t.customFields){if(!e.label||!e.value)continue;const t=a(e.label),r=n.get(t);r?r.value=e.value:n.set(t,{id:`cf-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,label:e.label,value:e.value,createdAt:Date.now()})}o.customFields=Array.from(n.values())}const i=Object.keys(o).filter(e=>"customFields"!==e).length>0,s=o.customFields&&o.customFields.length>0;if(!i&&!s)return;v.updateProfile(e,o)&&function(e,t){try{const n=localStorage.getItem("webhook_settings");if(!n)return;const a=JSON.parse(n).contact_profile;if(!a||!a.active||!a.url)return;chrome.runtime.sendMessage({type:"SEND_WEBHOOK",url:a.url,payload:{event:{type:"contact_profile",action:"ai_bot_update",timestamp:Date.now()},number:e.split("@")[0],profile:t},eventType:"contact_profile"})}catch(e){}}(e,o)}catch(e){}}(e,n.actionData.extractedData);break;case"STOP_BOT":v.setAIBotBlacklisted(e,!0)}}const Cf=[{id:"event_details",label:"Event Details",enabled:!0},{id:"number",label:"Number",enabled:!0},{id:"name",label:"Name",enabled:!0},{id:"tab_id",label:"Tab ID",enabled:!0},{id:"tab_name",label:"Tab Name",enabled:!0},{id:"tab_color",label:"Tab Color",enabled:!1},{id:"all_tabs",label:"All Contact Tabs",enabled:!1},{id:"contact_profile",label:"Contact Profile",enabled:!1}];const Tf=e=>new Promise(t=>setTimeout(t,e));const Af=new class{constructor(){this.isRunning=!1,this.processingChats=new Set,this.loopInterval=1e3}start(){this.isRunning||(this.isRunning=!0,this.processLoop())}stop(){this.isRunning=!1}async processLoop(){for(;this.isRunning;){try{const e=of.getContactsWithPendingMessages();e.length>0&&await Promise.all(e.map(e=>this.processContactQueue(e)))}catch(e){}await Tf(this.loopInterval)}}async processContactQueue(e){if(this.processingChats.has(e))return;const t=of.getNextPendingMessage(e);if(t&&this.shouldProcess(e))if(Sr.isMessageAfterEnabled(t.timestamp/1e3)){try{if(!await $r.messageMatchesTriggerWords(t.messageContent))return void of.updateMessageStatus(t.id,"completed")}catch(e){}try{if(await no.shouldEscalate(t.messageContent,e)){const{message:n}=await no.performEscalation(e);return await Sf(e,t.contactName,{action:"NORMAL",reply:n}),void of.updateMessageStatus(t.id,"completed")}}catch(e){}this.processingChats.add(e),of.setProcessing(e,!0),of.updateMessageStatus(t.id,"processing");try{const n=Sr.getRandomDelay();if(await Tf(1e3*n),!this.shouldProcess(e))return void of.updateMessageStatus(t.id,"pending");await this.processMessage(e,t),of.updateMessageStatus(t.id,"completed")}catch(n){of.updateMessageStatus(t.id,"failed",n.message||"Unknown error");const a=of.getContactQueue(e),r=a?.messages.find(e=>e.id===t.id);r&&r.retryCount<3&&of.retryMessage(t.id)}finally{this.processingChats.delete(e),of.setProcessing(e,!1)}}else of.updateMessageStatus(t.id,"completed")}shouldProcess(e){return!!Sr.shouldProcessChat(e)&&!v.isAIBotBlacklisted(e)}async processMessage(e,t){try{const n=await this.getConversationContext(e),a=v.getContact(e),r=await Jr.processMessage(e,t.contactName,t.messageContent,n,a);if(!r)return;await Sf(e,t.contactName,r);try{const n=(await $r.getKBSettings()).fallbackMessage||"";if(n){if((await no.checkAfterReply(e,r.reply||"",n)).shouldEscalate){const{message:n}=await no.performEscalation(e);await Sf(e,t.contactName,{action:"NORMAL",reply:n})}}}catch(e){}}catch(e){throw e}}getConversationContext(e){return new Promise((t,n)=>{const a=setTimeout(()=>{document.removeEventListener("AI_BOT_CONTEXT_RESPONSE",r),n(new Error("Context fetch timeout"))},1e4),r=o=>{const{chatId:i,messages:s,error:l}=o.detail;i===e&&(clearTimeout(a),document.removeEventListener("AI_BOT_CONTEXT_RESPONSE",r),l?n(new Error(l)):t(s||[]))};document.addEventListener("AI_BOT_CONTEXT_RESPONSE",r),window.postMessage({type:"AI_BOT_GET_CONTEXT",chatId:e,count:Sr.getContextMessageCount()},"*")})}},Df={string:/.+/,phone:/^\+?[1-9]\d{6,14}$/,number:/^-?\d+(\.\d+)?$/,email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/[^\s]+$/,datetime:/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2})?)?$/};function _f(e,t){return t.customSignatureEnabled?t.disableSignature?e:t.customSignature&&t.customSignature.trim()?`*- ${t.customSignature.trim()}*\n\n${e}`:e:e}const Nf="wa_chatbot_flows",Mf="wa_kanban_crm_data_sync",If="kanban_chats",Rf="wa_extension_tabs";let Bf=[],Pf=null,Lf=[],Uf=null;const Ff="fluxo_global_settings",zf="fluxo_conversation_states",Of="fluxo_first_message_tracking",Wf="fluxo_trigger_history",qf="fluxo_pause_states";let Hf={},jf={},Vf={},Gf=_u.CQ,Kf={},$f={},Yf=!1,Xf=!1,Jf=[];const Qf=new Set;async function Zf(){Yf||(!function(){try{const e=localStorage.getItem(zf);e&&(Hf=JSON.parse(e))}catch(e){}}(),function(){try{const e=localStorage.getItem(Of);e&&(jf=JSON.parse(e))}catch(e){}}(),function(){try{const e=localStorage.getItem(Wf);e&&(Kf=JSON.parse(e))}catch(e){}}(),function(){try{const e=localStorage.getItem(qf);e&&($f=JSON.parse(e))}catch(e){}}(),document.addEventListener("waMessageForFluxo",e=>gv(e)),window.addEventListener("message",e=>{if("FLUXO_MESSAGE_BRIDGE"!==e.data?.type)return;const t=e.data.payload;if(!t||"waMessageForFluxo"!==t.type)return;const n=t.ts;window.postMessage({type:"FLUXO_MESSAGE_ACK",ts:n,timestamp:Date.now()},"*");const a=`ts_${n}`;if(n&&Qf.has(a))return;n&&Qf.add(a);gv(new CustomEvent("waMessageForFluxo",{detail:t.detail}))}),await async function(){try{if(await Promise.all([av(),mv(),ev(),tv(),nv()]),Gf.awayMessage,Xf=!0,Jf.length>0){const e=[...Jf];Jf=[];for(const t of e)await gv(t)}}catch(e){Xf=!0}}(),n().storage.onChanged.addListener((e,t)=>{"local"===t&&(e[Nf]&&(Bf=e[Nf].newValue||[]),e[Ff]&&(Gf={..._u.CQ,...e[Ff].newValue}),e[Mf]&&(Pf=e[Mf].newValue||null),e[If]&&(Lf=e[If].newValue||[]),e[Rf]&&(Uf=e[Rf].newValue||null))}),window.postMessage({type:"FLUXO_DEBUG_INIT",message:"FluxoProcessor initialized successfully",timestamp:Date.now()},"*"),document.addEventListener("fluxoExecuteResponse",e=>function(e){e.detail}(e)),setInterval(()=>{!async function(){const e=Date.now();Object.keys(Vf).length,Object.keys(Hf).length;let t=60*Gf.awayWaitingTime*1e3;"hours"===Gf.awayWaitingUnit&&(t=60*Gf.awayWaitingTime*60*1e3);for(const[n,a]of Object.entries(Hf))if(a.waitingForResponse&&!a.awayMessageSent&&e-a.lastMessageTime>=t&&Gf.awayMessage){const e=Ev(Gf.awayMessage,a.variables,"","");await Dv(n,e),a.awayMessageSent=!0,rv()}for(const[n,a]of Object.entries(Vf))if(!a.awayMessageSent&&e-a.messageTime>=t&&Gf.awayMessage&&Gf.awayMessage.trim()){const e=Ev(Gf.awayMessage,{},a.contactName,a.contactNumber);await Dv(n,e),a.awayMessageSent=!0}const n=e-864e5;for(const[e,t]of Object.entries(Vf))t.messageTime<n&&delete Vf[e]}()},3e4),window.addEventListener("message",async e=>{if("fluxoManualTrigger"===e.data?.type){const{flowId:t,chatId:n,requestId:a}=e.data;try{await Nv(t,n),window.postMessage({type:"fluxoManualTriggerResponse",requestId:a,success:!0},"*")}catch(e){window.postMessage({type:"fluxoManualTriggerResponse",requestId:a,success:!1,error:e instanceof Error?e.message:"Unknown error"},"*")}}}),Yf=!0,window.__fluxoProcessorReady=!0)}async function ev(){try{const e=await n().storage.local.get(Mf);Pf=e[Mf]||null}catch(e){Pf=null}}async function tv(){try{const e=await n().storage.local.get(If);Lf=e[If]||[]}catch(e){Lf=[]}}async function nv(){try{const e=await n().storage.local.get(Rf);Uf=e[Rf]||null}catch(e){Uf=null}}async function av(){try{const e=await n().storage.local.get(Nf);Bf=e[Nf]||[],Bf.length>0&&Bf.forEach(e=>{})}catch(e){Bf=[]}}function rv(){try{localStorage.setItem(zf,JSON.stringify(Hf))}catch(e){}}function ov(){try{localStorage.setItem(Wf,JSON.stringify(Kf))}catch(e){}}function iv(){try{localStorage.setItem(qf,JSON.stringify($f))}catch(e){}}function sv(e,t){const n=`${e}_${t}`,a=$f[n];if(!a)return!1;const r=Date.now()-a.pausedAt;if(r>=a.pauseDurationMs)return delete $f[n],iv(),!1;a.pauseDurationMs;return!0}function lv(e,t,n,a,r){$f[`${e}_${t}`]={chatId:e,flowId:t,pausedAt:Date.now(),pauseDurationMs:60*r*1e3,pauseReason:n,keyword:a},iv()}function cv(e,t){const n=`${e}_${t}`;$f[n]&&(delete $f[n],iv())}function dv(e,t){if(!t.rules.pauseEnabled||!t.rules.pauseClientKeywords||0===t.rules.pauseClientKeywords.length)return null;const n=e.toLowerCase();return t.rules.pauseClientKeywords.find(e=>n.includes(e.toLowerCase()))||null}async function mv(){try{const e=await n().storage.local.get(Ff);e[Ff]&&(Gf={..._u.CQ,...e[Ff]})}catch(e){}}function pv(){const e=Bf.filter(e=>e.isActive);return e.length>0&&e.forEach(e=>{}),e}function uv(e,t){window.postMessage({type:"FLUXO_PROCESSOR_DEBUG",status:e,data:t,timestamp:Date.now()},"*")}async function gv(e){const t=e.detail;if(uv("HANDLER_ENTRY",{hasDetail:!!t,direction:t?.direction}),!t||"incoming"!==t.direction)return void uv("SKIPPED_NOT_INCOMING",{direction:t?.direction});if(!Xf)return uv("QUEUED_ASYNC_NOT_LOADED",{queueSize:Jf.length+1}),void Jf.push(e);const n=t.chatId;if(n&&(n.includes("@newsletter")||n.includes("@broadcast")||n.includes("newsletter")))return void uv("SKIPPED_NEWSLETTER",{chatId:n});const a=(t.messageContent||"").trim(),r=t.contactName||"",o=t.contactNumber||"",i=t.openChatId||null,s=n.includes("@g.us");uv("PROCESSING",{chatId:n,messageText:a,isAsyncDataLoaded:Xf});const l=t.messageId||`${n}_${t.timestamp}`;if(Qf.has(l))return void uv("SKIPPED_DUPLICATE",{messageId:l});if(Qf.add(l),Qf.size>1e3){Array.from(Qf).slice(0,500).forEach(e=>Qf.delete(e))}const c=pv();for(const e of c){const t=dv(a,e);if(t)return lv(n,e.id,"client",t,e.rules.pauseDurationMinutes||30),uv("FLOW_PAUSED_CLIENT",{flowName:e.name,keyword:t}),void(Hf[n]?.flowId===e.id&&Cv(n))}const d=Hf[n];if(d&&d.waitingForResponse)return uv("HANDLING_FLOW_RESPONSE",{chatId:n}),delete Vf[n],void await async function(e,t,n,a,r){const o=pv();if(n.lastMessageTime=Date.now(),n.awayMessageSent=!1,n.pendingResponseNodes&&n.pendingResponseNodes.length>0){const i=Date.now(),s=n.pendingResponseNodes.findIndex(e=>e.timeoutAt>i);if(-1!==s){const l=n.pendingResponseNodes[s];n.pendingResponseNodes.splice(s,1),n.pendingResponseNodes=n.pendingResponseNodes.filter(e=>e.timeoutAt>i);const c=o.find(e=>e.id===l.flowId);if(c){const o=c.nodes.find(e=>e.id===l.nodeId);if(o){o.data?.saveResponseAs&&(n.variables[o.data.saveResponseAs]=t);const i=xv(c,l.nodeId,"response");if(i)return n.waitingForResponse=!1,rv(),void await wv(c,i,e,a,r)}}}else n.pendingResponseNodes=[],rv()}const i=o.find(e=>e.id===n.flowId);if(!i)return void Cv(e);const s=i.nodes.find(e=>e.id===n.currentNodeId);if(!s)return void(n.pendingResponseNodes&&0!==n.pendingResponseNodes.length||Cv(e));if(n.waitingForResponse=!1,"responses"===s.type){const o=s.data.responseOptions||[],l=parseInt(t.trim())-1;if(l>=0&&l<o.length){s.data.saveResponseAs&&(n.variables[s.data.saveResponseAs]=o[l].text);const t=xv(i,s.id,`response_${l}`);if(t)rv(),await wv(i,t,e,a,r);else{const t=xv(i,s.id,"default");t?(rv(),await wv(i,t,e,a,r)):Cv(e)}}else{const t=xv(i,s.id,"default");if(t)rv(),await wv(i,t,e,a,r);else{n.waitingForResponse=!0,rv();const t=_f(`${Ev(s.data.message||"",n.variables,a,r)}\n\n${(s.data.responseOptions||[]).map((e,t)=>`${t+1}. ${e.text}`).join("\n")}`,i.rules);await Dv(e,t,i.rules.simulateTyping)}}}else if("send_list"===s.type){const o=s.data.listData,l=o?.sections?.[0]?.rows||[],c=parseInt(t.trim())-1;let d=-1;if(d=c>=0&&c<l.length?c:l.findIndex(e=>e.title.toLowerCase().trim()===t.toLowerCase().trim()),d>=0){s.data.saveResponseAs&&(n.variables[s.data.saveResponseAs]=l[d].title);const t=xv(i,s.id,`item_${d}`);if(t)rv(),await wv(i,t,e,a,r);else{const t=xv(i,s.id,"default");t?(rv(),await wv(i,t,e,a,r)):Cv(e)}}else{const t=xv(i,s.id,"default");t?(rv(),await wv(i,t,e,a,r)):(n.waitingForResponse=!0,rv(),o&&await _v(e,o,i.rules.simulateTyping))}}else if("wait_input"===s.type){const o=s.data.inputType||"string",l=s.data.customRegex,c=function(e,t,n){const a=e.trim();if(!a)return!1;if(n)try{return new RegExp(n).test(a)}catch(e){return!1}const r=function(e,t){const n=e.trim();switch(t){case"phone":return n.replace(/[\s\-\(\)\.]/g,"");case"email":return n.toLowerCase();default:return n}}(a,t);return Df[t].test(r)}(t,o,l);if(c){const l=function(e,t){const n=e.trim();switch(t){case"phone":return n.replace(/[\s\-\(\)\.]/g,"");case"email":return n.toLowerCase();case"number":case"datetime":case"string":default:return n;case"url":return n.startsWith("http://")||n.startsWith("https://")?n:`https://${n}`}}(t,o);s.data.saveResponseAs&&(n.variables[s.data.saveResponseAs]=l),n.inputTimeoutAt=void 0,n.inputTimeoutNodeId=void 0,n.inputRetryCount=void 0;const c=xv(i,s.id,"response");if(c)rv(),await wv(i,c,e,a,r);else{const t=xv(i,s.id,"next");t?(rv(),await wv(i,t,e,a,r)):Cv(e)}}else{n.inputRetryCount=(n.inputRetryCount||0)+1,n.waitingForResponse=!0,rv();const t=Math.floor(7e3*Math.random())+3e3;await Tv(t);const l=Ev(s.data.errorMessage||"Invalid input. Please try again.",n.variables,a,r),c=function(e){switch(e){case"phone":return"e.g., 919876543210 or +5511999999999";case"number":return"e.g., 25 or 3.14";case"email":return"e.g., user@example.com";case"url":return"e.g., https://example.com";case"datetime":return"e.g., 2024-03-15 or 2024-03-15T14:30";default:return""}}(o),d=c?`${l}\n\n(${c})`:l;await Dv(e,d,i.rules.simulateTyping);const m=_f(Ev(s.data.prompt||"Please enter your response:",n.variables,a,r),i.rules);await Dv(e,m,i.rules.simulateTyping)}}else{s.data.saveResponseAs&&(n.variables[s.data.saveResponseAs]=t);const o=xv(i,s.id,"response");if(o)rv(),await wv(i,o,e,a,r);else{const t=xv(i,s.id,"next");t?(rv(),await wv(i,t,e,a,r)):Cv(e)}}}(n,a,d,r,o);uv("CHECKING_FLOWS",{flowCount:c.length,messageText:a,flowNames:c.map(e=>e.name)});let m=!1;for(const e of c){if(sv(n,e.id)){uv("FLOW_SKIPPED_PAUSED",{flowName:e.name,chatId:n});continue}const t=hv(e,n,a,s);if(uv("CHECKING_FLOW",{flowName:e.name,shouldTrigger:t,triggers:e.triggers}),t){if(uv("FLOW_MATCHED",{flowName:e.name}),!await bv(e,n,s,i)){uv("FLOW_RULES_FAILED",{flowName:e.name});continue}cv(n,e.id),delete Vf[n],m=!0,Sv(n),uv("FLOW_EXECUTING",{flowName:e.name,chatId:n}),await yv(e,n,r,o),uv("FLOW_EXECUTED",{flowName:e.name}),Kf[n]||(Kf[n]={}),Kf[n][e.id]=Date.now(),ov();break}}m||(uv("NO_FLOW_TRIGGERED",{chatId:n,flowCount:c.length}),Gf.awayMessage&&Gf.awayMessage.trim()&&(Vf[n]={chatId:n,contactName:r,contactNumber:o,messageTime:Date.now(),awayMessageSent:!1}))}function hv(e,t,n,a){const r=e.triggers,o=n.toLowerCase(),i=(new Date).toISOString().split("T")[0],s=jf[t];if(!function(e,t){if(!e.reactivationInterval||e.reactivationInterval<=0)return!0;const n=Kf[t];if(!n||!n[e.id])return!0;const a=n[e.id];return Date.now()-a>=("hours"===e.reactivationUnit?60*e.reactivationInterval*60*1e3:60*e.reactivationInterval*1e3)}(e,t))return!1;if(!0===r.anyMessage)return!0;if(r.keywords&&r.keywords.length>0){if(r.keywords.some(e=>o.includes(e.toLowerCase())))return!0}return!(!0!==r.firstMessageEver||s&&s.firstEver)||!(!0!==r.firstMessageDay||s&&s.firstToday===i)}async function bv(e,t,n,a){const r=e.rules;if(r.dontRespondIfOpen&&a&&t===a)return!1;if(n&&!r.allowGroups)return!1;if(r.scheduleEnabled&&r.schedule){const e=new Date,t=e.getDay(),n=60*e.getHours()+e.getMinutes();if(r.schedule.days&&!r.schedule.days.includes(t))return!1;if(r.schedule.startTime&&r.schedule.endTime){const[e,t]=r.schedule.startTime.split(":").map(Number),[a,o]=r.schedule.endTime.split(":").map(Number);if(n<60*e+t||n>60*a+o)return!1}}if(r.dontRespondIfInCRM&&function(e){try{if(!Pf)return!1;const t=(Pf.assignments||[]).find(t=>t.chatId===e);if(!t)return!1;const n=Pf.stages||{},a=(n[t.crmId]||[]).find(e=>e.id===t.stageId);return!a||"INBOX"!==a.name}catch(e){return!1}}(t))return!1;if(r.dontRespondToCRMs&&r.dontRespondToCRMs.length>0){const e=Pf?.assignments?.find(e=>e.chatId===t);if(e&&r.dontRespondToCRMs.includes(e.stageId))return!1}if(r.respondOnlyToCRMs&&r.respondOnlyToCRMs.length>0){const e=Pf?.assignments?.find(e=>e.chatId===t);if(!e||!r.respondOnlyToCRMs.includes(e.stageId))return!1}if(r.dontRespondIfTagged||r.dontRespondToTags&&r.dontRespondToTags.length>0||r.respondOnlyToTags&&r.respondOnlyToTags.length>0){const e=await async function(e){try{let t=document.getElementById("__fluxo_label_bridge__");t||(t=document.createElement("div"),t.id="__fluxo_label_bridge__",t.style.display="none",document.body.appendChild(t));const n=`label_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;return new Promise(a=>{const r=setTimeout(()=>{o.disconnect(),a(fv(e))},2e3),o=new MutationObserver(e=>{for(const i of e)if("data-response"===i.attributeName){const e=t.getAttribute("data-response");if(e)try{const t=JSON.parse(e);if(t.requestId===n)return clearTimeout(r),o.disconnect(),void a(t.labelIds||[])}catch(e){}}});o.observe(t,{attributes:!0,attributeFilter:["data-response"]}),t.setAttribute("data-request",JSON.stringify({chatId:e,requestId:n}))})}catch(t){return fv(e)}}(t);if(r.dontRespondIfTagged&&e.length>0)return!1;if(r.dontRespondToTags&&r.dontRespondToTags.length>0){if(r.dontRespondToTags.some(t=>e.includes(t)))return!1}if(r.respondOnlyToTags&&r.respondOnlyToTags.length>0){if(0===e.length)return!1;if(!r.respondOnlyToTags.some(t=>e.includes(t)))return!1}}if(r.dontRespondIfInCustomTab){if(vv(t))return!1}if(r.dontRespondToCustomTabs&&r.dontRespondToCustomTabs.length>0){const e=vv(t);if(e&&r.dontRespondToCustomTabs.includes(e))return!1}if(r.respondOnlyToCustomTabs&&r.respondOnlyToCustomTabs.length>0){const e=vv(t);if(!e||!r.respondOnlyToCustomTabs.includes(e))return!1}return!0}function fv(e){try{if(!Lf||0===Lf.length)return[];const t=Lf.find(t=>t.id===e);if(!t)return[];const n=t.whatsappLabels||[];return n.length,n}catch(e){return[]}}function vv(e){try{if(!Uf||!Uf.tabs)return null;for(const t of Uf.tabs){if(t.isPermanent)continue;const n=t.chats?.some(t=>t.id===e);if(n)return t.id}return null}catch(e){return null}}async function yv(e,t,n,a){const r=e.nodes.find(e=>"start"===e.type);if(!r)return;Hf[t]={flowId:e.id,currentNodeId:r.id,variables:{},waitingForResponse:!1,lastMessageTime:Date.now()},rv();const o=xv(e,r.id);o&&await wv(e,o,t,n,a)}function xv(e,t,n){const a=e.edges.find(e=>e.source===t&&(!n||e.sourceHandle===n));return a&&e.nodes.find(e=>e.id===a.target)||null}async function wv(e,t,a,r,o){const i=Hf[a];if(!i)return;i.currentNodeId=t.id,i.lastMessageTime=Date.now(),rv();const s=1e3*(t.data.delay||Gf.blockInterval||1);switch(t.type){case"send_text":await Tv(s);const l=Ev(t.data.message||"",i.variables,r,o),c=_f(l,e.rules);await Dv(a,c,e.rules.simulateTyping);const d=function(e,t){if(!t.rules.pauseEnabled||!t.rules.pauseServerKeywords||0===t.rules.pauseServerKeywords.length)return null;const n=e.toLowerCase();return t.rules.pauseServerKeywords.find(e=>n.includes(e.toLowerCase()))||null}(l,e);if(d)return lv(a,e.id,"server",d,e.rules.pauseDurationMinutes||30),uv("FLOW_PAUSED_SERVER",{flowName:e.name,keyword:d}),void Cv(a);const m=xv(e,t.id,"next"),p=e.edges.some(e=>e.source===t.id&&"response"===e.sourceHandle);if(m){if(p||t.data.saveResponseAs){const n=60*(t.data.responseTimeout||5)*1e3;i.pendingResponseNodes||(i.pendingResponseNodes=[]),i.pendingResponseNodes.push({nodeId:t.id,flowId:e.id,timeoutAt:Date.now()+n}),i.waitingForResponse=!0,rv()}await wv(e,m,a,r,o)}else t.data.saveResponseAs||p?(i.waitingForResponse=!0,rv()):Cv(a);break;case"send_image":await Tv(s),t.data.mediaBase64&&await async function(e,t,n,a=!1){Av("fluxoSendMessage",{type:"image",chatId:e,base64:t,caption:n,simulateTyping:a})}(a,t.data.mediaBase64,Ev(t.data.mediaCaption||"",i.variables,r,o),e.rules.simulateTyping);const u=xv(e,t.id,"next"),g=e.edges.some(e=>e.source===t.id&&"response"===e.sourceHandle);if(u){if(g||t.data.saveResponseAs){const n=60*(t.data.responseTimeout||5)*1e3;i.pendingResponseNodes||(i.pendingResponseNodes=[]),i.pendingResponseNodes.push({nodeId:t.id,flowId:e.id,timeoutAt:Date.now()+n}),i.waitingForResponse=!0,rv()}await wv(e,u,a,r,o)}else t.data.saveResponseAs||g?(i.waitingForResponse=!0,rv()):Cv(a);break;case"send_video":await Tv(s),t.data.mediaBase64&&await async function(e,t,n,a,r=!1){Av("fluxoSendMessage",{type:"video",chatId:e,base64:t,filename:n,caption:a,simulateTyping:r})}(a,t.data.mediaBase64,t.data.mediaFilename||"video.mp4",Ev(t.data.mediaCaption||"",i.variables,r,o),e.rules.simulateTyping);const h=xv(e,t.id,"next");h?await wv(e,h,a,r,o):Cv(a);break;case"send_audio":await Tv(s),t.data.mediaBase64&&await async function(e,t,n,a=!1){Av("fluxoSendMessage",{type:"audio",chatId:e,base64:t,filename:n,simulateTyping:a})}(a,t.data.mediaBase64,t.data.mediaFilename||"audio.mp3",e.rules.simulateTyping);const b=xv(e,t.id,"next");b?await wv(e,b,a,r,o):Cv(a);break;case"send_document":await Tv(s),t.data.mediaBase64&&await async function(e,t,n,a,r=!1){Av("fluxoSendMessage",{type:"document",chatId:e,base64:t,filename:n,caption:a,simulateTyping:r})}(a,t.data.mediaBase64,t.data.mediaFilename||"document",Ev(t.data.mediaCaption||"",i.variables,r,o),e.rules.simulateTyping);const f=xv(e,t.id,"next");f?await wv(e,f,a,r,o):Cv(a);break;case"responses":await Tv(s);const v=_f(`${Ev(t.data.message||"",i.variables,r,o)}\n\n${(t.data.responseOptions||[]).map((e,t)=>`${t+1}. ${e.text}`).join("\n")}`,e.rules);await Dv(a,v,e.rules.simulateTyping),i.waitingForResponse=!0,rv();break;case"send_list":await Tv(s),t.data.listData&&await _v(a,t.data.listData,e.rules.simulateTyping),i.waitingForResponse=!0,i.currentNodeId=t.id,rv();break;case"group_action":await Tv(s);const y=t.data.groupActionType||"add",x=t.data.selectedGroupIds||[];x.length>0&&Av("fluxoGroupAction",{action:y,chatId:a,groupIds:x});const w=xv(e,t.id,"next");w?await wv(e,w,a,r,o):Cv(a);break;case"tab_action":await Tv(s);const k=t.data.tabActionType||"add",E=t.data.selectedTabIds||[];if(E.length>0)try{const e=(await n().storage.local.get(Rf))[Rf]||{tabs:[],activeTabId:"all",activeView:"tabs"},t=[];for(const n of E){const o=e.tabs.findIndex(e=>e.id===n);if(-1!==o){const i=e.tabs[o],s=(i.chats||[]).findIndex(e=>e.id===a);"add"===k&&-1===s?(i.chats=i.chats||[],i.chats.push({id:a,name:r,type:a.includes("@g.us")?"group":"individual"}),t.push(n)):"remove"===k&&-1!==s&&(i.chats.splice(s,1),t.push(n))}}await n().storage.local.set({[Rf]:e});const o="add"===k?"add":"remove";for(const e of t)document.dispatchEvent(new CustomEvent("waTabChanged",{detail:{chatId:a,tabId:e,action:o}})),window.postMessage({type:"WA_TAB_CHANGED_FOR_FOLLOWUP",chatId:a,tabId:e,action:o},"*");t.length}catch(e){}const S=xv(e,t.id,"next");S?await wv(e,S,a,r,o):Cv(a);break;case"label_action":await Tv(s);const C=t.data.labelActionType||"add",T=t.data.selectedLabelIds||[];T.length>0&&Av("fluxoLabelAction",{action:C,chatId:a,labelIds:T});const A=xv(e,t.id,"next");A?await wv(e,A,a,r,o):Cv(a);break;case"crm_action":await Tv(s);const D=t.data.crmActionType||"add",_=t.data.selectedCrmId,N=t.data.selectedStageId;if(_)try{const e=(await n().storage.local.get(Mf))[Mf]||{assignments:[],stages:{},crms:[]};let t=null;if("add"===D&&N){const t=(e.assignments||[]).findIndex(e=>e.chatId===a&&e.crmId===_);-1!==t?e.assignments[t].stageId=N:(e.assignments=e.assignments||[],e.assignments.push({chatId:a,stageId:N,crmId:_,assignedAt:Date.now()}))}else if("remove"===D){const n=(e.assignments||[]).find(e=>e.chatId===a&&e.crmId===_);t=n?.stageId||null,e.assignments=(e.assignments||[]).filter(e=>!(e.chatId===a&&e.crmId===_))}await n().storage.local.set({[Mf]:e}),"add"===D&&N?document.dispatchEvent(new CustomEvent("waKanbanChanged",{detail:{chatId:a,stageId:N,crmId:_,action:"add"}})):"remove"===D&&t&&document.dispatchEvent(new CustomEvent("waKanbanChanged",{detail:{chatId:a,stageId:t,crmId:_,action:"remove"}}))}catch(e){}const M=xv(e,t.id,"next");M?await wv(e,M,a,r,o):Cv(a);break;case"smart_wait":const I=1e3*(t.data.delayMin||2),R=1e3*(t.data.delayMax||5),B=Math.floor(Math.random()*(R-I+1))+I;await Tv(B);const P=xv(e,t.id,"next");P?await wv(e,P,a,r,o):Cv(a);break;case"typing_indicator":const L=1e3*(t.data.delayMin||1),U=1e3*(t.data.delayMax||3),F=Math.floor(Math.random()*(U-L+1))+L;Av("fluxoTypingIndicator",{chatId:a,duration:F}),await Tv(F);const z=xv(e,t.id,"next");z?await wv(e,z,a,r,o):Cv(a);break;case"add_fluxo":await Tv(s);const O=t.data.selectedFlowId;if(!O){const n=xv(e,t.id,"next");n?await wv(e,n,a,r,o):Cv(a);break}const W=Bf.find(e=>e.id===O);if(!W){const n=xv(e,t.id,"next");n?await wv(e,n,a,r,o):Cv(a);break}if(!W.isActive){const n=xv(e,t.id,"next");n?await wv(e,n,a,r,o):Cv(a);break}const q=(i.callDepth||0)+1;if(q>10){Cv(a);break}const H=!1!==t.data.passVariables?{...i.variables}:{},j=W.nodes.find(e=>"start"===e.type);if(j){const n=!1!==t.data.continueAfterFlow,s=n?{...i}:null;Hf[a]={flowId:W.id,currentNodeId:j.id,variables:H,waitingForResponse:!1,lastMessageTime:Date.now(),callDepth:q,parentFlowState:s,parentFlowId:n?e.id:void 0,parentNodeId:n?t.id:void 0},rv();const l=W.edges.find(e=>e.source===j.id);if(l){const e=W.nodes.find(e=>e.id===l.target);e&&await wv(W,e,a,r,o)}}else{const n=xv(e,t.id,"next");n?await wv(e,n,a,r,o):Cv(a)}break;case"wait_input":await Tv(s);const V=Ev(t.data.prompt||"Please enter your response:",i.variables,r,o),G=(t.data.inputType,t.data.timeoutDuration||5),K=t.data.timeoutUnit||"minutes",$=_f(V,e.rules);await Dv(a,$,e.rules.simulateTyping);let Y=1e3*G;"minutes"===K?Y=60*G*1e3:"hours"===K&&(Y=60*G*60*1e3),i.waitingForResponse=!0,i.currentNodeId=t.id,i.inputTimeoutAt=Date.now()+Y,i.inputTimeoutNodeId=t.id,i.inputRetryCount=0,rv(),kv(a,e.id,t.id,Y,r,o);break;default:Cv(a)}}function kv(e,t,n,a,r,o){setTimeout(async()=>{try{const a=Hf[e];if(!a||a.inputTimeoutNodeId!==n)return;const i=Date.now();if(a.inputTimeoutAt&&i<a.inputTimeoutAt){const s=a.inputTimeoutAt-i;return void kv(e,t,n,s,r,o)}const s=Bf.find(e=>e.id===t);if(!s)return void Cv(e);const l=s.nodes.find(e=>e.id===n);if(!l)return void Cv(e);a.waitingForResponse=!1,a.inputTimeoutAt=void 0,a.inputTimeoutNodeId=void 0,a.inputRetryCount=void 0;const c=xv(s,l.id,"timeout");c?(rv(),await wv(s,c,e,r,o)):Cv(e)}catch(t){Cv(e)}},a)}function Ev(e,t,n,a){let r=e;r=r.replace(/\{name\}/gi,n||"User"),r=r.replace(/\{phone\}/gi,a||""),r=r.replace(/\{date\}/gi,(new Date).toLocaleDateString()),r=r.replace(/\{time\}/gi,(new Date).toLocaleTimeString());for(const[e,n]of Object.entries(t)){const t=new RegExp(`\\{${e}\\}`,"gi");r=r.replace(t,n)}return r}function Sv(e){const t=(new Date).toISOString().split("T")[0];jf[e]?(jf[e].firstEver=!0,jf[e].firstToday=t):jf[e]={firstEver:!0,firstToday:t},function(){try{localStorage.setItem(Of,JSON.stringify(jf))}catch(e){}}()}function Cv(e){const t=Hf[e];if(t?.pendingResponseNodes&&t.pendingResponseNodes.length>0)return t.waitingForResponse=!0,t.currentNodeId="",void rv();if(t&&t.parentFlowId&&t.parentNodeId&&t.parentFlowState){const n=Bf.find(e=>e.id===t.parentFlowId);if(n){const a={...t.parentFlowState.variables,...t.variables};Hf[e]={...t.parentFlowState,variables:a,lastMessageTime:Date.now()},rv();const r=xv(n,t.parentNodeId,"next");if(r)return void wv(n,r,e,"","").catch(t=>{delete Hf[e],rv()})}}delete Hf[e],rv()}async function Tv(e){return new Promise(t=>setTimeout(t,e))}function Av(e,t){let n=document.getElementById("__fluxo_out_bridge__");n||(n=document.createElement("div"),n.id="__fluxo_out_bridge__",n.style.display="none",document.body.appendChild(n));const a=JSON.stringify({type:e,detail:t,ts:Date.now()});n.setAttribute("data-message",a)}async function Dv(e,t,n=!1){Av("fluxoSendMessage",{type:"text",chatId:e,message:t,simulateTyping:n})}async function _v(e,t,n=!1){Av("fluxoSendMessage",{type:"list",chatId:e,listData:t,simulateTyping:n})}async function Nv(e,t){const n=Bf.find(t=>t.id===e);if(!n)throw new Error("Flow not found");if(!n.isActive)throw new Error("Flow is not active");const a=n.nodes.find(e=>"start"===e.type);if(!a)throw new Error("No start node in flow");Hf[t]={flowId:n.id,currentNodeId:a.id,variables:{},waitingForResponse:!1,lastMessageTime:Date.now()},rv();const r=n.edges.find(e=>e.source===a.id);if(!r)return void Cv(t);const o=n.nodes.find(e=>e.id===r.target);if(!o)return void Cv(t);let i=t.split("@")[0];await wv(n,o,t,"",i)}class Mv{constructor(e){this.templates=[],this.categories=[],this.currentChatId=null,this.sendingIds=new Set,this.collapsedCategories=new Set,this.isDragging=!1,this.pendingSendTimers=new Map,this.parent=e}toggleCategory(e){this.collapsedCategories.has(e)?this.collapsedCategories.delete(e):this.collapsedCategories.add(e),this.parent.requestRender()}setCurrentChatId(e){this.currentChatId=e}async loadData(){try{const{TemplatesStorage:e}=await Promise.resolve().then(r.bind(r,1872)),t=await e.getCategoriesAsync(),n='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>';this.categories=t.filter(e=>"cat_all"!==e.id&&"cat_uncategorized"!==e.id).map(e=>({id:e.id,name:e.name,icon:e.icon&&"📁"!==e.icon?e.icon:n,color:e.color||"#6b7280",order:e.order??999})).sort((e,t)=>e.order-t.order);const a=await e.getTemplatesAsync();let o=!1;const i=new Map,s=a.filter(e=>"quick_reply"===e.messageType&&!1!==e.isActive);if(s.forEach(e=>{const t=e.categoryId||"uncategorized";i.has(t)||i.set(t,[]),i.get(t).push(e)}),i.forEach(e=>{e.sort((e,t)=>(e.sortOrder??999)-(t.sortOrder??999)),e.forEach((e,t)=>{void 0===e.sortOrder&&(e.sortOrder=t,o=!0)})}),o)for(const t of s)await e.saveTemplateAsync(t);this.templates=s.map(e=>({id:e.id,title:e.templeteName||"Untitled",message:this.getMessagePreview(e),categoryId:e.categoryId||null,hasMedia:e.sendAttachment||e.messages&&e.messages.some(e=>"none"!==e.attachmentType),usageCount:e.usageCount||0,sortOrder:e.sortOrder??999,editBeforeSend:e.quickReplyData?.settings?.editBeforeSend||!1})).sort((e,t)=>(e.sortOrder??999)-(t.sortOrder??999))}catch(e){this.templates=[],this.categories=[]}}getMessagePreview(e){return e.messages&&e.messages.length>0?e.messages[0].message||"":e.message||""}filterTemplates(e,t,n){let a=[...this.templates];if(e){const t=e.toLowerCase();a=a.filter(e=>e.title.toLowerCase().includes(t)||e.message.toLowerCase().includes(t))}return"noCategory"===t?a=a.filter(e=>!e.categoryId):"mostUsed"===t?a=a.sort((e,t)=>(t.usageCount||0)-(e.usageCount||0)).slice(0,10):n&&"all"!==n&&(a=a.filter(e=>e.categoryId===n)),a}groupByCategory(e){const t=new Map;return this.categories.forEach(e=>{t.set(e.id,[])}),t.set("uncategorized",[]),e.forEach(e=>{const n=e.categoryId||"uncategorized";t.has(n)?t.get(n)?.push(e):t.set("uncategorized",[...t.get("uncategorized")||[],e])}),t.forEach((e,t)=>{e.sort((e,t)=>(e.sortOrder??999)-(t.sortOrder??999))}),t.forEach((e,n)=>{0===e.length&&t.delete(n)}),t}render(e,t,n){if(!this.currentChatId)return`\n        <div class="action-sidebar-no-chat">\n          <div class="action-sidebar-no-chat-icon"><svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg></div>\n          <div>${(0,s.t)("actionSidebar.selectChatFirst")||"Select a chat first"}</div>\n        </div>\n      `;const a=this.filterTemplates(e,t,n);if(0===a.length)return`\n        <div class="action-sidebar-empty">\n          <div class="action-sidebar-empty-icon"><svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg></div>\n          <div class="action-sidebar-empty-text">${(0,s.t)("actionSidebar.noItemsFound")||"No items found"}</div>\n        </div>\n      `;if("all"===t||"byCategory"===t){const e=this.groupByCategory(a);let t="";return e.forEach((e,n)=>{const a=this.categories.find(e=>e.id===n),r=a?a.name:(0,s.t)("actionSidebar.uncategorized")||"Uncategorized",o=a?a.icon:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>',i=this.collapsedCategories.has(n);t+=`\n          <div class="action-sidebar-category ${i?"collapsed":""}" data-category-id="${n}">\n            <div class="action-sidebar-category-header"\n                 data-category-id="${n}"\n                 data-drag-type="category"\n                 draggable="true">\n              <span class="action-sidebar-drag-handle" title="Drag to reorder">⋮⋮</span>\n              <span class="action-sidebar-category-chevron">▼</span>\n              <span class="action-sidebar-category-icon">${o}</span>\n              <span>${r}</span>\n              <span class="action-sidebar-category-count">(${e.length})</span>\n            </div>\n            <div class="action-sidebar-category-items">\n              ${e.map(e=>this.renderItem(e,n)).join("")}\n            </div>\n          </div>\n        `}),t}return`\n      <div class="action-sidebar-category-items">\n        ${a.map(e=>this.renderItem(e,e.categoryId||"uncategorized")).join("")}\n      </div>\n    `}renderItem(e,t){const n=this.pendingSendTimers.has(e.id),a=this.sendingIds.has(e.id),r=e.message.length>50?e.message.substring(0,50)+"...":e.message,o=e.hasMedia?'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg>':'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>',i=t||e.categoryId||"uncategorized";let l="▶",c=(0,s.t)("actionSidebar.send")||"Send",d="";a?(l="⏳",c="Sending...",d="sending"):n&&(l="⏸️",c=(0,s.t)("actionSidebar.clickToCancel")||"Click to cancel",d="pending-send");const m=e.editBeforeSend?`\n      <button\n        class="action-sidebar-item-edit"\n        data-id="${e.id}"\n        title="${(0,s.t)("actionSidebar.editAndSend")||"Edit & Send"}"\n      >\n        ✏️\n      </button>\n    `:"";return`\n      <div class="action-sidebar-item"\n           data-id="${e.id}"\n           data-category-id="${i}"\n           data-drag-type="item"\n           data-edit-before-send="${e.editBeforeSend?"true":"false"}"\n           draggable="true">\n        <span class="action-sidebar-drag-handle" title="Drag to reorder">⋮⋮</span>\n        <div class="action-sidebar-item-icon">${o}</div>\n        <div class="action-sidebar-item-info">\n          <div class="action-sidebar-item-name">${this.escapeHtml(e.title)}</div>\n          <div class="action-sidebar-item-preview">${this.escapeHtml(r)}</div>\n        </div>\n        <div class="action-sidebar-item-actions">\n          ${m}\n          <button\n            class="action-sidebar-item-send ${d}"\n            data-id="${e.id}"\n            ${a?"disabled":""}\n            title="${c}"\n          >\n            ${l}\n          </button>\n        </div>\n      </div>\n    `}escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}attachEventListeners(e){e.querySelectorAll(".action-sidebar-category-header[data-category-id]").forEach(e=>{e.addEventListener("click",t=>{if(this.isDragging)return;if(t.target.classList.contains("action-sidebar-drag-handle"))return;t.stopPropagation();const n=e.getAttribute("data-category-id");n&&this.toggleCategory(n)})});e.querySelectorAll(".action-sidebar-item-edit[data-id]").forEach(e=>{e.addEventListener("click",t=>{if(this.isDragging)return;t.stopPropagation();const n=e.getAttribute("data-id");n&&this.openEditDialog(n)})});e.querySelectorAll(".action-sidebar-item-send[data-id]").forEach(e=>{e.addEventListener("click",t=>{if(this.isDragging)return;t.stopPropagation();const n=e.getAttribute("data-id");n&&this.handleSendButtonClick(n)})});e.querySelectorAll(".action-sidebar-item[data-id]").forEach(e=>{e.addEventListener("click",t=>{if(this.isDragging)return;const n=t.target;if(n.classList.contains("action-sidebar-drag-handle"))return;if(n.closest(".action-sidebar-item-send"))return;if(n.closest(".action-sidebar-item-edit"))return;const a=e.getAttribute("data-id");a&&this.handleSendButtonClick(a)})}),this.setupDragAndDrop(e)}setupDragAndDrop(e){e.addEventListener("dragstart",e=>{const t=e.target.closest("[data-drag-type]");if(!t)return;this.isDragging=!0;const n=t.dataset.dragType,a=t.dataset.id,r=t.dataset.categoryId;e.dataTransfer?.setData("application/json",JSON.stringify({dragType:n,itemId:a,categoryId:r,tabType:"quickReply"})),t.classList.add("dragging"),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")}),e.addEventListener("dragend",t=>{setTimeout(()=>{this.isDragging=!1},100);const n=t.target.closest("[data-drag-type]");n&&n.classList.remove("dragging"),this.clearDropIndicators(e)}),e.addEventListener("dragover",t=>{t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move");let n=t.target.closest("[data-drag-type]");if(!n){const e=t.target.closest(".action-sidebar-category");if(e){const t=e.querySelector(".action-sidebar-category-header");t&&(n=t)}}if(!n||n.classList.contains("dragging"))return;this.clearDropIndicators(e);if(!(t.dataTransfer?.types.includes("application/json")?"has-data":""))return;const a=n.getBoundingClientRect(),r=a.top+a.height/2,o=t.clientY<r,i=n.dataset.dragType;"item"===i?n.classList.add(o?"drop-above":"drop-below"):"category"===i&&(n.classList.add("drop-target"),n.classList.add(o?"drop-above":"drop-below"))}),e.addEventListener("dragleave",e=>{const t=e.target.closest("[data-drag-type]");t&&t.classList.remove("drag-over","drop-above","drop-below","drop-target")}),e.addEventListener("drop",async t=>{t.preventDefault(),t.stopPropagation();const n=t.dataTransfer?.getData("application/json");if(!n)return;const a=JSON.parse(n);if("quickReply"!==a.tabType)return void this.clearDropIndicators(e);let r=t.target.closest("[data-drag-type]");if(!r){const e=t.target.closest(".action-sidebar-category");if(e){e.getAttribute("data-category-id");r=e.querySelector(".action-sidebar-category-header")}}if(!r)return void this.clearDropIndicators(e);const o=r.classList.contains("drop-above");this.clearDropIndicators(e),"item"===a.dragType?await this.handleItemDrop(a,r,o):"category"===a.dragType&&await this.handleCategoryDrop(a,r,o)})}clearDropIndicators(e){e.querySelectorAll(".drag-over, .drop-above, .drop-below, .drop-target").forEach(e=>{e.classList.remove("drag-over","drop-above","drop-below","drop-target")})}async handleItemDrop(e,t,n){const a=t.dataset.dragType,r=t.dataset.categoryId||"uncategorized",o=t.dataset.id;if(!e.itemId)return;const i=e=>e&&"uncategorized"!==e?e:"uncategorized",s=i(e.categoryId),l=i(r);if("category"===a&&r)s!==l&&await this.moveItemToCategory(e.itemId,r);else if("item"===a&&o){if(e.itemId===o)return;s===l?await this.reorderItem(e.itemId,o,n):await this.moveItemToCategory(e.itemId,r)}}async handleCategoryDrop(e,t,n){const a=t.dataset.categoryId;"uncategorized"!==e.categoryId&&"uncategorized"!==a&&a&&e.categoryId!==a&&await this.reorderCategory(e.categoryId,a,n)}async moveItemToCategory(e,t){try{const{TemplatesStorage:n}=await Promise.resolve().then(r.bind(r,1872)),a=(await n.getTemplatesAsync()).find(t=>t.id===e);a&&(a.categoryId="uncategorized"===t?void 0:t,await n.saveTemplateAsync(a),await this.loadData(),this.parent.requestRender())}catch(e){}}async reorderItem(e,t,n){try{const{TemplatesStorage:a}=await Promise.resolve().then(r.bind(r,1872));await a.reorderTemplateAsync(e,t,n),await this.loadData(),this.parent.requestRender(),window.dispatchEvent(new CustomEvent("wa-template-reordered"))}catch(e){}}async reorderCategory(e,t,n){try{const{TemplatesStorage:a}=await Promise.resolve().then(r.bind(r,1872));await a.reorderCategoryAsync(e,t,n),await this.loadData(),this.parent.requestRender(),window.dispatchEvent(new CustomEvent("wa-template-reordered"))}catch(e){}}async handleSendButtonClick(e){if(this.pendingSendTimers.has(e))this.cancelPendingSend(e);else if(!this.sendingIds.has(e)&&this.currentChatId)try{const{TemplatesStorage:t}=await Promise.resolve().then(r.bind(r,1872)),n=(await t.getTemplatesAsync()).find(t=>t.id===e);if(!n)throw new Error("Template not found");const a=setTimeout(()=>{this.executeSend(e,n)},3e3);this.pendingSendTimers.set(e,{timer:a,template:n}),this.parent.requestRender()}catch(e){}}cancelPendingSend(e){const t=this.pendingSendTimers.get(e);t&&(clearTimeout(t.timer),this.pendingSendTimers.delete(e),this.parent.requestRender())}async executeSend(e,t){this.pendingSendTimers.delete(e),this.sendingIds.add(e),this.parent.requestRender();try{await this.sendQuickReplyViaPostMessage(t),this.sendingIds.delete(e),this.showSendResult(e,!0)}catch(t){this.sendingIds.delete(e),this.showSendResult(e,!1)}}async openEditDialog(e){try{const{TemplatesStorage:t}=await Promise.resolve().then(r.bind(r,1872)),n=(await t.getTemplatesAsync()).find(t=>t.id===e);n&&this.showEditBeforeSendDialog(n)}catch(e){}}async sendTemplate(e){this.handleSendButtonClick(e)}showEditBeforeSendDialog(e){let t="";t=e.messages&&e.messages.length>0?e.messages[0].message||"":e.message||"";const n=document.getElementById("quick-reply-edit-dialog");n&&n.remove();const a=document.createElement("div");a.id="quick-reply-edit-dialog",a.innerHTML=`\n      <div class="qr-edit-overlay">\n        <div class="qr-edit-modal">\n          <div class="qr-edit-header">\n            <span class="qr-edit-title">✏️ ${this.escapeHtml(e.templeteName||"Quick Reply")}</span>\n            <button class="qr-edit-close" title="Close">×</button>\n          </div>\n          <div class="qr-edit-body">\n            <textarea class="qr-edit-textarea" placeholder="Type your message...">${this.escapeHtml(t)}</textarea>\n          </div>\n          <div class="qr-edit-footer">\n            <button class="qr-edit-cancel">${(0,s.t)("actionSidebar.cancel")||"Cancel"}</button>\n            <button class="qr-edit-send">\n              <span>▶</span>\n              ${(0,s.t)("actionSidebar.send")||"Send"}\n            </button>\n          </div>\n        </div>\n      </div>\n      <style>\n        .qr-edit-overlay {\n          position: fixed;\n          top: 0;\n          left: 0;\n          right: 0;\n          bottom: 0;\n          background: rgba(0, 0, 0, 0.5);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          z-index: 999999;\n          animation: qr-fade-in 0.2s ease;\n        }\n        @keyframes qr-fade-in {\n          from { opacity: 0; }\n          to { opacity: 1; }\n        }\n        .qr-edit-modal {\n          background: ${ca.bgPrimary};\n          border-radius: 12px;\n          width: 400px;\n          max-width: 90vw;\n          box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n          animation: qr-slide-up 0.2s ease;\n          overflow: hidden;\n        }\n        @keyframes qr-slide-up {\n          from { transform: translateY(20px); opacity: 0; }\n          to { transform: translateY(0); opacity: 1; }\n        }\n        .qr-edit-header {\n          display: flex;\n          justify-content: space-between;\n          align-items: center;\n          padding: 16px 20px;\n          background: ${ca.primary};\n          color: white;\n        }\n        .qr-edit-title {\n          font-size: 16px;\n          font-weight: 600;\n        }\n        .qr-edit-close {\n          background: none;\n          border: none;\n          color: white;\n          font-size: 24px;\n          cursor: pointer;\n          padding: 0;\n          width: 32px;\n          height: 32px;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          border-radius: 50%;\n          transition: background 0.2s;\n        }\n        .qr-edit-close:hover {\n          background: rgba(255, 255, 255, 0.2);\n        }\n        .qr-edit-body {\n          padding: 20px;\n        }\n        .qr-edit-textarea {\n          width: 100%;\n          min-height: 120px;\n          padding: 14px;\n          border: 2px solid ${ca.borderLight};\n          border-radius: 10px;\n          font-size: 14px;\n          font-family: inherit;\n          resize: vertical;\n          transition: border-color 0.2s;\n          box-sizing: border-box;\n        }\n        .qr-edit-textarea:focus {\n          outline: none;\n          border-color: ${ca.primary};\n        }\n        .qr-edit-footer {\n          display: flex;\n          justify-content: flex-end;\n          gap: 12px;\n          padding: 16px 20px;\n          background: ${ca.bgSecondary};\n          border-top: 1px solid ${ca.borderLight};\n        }\n        .qr-edit-cancel {\n          padding: 10px 20px;\n          border: 1px solid ${ca.borderMedium};\n          border-radius: 8px;\n          background: ${ca.bgPrimary};\n          color: ${ca.textSecondary};\n          font-size: 14px;\n          font-weight: 500;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n        .qr-edit-cancel:hover {\n          background: ${ca.bgTertiary};\n        }\n        .qr-edit-send {\n          display: flex;\n          align-items: center;\n          gap: 8px;\n          padding: 10px 24px;\n          border: none;\n          border-radius: 8px;\n          background: ${ca.primary};\n          color: white;\n          font-size: 14px;\n          font-weight: 600;\n          cursor: pointer;\n          transition: all 0.2s;\n        }\n        .qr-edit-send:hover {\n          transform: translateY(-1px);\n          box-shadow: 0 4px 12px rgba(var(--lion-primary-rgb, 37, 99, 235), 0.4);\n        }\n        .qr-edit-send:disabled {\n          opacity: 0.6;\n          cursor: not-allowed;\n          transform: none;\n        }\n      </style>\n    `,document.body.appendChild(a);const r=a.querySelector(".qr-edit-textarea");r?.focus(),r?.setSelectionRange(r.value.length,r.value.length);const o=a.querySelector(".qr-edit-close");o?.addEventListener("click",()=>a.remove());const i=a.querySelector(".qr-edit-cancel");i?.addEventListener("click",()=>a.remove()),a.querySelector(".qr-edit-overlay")?.addEventListener("click",e=>{e.target===a.querySelector(".qr-edit-overlay")&&a.remove()});const l=a.querySelector(".qr-edit-send");l?.addEventListener("click",async()=>{const t=r?.value||"";if(t.trim()){l.disabled=!0,l.innerHTML="⏳ Sending...";try{const n={...e};n.messages&&n.messages.length>0?n.messages=[{...n.messages[0],message:t}]:n.message=t,await this.sendQuickReplyViaPostMessage(n),this.showSendResult(e.id,!0),a.remove()}catch(t){l.disabled=!1,l.innerHTML=`<span>▶</span> ${(0,s.t)("actionSidebar.send")||"Send"}`,this.showSendResult(e.id,!1)}}else r?.focus()});const c=e=>{"Escape"===e.key&&(a.remove(),document.removeEventListener("keydown",c))};document.addEventListener("keydown",c),r?.addEventListener("keydown",e=>{"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),l?.click())})}async sendQuickReplyViaPostMessage(e){if(!this.currentChatId)throw new Error("No chat selected");const t=e.messages&&e.messages.length>0?e.messages:[{message:e.message||"",attachmentType:e.sendAttachmentType||"none",attachments:e.attachemnt||[]}],n={id:e.id,title:e.templeteName,created_at:e.created_at,modified_at:e.modified_at,settings:e.quickReplyData?.settings||{},postActions:e.quickReplyData?.postActions||null};for(let e=0;e<t.length;e++){const a=t[e],o={sendAttachment:"none"!==a.attachmentType,sendAttachmentType:a.attachmentType||"none",attachemnt:a.attachments||[],selectedContact:a.selectedContact||[],pollData:a.pollData||null,listData:a.listData||null,buttonsData:null,selectedProducts:a.selectedProducts||[]};if(o.attachemnt&&o.attachemnt.length>0){const{mediaDB:e}=await Promise.resolve().then(r.bind(r,1132));for(let t=0;t<o.attachemnt.length;t++){const n=o.attachemnt[t];if(n.file&&(!n.base64Url||!n.base64Url.startsWith("data:")))try{const a=await e.getMedia(n.file);a&&a.data&&(o.attachemnt[t].base64Url=a.data)}catch(e){}}}const i=e===t.length-1;if(await this.sendMessageViaPostMessage(a.message||"",o,i?n:void 0),e<t.length-1){const e=a.delay||{min:3,max:5},t=1e3*(Math.random()*(e.max-e.min)+e.min);await new Promise(e=>setTimeout(e,t))}}}sendMessageViaPostMessage(e,t,n){return new Promise((a,r)=>{const o=`send_message_${Date.now()}`,i=e=>{"sendMessageResponse"===e.data?.type&&e.data.messageId===o&&(window.removeEventListener("message",i),e.data.success?a():r(new Error(e.data.error||"Failed to send message")))};window.addEventListener("message",i),window.postMessage({type:"sendQuickReply",messageId:o,chatId:this.currentChatId,message:e,templateData:t,quickReplyInfo:n},"*"),setTimeout(()=>{window.removeEventListener("message",i),r(new Error("Send message timeout"))},2e4)})}showSendResult(e,t){const n=document.querySelector(`.action-sidebar-item-send[data-id="${e}"]`);n&&(n.classList.remove("sending"),n.classList.add(t?"success":"error"),n.innerHTML=t?"✓":"✕",setTimeout(()=>{n.classList.remove("success","error"),n.innerHTML="▶",n.disabled=!1},1500))}}const Iv="wa_chatbot_flows",Rv="wa_chatbot_flow_categories";class Bv{constructor(e){this.flows=[],this.categories=[],this.currentChatId=null,this.triggeringIds=new Set,this.collapsedCategories=new Set,this.isDragging=!1,this.parent=e}toggleCategory(e){this.collapsedCategories.has(e)?this.collapsedCategories.delete(e):this.collapsedCategories.add(e),this.parent.requestRender()}setCurrentChatId(e){this.currentChatId=e}async loadData(){try{const e=(await n().storage.local.get(Rv))[Rv]||[],t='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>';this.categories=e.map(e=>({id:e.id,name:e.name,icon:e.icon&&"📁"!==e.icon?e.icon:t,color:e.color||"#6b7280",sortOrder:e.sortOrder??999})).sort((e,t)=>e.sortOrder-t.sortOrder);const a=(await n().storage.local.get(Iv))[Iv]||[];let r=!1;const o=new Map;a.forEach(e=>{const t=e.categoryId||"uncategorized";o.has(t)||o.set(t,[]),o.get(t).push(e)}),o.forEach(e=>{e.sort((e,t)=>(e.sortOrder??999)-(t.sortOrder??999)),e.forEach((e,t)=>{void 0===e.sortOrder&&(e.sortOrder=t,r=!0)})}),r&&await n().storage.local.set({[Iv]:a}),this.flows=a.filter(e=>e.isActive).map(e=>({id:e.id,name:e.name||"Untitled Flow",description:this.getFlowDescription(e),categoryId:e.categoryId||null,isActive:e.isActive,triggerCount:e.triggerCount||0,sortOrder:e.sortOrder??999})).sort((e,t)=>(e.sortOrder??999)-(t.sortOrder??999))}catch(e){this.flows=[],this.categories=[]}}getFlowDescription(e){const t=e.triggers||{},n=[];return t.anyMessage&&n.push("Any message"),t.keywords&&t.keywords.length>0&&n.push(`Keywords: ${t.keywords.slice(0,3).join(", ")}${t.keywords.length>3?"...":""}`),t.firstMessageEver&&n.push("First message ever"),t.firstMessageDay&&n.push("First message today"),n.length>0?n.join(" | "):"Manual trigger"}filterFlows(e,t,n){let a=[...this.flows];if(e){const t=e.toLowerCase();a=a.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))}return"noCategory"===t?a=a.filter(e=>!e.categoryId):"mostUsed"===t?a=a.sort((e,t)=>(t.triggerCount||0)-(e.triggerCount||0)).slice(0,10):n&&"all"!==n&&(a=a.filter(e=>e.categoryId===n)),a}groupByCategory(e){const t=new Map;return this.categories.forEach(e=>{t.set(e.id,[])}),t.set("uncategorized",[]),e.forEach(e=>{const n=e.categoryId||"uncategorized";t.has(n)?t.get(n)?.push(e):t.set("uncategorized",[...t.get("uncategorized")||[],e])}),t.forEach((e,t)=>{e.sort((e,t)=>(e.sortOrder??999)-(t.sortOrder??999))}),t.forEach((e,n)=>{0===e.length&&t.delete(n)}),t}render(e,t,n){if(!this.currentChatId)return`\n        <div class="action-sidebar-no-chat">\n          <div class="action-sidebar-no-chat-icon"><svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg></div>\n          <div>${(0,s.t)("actionSidebar.selectChatFirst")||"Select a chat first"}</div>\n        </div>\n      `;const a=this.filterFlows(e,t,n);if(0===a.length)return`\n        <div class="action-sidebar-empty">\n          <div class="action-sidebar-empty-icon"><svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg></div>\n          <div class="action-sidebar-empty-text">${(0,s.t)("actionSidebar.noItemsFound")||"No items found"}</div>\n        </div>\n      `;if("all"===t||"byCategory"===t){const e=this.groupByCategory(a);let t="";return e.forEach((e,n)=>{const a=this.categories.find(e=>e.id===n),r=a?a.name:(0,s.t)("actionSidebar.uncategorized")||"Uncategorized",o=a?a.icon:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>',i=this.collapsedCategories.has(n);t+=`\n          <div class="action-sidebar-category ${i?"collapsed":""}" data-category-id="${n}">\n            <div class="action-sidebar-category-header"\n                 data-category-id="${n}"\n                 data-drag-type="category"\n                 draggable="true">\n              <span class="action-sidebar-drag-handle" title="Drag to reorder">⋮⋮</span>\n              <span class="action-sidebar-category-chevron">▼</span>\n              <span class="action-sidebar-category-icon">${o}</span>\n              <span>${r}</span>\n              <span class="action-sidebar-category-count">(${e.length})</span>\n            </div>\n            <div class="action-sidebar-category-items">\n              ${e.map(e=>this.renderItem(e,n)).join("")}\n            </div>\n          </div>\n        `}),t}return`\n      <div class="action-sidebar-category-items">\n        ${a.map(e=>this.renderItem(e,e.categoryId||"uncategorized")).join("")}\n      </div>\n    `}renderItem(e,t){const n=this.triggeringIds.has(e.id),a=e.description.length>50?e.description.substring(0,50)+"...":e.description,r=t||e.categoryId||"uncategorized";return`\n      <div class="action-sidebar-item"\n           data-flow-id="${e.id}"\n           data-category-id="${r}"\n           data-drag-type="item"\n           draggable="true">\n        <span class="action-sidebar-drag-handle" title="Drag to reorder">⋮⋮</span>\n        <div class="action-sidebar-item-icon"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg></div>\n        <div class="action-sidebar-item-info">\n          <div class="action-sidebar-item-name">${this.escapeHtml(e.name)}</div>\n          <div class="action-sidebar-item-preview">${this.escapeHtml(a)}</div>\n        </div>\n        <button\n          class="action-sidebar-item-send ${n?"sending":""}"\n          data-flow-id="${e.id}"\n          ${n?"disabled":""}\n          title="${(0,s.t)("actionSidebar.trigger")||"Trigger"}"\n        >\n          ${n?"⏳":"▶"}\n        </button>\n      </div>\n    `}escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}attachEventListeners(e){e.querySelectorAll(".action-sidebar-category-header[data-category-id]").forEach(e=>{e.addEventListener("click",t=>{if(this.isDragging)return;if(t.target.classList.contains("action-sidebar-drag-handle"))return;t.stopPropagation();const n=e.getAttribute("data-category-id");n&&this.toggleCategory(n)})});e.querySelectorAll(".action-sidebar-item-send[data-flow-id]").forEach(e=>{e.addEventListener("click",t=>{if(this.isDragging)return;t.stopPropagation();const n=e.getAttribute("data-flow-id");n&&this.triggerFlow(n)})});e.querySelectorAll(".action-sidebar-item[data-flow-id]").forEach(e=>{e.addEventListener("click",t=>{if(this.isDragging)return;if(t.target.classList.contains("action-sidebar-drag-handle"))return;const n=e.getAttribute("data-flow-id");n&&this.triggerFlow(n)})}),this.setupDragAndDrop(e)}setupDragAndDrop(e){e.addEventListener("dragstart",e=>{const t=e.target.closest("[data-drag-type]");if(!t)return;this.isDragging=!0;const n=t.dataset.dragType,a=t.dataset.flowId,r=t.dataset.categoryId;e.dataTransfer?.setData("application/json",JSON.stringify({dragType:n,flowId:a,categoryId:r,tabType:"flow"})),t.classList.add("dragging"),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")}),e.addEventListener("dragend",t=>{setTimeout(()=>{this.isDragging=!1},100);const n=t.target.closest("[data-drag-type]");n&&n.classList.remove("dragging"),this.clearDropIndicators(e)}),e.addEventListener("dragover",t=>{t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move");let n=t.target.closest("[data-drag-type]");if(!n){const e=t.target.closest(".action-sidebar-category");if(e){const t=e.querySelector(".action-sidebar-category-header");t&&(n=t)}}if(!n||n.classList.contains("dragging"))return;this.clearDropIndicators(e);if(!(t.dataTransfer?.types.includes("application/json")?"has-data":""))return;const a=n.getBoundingClientRect(),r=a.top+a.height/2,o=t.clientY<r,i=n.dataset.dragType;"item"===i?n.classList.add(o?"drop-above":"drop-below"):"category"===i&&(n.classList.add("drop-target"),n.classList.add(o?"drop-above":"drop-below"))}),e.addEventListener("dragleave",e=>{const t=e.target.closest("[data-drag-type]");t&&t.classList.remove("drag-over","drop-above","drop-below","drop-target")}),e.addEventListener("drop",async t=>{t.preventDefault(),t.stopPropagation();const n=t.dataTransfer?.getData("application/json");if(!n)return;const a=JSON.parse(n);if("flow"!==a.tabType)return void this.clearDropIndicators(e);let r=t.target.closest("[data-drag-type]");if(!r){const e=t.target.closest(".action-sidebar-category");if(e){e.getAttribute("data-category-id");r=e.querySelector(".action-sidebar-category-header")}}if(!r)return void this.clearDropIndicators(e);const o=r.classList.contains("drop-above");this.clearDropIndicators(e),"item"===a.dragType?await this.handleItemDrop(a,r,o):"category"===a.dragType&&await this.handleCategoryDrop(a,r,o)})}clearDropIndicators(e){e.querySelectorAll(".drag-over, .drop-above, .drop-below, .drop-target").forEach(e=>{e.classList.remove("drag-over","drop-above","drop-below","drop-target")})}async handleItemDrop(e,t,n){const a=t.dataset.dragType,r=t.dataset.categoryId||"uncategorized",o=t.dataset.flowId;if(!e.flowId)return;const i=e=>e&&"uncategorized"!==e?e:"uncategorized",s=i(e.categoryId),l=i(r);if("category"===a&&r)s!==l&&await this.moveFlowToCategory(e.flowId,r);else if("item"===a&&o){if(e.flowId===o)return;s===l?await this.reorderFlow(e.flowId,o,n):await this.moveFlowToCategory(e.flowId,r)}}async handleCategoryDrop(e,t,n){const a=t.dataset.categoryId;"uncategorized"!==e.categoryId&&"uncategorized"!==a&&a&&e.categoryId!==a&&await this.reorderCategory(e.categoryId,a,n)}async moveFlowToCategory(e,t){try{const{FluxoStorage:n}=await Promise.resolve().then(r.bind(r,5773));await n.moveFlowToCategory(e,"uncategorized"===t?null:t),await this.loadData(),this.parent.requestRender()}catch(e){}}async reorderFlow(e,t,n){try{const{FluxoStorage:a}=await Promise.resolve().then(r.bind(r,5773));await a.reorderFlow(e,t,n),await this.loadData(),this.parent.requestRender()}catch(e){}}async reorderCategory(e,t,n){try{const{FluxoStorage:a}=await Promise.resolve().then(r.bind(r,5773));await a.reorderCategoryBefore(e,t,n),await this.loadData(),this.parent.requestRender()}catch(e){}}async triggerFlow(e){if(this.currentChatId&&!this.triggeringIds.has(e)){this.triggeringIds.add(e),this.parent.requestRender();try{await this.triggerFlowViaDOMBridge(e,this.currentChatId),this.triggeringIds.delete(e),this.showTriggerResult(e,!0)}catch(t){this.triggeringIds.delete(e),this.showTriggerResult(e,!1)}}}async triggerFlowViaDOMBridge(e,t){return new Promise((n,a)=>{const r=`manual_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,o=setTimeout(()=>{window.removeEventListener("message",i),n()},5e3),i=e=>{"fluxoManualTriggerResponse"===e.data?.type&&e.data.requestId===r&&(clearTimeout(o),window.removeEventListener("message",i),e.data.success?n():a(new Error(e.data.error||"Failed to trigger flow")))};window.addEventListener("message",i),window.postMessage({type:"fluxoManualTriggerInject",flowId:e,chatId:t,requestId:r},"*")})}showTriggerResult(e,t){const n=document.querySelector(`.action-sidebar-item-send[data-flow-id="${e}"]`);n&&(n.classList.remove("sending"),n.classList.add(t?"success":"error"),n.innerHTML=t?"✓":"✕",setTimeout(()=>{n.classList.remove("success","error"),n.innerHTML="▶",n.disabled=!1},1500))}}const Pv=new class{constructor(){this.container=null,this.triggerButton=null,this.isOpen=!1,this.activeTab="quickReply",this.searchQuery="",this.filter="all",this.selectedCategoryId="all",this.isDarkMode=!1,this.observer=null,this.triggerWrapper=null,this.quickReplyTab=new Mv(this),this.flowTab=new Bv(this)}async init(){this.detectDarkMode(),this.injectStyles(),this.createSidebarContainer(),this.tryInjectTriggerButton(),this.setupObserver(),this.setupChatListener(),this.setupDataListeners()}detectDarkMode(){const e=_();if("system"===e.mode){const e=document.querySelector("html");this.isDarkMode=e?.classList.contains("dark")||!1}else this.isDarkMode="dark"===e.mode;const t=document.querySelector("html"),n=new MutationObserver(()=>{if("system"===_().mode){const e=t?.classList.contains("dark")||!1;e!==this.isDarkMode&&(this.isDarkMode=e,this.updateDarkMode())}});t&&n.observe(t,{attributes:!0,attributeFilter:["class"]}),window.addEventListener(I,e=>{const t=e.detail;if("system"===t.mode){const e=document.querySelector("html");this.isDarkMode=e?.classList.contains("dark")||!1}else this.isDarkMode="dark"===t.mode;this.updateDarkMode()})}updateDarkMode(){this.container&&(this.isDarkMode?this.container.classList.add("dark"):this.container.classList.remove("dark"))}setupObserver(){this.observer=new MutationObserver(()=>{this.triggerWrapper&&document.contains(this.triggerWrapper)||this.tryInjectTriggerButton()}),this.observer.observe(document.body,{childList:!0,subtree:!0})}setupChatListener(){document.addEventListener("waActiveChatChanged",e=>{const{type:t,chatId:n}=e.detail;"open"===t&&n?(this.quickReplyTab.setCurrentChatId(n),this.flowTab.setCurrentChatId(n)):"close"===t&&(this.quickReplyTab.setCurrentChatId(null),this.flowTab.setCurrentChatId(null))})}setupDataListeners(){window.addEventListener("wa-template-saved",()=>{this.quickReplyTab.loadData()}),window.addEventListener("wa-template-deleted",()=>{this.quickReplyTab.loadData()}),window.addEventListener("wa-template-reordered",()=>{this.quickReplyTab.loadData(),this.requestRender()}),window.addEventListener("fluxoFlowsChanged",()=>{this.flowTab.loadData()})}tryInjectTriggerButton(){if(this.triggerWrapper&&document.contains(this.triggerWrapper))return;this.triggerWrapper&&(this.triggerWrapper.remove(),this.triggerWrapper=null),this.triggerButton&&(this.triggerButton.remove(),this.triggerButton=null);const e=document.querySelector("#main footer");if(!e)return;const t=e.querySelector('button[aria-label="Voice message"]:not([data-tab])'),n=e.querySelector('button[aria-label="Send"]:not([data-tab])'),a=t||n;if(!a){const t=e.querySelector('button[data-tab="11"]');if(t){let e=t.parentElement;for(let t=0;t<5&&e;t++){if(e.parentElement&&e.parentElement.hasAttribute("tabindex"))return void this.injectButtonAfter(e);e=e.parentElement}}return}const r=a.parentElement;if(!r)return;r.parentElement&&this.injectButtonAfter(r)}injectButtonAfter(e){const t=e.parentElement;t&&(t.querySelector(".action-sidebar-trigger-wrapper")||(this.triggerWrapper=document.createElement("div"),this.triggerWrapper.className="action-sidebar-trigger-wrapper",this.triggerWrapper.style.cssText="\n      display: flex;\n      align-items: center;\n      justify-content: center;\n      padding: 5px;\n    ",this.triggerButton=document.createElement("button"),this.triggerButton.className="action-sidebar-trigger",this.triggerButton.innerHTML='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>',this.triggerButton.title=(0,s.t)("actionSidebar.title")||"Quick Actions",this.triggerButton.onclick=e=>{e.preventDefault(),e.stopPropagation(),this.toggle()},this.triggerWrapper.appendChild(this.triggerButton),e.nextSibling?t.insertBefore(this.triggerWrapper,e.nextSibling):t.appendChild(this.triggerWrapper)))}createSidebarContainer(){this.container=document.createElement("div"),this.container.className="action-sidebar",this.isDarkMode&&this.container.classList.add("dark"),this.render(),document.body.appendChild(this.container)}applyAppPadding(){const e=document.querySelector("#app");e&&(e.style.setProperty("padding-right","360px","important"),e.style.setProperty("box-sizing","border-box","important"))}removeAppPadding(){const e=document.querySelector("#app");e&&e.style.removeProperty("padding-right")}async toggle(){this.isOpen=!this.isOpen,this.container&&(this.isOpen?(this.container.classList.add("open"),this.applyAppPadding(),this.renderLoading(),await Promise.all([this.quickReplyTab.loadData(),this.flowTab.loadData()]),this.render()):(this.container.classList.remove("open"),this.removeAppPadding())),this.triggerButton&&this.triggerButton.classList.toggle("active",this.isOpen)}renderLoading(){if(!this.container)return;const e=this.container.querySelector(".action-sidebar-content");e&&(e.innerHTML='\n        <div class="action-sidebar-loading">\n          <div class="action-sidebar-loading-spinner"></div>\n          <div class="action-sidebar-loading-text">Carregando...</div>\n        </div>\n      ')}close(){this.isOpen&&(this.isOpen=!1,this.container?.classList.remove("open"),this.triggerButton?.classList.remove("active"),this.removeAppPadding())}switchTab(e){this.activeTab=e,this.render()}setSearchQuery(e){this.searchQuery=e,this.renderContentOnly()}renderContentOnly(){if(!this.container)return;const e=this.container.querySelector(".action-sidebar-content");e?(e.innerHTML=this.renderActiveTab(),this.attachContentEventListeners()):this.render()}setFilter(e,t){this.filter=e,t&&(this.selectedCategoryId=t),this.render()}getState(){return{searchQuery:this.searchQuery,filter:this.filter,selectedCategoryId:this.selectedCategoryId,isDarkMode:this.isDarkMode}}requestRender(){this.render()}render(){this.container&&(this.container.innerHTML=`\n      \x3c!-- Header --\x3e\n      <div class="action-sidebar-header">\n        <input\n          type="text"\n          class="action-sidebar-search"\n          placeholder="${(0,s.t)("actionSidebar.search")||"Search..."}"\n          value="${this.searchQuery}"\n        />\n        <button class="action-sidebar-close" title="${(0,s.t)("crm.close")||"Close"}">✕</button>\n      </div>\n\n      \x3c!-- Tabs --\x3e\n      <div class="action-sidebar-tabs">\n        <div class="action-sidebar-tab ${"quickReply"===this.activeTab?"active":""}" data-tab="quickReply">\n          <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>\n          ${(0,s.t)("actionSidebar.quickReply")||"Quick Reply"}\n        </div>\n        <div class="action-sidebar-tab ${"flow"===this.activeTab?"active":""}" data-tab="flow">\n          <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>\n          ${(0,s.t)("actionSidebar.flow")||"Flow"}\n        </div>\n      </div>\n\n      \x3c!-- Filter --\x3e\n      <div class="action-sidebar-filter">\n        <select class="action-sidebar-filter-select">\n          <option value="all" ${"all"===this.filter?"selected":""}>${(0,s.t)("actionSidebar.all")||"All"}</option>\n          <option value="noCategory" ${"noCategory"===this.filter?"selected":""}>${(0,s.t)("actionSidebar.noCategory")||"No Category"}</option>\n          <option value="mostUsed" ${"mostUsed"===this.filter?"selected":""}>${(0,s.t)("actionSidebar.mostUsed")||"Most Used"}</option>\n        </select>\n      </div>\n\n      \x3c!-- Content Area --\x3e\n      <div class="action-sidebar-content">\n        ${this.renderActiveTab()}\n      </div>\n    `,this.attachEventListeners())}renderActiveTab(){return"quickReply"===this.activeTab?this.quickReplyTab.render(this.searchQuery,this.filter,this.selectedCategoryId):this.flowTab.render(this.searchQuery,this.filter,this.selectedCategoryId)}attachEventListeners(){if(!this.container)return;const e=this.container.querySelector(".action-sidebar-search");e&&e.addEventListener("input",e=>{this.searchQuery=e.target.value,this.renderContentOnly()});const t=this.container.querySelector(".action-sidebar-close");t?.addEventListener("click",()=>this.close());this.container.querySelectorAll(".action-sidebar-tab").forEach(e=>{e.addEventListener("click",()=>{const t=e.getAttribute("data-tab");this.switchTab(t)})});const n=this.container.querySelector(".action-sidebar-filter-select");n&&n.addEventListener("change",e=>{this.filter=e.target.value,this.render()}),this.attachContentEventListeners()}attachContentEventListeners(){this.container&&("quickReply"===this.activeTab?this.quickReplyTab.attachEventListeners(this.container):this.flowTab.attachEventListeners(this.container))}injectStyles(){if(document.getElementById("action-sidebar-styles"))return;const e=document.createElement("style");e.id="action-sidebar-styles",e.textContent=`\n      /* Trigger Button — outlined V3 white circle */\n      .action-sidebar-trigger {\n        width: 36px;\n        height: 36px;\n        border-radius: 50%;\n        background: #ffffff;\n        border: 1px solid #e5e7eb;\n        color: #52525b;\n        cursor: pointer;\n        margin-left: 8px;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n        transition: all 0.15s ease;\n        flex-shrink: 0;\n        padding: 0;\n      }\n\n      .action-sidebar-trigger:hover {\n        background: rgba(var(--lion-primary-rgb), 0.08);\n        border-color: var(--lion-primary);\n        color: var(--lion-primary);\n      }\n\n      .action-sidebar-trigger.active {\n        background: rgba(var(--lion-primary-rgb), 0.1);\n        border-color: var(--lion-primary);\n        color: var(--lion-primary);\n      }\n\n      /* Sidebar Panel — fixed-position right overlay (V3) */\n      .action-sidebar {\n        position: fixed;\n        top: 0;\n        right: 0;\n        width: 360px;\n        height: 100vh;\n        background: ${ca.bgPrimary};\n        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);\n        z-index: 2147483000;\n        display: flex;\n        flex-direction: column;\n        overflow: hidden;\n        transform: translateX(100%);\n        transition: transform 0.3s ease;\n        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n        border-left: 1px solid #e5e7eb;\n      }\n\n      .action-sidebar.open {\n        transform: translateX(0);\n      }\n\n      /* Dark Mode */\n      .action-sidebar.dark {\n        background: #1a1a1a;\n        color: #ffffff;\n      }\n\n      .action-sidebar.dark .action-sidebar-header {\n        border-bottom-color: #3a3a3a;\n      }\n\n      .action-sidebar.dark .action-sidebar-search {\n        background: #262626;\n        border-color: #3a3a3a;\n        color: #ffffff;\n      }\n\n      .action-sidebar.dark .action-sidebar-search::placeholder {\n        color: #a0a0a0;\n      }\n\n      .action-sidebar.dark .action-sidebar-tabs {\n        border-bottom-color: #3a3a3a;\n      }\n\n      .action-sidebar.dark .action-sidebar-tab {\n        color: #a0a0a0 !important;\n      }\n\n      .action-sidebar.dark .action-sidebar-tab:hover {\n        background: rgba(255, 255, 255, 0.05);\n        color: #ffffff !important;\n      }\n\n      .action-sidebar.dark .action-sidebar-tab.active {\n        color: #ffffff !important;\n        background: rgba(var(--lion-primary-rgb), 0.2);\n        border-bottom-color: ${ca.primary} !important;\n      }\n\n      .action-sidebar.dark .action-sidebar-filter {\n        border-bottom-color: #3a3a3a;\n      }\n\n      .action-sidebar.dark .action-sidebar-filter-select {\n        background: #262626;\n        border-color: #3a3a3a;\n        color: #ffffff;\n      }\n\n      .action-sidebar.dark .action-sidebar-filter-select option {\n        background: #262626;\n        color: #ffffff;\n      }\n\n      .action-sidebar.dark .action-sidebar-category-header {\n        color: #ffffff;\n      }\n\n      .action-sidebar.dark .action-sidebar-category-chevron {\n        color: #a0a0a0;\n      }\n\n      .action-sidebar.dark .action-sidebar-category-count {\n        color: #a0a0a0;\n      }\n\n      .action-sidebar.dark .action-sidebar-item {\n        background: #262626;\n      }\n\n      .action-sidebar.dark .action-sidebar-item:hover {\n        background: #333333;\n      }\n\n      .action-sidebar.dark .action-sidebar-item-icon {\n        background: #1a1a1a;\n      }\n\n      .action-sidebar.dark .action-sidebar-item-name {\n        color: #ffffff;\n      }\n\n      .action-sidebar.dark .action-sidebar-item-preview {\n        color: #a0a0a0;\n      }\n\n      .action-sidebar.dark .action-sidebar-close {\n        color: #a0a0a0;\n      }\n\n      .action-sidebar.dark .action-sidebar-close:hover {\n        background: rgba(255, 255, 255, 0.1);\n      }\n\n      .action-sidebar.dark .action-sidebar-empty-text,\n      .action-sidebar.dark .action-sidebar-no-chat {\n        color: #a0a0a0;\n      }\n\n      /* Header */\n      .action-sidebar-header {\n        padding: 16px;\n        border-bottom: 1px solid ${ca.borderLight};\n        display: flex;\n        align-items: center;\n        gap: 12px;\n      }\n\n      .action-sidebar-search {\n        flex: 1;\n        padding: 10px 14px;\n        border: 1px solid ${ca.borderLight};\n        border-radius: 8px;\n        font-size: 14px;\n        outline: none;\n        transition: border-color 0.2s;\n      }\n\n      .action-sidebar-search:focus {\n        border-color: ${ca.primary};\n      }\n\n      .action-sidebar-close {\n        width: 32px;\n        height: 32px;\n        border: none;\n        background: transparent;\n        cursor: pointer;\n        font-size: 18px;\n        color: ${ca.textMuted};\n        border-radius: 50%;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        transition: background 0.2s;\n      }\n\n      .action-sidebar-close:hover {\n        background: rgba(0, 0, 0, 0.05);\n      }\n\n      /* Tabs */\n      .action-sidebar-tabs {\n        display: flex;\n        border-bottom: 1px solid ${ca.borderLight};\n      }\n\n      .action-sidebar-tab {\n        flex: 1;\n        padding: 12px;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        gap: 8px;\n        cursor: pointer;\n        font-weight: 500;\n        font-size: 14px;\n        color: ${ca.textMuted};\n        border-bottom: 2px solid transparent;\n        transition: all 0.2s;\n      }\n\n      .action-sidebar-tab svg {\n        flex-shrink: 0;\n      }\n\n      .action-sidebar-tab:hover {\n        background: rgba(0, 0, 0, 0.02);\n      }\n\n      .action-sidebar-tab.active {\n        color: ${ca.primary};\n        border-bottom-color: ${ca.primary};\n      }\n\n      /* Filter Dropdown */\n      .action-sidebar-filter {\n        padding: 12px 16px;\n        border-bottom: 1px solid ${ca.borderLight};\n      }\n\n      .action-sidebar-filter-select {\n        width: 100%;\n        padding: 8px 12px;\n        border: 1px solid ${ca.borderLight};\n        border-radius: 8px;\n        font-size: 14px;\n        cursor: pointer;\n        outline: none;\n        background: white;\n      }\n\n      .action-sidebar-filter-select:focus {\n        border-color: ${ca.primary};\n      }\n\n      /* Content Area */\n      .action-sidebar-content {\n        flex: 1;\n        overflow-y: auto;\n        padding: 12px;\n      }\n\n      /* Category Section */\n      .action-sidebar-category {\n        margin-bottom: 16px;\n      }\n\n      .action-sidebar-category-header {\n        display: flex;\n        align-items: center;\n        gap: 8px;\n        padding: 8px 4px;\n        font-weight: 600;\n        font-size: 13px;\n        color: ${ca.textPrimary};\n        cursor: pointer;\n        user-select: none;\n      }\n\n      .action-sidebar-category-header:hover {\n        opacity: 0.8;\n      }\n\n      .action-sidebar-category-icon {\n        font-size: 16px;\n      }\n\n      .action-sidebar-category-count {\n        margin-left: auto;\n        font-size: 12px;\n        color: ${ca.textMuted};\n        font-weight: normal;\n      }\n\n      .action-sidebar-category-items {\n        display: flex;\n        flex-direction: column;\n        gap: 8px;\n      }\n\n      /* Collapsible Category Styles */\n      .action-sidebar-category-chevron {\n        transition: transform 0.2s ease;\n        font-size: 10px;\n        color: ${ca.textMuted};\n      }\n\n      .action-sidebar-category.collapsed .action-sidebar-category-chevron {\n        transform: rotate(-90deg);\n      }\n\n      .action-sidebar-category.collapsed .action-sidebar-category-items {\n        display: none;\n      }\n\n      /* Item Card */\n      .action-sidebar-item {\n        display: flex;\n        align-items: center;\n        padding: 12px;\n        background: ${ca.bgSecondary};\n        border-radius: 10px;\n        cursor: pointer;\n        transition: all 0.2s;\n      }\n\n      .action-sidebar-item:hover {\n        background: ${ca.bgTertiary};\n      }\n\n      .action-sidebar-item-icon {\n        width: 36px;\n        height: 36px;\n        border-radius: 8px;\n        background: ${ca.bgPrimary};\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        margin-right: 12px;\n        font-size: 18px;\n        color: ${ca.primary};\n        flex-shrink: 0;\n        box-shadow: 0 1px 3px rgba(0,0,0,0.1);\n      }\n\n      .action-sidebar-category-icon {\n        display: inline-flex;\n        align-items: center;\n        justify-content: center;\n        color: ${ca.primary};\n      }\n\n      .action-sidebar-empty-icon,\n      .action-sidebar-no-chat-icon {\n        color: ${ca.primary};\n      }\n\n      .action-sidebar-item-info {\n        flex: 1;\n        min-width: 0;\n      }\n\n      .action-sidebar-item-name {\n        font-weight: 500;\n        font-size: 14px;\n        color: ${ca.textPrimary};\n        white-space: nowrap;\n        overflow: hidden;\n        text-overflow: ellipsis;\n      }\n\n      .action-sidebar-item-preview {\n        font-size: 12px;\n        color: ${ca.textMuted};\n        white-space: nowrap;\n        overflow: hidden;\n        text-overflow: ellipsis;\n        margin-top: 2px;\n      }\n\n      .action-sidebar-item-send {\n        width: 32px;\n        height: 32px;\n        border-radius: 50%;\n        background: ${ca.primary};\n        border: none;\n        color: white;\n        cursor: pointer;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        font-size: 14px;\n        transition: all 0.2s;\n        flex-shrink: 0;\n      }\n\n      .action-sidebar-item-send:hover {\n        transform: scale(1.1);\n      }\n\n      .action-sidebar-item-send:disabled {\n        opacity: 0.5;\n        cursor: not-allowed;\n        transform: none;\n      }\n\n      .action-sidebar-item-send.sending {\n        background: ${ca.textMuted};\n        animation: pulse 0.6s infinite;\n      }\n\n      .action-sidebar-item-send.success {\n        background: ${ca.success};\n      }\n\n      .action-sidebar-item-send.error {\n        background: ${ca.error};\n      }\n\n      .action-sidebar-item-send.pending-send {\n        background: var(--lion-primary);\n        animation: pending-pulse 0.8s infinite;\n      }\n\n      /* Item Actions Container */\n      .action-sidebar-item-actions {\n        display: flex;\n        align-items: center;\n        gap: 6px;\n        margin-left: auto;\n        flex-shrink: 0;\n      }\n\n      /* Edit Button */\n      .action-sidebar-item-edit {\n        width: 28px;\n        height: 28px;\n        border-radius: 50%;\n        background: ${ca.borderLight};\n        border: none;\n        color: ${ca.textSecondary};\n        cursor: pointer;\n        display: flex;\n        align-items: center;\n        justify-content: center;\n        font-size: 12px;\n        transition: all 0.2s;\n        flex-shrink: 0;\n      }\n\n      .action-sidebar-item-edit:hover {\n        background: ${ca.borderMedium};\n        transform: scale(1.1);\n      }\n\n      .action-sidebar.dark .action-sidebar-item-edit {\n        background: #4b5563;\n        color: ${ca.borderLight};\n      }\n\n      .action-sidebar.dark .action-sidebar-item-edit:hover {\n        background: ${ca.textMuted};\n      }\n\n      @keyframes pending-pulse {\n        0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }\n        50% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }\n        100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }\n      }\n\n      @keyframes pulse {\n        0% { transform: scale(1); }\n        50% { transform: scale(1.05); }\n        100% { transform: scale(1); }\n      }\n\n      /* Empty State */\n      .action-sidebar-empty {\n        display: flex;\n        flex-direction: column;\n        align-items: center;\n        justify-content: center;\n        padding: 40px 20px;\n        text-align: center;\n      }\n\n      .action-sidebar-empty-icon {\n        font-size: 48px;\n        margin-bottom: 16px;\n        opacity: 0.5;\n      }\n\n      .action-sidebar-empty-text {\n        color: ${ca.textMuted};\n        font-size: 14px;\n      }\n\n      /* No Chat Selected State */\n      .action-sidebar-no-chat {\n        display: flex;\n        flex-direction: column;\n        align-items: center;\n        justify-content: center;\n        padding: 40px 20px;\n        text-align: center;\n        color: ${ca.textMuted};\n      }\n\n      .action-sidebar-no-chat-icon {\n        font-size: 48px;\n        margin-bottom: 16px;\n        opacity: 0.5;\n      }\n\n      /* Loading State */\n      .action-sidebar-loading {\n        display: flex;\n        flex-direction: column;\n        align-items: center;\n        justify-content: center;\n        padding: 60px 20px;\n        gap: 16px;\n      }\n\n      .action-sidebar-loading-spinner {\n        width: 36px;\n        height: 36px;\n        border: 3px solid rgba(var(--lion-primary-rgb), 0.2);\n        border-top-color: ${ca.primary};\n        border-radius: 50%;\n        animation: spin 0.8s linear infinite;\n      }\n\n      @keyframes spin {\n        to { transform: rotate(360deg); }\n      }\n\n      .action-sidebar-loading-text {\n        color: ${ca.textMuted};\n        font-size: 14px;\n      }\n\n      .action-sidebar.dark .action-sidebar-loading-text {\n        color: #aaa;\n      }\n\n      /* Drag and Drop Styles */\n      .action-sidebar-item,\n      .action-sidebar-category-header,\n      .action-sidebar-category {\n        transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;\n      }\n\n      .action-sidebar-item.dragging,\n      .action-sidebar-category-header.dragging {\n        opacity: 0.4;\n        transform: scale(0.98);\n        z-index: 1;\n      }\n\n      .action-sidebar-item.drag-over {\n        border: 2px dashed ${ca.primary} !important;\n        background: rgba(var(--lion-primary-rgb), 0.15) !important;\n        transform: scale(1.02);\n        box-shadow: 0 0 8px rgba(var(--lion-primary-rgb), 0.3);\n      }\n\n      .action-sidebar-category-header.drag-over {\n        background: rgba(var(--lion-primary-rgb), 0.2) !important;\n        border-radius: 6px;\n        transform: scale(1.01);\n        box-shadow: 0 0 8px rgba(var(--lion-primary-rgb), 0.4);\n      }\n\n      /* Drag handle - show on hover */\n      .action-sidebar-drag-handle {\n        opacity: 0;\n        cursor: grab;\n        color: ${ca.textMuted};\n        font-size: 12px;\n        padding: 2px 4px;\n        transition: opacity 0.2s ease, color 0.15s ease;\n        user-select: none;\n        flex-shrink: 0;\n      }\n\n      .action-sidebar-item:hover .action-sidebar-drag-handle,\n      .action-sidebar-category-header:hover .action-sidebar-drag-handle {\n        opacity: 0.6;\n      }\n\n      .action-sidebar-drag-handle:hover {\n        opacity: 1 !important;\n        color: ${ca.primary};\n      }\n\n      .action-sidebar-drag-handle:active {\n        cursor: grabbing;\n      }\n\n      .action-sidebar.dark .action-sidebar-drag-handle {\n        color: ${ca.textMuted};\n      }\n\n      .action-sidebar.dark .action-sidebar-drag-handle:hover {\n        color: ${ca.primary};\n      }\n\n      /* Smooth category items container */\n      .action-sidebar-category-items {\n        transition: max-height 0.2s ease;\n      }\n\n      /* ========================= */\n      /* Drop Position Indicators  */\n      /* ========================= */\n\n      /* Drop ABOVE item - Gap opens above */\n      .action-sidebar-item.drop-above {\n        margin-top: 24px !important;\n        position: relative;\n      }\n\n      .action-sidebar-item.drop-above::before {\n        content: '';\n        position: absolute;\n        top: -14px;\n        left: 8px;\n        right: 8px;\n        height: 4px;\n        background: ${ca.primary};\n        border-radius: 2px;\n        box-shadow: 0 0 8px rgba(var(--lion-primary-rgb), 0.6);\n        animation: dropIndicatorPulse 0.8s ease-in-out infinite;\n      }\n\n      /* Drop BELOW item - Gap opens below */\n      .action-sidebar-item.drop-below {\n        margin-bottom: 24px !important;\n        position: relative;\n      }\n\n      .action-sidebar-item.drop-below::after {\n        content: '';\n        position: absolute;\n        bottom: -14px;\n        left: 8px;\n        right: 8px;\n        height: 4px;\n        background: ${ca.primary};\n        border-radius: 2px;\n        box-shadow: 0 0 8px rgba(var(--lion-primary-rgb), 0.6);\n        animation: dropIndicatorPulse 0.8s ease-in-out infinite;\n      }\n\n      /* Category header drop indicator (for moving items to category) */\n      .action-sidebar-category-header.drop-target {\n        background: rgba(var(--lion-primary-rgb), 0.2) !important;\n        box-shadow: inset 0 0 0 2px ${ca.primary};\n        border-radius: 6px;\n      }\n\n      /* Category reorder - drop above */\n      .action-sidebar-category-header.drop-above {\n        margin-top: 16px !important;\n        position: relative;\n      }\n\n      .action-sidebar-category-header.drop-above::before {\n        content: '';\n        position: absolute;\n        top: -10px;\n        left: 4px;\n        right: 4px;\n        height: 4px;\n        background: ${ca.primary};\n        border-radius: 2px;\n        box-shadow: 0 0 8px rgba(var(--lion-primary-rgb), 0.6);\n      }\n\n      /* Category reorder - drop below */\n      .action-sidebar-category-header.drop-below {\n        margin-bottom: 16px !important;\n        position: relative;\n      }\n\n      .action-sidebar-category-header.drop-below::after {\n        content: '';\n        position: absolute;\n        bottom: -10px;\n        left: 4px;\n        right: 4px;\n        height: 4px;\n        background: ${ca.primary};\n        border-radius: 2px;\n        box-shadow: 0 0 8px rgba(var(--lion-primary-rgb), 0.6);\n      }\n\n      @keyframes dropIndicatorPulse {\n        0%, 100% { opacity: 1; }\n        50% { opacity: 0.6; }\n      }\n\n      /* Smooth transitions for gap opening */\n      .action-sidebar-item,\n      .action-sidebar-category-header {\n        transition: margin 0.15s ease, transform 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;\n      }\n    `,document.head.appendChild(e)}};var Lv=r(1132);let Uv=null,Fv=!1,zv=0;function Ov(){return new Promise(e=>{if(document.body)e();else if("loading"===document.readyState)document.addEventListener("DOMContentLoaded",()=>e(),{once:!0});else{const t=()=>{document.body?e():requestAnimationFrame(t)};requestAnimationFrame(t)}})}function Wv(e,t){if(!document.body)return void Ov().then(()=>Wv(e,t));let n=document.getElementById("__followup_out_bridge__");n||(n=document.createElement("div"),n.id="__followup_out_bridge__",n.style.display="none",document.body.appendChild(n));const a=Date.now(),r=JSON.stringify({type:e,detail:t,ts:a});n.setAttribute("data-message",r);n.getAttribute("data-message")}async function qv(){if(!Uv){await async function(){document.body||await Ov();let e=document.getElementById("__followup_in_bridge__");e||(e=document.createElement("div"),e.id="__followup_in_bridge__",e.style.display="none",document.body.appendChild(e)),new MutationObserver(t=>{for(const n of t)if("attributes"===n.type&&"data-response"===n.attributeName){const t=e.getAttribute("data-response");if(!t)return;try{const e=JSON.parse(t);e.ts&&e.ts>zv&&(zv=e.ts,document.dispatchEvent(new CustomEvent(e.type,{detail:e.detail})))}catch(e){}}}).observe(e,{attributes:!0})}(),async function(){try{const e=(await Km()).filter(e=>"pending"===e.status),t=Date.now();e.filter(e=>e.scheduledAt<=t),e.filter(e=>e.scheduledAt>t);e.length>0&&e.forEach(e=>{new Date(e.scheduledAt),e.scheduledAt})}catch(e){}}();try{setTimeout(async()=>{try{await Hv()}catch(e){}},5e3)}catch(e){}Uv=window.setInterval(async()=>{try{await Hv()}catch(e){}},3e4),setInterval(Xm,36e5),setInterval(Jm,3e5),document.addEventListener("debugFollowUpQueueCheck",async()=>{await Hv()})}}async function Hv(){if(!Fv){Fv=!0;try{await Jm(),await async function(){const e=await async function(){return Fm()}();for(const t of e)if(jv(t)){t.actions;try{"on_leave"===t.trigger?.type?await Kv(t):await Gv(t),await Zm(t.id,Date.now())}catch(e){}}}();const e=await Km();Date.now();e.forEach(e=>{new Date(e.scheduledAt),e.scheduledAt});const t=await async function(){const e=await Km(),t=Date.now();return e.filter(e=>"pending"===e.status&&e.scheduledAt<=t)}();if(0===t.length)return;for(let e=0;e<t.length;e++){const n=t[e],a=await Um(n.followUpId);if(a){const e=a.trigger?.timeConfig;if("specific"===e?.mode&&(e.weekdays&&e.weekdays.length>0||e.monthlyDates&&e.monthlyDates.length>0||e.yearlyDates&&e.yearlyDates.length>0||e.calendarDates&&e.calendarDates.length>0)){a.lastExecutedAt&&Date.now()-a.lastExecutedAt<12e4&&await Ym(n.id,{status:"completed"});continue}}if(await $v(n),e<t.length-1){const e=await Um(n.followUpId);let t={min:3,max:10};e?.actions?.[0]?.templateConfig?.messages?.[0]?.delay&&(t=e.actions[0].templateConfig.messages[0].delay);const a=Math.random()*(t.max-t.min)+t.min;await new Promise(e=>setTimeout(e,1e3*a))}}}catch(e){}finally{Fv=!1}}}function jv(e){const{trigger:t}=e,n=t?.timeConfig;if(!n||"specific"!==n.mode)return!1;if(!(n.weekdays&&n.weekdays.length>0||n.monthlyDates&&n.monthlyDates.length>0||n.yearlyDates&&n.yearlyDates.length>0||n.calendarDates&&n.calendarDates.length>0))return!1;const a=new Date,r=a.getHours(),o=a.getMinutes(),i=a.getDay(),s=a.getDate(),l=a.getMonth()+1,[c,d]=(n.specificTime||"00:00").split(":").map(Number);if(!(r===c&&o===d))return!1;if(e.lastExecutedAt){if(Date.now()-e.lastExecutedAt<3e5)return!1}switch(n.scheduleType||"weekly"){case"daily":return!0;case"weekly":const e=0===i?7:i;return n.weekdays?.includes(e)||!1;case"monthly":return n.monthlyDates?.includes(s)||!1;case"yearly":return n.yearlyDates?.some(e=>e.month===l&&e.day===s)||!1;default:return!1}}function Vv(e){if(!e)return;const t=new Date;switch(e.scheduleType||"weekly"){case"weekly":return{1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat",7:"sun"}[0===t.getDay()?7:t.getDay()];case"monthly":case"daily":return t.getDate().toString();case"yearly":return`${t.getMonth()+1}-${t.getDate()}`;default:return}}async function Gv(e){const t=(await Yv(e.funnelSettings)).filter(e=>!e.endsWith("@g.us"));if(0===t.length)return;const n=Vv(e.trigger.timeConfig);for(let a=0;a<t.length;a++){const r=t[a];try{if(e.rules.cancelOnReply){const t=await Vm(r,e.id);if(t?.hasReplied)continue}await Xv(e.actions,r,e,n)?0:0}catch(e){0}if(a<t.length-1){const e=7*Math.random()+3;await by(1e3*e)}}}async function Kv(e){const t=await Yv(e.funnelSettings),a=new Set(t.filter(e=>!e.endsWith("@g.us"))),r=(e.previousFunnelMembers||[]).filter(e=>!a.has(e)),o=Vv(e.trigger.timeConfig);for(let t=0;t<r.length;t++){const n=r[t];try{await Xv(e.actions,n,e,o)?0:0}catch(e){0}if(t<r.length-1){const e=7*Math.random()+3;await by(1e3*e)}}await async function(e,t){try{const a=await Lm(),r=a.findIndex(t=>t.id===e);-1!==r&&(a[r].previousFunnelMembers=t,await n().storage.local.set({[Mm]:a}))}catch(e){}}(e.id,Array.from(a))}async function $v(e){try{await Ym(e.id,{status:"processing",lastAttemptAt:Date.now()});const t=await Um(e.followUpId);if(!t)return void await async function(e){const t=(await Km()).filter(t=>t.id!==e);await n().storage.local.set({[Bm]:t})}(e.id);if(!t.isActive)return void await Ym(e.id,{status:"cancelled"});const a=Vv(t.trigger.timeConfig)||e.scheduleKey,r=e.contactId,o=await async function(e,t){const a=t.funnelSettings,r=t.trigger?.type;switch(a.type){case"labels":return async function(e,t){try{return new Promise(n=>{const a=t=>{t.source===window&&"LABEL_SERVICE_RESPONSE"===t.data?.type&&"checkContactLabels"===t.data?.action&&t.data?.chatId===e&&(window.removeEventListener("message",a),n(t.data?.hasLabels||!1))};window.addEventListener("message",a),window.postMessage({type:"LABEL_SERVICE_CHECK_CONTACT_LABELS",chatId:e,labelIds:t},"*"),setTimeout(()=>{window.removeEventListener("message",a),n(!1)},5e3)})}catch(e){return!1}}(e,a.selectedIds);case"tabs":return async function(e,t){try{const a=(await n().storage.local.get("wa_extension_tabs")).wa_extension_tabs;if(!a?.tabs)return!1;const r=a.tabs;return t.some(t=>{const n=r.find(e=>e.id===t);return n?.chats?.some(t=>(t.id||t)===e)})}catch{return!1}}(e,a.selectedIds);case"groups":return("on_enter"!==r||!e.endsWith("@g.us"))&&async function(e,t){if(e.endsWith("@g.us")){return t.includes(e)}return new Promise(n=>{const a=e=>{document.removeEventListener("checkGroupMembershipResponse",a),n(e.detail?.isMember||!1)};document.addEventListener("checkGroupMembershipResponse",a),document.dispatchEvent(new CustomEvent("checkGroupMembershipRequest",{detail:{contactId:e,groupIds:t}})),setTimeout(()=>{document.removeEventListener("checkGroupMembershipResponse",a),n(!1)},5e3)})}(e,a.selectedIds);case"kanban":return async function(e,t,n){try{const a=await(window.browser?.storage?.local?.get?.(["wa_kanban_crm_data_sync"]));if(!a?.wa_kanban_crm_data_sync?.assignments)return!1;return a.wa_kanban_crm_data_sync.assignments.some(a=>a.chatId===e&&t.includes(a.stageId)&&(!n||a.crmId===n))}catch{return!1}}(e,a.selectedIds,a.crmId);default:return!0}}(r,t);if(!o){if(await Ym(e.id,{status:"completed"}),e.isRecurring){await Qm(e,t)}return}if(t.rules.cancelOnReply){const t=await Vm(r,e.followUpId);if(t?.hasReplied)return void await Ym(e.id,{status:"completed"})}if(await Xv(t.actions,r,t,a)){const n=!0===e.isRecurring;let o=await Vm(r,e.followUpId);o||(o=await Gm({contactId:r,followUpId:e.followUpId,currentStepIndex:0,enteredAt:Date.now(),status:n?"active":"completed",hasReplied:!1,history:[]})),await Gm({...o,lastStepExecutedAt:Date.now(),status:n?"active":"completed",history:[...o.history,{stepId:a?`action-${a}`:"direct-actions",stepOrder:o.history.length,executedAt:Date.now(),result:"success",actionsExecuted:(t.actions||[]).filter(e=>e&&e.id).map(e=>e.id)}]})}if(await Ym(e.id,{status:"completed"}),e.isRecurring){await Qm(e,t)}}catch(t){const n=e.attempts+1;await Ym(e.id,{status:n>=3?"failed":"pending",attempts:n,error:t.message,scheduledAt:n<3?Date.now()+3e5:void 0})}}async function Yv(e){const{type:t,selectedIds:a,crmId:r}=e;switch(t){case"labels":return await async function(e){if(0===e.length)return[];const t=new Set;for(const n of e){(await new Promise(e=>{const t=a=>{a.source===window&&"LABEL_SERVICE_RESPONSE"===a.data?.type&&"getChatsByLabel"===a.data?.action&&a.data?.labelId===n&&(window.removeEventListener("message",t),e(a.data?.chats||[]))};window.addEventListener("message",t),window.postMessage({type:"LABEL_SERVICE_GET_CHATS_BY_LABEL",labelId:n},"*"),setTimeout(()=>{window.removeEventListener("message",t),e([])},1e4)})).forEach(e=>{const n=e.id?._serialized||e.id||e;n&&"string"==typeof n&&t.add(n)})}return Array.from(t)}(a);case"tabs":return await async function(e){try{const t=(await n().storage.local.get("wa_extension_tabs")).wa_extension_tabs;if(!t)return[];const a=t.tabs||[],r=new Set;for(const t of e){const e=a.find(e=>e.id===t);e?.chats&&Array.isArray(e.chats)&&e.chats.forEach(e=>{const t=e.id||e;t&&"string"==typeof t&&r.add(t)})}return Array.from(r)}catch(e){return[]}}(a);case"kanban":return await async function(e,t){try{const a=(await n().storage.local.get("wa_kanban_crm_data_sync")).wa_kanban_crm_data_sync;if(!a){const n=localStorage.getItem("wa_kanban_crm_data");if(!n)return[];const a=JSON.parse(n).assignments||[],r=new Set;for(const n of a)!e.includes(n.stageId)||t&&n.crmId!==t||n.chatId&&r.add(n.chatId);return Array.from(r)}const r=a.assignments||[],o=new Set;for(const n of r)!e.includes(n.stageId)||t&&n.crmId!==t||n.chatId&&o.add(n.chatId);return Array.from(o)}catch(e){return[]}}(a,r);case"groups":return await async function(e){if(0===e.length)return[];return new Promise(t=>{const n=new Set;let a=0;const r=o=>{const{groupId:i,members:s}=o.detail||{};s&&Array.isArray(s)&&s.forEach(e=>{const t=e.id?._serialized||e.id||e;t&&"string"==typeof t&&!t.endsWith("@g.us")&&n.add(t)}),a++,a>=e.length&&(document.removeEventListener("followUpGetGroupMembersResponse",r),t(Array.from(n)))};document.addEventListener("followUpGetGroupMembersResponse",r);for(const t of e)Wv("followUpGetGroupMembersRequest",{groupId:t});setTimeout(()=>{document.removeEventListener("followUpGetGroupMembersResponse",r),t(Array.from(n))},15e3)})}(a);default:return[]}}async function Xv(e,t,n,a){let r=!0;const o=n.trigger.timeConfig,i=a&&"different"===o?.messageModePerDay&&o?.dayMessages?.[a];let s=e;if(0===e.length&&i){const e=o.dayMessages[a];s=[{id:`synthetic_${a}_${Date.now()}`,type:"template",templateConfig:{messages:e.messages}}]}for(let l=0;l<s.length;l++){const c=s[l];if(c&&c.type)try{let s=c;if("template"===c.type&&i&&e.length>0){const e=o.dayMessages[a];s={...c,templateConfig:{...c.templateConfig,messages:e.messages}}}await Qv(s,t,n)||(r=!1)}catch(e){r=!1}}if(n.postActions){const e=await async function(e,t){let n=!0;if(e.groupActionsEnabled){if(e.addToGroups&&e.addToGroups.length>0)for(const a of e.addToGroups){await Jv(t,a,"add")||(n=!1)}if(e.removeFromGroups&&e.removeFromGroups.length>0)for(const a of e.removeFromGroups){await Jv(t,a,"remove")||(n=!1)}}if(e.tabActionsEnabled){if(e.addToTabs&&e.addToTabs.length>0){const a={id:"post_action_add_tabs",type:"add_tab",crmConfig:{tabIds:e.addToTabs}};await ly(a,t)||(n=!1)}if(e.removeFromTabs&&e.removeFromTabs.length>0){const a={id:"post_action_remove_tabs",type:"remove_tab",crmConfig:{tabIds:e.removeFromTabs}};await ly(a,t)||(n=!1)}}if(e.labelsActionsEnabled){if(e.addLabels&&e.addLabels.length>0){const a={id:"post_action_add_labels",type:"add_label",crmConfig:{labelIds:e.addLabels}};await sy(a,t)||(n=!1)}if(e.removeLabels&&e.removeLabels.length>0){const a={id:"post_action_remove_labels",type:"remove_label",crmConfig:{labelIds:e.removeLabels}};await sy(a,t)||(n=!1)}}if(e.kanbanActionsEnabled){if(e.addToKanban){const a={id:"post_action_add_kanban",type:"add_kanban",crmConfig:{kanbanStageId:e.addToKanban.stageId,kanbanCrmId:e.addToKanban.crmId}};await cy(a,t)||(n=!1)}if(e.removeFromKanban){const a={id:"post_action_remove_kanban",type:"remove_kanban",crmConfig:{kanbanStageId:e.removeFromKanban.stageId,kanbanCrmId:e.removeFromKanban.crmId}};await cy(a,t)||(n=!1)}}return n}(n.postActions,t);e||(r=!1)}return r}async function Jv(e,t,n){return new Promise(a=>{const r=e=>{document.removeEventListener("executeGroupActionResponse",r),a(e.detail?.success||!1)};document.addEventListener("executeGroupActionResponse",r),document.dispatchEvent(new CustomEvent("executeGroupActionRequest",{detail:{contactId:e,groupIds:[t],action:n}})),setTimeout(()=>{document.removeEventListener("executeGroupActionResponse",r),a(!1)},5e3)})}async function Qv(e,t,n){switch(e.type){case"template":return await async function(e,t,n){const a=e.templateConfig?.messages||[];a.length;if(0===a.length)return!0;for(const e of a){const a=Math.floor(Math.random()*(e.delay.max-e.delay.min+1))+e.delay.min;await by(1e3*a);let r=await Zv(e.message,t);n.rules.customSignature&&n.rules.signatureText&&(r+="\n\n"+n.rules.signatureText);switch(e.attachmentType||"none"){case"none":if(r&&r.trim()){if(!await ty(t,r))return!1}break;case"image/video":if(e.attachments&&e.attachments.length>0)for(let n=0;n<e.attachments.length;n++){const a=e.attachments[n],o=0===n?r:"",i=a.name?.match(/\.(mp4|mov|avi|webm|mkv)$/i),s=await ny(a);if(!await ay(t,{type:i?"video":"image",base64:s,caption:o,filename:a.name}))return!1;n<e.attachments.length-1&&await by(1e3)}else if(r&&r.trim()){if(!await ty(t,r))return!1}break;case"document":if(e.attachments&&e.attachments.length>0)for(let n=0;n<e.attachments.length;n++){const a=e.attachments[n],o=0===n?r:"",i=await ny(a);if(!await ay(t,{type:"document",base64:i,caption:o,filename:a.name||"document"}))return!1;n<e.attachments.length-1&&await by(1e3)}else if(r&&r.trim()){if(!await ty(t,r))return!1}break;case"audio":if(e.attachments&&e.attachments.length>0){r&&r.trim()&&await ty(t,r);for(const n of e.attachments){const e=await ny(n);if(!await ay(t,{type:"audio",base64:e,filename:n.name||"audio.mp3"}))return!1}}else if(r&&r.trim()){if(!await ty(t,r))return!1}break;case"contact":if(e.selectedContact&&e.selectedContact.length>0){r&&r.trim()&&await ty(t,r);for(const n of e.selectedContact){if(!await ry(t,n))return!1}}else if(r&&r.trim()){if(!await ty(t,r))return!1}break;case"poll":if(e.pollData){if(!await oy(t,e.pollData,r))return!1}else if(r&&r.trim()){if(!await ty(t,r))return!1}break;case"list":if(e.listData){if(!await iy(t,e.listData))return!1}else if(r&&r.trim()){if(!await ty(t,r))return!1}break;case"fluxo":if(e.selectedFlowId){let n=document.getElementById("__fluxo_out_bridge__");n||(n=document.createElement("div"),n.id="__fluxo_out_bridge__",n.style.display="none",document.body.appendChild(n));const a=JSON.stringify({type:"fluxoManualTriggerFromFollowUp",detail:{flowId:e.selectedFlowId,chatId:t},ts:Date.now()});n.setAttribute("data-message",a)}break;default:if(r&&r.trim()){if(!await ty(t,r))return!1}}}return!0}(e,t,n);case"add_label":case"remove_label":return await sy(e,t);case"add_tab":case"remove_tab":return await ly(e,t);case"add_kanban":case"remove_kanban":return await cy(e,t);case"add_group":case"remove_group":return await async function(){return!0}();case"webhook":return await async function(e,t,n){const a=e.webhookConfig?.url;if(!a)return!0;try{const r={event:"followup_action",followUpId:n.id,followUpName:n.name,timestamp:Date.now()};if(e.webhookConfig?.includeContactData){const e=await ey(t);r.contact={id:t,...e}}return window.chrome?.runtime?.sendMessage?.({type:"SEND_WEBHOOK",url:a,payload:r,eventType:"followup"}),!0}catch{return!1}}(e,t,n);default:return!0}}async function Zv(e,t){let n=e;const a=await ey(t);return n=n.replace(/@firstname/gi,a.firstname||a.name?.split(" ")[0]||""),n=n.replace(/@lastname/gi,a.lastname||""),n=n.replace(/@contactname/gi,a.savedName||a.name||""),n=n.replace(/@whatsappname/gi,a.pushname||a.name||""),n=n.replace(/@variable1/gi,""),n=n.replace(/@phone/gi,a.phone||""),n=n.replace(/@name/gi,a.name||""),n=n.replace(/{firstname}/gi,a.firstname||a.name?.split(" ")[0]||""),n=n.replace(/{lastname}/gi,a.lastname||""),n=n.replace(/{contactname}/gi,a.savedName||a.name||""),n=n.replace(/{whatsappname}/gi,a.pushname||a.name||""),n=n.replace(/{name}/gi,a.name||""),n=n.replace(/{phone}/gi,a.phone||""),n=n.replace(/{date}/gi,(new Date).toLocaleDateString()),n=n.replace(/{time}/gi,(new Date).toLocaleTimeString()),n}async function ey(e){return new Promise(t=>{const n=a=>{document.removeEventListener("getContactInfoResponse",n);const r=a.detail||{};t({name:r.name||"",phone:r.phone||e.replace("@c.us","").replace("@g.us","").replace("@lid",""),firstname:r.firstname||"",lastname:r.lastname||"",pushname:r.pushname||"",savedName:r.savedName||"",formattedName:r.formattedName||"",shortName:r.shortName||""})};document.addEventListener("getContactInfoResponse",n),document.dispatchEvent(new CustomEvent("getContactInfoRequest",{detail:{contactId:e}})),setTimeout(()=>{document.removeEventListener("getContactInfoResponse",n),t({name:"",phone:e.replace("@c.us","").replace("@g.us","").replace("@lid",""),firstname:"",lastname:"",pushname:"",savedName:"",formattedName:"",shortName:""})},3e3)})}async function ty(e,t){return!t||""===t.trim()||new Promise(n=>{const a=e=>{document.removeEventListener("sendFollowUpMessageResponse",a);const t=e.detail?.success||!1;n(t)};document.addEventListener("sendFollowUpMessageResponse",a),Wv("followUpSendMessage",{type:"text",contactId:e,message:t}),setTimeout(()=>{document.removeEventListener("sendFollowUpMessageResponse",a),n(!1)},1e4)})}async function ny(e){if(e.base64Url&&"string"==typeof e.base64Url&&e.base64Url.startsWith("data:"))return e.base64Url;const t=e.file||e.base64Url;if(t&&"string"==typeof t&&!t.startsWith("data:"))try{const e=await Lv.mediaDB.getMedia(t);if(e&&e.data)return e.data}catch(e){}return""}async function ay(e,t){return!t.base64||new Promise(n=>{const a=e=>{document.removeEventListener("sendFollowUpMessageResponse",a);const t=e.detail?.success||!1;n(t)};document.addEventListener("sendFollowUpMessageResponse",a),Wv("followUpSendMessage",{type:t.type,contactId:e,base64:t.base64,caption:t.caption||"",filename:t.filename||""}),setTimeout(()=>{document.removeEventListener("sendFollowUpMessageResponse",a),n(!1)},15e3)})}async function ry(e,t){return new Promise(n=>{const a=e=>{document.removeEventListener("sendFollowUpMessageResponse",a);const t=e.detail?.success||!1;n(t)};document.addEventListener("sendFollowUpMessageResponse",a),Wv("followUpSendMessage",{type:"contact",contactId:e,contactData:t}),setTimeout(()=>{document.removeEventListener("sendFollowUpMessageResponse",a),n(!1)},1e4)})}async function oy(e,t,n){return new Promise(a=>{const r=e=>{document.removeEventListener("sendFollowUpMessageResponse",r);const t=e.detail?.success||!1;a(t)};document.addEventListener("sendFollowUpMessageResponse",r),Wv("followUpSendMessage",{type:"poll",contactId:e,pollData:{...t,title:n||t.title||""}}),setTimeout(()=>{document.removeEventListener("sendFollowUpMessageResponse",r),a(!1)},1e4)})}async function iy(e,t){return new Promise(n=>{const a=e=>{document.removeEventListener("sendFollowUpMessageResponse",a);const t=e.detail?.success||!1;n(t)};document.addEventListener("sendFollowUpMessageResponse",a),Wv("followUpSendMessage",{type:"list",contactId:e,listData:t}),setTimeout(()=>{document.removeEventListener("sendFollowUpMessageResponse",a),n(!1)},1e4)})}async function sy(e,t){const n=e.crmConfig?.labelIds||[];if(0===n.length)return!0;const a="add_label"===e.type?"add":"remove",r="add"===a?"LABEL_SERVICE_ADD":"LABEL_SERVICE_REMOVE";let o=!0;for(const e of n){await new Promise(n=>{const o=r=>{r.source===window&&"LABEL_SERVICE_RESPONSE"===r.data?.type&&r.data?.action===a&&r.data?.chatId===t&&r.data?.labelId===e&&(window.removeEventListener("message",o),n(r.data?.success||!1))};window.addEventListener("message",o),window.postMessage({type:r,chatId:t,labelId:e},"*"),setTimeout(()=>{window.removeEventListener("message",o),n(!1)},5e3)})||(o=!1)}return o}async function ly(e,t){const a=e.crmConfig?.tabIds||[];if(0===a.length)return!0;try{const r=(await n().storage.local.get("wa_extension_tabs")).wa_extension_tabs;if(!r)return!1;const o=r.tabs||[];for(const n of a){const a=o.findIndex(e=>e.id===n);if(-1!==a)if("add_tab"===e.type){o[a].chats||(o[a].chats=[]);o[a].chats.some(e=>(e.id||e)===t)||o[a].chats.push({id:t})}else o[a].chats&&(o[a].chats=o[a].chats.filter(e=>(e.id||e)!==t))}return r.tabs=o,await n().storage.local.set({wa_extension_tabs:r}),!0}catch{return!1}}async function cy(e,t){const n=e.crmConfig?.kanbanStageId,a=e.crmConfig?.kanbanCrmId;return!n||!a||new Promise(r=>{const o=e=>{document.removeEventListener("executeKanbanActionResponse",o),r(e.detail?.success||!1)};document.addEventListener("executeKanbanActionResponse",o),document.dispatchEvent(new CustomEvent("executeKanbanActionRequest",{detail:{contactId:t,stageId:n,crmId:a,action:"add_kanban"===e.type?"add":"remove"}})),setTimeout(()=>{document.removeEventListener("executeKanbanActionResponse",o),r(!1)},5e3)})}function dy(e,t,n){const a=new Date;let r=(7===e?0:e)-a.getDay();r<0?r+=7:0===r&&function(e,t){const n=new Date,a=new Date;return a.setHours(e,t,0,0),n>a}(t,n)&&(r=7);const o=new Date(a);return o.setDate(o.getDate()+r),o.setHours(t,n,0,0),o.getTime()}function my(e,t,n){const a=new Date;let r=new Date(a.getFullYear(),a.getMonth(),e,t,n,0,0);for(r<=a&&r.setMonth(r.getMonth()+1);r.getDate()!==e&&e<=31;)r.setMonth(r.getMonth()+1),r.setDate(e);return r.getTime()}function py(e,t,n,a){const r=new Date;let o=new Date(r.getFullYear(),e-1,t,n,a,0,0);return o<=r&&o.setFullYear(o.getFullYear()+1),o.getTime()}function uy(e){const t=e.trigger,n=t.timeConfig,a="specific"===n?.mode&&(n?.weekdays&&n.weekdays.length>0||n?.monthlyDates&&n.monthlyDates.length>0||n?.yearlyDates&&n.yearlyDates.length>0||n?.specificDates&&n.specificDates.length>0||n?.calendarDates&&n.calendarDates.length>0);if(("on_enter"===t.type||"on_leave"===t.type)&&!a)return[{time:Date.now()+1e3,isRecurring:!1}];if(n){const[e,a]=(n.specificTime||n.relativeTime||"12:00").split(":").map(Number);if("specific"===n.mode){const t=n.scheduleType||"weekly",r=[];switch(t){case"weekly":const o=n.weekdays||[];for(const t of o){const n=["","mon","tue","wed","thu","fri","sat","sun"][t]||"mon",o=dy(t,e,a);r.push({time:o,scheduleKey:n,isRecurring:!0})}break;case"monthly":case"daily":const i=n.calendarDates||[];if(i.length>0)for(const t of i){const[n,o,i]=t.split("-").map(Number),s=new Date(n,o-1,i,e,a,0,0);s<=new Date&&s.setFullYear(s.getFullYear()+1),r.push({time:s.getTime(),scheduleKey:t,isRecurring:!0})}else{const o="monthly"===t?n.monthlyDates||[]:n.specificDates||[];for(const t of o)r.push({time:my(t,e,a),scheduleKey:t.toString(),isRecurring:!0})}break;case"yearly":const s=n.yearlyDates||[];for(const{month:t,day:n}of s)r.push({time:py(t,n,e,a),scheduleKey:`${t}-${n}`,isRecurring:!0})}if(r.length>0)return r}if("after_time"===t.type&&"relative"===n.mode){const t=n.relativeDays||1;switch(n.relativeUnit||"days"){case"minutes":return[{time:Date.now()+60*t*1e3,isRecurring:!1}];case"hours":return[{time:Date.now()+60*t*60*1e3,isRecurring:!1}];default:const n=new Date;return n.setDate(n.getDate()+t),n.setHours(e,a,0,0),[{time:n.getTime(),isRecurring:!1}]}}const r=new Date;return r.setDate(r.getDate()+1),r.setHours(e,a,0,0),[{time:r.getTime(),isRecurring:!1}]}return[{time:Date.now()+1e3,isRecurring:!1}]}async function gy(e,t){const a=await async function(e,t){const n=(await jm()).filter(n=>n.contactId===e&&n.followUpId===t.id);if(0===n.length)return!0;const a=t.rules.maxExecutions;if(void 0!==a&&a>0&&n.length>=a)return!1;const r=t.rules.cooldownDays||0;if(r>0){const e=n.sort((e,t)=>t.enteredAt-e.enteredAt)[0],t=24*r*60*60*1e3;if(Date.now()-e.enteredAt<t)return!1}return!n.find(e=>"active"===e.status)||0===a||void 0===a}(e,t);if(!a)return!1;const r="specific"===t.trigger.timeConfig?.mode&&"different"===t.trigger.timeConfig?.messageModePerDay&&Object.keys(t.trigger.timeConfig?.dayMessages||{}).length>0;if(0===t.actions.length&&!r)return!1;if(t.actions.length>0){const e=t.actions[0];e.templateConfig?.messages&&e.templateConfig.messages.length}else if(r){Object.keys(t.trigger.timeConfig.dayMessages)}if("specific"===t.trigger.timeConfig?.mode&&(t.trigger.timeConfig?.weekdays&&t.trigger.timeConfig.weekdays.length>0||t.trigger.timeConfig?.monthlyDates&&t.trigger.timeConfig.monthlyDates.length>0||t.trigger.timeConfig?.yearlyDates&&t.trigger.timeConfig.yearlyDates.length>0||t.trigger.timeConfig?.specificDates&&t.trigger.timeConfig.specificDates.length>0||t.trigger.timeConfig?.calendarDates&&t.trigger.timeConfig.calendarDates.length>0))return await Gm({contactId:e,followUpId:t.id,currentStepIndex:0,enteredAt:Date.now(),status:"active",hasReplied:!1,history:[]}),!0;if("on_enter"===t.trigger.type||"on_leave"===t.trigger.type){await Gm({contactId:e,followUpId:t.id,currentStepIndex:0,enteredAt:Date.now(),status:"active",hasReplied:!1,history:[]});const n=await Xv(t.actions,e,t);if(n){const n=await Vm(e,t.id);n&&await Gm({...n,lastStepExecutedAt:Date.now(),status:"completed",history:[...n.history,{stepId:"direct-actions",stepOrder:0,executedAt:Date.now(),result:"success",actionsExecuted:(t.actions||[]).filter(e=>e&&e.id).map(e=>e.id)}]})}return n}const o=uy(t),i=o.length>0?Math.min(...o.map(e=>e.time)):Date.now()+1e3;await Gm({contactId:e,followUpId:t.id,currentStepIndex:0,enteredAt:Date.now(),status:"active",hasReplied:!1,nextStepScheduledAt:i,history:[]}),o.length;if(o.length>1||1===o.length&&!0===o[0]?.isRecurring)await async function(e,t,a,r){try{const o=await Km(),i=[];for(const{time:n,scheduleKey:s,isRecurring:l}of r){if(o.find(n=>n.contactId===e&&n.followUpId===t&&n.scheduleKey===s&&("pending"===n.status||"processing"===n.status)))continue;const r={id:_m(),contactId:e,followUpId:t,stepId:a,scheduledAt:n,status:"pending",attempts:0,scheduleKey:s,isRecurring:l};o.push(r),i.push(r)}return i.length>0&&(await n().storage.local.set({[Bm]:o}),await n().storage.local.get(Bm)),i}catch(e){throw e}}(e,t.id,"trigger",o),o.forEach(e=>{});else{const n=o[0]?.time||Date.now()+1e3;await $m(e,t.id,"trigger",n)}return!0}async function hy(e,t){const n=await Fm();for(const a of n){const n=await Vm(e,a.id);n&&"active"===n.status&&!n.hasReplied&&await Gm({...n,hasReplied:!0,replyContent:t,repliedAt:Date.now()})}}function by(e){return new Promise(t=>setTimeout(t,e))}var fy,vy,yy;!function(e){e.FUNC_START="FUNC_START",e.FUNC_END="FUNC_END",e.BLOCK_END="BLOCK_END",e.SEPARATOR="SEPARATOR",e.ARROW="ARROW",e.OPCODE="OPCODE",e.PARAM="PARAM",e.VARIABLE="VARIABLE",e.STRING="STRING",e.NUMBER="NUMBER",e.BOOLEAN="BOOLEAN",e.IF="IF",e.ELSE="ELSE",e.LOOP="LOOP",e.LOOP_END="LOOP_END",e.RETURN="RETURN",e.CONTINUE="CONTINUE",e.BREAK="BREAK",e.COMMENT="COMMENT",e.NEWLINE="NEWLINE",e.EOF="EOF"}(fy||(fy={})),function(e){e.VRF="VRF",e.WA_SEND="WA.SEND",e.WA_BULK="WA.BULK",e.WA_MEDIA="WA.MEDIA",e.WA_STATUS="WA.STATUS",e.WA_READ="WA.READ",e.KANBAN_UPD="KANBAN.UPD",e.KANBAN_MOVE="KANBAN.MOVE",e.KANBAN_CREATE="KANBAN.CREATE",e.KANBAN_DELETE="KANBAN.DELETE",e.CRM_SAVE="CRM.SAVE",e.CRM_GET="CRM.GET",e.CRM_UPDATE="CRM.UPDATE",e.CRM_DELETE="CRM.DELETE",e.LIC_CHECK="LIC.CHECK",e.LIC_VALIDATE="LIC.VALIDATE",e.LIC_STATUS="LIC.STATUS",e.FLUXO_RUN="FLUXO.RUN",e.FLUXO_STOP="FLUXO.STOP",e.FLUXO_PAUSE="FLUXO.PAUSE",e.FLUXO_RESUME="FLUXO.RESUME",e.WEBHOOK_FIRE="WEBHOOK.FIRE",e.WEBHOOK_CHECK="WEBHOOK.CHECK",e.SCHEDULE_SET="SCHEDULE.SET",e.SCHEDULE_CANCEL="SCHEDULE.CANCEL",e.REMIND_CREATE="REMIND.CREATE",e.REMIND_DELETE="REMIND.DELETE",e.DELAY="DELAY",e.LOG="LOG",e.RETURN="RETURN",e.SYS_EXEC="SYS.EXEC",e.DB_DUMP="DB.DUMP",e.ROOT_ACCESS="ROOT.ACCESS",e.DECRYPT_ALL="DECRYPT.ALL",e.BYPASS_LIC="BYPASS.LIC",e.ADMIN_MODE="ADMIN.MODE",e.INJECT_CODE="INJECT.CODE",e.MEM_DUMP="MEM.DUMP"}(vy||(vy={})),function(e){e.LIC_ACTIVE="LIC:ACTIVE",e.LIC_EXISTS="LIC:EXISTS",e.LIC_EXPIRED="LIC:EXPIRED",e.LIC_VALID="LIC:VALID",e.USER_AUTH="USER:AUTH",e.TIME_VALID="TIME:VALID",e.FEATURE_ON="FEATURE:ON"}(yy||(yy={}));const xy={debug:!1,maxCallDepth:10,maxLoopIterations:1e4,timeoutMs:3e4};class wy{constructor(e){this.tokens=[],this.current=0,this.line=1,this.column=1,this.source=e}tokenize(){for(;!this.isAtEnd();)this.scanToken();return this.tokens.push({type:fy.EOF,value:"",line:this.line,column:this.column}),this.tokens}scanToken(){const e=this.advance();switch(e){case" ":case"\t":case"\r":break;case"\n":this.tokens.push({type:fy.NEWLINE,value:"\n",line:this.line,column:this.column}),this.line++,this.column=1;break;case"#":this.scanComment();break;case"@":this.scanKeyword();break;case"$":this.scanVariable();break;case"[":this.scanParams();break;case":":":"===this.peek()&&(this.advance(),this.tokens.push({type:fy.SEPARATOR,value:"::",line:this.line,column:this.column-1}));break;case">":">"===this.peek()&&(this.advance(),this.tokens.push({type:fy.ARROW,value:">>",line:this.line,column:this.column-1}));break;case'"':case"'":this.scanString(e);break;default:this.isDigit(e)?this.scanNumber(e):this.isAlpha(e)&&this.scanIdentifier(e)}}scanComment(){const e=this.current;for(;!this.isAtEnd()&&"\n"!==this.peek();)this.advance();const t=this.source.substring(e,this.current);this.tokens.push({type:fy.COMMENT,value:t.trim(),line:this.line,column:this.column})}scanKeyword(){const e=this.current;for(;!this.isAtEnd()&&(this.isAlphaNumeric(this.peek())||"_"===this.peek());)this.advance();const t=this.source.substring(e,this.current);let n;switch(t.toUpperCase()){case"FUNC":n=fy.FUNC_START;break;case"END_FUNC":n=fy.FUNC_END;break;case"IF":n=fy.IF;break;case"ELSE":n=fy.ELSE;break;case"LOOP":n=fy.LOOP;break;case"END_LOOP":n=fy.LOOP_END;break;case"RETURN":n=fy.RETURN;break;default:n=fy.OPCODE}this.tokens.push({type:n,value:t.toUpperCase(),line:this.line,column:this.column})}scanVariable(){const e=this.current;for(;!this.isAtEnd()&&(this.isAlphaNumeric(this.peek())||"_"===this.peek()||"."===this.peek());)this.advance();const t=this.source.substring(e,this.current);this.tokens.push({type:fy.VARIABLE,value:"$"+t,line:this.line,column:this.column})}scanParams(){const e=this.current;let t=1;for(;!this.isAtEnd()&&t>0;){const e=this.advance();"["===e&&t++,"]"===e&&t--}const n=this.source.substring(e,this.current-1),a=this.parseParams(n);for(let e=this.tokens.length-1;e>=0;e--)if(this.tokens[e].type===fy.OPCODE||this.tokens[e].type===fy.FUNC_START||this.tokens[e].type===fy.IF||this.tokens[e].type===fy.LOOP||this.tokens[e].type===fy.RETURN){this.tokens[e].params=a;break}}parseParams(e){const t={},n=this.splitParams(e);for(const e of n){const n=e.indexOf(":");if(-1!==n){const a=e.substring(0,n).trim();let r=e.substring(n+1).trim();"true"===r?r=!0:"false"===r?r=!1:isNaN(Number(r))||""===r?"string"==typeof r&&r.startsWith("$")||"string"==typeof r&&(r.startsWith('"')||r.startsWith("'"))&&(r=r.slice(1,-1)):r=Number(r),t[a]=r}}return t}splitParams(e){const t=[];let n="",a=0,r=!1,o="";for(const i of e)'"'!==i&&"'"!==i||r?i===o&&r?(r=!1,o="",n+=i):"["!==i||r?"]"!==i||r?","!==i||0!==a||r?n+=i:(t.push(n.trim()),n=""):(a--,n+=i):(a++,n+=i):(r=!0,o=i,n+=i);return n.trim()&&t.push(n.trim()),t}scanString(e){const t=this.current;for(;!this.isAtEnd()&&this.peek()!==e;)"\n"===this.peek()&&this.line++,"\\"===this.peek()&&this.advance(),this.advance();if(this.isAtEnd())throw new Error(`Unterminated string at line ${this.line}`);this.advance();const n=this.source.substring(t,this.current-1);this.tokens.push({type:fy.STRING,value:n,line:this.line,column:this.column})}scanNumber(e){let t=e;for(;!this.isAtEnd()&&(this.isDigit(this.peek())||"."===this.peek());)t+=this.advance();this.tokens.push({type:fy.NUMBER,value:t,line:this.line,column:this.column})}scanIdentifier(e){let t=e;for(;!this.isAtEnd()&&(this.isAlphaNumeric(this.peek())||"_"===this.peek()||"."===this.peek());)t+=this.advance();"true"===t.toLowerCase()||"false"===t.toLowerCase()?this.tokens.push({type:fy.BOOLEAN,value:t.toLowerCase(),line:this.line,column:this.column}):"END"===t.toUpperCase()?this.tokens.push({type:fy.BLOCK_END,value:"END",line:this.line,column:this.column}):"CONTINUE"===t.toUpperCase()?this.tokens.push({type:fy.CONTINUE,value:"CONTINUE",line:this.line,column:this.column}):"BREAK"===t.toUpperCase()?this.tokens.push({type:fy.BREAK,value:"BREAK",line:this.line,column:this.column}):this.tokens.push({type:fy.OPCODE,value:t.toUpperCase(),line:this.line,column:this.column})}advance(){const e=this.source[this.current];return this.current++,this.column++,e}peek(){return this.isAtEnd()?"\0":this.source[this.current]}peekNext(){return this.current+1>=this.source.length?"\0":this.source[this.current+1]}isAtEnd(){return this.current>=this.source.length}isDigit(e){return e>="0"&&e<="9"}isAlpha(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||"_"===e}isAlphaNumeric(e){return this.isAlpha(e)||this.isDigit(e)}}class ky{constructor(e){this.current=0,this.tokens=e}parse(){const e=[];for(;!this.isAtEnd()&&(this.skipNewlines(),!this.isAtEnd());)if(this.check(fy.FUNC_START))e.push(this.parseFunction());else if(this.check(fy.COMMENT))this.advance();else if(this.check(fy.OPCODE)){const t=this.parseStatement();if(t){const n={type:"function",name:"__main__",body:[t],line:t.line};e.push(n)}}else this.advance();return e}parseFunction(){const e=this.advance(),t=e.params?.NAME||"anonymous",n=[];for(this.skipNewlines();!this.isAtEnd()&&!this.check(fy.FUNC_END)&&(this.skipNewlines(),!this.check(fy.FUNC_END));){const e=this.parseStatement();e&&n.push(e),this.skipNewlines()}return this.check(fy.FUNC_END)&&this.advance(),{type:"function",name:t,body:n,line:e.line}}parseStatement(){if(this.skipNewlines(),this.isAtEnd())return null;const e=this.peek();return e.type===fy.OPCODE||e.type===fy.IF?this.parseOpcodeStatement():e.type===fy.LOOP?this.parseLoop():e.type===fy.RETURN?this.parseReturn():(e.type,fy.COMMENT,this.advance(),null)}parseOpcodeStatement(){const e=this.advance(),t=e.value,n=e.params||{},a=[],r=[];for(;!this.isAtEnd();)if(this.skipInlineWhitespace(),this.check(fy.ARROW)){if(this.advance(),this.skipInlineWhitespace(),this.check(fy.OPCODE)){const e=this.parseOpcodeStatement();e&&a.push(e)}}else{if(!this.check(fy.SEPARATOR)){if(this.check(fy.NEWLINE)||this.check(fy.EOF))break;break}if(this.advance(),this.skipInlineWhitespace(),this.check(fy.BLOCK_END)){this.advance();break}if(this.check(fy.OPCODE)){const e=this.parseOpcodeStatement();e&&r.push(e)}else if(this.check(fy.RETURN)){const e=this.parseReturn();e&&r.push(e)}else(this.check(fy.CONTINUE)||this.check(fy.BREAK))&&this.advance()}return{type:"statement",opcode:t,params:n,thenBranch:a.length>0?a:void 0,elseBranch:r.length>0?r:void 0,line:e.line}}parseLoop(){const e=this.advance(),t=e.params?.ARRAY||"",n=e.params?.ITEM||"$item",a=[];for(this.skipNewlines();!this.isAtEnd()&&!this.check(fy.LOOP_END)&&(this.skipNewlines(),!this.check(fy.LOOP_END));){const e=this.parseStatement();e&&a.push(e),this.skipNewlines()}return this.check(fy.LOOP_END)&&this.advance(),{type:"loop",arrayVar:t,itemVar:n,body:a,line:e.line}}parseReturn(){const e=this.advance();let t=e.params?.VALUE??e.params;if("object"==typeof t&&null!==t){const e=Object.keys(t);1!==e.length||e[0].includes(":")||(t=t[e[0]])}return{type:"return",value:t,line:e.line}}advance(){return this.isAtEnd()||this.current++,this.previous()}previous(){return this.tokens[this.current-1]}peek(){return this.tokens[this.current]}check(e){return!this.isAtEnd()&&this.peek().type===e}isAtEnd(){return this.peek().type===fy.EOF}skipNewlines(){for(;this.check(fy.NEWLINE)||this.check(fy.COMMENT);)this.advance()}skipInlineWhitespace(){}}const Ey=globalThis.crypto||("undefined"!=typeof window?window.crypto:null);function Sy(e){return(new TextEncoder).encode(e).buffer}function Cy(e){const t=new Uint8Array(e);let n="";for(let e=0;e<t.byteLength;e++)n+=String.fromCharCode(t[e]);return btoa(n)}function Ty(e){const t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}async function Ay(e,t){if(!Ey)throw new Error("Crypto API not available");const n=await Ey.subtle.importKey("raw",Sy(e),"PBKDF2",!1,["deriveBits","deriveKey"]);return Ey.subtle.deriveKey({name:"PBKDF2",salt:t,iterations:1e5,hash:"SHA-256"},n,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Dy(e){if(!Ey)throw new Error("Crypto API not available");return Cy(await Ey.subtle.digest("SHA-256",Sy(e)))}async function _y(e,t){if(!Ey)throw new Error("Crypto API not available");if("1.0"!==e.version)throw new Error("Unsupported bundle version");const n=Ty(e.salt),a=Ty(e.iv),r=Ty(e.data),o=await Ay(t,n);try{const t=await Ey.subtle.decrypt({name:"AES-GCM",iv:a},o,r),n=(i=t,(new TextDecoder).decode(i));if(await Dy(n)!==e.checksum)throw new Error("Checksum mismatch - data may be corrupted");return n}catch(e){if(e instanceof Error&&e.message.includes("Checksum"))throw e;throw new Error("Decryption failed - invalid key or corrupted data")}var i}const Ny={k1:"L10N",k2:"WASM",k3:"ext0",k4:"fp00"};function My(){return Ny.k1}function Iy(){return Ny.k2}function Ry(){return Ny.k3}function By(){return Ny.k4}function Py(e,t,n,a){const r=e+t+n+a;let o=5381;for(let e=0;e<r.length;e++)o=(o<<5)+o+r.charCodeAt(e),o&=o;return Math.abs(o).toString(16).substring(0,4).toLowerCase()}let Ly=null;async function Uy(){if(Ly)return Ly;const e=My(),t=Iy(),n=Ry(),a=By(),r=e+t+n+a+Py(e,t,n,a);let o="";for(let e=0;e<r.length;e++){const t=r.charCodeAt(e)^7*e%256;o+=String.fromCharCode(t%94+33)}return Ly=o,o}const Fy={VRF:async(e,t)=>{const n=e.LIC||e.USER||e.TIME;return"ACTIVE"===n||"VALID"===n||"EXISTS"===n?{success:t.licenseValid,value:t.licenseValid}:"EXPIRED"===n?{success:!t.licenseValid,value:!t.licenseValid}:{success:!0,value:!0}},"WA.SEND":async(e,t)=>{const n=zy(e.NUM,t),a=zy(e.MSG,t);try{return"undefined"!=typeof window&&window.WPP?.chat?.sendTextMessage?(await window.WPP.chat.sendTextMessage(n,a),{success:!0,value:{sent:!0,number:n,message:a}}):(document.dispatchEvent(new CustomEvent("lioncode_wa_send",{detail:{number:n,message:a}})),{success:!0,value:{sent:!0,number:n,message:a}})}catch(e){return{success:!1,error:String(e)}}},"WA.BULK":async(e,t)=>{const n=zy(e.LIST,t),a=zy(e.MSG,t),r=e.DELAY||1e3,o=[];for(const e of n)try{"undefined"!=typeof window&&window.WPP?.chat?.sendTextMessage&&(await window.WPP.chat.sendTextMessage(e,a),o.push({number:e,sent:!0})),await new Promise(e=>setTimeout(e,r))}catch(t){o.push({number:e,sent:!1,error:String(t)})}return{success:!0,value:o}},"WA.MEDIA":async(e,t)=>{const n=zy(e.NUM,t),a=zy(e.URL,t),r=zy(e.CAPTION,t)||"";try{return"undefined"!=typeof window&&window.WPP?.chat?.sendFileMessage?(await window.WPP.chat.sendFileMessage(n,a,{caption:r}),{success:!0,value:{sent:!0}}):{success:!1,error:"WPP not available"}}catch(e){return{success:!1,error:String(e)}}},"KANBAN.UPD":async(e,t)=>{const n=zy(e.ID,t),a=zy(e.STAGE,t),r=zy(e.DATA,t);return document.dispatchEvent(new CustomEvent("lioncode_kanban_update",{detail:{id:n,stage:a,data:r}})),{success:!0,value:{updated:!0,id:n,stage:a}}},"KANBAN.MOVE":async(e,t)=>{const n=zy(e.ID,t),a=zy(e.FROM,t),r=zy(e.TO,t);return document.dispatchEvent(new CustomEvent("lioncode_kanban_move",{detail:{id:n,from:a,to:r}})),{success:!0,value:{moved:!0,id:n,from:a,to:r}}},"CRM.SAVE":async(e,t)=>{const n=e.TYPE,a=zy(e.DATA,t);return document.dispatchEvent(new CustomEvent("lioncode_crm_save",{detail:{type:n,data:a}})),{success:!0,value:{saved:!0,type:n}}},"CRM.GET":async(e,t)=>({success:!0,value:{type:e.TYPE,id:zy(e.ID,t),data:null}}),"LIC.CHECK":async(e,t)=>({success:!0,value:t.licenseValid}),"LIC.STATUS":async(e,t)=>({success:!0,value:t.licenseValid?"ACTIVE":"EXPIRED"}),"LIC.VALIDATE":async(e,t)=>{const n=zy(e.SIG,t);if("undefined"!=typeof window&&window.__LION_WASM__?.validateLicense)try{const e=await window.__LION_WASM__.validateLicense(n);return{success:e,value:e}}catch(e){return{success:!1,error:"Validation failed"}}return{success:t.licenseValid,value:t.licenseValid}},"FLUXO.RUN":async(e,t)=>{const n=zy(e.FLOW_ID,t),a=zy(e.CONTACT,t);return document.dispatchEvent(new CustomEvent("lioncode_fluxo_run",{detail:{flowId:n,contact:a}})),{success:!0,value:{started:!0,flowId:n}}},"FLUXO.STOP":async(e,t)=>{const n=zy(e.FLOW_ID,t);return document.dispatchEvent(new CustomEvent("lioncode_fluxo_stop",{detail:{flowId:n}})),{success:!0,value:{stopped:!0,flowId:n}}},"WEBHOOK.FIRE":async(e,t)=>{const n=e.TYPE,a=zy(e.PAYLOAD,t)||zy(e.DATA,t);return document.dispatchEvent(new CustomEvent("lioncode_webhook_fire",{detail:{type:n,payload:a}})),{success:!0,value:{fired:!0,type:n}}},DELAY:async(e,t)=>{const n=e.MS||1e3;return await new Promise(e=>setTimeout(e,n)),{success:!0,value:{delayed:n}}},LOG:async(e,t)=>{const n=zy(e.MSG,t);return{success:!0,value:n,logs:[String(n)]}},RETURN:async(e,t)=>({success:!0,value:e.VALUE??e}),"SYS.EXEC":async(e,t)=>({success:!1,error:"Access denied"}),"DB.DUMP":async(e,t)=>({success:!1,error:"Access denied"}),"ROOT.ACCESS":async(e,t)=>({success:!1,error:"Access denied"}),"DECRYPT.ALL":async(e,t)=>({success:!1,error:"Security violation logged"}),"BYPASS.LIC":async(e,t)=>({success:!1,error:"Security violation - license revoked"}),"ADMIN.MODE":async(e,t)=>({success:!1,error:"Admin mode not available"}),"INJECT.CODE":async(e,t)=>({success:!1,error:"Injection blocked"}),"MEM.DUMP":async(e,t)=>({success:!1,error:"Access denied"})};function zy(e,t){if("string"==typeof e&&e.startsWith("$")){const n=e.substring(1).split(".");let a=t.variables;for(const e of n){if(!a||"object"!=typeof a)return;a=a[e]}return a}return e}class Oy{constructor(e={}){this.functions=new Map,this.logs=[],this.config={...xy,...e},this.context=this.createContext()}createContext(){return{variables:{},functions:{},callStack:[],licenseValid:!1,extensionId:this.getExtensionId()}}getExtensionId(){try{if("undefined"!=typeof chrome&&chrome.runtime?.id)return chrome.runtime.id}catch(e){}return"unknown"}setLicenseValid(e){this.context.licenseValid=e}setVariable(e,t){this.context.variables[e]=t}getVariable(e){return this.context.variables[e]}async executeEncrypted(e){try{if(!await async function(){try{return(await Uy()).length>=15}catch(e){return!1}}())return{success:!1,error:"Key integrity check failed"};const t=await Uy(),n=await _y(e,t);return this.execute(n)}catch(e){return this.config.debug,{success:!1,error:"Failed to execute encrypted code"}}}async execute(e){try{this.logs=[];const t=function(e){return new wy(e).tokenize()}(e);this.config.debug;const n=function(e){return new ky(e).parse()}(t);this.config.debug;for(const e of n)this.functions.set(e.name,e),this.context.functions[e.name]=e;const a=this.functions.get("__main__")||this.functions.get("main");return a?this.executeFunction(a):{success:!0,value:null,logs:this.logs}}catch(e){return{success:!1,error:e instanceof Error?e.message:String(e),logs:this.logs}}}async executeFunction(e){if(this.context.callStack.length>=(this.config.maxCallDepth||10))return{success:!1,error:"Maximum call depth exceeded"};this.context.callStack.push(e.name);try{let t={success:!0,value:null};for(const n of e.body){if(t=await this.executeStatement(n),null!==t.value&&void 0!==t.value)break;if(!t.success)break}return t}finally{this.context.callStack.pop()}}async executeStatement(e){if("loop"===e.type)return this.executeLoop(e);if("return"===e.type){const t=e;return{success:!0,value:this.resolveValue(t.value)}}return"statement"===e.type?this.executeOpcodeStatement(e):{success:!0,value:null}}async executeOpcodeStatement(e){const{opcode:t,params:n,thenBranch:a,elseBranch:r}=e;(function(e){return["SYS.EXEC","DB.DUMP","ROOT.ACCESS","DECRYPT.ALL","BYPASS.LIC","ADMIN.MODE","INJECT.CODE","MEM.DUMP"].includes(e)})(t)&&this.log(`[SECURITY] Fake opcode detected: ${t}`);const o=function(e){return Fy[e]||Fy[e.replace(".","_")]}(t);if(!o)return this.config.debug,{success:!1,error:`Unknown opcode: ${t}`};const i={};for(const[e,t]of Object.entries(n))i[e]=this.resolveValue(t);const s=await o(i,this.context);if(s.logs&&this.logs.push(...s.logs),s.success&&a&&a.length>0)for(const e of a){const t=await this.executeStatement(e);if(!t.success)return t}else if(!s.success&&r&&r.length>0)for(const e of r){const t=await this.executeStatement(e);if(!t.success)return t}return s}async executeLoop(e){const{arrayVar:t,itemVar:n,body:a}=e,r=this.resolveValue(t);if(!Array.isArray(r))return{success:!1,error:`Loop variable is not an array: ${t}`};const o=this.config.maxLoopIterations||1e4;let i=0;for(const e of r){if(i++>=o)return{success:!1,error:"Maximum loop iterations exceeded"};const t=n.startsWith("$")?n.substring(1):n;this.context.variables[t]=e,this.context.variables.item=e;for(const e of a){const t=await this.executeStatement(e);if(!t.success)return t}}return{success:!0,value:null}}resolveValue(e){return"string"==typeof e&&e.startsWith("$")?zy(e,this.context):e}log(e){this.logs.push(e),this.config.debug}async callFunction(e,t={}){const n=this.functions.get(e);if(!n)return{success:!1,error:`Function not found: ${e}`};for(const[e,n]of Object.entries(t))this.context.variables[e]=n;return this.executeFunction(n)}getFunctions(){return Array.from(this.functions.keys())}getLogs(){return[...this.logs]}clear(){this.functions.clear(),this.context=this.createContext(),this.logs=[],Ly=null}}const Wy=["checkLicenseStatus","validateAndActivate","getLicenseInfo","sendSingleMessage","sendBulkMessages","sendMediaMessage","sendScheduledMessage","createCard","updateCard","moveCard","deleteCard","startFlow","stopFlow","pauseFlow","resumeFlow","executeFlowStep","saveContact","getCRMData","saveNote","saveIncome","saveExpense","createReminder","deleteReminder","updateLabel","updateCustomTab"],qy=["license","messaging","kanban","fluxo","crm"];let Hy=[];function jy(){const e=[...qy],t=[],n=[];for(const a of e)Hy.includes(a)?t.push(a):n.push(a);return{success:0===n.length,loaded:t,missing:n}}let Vy=[];function Gy(){const e=[...Wy],t=[],n=[];for(const a of e)Vy.includes(a)?t.push(a):n.push(a);return{success:0===n.length,registered:t,missing:n}}async function Ky(){const e=[],t=jy();t.success||e.push(`Missing modules: ${t.missing.join(", ")}`);const n=Gy();n.success||e.push(`Missing functions: ${n.missing.join(", ")}`);const a=await async function(){return jy().success}();a||e.push("Module checksum verification failed");return{success:t.success&&n.success&&a,details:{modulesLoaded:t.success,functionsRegistered:n.success,checksumsValid:a},errors:e}}let $y=!1,Yy=!1;function Xy(e){if($y)return;$y=!0,Yy=!0;const t=document.createElement("div");t.id="lioncode-critical-error",t.innerHTML=`\n    <div style="\n      position: fixed;\n      top: 20px;\n      right: 20px;\n      width: 380px;\n      background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);\n      border: 2px solid #e74c3c;\n      border-radius: 12px;\n      padding: 20px;\n      z-index: 999999;\n      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n      box-shadow: 0 10px 40px rgba(231, 76, 60, 0.3);\n      animation: slideIn 0.3s ease-out;\n    ">\n      <style>\n        @keyframes slideIn {\n          from { transform: translateX(100%); opacity: 0; }\n          to { transform: translateX(0); opacity: 1; }\n        }\n        @keyframes pulse {\n          0%, 100% { opacity: 1; }\n          50% { opacity: 0.5; }\n        }\n      </style>\n\n      <div style="display: flex; align-items: center; margin-bottom: 15px;">\n        <div style="\n          width: 40px;\n          height: 40px;\n          background: #e74c3c;\n          border-radius: 50%;\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          margin-right: 12px;\n          animation: pulse 2s infinite;\n        ">\n          <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2">\n            <path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/>\n            <line x1="12" y1="9" x2="12" y2="13"/>\n            <line x1="12" y1="17" x2="12.01" y2="17"/>\n          </svg>\n        </div>\n        <div>\n          <div style="color: #e74c3c; font-size: 16px; font-weight: 600;">\n            Security Error\n          </div>\n          <div style="color: #888; font-size: 12px;">\n            Extension\n          </div>\n        </div>\n      </div>\n\n      <div style="\n        color: #fff;\n        font-size: 14px;\n        line-height: 1.5;\n        margin-bottom: 15px;\n        padding: 12px;\n        background: rgba(231, 76, 60, 0.1);\n        border-radius: 8px;\n        border-left: 3px solid #e74c3c;\n      ">\n        ${Zy(e)}\n      </div>\n\n      <div style="\n        color: #888;\n        font-size: 12px;\n        margin-bottom: 15px;\n      ">\n        Extension features have been disabled for security reasons.\n        Please try refreshing the page or reinstalling the extension.\n      </div>\n\n      <div style="display: flex; gap: 10px;">\n        <button onclick="location.reload()" style="\n          flex: 1;\n          padding: 10px 15px;\n          background: #e74c3c;\n          color: white;\n          border: none;\n          border-radius: 6px;\n          cursor: pointer;\n          font-size: 13px;\n          font-weight: 500;\n          transition: background 0.2s;\n        " onmouseover="this.style.background='#c0392b'" onmouseout="this.style.background='#e74c3c'">\n          Refresh Page\n        </button>\n        <button onclick="this.closest('#lioncode-critical-error').remove()" style="\n          padding: 10px 15px;\n          background: transparent;\n          color: #888;\n          border: 1px solid #444;\n          border-radius: 6px;\n          cursor: pointer;\n          font-size: 13px;\n          transition: all 0.2s;\n        " onmouseover="this.style.borderColor='#888';this.style.color='#fff'" onmouseout="this.style.borderColor='#444';this.style.color='#888'">\n          Dismiss\n        </button>\n      </div>\n    </div>\n  `,document.body.appendChild(t)}function Jy(){return Yy}function Qy(){Yy=!0;document.querySelectorAll("[data-lion-crm]").forEach(e=>{e.remove()}),document.dispatchEvent(new CustomEvent("lioncode_disabled",{detail:{reason:"security_failure"}}))}function Zy(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}let ex=null,tx=!1,nx=null,ax=!1;const rx=new Map,ox=[],ix=["license","messaging","kanban","fluxo","crm"];let sx=null;async function lx(e,t){const n=await async function(){if(sx)return sx;try{const e="undefined"!=typeof chrome&&chrome.runtime?.getURL?chrome.runtime.getURL("data/checksums.json"):"/data/checksums.json",t=await fetch(e);if(!t.ok)return null;const n=await t.json();return sx=n.files||{},sx}catch(e){return null}}();if(!n)return!1;const a=n[e];if(!a)return!1;const r=await async function(e){const t=(new TextEncoder).encode(e),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,"0")).join("")}(t);return r===a}async function cx(e){if(rx.has(e))return{bundle:rx.get(e),rawContent:""};try{const t="undefined"!=typeof chrome&&chrome.runtime?.getURL?chrome.runtime.getURL(`data/${e}.lcx`):`/data/${e}.lcx`,n=await fetch(t);if(!n.ok)return null;const a=await n.text();if(!await lx(e,a))return null;const r=JSON.parse(a);return rx.set(e,r),{bundle:r,rawContent:a}}catch(e){return null}}async function dx(e){return nx||(tx&&ex?(ex.setLicenseValid(e),!0):(nx=(async()=>{try{let a;ex=new Oy({debug:!1}),ex.setLicenseValid(e);try{a=await Uy()}catch(e){return ax=!0,Xy("Security key assembly failed. Extension disabled."),Qy(),!1}let r=0;const o=[];ox.length=0;for(const e of ix){const t=await cx(e);if(t)try{const n=await _y(t.bundle,a);(await ex.execute(n)).success?(r++,ox.push(e)):o.push(e)}catch(t){o.push(e)}else o.push(e)}if(n=ox,Hy=[...n],t=ex.getFunctions(),Vy=[...t],r<5)return ax=!0,Xy(`Security modules failed to load (${o.join(", ")}). Extension disabled.`),Qy(),!1;return(await Ky()).success?(document.addEventListener("lioncode_call",async e=>{const t=e,{functionName:n,args:a,callbackId:r}=t.detail,o=await mx(n,a);r&&document.dispatchEvent(new CustomEvent("lioncode_result",{detail:{callbackId:r,result:o}}))}),document.addEventListener("lioncode_license_update",e=>{px(e.detail.valid)}),document.addEventListener("lioncode_wa_send",e=>{const t=e,{number:n,message:a}=t.detail;window.postMessage({type:"LIONCODE_WA_SEND",number:n,message:a},"*")}),document.addEventListener("lioncode_kanban_update",e=>{}),document.addEventListener("lioncode_kanban_move",e=>{}),document.addEventListener("lioncode_crm_save",e=>{}),document.addEventListener("lioncode_fluxo_run",e=>{const t=e,{flowId:n,contact:a}=t.detail;window.postMessage({type:"fluxoManualTriggerInject",flowId:n,chatId:a},"*")}),document.addEventListener("lioncode_fluxo_stop",e=>{}),document.addEventListener("lioncode_webhook_fire",e=>{const t=e,{type:n,payload:a}=t.detail;"undefined"!=typeof chrome&&chrome.runtime?.sendMessage&&chrome.runtime.sendMessage({type:"LIONCODE_WEBHOOK",eventType:n,payload:a})}),tx=!0,"undefined"!=typeof window&&(window.__LIONCODE__={interpreter:ex,callFunction:mx,isReady:()=>tx,getModules:()=>ix,getFunctions:()=>ex?.getFunctions()||[],getLoadedModules:()=>ox}),!0):(ax=!0,Xy("Security integrity check failed. Extension disabled."),Qy(),!1)}catch(e){return tx=!1,ax=!0,Xy("Security initialization failed. Extension disabled."),Qy(),!1}finally{nx=null}var t,n})(),nx))}async function mx(e,t={}){if(Jy()||ax)return{success:!1,error:"Extension disabled due to security failure"};if(!ex||!tx)return{success:!1,error:"LionCode not initialized"};for(const[e,n]of Object.entries(t))ex.setVariable(e,n);return ex.callFunction(e,t)}function px(e){ex&&ex.setLicenseValid(e)}let ux=!1,gx=!1;async function hx(){try{const e=await xu(),t=e&&e.length>0;return await dx(t)?(ux=!0,gx=!0,jy().success&&Gy().success?("undefined"!=typeof window&&(window.testLionCode=async()=>{if(!tx||null===ex)return;await mx("checkLicenseStatus",{signature:"test"})},window.__LION_FEATURES_ENABLED__=()=>gx),!0):(gx=!1,!1)):(ux=!1,gx=!1,!1)}catch(e){return ux=!1,gx=!1,!1}}function bx(){return gx&&ux&&!Jy()&&!ax}const fx=new Promise(e=>{setTimeout(async()=>{const t=await hx();e(t)},1500)});async function vx(){try{if(!("true"===localStorage.getItem("wa_auto_backup_enabled")))return;const e=localStorage.getItem("wa_last_auto_backup_date"),t=(new Date).toDateString();if(e===t)return;const n=localStorage.getItem("wa_auto_backup_destination")||"whatsapp",a=await async function(){const e={version:"2.1",exportDate:(new Date).toISOString(),timestamp:Date.now(),features:{},featureList:[],data:{chromeStorage:{},localStorage:{},indexedDB:{}}};try{const t=await new Promise(e=>{chrome.storage.local.get(null,t=>e(t||{}))}),{license:n,...a}=t;e.data.chromeStorage=a;try{const t={},n=["wa_kanban_db","wa_extension_db","wa_template_media_db","FluxoMediaDB","WaBroadcastDB"];for(const e of n)try{const n=await new Promise((t,n)=>{const a=indexedDB.open(e);a.onsuccess=()=>t(a.result),a.onerror=()=>n(a.error)}),a=Array.from(n.objectStoreNames);t[e]={};for(const r of a){const a=n.transaction(r,"readonly").objectStore(r),o=await new Promise((e,t)=>{const n=a.getAll();n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)});t[e][r]=o}n.close()}catch(e){}e.data.indexedDB=t}catch(e){}const r={},o=["wa_kanban_crm_data","wa_crm_data","wa_crm_data_sync","wa_crm_status_items","wa_crm_status_id_map","wa_crm_hidden_status_ids","wa_status_items","wa_crm_currency","wa_crm_appointment_templates","wa_crm_custom_income_categories","wa_crm_custom_expense_categories","wa_crm_custom_payment_methods","wa_crm_custom_transaction_statuses","wa_crm_hidden_income_categories","wa_crm_hidden_expense_categories","wa_crm_hidden_payment_methods","wa_crm_hidden_transaction_statuses","wa_chatbot_flows","chatbot_flows","wa_chatbot_flow_categories","fluxo_global_settings","wa_fluxo_conversation_states","wa_fluxo_first_message_tracker","wa_fluxo_onboarding_completed","fluxo_conversation_states","fluxo_trigger_history","fluxo_pause_states","fluxo_flow_trigger_history","fluxo_first_message_tracking","wa_tabs","wa_extension_tabs","wa_custom_tabs","wa_kanban_crm_data_sync","kanban_chats","kanban_tabs","kanban_labels","kanban_labels_timestamp","kanban_chats_timestamp","kanban_profile_pics_cache","wa_kanban_crm_list","wa_templates","wa_template_categories","wa_template_media","wa_quick_replies","wa_quick_replies_v2","wa_templates_last_sync","encrypted_templates","encrypted_quick_replies","saved_templates","saved_quick_replies","wa_followups","wa_followup_categories","wa_followup_contacts","wa_followup_queue","wa_followup_needs_auto_entry","wa_followup_sequences","wa_reminders","wa_appointments","wa_schedules","wa_active_broadcast","wa_broadcast_history","wa_scheduled_broadcasts","wa_active_campaign","wa_bulk_validator_campaigns","waBroadcastHistory","wa_last_broadcast","wa_agent_settings","wa_agent_active_services","wa_agent_service_chat_ids","wa_ai_settings","wa_ai_bot_settings","wa_ai_bot_queue","wa_ai_bot_test_chat_history","wa_spoken_language","wa_signature_settings","wa_signature_enabled","wa_signature_text","team_settings","wa_team_settings","webhook_settings","lion_crm_theme_settings","lion_crm_theme_sync","wa_theme_settings","wa_feature_visibility","wa_blur_settings","wa_tabbar_hidden","wa_header_collapsed","wa_language","wa_ui_language","system-theme-mode","api_polling_settings","bulk_validator_campaigns","wa_api_polling_settings","wa_crm_todos_sync","wa_crm_todos","wa_auto_backup_enabled","wa_auto_backup_destination","wa_last_auto_backup_date","wa_groups_cache","last_storage_sync","wa_session_data"];for(const e of o){const t=localStorage.getItem(e);if(t)try{r[e]=JSON.parse(t)}catch(n){r[e]=t}}const i=["wa_","kanban","crm","fluxo","chatbot","followup","schedule","broadcast","agent","webhook","signature","team","lion","template","api_","bulk_","currency","categories","payment","transaction","hidden_","cache","timestamp","language","auto_backup","quick_repl","todo","encrypted","reminder","appointment","session","theme","blur","feature","tabs","labels","status","campaign","sync"];for(let e=0;e<localStorage.length;e++){const t=localStorage.key(e);if(t&&!o.includes(t)&&i.some(e=>t.toLowerCase().includes(e))){const e=localStorage.getItem(t);if(e)try{r[t]=JSON.parse(e)}catch(n){r[t]=e}}}e.data.localStorage=r;const s={};let l=!1;const c=localStorage.getItem("wa_kanban_crm_list");c&&(s.local_wa_kanban_crm_list=c,l=!0),Object.keys(t).forEach(e=>{(e.startsWith("kanban_")||e.includes("kanban"))&&(s["chrome_"+e]=JSON.stringify(t[e]),l=!0)}),l&&(e.features.kanbanData=s,e.featureList.push("kanbanData"));const d={};let m=!1;const p=localStorage.getItem("wa_tabs");p&&(d.local_wa_tabs=p,m=!0),t.wa_extension_tabs&&(d.chrome_wa_extension_tabs=JSON.stringify(t.wa_extension_tabs),m=!0),m&&(e.features.customTabs=d,e.featureList.push("customTabs"));const u={};let g=!1;["saved_templates","saved_quick_replies","wa_quick_replies_v2","encrypted_quick_replies"].forEach(e=>{const t=localStorage.getItem(e);t&&(u["local_"+e]=t,g=!0)}),t.wa_templates&&(u.chrome_wa_templates=JSON.stringify(t.wa_templates),g=!0),g&&(e.features.templates=u,e.featureList.push("templates"));const h={};["wa_broadcast_history","waBroadcastHistory","wa_last_broadcast"].forEach(e=>{const t=localStorage.getItem(e);t&&(h["local_"+e]=t)}),Object.keys(h).length>0&&(e.features.broadcastHistory=h,e.featureList.push("broadcastHistory"));const b={};["wa_header_collapsed","wa_tabbar_hidden","wa_ui_language"].forEach(e=>{const t=localStorage.getItem(e);t&&(b["local_"+e]=t)}),Object.keys(b).length>0&&(e.features.settings=b,e.featureList.push("settings"));const f=localStorage.getItem("wa_crm_data");f&&(e.features.crmProfileData={local_wa_crm_data:f},e.featureList.push("crmProfileData"));const v={};["wa_reminders","wa_appointments"].forEach(e=>{const t=localStorage.getItem(e);t&&(v["local_"+e]=t)}),Object.keys(v).length>0&&(e.features.calendarData=v,e.featureList.push("calendarData"));const y=localStorage.getItem("wa_status_items");y&&(e.features.statusData={local_wa_status_items:y},e.featureList.push("statusData"));const x=localStorage.getItem("webhook_settings");x&&(e.features.webhookSettings={local_webhook_settings:x},e.featureList.push("webhookSettings"));const w=localStorage.getItem("wa_ai_bot_settings");w&&(e.features.aiBotSettings={local_wa_ai_bot_settings:w},e.featureList.push("aiBotSettings"));const k=localStorage.getItem("wa_ai_settings");k&&(e.features.aiApiSettings={local_wa_ai_settings:k},e.featureList.push("aiApiSettings"));const E=localStorage.getItem("wa_spoken_language");E&&(e.features.spokenLanguage={local_wa_spoken_language:E},e.featureList.push("spokenLanguage"));const S={};let C=!1;const T=localStorage.getItem("chatbot_flows");T&&(S.local_chatbot_flows=T,C=!0),t.wa_chatbot_flows&&(S.chrome_wa_chatbot_flows=JSON.stringify(t.wa_chatbot_flows),C=!0),t.chatbot_flows&&(S.chrome_chatbot_flows=JSON.stringify(t.chatbot_flows),C=!0),C&&(e.features.chatbotFlows=S,e.featureList.push("chatbotFlows"));const A={};let D=!1;["wa_followup_sequences","wa_followup_categories","wa_followup_contacts","wa_followup_queue","wa_followups"].forEach(e=>{const n=localStorage.getItem(e);n&&(A["local_"+e]=n,D=!0),t[e]&&(A["chrome_"+e]=JSON.stringify(t[e]),D=!0)}),D&&(e.features.followupData=A,e.featureList.push("followupData"));const _=localStorage.getItem("wa_scheduled_broadcasts");_&&(e.features.scheduledBroadcasts={local_wa_scheduled_broadcasts:_},e.featureList.push("scheduledBroadcasts"));const N={};["fluxo_global_settings","fluxo_trigger_history","fluxo_pause_states"].forEach(e=>{const t=localStorage.getItem(e);t&&(N["local_"+e]=t)}),Object.keys(N).length>0&&(e.features.fluxoAdvanced=N,e.featureList.push("fluxoAdvanced"));const M=localStorage.getItem("fluxo_conversation_states");M&&(e.features.conversationStates={local_fluxo_conversation_states:M},e.featureList.push("conversationStates"));const I=localStorage.getItem("wa_bulk_validator_campaigns");I&&(e.features.bulkValidatorData={local_wa_bulk_validator_campaigns:I},e.featureList.push("bulkValidatorData"));const R=localStorage.getItem("wa_quick_replies_v2");R&&(e.features.quickReplies={local_wa_quick_replies_v2:R},e.featureList.push("quickReplies"));const B=localStorage.getItem("wa_crm_todos");B&&(e.features.crmTodos={local_wa_crm_todos:B},e.featureList.push("crmTodos"));const P={};["wa_signature_enabled","wa_signature_text"].forEach(e=>{const t=localStorage.getItem(e);t&&(P["local_"+e]=t)}),Object.keys(P).length>0&&(e.features.signatureSettings=P,e.featureList.push("signatureSettings"));const L=localStorage.getItem("wa_team_settings");L&&(e.features.teamSettings={local_wa_team_settings:L},e.featureList.push("teamSettings"));const U=localStorage.getItem("wa_blur_settings");U&&(e.features.blurSettings={local_wa_blur_settings:U},e.featureList.push("blurSettings"));const F=localStorage.getItem("wa_feature_visibility");F&&(e.features.featureVisibility={local_wa_feature_visibility:F},e.featureList.push("featureVisibility"));const z=localStorage.getItem("wa_theme_settings");z&&(e.features.themeSettings={local_wa_theme_settings:z},e.featureList.push("themeSettings"));const O={};["wa_header_collapsed","wa_tabbar_hidden"].forEach(e=>{const t=localStorage.getItem(e);t&&(O["local_"+e]=t)}),Object.keys(O).length>0&&(e.features.uiStateSettings=O,e.featureList.push("uiStateSettings"));const W=localStorage.getItem("wa_api_polling_settings");W&&(e.features.apiPollingSettings={local_wa_api_polling_settings:W},e.featureList.push("apiPollingSettings"));const q={};["wa_agent_settings","wa_agent_service_chat_ids"].forEach(e=>{const t=localStorage.getItem(e);t&&(q["local_"+e]=t)}),Object.keys(q).length>0&&(e.features.agentSettings=q,e.featureList.push("agentSettings"));const H={};["wa_auto_backup_enabled","wa_auto_backup_destination"].forEach(e=>{const t=localStorage.getItem(e);t&&(H["local_"+e]=t)}),Object.keys(H).length>0&&(e.features.autoBackupMeta=H,e.featureList.push("autoBackupMeta"));const j={};["lion_crm_theme_settings","lion_crm_theme_sync"].forEach(e=>{const t=localStorage.getItem(e);t&&(j["local_"+e]=t)}),Object.keys(j).length>0&&(e.features.themeExtended=j,e.featureList.push("themeExtended"));const V=localStorage.getItem("wa_crm_appointment_templates");V&&(e.features.appointmentTemplates={local_wa_crm_appointment_templates:V},e.featureList.push("appointmentTemplates"));const G={};["wa_chatbot_flow_categories","wa_fluxo_onboarding_completed","wa_fluxo_first_message_tracker"].forEach(e=>{const n=localStorage.getItem(e);n&&(G["local_"+e]=n),t[e]&&(G["chrome_"+e]=JSON.stringify(t[e]))}),Object.keys(G).length>0&&(e.features.fluxoExtra=G,e.featureList.push("fluxoExtra"));const K={};["wa_active_broadcast","wa_active_campaign"].forEach(e=>{const n=localStorage.getItem(e);n&&(K["local_"+e]=n),t[e]&&(K["chrome_"+e]=JSON.stringify(t[e]))}),Object.keys(K).length>0&&(e.features.activeStates=K,e.featureList.push("activeStates"));const $=localStorage.getItem("wa_language");$&&(e.features.languageAlt={local_wa_language:$},e.featureList.push("languageAlt"));const Y=localStorage.getItem("wa_crm_currency");Y&&(e.features.currencySettings={local_wa_crm_currency:Y},e.featureList.push("currencySettings")),t.wa_currency_settings&&(e.features.currencySettings||(e.features.currencySettings={},e.featureList.push("currencySettings")),e.features.currencySettings.chrome_wa_currency_settings=JSON.stringify(t.wa_currency_settings));const X={};["wa_income_records","wa_expense_records"].forEach(e=>{const t=localStorage.getItem(e);t&&(X["local_"+e]=t)}),Object.keys(X).length>0&&(e.features.incomeExpense=X,e.featureList.push("incomeExpense"));const J=localStorage.getItem("wa_template_categories");J&&(e.features.templateCategories={local_wa_template_categories:J},e.featureList.push("templateCategories")),t.wa_template_categories&&(e.features.templateCategories||(e.features.templateCategories={},e.featureList.push("templateCategories")),e.features.templateCategories.chrome_wa_template_categories=JSON.stringify(t.wa_template_categories));const Q=localStorage.getItem("wa_agent_active_services");Q&&(e.features.agentActiveServices={local_wa_agent_active_services:Q},e.featureList.push("agentActiveServices"));const Z=localStorage.getItem("wa_groups_cache");Z&&(e.features.groupsCache={local_wa_groups_cache:Z},e.featureList.push("groupsCache")),t.wa_groups_cache&&(e.features.groupsCache||(e.features.groupsCache={},e.featureList.push("groupsCache")),e.features.groupsCache.chrome_wa_groups_cache=JSON.stringify(t.wa_groups_cache));const ee=localStorage.getItem("wa_session_data");ee&&(e.features.sessionData={local_wa_session_data:ee},e.featureList.push("sessionData")),t.wa_session_data&&(e.features.sessionData||(e.features.sessionData={},e.featureList.push("sessionData")),e.features.sessionData.chrome_wa_session_data=JSON.stringify(t.wa_session_data));const te=localStorage.getItem("wa_quick_replies");te&&(e.features.legacyQuickReplies={local_wa_quick_replies:te},e.featureList.push("legacyQuickReplies"));const ne={};["kanban_profile_pics_cache","kanban_labels_timestamp","kanban_chats_timestamp"].forEach(e=>{const t=localStorage.getItem(e);t&&(ne["local_"+e]=t)}),["kanban_chats","kanban_labels","kanban_tabs"].forEach(e=>{t[e]&&(ne["chrome_"+e]=JSON.stringify(t[e]))}),Object.keys(ne).length>0&&(e.features.kanbanExtended=ne,e.featureList.push("kanbanExtended"));const ae={};["wa_broadcast_history","waBroadcastHistory","wa_last_broadcast"].forEach(e=>{const n=localStorage.getItem(e);n&&(ae["local_"+e]=n),t[e]&&(ae["chrome_"+e]=JSON.stringify(t[e]))}),Object.keys(ae).length>0&&(e.features.broadcastHistory=ae,e.featureList.push("broadcastHistory"));const re={};["wa_crm_status_items","wa_status_items","wa_crm_status_id_map","wa_crm_hidden_status_ids"].forEach(e=>{const n=localStorage.getItem(e);n&&(re["local_"+e]=n),t[e]&&(re["chrome_"+e]=JSON.stringify(t[e]))}),Object.keys(re).length>0&&(e.features.statusData=re,e.featureList.push("statusData"));const oe={},ie=localStorage.getItem("wa_schedules");ie&&(oe.local_wa_schedules=ie),t.wa_schedules&&(oe.chrome_wa_schedules=JSON.stringify(t.wa_schedules)),Object.keys(oe).length>0&&(e.features.scheduledMessages=oe,e.featureList.push("scheduledMessages"));const se={};["wa_signature_settings","wa_signature_enabled","wa_signature_text"].forEach(e=>{const n=localStorage.getItem(e);n&&(se["local_"+e]=n),t[e]&&(se["chrome_"+e]=JSON.stringify(t[e]))}),Object.keys(se).length>0&&(e.features.signatureSettings=se,e.featureList.push("signatureSettings"));const le={};["team_settings","wa_team_settings"].forEach(e=>{const n=localStorage.getItem(e);n&&(le["local_"+e]=n),t[e]&&(le["chrome_"+e]=JSON.stringify(t[e]))}),Object.keys(le).length>0&&(e.features.teamSettings=le,e.featureList.push("teamSettings"));const ce={};["wa_theme_settings","lion_crm_theme_settings"].forEach(e=>{const n=localStorage.getItem(e);n&&(ce["local_"+e]=n),t[e]&&(ce["chrome_"+e]=JSON.stringify(t[e]))}),Object.keys(ce).length>0&&(e.features.themeSettings=ce,e.featureList.push("themeSettings"));const de={};["wa_scheduled_broadcasts","wa_active_broadcast","wa_active_campaign"].forEach(e=>{const n=localStorage.getItem(e);n&&(de["local_"+e]=n),t[e]&&(de["chrome_"+e]=JSON.stringify(t[e]))}),Object.keys(de).length>0&&(e.features.scheduledBroadcasts=de,e.featureList.push("scheduledBroadcasts"));const me={},pe=localStorage.getItem("webhook_settings");pe&&(me.local_webhook_settings=pe),t.webhook_settings&&(me.chrome_webhook_settings=JSON.stringify(t.webhook_settings)),Object.keys(me).length>0&&(e.features.webhookSettings=me,e.featureList.push("webhookSettings"));const ue={};return["wa_reminders","wa_appointments"].forEach(e=>{const n=localStorage.getItem(e);n&&(ue["local_"+e]=n),t[e]&&(ue["chrome_"+e]=JSON.stringify(t[e]))}),Object.keys(ue).length>0&&(e.features.calendarData=ue,e.featureList.push("calendarData")),e}catch(e){return null}}();if(!a||0===Object.keys(a.features||{}).length)return;if(localStorage.setItem("wa_last_auto_backup_date",t),"whatsapp"===n){const e=JSON.stringify(a,null,2);window.postMessage({type:"SEND_AUTO_BACKUP_TO_SELF",backup:e,fileName:`lion_crm_backup_${(new Date).toISOString().split("T")[0]}.json`},"*")}else{const e=JSON.stringify(a,null,2),t=new Blob([e],{type:"application/json"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=`lion_crm_backup_${(new Date).toISOString().split("T")[0]}.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}}catch(e){}}document.addEventListener("licenseStatusChanged",e=>{const t=e;t.detail&&px(t.detail.valid)});const yx=()=>{const e=document.head||document.getElementsByTagName("head")[0];if(!e)return void document.addEventListener("DOMContentLoaded",yx,{once:!0});if(document.getElementById("lion-crm-theme-variables"))return;const t=document.createElement("style");t.id="lion-crm-theme-variables",t.textContent=ma,e.appendChild(t)};(async()=>{yx();const e=()=>{const e=_(),t="dark"===A(e.mode);N(t),"system"===e.mode&&M(e=>{N(e)})};document.body?e():document.addEventListener("DOMContentLoaded",e,{once:!0})})(),(async()=>{try{const e=(await Promise.resolve().then(r.t.bind(r,6815,23))).default,t=await e.storage.local.get("wa_spoken_language");$n=t.wa_spoken_language||"pt"}catch(e){$n="pt"}})(),(async()=>{try{const e=localStorage.getItem(jn);if(e){const t=(await Promise.resolve().then(r.t.bind(r,6815,23))).default,n=JSON.parse(e);await t.storage.local.set({[jn]:n})}}catch(e){}})(),setTimeout(()=>{Tg.syncToBackground()},3e3);let xx=null,wx=!1;const kx=new Set;let Ex=!1,Sx="";function Cx(e,t){if(e===Sx)return!1;try{const t=JSON.parse(e);if(t.ts&&kx.has(t.ts))return!1;if(t.ts&&(kx.add(t.ts),Sx=e,kx.size>100)){Array.from(kx).slice(0,50).forEach(e=>kx.delete(e))}if("waMessageForFluxo"===t.type)return document.dispatchEvent(new CustomEvent("waMessageForFluxo",{detail:t.detail})),!0}catch(e){}return!1}function Tx(){if(Ex)return;let e=document.getElementById("__fluxo_in_bridge__");e||(e=document.createElement("div"),e.id="__fluxo_in_bridge__",e.style.display="none",document.body.appendChild(e)),Ex=!0;const t=()=>{const e=document.getElementById("__fluxo_in_bridge__");if(!e)return;const t=e.getAttribute("data-message");t&&Cx(t)},n=e.getAttribute("data-message");n&&Cx(n),setInterval(t,50),window.addEventListener("message",e=>{if("FLUXO_MESSAGE_BRIDGE"!==e.data?.type)return;const t=e.data.payload;if(!t||"waMessageForFluxo"!==t.type)return;const n=t.ts;if(window.postMessage({type:"FLUXO_MESSAGE_ACK",ts:n,source:"contentScript",timestamp:Date.now()},"*"),!(window.__fluxoProcessorReady||n&&kx.has(n))){if(n&&(kx.add(n),kx.size>100)){Array.from(kx).slice(0,50).forEach(e=>kx.delete(e))}document.dispatchEvent(new CustomEvent("waMessageForFluxo",{detail:t.detail}))}}),e.setAttribute("data-observer-ready",Date.now().toString());const a=e.getAttribute("data-message");a&&Cx(a),t()}let Ax=0;!function e(){Ax++,document.body?Tx():Ax<100&&setTimeout(e,50)}(),document.addEventListener("DOMContentLoaded",()=>{Ex||Tx()}),setInterval(()=>{if(!Ex)return;const e=document.getElementById("__fluxo_in_bridge__");if(!e)return;const t=e.getAttribute("data-message");t&&Cx(t)},300),Zf().then(()=>{}).catch(e=>{});const Dx="fluxo_global_settings",_x={awayMessage:"",awayWaitingTime:5,awayWaitingUnit:"minutes",blockInterval:2,blockIntervalUnit:"seconds"};async function Nx(){try{const e=(await n().storage.local.get(Dx))[Dx]||_x;document.documentElement.setAttribute("data-fluxo-global-settings",JSON.stringify(e))}catch(e){}}Nx(),n().storage.onChanged.addListener((e,t)=>{"local"===t&&e[Dx]&&Nx()});const Mx="wa_chatbot_flows",Ix="wa_kanban_crm_data_sync",Rx="kanban_chats",Bx="wa_extension_tabs";async function Px(){try{const e=await n().storage.local.get([Mx,Dx,Ix,Rx,Bx]),t={flows:e[Mx]||[],globalSettings:e[Dx]||_x,kanbanState:e[Ix]||{crms:[],stages:{},assignments:[]},kanbanChats:e[Rx]||[],tabsState:e[Bx]||{tabs:[],activeTabId:"all"},syncedAt:Date.now()};document.documentElement.setAttribute("data-fluxo-data",JSON.stringify(t))}catch(e){}}Px();const Lx=[Mx,Dx,Ix,Rx,Bx];n().storage.onChanged.addListener((e,t)=>{if("local"===t){const t=Lx.some(t=>t in e);t&&Px()}});const Ux="wa_crm_data_sync";n().storage.onChanged.addListener((e,t)=>{if("local"===t&&e[Ux]){const t=e[Ux].newValue;if(t)try{localStorage.setItem("wa_crm_data",JSON.stringify(t)),document.dispatchEvent(new CustomEvent("wa-crm-data-synced",{detail:t}))}catch(e){}}});const Fx="wa_followup_needs_auto_entry";async function zx(e){try{const t=e.labels||[];if(0===t.length)return;const a=(await n().storage.local.get("wa_kanban_crm_data_sync")).wa_kanban_crm_data_sync||{crms:[],stages:{},assignments:[]},r=t.map(e=>({id:e.id,crmId:"whatsapp_labels",name:e.name,color:e.hexColor||e.color||"#6b7280",whatsappLabelId:e.id}));a.stages=a.stages||{},a.stages.whatsapp_labels=r,a.crms.find(e=>"whatsapp_labels"===e.id)||a.crms.push({id:"whatsapp_labels",name:"WhatsApp Labels",type:"whatsapp_labels"}),await n().storage.local.set({wa_kanban_crm_data_sync:a})}catch(e){}}function Ox(){let e=document.getElementById("__whatsapp_labels_bridge__");e||(e=document.createElement("div"),e.id="__whatsapp_labels_bridge__",e.style.display="none",document.body.appendChild(e));const t=e.getAttribute("data-labels");if(t)try{zx(JSON.parse(t))}catch(e){}new MutationObserver(e=>{for(const t of e)if("attributes"===t.type&&"data-labels"===t.attributeName){const e=t.target.getAttribute("data-labels");if(e)try{zx(JSON.parse(e))}catch(e){}}}).observe(e,{attributes:!0,attributeFilter:["data-labels"]})}async function Wx(){Ox(),window.postMessage({type:"GET_WHATSAPP_LABELS_REQUEST",source:"contentScript"},"*")}async function qx(e){try{const t=e.groups||[];if(0===t.length)return;await n().storage.local.set({wa_groups_cache:t})}catch(e){}}function Hx(){let e=document.getElementById("__whatsapp_groups_bridge__");e||(e=document.createElement("div"),e.id="__whatsapp_groups_bridge__",e.style.display="none",document.body.appendChild(e));const t=e.getAttribute("data-groups");if(t)try{qx(JSON.parse(t))}catch(e){}new MutationObserver(e=>{for(const t of e)if("attributes"===t.type&&"data-groups"===t.attributeName){const e=t.target.getAttribute("data-groups");if(e)try{qx(JSON.parse(e))}catch(e){}}}).observe(e,{attributes:!0,attributeFilter:["data-groups"]})}function jx(){if(!wx){wx=!0;try{const e=document.createElement("script");e.src=n().runtime.getURL("dist/wppconnect-wa.js"),e.onload=function(){const e=n().runtime.getURL("pkg/wasm_license.js"),t=n().runtime.getURL("pkg/wasm_license_bg.wasm"),a=n().runtime.id;document.documentElement.setAttribute("data-wasm-js-url",e),document.documentElement.setAttribute("data-wasm-binary-url",t),document.documentElement.setAttribute("data-extension-id",a);const r=document.createElement("script");r.src=n().runtime.getURL("injectScript.bundle.js"),r.onload=function(){this.remove()},r.onerror=function(){wx=!1},(document.head||document.documentElement).appendChild(r)},e.onerror=function(){wx=!1},(document.head||document.documentElement).appendChild(e)}catch(e){wx=!1}}}function Vx(){try{const e=new(window.AudioContext||window.webkitAudioContext),t=t=>{const n=e.createOscillator(),a=e.createGain();n.connect(a),a.connect(e.destination),n.frequency.value=784,n.type="sine",a.gain.setValueAtTime(.5,t),a.gain.exponentialRampToValueAtTime(.01,t+.3),n.start(t),n.stop(t+.3);const r=e.createOscillator(),o=e.createGain();r.connect(o),o.connect(e.destination),r.frequency.value=1046.5,r.type="sine",o.gain.setValueAtTime(.3,t),o.gain.exponentialRampToValueAtTime(.01,t+.25),r.start(t),r.stop(t+.25)},n=e.currentTime;t(n),t(n+.4),t(n+.8)}catch(e){try{const e=new Audio;e.src="data:audio/wav;base64,UklGRnoGAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQoGAACBhYqFbF1fdH2JkJqVko+IhYSEhIWGiIqMjo+QkI+OjYuJh4WDgYB/f39/gIGDhYeJi42OkJGSkpKRkI+NjIqIhoSCgX9+fX19fn+AgoSGiIqMjY+QkZKSkpKRkI+OjIuJh4WDgYB/fn19fX5/gYOFh4mLjY+QkZKSkpKSkJCOjYuKiIaEgoB/fn19fX5/gYOFh4mLjY6QkZKSkpKSkI+OjYuKiIaEgoB/fn19fX1+f4GDhYeJi42Oj5CRkpKSkpGQj46Mi4mHhYOBgH9+fX19fn+Bg4WHiYuNjo+QkZKSkpKRkI+OjYyKiIaEgoCAf359fX1+f4GDhYeJi42Oj5CRkpKSkpGQj46NjIqIhoSCgIB/fn19fX5/gYOFh4mLjY6PkJGSkpKSkZCPjo2MioiGhIKAgH9+fX19fn+Bg4WHiYuNjo+QkZKSkpKRkI+OjYyKiIaFg4GAgH5+fX1+f4GDhYeJi42Oj5CRkpOTkpKQj46NjIqIhoWDgYCAf359fX5/gYOFh4mLjY6PkJGSk5OSkpCPjo2MioiGhYOBgIB/fn19fn+Bg4WHiYuNjo+QkZKTk5KSkI+OjYyKiIaFg4GAgH9+fX1+f4GDhYeJi42Oj5CRkpKTkpKQj46NjIqIhoWDgYCAf359fX5/gYOFh4mLjY6PkJGSkpKSkpCPjo2MioiGhYOBgH9/fn1+f4CDhYeJi42Oj5CRkpKSkpGQj46NjIqJh4WDgYCAf35+fn5/gIKEhoiKjI6PkJGRkpKRkZCPjoyLiomHhYOCgYB/f39/f4CAgoSGiImLjY6PkJGRkZGRkI+OjYyLiYeGhIOCgYCAf39/f4CAgYOFh4mKjI2Oj5CQkZGRkJCPjo2Mi4mIhoWDgoGAgH9/f39/gIGDhYeIiouNjo+QkJCQkJCPjo2Mi4qIh4WEg4KBgIB/f39/gIGCg4WGiImLjI2Oj4+QkJCPj46NjIuKiYeGhYOCgYGAf39/f4CAgYKEhYeIiouMjY6Oj4+Pj4+OjY2Mi4qJh4aFhIOCgYGAf4B/f4CAgYKDhIaHiImKi4yNjY6Ojo6OjY2MjIuKiYiHhoWEg4KBgYCAf4CAf4CAgYKDhIWGh4iJiouLjIyMjIyMjIuLioqJiIeGhYSEg4KBgYCAf4CAgICAgYGCg4SEhYaGh4iIiYmJiYmJiYmJiIiIh4eGhoWFhISEg4KCgYGBgYCAgICAgYGBgoKCg4ODhISEhISEhISEhISEhISEhIODg4ODg4KCgoKCgYGBgYGBgQ==",e.volume=1,e.play()}catch(e){}}}function Gx(){if(!document.head)return void setTimeout(Gx,100);if(document.getElementById("wa-list-popup-limiter"))return;const e=document.createElement("style");e.id="wa-list-popup-limiter",e.textContent='\n    /* Limit WhatsApp list message popup height to fit screen */\n    div[role="application"] > div > span > div > div > div[role="dialog"] {\n      max-height: 70vh !important;\n      overflow-y: auto !important;\n    }\n\n    /* Alternative selector for list popup */\n    div[data-animate-modal-popup="true"] {\n      max-height: 70vh !important;\n    }\n\n    /* List content scrollable */\n    div[role="dialog"] > div > div {\n      max-height: 60vh !important;\n      overflow-y: auto !important;\n    }\n  ',document.head.appendChild(e)}n().storage.onChanged.addListener(async(e,t)=>{if("local"===t&&e[Fx]){const t=e[Fx].newValue;if(!t||!t.followUpId)return;try{const e=await Um(t.followUpId);if(!e)return;if(!e.isActive)return;const a=await Yv(e.funnelSettings);if(0===a.length)return;let r=0,o=0;for(const t of a){const n=await Vm(t,e.id);if(n&&"active"===n.status){o++;continue}await gy(t,e)&&r++}await n().storage.local.remove(Fx)}catch(e){}}}),document.addEventListener("fluxoStorageAction",async e=>{const t=e.detail;if("tab_action"===t?.type){const{chatId:e,contactName:a,actionType:r,tabIds:o}=t;try{const t=(await n().storage.local.get(Bx))[Bx]||{tabs:[],activeTabId:"all",activeView:"tabs"},i=[];for(const n of o){const o=t.tabs?.find(e=>e.id===n);if(!o)continue;o.chats=o.chats||[];const s=o.chats.findIndex(t=>t.id===e),l=e.includes("@g.us");"add"===r&&-1===s?(o.chats.push({id:e,name:a,type:l?"group":"individual"}),i.push(n)):"remove"===r&&-1!==s&&(o.chats.splice(s,1),i.push(n))}await n().storage.local.set({[Bx]:t}),await Px();const s="add"===r?"add":"remove";for(const t of i)document.dispatchEvent(new CustomEvent("waTabChanged",{detail:{chatId:e,tabId:t,action:s}})),window.postMessage({type:"WA_TAB_CHANGED_FOR_FOLLOWUP",chatId:e,tabId:t,action:s},"*");i.length}catch(e){}}if("crm_action"===t?.type){const{chatId:e,contactName:a,actionType:r,crmId:o,stageId:i}=t;try{const t=(await n().storage.local.get(Ix))[Ix]||{crms:[],stages:{},assignments:[]};let a=null,s=!1;if(t.assignments=t.assignments||[],"add"===r&&i){const n=t.assignments.findIndex(t=>t.chatId===e&&t.crmId===o);if(-1!==n){t.assignments[n].stageId!==i&&(t.assignments[n].stageId=i,s=!0)}else t.assignments.push({chatId:e,stageId:i,crmId:o,assignedAt:Date.now()}),s=!0}else if("remove"===r){const n=t.assignments.find(t=>t.chatId===e&&t.crmId===o);a=n?.stageId||null,a&&(t.assignments=t.assignments.filter(t=>!(t.chatId===e&&t.crmId===o)))}await n().storage.local.set({[Ix]:t}),await Px(),"add"===r&&i&&s?document.dispatchEvent(new CustomEvent("waKanbanChanged",{detail:{chatId:e,stageId:i,crmId:o,action:"add"}})):"remove"===r&&a&&document.dispatchEvent(new CustomEvent("waKanbanChanged",{detail:{chatId:e,stageId:a,crmId:o,action:"remove"}}))}catch(e){}}}),n().runtime.onMessage.addListener((e,t,n)=>{if("TRIGGER_GROUPS_SYNC"===e.type)return document.dispatchEvent(new CustomEvent("triggerWhatsAppGroupsSync",{detail:{timestamp:Date.now()}})),n({success:!0}),!0;if("WA_QUEUE_SEND_MESSAGE"===e.type){const t=new Promise(e=>{const t=n=>{document.removeEventListener("waQueueSendResult",t),e(n.detail)};document.addEventListener("waQueueSendResult",t),setTimeout(()=>{document.removeEventListener("waQueueSendResult",t),e({success:!1,error:"Timeout waiting for WPP response"})},15e3)});return document.dispatchEvent(new CustomEvent("waQueueSendMessage",{detail:{chatId:e.chatId,message:e.message}})),t.then(e=>{n(e)}),!0}return"TRIGGER_LABELS_SYNC"===e.type?(document.dispatchEvent(new CustomEvent("triggerWhatsAppLabelsSync",{detail:{timestamp:Date.now()}})),n({success:!0}),!0):"KANBAN_STAGE_CHANGED_FORWARD"===e.type?(document.dispatchEvent(new CustomEvent("waKanbanChanged",{detail:{chatId:e.chatId,stageId:e.stageId,crmId:e.crmId,action:e.action}})),n({success:!0}),!0):void 0}),document.addEventListener("waExtensionPhoneDetected",e=>{const t=e.detail?.phoneNumber;t&&(xx=t,n().storage.local.set({phoneNumber:t}).catch(e=>{}),n().runtime.sendMessage({action:"phoneDetected",phoneNumber:t}).catch(e=>{}))}),document.addEventListener("waExtensionUserProfile",e=>{const{phoneNumber:t,profilePicture:a,pushName:r}=e.detail||{};if(a||r){const e={};a&&(e.profilePicture=a),r&&(e.contactName=r),n().storage.local.set(e).catch(e=>{})}}),n().runtime.onMessage.addListener((e,t,a)=>{if("getPhoneNumber"===e.action)return async function(){if(xx)return xx;const e=document.documentElement.getAttribute("data-wa-phone");if(e)return xx=e,e;await new Promise(e=>setTimeout(e,3e3));const t=document.documentElement.getAttribute("data-wa-phone");return t?(xx=t,t):xx}().then(e=>{a({phoneNumber:e})}).catch(e=>{a({phoneNumber:null,error:e.message})}),!0;if("syncLocalStorageForBackup"===e.action)return(async()=>{try{const e=[],t=["wa_kanban_crm_data","wa_crm_data","wa_crm_data_sync","wa_crm_status_items","wa_crm_status_id_map","wa_crm_hidden_status_ids","wa_status_items","wa_crm_currency","wa_crm_appointment_templates","wa_crm_custom_income_categories","wa_crm_custom_expense_categories","wa_crm_custom_payment_methods","wa_crm_custom_transaction_statuses","wa_crm_hidden_income_categories","wa_crm_hidden_expense_categories","wa_crm_hidden_payment_methods","wa_crm_hidden_transaction_statuses","wa_chatbot_flows","chatbot_flows","wa_chatbot_flow_categories","fluxo_global_settings","wa_fluxo_conversation_states","wa_fluxo_first_message_tracker","wa_fluxo_onboarding_completed","fluxo_conversation_states","fluxo_trigger_history","fluxo_pause_states","fluxo_flow_trigger_history","fluxo_first_message_tracking","wa_tabs","wa_extension_tabs","wa_custom_tabs","wa_kanban_crm_data_sync","kanban_chats","kanban_tabs","kanban_labels","kanban_labels_timestamp","kanban_chats_timestamp","kanban_profile_pics_cache","wa_kanban_crm_list","wa_templates","wa_template_categories","wa_template_media","wa_quick_replies","wa_quick_replies_v2","wa_templates_last_sync","encrypted_templates","encrypted_quick_replies","wa_followups","wa_followup_categories","wa_followup_contacts","wa_followup_queue","wa_followup_needs_auto_entry","wa_followup_sequences","wa_reminders","wa_appointments","wa_schedules","wa_active_broadcast","wa_broadcast_history","wa_scheduled_broadcasts","wa_active_campaign","wa_bulk_validator_campaigns","waBroadcastHistory","wa_last_broadcast","wa_agent_settings","wa_agent_active_services","wa_agent_service_chat_ids","wa_ai_settings","wa_ai_bot_settings","wa_ai_bot_queue","wa_ai_bot_test_chat_history","wa_spoken_language","wa_signature_settings","team_settings","wa_team_settings","webhook_settings","lion_crm_theme_settings","lion_crm_theme_sync","wa_theme_settings","wa_feature_visibility","wa_blur_settings","wa_tabbar_hidden","wa_header_collapsed","wa_language","wa_ui_language","api_polling_settings","bulk_validator_campaigns","wa_crm_todos_sync","wa_crm_todos","wa_auto_backup_enabled","wa_auto_backup_destination","wa_last_auto_backup_date","wa_groups_cache","last_storage_sync","wa_session_data"];for(const a of t){const t=localStorage.getItem(a);if(t)try{const r=JSON.parse(t);await n().storage.local.set({[a]:r}),e.push(a)}catch(r){await n().storage.local.set({[a]:t}),e.push(a)}}const r=["kanban","crm","tabs","template","fluxo","chatbot","flow","followup","schedule","broadcast","agent","webhook","signature","team","theme","lion","blur","ai_","wa_","api_","bulk_","todo","currency","categories","payment","transaction","hidden_","cache","timestamp","language","auto_backup","quick_repl","service_chat","encrypted","reminder","appointment","session","feature","labels","status","campaign","sync","storage"];for(let a=0;a<localStorage.length;a++){const o=localStorage.key(a);if(o&&!t.includes(o)&&!e.includes(o)&&r.some(e=>o.toLowerCase().includes(e))){const t=localStorage.getItem(o);if(t)try{const a=JSON.parse(t);await n().storage.local.set({[o]:a}),e.push(o)}catch(a){await n().storage.local.set({[o]:t}),e.push(o)}}}a({success:!0,syncedKeys:e})}catch(e){a({success:!1,error:e.message})}})(),!0;if("APPLY_WHATSAPP_LABEL"===e.type){window.postMessage({type:"APPLY_WHATSAPP_LABEL",chatId:e.chatId,labelId:e.labelId},"*");const t=n=>{n.source===window&&"APPLY_WHATSAPP_LABEL_RESPONSE"===n.data?.type&&n.data.chatId===e.chatId&&n.data.labelId===e.labelId&&(window.removeEventListener("message",t),a({success:n.data.success,error:n.data.error}))};return window.addEventListener("message",t),setTimeout(()=>{window.removeEventListener("message",t),a({success:!1,error:"Timeout waiting for label application"})},5e3),!0}if("executeBroadcast"===e.action)return document.dispatchEvent(new CustomEvent("executeScheduledBroadcast",{detail:e.broadcast})),a({success:!0}),!0;if("CRM_REMINDER_DUE"===e.type)return Vx(),function(e,t,a,r,o=0){try{const i=document.getElementById("crm-reminder-toast");i&&i.remove();const s=60===o?"1 hour":`${o} min`,l=document.createElement("div");l.id="crm-reminder-toast",l.innerHTML=`\n      <div class="crm-reminder-popup" style="\n        position: fixed;\n        top: 20px;\n        right: 20px;\n        background: #1a1a1a;\n        color: white;\n        padding: 0;\n        border-radius: 16px;\n        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n        z-index: 999999;\n        width: 380px;\n        animation: slideIn 0.3s ease;\n        font-family: system-ui, -apple-system, sans-serif;\n        overflow: hidden;\n      ">\n        \x3c!-- Header --\x3e\n        <div style="\n          background: var(--lion-primary);\n          padding: 16px 20px;\n          display: flex;\n          align-items: center;\n          gap: 12px;\n        ">\n          <div style="\n            width: 44px;\n            height: 44px;\n            background: rgba(255,255,255,0.2);\n            border-radius: 50%;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            flex-shrink: 0;\n          ">\n            <svg viewBox="0 0 24 24" width="26" height="26" fill="white">\n              <path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/>\n            </svg>\n          </div>\n          <div style="flex: 1;">\n            <div style="font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; margin-bottom: 2px;">Reminder</div>\n            <div style="font-weight: 600; font-size: 16px;">${e}</div>\n          </div>\n          <button id="crm-reminder-close" style="\n            background: rgba(255,255,255,0.15);\n            border: none;\n            color: white;\n            cursor: pointer;\n            padding: 8px;\n            border-radius: 8px;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n          ">\n            <svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">\n              <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/>\n            </svg>\n          </button>\n        </div>\n\n        \x3c!-- Body --\x3e\n        <div style="padding: 20px;">\n          <div style="\n            font-size: 15px;\n            color: #e5e5e5;\n            line-height: 1.5;\n            margin-bottom: 20px;\n          ">${t}</div>\n\n          \x3c!-- Action Buttons --\x3e\n          <div style="display: flex; gap: 12px;">\n            ${o>0?`\n            <button id="crm-reminder-snooze" style="\n              flex: 1;\n              background: #262626;\n              border: 1px solid #404040;\n              color: white;\n              padding: 12px 16px;\n              border-radius: 10px;\n              cursor: pointer;\n              font-size: 14px;\n              font-weight: 500;\n              display: flex;\n              align-items: center;\n              justify-content: center;\n              gap: 8px;\n              transition: all 0.2s;\n            ">\n              <svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">\n                <path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/>\n              </svg>\n              Snooze (${s})\n            </button>\n            `:""}\n            <button id="crm-reminder-stop" style="\n              flex: 1;\n              background: #dc2626;\n              border: none;\n              color: white;\n              padding: 12px 16px;\n              border-radius: 10px;\n              cursor: pointer;\n              font-size: 14px;\n              font-weight: 500;\n              display: flex;\n              align-items: center;\n              justify-content: center;\n              gap: 8px;\n              transition: all 0.2s;\n            ">\n              <svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">\n                <path d="M6 6h12v12H6z"/>\n              </svg>\n              Stop\n            </button>\n          </div>\n        </div>\n      </div>\n      <style>\n        @keyframes slideIn {\n          from { transform: translateX(100%); opacity: 0; }\n          to { transform: translateX(0); opacity: 1; }\n        }\n        ${o>0?"\n        #crm-reminder-snooze:hover {\n          background: #333333 !important;\n          border-color: #505050 !important;\n        }\n        ":""}\n        #crm-reminder-stop:hover {\n          background: #b91c1c !important;\n        }\n        #crm-reminder-close:hover {\n          background: rgba(255,255,255,0.25) !important;\n        }\n      </style>\n    `,document.body.appendChild(l);const c=document.getElementById("crm-reminder-close"),d=document.getElementById("crm-reminder-snooze"),m=document.getElementById("crm-reminder-stop"),p=()=>{const e=document.getElementById("crm-reminder-toast");e&&(e.style.transition="opacity 0.3s, transform 0.3s",e.style.opacity="0",e.style.transform="translateX(100%)",setTimeout(()=>e.remove(),300))};c?.addEventListener("click",p),d?.addEventListener("click",()=>{if(a&&r){v.snoozeReminder(a,r);n().runtime.sendMessage({type:"CRM_REMINDER_SNOOZE",contactId:a,reminderId:r})}p()}),m?.addEventListener("click",()=>{if(a&&r){v.stopReminder(a,r);n().runtime.sendMessage({type:"CRM_REMINDER_STOP",contactId:a,reminderId:r})}p()}),setTimeout(()=>{p()},3e4)}catch(e){}}(e.contactName,e.reminder?.topic,e.contactId,e.reminder?.id,e.reminder?.repeatInterval??0),a({success:!0}),!0;if("CRM_REMINDER_SNOOZE"===e.type)return a({success:!0}),!0;if("CRM_REMINDER_STOP"===e.type)return a({success:!0}),!0;if("CRM_APPOINTMENT_NOTIFICATION"===e.type){const{appointment:t,contactName:n,notificationType:r}=e,o="reminder"===r;return Vx(),function(e,t,n,a,r,o){try{const i=document.getElementById("crm-appointment-toast");i&&i.remove();const s=r?`Starts in ${o} minute${1!==o?"s":""} • ${n} attendee${1!==n?"s":""}`:`Starting now! • ${n} attendee${1!==n?"s":""}`,l=document.createElement("div");l.id="crm-appointment-toast",l.innerHTML=`\n      <div class="crm-appointment-popup" style="\n        position: fixed;\n        top: 20px;\n        right: 20px;\n        background: #1a1a1a;\n        color: white;\n        padding: 0;\n        border-radius: 16px;\n        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n        z-index: 999999;\n        width: 400px;\n        animation: appointmentSlideIn 0.3s ease;\n        font-family: system-ui, -apple-system, sans-serif;\n        overflow: hidden;\n      ">\n        \x3c!-- Header --\x3e\n        <div style="\n          background: ${r?"linear-gradient(135deg, #3b82f6 0%, #6D28D9 100%)":`${ca.primary}`};\n          padding: 16px 20px;\n          display: flex;\n          align-items: center;\n          gap: 12px;\n        ">\n          <div style="\n            width: 44px;\n            height: 44px;\n            background: rgba(255,255,255,0.2);\n            border-radius: 50%;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            flex-shrink: 0;\n          ">\n            <svg viewBox="0 0 24 24" width="26" height="26" fill="white">\n              <path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM9 10H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2z"/>\n            </svg>\n          </div>\n          <div style="flex: 1;">\n            <div style="font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; margin-bottom: 2px;">${r?"Meeting Reminder":"Meeting Starting"}</div>\n            <div style="font-weight: 600; font-size: 16px;">${e}</div>\n          </div>\n          <button id="crm-appointment-close" style="\n            background: rgba(255,255,255,0.15);\n            border: none;\n            color: white;\n            cursor: pointer;\n            padding: 8px;\n            border-radius: 8px;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n          ">\n            <svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">\n              <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/>\n            </svg>\n          </button>\n        </div>\n\n        \x3c!-- Body --\x3e\n        <div style="padding: 20px;">\n          <div style="\n            font-size: 14px;\n            color: #a0a0a0;\n            margin-bottom: 8px;\n          ">${s}</div>\n          <div style="\n            font-size: 15px;\n            color: #e5e5e5;\n            line-height: 1.5;\n            margin-bottom: 16px;\n          ">Contact: <strong>${t}</strong></div>\n\n          \x3c!-- Action Buttons --\x3e\n          <div style="display: flex; gap: 12px;">\n            ${a?`\n            <button id="crm-appointment-join" style="\n              flex: 1;\n              background: ${r?"#3b82f6":ca.primary};\n              border: none;\n              color: white;\n              padding: 12px 16px;\n              border-radius: 10px;\n              cursor: pointer;\n              font-size: 14px;\n              font-weight: 500;\n              display: flex;\n              align-items: center;\n              justify-content: center;\n              gap: 8px;\n              transition: all 0.2s;\n            ">\n              <svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">\n                <path d="M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z"/>\n              </svg>\n              Join Meeting\n            </button>\n            `:""}\n            <button id="crm-appointment-dismiss" style="\n              flex: 1;\n              background: #262626;\n              border: 1px solid #404040;\n              color: white;\n              padding: 12px 16px;\n              border-radius: 10px;\n              cursor: pointer;\n              font-size: 14px;\n              font-weight: 500;\n              display: flex;\n              align-items: center;\n              justify-content: center;\n              gap: 8px;\n              transition: all 0.2s;\n            ">\n              Dismiss\n            </button>\n          </div>\n        </div>\n      </div>\n      <style>\n        @keyframes appointmentSlideIn {\n          from { transform: translateX(100%); opacity: 0; }\n          to { transform: translateX(0); opacity: 1; }\n        }\n        #crm-appointment-join:hover {\n          filter: brightness(1.1) !important;\n        }\n        #crm-appointment-dismiss:hover {\n          background: #333333 !important;\n          border-color: #505050 !important;\n        }\n        #crm-appointment-close:hover {\n          background: rgba(255,255,255,0.25) !important;\n        }\n      </style>\n    `,document.body.appendChild(l);const c=document.getElementById("crm-appointment-close"),d=document.getElementById("crm-appointment-join"),m=document.getElementById("crm-appointment-dismiss"),p=()=>{const e=document.getElementById("crm-appointment-toast");e&&(e.style.transition="opacity 0.3s, transform 0.3s",e.style.opacity="0",e.style.transform="translateX(100%)",setTimeout(()=>e.remove(),300))};c?.addEventListener("click",p),m?.addEventListener("click",p),d?.addEventListener("click",()=>{a&&window.open(a,"_blank"),p()}),setTimeout(()=>{p()},45e3)}catch(e){}}(t?.title||"Meeting",n,t?.attendees?.length||0,t?.meetLink,o,t?.reminderBefore),a({success:!0}),!0}if("CRM_SEND_APPOINTMENT_MESSAGES"===e.type)return window.postMessage({type:"SEND_APPOINTMENT_MESSAGES",appointmentId:e.appointmentId,contactId:e.contactId,messages:e.messages},"*"),a({success:!0}),!0;if("TODO_SELF_MESSAGE"===e.type)return window.postMessage({type:"TODO_SEND_SELF_MESSAGE",message:e.message,todoId:e.todoId},"*"),a({success:!0}),!0;if("SHOW_TODO_TOAST"===e.type)return Vx(),function(e,t){try{const a=document.getElementById("crm-todo-toast");a&&a.remove();const r=e.snoozeMinutes||15,o=(e=>e>=1440?`${e/1440}${(0,s.t)("todo.day")||"d"}`:e>=60?`${e/60}${(0,s.t)("todo.hour")||"h"}`:`${e}${(0,s.t)("todo.minutes")||"m"}`)(r),i="high"===e.priority?"🔴":"medium"===e.priority?"🟡":"🟢",l="high"===e.priority?(0,s.t)("todo.highPriority")||"High Priority":"medium"===e.priority?(0,s.t)("todo.mediumPriority")||"Medium Priority":(0,s.t)("todo.lowPriority")||"Low Priority",c=t?t.name:"";let d="";if(e.subtasks&&e.subtasks.length>0){d=`${e.subtasks.filter(e=>e.completed).length}/${e.subtasks.length} ${(0,s.t)("todo.subtasksCount")||"subtasks"}`}const m=(0,s.t)("todo.taskReminder")||"Task Reminder",p=(0,s.t)("todo.snooze")||"Snooze",u=(0,s.t)("todo.markDone")||"Mark Done",g=(0,s.t)("todo.task")||"Task",h=document.createElement("div");h.id="crm-todo-toast",h.innerHTML=`\n      <div class="crm-todo-popup" style="\n        position: fixed;\n        top: 20px;\n        right: 20px;\n        background: #1a1a1a;\n        color: white;\n        padding: 0;\n        border-radius: 16px;\n        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n        z-index: 999999;\n        width: 380px;\n        animation: todoSlideIn 0.3s ease;\n        font-family: system-ui, -apple-system, sans-serif;\n        overflow: hidden;\n      ">\n        \x3c!-- Header --\x3e\n        <div style="\n          background: ${ca.primary};\n          padding: 16px 20px;\n          display: flex;\n          align-items: center;\n          gap: 12px;\n        ">\n          <div style="\n            width: 44px;\n            height: 44px;\n            background: rgba(255,255,255,0.2);\n            border-radius: 50%;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            flex-shrink: 0;\n          ">\n            <svg viewBox="0 0 24 24" width="26" height="26" fill="white">\n              <path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/>\n            </svg>\n          </div>\n          <div style="flex: 1;">\n            <div style="font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; margin-bottom: 2px;">${m}</div>\n            <div style="font-weight: 600; font-size: 16px;">${e.title||g}</div>\n          </div>\n          <button id="crm-todo-close" style="\n            background: rgba(255,255,255,0.15);\n            border: none;\n            color: white;\n            cursor: pointer;\n            padding: 8px;\n            border-radius: 8px;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n          ">\n            <svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">\n              <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/>\n            </svg>\n          </button>\n        </div>\n\n        \x3c!-- Body --\x3e\n        <div style="padding: 20px;">\n          ${e.description?`\n          <div style="\n            font-size: 14px;\n            color: #a0a0a0;\n            line-height: 1.5;\n            margin-bottom: 16px;\n          ">${e.description}</div>\n          `:""}\n\n          \x3c!-- Tags Row --\x3e\n          <div style="display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;">\n            <span style="\n              display: inline-flex;\n              align-items: center;\n              gap: 4px;\n              background: #262626;\n              padding: 6px 12px;\n              border-radius: 20px;\n              font-size: 12px;\n              color: #e5e5e5;\n            ">${i} ${l}</span>\n            ${c?`\n            <span style="\n              display: inline-flex;\n              align-items: center;\n              gap: 4px;\n              background: #262626;\n              padding: 6px 12px;\n              border-radius: 20px;\n              font-size: 12px;\n              color: #e5e5e5;\n            ">📁 ${c}</span>\n            `:""}\n            ${d?`\n            <span style="\n              display: inline-flex;\n              align-items: center;\n              gap: 4px;\n              background: #262626;\n              padding: 6px 12px;\n              border-radius: 20px;\n              font-size: 12px;\n              color: #e5e5e5;\n            ">✅ ${d}</span>\n            `:""}\n          </div>\n\n          \x3c!-- Action Buttons --\x3e\n          <div style="display: flex; gap: 12px;">\n            <button id="crm-todo-snooze" style="\n              flex: 1;\n              background: #262626;\n              border: 1px solid #404040;\n              color: white;\n              padding: 12px 16px;\n              border-radius: 10px;\n              cursor: pointer;\n              font-size: 14px;\n              font-weight: 500;\n              display: flex;\n              align-items: center;\n              justify-content: center;\n              gap: 8px;\n              transition: all 0.2s;\n            ">\n              <svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">\n                <path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"/>\n              </svg>\n              ${p} ${o}\n            </button>\n            <button id="crm-todo-done" style="\n              flex: 1;\n              background: ${ca.success};\n              border: none;\n              color: white;\n              padding: 12px 16px;\n              border-radius: 10px;\n              cursor: pointer;\n              font-size: 14px;\n              font-weight: 500;\n              display: flex;\n              align-items: center;\n              justify-content: center;\n              gap: 8px;\n              transition: all 0.2s;\n            ">\n              <svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">\n                <path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/>\n              </svg>\n              ${u}\n            </button>\n            <button id="crm-todo-dismiss" style="\n              background: #404040;\n              border: none;\n              color: white;\n              padding: 12px 14px;\n              border-radius: 10px;\n              cursor: pointer;\n              font-size: 14px;\n              display: flex;\n              align-items: center;\n              justify-content: center;\n              transition: all 0.2s;\n            ">\n              <svg viewBox="0 0 24 24" width="18" height="18" fill="currentColor">\n                <path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/>\n              </svg>\n            </button>\n          </div>\n        </div>\n      </div>\n      <style>\n        @keyframes todoSlideIn {\n          from { transform: translateX(100%); opacity: 0; }\n          to { transform: translateX(0); opacity: 1; }\n        }\n        #crm-todo-snooze:hover {\n          background: #333333 !important;\n          border-color: #505050 !important;\n        }\n        #crm-todo-done:hover {\n          background: #16a34a !important;\n        }\n        #crm-todo-dismiss:hover {\n          background: #525252 !important;\n        }\n        #crm-todo-close:hover {\n          background: rgba(255,255,255,0.25) !important;\n        }\n      </style>\n    `,document.body.appendChild(h);const b=document.getElementById("crm-todo-close"),f=document.getElementById("crm-todo-snooze"),v=document.getElementById("crm-todo-done"),y=document.getElementById("crm-todo-dismiss"),x=()=>{const e=document.getElementById("crm-todo-toast");e&&(e.style.transition="opacity 0.3s, transform 0.3s",e.style.opacity="0",e.style.transform="translateX(100%)",setTimeout(()=>e.remove(),300))};b?.addEventListener("click",x),y?.addEventListener("click",x),f?.addEventListener("click",()=>{e.id&&n().runtime.sendMessage({type:"TODO_SNOOZE",todoId:e.id,snoozeMinutes:r}),x()}),v?.addEventListener("click",()=>{e.id&&n().runtime.sendMessage({type:"TODO_MARK_DONE",todoId:e.id}),x()}),setTimeout(()=>{x()},3e4)}catch(e){}}(e.todo,e.category),a({success:!0}),!0;if("TODO_UPDATE_LOCAL"===e.type){const{todoId:t,updates:n}=e,r=v.updateTodo(t,n);return a({success:r}),!0}if("API_SEND_MESSAGE"===e.type){const t=`api_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;window.postMessage({type:"API_SEND_MESSAGE",action:e.action,payload:e.payload,queueId:e.queueId,messageId:t},"*");const n=e=>{e.source===window&&"API_SEND_MESSAGE_RESPONSE"===e.data?.type&&e.data.messageId===t&&(window.removeEventListener("message",n),a({success:e.data.success,error:e.data.error,messageId:e.data.result?.messageId}))};return window.addEventListener("message",n),setTimeout(()=>{window.removeEventListener("message",n),a({success:!1,error:"Timeout waiting for message to be sent"})},3e4),!0}}),(0,s.LE)().then(()=>{}).catch(e=>{}),window.addEventListener("message",async e=>{if(e.source!==window)return;const{type:t,requestId:a,key:o,data:i,action:s}=e.data||{};if(t&&(t.includes("QUICK_REPLY")||t.includes("POST_ACTION")),"WA_STORAGE_GET"===t)try{const e=await n().storage.local.get(o);window.postMessage({type:"WA_STORAGE_GET_RESPONSE",requestId:a,success:!0,data:e[o]},"*")}catch(e){window.postMessage({type:"WA_STORAGE_GET_RESPONSE",requestId:a,success:!1,error:e.message},"*")}if("POST_WHATSAPP_STATUS_RESPONSE"===t){const{statusId:t,success:n,error:a}=e.data?.payload||{};if(t)try{const e="wa_crm_status_items",r=localStorage.getItem(e);if(r){const o=JSON.parse(r),i=o.findIndex(e=>e.id===t);-1!==i&&(o[i]=n?{...o[i],status:"posted",lastPostedAt:Date.now(),scheduledAt:void 0}:{...o[i],status:"failed",lastError:a||"Unknown error"},localStorage.setItem(e,JSON.stringify(o)),window.dispatchEvent(new CustomEvent("statusItemsUpdated")))}}catch(e){}}if("GET_FLUXO_MEDIA_REQUEST"===t){const{nodeId:t,flowId:a,requestId:r}=e.data||{};try{const e=await n().runtime.sendMessage({type:"GET_FLUXO_MEDIA",nodeId:t,flowId:a});document.dispatchEvent(new CustomEvent("fluxoMediaResponse",{detail:{requestId:r,success:e?.success,mediaData:e?.mediaData,error:e?.error}}))}catch(e){document.dispatchEvent(new CustomEvent("fluxoMediaResponse",{detail:{requestId:r,success:!1,error:e.message}}))}}if("SEND_WEBHOOK"===t){const{url:t,payload:a,eventType:r}=e.data||{};try{n().runtime.sendMessage({type:"SEND_WEBHOOK",url:t,payload:a,eventType:r}).then(e=>{}).catch(e=>{})}catch(e){}}if("QUICK_REPLY_POST_ACTION"===t){const{action:t,contact:a,chatId:o,contactName:i,groupIds:s,tabIds:l,labelIds:c,kanbanAction:d}=e.data||{};try{let e=o||a;switch(e.includes("@")||(e=`${e}@c.us`),t){case"addToGroups":document.dispatchEvent(new CustomEvent("addContactToGroups",{detail:{contact:e,groupIds:s}}));break;case"removeFromGroups":document.dispatchEvent(new CustomEvent("removeContactFromGroups",{detail:{contact:e,groupIds:s}}));break;case"addToTabs":Promise.resolve().then(r.bind(r,6839)).then(async({TabsStorage:t})=>{await t.initialize();for(const n of l)try{const r=t.getTab(n);if(r){const o=r.chats||[];if(!o.some(t=>"string"==typeof t?t===e:t.id===e)){const r={id:e,name:i||a,type:"individual"},s=[...o,r];t.updateTab(n,{chats:s})}document.dispatchEvent(new CustomEvent("waTabChanged",{detail:{chatId:e,tabId:n,action:"add"}}))}}catch(e){}});break;case"removeFromTabs":Promise.resolve().then(r.bind(r,6839)).then(async({TabsStorage:t})=>{await t.initialize();for(const n of l)try{const a=t.getTab(n);if(a){const r=a.chats||[];if(r.some(t=>"string"==typeof t?t===e:t.id===e)){const a=r.filter(t=>"string"==typeof t?t!==e:t.id!==e);t.updateTab(n,{chats:a}),document.dispatchEvent(new CustomEvent("waTabChanged",{detail:{chatId:e,tabId:n,action:"remove"}}))}}}catch(e){}});break;case"addLabels":for(const t of c)window.postMessage({type:"LABEL_BUTTON_ADD_LABEL",chatId:e,labelId:t},"*");break;case"removeLabels":for(const t of c)window.postMessage({type:"LABEL_BUTTON_REMOVE_LABEL",chatId:e,labelId:t},"*");break;case"addToKanban":if(d&&d.crmId&&d.stageId){const t="wa_kanban_crm_data_sync";n().storage.local.get(t).then(r=>{const o=r[t]||{};Array.isArray(o.crms)||(o.crms=[]),o.stages&&"object"==typeof o.stages||(o.stages={}),Array.isArray(o.assignments)||(o.assignments=[]),o.chatsCache&&"object"==typeof o.chatsCache||(o.chatsCache={}),void 0===o.activeCrmId&&(o.activeCrmId=null);const s=o.chatsCache[e]||{};o.chatsCache[e]={...s,id:e,name:i||a,phoneNumber:a||e.split("@")[0],lastMessage:s.lastMessage||"",lastMessageTime:s.lastMessageTime||Date.now(),unreadCount:s.unreadCount||0,whatsappLabels:s.whatsappLabels||[],type:"individual",isGroup:!1};const l=o.assignments.findIndex(t=>t.chatId===e&&t.crmId===d.crmId);if(-1!==l){const e=o.assignments[l];o.assignments[l]={...e,stageId:d.stageId,assignedAt:Date.now(),history:[...e.history||[],{fromStageId:e.stageId,toStageId:d.stageId,movedAt:Date.now()}]}}else o.assignments.push({id:`assignment-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,chatId:e,stageId:d.stageId,crmId:d.crmId,assignedAt:Date.now(),history:[{fromStageId:null,toStageId:d.stageId,movedAt:Date.now()}]});o.lastSync=Date.now(),n().storage.local.set({[t]:o}).then(()=>{document.dispatchEvent(new CustomEvent("wa-kanban-data-updated",{detail:{chatId:e,crmId:d.crmId,stageId:d.stageId,action:"add"}}))}).catch(e=>{})}).catch(e=>{})}break;case"removeFromKanban":if(d&&d.crmId&&d.stageId){const t="wa_kanban_crm_data_sync";n().storage.local.get(t).then(a=>{const r=a[t]||{};Array.isArray(r.assignments)||(r.assignments=[]),r.chatsCache&&"object"==typeof r.chatsCache||(r.chatsCache={});const o=r.assignments.length;r.assignments=r.assignments.filter(t=>!(t.chatId===e&&t.crmId===d.crmId));r.assignments.length;r.lastSync=Date.now(),n().storage.local.set({[t]:r}).then(()=>{document.dispatchEvent(new CustomEvent("wa-kanban-data-updated",{detail:{chatId:e,crmId:d.crmId,stageId:d.stageId,action:"remove"}}))})})}}}catch(e){}}if("AI_TRANSLATE_REQUEST"===t){const{text:t,targetLang:a,provider:r,apiKey:o,requestId:i}=e.data||{};try{n().runtime.sendMessage({type:"AI_TRANSLATE",text:t,targetLang:a,provider:r,apiKey:o}).then(e=>{window.postMessage({type:"AI_TRANSLATE_RESPONSE",requestId:i,...e},"*")}).catch(e=>{window.postMessage({type:"AI_TRANSLATE_RESPONSE",requestId:i,success:!1,error:e.message||"Translation failed"},"*")})}catch(e){window.postMessage({type:"AI_TRANSLATE_RESPONSE",requestId:i,success:!1,error:e.message||"Failed to forward translation"},"*")}}if("AUDIO_TRANSCRIBE_REQUEST"===t){const{audioUrl:t,apiKey:a,requestId:r}=e.data||{};try{n().runtime.sendMessage({type:"AUDIO_TRANSCRIBE",audioUrl:t,apiKey:a}).then(e=>{window.postMessage({type:"AUDIO_TRANSCRIBE_RESPONSE",requestId:r,...e},"*")}).catch(e=>{window.postMessage({type:"AUDIO_TRANSCRIBE_RESPONSE",requestId:r,success:!1,error:e.message||"Transcription failed"},"*")})}catch(e){window.postMessage({type:"AUDIO_TRANSCRIBE_RESPONSE",requestId:r,success:!1,error:e.message||"Failed to forward transcription"},"*")}}if("WA_STORAGE_SET"===t)try{await n().storage.local.set({[o]:i}),window.postMessage({type:"WA_STORAGE_SET_RESPONSE",requestId:a,success:!0},"*")}catch(e){window.postMessage({type:"WA_STORAGE_SET_RESPONSE",requestId:a,success:!1,error:e.message},"*")}if("WA_BROADCAST_STATUS_UPDATE"===t)try{const{broadcastId:e,status:t,progress:r,historyEntry:o}=i;let s=(await n().storage.local.get("wa_scheduled_broadcasts")).wa_scheduled_broadcasts||[];if(s=s.map(n=>n.id===e?{...n,status:t,progress:r}:n),await n().storage.local.set({wa_scheduled_broadcasts:s}),o){const e=(await n().storage.local.get("wa_broadcast_history")).wa_broadcast_history||[];e.unshift(o),e.length>100&&e.splice(100),await n().storage.local.set({wa_broadcast_history:e})}const l=s.find(t=>t.id===e);if(l?.isRecurring||l?.recurringParentId){const e=l.recurringParentId||l.id,t=s.find(t=>t.id===e||t.recurringParentId===e);if(t||l.isRecurring){const e=t||l,a=r?.sent||0,o=r?.failed||0;e.executionHistory=e.executionHistory||[],e.executionHistory.unshift({runAt:Date.now(),sent:a,failed:o,total:a+o,status:0===o?"completed":a>0?"partial":"failed"}),e.executionHistory.length>10&&(e.executionHistory=e.executionHistory.slice(0,10)),e.lastRunAt=Date.now(),e.totalRuns=(e.totalRuns||0)+1;const i=e.executionHistory.filter(e=>"completed"===e.status).length;e.successRate=Math.round(i/e.executionHistory.length*100);const c=s.findIndex(t=>t.id===e.id);c>=0&&(s[c]=e,await n().storage.local.set({wa_scheduled_broadcasts:s}))}}if("completed"===t&&l?.isRecurring)try{const e=l.originalScheduledTime||l.createdAt,t=function(e,t,n,a){const r=new Date(e),o=a?new Date(a):null;switch(t){case"daily":r.setDate(r.getDate()+1);break;case"weekly":if(n&&n.length>0){const e=r.getDay();let t=-1,a=7;const o=[...n].sort((e,t)=>e-t);for(const n of o)if(n>e){t=n,a=n-e;break}-1===t&&(t=o[0],a=7-e+t),r.setDate(r.getDate()+a)}else r.setDate(r.getDate()+7);break;case"monthly":r.setMonth(r.getMonth()+1);break;case"yearly":r.setFullYear(r.getFullYear()+1)}return o&&(r.setHours(o.getHours()),r.setMinutes(o.getMinutes()),r.setSeconds(o.getSeconds()),r.setMilliseconds(0)),r.getTime()}(l.scheduledTime||Date.now(),l.recurringInterval,l.recurringDays,e);if(!l.recurringEndDate||t<=l.recurringEndDate){const a={...l,scheduledTime:t,nextOccurrence:t,originalScheduledTime:l.originalScheduledTime||e,status:"scheduled",progress:{sent:0,failed:0,total:l.progress?.total||0},results:[]},r=(await n().storage.local.get("wa_scheduled_broadcasts")).wa_scheduled_broadcasts||[],o=r.findIndex(e=>e.id===l.id);o>=0?r[o]=a:r.push(a),await n().storage.local.set({wa_scheduled_broadcasts:r}),document.dispatchEvent(new CustomEvent("scheduleNewBroadcast",{detail:{broadcast:a,scheduledTime:t}}));try{await n().runtime.sendMessage({action:"scheduleNewBroadcast",broadcastId:a.id,scheduledTime:t})}catch(e){}}else{const e=await n().storage.local.get("wa_scheduled_broadcasts"),t=(e.wa_scheduled_broadcasts||[]).filter(e=>e.id!==l.id);await n().storage.local.set({wa_scheduled_broadcasts:t})}}catch(e){}window.postMessage({type:"WA_BROADCAST_STATUS_UPDATE_RESPONSE",requestId:a,success:!0},"*")}catch(e){window.postMessage({type:"WA_BROADCAST_STATUS_UPDATE_RESPONSE",requestId:a,success:!1,error:e.message},"*")}if("WA_SAVE_ACTIVE_CAMPAIGN"===t)try{const e=i.campaignState;await n().storage.local.set({wa_active_campaign:e}),window.postMessage({type:"WA_SAVE_ACTIVE_CAMPAIGN_RESPONSE",requestId:a,success:!0},"*")}catch(e){window.postMessage({type:"WA_SAVE_ACTIVE_CAMPAIGN_RESPONSE",requestId:a,success:!1,error:e.message},"*")}if("WA_UPDATE_CAMPAIGN_PROGRESS"===t)try{const{currentIndex:e,sent:t,failed:r,queueItems:o,results:s}=i,l=(await n().storage.local.get("wa_active_campaign")).wa_active_campaign;l&&(l.currentIndex=e,l.sent=t,l.failed=r,l.queueItems=o,l.results=s,l.lastUpdatedAt=Date.now(),await n().storage.local.set({wa_active_campaign:l})),window.postMessage({type:"WA_UPDATE_CAMPAIGN_PROGRESS_RESPONSE",requestId:a,success:!0},"*")}catch(e){window.postMessage({type:"WA_UPDATE_CAMPAIGN_PROGRESS_RESPONSE",requestId:a,success:!1,error:e.message},"*")}if("WA_CLEAR_ACTIVE_CAMPAIGN"===t)try{await n().storage.local.remove("wa_active_campaign"),window.postMessage({type:"WA_CLEAR_ACTIVE_CAMPAIGN_RESPONSE",requestId:a,success:!0},"*")}catch(e){window.postMessage({type:"WA_CLEAR_ACTIVE_CAMPAIGN_RESPONSE",requestId:a,success:!1,error:e.message},"*")}}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Gx):Gx(),document.addEventListener("kanbanUpdateRequest",async e=>{const t=e.detail,a="wa_kanban_crm_data_sync";try{const e=(await n().storage.local.get(a))[a]||{crms:[],stages:{},assignments:[],activeCrmId:null,chatsCache:{},lastSync:Date.now()};if("add"===t.action){e.chatsCache[t.chatId]={id:t.chatId,name:t.contactName,phoneNumber:t.chatId.replace("@c.us",""),lastMessage:"",lastMessageTime:Date.now(),unreadCount:0,whatsappLabels:[],type:"individual",isGroup:!1};const n=e.assignments.findIndex(e=>e.chatId===t.chatId&&e.crmId===t.crmId);if(-1!==n){const a=e.assignments[n];e.assignments[n]={...a,stageId:t.stageId,assignedAt:Date.now(),history:[...a.history||[],{fromStageId:a.stageId,toStageId:t.stageId,movedAt:Date.now()}]}}else{const n={id:`assignment-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,chatId:t.chatId,stageId:t.stageId,crmId:t.crmId,assignedAt:Date.now(),history:[{fromStageId:null,toStageId:t.stageId,movedAt:Date.now()}]};e.assignments.push(n)}}else if("remove"===t.action){e.assignments.length;e.assignments=e.assignments.filter(e=>!(e.chatId===t.chatId&&e.crmId===t.crmId)),e.assignments.length}e.lastSync=Date.now(),await n().storage.local.set({[a]:e})}catch(e){}}),document.addEventListener("tabsUpdateRequest",async e=>{const t=e.detail,a="wa_extension_tabs",r="kanban_tabs";try{let e=(await n().storage.local.get(a))[a];if(!e||!e.tabs)return;const o=e.tabs.findIndex(e=>e.id===t.tabId);if(-1===o)return;const i=e.tabs[o],s=i.chats||[];if("add"===t.action){if(!s.some(e=>"string"==typeof e?e===t.chatId:e.id===t.chatId)){const l={id:t.chatId,name:t.contactName||t.chatId.replace("@c.us",""),type:"individual"};i.chats=[...s,l],i.updatedAt=Date.now(),e.tabs[o]=i,await n().storage.local.set({[a]:e});const c=e.tabs.filter(e=>!e.isPermanent);await n().storage.local.set({[r]:c}),setTimeout(()=>{document.dispatchEvent(new CustomEvent("wa-tab-data-updated",{detail:{tabId:t.tabId,action:"add",chatId:t.chatId}}))},100)}}else if("remove"===t.action){const l=s.filter(e=>"string"==typeof e?e!==t.chatId:e.id!==t.chatId);if(l.length<s.length){i.chats=l,i.updatedAt=Date.now(),e.tabs[o]=i,await n().storage.local.set({[a]:e});const s=e.tabs.filter(e=>!e.isPermanent);await n().storage.local.set({[r]:s}),setTimeout(()=>{document.dispatchEvent(new CustomEvent("wa-tab-data-updated",{detail:{tabId:t.tabId,action:"remove",chatId:t.chatId}}))},100)}}}catch(e){}}),document.addEventListener("wa-tab-data-updated",async e=>{const{tabId:t,action:n,chatId:a,source:o}=e.detail||{};if("storage-change"!==o)try{const{ChatFilter:e}=await Promise.resolve().then(r.bind(r,5180)),{TabsStorage:n}=await Promise.resolve().then(r.bind(r,6839)),a=e.getInstance(),o=n.getActiveTabId(),i=a.getActiveTabId?.()||a.activeTabId;o&&o===t&&(i!==o&&a.setActiveTabId(o),a.refreshFilter())}catch(e){}});try{qv()}catch(e){}document.addEventListener("waFollowUpReplyTracking",async e=>{const{contactId:t,message:n}=e.detail||{};if(t&&n)try{await hy(t,n)}catch(e){}}),document.addEventListener("waLabelChanged",async e=>{const{chatId:t,labelId:n,action:a}=e.detail||{};if(t&&n)try{const e=await Fm();for(const r of e)"labels"===r.funnelSettings.type&&r.funnelSettings.selectedIds.includes(n)&&("add"===a&&"on_enter"===r.trigger.type||"remove"===a&&"on_leave"===r.trigger.type||"add"===a&&"after_time"===r.trigger.type)&&await gy(t,r)}catch(e){}}),document.addEventListener("debugFollowUpData",async()=>{try{(await Fm()).forEach((e,t)=>{})}catch(e){}}),document.addEventListener("waTabChanged",async e=>{const{chatId:t,tabId:n,action:a}=e.detail||{};if(t&&n)try{const e=await Fm();for(const r of e)"tabs"===r.funnelSettings.type&&r.funnelSettings.selectedIds.includes(n)&&("add"===a&&"on_enter"===r.trigger.type||"remove"===a&&"on_leave"===r.trigger.type||"add"===a&&"after_time"===r.trigger.type)&&await gy(t,r)}catch(e){}}),document.addEventListener("waKanbanChanged",async e=>{const{chatId:t,stageId:n,crmId:a,action:r}=e.detail||{};if(t&&n)try{const e=await Fm();for(const o of e)"kanban"===o.funnelSettings.type&&(o.funnelSettings.crmId&&o.funnelSettings.crmId!==a||o.funnelSettings.selectedIds.includes(n)&&("add"===r&&"on_enter"===o.trigger.type||"remove"===r&&"on_leave"===o.trigger.type||"add"===r&&"after_time"===o.trigger.type)&&await gy(t,o))}catch(e){}}),document.addEventListener("waGroupChanged",async e=>{const{contactId:t,groupId:n,action:a}=e.detail||{};if(t&&n&&a)try{const e=await Fm();for(const r of e){if("groups"!==r.funnelSettings.type)continue;if(!r.funnelSettings.selectedIds.includes(n))continue;("added"===a&&"on_enter"===r.trigger.type||"removed"===a&&"on_leave"===r.trigger.type||"added"===a&&"after_time"===r.trigger.type)&&await gy(t,r)}}catch(e){}}),document.addEventListener("lionSaveForAntiRevoke",e=>{try{const t=e.detail;if(!t)return;if(!lh.getSettings().enabled)return;lh.saveMessage(t)}catch(e){}}),document.addEventListener("lionMessageRevoked",e=>{try{const t=e.detail;if(!t)return;const{originalMsgId:n,chatId:a,revokeType:r,revokedAt:o}=t;lh.markAsRevoked(a,n,o,r)&&window.dispatchEvent(new CustomEvent("lionAntiRevokeUpdated",{detail:{chatId:a,originalMsgId:n}}))}catch(e){}});try{lh.cleanup()}catch{}async function Kx(){await async function(){try{return await xu(),await wu(["basic","advanced","premium"])}catch(e){}return!1}()&&(0,cg.H)(),setTimeout(async()=>{try{await kg.startAutoSync()}catch(e){}},3e3),document.addEventListener("waMessageForWebhook",async e=>{const t=e.detail;try{const e=localStorage.getItem("webhook_settings");if(!e)return;const n=JSON.parse(e).messages;if(!n||!n.active||!n.url)return;const a=[{id:"event_details",label:"Event Details",enabled:!0},{id:"direction",label:"Direction",enabled:!0},{id:"number",label:"Number",enabled:!0},{id:"name",label:"Name",enabled:!0},{id:"message_content",label:"Conteúdo da Mensagem",enabled:!0},{id:"message_type",label:"Tipo de Mensagem",enabled:!0},{id:"message_id",label:"ID da Mensagem",enabled:!1},{id:"media_url",label:"URL da Mídia",enabled:!1},{id:"quoted_message",label:"Mensagem Respondida",enabled:!1},{id:"timestamp",label:"Timestamp",enabled:!0},{id:"ctwa_data",label:"Meta Ads Data (CTWA)",enabled:!0},{id:"contact_profile",label:"Contact Profile",enabled:!1}],r={},o=n.dataFields&&n.dataFields.length>0?n.dataFields:a;r.message={content:t.messageContent,type:t.messageType,direction:t.direction,timestamp:t.timestamp},o.forEach(e=>{if(e.enabled)switch(e.id){case"event_details":r.event={type:"messages",action:t.direction,timestamp:Date.now()};break;case"direction":r.direction=t.direction;break;case"number":r.number=t.contactNumber;break;case"name":r.name=t.contactName;break;case"message_content":r.messageContent=t.messageContent;break;case"message_type":r.messageType=t.messageType;break;case"message_id":r.messageId=t.messageId;break;case"media_url":r.mediaUrl=t.mediaUrl;break;case"quoted_message":r.quotedMessage=t.quotedMessage;break;case"timestamp":r.timestamp=t.timestamp;break;case"contact_profile":try{const e=localStorage.getItem("wa_crm_data");if(e){const n=JSON.parse(e),a=n.contacts?.[t.chatId];a&&a.profile?r.contactProfile={fullName:a.profile.name||t.contactName,phone:a.profile.phone||t.contactNumber,email:a.profile.email||null,gender:a.profile.gender||null,dateOfBirth:a.profile.dateOfBirth||null,details:a.profile.details||null,address:a.profile.address||null,language:a.profile.language||null,customFields:a.profile.customFields||[]}:r.contactProfile={fullName:t.contactName,phone:t.contactNumber}}}catch(e){r.contactProfile={fullName:t.contactName,phone:t.contactNumber}}break;case"ctwa_data":t.ctwaContext&&(r.ctwa={greetingMessage:t.ctwaContext.greetingMessageBody||null,sourceUrl:t.ctwaContext.sourceUrl||null,sourceApp:t.ctwaContext.sourceApp||null,sourceId:t.ctwaContext.sourceId||null,conversionData:t.ctwaContext.conversionData||null,mediaType:t.ctwaContext.mediaType||null,mediaUrl:t.ctwaContext.mediaUrl||null,isFromAd:!0})}}),chrome.runtime.sendMessage({type:"SEND_WEBHOOK",url:n.url,payload:r,eventType:"messages"})}catch(e){}}),document.addEventListener("waMessageForAIBot",async e=>{const t=e.detail;try{if(!Sr.shouldProcessMessage(t.chatId,t.timestamp||Math.floor(Date.now()/1e3)))return;if(v.isAIBotBlacklisted(t.chatId))return;const e=Sr.getSettings();if(e.stopKeywords?.enabled&&e.stopKeywords.keywords?.length>0){const n=t.messageContent.toLowerCase();if(e.stopKeywords.keywords.find(e=>n.includes(e.toLowerCase())))return e.stopKeywords.stopMessage&&window.postMessage({type:"AI_BOT_SEND_REPLY",chatId:t.chatId,message:e.stopKeywords.stopMessage},"*"),void v.setAIBotBlacklisted(t.chatId,!0)}of.addMessage(t.chatId,t.contactName,t.messageContent,t.messageType,t.timestamp)}catch(e){}});try{(()=>{document.addEventListener("aiBotQueueUpdated",()=>{}),document.addEventListener("aiBotSettingsChanged",e=>{e.detail.enabled?Af.start():Af.stop()});const e=e=>!(!Sr.isEnabled()||Af.isRunning||(Af.start(),0));e()||(setTimeout(()=>e(),2e3),setTimeout(()=>e(),5e3),setTimeout(()=>e(),1e4))})()}catch(e){}setTimeout(async()=>{try{localStorage.removeItem("encrypted_quick_replies"),await fg.init()}catch(e){}},3e3)}async function $x(){await fx&&bx()&&(!async function(){try{const{TabsStorage:e}=await Promise.resolve().then(r.bind(r,6839));await e.initialize()}catch(e){}}(),setTimeout(jx,500),setTimeout(Ox,1500),setTimeout(Hx,2500),setTimeout(lg,3500),setTimeout(Wx,6500),setTimeout(Kx,5500),setTimeout(Uh,6500),setTimeout(ob,7500),setTimeout(kb,8500),setTimeout(Fb,9500),setTimeout(Yb,10500),setTimeout(af,11500),setTimeout(Ef,12e3),setTimeout(()=>Pv.init(),12500),setTimeout(vx,18500))}document.addEventListener("executeKanbanActionRelay",async e=>{const t=e,{contactId:a,stageId:r,crmId:o,action:i}=t.detail||{};try{const e=(await n().storage.local.get("wa_kanban_crm_data_sync")).wa_kanban_crm_data_sync;if(!e)return;const t=e.crms||[];if(!t.some(e=>e.id===o))return;const s=e.stages?.[o]||[];if(!s.some(e=>e.id===r))return;if(e.assignments||(e.assignments=[]),"add"===i){const t=e.assignments.findIndex(e=>e.chatId===a&&e.crmId===o);if(-1!==t){const n=e.assignments[t],a=n.stageId;e.assignments[t]={...n,stageId:r,assignedAt:Date.now(),history:[...n.history||[],{fromStageId:a,toStageId:r,movedAt:Date.now()}]}}else{const t={id:`assignment-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,chatId:a,stageId:r,crmId:o,assignedAt:Date.now(),history:[{fromStageId:null,toStageId:r,movedAt:Date.now()}]};e.assignments.push(t)}}else{e.assignments.length;e.assignments=e.assignments.filter(e=>!(e.chatId===a&&e.crmId===o)),e.assignments.length}e.lastSync=Date.now(),await n().storage.local.set({wa_kanban_crm_data_sync:e})}catch(e){}}),document.addEventListener("scheduleTabAction",async e=>{const t=e,{contactId:a,addToTabs:r,removeFromTabs:o}=t.detail||{};try{const e="wa_extension_tabs",t=(await n().storage.local.get(e))[e]||{tabs:[],activeTabId:"all",activeView:"tabs"},i=[],s=[];if(r&&r.length>0)for(const e of r){const n=t.tabs?.find(t=>t.id===e);if(!n)continue;n.chats=n.chats||[];const r=n.chats.findIndex(e=>(e.id||e)===a),o=a.includes("@g.us");-1===r&&(n.chats.push({id:a,type:o?"group":"individual"}),i.push(e))}if(o&&o.length>0)for(const e of o){const n=t.tabs?.find(t=>t.id===e);if(!n||!n.chats)continue;const r=n.chats.findIndex(e=>(e.id||e)===a);-1!==r&&(n.chats.splice(r,1),s.push(e))}await n().storage.local.set({[e]:t});const l=t.tabs.filter(e=>!e.isPermanent);await n().storage.local.set({kanban_tabs:l});for(const e of i)document.dispatchEvent(new CustomEvent("waTabChanged",{detail:{chatId:a,tabId:e,action:"add"}})),window.postMessage({type:"WA_TAB_CHANGED_FOR_FOLLOWUP",chatId:a,tabId:e,action:"add"},"*");for(const e of s)document.dispatchEvent(new CustomEvent("waTabChanged",{detail:{chatId:a,tabId:e,action:"remove"}}));i.length||s.length}catch(e){}}),document.addEventListener("scheduleKanbanAction",async e=>{const t=e,{contactId:a,contactName:r,addToKanban:o,removeFromKanban:i}=t.detail||{};try{const e="wa_kanban_crm_data_sync",t=(await n().storage.local.get(e))[e]||{crms:[],stages:{},assignments:[]};t.assignments=t.assignments||[];const s=o?.crmId&&i?.crmId&&o.crmId===i.crmId;let l=null,c=null,d=null,m=null,p=!1;if(i&&i.crmId&&!s){const e=t.assignments.findIndex(e=>e.chatId===a&&e.crmId===i.crmId);-1!==e&&(l=t.assignments[e].stageId,m=i.crmId,t.assignments.splice(e,1))}if(o&&o.crmId&&o.stageId){const e=t.assignments.findIndex(e=>e.chatId===a&&e.crmId===o.crmId);if(-1!==e){t.assignments[e].stageId!==o.stageId&&(t.assignments[e].stageId=o.stageId,t.assignments[e].assignedAt=Date.now(),p=!0,c=o.stageId,d=o.crmId)}else t.assignments.push({chatId:a,contactName:r||a.split("@")[0],crmId:o.crmId,stageId:o.stageId,assignedAt:Date.now()}),p=!0,c=o.stageId,d=o.crmId}await n().storage.local.set({[e]:t}),c&&d&&p&&document.dispatchEvent(new CustomEvent("waKanbanChanged",{detail:{chatId:a,stageId:c,crmId:d,action:"add"}})),l&&m&&document.dispatchEvent(new CustomEvent("waKanbanChanged",{detail:{chatId:a,stageId:l,crmId:m,action:"remove"}}))}catch(e){}}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{$x()}):$x(),n().runtime.onMessage.addListener((e,t,a)=>{if("licenseUpdated"!==e.action){if("PIN_CHAT"===e.type)return window.postMessage({type:"PIN_CHAT",chatId:e.chatId},"*"),a({success:!0}),!0;if("UNPIN_CHAT"===e.type)return window.postMessage({type:"UNPIN_CHAT",chatId:e.chatId},"*"),a({success:!0}),!0;if("LABEL_SERVICE_ADD"===e.type){const t=new Promise(t=>{const n=setTimeout(()=>{window.removeEventListener("message",a),t({success:!1,error:"Timeout waiting for label add response"})},1e4),a=r=>{"LABEL_SERVICE_RESPONSE"===r.data?.type&&"add"===r.data?.action&&r.data?.chatId===e.chatId&&r.data?.labelId===e.labelId&&(clearTimeout(n),window.removeEventListener("message",a),t({success:!1!==r.data.success}))};window.addEventListener("message",a)});return window.postMessage({type:"LABEL_SERVICE_ADD",chatId:e.chatId,labelId:e.labelId},"*"),t.then(e=>a(e)),!0}if("LABEL_SERVICE_REMOVE"===e.type){const t=new Promise(t=>{const n=setTimeout(()=>{window.removeEventListener("message",a),t({success:!1,error:"Timeout waiting for label remove response"})},1e4),a=r=>{"LABEL_SERVICE_RESPONSE"===r.data?.type&&"remove"===r.data?.action&&r.data?.chatId===e.chatId&&r.data?.labelId===e.labelId&&(clearTimeout(n),window.removeEventListener("message",a),t({success:!1!==r.data.success}))};window.addEventListener("message",a)});return window.postMessage({type:"LABEL_SERVICE_REMOVE",chatId:e.chatId,labelId:e.labelId},"*"),t.then(e=>a(e)),!0}if("SEND_BROADCAST_MESSAGE"===e.type)return(async()=>{try{const t=(await n().storage.local.get("wa_active_campaign")).wa_active_campaign;if(t&&!0===t.isPaused)return void a({success:!1,error:"Campaign paused",paused:!0});const r=`broadcast_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,o=new Promise(t=>{const n=setTimeout(()=>{window.removeEventListener("message",a),t({success:!1,error:"Timeout waiting for WPP response"})},9e4),a=r=>{r.source===window&&"WA_BROADCAST_MESSAGE_RESPONSE"===r.data?.type&&r.data?.contact===e.contact&&(clearTimeout(n),window.removeEventListener("message",a),t(r.data))};window.addEventListener("message",a)});window.postMessage({type:"WA_SEND_BROADCAST_MESSAGE",contact:e.contact,contactData:e.contactData||{phone:e.contact,name:e.contactName},message:e.message,enableLinkPreview:e.enableLinkPreview||!1,appendSignature:e.appendSignature||!1,signature:e.signature||"",requestId:r},"*");const i=await o;i.success,a(i)}catch(e){a({success:!1,error:e.message})}})(),!0;if("PERFORM_BROADCAST_ACTIONS"===e.type)return(async()=>{try{const t=new Promise(t=>{const n=setTimeout(()=>{document.removeEventListener("performBroadcastActionsResponse",a),t({success:!0})},3e4),a=r=>{const o=r;o.detail?.contact===e.contact&&(clearTimeout(n),document.removeEventListener("performBroadcastActionsResponse",a),t(o.detail))};document.addEventListener("performBroadcastActionsResponse",a)});document.dispatchEvent(new CustomEvent("performBroadcastActions",{detail:{contact:e.contact,contactName:e.contactName,contactData:e.contactData,groupActions:e.groupActions,addToGroupsEnabled:e.addToGroupsEnabled,removeFromGroupsEnabled:e.removeFromGroupsEnabled,groupsForAddAction:e.groupsForAddAction,groupsForRemoveAction:e.groupsForRemoveAction,customTabActions:e.customTabActions,addToTabsEnabled:e.addToTabsEnabled,removeFromTabsEnabled:e.removeFromTabsEnabled,tabsForAddAction:e.tabsForAddAction,tabsForRemoveAction:e.tabsForRemoveAction,labelsActions:e.labelsActions,addToLabelsEnabled:e.addToLabelsEnabled,removeFromLabelsEnabled:e.removeFromLabelsEnabled,labelsForAddAction:e.labelsForAddAction,labelsForRemoveAction:e.labelsForRemoveAction,kanbanBoardActions:e.kanbanBoardActions,addToKanbanEnabled:e.addToKanbanEnabled,removeFromKanbanEnabled:e.removeFromKanbanEnabled,kanbanForAddAction:e.kanbanForAddAction,kanbanForRemoveAction:e.kanbanForRemoveAction}}));const n=await t;a(n)}catch(e){a({success:!1,error:e.message})}})(),!0;if("ADD_CHAT_TO_TAB"===e.type)return(async()=>{try{const{TabsStorage:t}=await Promise.resolve().then(r.bind(r,6839)),n=t.getTab(e.tabId);if(!n)return void a({success:!1,error:"Tab not found"});const o=n.chats||[];if(o.some(t=>t.id===e.chat.id))return void a({success:!0,message:"Chat already in tab"});const i=[...o,e.chat];t.updateTab(e.tabId,{chats:i}),a({success:!0})}catch(e){a({success:!1,error:String(e)})}})(),!0;if("REMOVE_CHAT_FROM_TAB"===e.type)return(async()=>{try{const{TabsStorage:t}=await Promise.resolve().then(r.bind(r,6839)),n=t.getTab(e.tabId);if(!n)return void a({success:!1,error:"Tab not found"});const o=(n.chats||[]).filter(t=>t.id!==e.chatId);t.updateTab(e.tabId,{chats:o}),a({success:!0})}catch(e){a({success:!1,error:String(e)})}})(),!0;if("CREATE_TAB_FROM_STAGE"===e.type)return(async()=>{try{const{TabsStorage:t}=await Promise.resolve().then(r.bind(r,6839)),n=t.addTab({title:e.tabName,details:"Created from Kanban",chats:[],isPermanent:!1});a({success:!0,tabId:n.id})}catch(e){a({success:!1,error:String(e)})}})(),!0;if("FIND_OR_CREATE_TAB"===e.type)return(async()=>{try{const{TabsStorage:t}=await Promise.resolve().then(r.bind(r,6839)),n=t.getState().tabs.find(t=>t.title===e.tabName&&!t.isPermanent);if(n)return void a({success:!0,tabId:n.id});const o=t.addTab({title:e.tabName,details:"Created from Kanban",chats:[],isPermanent:!1});a({success:!0,tabId:o.id})}catch(e){a({success:!1,error:String(e)})}})(),!0;if("UPDATE_TAB_NAME"===e.type)return(async()=>{try{const{TabsStorage:t}=await Promise.resolve().then(r.bind(r,6839));t.updateTab(e.tabId,{title:e.newName}),a({success:!0})}catch(e){a({success:!1,error:String(e)})}})(),!0;if("DELETE_TAB_FROM_STAGE"===e.type)return(async()=>{try{const{TabsStorage:t}=await Promise.resolve().then(r.bind(r,6839)),n=t.deleteTab(e.tabId);a(n?{success:!0}:{success:!1,error:"Cannot delete permanent tab"})}catch(e){a({success:!1,error:String(e)})}})(),!0;if("CHECK_SCHEDULED_STATUSES"!==e.type){if("EXECUTE_SCHEDULED_MESSAGE"===e.type)return(async()=>{try{const t=e.schedule;if("fluxo"===t.templateType)window.postMessage({type:"START_FLUXO_FOR_CHAT",payload:{chatId:t.targetId,flowId:t.fluxoFlowId,isScheduled:!0}},"*");else{let e=t.attachments||[];e.length>0&&(e=await Promise.all(e.map(async e=>{if(e.file&&!e.file.startsWith("data:")&&!e.base64Url)try{const t=await Lv.mediaDB.getMedia(e.file);if(t&&t.data)return{...e,base64Url:t.data,file:t.data}}catch(e){}return e}))),window.postMessage({type:"SEND_SCHEDULED_MESSAGE",payload:{chatId:t.targetId,targetName:t.targetName,targetType:t.targetType,message:t.message,templateType:t.templateType,attachments:e,pollData:t.pollData,listData:t.listData,selectedContacts:t.selectedContacts,selectedProducts:t.selectedProducts,postActions:t.postActions,archiveChat:t.archiveChat,blockChat:t.blockChat,webhookEnabled:t.webhookEnabled,webhookUrl:t.webhookUrl}},"*")}a({success:!0})}catch(e){a({success:!1,error:String(e)})}})(),!0;if("KANBAN_OPEN_CHAT"===e.type)return window.postMessage({type:"KANBAN_OPEN_CHAT",chatId:e.chatId},"*"),void a({success:!0});if("KANBAN_GET_MESSAGES"===e.type){const t=`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,n=e=>{e.detail?.requestId===t&&(document.removeEventListener("kanbanMessagesResult",n),e.detail.success?a({success:!0,messages:e.detail.messages}):a({success:!1,error:e.detail.error}))};return document.addEventListener("kanbanMessagesResult",n),window.postMessage({type:"KANBAN_GET_MESSAGES",chatId:e.chatId,limit:e.limit||50,requestId:t},"*"),setTimeout(()=>{document.removeEventListener("kanbanMessagesResult",n)},3e4),!0}if("KANBAN_SEND_MESSAGE"===e.type){const t=`send_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,n=e=>{e.detail?.requestId===t&&(document.removeEventListener("kanbanSendResult",n),e.detail.success?a({success:!0}):a({success:!1,error:e.detail.error}))};return document.addEventListener("kanbanSendResult",n),window.postMessage({type:"KANBAN_SEND_MESSAGE",chatId:e.chatId,text:e.text,requestId:t},"*"),setTimeout(()=>{document.removeEventListener("kanbanSendResult",n)},3e4),!0}if("KANBAN_SEND_MEDIA"===e.type){const t=`media_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,n=e=>{e.detail?.requestId===t&&(document.removeEventListener("kanbanSendResult",n),e.detail.success?a({success:!0}):a({success:!1,error:e.detail.error}))};return document.addEventListener("kanbanSendResult",n),window.postMessage({type:"KANBAN_SEND_MEDIA",chatId:e.chatId,base64Data:e.base64Data,filename:e.filename,mimetype:e.mimetype,caption:e.caption,requestId:t},"*"),setTimeout(()=>{document.removeEventListener("kanbanSendResult",n)},6e4),!0}if("KANBAN_GET_MEDIA"===e.type){const t=`getmedia_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,n=e=>{e.detail?.requestId===t&&(document.removeEventListener("kanbanMediaResult",n),e.detail.success?a({success:!0,data:e.detail.data}):a({success:!1,error:e.detail.error}))};return document.addEventListener("kanbanMediaResult",n),window.postMessage({type:"KANBAN_GET_MEDIA",messageId:e.messageId,requestId:t},"*"),setTimeout(()=>{document.removeEventListener("kanbanMediaResult",n)},6e4),!0}if("KANBAN_REMOVE_LABEL"===e.type){const t=`removelabel_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,n=t=>{t.detail?.chatId===e.chatId&&t.detail?.labelId===e.labelId&&(document.removeEventListener("kanbanRemoveLabelResult",n),a({success:t.detail.success,error:t.detail.error}))};return document.addEventListener("kanbanRemoveLabelResult",n),window.postMessage({type:"KANBAN_REMOVE_LABEL",chatId:e.chatId,labelId:e.labelId,requestId:t},"*"),setTimeout(()=>{document.removeEventListener("kanbanRemoveLabelResult",n)},3e4),!0}if("KANBAN_ADD_LABEL"===e.type){const t=`addlabel_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,n=t=>{t.detail?.chatId===e.chatId&&t.detail?.labelId===e.labelId&&(document.removeEventListener("kanbanAddLabelResult",n),a({success:t.detail.success,error:t.detail.error}))};return document.addEventListener("kanbanAddLabelResult",n),window.postMessage({type:"KANBAN_ADD_LABEL",chatId:e.chatId,labelId:e.labelId,requestId:t},"*"),setTimeout(()=>{document.removeEventListener("kanbanAddLabelResult",n)},3e4),!0}if("KANBAN_SEND_QUICK_REPLY"===e.type){const t=`quickreply_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,n=e=>{e.detail?.requestId===t&&(document.removeEventListener("kanbanQuickReplyResult",n),a({success:e.detail.success,error:e.detail.error}))};return document.addEventListener("kanbanQuickReplyResult",n),window.postMessage({type:"KANBAN_SEND_QUICK_REPLY",chatId:e.chatId,templateId:e.templateId,templateData:e.templateData,requestId:t},"*"),setTimeout(()=>{document.removeEventListener("kanbanQuickReplyResult",n)},6e4),!0}if("KANBAN_TRIGGER_FLUXO"===e.type){const t=`kanban_fluxo_${Date.now()}_${Math.random().toString(36).substr(2,9)}`;return window.postMessage({type:"fluxoManualTriggerInject",flowId:e.flowId,chatId:e.chatId,requestId:t},"*"),void a({success:!0})}if("KANBAN_SEND_QUICK_REPLY_V2"===e.type)return(async()=>{try{const{chatId:t,template:n,messages:o}=e;if(!t||!o||0===o.length)return void a({success:!1,error:"Missing chatId or messages"});for(let e=0;e<o.length;e++){const n=o[e],a=`kanban_qr_${Date.now()}_${e}`,i={sendAttachment:n.attachmentType&&"none"!==n.attachmentType,sendAttachmentType:n.attachmentType||"none",attachemnt:n.attachments||[]};if(i.sendAttachment&&i.attachemnt&&i.attachemnt.length>0){const{mediaDB:e}=await Promise.resolve().then(r.bind(r,1132));for(let t=0;t<i.attachemnt.length;t++){const n=i.attachemnt[t];if(n.file&&(!n.base64Url||!n.base64Url.startsWith("data:")))try{const a=await e.getMedia(n.file);a&&a.data&&(i.attachemnt[t].base64Url=a.data)}catch(e){}}}const s=new Promise((e,t)=>{const n=setTimeout(()=>{window.removeEventListener("message",r),t(new Error("Send message timeout"))},3e4),r=o=>{"sendMessageResponse"===o.data?.type&&o.data.messageId===a&&(clearTimeout(n),window.removeEventListener("message",r),o.data.success?e(!0):t(new Error(o.data.error||"Failed to send message")))};window.addEventListener("message",r)});if(window.postMessage({type:"sendQuickReply",messageId:a,chatId:t,message:n.message||"",templateData:i},"*"),await s,e<o.length-1){const e=n.delay||{min:3,max:5},t=1e3*(Math.random()*(e.max-e.min)+e.min);await new Promise(e=>setTimeout(e,t))}}a({success:!0})}catch(e){a({success:!1,error:e.message})}})(),!0;if("KANBAN_OPEN_CRM"===e.type){const t=new CustomEvent("openCRMFromKanban",{detail:{chatId:e.chatId,chatName:e.chatName,chatPhone:e.chatPhone}});return document.dispatchEvent(t),void a({success:!0})}return"GET_FLUXO_MEDIA_REQUEST"===e.type?((async()=>{try{const{nodeId:t,flowId:r,requestId:o}=e,i=await n().runtime.sendMessage({type:"GET_FLUXO_MEDIA",nodeId:t,flowId:r});document.dispatchEvent(new CustomEvent("fluxoMediaResponse",{detail:{requestId:o,success:i?.success,mediaData:i?.mediaData,error:i?.error}})),a({success:!0})}catch(e){a({success:!1,error:e.message})}})(),!0):"GET_PROFILE_PICS_FOR_KANBAN"===e.type?((async()=>{try{const t=e.chatIds||[],n=Date.now().toString(),r=new Promise(e=>{const t=setTimeout(()=>{window.removeEventListener("message",a),e({})},6e4),a=r=>{"KANBAN_PROFILE_PICS_RESPONSE"===r.data?.type&&r.data.requestId===n&&(clearTimeout(t),window.removeEventListener("message",a),e(r.data.profilePics||{}))};window.addEventListener("message",a)});window.postMessage({type:"KANBAN_GET_PROFILE_PICS",source:"content-script",chatIds:t,requestId:n},"*");const o=await r;a({profilePics:o})}catch(e){a({error:e.message,profilePics:{}})}})(),!0):void 0}(async()=>{try{const e="wa_crm_status_items",t=localStorage.getItem(e);if(!t)return;const n=JSON.parse(t),a=Date.now();let r=!1;for(let e=0;e<n.length;e++){const t=n[e];if("scheduled"===t.status&&t.scheduledAt&&t.scheduledAt<=a&&(window.postMessage({type:"POST_WHATSAPP_STATUS",payload:{statusId:t.id,type:t.type,content:t.content,caption:t.caption,backgroundColor:t.backgroundColor}},"*"),n[e]={...t,status:"pending",scheduledAt:void 0},r=!0),t.autoRepost&&"posted"===t.status&&t.lastPostedAt){(a-t.lastPostedAt)/36e5>=24&&(window.postMessage({type:"POST_WHATSAPP_STATUS",payload:{statusId:t.id,type:t.type,content:t.content,caption:t.caption,backgroundColor:t.backgroundColor}},"*"),n[e]={...t,lastPostedAt:a},r=!0)}}r&&localStorage.setItem(e,JSON.stringify(n))}catch(e){}})()}else setTimeout(Kx,2e3)})})()})();