1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/home-CKVN_tXo.js","assets/dark-landing-page-DJPWE675.js","assets/proxy-Du-Re_ck.js","assets/shield-check-CeaMk_Of.js","assets/cog-D55vt1jZ.js","assets/brain-Cx3sZGHM.js","assets/circle-play-X1HYOc79.js","assets/circle-check-CycdxmpM.js","assets/auth-BHLXvF8b.js","assets/form-Dill8tQN.js","assets/label-B8pEaVSp.js","assets/types-CZPMdQiE.js","assets/schema-CHK6N8Qh.js","assets/tabs-CB-sMyyk.js","assets/index-DPGBKyX9.js","assets/admin-login-Da3iMUB2.js","assets/index-BlfsC8No.js","assets/dashboard-CYWeCi0k.js","assets/stat-card-D6RLI4nl.js","assets/navigation-D92oE7YS.js","assets/circle-help-B0lOEjtj.js","assets/explore-Cn3r_Tnw.js","assets/page-section-B3iaHowQ.js","assets/network-HjOBTNlg.js","assets/workflow-BR-AYK22.js","assets/file-code-D6DSGJK2.js","assets/platform-DrCCIpXb.js","assets/resources-CjU-bcjz.js","assets/page-header-B7c-lkoF.js","assets/contact-DiBTDhiC.js","assets/arrow-left-BisXiNbi.js","assets/about-CEi0TE0D.js","assets/contact-BtAUqP9N.js","assets/textarea-D2HCzsdG.js","assets/index-Dscfg2jT.js","assets/checkbox-Cq1_KlMr.js","assets/index-D5Ynt0l9.js","assets/contact-DpsRipQV.css","assets/pricing-H5l_qabz.js","assets/code-CWMcl_FQ.js","assets/cpu-CamQGDfc.js","assets/profile-DnG289kd.js","assets/clock-J-VTec2g.js","assets/credit-card-CbcRMTxa.js","assets/key-BX-e7lT6.js","assets/billing-D8UqftRn.js","assets/connect-tools-DJJRGJwq.js","assets/plug-G6JVmXPz.js","assets/folder-open-CDXk4-r7.js","assets/workspace-config-FakgVL2c.js","assets/plus-LIPWcPXb.js","assets/devices-DnYdvz0d.js","assets/qr-code-BELcD2KC.js","assets/smartphone-D9rmBN9Y.js","assets/get-gary-BaTxS6bL.js","assets/settings-2-C89yyjSh.js","assets/skills-CI9qGZg4.js","assets/wand-sparkles-CPYXfrpg.js","assets/trash-2-DcpaeqmH.js","assets/approvals-DOAuxKC4.js","assets/boom-simple-BJnmj4aq.js","assets/index-B-3zk2Pb.js","assets/index-Di4e0v0O.css","assets/BadabingLogo-DG649jAS.js","assets/boom-greeting-BYVz3SqL.js","assets/boom-control-B45at__D.js","assets/video-off-CvOrUHSx.js","assets/ellipsis-vertical-Ddav4E-y.js","assets/copy-BG1Et5wc.js","assets/external-link-CVFdo-3R.js","assets/download-Dx3u6hQ5.js","assets/public-meeting-simple-DY4DBkjm.js","assets/WebPhonePage-CSWdujuK.js","assets/separator-DfhwPx8z.js","assets/phone-off-DFUzB6cf.js","assets/volume-2-mnW8hwrd.js","assets/volume-x-CjaBilPp.js","assets/SimpleDialer-CPEjNmD1.js","assets/WebSIPClient-Db8900Ae.js","assets/CampaignManager-_oyfjsbB.js","assets/upload-Crs9HL86.js","assets/circle-x-DhGlJvnl.js","assets/SimpleDialerPage-BLJwmwEL.js","assets/EnterpriseDialer-DdF4P6ye.js","assets/pencil-B0MZMJ6y.js","assets/crm-connect-YJKHjUgf.js","assets/unlink-Dfh06tgg.js","assets/link-2-BopOio5J.js","assets/email-manager-Cdb7Ok11.js","assets/test-google-auth-BdgAhsRd.js","assets/ai-calling-test-Ig-70z7u.js","assets/resource-library-PylnVGjJ.js","assets/youtube-videos-BrcAcB83.js","assets/privacy-policy-CRba9w3u.js","assets/page-layout-DoqhKIvg.js","assets/terms-of-service-A82YC7Ef.js","assets/ai-ethics-BGucWuaB.js","assets/acceptable-use-CtdP_niE.js","assets/data-processing-Bl8d2Gar.
1js","assets/maia-CJ-SH0sO.js","assets/vaii-D07VfSPt.js","assets/command-D69-_Wmp.js","assets/bhconnect-UX6_jeWm.js","assets/arrow-right-left-kooURBKv.js","assets/mydata-C1ATKO75.js","assets/server-DOONVCED.js","assets/kubernetes-DclYAg5r.js","assets/container-CqWAKc02.js","assets/aws-BbgBUNdo.js","assets/cloud-CH6qA0W0.js","assets/pinecone-TkMerIxO.js","assets/langchain-BIwmG0rG.js","assets/n8n-Defj7hWq.js","assets/zapier-B7zbbD8L.js","assets/puzzle-C13v6Z5n.js","assets/wand-Dl51EDNE.js","assets/celonis-CBxW-Rdm.js","assets/microscope-Bt0nhlHC.js","assets/power-bi-qUYqMYkH.js","assets/chart-no-axes-column-increasing-9vGdqJHX.js","assets/share-2-CfSI7bG-.js","assets/ai-sdr-BQafSGVV.js","assets/workflow-DQc6i7kg.js","assets/analytics-bsb27ax-.js","assets/chart-line-CvcPruj9.js","assets/chart-pie-k-CmS-6I.js","assets/maia-DwvWfksh.js","assets/gary-BGrBC5Lq.js","assets/user-cog-Cc2d6kW2.js","assets/badabing-DBdU6q1P.js","assets/vaii-CLDX4bdL.js","assets/messages-square-C2Cdp0vD.js","assets/mydata-DXW2PD1I.js","assets/bhconnect-DWXSPlvQ.js","assets/unplug-o7gjd_lI.js","assets/link-BW6IJ9pW.js","assets/ambient-CUNKJpBY.js","assets/calendar-clock-B3i5RyQ7.js","assets/message-square-text-Bq-4Jpuj.js","assets/staffing-recruiting-CY-MdDfp.js","assets/sales-DCpV1QV_.js","assets/legal-5GmL-n92.js","assets/gavel-BXX55eBP.js","assets/legal-Cl60dnrF.js","assets/accordion-Bg8lmEBo.js","assets/legal-segments-Bcz8r6Fu.js","assets/stamp-Btr9Xgfj.js","assets/clipboard-check-Bfp61qgK.js","assets/scroll-text-Cg2-fzZP.js","assets/legal-segment-sLGKgUjp.js","assets/not-found-DG_rTePy.js","assets/plumber-BX24x7_2.js","assets/truck-B_Q6mhVa.js","assets/healthcare-18xQLDrX.js","assets/stethoscope-DW0hvPrZ.js","assets/clipboard-list-DrDLyAi_.js","assets/file-check-2-C25MzAmk.js","assets/financial-WLYxkVK8.js","assets/archive-B58m5dkj.js","assets/staffing-CY17_OJG.js","assets/repeat-Ck6f_srU.js","assets/real-estate-DyRagpqB.js","assets/hand-coins-C808INNe.js","assets/sales-CVegvF1b.js","assets/car-C4pTrDr3.js","assets/retail-DPE0WxV9.js","assets/package-search-D1sYx6ZK.js","assets/rotate-ccw-C4Z_pS_y.js","assets/hospitality-I0mvZ_zU.js","assets/utensils-crossed-DfzCBdib.js","assets/education-yg4b0_v5.js","assets/book-open-DpijCai1.js","assets/hvac-DNcwML_S.js","assets/thermometer-BAPmNYWS.js","assets/electrician-nIOQxHXf.js","assets/file-check-D6BrUWBw.js","assets/roofer-nYy95SG5.js","assets/umbrella-Bhk5Byzk.js","assets/painter-BfMPhXzz.js","assets/general-contractor-BdInQc2H.js","assets/handshake-DIr5TaJ_.js","assets/healthcare-B6w91vjd.js","assets/clipboard-DMjTHzGZ.js","assets/financial-BCvAlv51.js","assets/retail-BWGtGcF3.js","assets/badge-percent-COyhBJNK.js","assets/hospitality-DikLucoR.js","assets/utensils-CFxXMCGn.js","assets/message-circle-B8wscRdB.js","assets/education-CasdL_Hx.js","assets/ai-integration-DDnNRPxT.js","assets/knowledge-base-C95cVUOT.js","assets/book-aboDVz2Z.js","assets/rag-langchain-BWFe4HKc.js","assets/fine-tuning-CxnYv3F7.js","assets/data-migration-Dvl-0q1-.js","assets/case-studies-BvCmJ8yr.js","assets/templates-D3gLXvWo.js","assets/shopping-cart-C4Bww4a3.js","assets/case-studies-DWW4pf_R.js","assets/blog-D648hpJU.js","assets/avatar-DjNCNqAw.js","assets/ai-demo-B0Oaht2_.js","assets/qr-code-overlay-CgQn-MjT.js","assets/ai-voice-demo-B29dON_9.js","assets/chatbot-config-CKvMEI-O.js","assets/save-Vpy1jDrQ.js","assets/eye-off-CvCi8WPl.js","assets/eye-D2LLcxWJ.js","assets/ai-config-DGcgEGnO.js","assets/empty-state-CpfWHGl5.js","assets/admin-navigation-CUs6A1EO.js","assets/test-tube-B1a5aXn8.js","assets/headphones-CzvLGPgP.js","assets/observability-dashboard-DyQeg-oG.js","assets/table-uyLXpaVS.js","assets/scroll-area-BL7ivjW8.js","assets/skeleton-D-s2xcZ7.js","assets/timer-BDgxQp-q.js","assets/format-DpbSnpFF.js","assets/defaultOptions-w8f6iY6A.js","assets/en-US-BdMD9_HP.js","assets/startOfWeek-Bq8MAyDW.js","assets/user-management-BIB81iC1.js","assets/filter-DpSTqyYK.js","assets/arrow-up-uwPFSVvk.js","assets/arrow-down-CwXF4qNC.js","assets/arrow-up-down-BkyTIEkE.js","assets/log-in-_YJDov6d.js","assets/user-x-CwtEwOsb.js","assets/organization-management-CJ29G-el.js","assets/formatDistanceToNow-BJc3V-LV.js","assets/constructNow-d9oKvarD.js","assets/differenceInCalendarMonths-BZYu5ZUF.js","assets/endOfDay-xnhvJnr-.js","assets/endOfMonth-Ctgk4G_O.js","assets/differenceInMilliseconds-BXPkp8_a.js","assets/accept-invite-5-BBYSTw.js","assets/alert-Dwdyj1pB.js","assets/reset-password-BvxEtYgR.js","assets/refer-z4zv1yGb.js","assets/referrals-DtVZZDKv.js","assets/gift-6pPfX7SB.js","assets/admin-features-CN6btlqb.js","assets/lock-open-D3j3Jaty.js","assets/admin-external-api-keys-DAJgEARM.js","assets/api-keys-BXZOm_yy.js","assets/webhook-BqRBlEIL.js","assets/doc-management-BohWLJOB.js","assets/file-spreadsheet-DiHgccoS.js","assets/folder-plus-XzeiBsvV.js","assets/enterprise-BXNn9d_5.js","assets/professional-Dlsekgs8.js","assets/demo-CUY4WuRX.js","assets/free-dbtJ5Tik.js","assets/client-DDVS8DAH.js","assets/navigation-test-DO66829G.js","assets/sheet-DSHF_xY3.js","assets/voice-test-platform-CZY-UA8l.js","assets/demo-creator-DGUWBkBO.js","assets/trophy-DCeQH0HF.js","assets/heart-DVf2W5ry.js","assets/lightbulb-JEcM1JI2.js","assets/website-demo-creator-DsH3QwWc.js","assets/pen-line-BhaQPdQn.js","assets/panel-right-DdfkOcmZ.js","assets/mouse-pointer-click-CPlioleg.js","assets/demo-preview-DB_aL19d.js","assets/minus-CcXW4Z6_.js","assets/map-pin-W49BK2A6.js","assets/proposal-creator-CEAWb5F
1d.js","assets/dropdown-menu-CddSmWJf.js","assets/dollar-sign-BjlXbCFI.js","assets/proposal-preview-LDX_pJcP.js","assets/square-check-big-bDLOxN3s.js","assets/beaker-d_hRvVzu.js","assets/award-CyUxKIOS.js","assets/bell-off-EIeiTVRA.js","assets/monitor-off-CBA1NxRD.js","assets/bug-v0lCAyCp.js","assets/calendar-check-CCqtIEHU.js","assets/calendar-days-DQsPWV25.js","assets/calendar-range-AhdOjKA9.js","assets/calendar-x-DMWVIoZM.js","assets/maximize-CESlBSiK.js","assets/check-check-Cphe329H.js","assets/circle-minus-Chi7i7jw.js","assets/droplets-D8PIgrqY.js","assets/code-xml-DYg2Mizb.js","assets/ellipsis-5S1Y0YQI.js","assets/file-json-DIo7ZdT2.js","assets/file-video-CasZA_vm.js","assets/star-off-BuJnmsmZ.js","assets/film-IY8_S3TI.js","assets/flame-DqLldWf_.js","assets/gauge-DdTZjHU_.js","assets/ghost-B7JxqiHz.js","assets/git-branch-CIsvh7xx.js","assets/grip-vertical-BliYbOkh.js","assets/hard-drive-RqxBMyz0.js","assets/image-plus-DGeUHLUq.js","assets/image-DOVvmomL.js","assets/info-Cmbv6wPT.js","assets/variable-jrSeig6C.js","assets/list-checks-d01cZZsr.js","assets/list-ordered-D5tC-_IW.js","assets/tag-D0DbrkdV.js","assets/voicemail-DQ_37tlX.js","assets/message-square-off-nEi1hHC_.js","assets/message-square-plus-DVUf62xn.js","assets/moon-YWouOQ7N.js","assets/mouse-pointer-CINosLZr.js","assets/party-popper-CclTA_Bi.js","assets/pen-DqGfz-Gb.js","assets/power-off-CbzZXqOY.js","assets/power-C0JNgQjm.js","assets/reply-DC-vsmmu.js","assets/thumbs-down-n8JSfnLr.js","assets/scan-BbCU7xKu.js","assets/school-BNcA4KpI.js","assets/square-pen-BHfy1DHH.js","assets/sticky-note-CPze3Eqy.js","assets/sun-DSjaCQBB.js","assets/thumbs-up-CMKE3JUA.js","assets/trending-down-B9oFgxm-.js","assets/elevenlabs-voice-agent-BynK9nhA.js","assets/autonomous-agent-config-aLLbHoPY.js","assets/elevenlabs-voice-fixed-dUpb6AnP.js","assets/voice-agent-platform-fixed-BAJOwKkk.js","assets/tooltip-BjIXszj5.js","assets/voice-agent-setup-B58nmd8h.js","assets/automation-sequences-BL73Xn3x.js","assets/campaign-builder-eyrM5Gpd.js","assets/integrations-CgiyXBPi.js","assets/gary-portal-CefIU5gI.js","assets/lead-scoring-CvopqNHK.js","assets/sequence-templates-CEvFH854.js","assets/agent-memory-timeline-By6K5C3o.js","assets/parseISO-D-BZpntj.js","assets/api-dashboard-D2d_Xody.js","assets/crm-analytics-BkOfqz6h.js","assets/crm-dashboard-CKaiwSDz.js","assets/calendar-widget-Ts5GYd84.js","assets/endOfWeek-B5Qkmqy1.js","assets/addDays-8YRJUVBi.js","assets/isSameDay-7NUM5Lzm.js","assets/eachDayOfInterval-B4Sfyg1J.js","assets/startOfMonth-BlE4zmiO.js","assets/subMonths-CTHXSXq0.js","assets/pitches-5tm0JOqL.js","assets/crm-deals-CExYmh6a.js","assets/crm-calendar-DxmXn-Ok.js","assets/microsoft-integration-DFVWqRMf.js","assets/phone-numbers-D5Hor8IU.js","assets/chat-memory-CyskHzac.js","assets/sms-dashboard-CTyZVe7G.js","assets/contact-upload-DBJ2oDXs.js","assets/call-logs-BEmBcevx.js","assets/seo-dashboard-Copxi-ew.js","assets/seo-guide-CgRYZTt4.js","assets/ai-conference-DyH0lD43.js","assets/ai-conference-dashboard-CGpdkA9h.js","assets/isAfter-Dx0ZE2Ku.js","assets/ai-agent-config-Blt_udrk.js","assets/conference-recording-guide-DwqZ9r1l.js","assets/unified-communications-CwexDVEB.js","assets/unified-communications-dashboard-TVNKwXFo.js","assets/conference-recordings-BreQmzRk.js","assets/ai-sdrs-CnufQblF.js","assets/ai-recruiter-tM22N5X7.js","assets/crm-automation-B6qlGRmy.js","assets/ai-outbound-engine-DPYof84M.js","assets/ai-assistant-Cte_w1rI.js","assets/enterprise-ai-CeKiAxr7.js","assets/saas-platform-mUQCkaLV.js","assets/agentic-ai-Dn1yMOJq.js","assets/agentic-automation-rtG0G4H7.js","assets/ai-agents-BCg_8ynj.js","assets/ai-and-rpa-CkR6WAqt.js","assets/generative-ai-BVJhyAVI.js","assets/specialized-ai-CUc6nU3o.js","assets/enterprise-ai-DN1nDk7D.js","assets/ai-assistant-DUTHIedq.js","assets/what-is-rpa-DxhLCNUt.js","assets/sap-automation-YnuP7JmW.js","assets/web-automation-BIYd2IUO.js","assets/desktop-automation-Ctvn0ABj.js","assets/email-automation-B8kM79F4.js","assets/no-code-automation-gfYmcDyQ.js","assets/intelligent-automation-CarsiGHz.js","assets/test-automation-Dlcc-5Ja.js","assets/tradeworx-3cMU6Vt9.js","assets/traliant-CtTyjGfs.js","assets/reps-O2itBY9F.js","assets/alert-dialog-8LjQR4tb.js","assets/demo-data-tqXA6yv5.js","assets/subDays-B2Np3CVb.js","assets/campaign-launcher-D9qBew7x.js","assets/papaparse.min-CGCH5O8i.js","assets/csv-repository-DGAVCQSP.js","assets/contact-pipeline-CToe2EWK.js","assets/campaign-scheduler-BRQ8iqNT.js","assets/isToday-D2awjzY3.js","assets/isSameMonth-BXCo-8AA.js","assets/campaign-queue-C94yzafr.js","assets/meeting-timeline-CVDevkED.js","assets/popover-CzlkCSeK.js","assets/calendar-CvKdaSSM.js","assets/differenceInMinutes-Cwnf0-B6.js","assets/campaigns-Ddk5cy30.js","assets/banner-DzcPP-mq.js","assets/campaign-detail-DgYS9v9H.js","assets/campaign-analytics-D1AWy-cX.js","assets/video-campaigns-bWr_zimr.js","assets/video-studio-CLFHMYel.js","assets/document-storage-D_reW6EZ.js","assets/watch-WdYuwt-o.js","assets/landing-experiments-BFL5Ape0.js","assets/landing-preview-BGzf1CX_.js","assets/templates-BdnR438D.js","assets/contacts-RyVEgc7C.js","assets/contact-detail-DNOdarEc.js","assets/calendar-admin-Bi69dd4N.js","assets/calendar-team-view-DXPuEuru.
1js","assets/calendar-settings-B9J42cDi.js","assets/meeting-optimizer-tYPqdlJ4.js","assets/rep-calendar-view-DVetD71M.js","assets/calendar-automation-DPU1RQ31.js","assets/google-integration-wizard-yEtalmH0.js","assets/enterprise-onboarding-D66mxVbg.js","assets/workspace-management-5VbBAZph.js","assets/control-center-4yaaqvN5.js","assets/filter-stat-tile-ClLxLd5A.js","assets/system-health-BwN86VGD.js","assets/admin-feedback-DdJOh8rA.js","assets/client-portal-Bjp1K4gx.js","assets/systems-dashboard-BeztncMB.js","assets/confirmation-engine-C1AsGC2i.js","assets/unified-inbox-leQGoRxc.js","assets/callsheet-BBMfENtm.js","assets/recruiting-Du79pOZL.js","assets/recruiting-roles-1AglLHny.js","assets/recruiting-role-detail-QoGPujF6.js","assets/app-owner-dashboard-Drz6Ckwz.js","assets/owner-usage-dashboard-D55SC25Q.js","assets/recruiting-candidates-BrA2sDnt.js","assets/confirm-meeting-sLy55Cio.js","assets/clients-BVC6_aXI.js","assets/admin-meet-bots-DTNUJSBw.js","assets/admin-usage-DRz5P5Xf.js","assets/meeting-recordings-DcWrfuDl.js","assets/meet-bot-usage-D77Z_Msf.js","assets/dnc-list-CUeUdYsf.js","assets/email-accounts-BAmMr1yZ.js","assets/assistant-BBFbP3D9.js","assets/generateCategoricalChart-BxNjhG2o.js","assets/PieChart-B9MMk3De.js","assets/BarChart-Cma-y5jj.js","assets/analytics-dashboard-n_ttEHI0.js","assets/AreaChart-qLF5RZeY.js","assets/workspace-health-CluKNVZW.js","assets/campaign-intelligence-bYNm9XZE.js","assets/campaign-health-Bb-q0hpC.js","assets/meeting-tracker-4uVRGVSs.js","assets/meet-attendance-BXA5Sh27.js","assets/booking-pages-Bd1CEVmg.js","assets/public-book-CPqcr1oP.js","assets/sales-training-CYnJXZiy.js","assets/index-BPalbcuP.js","assets/mobile-qr-CfCSRI08.js"])))=>i.map(i=>d[i]); 2var ZE=Object.defineProperty;var Zv=t=>{throw TypeError(t)};var eP=(t,e,n)=>e in t?ZE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var nt=(t,e,n)=>eP(t,typeof e!="symbol"?e+"":e,n),gh=(t,e,n)=>e.has(t)||Zv("Cannot "+n);var _=(t,e,n)=>(gh(t,e,"read from private field"),n?n.call(t):e.get(t)),ee=(t,e,n)=>e.has(t)?Zv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),q=(t,e,n,i)=>(gh(t,e,"write to private field"),i?i.call(t,n):e.set(t,n),n),ve=(t,e,n)=>(gh(t,e,"access private method"),n);var xl=(t,e,n,i)=>({set _(r){q(t,e,r,n)},get _(){return _(t,e,i)}});function tP(t,e){for(var n=0;n<e.length;n++){const i=e[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in t)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();var f8=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Zx={exports:{}},Pu={},ek={exports:{}},Ce={};/** 3 * @license React 4 * react.production.min.js 5 * 6 * Copyright (c) Facebook, Inc. and its affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */var dl=Symbol.for("react.element"),nP=Symbol.for("react.portal"),iP=Symbol.for("react.fragment"),rP=Symbol.for("react.strict_mode"),sP=Symbol.for("react.profiler"),oP=Symbol.for("react.provider"),aP=Symbol.for("react.context"),cP=Symbol.for("react.forward_ref"),lP=Symbol.for("react.suspense"),dP=Symbol.for("react.memo"),uP=Symbol.for("react.lazy"),e0=Symbol.iterator;function hP(t){return t===null||typeof t!="object"?null:(t=e0&&t[e0]||t["@@iterator"],typeof t=="function"?t:null)}var tk={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nk=Object.assign,ik={};function wa(t,e,n){this.props=t,this.context=e,this.refs=ik,this.updater=n||tk}wa.prototype.isReactComponent={};wa.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)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,t,e,"setState")};wa.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function rk(){}rk.prototype=wa.prototype;function Vm(t,e,n){this.props=t,this.context=e,this.refs=ik,this.updater=n||tk}var zm=Vm.prototype=new rk;zm.constructor=Vm;nk(zm,wa.prototype);zm.isPureReactComponent=!0;
vendor: 10,049 bytes, lines 10-26
10var t0=Array.isArray,sk=Object.prototype.hasOwnProperty,Bm={current:null},ok={key:!0,ref:!0,__self:!0,__source:!0};function ak(t,e,n){var i,r={},s=null,o=null;if(e!=null)for(i in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)sk.call(e,i)&&!ok.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var l=Array(a),d=0;d<a;d++)l[d]=arguments[d+2];r.children=l}if(t&&t.defaultProps)for(i in a=t.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return{$$typeof:dl,type:t,key:s,ref:o,props:r,_owner:Bm.current}}function fP(t,e){return{$$typeof:dl,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Wm(t){return typeof t=="object"&&t!==null&&t.$$typeof===dl}function pP(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var n0=/\/+/g;function vh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?pP(""+t.key):e.toString(36)}function Zl(t,e,n,i,r){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case dl:case nP:o=!0}}if(o)return o=t,r=r(o),t=i===""?"."+vh(o,0):i,t0(r)?(n="",t!=null&&(n=t.replace(n0,"$&/")+"/"),Zl(r,e,n,"",function(d){return d})):r!=null&&(Wm(r)&&(r=fP(r,n+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(n0,"$&/")+"/")+t)),e.push(r)),1;if(o=0,i=i===""?".":i+":",t0(t))for(var a=0;a<t.length;a++){s=t[a];var l=i+vh(s,a);o+=Zl(s,e,n,l,r)}else if(l=hP(t),typeof l=="function")for(t=l.call(t),a=0;!(s=t.next()).done;)s=s.value,l=i+vh(s,a++),o+=Zl(s,e,n,l,r);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function kl(t,e,n){if(t==null)return t;var i=[],r=0;return Zl(t,i,"","",function(s){return e.call(n,s,r++)}),i}function mP(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Qt={current:null},ed={transition:null},gP={ReactCurrentDispatcher:Qt,ReactCurrentBatchConfig:ed,ReactCurrentOwner:Bm};function ck(){throw Error("act(...) is not supported in production builds of React.")}Ce.Children={map:kl,forEach:function(t,e,n){kl(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return kl(t,function(){e++}),e},toArray:function(t){return kl(t,function(e){return e})||[]},only:function(t){if(!Wm(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ce.Component=wa;Ce.Fragment=iP;Ce.Profiler=sP;Ce.PureComponent=Vm;Ce.StrictMode=rP;Ce.Suspense=lP;Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=gP;Ce.act=ck;Ce.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var i=nk({},t.props),r=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=Bm.current),e.key!==void 0&&(r=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)sk.call(e,l)&&!ok.hasOwnProperty(l)&&(i[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){a=Array(l);for(var d=0;d<l;d++)a[d]=arguments[d+2];i.children=a}return{$$typeof:dl,type:t.type,key:r,ref:s,props:i,_owner:o}};Ce.createContext=function(t){return t={$$typeof:aP,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:oP,_context:t},t.Consumer=t};Ce.createElement=ak;Ce.createFactory=function(t){var e=ak.bind(null,t);return e.type=t,e};Ce.createRef=function(){return{current:null}};Ce.forwardRef=function(t){return{$$typeof:cP,render:t}};Ce.isValidElement=Wm;Ce.lazy=function(t){return{$$typeof:uP,_payload:{_status:-1,_result:t},_init:mP}};Ce.memo=function(t,e){return{$$typeof:dP,type:t,compare:e===void 0?null:e}};Ce.startTransition=function(t){var e=ed.transition;ed.transition={};try{t()}finally{ed.transition=e}};Ce.unstable_act=ck;Ce.useCallback=function(t,e){return Qt.current.useCallback(t,e)};Ce.useContext=function(t){return Qt.current.useContext(t)};Ce.useDebugValue=function(){};Ce.useDeferredValue=function(t){return Qt.current.useDeferredValue(t)};Ce.useEffect=function(t,e){return Qt.current.useEffect(t,e)};Ce.useId=function(){return Qt.current.useId()};Ce.useImperativeHandle=function(t,e,n){return Qt.current.useImperativeHandle(t,e,n)};Ce.useInsertionEffect=function(t,e){return Qt.current.useInsertionEffect(t,e)};Ce.useLayoutEffect=function(t,e){return Qt.current.useLayoutEffect(t,e)};Ce.useMemo=function(t,e){return Qt.current.useMemo(t,e)};Ce.useReducer=function(t,e,n){return Qt.current.useReducer(t,e,n)};Ce.useRef=function(t){return Qt.current.useRef(t)};Ce.useState=function(t){return Qt.current.useState(t)};Ce.useSyncExternalStore=function(t,e,n){return Qt.current.useSyncExternalStore(t,e,n)};Ce.useTransition=function(){return Qt.current.useTransition()};Ce.version="18.3.1";ek.exports=Ce;var f=ek.exports;const vr=Xx(f),lk=tP({__proto__:null,default:vr},[f]);/** 11 * @license React 12 * react-jsx-runtime.production.min.js 13 * 14 * Copyright (c) Facebook, Inc. and its affiliates. 15 * 16 * This source code is licensed under the MIT license found in the 17 * LICENSE file in the root directory of this source tree. 18 */var vP=f,yP=Symbol.for("react.element"),bP=Symbol.for("react.fragment"),xP=Object.prototype.hasOwnProperty,kP=vP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,SP={key:!0,ref:!0,__self:!0,__source:!0};function dk(t,e,n){var i,r={},s=null,o=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(i in e)xP.call(e,i)&&!SP.hasOwnProperty(i)&&(r[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps,e)r[i]===void 0&&(r[i]=e[i]);return{$$typeof:yP,type:t,key:s,ref:o,props:r,_owner:kP.current}}Pu.Fragment=bP;Pu.jsx=dk;Pu.jsxs=dk;Zx.exports=Pu;var c=Zx.exports,uk={exports:{}},Cn={},hk={exports:{}},fk={};/** 19 * @license React 20 * scheduler.production.min.js 21 * 22 * Copyright (c) Facebook, Inc. and its affiliates. 23 * 24 * This source code is licensed under the MIT license found in the 25 * LICENSE file in the root directory of this source tree. 26 */(function(t){function e(A,U){var Q=A.length;A.push(U);e:for(;0<Q;){var se=Q-1>>>1,de=A[se];if(0<r(de,U))A[se]=U,A[Q]=de,Q=se;else break e}}function n(A){return A.length===0?null:A[0]}function i(A){if(A.length===0)return null;var U=A[0],Q=A.pop();if(Q!==U){A[0]=Q;e:for(var se=0,de=A.length,Ae=de>>>1;se<Ae;){var ye=2*(se+1)-1,Te=A[ye],We=ye+1,oe=A[We];if(0>r(Te,Q))We<de&&0>r(oe,Te)?(A[se]=oe,A[We]=Q,se=We):(A[se]=Te,A[ye]=Q,se=ye);else if(We<de&&0>r(oe,Q))A[se]=oe,A[We]=Q,se=We;else break e}}return U}function r(A,U){var Q=A.sortIndex-U.sortIndex;return Q!==0?Q:A.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],d=[],u=1,h=null,p=3,g=!1,b=!1,m=!1,k=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(A){for(var U=n(d);U!==null;){if(U.callback===null)i(d);else if(U.startTime<=A)i(d),U.sortIndex=U.expirationTime,e(l,U);else break;U=n(d)}}function S(A){if(m=!1,x(A),!b)if(n(l)!==null)b=!0,Y(w);else{var U=n(d);U!==null&&K(S,U.startTime-A)}}function w(A,U){b=!1,m&&(m=!1,v(P),P=-1),g=!0;var Q=p;try{for(x(U),h=n(l);h!==null&&(!(h.expirationTime>U)||A&&!L());){var se=h.callback;if(typeof se=="function"){h.callback=null,p=h.priorityLevel;var de=se(h.expirationTime<=U);U=t.unstable_now(),typeof de=="function"?h.callback=de:h===n(l)&&i(l),x(U)}else i(l);h=n(l)}if(h!==null)var Ae=!0;else{var ye=n(d);ye!==null&&K(S,ye.startTime-U),Ae=!1}return Ae}finally{h=null,p=Q,g=!1}}var C=!1,R=null,P=-1,N=5,I=-1;function L(){return!(t.unstable_now()-I<N)}function j(){if(R!==null){var A=t.unstable_now();I=A;var U=!0;try{U=R(!0,A)}finally{U?Z():(C=!1,R=null)}}else C=!1}var Z;if(typeof y=="function")Z=function(){y(j)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,te=F.port2;F.port1.onmessage=j,Z=function(){te.postMessage(null)}}else Z=function(){k(j,0)};function Y(A){R=A,C||(C=!0,Z())}function K(A,U){P=k(function(){A(t.unstable_now())},U)}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(A){A.callback=null},t.unstable_continueExecution=function(){b||g||(b=!0,Y(w))},t.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<A?Math.floor(1e3/A):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(A){switch(p){case 1:case 2:case 3:var U=3;break;default:U=p}var Q=p;p=U;try{return A()}finally{p=Q}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(A,U){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var Q=p;p=A;try{return U()}finally{p=Q}},t.unstable_scheduleCallback=function(A,U,Q){var se=t.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?se+Q:se):Q=se,A){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=Q+de,A={id:u++,callback:U,priorityLevel:A,startTime:Q,expirationTime:de,s
vendor: 4,537 bytes, lines 26-34
26ortIndex:-1},Q>se?(A.sortIndex=Q,e(d,A),n(l)===null&&A===n(d)&&(m?(v(P),P=-1):m=!0,K(S,Q-se))):(A.sortIndex=de,e(l,A),b||g||(b=!0,Y(w))),A},t.unstable_shouldYield=L,t.unstable_wrapCallback=function(A){var U=p;return function(){var Q=p;p=U;try{return A.apply(this,arguments)}finally{p=Q}}}})(fk);hk.exports=fk;var wP=hk.exports;/** 27 * @license React 28 * react-dom.production.min.js 29 * 30 * Copyright (c) Facebook, Inc. and its affiliates. 31 * 32 * This source code is licensed under the MIT license found in the 33 * LICENSE file in the root directory of this source tree. 34 */var CP=f,Sn=wP;function H(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var pk=new Set,vc={};function Xs(t,e){da(t,e),da(t+"Capture",e)}function da(t,e){for(vc[t]=e,t=0;t<e.length;t++)pk.add(e[t])}var Xi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Af=Object.prototype.hasOwnProperty,TP=/^[: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]*$/,i0={},r0={};function _P(t){return Af.call(r0,t)?!0:Af.call(i0,t)?!1:TP.test(t)?r0[t]=!0:(i0[t]=!0,!1)}function EP(t,e,n,i){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function PP(t,e,n,i){if(e===null||typeof e>"u"||EP(t,e,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Jt(t,e,n,i,r,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var Ot={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Ot[t]=new Jt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Ot[e]=new Jt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Ot[t]=new Jt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Ot[t]=new Jt(t,2,!1,t,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(t){Ot[t]=new Jt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Ot[t]=new Jt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Ot[t]=new Jt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Ot[t]=new Jt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Ot[t]=new Jt(t,5,!1,t.toLowerCase(),null,!1,!1)});var Hm=/[\-:]([a-z])/g;function $m(t){return t[1].toUpperCase()}"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
34-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(t){var e=t.replace(Hm,$m);Ot[e]=new Jt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Hm,$m);Ot[e]=new Jt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Hm,$m);Ot[e]=new Jt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Ot[t]=new Jt(t,1,!1,t.toLowerCase(),null,!1,!1)});Ot.xlinkHref=new Jt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Ot[t]=new Jt(t,1,!1,t.toLowerCase(),null,!0,!0)});function qm(t,e,n,i){var r=Ot.hasOwnProperty(e)?Ot[e]:null;(r!==null?r.type!==0:i||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(PP(e,n,r,i)&&(n=null),i||r===null?_P(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):r.mustUseProperty?t[r.propertyName]=n===null?r.type===3?!1:"":n:(e=r.attributeName,i=r.attributeNamespace,n===null?t.removeAttribute(e):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,i?t.setAttributeNS(i,e,n):t.setAttribute(e,n))))}var sr=CP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Sl=Symbol.for("react.element"),mo=Symbol.for("react.portal"),go=Symbol.for("react.fragment"),Km=Symbol.for("react.strict_mode"),Of=Symbol.for("react.profiler"),mk=Symbol.for("react.provider"),gk=Symbol.for("react.context"),Gm=Symbol.for("react.forward_ref"),Df=Symbol.for("react.suspense"),Lf=Symbol.for("react.suspense_list"),Qm=Symbol.for("react.memo"),Sr=Symbol.for("react.lazy"),vk=Symbol.for("react.offscreen"),s0=Symbol.iterator;function ja(t){return t===null||typeof t!="object"?null:(t=s0&&t[s0]||t["@@iterator"],typeof t=="function"?t:null)}var st=Object.assign,yh;function Ga(t){if(yh===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);yh=e&&e[1]||""}return` 35`+yh+t}var bh=!1;function xh(t,e){if(!t||bh)return"";bh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(d){var i=d}Reflect.construct(t,[],e)}else{try{e.call()}catch(d){i=d}t.call(e.prototype)}else{try{throw Error()}catch(d){i=d}t()}}catch(d){if(d&&i&&typeof d.stack=="string"){for(var r=d.stack.split(` 36`),s=i.stack.split(` 37`),o=r.length-1,a=s.length-1;1<=o&&0<=a&&r[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(r[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||r[o]!==s[a]){var l=` 38`+r[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{bh=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Ga(t):""}function RP(t){switch(t.tag){case 5:return Ga(t.type);case 16:return Ga("Lazy");case 13:return Ga("Suspense");case 19:return Ga("SuspenseList");case 0:case 2:case 15:return t=xh(t.type,!1),t;case 11:return t=xh(t.type.render,!1),t;case 1:return t=xh(t.type,!0),t;default:return""}}function Mf(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case go:return"Fragment";case mo:return"Portal";case Of:return"Profiler";case Km:return"StrictMode";case Df:return"Suspense";case Lf:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case gk:return(t.displayName||"Context")+".Consumer";case mk:return(t._context.displayName||"Context")+".Provider";case Gm:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Qm:return e=t.displayName||null,e!==null?e:Mf(t.type)||"Memo";case Sr:e=t._payload,t=t._init;try{return Mf(t(e))}catch{}}return null}function NP(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Mf(e);case 8:return e===Km?"StrictMode":"Mode";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(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function es(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function yk(t){var e=t.type;
vendor: 15,745 bytes, line 38
38return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function IP(t){var e=yk(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function wl(t){t._valueTracker||(t._valueTracker=IP(t))}function bk(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=yk(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function Dd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Uf(t,e){var n=e.checked;return st({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function o0(t,e){var n=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;n=es(e.value!=null?e.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function xk(t,e){e=e.checked,e!=null&&qm(t,"checked",e,!1)}function Ff(t,e){xk(t,e);var n=es(e.value),i=e.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Vf(t,e.type,n):e.hasOwnProperty("defaultValue")&&Vf(t,e.type,es(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function a0(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Vf(t,e,n){(e!=="number"||Dd(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Qa=Array.isArray;function jo(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+es(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function zf(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(H(91));return st({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function c0(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(H(92));if(Qa(n)){if(1<n.length)throw Error(H(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:es(n)}}function kk(t,e){var n=es(e.value),i=es(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),i!=null&&(t.defaultValue=""+i)}function l0(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function Sk(t){switch(t){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 Bf(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?Sk(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Cl,wk=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,i,r){MSApp.execUnsafeLocalFunction(function(){return t(e,n,i,r)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Cl=Cl||document.createElement("div"),Cl.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Cl.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function yc(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var nc={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},jP=["Webkit","ms","Moz","O"];Object.keys(nc).forEach(function(t){jP.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),nc[e]=nc[t]})});function Ck(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||nc.hasOwnProperty(t)&&nc[t]?(""+e).trim():e+"px"}function Tk(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var i=n.indexOf("--")===0,r=Ck(n,e[n],i);n==="float"&&(n="cssFloat"),i?t.setProperty(n,r):t[n]=r}}var AP=st({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 Wf(t,e){if(e){if(AP[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(H(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(H(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(H(61))}if(e.style!=null&&typeof e.style!="object")throw Error(H(62))}}function Hf(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 $f=null;function Jm(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var qf=null,Ao=null,Oo=null;function d0(t){if(t=fl(t)){if(typeof qf!="function")throw Error(H(280));var e=t.stateNode;e&&(e=Au(e),qf(t.stateNode,t.type,e))}}function _k(t){Ao?Oo?Oo.push(t):Oo=[t]:Ao=t}function Ek(){if(Ao){var t=Ao,e=Oo;if(Oo=Ao=null,d0(t),e)for(t=0;t<e.length;t++)d0(e[t])}}function Pk(t,e){return t(e)}function Rk(){}var kh=!1;function Nk(t,e,n){if(kh)return t(e,n);kh=!0;try{return Pk(t,e,n)}finally{kh=!1,(Ao!==null||Oo!==null)&&(Rk(),Ek())}}function bc(t,e){var n=t.stateNode;if(n===null)return null;var i=Au(n);if(i===null)return null;n=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(H(231,e,typeof n));return n}var Kf=!1;if(Xi)try{var Aa={};Object.defineProperty(Aa,"passive",{get:function(){Kf=!0}}),window.addEventListener("test",Aa,Aa),window.removeEventListener("test",Aa,Aa)}catch{Kf=!1}function OP(t,e,n,i,r,s,o,a,l){var d=Array.prototype.slice.call(arguments,3);try{e.apply(n,d)}catch(u){this.onError(u)}}var ic=!1,Ld=null,Md=!1,Gf=null,DP={onError:function(t){ic=!0,Ld=t}};function LP(t,e,n,i,r,s,o,a,l){ic=!1,Ld=null,OP.apply(DP,arguments)}function MP(t,e,n,i,r,s,o,a,l){if(LP.apply(this,arguments),ic){if(ic){var d=Ld;ic=!1,Ld=null}else throw Error(H(198));Md||(Md=!0,Gf=d)}}function Zs(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function Ik(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function u0(t){if(Zs(t)!==t)throw Error(H(188))}function UP(t){var e=t.alternate;if(!e){if(e=Zs(t),e===null)throw Error(H(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var s=r.alternate;if(s===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return u0(r),t;if(s===i)return u0(r),e;s=s.sibling}throw Error(H(188))}if(n.return!==i.return)n=r,i=s;else{for(var o=!1,a=r.child;a;){if(a===n){o=!0,n=r,i=s;break}if(a===i){o=!0,i=r,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,i=r;break}if(a===i){o=!0,i=s,n=r;break}a=a.sibling}if(!o)throw Error(H(189))}}if(n.alternate!==i)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?t:e}function jk(t){return t=UP(t),t!==null?Ak(t):null}function Ak(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Ak(t);if(e!==null)return e;t=t.sibling}return null}var Ok=Sn.unstable_scheduleCallback,h0=Sn.unstable_cancelCallback,FP=Sn.unstable_shouldYield,VP=Sn.unstable_requestPaint,ht=Sn.unstable_now,zP=Sn.unstable_getCurrentPriorityLevel,Ym=Sn.unstable_ImmediatePriority,Dk=Sn.unstable_UserBlockingPriority,Ud=Sn.unstable_NormalPriority,BP=Sn.unstable_LowPriority,Lk=Sn.unstable_IdlePriority,Ru=null,xi=null;function WP(t){if(xi&&typeof xi.onCommitFiberRoot=="function")try{xi.onCommitFiberRoot(Ru,t,void 0,(t.current.flags&128)===128)}catch{}}var Zn=Math.clz32?Math.clz32:qP,HP=Math.log,$P=Math.LN2;function qP(t){return t>>>=0,t===0?32:31-(HP(t)/$P|0)|0}var Tl=64,_l=4194304;function Ja(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Fd(t,e){var n=t.pendingLanes;if(n===0)return 0;var i=0,r=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~r;a!==0?i=Ja(a):(s&=o,s!==0&&(i=Ja(s)))}else o=n&~r,o!==0?i=Ja(o):s!==0&&(i=Ja(s));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,s=e&-e,r>=s||r===16&&(s&4194240)!==0))return e;if(i&4&&(i|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=i;0<e;)n=31-Zn(e),r=1<<n,i|=t[n],e&=~r;return i}function KP(t,e){switch(t){case 1:case 2:case 4:return e+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 e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function GP(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-Zn(s),a=1<<o,l=r[o];l===-1?(!(a&n)||a&i)&&(r[o]=KP(a,e)):l<=e&&(t.expiredLanes|=a),s&=~a}}function Qf(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Mk(){var t=Tl;return Tl<<=1,!(Tl&4194240)&&(Tl=64),t}function Sh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function ul(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Zn(e),t[e]=n}function QP(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0<n;){var r=31-Zn(n),s=1<<r;e[r]=0,i[r]=-1,t[r]=-1,n&=~s}}function Xm(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-Zn(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}var Ve=0;function Uk(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var Fk,Zm,Vk,zk,Bk,Jf=!1,El=[],Wr=null,Hr=null,$r=null,xc=new Map,kc=new Map,Cr=[],JP="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 f0(t,e){switch(t){case"focusin":case"focusout":Wr=null;break;case"dragenter":case"dragleave":Hr=null;break;case"mouseover":case"mouseout":$r=null;break;case"pointerover":case"pointerout":xc.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":kc.delete(e.pointerId)}}function Oa(t,e,n,i,r,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:s,targetContainers:[r]},e!==null&&(e=fl(e),e!==null&&Zm(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function YP(t,e,n,i,r){switch(e){case"focusin":return Wr=Oa(Wr,t,e,n,i,r),!0;case"dragenter":return Hr=Oa(Hr,t,e,n,i,r),!0;case"mouseover":return $r=Oa($r,t,e,n,i,r),!0;case"pointerover":var s=r.pointerId;return xc.set(s,Oa(xc.get(s)||null,t,e,n,i,r)),!0;case"gotpointercapture":return s=r.pointerId,kc.set(s,Oa(kc.get(s)||null,t,e,n,i,r)),!0}return!1}function Wk(t){var e=ks(t.target);if(e!==null){var n=Zs(e);if(n!==null){if(e=n.tag,e===13){if(e=Ik(n),e!==null){t.blockedOn=e,Bk(t.priority,function(){Vk(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function td(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Yf(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);$f=i,n.target.dispatchEvent(i),$f=null}else return e=fl(n),e!==null&&Zm(e),t.blockedOn=n,!1;e.shift()}return!0}function p0(t,e,n){td(t)&&n.delete(e)}function XP(){Jf=!1,Wr!==null&&td(Wr)&&(Wr=null),Hr!==null&&td(Hr)&&(Hr=null),$r!==null&&td($r)&&($r=null),xc.forEach(p0),kc.forEach(p0)}function Da(t,e){t.blockedOn===e&&(t.blockedOn=null,Jf||(Jf=!0,Sn.unstable_scheduleCallback(Sn.unstable_NormalPriority,XP)))}function Sc(t){function e(r){return Da(r,t)}if(0<El.length){Da(El[0],t);for(var n=1;n<El.length;n++){var i=El[n];i.blockedOn===t&&(i.blockedOn=null)}}for(Wr!==null&&Da(Wr,t),Hr!==null&&Da(Hr,t),$r!==null&&Da($r,t),xc.forEach(e),kc.forEach(e),n=0;n<Cr.length;n++)i=Cr[n],i.blockedOn===t&&(i.blockedOn=null);for(;0<Cr.length&&(n=Cr[0],n.blockedOn===null);)Wk(n),n.blockedOn===null&&Cr.shift()}var Do=sr.ReactCurrentBatchConfig,Vd=!0;function ZP(t,e,n,i){var r=Ve,s=Do.transition;Do.transition=null;try{Ve=1,eg(t,e,n,i)}finally{Ve=r,Do.transition=s}}function eR(t,e,n,i){var r=Ve,s=Do.transition;Do.transition=null;try{Ve=4,eg(t,e,n,i)}finally{Ve=r,Do.transition=s}}function eg(t,e,n,i){if(Vd){var r=Yf(t,e,n,i);if(r===null)jh(t,e,i,zd,n),f0(t,i);else if(YP(r,t,e,n,i))i.stopPropagation();else if(f0(t,i),e&4&&-1<JP.indexOf(t)){for(;r!==null;){var s=fl(r);if(s!==null&&Fk(s),s=Yf(t,e,n,i),s===null&&jh(t,e,i,zd,n),s===r)break;r=s}r!==null&&i.stopPropagation()}else jh(t,e,i,null,n)}}var zd=null;function Yf(t,e,n,i){if(zd=null,t=Jm(i),t=ks(t),t!==null)if(e=Zs(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Ik(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return zd=t,null}
vendor: 9,127 bytes, line 38
38function Hk(t){switch(t){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(zP()){case Ym:return 1;case Dk:return 4;case Ud:case BP:return 16;case Lk:return 536870912;default:return 16}default:return 16}}var Vr=null,tg=null,nd=null;function $k(){if(nd)return nd;var t,e=tg,n=e.length,i,r="value"in Vr?Vr.value:Vr.textContent,s=r.length;for(t=0;t<n&&e[t]===r[t];t++);var o=n-t;for(i=1;i<=o&&e[n-i]===r[s-i];i++);return nd=r.slice(t,1<i?1-i:void 0)}function id(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Pl(){return!0}function m0(){return!1}function Tn(t){function e(n,i,r,s,o){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Pl:m0,this.isPropagationStopped=m0,this}return st(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Pl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Pl)},persist:function(){},isPersistent:Pl}),e}var Ca={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ng=Tn(Ca),hl=st({},Ca,{view:0,detail:0}),tR=Tn(hl),wh,Ch,La,Nu=st({},hl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ig,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==La&&(La&&t.type==="mousemove"?(wh=t.screenX-La.screenX,Ch=t.screenY-La.screenY):Ch=wh=0,La=t),wh)},movementY:function(t){return"movementY"in t?t.movementY:Ch}}),g0=Tn(Nu),nR=st({},Nu,{dataTransfer:0}),iR=Tn(nR),rR=st({},hl,{relatedTarget:0}),Th=Tn(rR),sR=st({},Ca,{animationName:0,elapsedTime:0,pseudoElement:0}),oR=Tn(sR),aR=st({},Ca,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),cR=Tn(aR),lR=st({},Ca,{data:0}),v0=Tn(lR),dR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uR={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",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"},hR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fR(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=hR[t])?!!e[t]:!1}function ig(){return fR}var pR=st({},hl,{key:function(t){if(t.key){var e=dR[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=id(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?uR[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ig,charCode:function(t){return t.type==="keypress"?id(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?id(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),mR=Tn(pR),gR=st({},Nu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),y0=Tn(gR),vR=st({},hl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ig}),yR=Tn(vR),bR=st({},Ca,{propertyName:0,elapsedTime:0,pseudoElement:0}),xR=Tn(bR),kR=st({},Nu,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),SR=Tn(kR),wR=[9,13,27,32],rg=Xi&&"CompositionEvent"in window,rc=null;Xi&&"documentMode"in document&&(rc=document.documentMode);var CR=Xi&&"TextEvent"in window&&!rc,qk=Xi&&(!rg||rc&&8<rc&&11>=rc),b0=" ",x0=!1;function Kk(t,e){switch(t){case"keyup":return wR.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gk(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var vo=!1;function TR(t,e){switch(t){case"compositionend":return Gk(e);case"keypress":return e.which!==32?null:(x0=!0,b0);case"textInput":return t=e.data,t===b0&&x0?null:t;default:return null}}function _R(t,e){if(vo)return t==="compositionend"||!rg&&Kk(t,e)?(t=$k(),nd=tg=Vr=null,vo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return qk&&e.locale!=="ko"?null:e.data;default:return null}}var ER={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 k0(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!ER[t.type]:e==="textarea"}function Qk(t,e,n,i){_k(i),e=Bd(e,"onChange"),0<e.length&&(n=new ng("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var sc=null,wc=null;function PR(t){oS(t,0)}function Iu(t){var e=xo(t);if(bk(e))return t}function RR(t,e){if(t==="change")return e}var Jk=!1;if(Xi){var _h;if(Xi){var Eh="oninput"in document;if(!Eh){var S0=document.createElement("div");S0.setAttribute("oninput","return;"),Eh=typeof S0.oninput=="function"}_h=Eh}else _h=!1;Jk=_h&&(!document.documentMode||9<document.documentMode)}function w0(){sc&&(sc.detachEvent("onpropertychange",Yk),wc=sc=null)}function Yk(t){if(t.propertyName==="value"&&Iu(wc)){var e=[];Qk(e,wc,t,Jm(t)),Nk(PR,e)}}function NR(t,e,n){t==="focusin"?(w0(),sc=e,wc=n,sc.attachEvent("onpropertychange",Yk)):t==="focusout"&&w0()}function IR(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Iu(wc)}function jR(t,e){if(t==="click")return Iu(e)}function AR(t,e){if(t==="input"||t==="change")return Iu(e)}function OR(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ti=typeof Object.is=="function"?Object.is:OR;function Cc(t,e){if(ti(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!Af.call(e,r)||!ti(t[r],e[r]))return!1}return!0}function C0(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function T0(t,e){var n=C0(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=C0(n)}}function Xk(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Xk(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Zk(){for(var t=window,e=Dd();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Dd(t.document)}return e}function sg(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function DR(t){var e=Zk(),n=t.focusedElem,i=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Xk(n.ownerDocument.documentElement,n)){if(i!==null&&sg(n)){if
vendor: 5,775 bytes, line 38
38(e=i.start,t=i.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var r=n.textContent.length,s=Math.min(i.start,r);i=i.end===void 0?s:Math.min(i.end,r),!t.extend&&s>i&&(r=i,i=s,s=r),r=T0(n,s);var o=T0(n,i);r&&o&&(t.rangeCount!==1||t.anchorNode!==r.node||t.anchorOffset!==r.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),t.removeAllRanges(),s>i?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var LR=Xi&&"documentMode"in document&&11>=document.documentMode,yo=null,Xf=null,oc=null,Zf=!1;function _0(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Zf||yo==null||yo!==Dd(i)||(i=yo,"selectionStart"in i&&sg(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),oc&&Cc(oc,i)||(oc=i,i=Bd(Xf,"onSelect"),0<i.length&&(e=new ng("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=yo)))}function Rl(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var bo={animationend:Rl("Animation","AnimationEnd"),animationiteration:Rl("Animation","AnimationIteration"),animationstart:Rl("Animation","AnimationStart"),transitionend:Rl("Transition","TransitionEnd")},Ph={},eS={};Xi&&(eS=document.createElement("div").style,"AnimationEvent"in window||(delete bo.animationend.animation,delete bo.animationiteration.animation,delete bo.animationstart.animation),"TransitionEvent"in window||delete bo.transitionend.transition);function ju(t){if(Ph[t])return Ph[t];if(!bo[t])return t;var e=bo[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in eS)return Ph[t]=e[n];return t}var tS=ju("animationend"),nS=ju("animationiteration"),iS=ju("animationstart"),rS=ju("transitionend"),sS=new Map,E0="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 os(t,e){sS.set(t,e),Xs(e,[t])}for(var Rh=0;Rh<E0.length;Rh++){var Nh=E0[Rh],MR=Nh.toLowerCase(),UR=Nh[0].toUpperCase()+Nh.slice(1);os(MR,"on"+UR)}os(tS,"onAnimationEnd");os(nS,"onAnimationIteration");os(iS,"onAnimationStart");os("dblclick","onDoubleClick");os("focusin","onFocus");os("focusout","onBlur");os(rS,"onTransitionEnd");da("onMouseEnter",["mouseout","mouseover"]);da("onMouseLeave",["mouseout","mouseover"]);da("onPointerEnter",["pointerout","pointerover"]);da("onPointerLeave",["pointerout","pointerover"]);Xs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Xs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Xs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Xs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Xs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Xs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ya="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(" "),FR=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ya));function P0(t,e,n){var i=t.type||"unknown-event";t.currentTarget=n,MP(i,e,void 0,t),t.currentTarget=null}function oS(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var s=void 0;if(e)for(var o=i.length-1;0<=o;o--){var a=i[o],l=a.instance,d=a.currentTarget;if(a=a.listener,l!==s&&r.isPropagationStopped())break e;P0(r,a,d),s=l}else for(o=0;o<i.length;o++){if(a=i[o],l=a.instance,d=a.currentTarget,a=a.listener,l!==s&&r.isPropagationStopped())break e;P0(r,a,d),s=l}}}if(Md)throw t=Gf,Md=!1,Gf=null,t}function Qe(t,e){var n=e[rp];n===void 0&&(n=e[rp]=new Set);var i=t+"__bubble";n.has(i)||(aS(e,t,2,!1),n.add(i))}function Ih(t,e,n){var i=0;e&&(i|=4),aS(n,t,i,e)}var Nl="_reactListening"+Math.random().toString(36).slice(2);function Tc(t){if(!t[Nl]){t[Nl]=!0,pk.forEach(function(n){n!=="selectionchange"&&(FR.has(n)||Ih(n,!1,t),Ih(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Nl]||(e[Nl]=!0,Ih("selectionchange",!1,e))}}function aS(t,e,n,i){switch(Hk(e)){case 1:var r=ZP;break;case 4:r=eR;break;default:r=eg}n=r.bind(null,e,n,t),r=void 0,!Kf||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function jh(t,e,n,i,r){var s=i;if(!(e&1)&&!(e&2)&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var a=i.stateNode.containerInfo;
vendor: 5,316 bytes, lines 38-39
38if(a===r||a.nodeType===8&&a.parentNode===r)break;if(o===4)for(o=i.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;o=o.return}for(;a!==null;){if(o=ks(a),o===null)return;if(l=o.tag,l===5||l===6){i=s=o;continue e}a=a.parentNode}}i=i.return}Nk(function(){var d=s,u=Jm(n),h=[];e:{var p=sS.get(t);if(p!==void 0){var g=ng,b=t;switch(t){case"keypress":if(id(n)===0)break e;case"keydown":case"keyup":g=mR;break;case"focusin":b="focus",g=Th;break;case"focusout":b="blur",g=Th;break;case"beforeblur":case"afterblur":g=Th;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=g0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=iR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=yR;break;case tS:case nS:case iS:g=oR;break;case rS:g=xR;break;case"scroll":g=tR;break;case"wheel":g=SR;break;case"copy":case"cut":case"paste":g=cR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=y0}var m=(e&4)!==0,k=!m&&t==="scroll",v=m?p!==null?p+"Capture":null:p;m=[];for(var y=d,x;y!==null;){x=y;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,v!==null&&(S=bc(y,v),S!=null&&m.push(_c(y,S,x)))),k)break;y=y.return}0<m.length&&(p=new g(p,b,null,n,u),h.push({event:p,listeners:m}))}}if(!(e&7)){e:{if(p=t==="mouseover"||t==="pointerover",g=t==="mouseout"||t==="pointerout",p&&n!==$f&&(b=n.relatedTarget||n.fromElement)&&(ks(b)||b[Zi]))break e;if((g||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,g?(b=n.relatedTarget||n.toElement,g=d,b=b?ks(b):null,b!==null&&(k=Zs(b),b!==k||b.tag!==5&&b.tag!==6)&&(b=null)):(g=null,b=d),g!==b)){if(m=g0,S="onMouseLeave",v="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(m=y0,S="onPointerLeave",v="onPointerEnter",y="pointer"),k=g==null?p:xo(g),x=b==null?p:xo(b),p=new m(S,y+"leave",g,n,u),p.target=k,p.relatedTarget=x,S=null,ks(u)===d&&(m=new m(v,y+"enter",b,n,u),m.target=x,m.relatedTarget=k,S=m),k=S,g&&b)t:{for(m=g,v=b,y=0,x=m;x;x=so(x))y++;for(x=0,S=v;S;S=so(S))x++;for(;0<y-x;)m=so(m),y--;for(;0<x-y;)v=so(v),x--;for(;y--;){if(m===v||v!==null&&m===v.alternate)break t;m=so(m),v=so(v)}m=null}else m=null;g!==null&&R0(h,p,g,m,!1),b!==null&&k!==null&&R0(h,k,b,m,!0)}}e:{if(p=d?xo(d):window,g=p.nodeName&&p.nodeName.toLowerCase(),g==="select"||g==="input"&&p.type==="file")var w=RR;else if(k0(p))if(Jk)w=AR;else{w=IR;var C=NR}else(g=p.nodeName)&&g.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(w=jR);if(w&&(w=w(t,d))){Qk(h,w,n,u);break e}C&&C(t,p,d),t==="focusout"&&(C=p._wrapperState)&&C.controlled&&p.type==="number"&&Vf(p,"number",p.value)}switch(C=d?xo(d):window,t){case"focusin":(k0(C)||C.contentEditable==="true")&&(yo=C,Xf=d,oc=null);break;case"focusout":oc=Xf=yo=null;break;case"mousedown":Zf=!0;break;case"contextmenu":case"mouseup":case"dragend":Zf=!1,_0(h,n,u);break;case"selectionchange":if(LR)break;case"keydown":case"keyup":_0(h,n,u)}var R;if(rg)e:{switch(t){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else vo?Kk(t,n)&&(P="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(qk&&n.locale!=="ko"&&(vo||P!=="onCompositionStart"?P==="onCompositionEnd"&&vo&&(R=$k()):(Vr=u,tg="value"in Vr?Vr.value:Vr.textContent,vo=!0)),C=Bd(d,P),0<C.length&&(P=new v0(P,t,null,n,u),h.push({event:P,listeners:C}),R?P.data=R:(R=Gk(n),R!==null&&(P.data=R)))),(R=CR?TR(t,n):_R(t,n))&&(d=Bd(d,"onBeforeInput"),0<d.length&&(u=new v0("onBeforeInput","beforeinput",null,n,u),h.push({event:u,listeners:d}),u.data=R))}oS(h,e)})}function _c(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Bd(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,s=r.stateNode;r.tag===5&&s!==null&&(r=s,s=bc(t,n),s!=null&&i.unshift(_c(t,s,r)),s=bc(t,e),s!=null&&i.push(_c(t,s,r))),t=t.return}return i}function so(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function R0(t,e,n,i,r){for(var s=e._reactName,o=[];n!==null&&n!==i;){var a=n,l=a.alternate,d=a.stateNode;if(l!==null&&l===i)break;a.tag===5&&d!==null&&(a=d,r?(l=bc(n,s),l!=null&&o.unshift(_c(n,l,a))):r||(l=bc(n,s),l!=null&&o.push(_c(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var VR=/\r\n?/g,zR=/\u0000|\uFFFD/g;function N0(t){return(typeof t=="string"?t:""+t).replace(VR,` 39`).replace(zR,"")}function Il(t,e,n){if(e=N0(e),N0(t)!==e&&n)throw Error(H(425))}function Wd(){}var ep=null,tp=null;function np(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var ip=typeof setTimeout=="function"?setTimeout:void 0,BR=typeof clearTimeout=="function"?clearTimeout:void 0,I0=typeof Promise=="function"?Promise:void 0,WR=typeof queueMicrotask=="function"?queueMicrotask:typeof I0<"u"?function(t){return I0.resolve(null).then(t).cat
vendor: 4,824 bytes, line 39
39ch(HR)}:ip;function HR(t){setTimeout(function(){throw t})}function Ah(t,e){var n=e,i=0;do{var r=n.nextSibling;if(t.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(i===0){t.removeChild(r),Sc(e);return}i--}else n!=="$"&&n!=="$?"&&n!=="$!"||i++;n=r}while(n);Sc(e)}function qr(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function j0(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Ta=Math.random().toString(36).slice(2),gi="__reactFiber$"+Ta,Ec="__reactProps$"+Ta,Zi="__reactContainer$"+Ta,rp="__reactEvents$"+Ta,$R="__reactListeners$"+Ta,qR="__reactHandles$"+Ta;function ks(t){var e=t[gi];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Zi]||n[gi]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=j0(t);t!==null;){if(n=t[gi])return n;t=j0(t)}return e}t=n,n=t.parentNode}return null}function fl(t){return t=t[gi]||t[Zi],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function xo(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(H(33))}function Au(t){return t[Ec]||null}var sp=[],ko=-1;function as(t){return{current:t}}function Ye(t){0>ko||(t.current=sp[ko],sp[ko]=null,ko--)}function Ke(t,e){ko++,sp[ko]=t.current,t.current=e}var ts={},Bt=as(ts),an=as(!1),Ms=ts;function ua(t,e){var n=t.type.contextTypes;if(!n)return ts;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in n)r[s]=e[s];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=r),r}function cn(t){return t=t.childContextTypes,t!=null}function Hd(){Ye(an),Ye(Bt)}function A0(t,e,n){if(Bt.current!==ts)throw Error(H(168));Ke(Bt,e),Ke(an,n)}function cS(t,e,n){var i=t.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(H(108,NP(t)||"Unknown",r));return st({},n,i)}function $d(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ts,Ms=Bt.current,Ke(Bt,t),Ke(an,an.current),!0}function O0(t,e,n){var i=t.stateNode;if(!i)throw Error(H(169));n?(t=cS(t,e,Ms),i.__reactInternalMemoizedMergedChildContext=t,Ye(an),Ye(Bt),Ke(Bt,t)):Ye(an),Ke(an,n)}var Ui=null,Ou=!1,Oh=!1;function lS(t){Ui===null?Ui=[t]:Ui.push(t)}function KR(t){Ou=!0,lS(t)}function cs(){if(!Oh&&Ui!==null){Oh=!0;var t=0,e=Ve;try{var n=Ui;for(Ve=1;t<n.length;t++){var i=n[t];do i=i(!0);while(i!==null)}Ui=null,Ou=!1}catch(r){throw Ui!==null&&(Ui=Ui.slice(t+1)),Ok(Ym,cs),r}finally{Ve=e,Oh=!1}}return null}var So=[],wo=0,qd=null,Kd=0,In=[],jn=0,Us=null,qi=1,Ki="";function ps(t,e){So[wo++]=Kd,So[wo++]=qd,qd=t,Kd=e}function dS(t,e,n){In[jn++]=qi,In[jn++]=Ki,In[jn++]=Us,Us=t;var i=qi;t=Ki;var r=32-Zn(i)-1;i&=~(1<<r),n+=1;var s=32-Zn(e)+r;if(30<s){var o=r-r%5;s=(i&(1<<o)-1).toString(32),i>>=o,r-=o,qi=1<<32-Zn(e)+r|n<<r|i,Ki=s+t}else qi=1<<s|n<<r|i,Ki=t}function og(t){t.return!==null&&(ps(t,1),dS(t,1,0))}function ag(t){for(;t===qd;)qd=So[--wo],So[wo]=null,Kd=So[--wo],So[wo]=null;for(;t===Us;)Us=In[--jn],In[jn]=null,Ki=In[--jn],In[jn]=null,qi=In[--jn],In[jn]=null}var bn=null,vn=null,Ze=!1,qn=null;function uS(t,e){var n=An(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function D0(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,bn=t,vn=qr(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,bn=t,vn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Us!==null?{id:qi,overflow:Ki}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=An(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,bn=t,vn=null,!0):!1;default:return!1}}function op(t){return(t.mode&1)!==0&&(t.flags&128)===0}function ap(t){if(Ze){var e=vn;if(e){var n=e;if(!D0(t,e)){if(op(t))throw Error(H(418));e=qr(n.nextSibling);var i=bn;e&&D0(t,e)?uS(i,n):(t.flags=t.flags&-4097|2,Ze=!1,bn=t)}}else{if(op(t))throw Error(H(418));t.flags=t.flags&-4097|2,Ze=!1,bn=t}}}function L0(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;bn=t}function jl(t){if(t!==bn)return!1;if(!Ze)return L0(t),Ze=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!np(t.type,t.memoizedProps)),e&&(e=vn)){if(op(t))throw hS(),Error(H(418));for(;e;)uS(t,e),e=qr(e.nextSibling)}if(L0(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(H(317));e:{for(t=t.nextSibling,e=0;t;
vendor: 10,279 bytes, line 39
39){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){vn=qr(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}vn=null}}else vn=bn?qr(t.stateNode.nextSibling):null;return!0}function hS(){for(var t=vn;t;)t=qr(t.nextSibling)}function ha(){vn=bn=null,Ze=!1}function cg(t){qn===null?qn=[t]:qn.push(t)}var GR=sr.ReactCurrentBatchConfig;function Ma(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(H(309));var i=n.stateNode}if(!i)throw Error(H(147,t));var r=i,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=r.refs;o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,t))}return t}function Al(t,e){throw t=Object.prototype.toString.call(e),Error(H(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function M0(t){var e=t._init;return e(t._payload)}function fS(t){function e(v,y){if(t){var x=v.deletions;x===null?(v.deletions=[y],v.flags|=16):x.push(y)}}function n(v,y){if(!t)return null;for(;y!==null;)e(v,y),y=y.sibling;return null}function i(v,y){for(v=new Map;y!==null;)y.key!==null?v.set(y.key,y):v.set(y.index,y),y=y.sibling;return v}function r(v,y){return v=Jr(v,y),v.index=0,v.sibling=null,v}function s(v,y,x){return v.index=x,t?(x=v.alternate,x!==null?(x=x.index,x<y?(v.flags|=2,y):x):(v.flags|=2,y)):(v.flags|=1048576,y)}function o(v){return t&&v.alternate===null&&(v.flags|=2),v}function a(v,y,x,S){return y===null||y.tag!==6?(y=zh(x,v.mode,S),y.return=v,y):(y=r(y,x),y.return=v,y)}function l(v,y,x,S){var w=x.type;return w===go?u(v,y,x.props.children,S,x.key):y!==null&&(y.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Sr&&M0(w)===y.type)?(S=r(y,x.props),S.ref=Ma(v,y,x),S.return=v,S):(S=dd(x.type,x.key,x.props,null,v.mode,S),S.ref=Ma(v,y,x),S.return=v,S)}function d(v,y,x,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=Bh(x,v.mode,S),y.return=v,y):(y=r(y,x.children||[]),y.return=v,y)}function u(v,y,x,S,w){return y===null||y.tag!==7?(y=Os(x,v.mode,S,w),y.return=v,y):(y=r(y,x),y.return=v,y)}function h(v,y,x){if(typeof y=="string"&&y!==""||typeof y=="number")return y=zh(""+y,v.mode,x),y.return=v,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Sl:return x=dd(y.type,y.key,y.props,null,v.mode,x),x.ref=Ma(v,null,y),x.return=v,x;case mo:return y=Bh(y,v.mode,x),y.return=v,y;case Sr:var S=y._init;return h(v,S(y._payload),x)}if(Qa(y)||ja(y))return y=Os(y,v.mode,x,null),y.return=v,y;Al(v,y)}return null}function p(v,y,x,S){var w=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return w!==null?null:a(v,y,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Sl:return x.key===w?l(v,y,x,S):null;case mo:return x.key===w?d(v,y,x,S):null;case Sr:return w=x._init,p(v,y,w(x._payload),S)}if(Qa(x)||ja(x))return w!==null?null:u(v,y,x,S,null);Al(v,x)}return null}function g(v,y,x,S,w){if(typeof S=="string"&&S!==""||typeof S=="number")return v=v.get(x)||null,a(y,v,""+S,w);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Sl:return v=v.get(S.key===null?x:S.key)||null,l(y,v,S,w);case mo:return v=v.get(S.key===null?x:S.key)||null,d(y,v,S,w);case Sr:var C=S._init;return g(v,y,x,C(S._payload),w)}if(Qa(S)||ja(S))return v=v.get(x)||null,u(y,v,S,w,null);Al(y,S)}return null}function b(v,y,x,S){for(var w=null,C=null,R=y,P=y=0,N=null;R!==null&&P<x.length;P++){R.index>P?(N=R,R=null):N=R.sibling;var I=p(v,R,x[P],S);if(I===null){R===null&&(R=N);break}t&&R&&I.alternate===null&&e(v,R),y=s(I,y,P),C===null?w=I:C.sibling=I,C=I,R=N}if(P===x.length)return n(v,R),Ze&&ps(v,P),w;if(R===null){for(;P<x.length;P++)R=h(v,x[P],S),R!==null&&(y=s(R,y,P),C===null?w=R:C.sibling=R,C=R);return Ze&&ps(v,P),w}for(R=i(v,R);P<x.length;P++)N=g(R,v,P,x[P],S),N!==null&&(t&&N.alternate!==null&&R.delete(N.key===null?P:N.key),y=s(N,y,P),C===null?w=N:C.sibling=N,C=N);return t&&R.forEach(function(L){return e(v,L)}),Ze&&ps(v,P),w}function m(v,y,x,S){var w=ja(x);if(typeof w!="function")throw Error(H(150));if(x=w.call(x),x==null)throw Error(H(151));for(var C=w=null,R=y,P=y=0,N=null,I=x.next();R!==null&&!I.done;P++,I=x.next()){R.index>P?(N=R,R=null):N=R.sibling;var L=p(v,R,I.value,S);if(L===null){R===null&&(R=N);break}t&&R&&L.alternate===null&&e(v,R),y=s(L,y,P),C===null?w=L:C.sibling=L,C=L,R=N}if(I.done)return n(v,R),Ze&&ps(v,P),w;if(R===null){for(;!I.done;P++,I=x.next())I=h(v,I.value,S),I!==null&&(y=s(I,y,P),C===null?w=I:C.sibling=I,C=I);return Ze&&ps(v,P),w}for(R=i(v,R);!I.done;P++,I=x.next())I=g(R,v,P,I.value,S),I!==null&&(t&&I.alternate!==null&&R.delete(I.key===null?P:I.key),y=s(I,y,P),C===null?w=I:C.sibling=I,C=I);return t&&R.forEach(function(j){return e(v,j)}),Ze&&ps(v,P),w}function k(v,y,x,S){if(typeof x=="object"&&x!==null&&x.type===go&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Sl:e:{for(var w=x.key,C=y;C!==null;){if(C.key===w){if(w=x.type,w===go){if(C.tag===7){n(v,C.sibling),y=r(C,x.props.children),y.return=v,v=y;break e}}else if(C.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Sr&&M0(w)===C.type){n(v,C.sibling),y=r(C,x.props),y.ref=Ma(v,C,x),y.return=v,v=y;break e}n(v,C);break}else e(v,C);C=C.sibling}x.type===go?(y=Os(x.props.children,v.mode,S,x.key),y.return=v,v=y):(S=dd(x.type,x.key,x.props,null,v.mode,S),S.ref=Ma(v,y,x),S.return=v,v=S)}return o(v);case mo:e:{for(C=x.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(v,y.sibling),y=r(y,x.children||[]),y.return=v,v=y;break e}else{n(v,y);break}else e(v,y);y=y.sibling}y=Bh(x,v.mode,S),y.return=v,v=y}return o(v);case Sr:return C=x._init,k(v,y,C(x._payload),S)}if(Qa(x))return b(v,y,x,S);if(ja(x))return m(v,y,x,S);Al(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(v,y.sibling),y=r(y,x),y.return=v,v=y):(n(v,y),y=zh(x,v.mode,S),y.return=v,v=y),o(v)):n(v,y)}return k}var fa=fS(!0),pS=fS(!1),Gd=as(null),Qd=null,Co=null,lg=null;function dg(){lg=Co=Qd=null}function ug(t){var e=Gd.current;Ye(Gd),t._currentValue=e}function cp(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function Lo(t,e){Qd=t,lg=Co=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(sn=!0),t.firstContext=null)}function Ln(t){var e=t._currentValue;if(lg!==t)if(t={context:t,memoizedValue:e,next:null},Co===null){if(Qd===null)throw Error(H(308));Co=t,Qd.dependencies={lanes:0,firstContext:t}}else Co=Co.next=t;return e}var Ss=null;function hg(t){Ss===null?Ss=[t]:Ss.push(t)}function mS(t,e,n,i){var r=e.interleaved;return r===null?(n.next=n,hg(e)):(n.next=r.next,r.next=n),e.interleaved=n,er(t,i)}function er(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var wr=!1;function fg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function gS(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ji(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Kr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,je&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,er(t,n)}return r=i.interleaved,r===null?(e.next=e,hg(i)):(e.next=r.next,r.next=e),i.interleaved=e,er(t,n)}function rd(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,Xm(t,n)}}function U0(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?r=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?r=s=e:s=s.next=e}else r=s=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Jd(t,e,n,i){var r=t.updateQueue;wr=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,d=l.next;l.next=null,o===null?s=d:o.next=d,o=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=d:a.next=d,u.lastBaseUpdate=l))}if(s!==null){var h=r.baseState;o=0,u=d=l=null,a=s;do{var p=a.lane,g=a.eventTime;if((i&p)===p){u!==null&&(u=u.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var b=t,m=a;switch(p=e,g=n,m.tag){case 1:if(b=m.payload,typeof b=="function"){h=b.call(g,h,p);break e}h=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=m.payload,p=typeof b=="function"?b.call(g,h,p):b,p==null)break e;h=st({},h,p);break e;case 2:wr=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,p=r.effects,p===null?r.effects=[a]:p.push(a))}else g={eventTime:g,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(d=u=g,l=h):u=u.next=g,o|=p;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;p=a,a=p.next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}while(!0);if(u===null&&(l=h),r.baseState=l,r.firstBaseUpdate=d,r.lastBaseUpdate=u,e=r.shared.interleaved,e!==null){r=e;do o|=r.lane,r=r.next;while(r!==e)}else s===null&&(r.shared.lanes=0);Vs|=o,t.lanes=o,t.memoizedState=h}}function F0(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var i=t[e],r=i.callback;if(r!==null){if(i.callback=null,i=n,typeof r!="function")throw Error(H(191,r));r.call(i)}}}var pl={},ki=as(pl),Pc=as(pl),Rc=as(pl);function ws(t){if(t===pl)throw Error(H(174));return t}function pg(t,e){switch(Ke(Rc,e),Ke(Pc,t),Ke(ki,pl),t=e.nodeType,t){case 9:case 11:e=(e
vendor: 6,847 bytes, line 39
39=e.documentElement)?e.namespaceURI:Bf(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Bf(e,t)}Ye(ki),Ke(ki,e)}function pa(){Ye(ki),Ye(Pc),Ye(Rc)}function vS(t){ws(Rc.current);var e=ws(ki.current),n=Bf(e,t.type);e!==n&&(Ke(Pc,t),Ke(ki,n))}function mg(t){Pc.current===t&&(Ye(ki),Ye(Pc))}var it=as(0);function Yd(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Dh=[];function gg(){for(var t=0;t<Dh.length;t++)Dh[t]._workInProgressVersionPrimary=null;Dh.length=0}var sd=sr.ReactCurrentDispatcher,Lh=sr.ReactCurrentBatchConfig,Fs=0,rt=null,bt=null,wt=null,Xd=!1,ac=!1,Nc=0,QR=0;function Dt(){throw Error(H(321))}function vg(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!ti(t[n],e[n]))return!1;return!0}function yg(t,e,n,i,r,s){if(Fs=s,rt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,sd.current=t===null||t.memoizedState===null?ZR:eN,t=n(i,r),ac){s=0;do{if(ac=!1,Nc=0,25<=s)throw Error(H(301));s+=1,wt=bt=null,e.updateQueue=null,sd.current=tN,t=n(i,r)}while(ac)}if(sd.current=Zd,e=bt!==null&&bt.next!==null,Fs=0,wt=bt=rt=null,Xd=!1,e)throw Error(H(300));return t}function bg(){var t=Nc!==0;return Nc=0,t}function li(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wt===null?rt.memoizedState=wt=t:wt=wt.next=t,wt}function Mn(){if(bt===null){var t=rt.alternate;t=t!==null?t.memoizedState:null}else t=bt.next;var e=wt===null?rt.memoizedState:wt.next;if(e!==null)wt=e,bt=t;else{if(t===null)throw Error(H(310));bt=t,t={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},wt===null?rt.memoizedState=wt=t:wt=wt.next=t}return wt}function Ic(t,e){return typeof e=="function"?e(t):e}function Mh(t){var e=Mn(),n=e.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=t;var i=bt,r=i.baseQueue,s=n.pending;if(s!==null){if(r!==null){var o=r.next;r.next=s.next,s.next=o}i.baseQueue=r=s,n.pending=null}if(r!==null){s=r.next,i=i.baseState;var a=o=null,l=null,d=s;do{var u=d.lane;if((Fs&u)===u)l!==null&&(l=l.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),i=d.hasEagerState?d.eagerState:t(i,d.action);else{var h={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};l===null?(a=l=h,o=i):l=l.next=h,rt.lanes|=u,Vs|=u}d=d.next}while(d!==null&&d!==s);l===null?o=i:l.next=a,ti(i,e.memoizedState)||(sn=!0),e.memoizedState=i,e.baseState=o,e.baseQueue=l,n.lastRenderedState=i}if(t=n.interleaved,t!==null){r=t;do s=r.lane,rt.lanes|=s,Vs|=s,r=r.next;while(r!==t)}else r===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Uh(t){var e=Mn(),n=e.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do s=t(s,o.action),o=o.next;while(o!==r);ti(s,e.memoizedState)||(sn=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function yS(){}function bS(t,e){var n=rt,i=Mn(),r=e(),s=!ti(i.memoizedState,r);if(s&&(i.memoizedState=r,sn=!0),i=i.queue,xg(SS.bind(null,n,i,t),[t]),i.getSnapshot!==e||s||wt!==null&&wt.memoizedState.tag&1){if(n.flags|=2048,jc(9,kS.bind(null,n,i,r,e),void 0,null),_t===null)throw Error(H(349));Fs&30||xS(n,e,r)}return r}function xS(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=rt.updateQueue,e===null?(e={lastEffect:null,stores:null},rt.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function kS(t,e,n,i){e.value=n,e.getSnapshot=i,wS(e)&&CS(t)}function SS(t,e,n){return n(function(){wS(e)&&CS(t)})}function wS(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!ti(t,n)}catch{return!0}}function CS(t){var e=er(t,1);e!==null&&ei(e,t,1,-1)}function V0(t){var e=li();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ic,lastRenderedState:t},e.queue=t,t=t.dispatch=XR.bind(null,rt,t),[e.memoizedState,t]}function jc(t,e,n,i){return t={tag:t,create:e,destroy:n,deps:i,next:null},e=rt.updateQueue,e===null?(e={lastEffect:null,stores:null},rt.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t)),t}function TS(){return Mn().memoizedState}function od(t,e,n,i){var r=li();rt.flags|=t,r.memoizedState=jc(1|e,n,void 0,i===void 0?null:i)}function Du(t,e,n,i){var r=Mn();i=i===void 0?null:i;var s=void 0;if(bt!==null){var o=bt.memoizedState;if(s=o.destroy,i!==null&&vg(i,o.deps)){r.memoizedState=jc(e,n,s,i);return}}rt.flags|=t,r.memoizedState=jc(1|e,n,s,i)}function z0(t,e){return od(8390656,8,t,e)}function xg(t,e){return Du(2048,8,t,e)}function _S(t,e){return Du(4,2,t,e)}function ES(t,e){return Du(4,4,t,e)}function PS(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function RS(t,e,n){return n=n!=null?n.concat([t]):null,Du(4,4,PS.bind(null,e,t),n)}function kg(){}function NS(t,e){var n=Mn();e=e===void 0?null:e;var i=n.memoizedState;return i!==null&&e!==null&&vg(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function IS(t,e){var n=Mn();e=e===void 0?null:e;var i=n.memoizedState;return i!==null&&e!==null&&vg(e,i[1])?i[0]:(t=t(),n.memoizedState=[t,e],t)}function jS(t,e,n){return Fs&21?(ti(n,e)||(n=Mk(),rt.lanes|=n,Vs|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,sn=!0),t.memoizedState=n)}function JR(t,e){var n=Ve;Ve=n!==0&&4>n?n:4,t(!0);var i=Lh.transition;Lh.transition={};try{t(!1),e()}finally{Ve=n,Lh.transition=i}}function AS(){return Mn().memoizedState}function YR(t,e,n){var i=Qr(t);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},OS(t))DS(e,n);else if(n=mS(t,e,n,i),n!==null){var r=Gt();ei(n,t,i,r),LS(n,e,i)}}function XR(t,e,n){var i=Qr(t),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(OS(t))DS(e,r);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,n);if(r.hasEagerState=!0,r.eagerState=a,ti(a,o)){var l=e.interleaved;l===null?(r.next=r,hg(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}n=mS(t,e,r,i),n!==null&&(r=Gt(),ei(n,t,i,r),LS(n,e,i))}}function OS(t){var e=t.alternate;return t===rt||e!==null&&e===rt}function DS(t,e){ac=Xd=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function LS(t,e,n){if(n&4194240){var i=e.lanes;
vendor: 8,470 bytes, lines 39-41
39i&=t.pendingLanes,n|=i,e.lanes=n,Xm(t,n)}}var Zd={readContext:Ln,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useInsertionEffect:Dt,useLayoutEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useMutableSource:Dt,useSyncExternalStore:Dt,useId:Dt,unstable_isNewReconciler:!1},ZR={readContext:Ln,useCallback:function(t,e){return li().memoizedState=[t,e===void 0?null:e],t},useContext:Ln,useEffect:z0,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,od(4194308,4,PS.bind(null,e,t),n)},useLayoutEffect:function(t,e){return od(4194308,4,t,e)},useInsertionEffect:function(t,e){return od(4,2,t,e)},useMemo:function(t,e){var n=li();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var i=li();return e=n!==void 0?n(e):e,i.memoizedState=i.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},i.queue=t,t=t.dispatch=YR.bind(null,rt,t),[i.memoizedState,t]},useRef:function(t){var e=li();return t={current:t},e.memoizedState=t},useState:V0,useDebugValue:kg,useDeferredValue:function(t){return li().memoizedState=t},useTransition:function(){var t=V0(!1),e=t[0];return t=JR.bind(null,t[1]),li().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var i=rt,r=li();if(Ze){if(n===void 0)throw Error(H(407));n=n()}else{if(n=e(),_t===null)throw Error(H(349));Fs&30||xS(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,z0(SS.bind(null,i,s,t),[t]),i.flags|=2048,jc(9,kS.bind(null,i,s,n,e),void 0,null),n},useId:function(){var t=li(),e=_t.identifierPrefix;if(Ze){var n=Ki,i=qi;n=(i&~(1<<32-Zn(i)-1)).toString(32)+n,e=":"+e+"R"+n,n=Nc++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=QR++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},eN={readContext:Ln,useCallback:NS,useContext:Ln,useEffect:xg,useImperativeHandle:RS,useInsertionEffect:_S,useLayoutEffect:ES,useMemo:IS,useReducer:Mh,useRef:TS,useState:function(){return Mh(Ic)},useDebugValue:kg,useDeferredValue:function(t){var e=Mn();return jS(e,bt.memoizedState,t)},useTransition:function(){var t=Mh(Ic)[0],e=Mn().memoizedState;return[t,e]},useMutableSource:yS,useSyncExternalStore:bS,useId:AS,unstable_isNewReconciler:!1},tN={readContext:Ln,useCallback:NS,useContext:Ln,useEffect:xg,useImperativeHandle:RS,useInsertionEffect:_S,useLayoutEffect:ES,useMemo:IS,useReducer:Uh,useRef:TS,useState:function(){return Uh(Ic)},useDebugValue:kg,useDeferredValue:function(t){var e=Mn();return bt===null?e.memoizedState=t:jS(e,bt.memoizedState,t)},useTransition:function(){var t=Uh(Ic)[0],e=Mn().memoizedState;return[t,e]},useMutableSource:yS,useSyncExternalStore:bS,useId:AS,unstable_isNewReconciler:!1};function Bn(t,e){if(t&&t.defaultProps){e=st({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function lp(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:st({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Lu={isMounted:function(t){return(t=t._reactInternals)?Zs(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var i=Gt(),r=Qr(t),s=Ji(i,r);s.payload=e,n!=null&&(s.callback=n),e=Kr(t,s,r),e!==null&&(ei(e,t,r,i),rd(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=Gt(),r=Qr(t),s=Ji(i,r);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=Kr(t,s,r),e!==null&&(ei(e,t,r,i),rd(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=Gt(),i=Qr(t),r=Ji(n,i);r.tag=2,e!=null&&(r.callback=e),e=Kr(t,r,i),e!==null&&(ei(e,t,i,n),rd(e,t,i))}};function B0(t,e,n,i,r,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,s,o):e.prototype&&e.prototype.isPureReactComponent?!Cc(n,i)||!Cc(r,s):!0}function MS(t,e,n){var i=!1,r=ts,s=e.contextType;return typeof s=="object"&&s!==null?s=Ln(s):(r=cn(e)?Ms:Bt.current,i=e.contextTypes,s=(i=i!=null)?ua(t,r):ts),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Lu,t.stateNode=e,e._reactInternals=t,i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=s),e}function W0(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&Lu.enqueueReplaceState(e,e.state,null)}function dp(t,e,n,i){var r=t.stateNode;r.props=n,r.state=t.memoizedState,r.refs={},fg(t);var s=e.contextType;typeof s=="object"&&s!==null?r.context=Ln(s):(s=cn(e)?Ms:Bt.current,r.context=ua(t,s)),r.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(lp(t,e,s,n),r.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(e=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),e!==r.state&&Lu.enqueueReplaceState(r,r.state,null),Jd(t,n,r,i),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308)}function ma(t,e){try{var n="",i=e;do n+=RP(i),i=i.return;while(i);var r=n}catch(s){r=` 40Error generating stack: `+s.message+` 41`+s.stack}return{value:t,source:e,stack:r,digest:null}}function Fh(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function up(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var nN=typeof WeakMap=="function"?WeakMap:Map;function US(t,e,n){n=Ji(-1,n),n.tag=3,n.payload={element:null};var i=e.value;return n.callback=function(){tu||(tu=!0,kp=i),up(t,e)},n}function FS(t,e,n){n=Ji(-1,n),n.tag=3;var i=t.type.getDerivedStateFromError;if(typeof i=="function"){var r=e.value;n.payload=function(){return i(r)},n.callback=function(){up(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){up(t,e),typeof i!="function"&&(Gr===null?Gr=new Set([this]):Gr.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function H0(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new nN;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(r.add(n),t=gN.bind(null,t,e,n),e.then(t,t))}function $0(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function q0(t,e,n,i,r){return t.mode&1?(t.flags|=65536,t.lanes=r,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Ji(-1,1),e.tag=2,Kr(n,e,1))),n.lanes|=1),t)}var iN=sr.ReactCurrentOwner,sn=!1;function Kt(t,e,n,i){e.child=t===null?pS(e,null,n,i):fa(e,t.child,n,i)}function K0(t,e,n,i,r){n=n.render;var s=e.ref;return Lo(e,r),i=yg(t,e,n,i,s,r),n=bg(),t!==null&&!sn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,tr(t,e,r)):(Ze&&n&&og(e),e.flags|=1,Kt(t,e,i,r),e.child)}function G0(t,e,n,i,r){if(t===null){var s=n.type;return typeof s=="function"&&!Rg(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,VS(t,e,s,i,r)):(t=dd(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&r)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Cc,n(o,i)&&t.ref===e.ref)return tr(t,e,r)}return e.flags|=1,t=Jr(s,i),t.ref=e.ref,t.return=e,e.child=t}function VS(t,e,n,i,r){if(t!==null){var s=t.memoizedProps;if(Cc(s,i)&&t.ref===e.ref)if(sn=!1,e.pendingProps=i=s,(t.lanes&r)!==0)t.flags&131072&&(sn=!0);else return e.lanes=t.lanes,tr(t,e,r)}return hp(t,e,n,i,r)}function zS(t,e,n){var i=e.pendingProps,r=i.children,s=t!==null?t.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ke(_o,pn),pn|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Ke(_o,pn),pn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:n,Ke(_o,pn),pn|=i}else s!==null?(i=s.baseLanes|n,e.memoizedState=null):i=n,Ke(_o,pn),pn|=i;return Kt(t,e,r,n),e.child}function BS(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}
vendor: 5,244 bytes, line 41
41function hp(t,e,n,i,r){var s=cn(n)?Ms:Bt.current;return s=ua(e,s),Lo(e,r),n=yg(t,e,n,i,s,r),i=bg(),t!==null&&!sn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,tr(t,e,r)):(Ze&&i&&og(e),e.flags|=1,Kt(t,e,n,r),e.child)}function Q0(t,e,n,i,r){if(cn(n)){var s=!0;$d(e)}else s=!1;if(Lo(e,r),e.stateNode===null)ad(t,e),MS(e,n,i),dp(e,n,i,r),i=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,d=n.contextType;typeof d=="object"&&d!==null?d=Ln(d):(d=cn(n)?Ms:Bt.current,d=ua(e,d));var u=n.getDerivedStateFromProps,h=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==i||l!==d)&&W0(e,o,i,d),wr=!1;var p=e.memoizedState;o.state=p,Jd(e,i,o,r),l=e.memoizedState,a!==i||p!==l||an.current||wr?(typeof u=="function"&&(lp(e,n,u,i),l=e.memoizedState),(a=wr||B0(e,n,a,i,p,l,d))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),o.props=i,o.state=l,o.context=d,i=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{o=e.stateNode,gS(t,e),a=e.memoizedProps,d=e.type===e.elementType?a:Bn(e.type,a),o.props=d,h=e.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Ln(l):(l=cn(n)?Ms:Bt.current,l=ua(e,l));var g=n.getDerivedStateFromProps;(u=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||p!==l)&&W0(e,o,i,l),wr=!1,p=e.memoizedState,o.state=p,Jd(e,i,o,r);var b=e.memoizedState;a!==h||p!==b||an.current||wr?(typeof g=="function"&&(lp(e,n,g,i),b=e.memoizedState),(d=wr||B0(e,n,d,i,p,b,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(i,b,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(i,b,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=b),o.props=i,o.state=b,o.context=l,i=d):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),i=!1)}return fp(t,e,n,i,s,r)}function fp(t,e,n,i,r,s){BS(t,e);var o=(e.flags&128)!==0;if(!i&&!o)return r&&O0(e,n,!1),tr(t,e,s);i=e.stateNode,iN.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,t!==null&&o?(e.child=fa(e,t.child,null,s),e.child=fa(e,null,a,s)):Kt(t,e,a,s),e.memoizedState=i.state,r&&O0(e,n,!0),e.child}function WS(t){var e=t.stateNode;e.pendingContext?A0(t,e.pendingContext,e.pendingContext!==e.context):e.context&&A0(t,e.context,!1),pg(t,e.containerInfo)}function J0(t,e,n,i,r){return ha(),cg(r),e.flags|=256,Kt(t,e,n,i),e.child}var pp={dehydrated:null,treeContext:null,retryLane:0};function mp(t){return{baseLanes:t,cachePool:null,transitions:null}}function HS(t,e,n){var i=e.pendingProps,r=it.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(r&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(r|=1),Ke(it,r&1),t===null)return ap(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=i.children,t=i.fallback,s?(i=e.mode,s=e.child,o={mode:"hidden",children:o},!(i&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Fu(o,i,0,null),t=Os(t,i,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=mp(n),e.memoizedState=pp,t):Sg(e,o));if(r=t.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return rN(t,e,o,i,a,r,n);if(s){s=i.fallback,o=e.mode,r=t.child,a=r.sibling;var l={mode:"hidden",children:i.children};return!(o&1)&&e.child!==r?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=Jr(r,l),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?s=Jr(a,s):(s=Os(s,o,n,null),s.flags|=2),s.return=e,i.return=e,i.sibling=s,e.child=i,i=s,s=e.child,o=t.child.memoizedState,o=o===null?mp(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~n,e.memoizedState=pp,i}return s=t.child,t=s.sibling,i=Jr(s,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=n),i.return=e,i.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=i,e.memoizedState=null,i}function Sg(t,e){return e=Fu({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Ol(t,e,n,i){return i!==null&&cg(i),fa(e,t.child,null,n),t=Sg(e,e.pen
vendor: 5,152 bytes, line 41
41dingProps.children),t.flags|=2,e.memoizedState=null,t}function rN(t,e,n,i,r,s,o){if(n)return e.flags&256?(e.flags&=-257,i=Fh(Error(H(422))),Ol(t,e,o,i)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=Fu({mode:"visible",children:i.children},r,0,null),s=Os(s,r,o,null),s.flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,e.mode&1&&fa(e,t.child,null,o),e.child.memoizedState=mp(o),e.memoizedState=pp,s);if(!(e.mode&1))return Ol(t,e,o,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,s=Error(H(419)),i=Fh(s,i,void 0),Ol(t,e,o,i)}if(a=(o&t.childLanes)!==0,sn||a){if(i=_t,i!==null){switch(o&-o){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}r=r&(i.suspendedLanes|o)?0:r,r!==0&&r!==s.retryLane&&(s.retryLane=r,er(t,r),ei(i,t,r,-1))}return Pg(),i=Fh(Error(H(421))),Ol(t,e,o,i)}return r.data==="$?"?(e.flags|=128,e.child=t.child,e=vN.bind(null,t),r._reactRetry=e,null):(t=s.treeContext,vn=qr(r.nextSibling),bn=e,Ze=!0,qn=null,t!==null&&(In[jn++]=qi,In[jn++]=Ki,In[jn++]=Us,qi=t.id,Ki=t.overflow,Us=e),e=Sg(e,i.children),e.flags|=4096,e)}function Y0(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),cp(t.return,e,n)}function Vh(t,e,n,i,r){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function $S(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(Kt(t,e,i.children,n),i=it.current,i&2)i=i&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Y0(t,n,e);else if(t.tag===19)Y0(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}if(Ke(it,i),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&Yd(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Vh(e,!1,r,n,s);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&Yd(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Vh(e,!0,n,null,s);break;case"together":Vh(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ad(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function tr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Vs|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(H(153));if(e.child!==null){for(t=e.child,n=Jr(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Jr(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function sN(t,e,n){switch(e.tag){case 3:WS(e),ha();break;case 5:vS(e);break;case 1:cn(e.type)&&$d(e);break;case 4:pg(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,r=e.memoizedProps.value;Ke(Gd,i._currentValue),i._currentValue=r;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(Ke(it,it.current&1),e.flags|=128,null):n&e.child.childLanes?HS(t,e,n):(Ke(it,it.current&1),t=tr(t,e,n),t!==null?t.sibling:null);Ke(it,it.current&1);break;case 19:if(i=(n&e.childLanes)!==0,t.flags&128){if(i)return $S(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Ke(it,it.current),i)break;return null;case 22:case 23:return e.lanes=0,zS(t,e,n)}return tr(t,e,n)}var qS,gp,KS,GS;qS=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};gp=function(){};KS=function(t,e,n,i){var r=t.memoizedProps;if(r!==i){t=e.stateNode,ws(ki.current);var s=null;switch(n){case"input":r=Uf(t,r),i=Uf(t,i),s=[];break;case"select":r=st({},r,{value:void 0}),i=st({},i,{value:void 0}),s=[];break;case"textarea":r=zf(t,r),i=zf(t,i),s=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(t.onclick=Wd)}Wf(n,i);var o;n=null;for(d in r)if(!i.hasOwnProperty(d)&&r.hasOwnProperty(d)&&r[d]!=null)if(d==="style"){var a=r[d];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(vc.hasOwnProperty(d)?s||(s=[]):(s=s||[]).push(d,null));for(d in i){var l=i[d];if(a=r!=null?r[d]:void 0,i.hasOwnProperty(d)&&l!==a&&(l!=null||a!=null))if(d==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}
vendor: 5,029 bytes, line 41
41else n||(s||(s=[]),s.push(d,n)),n=l;else d==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(d,l)):d==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(d,""+l):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(vc.hasOwnProperty(d)?(l!=null&&d==="onScroll"&&Qe("scroll",t),s||a===l||(s=[])):(s=s||[]).push(d,l))}n&&(s=s||[]).push("style",n);var d=s;(e.updateQueue=d)&&(e.flags|=4)}};GS=function(t,e,n,i){n!==i&&(e.flags|=4)};function Ua(t,e){if(!Ze)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Lt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function oN(t,e,n){var i=e.pendingProps;switch(ag(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(e),null;case 1:return cn(e.type)&&Hd(),Lt(e),null;case 3:return i=e.stateNode,pa(),Ye(an),Ye(Bt),gg(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(t===null||t.child===null)&&(jl(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,qn!==null&&(Cp(qn),qn=null))),gp(t,e),Lt(e),null;case 5:mg(e);var r=ws(Rc.current);if(n=e.type,t!==null&&e.stateNode!=null)KS(t,e,n,i,r),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(H(166));return Lt(e),null}if(t=ws(ki.current),jl(e)){i=e.stateNode,n=e.type;var s=e.memoizedProps;switch(i[gi]=e,i[Ec]=s,t=(e.mode&1)!==0,n){case"dialog":Qe("cancel",i),Qe("close",i);break;case"iframe":case"object":case"embed":Qe("load",i);break;case"video":case"audio":for(r=0;r<Ya.length;r++)Qe(Ya[r],i);break;case"source":Qe("error",i);break;case"img":case"image":case"link":Qe("error",i),Qe("load",i);break;case"details":Qe("toggle",i);break;case"input":o0(i,s),Qe("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},Qe("invalid",i);break;case"textarea":c0(i,s),Qe("invalid",i)}Wf(n,s),r=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?i.textContent!==a&&(s.suppressHydrationWarning!==!0&&Il(i.textContent,a,t),r=["children",a]):typeof a=="number"&&i.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Il(i.textContent,a,t),r=["children",""+a]):vc.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Qe("scroll",i)}switch(n){case"input":wl(i),a0(i,s,!0);break;case"textarea":wl(i),l0(i);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(i.onclick=Wd)}i=r,e.updateQueue=i,i!==null&&(e.flags|=4)}else{o=r.nodeType===9?r:r.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Sk(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=o.createElement(n,{is:i.is}):(t=o.createElement(n),n==="select"&&(o=t,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):t=o.createElementNS(t,n),t[gi]=e,t[Ec]=i,qS(t,e,!1,!1),e.stateNode=t;e:{switch(o=Hf(n,i),n){case"dialog":Qe("cancel",t),Qe("close",t),r=i;break;case"iframe":case"object":case"embed":Qe("load",t),r=i;break;case"video":case"audio":for(r=0;r<Ya.length;r++)Qe(Ya[r],t);r=i;break;case"source":Qe("error",t),r=i;break;case"img":case"image":case"link":Qe("error",t),Qe("load",t),r=i;break;case"details":Qe("toggle",t),r=i;break;case"input":o0(t,i),r=Uf(t,i),Qe("invalid",t);break;case"option":r=i;break;case"select":t._wrapperState={wasMultiple:!!i.multiple},r=st({},i,{value:void 0}),Qe("invalid",t);break;case"textarea":c0(t,i),r=zf(t,i),Qe("invalid",t);break;default:r=i}Wf(n,r),a=r;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?Tk(t,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&wk(t,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&yc(t,l):typeof l=="number"&&yc(t,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(vc.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Qe("scroll",t):l!=null&&qm(t,s,l,o))}switch(n){case"input":wl(t),a0(t,i,!1);break;case"textarea":wl(t),l0(t);break;case"option":i.value!=null&&t.setAttribute("value",""+es(i.value));break;case"select":t.multiple=!!i.multiple,s=i.value,s!=null?jo(t,!!i.multiple,s,!1):i.defaultValue!=null&&jo(t,!!i.multiple,i.defaultValue,!0);break;default:typeof r.onClick=="function"&&(t.onclick=Wd)}switch(n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}
vendor: 30,002 bytes, line 41
41return Lt(e),null;case 6:if(t&&e.stateNode!=null)GS(t,e,t.memoizedProps,i);else{if(typeof i!="string"&&e.stateNode===null)throw Error(H(166));if(n=ws(Rc.current),ws(ki.current),jl(e)){if(i=e.stateNode,n=e.memoizedProps,i[gi]=e,(s=i.nodeValue!==n)&&(t=bn,t!==null))switch(t.tag){case 3:Il(i.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Il(i.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[gi]=e,e.stateNode=i}return Lt(e),null;case 13:if(Ye(it),i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Ze&&vn!==null&&e.mode&1&&!(e.flags&128))hS(),ha(),e.flags|=98560,s=!1;else if(s=jl(e),i!==null&&i.dehydrated!==null){if(t===null){if(!s)throw Error(H(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(H(317));s[gi]=e}else ha(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Lt(e),s=!1}else qn!==null&&(Cp(qn),qn=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(i=i!==null,i!==(t!==null&&t.memoizedState!==null)&&i&&(e.child.flags|=8192,e.mode&1&&(t===null||it.current&1?kt===0&&(kt=3):Pg())),e.updateQueue!==null&&(e.flags|=4),Lt(e),null);case 4:return pa(),gp(t,e),t===null&&Tc(e.stateNode.containerInfo),Lt(e),null;case 10:return ug(e.type._context),Lt(e),null;case 17:return cn(e.type)&&Hd(),Lt(e),null;case 19:if(Ye(it),s=e.memoizedState,s===null)return Lt(e),null;if(i=(e.flags&128)!==0,o=s.rendering,o===null)if(i)Ua(s,!1);else{if(kt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Yd(t),o!==null){for(e.flags|=128,Ua(s,!1),i=o.updateQueue,i!==null&&(e.updateQueue=i,e.flags|=4),e.subtreeFlags=0,i=n,n=e.child;n!==null;)s=n,t=i,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return Ke(it,it.current&1|2),e.child}t=t.sibling}s.tail!==null&&ht()>ga&&(e.flags|=128,i=!0,Ua(s,!1),e.lanes=4194304)}else{if(!i)if(t=Yd(o),t!==null){if(e.flags|=128,i=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Ua(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ze)return Lt(e),null}else 2*ht()-s.renderingStartTime>ga&&n!==1073741824&&(e.flags|=128,i=!0,Ua(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ht(),e.sibling=null,n=it.current,Ke(it,i?n&1|2:n&1),e):(Lt(e),null);case 22:case 23:return Eg(),i=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?pn&1073741824&&(Lt(e),e.subtreeFlags&6&&(e.flags|=8192)):Lt(e),null;case 24:return null;case 25:return null}throw Error(H(156,e.tag))}function aN(t,e){switch(ag(e),e.tag){case 1:return cn(e.type)&&Hd(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return pa(),Ye(an),Ye(Bt),gg(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return mg(e),null;case 13:if(Ye(it),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(H(340));ha()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ye(it),null;case 4:return pa(),null;case 10:return ug(e.type._context),null;case 22:case 23:return Eg(),null;case 24:return null;default:return null}}var Dl=!1,Ft=!1,cN=typeof WeakSet=="function"?WeakSet:Set,ie=null;function To(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){lt(t,e,i)}else n.current=null}function vp(t,e,n){try{n()}catch(i){lt(t,e,i)}}var X0=!1;function lN(t,e){if(ep=Vd,t=Zk(),sg(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,d=0,u=0,h=t,p=null;t:for(;;){for(var g;h!==n||r!==0&&h.nodeType!==3||(a=o+r),h!==s||i!==0&&h.nodeType!==3||(l=o+i),h.nodeType===3&&(o+=h.nodeValue.length),(g=h.firstChild)!==null;)p=h,h=g;for(;;){if(h===t)break t;if(p===n&&++d===r&&(a=o),p===s&&++u===i&&(l=o),(g=h.nextSibling)!==null)break;h=p,p=h.parentNode}h=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(tp={focusedElem:t,selectionRange:n},Vd=!1,ie=e;ie!==null;)if(e=ie,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ie=t;else for(;ie!==null;){e=ie;try{var b=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var m=b.memoizedProps,k=b.memoizedState,v=e.stateNode,y=v.getSnapshotBeforeUpdate(e.elementType===e.type?m:Bn(e.type,m),k);v.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){lt(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,ie=t;break}ie=e.return}return b=X0,X0=!1,b}function cc(t,e,n){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&t)===t){var s=r.destroy;r.destroy=void 0,s!==void 0&&vp(e,n,s)}r=r.next}while(r!==i)}}function Mu(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==e)}}function yp(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function QS(t){var e=t.alternate;e!==null&&(t.alternate=null,QS(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[gi],delete e[Ec],delete e[rp],delete e[$R],delete e[qR])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function JS(t){return t.tag===5||t.tag===3||t.tag===4}function Z0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||JS(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function bp(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Wd));else if(i!==4&&(t=t.child,t!==null))for(bp(t,e,n),t=t.sibling;t!==null;)bp(t,e,n),t=t.sibling}function xp(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(xp(t,e,n),t=t.sibling;t!==null;)xp(t,e,n),t=t.sibling}var Rt=null,Hn=!1;function ur(t,e,n){for(n=n.child;n!==null;)YS(t,e,n),n=n.sibling}function YS(t,e,n){if(xi&&typeof xi.onCommitFiberUnmount=="function")try{xi.onCommitFiberUnmount(Ru,n)}catch{}switch(n.tag){case 5:Ft||To(n,e);case 6:var i=Rt,r=Hn;Rt=null,ur(t,e,n),Rt=i,Hn=r,Rt!==null&&(Hn?(t=Rt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Rt.removeChild(n.stateNode));break;case 18:Rt!==null&&(Hn?(t=Rt,n=n.stateNode,t.nodeType===8?Ah(t.parentNode,n):t.nodeType===1&&Ah(t,n),Sc(t)):Ah(Rt,n.stateNode));break;case 4:i=Rt,r=Hn,Rt=n.stateNode.containerInfo,Hn=!0,ur(t,e,n),Rt=i,Hn=r;break;case 0:case 11:case 14:case 15:if(!Ft&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var s=r,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&vp(n,e,o),r=r.next}while(r!==i)}ur(t,e,n);break;case 1:if(!Ft&&(To(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(a){lt(n,e,a)}ur(t,e,n);break;case 21:ur(t,e,n);break;case 22:n.mode&1?(Ft=(i=Ft)||n.memoizedState!==null,ur(t,e,n),Ft=i):ur(t,e,n);break;default:ur(t,e,n)}}function ey(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new cN),e.forEach(function(i){var r=yN.bind(null,t,i);n.has(i)||(n.add(i),i.then(r,r))})}}function Un(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i];try{var s=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Rt=a.stateNode,Hn=!1;break e;case 3:Rt=a.stateNode.containerInfo,Hn=!0;break e;case 4:Rt=a.stateNode.containerInfo,Hn=!0;break e}a=a.return}if(Rt===null)throw Error(H(160));YS(s,o,r),Rt=null,Hn=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(d){lt(r,e,d)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)XS(e,t),e=e.sibling}function XS(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Un(e,t),ai(t),i&4){try{cc(3,t,t.return),Mu(3,t)}catch(m){lt(t,t.return,m)}try{cc(5,t,t.return)}catch(m){lt(t,t.return,m)}}break;case 1:Un(e,t),ai(t),i&512&&n!==null&&To(n,n.return);break;case 5:if(Un(e,t),ai(t),i&512&&n!==null&&To(n,n.return),t.flags&32){var r=t.stateNode;try{yc(r,"")}catch(m){lt(t,t.return,m)}}if(i&4&&(r=t.stateNode,r!=null)){var s=t.memoizedProps,o=n!==null?n.memoizedProps:s,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&xk(r,s),Hf(a,o);var d=Hf(a,s);for(o=0;o<l.length;o+=2){var u=l[o],h=l[o+1];u==="style"?Tk(r,h):u==="dangerouslySetInnerHTML"?wk(r,h):u==="children"?yc(r,h):qm(r,u,h,d)}switch(a){case"input":Ff(r,s);break;case"textarea":kk(r,s);break;case"select":var p=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!s.multiple;var g=s.value;g!=null?jo(r,!!s.multiple,g,!1):p!==!!s.multiple&&(s.defaultValue!=null?jo(r,!!s.multiple,s.defaultValue,!0):jo(r,!!s.multiple,s.multiple?[]:"",!1))}r[Ec]=s}catch(m){lt(t,t.return,m)}}break;case 6:if(Un(e,t),ai(t),i&4){if(t.stateNode===null)throw Error(H(162));r=t.stateNode,s=t.memoizedProps;try{r.nodeValue=s}catch(m){lt(t,t.return,m)}}break;case 3:if(Un(e,t),ai(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Sc(e.containerInfo)}catch(m){lt(t,t.return,m)}break;case 4:Un(e,t),ai(t);break;case 13:Un(e,t),ai(t),r=t.child,r.flags&8192&&(s=r.memoizedState!==null,r.stateNode.isHidden=s,!s||r.alternate!==null&&r.alternate.memoizedState!==null||(Tg=ht())),i&4&&ey(t);break;case 22:if(u=n!==null&&n.memoizedState!==null,t.mode&1?(Ft=(d=Ft)||u,Un(e,t),Ft=d):Un(e,t),ai(t),i&8192){if(d=t.memoizedState!==null,(t.stateNode.isHidden=d)&&!u&&t.mode&1)for(ie=t,u=t.child;u!==null;){for(h=ie=u;ie!==null;){switch(p=ie,g=p.child,p.tag){case 0:case 11:case 14:case 15:cc(4,p,p.return);break;case 1:To(p,p.return);var b=p.stateNode;if(typeof b.componentWillUnmount=="function"){i=p,n=p.return;try{e=i,b.props=e.memoizedProps,b.state=e.memoizedState,b.componentWillUnmount()}catch(m){lt(i,n,m)}}break;case 5:To(p,p.return);break;case 22:if(p.memoizedState!==null){ny(h);continue}}g!==null?(g.return=p,ie=g):ny(h)}u=u.sibling}e:for(u=null,h=t;;){if(h.tag===5){if(u===null){u=h;try{r=h.stateNode,d?(s=r.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Ck("display",o))}catch(m){lt(t,t.return,m)}}}else if(h.tag===6){if(u===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(m){lt(t,t.return,m)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Un(e,t),ai(t),i&4&&ey(t);break;case 21:break;default:Un(e,t),ai(t)}}function ai(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(JS(n)){var i=n;break e}n=n.return}throw Error(H(160))}switch(i.tag){case 5:var r=i.stateNode;i.flags&32&&(yc(r,""),i.flags&=-33);var s=Z0(t);xp(t,s,r);break;case 3:case 4:var o=i.stateNode.containerInfo,a=Z0(t);bp(t,a,o);break;default:throw Error(H(161))}}catch(l){lt(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function dN(t,e,n){ie=t,ZS(t)}function ZS(t,e,n){for(var i=(t.mode&1)!==0;ie!==null;){var r=ie,s=r.child;if(r.tag===22&&i){var o=r.memoizedState!==null||Dl;if(!o){var a=r.alternate,l=a!==null&&a.memoizedState!==null||Ft;a=Dl;var d=Ft;if(Dl=o,(Ft=l)&&!d)for(ie=r;ie!==null;)o=ie,l=o.child,o.tag===22&&o.memoizedState!==null?iy(r):l!==null?(l.return=o,ie=l):iy(r);for(;s!==null;)ie=s,ZS(s),s=s.sibling;ie=r,Dl=a,Ft=d}ty(t)}else r.subtreeFlags&8772&&s!==null?(s.return=r,ie=s):ty(t)}}function ty(t){for(;ie!==null;){var e=ie;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Ft||Mu(5,e);break;case 1:var i=e.stateNode;if(e.flags&4&&!Ft)if(n===null)i.componentDidMount();else{var r=e.elementType===e.type?n.memoizedProps:Bn(e.type,n.memoizedProps);i.componentDidUpdate(r,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&F0(e,s,i);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}F0(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var d=e.alternate;if(d!==null){var u=d.memoizedState;if(u!==null){var h=u.dehydrated;h!==null&&Sc(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}Ft||e.flags&512&&yp(e)}catch(p){lt(e,e.return,p)}}if(e===t){ie=null;break}if(n=e.sibling,n!==null){n.return=e.return,ie=n;break}ie=e.return}}function ny(t){for(;ie!==null;){var e=ie;if(e===t){ie=null;break}var n=e.sibling;if(n!==null){n.return=e.return,ie=n;break}ie=e.return}}function iy(t){for(;ie!==null;){var e=ie;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Mu(4,e)}catch(l){lt(e,n,l)}break;case 1:var i=e.stateNode;if(typeof i.componentDidMount=="function"){var r=e.return;try{i.componentDidMount()}catch(l){lt(e,r,l)}}var s=e.return;try{yp(e)}catch(l){lt(e,s,l)}break;case 5:var o=e.return;try{yp(e)}catch(l){lt(e,o,l)}}}catch(l){lt(e,e.return,l)}if(e===t){ie=null;break}var a=e.sibling;if(a!==null){a.return=e.return,ie=a;break}ie=e.return}}var uN=Math.ceil,eu=sr.ReactCurrentDispatcher,wg=sr.ReactCurrentOwner,On=sr.ReactCurrentBatchConfig,je=0,_t=null,mt=null,At=0,pn=0,_o=as(0),kt=0,Ac=null,Vs=0,Uu=0,Cg=0,lc=null,tn=null,Tg=0,ga=1/0,Di=null,tu=!1,kp=null,Gr=null,Ll=!1,zr=null,nu=0,dc=0,Sp=null,cd=-1,ld=0;function Gt(){return je&6?ht():cd!==-1?cd:cd=ht()}function Qr(t){return t.mode&1?je&2&&At!==0?At&-At:GR.transition!==null?(ld===0&&(ld=Mk()),ld):(t=Ve,t!==0||(t=window.event,t=t===void 0?16:Hk(t.type)),t):1}function ei(t,e,n,i){if(50<dc)throw dc=0,Sp=null,Error(H(185));ul(t,n,i),(!(je&2)||t!==_t)&&(t===_t&&(!(je&2)&&(Uu|=n),kt===4&&Tr(t,At)),ln(t,i),n===1&&je===0&&!(e.mode&1)&&(ga=ht()+500,Ou&&cs()))}function ln(t,e){var n=t.callbackNode;GP(t,e);var i=Fd(t,t===_t?At:0);if(i===0)n!==null&&h0(n),t.callbackNode=null,t.callbackPriority=0;else if(e=i&-i,t.callbackPriority!==e){if(n!=null&&h0(n),e===1)t.tag===0?KR(ry.bind(null,t)):lS(ry.bind(null,t)),WR(function(){!(je&6)&&cs()}),n=null;else{switch(Uk(i)){case 1:n=Ym;break;case 4:n=Dk;break;case 16:n=Ud;break;case 536870912:n=Lk;break;default:n=Ud}n=aw(n,ew.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function ew(t,e){if(cd=-1,ld=0,je&6)throw Error(H(327));var n=t.callbackNode;if(Mo()&&t.callbackNode!==n)return null;var i=Fd(t,t===_t?At:0);if(i===0)return null;if(i&30||i&t.expiredLanes||e)e=iu(t,i);else{e=i;var r=je;je|=2;var s=nw();(_t!==t||At!==e)&&(Di=null,ga=ht()+500,As(t,e));do try{pN();break}catch(a){tw(t,a)}while(!0);dg(),eu.current=s,je=r,mt!==null?e=0:(_t=null,At=0,e=kt)}if(e!==0){if(e===2&&(r=Qf(t),r!==0&&(i=r,e=wp(t,r))),e===1)throw n=Ac,As(t,0),Tr(t,i),ln(t,ht()),n;if(e===6)Tr(t,i);else{if(r=t.current.alternate,!(i&30)&&!hN(r)&&(e=iu(t,i),e===2&&(s=Qf(t),s!==0&&(i=s,e=wp(t,s))),e===1))throw n=Ac,As(t,0),Tr(t,i),ln(t,ht()),n;switch(t.finishedWork=r,t.finishedLanes=i,e){case 0:case 1:throw Error(H(345));case 2:ms(t,tn,Di);break;case 3:if(Tr(t,i),(i&130023424)===i&&(e=Tg+500-ht(),10<e)){if(Fd(t,0)!==0)break;if(r=t.suspendedLanes,(r&i)!==i){Gt(),t.pingedLanes|=t.suspendedLanes&r;break}t.timeoutHandle=ip(ms.bind(null,t,tn,Di),e);break}ms(t,tn,Di);break;case 4:if(Tr(t,i),(i&4194240)===i)break;for(e=t.eventTimes,r=-1;0<i;){var o=31-Zn(i);s=1<<o,o=e[o],o>r&&(r=o),i&=~s}if(i=r,i=ht()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*uN(i/1960))-i,10<i){t.timeoutHandle=ip(ms.bind(null,t,tn,Di),i);break}ms(t,tn,Di);break;case 5:ms(t,tn,Di);break;default:throw Error(H(329))}}}return ln(t,ht()),t.callbackNode===n?ew.bind(null,t):null}function wp(t,e){var n=lc;return t.current.memoizedState.isDehydrated&&(As(t,e).flags|=256),t=iu(t,e),t!==2&&(e=tn,tn=n,e!==null&&Cp(e)),t}function Cp(t){tn===null?tn=t:tn.push.apply(tn,t)}function hN(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var i=0;i<n.length;i++){var r=n[i],s=r.getSnapshot;r=r.value;try{if(!ti(s(),r))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Tr(t,e){for(e&=~Cg,e&=~Uu,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Zn(e),i=1<<n;t[n]=-1,e&=~i}}function ry(t){if(je&6)throw Error(H(327));Mo();var e=Fd(t,0);if(!(e&1))return ln(t,ht()),null;var n=iu(t,e);if(t.tag!==0&&n===2){var i=Qf(t);i!==0&&(e=i,n=wp(t,i))}if(n===1)throw n=Ac,As(t,0),Tr(t,e),ln(t,ht()),n;if(n===6)throw Error(H(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ms(t,tn,Di),ln(t,ht()),null}function _g(t,e){var n=je;je|=1;try{return t(e)}finally{je=n,je===0&&(ga=ht()+500,Ou&&cs())}}function zs(t){zr!==null&&zr.tag===0&&!(je&6)&&Mo();var e=je;je|=1;var n=On.transition,i=Ve;try{if(On.transition=null,Ve=1,t)return t()}finally{Ve=i,On.transition=n,je=e,!(je&6)&&cs()}}function Eg(){pn=_o.current,Ye(_o)}function As(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,BR(n)),mt!==null)for(n=mt.return;n!==null;){var i=n;switch(ag(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Hd();break;case 3:pa(),Ye(an),Ye(Bt),gg();break;case 5:mg(i);break;case 4:pa();break;case 13:Ye(it);break;case 19:Ye(it);break;case 10:ug(i.type._context);break;case 22:case 23:Eg()}n=n.return}if(_t=t,mt=t=Jr(t.current,null),At=pn=e,kt=0,Ac=null,Cg=Uu=Vs=0,tn=lc=null,Ss!==null){for(e=0;e<Ss.length;e++)if(n=Ss[e],i=n.interleaved,i!==null){n.interleaved=null;var r=i.next,s=n.pending;if(s!==null){var o=s.next;s.next=r,i.next=o}n.pending=i}Ss=null}return t}function tw(t,e){do{var n=mt;try{if(dg(),sd.current=Zd,Xd){for(var i=rt.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}Xd=!1}if(Fs=0,wt=bt=rt=null,ac=!1,Nc=0,wg.current=null,n===null||n.return===null){kt=1,Ac=e,mt=null;break}e:{var s=t,o=n.return,a=n,l=e;if(e=At,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var d=l,u=a,h=u.tag;if(!(u.mode&1)&&(h===0||h===11||h===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var g=$0(o);if(g!==null){g.flags&=-257,q0(g,o,a,s,e),g.mode&1&&H0(s,d,e),e=g,l=d;var b=e.updateQueue;if(b===null){var m=new Set;m.add(l),e.updateQueue=m}else b.add(l);break e}else{if(!(e&1)){H0(s,d,e),Pg();break e}l=Error(H(426))}}else if(Ze&&a.mode&1){var k=$0(o);if(k!==null){!(k.flags&65536)&&(k.flags|=256),q0(k,o,a,s,e),cg(ma(l,a));break e}}s=l=ma(l,a),kt!==4&&(kt=2),lc===null?lc=[s]:lc.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var v=US(s,l,e);U0(s,v);break e;case 1:a=l;var y=s.type,x=s.stateNode;if(!(s.flags&128)&&(typeof y.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Gr===null||!Gr.has(x)))){s.flags|=65536,e&=-e,s.lanes|=e;var S=FS(s,a,e);U0(s,S);break e}}s=s.return}while(s!==null)}rw(n)}catch(w){e=w,mt===n&&n!==null&&(mt=n=n.return);continue}break}while(!0)}function nw(){var t=eu.current;return eu.current=Zd,t===null?Zd:t}function Pg(){(kt===0||kt===3||kt===2)&&(kt=4),_t===null||!(Vs&268435455)&&!(Uu&268435455)||Tr(_t,At)}function iu(t,e){var n=je;je|=2;var i=nw();(_t!==t||At!==e)&&(Di=null,As(t,e));do try{fN();break}catch(r){tw(t,r)}while(!0);if(dg(),je=n,eu.current=i,mt!==null)throw Error(H(261));return _t=null,At=0,kt}function fN(){for(;mt!==null;)iw(mt)}function pN(){for(;mt!==null&&!FP();)iw(mt)}function iw(t){var e=ow(t.alternate,t,pn);t.memoizedProps=t.pendingProps,e===null?rw(t):mt=e,wg.current=null}function rw(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=aN(n,e),n!==null){n.flags&=32767,mt=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{kt=6,mt=null;return}}else if(n=oN(n,e,pn),n!==null){mt=n;return}if(e=e.sibling,e!==null){mt=e;return}mt=e=t}while(e!==null);kt===0&&(kt=5)}function ms(t,e,n){var i=Ve,r=On.transition;try{On.transition=null,Ve=1,mN(t,e,n,i)}finally{On.transition=r,Ve=i}return null}function mN(t,e,n,i){do Mo();while(zr!==null);if(je&6)throw Error(H(327));n=t.finishedWork;var r=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(H(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(QP(t,s),t===_t&&(mt=_t=null,At=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ll||(Ll=!0,aw(Ud,function(){return Mo(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=On.transition,On.transition=null;var o=Ve;Ve=1;var a=je;je|=4,wg.current=null,lN(t,n),XS(n,t),DR(tp),Vd=!!ep,tp=ep=null,t.current=n,dN(n),VP(),je=a,Ve=o,On.transition=s}else t.current=n;if(Ll&&(Ll=!1,zr=t,nu=r),s=t.pendingLanes,s===0&&(Gr=null),WP(n.stateNode),ln(t,ht()),e!==null)for(i=t.onRecoverableError,n=0;n<e.length;n++)r=e[n],i(r.value,{componentStack:r.stack,digest:r.digest});if(tu)throw tu=!1,t=kp,kp=null,t;return nu&1&&t.tag!==0&&Mo(),s=t.pendingLanes,s&1?t===Sp?dc++:(dc=0,Sp=t):dc=0,cs(),null}function Mo(){if(zr!==null){var t=Uk(nu),e=On.transition,n=Ve;try{if(On.transition=null,Ve=16>t?16:t,zr===null)var i=!1;else{if(t=zr,zr=null,nu=0,je&6)throw Error(H(331));var r=je;for(je|=4,ie=t.current;ie!==null;){var s=ie,o=s.child;if(ie.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var d=a[l];for(ie=d;ie!==null;){var u=ie;switch(u.tag){case 0:case 11:case 15:cc(8,u,s)}var h=u.child;if(h!==null)h.return=u,ie=h;else for(;ie!==null;){u=ie;var p=u.sibling,g=u.return;if(QS(u),u===d){ie=null;break}if(p!==null){p.return=g,ie=p;break}ie=g}}}var b=s.alternate;if(b!==null){var m=b.child;if(m!==null){b.child=null;do{var k=m.sibling;m.sibling=null,m=k}while(m!==null)}}ie=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,ie=o;else e:for(;ie!==null;){if(s=ie,s.flags&2048)switch(s.tag){case 0:case 11:case 15:cc(9,s,s.return)}var v=s.sibling;if(v!==null){v.return=s.return,ie=v;break e}ie=s.return}}var y=t.current;for(ie=y;ie!==null;){o=ie;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,ie=x;else e:for(o=y;ie!==null;){if(a=ie,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Mu(9,a)}}catch(w){lt(a,a.return,w)}if(a===o){ie=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,ie=S;break e}ie=a.return}}if(je=r,cs(),xi&&typeof xi.onPostCommitFiberRoot=="function")try{xi.onPostCommitFiberRoot(Ru,t)}catch{}i=!0}return i}finally{Ve=n,On.transition=e}}return!1}function sy(t,e,n){e=ma(n,e),e=US(t,e,1),t=Kr(t,e,1),e=Gt(),t!==null&&(ul(t,1,e),ln(t,e))}function lt(t,e,n){if(t.tag===3)sy(t,t,n);else for(;e!==null;){if(e.tag===3){sy(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Gr===null||!Gr.has(i))){t=ma(n,t),t=FS(e,t,1),e=Kr(e,t,1),t=Gt(),e!==null&&(ul(e,1,t),ln(e,t));break}}e=e.return}}function gN(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),e=Gt(),t.pingedLanes|=t.suspendedLanes&n,_t===t&&(At&n)===n&&(kt===4||kt===3&&(At&130023424)===At&&500>ht()-Tg?As(t,0):Cg|=n),ln(t,e)}function sw(t,e){e===0&&(t.mode&1?(e=_l,_l<<=1,!(_l&130023424)&&(_l=4194304)):e=1);var n=Gt();t=er(t,e),t!==null&&(ul(t,e,n),ln(t,n))}function vN(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),sw(t,n)}function yN(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(H(314))}i!==null&&i.delete(e),sw(t,n)}var ow;ow=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||an.current)sn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return sn=!1,sN(t,e,n);sn=!!(t.flags&131072)}else sn=!1,Ze&&e.flags&1048576&&dS(e,Kd,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;ad(t,e),t=e.pendingProps;var r=ua(e,Bt.current);Lo(e,n),r=yg(null,e,i,t,r,n);var s=bg();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,cn(i)?(s=!0,$d(e)):s=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,fg(e),r.updater=Lu,e.stateNode=r,r._reactInternals=e,dp(e,i,t,n),e=fp(null,e,i,!0,s,n)):(e.tag=0,Ze&&s&&og(e),Kt(null,e,r,n),e=e.child),e;case 16:i=e.elementType;e:{switch(ad(t,e),t=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=xN(i),t=Bn(i,t),r){case 0:e=hp(null,e,i,t,n);break e;case 1:e=Q0(null,e,i,t,n);break e;case 11:e=K0(null,e,i,t,n);break e;case 14:e=G0(null,e,i,Bn(i.type,t),n);break e}throw Error(H(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Bn(i,r),hp(t,e,i,r,n);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Bn(i,r),Q0(t,e,i,r,n);case 3:e:{if(WS(e),t===null)throw Error(H(387));i=e.pendingProps,s=e.memoizedState,r=s.element,gS(t,e),Jd(e,i,null,n);var o=e.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){r=ma(Error(H(423)),e),e=J0(t,e,i,n,r);break e}else if(i!==r){r=ma(Error(H(424)),e),e=J0(t,e,i,n,r);break e}else for(vn=qr(e.stateNode.containerInfo.firstChild),bn=e,Ze=!0,qn=null,n=pS(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ha(),i===r){e=tr(t,e,n);break e}Kt(t,e,i,n)}e=e.child}return e;case 5:return vS(e),t===null&&ap(e),i=e.type,r=e.pendingProps,s=t!==null?t.memoizedProps:null,o=r.children,np(i,r)?o=null:s!==null&&np(i,s)&&(e.flags|=32),BS(t,e),Kt(t,e,o,n),e.child;case 6:return t===null&&ap(e),null;case 13:return HS(t,e,n);case 4:return pg(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=fa(e,null,i,n):Kt(t,e,i,n),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Bn(i,r),K0(t,e,i,r,n);case 7:return Kt(t,e,e.pendingProps,n),e.child;case 8:return Kt(t,e,e.pendingProps.children,n),e.child;case 12:return Kt(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,o=r.value,Ke(Gd,i._currentValue),i._currentValue=o,s!==null)if(ti(s.value,o)){if(s.children===r.children&&!an.current){e=tr(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(s.tag===1){l=Ji(-1,n&-n),l.tag=2;var d=s.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?l.next=l:(l.next=u.next,u.next=l),d.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),cp(s.return,n,e),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(H(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),cp(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Kt(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,Lo(e,n),r=Ln(r),i=i(r),e.flags|=1,Kt(t,e,i,n),e.child;case 14:return i=e.type,r=Bn(i,e.pendingProps),r=Bn(i.type,r),G0(t,e,i,r,n);case 15:return VS(t,e,e.type,e.pendingProps,n);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Bn(i,r),ad(t,e),e.tag=1,cn(i)?(t=!0,$d(e)):t=!1,Lo(e,n),MS(e,i,r),dp(e,i,r,n),fp(null,e,i,!0,t,n);case 19:return $S(t,e,n);case 22:return zS(t,e,n)}throw Error(H(156,e.tag))};function aw(t,e){return Ok(t,e)}function bN(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function An(t,e,n,i){return new bN(t,e,n,i)}function Rg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function xN(t){if(typeof t=="function")return Rg(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Gm)return 11;if(t===Qm)return 14}return 2}function Jr(t,e){var n=t.alternate;return n===null?(n=An(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deleti
vendor: 6,825 bytes, line 41
41ons=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function dd(t,e,n,i,r,s){var o=2;if(i=t,typeof t=="function")Rg(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case go:return Os(n.children,r,s,e);case Km:o=8,r|=8;break;case Of:return t=An(12,n,e,r|2),t.elementType=Of,t.lanes=s,t;case Df:return t=An(13,n,e,r),t.elementType=Df,t.lanes=s,t;case Lf:return t=An(19,n,e,r),t.elementType=Lf,t.lanes=s,t;case vk:return Fu(n,r,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case mk:o=10;break e;case gk:o=9;break e;case Gm:o=11;break e;case Qm:o=14;break e;case Sr:o=16,i=null;break e}throw Error(H(130,t==null?t:typeof t,""))}return e=An(o,n,e,r),e.elementType=t,e.type=i,e.lanes=s,e}function Os(t,e,n,i){return t=An(7,t,i,e),t.lanes=n,t}function Fu(t,e,n,i){return t=An(22,t,i,e),t.elementType=vk,t.lanes=n,t.stateNode={isHidden:!1},t}function zh(t,e,n){return t=An(6,t,null,e),t.lanes=n,t}function Bh(t,e,n){return e=An(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function kN(t,e,n,i,r){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sh(0),this.expirationTimes=Sh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sh(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Ng(t,e,n,i,r,s,o,a,l){return t=new kN(t,e,n,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=An(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},fg(s),t}function SN(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:mo,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}function cw(t){if(!t)return ts;t=t._reactInternals;e:{if(Zs(t)!==t||t.tag!==1)throw Error(H(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(cn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(H(171))}if(t.tag===1){var n=t.type;if(cn(n))return cS(t,n,e)}return e}function lw(t,e,n,i,r,s,o,a,l){return t=Ng(n,i,!0,t,r,s,o,a,l),t.context=cw(null),n=t.current,i=Gt(),r=Qr(n),s=Ji(i,r),s.callback=e??null,Kr(n,s,r),t.current.lanes=r,ul(t,r,i),ln(t,i),t}function Vu(t,e,n,i){var r=e.current,s=Gt(),o=Qr(r);return n=cw(n),e.context===null?e.context=n:e.pendingContext=n,e=Ji(s,o),e.payload={element:t},i=i===void 0?null:i,i!==null&&(e.callback=i),t=Kr(r,e,o),t!==null&&(ei(t,r,o,s),rd(t,r,o)),o}function ru(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function oy(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Ig(t,e){oy(t,e),(t=t.alternate)&&oy(t,e)}function wN(){return null}var dw=typeof reportError=="function"?reportError:function(t){console.error(t)};function jg(t){this._internalRoot=t}zu.prototype.render=jg.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(H(409));Vu(t,e,null,null)};zu.prototype.unmount=jg.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;zs(function(){Vu(null,t,null,null)}),e[Zi]=null}};function zu(t){this._internalRoot=t}zu.prototype.unstable_scheduleHydration=function(t){if(t){var e=zk();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Cr.length&&e!==0&&e<Cr[n].priority;n++);Cr.splice(n,0,t),n===0&&Wk(t)}};function Ag(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Bu(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function ay(){}function CN(t,e,n,i,r){if(r){if(typeof i=="function"){var s=i;i=function(){var d=ru(o);s.call(d)}}var o=lw(e,i,t,0,null,!1,!1,"",ay);return t._reactRootContainer=o,t[Zi]=o.current,Tc(t.nodeType===8?t.parentNode:t),zs(),o}for(;r=t.lastChild;)t.removeChild(r);if(typeof i=="function"){var a=i;i=function(){var d=ru(l);a.call(d)}}var l=Ng(t,0,!1,null,null,!1,!1,"",ay);return t._reactRootContainer=l,t[Zi]=l.current,Tc(t.nodeType===8?t.parentNode:t),zs(function(){Vu(e,l,n,i)}),l}function Wu(t,e,n,i,r){var s=n._reactRootContainer;if(s){var o=s;if(typeof r=="function"){var a=r;r=function(){var l=ru(o);a.call(l)}}Vu(e,o,t,r)}else o=CN(n,e,t,r,i);return ru(o)}Fk=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Ja(e.pendingLanes);n!==0&&(Xm(e,n|1),ln(e,ht()),!(je&6)&&(ga=ht()+500,cs()))}break;case 13:zs(function(){var i=er(t,1);if(i!==null){var r=Gt();ei(i,t,1,r)}}),Ig(t,1)}};Zm=function(t){if(t.tag===13){var e=er(t,134217728);if(e!==null){var n=Gt();ei(e,t,134217728,n)}Ig(t,134217728)}};Vk=function(t){if(t.tag===13){var e=Qr(t),n=er(t,e);if(n!==null){var i=Gt();ei(n,t,e,i)}Ig(t,e)}};zk=function(){return Ve};Bk=function(t,e){var n=Ve;try{return Ve=t,e()}finally{Ve=n}};qf=function(t,e,n){switch(e){case"input":if(Ff(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=Au(i);if(!r)throw Error(H(90));bk(i),Ff(i,r)}}}break;case"textarea":kk(t,n);break;case"select":e=n.value,e!=null&&jo(t,!!n.multiple,e,!1)}};Pk=_g;Rk=zs;var TN={usingClientEntryPoint:!1,Events:[fl,xo,Au,_k,Ek,_g]},Fa={findFiberByHostInstance:ks,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},_N={bundleType:Fa.bundleType,version:Fa.version,rendererPackageName:Fa.rendererPackageName,rendererConfig:Fa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:sr.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=jk(t),t===null?null:t.stateNode},findFiberByHostInstance:Fa.findFiberByHostInstance||wN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
41if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ml=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ml.isDisabled&&Ml.supportsFiber)try{Ru=Ml.inject(_N),xi=Ml}catch{}}Cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TN;Cn.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ag(e))throw Error(H(200));return SN(t,e,null,n)};Cn.createRoot=function(t,e){if(!Ag(t))throw Error(H(299));var n=!1,i="",r=dw;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=Ng(t,1,!1,null,null,n,!1,i,r),t[Zi]=e.current,Tc(t.nodeType===8?t.parentNode:t),new jg(e)};Cn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(H(188)):(t=Object.keys(t).join(","),Error(H(268,t)));return t=jk(e),t=t===null?null:t.stateNode,t};Cn.flushSync=function(t){return zs(t)};Cn.hydrate=function(t,e,n){if(!Bu(e))throw Error(H(200));return Wu(null,t,e,!0,n)};Cn.hydrateRoot=function(t,e,n){if(!Ag(t))throw Error(H(405));var i=n!=null&&n.hydratedSources||null,r=!1,s="",o=dw;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=lw(e,null,t,1,n??null,r,!1,s,o),t[Zi]=e.current,Tc(t),i)for(t=0;t<i.length;t++)n=i[t],r=n._getVersion,r=r(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,r]:e.mutableSourceEagerHydrationData.push(n,r);return new zu(e)};Cn.render=function(t,e,n){if(!Bu(e))throw Error(H(200));return Wu(null,t,e,!1,n)};Cn.unmountComponentAtNode=function(t){if(!Bu(t))throw Error(H(40));return t._reactRootContainer?(zs(function(){Wu(null,null,t,!1,function(){t._reactRootContainer=null,t[Zi]=null})}),!0):!1};Cn.unstable_batchedUpdates=_g;Cn.unstable_renderSubtreeIntoContainer=function(t,e,n,i){if(!Bu(n))throw Error(H(200));if(t==null||t._reactInternals===void 0)throw Error(H(38));return Wu(t,e,n,!1,i)};Cn.version="18.3.1-next-f1338f8080-20240426";function uw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(uw)}catch(t){console.error(t)}}uw(),uk.exports=Cn;var eo=uk.exports;const EN=Xx(eo);var hw,cy=eo;hw=cy.createRoot,cy.hydrateRoot;const PN="modulepreload",RN=function(t){return"/"+t},ly={},T=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.allSettled(n.map(l=>{if(l=RN(l),l in ly)return;ly[l]=!0;const d=l.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":PN,d||(h.as="script"),h.crossOrigin="",h.href=l,a&&h.setAttribute("nonce",a),document.head.appendChild(h),d)return new Promise((p,g)=>{h.addEventListener("load",p),h.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return r.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};function NN(t,e){if(t instanceof RegExp)return{keys:!1,pattern:t};var n,i,r,s,o=[],a="",l=t.split("/");for(l[0]||l.shift();r=l.shift();)n=r[0],n==="*"?(o.push(n),a+=r[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(i=r.indexOf("?",1),s=r.indexOf(".",1),o.push(r.substring(1,~i?i:~s?s:r.length)),a+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(a+=(~i?"?":"")+"\\"+r.substring(s))):a+="/"+r;return{keys:o,pattern:new RegExp("^"+a+(e?"(?=$|/)":"/?$"),"i")}}var fw={exports:{}},pw={};/** 42 * @license React 43 * use-sync-external-store-shim.production.min.js 44 * 45 * Copyright (c) Facebook, Inc. and its affiliates. 46 * 47 * This source code is licensed under the MIT license found in the 48 * LICENSE file in the root directory of this source tree. 49 */var va=f;function IN(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var jN=typeof Object.is=="function"?Object.is:IN,AN=va.useState,ON=va.useEffect,DN=va.useLayoutEffect,LN=va.useDebugValue;function MN(t,e){var n=e(),i=AN({inst:{value:n,getSnapshot:e}}),r=i[0].inst,s=i[1];return DN(function(){r.value=n,r.getSnapshot=e,Wh(r)&&s({inst:r})},[t,n,e]),ON(function(){return Wh(r)&&s({inst:r}),t(function(){Wh(r)&&s({inst:r})})},[t]),LN(n),n}function Wh(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!jN(t,n)}catch{return!0}}function UN(t,e){return e()}var FN=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?UN:MN;pw.useSyncExternalStore=va.useSyncExternalStore!==void 0?va.useSyncExternalStore:FN;fw.exports=pw;var VN=fw.exports;const zN=lk.useInsertionEffect,BN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",mw=BN?f.useLayoutEffect:f.useEffect,WN=zN||mw,Og=t=>{const e=f.useRef([t,(...n)=>e[0](...n)]).current;return WN(()=>{e[0]=t}),e[1]},HN="popstate",Dg="pushState",Lg="replaceState",$N="hashchange",dy=[HN,Dg,Lg,$N],qN=t=>{for(const e of dy)addEventListener(e,t);return()=>{for(const e of dy)removeEventListener(e,t)}},gw=(t,e)=>VN.useSyncExternalStore(qN,t,e),KN=()=>location.search,GN=({ssrSearch:t=""}={})=>gw(KN,()=>t),uy=()=>location.pathname,QN=({ssrPath:t}={})=>gw(uy,t?()=>t:uy),JN=(t,{replace:e=!1,state:n=null}={})=>history[e?Lg:Dg](n,"",t),YN=(t={})=>[QN(t),JN],hy=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[hy]>"u"){for(const t of[Dg,Lg]){const e=history[t];history[t]=function(){const n=e.apply(this,arguments),i=new Event(t);return i.arguments=arguments,dispatchEvent(i),n}}Object.defineProperty(window,hy,{value:!0})}const XN=(t,e)=>e.toLowerCase().indexOf(t.toLowerCase())?"~"+e:e.slice(t.length)||"/",vw=(t="")=>t==="/"?"":t,ZN=(t,e)=>t[0]==="~"?t.slice(1):vw(e)+t,eI=(t="",e)=>XN(Tp(vw(t)),Tp(e)),tI=t=>t[0]==="?"?t.slice(1):t,Tp=t=>{try{return decodeURI(t)}catch{return t}}
49,nI=t=>Tp(tI(t)),yw={hook:YN,searchHook:GN,parser:NN,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:t=>t},bw=f.createContext(yw),to=()=>f.useContext(bw),xw={},kw=f.createContext(xw),iI=()=>f.useContext(kw),Hu=t=>{const[e,n]=t.hook(t);return[eI(t.base,e),Og((i,r)=>n(ZN(i,t.base),r))]},Pi=()=>Hu(to()),p8=()=>{const t=to();return nI(t.searchHook(t))},Mg=(t,e,n,i)=>{const{pattern:r,keys:s}=e instanceof RegExp?{keys:!1,pattern:e}:t(e||"*",i),o=r.exec(n)||[],[a,...l]=o;return a!==void 0?[!0,(()=>{const d=s!==!1?Object.fromEntries(s.map((h,p)=>[h,l[p]])):o.groups;let u={...l};return d&&Object.assign(u,d),u})(),...i?[a]:[]]:[!1,null]},m8=t=>Mg(to().parser,t,Pi()[0]),rI=({children:t,...e})=>{var u,h;const n=to(),i=e.hook?yw:n;let r=i;const[s,o]=((u=e.ssrPath)==null?void 0:u.split("?"))??[];o&&(e.ssrSearch=o,e.ssrPath=s),e.hrefs=e.hrefs??((h=e.hook)==null?void 0:h.hrefs);let a=f.useRef({}),l=a.current,d=l;for(let p in i){const g=p==="base"?i[p]+(e[p]||""):e[p]||i[p];l===d&&g!==d[p]&&(a.current=d={...d}),d[p]=g,g!==i[p]&&(r=d)}return f.createElement(bw.Provider,{value:r,children:t})},fy=({children:t,component:e},n)=>e?f.createElement(e,{params:n}):typeof t=="function"?t(n):t,sI=t=>{let e=f.useRef(xw),n=e.current;for(const i in t)t[i]!==n[i]&&(n=t);return Object.keys(t).length===0&&(n=t),e.current=n},D=({path:t,nest:e,match:n,...i})=>{const r=to(),[s]=Hu(r),[o,a,l]=n??Mg(r.parser,t,s,e),d=sI({...iI(),...a});if(!o)return null;const u=l?f.createElement(rI,{base:l},fy(i,d)):fy(i,d);return f.createElement(kw.Provider,{value:d,children:u})},Le=f.forwardRef((t,e)=>{const n=to(),[i,r]=Hu(n),{to:s="",href:o=s,onClick:a,asChild:l,children:d,className:u,replace:h,state:p,...g}=t,b=Og(k=>{k.ctrlKey||k.metaKey||k.altKey||k.shiftKey||k.button!==0||(a==null||a(k),k.defaultPrevented||(k.preventDefault(),r(o,t)))}),m=n.hrefs(o[0]==="~"?o.slice(1):n.base+o,n);return l&&f.isValidElement(d)?f.cloneElement(d,{onClick:b,href:m}):f.createElement("a",{...g,onClick:b,href:m,className:u!=null&&u.call?u(i===o):u,children:d,ref:e})}),Sw=t=>Array.isArray(t)?t.flatMap(e=>Sw(e&&e.type===f.Fragment?e.props.children:e)):[t],oI=({children:t,location:e})=>{const n=to(),[i]=Hu(n);for(const r of Sw(t)){let s=0;if(f.isValidElement(r)&&(s=Mg(n.parser,r.props.path,e||i,r.props.nest))[0])return f.cloneElement(r,{match:s})}return null},Dn=t=>{const{to:e,href:n=e}=t,[,i]=Pi(),r=Og(()=>i(e||n,t));return mw(()=>{r()},[]),null};var _a=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Bs=typeof window>"u"||"Deno"in globalThis;function Nn(){}function aI(t,e){return typeof t=="function"?t(e):t}function _p(t){return typeof t=="number"&&t>=0&&t!==1/0}function ww(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Uo(t,e){return typeof t=="function"?t(e):t}function Kn(t,e){return typeof t=="function"?t(e):t}function py(t,e){const{type:n="all",exact:i,fetchStatus:r,predicate:s,queryKey:o,stale:a}=t;if(o){if(i){if(e.queryHash!==Ug(o,e.options))return!1}else if(!Oc(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||r&&r!==e.state.fetchStatus||s&&!s(e))}function my(t,e){const{exact:n,status:i,predicate:r,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(Ws(e.options.mutationKey)!==Ws(s))return!1}else if(!Oc(e.options.mutationKey,s))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function Ug(t,e){return((e==null?void 0:e.queryKeyHashFn)||Ws)(t)}function Ws(t){return JSON.stringify(t,(e,n)=>Ep(n)?Object.keys(n).sort().reduce((i,r)=>(i[r]=n[r],i),{}):n)}function Oc(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Oc(t[n],e[n])):!1}function Cw(t,e){if(t===e)return t;const n=gy(t)&&gy(e);if(n||Ep(t)&&Ep(e)){const i=n?t:Object.keys(t),r=i.length,s=n?e:Object.keys(e),o=s.length,a=n?[]:{};let l=0;for(let d=0;d<o;d++){const u=n?d:s[d];(!n&&i.includes(u)||n)&&t[u]===void 0&&e[u]===void 0?(a[u]=void 0,l++):(a[u]=Cw(t[u],e[u]),a[u]===t[u]&&t[u]!==void 0&&l++)}return r===o&&l===r?t:a}return e}function su(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function gy(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ep(t){if(!vy(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!vy(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function vy(t){return Object.prototype.toString.call(t)==="[object Object]"}function cI(t){return new Promise(e=>{setTimeout(e,t)})}function Pp(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Cw(t,e):e}function lI(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function dI(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}var Fg=Symbol();function Tw(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Fg?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Cs,Nr,Qo,Bx,uI=(Bx=class extends _a{constructor(){super();ee(this,Cs);ee(this,Nr);ee(this,Qo);q(this,Qo,e=>{if(!Bs&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,Nr)||this.setEventListener(_(this,Qo))}onUnsubscribe(){var e;this.hasListeners()||((e=_(this,Nr))==null||e.call(this),q(this,Nr,void 0))}setEventListener(e){var n;q(this,Qo,e),(n=_(this,Nr))==null||n.call(this),q(this,Nr,e(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(e){_(this,Cs)!==e&&(q(this,Cs,e),this.onFocus())}onFocus(){const e=this.isFocused();
vendor: 32,252 bytes, line 49
49this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof _(this,Cs)=="boolean"?_(this,Cs):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Cs=new WeakMap,Nr=new WeakMap,Qo=new WeakMap,Bx),Vg=new uI,Jo,Ir,Yo,Wx,hI=(Wx=class extends _a{constructor(){super();ee(this,Jo,!0);ee(this,Ir);ee(this,Yo);q(this,Yo,e=>{if(!Bs&&window.addEventListener){const n=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}})}onSubscribe(){_(this,Ir)||this.setEventListener(_(this,Yo))}onUnsubscribe(){var e;this.hasListeners()||((e=_(this,Ir))==null||e.call(this),q(this,Ir,void 0))}setEventListener(e){var n;q(this,Yo,e),(n=_(this,Ir))==null||n.call(this),q(this,Ir,e(this.setOnline.bind(this)))}setOnline(e){_(this,Jo)!==e&&(q(this,Jo,e),this.listeners.forEach(i=>{i(e)}))}isOnline(){return _(this,Jo)}},Jo=new WeakMap,Ir=new WeakMap,Yo=new WeakMap,Wx),ou=new hI;function Rp(){let t,e;const n=new Promise((r,s)=>{t=r,e=s});n.status="pending",n.catch(()=>{});function i(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{i({status:"fulfilled",value:r}),t(r)},n.reject=r=>{i({status:"rejected",reason:r}),e(r)},n}function fI(t){return Math.min(1e3*2**t,3e4)}function _w(t){return(t??"online")==="online"?ou.isOnline():!0}var Ew=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Hh(t){return t instanceof Ew}function Pw(t){let e=!1,n=0,i=!1,r;const s=Rp(),o=m=>{var k;i||(p(new Ew(m)),(k=t.abort)==null||k.call(t))},a=()=>{e=!0},l=()=>{e=!1},d=()=>Vg.isFocused()&&(t.networkMode==="always"||ou.isOnline())&&t.canRun(),u=()=>_w(t.networkMode)&&t.canRun(),h=m=>{var k;i||(i=!0,(k=t.onSuccess)==null||k.call(t,m),r==null||r(),s.resolve(m))},p=m=>{var k;i||(i=!0,(k=t.onError)==null||k.call(t,m),r==null||r(),s.reject(m))},g=()=>new Promise(m=>{var k;r=v=>{(i||d())&&m(v)},(k=t.onPause)==null||k.call(t)}).then(()=>{var m;r=void 0,i||(m=t.onContinue)==null||m.call(t)}),b=()=>{if(i)return;let m;const k=n===0?t.initialPromise:void 0;try{m=k??t.fn()}catch(v){m=Promise.reject(v)}Promise.resolve(m).then(h).catch(v=>{var C;if(i)return;const y=t.retry??(Bs?0:3),x=t.retryDelay??fI,S=typeof x=="function"?x(n,v):x,w=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,v);if(e||!w){p(v);return}n++,(C=t.onFail)==null||C.call(t,n,v),cI(S).then(()=>d()?void 0:g()).then(()=>{e?p(v):b()})})};return{promise:s,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?b():g().then(b),s)}}function pI(){let t=[],e=0,n=a=>{a()},i=a=>{a()},r=a=>setTimeout(a,0);const s=a=>{e?t.push(a):r(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&r(()=>{i(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{i=a},setScheduler:a=>{r=a}}}var xt=pI(),Ts,Hx,Rw=(Hx=class{constructor(){ee(this,Ts)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_p(this.gcTime)&&q(this,Ts,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Bs?1/0:5*60*1e3))}clearGcTimeout(){_(this,Ts)&&(clearTimeout(_(this,Ts)),q(this,Ts,void 0))}},Ts=new WeakMap,Hx),Xo,Zo,Rn,Ut,Hc,_s,Wn,Ai,$x,mI=($x=class extends Rw{constructor(e){super();ee(this,Wn);ee(this,Xo);ee(this,Zo);ee(this,Rn);ee(this,Ut);ee(this,Hc);ee(this,_s);q(this,_s,!1),q(this,Hc,e.defaultOptions),this.setOptions(e.options),this.observers=[],q(this,Rn,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,q(this,Xo,gI(this.options)),this.state=e.state??_(this,Xo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=_(this,Ut))==null?void 0:e.promise}setOptions(e){this.options={..._(this,Hc),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Rn).remove(this)}setData(e,n){const i=Pp(this.state.data,e,this.options);return ve(this,Wn,Ai).call(this,{data:i,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),i}setState(e,n){ve(this,Wn,Ai).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var i,r;const n=(i=_(this,Ut))==null?void 0:i.promise;return(r=_(this,Ut))==null||r.cancel(e),n?n.then(Nn).catch(Nn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Xo))}isActive(){return this.observers.some(e=>Kn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Fg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!ww(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(i=>i.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=_(this,Ut))==null||n.continue()}onOnline(){var n;const e=this.observers.find(i=>i.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=_(this,Ut))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),_(this,Rn).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(_(this,Ut)&&(_(this,_s)?_(this,Ut).cancel({revert:!0}):_(this,Ut).cancelRetry()),this.scheduleGc()),_(this,Rn).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ve(this,Wn,Ai).call(this,{type:"invalidate"})}fetch(e,n){var l,d,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,Ut))return _(this,Ut).continueRetry(),_(this,Ut).promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,r=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(q(this,_s,!0),i.signal)})},s=()=>{const h=Tw(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return r(p),q(this,_s,!1),this.options.persister?this.options.persister(h,p,this):h(p)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};r(o),(l=this.options.behavior)==null||l.onFetch(o,this),q(this,Zo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&ve(this,Wn,Ai).call(this,{type:"fetch",meta:(u=o.fetchOptions)==null?void 0:u.meta});const a=h=>{var p,g,b,m;Hh(h)&&h.silent||ve(this,Wn,Ai).call(this,{type:"error",error:h}),Hh(h)||((g=(p=_(this,Rn).config).onError)==null||g.call(p,h,this),(m=(b=_(this,Rn).config).onSettled)==null||m.call(b,this.state.data,h,this)),this.scheduleGc()};return q(this,Ut,Pw({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:i.abort.bind(i),onSuccess:h=>{var p,g,b,m;if(h===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(k){a(k);return}(g=(p=_(this,Rn).config).onSuccess)==null||g.call(p,h,this),(m=(b=_(this,Rn).config).onSettled)==null||m.call(b,h,this.state.error,this),this.scheduleGc()},onError:a,onFail:(h,p)=>{ve(this,Wn,Ai).call(this,{type:"failed",failureCount:h,error:p})},onPause:()=>{ve(this,Wn,Ai).call(this,{type:"pause"})},onContinue:()=>{ve(this,Wn,Ai).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),_(this,Ut).start()}},Xo=new WeakMap,Zo=new WeakMap,Rn=new WeakMap,Ut=new WeakMap,Hc=new WeakMap,_s=new WeakMap,Wn=new WeakSet,Ai=function(e){const n=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Nw(i.data,this.options),fetchMeta:e.meta??null};case"success":return{...i,data:e.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return Hh(r)&&r.revert&&_(this,Zo)?{..._(this,Zo),fetchStatus:"idle"}:{...i,error:r,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=n(this.state),xt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),_(this,Rn).notify({query:this,type:"updated",action:e})})},$x);function Nw(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_w(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function gI(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,i=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var ui,qx,vI=(qx=class extends _a{constructor(e={}){super();ee(this,ui);this.config=e,q(this,ui,new Map)}build(e,n,i){const r=n.queryKey,s=n.queryHash??Ug(r,n);let o=this.get(s);return o||(o=new mI({cache:this,queryKey:r,queryHash:s,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){_(this,ui).has(e.queryHash)||(_(this,ui).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=_(this,ui).get(e.queryHash);n&&(e.destroy(),n===e&&_(this,ui).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){xt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return _(this,ui).get(e)}getAll(){return[..._(this,ui).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(i=>py(n,i))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(i=>py(e,i)):n}notify(e){xt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){xt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){xt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ui=new WeakMap,qx),hi,$t,Es,fi,yr,Kx,yI=(Kx=class extends Rw{constructor(e){super();ee(this,fi);ee(this,hi);ee(this,$t);ee(this,Es);this.mutationId=e.mutationId,q(this,$t,e.mutationCache),q(this,hi,[]),this.state=e.state||Iw(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){_(this,hi).includes(e)||(_(this,hi).push(e),this.clearGcTimeout(),_(this,$t).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){q(this,hi,_(this,hi).filter(n=>n!==e)),this.scheduleGc(),_(this,$t).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){_(this,hi).length||(this.state.status==="pending"?this.scheduleGc():_(this,$t).remove(this))}continue(){var e;return((e=_(this,Es))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var r,s,o,a,l,d,u,h,p,g,b,m,k,v,y,x,S,w,C,R;q(this,Es,Pw({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(P,N)=>{ve(this,fi,yr).call(this,{type:"failed",failureCount:P,error:N})},onPause:()=>{ve(this,fi,yr).call(this,{type:"pause"})},onContinue:()=>{ve(this,fi,yr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,$t).canRun(this)}));const n=this.state.status==="pending",i=!_(this,Es).canStart();try{if(!n){ve(this,fi,yr).call(this,{type:"pending",variables:e,isPaused:i}),await((s=(r=_(this,$t).config).onMutate)==null?void 0:s.call(r,e,this));const N=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));N!==this.state.context&&ve(this,fi,yr).call(this,{type:"pending",context:N,variables:e,isPaused:i})}const P=await _(this,Es).start();return await((d=(l=_(this,$t).config).onSuccess)==null?void 0:d.call(l,P,e,this.state.context,this)),await((h=(u=this.options).onSuccess)==null?void 0:h.call(u,P,e,this.state.context)),await((g=(p=_(this,$t).config).onSettled)==null?void 0:g.call(p,P,null,this.state.variables,this.state.context,this)),await((m=(b=this.options).onSettled)==null?void 0:m.call(b,P,null,e,this.state.context)),ve(this,fi,yr).call(this,{type:"success",data:P}),P}catch(P){try{throw await((v=(k=_(this,$t).config).onError)==null?void 0:v.call(k,P,e,this.state.context,this)),await((x=(y=this.options).onError)==null?void 0:x.call(y,P,e,this.state.context)),await((w=(S=_(this,$t).config).onSettled)==null?void 0:w.call(S,void 0,P,this.state.variables,this.state.context,this)),await((R=(C=this.options).onSettled)==null?void 0:R.call(C,void 0,P,e,this.state.context)),P}finally{ve(this,fi,yr).call(this,{type:"error",error:P})}}finally{_(this,$t).runNext(this)}}},hi=new WeakMap,$t=new WeakMap,Es=new WeakMap,fi=new WeakSet,yr=function(e){const n=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),xt.batch(()=>{_(this,hi).forEach(i=>{i.onMutationUpdate(e)}),_(this,$t).notify({mutation:this,type:"updated",action:e})})},Kx);function Iw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var fn,$c,Gx,bI=(Gx=class extends _a{constructor(e={}){super();ee(this,fn);ee(this,$c);this.config=e,q(this,fn,new Map),q(this,$c,Date.now())}build(e,n,i){const r=new yI({mutationCache:this,mutationId:++xl(this,$c)._,options:e.defaultMutationOptions(n),state:i});return this.add(r),r}add(e){const n=Ul(e),i=_(this,fn).get(n)??[];i.push(e),_(this,fn).set(n,i),this.notify({type:"added",mutation:e})}remove(e){var i;const n=Ul(e);if(_(this,fn).has(n)){const r=(i=_(this,fn).get(n))==null?void 0:i.filter(s=>s!==e);r&&(r.length===0?_(this,fn).delete(n):_(this,fn).set(n,r))}this.notify({type:"removed",mutation:e})}canRun(e){var i;const n=(i=_(this,fn).get(Ul(e)))==null?void 0:i.find(r=>r.state.status==="pending");return!n||n===e}runNext(e){var i;const n=(i=_(this,fn).get(Ul(e)))==null?void 0:i.find(r=>r!==e&&r.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){xt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[..._(this,fn).values()].flat()}find(e){const n={exact:!0,...e};return this.getAll().find(i=>my(n,i))}findAll(e={}){return this.getAll().filter(n=>my(e,n))}notify(e){xt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return xt.batch(()=>Promise.all(e.map(n=>n.continue().catch(Nn))))}},fn=new WeakMap,$c=new WeakMap,Gx);function Ul(t){var e;return((e=t.options.scope)==null?void 0:e.id)??String(t.mutationId)}function yy(t){return{onFetch:(e,n)=>{var u,h,p,g,b;const i=e.options,r=(p=(h=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:h.fetchMore)==null?void 0:p.direction,s=((g=e.state.data)==null?void 0:g.pages)||[],o=((b=e.state.data)==null?void 0:b.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const d=async()=>{let m=!1;const k=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(e.signal.aborted?m=!0:e.signal.addEventListener("abort",()=>{m=!0}),e.signal)})},v=Tw(e.options,e.fetchOptions),y=async(x,S,w)=>{if(m)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const C={queryKey:e.queryKey,pageParam:S,direction:w?"backward":"forward",meta:e.options.meta};k(C);const R=await v(C),{maxPages:P}=e.options,N=w?dI:lI;return{pages:N(x.pages,R,P),pageParams:N(x.pageParams,S,P)}};if(r&&s.length){const x=r==="backward",S=x?xI:by,w={pages:s,pageParams:o},C=S(i,w);a=await y(w,C,x)}else{const x=t??s.length;do{const S=l===0?o[0]??i.initialPageParam:by(i,a);if(l>0&&S==null)break;a=await y(a,S),l++}while(l<x)}return a};e.options.persister?e.fetchFn=()=>{var m,k;return(k=(m=e.options).persister)==null?void 0:k.call(m,d,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=d}}}function by(t,{pages:e,pageParams:n}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,n[i],n):void 0}function xI(t,{pages:e,pageParams:n}){var i;return e.length>0?(i=t.getPreviousPageParam)==null?void 0:i.call(t,e[0],e,n[0],n):void 0}var at,jr,Ar,ea,ta,Or,na,ia,Qx,kI=(Qx=class{constructor(t={}){ee(this,at);ee(this,jr);ee(this,Ar);ee(this,ea);ee(this,ta);ee(this,Or);ee(this,na);ee(this,ia);q(this,at,t.queryCache||new vI),q(this,jr,t.mutationCache||new bI),q(this,Ar,t.defaultOptions||{}),q(this,ea,new Map),q(this,ta,new Map),q(this,Or,0)}mount(){xl(this,Or)._++,_(this,Or)===1&&(q(this,na,Vg.subscribe(async t=>{t&&(await this.resumePausedMutations(),_(this,at).onFocus())})),q(this,ia,ou.subscribe(async t=>{t&&(await this.resumePausedMutations(),_(this,at).onOnline())})))}unmount(){var t,e;xl(this,Or)._--,_(this,Or)===0&&((t=_(this,na))==null||t.call(this),q(this,na,void 0),(e=_(this,ia))==null||e.call(this),q(this,ia,void 0))}isFetching(t){return _(this,at).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return _(this,jr).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=_(this,at).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),i=_(this,at).build(this,n);return t.revalidateIfStale&&i.isStaleByTime(Uo(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(e)}}getQueriesData(t){return _(this,at).findAll(t).map(({queryKey:e,state:n})=>{const i=n.data;return[e,i]})}setQueryData(t,e,n){const i=this.defaultQueryOptions({queryKey:t}),r=_(this,at).get(i.queryHash),s=r==null?void 0:r.state.data,o=aI(e,s);if(o!==void 0)return _(this,at).build(this,i).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return xt.batch(()=>_(this,at).findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=_(this,at).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=_(this,at);xt.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=_(this,at),i={type:"active",...t};return xt.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries(i,e)))}cancelQueries(t={},e={}){const n={revert:!0,...e},i=xt.batch(()=>_(this,at).findAll(t).map(r=>r.cancel(n)));return Promise.all(i).then(Nn).catch(Nn)}invalidateQueries(t={},e={}){return xt.batch(()=>{if(_(this,at).findAll(t).forEach(i=>{i.invalidate()}),t.refetchType==="none")return Promise.resolve();const n={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(n,e)})}refetchQueries(t={},e){const n={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},i=xt.batch(()=>_(this,at).findAll(t).filter(r=>!r.isDisabled()).map(r=>{let s=r.fetch(void 0,n);return n.throwOnError||(s=s.catch(Nn)),r.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(i).then(Nn)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=_(this,at).build(this,e);return n.isStaleByTime(Uo(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Nn).catch(Nn)}fetchInfiniteQuery(t){return t.behavior=yy(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Nn).catch(Nn)}ensureInfiniteQueryData(t){return t.behavior=yy(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return ou.isOnline()?_(this,jr).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,at)}getMutationCache(){return _(this,jr)}getDefaultOptions(){return _(this,Ar)}setDefaultOptions(t){q(this,Ar,t)}setQueryDefaults(t,e){_(this,ea).set(Ws(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[..._(this,ea).values()];let n={};return e.forEach(i=>{Oc(t,i.queryKey)&&(n={...n,...i.defaultOptions})}),n}setMutationDefaults(t,e){_(this,ta).set(Ws(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[..._(this,ta).values()];let n={};return e.forEach(i=>{Oc(t,i.mutationKey)&&(n={...n,...i.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={..._(this,Ar).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Ug(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===Fg&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{..._(this,Ar).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){_(this,at).clear(),_(this,jr).clear()}},at=new WeakMap,jr=new WeakMap,Ar=new WeakMap,ea=new WeakMap,ta=new WeakMap,Or=new WeakMap,na=new WeakMap,ia=new WeakMap,Qx),Zt,Pe,qc,qt,Ps,ra,Dr,pi,Kc,sa,oa,Rs,Ns,Lr,aa,Ue,Xa,Np,Ip,jp,Ap,Op,Dp,Lp,jw,Jx,SI=(Jx=class extends _a{constructor(e,n){super();ee(this,Ue);ee(this,Zt);ee(this,Pe);ee(this,qc);ee(this,qt);ee(this,Ps);ee(this,ra);ee(this,Dr);ee(this,pi);ee(this,Kc);ee(this,sa);ee(this,oa);ee(this,Rs);ee(this,Ns);ee(this,Lr);ee(this,aa,new Set);this.options=n,q(this,Zt,e),q(this,pi,null),q(this,Dr,Rp()),this.options.experimental_prefetchInRender||_(this,Dr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,Pe).addObserver(this),xy(_(this,Pe),this.options)?ve(this,Ue,Xa).call(this):this.updateResult(),ve(this,Ue,Ap).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mp(_(this,Pe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mp(_(this,Pe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ve(this,Ue,Op).call(this),ve(this,Ue,Dp).call(this),_(this,Pe).removeObserver(this)}setOptions(e,n){const i=this.options,r=_(this,Pe);if(this.options=_(this,Zt).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Kn(this.options.enabled,_(this,Pe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ve(this,Ue,Lp).call(this),_(this,Pe).setOptions(this.options),i._defaulted&&!su(this.options,i)&&_(this,Zt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,Pe),observer:this});const s=this.hasListeners();s&&ky(_(this,Pe),r,this.options,i)&&ve(this,Ue,Xa).call(this),this.updateResult(n),s&&(_(this,Pe)!==r||Kn(this.options.enabled,_(this,Pe))!==Kn(i.enabled,_(this,Pe))||Uo(this.options.staleTime,_(this,Pe))!==Uo(i.staleTime,_(this,Pe)))&&ve(this,Ue,Np).call(this);const o=ve(this,Ue,Ip).call(this);s&&(_(this,Pe)!==r||Kn(this.options.enabled,_(this,Pe))!==Kn(i.enabled,_(this,Pe))||o!==_(this,Lr))&&ve(this,Ue,jp).call(this,o)}getOptimisticResult(e){const n=_(this,Zt).getQueryCache().build(_(this,Zt),e),i=this.createResult(n,e);return CI(this,i)&&(q(this,qt,i),q(this,ra,this.options),q(this,Ps,_(this,Pe).state)),i}getCurrentResult(){return _(this,qt)}trackResult(e,n){const i={};return Object.keys(e).forEach(r=>{Object.defineProperty(i,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),n==null||n(r),e[r])})}),i}trackProp(e){_(this,aa).add(e)}getCurrentQuery(){return _(this,Pe)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=_(this,Zt).defaultQueryOptions(e),i=_(this,Zt).getQueryCache().build(_(this,Zt),n);return i.fetch().then(()=>this.createResult(i,n))}fetch(e){return ve(this,Ue,Xa).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,qt)))}createResult(e,n){var P;const i=_(this,Pe),r=this.options,s=_(this,qt),o=_(this,Ps),a=_(this,ra),d=e!==i?e.state:_(this,qc),{state:u}=e;let h={...u},p=!1,g;if(n._optimisticResults){const N=this.hasListeners(),I=!N&&xy(e,n),L=N&&ky(e,i,n,r);(I||L)&&(h={...h,...Nw(u.data,e.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:b,errorUpdatedAt:m,status:k}=h;if(n.select&&h.data!==void 0)if(s&&h.data===(o==null?void 0:o.data)&&n.select===_(this,Kc))g=_(this,sa);else try{q(this,Kc,n.select),g=n.select(h.data),g=Pp(s==null?void 0:s.data,g,n),q(this,sa,g),q(this,pi,null)}catch(N){q(this,pi,N)}else g=h.data;if(n.placeholderData!==void 0&&g===void 0&&k==="pending"){let N;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))N=s.data;else if(N=typeof n.placeholderData=="function"?n.placeholderData((P=_(this,oa))==null?void 0:P.state.data,_(this,oa)):n.placeholderData,n.select&&N!==void 0)try{N=n.select(N),q(this,pi,null)}catch(I){q(this,pi,I)}N!==void 0&&(k="success",g=Pp(s==null?void 0:s.data,N,n),p=!0)}_(this,pi)&&(b=_(this,pi),g=_(this,sa),m=Date.now(),k="error");const v=h.fetchStatus==="fetching",y=k==="pending",x=k==="error",S=y&&v,w=g!==void 0,R={status:k,fetchStatus:h.fetchStatus,isPending:y,isSuccess:k==="success",isError:x,isInitialLoading:S,isLoading:S,data:g,dataUpdatedAt:h.dataUpdatedAt,error:b,errorUpdatedAt:m,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:v,isRefetching:v&&!y,isLoadingError:x&&!w,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:x&&w,isStale:zg(e,n),refetch:this.refetch,promise:_(this,Dr)};if(this.options.experimental_prefetchInRender){const N=j=>{R.status==="error"?j.reject(R.error):R.data!==void 0&&j.resolve(R.data)},I=()=>{const j=q(this,Dr,R.promise=Rp());N(j)},L=_(this,Dr);switch(L.status){case"pending":e.queryHash===i.queryHash&&N(L);break;case"fulfilled":(R.status==="error"||R.data!==L.value)&&I();break;case"rejected":(R.status!=="error"||R.error!==L.reason)&&I();break}}return R}updateResult(e){const n=_(this,qt),i=this.createResult(_(this,Pe),this.options);if(q(this,Ps,_(this,Pe).state),q(this,ra,this.options),_(this,Ps).data!==void 0&&q(this,oa,_(this,Pe)),su(i,n))return;q(this,qt,i);const r={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!_(this,aa).size)return!0;const l=new Set(a??_(this,aa));return this.options.throwOnError&&l.add("error"),Object.keys(_(this,qt)).some(d=>{const u=d;return _(this,qt)[u]!==n[u]&&l.has(u)})};(e==null?void 0:e.listeners)!==!1&&s()&&(r.listeners=!0),ve(this,Ue,jw).call(this,{...r,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ve(this,Ue,Ap).call(this)}},Zt=new WeakMap,Pe=new WeakMap,qc=new WeakMap,qt=new WeakMap,Ps=new WeakMap,ra=new WeakMap,Dr=new WeakMap,pi=new WeakMap,Kc=new WeakMap,sa=new WeakMap,oa=new WeakMap,Rs=new WeakMap,Ns=new WeakMap,Lr=new WeakMap,aa=new WeakMap,Ue=new WeakSet,Xa=function(e){ve(this,Ue,Lp).call(this);let n=_(this,Pe).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Nn)),n},Np=function(){ve(this,Ue,Op).call(this);const e=Uo(this.options.staleTime,_(this,Pe));if(Bs||_(this,qt).isStale||!_p(e))return;const i=ww(_(this,qt).dataUpdatedAt,e)+1;q(this,Rs,setTimeout(()=>{_(this,qt).isStale||this.updateResult()},i))},Ip=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,Pe)):this.options.refetchInterval)??!1},jp=function(e){ve(this,Ue,Dp).call(this),q(this,Lr,e),!(Bs||Kn(this.options.enabled,_(this,Pe))===!1||!_p(_(this,Lr))||_(this,Lr)===0)&&q(this,Ns,setInterval(()=>{(this.options.refetchIntervalInBackground||Vg.isFocused())&&ve(this,Ue,Xa).call(this)},_(this,Lr)))},Ap=function(){ve(this,Ue,Np).call(this),ve(this,Ue,jp).call(this,ve(this,Ue,Ip).call(this))},Op=function(){_(this,Rs)&&(clearTimeout(_(this,Rs)),q(this,Rs,void 0))},Dp=function(){_(this,Ns)&&(clearInterval(_(this,Ns)),q(this,Ns,void 0))},Lp=function(){const e=_(this,Zt).getQueryCache().build(_(this,Zt),this.options);if(e===_(this,Pe))return;const n=_(this,Pe);q(this,Pe,e),q(this,qc,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},jw=function(e){xt.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(_(this,qt))}),_(this,Zt).getQueryCache().notify({query:_(this,Pe),type:"observerResultsUpdated"})})},Jx);function wI(t,e){return Kn(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function xy(t,e){return wI(t,e)||t.state.data!==void 0&&Mp(t,e,e.refetchOnMount)}function Mp(t,e,n){if(Kn(e.enabled,t)!==!1){const i=typeof n=="function"?n(t):n;return i==="always"||i!==!1&&zg(t,e)}return!1}function ky(t,e,n,i){return(t!==e||Kn(i.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&zg(t,n)}function zg(t,e){return Kn(e.enabled,t)!==!1&&t.isStaleByTime(Uo(e.staleTime,t))}function CI(t,e){return!su(t.getCurrentResult(),e)}var Mr,Ur,en,Vi,Yi,ud,Up,Yx,TI=(Yx=class extends _a{constructor(n,i){super();ee(this,Yi);ee(this,Mr);ee(this,Ur);ee(this,en);ee(this,Vi);q(this,Mr,n),this.setOptions(i),this.bindMethods(),ve(this,Yi,ud).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var r;const i=this.options;this.options=_(this,Mr).defaultMutationOptions(n),su(this.options,i)||_(this,Mr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,en),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&Ws(i.mutationKey)!==Ws(this.options.mutationKey)?this.reset():((r=_(this,en))==null?void 0:r.state.status)==="pending"&&_(this,en).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=_(this,en))==null||n.removeObserver(this)}onMutationUpdate(n){ve(this,Yi,ud).call(this),ve(this,Yi,Up).call(this,n)}getCurrentResult(){return _(this,Ur)}reset(){var n;(n=_(this,en))==null||n.removeObserver(this),q(this,en,void 0),ve(this,Yi,ud).call(this),ve(this,Yi,Up).call(this)}mutate(n,i){var r;return q(this,Vi,i),(r=_(this,en))==null||r.removeObserver(this),q(this,en,_(this,Mr).getMutationCache().build(_(this,Mr),this.options)),_(this,en).addObserver(this),_(this,en).execute(n)}},Mr=new WeakMap,Ur=new WeakMap,en=new WeakMap,Vi=new WeakMap,Yi=new WeakSet,ud=function(){var i;const n=((i=_(this,en))==null?void 0:i.state)??Iw();q(this,Ur,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Up=function(n){xt.batch(()=>{var i,r,s,o,a,l,d,u;if(_(this,Vi)&&this.hasListeners()){const h=_(this,Ur).variables,p=_(this,Ur).context;(n==null?void 0:n.type)==="success"?((r=(i=_(this,Vi)).onSuccess)==null||r.call(i,n.data,h,p),(o=(s=_(this,Vi)).onSettled)==null||o.call(s,n.data,null,h,p)):(n==null?void 0:n.type)==="error"&&((l=(a=_(this,Vi)).onError)==null||l.call(a,n.error,h,p),(u=(d=_(this,Vi)).onSettled)==null||u.call(d,void 0,n.error,h,p))}
49this.listeners.forEach(h=>{h(_(this,Ur))})})},Yx),Aw=f.createContext(void 0),Ow=t=>{const e=f.useContext(Aw);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},_I=({client:t,children:e})=>(f.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),c.jsx(Aw.Provider,{value:t,children:e})),Dw=f.createContext(!1),EI=()=>f.useContext(Dw);Dw.Provider;function PI(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var RI=f.createContext(PI()),NI=()=>f.useContext(RI);function Lw(t,e){return typeof t=="function"?t(...e):!!t}function Fp(){}var II=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},jI=t=>{f.useEffect(()=>{t.clearReset()},[t])},AI=({result:t,errorResetBoundary:e,throwOnError:n,query:i})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&Lw(n,[t.error,i]),OI=t=>{t.suspense&&(t.staleTime===void 0&&(t.staleTime=1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},DI=(t,e)=>t.isLoading&&t.isFetching&&!e,LI=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Sy=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function MI(t,e,n){var u,h,p,g,b;const i=Ow(),r=EI(),s=NI(),o=i.defaultQueryOptions(t);(h=(u=i.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||h.call(u,o),o._optimisticResults=r?"isRestoring":"optimistic",OI(o),II(o,s),jI(s);const a=!i.getQueryCache().get(o.queryHash),[l]=f.useState(()=>new e(i,o)),d=l.getOptimisticResult(o);if(f.useSyncExternalStore(f.useCallback(m=>{const k=r?Fp:l.subscribe(xt.batchCalls(m));return l.updateResult(),k},[l,r]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),f.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),LI(o,d))throw Sy(o,l,s);if(AI({result:d,errorResetBoundary:s,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash)}))throw d.error;if((g=(p=i.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||g.call(p,o,d),o.experimental_prefetchInRender&&!Bs&&DI(d,r)){const m=a?Sy(o,l,s):(b=i.getQueryCache().get(o.queryHash))==null?void 0:b.promise;m==null||m.catch(Fp).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?d:l.trackResult(d)}function ya(t,e){return MI(t,SI)}function $h(t,e){const n=Ow(),[i]=f.useState(()=>new TI(n,t));f.useEffect(()=>{i.setOptions(t)},[i,t]);const r=f.useSyncExternalStore(f.useCallback(o=>i.subscribe(xt.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),s=f.useCallback((o,a)=>{i.mutate(o,a).catch(Fp)},[i]);if(r.error&&Lw(i.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:s,mutateAsync:r.mutate}}async function Mw(t){if(!t.ok){const e=await t.text()||t.statusText;let n=e;try{const i=JSON.parse(e);i&&typeof i=="object"&&(n=i.message||i.error||e)}catch{}throw new Error(n)}}async function v8(t,e,n){const i=await fetch(e,{method:t,headers:n?{"Content-Type":"application/json"}:{},body:n?JSON.stringify(n):void 0,credentials:"include"});return await Mw(i),i}const Uw=({on401:t})=>async({queryKey:e})=>{const n=await fetch(e[0],{credentials:"include"});return t==="returnNull"&&n.status===401?null:(await Mw(n),await n.json())},Eo=new kI({defaultOptions:{queries:{queryFn:Uw({on401:"throw"}),refetchInterval:!1,refetchOnWindowFocus:!1,staleTime:1/0,retry:!1},mutations:{retry:!1}}}),UI=1,FI=1e6;let qh=0;function VI(){return qh=(qh+1)%Number.MAX_SAFE_INTEGER,qh.toString()}const Kh=new Map,wy=t=>{if(Kh.has(t))return;const e=setTimeout(()=>{Kh.delete(t),uc({type:"REMOVE_TOAST",toastId:t})},FI);Kh.set(t,e)},zI=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,UI)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?wy(n):t.toasts.forEach(i=>{wy(i.id)}),{...t,toasts:t.toasts.map(i=>i.id===n||n===void 0?{...i,open:!1}:i)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},hd=[];let fd={toasts:[]};function uc(t){fd=zI(fd,t),hd.forEach(e=>{e(fd)})}function BI({...t}){const e=VI(),n=r=>uc({type:"UPDATE_TOAST",toast:{...r,id:e}}),i=()=>uc({type:"DISMISS_TOAST",toastId:e});return uc({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:r=>{r||i()}}}),{id:e,dismiss:i,update:n}}function no(){const[t,e]=f.useState(fd);return f.useEffect(()=>(hd.push(e),()=>{const n=hd.indexOf(e);n>-1&&hd.splice(n,1)}),[t]),{...t,toast:BI,dismiss:n=>uc({type:"DISMISS_TOAST",toastId:n})}}function Ee(t,e,{checkForDefaultPrevented:n=!0}={}){return function(r){if(t==null||t(r),n===!1||!r.defaultPrevented)return e==null?void 0:e(r)}}function WI(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Fw(...t){return e=>t.forEach(n=>WI(n,e))}function tt(...t){return f.useCallback(Fw(...t),t)}function HI(t,e=[]){let n=[];function i(s,o){const a=f.createContext(o),l=n.length;n=[...n,o];function d(h){const{scope:p,children:g,...b}=h,m=(p==null?void 0:p[t][l])||a,k=f.useMemo(()=>b,Object.values(b));return c.jsx(m.Provider,{value:k,children:g})}function u(h,p){const g=(p==null?void 0:p[t][l])||a,b=f.useContext(g);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return d.displayName=s+"Provider",[d,u]}const r=()=>{const s=n.map(o=>f.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return f.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return r.scopeName=t,[i,$I(r,...e)]}function $I(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=i.reduce((a,{useScope:l,scopeName:d})=>{const h=l(s)[`__scope${d}`];return{...a,...h}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var Hs=f.forwardRef((t,e)=>{const{children:n,...i}=t,r=f.Children.toArray(n),s=r.find(KI);if(s){const o=s.props.children,a=r.map(l=>l===s?f.Children.count(o)>1?f.Children.only(null):f.isValidElement(o)?o.props.children:null:l);return c.jsx(Vp,{...i,ref:e,children:f.isValidElement(o)?f.cloneElement(o,void 0,a):null})}return c.jsx(Vp,{...i,ref:e,children:n})});Hs.displayName="Slot";var Vp=f.forwardRef((t,e)=>{const{children:n,...i}=t;if(f.isValidElement(n)){const r=QI(n);return f.cloneElement(n,{...GI(i,n.props),ref:e?Fw(e,r):r})}return f.Children.count(n)>1?f.Children.only(null):null});Vp.displayName="SlotClone";var qI=({children:t})=>c.jsx(c.Fragment,{children:t});function KI(t){return f.isValidElement(t)&&t.type===qI}function GI(t,e){const n={...e};for(const i in e){const r=t[i],s=e[i];/^on[A-Z]/.test(i)?r&&s?n[i]=(...a)=>{s(...a),r(...a)}:r&&(n[i]=r):i==="style"?n[i]={...r,...s}
vendor: 5,688 bytes, line 49
49:i==="className"&&(n[i]=[r,s].filter(Boolean).join(" "))}return{...t,...n}}function QI(t){var i,r;let e=(i=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function Vw(t){const e=t+"CollectionProvider",[n,i]=HI(e),[r,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:b,children:m}=g,k=vr.useRef(null),v=vr.useRef(new Map).current;return c.jsx(r,{scope:b,itemMap:v,collectionRef:k,children:m})};o.displayName=e;const a=t+"CollectionSlot",l=vr.forwardRef((g,b)=>{const{scope:m,children:k}=g,v=s(a,m),y=tt(b,v.collectionRef);return c.jsx(Hs,{ref:y,children:k})});l.displayName=a;const d=t+"CollectionItemSlot",u="data-radix-collection-item",h=vr.forwardRef((g,b)=>{const{scope:m,children:k,...v}=g,y=vr.useRef(null),x=tt(b,y),S=s(d,m);return vr.useEffect(()=>(S.itemMap.set(y,{ref:y,...v}),()=>void S.itemMap.delete(y))),c.jsx(Hs,{[u]:"",ref:x,children:k})});h.displayName=d;function p(g){const b=s(t+"CollectionConsumer",g);return vr.useCallback(()=>{const k=b.collectionRef.current;if(!k)return[];const v=Array.from(k.querySelectorAll(`[${u}]`));return Array.from(b.itemMap.values()).sort((S,w)=>v.indexOf(S.ref.current)-v.indexOf(w.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:o,Slot:l,ItemSlot:h},p,i]}function JI(t,e){const n=f.createContext(e),i=s=>{const{children:o,...a}=s,l=f.useMemo(()=>a,Object.values(a));return c.jsx(n.Provider,{value:l,children:o})};i.displayName=t+"Provider";function r(s){const o=f.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[i,r]}function $u(t,e=[]){let n=[];function i(s,o){const a=f.createContext(o),l=n.length;n=[...n,o];const d=h=>{var v;const{scope:p,children:g,...b}=h,m=((v=p==null?void 0:p[t])==null?void 0:v[l])||a,k=f.useMemo(()=>b,Object.values(b));return c.jsx(m.Provider,{value:k,children:g})};d.displayName=s+"Provider";function u(h,p){var m;const g=((m=p==null?void 0:p[t])==null?void 0:m[l])||a,b=f.useContext(g);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[d,u]}const r=()=>{const s=n.map(o=>f.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return f.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return r.scopeName=t,[i,YI(r,...e)]}function YI(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=i.reduce((a,{useScope:l,scopeName:d})=>{const h=l(s)[`__scope${d}`];return{...a,...h}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var XI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Re=XI.reduce((t,e)=>{const n=f.forwardRef((i,r)=>{const{asChild:s,...o}=i,a=s?Hs:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(a,{...o,ref:r})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function zw(t,e){t&&eo.flushSync(()=>t.dispatchEvent(e))}function wn(t){const e=f.useRef(t);return f.useEffect(()=>{e.current=t}),f.useMemo(()=>(...n)=>{var i;return(i=e.current)==null?void 0:i.call(e,...n)},[])}function ZI(t,e=globalThis==null?void 0:globalThis.document){const n=wn(t);f.useEffect(()=>{const i=r=>{r.key==="Escape"&&n(r)};return e.addEventListener("keydown",i,{capture:!0}),()=>e.removeEventListener("keydown",i,{capture:!0})},[n,e])}var ej="DismissableLayer",zp="dismissableLayer.update",tj="dismissableLayer.pointerDownOutside",nj="dismissableLayer.focusOutside",Cy,Bw=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qu=f.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=t,d=f.useContext(Bw),[u,h]=f.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=f.useState({}),b=tt(e,R=>h(R)),m=Array.from(d.layers),[k]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=m.indexOf(k),y=u?m.indexOf(u):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=y>=v,w=rj(R=>{const P=R.target,N=[...d.branches].some(I=>I.contains(P));!S||N||(r==null||r(R),o==null||o(R),R.defaultPrevented||a==null||a())},p),C=sj(R=>{const P=R.target;[...d.branches].some(I=>I.contains(P))||(s==null||s(R),o==null||o(R),R.defaultPrevented||a==null||a())},p);return ZI(R=>{y===d.layers.size-1&&(i==null||i(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},p),f.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Cy=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),Ty(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Cy)}},[u,p,n,d]),f.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),Ty())},[u,d]),f.useEffect(()=>{const R=()=>g({});return document.addEventListener(zp,R),()=>document.removeEventListener(zp,R)},[]),c.jsx(Re.div,{...l,ref:b,style:{pointerEvents:x?S?"auto":"none":void 0,...t.style},onFocusCapture:Ee(t.onFocusCapture,C.onFocusCapture),onBlurCapture:Ee(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ee(t.onPointerDownCapture,w.onPointerDownCapture)})});qu.displayName=ej;var ij="DismissableLayerBranch",Ww=f.forwardRef((t,e)=>{const n=f.useContext(Bw),i=f.useRef(null),r=tt(e,i);return f.useEffect(()=>
49{const s=i.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),c.jsx(Re.div,{...t,ref:r})});Ww.displayName=ij;function rj(t,e=globalThis==null?void 0:globalThis.document){const n=wn(t),i=f.useRef(!1),r=f.useRef(()=>{});return f.useEffect(()=>{const s=a=>{if(a.target&&!i.current){let l=function(){Hw(tj,n,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",r.current),r.current=l,e.addEventListener("click",r.current,{once:!0})):l()}else e.removeEventListener("click",r.current);i.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",r.current)}},[e,n]),{onPointerDownCapture:()=>i.current=!0}}function sj(t,e=globalThis==null?void 0:globalThis.document){const n=wn(t),i=f.useRef(!1);return f.useEffect(()=>{const r=s=>{s.target&&!i.current&&Hw(nj,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",r),()=>e.removeEventListener("focusin",r)},[e,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Ty(){const t=new CustomEvent(zp);document.dispatchEvent(t)}function Hw(t,e,n,{discrete:i}){const r=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),i?zw(r,s):r.dispatchEvent(s)}var oj=qu,aj=Ww,Wt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},cj="Portal",Ku=f.forwardRef((t,e)=>{var a;const{container:n,...i}=t,[r,s]=f.useState(!1);Wt(()=>s(!0),[]);const o=n||r&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?EN.createPortal(c.jsx(Re.div,{...i,ref:e}),o):null});Ku.displayName=cj;function lj(t,e){return f.useReducer((n,i)=>e[n][i]??n,t)}var ml=t=>{const{present:e,children:n}=t,i=dj(e),r=typeof n=="function"?n({present:i.isPresent}):f.Children.only(n),s=tt(i.ref,uj(r));return typeof n=="function"||i.isPresent?f.cloneElement(r,{ref:s}):null};ml.displayName="Presence";function dj(t){const[e,n]=f.useState(),i=f.useRef({}),r=f.useRef(t),s=f.useRef("none"),o=t?"mounted":"unmounted",[a,l]=lj(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const d=Fl(i.current);s.current=a==="mounted"?d:"none"},[a]),Wt(()=>{const d=i.current,u=r.current;if(u!==t){const p=s.current,g=Fl(d);t?l("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?l("UNMOUNT"):l(u&&p!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=t}},[t,l]),Wt(()=>{if(e){let d;const u=e.ownerDocument.defaultView??window,h=g=>{const m=Fl(i.current).includes(g.animationName);if(g.target===e&&m&&(l("ANIMATION_END"),!r.current)){const k=e.style.animationFillMode;e.style.animationFillMode="forwards",d=u.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=k)})}},p=g=>{g.target===e&&(s.current=Fl(i.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{u.clearTimeout(d),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(d=>{d&&(i.current=getComputedStyle(d)),n(d)},[])}}function Fl(t){return(t==null?void 0:t.animationName)||"none"}function uj(t){var i,r;let e=(i=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function Dc({prop:t,defaultProp:e,onChange:n=()=>{}}){const[i,r]=hj({defaultProp:e,onChange:n}),s=t!==void 0,o=s?t:i,a=wn(n),l=f.useCallback(d=>{if(s){const h=typeof d=="function"?d(t):d;h!==t&&a(h)}else r(d)},[s,t,r,a]);return[o,l]}function hj({defaultProp:t,onChange:e}){const n=f.useState(t),[i]=n,r=f.useRef(i),s=wn(e);return f.useEffect(()=>{r.current!==i&&(s(i),r.current=i)},[i,r,s]),n}var fj="VisuallyHidden",Gu=f.forwardRef((t,e)=>c.jsx(Re.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));Gu.displayName=fj;var Bg="ToastProvider",[Wg,pj,mj]=Vw("Toast"),[$w,y8]=$u("Toast",[mj]),[gj,Qu]=$w(Bg),qw=t=>{const{__scopeToast:e,label:n="Notification",duration:i=5e3,swipeDirection:r="right",swipeThreshold:s=50,children:o}=t,[a,l]=f.useState(null),[d,u]=f.useState(0),h=f.useRef(!1),p=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Bg}\`. Expected non-empty \`string\`.`),c.jsx(Wg.Provider,{scope:e,children:c.jsx(gj,{scope:e,label:n,duration:i,swipeDirection:r,swipeThreshold:s,toastCount:d,viewport:
49a,onViewportChange:l,onToastAdd:f.useCallback(()=>u(g=>g+1),[]),onToastRemove:f.useCallback(()=>u(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:p,children:o})})};qw.displayName=Bg;var Kw="ToastViewport",vj=["F8"],Bp="toast.viewportPause",Wp="toast.viewportResume",Gw=f.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:i=vj,label:r="Notifications ({hotkey})",...s}=t,o=Qu(Kw,n),a=pj(n),l=f.useRef(null),d=f.useRef(null),u=f.useRef(null),h=f.useRef(null),p=tt(e,h,o.onViewportChange),g=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=o.toastCount>0;f.useEffect(()=>{const k=v=>{var x;i.length!==0&&i.every(S=>v[S]||v.code===S)&&((x=h.current)==null||x.focus())};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[i]),f.useEffect(()=>{const k=l.current,v=h.current;if(b&&k&&v){const y=()=>{if(!o.isClosePausedRef.current){const C=new CustomEvent(Bp);v.dispatchEvent(C),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const C=new CustomEvent(Wp);v.dispatchEvent(C),o.isClosePausedRef.current=!1}},S=C=>{!k.contains(C.relatedTarget)&&x()},w=()=>{k.contains(document.activeElement)||x()};return k.addEventListener("focusin",y),k.addEventListener("focusout",S),k.addEventListener("pointermove",y),k.addEventListener("pointerleave",w),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{k.removeEventListener("focusin",y),k.removeEventListener("focusout",S),k.removeEventListener("pointermove",y),k.removeEventListener("pointerleave",w),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[b,o.isClosePausedRef]);const m=f.useCallback(({tabbingDirection:k})=>{const y=a().map(x=>{const S=x.ref.current,w=[S,...Nj(S)];return k==="forwards"?w:w.reverse()});return(k==="forwards"?y.reverse():y).flat()},[a]);return f.useEffect(()=>{const k=h.current;if(k){const v=y=>{var w,C,R;const x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){const P=document.activeElement,N=y.shiftKey;if(y.target===k&&N){(w=d.current)==null||w.focus();return}const j=m({tabbingDirection:N?"backwards":"forwards"}),Z=j.findIndex(F=>F===P);Gh(j.slice(Z+1))?y.preventDefault():N?(C=d.current)==null||C.focus():(R=u.current)==null||R.focus()}};return k.addEventListener("keydown",v),()=>k.removeEventListener("keydown",v)}},[a,m]),c.jsxs(aj,{ref:l,role:"region","aria-label":r.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&c.jsx(Hp,{ref:d,onFocusFromOutsideViewport:()=>{const k=m({tabbingDirection:"forwards"});Gh(k)}}),c.jsx(Wg.Slot,{scope:n,children:c.jsx(Re.ol,{tabIndex:-1,...s,ref:p})}),b&&c.jsx(Hp,{ref:u,onFocusFromOutsideViewport:()=>{const k=m({tabbingDirection:"backwards"});Gh(k)}})]})});Gw.displayName=Kw;var Qw="ToastFocusProxy",Hp=f.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:i,...r}=t,s=Qu(Qw,n);return c.jsx(Gu,{"aria-hidden":!0,tabIndex:0,...r,ref:e,style:{position:"fixed"},onFocus:o=>{var d;const a=o.relatedTarget;!((d=s.viewport)!=null&&d.contains(a))&&i()}})});Hp.displayName=Qw;var Ju="Toast",yj="toast.swipeStart",bj="toast.swipeMove",xj="toast.swipeCancel",kj="toast.swipeEnd",Jw=f.forwardRef((t,e)=>{const{forceMount:n,open:i,defaultOpen:r,onOpenChange:s,...o}=t,[a=!0,l]=Dc({prop:i,defaultProp:r,onChange:s});return c.jsx(ml,{present:n||a,children:c.jsx(Cj,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:wn(t.onPause),onResume:wn(t.onResume),onSwipeStart:Ee(t.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ee(t.onSwipeMove,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:Ee(t.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ee(t.onSwipeEnd,d=>{const{x:u,y:h}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),l(!1)})})})});Jw.displayName=Ju;var[Sj,wj]=$w(Ju,{onClose(){}}
49),Cj=f.forwardRef((t,e)=>{const{__scopeToast:n,type:i="foreground",duration:r,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:d,onSwipeStart:u,onSwipeMove:h,onSwipeCancel:p,onSwipeEnd:g,...b}=t,m=Qu(Ju,n),[k,v]=f.useState(null),y=tt(e,F=>v(F)),x=f.useRef(null),S=f.useRef(null),w=r||m.duration,C=f.useRef(0),R=f.useRef(w),P=f.useRef(0),{onToastAdd:N,onToastRemove:I}=m,L=wn(()=>{var te;(k==null?void 0:k.contains(document.activeElement))&&((te=m.viewport)==null||te.focus()),o()}),j=f.useCallback(F=>{!F||F===1/0||(window.clearTimeout(P.current),C.current=new Date().getTime(),P.current=window.setTimeout(L,F))},[L]);f.useEffect(()=>{const F=m.viewport;if(F){const te=()=>{j(R.current),d==null||d()},Y=()=>{const K=new Date().getTime()-C.current;R.current=R.current-K,window.clearTimeout(P.current),l==null||l()};return F.addEventListener(Bp,Y),F.addEventListener(Wp,te),()=>{F.removeEventListener(Bp,Y),F.removeEventListener(Wp,te)}}},[m.viewport,w,l,d,j]),f.useEffect(()=>{s&&!m.isClosePausedRef.current&&j(w)},[s,w,m.isClosePausedRef,j]),f.useEffect(()=>(N(),()=>I()),[N,I]);const Z=f.useMemo(()=>k?iC(k):null,[k]);return m.viewport?c.jsxs(c.Fragment,{children:[Z&&c.jsx(Tj,{__scopeToast:n,role:"status","aria-live":i==="foreground"?"assertive":"polite","aria-atomic":!0,children:Z}),c.jsx(Sj,{scope:n,onClose:L,children:eo.createPortal(c.jsx(Wg.ItemSlot,{scope:n,children:c.jsx(oj,{asChild:!0,onEscapeKeyDown:Ee(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||L(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(Re.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection,...b,ref:y,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ee(t.onKeyDown,F=>{F.key==="Escape"&&(a==null||a(F.nativeEvent),F.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,L()))}),onPointerDown:Ee(t.onPointerDown,F=>{F.button===0&&(x.current={x:F.clientX,y:F.clientY})}),onPointerMove:Ee(t.onPointerMove,F=>{if(!x.current)return;const te=F.clientX-x.current.x,Y=F.clientY-x.current.y,K=!!S.current,A=["left","right"].includes(m.swipeDirection),U=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,Q=A?U(0,te):0,se=A?0:U(0,Y),de=F.pointerType==="touch"?10:2,Ae={x:Q,y:se},ye={originalEvent:F,delta:Ae};K?(S.current=Ae,Vl(bj,h,ye,{discrete:!1})):_y(Ae,m.swipeDirection,de)?(S.current=Ae,Vl(yj,u,ye,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(te)>de||Math.abs(Y)>de)&&(x.current=null)}),onPointerUp:Ee(t.onPointerUp,F=>{const te=S.current,Y=F.target;if(Y.hasPointerCapture(F.pointerId)&&Y.releasePointerCapture(F.pointerId),S.current=null,x.current=null,te){const K=F.currentTarget,A={originalEvent:F,delta:te};_y(te,m.swipeDirection,m.swipeThreshold)?Vl(kj,g,A,{discrete:!0}):Vl(xj,p,A,{discrete:!0}),K.addEventListener("click",U=>U.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),Tj=t=>{const{__scopeToast:e,children:n,...i}=t,r=Qu(Ju,e),[s,o]=f.useState(!1),[a,l]=f.useState(!1);return Pj(()=>o(!0)),f.useEffect(()=>{const d=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(d)},[]),a?null:c.jsx(Ku,{asChild:!0,children:c.jsx(Gu,{...i,children:s&&c.jsxs(c.Fragment,{children:[r.label," ",n]})})})},_j="ToastTitle",Yw=f.forwardRef((t,e)=>{const{__scopeToast:n,...i}=t;return c.jsx(Re.div,{...i,ref:e})});Yw.displayName=_j;var Ej="ToastDescription",Xw=f.forwardRef((t,e)=>{const{__scopeToast:n,...i}=t;return c.jsx(Re.div,{...i,ref:e})});Xw.displayName=Ej;var Zw="ToastAction",eC=f.forwardRef((t,e)=>{const{altText:n,...i}=t;return n.trim()?c.jsx(nC,{altText:n,asChild:!0,children:c.jsx(Hg,{...i,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${Zw}\`. Expected non-empty \`string\`.`),null)});eC.displayName=Zw;var tC="ToastClose",Hg=f.forwardRef((t,e)=>{const{__scopeToast:n,...i}=t,r=wj(tC,n);return c.jsx(nC,{asChild:!0,children:c.jsx(Re.button,{type:"button",...i,ref:e,onClick:Ee(t.onClick,r.onClose)})})});Hg.displayName=tC;var nC=f.forwardRef((t,e)=>{const{__scopeToast:n,altText:i,...r}=t;return c.jsx(Re.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":i||void 0,...r,ref:e})});function iC(t){const e=[];
49return Array.from(t.childNodes).forEach(i=>{if(i.nodeType===i.TEXT_NODE&&i.textContent&&e.push(i.textContent),Rj(i)){const r=i.ariaHidden||i.hidden||i.style.display==="none",s=i.dataset.radixToastAnnounceExclude==="";if(!r)if(s){const o=i.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...iC(i))}}),e}function Vl(t,e,n,{discrete:i}){const r=n.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),i?zw(r,s):r.dispatchEvent(s)}var _y=(t,e,n=0)=>{const i=Math.abs(t.x),r=Math.abs(t.y),s=i>r;return e==="left"||e==="right"?s&&i>n:!s&&r>n};function Pj(t=()=>{}){const e=wn(t);Wt(()=>{let n=0,i=0;return n=window.requestAnimationFrame(()=>i=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(i)}},[e])}function Rj(t){return t.nodeType===t.ELEMENT_NODE}function Nj(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Gh(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var Ij=qw,rC=Gw,sC=Jw,oC=Yw,aC=Xw,cC=eC,lC=Hg;function dC(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=dC(t[e]))&&(i&&(i+=" "),i+=n);else for(e in t)t[e]&&(i&&(i+=" "),i+=e);return i}function jj(){for(var t,e,n=0,i="";n<arguments.length;)(t=arguments[n++])&&(e=dC(t))&&(i&&(i+=" "),i+=e);return i}const Ey=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,Py=jj,$g=(t,e)=>n=>{var i;if((e==null?void 0:e.variants)==null)return Py(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:s}=e,o=Object.keys(r).map(d=>{const u=n==null?void 0:n[d],h=s==null?void 0:s[d];if(u===null)return null;const p=Ey(u)||Ey(h);return r[d][p]}),a=n&&Object.entries(n).reduce((d,u)=>{let[h,p]=u;return p===void 0||(d[h]=p),d},{}),l=e==null||(i=e.compoundVariants)===null||i===void 0?void 0:i.reduce((d,u)=>{let{class:h,className:p,...g}=u;return Object.entries(g).every(b=>{let[m,k]=b;return Array.isArray(k)?k.includes({...s,...a}[m]):{...s,...a}[m]===k})?[...d,h,p]:d},[]);return Py(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)};/** 50 * @license lucide-react v0.453.0 - ISC 51 * 52 * This source code is licensed under the ISC license. 53 * See the LICENSE file in the root directory of this source tree. 54 */const Aj=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),uC=(...t)=>t.filter((e,n,i)=>!!e&&i.indexOf(e)===n).join(" ");/** 55 * @license lucide-react v0.453.0 - ISC 56 * 57 * This source code is licensed under the ISC license. 58 * See the LICENSE file in the root directory of this source tree. 59 */var Oj={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 60 * @license lucide-react v0.453.0 - ISC 61 * 62 * This source code is licensed under the ISC license. 63 * See the LICENSE file in the root directory of this source tree. 64 */const Dj=f.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:r="",children:s,iconNode:o,...a},l)=>f.createElement("svg",{ref:l,...Oj,width:e,height:e,stroke:t,strokeWidth:i?Number(n)*24/Number(e):n,className:uC("lucide",r),...a},[...o.map(([d,u])=>f.createElement(d,u)),...Array.isArray(s)?s:[s]]));/** 65 * @license lucide-react v0.453.0 - ISC 66 * 67 * This source code is licensed under the ISC license. 68 * See the LICENSE file in the root directory of this source tree. 69 */const G=(t,e)=>{const n=f.forwardRef(({className:i,...r},s)=>f.createElement(Dj,{ref:s,iconNode:e,className:uC(`lucide-${Aj(t)}`,i),...r}));return n.displayName=`${t}`,n};/** 70 * @license lucide-react v0.453.0 - ISC 71 * 72 * This source code is licensed under the ISC license. 73 * See the LICENSE file in the root directory of this source tree. 74 */const Qh=G("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l
74-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** 75 * @license lucide-react v0.453.0 - ISC 76 * 77 * This source code is licensed under the ISC license. 78 * See the LICENSE file in the root directory of this source tree. 79 */const Lc=G("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 80 * @license lucide-react v0.453.0 - ISC 81 * 82 * This source code is licensed under the ISC license. 83 * See the LICENSE file in the root directory of this source tree. 84 */const Lj=G("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/** 85 * @license lucide-react v0.453.0 - ISC 86 * 87 * This source code is licensed under the ISC license. 88 * See the LICENSE file in the root directory of this source tree. 89 */const Mj=G("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** 90 * @license lucide-react v0.453.0 - ISC 91 * 92 * This source code is licensed under the ISC license. 93 * See the LICENSE file in the root directory of this source tree. 94 */const zl=G("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** 95 * @license lucide-react v0.453.0 - ISC 96 * 97 * This source code is licensed under the ISC license. 98 * See the LICENSE file in the root directory of this source tree. 99 */const hC=G("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** 100 * @license lucide-react v0.453.0 - ISC 101 * 102 * This source code is licensed under the ISC license. 103 * See the LICENSE file in the root directory of this source tree. 104 */const pd=G("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 105 * @license lucide-react v0.453.0 - ISC 106 * 107 * This source code is licensed under the ISC license. 108 * See the LICENSE file in the root directory of this source tree. 109 */const Bl=G("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/** 110 * @license lucide-react v0.453.0 - ISC 111 * 112 * This source code is licensed under the ISC license. 113 * See the LICENSE file in the root directory of this source tree. 114 */const Uj=G("CalendarPlus",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M19 16v6",key:"tddt3s"}]]);/** 115 * @license lucide-react v0.453.0 - ISC 116 * 117 * This source code is licensed under the ISC license. 118 * See the LICENSE file in the root directory of this source tree. 119 */const Ry=G("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 120 * @license lucide-react v0.453.0 - ISC 121 * 122 * This source code is licensed under the ISC license. 123 * See the LICENSE file in the root directory of this source tree. 124 */const fC=G("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** 125 * @license lucide-react v0.453.0 - ISC 126 * 127 * This source code is licensed under the ISC license. 128 * See the LICENSE file in the root directory of this source tree. 129 */const Wl=G("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** 130 * @license lucide-react v0.453.0 - ISC 131 * 132 * This source code is licensed under the ISC license. 133 * See the LICENSE file in the root directory of this source tree. 134 */const Yu=G("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 135 * @license lucide-react v0.453.0 - ISC 136 * 137 * This source code is licensed under the ISC license. 138 * See the LICENSE file in the root directory of this source tree. 139 */const Yr=G("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 140 * @license lucide-react v0.453.0 - ISC 141 * 142 * This source code is licensed under the ISC license. 143 * See the LICENSE file in the root directory of this source tree. 144 */const Fj=G("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 145 * @license lucide-react v0.453.0 - ISC 146 * 147 * This source code is licensed under the ISC license. 148 * See the LICENSE file in the root directory of this source tree. 149 */const Vj=G("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 150 * @license lucide-react v0.453.0 - ISC 151 * 152 * This source code is licensed under the ISC license. 153 * See the LICENSE file in the root directory of this source tree. 154 */const zj=G("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 155 * @license lucide-react v0.453.0 - ISC 156 * 157 * This source code is licensed under the ISC license. 158 * See the LICENSE file in the root directory of this source tree. 159 */const Bj=G("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** 160 * @license lucide-react v0.453.0 - ISC 161 * 162 * This source code is licensed under the ISC license. 163 * See the LICENSE file in the root directory of this source tree. 164 */const Wj=G("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 165 * @license lucide-react v0.453.0 - ISC 166 * 167 * This source code is licensed under the ISC license. 168 * See the LICENSE file in the root directory of this source tree. 169 */const vs=G("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 170 * @license lucide-react v0.453.0 - ISC 171 * 172 * This source code is licensed under the ISC license. 173 * See the LICENSE file in the root directory of this source tree. 174 */const _r=G("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/** 175 * @license lucide-react v0.453.0 - ISC 176 * 177 * This source code is licensed under the ISC license. 178 * See the LICENSE file in the root directory of this source tree. 179 */const Hj=G("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** 180 * @license lucide-react v0.453.0 - ISC 181 * 182 * This source code is licensed under the ISC license. 183 * See the LICENSE file in the root directory of this source tree. 184 */const $j=G("FilePenLine",[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",ke
184y:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]]);/** 185 * @license lucide-react v0.453.0 - ISC 186 * 187 * This source code is licensed under the ISC license. 188 * See the LICENSE file in the root directory of this source tree. 189 */const fs=G("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 190 * @license lucide-react v0.453.0 - ISC 191 * 192 * This source code is licensed under the ISC license. 193 * See the LICENSE file in the root directory of this source tree. 194 */const Jh=G("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** 195 * @license lucide-react v0.453.0 - ISC 196 * 197 * This source code is licensed under the ISC license. 198 * See the LICENSE file in the root directory of this source tree. 199 */const qj=G("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 200 * @license lucide-react v0.453.0 - ISC 201 * 202 * This source code is licensed under the ISC license. 203 * See the LICENSE file in the root directory of this source tree. 204 */const Kj=G("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/** 205 * @license lucide-react v0.453.0 - ISC 206 * 207 * This source code is licensed under the ISC license. 208 * See the LICENSE file in the root directory of this source tree. 209 */const Ny=G("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/** 210 * @license lucide-react v0.453.0 - ISC 211 * 212 * This source code is licensed under the ISC license. 213 * See the LICENSE file in the root directory of this source tree. 214 */const Gj=G("HardHat",[["path",{d:"M2 18a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v2z",key:"1dej2m"}],["path",{d:"M10 10V5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v5",key:"1p9q5i"}],["path",{d:"M4 15v-3a6 6 0 0 1 6-6",key:"9ciidu"}],["path",{d:"M14 6a6 6 0 0 1 6 6v3",key:"1hnv84"}]]);/** 215 * @license lucide-react v0.453.0 - ISC 216 * 217 * This source code is licensed under the ISC license. 218 * See the LICENSE file in the root directory of this source tree. 219 */const Qj=G("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);/** 220 * @license lucide-react v0.453.0 - ISC 221 * 222 * This source code is licensed under the ISC license. 223 * See the LICENSE file in the root directory of this source tree. 224 */const Jj=G("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** 225 * @license lucide-react v0.453.0 - ISC 226 * 227 * This source code is licensed under the ISC license. 228 * See the LICENSE file in the root directory of this source tree. 229 */const Yj=G("Hotel",[["path",{d:"M10 22v-6.57",key:"1wmca3"}],["path",{d:"M12 11h.01",key:"z322tv"}],["path",{d:"M12 7h.01",key:"1ivr5q"}],["path",{d:"M14 15.43V22",key:"1q2vjd"}],["path",{d:"M15 16a5 5 0 0 0-6 0",key:"o9wqvi"}],["path",{d:"M16 11h.01",key:"xkw8gn"}],["path",{d:"M16 7h.01",key:"1kdx03"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 7h.01",key:"1vti4s"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]]);/** 230 * @license lucide-react v0.453.0 - ISC 231 * 232 * This source code is licensed under the ISC license. 233 * See the LICENSE file in the root directory of this source tree. 234 */const qg=G("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** 235 * @license lucide-react v0.453.0 - ISC 236 * 237 * This source code is licensed under the ISC license. 238 * See the LICENSE file in the root directory of this source tree. 239 */const Xj=G("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 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",key:"oot6mr"}]]);/** 240 * @license lucide-react v0.453.0 - ISC 241 * 242 * This source code is licensed under the ISC license. 243 * See the LICENSE file in the root directory of this source tree. 244 */const Zj=G("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/** 245 * @license lucide-react v0.453.0 - ISC 246 * 247 * This source code is licensed under the ISC license. 248 * See the LICENSE file in the root directory of this source tree. 249 */const eA=G("Landmark",[["line",{x1:"3",x2:"21",y1:"22",y2:"22",key:"j8o0r"}],["line",{x1:"6",x2:"6",y1:"18",y2:"11",key:"10tf0k"}],["line",{x1:"10",x2:"10",y1:"18",y2:"11",key:"54lgf6"}],["line",{x1:"14",x2:"14",y1:"18",y2:"11",key:"380y"}],["line",{x1:"18",x2:"18",y1:"18",y2:"11",key:"1kevvc"}],["polygon",{points:"12 2 20 7 4 7",key:"jkujk7"}]]);/** 250 * @license lucide-react v0.453.0 - ISC 251 * 252 * This source code is licensed under the ISC license. 253 * See the LICENSE file in the root directory of this source tree. 254 */const Iy=G("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** 255 * @license lucide-react v0.453.0 - ISC 256 * 257 * This source code is licensed under the ISC license. 258 * See the LICENSE file in the root directory of this source tree.
259 */const jy=G("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** 260 * @license lucide-react v0.453.0 - ISC 261 * 262 * This source code is licensed under the ISC license. 263 * See the LICENSE file in the root directory of this source tree. 264 */const tA=G("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/** 265 * @license lucide-react v0.453.0 - ISC 266 * 267 * This source code is licensed under the ISC license. 268 * See the LICENSE file in the root directory of this source tree. 269 */const io=G("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 270 * @license lucide-react v0.453.0 - ISC 271 * 272 * This source code is licensed under the ISC license. 273 * See the LICENSE file in the root directory of this source tree. 274 */const nA=G("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 275 * @license lucide-react v0.453.0 - ISC 276 * 277 * This source code is licensed under the ISC license. 278 * See the LICENSE file in the root directory of this source tree. 279 */const Yh=G("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 280 * @license lucide-react v0.453.0 - ISC 281 * 282 * This source code is licensed under the ISC license. 283 * See the LICENSE file in the root directory of this source tree. 284 */const iA=G("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** 285 * @license lucide-react v0.453.0 - ISC 286 * 287 * This source code is licensed under the ISC license. 288 * See the LICENSE file in the root directory of this source tree. 289 */const pC=G("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** 290 * @license lucide-react v0.453.0 - ISC 291 * 292 * This source code is licensed under the ISC license. 293 * See the LICENSE file in the root directory of this source tree. 294 */const rA=G("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** 295 * @license lucide-react v0.453.0 - ISC 296 * 297 * This source code is licensed under the ISC license. 298 * See the LICENSE file in the root directory of this source tree. 299 */const md=G("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 300 * @license lucide-react v0.453.0 - ISC 301 * 302 * This source code is licensed under the ISC license. 303 * See the LICENSE file in the root directory of this source tree. 304 */const sA=G("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** 305 * @license lucide-react v0.453.0 - ISC 306 * 307 * This source code is licensed under the ISC license. 308 * See the LICENSE file in the root directory of this source tree. 309 */const oA=G("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** 310 * @license lucide-react v0.453.0 - ISC 311 * 312 * This source code is licensed under the ISC license. 313 * See the LICENSE file in the root directory of this source tree. 314 */const mC=G("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** 315 * @license lucide-react v0.453.0 - ISC 316 * 317 * This source code is licensed under the ISC license. 318 * See the LICENSE file in the root directory of this source tree. 319 */const gC=G("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** 320 * @license lucide-react v0.453.0 - ISC 321 * 322 * This source code is licensed under the ISC license. 323 * See the LICENSE file in the root directory of this source tree. 324 */const aA=G("MonitorUp",[["path",{d:"m9 10 3-3 3 3",key:"11gsxs"}],["path",{d:"M12 13V7",key:"h0r20n"}],["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}]]);/** 325 * @license lucide-react v0.453.0 - ISC 326 * 327 * This source code is licensed under the ISC license. 328 * See the LICENSE file in the root directory of this source tree. 329 */const vC=G("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** 330 * @license lucide-react v0.453.0 - ISC 331 * 332 * This source code is licensed under the ISC license. 333 * See the LICENSE file in the root directory of this source tree. 334 */const Ay=G("Move",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]);/** 335 * @license lucide-react v0.453.0 - ISC 336 * 337 * This source code is licensed under the ISC license. 338 * See the LICENSE file in the root directory of this source tree. 339 */const Oy=G("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/** 340 * @license lucide-react v0.453.0 - ISC 341 * 342 * This source code is licensed under the ISC license. 343 * See the LICENSE file in the root directory of this source tree. 344 */const cA=G("PaintRoller",[["rect",{width:"16",height:"6",x:"2",y:"2",rx:"2",key:"jcyz7m"}],["path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2",key:"1b9h7c"}],["rect",{width:"4",height:"6",x:"8",y:"16",rx:"1",key:"d6e7yl"}]]);/** 345 * @license lucide-react v0.453.0 - ISC 346 * 347 * This source code is licensed under the ISC license. 348 * See the LICENSE file in the root directory of this source tree. 349 */const lA=G("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** 350 * @license lucide-react v0.453.0 - ISC 351 * 352 * This source code is licensed under the ISC license. 353 * See the LICENSE file in the root directory of this source tree. 354 */const yC=G("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);/** 355 * @license lucide-react v0.453.0 - ISC 356 * 357 * This source code is licensed under the ISC license. 358 * See the LICENSE file in the root directory of this source tree. 359 */const dA=G("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** 360 * @license lucide-react v0.453.0 - ISC 361 * 362 * This source code is licensed under the ISC license. 363 * See the LICENSE file in the root directory of this source tree. 364 */const Dy=G("PhoneCall",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}],["path",{d:"M14.05 2a9 9 0 0 1 8 7.94",key:"vmijpz"}],["path",{d:"M14.05 6A5 5 0 0 1 18 10",key:"13nbpp"}]]);/** 365 * @license lucide-react v0.453.0 - ISC 366 * 367 * This source code is licensed under the ISC license. 368 * See the LICENSE file in the root directory of this source tree. 369 */const gd=G("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 370 * @license lucide-react v0.453.0 - ISC 371 * 372 * This source code is licensed under the ISC license. 373 * See the LICENSE file in the root directory of this source tree. 374 */const uA=G("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 375 * @license lucide-react v0.453.0 - ISC 376 * 377 * This source code is licensed under the ISC license. 378 * See the LICENSE file in the root directory of this source tree. 379 */const hA=G("Presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]);/** 380 * @license lucide-react v0.453.0 - ISC 381 * 382 * This source code is licensed under the ISC license. 383 * See the LICENSE file in the root directory of this source tree. 384 */const fA=G("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** 385 * @license lucide-react v0.453.0 - ISC 386 * 387 * This source code is licensed under the ISC license. 388 * See the LICENSE file in the root directory of this source tree. 389 */const $p=G("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3
389kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** 390 * @license lucide-react v0.453.0 - ISC 391 * 392 * This source code is licensed under the ISC license. 393 * See the LICENSE file in the root directory of this source tree. 394 */const pA=G("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/** 395 * @license lucide-react v0.453.0 - ISC 396 * 397 * This source code is licensed under the ISC license. 398 * See the LICENSE file in the root directory of this source tree. 399 */const mA=G("Scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);/** 400 * @license lucide-react v0.453.0 - ISC 401 * 402 * This source code is licensed under the ISC license. 403 * See the LICENSE file in the root directory of this source tree. 404 */const gA=G("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 405 * @license lucide-react v0.453.0 - ISC 406 * 407 * This source code is licensed under the ISC license. 408 * See the LICENSE file in the root directory of this source tree. 409 */const Kg=G("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** 410 * @license lucide-react v0.453.0 - ISC 411 * 412 * This source code is licensed under the ISC license. 413 * See the LICENSE file in the root directory of this source tree. 414 */const Xh=G("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 415 * @license lucide-react v0.453.0 - ISC 416 * 417 * This source code is licensed under the ISC license. 418 * See the LICENSE file in the root directory of this source tree. 419 */const oo=G("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** 420 * @license lucide-react v0.453.0 - ISC 421 * 422 * This source code is licensed under the ISC license. 423 * See the LICENSE file in the root directory of this source tree. 424 */const vA=G("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/** 425 * @license lucide-react v0.453.0 - ISC 426 * 427 * This source code is licensed under the ISC license. 428 * See the LICENSE file in the root directory of this source tree. 429 */const Gi=G("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 430 * @license lucide-react v0.453.0 - ISC 431 * 432 * This source code is licensed under the ISC license. 433 * See the LICENSE file in the root directory of this source tree. 434 */const au=G("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** 435 * @license lucide-react v0.453.0 - ISC 436 * 437 * This source code is licensed under the ISC license. 438 * See the LICENSE file in the root directory of this source tree. 439 */const yA=G("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/** 440 * @license lucide-react v0.453.0 - ISC 441 * 442 * This source code is licensed under the ISC license. 443 * See the LICENSE file in the root directory of this source tree. 444 */const bA=G("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** 445 * @license lucide-react v0.453.0 - ISC 446 * 447 * This source code is licensed under the ISC license. 448 * See the LICENSE file in the root directory of this source tree. 449 */const bC=G("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 450 * @license lucide-react v0.453.0 - ISC 451 * 452 * This source code is licensed under the ISC license. 453 * See the LICENSE file in the root directory of this source tree. 454 */const xA=G("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 455 * @license lucide-react v0.453.0 - ISC 456 * 457 * This source code is licensed under the ISC license. 458 * See the LICENSE file in the root directory of this source tree. 459 */const kA=G("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/** 460 * @license lucide-react v0.453.0 - ISC 461 * 462 * This source code is licensed under the ISC license. 463 * See the LICENSE file in the root directory of this source tree. 464 */const SA=G("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}
vendor: 9,590 bytes, lines 464-509
464],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** 465 * @license lucide-react v0.453.0 - ISC 466 * 467 * This source code is licensed under the ISC license. 468 * See the LICENSE file in the root directory of this source tree. 469 */const wA=G("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** 470 * @license lucide-react v0.453.0 - ISC 471 * 472 * This source code is licensed under the ISC license. 473 * See the LICENSE file in the root directory of this source tree. 474 */const CA=G("UserSearch",[["circle",{cx:"10",cy:"7",r:"4",key:"e45bow"}],["path",{d:"M10.3 15H7a4 4 0 0 0-4 4v2",key:"3bnktk"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}]]);/** 475 * @license lucide-react v0.453.0 - ISC 476 * 477 * This source code is licensed under the ISC license. 478 * See the LICENSE file in the root directory of this source tree. 479 */const Ly=G("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 480 * @license lucide-react v0.453.0 - ISC 481 * 482 * This source code is licensed under the ISC license. 483 * See the LICENSE file in the root directory of this source tree. 484 */const po=G("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 485 * @license lucide-react v0.453.0 - ISC 486 * 487 * This source code is licensed under the ISC license. 488 * See the LICENSE file in the root directory of this source tree. 489 */const Mt=G("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/** 490 * @license lucide-react v0.453.0 - ISC 491 * 492 * This source code is licensed under the ISC license. 493 * See the LICENSE file in the root directory of this source tree. 494 */const TA=G("Wind",[["path",{d:"M17.7 7.7a2.5 2.5 0 1 1 1.8 4.3H2",key:"1k4u03"}],["path",{d:"M9.6 4.6A2 2 0 1 1 11 8H2",key:"b7d0fd"}],["path",{d:"M12.6 19.4A2 2 0 1 0 14 16H2",key:"1p5cb3"}]]);/** 495 * @license lucide-react v0.453.0 - ISC 496 * 497 * This source code is licensed under the ISC license. 498 * See the LICENSE file in the root directory of this source tree. 499 */const _A=G("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** 500 * @license lucide-react v0.453.0 - ISC 501 * 502 * This source code is licensed under the ISC license. 503 * See the LICENSE file in the root directory of this source tree. 504 */const Si=G("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 505 * @license lucide-react v0.453.0 - ISC 506 * 507 * This source code is licensed under the ISC license. 508 * See the LICENSE file in the root directory of this source tree. 509 */const cu=G("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function xC(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=xC(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function EA(){for(var t,e,n=0,i="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=xC(t))&&(i&&(i+=" "),i+=e);return i}const Gg="-",PA=t=>{const e=NA(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:o=>{const a=o.split(Gg);return a[0]===""&&a.length!==1&&a.shift(),kC(a,e)||RA(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&i[o]?[...l,...i[o]]:l}}},kC=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],i=e.nextPart.get(n),r=i?kC(t.slice(1),i):void 0;if(r)return r;if(e.validators.length===0)return;const s=t.join(Gg);return(o=e.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},My=/^\[(.+)\]$/,RA=t=>{if(My.test(t)){const e=My.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},NA=t=>{const{theme:e,prefix:n}=t,i={nextPart:new Map,validators:[]};return jA(Object.entries(t.classGroups),n).forEach(([s,o])=>{qp(o,i,s,e)}),i},qp=(t,e,n,i)=>{t.forEach(r=>{if(typeof r=="string"){const s=r===""?e:Uy(e,r);s.classGroupId=n;return}if(typeof r=="function"){if(IA(r)){qp(r(i),e,n,i);return}e.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([s,o])=>{qp(o,Uy(e,s),n,i)})})},Uy=(t,e)=>{let n=t;return e.split(Gg).forEach(i=>{n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n},IA=t=>t.isThemeGetter,jA=(t,e)=>e?t.map(([n,i])=>{const r=i.map(s=>typeof s=="string"?e+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[e+o,a])):s);return[n,r]}):t,AA=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,i=new Map;const r=(s,o)=>{n.set(s,o),e++,e>t&&(e=0,i=n,n=new Map)};return{get(s){let o=n.get(s);if(o!==void 0)return o;if((o=i.get(s))!==void 0)return r(s,o),o},set(s,o){n.has(s)?n.set(s,o):r(s,o)}}},SC="!",OA=t=>{const{separator:e,experimentalParseClassName:n}=t,i=e.length===1,r=e[0],s=e.length,o=a=>{const l=[];let d=0,u=0,h;for(let k=0;k<a.length;k++){let v=a[k];if(d===0){if(v===r&&(i||a.slice(k,k+s)===e)){l.push(a.slice(u,k)),u=k+s;continue}if(v==="/"){h=k;continue}}v==="["?d++:v==="]"&&d--}const p=l.length===0?a:a.substring(u),g=p.startsWith(SC),b=g?p.substring(1):p,m=h&&h>u?h-u:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:o}):o},DA=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(i=>{i[0]==="["?(e.push(...n.sort(),i),n=[]):n.push(i)}),e.push(...n.sort()),e},LA=t=>({cache:AA(t.cacheSize),parseClassName:OA(t),...PA(t)}),MA=/\s+/,UA=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:r}=e,s=[],o=t.trim().split(MA);let a="";for(let l=o.length-1;l>=0;l-=1){const d=o[l],{modifiers:u,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:g}=n(d);let b=!!g,m=i(b?p.substring(0,g):p);if(!m){if(!b){a=d+(a.length>0?" "+a:a);continue}if(m=i(p),!m){a=d+(a.length>0?" "+a:a);continue}b=!1}const k=DA(u).join(":"),v=h?k+SC:k,y=v+m;if(s.includes(y))continue;s.push(y);const x=r(m,b);for(let S=0;S<x.length;++S){const w=x[S];s.push(v+w)}a=d+(a.length>0?" "+a:a)}return a};function FA(){let t=0,e,n,i="";for(;t<arguments.length;)(e=arguments[t++])&&(n=wC(e))&&(i&&(i+=" "),i+=n);return i}const wC=t=>{if(typeof t=="string")return t;let e,n="";for(let i=0;i<t.length;i++)t[i]&&(e=wC(t[i]))&&(n&&(n+=" "),n+=e);return n};function VA(t,...e){let n,i,r,s=o;function o(l){const d=e.reduce((u,h)=>h(u),t());return n=LA(d),i=n.cache.get,r=n.cache.set,s=a,a(l)}function a(l){const d=i(l);if(d)return d;const u=UA(l,n);return r(l,u),u}return function(){return s(FA.apply(null,arguments))}}const Ge=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},CC=/^\[(?:([a-z-]+):)?(.+)\]$/i,zA=/^\d+\/\d+$/,BA=new Set(["px","full","screen"]),WA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,HA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$A=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,qA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ji=t=>Fo(t)||BA.has(t)||zA.test(t),hr=t=>Ea(t,"length",tO),Fo=t=>!!t&&!Number.isNaN(Number(t)),Zh=t=>Ea(t,"number",Fo),Va=t=>!!t&&Number.isInteger(Number(t)),GA=t=>t.endsWith("%")&&Fo(t.slice(0,-1)),ge=t=>CC.test(t),fr=t=>WA.test(t),QA=new Set(["length","size","percentage"]),JA=t=>Ea(t,QA,TC),YA=t=>Ea(t,"position",TC),XA=new Set(["image","url"]),ZA=t=>Ea(t,XA,iO),eO=t=>Ea(t,"",nO),za=()=>!0,Ea=(t,e,n)=>{const i=CC.exec(t);return i?i[1]?typeof e=="string"?i[1]===e:e.has(i[1]):n(i[2]):!1},tO=t=>HA.test(t)&&!$A.test(t),TC=()=>!1,nO=t=>qA.test(t),iO=t=>KA.test(t),rO=()=>{const t=Ge("colors"),e=Ge("spacing"),n=Ge("blur"),i=Ge("brightness"),r=Ge("borderColor"),s=Ge("borderRadius"),o=Ge("borderSpacing"),a=Ge("borderWidth"),l=Ge("contrast"),d=Ge("grayscale"),u=Ge("hueRotate"),h=Ge("invert"),p=Ge("gap"),g=Ge("gradientColorStops"),b=Ge("gradientColorStopPositions"),m=Ge("inset"),k=Ge("margin"),v=Ge("opacity"),y=Ge("padding"),x=Ge("saturate"),S=Ge("scale"),w=Ge("sepia"),C=Ge("skew"),R=Ge("space"),P=Ge("translate"),N=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",ge,e],j=()=>[ge,e],Z=()=>["",ji,hr],F=()=>["auto",Fo,ge],te=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",ge],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],se=()=>[Fo,ge];return{cacheSize:500,separator:":",theme:{colors:[za],spacing:[ji,hr],blur:["none","",fr,ge],brightness:se(),borderColor:[t],borderRadius:["n
509one","","full",fr,ge],borderSpacing:j(),borderWidth:Z(),contrast:se(),grayscale:U(),hueRotate:se(),invert:U(),gap:j(),gradientColorStops:[t],gradientColorStopPositions:[GA,hr],inset:L(),margin:L(),opacity:se(),padding:j(),saturate:se(),scale:se(),sepia:U(),skew:se(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",ge]}],container:["container"],columns:[{columns:[fr]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...te(),ge]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Va,ge]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ge]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",Va,ge]}],"grid-cols":[{"grid-cols":[za]}],"col-start-end":[{col:["auto",{span:["full",Va,ge]},ge]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[za]}],"row-start-end":[{row:["auto",{span:[Va,ge]},ge]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ge]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ge]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ge,e]}],"min-w":[{"min-w":[ge,e,"min","max","fit"]}],"max-w":[{"max-w":[ge,e,"none","full","min","max","fit","prose",{screen:[fr]},fr]}],h:[{h:[ge,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ge,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ge,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ge,e,"auto","min","max","fit"]}],"font-size":[{text:["base",fr,hr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Zh]}],"font-family":[{font:[za]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ge]}],"line-clamp":[{"line-clamp":["none",Fo,Zh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ji,ge]}],"list-image":[{"list-image":["none",ge]}],"list-style-type":[{list:["none","disc","decimal",ge]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ji,hr]}],"underline-offset":[{"underline-offset":["auto",ji,ge]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...te(),YA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",JA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ZA]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[b]}
vendor: 5,182 bytes, line 509
509],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:Y()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[ji,ge]}],"outline-w":[{outline:[ji,hr]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[ji,hr]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",fr,eO]}],"shadow-color":[{shadow:[za]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[i]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",fr,ge]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[h]}],saturate:[{saturate:[x]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ge]}],duration:[{duration:se()}],ease:[{ease:["linear","in","out","in-out",ge]}],delay:[{delay:se()}],animate:[{animate:["none","spin","ping","pulse","bounce",ge]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Va,ge]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ge]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ge]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
509],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ge]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ji,hr,Zh]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},sO=VA(rO);function De(...t){return sO(EA(t))}const oO=Ij,_C=f.forwardRef(({className:t,...e},n)=>c.jsx(rC,{ref:n,className:De("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:left-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));_C.displayName=rC.displayName;const aO=$g("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-left-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),EC=f.forwardRef(({className:t,variant:e,...n},i)=>c.jsx(sC,{ref:i,className:De(aO({variant:e}),t),...n}));EC.displayName=sC.displayName;const cO=f.forwardRef(({className:t,...e},n)=>c.jsx(cC,{ref:n,className:De("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));cO.displayName=cC.displayName;const PC=f.forwardRef(({className:t,...e},n)=>c.jsx(lC,{ref:n,className:De("absolute right-2 top-2 rounded-md p-1 text-foreground
509/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:c.jsx(Si,{className:"h-4 w-4"})}));PC.displayName=lC.displayName;const RC=f.forwardRef(({className:t,...e},n)=>c.jsx(oC,{ref:n,className:De("text-sm font-semibold",t),...e}));RC.displayName=oC.displayName;const NC=f.forwardRef(({className:t,...e},n)=>c.jsx(aC,{ref:n,className:De("text-sm opacity-90",t),...e}));NC.displayName=aC.displayName;function lO(){const{toasts:t}=no();return c.jsxs(oO,{children:[t.map(function({id:e,title:n,description:i,action:r,...s}){return c.jsxs(EC,{...s,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(RC,{children:n}),i&&c.jsx(NC,{children:i})]}),r,c.jsx(PC,{})]},e)}),c.jsx(_C,{})]})}const dO={theme:"system",setTheme:()=>null},uO=f.createContext(dO);function hO({children:t,defaultTheme:e="system",storageKey:n="ui-theme",...i}){const[r,s]=f.useState(()=>localStorage.getItem(n)||e);f.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),r==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(r)},[r]);const o={theme:r,setTheme:a=>{localStorage.setItem(n,a),s(a)}};return c.jsx(uO.Provider,{...i,value:o,children:t})}const IC="app-brand",jC=f.createContext({brand:"teal",setBrand:()=>{}});function AC(t){if(typeof document>"u")return;const e=document.documentElement;t==="purple"?e.setAttribute("data-brand","purple"):e.removeAttribute("data-brand")}function OC(){try{return localStorage.getItem(IC)==="purple"?"purple":"teal"}catch{return"teal"}}function fO({children:t}){const[e,n]=f.useState(OC);f.useEffect(()=>{AC(e)},[e]);const i=r=>{try{localStorage.setItem(IC,r)}catch{}n(r)};return c.jsx(jC.Provider,{value:{brand:e,setBrand:i},children:t})}const b8=()=>f.useContext(jC),DC=f.createContext(null);function pO({children:t}){const{toast:e}=no(),{data:n,error:i,isLoading:r}=ya({queryKey:["/api/user"],queryFn:async()=>{const l=await fetch("/api/user",{credentials:"include"});if(l.status===401)return null;if(!l.ok)throw new Error("Failed to fetch user");return l.json()},retry:!1,staleTime:5*60*1e3}),s=$h({mutationFn:async l=>{const d=await fetch("/api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l),credentials:"include"});if(!d.ok){const u=await d.json();throw new Error(u.message||"Login failed")}return d.json()},onSuccess:l=>{Eo.setQueryData(["/api/user"],l),e({title:"Welcome back!",description:"You have successfully signed in."})},onError:l=>{e({title:"Login failed",description:l.message,variant:"destructive"})}}),o=$h({mutationFn:async l=>{const d=await fetch("/api/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l),credentials:"include"});if(!d.ok){const u=await d.json();throw new Error(u.message||"Registration failed")}return d.json()},onSuccess:l=>{Eo.setQueryData(["/api/user"],l),e({title:"Welcome!",description:"Your account has been created successfully."})},onError:l=>{e({title:"Registration failed",description:l.message,variant:"destructive"})}}),a=$h({mutationFn:async()=>{if(!(await fetch("/api/logout",{method:"POST",credentials:"include"})).ok)throw new Error("Logout failed")},onSuccess:()=>{Eo.setQueryData(["/api/user"],null),Eo.invalidateQueries({queryKey:["/api/user"]}),e({title:"Goodbye!",description:"You have been signed out."}),window.location.href="/auth"},onError:l=>{e({title:"Logout failed",description:l.message,variant:"destructive"})}});return c.jsx(DC.Provider,{value:{user:n??null,isLoading:r,error:i,loginMutation:s,logoutMutation:a,registerMutation:o},children:t})}function Et(){const t=f.useContext(DC);if(!t)throw new Error("useAuth must be used within an AuthProvider");return t}const mO=1e4;function gO(){const{user:t}=Et(),{toast:e}=no(),n=f.useRef(new Set),i=f.useRef(null);f.useEffect(()=>{if(!t){i.current&&(clearInterval(i.current),i.current=null),n.current.clear();return}let r=!1;const s=async()=>{try{const o=await fetch("/api/dialer/post-call-pending",{credentials:"include"});if(!o.ok)return;const a=await o.json();if(r)return;for(const l of a.conferences??[])n.current.has(l.id)||(n.current.add(l.id),e({title:"Call summary ready",description:`${l.intent_count} action${l.intent_count===1?"":"s"} to review for ${l.dest_number}`,duration:15e3}))}catch{}};return s(),i.current=setInterval(s,mO),()=>{r=!0,i.current&&(clearInterval(i.current),i.current=null)}},[t,e])}const LC=f.createContext(null);function Qg(){const t=f.useContext(LC);if(!t)throw new Error("useRecording must be used within a RecordingProvider");return t}function vO({children:t}){const{toast:e}=no(),[n,i]=f.useState(!1),[r,s]=f.useState(!1),[o,a]=f.useState(!1),[l,d]=f.useState(!1),[u,h]=f.useState(3),[p,g]=f.useState(null),[b,m]=f.useState(null),[k,v]=f.useState(null),[y,x]=f.useState(0),[S,w]=f.useState("screen"),[C,R]=f.useState(!0),[P,N]=f.useState("bottom-right"),[I,L]=f.useState(null),j=f.useRef(null),Z=f.useRef([]),F=f.useRef(null),te=f.useRef(null),Y=f.useRef(null),K=f.useRef(null),A=f.useRef(null),U=f.useRef(!1),Q=f.useRef(!1),se=f.useCallback(ae=>{const re=Math.floor(ae/60),ne=ae%60;return`${re.toString().padStart(2,"0")}:${ne.toString().padStart(2,"0")}`},[]),de=f.useCallback((ae=800,re=150)=>{try{const ne=new(window.AudioContext||window.webkitAudioContext),be=ne.createOscillator(),Se=ne.createGain();be.connect(Se),Se.connect(ne.destination),be.frequency.value=ae,be.type="sine",Se.gain.setValueAtTime(.3,ne.currentTime),Se.gain.exponentialRampToValueAtTime(.01,ne.currentTime+re/1e3),be.start(ne.currentTime),be.stop(ne.currentTime+re/1e3)}catch{console.log("Audio context not available")}},[]),Ae=f.useCallback(()=>new Promise(ae=>{d(!0),h(3),de(600,100),setTimeout(()=>{h(2),de(600,100)},1e3),setTimeout(()=>{h(1),de(600,100)},2e3),setTimeout(()=>{d(!1),de(900,200),ae()},3e3)}),[de]),ye=f.useCallback(()=>{A.current&&(cancelAnimationFrame(A.current),A.current=null),te.current&&(te.current.getTracks().forEac
509h(ae=>ae.stop()),te.current=null),Y.current&&(Y.current.getTracks().forEach(ae=>ae.stop()),Y.current=null),K.current&&(K.current=null),L(null)},[]),Te=f.useCallback(async ae=>{s(!0),v(null);try{const re=new FormData;re.append("video",ae,`boom_${Date.now()}.webm`),re.append("title",`Quick Recording - ${new Date().toLocaleString()}`),re.append("recordingType",S);const ne=await fetch("/api/video-studio/upload",{method:"POST",body:re,credentials:"include"});if(!ne.ok){const Se=await ne.json().catch(()=>({error:`HTTP ${ne.status}`}));throw new Error(Se.error||`Upload failed (${ne.status})`)}const be=await ne.json();if(Eo.invalidateQueries({queryKey:["/api/video-studio/videos"]}),be.shareToken){const Se=`${window.location.origin}/v/${be.shareToken}`;v(Se),await navigator.clipboard.writeText(Se),e({title:"Recording saved!",description:"Share link copied to clipboard"})}else e({title:"Recording saved!",description:"Check your video library"})}catch(re){console.error("Upload error:",re),e({title:"Upload failed",description:re.message||"Could not save recording",variant:"destructive"})}finally{s(!1)}},[S,e]),We=f.useCallback(async()=>{try{await Ae(),Z.current=[];let ae;if(S==="camera"){const ne=await navigator.mediaDevices.getUserMedia({video:{width:1280,height:720,facingMode:"user"},audio:C});te.current=ne,L(ne),ae=ne}else if(S==="screen"){const ne=await navigator.mediaDevices.getDisplayMedia({video:{width:1920,height:1080},audio:C});if(Y.current=ne,ne.getVideoTracks()[0].onended=()=>{console.log("Screen share ended by user"),j.current&&j.current.state!=="inactive"&&j.current.stop(),F.current&&(clearInterval(F.current),F.current=null),i(!1)},C)try{const Se=(await navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0];ne.addTrack(Se)}catch{console.log("Microphone not available")}ae=ne}else{const ne=await navigator.mediaDevices.getDisplayMedia({video:{width:1920,height:1080},audio:!1});Y.current=ne,ne.getVideoTracks()[0].onended=()=>{console.log("Screen share ended by user (PiP mode)"),j.current&&j.current.state!=="inactive"&&j.current.stop(),F.current&&(clearInterval(F.current),F.current=null),i(!1)};const be=await navigator.mediaDevices.getUserMedia({video:{width:320,height:240,facingMode:"user"},audio:C});te.current=be,L(be);const Se=document.createElement("canvas");Se.width=1920,Se.height=1080,K.current=Se;const He=Se.getContext("2d"),ot=document.createElement("video");ot.srcObject=ne,ot.muted=!0,ot.play();const St=document.createElement("video");St.srcObject=be,St.muted=!0,St.play();const Yt=320,Pt=240,gt=20,lr=()=>{switch(P){case"top-left":return{x:gt,y:gt};case"top-right":return{x:Se.width-Yt-gt,y:gt};case"bottom-left":return{x:gt,y:Se.height-Pt-gt};case"bottom-right":default:return{x:Se.width-Yt-gt,y:Se.height-Pt-gt}}},vt=()=>{if(ot.readyState>=2&&He.drawImage(ot,0,0,Se.width,Se.height),St.readyState>=2){const{x:oi,y:dr}=lr();He.save(),He.beginPath(),He.roundRect(oi,dr,Yt,Pt,12),He.clip(),He.drawImage(St,oi,dr,Yt,Pt),He.restore(),He.strokeStyle="#fff",He.lineWidth=3,He.beginPath(),He.roundRect(oi,dr,Yt,Pt,12),He.stroke()}A.current=requestAnimationFrame(vt)};await new Promise(oi=>{const dr=()=>{ot.readyState>=2&&St.readyState>=2?oi():requestAnimationFrame(dr)};dr()}),vt();const hn=Se.captureStream(30);if(C){const oi=be.getAudioTracks()[0];oi&&hn.addTrack(oi)}ae=hn}const re=new MediaRecorder(ae,{mimeType:"video/webm;codecs=vp9"});j.current=re,Q.current=!0,re.ondataavailable=ne=>{ne.data.size>0&&Z.current.push(ne.data)},re.onstop=async()=>{if(U.current){U.current=!1;return}const ne=new Blob(Z.current,{type:"video/webm"}),be=URL.createObjectURL(ne);g(ne),m(be),a(!0),ye()},re.start(1e3),i(!0),x(0),F.current=setInterval(()=>{x(ne=>ne+1)},1e3),e({title:"Recording started",description:"Navigate freely - click the floating button to stop"})}catch(ae){console.error("Recording error:",ae),e({title:"Recording failed",description:"Could not start recording",variant:"destructive"}),ye()}},[S,C,P,e,Te,ye,Ae]),oe=f.useCallback(()=>{j.current&&Q.current&&n&&j.current.state!=="inactive"&&j.current.stop(),Q.current=!1,F.current&&(clearInterval(F.current),F.current=null),i(!1)},[n]),Oe=f.useCallback(async()=>{p&&(await Te(p),b&&URL.revokeObjectURL(b),g(null),m(null),a(!1),x(0))},[p,b,Te]),Xe=f.useCallback(()=>{b&&URL.revokeObjectURL(b),g(null),m(null),a(!1),x(0),e({title:"Recording discarded",description:"The recording was not saved"})},[b,e]),Ne=f.useCallback(async()=>
509{if(!(S!=="camera"||!n))try{const ae=await navigator.mediaDevices.getDisplayMedia({video:{width:1920,height:1080},audio:!1});Y.current=ae,ae.getVideoTracks()[0].onended=()=>{console.log("Screen share ended by user (added screen)"),j.current&&j.current.state!=="inactive"&&j.current.stop(),F.current&&(clearInterval(F.current),F.current=null),i(!1)};const re=document.createElement("canvas");re.width=1920,re.height=1080,K.current=re;const ne=re.getContext("2d"),be=document.createElement("video");be.srcObject=ae,be.muted=!0,be.play();const Se=document.createElement("video");Se.srcObject=te.current,Se.muted=!0,Se.play();const He=320,ot=240,St=20,Yt=()=>{switch(P){case"top-left":return{x:St,y:St};case"top-right":return{x:re.width-He-St,y:St};case"bottom-left":return{x:St,y:re.height-ot-St};case"bottom-right":default:return{x:re.width-He-St,y:re.height-ot-St}}},Pt=()=>{if(be.readyState>=2&&ne.drawImage(be,0,0,re.width,re.height),Se.readyState>=2){const{x:vt,y:hn}=Yt();ne.save(),ne.beginPath(),ne.roundRect(vt,hn,He,ot,12),ne.clip(),ne.drawImage(Se,vt,hn,He,ot),ne.restore(),ne.strokeStyle="#fff",ne.lineWidth=3,ne.beginPath(),ne.roundRect(vt,hn,He,ot,12),ne.stroke()}A.current=requestAnimationFrame(Pt)};await new Promise(vt=>{const hn=()=>{be.readyState>=2?vt():requestAnimationFrame(hn)};hn()}),Pt();const gt=re.captureStream(30);if(te.current){const vt=te.current.getAudioTracks()[0];vt&>.addTrack(vt)}U.current=!0,j.current&&j.current.state!=="inactive"&&j.current.stop();const lr=new MediaRecorder(gt,{mimeType:"video/webm;codecs=vp9"});Q.current=!0,lr.ondataavailable=vt=>{vt.data.size>0&&Z.current.push(vt.data)},lr.onstop=async()=>{if(U.current){U.current=!1;return}const vt=new Blob(Z.current,{type:"video/webm"}),hn=URL.createObjectURL(vt);g(vt),m(hn),a(!0),ye()},j.current=lr,lr.start(1e3),w("pip"),e({title:"Screen added!",description:"Now recording screen with camera overlay"})}catch(ae){console.error("Add screen error:",ae),e({title:"Could not add screen",description:"Screen sharing was cancelled",variant:"destructive"})}},[S,n,P,e,Te,ye]);return c.jsx(LC.Provider,{value:{isRecording:n,isUploading:r,isPendingReview:o,isCountingDown:l,countdownValue:u,pendingPreviewUrl:b,lastSavedShareUrl:k,recordingTime:y,recordingMode:S,setRecordingMode:w,enableMicrophone:C,setEnableMicrophone:R,pipPosition:P,setPipPosition:N,startRecording:We,stopRecording:oe,saveRecording:Oe,discardRecording:Xe,formatRecordingTime:se,cameraStream:I,addScreenShare:S==="camera"&&n?Ne:null},children:t})}const MC=f.createContext(null),ef="bsquared_selected_client_id";function yO(){const t=f.useContext(MC);if(!t)throw new Error("useClient must be used within a ClientProvider");return t}function bO({children:t}){const{user:e}=Et(),[n,i]=f.useState(null),{data:r,isLoading:s}=ya({queryKey:["/api/organization"],queryFn:async()=>{const g=await fetch("/api/organization",{credentials:"include"});if(g.status===401||g.status===404)return null;if(!g.ok)throw new Error("Failed to fetch organization");return g.json()},enabled:!!e,retry:2,staleTime:3e4}),o=(r==null?void 0:r.type)==="agency",{data:a=[],isLoading:l}=ya({queryKey:["/api/clients"],queryFn:async()=>{const g=await fetch("/api/clients",{credentials:"include"});if(g.status===401)return[];if(!g.ok)throw new Error(`Failed to fetch clients: ${g.status}`);return g.json()},enabled:!!e,retry:2,staleTime:3e4,refetchOnWindowFocus:!0});f.useEffect(()=>{if(e)if(e.clientId)i(e.clientId);else{const g=localStorage.getItem(ef);if(g){const b=parseInt(g,10);isNaN(b)||i(b)}}},[e]);const d=g=>{if((e==null?void 0:e.role)==="client"&&(e!=null&&e.clientId))return;const b=(g==null?void 0:g.id)??null;i(b),b!==null?localStorage.setItem(ef,b.toString()):localStorage.removeItem(ef)},u=a.find(g=>g.id===n)??null,h=o&&a.length>1,p=s||l;return c.jsx(MC.Provider,{value:{selectedClient:u,setSelectedClient:d,clients:a,isLoading:p,organization:r??null,isAgencyOrg:o,canManageMultipleClients:h,selectedClientId:n},children:t})}const UC=$g("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all duration-200 ease-smooth focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 active:scale-[0.99]",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-border/60 bg-background hover:bg-accent hover:text-accent-foreground hover:border-border",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),he=f.forwardRef(({className:t,variant:e,size:n,asChild:i=!1,...r},s)=>{const o=i?Hs:"button";return c.jsx(o,{className:De(UC({variant:e,size:n,className:t})),ref:s,...r})});he.displayName="Button";const xO=Object.freeze(Object.defineProperty({__proto__:null,Button:he,buttonVariants:UC},Symbol.toStringTag,{value:"Module"}));function or(){const{user:t,isLoading:e}=Et(),n=!e&&!!t,{data:i,isLoading:r}=ya({queryKey:["/api/organization"],queryFn:Uw({on401:"returnNull"}),staleTime:3e5,gcTime:3e5,retry:!1,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchInterval:!1,enabled:n});return{organization:i,billingPlan:(i==null?void 0:i.billingPlan)??"free",isLoading:e||n&&r}}const kO="admin_preview_view_mode";function x8(){const{user:t,isLoading:e}=Et(),n=typeof window<"u"?localStorage.getItem(kO):null,i=(t==null?void 0:t.role)!=="client"&&n==="client",r=i?"/api/features/my-access?asRole=client":"/api/features/my-access",s=!e&&!!t,{data:o,isLoading:a}=ya({queryKey:["/api/features/my-access",i?"client":"admin"],queryFn:async()=>{const d=await fetch(r,{credentials:"include"});if(d.status===401)return null;if(!d.ok)throw new Error("Failed to fetch feature access");return d.json()},staleTime:3e4,gcTime:6e4,retry:!1,refetchOnWindowFocus:!0,refetchOnMount:!0,refetchInterval:!1,enabled:s});return{hasFeature:d=>{var u;return((u=o==null?void 0:o.features)==null?void 0:u.includes(d))??!1},plan:(o==null?void 0:o.plan)??"starter",features:(o==null?void 0:o.features)??[],isLoading:e||s&&a}}const tf={free:{dashboard:!0,crm:!0,analytics:!1,voiceAgents:!0,maxVoiceAgents:1,monthlyCallMinutes:100,automationSequences:!1,maxAutomations:0,sms:!1,phoneNumbers:!1,apiAccess:!1,customIntegrations:!1,whiteLabel:!1,supportLevel:"basic"},starter:{dashboard:!0,crm:!0,analytics:!0,voiceAgents:!0,maxVoiceAgents:3,monthlyCallMinutes:500,automationSequences:!0,maxAutomations:5,sms:!0,phoneNumbers:!0,apiAccess:!1,customIntegrations:!1,whiteLabel:!1,supportLevel:"basic"},basic:{dashboard:!0,crm:!0,analytics:!0,voiceAgents:!0,maxVoiceAgents:3,monthlyCallMinutes:500,automationSequences:!0,maxAutomations:5,sms:!0,phoneNumbers:!0,apiAccess:!1,customIntegrations:!1,whiteLabel:!1,supportLevel:"basic"},professional:{dashboard:!0,crm:!0,analytics:!0,voiceAgents:!0,maxVoiceAgents:10,monthlyCallMinutes:2e3,automationSequences:!0,maxAutomations:20,sms:!0,phoneNumbers:!0,apiAccess:!0,customIntegrations:!0,whiteLabel:!1,supportLevel:"priority"},premium:{dashboard:!0,crm:!0,analytics:!0,voiceAgents:!0,maxVoiceAgents:10,monthlyCallMinutes:2e3,automationSequences:!0,maxAutomations:20,sms:!0,phoneNumbers:!0,apiAccess:!0,customIntegrations:!0,whiteLabel:!1,supportLevel:"priority"},enterprise:{dashboard:!0,crm:!0,analytics:!0,voiceAgents:!0,maxVoiceAgents:-1,monthlyCallMinutes:-1,automationSequences:!0,maxAutomations:-1,sms:!0,phoneNumbers:!0,apiAccess:!0,customIntegrations:!0,whiteLabel:!0,supportLevel:"premium"}};function Jg(){const{user:t}=Et(),{billingPlan:e}=or(),n=e||"free",i=(t==null?void 0:t.isActive)===!1||(t==null?void 0:t.status)==="suspended";let s={...tf[n]||tf.free};(t==null?void 0:t.role)==="superadmin"&&(s=tf.enterprise),i&&(s={...s,voiceAgents:!1,automationSequences:!1,sms:!1,apiAccess:!1});const o=u=>{const h=s[u];return typeof h=="boolean"?h:typeof h=="number"?h>0||h===-1:!0},a=(t==null?void 0:t.role)==="superadmin",l=n!=="enterprise"&&!i&&!a,d=(()=>
509{if(i)return"Your account is suspended. Please contact support.";switch(n){case"free":return"Upgrade to Starter to unlock more features";case"starter":return"Upgrade to Professional for advanced automation";case"professional":return"Upgrade to Enterprise for unlimited access";default:return""}})();return{...s,hasAccess:o,canUpgrade:l,upgradeMessage:d,billingPlan:n,isSuspended:i}}function SO(){const{toast:t}=no(),{billingPlan:e}=or(),{user:n}=Et(),{isRecording:i,isUploading:r,isPendingReview:s,isCountingDown:o,countdownValue:a,pendingPreviewUrl:l,lastSavedShareUrl:d,recordingTime:u,stopRecording:h,saveRecording:p,discardRecording:g,formatRecordingTime:b,recordingMode:m,cameraStream:k,addScreenShare:v}=Qg(),y=(n==null?void 0:n.role)==="admin"||(n==null?void 0:n.role)==="superadmin",x=e==="free"&&!y,S=f.useRef(null),w=f.useRef(null),[C,R]=f.useState({x:24,y:24}),[P,N]=f.useState(!1),[I,L]=f.useState({x:0,y:0}),[j,Z]=f.useState("medium");f.useEffect(()=>{S.current&&k&&(m==="camera"||m==="pip")&&(S.current.srcObject=k)},[k,m]);const F=f.useCallback(ye=>{if(w.current){const Te=w.current.getBoundingClientRect();L({x:ye.clientX-Te.left,y:ye.clientY-Te.top}),N(!0)}},[]);f.useEffect(()=>{const ye=We=>{var oe,Oe;if(P){const Xe=window.innerWidth-We.clientX-(((oe=w.current)==null?void 0:oe.offsetWidth)||220)+I.x,Ne=window.innerHeight-We.clientY-(((Oe=w.current)==null?void 0:Oe.offsetHeight)||200)+I.y;R({x:Math.max(10,Math.min(window.innerWidth-240,Xe)),y:Math.max(10,Math.min(window.innerHeight-220,Ne))})}},Te=()=>{N(!1)};return P&&(document.addEventListener("mousemove",ye),document.addEventListener("mouseup",Te)),()=>{document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",Te)}},[P,I]);const te=f.useRef(null),[Y,K]=f.useState(!1);f.useEffect(()=>{te.current&&l&&(te.current.src=l)},[l]);const A=()=>{te.current&&(Y?te.current.pause():te.current.play(),K(!Y))};if(f.useCallback(async()=>{d&&(await navigator.clipboard.writeText(d),t({title:"Link copied!",description:d}))},[d,t]),o)return c.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-sm",children:c.jsxs("div",{className:"text-center animate-pulse",children:[c.jsx("div",{className:"text-9xl font-bold text-white mb-4 animate-bounce",children:a}),c.jsx("p",{className:"text-white text-xl",children:"Recording starting..."})]})});if(x||!i&&!r&&!s)return null;if(r)return c.jsx("div",{className:"fixed z-[9999]",style:{bottom:`${C.y}px`,right:`${C.x}px`},"data-testid":"floating-uploading-widget",children:c.jsx("div",{className:"bg-slate-900 border border-brand-500/50 rounded-2xl shadow-2xl p-4 min-w-[240px]",children:c.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[c.jsx(io,{className:"w-5 h-5 text-brand-500 animate-spin"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-white text-sm font-medium",children:"Saving recording..."}),c.jsx("p",{className:"text-slate-400 text-xs",children:"Link will be copied automatically"})]})]})})});if(s&&l)return c.jsx("div",{ref:w,className:`fixed z-[9999] animate-in slide-in-from-bottom-4 duration-300 ${P?"cursor-grabbing":""}`,style:{bottom:`${C.y}px`,right:`${C.x}px`},"data-testid":"floating-review-widget",children:c.jsxs("div",{className:"bg-slate-900 border border-green-500/50 rounded-2xl shadow-2xl shadow-green-500/20 p-3 min-w-[280px]",children:[c.jsx("div",{className:"flex items-center justify-between mb-2 cursor-grab active:cursor-grabbing",onMouseDown:F,children:c.jsxs("div",{className:"flex items-center gap-1.5 text-slate-500 text-xs",children:[c.jsx(Ay,{className:"w-3 h-3"}),c.jsx("span",{children:"Drag to move"})]})}),c.jsxs("div",{className:"mb-3 rounded-lg overflow-hidden border border-slate-700 relative",children:[c.jsx("video",{ref:te,playsInline:!0,className:"w-full h-[140px] object-cover bg-black",onEnded:()=>K(!1)}),c.jsx("button",{onClick:A,className:"absolute inset-0 flex items-center justify-center bg-black/30 hover:bg-black/50 transition-colors",children:Y?c.jsx(dA,{className:"w-10 h-10 text-white"}):c.jsx(uA,{className:"w-10 h-10 text-white ml-1"})})]}),c.jsxs("div",{className:"text-center mb-3",children:[c.jsx("p",{className:"text-white text-sm font-medium",children:"Review your recording"}),c.jsxs("p",{className:"text-slate-400 text-xs",children:["Duration: ",b(u)]})]}),c.jsxs("div",{className:"flex gap-2 mb-2",children:[c.jsxs(he,{onClick:g,variant:"outline",size:"sm",className:"flex-1 border-red-500/50 text-red-400 hover:bg-red-500/20","data-testid":"button-discard-recording",children:[c.jsx(Si,{className:"w-3 h-3 mr-1"}),"Discard"]}),c.jsxs(he,{onClick:p,size:"sm",className:"flex-1 bg-green-600 hover:bg-green-700 text-white","data-testid":"button-save-recording",children:[c.jsx(Yu,{className:"w-3 h-3 mr-1"}),"Save & Copy Link"]})]})]})});const U=()=>{switch(m){case"camera":return c.jsx(fC,{className:"w-3 h-3"});case"screen":return c.jsx(vC,{className:"w-3 h-3"});case"pip":return c.jsx(yC,{className:"w-3 h-3"})}},Q=()=>{switch(m){case"camera":return"Camera";case"screen":return"Screen";case"pip":return"PiP"}},se=()=>{switch(j){case"small":return"h-[80px]";case"medium":return"h-[120px]";case"large":return"h-[180px]"}},de=()=>{switch(j){case"small":return"min-w-[180px]";case"medium":return"min-w-[220px]";case"large":return"min-w-[280px]"}},Ae=()=>{Z(j==="small"?"medium":j==="medium"?"large":"small")};return c.jsx("div",{ref:w,className:`fixed z-[9999] animate-in slide-in-from-bottom-4 duration-300 ${P?"cursor-grabbing":""}`,style:{bottom:`${C.y}px`,right:`${C.x}px`},"data-testid":"floating-recording-widget",children:c.jsxs("div",{className:`bg-slate-900 border border-red-500/50 rounded-2xl shadow-2xl shadow-red-500/20 p-3 ${de()}`,children:[c.jsxs("div",{className:"flex items-center justify-between mb-2 cursor-grab active:cursor-grabbing",onMouseDown:F,children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-slate-500 text-xs",children:[c.jsx(Ay,{className:"w-3 h-3"}),c.jsx("span",{children:"Drag to move"})]}),c.jsx("button",{onClick:Ae,className:"text-slate-500 hover:text-white p-1 rounded transition-colors",title:`Size: ${j}`,children:j==="large"?c.jsx(gC,{className:"w-3 h-3"}):c.jsx(pC,{className:"w-3 h-3"})})]}),(m==="camera"||m==="pip")&&k&&c.jsx("div",{className:"mb-3 rounded-lg overflow-hidden border border-slate-700",children:c.jsx("video",{ref:S,autoPlay:!0,muted:!0,playsInl
509ine:!0,className:`w-full ${se()} object-cover bg-black`})}),c.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"w-3 h-3 bg-red-500 rounded-full animate-pulse"}),c.jsx("div",{className:"absolute inset-0 w-3 h-3 bg-red-500 rounded-full animate-ping opacity-75"})]}),c.jsx("span",{className:"text-white font-mono text-lg",children:b(u)}),c.jsxs("div",{className:"flex items-center gap-1 text-slate-400 text-xs ml-auto",children:[U(),c.jsx("span",{children:Q()})]})]}),c.jsxs("div",{className:"flex gap-2",children:[m==="camera"&&v&&c.jsxs(he,{onClick:v,variant:"outline",size:"sm",className:"flex-1 border-blue-500/50 text-blue-400 hover:bg-blue-500/20","data-testid":"button-add-screen",children:[c.jsx(aA,{className:"w-3 h-3 mr-1"}),"Add Screen"]}),c.jsxs(he,{onClick:h,className:`bg-red-600 hover:bg-red-700 text-white ${m==="camera"&&v?"flex-1":"w-full"}`,size:"sm","data-testid":"button-stop-floating",children:[c.jsx(au,{className:"w-3 h-3 mr-1 fill-current"}),"Stop"]})]})]})})}const Yg=f.forwardRef(({className:t,type:e,...n},i)=>c.jsx("input",{type:e,className:De("flex h-10 w-full rounded-md border border-border/60 bg-background px-3.5 py-2 text-sm r
509ing-offset-background transition-colors duration-200 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground/70 hover:border-border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:border-ring/60 disabled:cursor-not-allowed disabled:opacity-50",t),ref:i,...n}));Yg.displayName="Input";const wO=["/assistant","/dashboard","/unified-inbox","/campaigns","/campaign-launcher","/video-campaigns","/templates","/landing-experiments","/crm-dashboard","/crm-deals","/contacts","/confirmation-engine","/calendar-admin","/meeting-timeline","/video-studio","/conference-recordings","/demo-creator","/voice-platform","/voice-agents","/call-logs","/agent-memory","/analytics-dashboard","/campaign-analytics","/crm-analytics","/workspace","/reps","/clients","/email-accounts","/api-dashboard","/ai-conference","/control-center","/admin","/boom"],Er="conference-launcher-state",vd=()=>typeof window>"u"?{x:700,y:500}:{x:window.innerWidth-100,y:window.innerHeight-140},Fy={isDocked:!1,position:vd()};function CO(){const[t,e]=Pi(),{user:n}=Et(),{isRecording:i,isCountingDown:r,startRecording:s,stopRecording:o,formatRecordingTime:a,recordingTime:l}=Qg(),{billingPlan:d}=or(),u=wO.some(K=>t.startsWith(K)),h=(n==null?void 0:n.role)==="admin"||(n==null?void 0:n.role)==="superadmin",p=d==="free"&&!h,g=()=>{var K,A;try{const U=localStorage.getItem(Er);if(U){const Q=JSON.parse(U),se=vd(),de=(K=Q.position)==null?void 0:K.x,Ae=(A=Q.position)==null?void 0:A.y,ye=typeof de=="number"&&typeof Ae=="number"&&de>window.innerWidth/2&&Ae>window.innerHeight/2;return{...Fy,...Q,position:ye?{x:de,y:Ae}:se}}}catch(U){console.error("Error loading launcher state:",U)}return{...Fy,position:vd()}},[b,m]=f.useState(g),[k,v]=f.useState(!1),[y,x]=f.useState(!1),[S,w]=f.useState(()=>{var K;return(n==null?void 0:n.name)||((K=n==null?void 0:n.email)==null?void 0:K.split("@")[0])||""}),C=f.useRef(null),R=f.useRef(null);f.useEffect(()=>{localStorage.setItem(Er,JSON.stringify(b))},[b]),f.useEffect(()=>{const K=U=>{if(!k||!C.current)return;const Q=U.clientX-C.current.startX,se=U.clientY-C.current.startY,de=Math.max(0,Math.min(window.innerWidth-80,C.current.startPosX+Q)),Ae=Math.max(0,Math.min(window.innerHeight-80,C.current.startPosY+se));m(ye=>({...ye,position:{x:de,y:Ae}}))},A=()=>{v(!1),C.current=null};return k&&(document.addEventListener("mousemove",K),document.addEventListener("mouseup",A)),()=>{document.removeEventListener("mousemove",K),document.removeEventListener("mouseup",A)}},[k]);const P=K=>{K.preventDefault(),v(!0),C.current={startX:K.clientX,startY:K.clientY,startPosX:b.position.x,startPosY:b.position.y}},N=()=>{const K={...b,isDocked:!0};m(K),x(!1),localStorage.setItem(Er,JSON.stringify(K)),window.dispatchEvent(new CustomEvent("launcher-state-change",{detail:{isDocked:!0}}))};f.useEffect(()=>{const K=A=>{const U=g();m({...U,isDocked:A.detail.isDocked,position:A.detail.isDocked?U.position:vd()})};return window.addEventListener("launcher-state-change",K),()=>window.removeEventListener("launcher-state-change",K)},[]);const I=()=>{var U;const K=`instant-${Date.now()}`,A=S.trim()||(n==null?void 0:n.name)||((U=n==null?void 0:n.email)==null?void 0:U.split("@")[0])||"Host";e(`/ai-conference/${K}?name=${encodeURIComponent(A)}&autoJoin=true`),x(!1)},L=()=>{e("/ai-conference-dashboard"),x(!1)},j=()=>{e("/ai-conference-dashboard?tab=schedule"),x(!1)};if(!u||!n||p||b.isDocked)return null;const Z=y?320:80,F=y?280:80,te=Math.min(b.position.x,window.innerWidth-Z-20),Y=Math.min(b.position.y,window.innerHeight-F-20);return c.jsx("div",{ref:R,className:"fixed z-[9999]",style:{left:Math.max(20,te),top:Math.max(20,Y),cursor:k?"grabbing":"default"},"data-testid":"floating-conference-launcher",children:y?c.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl border border-gray-200 min-w-[320px] overflow-hidden",children:[c.jsxs("div",{className:"flex items-center justify-between p-4 cursor-grab active:cursor-grabbing",onMouseDown:P,children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-brand-500 to-brand-600 flex items-center justify-center",children:c.jsx(Mt,{className:"w-5 h-5 text-white"})}),c.jsx("span",{className:"text-gray-800 font-semibold text-lg",children:"Qu
509ick Meeting"})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(he,{variant:"ghost",size:"icon",className:"h-8 w-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100",onClick:N,title:"Dock to sidebar","data-testid":"button-dock-launcher",children:c.jsx(gC,{className:"w-4 h-4"})}),c.jsx(he,{variant:"ghost",size:"icon",className:"h-8 w-8 text-gray-400 hover:text-gray-600 hover:bg-gray-100",onClick:()=>x(!1),"data-testid":"button-close-launcher-menu",children:c.jsx(Si,{className:"w-4 h-4"})})]})]}),c.jsxs("div",{className:"px-4 pb-4 space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("label",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Your Name"}),c.jsx(Yg,{value:S,onChange:K=>w(K.target.value),placeholder:"Enter your name",className:"bg-gray-50 border-gray-200 text-gray-800 placeholder:text-gray-400 focus:border-brand-400 focus:ring-brand-400","data-testid":"input-meeting-name"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs(he,{onClick:I,className:"flex-1 h-12 bg-gradient-to-r from-brand-500 to-brand-600 hover:from-brand-600 hover:to-brand-700 text-white font-semibold text-base rounded-xl","data-testid":"button-quick-start-meeting",children:[c.jsx(gd,{className:"w-5 h-5 mr-2"}),"Meeting"]}),c.jsx(he,{onClick:i?o:s,disabled:r,className:`flex-1 h-12 font-semibold text-base rounded-xl ${i?"bg-red-500 hover:bg-red-600 text-white":"bg-gradient-to-r from-red-500 to-pink-600 hover:from-red-600 hover:to-pink-700 text-white"}`,"data-testid":"button-quick-record",children:i?c.jsxs(c.Fragment,{children:[c.jsx(au,{className:"w-5 h-5 mr-2 fill-current"}),a(l)]}):c.jsxs(c.Fragment,{children:[c.jsx(vs,{className:"w-5 h-5 mr-2 fill-current"}),"Record"]})})]}),c.jsxs("div",{className:"flex gap-3",children:[c.jsxs(he,{onClick:L,variant:"outline",className:"flex-1 h-11 border-2 border-brand-200 text-brand-700 hover:bg-brand-50 hover:border-brand-300 font-semibold rounded-xl","data-testid":"button-open-meetings",children:[c.jsx(po,{className:"w-4 h-4 mr-2"}),"Meetings"]}),c.jsxs(he,{onClick:j,variant:"outline",className:"flex-1 h-11 border-2 border-brand-200 text-brand-700 hover:bg-brand-50 hover:border-brand-300 font-semibold rounded-xl","data-testid":"button-schedule-meeting",children:[c.jsx(Uj,{className:"w-4 h-4 mr-2"}),"Schedule"]})]})]})]}):c.jsxs("div",{className:"flex flex-col items-center gap-1",onMouseDown:P,style:{cursor:k?"grabbing":"grab"},children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("button",{onClick:K=>{K.stopPropagation(),I()},className:"group relative w-12 h-12 rounded-full bg-gradient-to-br from-pink-500 to-brand-600 shadow-lg hover:shadow-xl hover:scale-110 transition-all duration-200 flex items-center justify-center border-2 border-white/20",title:"Start Meeting (drag to move)","data-testid":"button-start-meeting-fab",children:[c.jsx(Mt,{className:"w-5 h-5 text-white"}),c.jsx("div",{className:"absolute -top-1 -right-1 w-2.5 h-2.5 bg-green-400 rounded-full border border-white animate-pulse"})]}),c.jsx("button",{onClick:K=>{K.stopPropagation(),i?o():r||s()},disabled:r,className:`group relative w-12 h-12 rounded-full shadow-lg hover:shadow-xl hover:scale-110 transition-all duration-200 flex items-center justify-center border-2 border-white/20 ${i?"bg-red-500 animate-pulse":"bg-gradient-to-br from-red-500 to-pink-600"}`,title:i?"Stop Recording":"Start Recording (drag to move)","data-testid":"button-start-record-fab",children:i?c.jsx(au,{className:"w-5 h-5 text-white fill-current"}):c.jsx(vs,{className:"w-5 h-5 text-white fill-current"})})]}),i&&c.jsx("span",{className:"text-xs text-white bg-red-500/90 px-2 py-0.5 rounded-full font-mono",children:a(l)}),c.jsx("button",{onClick:K=>{K.stopPropagation(),x(!0)},className:"text-xs text-brand-300 hover:text-white bg-brand-900/80 px-2 py-0.5 rounded-full","data-testid":"button-expand-conference-launcher",children:"More"})]})})}function TO({onUndock:t,userName:e}){const[,n]=Pi(),i=()=>{const r=`instant-${Date.now()}`;n(`/ai-conference/${r}?name=${encodeURIComponent(e||"Host")}&autoJoin=true`)};return c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs(he,{onClick:i,className:"flex-1 bg-gradient-to-r from-brand-500 to-brand-600 hover:from-brand-600 hover:to-brand-700 text-white font-semibold","data-testid":"button-docked-start-meeting",children:[c.jsx(Mt,{className:"w-4 h-4 mr-2"}),"Conference"]}),c.jsx(he,{variant:"ghost",size:"icon",className:"h-9 w-9 text-brand-300 hover:text-white hover:bg-brand-700",onClick:t,title:"Undock to floating button","data-testid":"button-undock-launcher",children:c.jsx(pC,{className:"w-4 h-4"})})]})}function _O(){const[t,e]=f.useState(()=>{try{const r=localStorage.getItem(Er);if(r)return JSON.parse(r).isDocked??!1}catch(r){console.error("Error loading launcher state:",r)}return!1}),n=()=>{const r=JSON.parse(localStorage.getItem(Er)||"{}");localStorage.setItem(Er,JSON.stringify({...r,isDocked:!0})),e(!0),window.dispatchEvent(new CustomEvent("launcher-state-change",{detail:{isDocked:!0}}))},i=()=>{const r=JSON.parse(localStorage.getItem(Er)||"{}");localStorage.setItem(Er,JSON.stringify({...r,isDocked:!1,position:{x:window.innerWidth-100,y:window.innerHeight-100}})),e(!1),window.dispatchEvent(new CustomEvent("launcher-state-change",{detail:{isDocked:!1}}))};return f.useEffect(()=>{const r=s=>{e(s.detail.isDocked)};return window.addEventListener("launcher-state-change",r),()=>window.removeEventListener("launcher-state-change",r)},[]),{isDocked:t,dock:n,undock:i}}const FC=()=>c.jsx("div",{className:"flex items-center justify-center min-h-screen",children:c.jsx(io,{className:"h-8 w-8 animate-spin text-border"})});function qe({path:t,component:e,allowClient:n}){return c.jsx(D,{path:t,children:c.jsx(f.Suspense,{fallback:c.jsx(FC,{}),children:c.jsx(EO,{component:e,allowClient:n})})})}function EO({component:t,allowClient:e}){const{user:n,isLoading:i}=Et();return i?c.jsx(FC,{}):n?e&&n.role==="client"?c.jsx(t,{}):n.role==="client"?c.jsx(Dn,{to:"/client-portal"}):n.role!=="admin"&&n.role!=="superadmin"?c.jsx(Dn,{to:"/dashboard"}):c.jsx(t,{}):(f.startTransition(()=>{}),c.jsx(Dn,{to:"/auth"}))}const PO=["/client-portal"],VC=()=>c.jsx("div",{className:"flex items-center justify-center min-h-screen",children:c.jsx(io,{className:"h-8 w-8 animate-spin text-border"})});function ce({children:t,path:e,component:n}){const i=({children:r})=>e?c.jsx(D,{path:e,children:r}):c.jsx(c.Fragment,{children:r});return c.jsx(i,{children:c.jsx(f.Suspense,{fallback:c.jsx(VC,{}),children:c.jsx(RO,{component:n,routePath:e,children:t})})})}function RO({children:t,component:e,routePath:n}){const{user:i,isLoading:r}=Et(),[s]=Pi();if(r)return c.jsx(VC,{});if(!i){const o=n||s,a=o&&o!=="/"?`/auth?redirect=${encodeURIComponent(o)}`:"/auth";return c.jsx(Dn,{to:a})}if(i.role==="client"){const o=n||s;if(!PO.some(l=>o===l||o.startsWith(l+"/")))return c.jsx(Dn,{to:"/client-portal"})}return e?c.jsx(e,{}):c.jsx(c.Fragment,{children:t})}const Mc=f.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:De("rounded-xl border border-border/60 bg-card text-card-foreground shadow-sm",t),...e}));
509Mc.displayName="Card";const Xu=f.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:De("flex flex-col space-y-1.5 p-6",t),...e}));Xu.displayName="CardHeader";const Zu=f.forwardRef(({className:t,...e},n)=>c.jsx("h3",{ref:n,className:De("text-2xl font-semibold leading-none tracking-tight",t),...e}));Zu.displayName="CardTitle";const eh=f.forwardRef(({className:t,...e},n)=>c.jsx("p",{ref:n,className:De("text-sm text-muted-foreground",t),...e}));eh.displayName="CardDescription";const Uc=f.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:De("p-6 pt-0",t),...e}));Uc.displayName="CardContent";const zC=f.forwardRef(({className:t,...e},n)=>c.jsx("div",{ref:n,className:De("flex items-center p-6 pt-0",t),...e}));zC.displayName="CardFooter";const NO=$g("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-ring/40 focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary/10 text-primary hover:bg-primary/15",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive/10 text-destructive hover:bg-destructive/15",outline:"border-border/60 text-foreground hover:bg-accent/50"}},defaultVariants:{variant:"default"}});function BC({className:t,variant:e,...n}){return c.jsx("div",{className:De(NO({variant:e}),t),...n})}function IO(t,e=[]){let n=[];function i(s,o){const a=f.createContext(o),l=n.length;n=[...n,o];function d(h){const{scope:p,children:g,...b}=h,m=(p==null?void 0:p[t][l])||a,k=f.useMemo(()=>b,Object.values(b));return c.jsx(m.Provider,{value:k,children:g})}function u(h,p){const g=(p==null?void 0:p[t][l])||a,b=f.useContext(g);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return d.displayName=s+"Provider",[d,u]}const r=()=>{const s=n.map(o=>f.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return f.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return r.scopeName=t,[i,jO(r,...e)]}function jO(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=i.reduce((a,{useScope:l,scopeName:d})=>{const h=l(s)[`__scope${d}`];return{...a,...h}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var Xg="Progress",Zg=100,[AO,k8]=IO(Xg),[OO,DO]=AO(Xg),WC=f.forwardRef((t,e)=>{const{__scopeProgress:n,value:i=null,max:r,getValueLabel:s=LO,...o}=t;(r||r===0)&&!Vy(r)&&console.error(MO(`${r}`,"Progress"));const a=Vy(r)?r:Zg;i!==null&&!zy(i,a)&&console.error(UO(`${i}`,"Progress"));const l=zy(i,a)?i:null,d=lu(l)?s(l,a):void 0;return c.jsx(OO,{scope:n,value:l,max:a,children:c.jsx(Re.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":lu(l)?l:void 0,"aria-valuetext":d,role:"progressbar","data-state":qC(l,a),"data-value":l??void 0,"data-max":a,...o,ref:e})})});WC.displayName=Xg;var HC="ProgressIndicator",$C=f.forwardRef((t,e)=>{const{__scopeProgress:n,...i}=t,r=DO(HC,n);return c.jsx(Re.div,{"data-state":qC(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...i,ref:e})});$C.displayName=HC;function LO(t,e){return`${Math.round(t/e*100)}%`}function qC(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function lu(t){return typeof t=="number"}function Vy(t){return lu(t)&&!isNaN(t)&&t>0}function zy(t,e){return lu(t)&&!isNaN(t)&&t<=e&&t>=0}function MO(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Zg}\`.`}function UO(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: 510 - a positive number 511 - less than the value passed to \`max\` (or ${Zg} if no \`max\` prop is set) 512 - \`null\` or \`undefined\` if the progress is indeterminate. 513 514Defaulting to \`null\`.`}var KC=WC,FO=$C;const VO=f.forwardRef(({className:t,value:e,...n},i)=>c.jsx(KC,{ref:i,className:De("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:c.jsx(FO,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));VO.displayName=KC.displayName;var zO=lk.useId||(()=>{}),BO=0;function Vo(t){const[e,n]=f.useState(zO());return Wt(()=>{n(i=>i??String(BO++))},[t]),e?`radix-${e}
514`:""}var nf="focusScope.autoFocusOnMount",rf="focusScope.autoFocusOnUnmount",By={bubbles:!1,cancelable:!0},WO="FocusScope",ev=f.forwardRef((t,e)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...o}=t,[a,l]=f.useState(null),d=wn(r),u=wn(s),h=f.useRef(null),p=tt(e,m=>l(m)),g=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(i){let m=function(x){if(g.paused||!a)return;const S=x.target;a.contains(S)?h.current=S:br(h.current,{select:!0})},k=function(x){if(g.paused||!a)return;const S=x.relatedTarget;S!==null&&(a.contains(S)||br(h.current,{select:!0}))},v=function(x){if(document.activeElement===document.body)for(const w of x)w.removedNodes.length>0&&br(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",k);const y=new MutationObserver(v);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",k),y.disconnect()}}},[i,a,g.paused]),f.useEffect(()=>{if(a){Hy.add(g);const m=document.activeElement;if(!a.contains(m)){const v=new CustomEvent(nf,By);a.addEventListener(nf,d),a.dispatchEvent(v),v.defaultPrevented||(HO(QO(GC(a)),{select:!0}),document.activeElement===m&&br(a))}return()=>{a.removeEventListener(nf,d),setTimeout(()=>{const v=new CustomEvent(rf,By);a.addEventListener(rf,u),a.dispatchEvent(v),v.defaultPrevented||br(m??document.body,{select:!0}),a.removeEventListener(rf,u),Hy.remove(g)},0)}}},[a,d,u,g]);const b=f.useCallback(m=>{if(!n&&!i||g.paused)return;const k=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,v=document.activeElement;if(k&&v){const y=m.currentTarget,[x,S]=$O(y);x&&S?!m.shiftKey&&v===S?(m.preventDefault(),n&&br(x,{select:!0})):m.shiftKey&&v===x&&(m.preventDefault(),n&&br(S,{select:!0})):v===y&&m.preventDefault()}},[n,i,g.paused]);return c.jsx(Re.div,{tabIndex:-1,...o,ref:p,onKeyDown:b})});ev.displayName=WO;function HO(t,{select:e=!1}={}){const n=document.activeElement;for(const i of t)if(br(i,{select:e}),document.activeElement!==n)return}function $O(t){const e=GC(t),n=Wy(e,t),i=Wy(e.reverse(),t);return[n,i]}function GC(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Wy(t,e){for(const n of t)if(!qO(n,{upTo:e}))return n}function qO(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function KO(t){return t instanceof HTMLInputElement&&"select"in t}function br(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&KO(t)&&e&&t.select()}}var Hy=GO();function GO(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=$y(t,e),t.unshift(e)},remove(e){var n;t=$y(t,e),(n=t[0])==null||n.resume()}}}function $y(t,e){const n=[...t],i=n.indexOf(e);return i!==-1&&n.splice(i,1),n}function QO(t){return t.filter(e=>e.tagName!=="A")}var sf=0;function QC(){f.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??qy()),document.body.insertAdjacentElement("beforeend",t[1]??qy()),sf++,()=>{sf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),sf--}},[])}function qy(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var vi=function(){return vi=Object.assign||function(e){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},vi.apply(this,arguments)};function JC(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function JO(t,e,n){if(n||arguments.length===2)for(var i=0,r=e.length,s;i<r;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))}var yd="right-scroll-bar-position",bd="width-before-scroll-bar",YO="with-scroll-bars-hidden",XO="--removed-body-scroll-bar-size";function of(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function ZO(t,e){var n=f.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(i){var r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}})[0];return n.callback=e,n.facade}var eD=typeof window<"u"?f.useLayoutEffect:f.useEffect,Ky=new WeakMap;function tD(t,e){var n=ZO(null,function(i){return t.forEach(function(r){return of(r,i)})});return eD(function(){var i=Ky.get(n);if(i){var r=new Set(i),s=new Set(t),o=n.current;r.forEach(function(a){s.has(a)||of(a,null)}
vendor: 4,112 bytes, lines 514-529
514),s.forEach(function(a){r.has(a)||of(a,o)})}Ky.set(n,t)},[t]),n}function nD(t){return t}function iD(t,e){e===void 0&&(e=nD);var n=[],i=!1,r={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var o=e(s,i);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(i=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){i=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var l=function(){var u=o;o=[],u.forEach(s)},d=function(){return Promise.resolve().then(l)};d(),n={push:function(u){o.push(u),d()},filter:function(u){return o=o.filter(u),n}}}};return r}function rD(t){t===void 0&&(t={});var e=iD(null);return e.options=vi({async:!0,ssr:!1},t),e}var YC=function(t){var e=t.sideCar,n=JC(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=e.read();if(!i)throw new Error("Sidecar medium not found");return f.createElement(i,vi({},n))};YC.isSideCarExport=!0;function sD(t,e){return t.useMedium(e),YC}var XC=rD(),af=function(){},th=f.forwardRef(function(t,e){var n=f.useRef(null),i=f.useState({onScrollCapture:af,onWheelCapture:af,onTouchMoveCapture:af}),r=i[0],s=i[1],o=t.forwardProps,a=t.children,l=t.className,d=t.removeScrollBar,u=t.enabled,h=t.shards,p=t.sideCar,g=t.noIsolation,b=t.inert,m=t.allowPinchZoom,k=t.as,v=k===void 0?"div":k,y=t.gapMode,x=JC(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,w=tD([n,e]),C=vi(vi({},x),r);return f.createElement(f.Fragment,null,u&&f.createElement(S,{sideCar:XC,removeScrollBar:d,shards:h,noIsolation:g,inert:b,setCallbacks:s,allowPinchZoom:!!m,lockRef:n,gapMode:y}),o?f.cloneElement(f.Children.only(a),vi(vi({},C),{ref:w})):f.createElement(v,vi({},C,{className:l,ref:w}),a))});th.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};th.classNames={fullWidth:bd,zeroRight:yd};var oD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function aD(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=oD();return e&&t.setAttribute("nonce",e),t}function cD(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function lD(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var dD=function(){var t=0,e=null;return{add:function(n){t==0&&(e=aD())&&(cD(e,n),lD(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},uD=function(){var t=dD();return function(e,n){f.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},ZC=function(){var t=uD(),e=function(n){var i=n.styles,r=n.dynamic;return t(i,r),null};return e},hD={left:0,top:0,right:0,gap:0},cf=function(t){return parseInt(t||"",10)||0},fD=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],i=e[t==="padding"?"paddingTop":"marginTop"],r=e[t==="padding"?"paddingRight":"marginRight"];return[cf(n),cf(i),cf(r)]},pD=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return hD;var e=fD(t),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,i-n+e[2]-e[0])}},mD=ZC(),zo="data-scroll-locked",gD=function(t,e,n,i){var r=t.left,s=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),` 515 .`.concat(YO,` { 516 overflow: hidden `).concat(i,`; 517 padding-right: `).concat(a,"px ").concat(i,`; 518 } 519 body[`).concat(zo,`] { 520 overflow: hidden `).concat(i,`; 521 overscroll-behavior: contain; 522 `).concat([e&&"position: relative ".concat(i,";"),n==="margin"&&` 523 padding-left: `.concat(r,`px; 524 padding-top: `).concat(s,`px; 525 padding-right: `).concat(o,`px; 526 margin-left:0; 527 margin-top:0; 528 margin-right: `).concat(a,"px ").concat(i,`; 529 `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(i,";
529")].filter(Boolean).join(""),` 530 } 531 532 .`).concat(yd,` { 533 right: `).concat(a,"px ").concat(i,`; 534 } 535 536 .`).concat(bd,` { 537 margin-right: `).concat(a,"px ").concat(i,`; 538 } 539 540 .`).concat(yd," .").concat(yd,` { 541 right: 0 `).concat(i,`; 542 } 543 544 .`).concat(bd," .").concat(bd,` { 545 margin-right: 0 `).concat(i,`; 546 } 547 548 body[`).concat(zo,`] { 549 `).concat(XO,": ").concat(a,`px; 550 } 551`)},Gy=function(){var t=parseInt(document.body.getAttribute(zo)||"0",10);return isFinite(t)?t:0},vD=function(){f.useEffect(function(){return document.body.setAttribute(zo,(Gy()+1).toString()),function(){var t=Gy()-1;t<=0?document.body.removeAttribute(zo):document.body.setAttribute(zo,t.toString())}},[])},yD=function(t){var e=t.noRelative,n=t.noImportant,i=t.gapMode,r=i===void 0?"margin":i;vD();var s=f.useMemo(function(){return pD(r)},[r]);return f.createElement(mD,{styles:gD(s,!e,r,n?"":"!important")})},Kp=!1;if(typeof window<"u")try{var Hl=Object.defineProperty({},"passive",{get:function(){return Kp=!0,!0}});window.addEventListener("test",Hl,Hl),window.removeEventListener("test",Hl,Hl)}catch{Kp=!1}var ao=Kp?{passive:!1}:!1,bD=function(t){return t.tagName==="TEXTAREA"},eT=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!bD(t)&&n[e]==="visible")},xD=function(t){return eT(t,"overflowY")},kD=function(t){return eT(t,"overflowX")},Qy=function(t,e){var n=e.ownerDocument,i=e;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var r=tT(t,i);if(r){var s=nT(t,i),o=s[1],a=s[2];if(o>a)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},SD=function(t){var e=t.scrollTop,n=t.scrollHeight,i=t.clientHeight;return[e,n,i]},wD=function(t){var e=t.scrollLeft,n=t.scrollWidth,i=t.clientWidth;return[e,n,i]},tT=function(t,e){return t==="v"?xD(e):kD(e)},nT=function(t,e){return t==="v"?SD(e):wD(e)},CD=function(t,e){return t==="h"&&e==="rtl"?-1:1},TD=function(t,e,n,i,r){var s=CD(t,window.getComputedStyle(e).direction),o=s*i,a=n.target,l=e.contains(a),d=!1,u=o>0,h=0,p=0;do{var g=nT(t,a),b=g[0],m=g[1],k=g[2],v=m-k-s*b;(b||v)&&tT(t,a)&&(h+=v,p+=b),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(e.contains(a)||e===a));return(u&&(Math.abs(h)<1||!r)||!u&&(Math.abs(p)<1||!r))&&(d=!0),d},$l=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Jy=function(t){return[t.deltaX,t.deltaY]},Yy=function(t){return t&&"current"in t?t.current:t},_D=function(t,e){return t[0]===e[0]&&t[1]===e[1]},ED=function(t){return` 552 .block-interactivity-`.concat(t,` {pointer-events: none;} 553 .allow-interactivity-`).concat(t,` {pointer-events: all;} 554`)},PD=0,co=[];function RD(t){var e=f.useRef([]),n=f.useRef([0,0]),i=f.useRef(),r=f.useState(PD++)[0],s=f.useState(ZC)[0],o=f.useRef(t);f.useEffect(function(){o.current=t},[t]),f.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var m=JO([t.lockRef.current],(t.shards||[]).map(Yy),!0).filter(Boolean);return m.forEach(function(k){return k.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var a=f.useCallback(function(m,k){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var v=$l(m),y=n.current,x="deltaX"in m?m.deltaX:y[0]-v[0],S="deltaY"in m?m.deltaY:y[1]-v[1],w,C=m.target,R=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&R==="h"&&C.type==="range")return!1;var P=Qy(R,C);if(!P)return!0;if(P?w=R:(w=R==="v"?"h":"v",P=Qy(R,C)),!P)return!1;if(!i.current&&"changedTouches"in m&&(x||S)&&(i.current=w),!w)return!0;var N=i.current||w;return TD(N,k,m,N==="h"?x:S,!0)},[]),l=f.useCallback(function(m){var k=m;if(!(!co.length||co[co.length-1]!==s)){var v="deltaY"in k?Jy(k):$l(k),y=e.current.filter(function(w){return w.name===k.type&&(w.target===k.target||k.target===w.shadowParent)&&_D(w.delta,v)}
vendor: 9,009 bytes, lines 554-558
554)[0];if(y&&y.should){k.cancelable&&k.preventDefault();return}if(!y){var x=(o.current.shards||[]).map(Yy).filter(Boolean).filter(function(w){return w.contains(k.target)}),S=x.length>0?a(k,x[0]):!o.current.noIsolation;S&&k.cancelable&&k.preventDefault()}}},[]),d=f.useCallback(function(m,k,v,y){var x={name:m,delta:k,target:v,should:y,shadowParent:ND(v)};e.current.push(x),setTimeout(function(){e.current=e.current.filter(function(S){return S!==x})},1)},[]),u=f.useCallback(function(m){n.current=$l(m),i.current=void 0},[]),h=f.useCallback(function(m){d(m.type,Jy(m),m.target,a(m,t.lockRef.current))},[]),p=f.useCallback(function(m){d(m.type,$l(m),m.target,a(m,t.lockRef.current))},[]);f.useEffect(function(){return co.push(s),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,ao),document.addEventListener("touchmove",l,ao),document.addEventListener("touchstart",u,ao),function(){co=co.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,ao),document.removeEventListener("touchmove",l,ao),document.removeEventListener("touchstart",u,ao)}},[]);var g=t.removeScrollBar,b=t.inert;return f.createElement(f.Fragment,null,b?f.createElement(s,{styles:ED(r)}):null,g?f.createElement(yD,{gapMode:t.gapMode}):null)}function ND(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const ID=sD(XC,RD);var tv=f.forwardRef(function(t,e){return f.createElement(th,vi({},t,{ref:e,sideCar:ID}))});tv.classNames=th.classNames;var jD=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},lo=new WeakMap,ql=new WeakMap,Kl={},lf=0,iT=function(t){return t&&(t.host||iT(t.parentNode))},AD=function(t,e){return e.map(function(n){if(t.contains(n))return n;var i=iT(n);return i&&t.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},OD=function(t,e,n,i){var r=AD(e,Array.isArray(t)?t:[t]);Kl[n]||(Kl[n]=new WeakMap);var s=Kl[n],o=[],a=new Set,l=new Set(r),d=function(h){!h||a.has(h)||(a.add(h),d(h.parentNode))};r.forEach(d);var u=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))u(p);else try{var g=p.getAttribute(i),b=g!==null&&g!=="false",m=(lo.get(p)||0)+1,k=(s.get(p)||0)+1;lo.set(p,m),s.set(p,k),o.push(p),m===1&&b&&ql.set(p,!0),k===1&&p.setAttribute(n,"true"),b||p.setAttribute(i,"true")}catch(v){console.error("aria-hidden: cannot operate on ",p,v)}})};return u(e),a.clear(),lf++,function(){o.forEach(function(h){var p=lo.get(h)-1,g=s.get(h)-1;lo.set(h,p),s.set(h,g),p||(ql.has(h)||h.removeAttribute(i),ql.delete(h)),g||h.removeAttribute(n)}),lf--,lf||(lo=new WeakMap,lo=new WeakMap,ql=new WeakMap,Kl={})}},rT=function(t,e,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(t)?t:[t]),r=jD(t);return r?(i.push.apply(i,Array.from(r.querySelectorAll("[aria-live]"))),OD(i,r,n,"aria-hidden")):function(){return null}},nv="Dialog",[sT,S8]=$u(nv),[DD,si]=sT(nv),oT=t=>{const{__scopeDialog:e,children:n,open:i,defaultOpen:r,onOpenChange:s,modal:o=!0}=t,a=f.useRef(null),l=f.useRef(null),[d=!1,u]=Dc({prop:i,defaultProp:r,onChange:s});return c.jsx(DD,{scope:e,triggerRef:a,contentRef:l,contentId:Vo(),titleId:Vo(),descriptionId:Vo(),open:d,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(h=>!h),[u]),modal:o,children:n})};oT.displayName=nv;var aT="DialogTrigger",cT=f.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=si(aT,n),s=tt(e,r.triggerRef);return c.jsx(Re.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":sv(r.open),...i,ref:s,onClick:Ee(t.onClick,r.onOpenToggle)})});cT.displayName=aT;var iv="DialogPortal",[LD,lT]=sT(iv,{forceMount:void 0}),dT=t=>{const{__scopeDialog:e,forceMount:n,children:i,container:r}=t,s=si(iv,e);return c.jsx(LD,{scope:e,forceMount:n,children:f.Children.map(i,o=>c.jsx(ml,{present:n||s.open,children:c.jsx(Ku,{asChild:!0,container:r,children:o})}))})};dT.displayName=iv;var du="DialogOverlay",uT=f.forwardRef((t,e)=>{const n=lT(du,t.__scopeDialog),{forceMount:i=n.forceMount,...r}=t,s=si(du,t.__scopeDialog);return s.modal?c.jsx(ml,{present:i||s.open,children:c.jsx(MD,{...r,ref:e})}):null});uT.displayName=du;var MD=f.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=si(du,n);return c.jsx(tv,{as:Hs,allowPinchZoom:!0,shards:[r.contentRef],children:c.jsx(Re.div,{"data-state":sv(r.open),...i,ref:e,style:{pointerEvents:"auto",...i.style}})})}),$s="DialogContent",hT=f.forwardRef((t,e)=>{const n=lT($s,t.__scopeDialog),{forceMount:i=n.forceMount,...r}=t,s=si($s,t.__scopeDialog);return c.jsx(ml,{present:i||s.open,children:s.modal?c.jsx(UD,{...r,ref:e}):c.jsx(FD,{...r,ref:e})})});hT.displayName=$s;var UD=f.forwardRef((t,e)=>{const n=si($s,t.__scopeDialog),i=f.useRef(null),r=tt(e,n.contentRef,i);return f.useEffect(()=>{const s=i.current;if(s)return rT(s)},[]),c.jsx(fT,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Ee(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Ee(t.onFocusOutside,s=>s.preventDefault())})}),FD=f.forwardRef((t,e)=>{const n=si($s,t.__scopeDialog),i=f.useRef(!1),r=f.useRef(!1);return c.jsx(fT,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=t.onCloseAutoFocus)==null||o.call(t,s),s.defaultPrevented||(i.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),i.current=!1,r.current=!1},onInteractOutside:s=>{var l,d;(l=t.onInteractOutside)==null||l.call(t,s),s.defaultPrevented||(i.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=s.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),fT=f.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:r,onCloseAutoFocus:s,...o}=t,a=si($s,n),l=f.useRef(null),d=tt(e,l);return QC(),c.jsxs(c.Fragment,{children:[c.jsx(ev,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:r,onUnmountAutoFocus:s,children:c.jsx(qu,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":sv(a.open),...o,ref:d,onDismiss:()=>a.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(VD,{titleId:a.titleId}),c.jsx(BD,{contentRef:l,descriptionId:a.descriptionId})]})]})}),rv="DialogTitle",pT=f.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=si(rv,n);return c.jsx(Re.h2,{id:r.titleId,...i,ref:e})});pT.displayName=rv;var mT="DialogDescription",gT=f.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=si(mT,n);return c.jsx(Re.p,{id:r.descriptionId,...i,ref:e})});gT.displayName=mT;var vT="DialogClose",yT=f.forwardRef((t,e)=>{const{__scopeDialog:n,...i}=t,r=si(vT,n);return c.jsx(Re.button,{type:"button",...i,ref:e,onClick:Ee(t.onClick,()=>r.onOpenChange(!1))})});yT.displayName=vT;function sv(t){return t?"open":"closed"}var bT="DialogTitleWarning",[w8,xT]=JI(bT,{contentName:$s,titleName:rv,docsSlug:"dialog"}),VD=({titleId:t})=>{const e=xT(bT),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. 555 556If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. 557 558For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return f.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},zD="DialogDescriptionWarning",BD=({contentRef:t,descriptionId:e})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xT(zD).contentName}}.`;return f.useEffect(()=>{var s;const r=(s=t.current)==null?void 0:s.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(i))},[i,t,e]),null},WD=oT,HD=cT,$D=dT,kT=uT,ST=hT,wT=pT,CT=gT,TT=yT;const _T=WD,qD=HD,ET=$D,KD=TT,ov=f.forwardRef(({className:t,...e},n)=>c.jsx(kT,{ref:n,className:De("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));ov.displayName=kT.displayName;const av=f.forwardRef(({className:t,children:e,...n},i)=>c.jsxs(ET,{children:[c.jsx(ov,{}),c.jsxs(ST,{ref:i,className:De("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border/60 bg-background p-6 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
558nded-xl",t),...n,children:[e,c.jsxs(TT,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[c.jsx(Si,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));av.displayName=ST.displayName;const cv=({className:t,...e})=>c.jsx("div",{className:De("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});cv.displayName="DialogHeader";const PT=({className:t,...e})=>c.jsx("div",{className:De("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});PT.displayName="DialogFooter";const lv=f.forwardRef(({className:t,...e},n)=>c.jsx(wT,{ref:n,className:De("text-lg font-semibold leading-none tracking-tight",t),...e}));lv.displayName=wT.displayName;const dv=f.forwardRef(({className:t,...e},n)=>c.jsx(CT,{ref:n,className:De("text-sm text-muted-foreground",t),...e}));dv.displayName=CT.displayName;const GD=Object.freeze(Object.defineProperty({__proto__:null,Dialog:_T,DialogClose:KD,DialogContent:av,DialogDescription:dv,DialogFooter:PT,DialogHeader:cv,DialogOverlay:ov,DialogPortal:ET,DialogTitle:lv,DialogTrigger:qD},Symbol.toStringTag,{value:"Module"}));function QD({variant:t="gradient",message:e,showClose:n=!0,onClose:i}){const[r,s]=f.useState(!0),{billingPlan:o}=or(),{canUpgrade:a,upgradeMessage:l}=Jg(),{user:d}=Et();if(!a||o!=="free"||!r||(d==null?void 0:d.role)==="client")return null;const u=()=>{s(!1),i==null||i()};return t==="compact"?c.jsx("div",{className:"bg-gradient-to-r from-brand-600/10 to-blue-600/10 border-b border-brand-500/20 px-4 py-2","data-testid":"upgrade-banner-compact",children:c.jsxs("div",{className:"flex items-center justify-between max-w-7xl mx-auto",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(Gi,{className:"w-4 h-4 text-brand-500"}),c.jsx("span",{className:"text-brand-700 dark:text-brand-300",children:e||"You're on the Free plan."}),c.jsx("span",{className:"text-brand-600 dark:text-brand-400 font-medium",children:"Upgrade for unlimited access."})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Le,{href:"/pricing",children:c.jsxs(he,{size:"sm",className:"bg-brand-600 hover:bg-brand-700 text-white h-7 px-3 text-xs","data-testid":"upgrade-btn-compact",children:["Upgrade ",c.jsx(Lc,{className:"w-3 h-3 ml-1"})]})}),n&&c.jsx("button",{onClick:u,className:"text-brand-400 hover:text-brand-600","data-testid":"close-banner-compact",children:c.jsx(Si,{className:"w-4 h-4"})})]})]})}):t==="subtle"?c.jsx("div",{className:"bg-gradient-to-r from-slate-50 to-brand-50 dark:from-slate-900 dark:to-brand-900/20 border border-brand-200 dark:border-brand-800 rounded-lg p-4 mb-4","data-testid":"upgrade-banner-subtle",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"p-2 bg-brand-100 dark:bg-brand-900/50 rounded-lg",children:c.jsx(_r,{className:"w-5 h-5 text-brand-600 dark:text-brand-400"})}),c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-gray-900 dark:text-gray-100",children:e||l}),c.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Get access to all features with our Starter plan"})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Le,{href:"/pricing",children:c.jsx(he,{size:"sm",variant:"outline",className:"border-brand-300 text-brand-700 hover:bg-brand-50 dark:border-brand-700 dark:text-brand-300","data-testid":"upgrade-btn-subtle",children:"View Plans"})}),n&&c.jsx("button",{onClick:u,className:"text-gray-400 hover:text-gray-600",children:c.jsx(Si,{className:"w-4 h-4"})})]})]})}):c.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-r from-brand-600 via-brand-700 to-blue-600 rounded-xl p-6 mb-6 shadow-lg","data-testid":"upgrade-banner-gradient",children:[c.jsx("div",{className:"absolute inset-0 bg-[url('/grid.svg')] opacity-10"}),c.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-white/10 rounded-full blur-3xl -translate-y-1/2 translate-x-1/2"}),c.jsxs("div",{className:"relative flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("div",{className:"p-3 bg-white/20 rounded-xl backdrop-blur",children:c.jsx($p,{className:"w-8 h-8 text-white"})}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xl font-bold text-white mb-1",children:"Unlock the Full Power of bangOS"}),c.jsx("p",{className:"text-white/80 max-w-lg",children:e||"You're currently on the Free plan with limited features. Upgrade to get unlimited access to AI agents, voice calls, and automation."})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(Le,{href:"/pricing",children:c.jsxs(he,{className:"bg-white text-brand-700 hover:bg-white/90 font-semibold px-6","data-testid":"upgrade-btn-gradient",children:["Upgrade Now ",c.jsx(Lc,{className:"w-4 h-4 ml-2"})]})}),n&&c.jsx("button",{onClick:u,className:"text-white/60 hover:text-white","data-testid":"close-banner-gradient",children:c.jsx(Si,{className:"w-5 h-5"})})]})]})]})}function C8({title:t="Upgrade Your Plan",description:e="Get more from bangOS with a paid plan",features:n=["Unlimited AI queries","Voice agents","Email automation","Priority support"],highlightPlan:i="starter",compact:r=!1}){const{billingPlan:s}=or(),{canUpgrade:o}=Jg(),{user:a}=Et();if(!o||s!=="free"||(a==null?void 0:a.role)==="client")return null;const d={starter:{price:49,name:"Starter Core"},professional:{price:149,name:"Pro Agent Stack"},enterprise:{price:499,name:"Enterprise"}}[i];return r?c.jsx(Mc,{className:"border-brand-200 dark:border-brand-800 bg-gradient-to-br from-brand-50 to-white dark:from-brand-950/50 dark:to-slate-900","data-testid":"upgrade-card-compact",children:c.jsx(Uc,{className:"p-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"p-2 bg-brand-100 dark:bg-brand-900 rounded-lg",children:c.jsx(cu,{className:"w-4 h-4 text-brand-600"})}),c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:t}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Starting at $",d.price,"/mo"]})]})]}),c.jsx(Le,{href:"/pricing",children:c.jsx(he,{size:"sm",className:"bg-brand-600 hover:bg-brand-700","data-testid":"upgrade-card-btn",children:"Upgrade"})})]})})}):c.jsxs(Mc,{className:"border-brand-200 dark:border-brand-800 bg-gradient-to-br from-brand-50 via-white to-blue-50 dark:from-brand-950/50 dark:via-slate-900 dark:to-blue-950/30 overflow-hidden","data-testid":"upgrade-card",children:[c.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-brand-200/50 dark:bg-brand-800/20 rounded-full blur-2xl -translate-y-1/2 translate-x-1/2"}),c.jsxs(Xu,{className:"relative",children:[c.jsx("div",{className:"flex items-center gap-2 mb-2",children:c.jsxs(BC,{className:"bg-brand-600 text-white",children:[c.jsx(yA,{className:"w-3 h-3 mr-1"}),"Recommended"]})}),c.jsx(Zu,{className:"text-xl",children:t}),c.jsx(eh,{children:e})]}),c.jsxs(Uc,{className:"relative space-y-4",children:[c.jsxs("div",{className:"flex items-baseline gap-1",children:[c.jsxs("span",{className:"text-3xl font-bold",children:["$",d.price]}),c.jsx("span",{className:"text-muted-foreground",children:"/month"})]}),c.jsx("ul",{className:"space-y-2",children:n.map((u,h)=>c.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[c.jsx(Yu,{className:"w-4 h-4 text-green-500"}),u]},h))}),c.jsx(Le,{href:"/pricing",children:c.jsxs(he,{className:"w-full bg-gradient-to-r from-brand-600 to-blue-600 hover:from-brand-700 hover:to-blue-700","data-testid":"upgrade-card-cta",children:["Upgrade to ",d.name," ",c.jsx(Lc,{className:"w-4 h-4 ml-2"})]})})]})]})}function JD(){const{billingPlan:t}=or(),{canUpgrade:e}=Jg(),{user:n}=Et();return!e||t!=="free"||(n==null?void 0:n.role)==="client"?null:c.jsxs("div",{className:"mx-3 mb-4 p-3 rounded-lg bg-gradient-to-br from-brand-600/10 to-blue-600/10 border border-brand-500/20","data-testid":"sidebar-upgrade-prompt",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx(Gi,{className:"w-4 h-4 text-brand-500"}),c.jsx("span",{className:"text-sm font-medium",children:"Free Plan"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"Unlock AI agents, voice calls, and more"}),c.jsx(Le,{href:"/pricing",children:c.jsxs(he,{size:"sm",className:"w-full bg-brand-600 hover:bg-brand-700 text-xs","data-testid":"sidebar-upgrade-btn",children:["Upgrade ",c.jsx(Lc,{className:"w-3 h-3 ml-1"})]})})]})}function T8({feature:t,message:e}){const{billingPlan:n}=or(),{user:i}=Et();return n!=="free"||(i==null?void 0:i.role)==="client"?null:c.jsxs("div",{className:"flex items-center gap-3 p-3 bg-brand-50 dark:bg-brand-950/30 border border-brand-200 dark:border-brand-800 rounded-lg","data-testid":`inline-upgrade-${t}`,children:[c.jsx(_r,{className:"w-5 h-5 text-brand-500 flex-shrink-0"}),c.jsx("p",{className:"text-sm flex-1",children:e||`Upgrade to unlock ${t}`}),c.jsx(Le,{href:"/pricing",children:c.jsx(he,{size:"sm",variant:"outline",className:"border-brand-300 text-brand-600 hover:bg-brand-100","data-testid":`inline-upgrade-btn-${t}`,children:"Upgrade"})})]})}function Xy(t,[e,n]){return Math.min(n,Math.max(e,t))}var YD=f.createContext(void 0);function XD(t){const e=f.useContext(YD);return t||e||"ltr"}const ZD=["top","right","bottom","left"],ns=Math.min,mn=Math.max,uu=Math.round,Gl=Math.floor,wi=t=>({x:t,y:t}
vendor: 12,579 bytes, line 558
558),e2={left:"right",right:"left",bottom:"top",top:"bottom"},t2={start:"end",end:"start"};function Gp(t,e,n){return mn(t,ns(e,n))}function nr(t,e){return typeof t=="function"?t(e):t}function ir(t){return t.split("-")[0]}function Pa(t){return t.split("-")[1]}function uv(t){return t==="x"?"y":"x"}function hv(t){return t==="y"?"height":"width"}const n2=new Set(["top","bottom"]);function is(t){return n2.has(ir(t))?"y":"x"}function fv(t){return uv(is(t))}function i2(t,e,n){n===void 0&&(n=!1);const i=Pa(t),r=fv(t),s=hv(r);let o=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=hu(o)),[o,hu(o)]}function r2(t){const e=hu(t);return[Qp(t),e,Qp(e)]}function Qp(t){return t.replace(/start|end/g,e=>t2[e])}const Zy=["left","right"],eb=["right","left"],s2=["top","bottom"],o2=["bottom","top"];function a2(t,e,n){switch(t){case"top":case"bottom":return n?e?eb:Zy:e?Zy:eb;case"left":case"right":return e?s2:o2;default:return[]}}function c2(t,e,n,i){const r=Pa(t);let s=a2(ir(t),n==="start",i);return r&&(s=s.map(o=>o+"-"+r),e&&(s=s.concat(s.map(Qp)))),s}function hu(t){return t.replace(/left|right|bottom|top/g,e=>e2[e])}function l2(t){return{top:0,right:0,bottom:0,left:0,...t}}function RT(t){return typeof t!="number"?l2(t):{top:t,right:t,bottom:t,left:t}}function fu(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function tb(t,e,n){let{reference:i,floating:r}=t;const s=is(e),o=fv(e),a=hv(o),l=ir(e),d=s==="y",u=i.x+i.width/2-r.width/2,h=i.y+i.height/2-r.height/2,p=i[a]/2-r[a]/2;let g;switch(l){case"top":g={x:u,y:i.y-r.height};break;case"bottom":g={x:u,y:i.y+i.height};break;case"right":g={x:i.x+i.width,y:h};break;case"left":g={x:i.x-r.width,y:h};break;default:g={x:i.x,y:i.y}}switch(Pa(e)){case"start":g[o]-=p*(n&&d?-1:1);break;case"end":g[o]+=p*(n&&d?-1:1);break}return g}const d2=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:h}=tb(d,i,l),p=i,g={},b=0;for(let m=0;m<a.length;m++){const{name:k,fn:v}=a[m],{x:y,y:x,data:S,reset:w}=await v({x:u,y:h,initialPlacement:i,placement:p,strategy:r,middlewareData:g,rects:d,platform:o,elements:{reference:t,floating:e}});u=y??u,h=x??h,g={...g,[k]:{...g[k],...S}},w&&b<=50&&(b++,typeof w=="object"&&(w.placement&&(p=w.placement),w.rects&&(d=w.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:r}):w.rects),{x:u,y:h}=tb(d,p,l)),m=-1)}return{x:u,y:h,placement:p,strategy:r,middlewareData:g}};async function Fc(t,e){var n;e===void 0&&(e={});const{x:i,y:r,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:p=!1,padding:g=0}=nr(e,t),b=RT(g),k=a[p?h==="floating"?"reference":"floating":h],v=fu(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(k)))==null||n?k:k.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy:l})),y=h==="floating"?{x:i,y:r,width:o.floating.width,height:o.floating.height}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),S=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},w=fu(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(v.top-w.top+b.top)/S.y,bottom:(w.bottom-v.bottom+b.bottom)/S.y,left:(v.left-w.left+b.left)/S.x,right:(w.right-v.right+b.right)/S.x}}const u2=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:d,padding:u=0}=nr(t,e)||{};if(d==null)return{};const h=RT(u),p={x:n,y:i},g=fv(r),b=hv(g),m=await o.getDimensions(d),k=g==="y",v=k?"top":"left",y=k?"bottom":"right",x=k?"clientHeight":"clientWidth",S=s.reference[b]+s.reference[g]-p[g]-s.floating[b],w=p[g]-s.reference[g],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let R=C?C[x]:0;(!R||!await(o.isElement==null?void 0:o.isElement(C)))&&(R=a.floating[x]||s.floating[b]);const P=S/2-w/2,N=R/2-m[b]/2-1,I=ns(h[v],N),L=ns(h[y],N),j=I,Z=R-m[b]-L,F=R/2-m[b]/2+P,te=Gp(j,F,Z),Y=!l.arrow&&Pa(r)!=null&&F!==te&&s.reference[b]/2-(F<j?I:L)-m[b]/2<0,K=Y?F<j?F-j:F-Z:0;return{[g]:p[g]+K,data:{[g]:te,centerOffset:F-te-K,...Y&&{alignmentOffset:K}},reset:Y}}}),h2=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:r,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:m=!0,...k}=nr(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=ir(r),y=is(a),x=ir(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(d.floating)),w=p||(x||!m?[hu(a)]:r2(a)),C=b!=="none";!p&&C&&w.push(...c2(a,m,b,S));const R=[a,...w],P=await Fc(e,k),N=[];let I=((i=s.flip)==null?void 0:i.overflows)||[];if(u&&N.push(P[v]),h){const F=i2(r,o,S);N.push(P[F[0]],P[F[1]])}if(I=[...I,{placement:r,overflows:N}],!N.every(F=>F<=0)){var L,j;const F=(((L=s.flip)==null?void 0:L.index)||0)+1,te=R[F];if(te)return{data:{index:F,overflows:I},reset:{placement:te}};let Y=(j=I.filter(K=>K.overflows[0]<=0).sort((K,A)=>K.overflows[1]-A.overflows[1])[0])==null?void 0:j.placement;if(!Y)switch(g){case"bestFit":{var Z;const K=(Z=I.filter(A=>{if(C){const U=is(A.placement);return U===y||U==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(U=>U>0).reduce((U,Q)=>U+Q,0)]).sort((A,U)=>A[1]-U[1])[0])==null?void 0:Z[0];K&&(Y=K);break}case"initialPlacement":Y=a;break}if(r!==Y)return{reset:{placement:Y}}}return{}}}};function nb(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function ib(t){return ZD.some(e=>t[e]>=0)}const f2=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:i="referenceHidden",...r}=nr(t,e);switch(i){case"referenceHidden":{const s=await Fc(e,{...r,elementContext:"reference"}),o=nb(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:ib(o)}}}case"escaped":{const s=await Fc(e,{...r,altBoundary:!0}),o=nb(s,n.floating);return{data:{escapedOffsets:o,escaped:ib(o)}}}default:return{}}}}};async function p2(t,e){const{placement:n,platform:i,elements:r}=t,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),o=ir(n),a=Pa(n),l=is(n)==="y",d=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,h=nr(e,t);let{mainAxis:p,crossAxis:g,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof b=="number"&&(g=a==="end"?b*-1:b),l?{x:g*u,y:p*d}:{x:p*d,y:g*u}}const m2=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:s,placement:o,middlewareData:a}=e,l=await p2(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(i=a.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:o}}}}},g2=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:k=>{let{x:v,y}=k;return{x:v,y}}},...l}=nr(t,e),d={x:n,y:i},u=await Fc(e,l),h=is(ir(r)),p=uv(h);let g=d[p],b=d[h];if(s){const k=p==="y"?"top":"left",v=p==="y"?"bottom":"right",y=g+u[k],x=g-u[v];g=Gp(y,g,x)}if(o){const k=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=b+u[k],x=b-u[v];b=Gp(y,b,x)}const m=a.fn({...e,[p]:g,[h]:b});return{...m,data:{x:m.x-n,y:m.y-i,enabled:{[p]:s,[h]:o}}}}}},v2=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:r,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:d=!0}=nr(t,e),u={x:n,y:i},h=is(r),p=uv(h);let g=u[p],b=u[h];const m=nr(a,e),k=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const x=p==="y"?"height":"width",S=s.reference[p]-s.floating[x]+k.mainAxis,w=s.reference[p]+s.reference[x]-k.mainAxis;g<S?g=S:g>w&&(g=w)}if(d){var v,y;const x=p==="y"?"width":"height",S=["top","left"].includes(ir(r)),w=s.reference[h]-s.floating[x]+(S&&((v=o.offset)==null?void 0:v[h])||0)+(S?0:k.crossAxis),C=s.reference[h]+s.reference[x]+(S?0:((y=o.offset)==null?void 0:y[h])||0)-(S?k.crossAxis:0);b<w?b=w:b>C&&(b=C)}return{[p]:g,[h]:b}}}},y2=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:r,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...d}=nr(t,e),u=await Fc(e,d),h=ir(r),p=Pa(r),g=is(r)==="y",{width:b,height:m}=s.floating;let k,v;h==="top"||h==="bottom"?(k=h,v=p===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(v=h,k=p==="end"?"top":"bottom");const y=m-u.top-u.bottom,x=b-u.left-u.right,S=ns(m-u[k],y),w=ns(b-u[v],x),C=!e.middlewareData.shift;let R=S,P=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(P=x),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(R=y),C&&!p){const I=mn(u.left,0),L=mn(u.right,0),j=mn(u.top,0),Z=mn(u.bottom,0);g?P=b-2*(I!==0||L!==0?I+L:mn(u.left,u.right)):R=m-2*(j!==0||Z!==0?j+Z:mn(u.top,u.bottom))}await l({...e,availableWidth:P,availableHeight:R});const N=await o.getDimensions(a.floating);return b!==N.width||m!==N.height?{reset:{rects:!0}}:{}}}};function nh(){return typeof window<"u"}function Ra(t){return NT(t)?(t.nodeName||"").toLowerCase():"#document"}function xn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ri(t){var e;return(e=(NT(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function NT(t){return nh()?t instanceof Node||t instanceof xn(t).Node:!1}function ni(t){return nh()?t instanceof Element||t instanceof xn(t).Element:!1}function Ti(t){return nh()?t instanceof HTMLElement||t instanceof xn(t).HTMLElement:!1}function rb(t){return!nh()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof xn(t).ShadowRoot}const b2=new Set(["inline","contents"]);function gl(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=ii(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!b2.has(r)}const x2=new Set(["table","td","th"]);function k2(t){return x2.has(Ra(t))}const S2=[":popover-open",":modal"];function ih(t){return S2.some(e=>{try{return t.matches(e)}catch{return!1}})}const w2=["transform","translate","scale","rotate","perspective"],C2=["transform","translate","scale","rotate","perspective","filter"],T2=["paint","layout","strict","content"];function pv(t){const e=mv(),n=ni(t)?ii(t):t;return w2.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||C2.some(i=>(n.willChange||"").includes(i))||T2.some(i=>(n.contain||"").includes(i))}function _2(t){let e=rs(t);for(;Ti(e)&&!ba(e);){if(pv(e))return e;if(ih(e))return null;e=rs(e)}return null}function mv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const E2=new Set(["html","body","#document"]);function ba(t){return E2.has(Ra(t))}function ii(t){return xn(t).getComputedStyle(t)}function rh(t){return ni(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function rs(t){if(Ra(t)==="html")return t;const e=t.assignedSlot||t.parentNode||rb(t)&&t.host||Ri(t);return rb(e)?e.host:e}function IT(t){const e=rs(t);return ba(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ti(e)&&gl(e)?e:IT(e)}function Vc(t,e,n){var i;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=IT(t),s=r===((i=t.ownerDocument)==null?void 0:i.body),o=xn(r);if(s){const a=Jp(o);return e.concat(o,o.visualViewport||[],gl(r)?r:[],a&&n?Vc(a):[])}return e.concat(r,Vc(r,[],n))}function Jp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function jT(t){const e=ii(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Ti(t),s=r?t.offsetWidth:n,o=r?t.offsetHeight:i,a=uu(n)!==s||uu(i)!==o;return a&&(n=s,i=o),{width:n,height:i,$:a}}function gv(t){return ni(t)?t:t.contextElement}function Bo(t){const e=gv(t);if(!Ti(e))return wi(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:s}=jT(e);let o=(s?uu(n.width):n.width)/i,a=(s?uu(n.height):n.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const P2=wi(0);function AT(t){const e=xn(t);
vendor: 4,140 bytes, line 558
558return!mv()||!e.visualViewport?P2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function R2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==xn(t)?!1:e}function qs(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=gv(t);let o=wi(1);e&&(i?ni(i)&&(o=Bo(i)):o=Bo(t));const a=R2(s,n,i)?AT(s):wi(0);let l=(r.left+a.x)/o.x,d=(r.top+a.y)/o.y,u=r.width/o.x,h=r.height/o.y;if(s){const p=xn(s),g=i&&ni(i)?xn(i):i;let b=p,m=Jp(b);for(;m&&i&&g!==b;){const k=Bo(m),v=m.getBoundingClientRect(),y=ii(m),x=v.left+(m.clientLeft+parseFloat(y.paddingLeft))*k.x,S=v.top+(m.clientTop+parseFloat(y.paddingTop))*k.y;l*=k.x,d*=k.y,u*=k.x,h*=k.y,l+=x,d+=S,b=xn(m),m=Jp(b)}}return fu({width:u,height:h,x:l,y:d})}function vv(t,e){const n=rh(t).scrollLeft;return e?e.left+n:qs(Ri(t)).left+n}function OT(t,e,n){n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=i.left+e.scrollLeft-(n?0:vv(t,i)),s=i.top+e.scrollTop;return{x:r,y:s}}function N2(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const s=r==="fixed",o=Ri(i),a=e?ih(e.floating):!1;if(i===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},d=wi(1);const u=wi(0),h=Ti(i);if((h||!h&&!s)&&((Ra(i)!=="body"||gl(o))&&(l=rh(i)),Ti(i))){const g=qs(i);d=Bo(i),u.x=g.x+i.clientLeft,u.y=g.y+i.clientTop}const p=o&&!h&&!s?OT(o,l,!0):wi(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+u.x+p.x,y:n.y*d.y-l.scrollTop*d.y+u.y+p.y}}function I2(t){return Array.from(t.getClientRects())}function j2(t){const e=Ri(t),n=rh(t),i=t.ownerDocument.body,r=mn(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=mn(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let o=-n.scrollLeft+vv(t);const a=-n.scrollTop;return ii(i).direction==="rtl"&&(o+=mn(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:o,y:a}}function A2(t,e){const n=xn(t),i=Ri(t),r=n.visualViewport;let s=i.clientWidth,o=i.clientHeight,a=0,l=0;if(r){s=r.width,o=r.height;const d=mv();(!d||d&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:s,height:o,x:a,y:l}}function O2(t,e){const n=qs(t,!0,e==="fixed"),i=n.top+t.clientTop,r=n.left+t.clientLeft,s=Ti(t)?Bo(t):wi(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=r*s.x,d=i*s.y;return{width:o,height:a,x:l,y:d}}function sb(t,e,n){let i;if(e==="viewport")i=A2(t,n);else if(e==="document")i=j2(Ri(t));else if(ni(e))i=O2(e,n);else{const r=AT(t);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return fu(i)}function DT(t,e){const n=rs(t);return n===e||!ni(n)||ba(n)?!1:ii(n).position==="fixed"||DT(n,e)}function D2(t,e){const n=e.get(t);if(n)return n;let i=Vc(t,[],!1).filter(a=>ni(a)&&Ra(a)!=="body"),r=null;const s=ii(t).position==="fixed";let o=s?rs(t):t;for(;ni(o)&&!ba(o);){const a=ii(o),l=pv(o);!l&&a.position==="fixed"&&(r=null),(s?!l&&!r:!l&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||gl(o)&&!l&&DT(t,o))?i=i.filter(u=>u!==o):r=a,o=rs(o)}return e.set(t,i),i}function L2(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const o=[...n==="clippingAncestors"?ih(e)?[]:D2(e,this._c):[].concat(n),i],a=o[0],l=o.reduce((d,u)=>{const h=sb(e,u,r);return d.top=mn(h.top,d.top),d.right=ns(h.right,d.right),d.bottom=ns(h.bottom,d.bottom),d.left=mn(h.left,d.left),d},sb(e,a,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function M2(t){const{width:e,height:n}=jT(t);return{width:e,height:n}}function U2(t,e,n){const i=Ti(e),r=Ri(e),s=n==="fixed",o=qs(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=wi(0);if(i||!i&&!s)if((Ra(e)!=="body"||gl(r))&&(a=rh(e)),i){const p=qs(e,!0,s,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else r&&(l.x=vv(r));const d=r&&!i&&!s?OT(r,a):wi(0),u=o.left+a.scrollLeft-l.x-d.x,h=o.top+a.scrollTop-l.y-d.y;return{x:u,y:h,width:o.width,height:o.height}}function df(t){return ii(t).position==="static"}function ob(t,e){if(!Ti(t)||ii(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ri(t)===n&&(n=n.ownerDocument.body),n}function LT(t,e){const n=xn(t);if(ih(t))return n;if(!Ti(t)){let r=rs(t);for(;r&&!ba(r);){if(ni(r)&&!df(r))return r;r=rs(r)}return n}let i=ob(t,e);for(;i&&k2(i)&&df(i);)i=ob(i,e);
vendor: 9,992 bytes, line 558
558return i&&ba(i)&&df(i)&&!pv(i)?n:i||_2(t)||n}const F2=async function(t){const e=this.getOffsetParent||LT,n=this.getDimensions,i=await n(t.floating);return{reference:U2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function V2(t){return ii(t).direction==="rtl"}const z2={convertOffsetParentRelativeRectToViewportRelativeRect:N2,getDocumentElement:Ri,getClippingRect:L2,getOffsetParent:LT,getElementRects:F2,getClientRects:I2,getDimensions:M2,getScale:Bo,isElement:ni,isRTL:V2};function MT(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function B2(t,e){let n=null,i;const r=Ri(t);function s(){var a;clearTimeout(i),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const d=t.getBoundingClientRect(),{left:u,top:h,width:p,height:g}=d;if(a||e(),!p||!g)return;const b=Gl(h),m=Gl(r.clientWidth-(u+p)),k=Gl(r.clientHeight-(h+g)),v=Gl(u),x={rootMargin:-b+"px "+-m+"px "+-k+"px "+-v+"px",threshold:mn(0,ns(1,l))||1};let S=!0;function w(C){const R=C[0].intersectionRatio;if(R!==l){if(!S)return o();R?o(!1,R):i=setTimeout(()=>{o(!1,1e-7)},1e3)}R===1&&!MT(d,t.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(w,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,x)}n.observe(t)}return o(!0),s}function W2(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,d=gv(t),u=r||s?[...d?Vc(d):[],...Vc(e)]:[];u.forEach(v=>{r&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const h=d&&a?B2(d,n):null;let p=-1,g=null;o&&(g=new ResizeObserver(v=>{let[y]=v;y&&y.target===d&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=g)==null||x.observe(e)})),n()}),d&&!l&&g.observe(d),g.observe(e));let b,m=l?qs(t):null;l&&k();function k(){const v=qs(t);m&&!MT(m,v)&&n(),m=v,b=requestAnimationFrame(k)}return n(),()=>{var v;u.forEach(y=>{r&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),h==null||h(),(v=g)==null||v.disconnect(),g=null,l&&cancelAnimationFrame(b)}}const H2=m2,$2=g2,q2=h2,K2=y2,G2=f2,ab=u2,Q2=v2,J2=(t,e,n)=>{const i=new Map,r={platform:z2,...n},s={...r.platform,_c:i};return d2(t,e,{...r,platform:s})};var xd=typeof document<"u"?f.useLayoutEffect:f.useEffect;function pu(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,i,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;i--!==0;)if(!pu(t[i],e[i]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(e,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!(s==="_owner"&&t.$$typeof)&&!pu(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function UT(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function cb(t,e){const n=UT(t);return Math.round(e*n)/n}function uf(t){const e=f.useRef(t);return xd(()=>{e.current=t}),e}function Y2(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:d}=t,[u,h]=f.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[p,g]=f.useState(i);pu(p,i)||g(i);const[b,m]=f.useState(null),[k,v]=f.useState(null),y=f.useCallback(A=>{A!==C.current&&(C.current=A,m(A))},[]),x=f.useCallback(A=>{A!==R.current&&(R.current=A,v(A))},[]),S=s||b,w=o||k,C=f.useRef(null),R=f.useRef(null),P=f.useRef(u),N=l!=null,I=uf(l),L=uf(r),j=uf(d),Z=f.useCallback(()=>{if(!C.current||!R.current)return;const A={placement:e,strategy:n,middleware:p};L.current&&(A.platform=L.current),J2(C.current,R.current,A).then(U=>{const Q={...U,isPositioned:j.current!==!1};F.current&&!pu(P.current,Q)&&(P.current=Q,eo.flushSync(()=>{h(Q)}))})},[p,e,n,L,j]);xd(()=>{d===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,h(A=>({...A,isPositioned:!1})))},[d]);const F=f.useRef(!1);xd(()=>(F.current=!0,()=>{F.current=!1}),[]),xd(()=>{if(S&&(C.current=S),w&&(R.current=w),S&&w){if(I.current)return I.current(S,w,Z);Z()}},[S,w,Z,I,N]);const te=f.useMemo(()=>({reference:C,floating:R,setReference:y,setFloating:x}),[y,x]),Y=f.useMemo(()=>({reference:S,floating:w}),[S,w]),K=f.useMemo(()=>{const A={position:n,left:0,top:0};if(!Y.floating)return A;const U=cb(Y.floating,u.x),Q=cb(Y.floating,u.y);return a?{...A,transform:"translate("+U+"px, "+Q+"px)",...UT(Y.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:Q}},[n,a,Y.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:Z,refs:te,elements:Y,floatingStyles:K}),[u,Z,te,Y,K])}const X2=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:i,padding:r}=typeof t=="function"?t(n):t;return i&&e(i)?i.current!=null?ab({element:i.current,padding:r}).fn(n):{}:i?ab({element:i,padding:r}).fn(n):{}}}},Z2=(t,e)=>({...H2(t),options:[t,e]}),eL=(t,e)=>({...$2(t),options:[t,e]}),tL=(t,e)=>({...Q2(t),options:[t,e]}),nL=(t,e)=>({...q2(t),options:[t,e]}),iL=(t,e)=>({...K2(t),options:[t,e]}),rL=(t,e)=>({...G2(t),options:[t,e]}),sL=(t,e)=>({...X2(t),options:[t,e]});var oL="Arrow",FT=f.forwardRef((t,e)=>{const{children:n,width:i=10,height:r=5,...s}=t;return c.jsx(Re.svg,{...s,ref:e,width:i,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});FT.displayName=oL;var aL=FT;function cL(t,e=[]){let n=[];function i(s,o){const a=f.createContext(o),l=n.length;n=[...n,o];function d(h){const{scope:p,children:g,...b}=h,m=(p==null?void 0:p[t][l])||a,k=f.useMemo(()=>b,Object.values(b));return c.jsx(m.Provider,{value:k,children:g})}function u(h,p){const g=(p==null?void 0:p[t][l])||a,b=f.useContext(g);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return d.displayName=s+"Provider",[d,u]}const r=()=>{const s=n.map(o=>f.createContext(o));return function(a){const l=(a==null?void 0:a[t])||s;return f.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return r.scopeName=t,[i,lL(r,...e)]}function lL(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const i=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const o=i.reduce((a,{useScope:l,scopeName:d})=>{const h=l(s)[`__scope${d}`];return{...a,...h}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function VT(t){const[e,n]=f.useState(void 0);return Wt(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,d=Array.isArray(l)?l[0]:l;o=d.inlineSize,a=d.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return i.observe(t,{box:"border-box"}),()=>i.unobserve(t)}else n(void 0)},[t]),e}var yv="Popper",[zT,BT]=cL(yv),[dL,WT]=zT(yv),HT=t=>{const{__scopePopper:e,children:n}=t,[i,r]=f.useState(null);return c.jsx(dL,{scope:e,anchor:i,onAnchorChange:r,children:n})};HT.displayName=yv;var $T="PopperAnchor",qT=f.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:i,...r}=t,s=WT($T,n),o=f.useRef(null),a=tt(e,o);return f.useEffect(()=>{s.onAnchorChange((i==null?void 0:i.current)||o.current)}),i?null:c.jsx(Re.div,{...r,ref:a})});qT.displayName=$T;var bv="PopperContent",[uL,hL]=zT(bv),KT=f.forwardRef((t,e)=>{var oe,Oe,Xe,Ne,ae,re;const{__scopePopper:n,side:i="bottom",sideOffset:r=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:b,...m}=t,k=WT(bv,n),[v,y]=f.useState(null),x=tt(e,ne=>y(ne)),[S,w]=f.useState(null),C=VT(S),R=(C==null?void 0:C.width)??0,P=(C==null?void 0:C.height)??0,N=i+(s!=="center"?"-"+s:""),I=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},L=Array.isArray(d)?d:[d],j=L.length>0,Z={padding:I,boundary:L.filter(pL),altBoundary:j},{refs:F,floatingStyles:te,placement:Y,isPositioned:K,middlewareData:A}=Y2({strategy:"fixed",placement:N,whileElementsMounted:(...ne)=>W2(...ne,{animationFrame:g==="always"}),elements:{reference:k.anchor},middleware:[Z2({mainAxis:r+P,alignmentAxis:o}),l&&eL({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?tL():void 0,...Z}),l&&nL({...Z}),iL({...Z,apply:({elements:ne,rects:be,availableWidth:Se,availableHeight:He})=>{const{width:ot,height:St}=be.reference,Yt=ne.floating.style;Yt.setProperty("--radix-popper-available-width",`${Se}px`),Yt.setProperty("--radix-popper-available-height",`${He}px`),Yt.setProperty("--radix-popper-anchor-width",`${ot}px`),Yt.setProperty("--radix-popper-anchor-height",`${St}px`)}}),S&&sL({element:S,padding:a}),mL({arrowWidth:R,arrowHeight:P}),p&&rL({strategy:"referenceHidden",...Z})]}),[U,Q]=JT(Y),se=wn(b);Wt(()=>{K&&(se==null||se())},[K,se]);const de=(oe=A.arrow)==null?void 0:oe.x,Ae=(Oe=A.arrow)==null?void 0:Oe.y,ye=((Xe=A.arrow)==null?void 0:Xe.centerOffset)!==0,[Te,We]=f.useState();return Wt(()=>{v&&We(window.getComputedStyle(v).zIndex)},[v]),c.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:K?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Te,"--radix-popper-transform-origin":[(Ne=A.transformOrigin)==null?void 0:Ne.x,(ae=A.transformOrigin)==null?void 0:ae.y].join(" "),...((re=A.hide)==null?void 0:re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:c.jsx(uL,{scope:n,placedSide:U,onArrowChange:w,arrowX:de,arrowY:Ae,shouldHideArrow:ye,children:c.jsx(Re.div,{"data-side":U,"data-align":Q,...m,ref:x,style:{...m.style,animation:K?void 0:"none"}})})})});KT.displayName=bv;var GT="PopperArrow",fL={top:"bottom",right:"left",bottom:"top",left:"r
558ight"},QT=f.forwardRef(function(e,n){const{__scopePopper:i,...r}=e,s=hL(GT,i),o=fL[s.placedSide];return c.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:c.jsx(aL,{...r,ref:n,style:{...r.style,display:"block"}})})});QT.displayName=GT;function pL(t){return t!==null}var mL=t=>({name:"transformOrigin",options:t,fn(e){var k,v,y;const{placement:n,rects:i,middlewareData:r}=e,o=((k=r.arrow)==null?void 0:k.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[d,u]=JT(n),h={start:"0%",center:"50%",end:"100%"}[u],p=(((v=r.arrow)==null?void 0:v.x)??0)+a/2,g=(((y=r.arrow)==null?void 0:y.y)??0)+l/2;let b="",m="";return d==="bottom"?(b=o?h:`${p}px`,m=`${-l}px`):d==="top"?(b=o?h:`${p}px`,m=`${i.floating.height+l}px`):d==="right"?(b=`${-l}px`,m=o?h:`${g}px`):d==="left"&&(b=`${i.floating.width+l}px`,m=o?h:`${g}px`),{data:{x:b,y:m}}}});function JT(t){const[e,n="center"]=t.split("-");return[e,n]}var gL=HT,vL=qT,yL=KT,bL=QT;function YT(t){const e=f.useRef({value:t,previous:t});return f.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var xL=[" ","Enter","ArrowUp","ArrowDown"],kL=[" ","Enter"],vl="Select",[sh,oh,SL]=Vw(vl),[Na,_8]=$u(vl,[SL,BT]),ah=BT(),[wL,ls]=Na(vl),[CL,TL]=Na(vl),XT=t=>{const{__scopeSelect:e,children:n,open:i,defaultOpen:r,onOpenChange:s,value:o,defaultValue:a,onValueChange:l,dir:d,name:u,autoComplete:h,disabled:p,required:g,form:b}=t,m=ah(e),[k,v]=f.useState(null),[y,x]=f.useState(null),[S,w]=f.useState(!1),C=XD(d),[R=!1,P]=Dc({prop:i,defaultProp:r,onChange:s}),[N,I]=Dc({prop:o,defaultProp:a,onChange:l}),L=f.useRef(null),j=k?b||!!k.closest("form"):!0,[Z,F]=f.useState(new Set),te=Array.from(Z).map(Y=>Y.props.value).join(";");return c.jsx(gL,{...m,children:c.jsxs(wL,{required:g,scope:e,trigger:k,onTriggerChange:v,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:w,contentId:Vo(),value:N,onValueChange:I,open:R,onOpenChange:P,dir:C,triggerPointerDownPosRef:L,disabled:p,children:[c.jsx(sh.Provider,{scope:e,children:c.jsx(CL,{scope:t.__scopeSelect,onNativeOptionAdd:f.useCallback(Y=>{F(K=>new Set(K).add(Y))},[]),onNativeOptionRemove:f.useCallback(Y=>{F(K=>{const A=new Set(K);return A.delete(Y),A})},[]),children:n})}),j?c.jsxs(w_,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:h,value:N,onChange:Y=>I(Y.target.value),disabled:p,form:b,children:[N===void 0?c.jsx("option",{value:""}):null,Array.from(Z)]},te):null]})})};XT.displayName=vl;var ZT="SelectTrigger",e_=f.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:i=!1,...r}=t,s=ah(n),o=ls(ZT,n),a=o.disabled||i,l=tt(e,o.onTriggerChange),d=oh(n),u=f.useRef("touch"),[h,p,g]=C_(m=>{const k=d().filter(x=>!x.disabled),v=k.find(x=>x.value===o.value),y=T_(k,m,v);y!==void 0&&o.onValueChange(y.value)}),b=m=>{a||(o.onOpenChange(!0),g()),m&&(o.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(vL,{asChild:!0,...s,children:c.jsx(Re.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":S_(o.value)?"":void 0,...r,ref:l,onClick:Ee(r.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&b(m)}),onPointerDown:Ee(r.onPointerDown,m=>{u.current=m.pointerType;const k=m.target;k.hasPointerCapture(m.pointerId)&&k.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(b(m),m.preventDefault())}),onKeyDown:Ee(r.onKeyDown,m=>{const k=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(k&&m.key===" ")&&xL.includes(m.key)&&(b(),m.preventDefault())})})})});e_.displayName=ZT;var t_="SelectValue",n_=f.forwardRef((t,e)=>{const{__scopeSelect:n,className:i,style:r,children:s,placeholder:o="",...a}=t,l=ls(t_,n),{onValueNodeHasChildrenChange:d}=l,u=s!==void 0,h=tt(e,l.onValueNodeChange);return Wt(()=>{d(u)},[d,u]),c.jsx(Re.span,{...a,ref:h,style:{pointerEvents:"none"},children:S_(l.value)?c.jsx(c.Fragment,{children:o}):s})});
vendor: 15,233 bytes, line 558
558n_.displayName=t_;var _L="SelectIcon",i_=f.forwardRef((t,e)=>{const{__scopeSelect:n,children:i,...r}=t;return c.jsx(Re.span,{"aria-hidden":!0,...r,ref:e,children:i||"▼"})});i_.displayName=_L;var EL="SelectPortal",r_=t=>c.jsx(Ku,{asChild:!0,...t});r_.displayName=EL;var Ks="SelectContent",s_=f.forwardRef((t,e)=>{const n=ls(Ks,t.__scopeSelect),[i,r]=f.useState();if(Wt(()=>{r(new DocumentFragment)},[]),!n.open){const s=i;return s?eo.createPortal(c.jsx(o_,{scope:t.__scopeSelect,children:c.jsx(sh.Slot,{scope:t.__scopeSelect,children:c.jsx("div",{children:t.children})})}),s):null}return c.jsx(a_,{...t,ref:e})});s_.displayName=Ks;var Vn=10,[o_,ds]=Na(Ks),PL="SelectContentImpl",a_=f.forwardRef((t,e)=>{const{__scopeSelect:n,position:i="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:l,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:g,sticky:b,hideWhenDetached:m,avoidCollisions:k,...v}=t,y=ls(Ks,n),[x,S]=f.useState(null),[w,C]=f.useState(null),R=tt(e,oe=>S(oe)),[P,N]=f.useState(null),[I,L]=f.useState(null),j=oh(n),[Z,F]=f.useState(!1),te=f.useRef(!1);f.useEffect(()=>{if(x)return rT(x)},[x]),QC();const Y=f.useCallback(oe=>{const[Oe,...Xe]=j().map(re=>re.ref.current),[Ne]=Xe.slice(-1),ae=document.activeElement;for(const re of oe)if(re===ae||(re==null||re.scrollIntoView({block:"nearest"}),re===Oe&&w&&(w.scrollTop=0),re===Ne&&w&&(w.scrollTop=w.scrollHeight),re==null||re.focus(),document.activeElement!==ae))return},[j,w]),K=f.useCallback(()=>Y([P,x]),[Y,P,x]);f.useEffect(()=>{Z&&K()},[Z,K]);const{onOpenChange:A,triggerPointerDownPosRef:U}=y;f.useEffect(()=>{if(x){let oe={x:0,y:0};const Oe=Ne=>{var ae,re;oe={x:Math.abs(Math.round(Ne.pageX)-(((ae=U.current)==null?void 0:ae.x)??0)),y:Math.abs(Math.round(Ne.pageY)-(((re=U.current)==null?void 0:re.y)??0))}},Xe=Ne=>{oe.x<=10&&oe.y<=10?Ne.preventDefault():x.contains(Ne.target)||A(!1),document.removeEventListener("pointermove",Oe),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",Oe),document.addEventListener("pointerup",Xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Oe),document.removeEventListener("pointerup",Xe,{capture:!0})}}},[x,A,U]),f.useEffect(()=>{const oe=()=>A(!1);return window.addEventListener("blur",oe),window.addEventListener("resize",oe),()=>{window.removeEventListener("blur",oe),window.removeEventListener("resize",oe)}},[A]);const[Q,se]=C_(oe=>{const Oe=j().filter(ae=>!ae.disabled),Xe=Oe.find(ae=>ae.ref.current===document.activeElement),Ne=T_(Oe,oe,Xe);Ne&&setTimeout(()=>Ne.ref.current.focus())}),de=f.useCallback((oe,Oe,Xe)=>{const Ne=!te.current&&!Xe;(y.value!==void 0&&y.value===Oe||Ne)&&(N(oe),Ne&&(te.current=!0))},[y.value]),Ae=f.useCallback(()=>x==null?void 0:x.focus(),[x]),ye=f.useCallback((oe,Oe,Xe)=>{const Ne=!te.current&&!Xe;(y.value!==void 0&&y.value===Oe||Ne)&&L(oe)},[y.value]),Te=i==="popper"?Yp:c_,We=Te===Yp?{side:a,sideOffset:l,align:d,alignOffset:u,arrowPadding:h,collisionBoundary:p,collisionPadding:g,sticky:b,hideWhenDetached:m,avoidCollisions:k}:{};return c.jsx(o_,{scope:n,content:x,viewport:w,onViewportChange:C,itemRefCallback:de,selectedItem:P,onItemLeave:Ae,itemTextRefCallback:ye,focusSelectedItem:K,selectedItemText:I,position:i,isPositioned:Z,searchRef:Q,children:c.jsx(tv,{as:Hs,allowPinchZoom:!0,children:c.jsx(ev,{asChild:!0,trapped:y.open,onMountAutoFocus:oe=>{oe.preventDefault()},onUnmountAutoFocus:Ee(r,oe=>{var Oe;(Oe=y.trigger)==null||Oe.focus({preventScroll:!0}),oe.preventDefault()}),children:c.jsx(qu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:oe=>oe.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:c.jsx(Te,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:oe=>oe.preventDefault(),...v,...We,onPlaced:()=>F(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Ee(v.onKeyDown,oe=>{const Oe=oe.ctrlKey||oe.altKey||oe.metaKey;if(oe.key==="Tab"&&oe.preventDefault(),!Oe&&oe.key.length===1&&se(oe.key),["ArrowUp","ArrowDown","Home","End"].includes(oe.key)){let Ne=j().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(oe.key)&&(Ne=Ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(oe.key)){const ae=oe.target,re=Ne.indexOf(ae);Ne=Ne.slice(re+1)}setTimeout(()=>Y(Ne)),oe.preventDefault()}})})})})})})});a_.displayName=PL;var RL="SelectItemAlignedPosition",c_=f.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:i,...r}=t,s=ls(Ks,n),o=ds(Ks,n),[a,l]=f.useState(null),[d,u]=f.useState(null),h=tt(e,R=>u(R)),p=oh(n),g=f.useRef(!1),b=f.useRef(!0),{viewport:m,selectedItem:k,selectedItemText:v,focusSelectedItem:y}=o,x=f.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&d&&m&&k&&v){const R=s.trigger.getBoundingClientRect(),P=d.getBoundingClientRect(),N=s.valueNode.getBoundingClientRect(),I=v.getBoundingClientRect();if(s.dir!=="rtl"){const ae=I.left-P.left,re=N.left-ae,ne=R.left-re,be=R.width+ne,Se=Math.max(be,P.width),He=window.innerWidth-Vn,ot=Xy(re,[Vn,Math.max(Vn,He-Se)]);a.style.minWidth=be+"px",a.style.left=ot+"px"}else{const ae=P.right-I.right,re=window.innerWidth-N.right-ae,ne=window.innerWidth-R.right-re,be=R.width+ne,Se=Math.max(be,P.width),He=window.innerWidth-Vn,ot=Xy(re,[Vn,Math.max(Vn,He-Se)]);a.style.minWidth=be+"px",a.style.right=ot+"px"}const L=p(),j=window.innerHeight-Vn*2,Z=m.scrollHeight,F=window.getComputedStyle(d),te=parseInt(F.borderTopWidth,10),Y=parseInt(F.paddingTop,10),K=parseInt(F.borderBottomWidth,10),A=parseInt(F.paddingBottom,10),U=te+Y+Z+A+K,Q=Math.min(k.offsetHeight*5,U),se=window.getComputedStyle(m),de=parseInt(se.paddingTop,10),Ae=parseInt(se.paddingBottom,10),ye=R.top+R.height/2-Vn,Te=j-ye,We=k.offsetHeight/2,oe=k.offsetTop+We,Oe=te+Y+oe,Xe=U-Oe;if(Oe<=ye){const ae=L.length>0&&k===L[L.length-1].ref.current;a.style.bottom="0px";const re=d.clientHeight-m.offsetTop-m.offsetHeight,ne=Math.max(Te,We+(ae?Ae:0)+re+K),be=Oe+ne;a.style.height=be+"px"}else{const ae=L.length>0&&k===L[0].ref.current;a.style.top="0px";const ne=Math.max(ye,te+m.offsetTop+(ae?de:0)+We)+Xe;a.style.height=ne+"px",m.scrollTop=Oe-ye+m.offsetTop}a.style.margin=`${Vn}px 0`,a.style.minHeight=Q+"px",a.style.maxHeight=j+"px",i==null||i(),requestAnimationFrame(()=>g.current=!0)}},[p,s.trigger,s.valueNode,a,d,m,k,v,s.dir,i]);Wt(()=>x(),[x]);const[S,w]=f.useState();Wt(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]);const C=f.useCallback(R=>{R&&b.current===!0&&(x(),y==null||y(),b.current=!1)},[x,y]);return c.jsx(IL,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:C,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:c.jsx(Re.div,{...r,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});c_.displayName=RL;var NL="SelectPopperPosition",Yp=f.forwardRef((t,e)=>{const{__scopeSelect:n,align:i="start",collisionPadding:r=Vn,...s}=t,o=ah(n);return c.jsx(yL,{...o,...s,ref:e,align:i,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Yp.displayName=NL;var[IL,xv]=Na(Ks,{}),Xp="SelectViewport",l_=f.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:i,...r}=t,s=ds(Xp,n),o=xv(Xp,n),a=tt(e,s.onViewportChange),l=f.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),c.jsx(sh.Slot,{scope:n,children:c.jsx(Re.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:Ee(r.onScroll,d=>{const u=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&h){const g=Math.abs(l.current-u.scrollTop);if(g>0){const b=window.innerHeight-Vn*2,m=parseFloat(h.style.minHeight),k=parseFloat(h.style.height),v=Math.max(m,k);if(v<b){const y=v+g,x=Math.min(b,y),S=y-x;h.style.height=x+"px",h.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});l_.displayName=Xp;var d_="SelectGroup",[jL,AL]=Na(d_),OL=f.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,r=Vo();return c.jsx(jL,{scope:n,id:r,children:c.jsx(Re.div,{role:"group","aria-labelledby":r,...i,ref:e})})});OL.displayName=d_;var u_="SelectLabel",h_=f.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,r=AL(u_,n);return c.jsx(Re.div,{id:r.id,...i,ref:e})});h_.displayName=u_;var mu="SelectItem",[DL,f_]=Na(mu),p_=f.forwardRef((t,e)=>{const{__scopeSelect:n,value:i,disabled:r=!1,textValue:s,...o}=t,a=ls(mu,n),l=ds(mu,n),d=a.value===i,[u,h]=f.useState(s??""),[p,g]=f.useState(!1),b=tt(e,y=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,y,i,r)}),m=Vo(),k=f.useRef("touch"),v=()=>{r||(a.onValueChange(i),a.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(DL,{scope:n,value:i,disabled:r,textId:m,isSelected:d,onItemTextChange:f.useCallback(y=>{h(x=>x||((y==null?void 0:y.textContent)??"").trim())},[]),children:c.jsx(sh.ItemSlot,{scope:n,value:i,disabled:r,textValue:u,children:c.jsx(Re.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...o,ref:b,onFocus:Ee(o.onFocus,()=>g(!0)),onBlur:Ee(o.onBlur,()=>g(!1)),onClick:Ee(o.onClick,()=>{k.current!=="mouse"&&v()}),onPointerUp:Ee(o.onPointerUp,()=>{k.current==="mouse"&&v()}),onPointerDown:Ee(o.onPointerDown,y=>{k.current=y.pointerType}),onPointerMove:Ee(o.onPointerMove,y=>{var x;k.current=y.pointerType,r?(x=l.onItemLeave)==null||x.call(l):k.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(o.onPointerLeave,y=>{var x;y.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:Ee(o.onKeyDown,y=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&y.key===" "||(kL.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})})})})});p_.displayName=mu;var Za="SelectItemText",m_=f.forwardRef((t,e)=>{const{__scopeSelect:n,className:i,style:r,...s}=t,o=ls(Za,n),a=ds(Za,n),l=f_(Za,n),d=TL(Za,n),[u,h]=f.useState(null),p=tt(e,v=>h(v),l.onItemTextChange,v=>{var y;return(y=a.itemTextRefCallback)==null?void 0:y.call(a,v,l.value,l.disabled)}),g=u==null?void 0:u.textContent,b=f.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:g},l.value),[l.disabled,l.value,g]),{onNativeOptionAdd:m,onNativeOptionRemove:k}=d;return Wt(()=>(m(b),()=>k(b)),[m,k,b]),c.jsxs(c.Fragment,{children:[c.jsx(Re.span,{id:l.textId,...s,ref:p}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?eo.createPortal(s.children,o.valueNode):null]})});m_.displayName=Za;var g_="SelectItemIndicator",v_=f.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t;return f_(g_,n).isSelected?c.jsx(Re.span,{"aria-hidden":!0,...i,ref:e}):null});v_.displayName=g_;var Zp="SelectScrollUpButton",y_=f.forwardRef((t,e)=>{const n=ds(Zp,t.__scopeSelect),i=xv(Zp,t.__scopeSelect),[r,s]=f.useState(!1),o=tt(e,i.onScrollButtonChange);return Wt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=l.scrollTop>0;s(d)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),r?c.jsx(x_,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});y_.displayName=Zp;var em="SelectScrollDownButton",b_=f.forwardRef((t,e)=>{const n=ds(em,t.__scopeSelect),i=xv(em,t.__scopeSelect),[r,s]=f.useState(!1),o=tt(e,i.onScrollButtonChange);return Wt(()=>{if(n.viewport&&n.isPositioned){let a=function(){const d=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<d;s(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),r?c.jsx(x_,{...t,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});b_.displayName=em;var x_=f.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:i,...r}=t,s=ds("SelectScrollButton",n),o=f.useRef(null),a=oh(n),l=f.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return f.useEffect(()=>()=>l(),[l]),Wt(()=>{var u;const d=a().find(h=>h.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),c.jsx(Re.div,{"aria-hidden":!0,...r,ref:e,style:{flexShrink:0,...r.style},onPointerDown:Ee(r.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(i,50))}),onPointerMove:Ee(r.onPointerMove,()=>{var d;(d=s.onItemLeave)==null||d.call(s),o.current===null&&(o.current=window.setInterval(i,50))}),onPointerLeave:Ee(r.onPointerLeave,()=>{l()})})}),LL="SelectSeparator",k_=f.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t;return c.jsx(Re.div,{"aria-hidden":!0,...i,ref:e})});k_.displayName=LL;var tm="SelectArrow",ML=f.forwardRef((t,e)=>{const{__scopeSelect:n,...i}=t,r=ah(n),s=ls(tm,n),o=ds(tm,n);return s.open&&o.position==="popper"?c.jsx(bL,{...r,...i,ref:e}):null});ML.displayName=tm;function S_(t){return t===""||t===void 0}var w_=f.forwardRef((t,e)=>{const{value:n,...i}=t,r=f.useRef(null),s=tt(e,r),o=YT(n);return f.useEffect(()=>{const a=r.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==n&&u){const h=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(h)}},[o,n]),c.jsx(Gu,{asChild:!0,children:c.jsx("select",{...i,ref:s,defaultValue:n})})});w_.displayName="BubbleSelect";function C_(t){const e=wn(t),n=f.useRef(""),i=f.useRef(0),r=f.useCallback(o=>{const a=n.current+o;e(a),function l(d){n.current=d,window.clearTimeout(i.current),d!==""&&(i.current=window.setTimeout(()=>l(""),1e3))}(a)},[e]),s=f.useCallback(()=>{n.current="",window.clearTimeout(i.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(i.current),[]),[n,r,s]}function T_(t,e,n){const r=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=UL(t,Math.max(s,0));r.length===1&&(o=o.filter(d=>d!==n));const l=o.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function UL(t,e){return t.map((n,i)=>t[(e+i)%t.length])}var FL=XT,__=e_,VL=n_,zL=i_,BL=r_,E_=s_,WL=l_,P_=h_,R_=p_,HL=m_,$L=v_,N_=y_,I_=b_,j_=k_;const lb=FL,db=VL,nm=f.forwardRef(({className:t,children:e,...n},i)=>c.jsxs(__,{ref:i,className:De("flex h-10 w-full items-center justify-between rounded-md border border-border/60 bg-background px-3.5 py-2 text-sm r
558ing-offset-background transition-colors duration-200 placeholder:text-muted-foreground/70 hover:border-border focus:outline-none focus:ring-2 focus:ring-ring/30 focus:ring-offset-2 focus:ring-offset-background focus:border-ring/60 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,c.jsx(zL,{asChild:!0,children:c.jsx(Yr,{className:"h-4 w-4 opacity-50"})})]}));nm.displayName=__.displayName;const A_=f.forwardRef(({className:t,...e},n)=>c.jsx(N_,{ref:n,className:De("flex cursor-default items-center justify-center py-1",t),...e,children:c.jsx(zj,{className:"h-4 w-4"})}));A_.displayName=N_.displayName;const O_=f.forwardRef(({className:t,...e},n)=>c.jsx(I_,{ref:n,className:De("flex cursor-default items-center justify-center py-1",t),...e,children:c.jsx(Yr,{className:"h-4 w-4"})}));O_.displayName=I_.displayName;const im=f.forwardRef(({className:t,children:e,position:n="popper",...i},r)=>c.jsx(BL,{children:c.jsxs(E_,{ref:r,className:De("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-lg border border-border/60 bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...i,children:[c.jsx(A_,{}),c.jsx(WL,{className:De("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),c.jsx(O_,{})]})}));im.displayName=E_.displayName;const qL=f.forwardRef(({className:t,...e},n)=>c.jsx(P_,{ref:n,className:De("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));qL.displayName=P_.displayName;const rm=f.forwardRef(({className:t,children:e,...n},i)=>c.jsxs(R_,{ref:i,className:De("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx($L,{children:c.jsx(Yu,{className:"h-4 w-4"})})}),c.jsx(HL,{children:e})]}));rm.displayName=R_.displayName;const KL=f.forwardRef(({className:t,...e},n)=>c.jsx(j_,{ref:n,className:De("-mx-1 my-1 h-px bg-muted",t),...e}));KL.displayName=j_.displayName;var kv="Switch",[GL,E8]=$u(kv),[QL,JL]=GL(kv),D_=f.forwardRef((t,e)=>{const{__scopeSwitch:n,name:i,checked:r,defaultChecked:s,required:o,disabled:a,value:l="on",onCheckedChange:d,form:u,...h}=t,[p,g]=f.useState(null),b=tt(e,x=>g(x)),m=f.useRef(!1),k=p?u||!!p.closest("form"):!0,[v=!1,y]=Dc({prop:r,defaultProp:s,onChange:d});return c.jsxs(QL,{scope:n,checked:v,disabled:a,children:[c.jsx(Re.button,{type:"button",role:"switch","aria-checked":v,"aria-required":o,"data-state":U_(v),"data-disabled":a?"":void 0,disabled:a,value:l,...h,ref:b,onClick:Ee(t.onClick,x=>{y(S=>!S),k&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})}),k&&c.jsx(YL,{control:p,bubbles:!m.current,name:i,value:l,checked:v,required:o,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});D_.displayName=kv;var L_="SwitchThumb",M_=f.forwardRef((t,e)=>{const{__scopeSwitch:n,...i}=t,r=JL(L_,n);return c.jsx(Re.span,{"data-state":U_(r.checked),"data-disabled":r.disabled?"":void 0,...i,ref:e})});M_.displayName=L_;var YL=t=>{const{control:e,checked:n,bubbles:i=!0,...r}=t,s=f.useRef(null),o=YT(n),a=VT(e);return f.useEffect(()=>{const l=s.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&h){const p=new Event("click",{bubbles:i});h.call(l,n),l.dispatchEvent(p)}},[o,n,i]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function U_(t){return t?"checked":"unchecked"}var F_=D_,XL=M_;const V_=f.forwardRef(({className:t,...e},n)=>c.jsx(F_,{className:De("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:c.jsx(XL,{className:De("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}
558));V_.displayName=F_.displayName;const hf="admin_preview_view_mode";function ub({children:t,title:e,subtitle:n}){var Kv,Gv,Qv,Jv;const[i,r]=Pi(),[s,o]=f.useState(!1),[a,l]=f.useState(!1),[d,u]=f.useState(!1),[h,p]=f.useState(null),[g,b]=f.useState({outreach:!1,crm:!1,recruiting:!1,calendar:!1,video:!1,voice:!1,analytics:!1,settings:!1}),{user:m,logoutMutation:k}=Et();no();const{billingPlan:v}=or(),{clients:y,selectedClient:x,setSelectedClient:S,selectedClientId:w}=yO(),{isRecording:C,isUploading:R,recordingMode:P,setRecordingMode:N,enableMicrophone:I,setEnableMicrophone:L,pipPosition:j,setPipPosition:Z,startRecording:F,stopRecording:te,formatRecordingTime:Y,recordingTime:K}=Qg(),[A,U]=f.useState(!1),[Q,se]=f.useState(()=>{try{const M=localStorage.getItem("sidebar-admin-collapsed");return M===null?!0:M==="true"}catch{return!0}}),de=()=>{se(M=>{const pe=!M;try{localStorage.setItem("sidebar-admin-collapsed",String(pe))}catch{}return pe})},{isDocked:Ae,undock:ye}=_O(),[Te,We]=f.useState(null),[oe,Oe]=f.useState([]);f.useEffect(()=>{h==="owner"&&(async()=>{try{const pe=await fetch("/api/admin/users",{credentials:"include"});if(pe.ok){const fe=await pe.json(),Ii=(Array.isArray(fe)?fe:fe.users||[]).filter(bl=>bl.role==="owner"||bl.role==="superadmin");Oe(Ii),!Te&&Ii.length>0&&We(Ii[0])}}catch(pe){console.error("Failed to fetch owners:",pe)}})()},[h]);const Xe=(m==null?void 0:m.role)==="client"?m==null?void 0:m.clientId:w,{data:Ne}=ya({queryKey:["/api/clients",Xe,"sidebar"],queryFn:async()=>{const M=await fetch(`/api/clients/${Xe}`,{credentials:"include"});return M.ok?M.json():null},enabled:!!Xe,staleTime:6e4,retry:2}),ae=(Ne==null?void 0:Ne.name)||(x==null?void 0:x.name)||null,re=M=>{b(pe=>({...pe,[M]:!pe[M]}))};f.useEffect(()=>{if((m==null?void 0:m.role)==="client"){p("client");return}const M=localStorage.getItem(hf);M?p(M):S(null)},[m==null?void 0:m.role]),f.useEffect(()=>{if((h==="client"||h==="client_staging")&&(m==null?void 0:m.role)!=="client"){const M=ot[h];(M==null?void 0:M.allowedItems.some(fe=>i===fe||i.startsWith(fe+"/")))||r("/client-portal")}},[h,i]);const ne=M=>{p(M),M?localStorage.setItem(hf,M):localStorage.removeItem(hf);const pe=M==="client"||M==="client_staging";if(pe&&!w&&y.length>0){const fe=y.find(Ht=>Ht.isActive)||y[0];S(fe)}pe||S(null),r(pe?"/client-portal":"/assistant"),window.scrollTo(0,0)},be=()=>{k.mutate()},Se=async()=>{U(!1),await F()},He=[{mode:"owner",label:"Owner View",icon:_r,color:"pink"},{mode:"enterprise",label:"Enterprise View",icon:_r,color:"purple"},{mode:"professional",label:"Pro View",icon:Gi,color:"blue"},{mode:"demo",label:"Demo View",icon:Oy,color:"orange"},{mode:"free",label:"Free View",icon:Ly,color:"gray"},{mode:"client_staging",label:"Client Staging",icon:Jh,color:"amber"},{mode:"client",label:"Client View",icon:Bl,color:"emerald"}],ot={owner:{allowedItems:["/gary","/assistant","/campaigns","/campaign-launcher","/campaign-scheduler","/campaign-queue","/campaign-analytics","/crm-dashboard","/contacts","/contact-detail","/contact-upload","/contacts","/crm-deals","/calendar-admin","/calendar-admin/settings","/templates","/email-accounts","/google-integration-wizard","/landing-experiments","/proposal-creator","/documents","/voice-platform","/workspace","/reps","/control-center","/integrations"],label:"Owner View",color:"pink"},enterprise:{allowedItems:["/gary","/assistant","/unified-inbox","/campaigns","/campaign-launcher","/campaign-health","/meeting-tracker","/meet-attendance","/csv-repository","/contact-pipeline","/video-campaigns","/templates","/landing-experiments","/crm-dashboard","/contacts","/crm-deals","/confirmation-engine","/calendar-admin","/calendar-admin/automation","/meeting-timeline","/video-studio","/conference-recordings","/meeting-recordings","/meet-bot-usage","/demo-creator","/website-demo-creator","/proposal-creator","/documents","/voice-platform","/voice-agents","/sales-training","/call-logs","/agent-memory","/analytics-dashboard","/campaign-analytics","/crm-analytics","/workspace","/reps","/clients","/email-accounts","/api-dashboard","/system-health","/control-center"],label:"Enterprise View",color:"purple"},professional:{allowedItems:["/gary","/assistant","/unified-inbox","/campaigns","/campaign-launcher","/campaign-health","/meeting-tracker","/meet-attendance","/csv-repository","/contact-pipeline","/video-campaigns","/templates","/landing-experiments","/crm-dashboard","/contacts","/crm-deals","/confirmation-engine","/calendar-admin","/meeting-timeline","/video-studio","/conference-recordings","/meeting-recordings","/meet-bot-usage","/demo-creator","/website-demo-creator","/proposal-creator","/documents","/voice-platform","/voice-agents","/sales-training","/analytics-dashboard","/campaign-analytics","/crm-analytics","/workspace","/reps","/clients","/email-accounts","/system-health","/control-center"],label:"Professional View",color:"blue"},demo:{allowedItems:["/gary","/assistant","/campaigns","/campaign-launcher","/templates","/crm-dashboard","/contacts","/calendar-admin","/demo-creator","/proposal-creator"],label:"Demo View",color:"orange"},free:{allowedItems:["/gary","/assistant","/campaigns","/campaign-launcher","/templates","/crm-dashboard","/contacts","/workspace","/email-accounts","/calendar-admin"],label:"Free View",color:"gray"},client_staging:{allowedItems:["/client-portal"],label:"Client Staging",color:"amber"}
558,client:{allowedItems:["/client-portal"],label:"Client View",color:"emerald"}},Yt=[{href:"/",label:"Dashboard",icon:qg,adminOnly:!0},{href:"/crm-dashboard",label:"CRM",icon:po,adminOnly:!1},{href:"/voice-platform",label:"Voice",icon:gd,adminOnly:!1},{href:"/boom-dev",label:"boom video",icon:Mt,adminOnly:!1},{href:"/enterprise-dialer",label:"bam dialer",icon:Ny,adminOnly:!1},{href:"/campaigns",label:"Campaigns",icon:cu,adminOnly:!1},{href:"/crm-analytics",label:"Analytics",icon:Wl,adminOnly:!1},{href:"/call-logs",label:"Calls",icon:Dy,adminOnly:!1},{href:"/api-dashboard",label:"APIs",icon:Xh,adminOnly:!1}].filter(M=>!(M.adminOnly&&(h||(m==null?void 0:m.role)!=="admin"&&(m==null?void 0:m.role)!=="superadmin"))),Pt=(m==null?void 0:m.role)==="admin"||(m==null?void 0:m.role)==="superadmin"||(m==null?void 0:m.role)==="owner",gt=(m==null?void 0:m.role)==="superadmin",lr=Pt?[{href:"/admin/users",label:"Admin",icon:oo},{href:"/navigation-hub",label:"All Features",icon:md}]:[{href:"/navigation-hub",label:"All Features",icon:md}],vt=[...Yt,...lr],hn=[{href:"/gary",label:"Gary AI",icon:zl},{href:"/unified-inbox",label:"Inbox",icon:Xj},{href:"/campaigns",label:"Outreach",icon:$p,section:"outreach",children:[{href:"/pitches",label:"Pitches",icon:Kg},{href:"/campaign-launcher",label:"Launch",icon:$p},{href:"/campaigns",label:"Campaigns",icon:sA},{href:"/campaign-health",label:"Campaign Health",icon:Qh},{href:"/meeting-tracker",label:"Meeting Tracker",icon:Mt},{href:"/meet-attendance",label:"Meet Attendance",icon:Mt},{href:"/csv-repository",label:"CSV Repository",icon:fs},{href:"/contact-pipeline",label:"Contact Pipeline",icon:wA},{href:"/callsheet",label:"Callsheets",icon:fs},{href:"/templates",label:"Templates",icon:fs},{href:"/dnc",label:"Do Not Contact",icon:Lj}]},{href:"/crm-dashboard",label:"CRM",icon:po,section:"crm",children:[{href:"/contacts",label:"Contacts",icon:po},{href:"/crm-deals",label:"Deals",icon:Hj},{href:"/confirmation-engine",label:"Confirmations",icon:Wj}]},{href:"/recruiting",label:"AI Recruiter",icon:po,section:"recruiting",children:[{href:"/recruiting",label:"Dashboard",icon:jy},{href:"/recruiting/roles",label:"Open Roles",icon:hC}]},{href:"/calendar",label:"Calendar",icon:Ry,section:"calendar",children:[{href:"/calendar",label:"View Calendar",icon:Ry},{href:"/calendar-admin/automation",label:"Automation",icon:cu},{href:"/meeting-timeline",label:"Meeting History",icon:Jj},{href:"/workspace",label:"Workspace Reps",icon:pd,adminOnly:!0}]},{href:"/video-studio",label:"Video",icon:Mt,section:"video",children:[{href:"/ai-conference",label:"Boom Room",icon:Mt},{href:"/ai-conference-dashboard",label:"Conference Dashboard",icon:Mt},{href:"/video-studio",label:"Record Video",icon:Mt},{href:"/conference-recordings",label:"Recordings",icon:Mt},{href:"/meeting-recordings",label:"Meeting Recordings",icon:Mt},{href:"/meet-bot-usage",label:"Notetaker Usage",icon:Mt},{href:"/demo-creator",label:"Demo Creator",icon:hA},{href:"/website-demo-creator",label:"Website Demos",icon:qj,adminOnly:!0},{href:"/proposal-creator",label:"Proposals",icon:$j,adminOnly:!0}]},{href:"/documents",label:"Documents",icon:fs,section:"documents",children:[{href:"/documents",label:"Document Storage",icon:fs},{href:"/csv-repository",label:"CSV Repository",icon:fs},{href:"/admin/doc-management",label:"Document Trimmer",icon:mA}]},{href:"/voice-platform",label:"Voice & Calls",icon:gd,section:"voice",children:[{href:"/voice-platform",label:"VoIP Dashboard",icon:gd},{href:"/voice-agents",label:"AI Agents",icon:zl},{href:"/sales-training",label:"Sales Training",icon:bA},{href:"/call-logs",label:"Call Logs",icon:Dy},{href:"/agent-memory-timeline",label:"Agent Memory",icon:fs}]},{href:"/analytics-dashboard",label:"Analytics",icon:Wl,section:"analytics",children:[{href:"/analytics-dashboard",label:"Overview",icon:bC},{href:"/campaign-analytics",label:"Campaigns",icon:Wl},{href:"/crm-analytics",label:"CRM Stats",icon:Wl}]},{href:"/profile",label:"Settings",icon:Xh,section:"settings",children:[{href:"/ai-config",label:"AI Config",icon:zl}
558,{href:"/reps",label:"Team Members",icon:SA},{href:"/clients",label:"Clients",icon:pd},{href:"/email-accounts",label:"Email Accounts",icon:iA},{href:"/admin/meet-bots",label:"Meeting Bots",icon:zl},{href:"/landing-experiments",label:"Landing Lab",icon:yC},{href:"/api-dashboard",label:"API Keys",icon:Xh}]}],oi=[{href:"/control-center",label:"Control Center",icon:Ny},{href:"/system-health",label:"System Health",icon:Qh},{href:"/admin/users",label:"User Management",icon:po},{href:"/admin/features",label:"Feature Gates",icon:oo}],dr=[{href:"/admin/organizations",label:"Organizations",icon:pd},{href:"/admin/observability",label:"System Observability",icon:Qh}],$v=["/assistant","/campaigns","/campaign-launcher","/templates","/crm-dashboard","/contacts","/workspace","/reps","/clients","/email-accounts","/calendar-admin"],qv=(()=>{let M=hn;if(Pt&&(m==null?void 0:m.role)!=="client"){const fe={href:"/admin/users",label:"Admin",icon:oo,children:[...oi,...gt?dr:[]]};M=[...M,fe]}if(((m==null?void 0:m.role)==="client"||h==="client"||h==="client_staging")&&(M=[{href:"/client-portal",label:"Client Portal",icon:jy},...M]),(m==null?void 0:m.role)==="client"){const fe=ot.client;return M.filter(Ht=>fe.allowedItems.includes(Ht.href)).map(Ht=>({...Ht,children:void 0}))}if(v==="free"&&!gt)return M.filter(fe=>$v.includes(fe.href)).map(fe=>fe.children?{...fe,children:fe.children.filter(Ht=>$v.includes(Ht.href))}:fe);if(!h)return M;const pe=ot[h];return pe?M.filter(fe=>pe.allowedItems.includes(fe.href)).map(fe=>fe.children?{...fe,children:fe.children.filter(Ht=>pe.allowedItems.includes(Ht.href))}:fe):M})(),Ia=M=>M==="/"||M==="/dashboard"?i==="/"||i==="/dashboard":i.startsWith(M),JE=()=>i.startsWith("/crm")?"CRM Dashboard":i.startsWith("/voice")?"Voice Platform":i.startsWith("/boom")?"Video Conference":i.startsWith("/enterprise-dialer")?"Enterprise Dialer":i.startsWith("/admin")?"Admin Panel":i.startsWith("/automation")?"Automation":i.startsWith("/analytics")?"Analytics":i.startsWith("/api")?"API Dashboard":"Dashboard";return c.jsxs("div",{className:"min-h-screen bg-gray-50",children:[c.jsx("nav",{className:"bg-gradient-to-r from-gray-900 via-brand-900 to-gray-900 border-b border-brand-500/30 px-4 lg:px-6 py-3",children:c.jsxs("div",{className:"flex justify-between items-center mx-auto max-w-full",children:[c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("a",{href:"/home",className:"flex items-center justify-center w-8 h-8 bg-brand-900 rounded-lg hover:bg-brand-800 transition-all duration-200",title:"Return to bsquared.ai main website",children:c.jsxs("span",{className:"text-white font-bold text-sm",children:["b",c.jsx("sup",{className:"text-[10px]",children:"2"})]})}),!h&>&&c.jsx("div",{className:"hidden lg:flex items-center space-x-1 ml-4",children:vt.map(M=>{const pe=M.icon,fe=Ia(M.href);return c.jsx(Le,{href:M.href,children:c.jsxs(he,{variant:"ghost",size:"sm",className:`text-xs px-2 py-1 h-8 ${fe?"bg-brand-700/50 text-white":"text-gray-300 hover:text-white hover:bg-brand-800/50"}`,"data-testid":`nav-${M.label.toLowerCase().replace(/\s+/g,"-")}`,children:[c.jsx(pe,{className:"w-3.5 h-3.5 mr-1"}),M.label]})},M.href)})})]}),c.jsxs("div",{className:"flex items-center space-x-3",children:[m&&c.jsxs(c.Fragment,{children:[c.jsx(BC,{variant:"outline",className:"text-gray-300 border-gray-600 hidden sm:inline-flex",children:m.role}),c.jsx(Le,{href:"/profile",children:c.jsxs("div",{className:"text-gray-300 text-sm hidden sm:block hover:text-white cursor-pointer",title:m.email||"View Profile",children:[m.name||((Kv=m.email)==null?void 0:Kv.split("@")[0]),c.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",m.email,")"]})]})}),c.jsxs(he,{variant:"ghost",size:"sm",onClick:be,disabled:k.isPending,className:"text-gray-300 hover:text-white hover:bg-red-500/20 border border-transparent hover:border-red-500/50","data-testid":"button-logout",children:[c.jsx(Yh,{className:"w-4 h-4 mr-1"}),c.jsx("span",{className:"hidden sm:inline",children:k.isPending?"Signing out...":"Logout"})]})]}),c.jsx(he,{variant:"ghost",size:"sm",className:"lg:hidden text-gray-300",onClick:()=>l(!a),children:c.jsx(md,{className:"w-5 h-5"})})]})]})}),c.jsxs("div",{className:"flex",children:[c.jsxs("div",{className:`${s?"w-16":"w-64"} bg-brand-900 sticky top-0 transition-all duration-300 flex flex-col`,style:{height:"calc(100vh - 60px)"},children:[c.jsxs("div",{className:"p-4 border-b border-brand-700",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[!s&&c.jsx("div",{children:c.jsx("h2",{className:"text-pink-400 font-semibold text-sm",children:JE()})}),c.jsx(he,{variant:"ghost",size:"sm",className:"text-gray-400 hover:text-white p-1",onClick:()=>o(!s),children:s?c.jsx(Vj,{className:"w-4 h-4"}):c.jsx(Fj,{className:"w-4 h-4"})})]}),(Pt||!m)&&!s&&(m==null?void 0:m.role)!=="client"&&c.jsxs("div",{className:"relative",children:[c.jsxs("div",{onClick:()=>u(!d),className:`inline-flex items-center gap-1.5 px-2 py-1 rounded-md cursor-pointer transition-all text-xs ${h?"bg-gradient-to-r from-pink-500/30 to-brand-600/30 border border-pink-400/50 hover:border-pink-400":"bg-brand-800/50 border border-brand-600 hover:border-brand-500"}`,"data-testid":"dropdown-view-selector",children:[h==="owner"&&c.jsx(_r,{className:"w-3 h-3 text-pink-400"}),h==="enterprise"&&c.jsx(_r,{className:"w-3 h-3 text-brand-400"}),h==="professional"&&c.jsx(Gi,{className:"w-3 h-3 text-blue-400"}),h==="demo"&&c.jsx(Oy,{className:"w-3 h-3 text-orange-400"}),h==="free"&&c.jsx(Ly,{className:"w-3 h-3 text-gray-400"}),h==="client_staging"&&c.jsx(Jh,{className:"w-3 h-3 text-amber-400"}),h==="client"&&c.jsx(Bl,{className:"w-3 h-3 text-emerald-400"}),!h&&c.jsx(Iy,{className:"w-3 h-3 text-gray-400"}),c.jsx("span",{className:"text-white font-medium",children:h==="client_staging"?"Staging":h?h==="professional"?"Pro":h==="owner"?"Owner":h.charAt(0).toUpperCase()+h.slice(1):"Admin"}),c.jsx(Yr,{className:`w-3 h-3 text-gray-400 transition-transform ${d?"rotate-180":""}`})]}),d&&c.jsxs("div",{className:"absolute top-full left-0 mt-1 w-44 bg-brand-800 rounded-lg shadow-xl border border-brand-600 py-1 z-50",children:[c.jsxs("div",{onClick:()=>{ne(null),u(!1)},className:`flex items-center gap-2 px-3 py-2 cursor-pointer ${h?"text-gray-300 hover:bg-brand-700 hover:text-white":"bg-brand-600 text-white"}`,children:[c.jsx(oo,{className:"w-4 h-4"}),c.jsx("span",{className:"text-sm",children:"Admin View"}),!h&&c.jsx("span",{className:"ml-auto text-xs",children:"✓"})]}),c.jsx("div",{className:"border-t border-brand-600 my-1"}),He.map(M=>{const pe=M.icon,fe=h===M.mode;return c.jsxs("div",{onClick:()=>{ne(M.mode),u(!1)},className:`flex items-center gap-2 px-3 py-2 cursor-pointer ${fe?"bg-brand-600 text-white":"text-gray-300 hover:bg-brand-700 hover:text-white"}`,children:[c.jsx(pe,{className:"w-4 h-4"}),c.jsx("span",{className:"text-sm",children:M.label}),fe&&c.jsx("span",{className:"ml-auto text-xs",children:"✓"})]},M.mode)})]})]})]}),!s&&(m==null?void 0:m.role)!=="client"&&h==="owner"&&c.jsxs("div",{className:"p-2 border-b border-pink-700/50 bg-pink-900/30",children:[c.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[c.jsx(_r,{className:"w-3.5 h-3.5 text-pink-400"}),c.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-pink-300",children:"Preview Owner"})]}),oe.length>0?c.jsxs(lb,{value:((Gv=Te==null?void 0:Te.id)==null?void 0:Gv.toString())??"",onValueChange:M=>{const pe=oe.find(fe=>fe.id===parseInt(M));pe&&We(pe)},children:[c.jsx(nm,{className:"w-full h-9 bg-pink-900/50 border-pink-600 text-white hover:bg-pink-800/50 focus:ring-pink-500",children:c.jsx(db,{placeholder:"Select an owner...",children:Te?c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-pink-400 flex-shrink-0"}),c.jsx("span",{className:"truncate font-medium",children:Te.name||Te.email})]}):c.jsx("span",{className:"text-pink-300",children:"Select an owner..."})})}),c.jsx(im,{className:"bg-slate-900 border-slate-700",children:oe.map(M=>c.jsx(rm,{value:M.id.toString(),className:"text-white hover:bg-pink-900/50",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-pink-400 flex-shrink-0"}),c.jsx("span",{children:M.name||M.email}),c.jsxs("span",{className:"text-xs text-slate-400",children:["(",M.email,")"]})]})},M.id))})]}):c.jsx("p",{className:"text-xs text-pink-300",children:"No owners found"}),Te&&c.jsxs("div",{className:"mt-2 p-2 bg-pink-800/20 rounded border border-pink-600/50",children:[c.jsxs("p",{className:"text-xs text-pink-200",children:[c.jsx("strong",{children:"Viewing as:"})," ",Te.name||Te.email]}),c.jsx("p",{className:"text-xs text-pink-300 mt-1",children:"Features shown. (Data filtering coming soon)"})]}),!Te&&oe.length>0&&c.jsx("p",{className:"text-xs text-pink-300 mt-1.5",children:"Select an owner to preview their dashboard"})]}),!s&&(m==null?void 0:m.role)!=="client"&&(h==="client"||h==="client_staging")&&c.jsxs("div",{className:`p-2 border-b ${h==="client_staging"?"border-amber-700/50 bg-amber-900/30":"border-emerald-700/50 bg-emerald-900/30"}`,children:[c.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[h==="client_staging"?c.jsx(Jh,{className:"w-3.5 h-3.5 text-amber-400"}):c.jsx(Bl,{className:"w-3.5 h-3.5 text-emerald-400"}),c.jsx("span",{className:`text-xs font-semibold uppercase tracking-wide ${h==="client_staging"?"text-amber-300":"text-emerald-300"}`,children:h==="client_staging"?"Staging for":"Viewing as"})]}),y.length>0?c.jsxs(lb,{value:((Qv=x==null?void 0:x.id)==null?void 0:Qv.toString())??"",onValueChange:M=>{const pe=y.find(fe=>fe.id===parseInt(M));pe&&S(pe)},children:[c.jsx(nm,{className:"w-full h-9 bg-emerald-900/50 border-emerald-600 text-white hover:bg-emerald-800/50 focus:ring-emerald-500",children:c.jsx(db,{placeholder:"Select a client...",children:x?c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:x.color||"#10b981"}}),c.jsx("span",{className:"truncate font-medium",children:x.name})]}):c.jsx("span",{className:"text-emerald-300",children:"Select a client..."})})}),c.jsx(im,{className:"bg-slate-900 border-slate-700",children:y.filter(M=>M.isActive).map(M=>c.jsx(rm,{value:M.id.toString(),className:"text-white hover:bg-emerald-900/50",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:M.color||"#10b981"}}),c.jsx("span",{children:M.name}),M.domain&&c.jsxs("span",{className:"text-xs text-slate-400",children:["(",M.domain,")"]})]})},M.id))})]}):c.jsx("p",{className:"text-xs text-amber-300",children:"No clients configured"}),!x&&y.length>0&&c.jsx("p",{className:"text-xs text-amber-300 mt-1.5",children:"Select a client to preview their dashboard"})]}),(m==null?void 0:m.role)==="client"&&!s&&ae&&c.jsx("div",{className:"p-3 border-b border-brand-700 bg-brand-800/30",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Bl,{className:"w-4 h-4 text-brand-300 flex-shrink-0"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-white text-sm font-semibold truncate",children:ae}),c.jsx("p",{className:"text-brand-300 text-xs",children:"Client Portal"})]})]})}),(m==null?void 0:m.role)!=="client"&&h!=="client"&&c.jsx("div",{className:"p-2 border-b border-brand-700",children:(()=>{const M=(h==="free"||h==="demo"||v==="free")&&!gt;return s?c.jsx(he,{onClick:()=>!M&&U(!0),disabled:M,className:`w-full p-2 ${M?"bg-gray-600 text-gray-400 cursor-not-allowed opacity-50":"bg-gradient-to-r from-pink-500 to-brand-600 hover:from-pink-600 hover:to-brand-700 text-white"}`,size:"icon","data-testid":"button-boom-record-collapsed",children:c.jsx(vs,{className:"w-5 h-5 fill-current"})}):c.jsxs(he,{onClick:()=>!M&&U(!0),disabled:M,className:`w-full font-semibold ${M?"bg-gray-600 text-gray-400 cursor-not-allowed opacity-50":"bg-gradient-to-r from-pink-500 to-brand-600 hover:from-pink-600 hover:to-brand-700 text-white"}`,"data-testid":"button-boom-record",children:[c.jsx(vs,{className:"w-4 h-4 mr-2 fill-current"}),"Boom Record",M&&c.jsx("span",{className:"ml-2 text-xs",children:"(Pro)"})]})})()}),Ae&&(m==null?void 0:m.role)!=="client"&&h!=="client"&&c.jsx("div",{className:"p-2 border-b border-brand-700",children:(()=>{var pe;const M=(h==="free"||v==="free")&&!gt;return s?c.jsx(he,{onClick:()=>{var Ii;
558if(M)return;const fe=`instant-${Date.now()}`,Ht=(m==null?void 0:m.name)||((Ii=m==null?void 0:m.email)==null?void 0:Ii.split("@")[0])||"Host";r(`/ai-conference/${fe}?name=${encodeURIComponent(Ht)}&autoJoin=true`)},disabled:M,className:`w-full p-2 ${M?"bg-gray-600 text-gray-400 cursor-not-allowed opacity-50":"bg-gradient-to-r from-brand-500 to-brand-600 hover:from-brand-600 hover:to-brand-700 text-white"}`,size:"icon","data-testid":"button-conference-docked-collapsed",children:c.jsx(Mt,{className:"w-5 h-5"})}):M?c.jsxs(he,{disabled:!0,className:"w-full bg-gray-600 text-gray-400 cursor-not-allowed opacity-50 font-semibold","data-testid":"button-conference-disabled",children:[c.jsx(Mt,{className:"w-4 h-4 mr-2"}),"Boom Conference",c.jsx("span",{className:"ml-2 text-xs",children:"(Pro)"})]}):c.jsx(TO,{onUndock:ye,userName:(m==null?void 0:m.name)||((pe=m==null?void 0:m.email)==null?void 0:pe.split("@")[0])})})()}),c.jsxs("nav",{className:"flex-1 min-h-0 overflow-y-auto p-2",children:[(Pt||!m)&&s&&(m==null?void 0:m.role)!=="client"&&c.jsxs("div",{className:"mb-2 relative",onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),children:[c.jsx("div",{className:`flex items-center justify-center p-2 rounded-lg cursor-pointer ${h?"bg-gradient-to-r from-pink-500/20 to-brand-600/20 border border-pink-400/50":"text-gray-400 hover:text-white hover:bg-white/10"}`,children:c.jsx(Iy,{className:"w-5 h-5"})}),d&&c.jsxs("div",{className:"absolute left-full top-0 ml-2 w-48 bg-brand-800 rounded-lg shadow-xl border border-brand-600 py-1 z-50",children:[c.jsxs("div",{onClick:()=>ne(null),className:`flex items-center gap-2 px-3 py-2 cursor-pointer ${h?"text-gray-300 hover:bg-brand-700 hover:text-white":"bg-brand-600 text-white"}`,children:[c.jsx(oo,{className:"w-4 h-4"}),c.jsx("span",{className:"text-sm",children:"Admin View"}),!h&&c.jsx("span",{className:"ml-auto text-xs",children:"✓"})]}),c.jsx("div",{className:"border-t border-brand-600 my-1"}),He.map(M=>{const pe=M.icon,fe=h===M.mode;return c.jsxs("div",{onClick:()=>ne(M.mode),className:`flex items-center gap-2 px-3 py-2 cursor-pointer ${fe?"bg-brand-600 text-white":"text-gray-300 hover:bg-brand-700 hover:text-white"}`,children:[c.jsx(pe,{className:"w-4 h-4"}),c.jsx("span",{className:"text-sm",children:M.label}),fe&&c.jsx("span",{className:"ml-auto text-xs",children:"✓"})]},M.mode)})]})]}),qv.map(M=>{var Yv,Xv;const pe=M.icon,fe=Ia(M.href),Ht=M.children&&M.children.length>0,Ii=M.section?g[M.section]:!1,bl=Ht&&((Yv=M.children)==null?void 0:Yv.some(_n=>Ia(_n.href)));return c.jsx("div",{children:Ht?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`flex items-center justify-between px-3 py-2 rounded-lg mb-1 transition-all duration-200 cursor-pointer ${fe||bl?"bg-gradient-to-r from-pink-500/20 to-brand-600/20 text-white border-l-4 border-pink-400":"text-gray-400 hover:text-white hover:bg-white/10"}`,"data-testid":`link-sidebar-${M.label.toLowerCase().replace(/\s+/g,"-")}`,children:[c.jsxs(Le,{href:M.href,className:"flex items-center space-x-3 flex-1",children:[c.jsx(pe,{className:"w-5 h-5 flex-shrink-0"}),!s&&c.jsx("span",{className:"text-sm font-medium",children:M.label})]}),!s&&c.jsx("div",{onClick:_n=>{_n.stopPropagation(),M.section&&re(M.section)},className:"p-1 hover:bg-white/10 rounded",children:c.jsx(Yr,{className:`w-4 h-4 transition-transform ${Ii?"rotate-180":""}`})})]}),Ii&&!s&&c.jsx("div",{className:"ml-4 pl-2 border-l border-brand-600/50",children:(Xv=M.children)==null?void 0:Xv.filter(_n=>!_n.adminOnly||Pt).map(_n=>{const YE=_n.icon,XE=Ia(_n.href);return c.jsx(Le,{href:_n.href,children:c.jsxs("div",{className:`flex items-center space-x-3 px-3 py-2 rounded-lg mb-1 transition-all duration-200 cursor-pointer ${XE?"bg-gradient-to-r from-pink-500/20 to-brand-600/20 text-white":"text-gray-400 hover:text-white hover:bg-white/10"}`,"data-testid":`link-sidebar-${_n.label.toLowerCase().replace(/\s+/g,"-")}`,children:[c.jsx(YE,{className:"w-4 h-4 flex-shrink-0"}),c.jsx("span",{className:"text-sm",children:_n.label})]})},_n.href)})})]}):c.jsx(Le,{href:M.href,children:c.jsxs("div",{className:`flex items-center space-x-3 px-3 py-2 rounded-lg mb-1 transition-all duration-200 cursor-pointer ${fe?"bg-gradient-to-r from-pink-500/20 to-brand-600/20 text-white border-l-4 border-pink-400":"text-gray-400 hover:text-white hover:bg-white/10"}`,"data-testid":`link-sidebar-${M.label.toLowerCase().replace(/\s+/g,"-")}`,children:[c.jsx(pe,{className:"w-5 h-5 flex-shrink-0"}),!s&&c.jsx("span",{className:"text-sm font-medium",children:M.label})]})})},M.href)})]}),c.jsxs("div",{className:"p-2 border-t border-brand-700 mt-auto flex-shrink-0",children:[!s&&v==="free"&&!gt&&!Pt&&(m==null?void 0:m.role)!=="client"&&c.jsx(JD,{}),Pt&&!s&&(m==null?void 0:m.role)!=="client"&&c.jsxs("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-2 mb-2",children:[c.jsxs("button",{type:"button",onClick:de,"aria-expanded":!Q,className:"flex w-full items-center justify-between gap-2 rounded px-1 py-0.5 hover:bg-white/5 transition-colors","data-testid":"button-toggle-admin-panel",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(oo,{className:"w-4 h-4 text-red-400"}),c.jsx("span",{className:"text-red-400 text-xs font-medium",children:"Admin Access"})]}),c.jsx(Yr,{className:`w-4 h-4 text-red-400 transition-transform ${Q?""
558:"rotate-180"}`})]}),!Q&&c.jsx(Le,{href:"/navigation-hub",children:c.jsx(he,{size:"sm",className:"w-full bg-red-600 hover:bg-red-700 text-white text-xs mt-2",children:"View Navigation Dashboard"})})]}),m&&c.jsxs("div",{className:`mt-2 ${s?"":"bg-brand-800/50 rounded-lg p-2"}`,children:[!s&&c.jsxs("div",{className:"mb-2 px-1",children:[c.jsx("p",{className:"text-white text-sm font-medium truncate",children:m.name||((Jv=m.email)==null?void 0:Jv.split("@")[0])}),m.email&&c.jsx("p",{className:"text-gray-400 text-xs truncate",children:m.email})]}),c.jsxs(he,{variant:"ghost",size:"sm",onClick:be,disabled:k.isPending,className:`w-full text-gray-400 hover:text-white hover:bg-red-500/20 border border-transparent hover:border-red-500/50 ${s?"justify-center px-2":"justify-start"}`,"data-testid":"button-sidebar-logout",children:[c.jsx(Yh,{className:"w-4 h-4 flex-shrink-0"}),!s&&c.jsx("span",{className:"ml-2 text-sm",children:k.isPending?"Signing out...":"Sign Out"})]})]})]})]}),c.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-auto",style:{height:"calc(100vh - 60px)"},children:[c.jsx("div",{className:"hidden",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[e&&c.jsx("h1",{className:"text-2xl font-bold text-white",children:e}),n&&c.jsx("p",{className:"text-gray-200 mt-1",children:n})]}),c.jsxs("div",{className:"flex items-center space-x-3",children:[c.jsxs(he,{variant:"outline",size:"sm",children:[c.jsx(Mj,{className:"w-4 h-4 mr-2"}),"Notifications"]}),c.jsxs("div",{className:"relative",children:[c.jsx(gA,{className:"w-4 h-4 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),c.jsx("input",{type:"text",placeholder:"Search...",className:"pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-500 focus:border-transparent text-sm"})]})]})]})}),v==="free"&&!gt&&!Pt&&c.jsx(QD,{variant:"compact"}),c.jsx("div",{className:"flex-1 p-4 sm:p-6 lg:p-8 overflow-auto min-h-0",children:t})]})]}),a&&c.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 z-50 lg:hidden",children:c.jsxs("div",{className:"fixed inset-y-0 left-0 w-64 bg-brand-900 p-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-6",children:[c.jsxs("a",{href:"/home",className:"flex items-center gap-2",title:"bsquared.ai",children:[c.jsxs("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-brand-500 text-white font-bold text-sm",children:["b",c.jsx("sup",{className:"text-[9px]",children:"2"})]}),c.jsx("span",{className:"text-white font-bold tracking-tight",children:"bsquared.ai"})]}),c.jsx(he,{variant:"ghost",size:"sm",className:"text-gray-400",onClick:()=>l(!1),children:c.jsx(Si,{className:"w-5 h-5"})})]}),c.jsx("nav",{className:"space-y-2",children:qv.map(M=>{const pe=M.icon;return c.jsx(Le,{href:M.href,children:c.jsxs("div",{className:`flex items-center space-x-3 px-3 py-2 rounded-lg transition-all duration-200 cursor-pointer ${Ia(M.href)?"bg-gradient-to-r from-pink-500/20 to-brand-600/20 text-white":"text-gray-400 hover:text-white hover:bg-white/10"}`,onClick:()=>l(!1),children:[c.jsx(pe,{className:"w-5 h-5"}),c.jsx("span",{className:"text-sm font-medium",children:M.label})]})},M.href)})}),m&&c.jsx("div",{className:"absolute bottom-4 left-4 right-4",children:c.jsxs(he,{variant:"outline",onClick:()=>{l(!1),be()},disabled:k.isPending,className:"w-full text-red-400 border-red-500/50 hover:bg-red-500/20 hover:text-red-300","data-testid":"button-mobile-logout",children:[c.jsx(Yh,{className:"w-4 h-4 mr-2"}),k.isPending?"Signing out...":"Sign Out"]})})]})}),c.jsx(_T,{open:A,onOpenChange:M=>{!C&&!R&&U(M)},children:c.jsxs(av,{className:"sm:max-w-md bg-slate-900 border-brand-700/50",children:[c.jsxs(cv,{children:[c.jsxs(lv,{className:"flex items-center gap-2 text-white",children:[c.jsx("div",{className:"w-8 h-8 bg-gradient-to-r from-pink-500 to-brand-600 rounded-full flex items-center justify-center",children:c.jsx(vs,{className:"w-4 h-4 text-white fill-current"})}),"Boom Record"]}),c.jsx(dv,{className:"text-slate-400",children:"Start a quick recording from anywhere"})]}),C?c.jsxs("div",{className:"py-8 text-center",children:[c.jsx("div",{className:"relative inline-flex items-center justify-center mb-4",children:c.jsx("div",{className:"w-24 h-24 bg-red-500/20 rounded-full flex items-center justify-center animate-pulse",children:c.jsx(vs,{className:"w-12 h-12 text-red-500 fill-current"})})}),c.jsx("p",{className:"text-3xl font-mono text-white mb-2",children:Y(K)}),c.jsx("p",{className:"text-slate-400 mb-6",children:"Recording in progress..."}),c.jsxs(he,{onClick:te,className:"bg-red-600 hover:bg-red-700 text-white px-8",size:"lg","data-testid":"button-stop-quick-recording",children:[c.jsx(au,{className:"w-5 h-5 mr-2 fill-current"}),"Stop Recording"]})]}):R?c.jsxs("div",{className:"py-8 text-center",children:[c.jsx(io,{className:"w-12 h-12 text-brand-500 animate-spin mx-auto mb-4"}),c.jsx("p",{className:"text-white mb-2",children:"Saving your recording..."}),c.jsx("p",{className:"text-slate-400 text-sm",children:"This will take a moment"})]}):c.jsxs("div",{className:"space-y-6 py-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium text-slate-300 mb-3 block",children:"Recording Mode"}),c.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[c.jsxs("button",{onClick:()=>N("camera"),className:`p-4 rounded-lg border-2 transition-all flex flex-col items-center gap-2 ${P==="camera"?"border-brand-500 bg-brand-500/20 text-white":"border-slate-700 text-slate-400 hover:border-slate-600 hover:bg-slate-800"}`,"data-testid":"button-mode-camera",children:[c.jsx(fC,{className:"w-6 h-6"}),c.jsx("span",{className:"text-xs font-medium",children:"Camera"})]}),c.jsxs("button",{onClick:()=>N("screen"),className:`p-4 rounded-lg border-2 transition-all flex flex-col items-center gap-2 ${P==="screen"?"border-brand-500 bg-brand-500/20 text-white":"border-slate-700 text-slate-400 hover:border-slate-600 hover:bg-slate-800"}`,"data-testid":"button-mode-screen",children:[c.jsx(vC,{className:"w-6 h-6"}),c.jsx("span",{className:"text-xs font-medium",children:"Screen"})]}),c.jsxs("button",{onClick:()=>N("pip"),className:`p-4 rounded-lg border-2 transition-all flex flex-col items-center gap-2 ${P==="pip"?"border-brand-500 bg-brand-500/20 text-white":"border-slate-700 text-slate-400 hover:border-slate-600 hover:bg-slate-800"}`,"data-testid":"button-mode-pip",children:[c.jsx(Mt,{className:"w-6 h-6"}),c.jsx("span",{className:"text-xs font-medium",children:"Both"})]})]})]}),P==="pip"&&c.jsxs("div",{children:[c.jsx("label",{className:"text-sm font-medium text-slate-300 mb-3 block",children:"Camera Position"}),c.jsx("div",{className:"grid grid-cols-4 gap-2",children:["bottom-left","bottom-right","top-left","top-right"].map(M=>c.jsx("button",{onClick:()=>Z(M),className:`p-2 rounded-lg border transition-all text-xs ${j===M?"border-brand-500 bg-brand-500/20 text-white":"border-slate-700 text-slate-400 hover:border-slate-600"}`,children:M.split("-").map(pe=>pe.charAt(0).toUpperCase()+pe.slice(1)).join(" ")},M))})]}),c.jsxs("div",{className:"flex items-center justify-between py-2",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(mC,{className:"w-5 h-5 text-slate-400"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium text-white",children:"Microphone"}),c.jsx("p",{className:"text-xs text-slate-500",children:"Record your voice"})]})]}),c.jsx(V_,{checked:I,onCheckedChange:L,"data-testid":"switch-microphone"})]}),c.jsxs(he,{onClick:Se,className:"w-full bg-gradient-to-r from-pink-500 to-brand-600 hover:from-pink-600 hover:to-brand-700 text-white py-6",size:"lg","data-testid":"button-start-quick-recording",children:[c.jsx(vs,{className:"w-5 h-5 mr-2 fill-current"}),"Start Recording"]})]})]})})]})}const hb=["free","starter","pro","enterprise"];function En({children:t,featureName:e="This feature",minTier:n="starter"}){const{billingPlan:i,organization:r,isLoading:s}=or(),{user:o,isLoading:a}=Et(),[,l]=Pi();if(s||a)return c.jsx(ub,{title:"Loading...",subtitle:"",children:c.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:c.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-brand-600"})})});if(!o)return l("/auth"),null;if(o.role==="superadmin"||o.role==="client")return c.jsx(c.Fragment,{children:t});const u=(r==null?void 0:r.billingPlan)||i||"free",h=hb.indexOf(u),p=hb.indexOf(n);return h>=p?c.jsx(c.Fragment,{children:t}):c.jsx(ub,{title:"Premium Feature",subtitle:"Upgrade to unlock this feature",children:c.jsx("div",{className:"flex items-center justify-center min-h-[60vh] p-6",children:c.jsxs(Mc,{className:"w-full max-w-lg border-2 border-brand-200 shadow-xl",children:[c.jsxs(Xu,{className:"text-center pb-2",children:[c.jsx("div",{className:"mx-auto w-16 h-16 bg-gradient-to-br from-brand-500 to-blue-600 rounded-full flex items-center justify-center mb-4",children:c.jsx(nA,{className:"w-8 h-8 text-white"})}),c.jsx(Zu,{className:"text-2xl",children:"Upgrade Required"}),c.jsxs(eh,{className:"text-base mt-2",children:[e," is available on ",n.charAt(0).toUpperCase()+n.slice(1)," plan and above."]})]}),c.jsxs(Uc,{className:"space-y-6",children:[c.jsxs("div",{className:"bg-gradient-to-r from-brand-50 to-blue-50 rounded-lg p-4 border border-brand-100",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[c.jsx(_r,{className:"w-5 h-5 text-brand-600"}),c.jsx("span",{className:"font-semibold text-slate-800",children:"Unlock Premium Features"})]}),c.jsxs("ul",{className:"space-y-2 text-sm text-slate-600",children:[c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx(Gi,{className:"w-4 h-4 text-brand-500"}),"Unlimited AI queries and voice agents"]}),c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx(Gi,{className:"w-4 h-4 text-brand-500"}),"Full access to Voice & Calls, Video, Analytics"]}),c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx(Gi,{className:"w-4 h-4 text-brand-500"}),"Advanced automation and workflows"]}),c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx(Gi,{className:"w-4 h-4 text-brand-500"}
558),"Priority support and training"]})]})]}),c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs(he,{onClick:()=>l("/pricing"),className:"w-full bg-gradient-to-r from-brand-600 to-blue-600 hover:from-brand-700 hover:to-blue-700 text-white",size:"lg","data-testid":"btn-upgrade-premium",children:["View Pricing Plans",c.jsx(Lc,{className:"w-4 h-4 ml-2"})]}),c.jsx(he,{variant:"outline",onClick:()=>l("/assistant"),className:"w-full","data-testid":"btn-back-assistant",children:"Back to Gary AI"})]})]})]})})})}const z_=()=>c.jsx("div",{className:"flex items-center justify-center min-h-screen",children:c.jsx(io,{className:"h-8 w-8 animate-spin text-border"})});function Ql({path:t,component:e}){return c.jsx(D,{path:t,children:c.jsx(f.Suspense,{fallback:c.jsx(z_,{}),children:c.jsx(ZL,{component:e})})})}function ZL({component:t}){const{user:e,isLoading:n}=Et();return n?c.jsx(z_,{}):e?e.role==="client"?c.jsx(Dn,{to:"/assistant"}):e.role!=="superadmin"?c.jsx(Dn,{to:"/assistant"}):c.jsx(t,{}):(f.startTransition(()=>{}),c.jsx(Dn,{to:"/auth"}))}const B_=()=>c.jsx("div",{className:"flex items-center justify-center min-h-screen",children:c.jsx(io,{className:"h-8 w-8 animate-spin text-border"})});function me({path:t,children:e}){return c.jsx(D,{path:t,children:c.jsx(f.Suspense,{fallback:c.jsx(B_,{}),children:c.jsx(eM,{children:e})})})}function eM({children:t}){const{user:e,isLoading:n}=Et();return n?c.jsx(B_,{}):e?e.role==="client"?c.jsx(Dn,{to:"/client-portal"}):c.jsx(c.Fragment,{children:t}):c.jsx(Dn,{to:"/auth"})}const W_=()=>c.jsx("div",{className:"flex items-center justify-center min-h-screen",children:c.jsx(io,{className:"h-8 w-8 animate-spin text-border"})});function tM({path:t,component:e}){return c.jsx(D,{path:t,children:c.jsx(f.Suspense,{fallback:c.jsx(W_,{}),children:c.jsx(nM,{component:e})})})}function nM({component:t}){const{user:e,isLoading:n}=Et();return n?c.jsx(W_,{}):e?e.role!=="app_owner"?c.jsx(Dn,{to:"/dashboard"}):c.jsx(t,{}):(f.startTransition(()=>{}),c.jsx(Dn,{to:"/auth"}))}const fb=[{slug:"plumber",icon:_A,group:"Home Services",navLabel:"Plumbing",navBlurb:"Never miss the 2am call",eyebrow:"For plumbing companies",title:"Never miss the 2am call. Book the job while you sleep.",body:"A 24/7 AI dispatcher, Smart Sites, and dispatch automation that plugs into ServiceTitan and Housecall Pro.",cta:"Explore b² for Plumbing",featured:!0},{slug:"hvac",icon:TA,group:"Home Services",navLabel:"HVAC",navBlurb:"Answer the no-heat call",eyebrow:"For HVAC companies",title:"No heat at midnight? Someone actually answers.",body:"A 24/7 AI dispatcher that triages the emergency, books the truck, and integrates with your field-service software.",cta:"Explore b² for HVAC"},{slug:"electrician",icon:cu,group:"Home Services",navLabel:"Electrical",navBlurb:"Answer the power-out call",eyebrow:"For electricians",title:"Power out, panel sparking — and you pick up first.",body:"A 24/7 AI dispatcher that puts safety first, captures the job, and books it — day or night.",cta:"Explore b² for Electrical"},{slug:"roofer",icon:Gj,group:"Home Services",navLabel:"Roofing",navBlurb:"Catch the storm surge",eyebrow:"For roofing companies",title:"When the storm hits, everyone calls at once. Catch them all.",body:"An AI dispatcher that answers the post-storm surge, captures the claim details, and books the inspection.",cta:"Explore b² for Roofing"},{slug:"painter",icon:cA,group:"Home Services",navLabel:"Painting",navBlurb:"Never lose an estimate",eyebrow:"For painting companies",title:"Answer every estimate call. Follow up so quotes don't go cold.",body:"An AI estimator that books the walk-through instantly and chases the follow-ups you never get to.",cta:"Explore b² for Painting"},{slug:"general-contractor",icon:pd,group:"Home Services",navLabel:"General Contractors",navBlurb:"Qualify project leads",eyebrow:"For general contractors & subs",title:"Qualify every project lead. Keep the long ones warm.",body:"An AI that scopes the job, books the consult, and nurtures a months-long pipeline without dropping a lead.",cta:"Explore b² for Contractors"},{slug:"legal",icon:pA,group:"Professional Services",navLabel:"Legal Services",navBlurb:"Automate legal workflows",eyebrow:"For law firms",title:"Increase billable hours. Onboard faster. Close sooner.",body:"Smart Sites, AI intake, and document workflow automation—built for how legal firms work.",cta:"Explore b² for Legal",featured:!0},{slug:"financial",icon:eA,group:"Professional Services",navLabel:"Financial Services",navBlurb:"Risk analysis & compliance",eyebrow:"For financial services",title:"Onboard clients faster. Keep the regulator happy.",body:"Client onboarding, KYC/AML document collection, and compliance workflows that hold up to an audit.",cta:"Explore b² for Financial"},{slug:"healthcare",icon:Qj,group:"Professional Services",navLabel:"Healthcare",navBlurb:"Patient engagement",eyebrow:"For healthcare",title:"Fewer no-shows. Less paperwork. Better intake.",body:"Patient intake, reminders, and prior-auth workflows — inside your compliance boundary.",cta:"Explore b² for Healthcare"},{slug:"staffing",icon:hC,group:"Professional Services",navLabel:"Staffing & Recruiting",navBlurb:"Streamline hiring",eyebrow:"For staffing & recruiting",title:"Source, screen, and schedule without the phone tag.",body:"AI recruiters that screen candidates, book interviews, and keep your submittals moving.",cta:"Explore b² for Staffing"},{slug:"real-estate",icon:qg,group:"Professional Services",navLabel:"Real Estate",navBlurb:"Win the speed-to-lead race",eyebrow:"For agents, teams & investors",title:"Call every lead back in under a minute. Win the deal, not the voicemail tag.",body:"AI lead response, showing scheduling, and seller screening that writes back to Follow Up Boss — built for agents, teams, and investors.",cta:"Explore b² for Real Estate",featured:!0},{slug:"sales",icon:bC,group:"Professional Services",navLabel:"Sales Teams",navBlurb:"Boost sales performance",eyebrow:"For sales teams",title:"Answer every lead first. Book more meetings.",body:"AI SDRs that qualify inbound, chase follow-ups, and keep the CRM honest.",cta:"Explore b² for Sales"},{slug:"retail",icon:vA,group:"Consumer & Public",navLabel:"Retail",navBlurb:"Always-on customer service",eyebrow:"For retail",title:"Answer every customer, at any hour.",body:"Order status, returns, and product questions handled instantly — without growing the support team.",cta:"Explore b² for Retail"}
558,{slug:"hospitality",icon:Yj,group:"Consumer & Public",navLabel:"Hospitality",navBlurb:"Guest experience automation",eyebrow:"For hospitality",title:"The front desk can't answer every call. This can.",body:"Reservations, guest messaging, and front-desk overflow — answered on the first ring.",cta:"Explore b² for Hospitality"},{slug:"education",icon:Kj,group:"Consumer & Public",navLabel:"Education",navBlurb:"Enrollment & student support",eyebrow:"For education",title:"Answer every applicant. Enroll more students.",body:"Admissions inquiries, enrollment workflows, and student support — FERPA-aware by design.",cta:"Explore b² for Education"}],pb=["Home Services","Professional Services","Consumer & Public"],mb=[{href:"/solutions/ai-sdrs",icon:rA,label:"AI SDRs",blurb:"AI-powered sales development"},{href:"/solutions/ai-recruiter",icon:CA,label:"AI Recruiter",blurb:"Automated talent acquisition"},{href:"/solutions/white-labeling",icon:lA,label:"White Labeling",blurb:"Custom branded AI solutions"}],gb=[{group:"Legal",items:[{href:"/policies/privacy-policy",label:"Privacy Policy"},{href:"/policies/terms-of-service",label:"Terms of Service"}]},{group:"AI Policies",items:[{href:"/policies/ai-ethics",label:"AI Ethics"},{href:"/policies/acceptable-use",label:"Acceptable Use Policy"},{href:"/policies/data-processing",label:"Data Processing Agreement"}]}];function vb(){return c.jsx(Le,{href:"/",children:c.jsxs("div",{className:"group flex cursor-pointer items-center gap-2.5",children:[c.jsxs("span",{className:"relative flex h-11 w-11 items-center justify-center overflow-hidden rounded-[13px] bg-gradient-to-br from-teal-400 via-teal-500 to-[#1a2744] shadow-lg shadow-teal-500/30 transition-transform duration-200 group-hover:scale-105",children:[c.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-0 h-1/2 bg-gradient-to-b from-white/25 to-transparent"}),c.jsxs("span",{className:"inline-flex items-start leading-none text-white",children:[c.jsx("span",{className:"text-[22px] font-black leading-none",children:"b"}),c.jsx("span",{className:"ml-[0.5px] text-[13px] font-black leading-none",children:"2"})]})]}),c.jsx("span",{className:"text-[26px] font-extrabold tracking-tight text-foreground",children:"AI"}),c.jsx("span",{className:"rounded-md border border-teal-500/25 bg-teal-500/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-teal-600",children:"automation"})]})})}function iM(){const[t,e]=f.useState(!1),[n,i]=f.useState(null),r=d=>i(u=>u===d?null:d),s=()=>{e(!1),i(null)},o="px-1 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wider text-teal-600",a="block rounded-md px-3 py-2.5 text-sm hover:bg-teal-500/10",l="flex w-full items-center justify-between rounded-md px-3 py-3 text-base font-medium hover:bg-teal-500/10";return c.jsxs("header",{className:"sticky top-0 z-50 w-full bg-background/80 backdrop-blur supports-[backdrop-filter]:bg-background/70 border-b border-border/40 transition-all duration-200",children:[c.jsxs("div",{className:"container mx-auto px-4 py-4 lg:py-5",children:[c.jsxs("div",{className:"hidden lg:flex flex-col items-center gap-4",children:[c.jsx(vb,{}),c.jsxs("nav",{className:"flex items-center justify-center gap-6 flex-wrap",children:[c.jsxs("div",{className:"relative group navbar-dropdown-container",children:[c.jsx("button",{className:"px-4 py-2 text-sm font-medium rounded-md hover:bg-teal-500/10",children:"Solutions"}),c.jsxs("div",{className:"absolute left-0 navbar-dropdown-menu w-72 bg-popover shadow-md rounded-md p-3 z-50",children:[c.jsx("div",{className:"px-2 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wider text-teal-600",children:"Solutions"}),c.jsx("div",{className:"grid gap-1",children:mb.map(({href:d,icon:u,label:h,blurb:p})=>c.jsxs(Le,{href:d,className:"flex items-start gap-2.5 rounded-md px-2 py-1.5 text-sm hover:bg-teal-500/10",children:[c.jsx(u,{className:"mt-0.5 h-4 w-4 shrink-0 text-teal-600"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-medium leading-tight",children:h}),c.jsx("div",{className:"text-xs text-muted-foreground",children:p})]})]},d))})]})]}),c.jsxs("div",{className:"relative group navbar-dropdown-container",children:[c.jsx("button",{className:"px-4 py-2 text-sm font-medium rounded-md hover:bg-teal-500/10",children:"Industries"}),c.jsx("div",{className:"absolute left-0 navbar-dropdown-menu w-[34rem] bg-popover shadow-md rounded-md p-3 z-50",children:c.jsx("div",{className:"grid grid-cols-3 gap-x-4 gap-y-1",children:pb.map(d=>c.jsxs("div",{children:[c.jsx("div",{className:"px-2 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wider text-teal-600",children:d}),fb.filter(u=>u.group===d).map(({slug:u,icon:h,navLabel:p,navBlurb:g})=>c.jsxs(Le,{href:`/${u}`,className:"flex items-start gap-2.5 rounded-md px-2 py-1.5 text-sm hover:bg-teal-500/10",children:[c.jsx(h,{className:"mt-0.5 h-4 w-4 shrink-0 text-teal-600"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-medium leading-tight",children:p}),c.jsx("div",{className:"text-xs text-muted-foreground",children:g})]})]},u))]},d))})})]}),c.jsx(Le,{href:"/contact",className:"px-4 py-2 text-sm font-medium rounded-md hover:bg-teal-500/10",children:"Contact"}),c.jsx(Le,{href:"/about",className:"px-4 py-2 text-sm font-medium rounded-md hover:bg-teal-500/10",children:"About"}),c.jsxs("div",{className:"relative group navbar-dropdown-container",children:[c.jsx("button",{className:"px-4 py-2 text-sm font-medium rounded-md hover:bg-teal-500/10",children:"Compliance"}),c.jsx("div",{className:"absolute left-0 navbar-dropdown-menu w-72 bg-popover shadow-md rounded-md p-2 z-50",children:c.jsx("div",{className:"grid gap-2",children:gb.map(({group:d,items:u})=>c.jsxs("div",{children:[c.jsx("h4",{className:"px-2 pb-1 pt-1 text-[11px] font-semibold uppercase tracking-wider text-teal-600",children:d}),u.map(({href:h,label:p})=>c.jsx(Le,{href:h,className:"block px-4 py-2 text-sm hover:bg-teal-500/10 rounded-md",children:c.jsx("div",{className:"font-medium",children:p})},h))]},d))})})]}),c.jsx(Le,{href:"/auth?tab=login",className:"px-4 py-2 text-sm font-medium rounded-md hover:bg-teal-500/10",children:"Login"}),c.jsx(Le,{href:"/signup",className:"px-4 py-2 text-sm font-medium rounded-md bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 transition-colors duration-200",children:"Sign Up"})]})]}),c.jsxs("div",{className:"flex items-center justify-between lg:hidden",children:[c.jsx(vb,{}),c.jsx("button",{"aria-label":t?"Close menu":"Open menu","aria-expanded":t,onClick:()=>e(d=>!d),className:"inline-flex h-11 w-11 items-center justify-center rounded-lg text-foreground hover:bg-teal-500/10",children:t?c.jsx(Si,{className:"h-6 w-6"}):c.jsx(md,{className:"h-6 w-6"})})]})]}),t&&c.jsx("div",{className:"lg:hidden border-t border-border/40 bg-background/95 backdrop-blur",children:c.jsxs("nav",{className:"container mx-auto max-h-[calc(100dvh-4.5rem)] overflow-y-auto px-4 py-3",children:[c.jsxs("button",{className:l,onClick:()=>r("solutions"),"aria-expanded":n==="solutions",children:["Solutions",c.jsx(Yr,{className:`h-5 w-5 transition-transform ${n==="solutions"?"rotate-180":""}`})]}),n==="solutions"&&c.jsx("div",{className:"mb-1 pl-3",children:mb.map(({href:d,icon:u,label:h,blurb:p})=>c.jsxs(Le,{href:d,onClick:s,className:"flex items-start gap-2.5 rounded-md px-3 py-2.5 hover:bg-teal-500/10",children:[c.jsx(u,{className:"mt-0.5 h-4 w-4 shrink-0 text-teal-600"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-medium leading-tight",children:h}),c.jsx("div",{className:"text-xs text-muted-foreground",children:p})]})]},d))}),c.jsxs("button",{className:l,onClick:()=>r("industries"),"aria-expanded":n==="industries",children:["Industries",c.jsx(Yr,{className:`h-5 w-5 transition-transform ${n==="industries"?"rotate-180":""}`})]}),n==="industries"&&c.jsx("div",{className:"mb-1 pl-3",children:pb.map(d=>c.jsxs("div",{className:"mb-1",children:[c.jsx("div",{className:o,children:d}),fb.filter(u=>u.group===d).map(({slug:u,icon:h,navLabel:p})=>c.jsxs(Le,{href:`/${u}`,onClick:s,className:"flex items-center gap-2.5 rounded-md px-3 py-2 text-sm hover:bg-teal-500/10",children:[c.jsx(h,{className:"h-4 w-4 shrink-0 text-teal-600"}),c.jsx("span",{className:"font-medium",children:p})]},u))]},d))}),c.jsx(Le,{href:"/contact",onClick:s,className:a+" text-base font-medium",children:"Contact"}),c.jsx(Le,{href:"/about",onClick:s,className:a+" text-base font-medium",children:"About"}),c.jsxs("button",{className:l,onClick:()=>r("compliance"),"aria-expanded":n==="compliance",children:["Compliance",c.jsx(Yr,{className:`h-5 w-5 transition-transform ${n==="compliance"?"rotate-180":""}`})]}),n==="compliance"&&c.jsx("div",{className:"mb-1 pl-3",children:gb.map(({group:d,items:u})=>c.jsxs("div",{className:"mb-1",children:[c.jsx("div",{className:o,children:d}),u.map(({href:h,label:p})=>c.jsx(Le,{href:h,onClick:s,className:"block rounded-md px-3 py-2 text-sm font-medium hover:bg-teal-500/10",children:p},h))]},d))}),c.jsx(Le,{href:"/auth?tab=login",onClick:s,className:a+" text-base font-medium",children:"Login"}),c.jsx(Le,{href:"/signup",onClick:s,className:"mt-2 block rounded-md bg-primary px-3 py-3 text-center text-base font-semibold text-primary-foreground shadow-sm hover:bg-primary/90",children:"Sign Up"})]})})]})}function rM(){const t=new Date().getFullYear(),[e,n]=f.useState(""),[i,r]=f.useState(!1),[s,o]=f.useState(!1),[a,l]=f.useState(null),d=f.useRef(null),{toast:u}=no(),h=[{title:"Platform",links:[{label:"Maia",href:"/platform/maia"},{label:"VAII",href:"/platform/vaii"},{label:"BHConnect",href:"/platform/bhconnect"},{label:"MyData",href:"/platform/mydata"},{label:"Ambient CRM",href:"/product/ambient"}]},{title:"Solutions",links:[{label:"AI Integration",href:"/solutions/ai-integration"},{label:"Knowledge Base",href:"/solutions/knowledge-base"},{label:"RAG + Langchain",href:"/solutions/rag-langchain"},{label:"Fine Tuning",href:"/solutions/fine-tuning"}]},{title:"Explore",links:[{label:"Agentic AI",href:"/explore/agentic-ai"},{label:"Enterprise AI",href:"/explore/enterprise-ai"},{label:"What is RPA?",href:"/explore/what-is-rpa"},{label:"AI Assistant",href:"/explore/ai-assistant"}]},{title:"Company",links:[{label:"About",href:"/about"},{label:"Contact",href:"/contact"},{label:"Resources",href:"/resources"},{label:"Blog",href:"/resources/blog"}]},{title:"Legal",links:[{label:"Privacy Policy",href:"/policies/privacy-policy"},{label:"Terms of Service",href:"/policies/terms-of-service"},{label:"AI Ethics",href:"/policies/ai-ethics"},{label:"Acceptable Use",href:"/policies/acceptable-use"},{label:"Data Processing",href:"/policies/data-processing"}]}],p=async g=>{if(g.preventDefault(),!e||!e.includes("@")||!e.includes(".")){l("Please enter a valid email address"),u({title:"Invalid email",description:"Please enter a valid email address",variant:"destructive"});return}r(!0),l(null);try{const b=await fetch("/api/newsletter/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})}),m=await b.json();b.ok?(o(!0),n(""),u({title:"Subscription successful!",description:"Thank y
558ou for subscribing to our newsletter.",variant:"default"}),setTimeout(()=>{o(!1)},5e3)):(l(m.message||"Failed to subscribe. Please try again."),u({title:"Subscription failed",description:m.message||"Failed to subscribe. Please try again.",variant:"destructive"}))}catch(b){console.error("Newsletter subscription error:",b),l("An error occurred. Please try again."),u({title:"Error",description:"An error occurred. Please try again.",variant:"destructive"})}finally{r(!1)}};return c.jsx("footer",{className:"bg-muted/30 border-t border-border/40",children:c.jsxs("div",{className:"container py-12 lg:py-16",children:[c.jsxs("div",{className:"grid grid-cols-1 gap-8 lg:grid-cols-5",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx(Le,{href:"/",children:c.jsxs("div",{className:"flex cursor-pointer items-center gap-2",children:[c.jsxs("span",{className:"relative flex h-9 w-9 items-center justify-center overflow-hidden rounded-[10px] bg-gradient-to-br from-teal-400 via-teal-500 to-[#1a2744] shadow-md shadow-teal-500/25",children:[c.jsx("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 top-0 h-1/2 bg-gradient-to-b from-white/25 to-transparent"}),c.jsxs("span",{className:"inline-flex items-start leading-none text-white",children:[c.jsx("span",{className:"text-lg font-black leading-none",children:"b"}),c.jsx("span",{className:"ml-[0.5px] text-[10px] font-black leading-none",children:"2"})]})]}),c.jsx("span",{className:"text-xl font-extrabold tracking-tight",children:"bsquared.ai"})]})}),c.jsx("p",{className:"mt-4 text-muted-foreground max-w-xs",children:"Empowering businesses with intelligent AI and automation solutions to streamline workflows and drive innovation."}),c.jsxs("div",{className:"mt-6",children:[c.jsx("div",{className:"text-sm font-medium mb-2",children:"Subscribe to our newsletter"}),s?c.jsxs("div",{className:"flex items-center text-sm text-green-600 dark:text-green-500 gap-1.5 py-2",children:[c.jsx(Yu,{className:"h-4 w-4"}),c.jsx("span",{children:"Thank you for subscribing!"})]}):c.jsxs("form",{onSubmit:p,className:"flex gap-2",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx(Yg,{ref:d,type:"email",placeholder:"Enter your email",className:"max-w-xs","aria-label":"Email for newsletter",value:e,onChange:g=>n(g.target.value),disabled:i}),a&&c.jsxs("div",{className:"flex items-center text-xs text-red-600 dark:text-red-500 gap-1 mt-1",children:[c.jsx(Bj,{className:"h-3 w-3"}),c.jsx("span",{children:a})]})]}),c.jsx(he,{type:"submit",size:"icon","aria-label":"Subscribe",disabled:i,children:i?c.jsx("div",{className:"h-4 w-4 border-2 border-t-transparent border-white rounded-full animate-spin"}):c.jsx(Kg,{className:"h-4 w-4"})})]})]})]}),c.jsx("div",{className:"col-span-3 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-5 gap-8",children:h.map((g,b)=>c.jsxs("div",{className:"space-y-3",children:[c.jsx("h3",{className:"text-sm font-medium",children:g.title}),c.jsx("ul",{className:"space-y-2",children:g.links.map((m,k)=>c.jsx("li",{children:c.jsx(Le,{href:m.href,children:c.jsx("span",{className:"text-muted-foreground hover:text-foreground text-sm cursor-pointer",children:m.label})})},`footer-link-${b}-${k}`))})]},`footer-section-${b}`))})]}),c.jsxs("div",{className:"mt-12 pt-8 border-t border-border/40 flex flex-col md:flex-row justify-between items-center",children:[c.jsxs("div",{className:"text-sm text-muted-foreground",children:["© ",t," bsquared.ai Technologies. All rights reserved."]}),c.jsxs("div",{className:"flex gap-4 mt-4 md:mt-0",children:[c.jsx(he,{variant:"ghost",size:"icon",asChild:!0,"aria-label":"LinkedIn",children:c.jsx("a",{href:"https://www.linkedin.com/company/bsquaredai/",target:"_blank",rel:"noopener noreferrer",children:c.jsx(tA,{className:"h-4 w-4"})})}),c.jsx(he,{variant:"ghost",size:"icon",asChild:!0,"aria-label":"Twitter",children:c.jsx("a",{href:"https://x.com/bsquared_ai",target:"_blank",rel:"noopener noreferrer",children:c.jsx(kA,{className:"h-4 w-4"})})}),c.jsx(he,{variant:"ghost",size:"icon",asChild:!0,"aria-label":"Instagram",children:c.jsx("a",{href:"https://instagram.com/bsquared_ai",target:"_blank",rel:"noopener noreferrer",children:c.jsx(Zj,{className:"h-4 w-4"})})})]})]})]})})}var yb={};
vendor: 13,266 bytes, line 558
558function sM(t,e){return e.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(i){if(i!=="default"&&!(i in t)){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}})}),Object.freeze(t)}var oM=Object.defineProperty,aM=(t,e,n)=>e in t?oM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,bb=(t,e,n)=>aM(t,typeof e!="symbol"?e+"":e,n);let dn=class{constructor(){bb(this,"_locking"),bb(this,"_locks"),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){this._locks+=1;let e;const n=new Promise(r=>e=()=>{this._locks-=1,r()}),i=this._locking.then(()=>e);return this._locking=this._locking.then(()=>n),i}};function dt(t,e){if(!t)throw new Error(e)}const cM=34028234663852886e22,lM=-34028234663852886e22,dM=4294967295,uM=2147483647,hM=-2147483648;function kd(t){if(typeof t!="number")throw new Error("invalid int 32: "+typeof t);if(!Number.isInteger(t)||t>uM||t<hM)throw new Error("invalid int 32: "+t)}function sm(t){if(typeof t!="number")throw new Error("invalid uint 32: "+typeof t);if(!Number.isInteger(t)||t>dM||t<0)throw new Error("invalid uint 32: "+t)}function H_(t){if(typeof t!="number")throw new Error("invalid float 32: "+typeof t);if(Number.isFinite(t)&&(t>cM||t<lM))throw new Error("invalid float 32: "+t)}const $_=Symbol("@bufbuild/protobuf/enum-type");function fM(t){const e=t[$_];return dt(e,"missing enum type on enum object"),e}function q_(t,e,n,i){t[$_]=K_(e,n.map(r=>({no:r.no,name:r.name,localName:t[r.no]})))}function K_(t,e,n){const i=Object.create(null),r=Object.create(null),s=[];for(const o of e){const a=G_(o);s.push(a),i[o.name]=a,r[o.no]=a}return{typeName:t,values:s,findName(o){return i[o]},findNumber(o){return r[o]}}}function pM(t,e,n){const i={};for(const r of e){const s=G_(r);i[s.localName]=s.no,i[s.no]=s.localName}return q_(i,t,e),i}function G_(t){return"localName"in t?t:Object.assign(Object.assign({},t),{localName:t.name})}class Sv{equals(e){return this.getType().runtime.util.equals(this.getType(),this,e)}clone(){return this.getType().runtime.util.clone(this)}fromBinary(e,n){const i=this.getType(),r=i.runtime.bin,s=r.makeReadOptions(n);return r.readMessage(this,s.readerFactory(e),e.byteLength,s),this}fromJson(e,n){const i=this.getType(),r=i.runtime.json,s=r.makeReadOptions(n);return r.readMessage(i,e,s,this),this}fromJsonString(e,n){let i;try{i=JSON.parse(e)}catch(r){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(r instanceof Error?r.message:String(r)))}return this.fromJson(i,n)}toBinary(e){const n=this.getType(),i=n.runtime.bin,r=i.makeWriteOptions(e),s=r.writerFactory();return i.writeMessage(this,s,r),s.finish()}toJson(e){const n=this.getType(),i=n.runtime.json,r=i.makeWriteOptions(e);return i.writeMessage(this,r)}toJsonString(e){var n;const i=this.toJson(e);return JSON.stringify(i,null,(n=e==null?void 0:e.prettySpaces)!==null&&n!==void 0?n:0)}toJSON(){return this.toJson({emitDefaultValues:!0})}getType(){return Object.getPrototypeOf(this).constructor}}function mM(t,e,n,i){var r;const s=(r=i==null?void 0:i.localName)!==null&&r!==void 0?r:e.substring(e.lastIndexOf(".")+1),o={[s]:function(a){t.util.initFields(this),t.util.initPartial(a,this)}}[s];return Object.setPrototypeOf(o.prototype,new Sv),Object.assign(o,{runtime:t,typeName:e,fields:t.util.newFieldList(n),fromBinary(a,l){return new o().fromBinary(a,l)},fromJson(a,l){return new o().fromJson(a,l)},fromJsonString(a,l){return new o().fromJsonString(a,l)},equals(a,l){return t.util.equals(o,a,l)}}),o}function gM(){let t=0,e=0;for(let i=0;i<28;i+=7){let r=this.buf[this.pos++];if(t|=(r&127)<<i,!(r&128))return this.assertBounds(),[t,e]}let n=this.buf[this.pos++];if(t|=(n&15)<<28,e=(n&112)>>4,!(n&128))return this.assertBounds(),[t,e];for(let i=3;i<=31;i+=7){let r=this.buf[this.pos++];if(e|=(r&127)<<i,!(r&128))return this.assertBounds(),[t,e]}throw new Error("invalid varint")}function ff(t,e,n){for(let s=0;s<28;s=s+7){const o=t>>>s,a=!(!(o>>>7)&&e==0),l=(a?o|128:o)&255;if(n.push(l),!a)return}const i=t>>>28&15|(e&7)<<4,r=!!(e>>3);if(n.push((r?i|128:i)&255),!!r){for(let s=3;s<31;s=s+7){const o=e>>>s,a=!!(o>>>7),l=(a?o|128:o)&255;if(n.push(l),!a)return}n.push(e>>>31&1)}}const Sd=4294967296;function xb(t){const e=t[0]==="-";e&&(t=t.slice(1));const n=1e6;let i=0,r=0;function s(o,a){const l=Number(t.slice(o,a));r*=n,i=i*n+l,i>=Sd&&(r=r+(i/Sd|0),i=i%Sd)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),e?J_(i,r):wv(i,r)}function vM(t,e){let n=wv(t,e);const i=n.hi&2147483648;i&&(n=J_(n.lo,n.hi));const r=Q_(n.lo,n.hi);return i?"-"+r:r}function Q_(t,e){if({lo:t,hi:e}=yM(t,e),e<=2097151)return String(Sd*e+t);const n=t&16777215,i=(t>>>24|e<<8)&16777215,r=e>>16&65535;let s=n+i*6777216+r*6710656,o=i+r*8147497,a=r*2;const l=1e7;return s>=l&&(o+=Math.floor(s/l),s%=l),o>=l&&(a+=Math.floor(o/l),o%=l),a.toString()+kb(o)+kb(s)}function yM(t,e){return{lo:t>>>0,hi:e>>>0}}function wv(t,e){return{lo:t|0,hi:e|0}}function J_(t,e){return e=~e,t?t=~t+1:e+=1,wv(t,e)}const kb=t=>{const e=String(t);return"0000000".slice(e.length)+e};function Sb(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let n=0;n<9;n++)e.push(t&127|128),t=t>>7;e.push(1)}}function bM(){let t=this.buf[this.pos++],e=t&127;if(!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,!(t&128))return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let n=5;t&128&&n<10;n++)t=this.buf[this.pos++];if(t&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function xM(){const t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(typeof process!="object"||typeof yb!="object"||yb.BUF_BIGINT_DISABLE!=="1")){const r=BigInt("-9223372036854775808"),s=BigInt("9223372036854775807"),o=BigInt("0"),a=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(l){const d=typeof l=="bigint"?l:BigInt(l);if(d>s||d<r)throw new Error("int64 invalid: ".concat(l));return d},uParse(l){const d=typeof l=="bigint"?l:BigInt(l);if(d>a||d<o)throw new Error("uint64 invalid: ".concat(l));return d},enc(l){return t.setBigInt64(0,this.parse(l),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},uEnc(l){return t.setBigInt64(0,this.uParse(l),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},dec(l,d){return t.setInt32(0,l,!0),t.setInt32(4,d,!0),t.getBigInt64(0,!0)},uDec(l,d){return t.setInt32(0,l,!0),t.setInt32(4,d,!0),t.getBigUint64(0,!0)}}}const n=r=>dt(/^-?[0-9]+$/.test(r),"int64 invalid: ".concat(r)),i=r=>dt(/^[0-9]+$/.test(r),"uint64 invalid: ".concat(r));return{zero:"0",supported:!1,parse(r){return typeof r!="string"&&(r=r.toString()),n(r),r},uParse(r){return typeof r!="string"&&(r=r.toString()),i(r),r},enc(r){return typeof r!="string"&&(r=r.toString()),n(r),xb(r)},uEnc(r){return typeof r!="string"&&(r=r.toString()),i(r),xb(r)},dec(r,s){return vM(r,s)},uDec(r,s){return Q_(r,s)}}}const et=xM();var z;(function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"})(z||(z={}));var ss;(function(t){t[t.BIGINT=0]="BIGINT",t[t.STRING=1]="STRING"})(ss||(ss={}));function pr(t,e,n){if(e===n)return!0;if(t==z.BYTES){if(!(e instanceof Uint8Array)||!(n instanceof Uint8Array)||e.length!==n.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==n[i])return!1;return!0}switch(t){case z.UINT64:case z.FIXED64:case z.INT64:case z.SFIXED64:case z.SINT64:return e==n}return!1}function xa(t,e){switch(t){case z.BOOL:return!1;case z.UINT64:case z.FIXED64:case z.INT64:case z.SFIXED64:case z.SINT64:return e==0?et.zero:"0";case z.DOUBLE:case z.FLOAT:return 0;case z.BYTES:return new Uint8Array(0);case z.STRING:return"";default:return 0}}function Y_(t,e){switch(t){case z.BOOL:return e===!1;case z.STRING:return e==="";case z.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}var ft;(function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"})(ft||(ft={}));class kM{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let r=0;r<this.chunks.length;r++)e+=this.chunks[r].length;let n=new Uint8Array(e),i=0;for(let r=0;r<this.chunks.length;r++)n.set(this.chunks[r],i),i+=this.chunks[r].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,n){return this.uint32((e<<3|n)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(sm(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return kd(e),Sb(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let n=this.textEncoder.encode(e);return this.uint32(n.byteLength),this.raw(n)}float(e){H_(e);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,e,!0),this.raw(n)}fixed32(e){sm(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){kd(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return kd(e),e=(e<<1^e>>31)>>>0,Sb(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),i=new DataView(n.buffer),r=et.enc(e);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),i=new DataView(n.buffer),r=et.uEnc(e);return i.setInt32(0,r.lo,!0),i.setInt32(4,r.hi,!0),this.raw(n)}int64(e){let n=et.enc(e);return ff(n.lo,n.hi,this.buf),this}sint64(e){let n=et.enc(e),i=n.hi>>31,r=n.lo<<1^i,s=(n.hi<<1|n.lo>>>31)^i;return ff(r,s,this.buf),this}uint64(e){let n=et.uEnc(e);return ff(n.lo,n.hi,this.buf),this}}class SM{constructor(e,n){this.varint64=gM,this.uint32=bM,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=n??new TextDecoder}tag(){let e=this.uint32(),n=e>>>3,i=e&7;if(n<=0||i<0||i>5)throw new Error("illegal tag: field no "+n+" wire type "+i);return[n,i]}skip(e,n){let i=this.pos;switch(e){case ft.Varint:for(;this.buf[this.pos++]&128;);break;case ft.Bit64:this.pos+=4;case ft.Bit32:this.pos+=4;break;case ft.LengthDelimited:let r=this.uint32();this.pos+=r;break;case ft.StartGroup:for(;;){const[s,o]=this.tag();if(o===ft.EndGroup){if(n!==void 0&&s!==n)throw new Error("invalid end group tag");break}this.skip(o,s)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return et.dec(...this.varint64())}uint64(){return et.uDec(...this.varint64())}sint64(){let[e,n]=this.varint64(),i=-(e&1);return e=(e>>>1|(n&1)<<31)^i,n=n>>>1^i,et.dec(e,n)}bool(){let[e,n]=this.varint64();return e!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return et.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return et.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),n=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(n,n+e)}string(){return this.textDecoder.decode(this.bytes())}}function wM(t,e,n,i){let r;return{typeName:e,extendee:n,get field(){if(!r){const s=typeof i=="function"?i():i;s.name=e.split(".").pop(),s.jsonName="[".concat(e,"]"),r=t.util.newFieldList([s]).list()[0]}return r},runtime:t}}function X_(t){const e=t.field.localName,n=Object.create(null);return n[e]=CM(t),[n,()=>n[e]]}function CM(t){const e=t.field;if(e.repeated)return[];if(e.default!==void 0)return e.default;switch(e.kind){case"enum":return e.T.values[0].no;case"scalar":return xa(e.T,e.L);case"message":const n=e.T,i=new n;return n.fieldWrapper?n.fieldWrapper.unwrapField(i):i;case"map":throw"map fields are not allowed to be extensions"}}function TM(t,e){if(!e.repeated&&(e.kind=="enum"||e.kind=="scalar")){for(let n=t.length-1;n>=0;--n)if(t[n].no==e.no)return[t[n]];return[]}return t.filter(n=>n.no===e.no)}let Bi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
558+/".split(""),ch=[];for(let t=0;t<Bi.length;t++)ch[Bi[t].charCodeAt(0)]=t;ch[45]=Bi.indexOf("+");ch[95]=Bi.indexOf("/");const Z_={dec(t){let e=t.length*3/4;t[t.length-2]=="="?e-=2:t[t.length-1]=="="&&(e-=1);let n=new Uint8Array(e),i=0,r=0,s,o=0;for(let a=0;a<t.length;a++){if(s=ch[t.charCodeAt(a)],s===void 0)switch(t[a]){case"=":r=0;case` 559`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(r){case 0:o=s,r=1;break;case 1:n[i++]=o<<2|(s&48)>>4,o=s,r=2;break;case 2:n[i++]=(o&15)<<4|(s&60)>>2,o=s,r=3;break;case 3:n[i++]=(o&3)<<6|s,r=0;break}}if(r==1)throw Error("invalid base64 string.");return n.subarray(0,i)},enc(t){let e="",n=0,i,r=0;for(let s=0;s<t.length;s++)switch(i=t[s],n){case 0:e+=Bi[i>>2],r=(i&3)<<4,n=1;break;case 1:e+=Bi[r|i>>4],r=(i&15)<<2,n=2;break;case 2:e+=Bi[r|i>>6],e+=Bi[i&63],n=0;break}return n&&(e+=Bi[r],e+="=",n==1&&(e+="=")),e}};function _M(t,e,n){t1(e,t);const i=e.runtime.bin.makeReadOptions(n),r=TM(t.getType().runtime.bin.listUnknownFields(t),e.field),[s,o]=X_(e);for(const a of r)e.runtime.bin.readField(s,i.readerFactory(a.data),e.field,a.wireType,i);return o()}function EM(t,e,n,i){t1(e,t);const r=e.runtime.bin.makeReadOptions(i),s=e.runtime.bin.makeWriteOptions(i);if(e1(t,e)){const d=t.getType().runtime.bin.listUnknownFields(t).filter(u=>u.no!=e.field.no);t.getType().runtime.bin.discardUnknownFields(t);for(const u of d)t.getType().runtime.bin.onUnknownField(t,u.no,u.wireType,u.data)}const o=s.writerFactory();let a=e.field;!a.opt&&!a.repeated&&(a.kind=="enum"||a.kind=="scalar")&&(a=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(a,n,o,s);const l=r.readerFactory(o.finish());for(;l.pos<l.len;){const[d,u]=l.tag(),h=l.skip(u,d);t.getType().runtime.bin.onUnknownField(t,d,u,h)}}function e1(t,e){const n=t.getType();return e.extendee.typeName===n.typeName&&!!n.runtime.bin.listUnknownFields(t).find(i=>i.no==e.field.no)}function t1(t,e){dt(t.extendee.typeName==e.getType().typeName,"extension ".concat(t.typeName," can only be applied to message ").concat(t.extendee.typeName))}function n1(t,e){const n=t.localName;if(t.repeated)return e[n].length>0;if(t.oneof)return e[t.oneof.localName].case===n;switch(t.kind){case"enum":case"scalar":return t.opt||t.req?e[n]!==void 0:t.kind=="enum"?e[n]!==t.T.values[0].no:!Y_(t.T,e[n]);case"message":return e[n]!==void 0;case"map":return Object.keys(e[n]).length>0}}function wb(t,e){const n=t.localName,i=!t.opt&&!t.req;if(t.repeated)e[n]=[];else if(t.oneof)e[t.oneof.localName]={case:void 0};else switch(t.kind){case"map":e[n]={};break;case"enum":e[n]=i?t.T.values[0].no:void 0;break;case"scalar":e[n]=i?xa(t.T,t.L):void 0;break;case"message":e[n]=void 0;break}}function Wi(t,e){if(t===null||typeof t!="object"||!Object.getOwnPropertyNames(Sv.prototype).every(i=>i in t&&typeof t[i]=="function"))return!1;const n=t.getType();return n===null||typeof n!="function"||!("typeName"in n)||typeof n.typeName!="string"?!1:e===void 0?!0:n.typeName==e.typeName}function i1(t,e){return Wi(e)||!t.fieldWrapper?e:t.fieldWrapper.wrapField(e)}z.DOUBLE,z.FLOAT,z.INT64,z.UINT64,z.INT32,z.UINT32,z.BOOL,z.STRING,z.BYTES;const Cb={ignoreUnknownFields:!1},Tb={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function PM(t){return t?Object.assign(Object.assign({},Cb),t):Cb}function RM(t){return t?Object.assign(Object.assign({},Tb),t):Tb}const gu=Symbol(),wd=Symbol();function NM(){return{makeReadOptions:PM,makeWriteOptions:RM,readMessage(t,e,n,i){if(e==null||Array.isArray(e)||typeof e!="object")throw new Error("cannot decode message ".concat(t.typeName," from JSON: ").concat(di(e)));i=i??new t;const r=new Map,s=n.typeRegistry;for(const[o,a]of Object.entries(e)){const l=t.fields.findJsonName(o);if(l){if(l.oneof){if(a===null&&l.kind=="scalar")continue;const d=r.get(l.oneof);if(d!==void 0)throw new Error("cannot decode message ".concat(t.typeName,' from JSON: multiple keys for oneof "').concat(l.oneof.name,'" present: "').concat(d,'", "').concat(o,'"'));r.set(l.oneof,o)}_b(i,a,l,n,t)}else{let d=!1;if(s!=null&&s.findExtension&&o.startsWith("[")&&o.endsWith("]")){const u=s.findExtension(o.substring(1,o.length-1));if(u&&u.extendee.typeName==t.typeName){d=!0;const[h,p]=X_(u);_b(h,a,u.field,n,u),EM(i,u,p(),n)}}if(!d&&!n.ignoreUnknownFields)throw new Error("cannot decode message ".concat(t.typeName,' from JSON: key "').concat(o,'" is unknown'))}}return i},writeMessage(t,e){const n=t.getType(),i={};let r;try{for(r of n.fields.byNumber()){if(!n1(r,t)){if(r.req)throw"required field not set";if(!e.emitDefaultValues||!jM(r))continue}const o=r.oneof?t[r.oneof.localName].value:t[r.localName],a=Eb(r,o,e);a!==void 0&&(i[e.useProtoFieldName?r.name:r.jsonName]=a)}const s=e.typeRegistry;if(s!=null&&s.findExtensionFor)for(const o of n.runtime.bin.listUnknownFields(t)){const a=s.findExtensionFor(n.typeName,o.no);if(a&&e1(t,a)){const l=_M(t,a,e),d=Eb(a.field,l,e);d!==void 0&&(i[a.field.jsonName]=d)}}}catch(s){const o=r?"cannot encode field ".concat(n.typeName,".").concat(r.name," to JSON"):"cannot encode message ".concat(n.typeName," to JSON"),a=s instanceof Error?s.message:String(s);throw new Error(o+(a.length>0?": ".concat(a):""))}return i}
vendor: 17,468 bytes, line 559
559,readScalar(t,e,n){return hc(t,e,n??ss.BIGINT,!0)},writeScalar(t,e,n){if(e!==void 0&&(n||Y_(t,e)))return Cd(t,e)},debug:di}}function di(t){if(t===null)return"null";switch(typeof t){case"object":return Array.isArray(t)?"array":"object";case"string":return t.length>100?"string":'"'.concat(t.split('"').join('\\"'),'"');default:return String(t)}}function _b(t,e,n,i,r){let s=n.localName;if(n.repeated){if(dt(n.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(r.typeName,".").concat(n.name," from JSON: ").concat(di(e)));const o=t[s];for(const a of e){if(a===null)throw new Error("cannot decode field ".concat(r.typeName,".").concat(n.name," from JSON: ").concat(di(a)));switch(n.kind){case"message":o.push(n.T.fromJson(a,i));break;case"enum":const l=pf(n.T,a,i.ignoreUnknownFields,!0);l!==wd&&o.push(l);break;case"scalar":try{o.push(hc(n.T,a,n.L,!0))}catch(d){let u="cannot decode field ".concat(r.typeName,".").concat(n.name," from JSON: ").concat(di(a));throw d instanceof Error&&d.message.length>0&&(u+=": ".concat(d.message)),new Error(u)}break}}}else if(n.kind=="map"){if(e===null)return;if(typeof e!="object"||Array.isArray(e))throw new Error("cannot decode field ".concat(r.typeName,".").concat(n.name," from JSON: ").concat(di(e)));const o=t[s];for(const[a,l]of Object.entries(e)){if(l===null)throw new Error("cannot decode field ".concat(r.typeName,".").concat(n.name," from JSON: map value null"));let d;try{d=IM(n.K,a)}catch(u){let h="cannot decode map key for field ".concat(r.typeName,".").concat(n.name," from JSON: ").concat(di(e));throw u instanceof Error&&u.message.length>0&&(h+=": ".concat(u.message)),new Error(h)}switch(n.V.kind){case"message":o[d]=n.V.T.fromJson(l,i);break;case"enum":const u=pf(n.V.T,l,i.ignoreUnknownFields,!0);u!==wd&&(o[d]=u);break;case"scalar":try{o[d]=hc(n.V.T,l,ss.BIGINT,!0)}catch(h){let p="cannot decode map value for field ".concat(r.typeName,".").concat(n.name," from JSON: ").concat(di(e));throw h instanceof Error&&h.message.length>0&&(p+=": ".concat(h.message)),new Error(p)}break}}}else switch(n.oneof&&(t=t[n.oneof.localName]={case:s},s="value"),n.kind){case"message":const o=n.T;if(e===null&&o.typeName!="google.protobuf.Value")return;let a=t[s];Wi(a)?a.fromJson(e,i):(t[s]=a=o.fromJson(e,i),o.fieldWrapper&&!n.oneof&&(t[s]=o.fieldWrapper.unwrapField(a)));break;case"enum":const l=pf(n.T,e,i.ignoreUnknownFields,!1);switch(l){case gu:wb(n,t);break;case wd:break;default:t[s]=l;break}break;case"scalar":try{const d=hc(n.T,e,n.L,!1);switch(d){case gu:wb(n,t);break;default:t[s]=d;break}}catch(d){let u="cannot decode field ".concat(r.typeName,".").concat(n.name," from JSON: ").concat(di(e));throw d instanceof Error&&d.message.length>0&&(u+=": ".concat(d.message)),new Error(u)}break}}function IM(t,e){if(t===z.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return hc(t,e,ss.BIGINT,!0).toString()}function hc(t,e,n,i){if(e===null)return i?xa(t,n):gu;switch(t){case z.DOUBLE:case z.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;const r=Number(e);if(Number.isNaN(r)||!Number.isFinite(r))break;return t==z.FLOAT&&H_(r),r;case z.INT32:case z.FIXED32:case z.SFIXED32:case z.SINT32:case z.UINT32:let s;if(typeof e=="number"?s=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(s=Number(e)),s===void 0)break;return t==z.UINT32||t==z.FIXED32?sm(s):kd(s),s;case z.INT64:case z.SFIXED64:case z.SINT64:if(typeof e!="number"&&typeof e!="string")break;const o=et.parse(e);return n?o.toString():o;case z.FIXED64:case z.UINT64:if(typeof e!="number"&&typeof e!="string")break;const a=et.uParse(e);return n?a.toString():a;case z.BOOL:if(typeof e!="boolean")break;return e;case z.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case z.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return Z_.dec(e)}throw new Error}function pf(t,e,n,i){if(e===null)return t.typeName=="google.protobuf.NullValue"?0:i?t.values[0].no:gu;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const r=t.findName(e);if(r!==void 0)return r.no;if(n)return wd;break}throw new Error("cannot decode enum ".concat(t.typeName," from JSON: ").concat(di(e)))}function jM(t){return t.repeated||t.kind=="map"?!0:!(t.oneof||t.kind=="message"||t.opt||t.req)}function Eb(t,e,n){if(t.kind=="map"){dt(typeof e=="object"&&e!=null);const i={},r=Object.entries(e);switch(t.V.kind){case"scalar":for(const[o,a]of r)i[o.toString()]=Cd(t.V.T,a);break;case"message":for(const[o,a]of r)i[o.toString()]=a.toJson(n);break;case"enum":const s=t.V.T;for(const[o,a]of r)i[o.toString()]=mf(s,a,n.enumAsInteger);break}return n.emitDefaultValues||r.length>0?i:void 0}if(t.repeated){dt(Array.isArray(e));const i=[];switch(t.kind){case"scalar":for(let r=0;r<e.length;r++)i.push(Cd(t.T,e[r]));break;case"enum":for(let r=0;r<e.length;r++)i.push(mf(t.T,e[r],n.enumAsInteger));break;case"message":for(let r=0;r<e.length;r++)i.push(e[r].toJson(n));break}return n.emitDefaultValues||i.length>0?i:void 0}switch(t.kind){case"scalar":return Cd(t.T,e);case"enum":return mf(t.T,e,n.enumAsInteger);case"message":return i1(t.T,e).toJson(n)}}function mf(t,e,n){var i;if(dt(typeof e=="number"),t.typeName=="google.protobuf.NullValue")return null;if(n)return e;const r=t.findNumber(e);return(i=r==null?void 0:r.name)!==null&&i!==void 0?i:e}function Cd(t,e){switch(t){case z.INT32:case z.SFIXED32:case z.SINT32:case z.FIXED32:case z.UINT32:return dt(typeof e=="number"),e;case z.FLOAT:case z.DOUBLE:return dt(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case z.STRING:return dt(typeof e=="string"),e;case z.BOOL:return dt(typeof e=="boolean"),e;case z.UINT64:case z.FIXED64:case z.INT64:case z.SFIXED64:case z.SINT64:return dt(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case z.BYTES:return dt(e instanceof Uint8Array),Z_.enc(e)}}const uo=Symbol("@bufbuild/protobuf/unknown-fields"),Pb={readUnknownFields:!0,readerFactory:t=>new SM(t)},Rb={writeUnknownFields:!0,writerFactory:()=>new kM};function AM(t){return t?Object.assign(Object.assign({},Pb),t):Pb}function OM(t){return t?Object.assign(Object.assign({},Rb),t):Rb}function DM(){return{makeReadOptions:AM,makeWriteOptions:OM,listUnknownFields(t){var e;return(e=t[uo])!==null&&e!==void 0?e:[]},discardUnknownFields(t){delete t[uo]},writeUnknownFields(t,e){const i=t[uo];if(i)for(const r of i)e.tag(r.no,r.wireType).raw(r.data)},onUnknownField(t,e,n,i){const r=t;Array.isArray(r[uo])||(r[uo]=[]),r[uo].push({no:e,wireType:n,data:i})},readMessage(t,e,n,i,r){const s=t.getType(),o=r?e.len:e.pos+n;let a,l;for(;e.pos<o&&([a,l]=e.tag(),!(r===!0&&l==ft.EndGroup));){const d=s.fields.find(a);if(!d){const u=e.skip(l,a);i.readUnknownFields&&this.onUnknownField(t,a,l,u);continue}Nb(t,e,d,l,i)}if(r&&(l!=ft.EndGroup||a!==n))throw new Error("invalid end group tag")},readField:Nb,writeMessage(t,e,n){const i=t.getType();for(const r of i.fields.byNumber()){if(!n1(r,t)){if(r.req)throw new Error("cannot encode field ".concat(i.typeName,".").concat(r.name," to binary: required field not set"));continue}const s=r.oneof?t[r.oneof.localName].value:t[r.localName];Ib(r,s,e,n)}return n.writeUnknownFields&&this.writeUnknownFields(t,e),e},writeField(t,e,n,i){e!==void 0&&Ib(t,e,n,i)}}}function Nb(t,e,n,i,r){let{repeated:s,localName:o}=n;switch(n.oneof&&(t=t[n.oneof.localName],t.case!=o&&delete t.value,t.case=o,o="value"),n.kind){case"scalar":case"enum":const a=n.kind=="enum"?z.INT32:n.T;let l=vu;if(n.kind=="scalar"&&n.L>0&&(l=MM),s){let p=t[o];if(i==ft.LengthDelimited&&a!=z.STRING&&a!=z.BYTES){let b=e.uint32()+e.pos;for(;e.pos<b;)p.push(l(e,a))}else p.push(l(e,a))}else t[o]=l(e,a);break;case"message":const d=n.T;s?t[o].push(Td(e,new d,r,n)):Wi(t[o])?Td(e,t[o],r,n):(t[o]=Td(e,new d,r,n),d.fieldWrapper&&!n.oneof&&!n.repeated&&(t[o]=d.fieldWrapper.unwrapField(t[o])));break;case"map":let[u,h]=LM(n,e,r);t[o][u]=h;break}}function Td(t,e,n,i){const r=e.getType().runtime.bin,s=i==null?void 0:i.delimited;return r.readMessage(e,t,s?i.no:t.uint32(),n,s),e}function LM(t,e,n){const i=e.uint32(),r=e.pos+i;let s,o;for(;e.pos<r;){const[a]=e.tag();switch(a){case 1:s=vu(e,t.K);break;case 2:switch(t.V.kind){case"scalar":o=vu(e,t.V.T);break;case"enum":o=e.int32();break;case"message":o=Td(e,new t.V.T,n,void 0);break}break}}if(s===void 0&&(s=xa(t.K,ss.BIGINT)),typeof s!="string"&&typeof s!="number"&&(s=s.toString()),o===void 0)switch(t.V.kind){case"scalar":o=xa(t.V.T,ss.BIGINT);break;case"enum":o=t.V.T.values[0].no;break;case"message":o=new t.V.T;break}return[s,o]}function MM(t,e){const n=vu(t,e);return typeof n=="bigint"?n.toString():n}function vu(t,e){switch(e){case z.STRING:return t.string();case z.BOOL:return t.bool();case z.DOUBLE:return t.double();case z.FLOAT:return t.float();case z.INT32:return t.int32();case z.INT64:return t.int64();case z.UINT64:return t.uint64();case z.FIXED64:return t.fixed64();case z.BYTES:return t.bytes();case z.FIXED32:return t.fixed32();case z.SFIXED32:return t.sfixed32();case z.SFIXED64:return t.sfixed64();case z.SINT64:return t.sint64();case z.UINT32:return t.uint32();case z.SINT32:return t.sint32()}}function Ib(t,e,n,i){dt(e!==void 0);const r=t.repeated;switch(t.kind){case"scalar":case"enum":let s=t.kind=="enum"?z.INT32:t.T;if(r)if(dt(Array.isArray(e)),t.packed)FM(n,s,t.no,e);else for(const o of e)fc(n,s,t.no,o);else fc(n,s,t.no,e);break;case"message":if(r){dt(Array.isArray(e));for(const o of e)jb(n,i,t,o)}else jb(n,i,t,e);break;case"map":dt(typeof e=="object"&&e!=null);for(const[o,a]of Object.entries(e))UM(n,i,t,o,a);break}}function UM(t,e,n,i,r){t.tag(n.no,ft.LengthDelimited),t.fork();let s=i;switch(n.K){case z.INT32:case z.FIXED32:case z.UINT32:case z.SFIXED32:case z.SINT32:s=Number.parseInt(i);break;case z.BOOL:dt(i=="true"||i=="false"),s=i=="true";break}switch(fc(t,n.K,1,s),n.V.kind){case"scalar":fc(t,n.V.T,2,r);break;case"enum":fc(t,z.INT32,2,r);break;case"message":dt(r!==void 0),t.tag(2,ft.LengthDelimited).bytes(r.toBinary(e));break}t.join()}function jb(t,e,n,i){const r=i1(n.T,i);n.delimited?t.tag(n.no,ft.StartGroup).raw(r.toBinary(e)).tag(n.no,ft.EndGroup):t.tag(n.no,ft.LengthDelimited).bytes(r.toBinary(e))}function fc(t,e,n,i){dt(i!==void 0);let[r,s]=r1(e);t.tag(n,r)[s](i)}function FM(t,e,n,i){if(!i.length)return;t.tag(n,ft.LengthDelimited).fork();let[,r]=r1(e);for(let s=0;s<i.length;s++)t[r](i[s]);t.join()}function r1(t){let e=ft.Varint;switch(t){case z.BYTES:case z.STRING:e=ft.LengthDelimited;break;case z.DOUBLE:case z.FIXED64:case z.SFIXED64:e=ft.Bit64;break;case z.FIXED32:case z.SFIXED32:case z.FLOAT:e=ft.Bit32;break}const n=z[t].toLowerCase();return[e,n]}function VM(){return{setEnumType:q_,initPartial(t,e){if(t===void 0)return;const n=e.getType();for(const i of n.fields.byMember()){const r=i.localName,s=e,o=t;if(o[r]!=null)switch(i.kind){case"oneof":const a=o[r].case;if(a===void 0)continue;const l=i.findField(a);let d=o[r].value;l&&l.kind=="message"&&!Wi(d,l.T)?d=new l.T(d):l&&l.kind==="scalar"&&l.T===z.BYTES&&(d=Ba(d)),s[r]={case:a,value:d};break;case"scalar":case"enum":let u=o[r];i.T===z.BYTES&&(u=i.repeated?u.map(Ba):Ba(u)),s[r]=u;break;case"map":switch(i.V.kind){case"scalar":case"enum":if(i.V.T===z.BYTES)for(const[g,b]of Object.entries(o[r]))s[r][g]=Ba(b);else Object.assign(s[r],o[r]);break;case"message":const p=i.V.T;for(const g of Object.keys(o[r])){let b=o[r][g];p.fieldWrapper||(b=new p(b)),s[r][g]=b}break}break;case"message":const h=i.T;if(i.repeated)s[r]=o[r].map(p=>Wi(p,h)?p:new h(p));else{const p=o[r];h.fieldWrapper?h.typeName==="google.protobuf.BytesValue"?s[r]=Ba(p):s[r]=p:s[r]=Wi(p,h)?p:new h(p)}break}}},equals(t,e,n){return e===n?!0:!e||!n?!1:t.fields.byMember().every(i=>{const r=e[i.localName],s=n[i.localName];if(i.repeated){if(r.length!==s.length)return!1;switch(i.kind){case"message":return r.every((o,a)=>i.T.equals(o,s[a]));case"scalar":return r.every((o,a)=>pr(i.T,o,s[a]));case"enum":return r.every((o,a)=>pr(z.INT32,o,s[a]))}throw new Error("repeated cannot contain ".concat(i.kind))}switch(i.kind){case"message":let o=r,a=s;return i.T.fieldWrapper&&(o!==void 0&&!Wi(o)&&(o=i.T.fieldWrapper.wrapField(o)),a!==void 0&&!Wi(a)&&(a=i.T.fieldWrapper.wrapField(a))),i.T.equals(o,a);case"enum":return pr(z.INT32,r,s);case"scalar":return pr(i.T,r,s);case"oneof":if(r.case!==s.case)return!1;const l=i.findField(r.case);if(l===void 0)return!0;switch(l.kind){case"message":return l.T.equals(r.value,s.value);case"enum":return pr(z.INT32,r.value,s.value);case"scalar":return pr(l.T,r.value,s.value)}throw new Error("oneof cannot contain ".concat(l.kind));case"map":const d=Object.keys(r).concat(Object.keys(s));switch(i.V.kind){case"message":const u=i.V.T;return d.every(p=>u.equals(r[p],s[p]));case"enum":return d.every(p=>pr(z.INT32,r[p],s[p]));case"scalar":const h=i.V.T;return d.every(p=>pr(h,r[p],s[p]))}break}})},clone(t){const e=t.getType(),n=new e,i=n;for(const r of e.fields.byMember()){const s=t[r.localName];let o;if(r.repeated)o=s.map(Jl);else if(r.kind=="map"){o=i[r.localName];for(const[a,l]of Object.entries(s))o[a]=Jl(l)}else r.kind=="oneof"?o=r.findField(s.case)?{case:s.case,value:Jl(s.value)}:{case:void 0}:o=Jl(s);i[r.localName]=o}for(const r of e.runtime.bin.listUnknownFields(t))e.runtime.bin.onUnknownField(i,r.no,r.wireType,r.data);return n}}}function Jl(t){if(t===void 0)return t;if(Wi(t))return t.clone();if(t instanceof Uint8Array){const e=new Uint8Array(t.byteLength);return e.set(t),e}return t}function Ba(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function zM(t,e,n){return{syntax:t,json:NM(),bin:DM(),util:Object.assign(Object.assign({},VM()),{newFieldList:e,initFields:n}),makeMessageType(i,r,s){return mM(this,i,r,s)},makeEnum:pM,makeEnumType:K_,getEnumType:fM,makeExtension(i,r,s){return wM(this,i,r,s)}}}class BM{constructor(e,n){this._fields=e,this._normalizer=n}findJsonName(e){if(!this.jsonNames){const n={};for(const i of this.list())n[i.jsonName]=n[i.name]=i;this.jsonNames=n}return this.jsonNames[e]}find(e){if(!this.numbers){const n={};for(const i of this.list())n[i.no]=i;this.numbers=n}return this.numbers[e]}list(){return this.all||(this.all=this._normalizer(this._fields)),this.all}byNumber(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort((e,n)=>e.no-n.no)),this.numbersAsc}byMember(){if(!this.members){this.members=[];const e=this.members;let n;for(const i of this.list())i.oneof?i.oneof!==n&&(n=i.oneof,e.push(n)):e.push(i)}return this.members}}function s1(t,e){const n=o1(t);return e?n:GM(KM(n))}function WM(t){return s1(t,!1)}const HM=o1;function o1(t){let e=!1;const n=[];for(let i=0;i<t.length;i++){let r=t.charAt(i);switch(r){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(r),e=!1;break;default:e&&(e=!1,r=r.toUpperCase()),n.push(r);break}}return n.join("")}const $M=new Set(["constructor","toString","toJSON","valueOf"]),qM=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),a1=t=>"".concat(t,"$"),KM=t=>qM.has(t)?a1(t):t,GM=t=>$M.has(t)?a1(t):t;class QM{constructor(e){this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=WM(e)}addField(e){dt(e.oneof===this,"field ".concat(e.name," not one of ").concat(this.name)),this.fields.push(e)}findField(e){if(!this._lookup){this._lookup=Object.create(null);for(let n=0;n<this.fields.length;n++)this._lookup[this.fields[n].localName]=this.fields[n]}return this._lookup[e]}}function JM(t,e){var n,i,r,s,o,a;const l=[];let d;for(const u of typeof t=="function"?t():t){const h=u;if(h.localName=s1(u.name,u.oneof!==void 0),h.jsonName=(n=u.jsonName)!==null&&n!==void 0?n:HM(u.name),h.repeated=(i=u.repeated)!==null&&i!==void 0?i:!1,u.kind=="scalar"&&(h.L=(r=u.L)!==null&&r!==void 0?r:ss.BIGINT),h.delimited=(s=u.delimited)!==null&&s!==void 0?s:!1,h.req=(o=u.req)!==null&&o!==void 0?o:!1,h.opt=(a=u.opt)!==null&&a!==void 0?a:!1,u.packed===void 0&&(h.packed=u.kind=="enum"||u.kind=="scalar"&&u.T!=z.BYTES&&u.T!=z.STRING),u.oneof!==void 0){const p=typeof u.oneof=="string"?u.oneof:u.oneof.name;(!d||d.name!=p)&&(d=new QM(p)),h.oneof=d,d.addField(h)}l.push(h)}return l}const O=zM("proto3",t=>new BM(t,e=>JM(e)),t=>{for(const e of t.getType().fields.byMember()){if(e.opt)continue;const n=e.localName,i=t;if(e.repeated){i[n]=[];continue}switch(e.kind){case"oneof":i[n]={case:void 0};break;case"enum":i[n]=0;break;case"map":i[n]={};break;case"scalar":i[n]=xa(e.T,e.L);break}}});class nn extends Sv{constructor(e){super(),this.seconds=et.zero,this.nanos=0,O.util.initPartial(e,this)}fromJson(e,n){if(typeof e!="string")throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(O.json.debug(e)));const i=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!i)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");const r=Date.parse(i[1]+"-"+i[2]+"-"+i[3]+"T"+i[4]+":"+i[5]+":"+i[6]+(i[8]?i[8]:"Z"));if(Number.isNaN(r))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invali
559d RFC 3339 string");if(r<Date.parse("0001-01-01T00:00:00Z")||r>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=et.parse(r/1e3),this.nanos=0,i[7]&&(this.nanos=parseInt("1"+i[7]+"0".repeat(9-i[7].length))-1e9),this}toJson(e){const n=Number(this.seconds)*1e3;if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(this.nanos<0)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");let i="Z";if(this.nanos>0){const r=(this.nanos+1e9).toString().substring(1);r.substring(3)==="000000"?i="."+r.substring(0,3)+"Z":r.substring(6)==="000"?i="."+r.substring(0,6)+"Z":i="."+r+"Z"}return new Date(n).toISOString().replace(".000Z",i)}toDate(){return new Date(Number(this.seconds)*1e3+Math.ceil(this.nanos/1e6))}static now(){return nn.fromDate(new Date)}static fromDate(e){const n=e.getTime();return new nn({seconds:et.parse(Math.floor(n/1e3)),nanos:n%1e3*1e6})}static fromBinary(e,n){return new nn().fromBinary(e,n)}static fromJson(e,n){return new nn().fromJson(e,n)}static fromJsonString(e,n){return new nn().fromJsonString(e,n)}static equals(e,n){return O.util.equals(nn,e,n)}}nn.runtime=O;nn.typeName="google.protobuf.Timestamp";nn.fields=O.util.newFieldList(()=>[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]);const YM=O.makeMessageType("livekit.MetricsBatch",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:nn},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:XM,repeated:!0},{no:5,name:"events",kind:"message",T:e3,repeated:!0}]),XM=O.makeMessageType("livekit.TimeSeriesMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:ZM,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}]),ZM=O.makeMessageType("livekit.MetricSample",()=>[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:nn},{no:3,name:"value",kind:"scalar",T:2}]),e3=O.makeMessageType("livekit.EventMetric",()=>[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:nn},{no:7,name:"normalized_end_timestamp",kind:"message",T:nn,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}]),c1=O.makeEnum("livekit.BackupCodecPolicy",[{no:0,name:"PREFER_REGRESSION"},{no:1,name:"SIMULCAST"},{no:2,name:"REGRESSION"}]),Gn=O.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),pt=O.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),Cv=O.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),ec=O.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),zc=O.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),Xn=O.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"},{no:13,name:"SIP_TRUNK_FAILURE"},{no:14,name:"CONNECTION_TIMEOUT"},{no:15,name:"MEDIA_FAILURE"}]),ho=O.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),t3=O.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}
vendor: 8,704 bytes, line 559
559]),Ct=O.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"},{no:6,name:"TF_PRECONNECT_BUFFER"}]),lh=O.makeMessageType("livekit.Room",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:15,name:"creation_time_ms",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:yu,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:k1}]),yu=O.makeMessageType("livekit.Codec",()=>[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}]),n3=O.makeMessageType("livekit.ParticipantPermission",()=>[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:O.getEnumType(pt),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8}]),Gs=O.makeMessageType("livekit.ParticipantInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:O.getEnumType(Wo)},{no:4,name:"tracks",kind:"message",T:Po,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:17,name:"joined_at_ms",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:n3},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:O.getEnumType(Bc)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:O.getEnumType(Xn)},{no:18,name:"kind_details",kind:"enum",T:O.getEnumType(i3),repeated:!0}]),Wo=O.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),Bc=O.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"}]),i3=O.makeEnum("livekit.ParticipantInfo.KindDetail",[{no:0,name:"CLOUD_AGENT"},{no:1,name:"FORWARDED"}]),gn=O.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),r3=O.makeMessageType("livekit.SimulcastCodecInfo",()=>[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:Ds,repeated:!0}]),Po=O.makeMessageType("livekit.TrackInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:O.getEnumType(Gn)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:O.getEnumType(pt)},{no:10,name:"layers",kind:"message",T:Ds,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:r3,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:O.getEnumType(gn)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:k1},{no:19,name:"audio_features",kind:"enum",T:O.getEnumType(Ct),repeated:!0},{no:20,name:"backup_codec_policy",kind:"enum",T:O.getEnumType(c1)}]),Ds=O.makeMessageType("livekit.VideoLayer",()=>[{no:1,name:"quality",kind:"enum",T:O.getEnumType(Cv)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13},{no:6,name:"spatial_layer",kind:"scalar",T:5},{no:7,name:"rid",kind:"scalar",T:9}]),rn=O.makeMessageType("livekit.DataPacket",()=>[{no:1,name:"kind",kind:"enum",T:O.getEnumType(xe)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:d1,oneof:"value"},{no:3,name:"speaker",kind:"message",T:s3,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:u1,oneof:"value"},{no:7,name:"transcription",kind:"message",T:o3,oneof:"value"},{no:8,name:"metrics",kind:"message",T:YM,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:om,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:h1,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:f1,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:p1,oneof:"value"},{no:13,name:"stream_header",kind:"message",T:cm,oneof:"value"},{no:14,name:"stream_chunk",kind:"message",T:lm,oneof:"value"},{no:15,name:"stream_trailer",kind:"message",T:dm,oneof:"value"},{no:16,name:"sequence",kind:"scalar",T:13},{no:17,name:"participant_sid",kind:"scalar",T:9}]),xe=O.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),s3=O.makeMessageType("livekit.ActiveSpeakerUpdate",()=>[{no:1,name:"speakers",kind:"message",T:l1,repeated:!0}]),l1=O.makeMessageType("livekit.SpeakerInfo",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}]),d1=O.makeMessageType("livekit.UserPacket",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0},{no:11,name:"nonce",kind:"scalar",T:12}]),u1=O.makeMessageType("livekit.SipDTMF",()=>[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}]),o3=O.makeMessageType("livekit.Transcription",()=>[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:a3,repeated:!0}]),a3=O.makeMessageType("livekit.TranscriptionSegment",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}]),om=O.makeMessageType("livekit.ChatMessage",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}]),h1=O.makeMessageType("livekit.RpcRequest",()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13}]),f1=O.makeMessageType("livekit.RpcAck",()=>[{no:1,name:"request_id",kind:"scalar",T:9}]),p1=O.makeMessageType("livekit.RpcResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:m1,oneof:"value"}]),m1=O.makeMessageType("livekit.RpcError",()=>[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}]),g1=O.makeMessageType("livekit.ParticipantTracks",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}]),v1=O.makeMessageType("livekit.ServerInfo",()=>[{no:1,name:"edition",kind:"enum",T:O.getEnumType(y1)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}]),y1=O.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),c3=O.makeMessageType("livekit.ClientInfo",()=>
vendor: 16,384 bytes, line 559
559[{no:1,name:"sdk",kind:"enum",T:O.getEnumType(b1)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9}]),b1=O.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"},{no:13,name:"UNREAL"},{no:14,name:"ESP32"}]),x1=O.makeMessageType("livekit.ClientConfiguration",()=>[{no:1,name:"video",kind:"message",T:Ab},{no:2,name:"screen",kind:"message",T:Ab},{no:3,name:"resume_connection",kind:"enum",T:O.getEnumType(zc)},{no:4,name:"disabled_codecs",kind:"message",T:l3},{no:5,name:"force_relay",kind:"enum",T:O.getEnumType(zc)}]),Ab=O.makeMessageType("livekit.VideoConfiguration",()=>[{no:1,name:"hardware_encoder",kind:"enum",T:O.getEnumType(zc)}]),l3=O.makeMessageType("livekit.DisabledCodecs",()=>[{no:1,name:"codecs",kind:"message",T:yu,repeated:!0},{no:2,name:"publish",kind:"message",T:yu,repeated:!0}]),k1=O.makeMessageType("livekit.TimedVersion",()=>[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]),am=O.makeEnum("livekit.DataStream.OperationType",[{no:0,name:"CREATE"},{no:1,name:"UPDATE"},{no:2,name:"DELETE"},{no:3,name:"REACTION"}]),S1=O.makeMessageType("livekit.DataStream.TextHeader",()=>[{no:1,name:"operation_type",kind:"enum",T:O.getEnumType(am)},{no:2,name:"version",kind:"scalar",T:5},{no:3,name:"reply_to_stream_id",kind:"scalar",T:9},{no:4,name:"attached_stream_ids",kind:"scalar",T:9,repeated:!0},{no:5,name:"generated",kind:"scalar",T:8}],{localName:"DataStream_TextHeader"}),w1=O.makeMessageType("livekit.DataStream.ByteHeader",()=>[{no:1,name:"name",kind:"scalar",T:9}],{localName:"DataStream_ByteHeader"}),cm=O.makeMessageType("livekit.DataStream.Header",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"topic",kind:"scalar",T:9},{no:4,name:"mime_type",kind:"scalar",T:9},{no:5,name:"total_length",kind:"scalar",T:4,opt:!0},{no:7,name:"encryption_type",kind:"enum",T:O.getEnumType(gn)},{no:8,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:9,name:"text_header",kind:"message",T:S1,oneof:"content_header"},{no:10,name:"byte_header",kind:"message",T:w1,oneof:"content_header"}],{localName:"DataStream_Header"}),lm=O.makeMessageType("livekit.DataStream.Chunk",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"chunk_index",kind:"scalar",T:4},{no:3,name:"content",kind:"scalar",T:12},{no:4,name:"version",kind:"scalar",T:5},{no:5,name:"iv",kind:"scalar",T:12,opt:!0}],{localName:"DataStream_Chunk"}),dm=O.makeMessageType("livekit.DataStream.Trailer",()=>[{no:1,name:"stream_id",kind:"scalar",T:9},{no:2,name:"reason",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}}],{localName:"DataStream_Trailer"}),Qn=O.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),um=O.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),d3=O.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),u3=O.makeMessageType("livekit.SignalRequest",()=>[{no:1,name:"offer",kind:"message",T:Qs,oneof:"message"},{no:2,name:"answer",kind:"message",T:Qs,oneof:"message"},{no:3,name:"trickle",kind:"message",T:Tv,oneof:"message"},{no:4,name:"add_track",kind:"message",T:fm,oneof:"message"},{no:5,name:"mute",kind:"message",T:_v,oneof:"message"},{no:6,name:"subscription",kind:"message",T:dh,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:C1,oneof:"message"},{no:8,name:"leave",kind:"message",T:uh,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:_1,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:N1,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:I1,oneof:"message"},{no:13,name:"simulate",kind:"message",T:ci,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:E1,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:O1,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:T1,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:g3,oneof:"message"}]),Ob=O.makeMessageType("livekit.SignalResponse",()=>[{no:1,name:"join",kind:"message",T:h3,oneof:"message"},{no:2,name:"answer",kind:"message",T:Qs,oneof:"message"},{no:3,name:"offer",kind:"message",T:Qs,oneof:"message"},{no:4,name:"trickle",kind:"message",T:Tv,oneof:"message"},{no:5,name:"update",kind:"message",T:m3,oneof:"message"},{no:6,name:"track_published",kind:"message",T:Ev,oneof:"message"},{no:8,name:"leave",kind:"message",T:uh,oneof:"message"},{no:9,name:"mute",kind:"message",T:_v,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:v3,oneof:"message"},{no:11,name:"room_update",kind:"message",T:y3,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:x3,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:S3,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:C3,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:T3,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:p3,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:f3,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:E3,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:N3,oneof:"message"},{no:22,name:"request_response",kind:"message",T:I3,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:j3,oneof:"message"},{no:24,name:"room_moved",kind:"message",T:_3,oneof:"message"}]),hm=O.makeMessageType("livekit.SimulcastCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}]),fm=O.makeMessageType("livekit.AddTrackRequest",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:O.getEnumType(Gn)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:O.getEnumType(pt)},{no:9,name:"layers",kind:"message",T:Ds,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:hm,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:O.getEnumType(gn)},{no:15,name:"stream",kind:"scalar",T:9},{no:16,name:"backup_codec_policy",kind:"enum",T:O.getEnumType(c1)},{no:17,name:"audio_features",kind:"enum",T:O.getEnumType(Ct),repeated:!0}]),Tv=O.makeMessageType("livekit.TrickleRequest",()=>[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:O.getEnumType(Qn)},{no:3,name:"final",kind:"scalar",T:8}]),_v=O.makeMessageType("livekit.MuteTrackRequest",()=>[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}]),h3=O.makeMessageType("livekit.JoinResponse",()=>[{no:1,name:"room",kind:"message",T:lh},{no:2,name:"participant",kind:"message",T:Gs},{no:3,name:"other_participants",kind:"message",T:Gs,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:P1,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:x1},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:v1},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:yu,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}]),f3=O.makeMessageType("livekit.ReconnectResponse",()=>[{no:1,name:"ice_servers",kind:"message",T:P1,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:x1},{no:3,name:"server_info",kind:"message",T:v1},{no:4,name:"last_message_seq",kind:"scalar",T:13}]),Ev=O.makeMessageType("livekit.TrackPublishedResponse",()=>[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:Po}]),p3=O.makeMessageType("livekit.TrackUnpublishedResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]),Qs=O.makeMessageType("livekit.SessionDescription",()=>[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9},{no:3,name:"id",kind:"scalar",T:13}]),m3=O.makeMessageType("livekit.ParticipantUpdate",()=>[{no:1,name:"participants",kind:"message",T:Gs,repeated:!0}]),dh=O.makeMessageType("livekit.UpdateSubscription",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:g1,repeated:!0}]),C1=O.makeMessageType("livekit.UpdateTrackSettings",()=>[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:O.getEnumType(Cv)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}]),T1=O.makeMessageType("livekit.UpdateLocalAudioTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:O.getEnumType(Ct),repeated:!0}]),g3=O.makeMessageType("livekit.UpdateLocalVideoTrack",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}]),uh=O.makeMessageType("livekit.LeaveRequest",()=>[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:O.getEnumType(Xn)},{no:3,name:"action",kind:"enum",T:O.getEnumType(Ho)},{no:4,name:"regions",kind:"message",T:P3}]),Ho=O.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),_1=O.makeMessageType("livekit.UpdateVideoLayers",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:Ds,repeated:!0}]),E1=O.makeMessageType("livekit.UpdateParticipantMetadata",()=>[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}]),P1=O.makeMessageType("livekit.ICEServer",()=>[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]),v3=O.makeMessageType("livekit.SpeakersChanged",()=>[{no:1,name:"speakers",kind:"message",T:l1,repeated:!0}]),y3=O.makeMessageType("livekit.RoomUpdate",()=>[{no:1,name:"room",kind:"message",T:lh}]),b3=O.makeMessageType("livekit.ConnectionQualityInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:O.getEnumType(ec)},{no:3,name:"score",kind:"scalar",T:2}]),x3=O.makeMessageType("livekit.ConnectionQualityUpdate",()=>[{no:1,name:"updates",kind:"message",T:b3,repeated:!0}]),k3=O.makeMessageType("livekit.StreamStateInfo",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:O.getEnumType(um)}]),S3=O.makeMessageType("livekit.StreamStateUpdate",()=>[{no:1,name:"stream_states",kind:"message",T:k3,repeated:!0}]),Pv=O.makeMessageType("livekit.SubscribedQuality",()=>[{no:1,name:"quality",kind:"enum",T:O.getEnumType(Cv)},{no:2,name:"enabled",kind:"scalar",T:8}]),w3=O.makeMessageType("livekit.SubscribedCodec",()=>[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:Pv,repeated:!0}]),C3=O.makeMessageType("livekit.SubscribedQualityUpdate",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:Pv,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:w3,repeated:!0}]),R1=O.makeMessageType("livekit.TrackPermission",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}]),N1=O.makeMessageType("livekit.SubscriptionPermission",()=>[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:R1,repeated:!0}]),T3=O.makeMessageType("livekit.SubscriptionPermissionUpdate",()=>[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}]),_3=O.makeMessageType("livekit.RoomMovedResponse",()=>[{no:1,name:"room",kind:"message",T:lh},{no:2,name:"token",kind:"scalar",T:9},{no:3,name:"participant",kind:"message",T:Gs},{no:4,name:"other_participants",kind:"message",T:Gs,repeated:!0}]),I1=O.makeMessageType("livekit.SyncState",()=>[{no:1,name:"answer",kind:"message",T:Qs},{no:2,name:"subscription",kind:"message",T:dh},{no:3,name:"publish_tracks",kind:"message",T:Ev,repeated:!0},{no:4,name:"data_channels",kind:"message",T:A1,repeated:!0},{no:5,name:"offer",kind:"message",T:Qs},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0},{no:7,name:"datachannel_receive_states",kind:"message",T:j1,repeated:!0}]),j1=O.makeMessageType("livekit.DataChannelReceiveState",()=>[{no:1,name:"publisher_sid",kind:"scalar",T:9},{no:2,name:"last_seq",kind:"scalar",T:13}]),A1=O.makeMessageType("livekit.DataChannelInfo",()=>[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:O.getEnumType(Qn)}]),ci=O.makeMessageType("livekit.SimulateScenario",()=>[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:O.getEnumType(d3),oneof:"scenario"},{no:6,name:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}]),O1=O.makeMessageType("livekit.Ping",()=>[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}]),E3=O.makeMessageType("livekit.Pong",()=>[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}]),P3=O.makeMessageType("livekit.RegionSettings",()=>[{no:1,name:"regions",kind:"message",T:R3,repeated:!0}]),R3=O.makeMessageType("livekit.RegionInfo",()=>[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}]),N3=O.makeMessageType("livekit.SubscriptionResponse",()=>[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:O.getEnumType(t3)}]),I3=O.makeMessageType("livekit.RequestResponse",()=>[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:O.getEnumType(Rv)},{no:3,name:"message",kind:"scalar",T:9}]),Rv=O.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"}]),j3=O.makeMessageType("livekit.TrackSubscribed",()=>[{no:1,name:"track_sid",kind:"scalar",T:9}]);function A3(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _d={exports:{}},O3=_d.exports,Db;function D3(){return Db||(Db=1,function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(O3,function(){var e=function(){},n="undefined",i=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],s={},o=null;function a(m,k){var v=m[k];if(typeof v.bind=="function")return v.bind(m);try{return Function.prototype.bind.call(v,m)}catch{return function(){return Function.prototype.apply.apply(v,[m,
vendor: 8,734 bytes, line 559
559arguments])}}}function l(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function d(m){return m==="debug"&&(m="log"),typeof console===n?!1:m==="trace"&&i?l:console[m]!==void 0?a(console,m):console.log!==void 0?a(console,"log"):e}function u(){for(var m=this.getLevel(),k=0;k<r.length;k++){var v=r[k];this[v]=k<m?e:this.methodFactory(v,m,this.name)}if(this.log=this.debug,typeof console===n&&m<this.levels.SILENT)return"No console available for logging"}function h(m){return function(){typeof console!==n&&(u.call(this),this[m].apply(this,arguments))}}function p(m,k,v){return d(m)||h.apply(this,arguments)}function g(m,k){var v=this,y,x,S,w="loglevel";typeof m=="string"?w+=":"+m:typeof m=="symbol"&&(w=void 0);function C(L){var j=(r[L]||"silent").toUpperCase();if(!(typeof window===n||!w)){try{window.localStorage[w]=j;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+j+";"}catch{}}}function R(){var L;if(!(typeof window===n||!w)){try{L=window.localStorage[w]}catch{}if(typeof L===n)try{var j=window.document.cookie,Z=encodeURIComponent(w),F=j.indexOf(Z+"=");F!==-1&&(L=/^([^;]+)/.exec(j.slice(F+Z.length+1))[1])}catch{}return v.levels[L]===void 0&&(L=void 0),L}}function P(){if(!(typeof window===n||!w)){try{window.localStorage.removeItem(w)}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function N(L){var j=L;if(typeof j=="string"&&v.levels[j.toUpperCase()]!==void 0&&(j=v.levels[j.toUpperCase()]),typeof j=="number"&&j>=0&&j<=v.levels.SILENT)return j;throw new TypeError("log.setLevel() called with invalid level: "+L)}v.name=m,v.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},v.methodFactory=k||p,v.getLevel=function(){return S??x??y},v.setLevel=function(L,j){return S=N(L),j!==!1&&C(S),u.call(v)},v.setDefaultLevel=function(L){x=N(L),R()||v.setLevel(L,!1)},v.resetLevel=function(){S=null,P(),u.call(v)},v.enableAll=function(L){v.setLevel(v.levels.TRACE,L)},v.disableAll=function(L){v.setLevel(v.levels.SILENT,L)},v.rebuild=function(){if(o!==v&&(y=N(o.getLevel())),u.call(v),o===v)for(var L in s)s[L].rebuild()},y=N(o?o.getLevel():"WARN");var I=R();I!=null&&(S=N(I)),u.call(v)}o=new g,o.getLogger=function(k){if(typeof k!="symbol"&&typeof k!="string"||k==="")throw new TypeError("You must supply a name when creating a logger.");var v=s[k];return v||(v=s[k]=new g(k,o.methodFactory)),v};var b=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=b),o},o.getLoggers=function(){return s},o.default=o,o})}(_d)),_d.exports}var hh=D3(),pm;(function(t){t[t.trace=0]="trace",t[t.debug=1]="debug",t[t.info=2]="info",t[t.warn=3]="warn",t[t.error=4]="error",t[t.silent=5]="silent"})(pm||(pm={}));var ri;(function(t){t.Default="livekit",t.Room="livekit-room",t.Participant="livekit-participant",t.Track="livekit-track",t.Publication="livekit-track-publication",t.Engine="livekit-engine",t.Signal="livekit-signal",t.PCManager="livekit-pc-manager",t.PCTransport="livekit-pc-transport",t.E2EE="lk-e2ee"})(ri||(ri={}));let ke=hh.getLogger("livekit");Object.values(ri).map(t=>hh.getLogger(t));ke.setDefaultLevel(pm.info);function rr(t){const e=hh.getLogger(t);return e.setDefaultLevel(ke.getLevel()),e}const L3=hh.getLogger("lk-e2ee"),Wa=7e3,M3=[0,300,2*2*300,3*3*300,4*4*300,Wa,Wa,Wa,Wa,Wa];class U3{constructor(e){this._retryDelays=e!==void 0?[...e]:M3}nextRetryDelayInMs(e){if(e.retryCount>=this._retryDelays.length)return null;const n=this._retryDelays[e.retryCount];return e.retryCount<=1?n:n+Math.random()*1e3}}function F3(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function E(t,e,n,i){function r(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{d(i.next(u))}catch(h){o(h)}}function l(u){try{d(i.throw(u))}catch(h){o(h)}}function d(u){u.done?s(u.value):r(u.value).then(a,l)}d((i=i.apply(t,e||[])).next())})}function Lb(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Hi(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Lb=="function"?Lb(t):t[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(s){n[s]=t[s]&&function(o){return new Promise(function(a,l){o=t[s](o),r(a,l,o.done,o.value)})}}function r(s,o,a,l){Promise.resolve(l).then(function(d){s({value:d,done:a})},o)}}var Yl={exports:{}},Mb;function V3(){if(Mb)return Yl.exports;Mb=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(w,C,R){return Function.prototype.apply.call(w,C,R)},n;t&&typeof t.ownKeys=="function"?n=t.ownKeys:Object.getOwnPropertySymbols?n=function(w){return Object.getOwnPropertyNames(w).concat(Object.getOwnPropertySymbols(w))}:n=function(w){return Object.getOwnPropertyNames(w)};function i(S){console&&console.warn&&console.warn(S)}var r=Number.isNaN||function(w){return w!==w};function s(){s.init.call(this)}Yl.exports=s,Yl.exports.once=v,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(S){if(typeof S!="number"||S<0||r(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");o=S}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(w){if(typeof w!="number"||w<0||r(w))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+w+".");return this._maxListeners=w,this};function l(S){return S._maxListeners===void 0?s.defaultMaxListeners:S._maxListeners}s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(w){for(var C=[],R=1;R<arguments.length;R++)C.push(arguments[R]);var P=w==="error",N=this._events;if(N!==void 0)P=P&&N.error===void 0;else if(!P)return!1;if(P){var I;if(C.length>0&&(I=C[0]),I instanceof Error)throw I;var L=new Error("Unhandled error."+(I?" ("+I.message+")":""));throw L.context=I,L}var j=N[w];if(j===void 0)return!1;if(typeof j=="function")e(j,this,C);else for(var Z=j.length,F=b(j,Z),R=0;R<Z;++R)e(F[R],this,C);return!0};function d(S,w,C,R){var P,N,I;if(a(C),N=S._events,N===void 0?(N=S._events=Object.create(null),S._eventsCount=0):(N.newListener!==void 0&&(S.emit("newListener",w,C.listener?C.listener:C),N=S._events),I=N[w]),I===void 0)I=N[w]=C,++S._eventsCount;else if(typeof I=="function"?I=N[w]=R?[C,I]:[I,C]:R?I.unshift(C):I.push(C),P=l(S),P>0&&I.length>P&&!I.warned){I.warned=!0;var L=new Error("Possible EventEmitter memory leak detected. "+I.length+" "+String(w)+" listeners added. Use emitter.setMaxListeners() to increase limit");L.name="MaxListenersExceededWarning",L.emitter=S,L.type=w,L.count=I.length,i(L)}return S}s.prototype.addListener=function(w,C){return d(this,w,C,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(w,C){return d(this,w,C,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(S,w,C){var R={fired:!1,wrapFn:void 0,target:S,type:w,listener:C},P=u.bind(R);return P.listener=C,R.wrapFn=P,P}s.prototype.once=function(w,C){return a(C),this.on(w,h(this,w,C)),this},s.prototype.prependOnceListener=function(w,C){return a(C),this.prependListener(w,h(this,w,C)),this},s.prototype.removeListener=function(w,C){var R,P,N,I,L;if(a(C),P=this._events,P===void 0)return this;if(R=P[w],R===void 0)return this;if(R===C||R.listener===C)--this._eventsCount===0?this._events=Object.create(null):(delete P[w],P.removeListener&&this.emit
vendor: 48,380 bytes, lines 559-590
559("removeListener",w,R.listener||C));else if(typeof R!="function"){for(N=-1,I=R.length-1;I>=0;I--)if(R[I]===C||R[I].listener===C){L=R[I].listener,N=I;break}if(N<0)return this;N===0?R.shift():m(R,N),R.length===1&&(P[w]=R[0]),P.removeListener!==void 0&&this.emit("removeListener",w,L||C)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(w){var C,R,P;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[w]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[w]),this;if(arguments.length===0){var N=Object.keys(R),I;for(P=0;P<N.length;++P)I=N[P],I!=="removeListener"&&this.removeAllListeners(I);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(C=R[w],typeof C=="function")this.removeListener(w,C);else if(C!==void 0)for(P=C.length-1;P>=0;P--)this.removeListener(w,C[P]);return this};function p(S,w,C){var R=S._events;if(R===void 0)return[];var P=R[w];return P===void 0?[]:typeof P=="function"?C?[P.listener||P]:[P]:C?k(P):b(P,P.length)}s.prototype.listeners=function(w){return p(this,w,!0)},s.prototype.rawListeners=function(w){return p(this,w,!1)},s.listenerCount=function(S,w){return typeof S.listenerCount=="function"?S.listenerCount(w):g.call(S,w)},s.prototype.listenerCount=g;function g(S){var w=this._events;if(w!==void 0){var C=w[S];if(typeof C=="function")return 1;if(C!==void 0)return C.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function b(S,w){for(var C=new Array(w),R=0;R<w;++R)C[R]=S[R];return C}function m(S,w){for(;w+1<S.length;w++)S[w]=S[w+1];S.pop()}function k(S){for(var w=new Array(S.length),C=0;C<w.length;++C)w[C]=S[C].listener||S[C];return w}function v(S,w){return new Promise(function(C,R){function P(I){S.removeListener(w,N),R(I)}function N(){typeof S.removeListener=="function"&&S.removeListener("error",P),C([].slice.call(arguments))}x(S,w,N,{once:!0}),w!=="error"&&y(S,P,{once:!0})})}function y(S,w,C){typeof S.on=="function"&&x(S,"error",w,C)}function x(S,w,C,R){if(typeof S.on=="function")R.once?S.once(w,C):S.on(w,C);else if(typeof S.addEventListener=="function")S.addEventListener(w,function P(N){R.once&&S.removeEventListener(w,P),C(N)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}return Yl.exports}var Ni=V3();let D1=!0,L1=!0;function tc(t,e,n){const i=t.match(e);return i&&i.length>=n&&parseFloat(i[n],10)}function ro(t,e,n){if(!t.RTCPeerConnection)return;const i=t.RTCPeerConnection.prototype,r=i.addEventListener;i.addEventListener=function(o,a){if(o!==e)return r.apply(this,arguments);const l=d=>{const u=n(d);u&&(a.handleEvent?a.handleEvent(u):a(u))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(a,l),r.apply(this,[o,l])};const s=i.removeEventListener;i.removeEventListener=function(o,a){if(o!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(a))return s.apply(this,arguments);const l=this._eventMap[e].get(a);return this._eventMap[e].delete(a),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,l])},Object.defineProperty(i,"on"+e,{get(){return this["_on"+e]},set(o){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),o&&this.addEventListener(e,this["_on"+e]=o)},enumerable:!0,configurable:!0})}function z3(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(D1=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function B3(t){return typeof t!="boolean"?new Error("Argument type: "+typeof t+". Please use a boolean."):(L1=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function M1(){if(typeof window=="object"){if(D1)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Nv(t,e){L1&&console.warn(t+" is deprecated, please use "+e+" instead.")}function W3(t){const e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;const{navigator:n}=t;if(n.userAgentData&&n.userAgentData.brands){const i=n.userAgentData.brands.find(r=>r.brand==="Chromium");if(i)return{browser:"chrome",version:parseInt(i.version,10)}}if(n.mozGetUserMedia)e.browser="firefox",e.version=parseInt(tc(n.userAgent,/Firefox\/(\d+)\./,1));else if(n.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=parseInt(tc(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2));else if(t.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=parseInt(tc(n.userAgent,/AppleWebKit\/(\d+)\./,1)),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype,e._safariVersion=tc(n.userAgent,/Version\/(\d+(\.?\d+))/,1);else return e.browser="Not a supported browser.",e;return e}function Ub(t){return Object.prototype.toString.call(t)==="[object Object]"}function U1(t){return Ub(t)?Object.keys(t).reduce(function(e,n){const i=Ub(t[n]),r=i?U1(t[n]):t[n],s=i&&!Object.keys(r).length;return r===void 0||s?e:Object.assign(e,{[n]:r})},{}):t}function mm(t,e,n){!e||n.has(e.id)||(n.set(e.id,e),Object.keys(e).forEach(i=>{i.endsWith("Id")?mm(t,t.get(e[i]),n):i.endsWith("Ids")&&e[i].forEach(r=>{mm(t,t.get(r),n)})}))}function Fb(t,e,n){const i=n?"outbound-rtp":"inbound-rtp",r=new Map;if(e===null)return r;const s=[];return t.forEach(o=>{o.type==="track"&&o.trackIdentifier===e.id&&s.push(o)}),s.forEach(o=>{t.forEach(a=>{a.type===i&&a.trackId===o.id&&mm(t,a,r)})}),r}const Vb=M1;function F1(t,e){const n=t&&t.navigator;if(!n.mediaDevices)return;const i=function(a){if(typeof a!="object"||a.mandatory||a.optional)return a;const l={};return Object.keys(a).forEach(d=>{if(d==="require"||d==="advanced"||d==="mediaSource")return;const u=typeof a[d]=="object"?a[d]:{ideal:a[d]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const h=function(p,g){return p?p+g.charAt(0).toUpperCase()+g.slice(1):g==="deviceId"?"sourceId":g};if(u.ideal!==void 0){l.optional=l.optional||[];let p={};typeof u.ideal=="number"?(p[h("min",d)]=u.ideal,l.optional.push(p),p={},p[h("max",d)]=u.ideal,l.optional.push(p)):(p[h("",d)]=u.ideal,l.optional.push(p))}u.exact!==void 0&&typeof u.exact!="number"?(l.mandatory=l.mandatory||{},l.mandatory[h("",d)]=u.exact):["min","max"].forEach(p=>{u[p]!==void 0&&(l.mandatory=l.mandatory||{},l.mandatory[h(p,d)]=u[p])})}),a.advanced&&(l.optional=(l.optional||[]).concat(a.advanced)),l},r=function(a,l){if(e.version>=61)return l(a);if(a=JSON.parse(JSON.stringify(a)),a&&typeof a.audio=="object"){const d=function(u,h,p){h in u&&!(p in u)&&(u[p]=u[h],delete u[h])};a=JSON.parse(JSON.stringify(a)),d(a.audio,"autoGainControl","googAutoGainControl"),d(a.audio,"noiseSuppression","googNoiseSuppression"),a.audio=i(a.audio)}if(a&&typeof a.video=="object"){let d=a.video.facingMode;d=d&&(typeof d=="object"?d:{ideal:d});const u=e.version<66;if(d&&(d.exact==="user"||d.exact==="environment"||d.ideal==="user"||d.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete a.video.facingMode;let h;if(d.exact==="environment"||d.ideal==="environment"?h=["back","rear"]:(d.exact==="user"||d.ideal==="user")&&(h=["front"]),h)return n.mediaDevices.enumerateDevices().then(p=>{p=p.filter(b=>b.kind==="videoinput");let g=p.find(b=>h.some(m=>b.label.toLowerCase().includes(m)));return!g&&p.length&&h.includes("back")&&(g=p[p.length-1]),g&&(a.video.deviceId=d.exact?{exact:g.deviceId}:{ideal:g.deviceId}),a.video=i(a.video),Vb("chrome: "+JSON.stringify(a)),l(a)})}a.video=i(a.video)}return Vb("chrome: "+JSON.stringify(a)),l(a)},s=function(a){return e.version>=64?a:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[a.name]||a.name,message:a.message,constraint:a.constraint||a.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},o=function(a,l,d){r(a,u=>{n.webkitGetUserMedia(u,l,h=>{d&&d(s(h))})})};if(n.getUserMedia=o.bind(n),n.mediaDevices.getUserMedia){const a=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(l){return r(l,d=>a(d).then(u=>{if(d.audio&&!u.getAudioTracks().length||d.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(h=>{h.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(s(u))))}}}function V1(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function z1(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("ontrack"in t.RTCPeerConnection.prototype)){Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(n){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=n)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=i=>{i.stream.addEventListener("addtrack",r=>{let s;t.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(a=>a.track&&a.track.id===r.track.id):s={track:r.track};const o=new Event("track");o.track=r.track,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)}),i.stream.getTracks().forEach(r=>{let s;t.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(a=>a.track&&a.track.id===r.id):s={track:r};const o=new Event("track");o.track=r,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else ro(t,"track",e=>(e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e))}function B1(t){if(typeof t=="object"&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(r,s){return{track:s,get dtmf(){return this._dtmf===void 0&&(s.kind==="audio"?this._dtmf=r.createDTMFSender(s):this._dtmf=null),this._dtmf},_pc:r}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const r=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(a,l){let d=r.apply(this,arguments);return d||(d=e(this,a),this._senders.push(d)),d};const s=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(a){s.apply(this,arguments);const l=this._senders.indexOf(a);l!==-1&&this._senders.splice(l,1)}}const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(s){this._senders=this._senders||[],n.apply(this,[s]),s.getTracks().forEach(o=>{this._senders.push(e(this,o))})};const i=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(s){this._senders=this._senders||[],i.apply(this,[s]),s.getTracks().forEach(o=>{const a=this._senders.find(l=>l.track===o);a&&this._senders.splice(this._senders.indexOf(a),1)})}}else if(typeof t=="object"&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const i=e.apply(this,[]);return i.forEach(r=>r._pc=this),i},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function W1(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const n=t.RTCPeerConnection.prototype.getSenders;n&&(t.RTCPeerConnection.prototype.getSenders=function(){const s=n.apply(this,[]);return s.forEach(o=>o._pc=this),s});const i=t.RTCPeerConnection.prototype.addTrack;i&&(t.RTCPeerConnection.prototype.addTrack=function(){const s=i.apply(this,arguments);return s._pc=this,s}),t.RTCRtpSender.prototype.getStats=function(){const s=this;return this._pc.getStats().then(o=>Fb(o,s.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const n=t.RTCPeerConnection.prototype.getReceivers;n&&(t.RTCPeerConnection.prototype.getReceivers=function(){const r=n.apply(this,[]);return r.forEach(s=>s._pc=this),r}),ro(t,"track",i=>(i.receiver._pc=i.srcElement,i)),t.RTCRtpReceiver.prototype.getStats=function(){const r=this;return this._pc.getStats().then(s=>Fb(s,r.track,!1))}}if(!("getStats"in t.RTCRtpSender.prototype&&"getStats"in t.RTCRtpReceiver.prototype))return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const i=arguments[0];let r,s,o;return this.getSenders().forEach(a=>{a.track===i&&(r?o=!0:r=a)}),this.getReceivers().forEach(a=>(a.track===i&&(s?o=!0:s=a),a.track===i)),o||r&&s?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):r?r.getStats():s?s.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function H1(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(o=>this._shimmedLocalStreams[o][0])};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(o,a){if(!a)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const l=e.apply(this,arguments);return this._shimmedLocalStreams[a.id]?this._shimmedLocalStreams[a.id].indexOf(l)===-1&&this._shimmedLocalStreams[a.id].push(l):this._shimmedLocalStreams[a.id]=[a,l],l};const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(o){this._shimmedLocalStreams=this._shimmedLocalStreams||{},o.getTracks().forEach(d=>{if(this.getSenders().find(h=>h.track===d))throw new DOMException("Track already exists.","InvalidAccessError")});const a=this.getSenders();n.apply(this,arguments);const l=this.getSenders().filter(d=>a.indexOf(d)===-1);this._shimmedLocalStreams[o.id]=[o].concat(l)};const i=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[o.id],i.apply(this,arguments)};const r=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},o&&Object.keys(this._shimmedLocalStreams).forEach(a=>{const l=this._shimmedLocalStreams[a].indexOf(o);l!==-1&&this._shimmedLocalStreams[a].splice(l,1),this._shimmedLocalStreams[a].length===1&&delete this._shimmedLocalStreams[a]}),r.apply(this,arguments)}}function $1(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return H1(t);const n=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const u=n.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(h=>this._reverseStreams[h.id])};const i=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(h=>{if(this.getSenders().find(g=>g.track===h))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const h=new t.MediaStream(u.getTracks());this._streams[u.id]=h,this._reverseStreams[h.id]=u,u=h}i.apply(this,[u])};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},r.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},t.RTCPeerConnection.prototype.addTrack=function(u,h){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const p=[].slice.call(arguments,1);if(p.length!==1||!p[0].getTracks().find(m=>m===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(m=>m.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const b=this._streams[h.id];if(b)b.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const m=new t.MediaStream([u]);this._streams[h.id]=m,this._reverseStreams[m.id]=h,this.addStream(m)}return this.getSenders().find(m=>m.track===u)};function s(d,u){let h=u.sdp;return Object.keys(d._reverseStreams||[]).forEach(p=>{const g=d._reverseStreams[p],b=d._streams[g.id];h=h.replace(new RegExp(b.id,"g"),g.id)}),new RTCSessionDescription({type:u.type,sdp:h})}function o(d,u){let h=u.sdp;return Object.keys(d._reverseStreams||[]).forEach(p=>{const g=d._reverseStreams[p],b=d._streams[g.id];h=h.replace(new RegExp(g.id,"g"),b.id)}),new RTCSessionDescription({type:u.type,sdp:h})}["createOffer","createAnswer"].forEach(function(d){const u=t.RTCPeerConnection.prototype[d],h={[d](){const p=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[b=>{const m=s(this,b);p[0].apply(null,[m])},b=>{p[1]&&p[1].apply(null,b)},arguments[2]]):u.apply(this,arguments).then(b=>s(this,b))}};t.RTCPeerConnection.prototype[d]=h[d]});const a=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?a.apply(this,arguments):(arguments[0]=o(this,arguments[0]),a.apply(this,arguments))};const l=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const d=l.get.apply(this);return d.type===""?d:s(this,d)}}),t.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let p;Object.keys(this._streams).forEach(g=>{this._streams[g].getTracks().find(m=>u.track===m)&&(p=this._streams[g])}),p&&(p.getTracks().length===1?this.removeStream(this._reverseStreams[p.id]):p.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function gm(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(n){const i=t.RTCPeerConnection.prototype[n],r={[n](){return arguments[0]=new(n==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}};t.RTCPeerConnection.prototype[n]=r[n]})}function q1(t,e){ro(t,"negotiationneeded",n=>{const i=n.target;if(!((e.version<72||i.getConfiguration&&i.getConfiguration().sdpSemantics==="plan-b")&&i.signalingState!=="stable"))return n})}var zb=Object.freeze({__proto__:null,fixNegotiationNeeded:q1,shimAddTrackRemoveTrack:$1,shimAddTrackRemoveTrackWithNative:H1,shimGetSendersWithDtmf:B1,shimGetUserMedia:F1,shimMediaStream:V1,shimOnTrack:z1,shimPeerConnection:gm,shimSenderReceiverGetStats:W1});function K1(t,e){const n=t&&t.navigator,i=t&&t.MediaStreamTrack;if(n.getUserMedia=function(r,s,o){Nv("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(r).then(s,o)},!(e.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const r=function(o,a,l){a in o&&!(l in o)&&(o[l]=o[a],delete o[a])},s=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(o){return typeof o=="object"&&typeof o.audio=="object"&&(o=JSON.parse(JSON.stringify(o)),r(o.audio,"autoGainControl","mozAutoGainControl"),r(o.audio,"noiseSuppression","mozNoiseSuppression")),s(o)},i&&i.prototype.getSettings){const o=i.prototype.getSettings;i.prototype.getSettings=function(){const a=o.apply(this,arguments);return r(a,"mozAutoGainControl","autoGainControl"),r(a,"mozNoiseSuppression","noiseSuppression"),a}}if(i&&i.prototype.applyConstraints){const o=i.prototype.applyConstraints;i.prototype.applyConstraints=function(a){return this.kind==="audio"&&typeof a=="object"&&(a=JSON.parse(JSON.stringify(a)),r(a,"autoGainControl","mozAutoGainControl"),r(a,"noiseSuppression","mozNoiseSuppression")),o.apply(this,[a])}}}}function H3(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(i){if(!(i&&i.video)){const r=new DOMException("getDisplayMedia without video constraints is undefined");return r.name="NotFoundError",r.code=8,Promise.reject(r)}return i.video===!0?i.video={mediaSource:e}:i.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(i)})}function G1(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function vm(t,e){if(typeof t!="object"||!(t.RTCPeerConnection||t.mozRTCPeerConnection))return;!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(r){const s=t.RTCPeerConnection.prototype[r],o={[r](){return arguments[0]=new(r==="addIceCandidate"?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),s.apply(this,arguments)}};t.RTCPeerConnection.prototype[r]=o[r]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[s,o,a]=arguments;return i.apply(this,[s||null]).then(l=>{if(e.version<53&&!o)try{l.forEach(d=>{d.type=n[d.type]||d.type})}catch(d){if(d.name!=="TypeError")throw d;l.forEach((u,h)=>{l.set(h,Object.assign({},u,{type:n[u.type]||u.type}))})}return l}).then(o,a)}}function Q1(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const r=e.apply(this,[]);return r.forEach(s=>s._pc=this),r});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const r=n.apply(this,arguments);return r._pc=this,r}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function J1(t){if(!(typeof t=="object"&&t.RTCPeerConnection&&t.RTCRtpSender)||t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const i=e.apply(this,[]);return i.forEach(r=>r._pc=this),i}),ro(t,"track",n=>(n.receiver._pc=n.srcElement,n)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function Y1(t){!t.RTCPeerConnection||"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(n){Nv("removeStream","removeTrack"),this.getSenders().forEach(i=>{i.track&&n.getTracks().includes(i.track)&&this.removeTrack(i)})})}function X1(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function Z1(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let i=arguments[1]&&arguments[1].sendEncodings;i===void 0&&(i=[]),i=[...i];const r=i.length>0;r&&i.forEach(o=>{if("rid"in o&&!/^[a-z0-9]{0,16}$/i.test(o.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in o&&!(parseFloat(o.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in o&&!(parseFloat(o.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const s=e.apply(this,arguments);if(r){const{sender:o}=s,a=o.getParameters();(!("encodings"in a)||a.encodings.length===1&&Object.keys(a.encodings[0]).length===0)&&(a.encodings=i,o.sendEncodings=i,this.setParametersPromises.push(o.setParameters(a).then(()=>{delete o.sendEncodings}).catch(()=>{delete o.sendEncodings})))}return s})}function eE(t){if(!(typeof t=="object"&&t.RTCRtpSender))return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const i=e.apply(this,arguments);return"encodings"in i||(i.encodings=[].concat(this.sendEncodings||[{}])),i})}function tE(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function nE(t){if(!(typeof t=="object"&&t.RTCPeerConnection))return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}var Bb=Object.freeze({__proto__:null,shimAddTransceiver:Z1,shimCreateAnswer:nE,shimCreateOffer:tE,shimGetDisplayMedia:H3,shimGetParameters:eE,shimGetUserMedia:K1,shimOnTrack:G1,shimPeerConnection:vm,shimRTCDataChannel:X1,shimReceiverGetStats:J1,shimRemoveStream:Y1,shimSenderGetStats:Q1});function iE(t){if(!(typeof t!="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(i){this._localStreams||(this._localStreams=[]),this._localStreams.includes(i)||this._localStreams.push(i),i.getAudioTracks().forEach(r=>e.call(this,r,i)),i.getVideoTracks().forEach(r=>e.call(this,r,i))},t.RTCPeerConnection.prototype.addTrack=function(i){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];return s&&s.forEach(a=>{this._localStreams?this._localStreams.includes(a)||this._localStreams.push(a):this._localStreams=[a]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(n){this._localStreams||(this._localStreams=[]);const i=this._localStreams.indexOf(n);if(i===-1)return;this._localStreams.splice(i,1);const r=n.getTracks();this.getSenders().forEach(s=>{r.includes(s.track)&&this.removeTrack(s)})})}}function rE(t){if(!(typeof t!="object"||!t.RTCPeerConnection)&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(n){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=n),this.addEventListener("track",this._onaddstreampoly=i=>{i.streams.forEach(r=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(r))return;this._remoteStreams.push(r);const s=new Event("addstream");s.stream=r,this.dispatchEvent(s)})})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const i=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(r){r.streams.forEach(s=>{if(i._remoteStreams||(i._remoteStreams=[]),i._remoteStreams.indexOf(s)>=0)return;i._remoteStreams.push(s);const o=new Event("addstream");o.stream=s,i.dispatchEvent(o)})}),e.apply(i,arguments)}}}function sE(t){if(typeof t!="object"||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,n=e.createOffer,i=e.createAnswer,r=e.setLocalDescription,s=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(d,u){const h=arguments.length>=2?arguments[2]:arguments[0],p=n.apply(this,[h]);return u?(p.then(d,u),Promise.resolve()):p},e.createAnswer=function(d,u){const h=arguments.length>=2?arguments[2]:arguments[0],p=i.apply(this,[h]);return u?(p.then(d,u),Promise.resolve()):p};let a=function(l,d,u){const h=r.apply(this,[l]);return u?(h.then(d,u),Promise.resolve()):h};e.setLocalDescription=a,a=function(l,d,u){const h=s.apply(this,[l]);return u?(h.then(d,u),Promise.resolve()):h},e.setRemoteDescription=a,a=function(l,d,u){const h=o.apply(this,[l]);return u?(h.then(d,u),Promise.resolve()):h},e.addIceCandidate=a}function oE(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const n=e.mediaDevices,i=n.getUserMedia.bind(n);e.mediaDevices.getUserMedia=r=>i(aE(r))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(i,r,s){e.mediaDevices.getUserMedia(i).then(r,s)}).bind(e))}function aE(t){return t&&t.video!==void 0?Object.assign({},t,{video:U1(t.video)}):t}function cE(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(i,r){if(i&&i.iceServers){const s=[];for(let o=0;o<i.iceServers.length;o++){let a=i.iceServers[o];a.urls===void 0&&a.url?(Nv("RTCIceServer.url","RTCIceServer.urls"),a=JSON.parse(JSON.stringify(a)),a.urls=a.url,delete a.url,s.push(a)):s.push(i.iceServers[o])}i.iceServers=s}return new e(i,r)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get(){return e.generateCertificate}})}function lE(t){typeof t=="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function dE(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(i){if(i){typeof i.offerToReceiveAudio<"u"&&(i.offerToReceiveAudio=!!i.offerToReceiveAudio);const r=this.getTransceivers().find(o=>o.receiver.track.kind==="audio");i.offerToReceiveAudio===!1&&r?r.direction==="sendrecv"?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":r.direction==="recvonly"&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):i.offerToReceiveAudio===!0&&!r&&this.addTransceiver("audio",{direction:"recvonly"}),typeof i.offerToReceiveVideo<"u"&&(i.offerToReceiveVideo=!!i.offerToReceiveVideo);const s=this.getTransceivers().find(o=>o.receiver.track.kind==="video");i.offerToReceiveVideo===!1&&s?s.direction==="sendrecv"?s.setDirection?s.setDirection("sendonly"):s.direction="sendonly":s.direction==="recvonly"&&(s.setDirection?s.setDirection("inactive"):s.direction="inactive"):i.offerToReceiveVideo===!0&&!s&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function uE(t){typeof t!="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var Wb=Object.freeze({__proto__:null,shimAudioContext:uE,shimCallbacksAPI:sE,shimConstraints:aE,shimCreateOfferLegacy:dE,shimGetUserMedia:oE,shimLocalStreamsAPI:iE,shimRTCIceServerUrls:cE,shimRemoteStreamsAPI:rE,shimTrackEventTransceiver:lE}),gf={exports:{}},Hb;function $3(){return Hb||(Hb=1,function(t){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(n){return n.trim().split(` 560`).map(i=>i.trim())},e.splitSections=function(n){return n.split(` 561m=`).map((r,s)=>(s>0?"m="+r:r).trim()+`\r 562`)},e.getDescription=function(n){const i=e.splitSections(n);return i&&i[0]},e.getMediaSections=function(n){const i=e.splitSections(n);return i.shift(),i},e.matchPrefix=function(n,i){return e.splitLines(n).filter(r=>r.indexOf(i)===0)},e.parseCandidate=function(n){let i;n.indexOf("a=candidate:")===0?i=n.substring(12).split(" "):i=n.substring(10).split(" ");const r={foundation:i[0],component:{1:"rtp",2:"rtcp"}[i[1]]||i[1],protocol:i[2].toLowerCase(),priority:parseInt(i[3],10),ip:i[4],address:i[4],port:parseInt(i[5],10),type:i[7]};for(let s=8;s<i.length;s+=2)switch(i[s]){case"raddr":r.relatedAddress=i[s+1];break;case"rport":r.relatedPort=parseInt(i[s+1],10);break;case"tcptype":r.tcpType=i[s+1];break;case"ufrag":r.ufrag=i[s+1],r.usernameFragment=i[s+1];break;default:r[i[s]]===void 0&&(r[i[s]]=i[s+1]);break}return r},e.writeCandidate=function(n){const i=[];i.push(n.foundation);const r=n.component;r==="rtp"?i.push(1):r==="rtcp"?i.push(2):i.push(r),i.push(n.protocol.toUpperCase()),i.push(n.priority),i.push(n.address||n.ip),i.push(n.port);const s=n.type;return i.push("typ"),i.push(s),s!=="host"&&n.relatedAddress&&n.relatedPort&&(i.push("raddr"),i.push(n.relatedAddress),i.push("rport"),i.push(n.relatedPort)),n.tcpType&&n.protocol.toLowerCase()==="tcp"&&(i.push("tcptype"),i.push(n.tcpType)),(n.usernameFragment||n.ufrag)&&(i.push("ufrag"),i.push(n.usernameFragment||n.ufrag)),"candidate:"+i.join(" ")},e.parseIceOptions=function(n){return n.substring(14).split(" ")},e.parseRtpMap=function(n){let i=n.substring(9).split(" ");const r={payloadType:parseInt(i.shift(),10)};return i=i[0].split("/"),r.name=i[0],r.clockRate=parseInt(i[1],10),r.channels=i.length===3?parseInt(i[2],10):1,r.numChannels=r.channels,r},e.writeRtpMap=function(n){let i=n.payloadType;n.preferredPayloadType!==void 0&&(i=n.preferredPayloadType);const r=n.channels||n.numChannels||1;return"a=rtpmap:"+i+" "+n.name+"/"+n.clockRate+(r!==1?"/"+r:"")+`\r 563`},e.parseExtmap=function(n){const i=n.substring(9).split(" ");return{id:parseInt(i[0],10),direction:i[0].indexOf("/")>0?i[0].split("/")[1]:"sendrecv",uri:i[1],attributes:i.slice(2).join(" ")}},e.writeExtmap=function(n){return"a=extmap:"+(n.id||n.preferredId)+(n.direction&&n.direction!=="sendrecv"?"/"+n.direction:"")+" "+n.uri+(n.attributes?" "+n.attributes:"")+`\r 564`},e.parseFmtp=function(n){const i={};let r;const s=n.substring(n.indexOf(" ")+1).split(";");for(let o=0;o<s.length;o++)r=s[o].trim().split("="),i[r[0].trim()]=r[1];return i},e.writeFmtp=function(n){let i="",r=n.payloadType;if(n.preferredPayloadType!==void 0&&(r=n.preferredPayloadType),n.parameters&&Object.keys(n.parameters).length){const s=[];Object.keys(n.parameters).forEach(o=>{n.parameters[o]!==void 0?s.push(o+"="+n.parameters[o]):s.push(o)}),i+="a=fmtp:"+r+" "+s.join(";")+`\r 565`}return i},e.parseRtcpFb=function(n){const i=n.substring(n.indexOf(" ")+1).split(" ");return{type:i.shift(),parameter:i.join(" ")}},e.writeRtcpFb=function(n){let i="",r=n.payloadType;return n.preferredPayloadType!==void 0&&(r=n.preferredPayloadType),n.rtcpFeedback&&n.rtcpFeedback.length&&n.rtcpFeedback.forEach(s=>{i+="a=rtcp-fb:"+r+" "+s.type+(s.parameter&&s.parameter.length?" "+s.parameter:"")+`\r 566`}),i},e.parseSsrcMedia=function(n){const i=n.indexOf(" "),r={ssrc:parseInt(n.substring(7,i),10)},s=n.indexOf(":",i);return s>-1?(r.attribute=n.substring(i+1,s),r.value=n.substring(s+1)):r.attribute=n.substring(i+1),r},e.parseSsrcGroup=function(n){const i=n.substring(13).split(" ");return{semantics:i.shift(),ssrcs:i.map(r=>parseInt(r,10))}},e.getMid=function(n){const i=e.matchPrefix(n,"a=mid:")[0];if(i)return i.substring(6)},e.parseFingerprint=function(n){const i=n.substring(14).split(" ");return{algorithm:i[0].toLowerCase(),value:i[1].toUpperCase()}},e.getDtlsParameters=function(n,i){return{role:"auto",fingerprints:e.matchPrefix(n+i,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(n,i){let r="a=setup:"+i+`\r 567`;return n.fingerprints.forEach(s=>{r+="a=fingerprint:"+s.algorithm+" "+s.value+`\r 568`}),r},e.parseCryptoLine=function(n){const i=n.substring(9).split(" ");return{tag:parseInt(i[0],10),cryptoSuite:i[1],keyParams:i[2],sessionParams:i.slice(3)}},e.writeCryptoLine=function(n){return"a=crypto:"+n.tag+" "+n.cryptoSuite+" "+(typeof n.keyParams=="object"?e.writeCryptoKeyParams(n.keyParams):n.keyParams)+(n.sessionParams?" "+n.sessionParams.join(" "):"")+`\r 569`},e.parseCryptoKeyParams=function(n){if(n.indexOf("inline:")!==0)return null;const i=n.substring(7).split("|");return{keyMethod:"inline",keySalt:i[0],lifeTime:i[1],mkiValue:i[2]?i[2].split(":")[0]:void 0,mkiLength:i[2]?i[2].split(":")[1]:void 0}},e.writeCryptoKeyParams=function(n){return n.keyMethod+":"+n.keySalt+(n.lifeTime?"|"+n.lifeTime:"")+(n.mkiValue&&n.mkiLength?"|"+n.mkiValue+":"+n.mkiLength:"")},e.getCryptoParameters=function(n,i){return e.matchPrefix(n+i,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(n,i){const r=e.matchPrefix(n+i,"a=ice-ufrag:")[0],s=e.matchPrefix(n+i,"a=ice-pwd:")[0];return r&&s?{usernameFragment:r.substring(12),password:s.substring(10)}:null},e.writeIceParameters=function(n){let i="a=ice-ufrag:"+n.usernameFragment+`\r 570a=ice-pwd:`+n.password+`\r 571`;return n.iceLite&&(i+=`a=ice-lite\r 572`),i},e.parseRtpParameters=function(n){const i={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},s=e.splitLines(n)[0].split(" ");i.profile=s[2];for(let a=3;a<s.length;a++){const l=s[a],d=e.matchPrefix(n,"a=rtpmap:"+l+" ")[0];if(d){const u=e.parseRtpMap(d),h=e.matchPrefix(n,"a=fmtp:"+l+" ");switch(u.parameters=h.length?e.parseFmtp(h[0]):{},u.rtcpFeedback=e.matchPrefix(n,"a=rtcp-fb:"+l+" ").map(e.parseRtcpFb),i.codecs.push(u),u.name.toUpperCase()){case"RED":case"ULPFEC":i.fecMechanisms.push(u.name.toUpperCase());break}}}e.matchPrefix(n,"a=extmap:").forEach(a=>{i.headerExtensions.push(e.parseExtmap(a))});const o=e.matchPrefix(n,"a=rtcp-fb:* ").map(e.parseRtcpFb);return i.codecs.forEach(a=>{o.forEach(l=>{a.rtcpFeedback.find(u=>u.type===l.type&&u.parameter===l.parameter)||a.rtcpFeedback.push(l)})}),i},e.writeRtpDescription=function(n,i){let r="";r+="m="+n+" ",r+=i.codecs.length>0?"9":"0",r+=" "+(i.profile||"UDP/TLS/RTP/SAVPF")+" ",r+=i.codecs.map(o=>o.preferredPayloadType!==void 0?o.preferredPayloadType:o.payloadType).join(" ")+`\r 573`,r+=`c=IN IP4 0.0.0.0\r 574`,r+=`a=rtcp:9 IN IP4 0.0.0.0\r 575`,i.codecs.forEach(o=>{r+=e.writeRtpMap(o),r+=e.writeFmtp(o),r+=e.writeRtcpFb(o)});let s=0;return i.codecs.forEach(o=>{o.maxptime>s&&(s=o.maxptime)}),s>0&&(r+="a=maxptime:"+s+`\r 576`),i.headerExtensions&&i.headerExtensions.forEach(o=>{r+=e.writeExtmap(o)}),r},e.parseRtpEncodingParameters=function(n){const i=[],r=e.parseRtpParameters(n),s=r.fecMechanisms.indexOf("RED")!==-1,o=r.fecMechanisms.indexOf("ULPFEC")!==-1,a=e.matchPrefix(n,"a=ssrc:").map(p=>e.parseSsrcMedia(p)).filter(p=>p.attribute==="cname"),l=a.length>0&&a[0].ssrc;let d;const u=e.matchPrefix(n,"a=ssrc-group:FID").map(p=>p.substring(17).split(" ").map(b=>parseInt(b,10)));u.length>0&&u[0].length>1&&u[0][0]===l&&(d=u[0][1]),r.codecs.forEach(p=>{if(p.name.toUpperCase()==="RTX"&&p.parameters.apt){let g={ssrc:l,codecPayloadType:parseInt(p.parameters.apt,10)};l&&d&&(g.rtx={ssrc:d}),i.push(g),s&&(g=JSON.parse(JSON.stringify(g)),g.fec={ssrc:l,mechanism:o?"red+ulpfec":"red"},i.push(g))}}),i.length===0&&l&&i.push({ssrc:l});let h=e.matchPrefix(n,"b=");return h.length&&(h[0].indexOf("b=TIAS:")===0?h=parseInt(h[0].substring(7),10):h[0].indexOf("b=AS:")===0?h=parseInt(h[0].substring(5),10)*1e3*.95-50*40*8:h=void 0,i.forEach(p=>{p.maxBitrate=h})),i},e.parseRtcpParameters=function(n){const i={},r=e.matchPrefix(n,"a=ssrc:").map(a=>e.parseSsrcMedia(a)).filter(a=>a.attribute==="cname")[0];r&&(i.cname=r.value,i.ssrc=r.ssrc);const s=e.matchPrefix(n,"a=rtcp-rsize");i.reducedSize=s.length>0,i.compound=s.length===0;const o=e.matchPrefix(n,"a=rtcp-mux");return i.mux=o.length>0,i},e.writeRtcpParameters=function(n){let i="";return n.reducedSize&&(i+=`a=rtcp-rsize\r 577`),n.mux&&(i+=`a=rtcp-mux\r 578`),n.ssrc!==void 0&&n.cname&&(i+="a=ssrc:"+n.ssrc+" cname:"+n.cname+`\r 579`),i},e.parseMsid=function(n){let i;const r=e.matchPrefix(n,"a=msid:");if(r.length===1)return i=r[0].substring(7).split(" "),{stream:i[0],track:i[1]};const s=e.matchPrefix(n,"a=ssrc:").map(o=>e.parseSsrcMedia(o)).filter(o=>o.attribute==="msid");if(s.length>0)return i=s[0].value.split(" "),{stream:i[0],track:i[1]}},e.parseSctpDescription=function(n){const i=e.parseMLine(n),r=e.matchPrefix(n,"a=max-message-size:");let s;r.length>0&&(s=parseInt(r[0].substring(19),10)),isNaN(s)&&(s=65536);const o=e.matchPrefix(n,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substring(12),10),protocol:i.fmt,maxMessageSize:s};const a=e.matchPrefix(n,"a=sctpmap:");if(a.length>0){const l=a[0].substring(10).split(" ");return{port:parseInt(l[0],10),protocol:l[1],maxMessageSize:s}}},e.writeSctpDescription=function(n,i){let r=[];return n.protocol!=="DTLS/SCTP"?r=["m="+n.kind+" 9 "+n.protocol+" "+i.protocol+`\r 580`,`c=IN IP4 0.0.0.0\r 581`,"a=sctp-port:"+i.port+`\r 582`]:r=["m="+n.kind+" 9 "+n.protocol+" "+i.port+`\r 583`,`c=IN IP4 0.0.0.0\r 584`,"a=sctpmap:"+i.port+" "+i.protocol+` 65535\r 585`],i.maxMessageSize!==void 0&&r.push("a=max-message-size:"+i.maxMessageSize+`\r 586`),r.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(n,i,r){let s;const o=i!==void 0?i:2;return n?s=n:s=e.generateSessionId(),`v=0\r 587o=`+(r||"thisisadapterortc")+" "+s+" "+o+` IN IP4 127.0.0.1\r 588s=-\r 589t=0 0\r 590`},e.getDirection=function(n,i){const r=e.splitLines(n);for(let s=0;s<r.length;s++)switch(r[s]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return r[s].substring(2)}return i?e.getDirection(i):"sendrecv"},e.getKind=function(n){return e.splitLines(n)[0].split(" ")[0].substring(2)},e.isRejected=function(n){return n.split(" ",2)[1]==="0"},e.parseMLine=function(n){const r=e.splitLines(n)[0].substring(2).split(" ");return{kind:r[0],port:parseInt(r[1],10),protocol:r[2],fmt:r.slice(3).join(" ")}},e.parseOLine=function(n){const r=e.matchPrefix(n,"o=")[0].substring(2).split(" ");return{username:r[0],sessionId:r[1],sessionVersion:parseInt(r[2],10),netType:r[3],addressType:r[4],address:r[5]}},e.isValidSDP=function(n){if(typeof n!="string"||n.length===0)return!1;const i=e.splitLines(n);for(let r=0;r<i.length;r++)if(i[r].length<2||i[r].charAt(1)!=="=")return!1;return!0},t.exports=e}(gf)),gf.exports}var hE=$3(),$o=A3(hE),q3=sM({__proto__:null,default:$o},[hE]);function Ed(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(i){if(typeof i=="object"&&i.candidate&&i.candidate.indexOf("a=")===0&&(i=JSON.parse(JSON.stringify(i)),i.candidate=i.candidate.substring(2)),i.candidate&&i.candidate.length){const r=new e(i),s=$o.parseCandidate(i.candidate);for(const o in s)o in r||Object.defineProperty(r,o,{value:s[o]});return r.toJSON=function(){return{candidate:r.candidate,sdpMid:r.sdpMid,sdpMLineIndex:r.sdpMLineIndex,usernameFragment:r.usernameFragment}},r}return new e(i)},t.RTCIceCandidate.prototype=e.prototype,ro(t,"icecandidate",n=>(n.candidate&&Object.defineProperty(n,"candidate",{value:new t.RTCIceCandidate(n.candidate),writable:"false"}),n))}function ym(t){!t.RTCIceCandidate||t.RTCIceCandidate&&"relayProtocol"in t.RTCIceCandidate.prototype||ro(t,"icecandidate",e=>{if(e.candidate){const n=$o.parseCandidate(e.candidate.candidate);n.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[n.priority>>24])}return e})}function Pd(t,e){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp}});const n=function(a){if(!a||!a.sdp)return!1;const l=$o.splitSections(a.sdp);return l.shift(),l.some(d=>{const u=$o.parseMLine(d);return u&&u.kind==="application"&&u.protocol.indexOf("SCTP")!==-1})},i=function(a){const l=a.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(l===null||l.length<2)return-1;const d=parseInt(l[1],10);return d!==d?-1:d},r=function(a){let l=65536;return e.browser==="firefox"&&(e.version<57?a===-1?l=16384:l=2147483637:e.version<60?l=e.version===57?65535:65536:l=2147483637),l},s=function(a,l){let d=65536;e.browser==="firefox"&&e.version===57&&(d=65535);const u=$o.matchPrefix(a.sdp,"a=max-message-size:");return u.length>0?d=parseInt(u[0].substring(19),10):e.browser==="firefox"&&l!==-1&&(d=2147483637),d},o=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,e.browser==="chrome"&&e.version>=76){const{sdpSemantics:l}=this.getConfiguration();l==="plan-b"&&Object.defineProperty(this,"sctp",{get(){return typeof this._sctp>"u"?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const l=i(arguments[0]),d=r(l),u=s(arguments[0],l);let h;d===0&&u===0?h=Number.POSITIVE_INFINITY:d===0||u===0?h=Math.max(d,u):h=Math.min(d,u);const p={};Object.defineProperty(p,"maxMessageSize",{get(){return h}}),this._sctp=p}return o.apply(this,arguments)}}function Rd(t){if(!(t.RTCPeerConnection&&"createDataChannel"in t.RTCPeerConnection.prototype))return;function e(i,r){const s=i.send;i.send=function(){const a=arguments[0],l=a.length||a.size||a.byteLength;if(i.readyState==="open"&&r.sctp&&l>r.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+r.sctp.maxMessageSize+" bytes)");return s.apply(i,arguments)}}const n=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const r=n.apply(this,arguments);return e(r,this),r},ro(t,"datachannel",i=>(e(i.channel,i.target),i))}function bm(t){if(!t.RTCPeerConnection||"connectionState"in t.RTCPeerConnection.prototype)return;const e=t.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(n){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),n&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=n)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(n=>{const i=e[n];e[n]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=r=>{const s=r.target;if(s._lastConnectionState!==s.connectionState){s._lastConnectionState=s.connectionState;const o=new Event("connectionstatechange",r);s.dispatchEvent(o)}return r},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),i.apply(this,arguments)}})}function xm(t,e){if(!t.RTCPeerConnection||e.browser==="chrome"&&e.ver
vendor: 4,556 bytes, lines 590-593
590sion>=71||e.browser==="safari"&&e._safariVersion>=13.1)return;const n=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(r){if(r&&r.sdp&&r.sdp.indexOf(` 591a=extmap-allow-mixed`)!==-1){const s=r.sdp.split(` 592`).filter(o=>o.trim()!=="a=extmap-allow-mixed").join(` 593`);t.RTCSessionDescription&&r instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:r.type,sdp:s}):r.sdp=s}return n.apply(this,arguments)}}function Nd(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const n=t.RTCPeerConnection.prototype.addIceCandidate;!n||n.length===0||(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&e.version<78||e.browser==="firefox"&&e.version<68||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Id(t,e){if(!(t.RTCPeerConnection&&t.RTCPeerConnection.prototype))return;const n=t.RTCPeerConnection.prototype.setLocalDescription;!n||n.length===0||(t.RTCPeerConnection.prototype.setLocalDescription=function(){let r=arguments[0]||{};if(typeof r!="object"||r.type&&r.sdp)return n.apply(this,arguments);if(r={type:r.type,sdp:r.sdp},!r.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":r.type="offer";break;default:r.type="answer";break}return r.sdp||r.type!=="offer"&&r.type!=="answer"?n.apply(this,[r]):(r.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(o=>n.apply(this,[o]))})}var K3=Object.freeze({__proto__:null,removeExtmapAllowMixed:xm,shimAddIceCandidateNullOrEmpty:Nd,shimConnectionState:bm,shimMaxMessageSize:Pd,shimParameterlessSetLocalDescription:Id,shimRTCIceCandidate:Ed,shimRTCIceCandidateRelayProtocol:ym,shimSendThrowTypeError:Rd});function G3(){let{window:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0};const n=M1,i=W3(t),r={browserDetails:i,commonShim:K3,extractVersion:tc,disableLog:z3,disableWarnings:B3,sdp:q3};switch(i.browser){case"chrome":if(!zb||!gm||!e.shimChrome)return n("Chrome shim is not included in this adapter release."),r;if(i.version===null)return n("Chrome shim can not determine version, not shimming."),r;n("adapter.js shimming chrome."),r.browserShim=zb,Nd(t,i),Id(t),F1(t,i),V1(t),gm(t,i),z1(t),$1(t,i),B1(t),W1(t),q1(t,i),Ed(t),ym(t),bm(t),Pd(t,i),Rd(t),xm(t,i);break;case"firefox":if(!Bb||!vm||!e.shimFirefox)return n("Firefox shim is not included in this adapter release."),r;n("adapter.js shimming firefox."),r.browserShim=Bb,Nd(t,i),Id(t),K1(t,i),vm(t,i),G1(t),Y1(t),Q1(t),J1(t),X1(t),Z1(t),eE(t),tE(t),nE(t),Ed(t),bm(t),Pd(t,i),Rd(t);break;case"safari":if(!Wb||!e.shimSafari)return n("Safari shim is not included in this adapter release."),r;n("adapter.js shimming safari."),r.browserShim=Wb,Nd(t,i),Id(t),cE(t),dE(t),sE(t),iE(t),rE(t),lE(t),oE(t),uE(t),Ed(t),ym(t),Pd(t,i),Rd(t),xm(t,i);break;default:n("Unsupported browser!");break}return r}G3({window:typeof window>"u"?void 0:window});const Q3=10,Ha="lk_e2ee",J3="LKFrameEncryptionKey",Y3={sharedKey:!1,ratchetSalt:J3,ratchetWindowSize:8,failureTolerance:Q3,keyringSize:16};var Xr;(function(t){t.SetKey="setKey",t.RatchetRequest="ratchetRequest",t.KeyRatcheted="keyRatcheted"})(Xr||(Xr={}));var $b;(function(t){t.KeyRatcheted="keyRatcheted"})($b||($b={}));var Br;(function(t){t.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",t.EncryptionError="encryptionError"})(Br||(Br={}));var qb;(function(t){t.Error="cryptorError"})(qb||(qb={}));function X3(){return Z3()||km()}function km(){return typeof window.RTCRtpScriptTransform<"u"}function Z3(){return typeof window.RTCRtpSender<"u"&&typeof window.RTCRtpSender.prototype.createEncodedStreams<"u"}class R8 extends Ni.EventEmitter{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.onKeyRatcheted=(n,i,r)=>{ke.debug("key ratcheted event received",{ratchetResult:n,participantId:i,keyIndex:r})},this.keyInfoMap=new Map,this.options=Object.assign(Object.assign({},Y3),e),this.on(Xr.KeyRatcheted,this.onKeyRatcheted)}onSetEncryptionKey(e,n,i){const r={key:e,participantIdentity:n,keyIndex:i};if(!this.options.sharedKey&&!n)throw new Error("participant identity needs to be passed for encryption key if sharedKey option is false");this.keyInfoMap.set("".concat(n??"shared","-").concat(i??0),r),this.emit
593(Xr.SetKey,r)}getKeys(){return Array.from(this.keyInfoMap.values())}getOptions(){return this.options}ratchetKey(e,n){this.emit(Xr.RatchetRequest,e,n)}}class ar extends Error{constructor(e,n){super(n||"an error has occured"),this.name="LiveKitError",this.code=e}}var Ie;(function(t){t[t.NotAllowed=0]="NotAllowed",t[t.ServerUnreachable=1]="ServerUnreachable",t[t.InternalError=2]="InternalError",t[t.Cancelled=3]="Cancelled",t[t.LeaveRequest=4]="LeaveRequest",t[t.Timeout=5]="Timeout"})(Ie||(Ie={}));class $e extends ar{constructor(e,n,i,r){super(1,e),this.name="ConnectionError",this.status=i,this.reason=n,this.context=r,this.reasonName=Ie[n]}}class Iv extends ar{constructor(e){super(21,e??"device is unsupported"),this.name="DeviceUnsupportedError"}}class $i extends ar{constructor(e){super(20,e??"track is invalid"),this.name="TrackInvalidError"}}class e4 extends ar{constructor(e){super(10,e??"unsupported server"),this.name="UnsupportedServer"}}class yt extends ar{constructor(e){super(12,e??"unexpected connection state"),this.name="UnexpectedConnectionState"}}class Sm extends ar{constructor(e){super(13,e??"unable to negotiate"),this.name="NegotiationError"}}class Kb extends ar{constructor(e,n){super(15,e),this.name="PublishTrackError",this.status=n}}class Gb extends ar{constructor(e,n){super(15,e),this.reason=n,this.reasonName=typeof n=="string"?n:Rv[n]}}var Jn;(function(t){t[t.AlreadyOpened=0]="AlreadyOpened",t[t.AbnormalEnd=1]="AbnormalEnd",t[t.DecodeFailed=2]="DecodeFailed",t[t.LengthExceeded=3]="LengthExceeded",t[t.Incomplete=4]="Incomplete",t[t.HandlerAlreadyRegistered=7]="HandlerAlreadyRegistered"})(Jn||(Jn={}));class Pr extends ar{constructor(e,n){super(16,e),this.name="DataStreamError",this.reason=n,this.reasonName=Jn[n]}}var bu;(function(t){t.PermissionDenied="PermissionDenied",t.NotFound="NotFound",t.DeviceInUse="DeviceInUse",t.Other="Other"})(bu||(bu={}));(function(t){function e(n){if(n&&"name"in n)return n.name==="NotFoundError"||n.name==="DevicesNotFoundError"?t.NotFound:n.name==="NotAllowedError"||n.name==="PermissionDeniedError"?t.PermissionDenied:n.name==="NotReadableError"||n.name==="TrackStartError"?t.DeviceInUse:t.Other}t.getFailure=e})(bu||(bu={}));var Qb;(function(t){t[t.InvalidKey=0]="InvalidKey",t[t.MissingKey=1]="MissingKey",t[t.InternalError=2]="InternalError"})(Qb||(Qb={}));var B;(function(t){t.Connected="connected",t.Reconnecting="reconnecting",t.SignalReconnecting="signalReconnecting",t.Reconnected="reconnected",t.Disconnected="disconnected",t.ConnectionStateChanged="connectionStateChanged",t.Moved="moved",t.MediaDevicesChanged="mediaDevicesChanged",t.ParticipantConnected="participantConnected",t.ParticipantDisconnected="participantDisconnected",t.TrackPublished="trackPublished",t.TrackSubscribed="trackSubscribed",t.TrackSubscriptionFailed="trackSubscriptionFailed",t.TrackUnpublished="trackUnpublished",t.TrackUnsubscribed="trackUnsubscribed",t.TrackMuted="trackMuted",t.TrackUnmuted="trackUnmuted",t.LocalTrackPublished="localTrackPublished",t.LocalTrackUnpublished="localTrackUnpublished",t.LocalAudioSilenceDetected="localAudioSilenceDetected",t.ActiveSpeakersChanged="activeSpeakersChanged",t.ParticipantMetadataChanged="participantMetadataChanged",t.ParticipantNameChanged="participantNameChanged",t.ParticipantAttributesChanged="participantAttributesChanged",t.ParticipantActive="participantActive",t.RoomMetadataChanged="roomMetadataChanged",t.DataReceived="dataReceived",t.SipDTMFReceived="sipDTMFReceived",t.TranscriptionReceived="transcriptionReceived",t.ConnectionQualityChanged="connectionQualityChanged",t.TrackStreamStateChanged="trackStreamStateChanged",t.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",t.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",t.AudioPlaybackStatusChanged="audioPlaybackChanged",t.VideoPlaybackStatusChanged="videoPlaybackChanged",t.MediaDevicesError="mediaDevicesError",t.ParticipantPermissionsChanged="participantPermissionsChanged",t.SignalConnected="signalConnected",t.RecordingStatusChanged="recordingStatusChanged",t.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",t.EncryptionError="encryptionError",t.DCBufferStatusChanged="dcBufferStatusChanged",t.ActiveDeviceChanged="activeDeviceChanged",t.ChatMessage="chatMessage",t.LocalTrackSubscribed="localTrackSubscribed",t.MetricsReceived="metricsReceived"})(B||(B={}));var J;(function(t){t.TrackPublished="trackPublished",t.TrackSubscribed="trackSubscribed",t.TrackSubscriptionFailed="trackSubscriptionFailed",t.TrackUnpublished="trackUnpublished",t.TrackUnsubscribed="trackUnsubscribed",t.TrackMuted="trackMuted",t.TrackUnmuted="trackUnmuted",t.LocalTrackPublished="localTrackPublished",t.LocalTrackUnpublished="localTrackUnpublished",t.LocalTrackCpuConstrained="localTrackCpuConstrained",t.LocalSenderCreated="localSenderCreated",t.ParticipantMetadataChanged="participantMetadataChanged",t.ParticipantNameChanged="participantNameChanged",t.DataReceived="dataReceived",t.SipDTMFReceived="sipDTMFReceived",t.TranscriptionReceived="transcriptionReceived",t.IsSpeakingChanged="isSpeakingChanged",t.ConnectionQualityChanged="connectionQualityChanged",t.TrackStreamStateChanged="trackStreamStateChanged",t.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",t.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",t.TrackCpuConstrained="trackCpuConstrained",t.MediaDevicesError="mediaDevicesError",t.AudioStreamAcquired="audioStreamAcquired",t.ParticipantPermissionsChanged="participantPermissionsChanged",t.PCTrackAdded="pcTrackAdded",t.AttributesChanged="attributesChanged",t.LocalTrackSubscribed="localTrackSubscribed",t.ChatMessage="chatMessage",t.Active="active"})(J||(J={}));var X;(function(t){t.TransportsCreated="transportsCreated",t.Connected="connected",t.Disconnected="disconnected",t.Resuming="resuming",t.Resumed="resumed",t.Restarting="restarting",t.Restarted="restarted",t.SignalResumed="signalResumed",t.SignalRestarted="signalRestarted",t.Closing="closing",t.MediaTrackAdded="mediaTrackAdded",t.ActiveSpeakersUpdate="activeSpeakersUpdate",t.DataPacketReceived="dataPacketReceived",t.RTPVideoMapUpdate="rtpVideoMapUpdate",t.DCBufferStatusChanged="dcBufferStatusChanged",t.ParticipantUpdate="participantUpdate",t.RoomUpdate="roomUpdate",t.SpeakersChanged="speakersChanged",t.StreamStateChanged="streamStateChanged",t.ConnectionQualityUpdate="connectionQualityUpdate",t.SubscriptionError="subscriptionError",t.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",t.RemoteMute="remoteMute",t.SubscribedQualityUpdate="subscribedQualityUpdate",t.LocalTrackUnpublished="localTrackUnpublished",t.LocalTrackSubscribed="localTrackSubscribed",t.Offline="offline",t.SignalRequestResponse="signalRequestResponse",t.SignalConnected="signalConnected",t.RoomMoved="roomMoved"})(X||(X={}));var $;(function(t){t.Message="message",t.Muted="muted",t.Unmuted="unmuted",t.Restarted="restarted",t.Ended="ended",t.Subscribed="subscribed",t.Unsubscribed="unsubscribed",t.CpuConstrained="cpuConstrained",t.UpdateSettings="updateSettings",t.UpdateSubscription="updateSubscription",t.AudioPlaybackStarted="audioPlaybackStarted",t.AudioPlaybackFailed="audioPlaybackFailed",t.AudioSilenceDetected="audioSilenceDetected",t.VisibilityChanged="visibilityChanged",t.VideoDimensionsChanged="videoDimensionsChanged",t.VideoPlaybackStarted="videoPlaybackStarted",t.VideoPlaybackFailed="videoPlaybackFailed",t.ElementAttached="elementAttached",t.ElementDetached="elementDetached",t.UpstreamPaused="upstreamPaused",t.UpstreamResumed="upstreamResumed",t.SubscriptionPermissionChanged="subscriptionPermissionChanged",t.SubscriptionStatusChanged="subscriptionStatusChanged",t.SubscriptionFailed="subscriptionFailed",t.TrackProcessorUpdate="trackProcessorUpdate",t.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",t.TranscriptionReceived="transcriptionReceived",t.TimeSyncUpdate="timeSyncUpdate",t.PreConnectBufferFlushed="preConnectBufferFlushed"})($||($={}));function t4(t){return typeof t>"u"?t:typeof structuredClone=="function"?typeof t=="object"&&t!==null?structuredClone(Object.assign({},t)):structuredClone(t):JSON.parse(JSON.stringify(t))}const n4=/version\/(\d+(\.?_?\d+)+)/i;let vf;function kn(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(typeof navigator>"u")return;const n=navigator.userAgent.toLowerCase();if(vf===void 0||e){const i=i4.find(r=>{let{test:s}=r;return s.test(n)});vf=i==null?void 0:i.describe(n)}return vf}const i4=[{test:/firefox|iceweasel|fxios/i,describe(t){return{name:"Firefox",version:jd(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t),os:t.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:yf(t)}
vendor: 4,113 bytes, line 593
593}},{test:/chrom|crios|crmo/i,describe(t){return{name:"Chrome",version:jd(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t),os:t.toLowerCase().includes("crios")?"iOS":void 0,osVersion:yf(t)}}},{test:/safari|applewebkit/i,describe(t){return{name:"Safari",version:jd(n4,t),os:t.includes("mobile/")?"iOS":"macOS",osVersion:yf(t)}}}];function jd(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;const i=e.match(t);return i&&i.length>=n&&i[n]||""}function yf(t){return t.includes("mac os")?jd(/\(.+?(\d+_\d+(:?_\d+)?)/,t,1).replace(/_/g,"."):void 0}var r4="2.15.7";const s4=r4,o4=16;class Nt{}Nt.setTimeout=function(){return setTimeout(...arguments)};Nt.setInterval=function(){return setInterval(...arguments)};Nt.clearTimeout=function(){return clearTimeout(...arguments)};Nt.clearInterval=function(){return clearInterval(...arguments)};const a4=5e3,$a=[];var yn;(function(t){t[t.LOW=0]="LOW",t[t.MEDIUM=1]="MEDIUM",t[t.HIGH=2]="HIGH"})(yn||(yn={}));class V extends Ni.EventEmitter{get streamState(){return this._streamState}setStreamState(e){this._streamState=e}constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r;super(),this.attachedElements=[],this.isMuted=!1,this._streamState=V.StreamState.Active,this.isInBackground=!1,this._currentBitrate=0,this.log=ke,this.appVisibilityChangedListener=()=>{this.backgroundTimeout&&clearTimeout(this.backgroundTimeout),document.visibilityState==="hidden"?this.backgroundTimeout=setTimeout(()=>this.handleAppVisibilityChanged(),a4):this.handleAppVisibilityChanged()},this.log=rr((r=i.loggerName)!==null&&r!==void 0?r:ri.Track),this.loggerContextCb=i.loggerContextCb,this.setMaxListeners(100),this.kind=n,this._mediaStreamTrack=e,this._mediaStreamID=e.id,this.source=V.Source.Unknown}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),we(this))}get currentBitrate(){return this._currentBitrate}get mediaStreamTrack(){return this._mediaStreamTrack}get mediaStreamID(){return this._mediaStreamID}attach(e){let n="audio";this.kind===V.Kind.Video&&(n="video"),this.attachedElements.length===0&&this.kind===V.Kind.Video&&this.addAppVisibilityListener(),e||(n==="audio"&&($a.forEach(s=>{s.parentElement===null&&!e&&(e=s)}),e&&$a.splice($a.indexOf(e),1)),e||(e=document.createElement(n))),this.attachedElements.includes(e)||this.attachedElements.push(e),Ro(this.mediaStreamTrack,e);const i=e.srcObject.getTracks(),r=i.some(s=>s.kind==="audio");return e.play().then(()=>{this.emit(r?$.AudioPlaybackStarted:$.VideoPlaybackStarted)}).catch(s=>{s.name==="NotAllowedError"?this.emit(r?$.AudioPlaybackFailed:$.VideoPlaybackFailed,s):s.name==="AbortError"?ke.debug("".concat(r?"audio":"video"," playback aborted, likely due to new play request")):ke.warn("could not playback ".concat(r?"audio":"video"),s),r&&e&&i.some(o=>o.kind==="video")&&s.name==="NotAllowedError"&&(e.muted=!0,e.play().catch(()=>{}))}),this.emit($.ElementAttached,e),e}detach(e){try{if(e){qo(this.mediaStreamTrack,e);const i=this.attachedElements.indexOf(e);return i>=0&&(this.attachedElements.splice(i,1),this.recycleElement(e),this.emit($.ElementDetached,e)),e}const n=[];return this.attachedElements.forEach(i=>{qo(this.mediaStreamTrack,i),n.push(i),this.recycleElement(i),this.emit($.ElementDetached,i)}),this.attachedElements=[],n}finally{this.attachedElements.length===0&&this.removeAppVisibilityListener()}}stop(){this.stopMonitor(),this._mediaStreamTrack.stop()}enable(){this._mediaStreamTrack.enabled=!0}disable(){this._mediaStreamTrack.enabled=!1}stopMonitor(){this.monitorInterval&&clearInterval(this.monitorInterval),this.timeSyncHandle&&cancelAnimationFrame(this.timeSyncHandle)}updateLoggerOptions(e){e.loggerName&&(this.log=rr(e.loggerName)),e.loggerContextCb&&(this.loggerContextCb=e.loggerContextCb)}recycleElement(e){if(e instanceof HTMLAudioElement){let n=!0;e.pause(),$a.forEach(i=>{i.parentElement||(n=!1)}),n&&$a.push(e)}}handleAppVisibilityChanged(){return E(this,void 0,void 0,function*(){this.isInBackground=document.visibilityState==="hidden",!this.isInBackgroun
vendor: 33,391 bytes, line 593
593d&&this.kind===V.Kind.Video&&setTimeout(()=>this.attachedElements.forEach(e=>e.play().catch(()=>{})),0)})}addAppVisibilityListener(){on()?(this.isInBackground=document.visibilityState==="hidden",document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}removeAppVisibilityListener(){on()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}function Ro(t,e){let n;e.srcObject instanceof MediaStream?n=e.srcObject:n=new MediaStream;let i;t.kind==="audio"?i=n.getAudioTracks():i=n.getVideoTracks(),i.includes(t)||(i.forEach(r=>{n.removeTrack(r)}),n.addTrack(t)),(!Ys()||!(e instanceof HTMLVideoElement))&&(e.autoplay=!0),e.muted=n.getAudioTracks().length===0,e instanceof HTMLVideoElement&&(e.playsInline=!0),e.srcObject!==n&&(e.srcObject=n,(Ys()||Js())&&e instanceof HTMLVideoElement&&setTimeout(()=>{e.srcObject=n,e.play().catch(()=>{})},0))}function qo(t,e){if(e.srcObject instanceof MediaStream){const n=e.srcObject;n.removeTrack(t),n.getTracks().length>0?e.srcObject=n:e.srcObject=null}}(function(t){let e;(function(d){d.Audio="audio",d.Video="video",d.Unknown="unknown"})(e=t.Kind||(t.Kind={}));let n;(function(d){d.Camera="camera",d.Microphone="microphone",d.ScreenShare="screen_share",d.ScreenShareAudio="screen_share_audio",d.Unknown="unknown"})(n=t.Source||(t.Source={}));let i;(function(d){d.Active="active",d.Paused="paused",d.Unknown="unknown"})(i=t.StreamState||(t.StreamState={}));function r(d){switch(d){case e.Audio:return Gn.AUDIO;case e.Video:return Gn.VIDEO;default:return Gn.DATA}}t.kindToProto=r;function s(d){switch(d){case Gn.AUDIO:return e.Audio;case Gn.VIDEO:return e.Video;default:return e.Unknown}}t.kindFromProto=s;function o(d){switch(d){case n.Camera:return pt.CAMERA;case n.Microphone:return pt.MICROPHONE;case n.ScreenShare:return pt.SCREEN_SHARE;case n.ScreenShareAudio:return pt.SCREEN_SHARE_AUDIO;default:return pt.UNKNOWN}}t.sourceToProto=o;function a(d){switch(d){case pt.CAMERA:return n.Camera;case pt.MICROPHONE:return n.Microphone;case pt.SCREEN_SHARE:return n.ScreenShare;case pt.SCREEN_SHARE_AUDIO:return n.ScreenShareAudio;default:return n.Unknown}}t.sourceFromProto=a;function l(d){switch(d){case um.ACTIVE:return i.Active;case um.PAUSED:return i.Paused;default:return i.Unknown}}t.streamStateFromProto=l})(V||(V={}));class ze{constructor(e,n,i,r,s){if(typeof e=="object")this.width=e.width,this.height=e.height,this.aspectRatio=e.aspectRatio,this.encoding={maxBitrate:e.maxBitrate,maxFramerate:e.maxFramerate,priority:e.priority};else if(n!==void 0&&i!==void 0)this.width=e,this.height=n,this.aspectRatio=e/n,this.encoding={maxBitrate:i,maxFramerate:r,priority:s};else throw new TypeError("Unsupported options: provide at least width, height and maxBitrate")}get resolution(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}const c4=["vp8","h264"],l4=["vp8","h264","vp9","av1","h265"];function d4(t){return!!c4.find(e=>e===t)}var Jb;(function(t){t[t.PREFER_REGRESSION=0]="PREFER_REGRESSION",t[t.SIMULCAST=1]="SIMULCAST",t[t.REGRESSION=2]="REGRESSION"})(Jb||(Jb={}));var wm;(function(t){t.telephone={maxBitrate:12e3},t.speech={maxBitrate:24e3},t.music={maxBitrate:48e3},t.musicStereo={maxBitrate:64e3},t.musicHighQuality={maxBitrate:96e3},t.musicHighQualityStereo={maxBitrate:128e3}})(wm||(wm={}));const ka={h90:new ze(160,90,9e4,20),h180:new ze(320,180,16e4,20),h216:new ze(384,216,18e4,20),h360:new ze(640,360,45e4,20),h540:new ze(960,540,8e5,25),h720:new ze(1280,720,17e5,30),h1080:new ze(1920,1080,3e6,30),h1440:new ze(2560,1440,5e6,30),h2160:new ze(3840,2160,8e6,30)},Cm={h120:new ze(160,120,7e4,20),h180:new ze(240,180,125e3,20),h240:new ze(320,240,14e4,20),h360:new ze(480,360,33e4,20),h480:new ze(640,480,5e5,20),h540:new ze(720,540,6e5,25),h720:new ze(960,720,13e5,30),h1080:new ze(1440,1080,23e5,30),h1440:new ze(1920,1440,38e5,30)},jv={h360fps3:new ze(640,360,2e5,3,"medium"),h360fps15:new ze(640,360,4e5,15,"medium"),h720fps5:new ze(1280,720,8e5,5,"medium"),h720fps15:new ze(1280,720,15e5,15,"medium"),h720fps30:new ze(1280,720,2e6,30,"medium"),h1080fps15:new ze(1920,1080,25e5,15,"medium"),h1080fps30:new ze(1920,1080,5e6,30,"medium"),original:new ze(0,0,7e6,30,"medium")},u4="|",Yb="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function h4(t){const e=t.split(u4);return e.length>1?[e[0],t.substr(e[0].length+1)]:[t,""]}function un(t){return E(this,void 0,void 0,function*(){return new Promise(e=>Nt.setTimeout(e,t))})}function xu(){return"addTransceiver"in RTCPeerConnection.prototype}function Tm(){return"addTrack"in RTCPeerConnection.prototype}function f4(){return typeof ResizeObserver!==void 0&&typeof IntersectionObserver!==void 0}function p4(){return xu()}function m4(){if(!("getCapabilities"in RTCRtpSender)||Ys()||Js())return!1;const t=RTCRtpSender.getCapabilities("video");let e=!1;if(t){for(const n of t.codecs)if(n.mimeType==="video/AV1"){e=!0;break}}return e}function g4(){if(!("getCapabilities"in RTCRtpSender)||Js())return!1;if(Ys()){const n=kn();if(n!=null&&n.version&&Ei(n.version,"16")<0||(n==null?void 0:n.os)==="iOS"&&(n!=null&&n.osVersion)&&Ei(n.osVersion,"16")<0)return!1}const t=RTCRtpSender.getCapabilities("video");let e=!1;if(t){for(const n of t.codecs)if(n.mimeType==="video/VP9"){e=!0;break}}return e}function yi(t){return t==="av1"||t==="vp9"}function _m(t){return!document||Wc()?!1:(t||(t=document.createElement("audio")),"setSinkId"in t)}function v4(){return typeof RTCPeerConnection>"u"?!1:xu()||Tm()}function Js(){var t;return((t=kn())===null||t===void 0?void 0:t.name)==="Firefox"}function Ys(){var t;return((t=kn())===null||t===void 0?void 0:t.name)==="Safari"}function Wc(){const t=kn();return(t==null?void 0:t.name)==="Safari"||(t==null?void 0:t.os)==="iOS"}function y4(){const t=kn();return(t==null?void 0:t.name)==="Safari"&&t.version.startsWith("17.")||(t==null?void 0:t.os)==="iOS"&&!!(t!=null&&t.osVersion)&&Ei(t.osVersion,"17")>=0}function b4(t){return t||(t=kn()),(t==null?void 0:t.name)==="Safari"&&Ei(t.version,"18.3")>0||(t==null?void 0:t.os)==="iOS"&&!!(t!=null&&t.osVersion)&&Ei(t.osVersion,"18.3")>0}function fE(){var t,e;return on()?(e=(t=navigator.userAgentData)===null||t===void 0?void 0:t.mobile)!==null&&e!==void 0?e:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent):!1}function x4(){const t=kn(),e="17.2";if(t)return t.name!=="Safari"&&t.os!=="iOS"||t.os==="iOS"&&t.osVersion&&Ei(t.osVersion,e)>=0?!0:t.name==="Safari"&&Ei(t.version,e)>=0}function on(){return typeof document<"u"}function _i(){return navigator.product=="ReactNative"}function Em(t){return t.hostname.endsWith(".livekit.cloud")||t.hostname.endsWith(".livekit.run")}function pE(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function mE(){if(!_i())return;let t=pE();if(t)return t.platform}function Xb(){if(on())return window.devicePixelRatio;if(_i()){let t=pE();if(t)return t.devicePixelRatio}return 1}function Ei(t,e){const n=t.split("."),i=e.split("."),r=Math.min(n.length,i.length);for(let s=0;s<r;++s){const o=parseInt(n[s],10),a=parseInt(i[s],10);if(o>a)return 1;if(o<a)return-1;if(s===r-1&&o===a)return 0}return t===""&&e!==""?-1:e===""?1:n.length==i.length?0:n.length<i.length?-1:1}function k4(t){for(const e of t)e.target.handleResize(e)}function S4(t){for(const e of t)e.target.handleVisibilityChanged(e)}let bf=null;const Zb=()=>(bf||(bf=new ResizeObserver(k4)),bf);let xf=null;const ex=()=>(xf||(xf=new IntersectionObserver(S4,{root:null,rootMargin:"0px"})),xf);function w4(){var t;const e=new c3({sdk:b1.JS,protocol:o4,version:s4});return _i()&&(e.os=(t=mE())!==null&&t!==void 0?t:""),e}function tx(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:16,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;const r=document.createElement("canvas");r.width=t,r.height=e;const s=r.getContext("2d");s==null||s.fillRect(0,0,r.width,r.height),i&&s&&(s.beginPath(),s.arc(t/2,e/2,50,0,Math.PI*2,!0),s.closePath(),s.fillStyle="grey",s.fill());const o=r.captureStream(),[a]=o.getTracks();if(!a)throw Error("Could not get empty media stream video track");return a.enabled=n,a}let qa;function kf(){if(!qa){const t=new AudioContext,e=t.createOscillator(),n=t.createGain();n.gain.setValueAtTime(0,0);const i=t.createMediaStreamDestination();if(e.connect(n),n.connect(i),e.start(),[qa]=i.stream.getAudioTracks(),!qa)throw Error("Could not get empty media stream audio track");qa.enabled=!1}return qa.clone()}class bi{get isResolved(){return this._isResolved}constructor(e,n){this._isResolved=!1,this.onFinally=n,this.promise=new Promise((i,r)=>E(this,void 0,void 0,function*(){this.resolve=i,this.reject=r,e&&(yield e(i,r))})).finally(()=>{var i;this._isResolved=!0,(i=this.onFinally)===null||i===void 0||i.call(this)})}}function C4(t){return l4.includes(t)}function Zr(t){if(typeof t=="string"||typeof t=="number")return t;if(Array.isArray(t))return t[0];if(t.exact!==void 0)return Array.isArray(t.exact)?t.exact[0]:t.exact;if(t.ideal!==void 0)return Array.isArray(t.ideal)?t.ideal[0]:t.ideal;throw Error("could not unwrap constraint")}function T4(t){return t.startsWith("http")?t.replace(/^(http)/,"ws"):t}function Pm(t){return t.startsWith("ws")?t.replace(/^(ws)/,"http"):t}function _4(t,e){return t.segments.map(n=>{let{id:i,text:r,language:s,startTime:o,endTime:a,final:l}=n;var d;const u=(d=e.get(i))!==null&&d!==void 0?d:Date.now(),h=Date.now();return l?e.delete(i):e.set(i,u),{id:i,text:r,startTime:Number.parseInt(o.toString()),endTime:Number.parseInt(a.toString()),final:l,language:s,firstReceivedTime:u,lastReceivedTime:h}})}function E4(t){const{id:e,timestamp:n,message:i,editTimestamp:r}=t;return{id:e,timestamp:Number.parseInt(n.toString()),editTimestamp:r?Number.parseInt(r.toString()):void 0,message:i}}function nx(t){switch(t.reason){case Ie.LeaveRequest:return t.context;case Ie.Cancelled:return Xn.CLIENT_INITIATED;case Ie.NotAllowed:return Xn.USER_REJECTED;case Ie.ServerUnreachable:return Xn.JOIN_FAILURE;default:return Xn.UNKNOWN_REASON}}function Ad(t){return t!==void 0?Number(t):void 0}function gs(t){return t!==void 0?BigInt(t):void 0}function Ls(t){return!!t&&!(t instanceof MediaStreamTrack)&&t.isLocal}function Ci(t){return!!t&&t.kind==V.Kind.Audio}function us(t){return!!t&&t.kind==V.Kind.Video}function mr(t){return Ls(t)&&us(t)}function Oi(t){return Ls(t)&&Ci(t)}function Rm(t){return!!t&&!t.isLocal}function P4(t){return!!t&&!t.isLocal}function Sf(t){return Rm(t)&&us(t)}function R4(t){return t.isLocal}function N4(t,e){const n=[];let i=new TextEncoder().encode(t);for(;i.length>e;){let r=e;for(;r>0;){const s=i[r];if(s!==void 0&&(s&192)!==128)break;r--}n.push(i.slice(0,r)),i=i.slice(r)}return i.length>0&&n.push(i),n}function gE(t,e,n){var i,r,s,o;const{optionsWithoutProcessor:a,audioProcessor:l,videoProcessor:d}=bE(t??{}),u=e==null?void 0:e.processor,h=n==null?void 0:n.processor,p=a??{};return p.audio===!0&&(p.audio={}),p.video===!0&&(p.video={}),p.audio&&(Nm(p.audio,e),(i=(s=p.audio).deviceId)!==null&&i!==void 0||(s.deviceId={ideal:"default"}),(l||u)&&(p.audio.processor=l??u)),p.video&&(Nm(p.video,n),(r=(o=p.video).deviceId)!==null&&r!==void 0||(o.deviceId={ideal:"default"}),(d||h)&&(p.video.processor=d??h)),p}function Nm(t,e){return Object.keys(e).forEach(n=>{t[n]===void 0&&(t[n]=e[n])}),t}function Av(t){var e,n,i,r;const s={};if(t.video)if(typeof t.video=="object"){const o={},a=o,l=t.video;Object.keys(l).forEach(d=>{switch(d){case"resolution":Nm(a,l.resolution);break;default:a[d]=l[d]}}),s.video=o,(e=(i=s.video).deviceId)!==null&&e!==void 0||(i.deviceId={ideal:"default"})}else s.video=t.video?{deviceId:{ideal:"default"}}:!1;else s.video=!1;return t.audio?typeof t.audio=="object"?(s.audio=t.audio,(n=(r=s.audio).deviceId)!==null&&n!==void 0||(r.deviceId={ideal:"default"})):s.audio={deviceId:{ideal:"default"}}:s.audio=!1,s}function vE(t){return E(this,arguments,void 0,function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200;return function*(){const i=yE();if(i){const r=i.createAnalyser();r.fftSize=2048;const s=r.frequencyBinCount,o=new Uint8Array(s);i.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(r),yield un(n),r.getByteTimeDomainData(o);const l=o.some(d=>d!==128&&d!==0);return i.close(),!l}return!1}()})}function yE(){var t;const e=typeof window<"u"&&(window.AudioContext||window.webkitAudioContext);if(e){const n=new e({latencyHint:"interactive"});if(n.state==="suspended"&&typeof window<"u"&&(!((t=window.document)===null||t===void 0)&&t.body)){const i=()=>E(this,void 0,void 0,function*(){var r;try{n.state==="suspended"&&(yield n.resume())}catch(s){console.warn("Error trying to auto-resume audio context",s)}(r=window.document.body)===null||r===void 0||r.removeEventListener("click",i)});window.document.body.addEventListener("click",i)}return n}}function I4(t){return t==="audioinput"?V.Source.Microphone:t==="videoinput"?V.Source.Camera:V.Source.Unknown}function Im(t){return t===V.Source.Microphone?"audioinput":t===V.Source.Camera?"videoinput":void 0}function j4(t){var e,n;let i=(e=t.video)!==null&&e!==void 0?e:!0;return t.resolution&&t.resolution.width>0&&t.resolution.height>0&&(i=typeof i=="boolean"?{}:i,Ys()?i=Object.assign(Object.assign({},i),{width:{max:t.resolution.width},height:{max:t.resolution.height},frameRate:t.resolution.frameRate}):i=Object.assign(Object.assign({},i),{width:{ideal:t.resolution.width},height:{ideal:t.resolution.height},frameRate:t.resolution.frameRate})),{audio:(n=t.audio)!==null&&n!==void 0?n:!1,video:i,controller:t.controller,selfBrowserSurface:t.selfBrowserSurface,surfaceSwitching:t.surfaceSwitching,systemAudio:t.systemAudio,preferCurrentTab:t.preferCurrentTab}}function pc(t){return t.split("/")[1].toLowerCase()}function A4(t){const e=[];return t.forEach(n=>{n.track!==void 0&&e.push(new Ev({cid:n.track.mediaStreamID,track:n.trackInfo}))}),e}function we(t){return"mediaStreamTrack"in t?{trackID:t.sid,source:t.source,muted:t.isMuted,enabled:t.mediaStreamTrack.enabled,kind:t.kind,streamID:t.mediaStreamID,streamTrackID:t.mediaStreamTrack.id}:{trackID:t.trackSid,enabled:t.isEnabled,muted:t.isMuted,trackInfo:Object.assign({mimeType:t.mimeType,name:t.trackName,encrypted:t.isEncrypted,kind:t.kind,source:t.source},t.track?we(t.track):{})}}function O4(){return typeof RTCRtpReceiver<"u"&&"getSynchronizationSources"in RTCRtpReceiver}function D4(t,e){var n;t===void 0&&(t={}),e===void 0&&(e={});const i=[...Object.keys(e),...Object.keys(t)],r={};for(const s of i)t[s]!==e[s]&&(r[s]=(n=e[s])!==null&&n!==void 0?n:"");return r}function bE(t){const e=Object.assign({},t);let n,i;return typeof e.audio=="object"&&e.audio.processor&&(n=e.audio.processor,e.audio=Object.assign(Object.assign({},e.audio),{processor:void 0})),typeof e.video=="object"&&e.video.processor&&(i=e.video.processor,e.video=Object.assign(Object.assign({},e.video),{processor:void 0})),{audioProcessor:n,videoProcessor:i,optionsWithoutProcessor:t4(e)}}function L4(t){switch(t){case pt.CAMERA:return V.Source.Camera;case pt.MICROPHONE:return V.Source.Microphone;case pt.SCREEN_SHARE:return V.Source.ScreenShare;case pt.SCREEN_SHARE_AUDIO:return V.Source.ScreenShareAudio;default:return V.Source.Unknown}}function ix(t,e){return t.width*t.height<e.width*e.height}function M4(t,e){var n;return(n=t.layers)===null||n===void 0?void 0:n.find(i=>i.quality===e)}class U4 extends Ni.EventEmitter{constructor(e){super(),this.onWorkerMessage=n=>{var i,r;const{kind:s,data:o}=n.data;switch(s){case"error":ke.error(o.error.message),this.emit(Br.EncryptionError,o.error);break;case"initAck":o.enabled&&this.keyProvider.getKeys().forEach(a=>{this.postKey(a)});break;case"enable":if(o.enabled&&this.keyProvider.getKeys().forEach(a=>{this.postKey(a)}),this.encryptionEnabled!==o.enabled&&o.participantIdentity===((i=this.room)===null||i===void 0?void 0:i.localParticipant.identity))this.emit(Br.ParticipantEncryptionStatusChanged,o.enabled,this.room.localParticipant),this.encryptionEnabled=o.enabled;else if(o.participantIdentity){const a=(r=this.room)===null||r===void 0?void 0:r.getParticipantByIdentity(o.participantIdentity);if(!a)throw TypeError("couldn't set encryption status, participant not found".concat(o.participantIdentity));this.emit(Br.ParticipantEncryptionStatusChanged,o.enabled,a)}break;case"ratchetKey":this.keyProvider.emit(Xr.KeyRatcheted,o.ratchetResult,o.participantIdentity,o.keyIndex);break}},this.onWorkerError=n=>{ke.error("e2ee worker encountered an error:",{error:n.error}),this.emit(Br.EncryptionError,n.error)},this.keyProvider=e.keyProvider,this.worker=e.worker,this.encryptionEnabled=!1}setup(e){if(!X3())throw new Iv("tried to setup end-to-end encryption on an unsupported browser");if(ke.info("setting up e2ee"),e!==this.room){this.room=e,this.setupEventListeners(e,this.keyProvider);const n={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:L3.getLevel()}};this.worker&&(ke.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(n))}}setParticipantCryptorEnabled(e,n){ke.debug("set e2ee to ".concat(e," for participant ").concat(n)),this.postEnable(e,n)}setSifTrailer(e){!e||e.length===0?ke.warn("ignoring server sent trailer as it's empty"):this.postSifTrailer(e)}setupEngine(e){e.on(X.RTPVideoMapUpdate,n=>{this.postRTPMap(n)})}setupEventListeners(e,n){e.on(B.TrackPublished,(i,r)=>this.setParticipantCryptorEnabled(i.trackInfo.encryption!==gn.NONE,r.identity)),e.on(B.ConnectionStateChanged,i=>{i===_e.Connected&&e.remoteParticipants.forEach(r=>{r.trackPublications.forEach(s=>{this.setParticipantCryptorEnabled(s.trackInfo.encryption!==gn.NONE,r.identity)})})}).on(B.TrackUnsubscribed,(i,r,s)=>{var o;const a={kind:"removeTransform",data:{participantIdentity:s.identity,trackId:i.mediaStreamID}};(o=this.worker)===null||o===void 0||o.postMessage(a)}).on(B.TrackSubscribed,(i,r,s)=>{this.setupE2EEReceiver(i,s.identity,r.trackInfo)}).on(B.SignalConnected,()=>{if(!this.room)throw new TypeError("expected room to be present on signal connect");n.getKeys().forEach(i=>{this.postKey(i)}),this.setParticipantCryptorEnabled(this.room.localParticipant.isE2EEEnabled,this.room.localParticipant.identity)}),e.localParticipant.on(J.LocalSenderCreated,(i,r)=>E(this,void 0,void 0,function*(){this.setupE2EESender(r,i)})),e.localParticipant.on(J.LocalTrackPublished,i=>{if(!us(i.track)||!Wc())return;const r={kind:"updateCodec",data:{trackId:i.track.mediaStreamID,codec:pc(i.trackInfo.codecs[0].mimeType),participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(r)}),n.on(Xr.SetKey,i=>this.postKey(i)).on(Xr.RatchetRequest,(i,r)=>this.postRatchetRequest(i,r))}postRatchetRequest(e,n){if(!this.worker)throw Error("could not ratchet key, worker is missing");const i={kind:"ratchetRequest",data:{participantIdentity:e,keyIndex:n}};this.worker.postMessage(i)}postKey(e){let{key:n,participantIdentity:i,keyIndex:r}=e;var s;if(!this.worker)throw Error("could not set key, worker is missing");const o={kind:"setKey",data:{participantIdentity:i,isPublisher:i===((s=this.room)===null||s===void 0?void 0:s.localParticipant.identity),key:n,keyIndex:r}};this.worker.postMessage(o)}postEnable(e,n){if(this.worker){const i={kind:"enable",data:{enabled:e,participantIdentity:n}};this.worker.postMessage(i)}else throw new ReferenceError("failed to enable e2ee, worker is not ready")}postRTPMap(e){var n;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(!((n=this.room)===null||n===void 0)&&n.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");const i={kind:"setRTPMap",data:{map:e,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(i)}postSifTrailer(e){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");const n={kind:"setSifTrailer",data:{trailer:e}};this.worker.postMessage(n)}setupE2EEReceiver(e,n,i){if(e.receiver){if(!(i!=null&&i.mimeType)||i.mimeType==="")throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(e.receiver,e.mediaStreamID,n,e.kind==="video"?pc(i.mimeType):void 0)}}setupE2EESender(e,n){if(!Ls(e)||!n){n||ke.warn("early return because sender is not ready");return}this.handleSender(n,e.mediaStreamID,void 0)}handleReceiver(e,n,i,r){return E(this,void 0,void 0,function*(){if(this.worker){if(km()){const s={kind:"decode",participantIdentity:i,trackId:n,codec:r};e.transform=new RTCRtpScriptTransform(this.worker,s)}else{if(Ha in e&&r){const l={kind:"updateCodec",data:{trackId:n,codec:r,participantIdentity:i}};this.worker.postMessage(l);return}let s=e.writableStream,o=e.readableStream;if(!s||!o){const l=e.createEncodedStreams();e.writableStream=l.writable,s=l.writable,e.readableStream=l.readable,o=l.readable}const a={kind:"decode",data:{readableStream:o,writableStream:s,trackId:n,codec:r,participantIdentity:i,isReuse:Ha in e}};this.worker.postMessage(a,[o,s])}e[Ha]=!0}})}handleSender(e,n,i){var r;if(!(Ha in e||!this.worker)){if(!(!((r=this.room)===null||r===void 0)&&r.localParticipant.identity)||this.room.localParticipant.identity==="")throw TypeError("local identity needs to be known in order to set up encrypted sender");if(km()){ke.info("initialize script transform");const s={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:n,codec:i};e.transform=new RTCRtpScriptTransform(this.worker,s)}else{ke.info("initialize encoded streams");const s=e.createEncodedStreams(),o={kind:"encode",data:{readableStream:s.readable,writableStream:s.writable,codec:i,trackId:n,participantIdentity:this.room.localParticipant.identity,isReuse:!1}};this.worker.postMessage(o,[s.readable,s.writable])}e[Ha]=!0}}}const wf="default";class Tt{constructor(){this._previousDevices=[]}static getInstance(){return this.instance===void 0&&(this.instance=new Tt),this.instance}get previousDevices(){return this._previousDevices}getDevices(e){return E(this,arguments,void 0,function(n){var i=this;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var s;if(((s=Tt.userMediaPromiseMap)===null||s===void 0?void 0:s.size)>0){ke.debug("awaiting getUserMedia promise");try{n?yield Tt.userMediaPromiseMap.get(n):yield Promise.all(Tt.userMediaPromiseMap.values())}catch{ke.warn("error waiting for media permissons")}}let o=yield navigator.mediaDevices.enumerateDevices();if(r&&!(Ys()&&i.hasDeviceInUse(n))&&(o.filter(l=>l.kind===n).length===0||o.some(l=>{const d=l.label==="",u=n?l.kind===n:!0;return d&&u}))){const l={video:n!=="audioinput"&&n!=="audiooutput",audio:n!=="videoinput"&&{deviceId:{ideal:"default"}}},d=yield navigator.mediaDevices.getUserMedia(l);o=yield navigator.mediaDevices.enumerateDevices(),d.getTracks().forEach(u=>{u.stop()})}return i._previousDevices=o,n&&(o=o.filter(a=>a.kind===n)),o}()})}normalizeDeviceId(e,n,i){return E(this,void 0,void 0,function*(){if(n!==wf)return n;const r=yield this.getDevices(e),s=r.find(a=>a.deviceId===wf);if(!s){ke.warn("could not reliably determine default device");return}const o=r.find(a=>a.deviceId!==wf&&a.groupId===(i??s.groupId));if(!o){ke.warn("could not reliably determine default device");return}return o==null?void 0:o.deviceId})}hasDeviceInUse(e){return e?Tt.userMediaPromiseMap.has(e):Tt.userMediaPromiseMap.size>0}}Tt.mediaDeviceKinds=["audioinput","audiooutput","videoinput"];Tt.userMediaPromiseMap=new Map;var mc;(function(t){t[t.WAITING=0]="WAITING",t[t.RUNNING=1]="RUNNING",t[t.COMPLETED=2]="COMPLETED"})(mc||(mc={}));class F4{constructor(){this.pendingTasks=new Map,this.taskMutex=new dn,this.nextTaskIndex=0}run(e){return E(this,void 0,void 0,function*(){const n={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:mc.WAITING};this.pendingTasks.set(n.id,n);const i=yield this.taskMutex.lock();try{return n.executedAt=Date.now(),n.status=mc.RUNNING,yield e()}finally{n.status=mc.COMPLETED,this.pendingTasks.delete(n.id),i()}})}flush(){return E(this,void 0,void 0,function*(){return this.run(()=>E(this,void 0,void 0,function*(){}))})}snapshot(){return Array.from(this.pendingTasks.values())}}function V4(t,e){const n=new URL(T4(t));return e.forEach((i,r)=>{n.searchParams.set(r,i)}),xE(n,"rtc")}function z4(t){const e=new URL(Pm(t));return xE(e,"validate")}function B4(t){return t.endsWith("/")?t:"".concat(t,"/")}function xE(t,e){return t.pathname="".concat(B4(t.pathname)).concat(e),t.toString()}const W4=["syncState","trickle","offer","answer","simulate","leave"];function H4(t){const e=W4.indexOf(t.case)>=0;return ke.trace("request allowed to bypass queue:",{canPass:e,req:t}),e}var Je;(function(t){t[t.CONNECTING=0]="CONNECTING",t[t.CONNECTED=1]="CONNECTED",t[t.RECONNECTING=2]="RECONNECTING",t[t.DISCONNECTING=3]="DISCONNECTING",t[t.DISCONNECTED=4]="DISCONNECTED"})(Je||(Je={}));class Ov{get currentState(){return this.state}get isDisconnected(){return this.state===Je.DISCONNECTING||this.state===Je.DISCONNECTED}get isEstablishingConnection(){return this.state===Je.CONNECTING||this.state===Je.RECONNECTING}getNextRequestId(){return this._requestId+=1,this._requestId}constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var i;this.rtt=0,this.state=Je.DISCONNECTED,this.log=ke,this._requestId=0,this.resetCallbacks=()=>{this.onAnswer=void 0,this.onLeave=void 0,this.onLocalTrackPublished=void 0,this.onLocalTrackUnpublished=void 0,this.onNegotiateRequested=void 0,this.onOffer=void 0,this.onRemoteMuteChanged=void 0,this.onSubscribedQualityUpdate=void 0,this.onTokenRefresh=void 0,this.onTrickle=void 0,this.onClose=void 0},this.log=rr((i=n.loggerName)!==null&&i!==void 0?i:ri.Signal),this.loggerContextCb=n.loggerContextCb,this.useJSON=e,this.requestQueue=new F4,this.queuedRequests=[],this.closingLock=new dn,this.connectionLock=new dn,this.state=Je.DISCONNECTED}get logContext(){var e,n;return(n=(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this))!==null&&n!==void 0?n:{}}join(e,n,i,r){return E(this,void 0,void 0,function*(){return this.state=Je.CONNECTING,this.options=i,yield this.connect(e,n,i,r)})}reconnect(e,n,i,r){return E(this,void 0,void 0,function*(){if(!this.options){this.log.warn("attempted to reconnect without signal options being set, ignoring",this.logContext);return}return this.state=Je.RECONNECTING,this.clearPingInterval(),yield this.connect(e,n,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:i,reconnectReason:r}))})}connect(e,n,i,r){this.connectOptions=i;const s=w4(),o=$4(n,s,i),a=V4(e,o),l=z4(a);return new Promise((d,u)=>E(this,void 0,void 0,function*(){const h=yield this.connectionLock.lock();try{const p=()=>E(this,void 0,void 0,function*(){this.close(),clearTimeout(g),u(new $e("room connection has been cancelled (signal)",Ie.Cancelled))}),g=setTimeout(()=>{this.close(),u(new $e("room connection has timed out (signal)",Ie.ServerUnreachable))},i.websocketTimeout);r!=null&&r.aborted&&p(),r==null||r.addEventListener("abort",p);const b=new URL(a);b.searchParams.has("access_token")&&b.searchParams.set("access_token","<redacted>"),this.log.debug("connecting to ".concat(b),Object.assign({reconnect:i.reconnect,reconnectReason:i.reconnectReason},this.logContext)),this.ws&&(yield this.close(!1)),this.ws=new WebSocket(a),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{clearTimeout(g)},this.ws.onerror=m=>E(this,void 0,void 0,function*(){if(this.state!==Je.CONNECTED){this.state=Je.DISCONNECTED,clearTimeout(g);try{const k=yield fetch(l);if(k.status.toFixed(0).startsWith("4")){const v=yield k.text();u(new $e(v,Ie.NotAllowed,k.status))}else u(new $e("Encountered unknown websocket error during connection: ".concat(m.toString()),Ie.InternalError,k.status))}catch(k){u(new $e(k instanceof Error?k.message:"server was not reachable",Ie.ServerUnreachable))}return}this.handleWSError(m)}),this.ws.onmessage=m=>E(this,void 0,void 0,function*(){var k,v,y;let x;if(typeof m.data=="string"){const S=JSON.parse(m.data);x=Ob.fromJson(S,{ignoreUnknownFields:!0})}else if(m.data instanceof ArrayBuffer)x=Ob.fromBinary(new Uint8Array(m.data));else{this.log.error("could not decode websocket message: ".concat(typeof m.data),this.logContext);return}if(this.state!==Je.CONNECTED){let S=!1;if(((k=x.message)===null||k===void 0?void 0:k.case)==="join"?(this.state=Je.CONNECTED,r==null||r.removeEventListener("abort",p),this.pingTimeoutDuration=x.message.value.pingTimeout,this.pingIntervalDuration=x.message.value.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&(this.log.debug("ping config",Object.assign(Object.assign({},this.logContext),{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration})),this.startPingInterval()),d(x.message.value)):this.state===Je.RECONNECTING&&x.message.case!=="leave"?(this.state=Je.CONNECTED,r==null||r.removeEventListener("abort",p),this.startPingInterval(),((v=x.message)===null||v===void 0?void 0:v.case)==="reconnect"?d(x.message.value):(this.log.debug("declaring signal reconnected without reconnect response received",this.logContext),d(void 0),S=!0)):this.isEstablishingConnection&&x.message.case==="leave"?u(new $e("Received leave request while trying to (re)connect",Ie.LeaveRequest,void 0,x.message.value.reason)):i.reconnect||u(new $e("did not receive join response, got ".concat((y=x.message)===null||y===void 0?void 0:y.case," instead"),Ie.InternalError)),!S)return}this.signalLatency&&(yield un(this.signalLatency)),this.handleSignalResponse(x)}),this.ws.onclose=m=>{this.isEstablishingConnection&&u(new $e("Websocket got closed during a (re)connection attempt",Ie.InternalError)),this.log.warn("websocket closed",Object.assign(Object.assign({},this.logContext),{reason:m.reason,code:m.code,wasClean:m.wasClean,state:this.state})),this.handleOnClose(m.reason)}}finally{h()}}))}close(){return E(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){const i=yield e.closingLock.lock();try{if(e.clearPingInterval(),n&&(e.state=Je.DISCONNECTING),e.ws){e.ws.onmessage=null,e.ws.onopen=null,e.ws.onclose=null;const r=new Promise(s=>{e.ws?e.ws.onclose=()=>{s()}:s()});e.ws.readyState<e.ws.CLOSING&&(e.ws.close(),yield Promise.race([r,un(250)])),e.ws=void 0}}finally{n&&(e.state=Je.DISCONNECTED),i()}}()})}sendOffer(e,n){this.log.debug("sending offer",Object.assign(Object.assign({},this.logContext),{offerSdp:e.sdp})),this.sendRequest({case:"offer",value:ku(e,n)})}sendAnswer(e,n){return this.log.debug("sending answer",Object.assign(Object.assign({},this.logContext),{answerSdp:e.sdp})),this.sendRequest({case:"answer",value:ku(e,n)})}sendIceCandidate(e,n){return this.log.debug("sending ice candidate",Object.assign(Object.assign({},this.logContext),{candidate:e})),this.sendRequest({case:"trickle",value:new Tv({candidateInit:JSON.stringify(e),target:n})})}sendMuteTrack(e,n){return this.sendRequest({case:"mute",value:new _v({sid:e,muted:n})})}sendAddTrack(e){return this.sendRequest({case:"addTrack",value:e})}sendUpdateLocalMetadata(e,n){return E(this,arguments,void 0,function(i,r){var s=this;let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return function*(){const a=s.getNextRequestId();return yield s.sendRequest({case:"updateMetadata",value:new E1({requestId:a,metadata:i,name:r,attributes:o})}),a}()})}sendUpdateTrackSettings(e){this.sendRequest({case:"trackSetting",value:e})}sendUpdateSubscription(e){return this.sendRequest({case:"subscription",value:e})}sendSyncState(e){return this.sendRequest({case:"syncState",value:e})}sendUpdateVideoLayers(e,n){return this.sendRequest({case:"updateLayers",value:new _1({trackSid:e,layers:n})})}sendUpdateSubscriptionPermissions(e,n){return this.sendRequest({case:"subscriptionPermission",value:new N1({allParticipants:e,trackPermissions:n})})}sendSimulateScenario(e){return this.sendRequest({case:"simulate",value:e})}sendPing(){return Promise.all([this.sendRequest({case:"ping",value:et.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new O1({timestamp:et.parse(Date.now()),rtt:et.parse(this.rtt)})})])}sendUpdateLocalAudioTrack(e,n){return this.sendRequest({case:"updateAudioTrack",value:new T1({trackSid:e,features:n})})}sendLeave(){return this.sendRequest({case:"leave",value:new uh({reason:Xn.CLIENT_INITIATED,action:Ho.DISCONNECT})})}sendRequest(e){return E(this,arguments,void 0,function(n){var i=this;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return function*(){if(!r&&!H4(n)&&i.state===Je.RECONNECTING){i.queuedRequests.push(()=>E(i,void 0,void 0,function*(){yield this.sendRequest(n,!0)}));return}if(r||(yield i.requestQueue.flush()),i.signalLatency&&(yield un(i.signalLatency)),i.isDisconnected){i.log.debug("skipping signal request (type: ".concat(n.case,") - SignalClient disconnected"));return}if(!i.ws||i.ws.readyState!==i.ws.OPEN){i.log.error("cannot send signal request before connected, type: ".concat(n==null?void 0:n.case),i.logContext);return}const o=new u3({message:n});try{i.useJSON?i.ws.send(o.toJsonString()):i.ws.send(o.toBinary())}catch(a){i.log.error("error sending signal message",Object.assign(Object.assign({}
593,i.logContext),{error:a}))}}()})}handleSignalResponse(e){var n,i;const r=e.message;if(r==null){this.log.debug("received unsupported message",this.logContext);return}let s=!1;if(r.case==="answer"){const o=rx(r.value);this.onAnswer&&this.onAnswer(o,r.value.id)}else if(r.case==="offer"){const o=rx(r.value);this.onOffer&&this.onOffer(o,r.value.id)}else if(r.case==="trickle"){const o=JSON.parse(r.value.candidateInit);this.onTrickle&&this.onTrickle(o,r.value.target)}else r.case==="update"?this.onParticipantUpdate&&this.onParticipantUpdate((n=r.value.participants)!==null&&n!==void 0?n:[]):r.case==="trackPublished"?this.onLocalTrackPublished&&this.onLocalTrackPublished(r.value):r.case==="speakersChanged"?this.onSpeakersChanged&&this.onSpeakersChanged((i=r.value.speakers)!==null&&i!==void 0?i:[]):r.case==="leave"?this.onLeave&&this.onLeave(r.value):r.case==="mute"?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(r.value.sid,r.value.muted):r.case==="roomUpdate"?this.onRoomUpdate&&r.value.room&&this.onRoomUpdate(r.value.room):r.case==="connectionQuality"?this.onConnectionQuality&&this.onConnectionQuality(r.value):r.case==="streamStateUpdate"?this.onStreamStateUpdate&&this.onStreamStateUpdate(r.value):r.case==="subscribedQualityUpdate"?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(r.value):r.case==="subscriptionPermissionUpdate"?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(r.value):r.case==="refreshToken"?this.onTokenRefresh&&this.onTokenRefresh(r.value):r.case==="trackUnpublished"?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(r.value):r.case==="subscriptionResponse"?this.onSubscriptionError&&this.onSubscriptionError(r.value):r.case==="pong"||(r.case==="pongResp"?(this.rtt=Date.now()-Number.parseInt(r.value.lastPingTimestamp.toString()),this.resetPingTimeout(),s=!0):r.case==="requestResponse"?this.onRequestResponse&&this.onRequestResponse(r.value):r.case==="trackSubscribed"?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(r.value.trackSid):r.case==="roomMoved"?(this.onTokenRefresh&&this.onTokenRefresh(r.value.token),this.onRoomMoved&&this.onRoomMoved(r.value)):this.log.debug("unsupported message",Object.assign(Object.assign({},this.logContext),{msgCase:r.case})));s||this.resetPingTimeout()}setReconnected(){for(;this.queuedRequests.length>0;){const e=this.queuedRequests.shift();e&&this.requestQueue.run(e)}}handleOnClose(e){return E(this,void 0,void 0,function*(){if(this.state===Je.DISCONNECTED)return;const n=this.onClose;yield this.close(),this.log.debug("websocket connection closed: ".concat(e),Object.assign(Object.assign({},this.logContext),{reason:e})),n&&n(e)})}handleWSError(e){this.log.error("websocket error",Object.assign(Object.assign({},this.logContext),{error:e}))}resetPingTimeout(){if(this.clearPingTimeout(),!this.pingTimeoutDuration){this.log.warn("ping timeout duration not set",this.logContext);return}this.pingTimeout=Nt.setTimeout(()=>{this.log.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-this.pingTimeoutDuration*1e3).toUTCString()),this.logContext),this.handleOnClose("ping timeout")},this.pingTimeoutDuration*1e3)}clearPingTimeout(){this.pingTimeout&&Nt.clearTimeout(this.pingTimeout)}startPingInterval(){if(this.clearPingInterval(),this.resetPingTimeout(),!this.pingIntervalDuration){this.log.warn("ping interval duration not set",this.logContext);return}this.log.debug("start ping interval",this.logContext),this.pingInterval=Nt.setInterval(()=>{this.sendPing()},this.pingIntervalDuration*1e3)}clearPingInterval(){this.log.debug("clearing ping interval",this.logContext),this.clearPingTimeout(),this.pingInterval&&Nt.clearInterval(this.pingInterval)}}function rx(t){const e={type:"offer",sdp:t.sdp};switch(t.type){case"answer":case"offer":case"pranswer":case"rollback":e.type=t.type;break}return e}function ku(t,e){return new Qs({sdp:t.sdp,type:t.type,id:e})}function $4(t,e,n){var i;const r=new URLSearchParams;return r.set("access_token",t),n.reconnect&&(r.set("reconnect","1"),n.sid&&r.set("sid",n.sid)),r.set("auto_subscribe",n.autoSubscribe?"1":"0"),r.set("sdk",_i()?"reactnative":"js"),r.set("version",e.version),r.set("protocol",e.protocol.toString()),e.deviceModel&&r.set("device_model",e.deviceModel),e.os&&r.set("os",e.os),e.osVersion&&r.set("os_version",e.osVersion),e.browser&&r.set("browser",e.browser),e.browserVersion&&r.set("browser_version",e.browserVersion),n.adaptiveStream&&r.set("adaptive_stream","1"),n.reconnectReason&&r.set("reconnect_reason",n.reconnectReason.toString()),!((i=navigator.connection)===null||i===void 0)&&i.type&&r.set("network",navigator.connection.type),r}class sx{constructor(){this.buffer=[],this._totalSize=0}push(e){this.buffer.push(e),this._totalSize+=e.data.byteLength}pop(){const e=this.buffer.shift();return e&&(this._totalSize-=e.data.byteLength),e}getAll(){return this.buffer.slice()}popToSequence(e){for(;this.buffer.length>0&&this.buffer[0].sequence<=e;)this.pop()}alignBufferedAmount(e){for(;this.buffer.length>0;){const n=this.buffer[0];if(this._totalSize-n.data.byteLength<=e)break;this.pop()}}get length(){return this.buffer.length}}class q4{constructor(e){this._map=new Map,this._lastCleanup=0,this.ttl=e}set(e,n){const i=Date.now();i-this._lastCleanup>this.ttl/2&&this.cleanup();const r=i+this.ttl;return this._map.set(e,{value:n,expiresAt:r}),this}get(e){const n=this._map.get(e);if(n){if(n.expiresAt<Date.now()){this._map.delete(e);return}return n.value}}has(e){const n=this._map.get(e);return n?n.expiresAt<Date.now()?(this._map.delete(e),!1):!0:!1}delete(e){return this._map.delete(e)}clear(){this._map.clear()}cleanup(){const e=Date.now();for(const[n,i]of this._map.entries())i.expiresAt<e&&this._map.delete(n);this._lastCleanup=e}get size(){return this.cleanup(),this._map.size}forEach(e){this.cleanup();for(const[n,i]of this._map.entries())i.expiresAt>
593=Date.now()&&e(i.value,n,this.asValueMap())}map(e){this.cleanup();const n=[],i=this.asValueMap();for(const[r,s]of i.entries())n.push(e(s,r,i));return n}asValueMap(){const e=new Map;for(const[n,i]of this._map.entries())i.expiresAt>=Date.now()&&e.set(n,i.value);return e}}var Fn={},Cf={},Tf={exports:{}},ox;function Dv(){if(ox)return Tf.exports;ox=1;var t=Tf.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return e.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return e.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return e.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var n="candidate:%s %d %s %d %s %d typ %s";return n+=e.raddr!=null?" raddr %s rport %d":"%v%v",n+=e.tcptype!=null?" tcptype %s":"%v",e.generation!=null&&(n+=" generation %d"),n+=e["network-id"]!=null?" network-id %d":"%v",n+=e["network-cost"]!=null?" network-cost %d":"%v",n}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var n="ssrc:%d";return e.attribute!=null&&(n+=" %s",e.value!=null&&(n+=":%s")),n}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","max
593MessageSize"],format:function(e){return e.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(e.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var n="mediaclk:";return n+=e.id!=null?"id=%s %s":"%v%s",n+=e.mediaClockValue!=null?"=%s":"",n+=e.rateNumerator!=null?" rate=%s":"",n+=e.rateDenominator!=null?"/%s":"",n}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(t).forEach(function(e){var n=t[e];n.forEach(function(i){i.reg||(i.reg=/(.*)/),i.format||(i.format="%s")})}),Tf.exports}var ax;function K4(){return ax||(ax=1,function(t){var e=function(a){return String(Number(a))===a?Number(a):a},n=function(a,l,d,u){if(u&&!d)l[u]=e(a[1]);else for(var h=0;h<d.length;h+=1)a[h+1]!=null&&(l[d[h]]=e(a[h+1]))},i=function(a,l,d){var u=a.name&&a.names;a.push&&!l[a.push]?l[a.push]=[]:u&&!l[a.name]&&(l[a.name]={});var h=a.push?{}:u?l[a.name]:l;n(d.match(a.reg),h,a.names,a.name),a.push&&l[a.push].push(h)},r=Dv(),s=RegExp.prototype.test.bind(/^([a-z])=(.*)/);t.parse=function(a){var l={},d=[],u=l;return a.split(/(\r\n|\r|\n)/).filter(s).forEach(function(h){var p=h[0],g=h.slice(2);p==="m"&&(d.push({rtp:[],fmtp:[]}),u=d[d.length-1]);for(var b=0;b<(r[p]||[]).length;b+=1){var m=r[p][b];if(m.reg.test(g))return i(m,u,g)}}),l.media=d,l};var o=function(a,l){var d=l.split(/=(.+)/,2);return d.length===2?a[d[0]]=e(d[1]):d.length===1&&l.length>1&&(a[d[0]]=void 0),a};t.parseParams=function(a){return a.split(/;\s?/).reduce(o,{})},t.parseFmtpConfig=t.parseParams,t.parsePayloads=function(a){return a.toString().split(" ").map(Number)},t.parseRemoteCandidates=function(a){for(var l=[],d=a.split(" ").map(e),u=0;u<d.length;u+=3)l.push({component:d[u],ip:d[u+1],port:d[u+2]});return l},t.parseImageAttributes=function(a){return a.split(" ").map(function(l){return l.substring(1,l.length-1).split(",").reduce(o,{})})},t.parseSimulcastStreamList=function(a){return a.split(";").map(function(l){return l.split(",").map(function(d){var u,h=!1;return d[0]!=="~"?u=e(d):(u=e(d.substring(1,d.length)),h=!0),{scid:u,paused:h}})})}}(Cf)),Cf}var _f,cx;
vendor: 1,183 bytes, line 593
593function G4(){if(cx)return _f;cx=1;var t=Dv(),e=/%[sdv%]/g,n=function(o){var a=1,l=arguments,d=l.length;return o.replace(e,function(u){if(a>=d)return u;var h=l[a];switch(a+=1,u){case"%%":return"%";case"%s":return String(h);case"%d":return Number(h);case"%v":return""}})},i=function(o,a,l){var d=a.format instanceof Function?a.format(a.push?l:l[a.name]):a.format,u=[o+"="+d];if(a.names)for(var h=0;h<a.names.length;h+=1){var p=a.names[h];a.name?u.push(l[a.name][p]):u.push(l[a.names[h]])}else u.push(l[a.name]);return n.apply(null,u)},r=["v","o","s","i","u","e","p","c","b","t","r","z","a"],s=["i","c","b","a"];return _f=function(o,a){a=a||{},o.version==null&&(o.version=0),o.name==null&&(o.name=" "),o.media.forEach(function(h){h.payloads==null&&(h.payloads="")});var l=a.outerOrder||r,d=a.innerOrder||s,u=[];return l.forEach(function(h){t[h].forEach(function(p){p.name in o&&o[p.name]!=null?u.push(i(h,p,o)):p.push in o&&o[p.push]!=null&&o[p.push].forEach(function(g){u.push(i(h,p,g))})})}),o.media.forEach(function(h){u.push(i("m",t.m[0],h)),d.forEach(function(p){t[p].forEach(function(g){g.name in h&&h[g.name]!=null?u.push(i(p,g,h)):g.push in h&&h[g.push]!=null&&h[g.push].forEac
vendor: 4,126 bytes, lines 593-595
593h(function(b){u.push(i(p,g,b))})})})}),u.join(`\r 594`)+`\r 595`},_f}var lx;function Q4(){if(lx)return Fn;lx=1;var t=K4(),e=G4(),n=Dv();return Fn.grammar=n,Fn.write=e,Fn.parse=t.parse,Fn.parseParams=t.parseParams,Fn.parseFmtpConfig=t.parseFmtpConfig,Fn.parsePayloads=t.parsePayloads,Fn.parseRemoteCandidates=t.parseRemoteCandidates,Fn.parseImageAttributes=t.parseImageAttributes,Fn.parseSimulcastStreamList=t.parseSimulcastStreamList,Fn}var xr=Q4();function Lv(t,e,n){var i,r,s;e===void 0&&(e=50),n===void 0&&(n={});var o=(i=n.isImmediate)!=null&&i,a=(r=n.callback)!=null&&r,l=n.maxWait,d=Date.now(),u=[];function h(){if(l!==void 0){var g=Date.now()-d;if(g+e>=l)return l-g}return e}var p=function(){var g=[].slice.call(arguments),b=this;return new Promise(function(m,k){var v=o&&s===void 0;if(s!==void 0&&clearTimeout(s),s=setTimeout(function(){if(s=void 0,d=Date.now(),!o){var x=t.apply(b,g);a&&a(x),u.forEach(function(S){return(0,S.resolve)(x)}),u=[]}},h()),v){var y=t.apply(b,g);return a&&a(y),m(y)}u.push({resolve:m,reject:k})})};return p.cancel=function(g){s!==void 0&&clearTimeout(s),u.forEach(function(b){return(0,b.reject)(g)}),u=[]},p}const J4=.7,Y4=20,Ko={NegotiationStarted:"negotiationStarted",NegotiationComplete:"negotiationComplete",RTPVideoPayloadTypes:"rtpVideoPayloadTypes"};class dx extends Ni.EventEmitter{get pc(){return this._pc||(this._pc=this.createPC()),this._pc}constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var i;super(),this.log=ke,this.ddExtID=0,this.latestOfferId=0,this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate=!1,this.trackBitrates=[],this.remoteStereoMids=[],this.remoteNackMids=[],this.negotiate=Lv(r=>E(this,void 0,void 0,function*(){this.emit(Ko.NegotiationStarted);try{yield this.createAndSendOffer()}catch(s){if(r)r(s);else throw s}}),Y4),this.close=()=>{this._pc&&(this._pc.close(),this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.ondatachannel=null,this._pc.onnegotiationneeded=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ondatachannel=null,this._pc.ontrack=null,this._pc.onconnectionstatechange=null,this._pc.oniceconnectionstatechange=null,this._pc=null)},this.log=rr((i=n.loggerName)!==null&&i!==void 0?i:ri.PCTransport),this.loggerOptions=n,this.config=e,this._pc=this.createPC(),this.offerLock=new dn}createPC(){const e=new RTCPeerConnection(this.config);return e.onicecandidate=n=>{var i;n.candidate&&((i=this.onIceCandidate)===null||i===void 0||i.call(this,n.candidate))},e.onicecandidateerror=n=>{var i;(i=this.onIceCandidateError)===null||i===void 0||i.call(this,n)},e.oniceconnectionstatechange=()=>{var n;(n=this.onIceConnectionStateChange)===null||n===void 0||n.call(this,e.iceConnectionState)},e.onsignalingstatechange=()=>{var n;(n=this.onSignalingStatechange)===null||n===void 0||n.call(this,e.signalingState)},e.onconnectionstatechange=()=>{var n;(n=this.onConnectionStateChange)===null||n===void 0||n.call(this,e.connectionState)},e.ondatachannel=n=>{var i;(i=this.onDataChannel)===null||i===void 0||i.call(this,n)},e.ontrack=n=>{var i;(i=this.onTrack)===null||i===void 0||i.call(this,n)},e}get logContext(){var e,n;return Object.assign({},(n=(e=this.loggerOptions).loggerContextCb)===null||n===void 0?void 0:n.call(e))}get isICEConnected(){return this._pc!==null&&(this.pc.iceConnectionState==="connected"||this.pc.iceConnectionState==="completed")}addIceCandidate(e){return E(this,void 0,void 0,function*(){if(this.pc.remoteDescription&&!this.restartingIce)return this.pc.addIceCandidate(e);this.pendingCandidates.push(e)})}setRemoteDescription(e,n){return E(this,void 0,void 0,function*(){var i;if(e.type==="answer"&&this.latestOfferId>0&&n>0&&n!==this.latestOfferId)return this.log.warn("ignoring answer for old offer",Object.assign(Object.assign({},this.logContext),{offerId:n,latestOfferId:this.latestOfferId})),!1;let r;if(e.type==="offer"){let{stereoMids:s,nackMids:o}=X4(e);this.remoteStereoMids=s,this.remoteNackMids=o}else if(e.type==="answer"){const s=xr.parse((i=e.sdp)!==null&&i!==void 0?i:"");
595s.media.forEach(o=>{const a=Mv(o.mid);o.type==="audio"&&this.trackBitrates.some(l=>{if(!l.transceiver||a!=l.transceiver.mid)return!1;let d=0;if(o.rtp.some(h=>h.codec.toUpperCase()===l.codec.toUpperCase()?(d=h.payload,!0):!1),d===0)return!0;let u=!1;for(const h of o.fmtp)if(h.payload===d){h.config=h.config.split(";").filter(p=>!p.includes("maxaveragebitrate")).join(";"),l.maxbr>0&&(h.config+=";maxaveragebitrate=".concat(l.maxbr*1e3)),u=!0;break}return u||l.maxbr>0&&o.fmtp.push({payload:d,config:"maxaveragebitrate=".concat(l.maxbr*1e3)}),!0})}),r=xr.write(s)}return yield this.setMungedSDP(e,r,!0),this.pendingCandidates.forEach(s=>{this.pc.addIceCandidate(s)}),this.pendingCandidates=[],this.restartingIce=!1,this.renegotiate?(this.renegotiate=!1,yield this.createAndSendOffer()):e.type==="answer"&&(this.emit(Ko.NegotiationComplete),e.sdp&&xr.parse(e.sdp).media.forEach(o=>{o.type==="video"&&this.emit(Ko.RTPVideoPayloadTypes,o.rtp)})),!0})}createAndSendOffer(e){return E(this,void 0,void 0,function*(){var n;const i=yield this.offerLock.lock();try{if(this.onOffer===void 0)return;if(e!=null&&e.iceRestart&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),this._pc&&this._pc.signalingState==="have-local-offer"){const a=this._pc.remoteDescription;if(e!=null&&e.iceRestart&&a)yield this._pc.setRemoteDescription(a);else{this.renegotiate=!0;return}}else if(!this._pc||this._pc.signalingState==="closed"){this.log.warn("could not createOffer with closed peer connection",this.logContext);return}this.log.debug("starting to negotiate",this.logContext);const r=this.latestOfferId+1;this.latestOfferId=r;const s=yield this.pc.createOffer(e);this.log.debug("original offer",Object.assign({sdp:s.sdp},this.logContext));const o=xr.parse((n=s.sdp)!==null&&n!==void 0?n:"");if(o.media.forEach(a=>{hx(a),a.type==="audio"?ux(a,[],[]):a.type==="video"&&this.trackBitrates.some(l=>{if(!a.msid||!l.cid||!a.msid.includes(l.cid))return!1;let d=0;if(a.rtp.some(h=>h.codec.toUpperCase()===l.codec.toUpperCase()?(d=h.payload,!0):!1),d===0||(yi(l.codec)&&!Ys()&&this.ensureVideoDDExtensionForSVC(a,o),l.codec!=="av1"))return!0;const u=Math.round(l.maxbr*J4);for(const h of a.fmtp)if(h.payload===d){h.config.includes("x-google-start-bitrate")||(h.config+=";x-google-start-bitrate=".concat(u));break}return!0})}),this.latestOfferId>r){this.log.warn("latestOfferId mismatch",Object.assign(Object.assign({},this.logContext),{latestOfferId:this.latestOfferId,offerId:r}));return}yield this.setMungedSDP(s,xr.write(o)),this.onOffer(s,this.latestOfferId)}finally{i()}})}createAndSetAnswer(){return E(this,void 0,void 0,function*(){var e;const n=yield this.pc.createAnswer(),i=xr.parse((e=n.sdp)!==null&&e!==void 0?e:"");return i.media.forEach(r=>{hx(r),r.type==="audio"&&ux(r,this.remoteStereoMids,this.remoteNackMids)}),yield this.setMungedSDP(n,xr.write(i)),n})}createDataChannel(e,n){return this.pc.createDataChannel(e,n)}addTransceiver(e,n){return this.pc.addTransceiver(e,n)}addTrack(e){if(!this._pc)throw new yt("PC closed, cannot add track");return this._pc.addTrack(e)}setTrackCodecBitrate(e){this.trackBitrates.push(e)}setConfiguration(e){var n;if(!this._pc)throw new yt("PC closed, cannot configure");return(n=this._pc)===null||n===void 0?void 0:n.setConfiguration(e)}canRemoveTrack(){var e;return!!(!((e=this._pc)===null||e===void 0)&&e.removeTrack)}removeTrack(e){var n;return(n=this._pc)===null||n===void 0?void 0:n.removeTrack(e)}getConnectionState(){var e,n;return(n=(e=this._pc)===null||e===void 0?void 0:e.connectionState)!==null&&n!==void 0?n:"closed"}getICEConnectionState(){var e,n;return(n=(e=this._pc)===null||e===void 0?void 0:e.iceConnectionState)!==null&&n!==void 0?n:"closed"}getSignallingState(){var e,n;return(n=(e=this._pc)===null||e===void 0?void 0:e.signalingState)!==null&&n!==void 0?n:"closed"}getTransceivers(){var e,n;return(n=(e=this._pc)===null||e===void 0?void 0:e.getTransceivers())!==null&&n!==void 0?n:[]}getSenders(){var e,n;return(n=(e=this._pc)===null||e===void 0?void 0:e.getSenders())!==null&&n!==void 0?n:[]}getLocalDescription(){var e;return(e=this._pc)===null||e===void 0?void 0:e.localDescription}getRemoteDescription(){var e;return(e=this.pc)===null||e===void 0?void 0:e.remoteDescription}getStats(){return this.pc.getStats()}getConnectedAddress(){return E(this,void 0,void 0,function*(){var e;if(!this._pc)return;let n="";const i=new Map,r=new Map;
vendor: 7,707 bytes, line 595
595if((yield this._pc.getStats()).forEach(a=>{switch(a.type){case"transport":n=a.selectedCandidatePairId;break;case"candidate-pair":n===""&&a.selected&&(n=a.id),i.set(a.id,a);break;case"remote-candidate":r.set(a.id,"".concat(a.address,":").concat(a.port));break}}),n==="")return;const o=(e=i.get(n))===null||e===void 0?void 0:e.remoteCandidateId;if(o!==void 0)return r.get(o)})}setMungedSDP(e,n,i){return E(this,void 0,void 0,function*(){if(n){const r=e.sdp;e.sdp=n;try{this.log.debug("setting munged ".concat(i?"remote":"local"," description"),this.logContext),i?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e);return}catch(s){this.log.warn("not able to set ".concat(e.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:s,sdp:n})),e.sdp=r}}try{i?yield this.pc.setRemoteDescription(e):yield this.pc.setLocalDescription(e)}catch(r){let s="unknown error";r instanceof Error?s=r.message:typeof r=="string"&&(s=r);const o={error:s,sdp:e.sdp};throw!i&&this.pc.remoteDescription&&(o.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(e.type),Object.assign(Object.assign({},this.logContext),{fields:o})),new Sm(s)}})}ensureVideoDDExtensionForSVC(e,n){var i,r;if(!((i=e.ext)===null||i===void 0?void 0:i.some(o=>o.uri===Yb))){if(this.ddExtID===0){let o=0;n.media.forEach(a=>{var l;a.type==="video"&&((l=a.ext)===null||l===void 0||l.forEach(d=>{d.value>o&&(o=d.value)}))}),this.ddExtID=o+1}(r=e.ext)===null||r===void 0||r.push({value:this.ddExtID,uri:Yb})}}}function ux(t,e,n){const i=Mv(t.mid);let r=0;t.rtp.some(s=>s.codec==="opus"?(r=s.payload,!0):!1),r>0&&(t.rtcpFb||(t.rtcpFb=[]),n.includes(i)&&!t.rtcpFb.some(s=>s.payload===r&&s.type==="nack")&&t.rtcpFb.push({payload:r,type:"nack"}),e.includes(i)&&t.fmtp.some(s=>s.payload===r?(s.config.includes("stereo=1")||(s.config+=";stereo=1"),!0):!1))}function X4(t){var e;const n=[],i=[],r=xr.parse((e=t.sdp)!==null&&e!==void 0?e:"");let s=0;return r.media.forEach(o=>{var a;const l=Mv(o.mid);o.type==="audio"&&(o.rtp.some(d=>d.codec==="opus"?(s=d.payload,!0):!1),!((a=o.rtcpFb)===null||a===void 0)&&a.some(d=>d.payload===s&&d.type==="nack")&&i.push(l),o.fmtp.some(d=>d.payload===s?(d.config.includes("sprop-stereo=1")&&n.push(l),!0):!1))}),{stereoMids:n,nackMids:i}}function hx(t){if(t.connection){const e=t.connection.ip.indexOf(":")>=0;(t.connection.version===4&&e||t.connection.version===6&&!e)&&(t.connection.ip="0.0.0.0",t.connection.version=4)}}function Mv(t){return typeof t=="number"?t.toFixed(0):t}const jm="vp8",Z4={audioPreset:wm.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:jv.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:jm,backupCodec:!0,preConnectBuffer:!1},kE={deviceId:{ideal:"default"},autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,voiceIsolation:!0},SE={deviceId:{ideal:"default"},resolution:ka.h720.resolution},eU={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new U3,disconnectOnPageLeave:!0,webAudioMix:!1},Uv={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};var ct;(function(t){t[t.NEW=0]="NEW",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED",t[t.FAILED=3]="FAILED",t[t.CLOSING=4]="CLOSING",t[t.CLOSED=5]="CLOSED"})(ct||(ct={}));class tU{get needsPublisher(){return this.isPublisherConnectionRequired}get needsSubscriber(){return this.isSubscriberConnectionRequired}get currentState(){return this.state}constructor(e,n,i){var r;this.peerConnectionTimeout=Uv.peerConnectionTimeout,this.log=ke,this.updateState=()=>{var s;const o=this.state,a=this.requiredTransports.map(l=>l.getConnectionState());a.every(l=>l==="connected")?this.state=ct.CONNECTED:a.some(l=>l==="failed")?this.state=ct.FAILED:a.some(l=>l==="connecting")?this.state=ct.CONNECTING:a.every(l=>l==="closed")?this.state=ct.CLOSED:a.some(l=>l==="closed")?this.state=ct.CLOSING:a.every(l=>l==="new")&&(this.state=ct.NEW),o!==this.state&&(this.log.debug("pc state change: from ".concat(ct[o]," to ").concat(ct[this.state]),this.logContext),(s=this.onStateChange)===null||s===void 0||s.call(this,this.state,this.publisher.getConnectionState(),this.subscriber.getConnectionState()))},this.log=rr((r=i.loggerName)!==null&&r!==void 0?r:ri.PCManager),this.loggerOptions=i,this.isPublisherConnectionRequired=!n,this.isSubscriberConnectionRequired=n,this.publisher=new dx(e,i),this.subscriber=new dx(e,i),this.publisher.onConnectionStateChange=this.updateState,this.subscriber.onConnectionStateChange=this.updateState,this.publisher.onIceConnectionStateChange=this.updateState,this.subscriber.onIceConnectionStateChange=this.updateState,this.publisher.onSignalingStatechange=this.updateState,this.subscriber.onSignalingStatechange=this.updateState,this.publisher.onIceCandidate=s=>{var o;(o=this.onIceCandidate)===null||o===void 0||o.call(this,s,Qn.PUBLISHER)},this.subscriber.onIceCandidate=s=>{var o;(o=this.onIceCandidate)===null||o===void 0||o.call(this,s,Qn.SUBSCRIBER)},this.subscriber.onDataChannel=s=>{var o;(o=this.onDataChannel)===null||o===void 0||o.call(this,s)},this.subscriber.onTrack=s=>{var o;(o=this.onTrack)===null||o===void 0||o.call(this,s)},this.publisher.onOffer=(s,o)=>{var a;(a=this.onPublisherOffer)===null||a===void 0||a.call(this,s,o)},this.state=ct.NEW,this.connectionLock=new dn,this.remoteOfferLock=new dn}get logContext(){var e,n;return Object.assign({},(n=(e=this.loggerOptions).loggerContextCb)===null||n===void 0?void 0:n.call(e))}requirePublisher(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isPublisherConnectionRequired=e,this.updateState()}requireSubscriber(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.isSubscriberConnectionRequired=e,this.updateState()}createAndSendPublisherOffer(e){return this.publisher.createAndSendOffer(e)}setPublisherAnswer(e,n){return this.publisher.setRemoteDescription(e,n)}removeTrack(e){return this.publisher.removeTrack(e)}close(){return E(this,void 0,void 0,function*(){if(this.publisher&&this.publisher.getSignallingState()!=="closed"){const e=this.publisher;for(const n of e.getSenders())try{e.canRemoveTrack()&&e.removeTrack(n)}catch(i){this.log.warn("could not removeTrack",Object.assign(Object.assign({},this.logContext),{error:i}))}}yield Promise.all([this.publisher.close(),this.subscriber.close()]),this.updateState()})}triggerIceRestart(){return E(this,void 0,void 0,function*(){this.subscriber.restartingIce=!0,this.needsPublisher&&(yield this.createAndSendPublisherOffer({iceRestart:!0}))})}addIceCandidate(e,n){return E(this,void 0,void 0,function*(){n===Qn.PUBLISHER?yield this.publisher.addIceCandidate(e):yield this.subscriber.addIceCandidate(e)})}createSubscriberAnswerFromOffer(e,n){return E(this,void 0,void 0,function*(){this.log.debug("received server offer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,signalingState:this.subscriber.getSignallingState().toString()}));const i=yield this.remoteOfferLock.lock();try{return(yield this.subscriber.setRemoteDescription(e,n))?yield this.subscriber.createAndSetAnswer():void 0}finally{i()}})}updateConfiguration(e,n){this.publisher.setConfiguration(e),this.subscriber.setConfiguration(e),n&&this.triggerIceRestart()}ensurePCTransportConnection(e,n){return E(this,void 0,void 0,function*(){var i;const r=yield this.connectionLock.lock();try{this.isPublisherConnectionRequired&&this.publisher.getConnectionState()!=="connected"&&this.publisher.getConnectionState()!=="connecting"&&(this.log.debug("negotiation required, start negotiating",this.logContext),this.publisher.negotiate()),yield Promise.all((i=this.requiredTransports)===null||i===void 0?void 0:i.map(s=>
595this.ensureTransportConnected(s,e,n)))}finally{r()}})}negotiate(e){return E(this,void 0,void 0,function*(){return new Promise((n,i)=>E(this,void 0,void 0,function*(){const r=setTimeout(()=>{i("negotiation timed out")},this.peerConnectionTimeout),s=()=>{clearTimeout(r),i("negotiation aborted")};e.signal.addEventListener("abort",s),this.publisher.once(Ko.NegotiationStarted,()=>{e.signal.aborted||this.publisher.once(Ko.NegotiationComplete,()=>{clearTimeout(r),n()})}),yield this.publisher.negotiate(o=>{clearTimeout(r),i(o)})}))})}addPublisherTransceiver(e,n){return this.publisher.addTransceiver(e,n)}addPublisherTrack(e){return this.publisher.addTrack(e)}createPublisherDataChannel(e,n){return this.publisher.createDataChannel(e,n)}getConnectedAddress(e){return e===Qn.PUBLISHER?this.publisher.getConnectedAddress():e===Qn.SUBSCRIBER?this.publisher.getConnectedAddress():this.requiredTransports[0].getConnectedAddress()}get requiredTransports(){const e=[];return this.isPublisherConnectionRequired&&e.push(this.publisher),this.isSubscriberConnectionRequired&&e.push(this.subscriber),e}ensureTransportConnected(e,n){return E(this,arguments,void 0,function(i,r){var s=this;let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.peerConnectionTimeout;return function*(){if(i.getConnectionState()!=="connected")return new Promise((l,d)=>E(s,void 0,void 0,function*(){const u=()=>{this.log.warn("abort transport connection",this.logContext),Nt.clearTimeout(h),d(new $e("room connection has been cancelled",Ie.Cancelled))};r!=null&&r.signal.aborted&&u(),r==null||r.signal.addEventListener("abort",u);const h=Nt.setTimeout(()=>{r==null||r.signal.removeEventListener("abort",u),d(new $e("could not establish pc connection",Ie.InternalError))},o);for(;this.state!==ct.CONNECTED;)if(yield un(50),r!=null&&r.signal.aborted){d(new $e("room connection has been cancelled",Ie.Cancelled));return}Nt.clearTimeout(h),r==null||r.signal.removeEventListener("abort",u),l()}))}()})}}class ut extends Error{constructor(e,n,i){super(n),this.code=e,this.message=fx(n,ut.MAX_MESSAGE_BYTES),this.data=i?fx(i,ut.MAX_DATA_BYTES):void 0}static fromProto(e){return new ut(e.code,e.message,e.data)}toProto(){return new m1({code:this.code,message:this.message,data:this.data})}static builtIn(e,n){return new ut(ut.ErrorCode[e],ut.ErrorMessage[e],n)}}ut.MAX_MESSAGE_BYTES=256;ut.MAX_DATA_BYTES=15360;ut.ErrorCode={APPLICATION_ERROR:1500,CONNECTION_TIMEOUT:1501,RESPONSE_TIMEOUT:1502,RECIPIENT_DISCONNECTED:1503,RESPONSE_PAYLOAD_TOO_LARGE:1504,SEND_FAILED:1505,UNSUPPORTED_METHOD:1400,RECIPIENT_NOT_FOUND:1401,REQUEST_PAYLOAD_TOO_LARGE:1402,UNSUPPORTED_SERVER:1403,UNSUPPORTED_VERSION:1404};ut.ErrorMessage={APPLICATION_ERROR:"Application error in method handler",CONNECTION_TIMEOUT:"Connection timeout",RESPONSE_TIMEOUT:"Response timeout",RECIPIENT_DISCONNECTED:"Recipient disconnected",RESPONSE_PAYLOAD_TOO_LARGE:"Response payload too large",SEND_FAILED:"Failed to send",UNSUPPORTED_METHOD:"Method not supported at destination",RECIPIENT_NOT_FOUND:"Recipient not found",REQUEST_PAYLOAD_TOO_LARGE:"Request payload too large",UNSUPPORTED_SERVER:"RPC not supported by server",UNSUPPORTED_VERSION:"Unsupported RPC version"};const wE=15360;function Fv(t){return new TextEncoder().encode(t).length}function fx(t,e){if(Fv(t)<=e)return t;let n=0,i=t.length;const r=new TextEncoder;for(;n<i;){const s=Math.floor((n+i+1)/2);r.encode(t.slice(0,s)).length<=e?n=s:i=s-1}return t.slice(0,n)}const Vv=2e3;function fh(t,e){if(!e)return 0;let n,i;return"bytesReceived"in t?(n=t.bytesReceived,i=e.bytesReceived):"bytesSent"in t&&(n=t.bytesSent,i=e.bytesSent),n===void 0||i===void 0||t.timestamp===void 0||e.timestamp===void 0?0:(n-i)*8*1e3/(t.timestamp-e.timestamp)}const zv=typeof MediaRecorder<"u";class nU{constructor(){throw new Error("MediaRecorder is not available in this environment")}}const iU=zv?MediaRecorder:nU;class rU extends iU{constructor(e,n){if(!zv)throw new Error("MediaRecorder is not available in this environment");super(new MediaStream([e.mediaStreamTrack]),n);let i,r;const s=()=>r===void 0,o=()=>{this.removeEventListener("dataavailable",i),this.removeEventListener("stop",o),this.removeEventListener("error",a),r==null||r.close(),r=void 0},a=l=>{r==null||r.error(l),this.removeEventListener("dataavailable",i),this.removeEventListener("stop",o),this.removeEventListener("error",a),r=void 0};this.byteStream=new ReadableStream({start:l=>{r=l,i=d=>E(this,void 0,void 0,function*(){let u;if(d.data.arrayBuffer){const h=yield d.data.arrayBuffer();u=new Uint8Array(h)}else if(d.data.byteArray)u=d.data.byteArray;else throw new Error("no data available!");s()||l.enqueue(u)}),this.addEventListener("dataavailable",i)},cancel:()=>{o()}}),this.addEventListener("stop",o),this.addEventListener("error",a)}}function sU(){return zv}const oU=1e3,aU=1e4;class CE extends V{get sender(){return this._sender}set sender(e){this._sender=e}get constraints(){return this._constraints}get hasPreConnectBuffer(){return!!this.localTrackRecorder}constructor(e,n,i){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=arguments.length>4?arguments[4]:void 0;super(e,n,s),this.manuallyStopped=!1,this._isUpstreamPaused=!1,this.handleTrackMuteEvent=()=>this.debouncedTrackMuteHandler().catch(()=>this.log.debug("track mute bounce got cancelled by an unmute event",this.logContext)),this.debouncedTrackMuteHandler=Lv(()=>E(this,void 0,void 0,function*(){yield this.pauseUpstream()}),5e3),this.handleTrackUnmuteEvent=()=>E(this,void 0,void 0,function*(){this.debouncedTrackMuteHandler.cancel("unmute"),yield this.resumeUpstream()}),this.handleEnded=()=>
vendor: 4,720 bytes, line 595
595{this.isInBackground&&(this.reacquireTrack=!0),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),this.emit($.Ended,this)},this.reacquireTrack=!1,this.providedByUser=r,this.muteLock=new dn,this.pauseUpstreamLock=new dn,this.trackChangeLock=new dn,this.trackChangeLock.lock().then(o=>E(this,void 0,void 0,function*(){try{yield this.setMediaStreamTrack(e,!0)}finally{o()}})),this._constraints=e.getConstraints(),i&&(this._constraints=i)}get id(){return this._mediaStreamTrack.id}get dimensions(){if(this.kind!==V.Kind.Video)return;const{width:e,height:n}=this._mediaStreamTrack.getSettings();if(e&&n)return{width:e,height:n}}get isUpstreamPaused(){return this._isUpstreamPaused}get isUserProvided(){return this.providedByUser}get mediaStreamTrack(){var e,n;return(n=(e=this.processor)===null||e===void 0?void 0:e.processedTrack)!==null&&n!==void 0?n:this._mediaStreamTrack}get isLocal(){return!0}getSourceTrackSettings(){return this._mediaStreamTrack.getSettings()}setMediaStreamTrack(e,n){return E(this,void 0,void 0,function*(){var i;if(e===this._mediaStreamTrack&&!n)return;this._mediaStreamTrack&&(this.attachedElements.forEach(s=>{qo(this._mediaStreamTrack,s)}),this.debouncedTrackMuteHandler.cancel("new-track"),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent)),this.mediaStream=new MediaStream([e]),e&&(e.addEventListener("ended",this.handleEnded),e.addEventListener("mute",this.handleTrackMuteEvent),e.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=e.getConstraints());let r;if(this.processor&&e){if(this.log.debug("restarting processor",this.logContext),this.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");this.processorElement&&(Ro(e,this.processorElement),this.processorElement.muted=!0),yield this.processor.restart({track:e,kind:this.kind,element:this.processorElement}),r=this.processor.processedTrack}this.sender&&((i=this.sender.transport)===null||i===void 0?void 0:i.state)!=="closed"&&(yield this.sender.replaceTrack(r??e)),!this.providedByUser&&this._mediaStreamTrack!==e&&this._mediaStreamTrack.stop(),this._mediaStreamTrack=e,e&&(this._mediaStreamTrack.enabled=!this.isMuted,yield this.resumeUpstream(),this.attachedElements.forEach(s=>{Ro(r??e,s)}))})}waitForDimensions(){return E(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:oU;return function*(){var i;if(e.kind===V.Kind.Audio)throw new Error("cannot get dimensions for audio tracks");((i=kn())===null||i===void 0?void 0:i.os)==="iOS"&&(yield un(10));const r=Date.now();for(;Date.now()-r<n;){const s=e.dimensions;if(s)return s;yield un(50)}throw new $i("unable to get track dimensions after timeout")}()})}setDeviceId(e){return E(this,void 0,void 0,function*(){return this._constraints.deviceId===e&&this._mediaStreamTrack.getSettings().deviceId===Zr(e)||(this._constraints.deviceId=e,this.isMuted)?!0:(yield this.restartTrack(),Zr(e)===this._mediaStreamTrack.getSettings().deviceId)})}getDeviceId(){return E(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){if(e.source===V.Source.ScreenShare)return;const{deviceId:i,groupId:r}=e._mediaStreamTrack.getSettings(),s=e.kind===V.Kind.Audio?"audioinput":"videoinput";return n?Tt.getInstance().normalizeDeviceId(s,i,r):i}()})}mute(){return E(this,void 0,void 0,function*(){return this.setTrackMuted(!0),this})}unmute(){return E(this,void 0,void 0,function*(){return this.setTrackMuted(!1),this})}replaceTrack(e,n){return E(this,void 0,void 0,function*(){const i=yield this.trackChangeLock.lock();try{if(!this.sender)throw new $i("unable to replace an unpublished track");let r,s;return typeof n=="boolean"?r=n:n!==void 0&&(r=n.userProvidedTrack,s=n.stopProcessor),this.providedByUser=r??!0,this.log.debug("replace MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(e),s&&this.processor&&(yield this.internalStopProcessor()),this}finally{i()}})}restart(e){return E(this,void 0,void 0,function*(){this.manuallyStopped=!1;const n=yield this.trackChangeLock.lock();try{e||(e=this._constraints);const{deviceId:i,facingMode:r}=e,s=F3(e,["deviceId","facingMode"]);this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:e}));const o={audio:!1,video:!1};this.kind===V.Kind.Video?o.video=i||r?{deviceId:i,facingMode:r}:!0:o.audio=i?Object.assign({deviceId:i}
595,s):!0,this.attachedElements.forEach(d=>{qo(this.mediaStreamTrack,d)}),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop();const l=(yield navigator.mediaDevices.getUserMedia(o)).getTracks()[0];return this.kind===V.Kind.Video&&(yield l.applyConstraints(s)),l.addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),yield this.setMediaStreamTrack(l),this._constraints=e,this.emit($.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),this}finally{n()}})}setTrackMuted(e){this.log.debug("setting ".concat(this.kind," track ").concat(e?"muted":"unmuted"),this.logContext),!(this.isMuted===e&&this._mediaStreamTrack.enabled!==e)&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit(e?$.Muted:$.Unmuted,this))}get needsReAcquisition(){return this._mediaStreamTrack.readyState!=="live"||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return E(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),fE()&&(this.log.debug("visibility changed, is in Background: ".concat(this.isInBackground),this.logContext),!this.isInBackground&&this.needsReAcquisition&&!this.isUserProvided&&!this.isMuted&&(this.log.debug("track needs to be reacquired, restarting ".concat(this.source),this.logContext),yield this.restart(),this.reacquireTrack=!1))})}stop(){var e;this.manuallyStopped=!0,super.stop(),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),(e=this.processor)===null||e===void 0||e.destroy(),this.processor=void 0}pauseUpstream(){return E(this,void 0,void 0,function*(){var e;const n=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!0)return;if(!this.sender){this.log.warn("unable to pause upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!0,this.emit($.UpstreamPaused,this);const i=kn();if((i==null?void 0:i.name)==="Safari"&&Ei(i.version,"12.0")<0)throw new Iv("pauseUpstream is not supported on Safari < 12.");((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(null))}finally{n()}})}resumeUpstream(){return E(this,void 0,void 0,function*(){var e;const n=yield this.pauseUpstreamLock.lock();try{if(this._isUpstreamPaused===!1)return;if(!this.sender){this.log.warn("unable to resume upstream for an unpublished track",this.logContext);return}this._isUpstreamPaused=!1,this.emit($.UpstreamResumed,this),((e=this.sender.transport)===null||e===void 0?void 0:e.state)!=="closed"&&(yield this.sender.replaceTrack(this.mediaStreamTrack))}finally{n()}})}getRTCStatsReport(){return E(this,void 0,void 0,function*(){var e;return!((e=this.sender)===null||e===void 0)&&e.getStats?yield this.sender.getStats():void 0})}setProcessor(e){return E(this,arguments,void 0,function(n){var i=this;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var s;const o=yield i.trackChangeLock.lock();try{i.log.debug("setting up processor",i.logContext);const a=document.createElement(i.kind),l={kind:i.kind,track:i._mediaStreamTrack,element:a,audioContext:i.audioContext};if(yield n.init(l),i.log.debug("processor initialized",i.logContext),i.processor&&(yield i.internalStopProcessor()),i.kind==="unknown")throw TypeError("cannot set processor on track of unknown kind");if(Ro(i._mediaStreamTrack,a),a.muted=!0,a.play().catch(d=>{d instanceof DOMException&&d.name==="AbortError"?(i.log.warn("failed to play processor element, retrying",Object.assign(Object.assign({},i.logContext),{error:d})),setTimeout(()=>{a.play().catch(u=>{i.log.error("failed to play processor element",Object.assign(Object.assign({},i.logContext),{err:u}))})},100)):i.log.error("failed to play processor element",Object.assign(Object.assign({}
595,i.logContext),{error:d}))}),i.processor=n,i.processorElement=a,i.processor.processedTrack){for(const d of i.attachedElements)d!==i.processorElement&&r&&(qo(i._mediaStreamTrack,d),Ro(i.processor.processedTrack,d));yield(s=i.sender)===null||s===void 0?void 0:s.replaceTrack(i.processor.processedTrack)}i.emit($.TrackProcessorUpdate,i.processor)}finally{o()}}()})}getProcessor(){return this.processor}stopProcessor(){return E(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){const i=yield e.trackChangeLock.lock();try{yield e.internalStopProcessor(n)}finally{i()}}()})}internalStopProcessor(){return E(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var i,r;e.processor&&(e.log.debug("stopping processor",e.logContext),(i=e.processor.processedTrack)===null||i===void 0||i.stop(),yield e.processor.destroy(),e.processor=void 0,n||((r=e.processorElement)===null||r===void 0||r.remove(),e.processorElement=void 0),yield e._mediaStreamTrack.applyConstraints(e._constraints),yield e.setMediaStreamTrack(e._mediaStreamTrack,!0),e.emit($.TrackProcessorUpdate))}()})}startPreConnectBuffer(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:100;if(!sU()){this.log.warn("MediaRecorder is not available, cannot start preconnect buffer",this.logContext);return}if(this.localTrackRecorder){this.log.warn("preconnect buffer already started");return}else{let n="audio/webm;codecs=opus";MediaRecorder.isTypeSupported(n)||(n="video/mp4"),this.localTrackRecorder=new rU(this,{mimeType:n})}this.localTrackRecorder.start(e),this.autoStopPreConnectBuffer=setTimeout(()=>{this.log.warn("preconnect buffer timed out, stopping recording automatically",this.logContext),this.stopPreConnectBuffer()},aU)}stopPreConnectBuffer(){clearTimeout(this.autoStopPreConnectBuffer),this.localTrackRecorder&&(this.localTrackRecorder.stop(),this.localTrackRecorder=void 0)}getPreConnectBuffer(){var e;return(e=this.localTrackRecorder)===null||e===void 0?void 0:e.byteStream}getPreConnectBufferMimeType(){var e;return(e=this.localTrackRecorder)===null||e===void 0?void 0:e.mimeType}}class Su extends CE{get enhancedNoiseCancellation(){return this.isKrispNoiseFilterEnabled}constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;super(e,V.Kind.Audio,n,i,s),this.stopOnMute=!1,this.isKrispNoiseFilterEnabled=!1,this.monitorSender=()=>E(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let o;try{o=yield this.getSenderStats()}catch(a){this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:a}));return}o&&this.prevStats&&(this._currentBitrate=fh(o,this.prevStats)),this.prevStats=o}),this.handleKrispNoiseFilterEnable=()=>{this.isKrispNoiseFilterEnabled=!0,this.log.debug("Krisp noise filter enabled",this.logContext),this.emit($.AudioTrackFeatureUpdate,this,Ct.TF_ENHANCED_NOISE_CANCELLATION,!0)},this.handleKrispNoiseFilterDisable=()=>{this.isKrispNoiseFilterEnabled=!1,this.log.debug("Krisp noise filter disabled",this.logContext),this.emit($.AudioTrackFeatureUpdate,this,Ct.TF_ENHANCED_NOISE_CANCELLATION,!1)},this.audioContext=r,this.checkForSilence()}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return E(this,void 0,void 0,function*(){const n=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===V.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{n()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return E(this,void 0,void 0,function*(){const n=yield this.muteLock.lock();try{if(!this.isMuted)return this.log.debug("Track already unmuted",this.logContext),this;const i=this._constraints.deviceId&&this._mediaStreamTrack.getSettings().deviceId!==Zr(this._constraints.deviceId);return this.source===V.Source.Microphone&&(this.stopOnMute||this._mediaStreamTrack.readyState==="ended"||i)&&!this.isUserProvided&&(this.log.debug("reacquiring mic track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this}finally{n()}})}restartTrack(e){return E(this,void 0,void 0,function*(){let n;if(e){const i=Av({audio:e});typeof i.audio!="boolean"&&(n=i.audio)}yield this.restart(n)})}restart(e){const n=Object.create(null,{restart:{get:()=>super.restart}});return E(this,void 0,void 0,function*(){const i=yield n.restart.call(this,e);return this.checkForSilence(),i})}startMonitor(){on()&&(this.monitorInterval||(this.monitorInterval=setInterval(()=>{this.monitorSender()},Vv)))}setProcessor(e){return E(this,void 0,void 0,function*(){var n;const i=yield this.trackChangeLock.lock();try{if(!_i()&&!this.audioContext)throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");this.processor&&(yield this.internalStopProcessor());const r={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext};this.log.debug("setting up audio processor ".concat(e.name),this.logContext),yield e.init(r),this.processor=e,this.processor.processedTrack&&(yield(n=this.sender)===null||n===void 0?void 0:n.replaceTrack(this.processor.processedTrack),this.processor.processedTrack.addEventListener("enable-lk-krisp-noise-filter",this.handleKrispNoiseFilterEnable),this.processor.processedTrack.addEventListener("disable-lk-krisp-noise-filter",this.handleKrispNoiseFilterDisable)),this.emit
vendor: 15,123 bytes, line 595
595($.TrackProcessorUpdate,this.processor)}finally{i()}})}setAudioContext(e){this.audioContext=e}getSenderStats(){return E(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return;const n=yield this.sender.getStats();let i;return n.forEach(r=>{r.type==="outbound-rtp"&&(i={type:"audio",streamId:r.id,packetsSent:r.packetsSent,packetsLost:r.packetsLost,bytesSent:r.bytesSent,timestamp:r.timestamp,roundTripTime:r.roundTripTime,jitter:r.jitter})}),i})}checkForSilence(){return E(this,void 0,void 0,function*(){const e=yield vE(this);return e&&(this.isMuted||this.log.warn("silence detected on local audio track",this.logContext),this.emit($.AudioSilenceDetected)),e})}}function cU(t,e,n){switch(t.kind){case"audio":return new Su(t,e,!1,void 0,n);case"video":return new wu(t,e,!1,n);default:throw new $i("unsupported track type: ".concat(t.kind))}}const lU=Object.values(ka),dU=Object.values(Cm),uU=Object.values(jv),hU=[ka.h180,ka.h360],fU=[Cm.h180,Cm.h360],pU=t=>[{scaleResolutionDownBy:2,fps:t.encoding.maxFramerate}].map(n=>{var i,r;return new ze(Math.floor(t.width/n.scaleResolutionDownBy),Math.floor(t.height/n.scaleResolutionDownBy),Math.max(15e4,Math.floor(t.encoding.maxBitrate/(Math.pow(n.scaleResolutionDownBy,2)*(((i=t.encoding.maxFramerate)!==null&&i!==void 0?i:30)/((r=n.fps)!==null&&r!==void 0?r:30))))),n.fps,t.encoding.priority)}),Am=["q","h","f"];function Om(t,e,n,i){var r,s;let o=i==null?void 0:i.videoEncoding;t&&(o=i==null?void 0:i.screenShareEncoding);const a=i==null?void 0:i.simulcast,l=i==null?void 0:i.scalabilityMode,d=i==null?void 0:i.videoCodec;if(!o&&!a&&!l||!e||!n)return[{}];o||(o=gU(t,e,n,d),ke.debug("using video encoding",o));const u=o.maxFramerate,h=new ze(e,n,o.maxBitrate,o.maxFramerate,o.priority);if(l&&yi(d)){const b=new TE(l),m=[];if(b.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(l));const k=kn();if(Wc()||_i()||(k==null?void 0:k.name)==="Chrome"&&Ei(k==null?void 0:k.version,"113")<0){const v=b.suffix=="h"?2:3,y=b4(k);for(let x=0;x<b.spatial;x+=1)m.push({rid:Am[2-x],maxBitrate:o.maxBitrate/Math.pow(v,x),maxFramerate:h.encoding.maxFramerate,scaleResolutionDownBy:y?Math.pow(2,x):void 0});m[0].scalabilityMode=l}else m.push({maxBitrate:o.maxBitrate,maxFramerate:h.encoding.maxFramerate,scalabilityMode:l});return h.encoding.priority&&(m[0].priority=h.encoding.priority,m[0].networkPriority=h.encoding.priority),ke.debug("using svc encoding",{encodings:m}),m}if(!a)return[o];let p=[];t?p=(r=mx(i==null?void 0:i.screenShareSimulcastLayers))!==null&&r!==void 0?r:px(t,h):p=(s=mx(i==null?void 0:i.videoSimulcastLayers))!==null&&s!==void 0?s:px(t,h);let g;if(p.length>0){const b=p[0];p.length>1&&([,g]=p);const m=Math.max(e,n);if(m>=960&&g)return Ef(e,n,[b,g,h],u);if(m>=480)return Ef(e,n,[b,h],u)}return Ef(e,n,[h])}function mU(t,e,n){var i,r,s,o;if(!n.backupCodec||n.backupCodec===!0||n.backupCodec.codec===n.videoCodec)return;e!==n.backupCodec.codec&&ke.warn("requested a different codec than specified as backup",{serverRequested:e,backup:n.backupCodec.codec}),n.videoCodec=e,n.videoEncoding=n.backupCodec.encoding;const a=t.mediaStreamTrack.getSettings(),l=(i=a.width)!==null&&i!==void 0?i:(r=t.dimensions)===null||r===void 0?void 0:r.width,d=(s=a.height)!==null&&s!==void 0?s:(o=t.dimensions)===null||o===void 0?void 0:o.height;return t.source===V.Source.ScreenShare&&n.simulcast&&(n.simulcast=!1),Om(t.source===V.Source.ScreenShare,l,d,n)}function gU(t,e,n,i){const r=vU(t,e,n);let{encoding:s}=r[0];const o=Math.max(e,n);for(let a=0;a<r.length;a+=1){const l=r[a];if(s=l.encoding,l.width>=o)break}if(i)switch(i){case"av1":case"h265":s=Object.assign({},s),s.maxBitrate=s.maxBitrate*.7;break;case"vp9":s=Object.assign({},s),s.maxBitrate=s.maxBitrate*.85;break}return s}function vU(t,e,n){if(t)return uU;const i=e>n?e/n:n/e;return Math.abs(i-16/9)<Math.abs(i-4/3)?lU:dU}function px(t,e){if(t)return pU(e);const{width:n,height:i}=e,r=n>i?n/i:i/n;return Math.abs(r-16/9)<Math.abs(r-4/3)?hU:fU}function Ef(t,e,n,i){const r=[];if(n.forEach((s,o)=>{if(o>=Am.length)return;const a=Math.min(t,e),d={rid:Am[o],scaleResolutionDownBy:Math.max(1,a/Math.min(s.width,s.height)),maxBitrate:s.encoding.maxBitrate},u=i&&s.encoding.maxFramerate?Math.min(i,s.encoding.maxFramerate):s.encoding.maxFramerate;u&&(d.maxFramerate=u);const h=Js()||o===0;s.encoding.priority&&h&&(d.priority=s.encoding.priority,d.networkPriority=s.encoding.priority),r.push(d)}),_i()&&mE()==="ios"){let s;r.forEach(a=>{s?a.maxFramerate&&a.maxFramerate>s&&(s=a.maxFramerate):s=a.maxFramerate});let o=!0;r.forEach(a=>{var l;a.maxFramerate!=s&&(o&&(o=!1,ke.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),ke.info('Setting framerate of encoding "'.concat((l=a.rid)!==null&&l!==void 0?l:"",'" to ').concat(s)),a.maxFramerate=s)})}return r}function mx(t){if(t)return t.sort((e,n)=>{const{encoding:i}=e,{encoding:r}=n;return i.maxBitrate>r.maxBitrate?1:i.maxBitrate<r.maxBitrate?-1:i.maxBitrate===r.maxBitrate&&i.maxFramerate&&r.maxFramerate?i.maxFramerate>r.maxFramerate?1:-1:0})}class TE{constructor(e){const n=e.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!n)throw new Error("invalid scalability mode");if(this.spatial=parseInt(n[1]),this.temporal=parseInt(n[2]),n.length>3)switch(n[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=n[3]}}toString(){var e;return"L".concat(this.spatial,"T").concat(this.temporal).concat((e=this.suffix)!==null&&e!==void 0?e:"")}}function yU(t){return t.source===V.Source.ScreenShare||t.constraints.height&&Zr(t.constraints.height)>=1080?"maintain-resolution":"balanced"}const bU=5e3;class wu extends CE{get sender(){return this._sender}set sender(e){this._sender=e,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,r=arguments.length>3?arguments[3]:void 0;super(e,V.Kind.Video,n,i,r),this.simulcastCodecs=new Map,this.degradationPreference="balanced",this.isCpuConstrained=!1,this.optimizeForPerformance=!1,this.monitorSender=()=>E(this,void 0,void 0,function*(){if(!this.sender){this._currentBitrate=0;return}let s;try{s=yield this.getSenderStats()}catch(l){this.log.error("could not get video sender stats",Object.assign(Object.assign({},this.logContext),{error:l}));return}const o=new Map(s.map(l=>[l.rid,l])),a=s.some(l=>l.qualityLimitationReason==="cpu");if(a!==this.isCpuConstrained&&(this.isCpuConstrained=a,this.isCpuConstrained&&this.emit($.CpuConstrained)),this.prevStats){let l=0;o.forEach((d,u)=>{var h;const p=(h=this.prevStats)===null||h===void 0?void 0:h.get(u);l+=fh(d,p)}),this._currentBitrate=l}this.prevStats=o}),this.senderLock=new dn}get isSimulcast(){return!!(this.sender&&this.sender.getParameters().encodings.length>1)}startMonitor(e){var n;if(this.signalClient=e,!on())return;const i=(n=this.sender)===null||n===void 0?void 0:n.getParameters();i&&(this.encodings=i.encodings),!this.monitorInterval&&(this.monitorInterval=setInterval(()=>{this.monitorSender()},Vv))}stop(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach(e=>{e.mediaStreamTrack.stop()}),super.stop()}pauseUpstream(){const e=Object.create(null,{pauseUpstream:{get:()=>super.pauseUpstream}});return E(this,void 0,void 0,function*(){var n,i,r,s,o;yield e.pauseUpstream.call(this);try{for(var a=!0,l=Hi(this.simulcastCodecs.values()),d;d=yield l.next(),n=d.done,!n;a=!0)s=d.value,a=!1,yield(o=s.sender)===null||o===void 0?void 0:o.replaceTrack(null)}catch(u){i={error:u}}finally{try{!a&&!n&&(r=l.return)&&(yield r.call(l))}finally{if(i)throw i.error}}})}resumeUpstream(){const e=Object.create(null,{resumeUpstream:{get:()=>super.resumeUpstream}});return E(this,void 0,void 0,function*(){var n,i,r,s,o;yield e.resumeUpstream.call(this);try{for(var a=!0,l=Hi(this.simulcastCodecs.values()),d;d=yield l.next(),n=d.done,!n;a=!0){s=d.value,a=!1;const u=s;yield(o=u.sender)===null||o===void 0?void 0:o.replaceTrack(u.mediaStreamTrack)}}catch(u){i={error:u}}finally{try{!a&&!n&&(r=l.return)&&(yield r.call(l))}finally{if(i)throw i.error}}})}mute(){const e=Object.create(null,{mute:{get:()=>super.mute}});return E(this,void 0,void 0,function*(){const n=yield this.muteLock.lock();try{return this.isMuted?(this.log.debug("Track already muted",this.logContext),this):(this.source===V.Source.Camera&&!this.isUserProvided&&(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),yield e.mute.call(this),this)}finally{n()}})}unmute(){const e=Object.create(null,{unmute:{get:()=>super.unmute}});return E(this,void 0,void 0,function*(){const n=yield this.muteLock.lock();try{return this.isMuted?(this.source===V.Source.Camera&&!this.isUserProvided&&(this.log.debug("reacquiring camera track",this.logContext),yield this.restartTrack()),yield e.unmute.call(this),this):(this.log.debug("Track already unmuted",this.logContext),this)}finally{n()}})}setTrackMuted(e){super.setTrackMuted(e);for(const n of this.simulcastCodecs.values())n.mediaStreamTrack.enabled=!e}getSenderStats(){return E(this,void 0,void 0,function*(){var e;if(!(!((e=this.sender)===null||e===void 0)&&e.getStats))return[];const n=[],i=yield this.sender.getStats();return i.forEach(r=>{var s;if(r.type==="outbound-rtp"){const o={type:"video",streamId:r.id,frameHeight:r.frameHeight,frameWidth:r.frameWidth,framesPerSecond:r.framesPerSecond,framesSent:r.framesSent,firCount:r.firCount,pliCount:r.pliCount,nackCount:r.nackCount,packetsSent:r.packetsSent,bytesSent:r.bytesSent,qualityLimitationReason:r.qualityLimitationReason,qualityLimitationDurations:r.qualityLimitationDurations,qualityLimitationResolutionChanges:r.qualityLimitationResolutionChanges,rid:(s=r.rid)!==null&&s!==void 0?s:r.id,retransmittedPacketsSent:r.retransmittedPacketsSent,targetBitrate:r.targetBitrate,timestamp:r.timestamp},a=i.get(r.remoteId);a&&(o.jitter=a.jitter,o.packetsLost=a.packetsLost,o.roundTripTime=a.roundTripTime),n.push(o)}}),n.sort((r,s)=>{var o,a;return((o=s.frameWidth)!==null&&o!==void 0?o:0)-((a=r.frameWidth)!==null&&a!==void 0?a:0)}),n})}setPublishingQuality(e){const n=[];for(let i=yn.LOW;i<=yn.HIGH;i+=1)n.push(new Pv({quality:i,enabled:i<=e}));this.log.debug("setting publishing quality. max quality ".concat(e),this.logContext),this.setPublishingLayers(yi(this.codec),n)}restartTrack(e){return E(this,void 0,void 0,function*(){var n,i,r,s,o;let a;if(e){const h=Av({video:e});typeof h.video!="boolean"&&(a=h.video)}yield this.restart(a),this.isCpuConstrained=!1;try{for(var l=!0,d=Hi(this.simulcastCodecs.values()),u;u=yield d.next(),n=u.done,!n;l=!0){s=u.value,l=!1;const h=s;h.sender&&((o=h.sender.transport)===null||o===void 0?void 0:o.state)!=="closed"&&(h.mediaStreamTrack=this.mediaStreamTrack.clone(),yield h.sender.replaceTrack(h.mediaStreamTrack))}}catch(h){i={error:h}}finally{try{!l&&!n&&(r=d.return)&&(yield r.call(d))}finally{if(i)throw i.error}}})}setProcessor(e){const n=Object.create(null,{setProcessor:{get:()=>super.setProcessor}});return E(this,arguments,void 0,function(i){var r=this;let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){var o,a,l,d,u,h;if(yield n.setProcessor.call(r,i,s),!((u=r.processor)===null||u===void 0)&&u.processedTrack)try{for(var p=!0,g=Hi(r.simulcastCodecs.values()),b;b=yield g.next(),o=b.done,!o;p=!0)d=b.value,p=!1,yield(h=d.sender)===null||h===void 0?void 0:h.replaceTrack(r.processor.processedTrack)}catch(m){a={error:m}}finally{try{!p&&!o&&(l=g.return)&&(yield l.call(g))}finally{if(a)throw a.error}}}()})}setDegradationPreference(e){return E(this,void 0,void 0,function*(){if(this.degradationPreference=e,this.sender)try{this.log.debug("setting degradationPreference to ".concat(e),this.logContext);const n=this.sender.getParameters();n.degradationPreference=e,this.sender.setParameters(n)}catch(n){this.log.warn("failed to set degradationPreference",Object.assign({error:n},this.logContext))}})}addSimulcastTrack(e,n){if(this.simulcastCodecs.has(e)){this.log.error("".concat(e," already added, skipping adding simulcast codec"),this.logContext);return}const i={codec:e,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:n};return this.simulcastCodecs.set(e,i),i}setSimulcastTrackSender(e,n){const i=this.simulcastCodecs.get(e);i&&(i.sender=n,setTimeout(()=>{this.subscribedCodecs&&this.setPublishingCodecs(this.subscribedCodecs)},bU))}setPublishingCodecs(e){return E(this,void 0,void 0,function*(){var n,i,r,s,o,a,l;if(this.log.debug("setting publishing codecs",Object.assign(Object.assign({},this.logContext),{codecs:e,currentCodec:this.codec})),!this.codec&&e.length>0)return yield this.setPublishingLayers(yi(e[0].codec),e[0].qualities),[];this.subscribedCodecs=e;const d=[];try{for(n=!0,i=Hi(e);r=yield i.next(),s=r.done,!s;n=!0){l=r.value,n=!1;const u=l;if(!this.codec||this.codec===u.codec)yield this.setPublishingLayers(yi(u.codec),u.qualities);else{const h=this.simulcastCodecs.get(u.codec);if(this.log.debug("try setPublishingCodec for ".concat(u.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:h})),!h||!h.sender){for(const p of u.qualities)if(p.enabled){d.push(u.codec);break}}else h.encodings&&(this.log.debug("try setPublishingLayersForSender ".concat(u.codec),this.logContext),yield gx(h.sender,h.encodings,u.qualities,this.senderLock,yi(u.codec),this.log,this.logContext))}}}catch(u){o={error:u}}finally{try{!n&&!s&&(a=i.return)&&(yield a.call(i))}finally{if(o)throw o.error}}return d})}setPublishingLayers(e,n){return E(this,void 0,void 0,function*(){if(this.optimizeForPerformance){this.log.info("skipping setPublishingLayers due to optimized publishing performance",Object.assign(Object.assign({},this.logContext),{qualities:n}));return}this.log.debug("setting publishing layers",Object.assign(Object.assign({},this.logContext),{qualities:n})),!(!this.sender||!this.encodings)&&(yield gx(this.sender,this.encodings,n,this.senderLock,e,this.log,this.logContext))})}prioritizePerformance(){return E(this,void 0,void 0,function*(){if(!this.sender)throw new Error("sender not found");const e=yield this.senderLock.lock();try{this.optimizeForPerformance=!0;const n=this.sender.getParameters();n.encodings=n.encodings.map((i,r)=>{var s;return Object.assign(Object.assign({},i),{active:r===0,scaleResolutionDownBy:Math.max(1,Math.ceil(((s=this.mediaStreamTrack.getSettings().height)!==null&&s!==void 0?s:360)/360)),scalabilityMode:r===0&&yi(this.codec)?"L1T3":void 0,maxFramerate:r===0?15:0,maxBitrate:r===0?i.maxBitrate:0})}),this.log.debug("setting performance optimised encodings",Object.assign(Object.assign({},this.logContext),{encodings:n.encodings})),this.encodings=n.encodings,yield this.sender.setParameters(n)}catch(n){this.log.error("failed to set performance optimised encodings",Object.assign(Object.assign({},this.logContext),{error:n})),this.optimizeForPerformance=!1}finally{e()}})}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return E(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),fE()&&this.isInBackgroun
595d&&this.source===V.Source.Camera&&(this._mediaStreamTrack.enabled=!1)})}}function gx(t,e,n,i,r,s,o){return E(this,void 0,void 0,function*(){const a=yield i.lock();s.debug("setPublishingLayersForSender",Object.assign(Object.assign({},o),{sender:t,qualities:n,senderEncodings:e}));try{const l=t.getParameters(),{encodings:d}=l;if(!d)return;if(d.length!==e.length){s.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},o),{encodings:d,senderEncodings:e}));return}let u=!1;!1&&d[0].scalabilityMode||(r&&n.some(g=>g.enabled)&&n.forEach(g=>g.enabled=!0),d.forEach((p,g)=>{var b;let m=(b=p.rid)!==null&&b!==void 0?b:"";m===""&&(m="q");const k=_E(m),v=n.find(y=>y.quality===k);v&&p.active!==v.enabled&&(u=!0,p.active=v.enabled,s.debug("setting layer ".concat(v.quality," to ").concat(p.active?"enabled":"disabled"),o),Js()&&(v.enabled?(p.scaleResolutionDownBy=e[g].scaleResolutionDownBy,p.maxBitrate=e[g].maxBitrate,p.maxFrameRate=e[g].maxFrameRate):(p.scaleResolutionDownBy=4,p.maxBitrate=10,p.maxFrameRate=2)))})),u&&(l.encodings=d,s.debug("setting encodings",Object.assign(Object.assign({},o),{encodings:l.encodings})),yield t.setParameters(l))}finally{a()}})}function _E(t){switch(t){case"f":return yn.HIGH;case"h":return yn.MEDIUM;case"q":return yn.LOW;default:return yn.HIGH}}function vx(t,e,n,i){if(!n)return[new Ds({quality:yn.HIGH,width:t,height:e,bitrate:0,ssrc:0})];if(i){const r=n[0].scalabilityMode,s=new TE(r),o=[],a=s.suffix=="h"?1.5:2,l=s.suffix=="h"?2:3;for(let d=0;d<s.spatial;d+=1)o.push(new Ds({quality:Math.min(yn.HIGH,s.spatial-1)-d,width:Math.ceil(t/Math.pow(a,d)),height:Math.ceil(e/Math.pow(a,d)),bitrate:n[0].maxBitrate?Math.ceil(n[0].maxBitrate/Math.pow(l,d)):0,ssrc:0}));return o}return n.map(r=>{var s,o,a;const l=(s=r.scaleResolutionDownBy)!==null&&s!==void 0?s:1;let d=_E((o=r.rid)!==null&&o!==void 0?o:"");return new Ds({quality:d,width:Math.ceil(t/l),height:Math.ceil(e/l),bitrate:(a=r.maxBitrate)!==null&&a!==void 0?a:0,ssrc:0})})}const yx="_lossy",bx="_reliable",xU=2*1e3,Pf="leave-reconnect",kU=3e4;var zn;(function(t){t[t.New=0]="New",t[t.Connected=1]="Connected",t[t.Disconnected=2]="Disconnected",t[t.Reconnecting=3]="Reconnecting",t[t.Closed=4]="Closed"})(zn||(zn={}));class SU extends Ni.EventEmitter{get isClosed(){return this._isClosed}get pendingReconnect(){return!!this.reconnectTimeout}constructor(e){var n;super(),this.options=e,this.rtcConfig={},this.peerConnectionTimeout=Uv.peerConnectionTimeout,this.fullReconnectOnNext=!1,this.latestRemoteOfferId=0,this.subscriberPrimary=!1,this.pcState=zn.New,this._isClosed=!0,this.pendingTrackResolvers={},this.reconnectAttempts=0,this.reconnectStart=0,this.attemptingReconnect=!1,this.joinAttempts=0,this.maxJoinAttempts=1,this.shouldFailNext=!1,this.log=ke,this.reliableDataSequence=1,this.reliableMessageBuffer=new sx,this.reliableReceivedState=new q4(kU),this.handleDataChannel=i=>E(this,[i],void 0,function(r){var s=this;let{channel:o}=r;return function*(){if(o){if(o.label===bx)s.reliableDCSub=o;else if(o.label===yx)s.lossyDCSub=o;else return;s.log.debug("on data channel ".concat(o.id,", ").concat(o.label),s.logContext),o.onmessage=s.handleDataMessage}}()}),this.handleDataMessage=i=>E(this,void 0,void 0,function*(){var r,s;const o=yield this.dataProcessLock.lock();try{let a;if(i.data instanceof ArrayBuffer)a=i.data;else if(i.data instanceof Blob)a=yield i.data.arrayBuffer();else{this.log.error("unsupported data type",Object.assign(Object.assign({},this.logContext),{data:i.data}));return}const l=rn.fromBinary(new Uint8Array(a));if(l.sequence>0&&l.participantSid!==""){const d=this.reliableReceivedState.get(l.participantSid);if(d&&l.sequence<=d)return;this.reliableReceivedState.set(l.participantSid,l.sequence)}((r=l.value)===null||r===void 0?void 0:r.case)==="speaker"?this.emit(X.ActiveSpeakersUpdate,l.value.value.speakers):(((s=l.value)===null||s===void 0?void 0:s.case)==="user"&&CU(l,l.value.value),this.emit(X.DataPacketReceived,l))}finally{o()}}),this.handleDataError=i=>{const s=i.currentTarget.maxRetransmits===0?"lossy":"reliable";if(i instanceof ErrorEvent&&i.error){const{error:o}=i.error;this.log.error("DataChannel error on ".concat(s,": ").concat(i.message),Object.assign(Object.assign({},this.logContext),{error:o}))}else this.log.error("Unknown DataChannel error on ".concat(s),Object.assign(Object.assign({},this.logContext),{event:i}))},this.handleBufferedAmountLow=i=>
vendor: 4,342 bytes, line 595
595{const s=i.currentTarget.maxRetransmits===0?xe.LOSSY:xe.RELIABLE;this.updateAndEmitDCBufferStatus(s)},this.handleDisconnect=(i,r)=>{if(this._isClosed)return;this.log.warn("".concat(i," disconnected"),this.logContext),this.reconnectAttempts===0&&(this.reconnectStart=Date.now());const s=l=>{this.log.warn("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(l,"ms. giving up"),this.logContext),this.emit(X.Disconnected),this.close()},o=Date.now()-this.reconnectStart;let a=this.getNextRetryDelay({elapsedMs:o,retryCount:this.reconnectAttempts});if(a===null){s(o);return}i===Pf&&(a=0),this.log.debug("reconnecting in ".concat(a,"ms"),this.logContext),this.clearReconnectTimeout(),this.token&&this.regionUrlProvider&&this.regionUrlProvider.updateToken(this.token),this.reconnectTimeout=Nt.setTimeout(()=>this.attemptReconnect(r).finally(()=>this.reconnectTimeout=void 0),a)},this.waitForRestarted=()=>new Promise((i,r)=>{this.pcState===zn.Connected&&i();const s=()=>{this.off(X.Disconnected,o),i()},o=()=>{this.off(X.Restarted,s),r()};this.once(X.Restarted,s),this.once(X.Disconnected,o)}),this.updateAndEmitDCBufferStatus=i=>{const r=this.isBufferStatusLow(i);typeof r<"u"&&r!==this.dcBufferStatus.get(i)&&(this.dcBufferStatus.set(i,r),this.emit(X.DCBufferStatusChanged,r,i))},this.isBufferStatusLow=i=>{const r=this.dataChannelForKind(i);if(r)return i===xe.RELIABLE&&this.reliableMessageBuffer.alignBufferedAmount(r.bufferedAmount),r.bufferedAmount<=r.bufferedAmountLowThreshold},this.handleBrowserOnLine=()=>{this.client.currentState===Je.RECONNECTING&&(this.clearReconnectTimeout(),this.attemptReconnect(ho.RR_SIGNAL_DISCONNECTED))},this.log=rr((n=e.loggerName)!==null&&n!==void 0?n:ri.Engine),this.loggerOptions={loggerName:e.loggerName,loggerContextCb:()=>this.logContext},this.client=new Ov(void 0,this.loggerOptions),this.client.signalLatency=this.options.expSignalLatency,this.reconnectPolicy=this.options.reconnectPolicy,this.registerOnLineListener(),this.closingLock=new dn,this.dataProcessLock=new dn,this.dcBufferStatus=new Map([[xe.LOSSY,!0],[xe.RELIABLE,!0]]),this.client.onParticipantUpdate=i=>this.emit(X.ParticipantUpdate,i),this.client.onConnectionQuality=i=>this.emit(X.ConnectionQualityUpdate,i),this.client.onRoomUpdate=i=>this.emit(X.RoomUpdate,i),this.client.onSubscriptionError=i=>this.emit(X.SubscriptionError,i),this.client.onSubscriptionPermissionUpdate=i=>this.emit(X.SubscriptionPermissionUpdate,i),this.client.onSpeakersChanged=i=>this.emit(X.SpeakersChanged,i),this.client.onStreamStateUpdate=i=>this.emit(X.StreamStateChanged,i),this.client.onRequestResponse=i=>this.emit(X.SignalRequestResponse,i)}get logContext(){var e,n,i,r,s,o;return{room:(n=(e=this.latestJoinResponse)===null||e===void 0?void 0:e.room)===null||n===void 0?void 0:n.name,roomID:(r=(i=this.latestJoinResponse)===null||i===void 0?void 0:i.room)===null||r===void 0?void 0:r.sid,participant:(o=(s=this.latestJoinResponse)===null||s===void 0?void 0:s.participant)===null||o===void 0?void 0:o.identity,pID:this.participantSid}}join(e,n,i,r){return E(this,void 0,void 0,function*(){this.url=e,this.token=n,this.signalOpts=i,this.maxJoinAttempts=i.maxRetries;try{this.joinAttempts+=1,this.setupSignalClientCallbacks();const s=yield this.client.join(e,n,i,r);return this._isClosed=!1,this.latestJoinResponse=s,this.subscriberPrimary=s.subscriberPrimary,this.pcManager||(yield this.configure(s)),(!this.subscriberPrimary||s.fastPublish)&&this.negotiate(),this.clientConfiguration=s.clientConfiguration,this.emit(X.SignalConnected,s),s}catch(s){if(s instanceof $e&&s.reason===Ie.ServerUnreachable&&(this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts," of ").concat(this.maxJoinAttempts),this.logContext),this.joinAttempts<this.maxJoinAttempts))return this.join(e,n,i,r);throw s}})}close(){return E(this,void 0,void 0,function*(){const e=yield this.closingLock.lock();if(this.isClosed){e();return}try{this._isClosed=!0,this.joinAttempts=0,this.emit(X.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),yield this.cleanupPeerConnections(),yield this.cleanupClient()}finally{e()}})}cleanupPeerConnections(){return E(this,void 0,void 0,function*(){var e;yield(e=this.pcManager)===null||e===void 0?void 0:e.close(),this.pcManager=void 0;const n=i=>
vendor: 1,997 bytes, line 595
595{i&&(i.close(),i.onbufferedamountlow=null,i.onclose=null,i.onclosing=null,i.onerror=null,i.onmessage=null,i.onopen=null)};n(this.lossyDC),n(this.lossyDCSub),n(this.reliableDC),n(this.reliableDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0,this.reliableMessageBuffer=new sx,this.reliableDataSequence=1,this.reliableReceivedState.clear()})}cleanupClient(){return E(this,void 0,void 0,function*(){yield this.client.close(),this.client.resetCallbacks()})}addTrack(e){if(this.pendingTrackResolvers[e.cid])throw new $i("a track with the same ID has already been published");return new Promise((n,i)=>{const r=setTimeout(()=>{delete this.pendingTrackResolvers[e.cid],i(new $e("publication of local track timed out, no response from server",Ie.Timeout))},1e4);this.pendingTrackResolvers[e.cid]={resolve:s=>{clearTimeout(r),n(s)},reject:()=>{clearTimeout(r),i(new Error("Cancelled publication by calling unpublish"))}},this.client.sendAddTrack(e)})}removeTrack(e){if(e.track&&this.pendingTrackResolvers[e.track.id]){const{reject:n}=this.pendingTrackResolvers[e.track.id];n&&n(),delete this.pendingTrackResolvers[e.track.id]}try{return this.pcManager.removeTrack(e),!0}catch(n){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:n}))}return!1}updateMuteStatus(e,n){this.client.sendMuteTrack(e,n)}get dataSubscriberReadyState(){var e;return(e=this.reliableDCSub)===null||e===void 0?void 0:e.readyState}getConnectedServerAddress(){return E(this,void 0,void 0,function*(){var e;return(e=this.pcManager)===null||e===void 0?void 0:e.getConnectedAddress()})}setRegionUrlProvider(e){this.regionUrlProvider=e}configure(e){return E(this,void 0,void 0,function*(){var n,i;if(this.pcManager&&this.pcManager.currentState!==ct.NEW)return;this.participantSid=(n=e.participant)===null||n===void 0?void 0:n.sid;const r=this.makeRTCConfiguration(e);this.pcManager=new tU(r,e.subscriberPrimary,this.loggerOptions),this.emit(X.Trans
595portsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=(s,o)=>{this.client.sendIceCandidate(s,o)},this.pcManager.onPublisherOffer=(s,o)=>{this.client.sendOffer(s,o)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=(s,o,a)=>E(this,void 0,void 0,function*(){if(this.log.debug("primary PC state changed ".concat(s),this.logContext),["closed","disconnected","failed"].includes(o)&&(this.publisherConnectionPromise=void 0),s===ct.CONNECTED){const u=this.pcState===zn.New;this.pcState=zn.Connected,u&&this.emit(X.Connected,e)}else s===ct.FAILED&&this.pcState===zn.Connected&&(this.pcState=zn.Disconnected,this.handleDisconnect("peerconnection failed",a==="failed"?ho.RR_SUBSCRIBER_FAILED:ho.RR_PUBLISHER_FAILED));const l=this.client.isDisconnected||this.client.currentState===Je.RECONNECTING,d=[ct.FAILED,ct.CLOSING,ct.CLOSED].includes(s);l&&d&&!this._isClosed&&this.emit(X.Offline)}),this.pcManager.onTrack=s=>{this.emit(X.MediaTrackAdded,s.track,s.streams[0],s.receiver)},wU((i=e.serverInfo)===null||i===void 0?void 0:i.protocol)||this.createDataChannels()})}setupSignalClientCallbacks(){this.client.onAnswer=(e,n)=>E(this,void 0,void 0,function*(){this.pcManager&&(this.log.debug("received server answer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type})),yield this.pcManager.setPublisherAnswer(e,n))}),this.client.onTrickle=(e,n)=>{this.pcManager&&(this.log.debug("got ICE candidate from peer",Object.assign(Object.assign({},this.logContext),{candidate:e,target:n})),this.pcManager.addIceCandidate(e,n))},this.client.onOffer=(e,n)=>E(this,void 0,void 0,function*(){if(this.latestRemoteOfferId=n,!this.pcManager)return;const i=yield this.pcManager.createSubscriberAnswerFromOffer(e,n);i&&this.client.sendAnswer(i,n)}),this.client.onLocalTrackPublished=e=>{var n;if(this.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},this.logContext),{cid:e.cid,track:(n=e.track)===null||n===void 0?void 0:n.sid})),!this.pendingTrackResolvers[e.cid]){this.log.error("missing track resolver for ".concat(e.cid),Object.assign(Object.assign({},this.logContext),{cid:e.cid}));return}const{resolve:i}=this.pendingTrackResolvers[e.cid];delete this.pendingTrackResolvers[e.cid],i(e.track)},this.client.onLocalTrackUnpublished=e=>{this.emit(X.LocalTrackUnpublished,e)},this.client.onLocalTrackSubscribed=e=>{this.emit(X.LocalTrackSubscribed,e)},this.client.onTokenRefresh=e=>{this.token=e},this.client.onRemoteMuteChanged=(e,n)=>{this.emit(X.RemoteMute,e,n)},this.client.onSubscribedQualityUpdate=e=>{this.emit(X.SubscribedQualityUpdate,e)},this.client.onRoomMoved=e=>{var n;this.participantSid=(n=e.participant)===null||n===void 0?void 0:n.sid,this.latestJoinResponse&&(this.latestJoinResponse.room=e.room),this.emit(X.RoomMoved,e)},this.client.onClose=()=>{this.handleDisconnect("signal",ho.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=e=>{switch(this.log.debug("client leave request",Object.assign(Object.assign({},this.logContext),{reason:e==null?void 0:e.reason})),e.regions&&this.regionUrlProvider&&(this.log.debug("updating regions",this.logContext),this.regionUrlProvider.setServerReportedRegions(e.regions)),e.action){case Ho.DISCONNECT:this.emit(X.Disconnected,e==null?void 0:e.reason),this.close();break;case Ho.RECONNECT:this.fullReconnectOnNext=!0,this.handleDisconnect(Pf);break;case Ho.RESUME:this.handleDisconnect(Pf)}}}makeRTCConfiguration(e){var n;const i=Object.assign({},this.rtcConfig);if(!((n=this.signalOpts)===null||n===void 0)&&n.e2eeEnabled&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),i.encodedInsertableStreams=!0),e.iceServers&&!i.iceServers){const r=[];e.iceServers.forEach(s=>{const o={urls:s.urls};s.username&&(o.username=s.username),s.credential&&(o.credential=s.credential),r.push(o)}),i.iceServers=r}return e.clientConfiguration&&e.clientConfiguration.forceRelay===zc.ENABLED&&(i.iceTransportPolicy="relay"),i.sdpSemantics="unified-plan",i.continualGatheringPolicy="gather_continually",i}createDataChannels(){this.pcManager&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.lossyDC=this.pcManager.createPublisherDataChannel
vendor: 5,406 bytes, line 595
595(yx,{ordered:!1,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(bx,{ordered:!0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=this.handleBufferedAmountLow,this.reliableDC.onbufferedamountlow=this.handleBufferedAmountLow)}createSender(e,n,i){return E(this,void 0,void 0,function*(){if(xu())return yield this.createTransceiverRTCRtpSender(e,n,i);if(Tm())return this.log.warn("using add-track fallback",this.logContext),yield this.createRTCRtpSender(e.mediaStreamTrack);throw new yt("Required webRTC APIs not supported on this device")})}createSimulcastSender(e,n,i,r){return E(this,void 0,void 0,function*(){if(xu())return this.createSimulcastTransceiverSender(e,n,i,r);if(Tm())return this.log.debug("using add-track fallback",this.logContext),this.createRTCRtpSender(e.mediaStreamTrack);throw new yt("Cannot stream on this device")})}createTransceiverRTCRtpSender(e,n,i){return E(this,void 0,void 0,function*(){if(!this.pcManager)throw new yt("publisher is closed");const r=[];e.mediaStream&&r.push(e.mediaStream),us(e)&&(e.codec=n.videoCodec);const s={direction:"sendonly",streams:r};return i&&(s.sendEncodings=i),(yield this.pcManager.addPublisherTransceiver(e.mediaStreamTrack,s)).sender})}createSimulcastTransceiverSender(e,n,i,r){return E(this,void 0,void 0,function*(){if(!this.pcManager)throw new yt("publisher is closed");const s={direction:"sendonly"};r&&(s.sendEncodings=r);const o=yield this.pcManager.addPublisherTransceiver(n.mediaStreamTrack,s);if(i.videoCodec)return e.setSimulcastTrackSender(i.videoCodec,o.sender),o.sender})}createRTCRtpSender(e){return E(this,void 0,void 0,function*(){if(!this.pcManager)throw new yt("publisher is closed");return this.pcManager.addPublisherTrack(e)})}attemptReconnect(e){return E(this,void 0,void 0,function*(){var n,i,r;if(!this._isClosed){if(this.attemptingReconnect){ke.warn("already attempting reconnect, returning early",this.logContext);return}(((n=this.clientConfiguration)===null||n===void 0?void 0:n.resumeConnection)===zc.DISABLED||((r=(i=this.pcManager)===null||i===void 0?void 0:i.currentState)!==null&&r!==void 0?r:ct.NEW)===ct.NEW)&&(this.fullReconnectOnNext=!0);try{this.attemptingReconnect=!0,this.fullReconnectOnNext?yield this.restartConnection():yield this.resumeConnection(e),this.clearPendingReconnect(),this.fullReconnectOnNext=!1}catch(s){this.reconnectAttempts+=1;let o=!0;s instanceof yt?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:s})),o=!1):s instanceof fo||(this.fullReconnectOnNext=!0),o?this.handleDisconnect("reconnect",ho.RR_UNKNOWN):(this.log.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up"),this.logContext),this.emit(X.Disconnected),yield this.close())}finally{this.attemptingReconnect=!1}}})}getNextRetryDelay(e){try{return this.reconnectPolicy.nextRetryDelayInMs(e)}catch(n){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:n}))}return null}restartConnection(e){return E(this,void 0,void 0,function*(){var n,i,r;try{if(!this.url||!this.token)throw new yt("could not reconnect, url or token not saved");this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(X.Restarting),this.client.isDisconnected||(yield this.client.sendLeave()),yield this.cleanupPeerConnections(),yield this.cleanupClient();let s;try{if(!this.signalOpts)throw this.log.warn("attempted connection restart, without signal options present",this.logContext),new fo;s=yield this.join(e??this.url,this.token,this.signalOpts)}catch(o){throw o instanceof $e&&o.reason===Ie.NotAllowed?new yt("could not reconnect, token might be expired"):new fo}if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(this.client.setReconnected(),this.emit(X.SignalRestarted,s),yield this.waitForPCReconnected(),this.client.currentState!==Je.CONNECTED)throw new fo("Signal connection got severed during reconnect");(n=this.regionUrlProvider)===null||n===void 0||n.resetAttempts(),this.emit(X.Restarted)}catch(s){const o=yield(i=this.regionUrlProvider)===null||i===void 0?void 0:i.getNextBestRegionUrl();if(o){yield this.restartConnection(o);return}else throw(r=this.regionUrlProvider)===null||r===void 0||r.resetAttempts(),s}})}resumeConnection(e){return E(this,void 0,void 0,function*(){var n;if(!this.url||!this.token)throw new yt("could not reconnect, url or token not saved");if(!this.pcManager)throw new yt("publisher and subscriber connections unset");this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(X.Resuming);let i;try{this.setupSignalClientCallbacks(),i=yield this.client.reconnect(this.url,this.token,this.participantSid,e)}catch(r){let s="";throw r instanceof Error&&(s=r.message,this.log.error(r.message,Object.assign(Object.assign({},this.logContext),{error:r}))),r instanceof $e&&r.reason===Ie.NotAllowed?new yt("could not reconnect, token might be expired"):r instanceof $e&&r.reason===Ie.LeaveRequest?r:new fo(s)}
595if(this.emit(X.SignalResumed),i){const r=this.makeRTCConfiguration(i);this.pcManager.updateConfiguration(r),this.latestJoinResponse&&(this.latestJoinResponse.serverInfo=i.serverInfo)}else this.log.warn("Did not receive reconnect response",this.logContext);if(this.shouldFailNext)throw this.shouldFailNext=!1,new Error("simulated failure");if(yield this.pcManager.triggerIceRestart(),yield this.waitForPCReconnected(),this.client.currentState!==Je.CONNECTED)throw new fo("Signal connection got severed during reconnect");this.client.setReconnected(),((n=this.reliableDC)===null||n===void 0?void 0:n.readyState)==="open"&&this.reliableDC.id===null&&this.createDataChannels(),i!=null&&i.lastMessageSeq&&this.resendReliableMessagesForResume(i.lastMessageSeq),this.emit(X.Resumed)})}waitForPCInitialConnection(e,n){return E(this,void 0,void 0,function*(){if(!this.pcManager)throw new yt("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(n,e)})}waitForPCReconnected(){return E(this,void 0,void 0,function*(){this.pcState=zn.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext);try{if(yield un(xU),!this.pcManager)throw new yt("PC manager is closed");yield this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout),this.pcState=zn.Connected}catch(e){throw this.pcState=zn.Disconnected,new $e("could not establish PC connection, ".concat(e.message),Ie.InternalError)}})}publishRpcResponse(e,n,i,r){return E(this,void 0,void 0,function*(){const s=new rn({destinationIdentities:[e],kind:xe.RELIABLE,value:{case:"rpcResponse",value:new p1({requestId:n,value:r?{case:"error",value:r.toProto()}:{case:"payload",value:i??""}})}});yield this.sendDataPacket(s,xe.RELIABLE)})}publishRpcAck(e,n){return E(this,void 0,void 0,function*(){const i=new rn({destinationIdentities:[e],kind:xe.RELIABLE,value:{case:"rpcAck",value:new f1({requestId:n})}});yield this.sendDataPacket(i,xe.RELIABLE)})}sendDataPacket(e,n){return E(this,void 0,void 0,function*(){yield this.ensurePublisherConnected(n),n===xe.RELIABLE&&(e.sequence=this.reliableDataSequence,this.reliableDataSequence+=1);const i=e.toBinary(),r=this.dataChannelForKind(n);if(r){if(n===xe.RELIABLE&&this.reliableMessageBuffer.push({data:i,sequence:e.sequence}),this.attemptingReconnect)return;r.send(i)}this.updateAndEmitDCBufferStatus(n)})}resendReliableMessagesForResume(e){return E(this,void 0,void 0,function*(){yield this.ensurePublisherConnected(xe.RELIABLE);const n=this.dataChannelForKind(xe.RELIABLE);n&&(this.reliableMessageBuffer.popToSequence(e),this.reliableMessageBuffer.getAll().forEach(i=>{n.send(i.data)})),this.updateAndEmitDCBufferStatus(xe.RELIABLE)})}waitForBufferStatusLow(e){return new Promise((n,i)=>E(this,void 0,void 0,function*(){if(this.isBufferStatusLow(e))n();else{const r=()=>i("Engine closed");for(this.once(X.Closing,r);!this.dcBufferStatus.get(e);)yield un(10);this.off(X.Closing,r),n()}}))}ensureDataTransportConnected(e){return E(this,arguments,void 0,function(n){var i=this;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.subscriberPrimary;return function*(){var s;if(!i.pcManager)throw new yt("PC manager is closed");const o=r?i.pcManager.subscriber:i.pcManager.publisher,a=r?"Subscriber":"Publisher";if(!o)throw new $e("".concat(a," connection not set"),Ie.InternalError);let l=!1;!r&&!i.dataChannelForKind(n,r)&&(i.createDataChannels(),l=!0),!l&&!r&&!i.pcManager.publisher.isICEConnected&&i.pcManager.publisher.getICEConnectionState()!=="checking"&&(l=!0),l&&i.negotiate();const d=i.dataChannelForKind(n,r);if((d==null?void 0:d.readyState)==="open")return;const u=new Date().getTime()+i.peerConnectionTimeout;for(;new Date().getTime()<u;){if(o.isICEConnected&&((s=i.dataChannelForKind(n,r))===null||s===void 0?void 0:s.readyState)==="open")return;yield un(50)}throw new $e("could not establish ".concat(a," connection, state: ").concat(o.getICEConnectionState()),Ie.InternalError)}()})}ensurePublisherConnected(e){return E(this,void 0,void 0,function*(){this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(e,!1)),yield this.publisherConnectionPromise})}verifyTransport(){return!(!this.pcManager||this.pcManager.currentState!==ct.CONNECTED||!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}negotiate(){return E(this,void 0,void 0,function*(){return new Promise((e,n
vendor: 1,541 bytes, line 595
595)=>E(this,void 0,void 0,function*(){if(!this.pcManager){n(new Sm("PC manager is closed"));return}this.pcManager.requirePublisher(),this.pcManager.publisher.getTransceivers().length==0&&!this.lossyDC&&!this.reliableDC&&this.createDataChannels();const i=new AbortController,r=()=>{i.abort(),this.log.debug("engine disconnected while negotiation was ongoing",this.logContext),e()};this.isClosed&&n("cannot negotiate on closed engine"),this.on(X.Closing,r),this.pcManager.publisher.once(Ko.RTPVideoPayloadTypes,s=>{const o=new Map;s.forEach(a=>{const l=a.codec.toLowerCase();C4(l)&&o.set(a.payload,l)}),this.emit(X.RTPVideoMapUpdate,o)});try{yield this.pcManager.negotiate(i),e()}catch(s){s instanceof Sm&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",ho.RR_UNKNOWN),n(s)}finally{this.off(X.Closing,r)}}))})}dataChannelForKind(e,n){if(n){if(e===xe.LOSSY)return this.lossyDCSub;if(e===xe.RELIABLE)return this.reliableDCSub}else{if(e===xe.LOSSY)return this.lossyDC;if(e===xe.RELIABLE)return this.reliableDC}}sendSyncState(e,n){var i,r;if(!this.pcManager){this.log.warn("sync state cannot be sent without peer connection setup",this.logContext);return}const s=this.pcManager.subscriber.getLocalDescription(),o=this.pcManager.subscriber.getRemoteDescription(),a=(r=(i=this.signalOpts)===null||i===void 0?void 0:i.autoSubscribe)!==null&&r!==void 0?r:!0,l=new Array,d=new Array;e.forEach(u=>{u.isDesired!==a&&l.push(u.trackSid),u.isEnabled||d.push(u.trackSid)}),this.client.sendSyncState(new I1({answer:s?ku({sdp:s.sdp,type:s.type}
595):void 0,offer:o?ku({sdp:o.sdp,type:o.type}):void 0,subscription:new dh({trackSids:l,subscribe:!a,participantTracks:[]}),publishTracks:A4(n),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:d,datachannelReceiveStates:this.reliableReceivedState.map((u,h)=>new j1({publisherSid:h,lastSeq:u}))}))}failNext(){this.shouldFailNext=!0}dataChannelsInfo(){const e=[],n=(i,r)=>{(i==null?void 0:i.id)!==void 0&&i.id!==null&&e.push(new A1({label:i.label,id:i.id,target:r}))};return n(this.dataChannelForKind(xe.LOSSY),Qn.PUBLISHER),n(this.dataChannelForKind(xe.RELIABLE),Qn.PUBLISHER),n(this.dataChannelForKind(xe.LOSSY,!0),Qn.SUBSCRIBER),n(this.dataChannelForKind(xe.RELIABLE,!0),Qn.SUBSCRIBER),e}clearReconnectTimeout(){this.reconnectTimeout&&Nt.clearTimeout(this.reconnectTimeout)}clearPendingReconnect(){this.clearReconnectTimeout(),this.reconnectAttempts=0}registerOnLineListener(){on()&&window.addEventListener("online",this.handleBrowserOnLine)}deregisterOnLineListener(){on()&&window.removeEventListener("online",this.handleBrowserOnLine)}}class fo extends Error{}function wU(t){return t!==void 0&&t>13}function CU(t,e){const n=t.participantIdentity?t.participantIdentity:e.participantIdentity;t.participantIdentity=n,e.participantIdentity=n;const i=t.destinationIdentities.length!==0?t.destinationIdentities:e.destinationIdentities;t.destinationIdentities=i,e.destinationIdentities=i}class Dm{constructor(e,n){this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=n}updateToken(e){this.token=e}isCloud(){return Em(this.serverUrl)}getServerUrl(){return this.serverUrl}getNextBestRegionUrl(e){return E(this,void 0,void 0,function*(){if(!this.isCloud())throw Error("region availability is only supported for LiveKit Cloud domains");(!this.regionSettings||Date.now()-this.lastUpdateAt>this.settingsCacheTime)&&(this.regionSettings=yield this.fetchRegionSettings(e));const n=this.regionSettings.regions.filter(i=>!this.attemptedRegions.find(r=>r.url===i.url));if(n.length>0){const i=n[0];return this.attemptedRegions.push(i),ke.debug("next region: ".concat(i.region)),i.url}else return null})}resetAttempts(){this.attemptedRegions=[]}fetchRegionSettings(e){return E(this,void 0,void 0,function*(){const n=yield fetch("".concat(TU(this.serverUrl),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:e});if(n.ok){const i=yield n.json();return this.lastUpdateAt=Date.now(),i}else throw new $e("Could not fetch region settings: ".concat(n.statusText),n.status===401?Ie.NotAllowed:Ie.InternalError,n.status)})}setServerReportedRegions(e){this.regionSettings=e,this.lastUpdateAt=Date.now()}}function TU(t){return"".concat(t.protocol.replace("ws","http"),"//").concat(t.host,"/settings")}class EE{get info(){return this._info}validateBytesReceived(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!(typeof this.totalByteSize!="number"||this.totalByteSize===0)){if(e&&this.bytesReceived<this.totalByteSize)throw new Pr("Not enough chunk(s) received - expected ".concat(this.totalByteSize," bytes of data total, only received ").concat(this.bytesReceived," bytes"),Jn.Incomplete);if(this.bytesReceived>this.totalByteSize)throw new Pr("Extra chunk(s) received - expected ".concat(this.totalByteSize," bytes of data total, received ").concat(this.bytesReceived," bytes"),Jn.LengthExceeded)}}constructor(e,n,i,r){this.reader=n,this.totalByteSize=i,this._info=e,this.bytesReceived=0,this.outOfBandFailureRejectingFuture=r}}class _U extends EE{handleChunkReceived(e){var n;this.bytesReceived+=e.content.byteLength,this.validateBytesReceived();const i=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(n=this.onProgress)===null||n===void 0||n.call(this,i)}[Symbol.asyncIterator](){const e=this.reader.getReader();let n=new bi,i=null,r=null;if(this.signal){const o=this.signal;r=()=>{var a;(a=n.reject)===null||a===void 0||a.call(n,o.reason)},o.addEventListener("abort",r),i=o}const s=()=>{e.releaseLock(),i&&r&&i.removeEventListener("abort",r),this.signal=void 0};return{next:()=>E(this,void 0,void 0,function*(){var o,a;try{const{done:l,value:d}=yield Promise.race([e.read(),n.promise,(a=(o=this.outOfBandFailureRejectingFuture)===null||o===void 0?void 0:o.promise)!==null&&a!==void 0?a:new Promise(()=>{})]);return l?(this.validateBytesReceived(!0),{done:!0,value:void 0}):(this.handleChunkReceived(d),{done:!1,value:d.content})}catch(l){throw s(),l}}),return(){return E(this,void 0,void 0,function*(){return s(),{done:!0,value:void 0}})}}}withAbortSignal(e){return this.signal=e,this}readAll(){return E(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function*(){var i,r,s,o;let a=new Set;const l=n.signal?e.withAbortSignal(n.signal):e;try{for(var d=!0,u=Hi(l),h;h=yield u.next(),i=h.done,!i;d=!0){o=h.value,d=!1;const p=o;a.add(p)}}catch(p){r={error:p}}finally{try{!d&&!i&&(s=u.return)&&(yield s.call(u))}finally{if(r)throw r.error}}return Array.from(a)}()})}}
595class EU extends EE{constructor(e,n,i,r){super(e,n,i,r),this.receivedChunks=new Map}handleChunkReceived(e){var n;const i=Ad(e.chunkIndex),r=this.receivedChunks.get(i);if(r&&r.version>e.version)return;this.receivedChunks.set(i,e),this.bytesReceived+=e.content.byteLength,this.validateBytesReceived();const s=this.totalByteSize?this.bytesReceived/this.totalByteSize:void 0;(n=this.onProgress)===null||n===void 0||n.call(this,s)}[Symbol.asyncIterator](){const e=this.reader.getReader(),n=new TextDecoder("utf-8",{fatal:!0});let i=new bi,r=null,s=null;if(this.signal){const a=this.signal;s=()=>{var l;(l=i.reject)===null||l===void 0||l.call(i,a.reason)},a.addEventListener("abort",s),r=a}const o=()=>{e.releaseLock(),r&&s&&r.removeEventListener("abort",s),this.signal=void 0};return{next:()=>E(this,void 0,void 0,function*(){var a,l;try{const{done:d,value:u}=yield Promise.race([e.read(),i.promise,(l=(a=this.outOfBandFailureRejectingFuture)===null||a===void 0?void 0:a.promise)!==null&&l!==void 0?l:new Promise(()=>{})]);if(d)return this.validateBytesReceived(!0),{done:!0,value:void 0};{this.handleChunkReceived(u);let h;try{h=n.decode(u.content)}catch(p){throw new Pr("Cannot decode datastream chunk ".concat(u.chunkIndex," as text: ").concat(p),Jn.DecodeFailed)}return{done:!1,value:h}}}catch(d){throw o(),d}}),return(){return E(this,void 0,void 0,function*(){return o(),{done:!0,value:void 0}})}}}withAbortSignal(e){return this.signal=e,this}readAll(){return E(this,arguments,void 0,function(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return function*(){var i,r,s,o;let a="";const l=n.signal?e.withAbortSignal(n.signal):e;try{for(var d=!0,u=Hi(l),h;h=yield u.next(),i=h.done,!i;d=!0)o=h.value,d=!1,a+=o}catch(p){r={error:p}}finally{try{!d&&!i&&(s=u.return)&&(yield s.call(u))}finally{if(r)throw r.error}}return a}()})}}class PU{constructor(){this.log=ke,this.byteStreamControllers=new Map,this.textStreamControllers=new Map,this.byteStreamHandlers=new Map,this.textStreamHandlers=new Map}registerTextStreamHandler(e,n){if(this.textStreamHandlers.has(e))throw new Pr('A text stream handler for topic "'.concat(e,'" has already been set.'),Jn.HandlerAlreadyRegistered);this.textStreamHandlers.set(e,n)}unregisterTextStreamHandler(e){this.textStreamHandlers.delete(e)}registerByteStreamHandler(e,n){if(this.byteStreamHandlers.has(e))throw new Pr('A byte stream handler for topic "'.concat(e,'" has already been set.'),Jn.HandlerAlreadyRegistered);this.byteStreamHandlers.set(e,n)}unregisterByteStreamHandler(e){this.byteStreamHandlers.delete(e)}clearHandlersAndControllers(){this.byteStreamControllers.clear(),this.textStreamControllers.clear(),this.byteStreamHandlers.clear(),this.textStreamHandlers.clear()}validateParticipantHasNoActiveDataStreams(e){var n,i,r,s;const o=Array.from(this.textStreamControllers.entries()).filter(l=>l[1].sendingParticipantIdentity===e),a=Array.from(this.byteStreamControllers.entries()).filter(l=>l[1].sendingParticipantIdentity===e);if(o.length>0||a.length>0){const l=new Pr("Participant ".concat(e," unexpectedly disconnected in the middle of sending data"),Jn.AbnormalEnd);for(const[d,u]of a)(i=(n=u.outOfBandFailureRejectingFuture).reject)===null||i===void 0||i.call(n,l),this.byteStreamControllers.delete(d);for(const[d,u]of o)(s=(r=u.outOfBandFailureRejectingFuture).reject)===null||s===void 0||s.call(r,l),this.textStreamControllers.delete(d)}}handleDataStreamPacket(e){return E(this,void 0,void 0,function*(){switch(e.value.case){case"streamHeader":return this.handleStreamHeader(e.value.value,e.participantIdentity);case"streamChunk":return this.handleStreamChunk(e.value.value);case"streamTrailer":return this.handleStreamTrailer(e.value.value);default:throw new Error('DataPacket of value "'.concat(e.value.case,'" is not data stream related!'))}})}handleStreamHeader(e,n){return E(this,void 0,void 0,function*(){var i;if(e.contentHeader.case==="byteHeader"){const r=this.byteStreamHandlers.get(e.topic);if(!r){this.log.debug("ignoring incoming byte stream due to no handler for topic",e.topic);return}let s;const o=new bi,a={id:e.streamId,name:(i=e.contentHeader.value.name)!==null&&i!==void 0?i:"unknown",mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Ad(e.timestamp),attributes:e.attributes},l=new ReadableStream({start:d=>{if(s=d,this.textStreamControllers.has(e.streamId))throw new Pr("A data stream read is already in progress for a stream with i
595d ".concat(e.streamId,"."),Jn.AlreadyOpened);this.byteStreamControllers.set(e.streamId,{info:a,controller:s,startTime:Date.now(),sendingParticipantIdentity:n,outOfBandFailureRejectingFuture:o})}});r(new _U(a,l,Ad(e.totalLength),o),{identity:n})}else if(e.contentHeader.case==="textHeader"){const r=this.textStreamHandlers.get(e.topic);if(!r){this.log.debug("ignoring incoming text stream due to no handler for topic",e.topic);return}let s;const o=new bi,a={id:e.streamId,mimeType:e.mimeType,size:e.totalLength?Number(e.totalLength):void 0,topic:e.topic,timestamp:Number(e.timestamp),attributes:e.attributes},l=new ReadableStream({start:d=>{if(s=d,this.textStreamControllers.has(e.streamId))throw new Pr("A data stream read is already in progress for a stream with id ".concat(e.streamId,"."),Jn.AlreadyOpened);this.textStreamControllers.set(e.streamId,{info:a,controller:s,startTime:Date.now(),sendingParticipantIdentity:n,outOfBandFailureRejectingFuture:o})}});r(new EU(a,l,Ad(e.totalLength),o),{identity:n})}})}handleStreamChunk(e){const n=this.byteStreamControllers.get(e.streamId);n&&e.content.length>0&&n.controller.enqueue(e);const i=this.textStreamControllers.get(e.streamId);i&&e.content.length>0&&i.controller.enqueue(e)}handleStreamTrailer(e){const n=this.textStreamControllers.get(e.streamId);n&&(n.info.attributes=Object.assign(Object.assign({},n.info.attributes),e.attributes),n.controller.close(),this.textStreamControllers.delete(e.streamId));const i=this.byteStreamControllers.get(e.streamId);i&&(i.info.attributes=Object.assign(Object.assign({},i.info.attributes),e.attributes),i.controller.close(),this.byteStreamControllers.delete(e.streamId))}}class PE{constructor(e,n,i){this.writableStream=e,this.defaultWriter=e.getWriter(),this.onClose=i,this.info=n}write(e){return this.defaultWriter.write(e)}close(){return E(this,void 0,void 0,function*(){var e;yield this.defaultWriter.close(),this.defaultWriter.releaseLock(),(e=this.onClose)===null||e===void 0||e.call(this)})}}class RU extends PE{}class NU extends PE{}const xx=15e3;class IU{constructor(e,n){this.engine=e,this.log=n}setupEngine(e){this.engine=e}sendText(e,n){return E(this,void 0,void 0,function*(){var i;const r=crypto.randomUUID(),o=new TextEncoder().encode(e).byteLength,a=(i=n==null?void 0:n.attachments)===null||i===void 0?void 0:i.map(()=>crypto.randomUUID()),l=new Array(a?a.length+1:1).fill(0),d=(h,p)=>{var g;l[p]=h;const b=l.reduce((m,k)=>m+k,0);(g=n==null?void 0:n.onProgress)===null||g===void 0||g.call(n,b)},u=yield this.streamText({streamId:r,totalSize:o,destinationIdentities:n==null?void 0:n.destinationIdentities,topic:n==null?void 0:n.topic,attachedStreamIds:a,attributes:n==null?void 0:n.attributes});return yield u.write(e),d(1,0),yield u.close(),n!=null&&n.attachments&&a&&(yield Promise.all(n.attachments.map((h,p)=>E(this,void 0,void 0,function*(){return this._sendFile(a[p],h,{topic:n.topic,mimeType:h.type,onProgress:g=>{d(g,p+1)}})})))),u.info})}streamText(e){return E(this,void 0,void 0,function*(){var n,i;const r=(n=e==null?void 0:e.streamId)!==null&&n!==void 0?n:crypto.randomUUID(),s={id:r,mimeType:"text/plain",timestamp:Date.now(),topic:(i=e==null?void 0:e.topic)!==null&&i!==void 0?i:"",size:e==null?void 0:e.totalSize,attributes:e==null?void 0:e.attributes},o=new cm({streamId:r,mimeType:s.mimeType,topic:s.topic,timestamp:gs(s.timestamp),totalLength:gs(e==null?void 0:e.totalSize),attributes:s.attributes,contentHeader:{case:"textHeader",value:new S1({version:e==null?void 0:e.version,attachedStreamIds:e==null?void 0:e.attachedStreamIds,replyToStreamId:e==null?void 0:e.replyToStreamId,operationType:(e==null?void 0:e.type)==="update"?am.UPDATE:am.CREATE})}}),a=e==null?void 0:e.destinationIdentities,l=new rn({destinationIdentities:a,value:{case:"streamHeader",value:o}});yield this.engine.sendDataPacket(l,xe.RELIABLE);let d=0;const u=this.engine,h=new WritableStream({write(b){return E(this,void 0,void 0,function*(){for(const m of N4(b,xx)){yield u.waitForBufferStatusLow(xe.RELIABLE);const k=new lm({content:m,streamId:r,chunkIndex:gs(d)}),v=new rn({destinationIdentities:a,value:{case:"streamChunk",value:k}});yield u.sendDataPacket(v,xe.RELIABLE),d+=1}})},close(){return E(this,void 0,void 0,function*(){const b=new dm({streamId:r}),m=new rn({destinationIdentities:a,value:{case:"streamTrailer",value:b}});yield u.sendDataPacket(m,xe.RELIABLE)})},abort(b){console.log("Sink error:",b)}});let p=()=>E(this,void 0,void 0,function*(){yield g.close()});u.once(X.Closing,p);const g=new RU(h,s,()=>this.engine.off(X.Closing,p));return g})}sendFile(e,n){return E(this,void 0,void 0,function*(){const i=crypto.randomUUID();return yield this._sendFile(i,e,n),{id:i}})}_sendFile(e,n,i){return E(this,void 0,void 0,function*(){var r;const s=yield this.streamBytes({streamId:e,totalSize:n.size,name:n.name,mimeType:(r=i==null?void 0:i.mimeType)!==null&&r!==void 0?r:n.type,topic:i==null?void 0:i.topic,destinationIdentities:i==null?void 0:i.destinationIdentities}),o=n.stream().getReader();for(;;){const{done:a,value:l}=yield o.read();if(a)break;yield s.write(l)}return yield s.close(),s.info})}streamBytes(e){return E(this,void 0,void 0,function*(){var n,i,r,s,o;const a=(n=e==null?void 0:e.streamId)!==null&&n!==void 0?n:crypto.randomUUID(),l=e==null?void 0:e.destinationIdentities,d={id:a,mimeType:(i=e==null?void 0:e.mimeType)!==null&&i!==void 0?i:"application/octet-stream",topic:(r=e==null?void 0:e.topic)!==null&&r!==void 0?r:"",timestamp:Date.now(),attributes:e==null?void 0:e.attributes,size:e==null?void 0:e.totalSize,name:(s=e==null?void 0:e.name)!==null&&s!==void 0?s:"unknown"},u=new cm({totalLength:gs((o=d.size)!==null&&o!==void 0?o:0),mimeType:d.mimeType,streamId:a,topic:d.topic,timestamp:gs(Date.now()),attributes:d.attributes,contentHeader:{case:"byteHeader",value:new w1({name:d.name})}}),h=new rn({destinationIdentities:l,value:{case:"streamHeader",value:u}});yield this.engine.sendDataPacket(h,xe.RELIABLE);let p=0;const g=new dn,b=this.engine,m=this.log,k=new WritableStream({write(y){return E(this,void 0,void 0,function*(){const x=yield g.lock();let S=0;try{for(;S<y.byteLength;){const w=y.slice(S,S+xx);yield b.waitForBufferStatusLow(xe.RELIABLE);const C=new rn({destinationIdentities:l,value:{case:"streamChunk",value:new lm({content:w,streamId:a,chunkIndex:gs(p)})}});yield b.sendDataPacket(C,xe.RELIABLE),p+=1,S+=w.byteLength}}finally{x()}})},close(){return E(this,void 0,void 0,function*(){const y=new dm({streamId:a}),x=new rn({destinationIdentities:l,value:{case:"streamTrailer",value:y}});yield b.sendDataPacket(x,xe.RELIABLE)})},abort(y){m.error("Sink error:",y)}});return new NU(k,d)})}}class RE extends V{constructor(e,n,i,r,s){super(e,i,s),this.sid=n,this.receiver=r}get isLocal(){return!1}setMuted(e){this.isMuted!==e&&(this.isMuted=e,this._mediaStreamTrack.enabled=!e,this.emit
vendor: 16,988 bytes, line 595
595(e?$.Muted:$.Unmuted,this))}setMediaStream(e){this.mediaStream=e;const n=i=>{i.track===this._mediaStreamTrack&&(e.removeEventListener("removetrack",n),this.receiver&&"playoutDelayHint"in this.receiver&&(this.receiver.playoutDelayHint=void 0),this.receiver=void 0,this._currentBitrate=0,this.emit($.Ended,this))};e.addEventListener("removetrack",n)}start(){this.startMonitor(),super.enable()}stop(){this.stopMonitor(),super.disable()}getRTCStatsReport(){return E(this,void 0,void 0,function*(){var e;return!((e=this.receiver)===null||e===void 0)&&e.getStats?yield this.receiver.getStats():void 0})}setPlayoutDelay(e){this.receiver?"playoutDelayHint"in this.receiver?this.receiver.playoutDelayHint=e:this.log.warn("Playout delay not supported in this browser"):this.log.warn("Cannot set playout delay, track already ended")}getPlayoutDelay(){if(this.receiver){if("playoutDelayHint"in this.receiver)return this.receiver.playoutDelayHint;this.log.warn("Playout delay not supported in this browser")}else this.log.warn("Cannot get playout delay, track already ended");return 0}startMonitor(){this.monitorInterval||(this.monitorInterval=setInterval(()=>this.monitorReceiver(),Vv)),O4()&&this.registerTimeSyncUpdate()}registerTimeSyncUpdate(){const e=()=>{var n;this.timeSyncHandle=requestAnimationFrame(()=>e());const i=(n=this.receiver)===null||n===void 0?void 0:n.getSynchronizationSources()[0];if(i){const{timestamp:r,rtpTimestamp:s}=i;s&&this.rtpTimestamp!==s&&(this.emit($.TimeSyncUpdate,{timestamp:r,rtpTimestamp:s}),this.rtpTimestamp=s)}};e()}}class jU extends RE{constructor(e,n,i,r,s,o){super(e,n,V.Kind.Audio,i,o),this.monitorReceiver=()=>E(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const a=yield this.getReceiverStats();a&&this.prevStats&&this.receiver&&(this._currentBitrate=fh(a,this.prevStats)),this.prevStats=a}),this.audioContext=r,this.webAudioPluginNodes=[],s&&(this.sinkId=s.deviceId)}setVolume(e){var n;for(const i of this.attachedElements)this.audioContext?(n=this.gainNode)===null||n===void 0||n.gain.setTargetAtTime(e,0,.1):i.volume=e;_i()&&this._mediaStreamTrack._setVolume(e),this.elementVolume=e}getVolume(){if(this.elementVolume)return this.elementVolume;if(_i())return 1;let e=0;return this.attachedElements.forEach(n=>{n.volume>e&&(e=n.volume)}),e}setSinkId(e){return E(this,void 0,void 0,function*(){this.sinkId=e,yield Promise.all(this.attachedElements.map(n=>{if(_m(n))return n.setSinkId(e)}))})}attach(e){const n=this.attachedElements.length===0;return e?super.attach(e):e=super.attach(),this.sinkId&&_m(e)&&e.setSinkId(this.sinkId).catch(i=>{this.log.error("Failed to set sink id on remote audio track",i,this.logContext)}),this.audioContext&&n&&(this.log.debug("using audio context mapping",this.logContext),this.connectWebAudio(this.audioContext,e),e.volume=0,e.muted=!0),this.elementVolume&&this.setVolume(this.elementVolume),e}detach(e){let n;return e?(n=super.detach(e),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(n=super.detach(),this.disconnectWebAudio()),n}setAudioContext(e){this.audioContext=e,e&&this.attachedElements.length>0?this.connectWebAudio(e,this.attachedElements[0]):e||this.disconnectWebAudio()}setWebAudioPlugins(e){this.webAudioPluginNodes=e,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}connectWebAudio(e,n){this.disconnectWebAudio(),this.sourceNode=e.createMediaStreamSource(n.srcObject);let i=this.sourceNode;this.webAudioPluginNodes.forEach(r=>{i.connect(r),i=r}),this.gainNode=e.createGain(),i.connect(this.gainNode),this.gainNode.connect(e.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),e.state!=="running"&&e.resume().then(()=>{e.state!=="running"&&this.emit($.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))}).catch(r=>{this.emit($.AudioPlaybackFailed,r)})}disconnectWebAudio(){var e,n;(e=this.gainNode)===null||e===void 0||e.disconnect(),(n=this.sourceNode)===null||n===void 0||n.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}getReceiverStats(){return E(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let n;return e.forEach(i=>{i.type==="inbound-rtp"&&(n={type:"audio",streamId:i.id,timestamp:i.timestamp,jitter:i.jitter,bytesReceived:i.bytesReceived,concealedSamples:i.concealedSamples,concealmentEvents:i.concealmentEvents,silentConcealedSamples:i.silentConcealedSamples,silentConcealmentEvents:i.silentConcealmentEvents,totalAudioEnergy:i.totalAudioEnergy,totalSamplesDuration:i.totalSamplesDuration})}),n})}}const Rf=100;class AU extends RE{constructor(e,n,i,r,s){super(e,n,V.Kind.Video,i,s),this.elementInfos=[],this.monitorReceiver=()=>E(this,void 0,void 0,function*(){if(!this.receiver){this._currentBitrate=0;return}const o=yield this.getReceiverStats();o&&this.prevStats&&this.receiver&&(this._currentBitrate=fh(o,this.prevStats)),this.prevStats=o}),this.debouncedHandleResize=Lv(()=>{this.updateDimensions()},Rf),this.adaptiveStreamSettings=r}get isAdaptiveStream(){return this.adaptiveStreamSettings!==void 0}setStreamState(e){super.setStreamState(e),console.log("setStreamState",e),e===V.StreamState.Active&&this.updateVisibility()}get mediaStreamTrack(){return this._mediaStreamTrack}setMuted(e){super.setMuted(e),this.attachedElements.forEach(n=>{e?qo(this._mediaStreamTrack,n):Ro(this._mediaStreamTrack,n)})}attach(e){if(e?super.attach(e):e=super.attach(),this.adaptiveStreamSettings&&this.elementInfos.find(n=>n.element===e)===void 0){const n=new OU(e);this.observeElementInfo(n)}return e}observeElementInfo(e){this.adaptiveStreamSettings&&this.elementInfos.find(n=>n===e)===void 0?(e.handleResize=()=>{this.debouncedHandleResize()},e.handleVisibilityChanged=()=>{this.updateVisibility()},this.elementInfos.push(e),e.observe(),this.debouncedHandleResize(),this.updateVisibility()):this.log.warn("visibility resize observer not triggered",this.logContext)}stopObservingElementInfo(e){if(!this.isAdaptiveStream){this.log.warn("stopObservingElementInfo ignored",this.logContext);return}const n=this.elementInfos.filter(i=>i===e);for(const i of n)i.stopObserving();this.elementInfos=this.elementInfos.filter(i=>i!==e),this.updateVisibility(),this.debouncedHandleResize()}detach(e){let n=[];if(e)return this.stopObservingElement(e),super.detach(e);n=super.detach();for(const i of n)this.stopObservingElement(i);return n}getDecoderImplementation(){var e;return(e=this.prevStats)===null||e===void 0?void 0:e.decoderImplementation}getReceiverStats(){return E(this,void 0,void 0,function*(){if(!this.receiver||!this.receiver.getStats)return;const e=yield this.receiver.getStats();let n,i="",r=new Map;return e.forEach(s=>{s.type==="inbound-rtp"?(i=s.codecId,n={type:"video",streamId:s.id,framesDecoded:s.framesDecoded,framesDropped:s.framesDropped,framesReceived:s.framesReceived,packetsReceived:s.packetsReceived,packetsLost:s.packetsLost,frameWidth:s.frameWidth,frameHeight:s.frameHeight,pliCount:s.pliCount,firCount:s.firCount,nackCount:s.nackCount,jitter:s.jitter,timestamp:s.timestamp,bytesReceived:s.bytesReceived,decoderImplementation:s.decoderImplementation}):s.type==="codec"&&r.set(s.id,s)}),n&&i!==""&&r.get(i)&&(n.mimeType=r.get(i).mimeType),n})}stopObservingElement(e){const n=this.elementInfos.filter(i=>i.element===e);for(const i of n)this.stopObservingElementInfo(i)}handleAppVisibilityChanged(){const e=Object.create(null,{handleAppVisibilityChanged:{get:()=>super.handleAppVisibilityChanged}});return E(this,void 0,void 0,function*(){yield e.handleAppVisibilityChanged.call(this),this.isAdaptiveStream&&this.updateVisibility()})}updateVisibility(e){var n,i;const r=this.elementInfos.reduce((l,d)=>Math.max(l,d.visibilityChangedAt||0),0),s=!((i=(n=this.adaptiveStreamSettings)===null||n===void 0?void 0:n.pauseVideoInBackground)!==null&&i!==void 0)||i?this.isInBackground:!1,o=this.elementInfos.some(l=>l.pictureInPicture),a=this.elementInfos.some(l=>l.visible)&&!s||o;if(!(this.lastVisible===a&&!e)){if(!a&&Date.now()-r<Rf){Nt.setTimeout(()=>{this.updateVisibility()},Rf);return}this.lastVisible=a,this.emit($.VisibilityChanged,a,this)}}updateDimensions(){var e,n;let i=0,r=0;const s=this.getPixelDensity();for(const o of this.elementInfos){const a=o.width()*s,l=o.height()*s;a+l>i+r&&(i=a,r=l)}((e=this.lastDimensions)===null||e===void 0?void 0:e.width)===i&&((n=this.lastDimensions)===null||n===void 0?void 0:n.height)===r||(this.lastDimensions={width:i,height:r},this.emit($.VideoDimensionsChanged,this.lastDimensions,this))}getPixelDensity(){var e;const n=(e=this.adaptiveStreamSettings)===null||e===void 0?void 0:e.pixelDensity;return n==="screen"?Xb():n||(Xb()>2?2:1)}}class OU{get visible(){return this.isPiP||this.isIntersecting}get pictureInPicture(){return this.isPiP}constructor(e,n){this.onVisibilityChanged=i=>{var r;const{target:s,isIntersecting:o}=i;s===this.element&&(this.isIntersecting=o,this.isPiP=Ka(this.element),this.visibilityChangedAt=Date.now(),(r=this.handleVisibilityChanged)===null||r===void 0||r.call(this))},this.onEnterPiP=()=>{var i,r,s;(r=(i=window.documentPictureInPicture)===null||i===void 0?void 0:i.window)===null||r===void 0||r.addEventListener("pagehide",this.onLeavePiP),this.isPiP=Ka(this.element),(s=this.handleVisibilityChanged)===null||s===void 0||s.call(this)},this.onLeavePiP=()=>{var i;this.isPiP=Ka(this.element),(i=this.handleVisibilityChanged)===null||i===void 0||i.call(this)},this.element=e,this.isIntersecting=n??Lm(e),this.isPiP=on()&&Ka(e),this.visibilityChangedAt=0}width(){return this.element.clientWidth}height(){return this.element.clientHeight}observe(){var e,n,i;this.isIntersecting=Lm(this.element),this.isPiP=Ka(this.element),this.element.handleResize=()=>{var r;(r=this.handleResize)===null||r===void 0||r.call(this)},this.element.handleVisibilityChanged=this.onVisibilityChanged,ex().observe(this.element),Zb().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP),(e=window.documentPictureInPicture)===null||e===void 0||e.addEventListener("enter",this.onEnterPiP),(i=(n=window.documentPictureInPicture)===null||n===void 0?void 0:n.window)===null||i===void 0||i.addEventListener("pagehide",this.onLeavePiP)}stopObserving(){var e,n,i,r,s;(e=ex())===null||e===void 0||e.unobserve(this.element),(n=Zb())===null||n===void 0||n.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP),(i=window.documentPictureInPicture)===null||i===void 0||i.removeEventListener("enter",this.onEnterPiP),(s=(r=window.documentPictureInPicture)===null||r===void 0?void 0:r.window)===null||s===void 0||s.removeEventListener("pagehide",this.onLeavePiP)}}function Ka(t){var e,n;return document.pictureInPictureElement===t?!0:!((e=window.documentPictureInPicture)===null||e===void 0)&&e.window?Lm(t,(n=window.documentPictureInPicture)===null||n===void 0?void 0:n.window):!1}function Lm(t,e){const n=e||window;let i=t.offsetTop,r=t.offsetLeft;const s=t.offsetWidth,o=t.offsetHeight,{hidden:a}=t,{display:l}=getComputedStyle(t);for(;t.offsetParent;)t=t.offsetParent,i+=t.offsetTop,r+=t.offsetLeft;return i<n.pageYOffset+n.innerHeight&&r<n.pageXOffset+n.innerWidth&&i+o>n.pageYOffset&&r+s>n.pageXOffset&&!a&&l!=="none"}class Fi extends Ni.EventEmitter{constructor(e,n,i,r){var s;super(),this.metadataMuted=!1,this.encryption=gn.NONE,this.log=ke,this.handleMuted=()=>{this.emit($.Muted)},this.handleUnmuted=()=>{this.emit($.Unmuted)},this.log=rr((s=r==null?void 0:r.loggerName)!==null&&s!==void 0?s:ri.Publication),this.loggerContextCb=this.loggerContextCb,this.setMaxListeners(100),this.kind=e,this.trackSid=n,this.trackName=i,this.source=V.Source.Unknown}setTrack(e){this.track&&(this.track.off($.Muted,this.handleMuted),this.track.off($.Unmuted,this.handleUnmuted)),this.track=e,e&&(e.on($.Muted,this.handleMuted),e.on($.Unmuted,this.handleUnmuted))}get logContext(){var e;return Object.assign(Object.assign({},(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this)),we(this))}get isMuted(){return this.metadataMuted}get isEnabled(){return!0}get isSubscribed(){return this.track!==void 0}get isEncrypted(){return this.encryption!==gn.NONE}get audioTrack(){if(Ci(this.track))return this.track}get videoTrack(){if(us(this.track))return this.track}updateInfo(e){this.trackSid=e.sid,this.trackName=e.name,this.source=V.sourceFromProto(e.source),this.mimeType=e.mimeType,this.kind===V.Kind.Video&&e.width>0&&(this.dimensions={width:e.width,height:e.height},this.simulcasted=e.simulcast),this.encryption=e.encryption,this.trackInfo=e,this.log.debug("update publication info",Object.assign(Object.assign({},this.logContext),{info:e}))}}(function(t){(function(e){e.Desired="desired",e.Subscribed="subscribed",e.Unsubscribed="unsubscribed"})(t.SubscriptionStatus||(t.SubscriptionStatus={})),function(e){e.Allowed="allowed",e.NotAllowed="not_allowed"}(t.PermissionStatus||(t.PermissionStatus={}))})(Fi||(Fi={}));class Mm extends Fi{get isUpstreamPaused(){var e;return(e=this.track)===null||e===void 0?void 0:e.isUpstreamPaused}constructor(e,n,i,r){super(e,n.sid,n.name,r),this.track=void 0,this.handleTrackEnded=()=>{this.emit($.Ended)},this.handleCpuConstrained=()=>{this.track&&us(this.track)&&this.emit($.CpuConstrained,this.track)},this.updateInfo(n),this.setTrack(i)}setTrack(e){this.track&&(this.track.off($.Ended,this.handleTrackEnded),this.track.off($.CpuConstrained,this.handleCpuConstrained)),super.setTrack(e),e&&(e.on($.Ended,this.handleTrackEnded),e.on($.CpuConstrained,this.handleCpuConstrained))}get isMuted(){return this.track?this.track.isMuted:super.isMuted}get audioTrack(){return super.audioTrack}get videoTrack(){return super.videoTrack}get isLocal(){return!0}mute(){return E(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.mute()})}unmute(){return E(this,void 0,void 0,function*(){var e;return(e=this.track)===null||e===void 0?void 0:e.unmute()})}pauseUpstream(){return E(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.pauseUpstream()})}resumeUpstream(){return E(this,void 0,void 0,function*(){var e;yield(e=this.track)===null||e===void 0?void 0:e.resumeUpstream()})}getTrackFeatures(){var e;if(Ci(this.track)){const n=this.track.getSourceTrackSettings(),i=new Set;return n.autoGainControl&&i.add(Ct.TF_AUTO_GAIN_CONTROL),n.echoCancellation&&i.add(Ct.TF_ECHO_CANCELLATION),n.noiseSuppression&&i.add(Ct.TF_NOISE_SUPPRESSION),n.channelCount&&n.channelCount>1&&i.add(Ct.TF_STEREO),!((e=this.options)===null||e===void 0)&&e.dtx||i.add(Ct.TF_NO_DTX),this.track.enhancedNoiseCancellation&&i.add(Ct.TF_ENHANCED_NOISE_CANCELLATION),Array.from(i.values())}else return[]}}function ph(t,e){return E(this,void 0,void 0,function*(){t??(t={});let n=!1;const{audioProcessor:i,videoProcessor:r,optionsWithoutProcessor:s}=bE(t);let o=s.audio,a=s.video;if(i&&typeof s.audio=="object"&&(s.audio.processor=i),r&&typeof s.video=="object"&&(s.video.processor=r),t.audio&&typeof s.audio=="object"&&typeof s.audio.deviceId=="string"){const h=s.audio.deviceId;s.audio.deviceId={exact:h},n=!0,o=Object.assign(Object.assign({},s.audio),{deviceId:{ideal:h}})}if(s.video&&typeof s.video=="object"&&typeof s.video.deviceId=="string"){const h=s.video.deviceId;s.video.deviceId={exact:h},n=!0,a=Object.assign(Object.assign({},s.video),{deviceId:{ideal:h}})}(s.audio===!0||typeof s.audio=="object"&&!s.audio.deviceId)&&(s.audio={deviceId:"default"}),s.video===!0?s.video={deviceId:"default"}:typeof s.video=="object"&&!s.video.deviceId&&(s.video.deviceId="default");const l=gE(s,kE,SE),d=Av(l),u=navigator.mediaDevices.getUserMedia(d);s.audio&&(Tt.userMediaPromiseMap.set("audioinput",u),u.catch(()=>Tt.userMediaPromiseMap.delete("audioinput"))),s.video&&(Tt.userMediaPromiseMap.set("videoinput",u),u.catch(()=>Tt.userMediaPromiseMap.delete("videoinput")));try{const h=yield u;return yield Promise.all(h.getTracks().map(p=>E(this,void 0,void 0,function*(){const g=p.kind==="audio";let b=g?l.audio:l.video;(typeof b=="boolean"||!b)&&(b={});let m;const k=g?d.audio:d.video;typeof k!="boolean"&&(m=k);const v=p.getSettings().deviceId;m!=null&&m.deviceId&&Zr(m.deviceId)!==v?m.deviceId=v:m||(m={deviceId:v});const y=cU(p,m,e);return y.kind===V.Kind.Video?y.source=V.Source.Camera:y.kind===V.Kind.Audio&&(y.source=V.Source.Microphone),y.mediaStream=h,Ci(y)&&i?yield y.setProcessor(i):us(y)&&r&&(yield y.setProcessor(r)),y})))}catch(h){if(!n)throw h;return ph(Object.assign(Object.assign({},t),{audio:o,video:a}),e)}})}function DU(t){return E(this,void 0,void 0,function*(){return(yield ph({audio:!1,video:!0}))[0]})}function NE(t){return E(this,void 0,void 0,function*(){return(yield ph({audio:t??!0,video:!1}
595))[0]})}var Yn;(function(t){t.Excellent="excellent",t.Good="good",t.Poor="poor",t.Lost="lost",t.Unknown="unknown"})(Yn||(Yn={}));function LU(t){switch(t){case ec.EXCELLENT:return Yn.Excellent;case ec.GOOD:return Yn.Good;case ec.POOR:return Yn.Poor;case ec.LOST:return Yn.Lost;default:return Yn.Unknown}}class IE extends Ni.EventEmitter{get logContext(){var e,n;return Object.assign({},(n=(e=this.loggerOptions)===null||e===void 0?void 0:e.loggerContextCb)===null||n===void 0?void 0:n.call(e))}get isEncrypted(){return this.trackPublications.size>0&&Array.from(this.trackPublications.values()).every(e=>e.isEncrypted)}get isAgent(){var e;return((e=this.permissions)===null||e===void 0?void 0:e.agent)||this.kind===Bc.AGENT}get isActive(){var e;return((e=this.participantInfo)===null||e===void 0?void 0:e.state)===Wo.ACTIVE}get kind(){return this._kind}get attributes(){return Object.freeze(Object.assign({},this._attributes))}constructor(e,n,i,r,s,o){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:Bc.STANDARD;var l;super(),this.audioLevel=0,this.isSpeaking=!1,this._connectionQuality=Yn.Unknown,this.log=ke,this.log=rr((l=o==null?void 0:o.loggerName)!==null&&l!==void 0?l:ri.Participant),this.loggerOptions=o,this.setMaxListeners(100),this.sid=e,this.identity=n,this.name=i,this.metadata=r,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this._kind=a,this._attributes=s??{}}getTrackPublications(){return Array.from(this.trackPublications.values())}getTrackPublication(e){for(const[,n]of this.trackPublications)if(n.source===e)return n}getTrackPublicationByName(e){for(const[,n]of this.trackPublications)if(n.trackName===e)return n}waitUntilActive(){return this.isActive?Promise.resolve():this.activeFuture?this.activeFuture.promise:(this.activeFuture=new bi,this.once(J.Active,()=>{var e,n;(n=(e=this.activeFuture)===null||e===void 0?void 0:e.resolve)===null||n===void 0||n.call(e),this.activeFuture=void 0}),this.activeFuture.promise)}get connectionQuality(){return this._connectionQuality}get isCameraEnabled(){var e;const n=this.getTrackPublication(V.Source.Camera);return!(!((e=n==null?void 0:n.isMuted)!==null&&e!==void 0)||e)}get isMicrophoneEnabled(){var e;const n=this.getTrackPublication(V.Source.Microphone);return!(!((e=n==null?void 0:n.isMuted)!==null&&e!==void 0)||e)}get isScreenShareEnabled(){return!!this.getTrackPublication(V.Source.ScreenShare)}get isLocal(){return!1}get joinedAt(){return this.participantInfo?new Date(Number.parseInt(this.participantInfo.joinedAt.toString())*1e3):new Date}updateInfo(e){var n;return this.participantInfo&&this.participantInfo.sid===e.sid&&this.participantInfo.version>e.version?!1:(this.identity=e.identity,this.sid=e.sid,this._setName(e.name),this._setMetadata(e.metadata),this._setAttributes(e.attributes),e.state===Wo.ACTIVE&&((n=this.participantInfo)===null||n===void 0?void 0:n.state)!==Wo.ACTIVE&&this.emit(J.Active),e.permission&&this.setPermissions(e.permission),this.participantInfo=e,!0)}_setMetadata(e){const n=this.metadata!==e,i=this.metadata;this.metadata=e,n&&this.emit(J.ParticipantMetadataChanged,i)}_setName(e){const n=this.name!==e;this.name=e,n&&this.emit(J.ParticipantNameChanged,e)}_setAttributes(e){const n=D4(this.attributes,e);this._attributes=e,Object.keys(n).length>0&&this.emit(J.AttributesChanged,n)}setPermissions(e){var n,i,r,s,o,a;const l=this.permissions,d=e.canPublish!==((n=this.permissions)===null||n===void 0?void 0:n.canPublish)||e.canSubscribe!==((i=this.permissions)===null||i===void 0?void 0:i.canSubscribe)||e.canPublishData!==((r=this.permissions)===null||r===void 0?void 0:r.canPublishData)||e.hidden!==((s=this.permissions)===null||s===void 0?void 0:s.hidden)||e.recorder!==((o=this.permissions)===null||o===void 0?void 0:o.recorder)||e.canPublishSources.length!==this.permissions.canPublishSources.length||e.canPublishSources.some((u,h)=>{var p;return u!==((p=this.permissions)===null||p===void 0?void 0:p.canPublishSources[h])})||e.canSubscribeMetrics!==((a=this.permissions)===null||a===void 0?void 0:a.canSubscribeMetrics);
595return this.permissions=e,d&&this.emit(J.ParticipantPermissionsChanged,l),d}setIsSpeaking(e){e!==this.isSpeaking&&(this.isSpeaking=e,e&&(this.lastSpokeAt=new Date),this.emit(J.IsSpeakingChanged,e))}setConnectionQuality(e){const n=this._connectionQuality;this._connectionQuality=LU(e),n!==this._connectionQuality&&this.emit(J.ConnectionQualityChanged,this._connectionQuality)}setDisconnected(){var e,n;this.activeFuture&&((n=(e=this.activeFuture).reject)===null||n===void 0||n.call(e,new Error("Participant disconnected")),this.activeFuture=void 0)}setAudioContext(e){this.audioContext=e,this.audioTrackPublications.forEach(n=>Ci(n.track)&&n.track.setAudioContext(e))}addTrackPublication(e){e.on($.Muted,()=>{this.emit(J.TrackMuted,e)}),e.on($.Unmuted,()=>{this.emit(J.TrackUnmuted,e)});const n=e;switch(n.track&&(n.track.sid=e.trackSid),this.trackPublications.set(e.trackSid,e),e.kind){case V.Kind.Audio:this.audioTrackPublications.set(e.trackSid,e);break;case V.Kind.Video:this.videoTrackPublications.set(e.trackSid,e);break}}}function MU(t){var e,n,i;if(!t.participantSid&&!t.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new R1({participantIdentity:(e=t.participantIdentity)!==null&&e!==void 0?e:"",participantSid:(n=t.participantSid)!==null&&n!==void 0?n:"",allTracks:(i=t.allowAll)!==null&&i!==void 0?i:!1,trackSids:t.allowedTrackSids||[]})}class UU extends IE{constructor(e,n,i,r,s,o){super(e,n,void 0,void 0,void 0,{loggerName:r.loggerName,loggerContextCb:()=>this.engine.logContext}),this.pendingPublishing=new Set,this.pendingPublishPromises=new Map,this.participantTrackPermissions=[],this.allParticipantsAllowedToSubscribe=!0,this.encryptionType=gn.NONE,this.enabledPublishVideoCodecs=[],this.pendingAcks=new Map,this.pendingResponses=new Map,this.handleReconnecting=()=>{this.reconnectFuture||(this.reconnectFuture=new bi)},this.handleReconnected=()=>{var a,l;(l=(a=this.reconnectFuture)===null||a===void 0?void 0:a.resolve)===null||l===void 0||l.call(a),this.reconnectFuture=void 0,this.updateTrackSubscriptionPermissions()},this.handleClosing=()=>{var a,l,d,u,h,p;this.reconnectFuture&&(this.reconnectFuture.promise.catch(g=>this.log.warn(g.message,this.logContext)),(l=(a=this.reconnectFuture)===null||a===void 0?void 0:a.reject)===null||l===void 0||l.call(a,"Got disconnected during reconnection attempt"),this.reconnectFuture=void 0),this.signalConnectedFuture&&((u=(d=this.signalConnectedFuture).reject)===null||u===void 0||u.call(d,"Got disconnected without signal connected"),this.signalConnectedFuture=void 0),(p=(h=this.activeAgentFuture)===null||h===void 0?void 0:h.reject)===null||p===void 0||p.call(h,"Got disconnected without active agent present"),this.activeAgentFuture=void 0,this.firstActiveAgent=void 0},this.handleSignalConnected=a=>{var l,d;a.participant&&this.updateInfo(a.participant),this.signalConnectedFuture||(this.signalConnectedFuture=new bi),(d=(l=this.signalConnectedFuture).resolve)===null||d===void 0||d.call(l)},this.handleSignalRequestResponse=a=>{const{requestId:l,reason:d,message:u}=a,h=this.pendingSignalRequests.get(l);h&&(d!==Rv.OK&&h.reject(new Gb(u,d)),this.pendingSignalRequests.delete(l))},this.handleDataPacket=a=>{switch(a.value.case){case"rpcResponse":let l=a.value.value,d=null,u=null;l.value.case==="payload"?d=l.value.value:l.value.case==="error"&&(u=ut.fromProto(l.value.value)),this.handleIncomingRpcResponse(l.requestId,d,u);break;case"rpcAck":let h=a.value.value;this.handleIncomingRpcAck(h.requestId);break}},this.updateTrackSubscriptionPermissions=()=>{this.log.debug("updating track subscription permissions",Object.assign(Object.assign({},this.logContext),{allParticipantsAllowed:this.allParticipantsAllowedToSubscribe,participantTrackPermissions:this.participantTrackPermissions})),this.engine.client.sendUpdateSubscriptionPermissions(this.allParticipantsAllowedToSubscribe,this.participantTrackPermissions.map(a=>MU(a)))},this.onTrackUnmuted=a=>{this.onTrackMuted(a,a.isUpstreamPaused)},this.onTrackMuted=(a,l)=>{if(l===void 0&&(l=!0),!a.sid){this.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},this.logContext),we(a)));return}this.engine.updateMuteStatus(a.sid,l)},this.onTrackUpstreamPaused=a=>{this.log.debug("upstream paused",Object.assign(Object.assign({},this.logContext),we(a))),this.onTrackMuted(a,!0)},this.onTrackUpstreamResumed=a=>{this.log.debug("upstream resumed",Object.assign(Object.assign({},this.logContext),we(a))),this.onTrackMuted(a,a.isMuted)},this.onTrackFeatureUpdate=a=>{const l=this.audioTrackPublications.get(a.sid);if(!l){this.log.warn("Could not update local audio track settings, missing publication for track ".concat(a.sid),this.logContext);return}this.engine.client.sendUpdateLocalAudioTrack(l.trackSid,l.getTrackFeatures())},this.onTrackCpuConstrained=(a,l)=>{this.log.debug("track cpu constrained",Object.assign(Object.assign({}
vendor: 8,603 bytes, line 595
595,this.logContext),we(l))),this.emit(J.LocalTrackCpuConstrained,a,l)},this.handleSubscribedQualityUpdate=a=>E(this,void 0,void 0,function*(){var l,d,u,h,p;if(!(!((p=this.roomOptions)===null||p===void 0)&&p.dynacast))return;const g=this.videoTrackPublications.get(a.trackSid);if(!g){this.log.warn("received subscribed quality update for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:a.trackSid}));return}if(!g.videoTrack)return;const b=yield g.videoTrack.setPublishingCodecs(a.subscribedCodecs);try{for(var m=!0,k=Hi(b),v;v=yield k.next(),l=v.done,!l;m=!0){h=v.value,m=!1;const y=h;d4(y)&&(this.log.debug("publish ".concat(y," for ").concat(g.videoTrack.sid),Object.assign(Object.assign({},this.logContext),we(g))),yield this.publishAdditionalCodecForTrack(g.videoTrack,y,g.options))}}catch(y){d={error:y}}finally{try{!m&&!l&&(u=k.return)&&(yield u.call(k))}finally{if(d)throw d.error}}}),this.handleLocalTrackUnpublished=a=>{const l=this.trackPublications.get(a.trackSid);if(!l){this.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:a.trackSid}));return}this.unpublishTrack(l.track)},this.handleTrackEnded=a=>E(this,void 0,void 0,function*(){if(a.source===V.Source.ScreenShare||a.source===V.Source.ScreenShareAudio)this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),we(a))),this.unpublishTrack(a);else if(a.isUserProvided)yield a.mute();else if(Oi(a)||mr(a))try{if(on())try{const l=yield navigator==null?void 0:navigator.permissions.query({name:a.source===V.Source.Camera?"camera":"microphone"});if(l&&l.state==="denied")throw this.log.warn("user has revoked access to ".concat(a.source),Object.assign(Object.assign({},this.logContext),we(a))),l.onchange=()=>{l.state!=="denied"&&(a.isMuted||a.restartTrack(),l.onchange=null)},new Error("GetUserMedia Permission denied")}catch{}a.isMuted||(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),we(a))),Oi(a)?yield a.restartTrack({deviceId:"default"}):yield a.restartTrack())}catch{this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),we(a))),yield a.mute()}}),this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.trackPublications=new Map,this.engine=i,this.roomOptions=r,this.setupEngine(i),this.activeDeviceMap=new Map([["audioinput","default"],["videoinput","default"],["audiooutput","default"]]),this.pendingSignalRequests=new Map,this.rpcHandlers=s,this.roomOutgoingDataStreamManager=o}get lastCameraError(){return this.cameraError}get lastMicrophoneError(){return this.microphoneError}get isE2EEEnabled(){return this.encryptionType!==gn.NONE}getTrackPublication(e){const n=super.getTrackPublication(e);if(n)return n}getTrackPublicationByName(e){const n=super.getTrackPublicationByName(e);if(n)return n}setupEngine(e){var n;this.engine=e,this.engine.on(X.RemoteMute,(i,r)=>{const s=this.trackPublications.get(i);!s||!s.track||(r?s.mute():s.unmute())}),!((n=this.signalConnectedFuture)===null||n===void 0)&&n.isResolved&&(this.signalConnectedFuture=void 0),this.engine.on(X.Connected,this.handleReconnected).on(X.SignalConnected,this.handleSignalConnected).on(X.SignalRestarted,this.handleReconnected).on(X.SignalResumed,this.handleReconnected).on(X.Restarting,this.handleReconnecting).on(X.Resuming,this.handleReconnecting).on(X.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(X.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(X.Closing,this.handleClosing).on(X.SignalRequestResponse,this.handleSignalRequestResponse).on(X.DataPacketReceived,this.handleDataPacket)}setMetadata(e){return E(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({metadata:e})})}setName(e){return E(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({name:e})})}setAttributes(e){return E(this,void 0,void 0,function*(){yield this.requestMetadataUpdate({attributes:e})})}requestMetadataUpdate(e){return E(this,arguments,void 0,function(n){var i=this;let{metadata:r,name:s,attributes:o}=n;return function*(){return new Promise((a,l)=>E(i,void 0,void 0,function*(){var d,u;try{let h=!1;const p=yield this.engine.client.sendUpdateLocalMetadata((d=r??this.metadata)!==null&&d!==void 0?d:"",(u=s??this.name)!==null&&u!==void 0?u:"",o),g=performance.now();for(this.pendingSignalRequests.set(p,{resolve:a,reject:b=>{l(b),h=!0},values:{name:s,metadata:r,attributes:o}});performance.now()-g<5e3&&!h;){if((!s||this.name===s)&&(!r||this.metadata===r)&&(!o||Object.entries(o).every(b=>{let[m,k]=b;return this.attributes[m]===k||k===""&&!this.attributes[m]}))){this.pendingSignalRequests.delete(p),a();return}yield un(50)}l(new Gb("Request to update local metadata timed out","TimeoutError"))}catch(h){h instanceof Error&&l(h)}}))}()})}setCameraEnabled(e,n,i){return this.setTrackEnabled(V.Source.Camera,e,n,i)}setMicrophoneEnabled(e,n,i){return this.setTrackEnabled(V.Source.Microphone,e,n,i)}setScreenShareEnabled(e,n,i){return this.setTrackEnabled(V.Source.ScreenShare,e,n,i)}setE2EEEnabled(e){return E(this,void 0,void 0,function*(){this.encryptionType=e?gn.GCM:gn.NONE,yield this.republishAllTracks(void 0,!1)})}setTrackEnabled(e,n,i,r){return E(this,void 0,void 0,function*(){var s,o;this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:e,enabled:n})),this.republishPromise&&(yield this.republishPromise);let a=this.getTrackPublication(e);if(n)if(a)yield a.unmute();else{let l;if(this.pendingPublishing.has(e)){const d=yield this.waitForPendingPublicationOfSource(e);return d||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e})),yield d==null?void 0:d.unmute(),d}this.pendingPublishing.add(e);try{switch(e){case V.Source.Camera:l=yield this.createTracks({video:(s=i)!==null&&s!==void 0?s:!0});break;case V.Source.Microphone:l=yield this.createTracks({audio:(o=i)!==null&&o!==void 0?o:!0});break;case V.Source.ScreenShare:l=yield this.createScreenTracks(Object.assign({},i));break;default:throw new $i(e)}}catch(d){throw l==null||l.forEach(u=>{u.stop()}),d instanceof Error&&this.emit(J.MediaDevicesError,d,Im(e)),this.pendingPublishing.delete(e),d}for(const d of l){const u=Object.assign(Object.assign({},this.roomOptions.publishDefaults),i);e===V.Source.Microphone&&Ci(d)&&u.preConnectBuffer&&(this.log.info("starting preconnect buffer for microphone",Object.assign({},this.logContext)),d.startPreConnectBuffer())}try{const d=[];for(const h of l)this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),we(h))),d.push(this.publishTrack(h,r));[a]=yield Promise.all(d)}catch(d){throw l==null||l.forEach(u=>{u.stop()}),d}finally{this.pendingPublishing.delete(e)}}else if(!(a!=null&&a.track)&&this.pendingPublishing.has(e)&&(a=yield this.waitForPendingPublicationOfSource(e),a||this.log.info("waiting for pending publication promise timed out",Object.assign(Object.assign({},this.logContext),{source:e}))),a&&a.track)if(e===V.Source.ScreenShare){a=yield this.unpublishTrack(a.track);const l=this.getTrackPublication(V.Source.ScreenShareAudio);l&&l.track&&this.unpublishTrack(l.track)}else yield a.mute();return a})}enableCameraAndMicrophone(){return E(this,void 0,void 0,function*(){if(!(this.pendingPublishing.has(V.Source.Camera)||this.pendingPublishing.has(V.Source.Microphone))){this.pendingPublishing.add(V.Source.Camera),this.pendingPublishing.add(V.Source.Microphone);try{const e=yield this.createTracks({audio:!0,video:!0});yield Promise.all(e.map(n=>this.publishTrack(n)))}finally{this.pendingPublishing.delete(V.Source.Camera),this.pendingPublishing.delete(V.Source.Microphone)}}})}createTracks(e){return E(this,void 0,void 0,function*(){var n,i;e??(e={});const r=gE(e,(n=this.roomOptions)===null||n===void 0?void 0:n.audioCaptureDefaults,(i=this.roomOptions)===null||i===void 0?void 0:i.videoCaptureDefaults);try{return(yield ph(r,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext})).map(a=>(Ci(a)&&(this.microphoneError=void 0,a.setAudioContext(this.audioContext),a.source=V.Source.Microphone,this.emit(J.AudioStreamAcquired)),us(a)&&(this.cameraError=void 0,a.source=V.Source.Camera),a))}catch(s){throw s instanceof Error&&(e.audio&&(this.microphoneError=s),e.video&&(this.cameraError=s)),s}})}createScreenTracks(e){return E(this,void 0,void 0,function*(){if(e===void 0&&(e={}),navigator.mediaDevices.getDisplayMedia===void 0)throw new Iv("getDisplayMedia not supported");
595e.resolution===void 0&&!y4()&&(e.resolution=jv.h1080fps30.resolution);const n=j4(e),i=yield navigator.mediaDevices.getDisplayMedia(n),r=i.getVideoTracks();if(r.length===0)throw new $i("no video track found");const s=new wu(r[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});s.source=V.Source.ScreenShare,e.contentHint&&(s.mediaStreamTrack.contentHint=e.contentHint);const o=[s];if(i.getAudioTracks().length>0){this.emit(J.AudioStreamAcquired);const a=new Su(i.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});a.source=V.Source.ScreenShareAudio,o.push(a)}return o})}publishTrack(e,n){return E(this,void 0,void 0,function*(){return this.publishOrRepublishTrack(e,n)})}publishOrRepublishTrack(e,n){return E(this,arguments,void 0,function(i,r){var s=this;let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return function*(){var a,l,d,u;Oi(i)&&i.setAudioContext(s.audioContext),yield(a=s.reconnectFuture)===null||a===void 0?void 0:a.promise,s.republishPromise&&!o&&(yield s.republishPromise),Ls(i)&&s.pendingPublishPromises.has(i)&&(yield s.pendingPublishPromises.get(i));let h;if(i instanceof MediaStreamTrack)h=i.getConstraints();else{h=i.constraints;let v;switch(i.source){case V.Source.Microphone:v="audioinput";break;case V.Source.Camera:v="videoinput"}v&&s.activeDeviceMap.has(v)&&(h=Object.assign(Object.assign({},h),{deviceId:s.activeDeviceMap.get(v)}))}if(i instanceof MediaStreamTrack)switch(i.kind){case"audio":i=new Su(i,h,!0,s.audioContext,{loggerName:s.roomOptions.loggerName,loggerContextCb:()=>s.logContext});break;case"video":i=new wu(i,h,!0,{loggerName:s.roomOptions.loggerName,loggerContextCb:()=>s.logContext});break;default:throw new $i("unsupported MediaStreamTrack kind ".concat(i.kind))}else i.updateLoggerOptions({loggerName:s.roomOptions.loggerName,loggerContextCb:()=>s.logContext});let p;if(s.trackPublications.forEach(v=>{v.track&&v.track===i&&(p=v)}),p)return s.log.warn("track has already been published, skipping",Object.assign(Object.assign({},s.logContext),we(p))),p;const g=Object.assign(Object.assign({},s.roomOptions.publishDefaults),r),b="channelCount"in i.mediaStreamTrack.getSettings()&&i.mediaStreamTrack.getSettings().channelCount===2||i.mediaStreamTrack.getConstraints().channelCount===2,m=(l=g.forceStereo)!==null&&l!==void 0?l:b;m&&(g.dtx===void 0&&s.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},s.logContext),we(i))),g.red===void 0&&s.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),(d=g.dtx)!==null&&d!==void 0||(g.dtx=!1),(u=g.red)!==null&&u!==void 0||(g.red=!1)),!x4()&&s.roomOptions.e2ee&&(s.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2",Object.assign({},s.logContext)),g.simulcast=!1),g.source&&(i.source=g.source);const k=new Promise((v,y)=>E(s,void 0,void 0,function*(){try{if(this.engine.client.currentState!==Je.CONNECTED){this.log.debug("deferring track publication until signal is connected",Object.assign(Object.assign({},this.logContext),{track:we(i)}));const x=setTimeout(()=>{y(new Kb("publishing rejected as engine not connected within timeout",408))},15e3);yield this.waitUntilEngineConnected(),clearTimeout(x);const S=yield this.publish(i,g,m);v(S)}else try{const x=yield this.publish(i,g,m);v(x)}catch(x){y(x)}}catch(x){y(x)}}));s.pendingPublishPromises.set(i,k);try{return yield k}catch(v){throw v}finally{s.pendingPublishPromises.delete(i)}}()})}waitUntilEngineConnected(){return this.signalConnectedFuture||(this.signalConnectedFuture=new bi),this.signalConnectedFuture.promise}hasPermissionsToPublish(e){if(!this.permissions)return this.log.warn("no permissions present for publishing track",Object.assign(Object.assign({},this.logContext),we(e))),!1;const{canPublish:n,canPublishSources:i}=this.permissions;return n&&(i.length===0||i.map(r=>L4(r)).includes(e.source))?!0:(this.log.warn("insufficient permissions to publish",Object.assign(Object.assign({},this.logContext),we(e))),!1)}publish(e,n,i){return E(this,void 0,void 0,function*(){var r,s,o,a,l,d,u,h,p,g;if(!this.hasPermissionsToPublish(e))throw new Kb("failed to publish track, insufficient permissions",403);Array.from(this.trackPublications.values()).find(N=>Ls(e)&&N.source===e.source)&&e.source!==V.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(e.source),Object.assign(Object.assign({},this.logContext),we(e))),n.stopMicTrackOnMute&&Ci(e)&&(e.stopOnMute=!0),e.source===V.Source.ScreenShare&&Js()&&(n.simulcast=!1),n.videoCodec==="av1"&&!m4()&&(n.videoCodec=void 0),n.videoCodec==="vp9"&&!g4()&&(n.videoCodec=void 0),n.videoCodec===void 0&&(n.videoCodec=jm),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some(N=>n.videoCodec===pc(N.mime))||(n.videoCodec=pc(this.enabledPublishVideoCodecs[0].mime)));const m=n.videoCodec;e.on($.Muted,this.onTrackMuted),e.on($.Unmuted,this.onTrackUnmuted),e.on($.Ended,this.handleTrackEnded),e.on($.UpstreamPaused,this.onTrackUpstreamPaused),e.on($.UpstreamResumed,this.onTrackUpstreamResumed),e.on($.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate);const k=[],v=!(!((r=n.dtx)!==null&&r!==void 0)||r),y=e.getSourceTrackSettings();y.autoGainControl&&k.push(Ct.TF_AUTO_GAIN_CONTROL),y.echoCancellation&&k.push(Ct.TF_ECHO_CANCELLATION),y.noiseSuppression&&k.push(Ct.TF_NOISE_SUPPRESSION),y.channelCount&&y.channelCount>1&&k.push(Ct.TF_STEREO),v&&k.push(Ct.TF_NO_DTX),Oi(e)&&e.hasPreConnectBuffer&&k.push(Ct.TF_PRECONNECT_BUFFER);const x=new fm({cid:e.mediaStreamTrack.id,name:n.name,type:V.kindToProto(e.kind),muted:e.isMuted,source:V.sourceToProto(e.source),disableDtx:v,encryption:this.encryptionType,stereo:i,disableRed:this.isE2EEEnabled||!(!((s=n.red)!==null&&s!==void 0)||s),stream:n==null?void 0:n.stream,backupCodecPolicy:n==null?void 0:n.backupCodecPolicy,audioFeatures:k});let S;if(e.kind===V.Kind.Video){let N={width:0,height:0};try{N=yield e.waitForDimensions()}catch{const L=(a=(o=this.roomOptions.videoCaptureDefaults)===null||o===void 0?void 0:o.resolution)!==null&&a!==void 0?a:ka.h720.resolution;N={width:L.width,height:L.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),we(e)),{dims:N}))}x.width=N.width,x.height=N.height,mr(e)&&(yi(m)&&(e.source===V.Source.ScreenShare&&(n.scalabilityMode="L1T3","contentHint"in e.mediaStreamTrack&&(e.mediaStreamTrack.contentHint="motion",this.log.info("forcing contentHint to motion for screenshare with SVC codecs",Object.assign(Object.assign({},this.logContext),we(e))))),n.scalabilityMode=(l=n.scalabilityMode)!==null&&l!==void 0?l:"L3T3_KEY"),x.simulcastCodecs=[new hm({codec:m,cid:e.mediaStreamTrack.id})],n.backupCodec===!0&&(n.backupCodec={codec:jm}
595),n.backupCodec&&m!==n.backupCodec.codec&&x.encryption===gn.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),x.simulcastCodecs.push(new hm({codec:n.backupCodec.codec,cid:""})))),S=Om(e.source===V.Source.ScreenShare,x.width,x.height,n),x.layers=vx(x.width,x.height,S,yi(n.videoCodec))}else e.kind===V.Kind.Audio&&(S=[{maxBitrate:(d=n.audioPreset)===null||d===void 0?void 0:d.maxBitrate,priority:(h=(u=n.audioPreset)===null||u===void 0?void 0:u.priority)!==null&&h!==void 0?h:"high",networkPriority:(g=(p=n.audioPreset)===null||p===void 0?void 0:p.priority)!==null&&g!==void 0?g:"high"}]);if(!this.engine||this.engine.isClosed)throw new yt("cannot publish track when not connected");const w=()=>E(this,void 0,void 0,function*(){var N,I,L;if(!this.engine.pcManager)throw new yt("pcManager is not ready");if(e.sender=yield this.engine.createSender(e,n,S),this.emit(J.LocalSenderCreated,e.sender,e),mr(e)&&((N=n.degradationPreference)!==null&&N!==void 0||(n.degradationPreference=yU(e)),e.setDegradationPreference(n.degradationPreference)),S)if(Js()&&e.kind===V.Kind.Audio){let j;for(const Z of this.engine.pcManager.publisher.getTransceivers())if(Z.sender===e.sender){j=Z;break}j&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:j,codec:"opus",maxbr:!((I=S[0])===null||I===void 0)&&I.maxBitrate?S[0].maxBitrate/1e3:0})}else e.codec&&yi(e.codec)&&(!((L=S[0])===null||L===void 0)&&L.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:x.cid,codec:e.codec,maxbr:S[0].maxBitrate/1e3});yield this.engine.negotiate()});let C;const R=new Promise((N,I)=>E(this,void 0,void 0,function*(){var L;try{C=yield this.engine.addTrack(x),N(C)}catch(j){e.sender&&(!((L=this.engine.pcManager)===null||L===void 0)&&L.publisher)&&(this.engine.pcManager.publisher.removeTrack(e.sender),yield this.engine.negotiate().catch(Z=>{this.log.error("failed to negotiate after removing track due to failed add track request",Object.assign(Object.assign(Object.assign({},this.logContext),we(e)),{error:Z}))})),I(j)}}));if(this.enabledPublishVideoCodecs.length>0)C=(yield Promise.all([R,w()]))[0];else{C=yield R;let N;if(C.codecs.forEach(I=>{N===void 0&&(N=I.mimeType)}),N&&e.kind===V.Kind.Video){const I=pc(N);I!==m&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),we(e)),{codec:I})),n.videoCodec=I,S=Om(e.source===V.Source.ScreenShare,x.width,x.height,n))}yield w()}const P=new Mm(e.kind,C,e,{loggerName:this.roomOptions.loggerName,loggerContextCb:()=>this.logContext});if(P.on($.CpuConstrained,N=>this.onTrackCpuConstrained(N,P)),P.options=n,e.sid=C.sid,this.log.debug("publishing ".concat(e.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:S,trackInfo:C})),mr(e)?e.startMonitor(this.engine.client):Oi(e)&&e.startMonitor(),this.addTrackPublication(P),this.emit(J.LocalTrackPublished,P),Oi(e)&&C.audioFeatures.includes(Ct.TF_PRECONNECT_BUFFER)){const N=e.getPreConnectBuffer(),I=e.getPreConnectBufferMimeType();this.on(J.LocalTrackSubscribed,L=>
595{if(L.trackSid===C.sid){if(!e.hasPreConnectBuffer){this.log.warn("subscribe event came to late, buffer already closed",this.logContext);return}this.log.debug("finished recording preconnect buffer",Object.assign(Object.assign({},this.logContext),we(e))),e.stopPreConnectBuffer()}}),N&&new Promise((j,Z)=>E(this,void 0,void 0,function*(){var F,te,Y,K,A,U;try{this.log.debug("waiting for agent",Object.assign(Object.assign({},this.logContext),we(e)));const Ae=setTimeout(()=>{Z(new Error("agent not active within 10 seconds"))},1e4),ye=yield this.waitUntilActiveAgentPresent();clearTimeout(Ae),this.log.debug("sending preconnect buffer",Object.assign(Object.assign({},this.logContext),we(e)));const Te=yield this.streamBytes({name:"preconnect-buffer",mimeType:I,topic:"lk.agent.pre-connect-audio-buffer",destinationIdentities:[ye.identity],attributes:{trackId:P.trackSid,sampleRate:String((A=y.sampleRate)!==null&&A!==void 0?A:"48000"),channels:String((U=y.channelCount)!==null&&U!==void 0?U:"1")}});try{for(var Q=!0,se=Hi(N),de;de=yield se.next(),F=de.done,!F;Q=!0){K=de.value,Q=!1;const We=K;yield Te.write(We)}}catch(We){te={error:We}}finally{try{!Q&&!F&&(Y=se.return)&&(yield Y.call(se))}finally{if(te)throw te.error}}yield Te.close(),j()}catch(Ae){Z(Ae)}})).then(()=>{this.log.debug("preconnect buffer sent successfully",Object.assign(Object.assign({},this.logContext),we(e)))}).catch(j=>{this.log.error("error sending preconnect buffer",Object.assign(Object.assign(Object.assign({},this.logContext),we(e)),{error:j}))})}return P})}get isLocal(){return!0}publishAdditionalCodecForTrack(e,n,i){return E(this,void 0,void 0,function*(){var r;if(this.encryptionType!==gn.NONE)return;let s;if(this.trackPublications.forEach(g=>{g.track&&g.track===e&&(s=g)}),!s)throw new $i("track is not published");if(!mr(e))throw new $i("track is not a video track");const o=Object.assign(Object.assign({},(r=this.roomOptions)===null||r===void 0?void 0:r.publishDefaults),i),a=mU(e,n,o);if(!a){this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),we(e)));return}const l=e.addSimulcastTrack(n,a);if(!l)return;const d=new fm({cid:l.mediaStreamTrack.id,type:V.kindToProto(e.kind),muted:e.isMuted,source:V.sourceToProto(e.source),sid:e.sid,simulcastCodecs:[{codec:o.videoCodec,cid:l.mediaStreamTrack.id}]});if(d.layers=vx(d.width,d.height,a),!this.engine||this.engine.isClosed)throw new yt("cannot publish track when not connected");const u=()=>E(this,void 0,void 0,function*(){yield this.engine.createSimulcastSender(e,l,o,a),yield this.engine.negotiate()}),p=(yield Promise.all([this.engine.addTrack(d),u()]))[0];this.log.debug("published ".concat(n," for track ").concat(e.sid),Object.assign(Object.assign({},this.logContext),{encodings:a,trackInfo:p}))})}unpublishTrack(e,n){return E(this,void 0,void 0,function*(){var i,r;if(Ls(e)){const d=this.pendingPublishPromises.get(e);d&&(this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),we(e))),yield d)}const s=this.getPublicationForTrack(e),o=s?we(s):void 0;if(this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),o)),!s||!s.track){this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),o));return}e=s.track,e.off($.Muted,this.onTrackMuted),e.off($.Unmuted,this.onTrackUnmuted),e.off($.Ended,this.handleTrackEnded),e.off($.UpstreamPaused,this.onTrackUpstreamPaused),e.off($.UpstreamResumed,this.onTrackUpstreamResumed),e.off($.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),n===void 0&&(n=(r=(i=this.roomOptions)===null||i===void 0?void 0:i.stopLocalTrackOnUnpublish)!==null&&r!==void 0?r:!0),n?e.stop():e.stopMonitor();let a=!1;const l=e.sender;if(e.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<ct.FAILED&&l)try{for(const d of this.engine.pcManager.publisher.getTransceivers())d.sender===l&&(d.direction="inactive",a=!0);if(this.engine.removeTrack(l)&&(a=!0),mr(e)){for(const[,d]of e.simulcastCodecs)d.sender&&(this.engine.removeTrack(d.sender)&&(a=!0),d.sender=void 0);e.simulcastCodecs.clear()}}catch(d){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),o),{error:d}))}switch(this.trackPublications.delete(s.trackSid),s.kind){case V.Kind.Audio:this.audioTrackPublications.delete(s.trackSid);break;case V.Kind.Video:this.videoTrackPublications.delete(s.trackSid);break}
vendor: 4,109 bytes, line 595
595return this.emit(J.LocalTrackUnpublished,s),s.setTrack(void 0),a&&(yield this.engine.negotiate()),s})}unpublishTracks(e){return E(this,void 0,void 0,function*(){return(yield Promise.all(e.map(i=>this.unpublishTrack(i)))).filter(i=>!!i)})}republishAllTracks(e){return E(this,arguments,void 0,function(n){var i=this;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return function*(){i.republishPromise&&(yield i.republishPromise),i.republishPromise=new Promise((s,o)=>E(i,void 0,void 0,function*(){try{const a=[];this.trackPublications.forEach(l=>{l.track&&(n&&(l.options=Object.assign(Object.assign({},l.options),n)),a.push(l))}),yield Promise.all(a.map(l=>E(this,void 0,void 0,function*(){const d=l.track;yield this.unpublishTrack(d,!1),r&&!d.isMuted&&d.source!==V.Source.ScreenShare&&d.source!==V.Source.ScreenShareAudio&&(Oi(d)||mr(d))&&!d.isUserProvided&&(this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:l.trackSid})),yield d.restartTrack()),yield this.publishOrRepublishTrack(d,l.options,!0)}))),s()}catch(a){o(a)}finally{this.republishPromise=void 0}})),yield i.republishPromise}()})}publishData(e){return E(this,arguments,void 0,function(n){var i=this;let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){const s=r.reliable?xe.RELIABLE:xe.LOSSY,o=r.destinationIdentities,a=r.topic,l=new rn({kind:s,value:{case:"user",value:new d1({participantIdentity:i.identity,payload:n,destinationIdentities:o,topic:a})}});yield i.engine.sendDataPacket(l,s)}()})}publishDtmf(e,n){return E(this,void 0,void 0,function*(){const i=new rn({kind:xe.RELIABLE,value:{case:"sipDtmf",value:new u1({code:e,digit:n})}});yield this.engine.sendDataPacket(i,xe.RELIABLE)})}sendChatMessage(e,n){return E(this,void 0,void 0,function*(){const i={id:crypto.randomUUID(),message:e,timestamp:Date.now(),attachedFiles:n==null?void 0:n.attachments},r=new rn({value:{case:"chatMessage",value:new om(Object.assign(Object.assign({},i),{timestamp:et.parse(i.timestamp)}))}});return yield this.engine.sendDataPacket(r,xe.RELIABLE),this.emit(J.ChatMessage,i),i})}editChatMessage(e,n){return E(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},n),{message:e,editTimestamp:Date.now()}),r=new rn({value:{case:"chatMessage",value:new om(Object.assign(Object.assign({},i),{timestamp:et.parse(i.timestamp),editTimestamp:et.parse(i.editTimestamp)}))}});return yield this.engine.sendDataPacket(r,xe.RELIABLE),this.emit(J.ChatMessage,i),i})}sendText(e,n){return E(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.sendText(e,n)})}streamText(e){return E(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.streamText(e)})}sendFile(e,n){return E(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.sendFile(e,n)})}streamBytes(e){return E(this,void 0,void 0,function*(){return this.roomOutgoingDataStreamManager.streamBytes(e)})}performRpc(e){return E(this,arguments,void 0,function(n){var i=this;let{destinationIdentity:r,method:s,payload:o,responseTimeout:a=1e4}=n;return function*(){return new Promise((d,u)=>E(i,void 0,void 0,function*(){var h,p,g,b;if(Fv(o)>wE){u(ut.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));return}if(!((p=(h=this.engine.latestJoinResponse)===null||h===void 0?void 0:h.serverInfo)===null||p===void 0)&&p.version&&Ei((b=(g=this.engine.latestJoinResponse)===null||g===void 0?void 0:g.serverInfo)===null||b===void 0?void 0:b.version,"1.8.0")<0){u(ut.builtIn("UNSUPPORTED_SERVER"));return}const m=crypto.randomUUID();yield this.publishRpcRequest(r,m,s,o,a-2e3);const k=setTimeout(()=>{this.pendingAcks.delete(m),u(ut.builtIn("CONNECTION_TIMEOUT")),this.pendingResponses.delete(m),clearTimeout(v)},2e3);this.pendingAcks.set(m,{resolve:()=>{clearTimeout(k)},participantIdentity:r});const v=setTimeout(()=>{this.pendingResponses.delete(m),u(ut.builtIn("RESPONSE_TIMEOUT"))},a);this.pendingResponses.set(m,{resolve:(y,x)=>{clearTimeout(v),this.pendingAcks.has(m)&&(console.warn("RPC response received before ack",m),this.pendingAcks.delete(m),clearTimeout(k)),x?u(x
595):d(y??"")},participantIdentity:r})}))}()})}registerRpcMethod(e,n){this.rpcHandlers.has(e)&&this.log.warn("you're overriding the RPC handler for method ".concat(e,", in the future this will throw an error")),this.rpcHandlers.set(e,n)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setTrackSubscriptionPermissions(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];this.participantTrackPermissions=n,this.allParticipantsAllowedToSubscribe=e,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}handleIncomingRpcAck(e){const n=this.pendingAcks.get(e);n?(n.resolve(),this.pendingAcks.delete(e)):console.error("Ack received for unexpected RPC request",e)}handleIncomingRpcResponse(e,n,i){const r=this.pendingResponses.get(e);r?(r.resolve(n,i),this.pendingResponses.delete(e)):console.error("Response received for unexpected RPC request",e)}publishRpcRequest(e,n,i,r,s){return E(this,void 0,void 0,function*(){const o=new rn({destinationIdentities:[e],kind:xe.RELIABLE,value:{case:"rpcRequest",value:new h1({id:n,method:i,payload:r,responseTimeoutMs:s,version:1})}});yield this.engine.sendDataPacket(o,xe.RELIABLE)})}handleParticipantDisconnected(e){for(const[n,{participantIdentity:i}]of this.pendingAcks)i===e&&this.pendingAcks.delete(n);for(const[n,{participantIdentity:i,resolve:r}]of this.pendingResponses)i===e&&(r(null,ut.builtIn("RECIPIENT_DISCONNECTED")),this.pendingResponses.delete(n))}setEnabledPublishCodecs(e){this.enabledPublishVideoCodecs=e.filter(n=>n.mime.split("/")[0].toLowerCase()==="video")}updateInfo(e){return super.updateInfo(e)?(e.tracks.forEach(n=>{var i,r;const s=this.trackPublications.get(n.sid);if(s){const o=s.isMuted||((r=(i=s.track)===null||i===void 0?void 0:i.isUpstreamPaused)!==null&&r!==void 0?r:!1);o!==n.muted&&(this.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},this.logContext),we(s)),{mutedOnServer:o})),this.engine.client.sendMuteTrack(n.sid,o))}}),!0):!1}setActiveAgent(e){var n,i,r,s;this.firstActiveAgent=e,e&&!this.firstActiveAgent&&(this.firstActiveAgent=e),e?(i=(n=this.activeAgentFuture)===null||n===void 0?void 0:n.resolve)===null||i===void 0||i.call(n,e):(s=(r=this.activeAgentFuture)===null||r===void 0?void 0:r.reject)===null||s===void 0||s.call(r,"Agent disconnected"),this.activeAgentFuture=void 0}waitUntilActiveAgentPresent(){return this.firstActiveAgent?Promise.resolve(this.firstActiveAgent):(this.activeAgentFuture||(this.activeAgentFuture=new bi),this.activeAgentFuture.promise)}getPublicationForTrack(e){let n;return this.trackPublications.forEach(i=>{const r=i.track;r&&(e instanceof MediaStreamTrack?(Oi(r)||mr(r))&&r.mediaStreamTrack===e&&(n=i):e===r&&(n=i))}),n}waitForPendingPublicationOfSource(e){return E(this,void 0,void 0,function*(){const i=Date.now();for(;Date.now()<i+1e4;){const r=Array.from(this.pendingPublishPromises.entries()).find(s=>{let[o]=s;return o.source===e});if(r)return r[1];yield un(20)}})}}class FU extends Fi{constructor(e,n,i,r){super(e,n.sid,n.name,r),this.track=void 0,this.allowed=!0,this.requestedDisabled=void 0,this.visible=!0,this.handleEnded=s=>{this.setTrack(void 0),this.emit($.Ended,s)},this.handleVisibilityChange=s=>{this.log.debug("adaptivestream video visibility ".concat(this.trackSid,", visible=").concat(s),this.logContext),this.visible=s,this.emitTrackUpdate()},this.handleVideoDimensionsChange=s=>{this.log.debug("adaptivestream video dimensions ".concat(s.width,"x").concat(s.height),this.logContext),this.videoDimensionsAdaptiveStream=s,this.emitTrackUpdate()},this.subscribed=i,this.updateInfo(n)}setSubscribed(e){const n=this.subscriptionStatus,i=this.permissionStatus;this.subscribed=e,e&&(this.allowed=!0);const r=new dh({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new g1({participantSid:"",trackSids:[this.trackSid]})]});this.emit($.UpdateSubscription,r),this.emitSubscriptionUpdateIfChanged(n),this.emitPermissionUpdateIfChanged(i)}get subscriptionStatus(){return this.subscribed===!1?Fi.SubscriptionStatus.Unsubscribed:super.isSubscribed?Fi.SubscriptionStatus.Subscribed:Fi.SubscriptionStatus.Desired}get permissionStatus(){return this.allowed?Fi.PermissionStatus.Allowed:Fi.PermissionStatus.NotAllowed}get isSubscribed(){return this.subscribed===!1?!1:super.isSubscribed}get isDesired(){return this.subscribed!==!1}get isEnabled(){return this.requestedDisabled!==void 0?!this.requestedDisabled:this.isAdaptiveStream?this.visible:!0}get isLocal(){return!1}setEnabled(e){!this.isManualOperationAllowed()||this.requestedDisabled===!e||(this.requestedDisabled=!e,this.emitTrackUpdate())}setVideoQuality(e){!this.isManualOperationAllowed()||this.requestedMaxQuality===e||(this.requestedMaxQuality=e,this.requestedVideoDimensions=void 0,this.emitTrackUpdate())}setVideoDimensions(e){var n,i;this.isManualOperationAllowed()&&(((n=this.requestedVideoDimensions)===null||n===void 0?void 0:n.width)===e.width&&((i=this.requestedVideoDimensions)===null||i===void 0?void 0:i.height)===e.height||(Sf(this.track)&&(this.requestedVideoDimensions=e),this.requestedMaxQuality=void 0,this.emitTrackUpdate()))}setVideoFPS(e){this.isManualOperationAllowed()&&Sf(this.track)&&this.fps!==e&&(this.fps=e,this.emitTrackUpdate())}get videoQuality(){var e;return(e=this.requestedMaxQuality)!==null&&e!==void 0?e:yn.HIGH}setTrack(e){const n=this.subscriptionStatus,i=this.permissionStatus,r=this.track;r!==e&&(r&&(r.off($.VideoDimensionsChanged,this.handleVideoDimensionsChange),r.off($.VisibilityChanged,this.handleVisibilityChange),r.off($.Ended,this.handleEnded),r.detach(),r.stopMonitor(),this.emit
595($.Unsubscribed,r)),super.setTrack(e),e&&(e.sid=this.trackSid,e.on($.VideoDimensionsChanged,this.handleVideoDimensionsChange),e.on($.VisibilityChanged,this.handleVisibilityChange),e.on($.Ended,this.handleEnded),this.emit($.Subscribed,e)),this.emitPermissionUpdateIfChanged(i),this.emitSubscriptionUpdateIfChanged(n))}setAllowed(e){const n=this.subscriptionStatus,i=this.permissionStatus;this.allowed=e,this.emitPermissionUpdateIfChanged(i),this.emitSubscriptionUpdateIfChanged(n)}setSubscriptionError(e){this.emit($.SubscriptionFailed,e)}updateInfo(e){super.updateInfo(e);const n=this.metadataMuted;this.metadataMuted=e.muted,this.track?this.track.setMuted(e.muted):n!==e.muted&&this.emit(e.muted?$.Muted:$.Unmuted)}emitSubscriptionUpdateIfChanged(e){const n=this.subscriptionStatus;e!==n&&this.emit($.SubscriptionStatusChanged,n,e)}emitPermissionUpdateIfChanged(e){this.permissionStatus!==e&&this.emit($.SubscriptionPermissionChanged,this.permissionStatus,e)}isManualOperationAllowed(){return this.isDesired?!0:(this.log.warn("cannot update track settings when not subscribed",this.logContext),!1)}get isAdaptiveStream(){return Sf(this.track)&&this.track.isAdaptiveStream}emitTrackUpdate(){const e=new C1({trackSids:[this.trackSid],disabled:!this.isEnabled,fps:this.fps});if(this.kind===V.Kind.Video){let n=this.requestedVideoDimensions;if(this.videoDimensionsAdaptiveStream!==void 0)if(n)ix(this.videoDimensionsAdaptiveStream,n)&&(this.log.debug("using adaptive stream dimensions instead of requested",Object.assign(Object.assign({},this.logContext),this.videoDimensionsAdaptiveStream)),n=this.videoDimensionsAdaptiveStream);else if(this.requestedMaxQuality!==void 0&&this.trackInfo){const i=M4(this.trackInfo,this.requestedMaxQuality);i&&ix(this.videoDimensionsAdaptiveStream,i)&&(this.log.debug("using adaptive stream dimensions instead of max quality layer",Object.assign(Object.assign({},this.logContext),this.videoDimensionsAdaptiveStream)),n=this.videoDimensionsAdaptiveStream)}else this.log.debug("using adaptive stream dimensions",Object.assign(Object.assign({},this.logContext),this.videoDimensionsAdaptiveStream)),n=this.videoDimensionsAdaptiveStream;n?(e.width=Math.ceil(n.width),e.height=Math.ceil(n.height)):this.requestedMaxQuality!==void 0?(this.log.debug("using requested max quality",Object.assign(Object.assign({},this.logContext),{quality:this.requestedMaxQuality})),e.quality=this.requestedMaxQuality):(this.log.debug("using default quality",Object.assign(Object.assign({},this.logContext),{quality:yn.HIGH})),e.quality=yn.HIGH)}this.emit($.UpdateSettings,e)}}class Cu extends IE{static fromParticipantInfo(e,n,i){return new Cu(e,n.sid,n.identity,n.name,n.metadata,n.attributes,i,n.kind)}get logContext(){return Object.assign(Object.assign({},super.logContext),{rpID:this.sid,remoteParticipant:this.identity})}constructor(e,n,i,r,s,o,a){let l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:Bc.STANDARD;super(n,i||"",r,s,o,a,l),this.signalClient=e,this.trackPublications=new Map,this.audioTrackPublications=new Map,this.videoTrackPublications=new Map,this.volumeMap=new Map}addTrackPublication(e){super.addTrackPublication(e),e.on($.UpdateSettings,n=>{this.log.debug("send update settings",Object.assign(Object.assign(Object.assign({},this.logContext),we(e)),{settings:n})),this.signalClient.sendUpdateTrackSettings(n)}),e.on($.UpdateSubscription,n=>{n.participantTracks.forEach(i=>{i.participantSid=this.sid}),this.signalClient.sendUpdateSubscription(n)}),e.on($.SubscriptionPermissionChanged,n=>{this.emit(J.TrackSubscriptionPermissionChanged,e,n)}),e.on($.SubscriptionStatusChanged,n=>{this.emit(J.TrackSubscriptionStatusChanged,e,n)}),e.on($.Subscribed,n=>{this.emit(J.TrackSubscribed,n,e)}),e.on($.Unsubscribed,n=>{this.emit(J.TrackUnsubscribed,n,e)}),e.on($.SubscriptionFailed,n=>{this.emit(J.TrackSubscriptionFailed,e.trackSid,n)})}getTrackPublication(e){const n=super.getTrackPublication(e);if(n)return n}getTrackPublicationByName(e){const n=super.getTrackPublicationByName(e);if(n)return n}setVolume(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:V.Source.Microphone;this.volumeMap.set(n,e);const i=this.getTrackPublication(n);i&&i.track&&i.track.setVolume(e)}getVolume(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V.Source.Microphone;const n=this.getTrackPublication(e);return n&&n.track?n.track.getVolume():this.volumeMap.get(e)}addSubscribedMediaTrack(e,n,i,r,s,o){let a=this.getTrackPublicationBySid(n);if(a||n.startsWith("TR")||this.trackPublications.forEach(u=>{!a&&e.kind===u.kind.toString()&&(a=u)}),!a){if(o===0){this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:n}
vendor: 33,198 bytes, line 595
595)),this.emit(J.TrackSubscriptionFailed,n);return}o===void 0&&(o=20),setTimeout(()=>{this.addSubscribedMediaTrack(e,n,i,r,s,o-1)},150);return}if(e.readyState==="ended"){this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",Object.assign(Object.assign({},this.logContext),we(a))),this.emit(J.TrackSubscriptionFailed,n);return}const l=e.kind==="video";let d;return l?d=new AU(e,n,r,s):d=new jU(e,n,r,this.audioContext,this.audioOutput),d.source=a.source,d.isMuted=a.isMuted,d.setMediaStream(i),d.start(),a.setTrack(d),this.volumeMap.has(a.source)&&Rm(d)&&Ci(d)&&d.setVolume(this.volumeMap.get(a.source)),a}get hasMetadata(){return!!this.participantInfo}getTrackPublicationBySid(e){return this.trackPublications.get(e)}updateInfo(e){if(!super.updateInfo(e))return!1;const n=new Map,i=new Map;return e.tracks.forEach(r=>{var s,o;let a=this.getTrackPublicationBySid(r.sid);if(a)a.updateInfo(r);else{const l=V.kindFromProto(r.type);if(!l)return;a=new FU(l,r,(s=this.signalClient.connectOptions)===null||s===void 0?void 0:s.autoSubscribe,{loggerContextCb:()=>this.logContext,loggerName:(o=this.loggerOptions)===null||o===void 0?void 0:o.loggerName}),a.updateInfo(r),i.set(r.sid,a);const d=Array.from(this.trackPublications.values()).find(u=>u.source===(a==null?void 0:a.source));d&&a.source!==V.Source.Unknown&&this.log.debug("received a second track publication for ".concat(this.identity," with the same source: ").concat(a.source),Object.assign(Object.assign({},this.logContext),{oldTrack:we(d),newTrack:we(a)})),this.addTrackPublication(a)}n.set(r.sid,a)}),this.trackPublications.forEach(r=>{n.has(r.trackSid)||(this.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},this.logContext),we(r))),this.unpublishTrack(r.trackSid,!0))}),i.forEach(r=>{this.emit(J.TrackPublished,r)}),!0}unpublishTrack(e,n){const i=this.trackPublications.get(e);if(!i)return;const{track:r}=i;switch(r&&(r.stop(),i.setTrack(void 0)),this.trackPublications.delete(e),i.kind){case V.Kind.Audio:this.audioTrackPublications.delete(e);break;case V.Kind.Video:this.videoTrackPublications.delete(e);break}n&&this.emit(J.TrackUnpublished,i)}setAudioOutput(e){return E(this,void 0,void 0,function*(){this.audioOutput=e;const n=[];this.audioTrackPublications.forEach(i=>{var r;Ci(i.track)&&Rm(i.track)&&n.push(i.track.setSinkId((r=e.deviceId)!==null&&r!==void 0?r:"default"))}),yield Promise.all(n)})}emit(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:e,args:i})),super.emit(e,...i)}}var _e;(function(t){t.Disconnected="disconnected",t.Connecting="connecting",t.Connected="connected",t.Reconnecting="reconnecting",t.SignalReconnecting="signalReconnecting"})(_e||(_e={}));const VU=4*1e3;class Sa extends Ni.EventEmitter{constructor(e){var n,i,r,s;if(super(),n=this,this.state=_e.Disconnected,this.activeSpeakers=[],this.isE2EEEnabled=!1,this.audioEnabled=!0,this.isVideoPlaybackBlocked=!1,this.log=ke,this.bufferedEvents=[],this.isResuming=!1,this.rpcHandlers=new Map,this.connect=(o,a,l)=>E(this,void 0,void 0,function*(){var d;if(!v4())throw _i()?Error("WebRTC isn't detected, have you called registerGlobals?"):Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");const u=yield this.disconnectLock.lock();if(this.state===_e.Connected)return this.log.info("already connected to room ".concat(this.name),this.logContext),u(),Promise.resolve();if(this.connectFuture)return u(),this.connectFuture.promise;this.setAndEmitConnectionState(_e.Connecting),((d=this.regionUrlProvider)===null||d===void 0?void 0:d.getServerUrl().toString())!==o&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),Em(new URL(o))&&(this.regionUrlProvider===void 0?this.regionUrlProvider=new Dm(o,a):this.regionUrlProvider.updateToken(a),this.regionUrlProvider.fetchRegionSettings().then(g=>{var b;(b=this.regionUrlProvider)===null||b===void 0||b.setServerReportedRegions(g)}).catch(g=>{this.log.warn("could not fetch region settings",Object.assign(Object.assign({},this.logContext),{error:g}))}));const h=(g,b,m)=>E(this,void 0,void 0,function*(){var k,v;this.abortController&&this.abortController.abort();const y=new AbortController;this.abortController=y,u==null||u();try{yield this.attemptConnection(m??o,a,l,y),this.abortController=void 0,g()}catch(x){if(this.regionUrlProvider&&x instanceof $e&&x.reason!==Ie.Cancelled&&x.reason!==Ie.NotAllowed){let S=null;try{S=yield this.regionUrlProvider.getNextBestRegionUrl((k=this.abortController)===null||k===void 0?void 0:k.signal)}catch(w){if(w instanceof $e&&(w.status===401||w.reason===Ie.Cancelled)){this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),b(w);return}}S&&!(!((v=this.abortController)===null||v===void 0)&&v.signal.aborted)?(this.log.info("Initial connection failed with ConnectionError: ".concat(x.message,". Retrying with another region: ").concat(S),this.logContext),this.recreateEngine(),yield h(g,b,S)):(this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,nx(x)),b(x))}else{let S=Xn.UNKNOWN_REASON;x instanceof $e&&(S=nx(x)),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,S),b(x)}}}),p=this.regionUrl;return this.regionUrl=void 0,this.connectFuture=new bi((g,b)=>{h(g,b,p)},()=>{this.clearConnectionFutures()}),this.connectFuture.promise}),this.connectSignal=(o,a,l,d,u,h)=>E(this,void 0,void 0,function*(){var p,g,b;const m=yield l.join(o,a,{autoSubscribe:d.autoSubscribe,adaptiveStream:typeof u.adaptiveStream=="object"?!0:u.adaptiveStream,maxRetries:d.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:d.websocketTimeout},h.signal);let k=m.serverInfo;if(k||(k={version:m.serverVersion,region:m.serverRegion}),this.serverInfo=k,this.log.debug("connected to Livekit Server ".concat(Object.entries(k).map(v=>{let[y,x]=v;return"".concat(y,": ").concat(x)}).join(", ")),{room:(p=m.room)===null||p===void 0?void 0:p.name,roomSid:(g=m.room)===null||g===void 0?void 0:g.sid,identity:(b=m.participant)===null||b===void 0?void 0:b.identity}),!k.version)throw new e4("unknown server version");return k.version==="0.15.1"&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),u.dynacast=!1),m}),this.applyJoinResponse=o=>{const a=o.participant;if(this.localParticipant.sid=a.sid,this.localParticipant.identity=a.identity,this.localParticipant.setEnabledPublishCodecs(o.enabledPublishCodecs),this.options.e2ee&&this.e2eeManager)try{this.e2eeManager.setSifTrailer(o.sifTrailer)}catch(l){this.log.error(l instanceof Error?l.message:"Could not set SifTrailer",Object.assign(Object.assign({},this.logContext),{error:l}))}this.handleParticipantUpdates([a,...o.otherParticipants]),o.room&&this.handleRoomUpdate(o.room)},this.attemptConnection=(o,a,l,d)=>E(this,void 0,void 0,function*(){var u,h;this.state===_e.Reconnecting||this.isResuming||!((u=this.engine)===null||u===void 0)&&u.pendingReconnect?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine()):this.maybeCreateEngine(),!((h=this.regionUrlProvider)===null||h===void 0)&&h.isCloud()&&this.engine.setRegionUrlProvider(this.regionUrlProvider),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},Uv),l),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout);try{const p=yield this.connectSignal(o,a,this.engine,this.connOptions,this.options,d);this.applyJoinResponse(p),this.setupLocalParticipantEvents(),this.emit(B.SignalConnected)}catch(p){yield this.engine.close(),this.recreateEngine();const g=new $e("could not establish signal connection",Ie.ServerUnreachable);throw p instanceof Error&&(g.message="".concat(g.message,": ").concat(p.message)),p instanceof $e&&(g.reason=p.reason,g.status=p.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:p})),g}if(d.signal.aborted)throw yield this.engine.close(),this.recreateEngine(),new $e("Connection attempt aborted",Ie.Cancelled);try{yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,d)}catch(p){throw yield this.engine.close(),this.recreateEngine(),p}on()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),on()&&document.addEventListener("freeze",this.onPageLeave),this.setAndEmitConnectionState(_e.Connected),this.emit(B.Connected),this.registerConnectionReconcile()}),this.disconnect=function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];return E(n,[...a],void 0,function(){var d=this;let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return function*(){var h,p,g,b;const m=yield d.disconnectLock.lock();try{if(d.state===_e.Disconnected){d.log.debug("already disconnected",d.logContext);return}d.log.info("disconnect from room",Object.assign({},d.logContext)),(d.state===_e.Connecting||d.state===_e.Reconnecting||d.isResuming)&&(d.log.warn("abort connection attempt",d.logContext),(h=d.abortController)===null||h===void 0||h.abort(),(g=(p=d.connectFuture)===null||p===void 0?void 0:p.reject)===null||g===void 0||g.call(p,new $e("Client initiated disconnect",Ie.Cancelled)),d.connectFuture=void 0),!((b=d.engine)===null||b===void 0)&&b.client.isDisconnected||(yield d.engine.client.sendLeave()),d.engine&&(yield d.engine.close()),d.handleDisconnect(u,Xn.CLIENT_INITIATED),d.engine=void 0}finally{m()}}()})},this.onPageLeave=()=>E(this,void 0,void 0,function*(){this.log.info("Page leave detected, disconnecting",this.logContext),yield this.disconnect()}),this.startAudio=()=>E(this,void 0,void 0,function*(){const o=[],a=kn();if(a&&a.os==="iOS"){const l="livekit-dummy-audio-el";let d=document.getElementById(l);if(!d){d=document.createElement("audio"),d.id=l,d.autoplay=!0,d.hidden=!0;const u=kf();u.enabled=!0;const h=new MediaStream([u]);d.srcObject=h,document.addEventListener("visibilitychange",()=>{d&&(d.srcObject=document.hidden?null:h,document.hidden||(this.log.debug("page visible again, triggering startAudio to resume playback and update playback status",this.logContext),this.startAudio()))}),document.body.append(d),this.once(B.Disconnected,()=>{d==null||d.remove(),d=null})}o.push(d)}this.remoteParticipants.forEach(l=>{l.audioTrackPublications.forEach(d=>{d.track&&d.track.attachedElements.forEach(u=>{o.push(u)})})});try{yield Promise.all([this.acquireAudioContext(),...o.map(l=>(l.muted=!1,l.play()))]),this.handleAudioPlaybackStarted()}catch(l){throw this.handleAudioPlaybackFailed(l),l}}),this.startVideo=()=>E(this,void 0,void 0,function*(){const o=[];for(const a of this.remoteParticipants.values())a.videoTrackPublications.forEach(l=>{var d;(d=l.track)===null||d===void 0||d.attachedElements.forEach(u=>{o.includes(u)||o.push(u)})});yield Promise.all(o.map(a=>a.play())).then(()=>{this.handleVideoPlaybackStarted()}).catch(a=>{a.name==="NotAllowedError"?this.handleVideoPlaybackFailed():this.log.warn("Resuming video playback failed, make sure you call `startVideo` directly in a user gesture handler",this.logContext)})}),this.handleRestarting=()=>{this.clearConnectionReconcile(),this.isResuming=!1;for(const o of this.remoteParticipants.values())this.handleParticipantDisconnected(o.identity,o);this.setAndEmitConnectionState(_e.Reconnecting)&&this.emit(B.Reconnecting)},this.handleSignalRestarted=o=>E(this,void 0,void 0,function*(){this.log.debug("signal reconnected to server, region ".concat(o.serverRegion),Object.assign(Object.assign({},this.logContext),{region:o.serverRegion})),this.bufferedEvents=[],this.applyJoinResponse(o);try{yield this.localParticipant.republishAllTracks(void 0,!0)}catch(a){this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:a}))}try{yield this.engine.waitForRestarted(),this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:o.serverRegion}))}catch{return}this.setAndEmitConnectionState(_e.Connected),this.emit(B.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents()}),this.handleParticipantUpdates=o=>{o.forEach(a=>{var l;if(a.identity===this.localParticipant.identity){this.localParticipant.updateInfo(a);return}a.identity===""&&(a.identity=(l=this.sidToIdentity.get(a.sid))!==null&&l!==void 0?l:"");let d=this.remoteParticipants.get(a.identity);a.state===Wo.DISCONNECTED?this.handleParticipantDisconnected(a.identity,d):d=this.getOrCreateParticipant(a.identity,a)})},this.handleActiveSpeakersUpdate=o=>{const a=[],l={};o.forEach(d=>{if(l[d.sid]=!0,d.sid===this.localParticipant.sid)this.localParticipant.audioLevel=d.level,this.localParticipant.setIsSpeaking(!0),a.push(this.localParticipant);else{const u=this.getRemoteParticipantBySid(d.sid);u&&(u.audioLevel=d.level,u.setIsSpeaking(!0),a.push(u))}}),l[this.localParticipant.sid]||(this.localParticipant.audioLevel=0,this.localParticipant.setIsSpeaking(!1)),this.remoteParticipants.forEach(d=>{l[d.sid]||(d.audioLevel=0,d.setIsSpeaking(!1))}),this.activeSpeakers=a,this.emitWhenConnected(B.ActiveSpeakersChanged,a)},this.handleSpeakersChanged=o=>{const a=new Map;this.activeSpeakers.forEach(d=>{const u=this.remoteParticipants.get(d.identity);u&&u.sid!==d.sid||a.set(d.sid,d)}),o.forEach(d=>{let u=this.getRemoteParticipantBySid(d.sid);d.sid===this.localParticipant.sid&&(u=this.localParticipant),u&&(u.audioLevel=d.level,u.setIsSpeaking(d.active),d.active?a.set(d.sid,u):a.delete(d.sid))});const l=Array.from(a.values());l.sort((d,u)=>u.audioLevel-d.audioLevel),this.activeSpeakers=l,this.emitWhenConnected(B.ActiveSpeakersChanged,l)},this.handleStreamStateUpdate=o=>{o.streamStates.forEach(a=>{const l=this.getRemoteParticipantBySid(a.participantSid);if(!l)return;const d=l.getTrackPublicationBySid(a.trackSid);if(!d||!d.track)return;const u=V.streamStateFromProto(a.state);d.track.setStreamState(u),u!==d.track.streamState&&(l.emit(J.TrackStreamStateChanged,d,d.track.streamState),this.emitWhenConnected(B.TrackStreamStateChanged,d,d.track.streamState,l))})},this.handleSubscriptionPermissionUpdate=o=>{const a=this.getRemoteParticipantBySid(o.participantSid);if(!a)return;const l=a.getTrackPublicationBySid(o.trackSid);l&&l.setAllowed(o.allowed)},this.handleSubscriptionError=o=>{const a=Array.from(this.remoteParticipants.values()).find(d=>d.trackPublications.has(o.trackSid));if(!a)return;const l=a.getTrackPublicationBySid(o.trackSid);l&&l.setSubscriptionError(o.err)},this.handleDataPacket=o=>{const a=this.remoteParticipants.get(o.participantIdentity);if(o.value.case==="user")this.handleUserPacket(a,o.value.value,o.kind);else if(o.value.case==="transcription")this.handleTranscription(a,o.value.value);else if(o.value.case==="sipDtmf")this.handleSipDtmf(a,o.value.value);else if(o.value.case==="chatMessage")this.handleChatMessage(a,o.value.value);else if(o.value.case==="metrics")this.handleMetrics(o.value.value,a);else if(o.value.case==="streamHeader"||o.value.case==="streamChunk"||o.value.case==="streamTrailer")this.handleDataStream(o);else if(o.value.case==="rpcRequest"){const l=o.value.value;this.handleIncomingRpcRequest(o.participantIdentity,l.id,l.method,l.payload,l.responseTimeoutMs,l.version)}},this.handleUserPacket=(o,a,l)=>{this.emit(B.DataReceived,a.payload,o,l,a.topic),o==null||o.emit(J.DataReceived,a.payload,l)},this.handleSipDtmf=(o,a)=>{this.emit(B.SipDTMFReceived,a,o),o==null||o.emit(J.SipDTMFReceived,a)},this.handleTranscription=(o,a)=>{const l=a.transcribedParticipantIdentity===this.localParticipant.identity?this.localParticipant:this.getParticipantByIdentity(a.transcribedParticipantIdentity),d=l==null?void 0:l.trackPublications.get(a.trackId),u=_4(a,this.transcriptionReceivedTimes);d==null||d.emit($.TranscriptionReceived,u),l==null||l.emit(J.TranscriptionReceived,u,d),this.emit(B.TranscriptionReceived,u,l,d)},this.handleChatMessage=(o,a)=>{const l=E4(a);this.emit(B.ChatMessage,l,o)},this.handleMetrics=(o,a)=>{this.emit(B.MetricsReceived,o,a)},this.handleDataStream=o=>{this.incomingDataStreamManager.handleDataStreamPacket(o)},this.bufferedSegments=new Map,this.handleAudioPlaybackStarted=()=>{this.canPlaybackAudio||(this.audioEnabled=!0,this.emit(B.AudioPlaybackStatusChanged,!0))},this.handleAudioPlaybackFailed=o=>{this.log.warn("could not playback audio",Object.assign(Object.assign({},this.logContext),{error:o})),this.canPlaybackAudio&&(this.audioEnabled=!1,this.emit(B.AudioPlaybackStatusChanged,!1))},this.handleVideoPlaybackStarted=()=>{this.isVideoPlaybackBlocked&&(this.isVideoPlaybackBlocked=!1,this.emit(B.VideoPlaybackStatusChanged,!0))},this.handleVideoPlaybackFailed=()=>{this.isVideoPlaybackBlocked||(this.isVideoPlaybackBlocked=!0,this.emit(B.VideoPlaybackStatusChanged,!1))},this.handleDeviceChange=()=>E(this,void 0,void 0,function*(){var o;((o=kn())===null||o===void 0?void 0:o.os)!=="iOS"&&(yield this.selectDefaultDevices()),this.emit(B.MediaDevicesChanged)}),this.handleRoomUpdate=o=>{const a=this.roomInfo;this.roomInfo=o,a&&a.metadata!==o.metadata&&this.emitWhenConnected(B.RoomMetadataChanged,o.metadata),(a==null?void 0:a.activeRecording)!==o.activeRecording&&this.emitWhenConnected(B.RecordingStatusChanged,o.activeRecording)},this.handleConnectionQualityUpdate=o=>{o.updates.forEach(a=>{if(a.participantSid===this.localParticipant.sid){this.localParticipant.setConnectionQuality(a.quality);return}const l=this.getRemoteParticipantBySid(a.participantSid);l&&l.setConnectionQuality(a.quality)})},this.onLocalParticipantMetadataChanged=o=>{this.emit(B.ParticipantMetadataChanged,o,this.localParticipant)},this.onLocalParticipantNameChanged=o=>{this.emit(B.ParticipantNameChanged,o,this.localParticipant)},this.onLocalAttributesChanged=o=>{this.emit(B.ParticipantAttributesChanged,o,this.localParticipant)},this.onLocalTrackMuted=o=>{this.emit(B.TrackMuted,o,this.localParticipant)},this.onLocalTrackUnmuted=o=>{this.emit(B.TrackUnmuted,o,this.localParticipant)},this.onTrackProcessorUpdate=o=>{var a;(a=o==null?void 0:o.onPublish)===null||a===void 0||a.call(o,this)},this.onLocalTrackPublished=o=>E(this,void 0,void 0,function*(){var a,l,d,u,h,p;(a=o.track)===null||a===void 0||a.on($.TrackProcessorUpdate,this.onTrackProcessorUpdate),(l=o.track)===null||l===void 0||l.on($.Restarted,this.onLocalTrackRestarted),(h=(u=(d=o.track)===null||d===void 0?void 0:d.getProcessor())===null||u===void 0?void 0:u.onPublish)===null||h===void 0||h.call(u,this),this.emit(B.LocalTrackPublished,o,this.localParticipant),Oi(o.track)&&(yield o.track.checkForSilence())&&this.emit(B.LocalAudioSilenceDetected,o);const g=yield(p=o.track)===null||p===void 0?void 0:p.getDeviceId(!1),b=Im(o.source);b&&g&&g!==this.localParticipant.activeDeviceMap.get(b)&&(this.localParticipant.activeDeviceMap.set(b,g),this.emit(B.ActiveDeviceChanged,b,g))}),this.onLocalTrackUnpublished=o=>{var a,l;(a=o.track)===null||a===void 0||a.off($.TrackProcessorUpdate,this.onTrackProcessorUpdate),(l=o.track)===null||l===void 0||l.off($.Restarted,this.onLocalTrackRestarted),this.emit(B.LocalTrackUnpublished,o,this.localParticipant)},this.onLocalTrackRestarted=o=>E(this,void 0,void 0,function*(){const a=yield o.getDeviceId(!1),l=Im(o.source);l&&a&&a!==this.localParticipant.activeDeviceMap.get(l)&&(this.log.debug("local track restarted, setting ".concat(l," ").concat(a," active"),this.logContext),this.localParticipant.activeDeviceMap.set(l,a),this.emit(B.ActiveDeviceChanged,l,a))}),this.onLocalConnectionQualityChanged=o=>{this.emit(B.ConnectionQualityChanged,o,this.localParticipant)},this.onMediaDevicesError=(o,a)=>{this.emit(B.MediaDevicesError,o,a)},this.onLocalParticipantPermissionsChanged=o=>{this.emit(B.ParticipantPermissionsChanged,o,this.localParticipant)},this.onLocalChatMessageSent=o=>{this.emit(B.ChatMessage,o,this.localParticipant)},this.setMaxListeners(100),this.remoteParticipants=new Map,this.sidToIdentity=new Map,this.options=Object.assign(Object.assign({},eU),e),this.log=rr((i=this.options.loggerName)!==null&&i!==void 0?i:ri.Room),this.transcriptionReceivedTimes=new Map,this.options.audioCaptureDefaults=Object.assign(Object.assign({},kE),e==null?void 0:e.audioCaptureDefaults),this.options.videoCaptureDefaults=Object.assign(Object.assign({},SE),e==null?void 0:e.videoCaptureDefaults),this.options.publishDefaults=Object.assign(Object.assign({},Z4),e==null?void 0:e.publishDefaults),this.maybeCreateEngine(),this.incomingDataStreamManager=new PU,this.outgoingDataStreamManager=new IU(this.engine,this.log),this.disconnectLock=new dn,this.localParticipant=new UU("","",this.engine,this.options,this.rpcHandlers,this.outgoingDataStreamManager),this.options.videoCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("videoinput",Zr(this.options.videoCaptureDefaults.deviceId)),this.options.audioCaptureDefaults.deviceId&&this.localParticipant.activeDeviceMap.set("audioinput",Zr(this.options.audioCaptureDefaults.deviceId)),!((r=this.options.audioOutput)===null||r===void 0)&&r.deviceId&&this.switchActiveDevice("audiooutput",Zr(this.options.audioOutput.deviceId)).catch(o=>this.log.warn("Could not set audio output: ".concat(o.message),this.logContext)),this.options.e2ee&&this.setupE2EE(),on()){const o=new AbortController;(s=navigator.mediaDevices)===null||s===void 0||s.addEventListener("devicechange",this.handleDeviceChange,{signal:o.signal}),Sa.cleanupRegistry&&Sa.cleanupRegistry.register(this,()=>{o.abort()})}}registerTextStreamHandler(e,n){return this.incomingDataStreamManager.registerTextStreamHandler(e,n)}unregisterTextStreamHandler(e){return this.incomingDataStreamManager.unregisterTextStreamHandler(e)}registerByteStreamHandler(e,n){return this.incomingDataStreamManager.registerByteStreamHandler(e,n)}unregisterByteStreamHandler(e){return this.incomingDataStreamManager.unregisterByteStreamHandler(e)}registerRpcMethod(e,n){if(this.rpcHandlers.has(e))throw Error("RPC handler already registered for method ".concat(e,", unregisterRpcMethod before trying to register again"));this.rpcHandlers.set(e,n)}unregisterRpcMethod(e){this.rpcHandlers.delete(e)}setE2EEEnabled(e){return E(this,void 0,void 0,function*(){if(this.e2eeManager)yield Promise.all([this.localParticipant.setE2EEEnabled(e)]),this.localParticipant.identity!==""&&this.e2eeManager.setParticipantCryptorEnabled(e,this.localParticipant.identity);else throw Error("e2ee not configured, please set e2ee settings within the room options")})}setupE2EE(){var e;this.options.e2ee&&("e2eeManager"in this.options.e2ee?this.e2eeManager=this.options.e2ee.e2eeManager:this.e2eeManager=new U4(this.options.e2ee),this.e2eeManager.on(Br.ParticipantEncryptionStatusChanged,(n,i)=>{R4(i)&&(this.isE2EEEnabled=n),this.emit(B.ParticipantEncryptionStatusChanged,n,i)}),this.e2eeManager.on(Br.EncryptionError,n=>this.emit(B.EncryptionError,n)),(e=this.e2eeManager)===null||e===void 0||e.setup(this))}get logContext(){var e;return{room:this.name,roomID:(e=this.roomInfo)===null||e===void 0?void 0:e.sid,participant:this.localParticipant.identity,pID:this.localParticipant.sid}}get isRecording(){var e,n;return(n=(e=this.roomInfo)===null||e===void 0?void 0:e.activeRecording)!==null&&n!==void 0?n:!1}getSid(){return E(this,void 0,void 0,function*(){return this.state===_e.Disconnected?"":this.roomInfo&&this.roomInfo.sid!==""?this.roomInfo.sid:new Promise((e,n)=>{const i=r=>{r.sid!==""&&(this.engine.off(X.RoomUpdate,i),e(r.sid))};this.engine.on(X.RoomUpdate,i),this.once(B.Disconnected,()=>{this.engine.off(X.RoomUpdate,i),n("Room disconnected before room server id was available")})})})}get name(){var e,n;return(n=(e=this.roomInfo)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:""}get metadata(){var e;return(e=this.roomInfo)===null||e===void 0?void 0:e.metadata}get numParticipants(){var e,n;return(n=(e=this.roomInfo)===null||e===void 0?void 0:e.numParticipants)!==null&&n!==void 0?n:0}get numPublishers(){var e,n;return(n=(e=this.roomInfo)===null||e===void 0?void 0:e.numPublishers)!==null&&n!==void 0?n:0}maybeCreateEngine(){this.engine&&!this.engine.isClosed||(this.engine=new SU(this.options),this.engine.on(X.ParticipantUpdate,this.handleParticipantUpdates).on(X.RoomUpdate,this.handleRoomUpdate).on(X.SpeakersChanged,this.handleSpeakersChanged).on(X.StreamStateChanged,this.handleStreamStateUpdate).on(X.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(X.SubscriptionError,this.handleSubscriptionError).on(X.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(X.MediaTrackAdded,(e,n,i)=>{this.onTrackAdded(e,n,i)}).on(X.Disconnected,e=>{this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,e)}).on(X.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(X.DataPacketReceived,this.handleDataPacket).on(X.Resuming,()=>{this.clearConnectionReconcile(),this.isResuming=!0,this.log.info("Resuming signal connection",this.logContext),this.setAndEmitConnectionState(_e.SignalReconnecting)&&this.emit(B.SignalReconnecting)}).on(X.Resumed,()=>{this.registerConnectionReconcile(),this.isResuming=!1,this.log.info("Resumed signal connection",this.logContext),this.updateSubscriptions(),this.emitBufferedEvents(),this.setAndEmitConnectionState(_e.Connected)&&this.emit(B.Reconnected)}).on(X.SignalResumed,()=>{this.bufferedEvents=[],(this.state===_e.Reconnecting||this.isResuming)&&this.sendSyncState()}).on(X.Restarting,this.handleRestarting).on(X.SignalRestarted,this.handleSignalRestarted).on(X.Offline,()=>{this.setAndEmitConnectionState(_e.Reconnecting)&&this.emit(B.Reconnecting)}).on(X.DCBufferStatusChanged,(e,n)=>{this.emit(B.DCBufferStatusChanged,e,n)}).on(X.LocalTrackSubscribed,e=>{const n=this.localParticipant.getTrackPublications().find(i=>{let{trackSid:r}=i;return r===e});if(!n){this.log.warn("could not find local track subscription for subscribed event",this.logContext);return}this.localParticipant.emit(J.LocalTrackSubscribed,n),this.emitWhenConnected(B.LocalTrackSubscribed,n,this.localParticipant)}).on(X.RoomMoved,e=>{this.log.debug("room moved",e),e.room&&this.handleRoomUpdate(e.room),this.remoteParticipants.forEach((n,i)=>{this.handleParticipantDisconnected(i,n)}),this.emit(B.Moved,e.room.name),e.participant?this.handleParticipantUpdates([e.participant,...e.otherParticipants]):this.handleParticipantUpdates(e.otherParticipants)}),this.localParticipant&&this.localParticipant.setupEngine(this.engine),this.e2eeManager&&this.e2eeManager.setupEngine(this.engine),this.outgoingDataStreamManager&&this.outgoingDataStreamManager.setupEngine(this.engine))}static getLocalDevices(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Tt.getInstance().getDevices(e,n)}prepareConnection(e,n){return E(this,void 0,void 0,function*(){if(this.state===_e.Disconnected){this.log.debug("prepareConnection to ".concat(e),this.logContext);try{if(Em(new URL(e))&&n){this.regionUrlProvider=new Dm(e,n);const i=yield this.regionUrlProvider.getNextBestRegionUrl();i&&this.state===_e.Disconnected&&(this.regionUrl=i,yield fetch(Pm(i),{method:"HEAD"}),this.log.debug("prepared connection to ".concat(i),this.logContext))}else yield fetch(Pm(e),{method:"HEAD"})}catch(i){this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:i}))}}})}getParticipantByIdentity(e){return this.localParticipant.identity===e?this.localParticipant:this.remoteParticipants.get(e)}clearConnectionFutures(){this.connectFuture=void 0}simulateScenario(e,n){return E(this,void 0,void 0,function*(){let i=()=>E(this,void 0,void 0,function*(){}),r;switch(e){case"signal-reconnect":yield this.engine.client.handleOnClose("simulate disconnect");break;case"speaker":r=new ci({scenario:{case:"speakerUpdate",value:3}});break;case"node-failure":r=new ci({scenario:{case:"nodeFailure",value:!0}});break;case"server-leave":r=new ci({scenario:{case:"serverLeave",value:!0}});break;case"migration":r=new ci({scenario:{case:"migration",value:!0}});break;case"resume-reconnect":this.engine.failNext(),yield this.engine.client.handleOnClose("simulate resume-disconnect");break;case"disconnect-signal-on-resume":i=()=>E(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),r=new ci({scenario:{case:"disconnectSignalOnResume",value:!0}});break;case"disconnect-signal-on-resume-no-messages":i=()=>E(this,void 0,void 0,function*(){yield this.engine.client.handleOnClose("simulate resume-disconnect")}),r=new ci({scenario:{case:"disconnectSignalOnResumeNoMessages",value:!0}});break;case"full-reconnect":this.engine.fullReconnectOnNext=!0,yield this.engine.client.handleOnClose("simulate full-reconnect");break;case"force-tcp":case"force-tls":r=new ci({scenario:{case:"switchCandidateProtocol",value:e==="force-tls"?2:1}}),i=()=>E(this,void 0,void 0,function*(){const s=this.engine.client.onLeave;s&&s(new uh({reason:Xn.CLIENT_INITIATED,action:Ho.RECONNECT}))});break;case"subscriber-bandwidth":if(n===void 0||typeof n!="number")throw new Error("subscriber-bandwidth requires a number as argument");r=new ci({scenario:{case:"subscriberBandwidth",value:gs(n)}});break;case"leave-full-reconnect":r=new ci({scenario:{case:"leaveRequestFullReconnect",value:!0}})}r&&(yield this.engine.client.sendSimulateScenario(r),yield i())})}get canPlaybackAudio(){return this.audioEnabled}get canPlaybackVideo(){return!this.isVideoPlaybackBlocked}getActiveDevice(e){return this.localParticipant.activeDeviceMap.get(e)}switchActiveDevice(e,n){return E(this,arguments,void 0,function(i,r){var s=this;let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function*(){var a,l,d,u,h,p,g;let b=!0,m=!1;const k=o?{exact:r}:r;if(i==="audioinput"){m=s.localParticipant.audioTrackPublications.size===0;const v=(a=s.getActiveDevice(i))!==null&&a!==void 0?a:s.options.audioCaptureDefaults.deviceId;s.options.audioCaptureDefaults.deviceId=k;const y=Array.from(s.localParticipant.audioTrackPublications.values()).filter(S=>S.source===V.Source.Microphone);try{b=(yield Promise.all(y.map(S=>{var w;return(w=S.audioTrack)===null||w===void 0?void 0:w.setDeviceId(k)}))).every(S=>S===!0)}catch(S){throw s.options.audioCaptureDefaults.deviceId=v,S}const x=y.some(S=>{var w,C;return(C=(w=S.track)===null||w===void 0?void 0:w.isMuted)!==null&&C!==void 0?C:!1});b&&x&&(m=!0)}else if(i==="videoinput"){m=s.localParticipant.videoTrackPublications.size===0;const v=(l=s.getActiveDevice(i))!==null&&l!==void 0?l:s.options.videoCaptureDefaults.deviceId;s.options.videoCaptureDefaults.deviceId=k;const y=Array.from(s.localParticipant.videoTrackPublications.values()).filter(S=>S.source===V.Source.Camera);try{b=(yield Promise.all(y.map(S=>{var w;return(w=S.videoTrack)===null||w===void 0?void 0:w.setDeviceId(k)}))).every(S=>S===!0)}catch(S){throw s.options.videoCaptureDefaults.deviceId=v,S}const x=y.some(S=>{var w,C;return(C=(w=S.track)===null||w===void 0?void 0:w.isMuted)!==null&&C!==void 0?C:!1});b&&x&&(m=!0)}else if(i==="audiooutput"){if(m=!0,!_m()&&!s.options.webAudioMix||s.options.webAudioMix&&s.audioContext&&!("setSinkId"in s.audioContext))throw new Error("cannot switch audio output, the current browser does not support it");s.options.webAudioMix&&(r=(d=yield Tt.getInstance().normalizeDeviceId("audiooutput",r))!==null&&d!==void 0?d:""),(u=(g=s.options).audioOutput)!==null&&u!==void 0||(g.audioOutput={});const v=(h=s.getActiveDevice(i))!==null&&h!==void 0?h:s.options.audioOutput.deviceId;s.options.audioOutput.deviceId=r;try{s.options.webAudioMix&&((p=s.audioContext)===null||p===void 0||p.setSinkId(r)),yield Promise.all(Array.from(s.remoteParticipants.values()).map(y=>y.setAudioOutput({deviceId:r})))}catch(y){throw s.options.audioOutput.deviceId=v,y}}return m&&(s.localParticipant.activeDeviceMap.set(i,r),s.emit(B.ActiveDeviceChanged,i,r)),b}()})}setupLocalParticipantEvents(){this.localParticipant.on(J.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(J.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(J.AttributesChanged,this.onLocalAttributesChanged).on(J.TrackMuted,this.onLocalTrackMuted).on(J.TrackUnmuted,this.onLocalTrackUnmuted).on(J.LocalTrackPublished,this.onLocalTrackPublished).on(J.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(J.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(J.MediaDevicesError,this.onMediaDevicesError).on(J.AudioStreamAcquired,this.startAudio).on(J.ChatMessage,this.onLocalChatMessageSent).on(J.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}recreateEngine(){var e;(e=this.engine)===null||e===void 0||e.close(),this.engine=void 0,this.isResuming=!1,this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.bufferedEvents=[],this.maybeCreateEngine()}onTrackAdded(e,n,i){if(this.state===_e.Connecting||this.state===_e.Reconnecting){const h=()=>{this.onTrackAdded(e,n,i),p()},p=()=>{this.off(B.Reconnected,h),this.off(B.Connected,h),this.off(B.Disconnected,p)};
595this.once(B.Reconnected,h),this.once(B.Connected,h),this.once(B.Disconnected,p);return}if(this.state===_e.Disconnected){this.log.warn("skipping incoming track after Room disconnected",this.logContext);return}if(e.readyState==="ended"){this.log.info("skipping incoming track as it already ended",this.logContext);return}const r=h4(n.id),s=r[0];let o=r[1],a=e.id;if(o&&o.startsWith("TR")&&(a=o),s===this.localParticipant.sid){this.log.warn("tried to create RemoteParticipant for local participant",this.logContext);return}const l=Array.from(this.remoteParticipants.values()).find(h=>h.sid===s);if(!l){this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(s),this.logContext);return}let d;this.options.adaptiveStream&&(typeof this.options.adaptiveStream=="object"?d=this.options.adaptiveStream:d={});const u=l.addSubscribedMediaTrack(e,a,n,i,d);u!=null&&u.isEncrypted&&!this.e2eeManager&&this.emit(B.EncryptionError,new Error("Encrypted ".concat(u.source," track received from participant ").concat(l.sid,", but room does not have encryption enabled!")))}handleDisconnect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,n=arguments.length>1?arguments[1]:void 0;var i;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.incomingDataStreamManager.clearHandlersAndControllers(),this.state!==_e.Disconnected){this.regionUrl=void 0;
vendor: 25,680 bytes, line 595
595try{this.remoteParticipants.forEach(r=>{r.trackPublications.forEach(s=>{r.unpublishTrack(s.trackSid)})}),this.localParticipant.trackPublications.forEach(r=>{var s,o,a;r.track&&this.localParticipant.unpublishTrack(r.track,e),e?((s=r.track)===null||s===void 0||s.detach(),(o=r.track)===null||o===void 0||o.stop()):(a=r.track)===null||a===void 0||a.stopMonitor()}),this.localParticipant.off(J.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(J.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(J.AttributesChanged,this.onLocalAttributesChanged).off(J.TrackMuted,this.onLocalTrackMuted).off(J.TrackUnmuted,this.onLocalTrackUnmuted).off(J.LocalTrackPublished,this.onLocalTrackPublished).off(J.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(J.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(J.MediaDevicesError,this.onMediaDevicesError).off(J.AudioStreamAcquired,this.startAudio).off(J.ChatMessage,this.onLocalChatMessageSent).off(J.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.trackPublications.clear(),this.localParticipant.videoTrackPublications.clear(),this.localParticipant.audioTrackPublications.clear(),this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.activeSpeakers=[],this.audioContext&&typeof this.options.webAudioMix=="boolean"&&(this.audioContext.close(),this.audioContext=void 0),on()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),(i=navigator.mediaDevices)===null||i===void 0||i.removeEventListener("devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(_e.Disconnected),this.emit(B.Disconnected,n)}}}handleParticipantDisconnected(e,n){var i;this.remoteParticipants.delete(e),n&&(this.incomingDataStreamManager.validateParticipantHasNoActiveDataStreams(e),n.trackPublications.forEach(r=>{n.unpublishTrack(r.trackSid,!0)}),this.emit(B.ParticipantDisconnected,n),n.setDisconnected(),(i=this.localParticipant)===null||i===void 0||i.handleParticipantDisconnected(n.identity))}handleIncomingRpcRequest(e,n,i,r,s,o){return E(this,void 0,void 0,function*(){if(yield this.engine.publishRpcAck(e,n),o!==1){yield this.engine.publishRpcResponse(e,n,null,ut.builtIn("UNSUPPORTED_VERSION"));return}const a=this.rpcHandlers.get(i);if(!a){yield this.engine.publishRpcResponse(e,n,null,ut.builtIn("UNSUPPORTED_METHOD"));return}let l=null,d=null;try{const u=yield a({requestId:n,callerIdentity:e,payload:r,responseTimeout:s});Fv(u)>wE?(l=ut.builtIn("RESPONSE_PAYLOAD_TOO_LARGE"),console.warn("RPC Response payload too large for ".concat(i))):d=u}catch(u){u instanceof ut?l=u:(console.warn("Uncaught error returned by RPC handler for ".concat(i,". Returning APPLICATION_ERROR instead."),u),l=ut.builtIn("APPLICATION_ERROR"))}yield this.engine.publishRpcResponse(e,n,d,l)})}selectDefaultDevices(){return E(this,void 0,void 0,function*(){var e,n,i;const r=Tt.getInstance().previousDevices,s=yield Tt.getInstance().getDevices(void 0,!1),o=kn();if((o==null?void 0:o.name)==="Chrome"&&o.os!=="iOS")for(let l of s){const d=r.find(u=>u.deviceId===l.deviceId);d&&d.label!==""&&d.kind===l.kind&&d.label!==l.label&&this.getActiveDevice(l.kind)==="default"&&this.emit(B.ActiveDeviceChanged,l.kind,l.deviceId)}const a=["audiooutput","audioinput","videoinput"];for(let l of a){const d=I4(l),u=this.localParticipant.getTrackPublication(d);if(u&&(!((e=u.track)===null||e===void 0)&&e.isUserProvided))continue;const h=s.filter(g=>g.kind===l),p=this.getActiveDevice(l);if(p===((n=r.filter(g=>g.kind===l)[0])===null||n===void 0?void 0:n.deviceId)&&h.length>0&&((i=h[0])===null||i===void 0?void 0:i.deviceId)!==p){yield this.switchActiveDevice(l,h[0].deviceId);continue}l==="audioinput"&&!Wc()||l==="videoinput"||h.length>0&&!h.find(g=>g.deviceId===this.getActiveDevice(l))&&(l!=="audiooutput"||!Wc())&&(yield this.switchActiveDevice(l,h[0].deviceId))}})}acquireAudioContext(){return E(this,void 0,void 0,function*(){var e,n;if(typeof this.options.webAudioMix!="boolean"&&this.options.webAudioMix.audioContext?this.audioContext=this.options.webAudioMix.audioContext:(!this.audioContext||this.audioContext.state==="closed")&&(this.audioContext=(e=yE())!==null&&e!==void 0?e:void 0),this.options.webAudioMix&&this.remoteParticipants.forEach(r=>r.setAudioContext(this.audioContext)),this.localParticipant.setAudioContext(this.audioContext),this.audioContext&&this.audioContext.state==="suspended")try{yield Promise.race([this.audioContext.resume(),un(200)])}catch(r){this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:r}))}const i=((n=this.audioContext)===null||n===void 0?void 0:n.state)==="running";i!==this.canPlaybackAudio&&(this.audioEnabled=i,this.emit(B.AudioPlaybackStatusChanged,i))})}createParticipant(e,n){var i;let r;return n?r=Cu.fromParticipantInfo(this.engine.client,n,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}):r=new Cu(this.engine.client,"",e,void 0,void 0,void 0,{loggerContextCb:()=>this.logContext,loggerName:this.options.loggerName}),this.options.webAudioMix&&r.setAudioContext(this.audioContext),!((i=this.options.audioOutput)===null||i===void 0)&&i.deviceId&&r.setAudioOutput(this.options.audioOutput).catch(s=>this.log.warn("Could not set audio output: ".concat(s.message),this.logContext)),r}getOrCreateParticipant(e,n){if(this.remoteParticipants.has(e)){const r=this.remoteParticipants.get(e);return n&&r.updateInfo(n)&&this.sidToIdentity.set(n.sid,n.identity),r}const i=this.createParticipant(e,n);return this.remoteParticipants.set(e,i),this.sidToIdentity.set(n.sid,n.identity),this.emitWhenConnected(B.ParticipantConnected,i),i.on(J.TrackPublished,r=>{this.emitWhenConnected(B.TrackPublished,r,i)}).on(J.TrackSubscribed,(r,s)=>{r.kind===V.Kind.Audio?(r.on($.AudioPlaybackStarted,this.handleAudioPlaybackStarted),r.on($.AudioPlaybackFailed,this.handleAudioPlaybackFailed)):r.kind===V.Kind.Video&&(r.on($.VideoPlaybackFailed,this.handleVideoPlaybackFailed),r.on($.VideoPlaybackStarted,this.handleVideoPlaybackStarted)),this.emit(B.TrackSubscribed,r,s,i)}).on(J.TrackUnpublished,r=>{this.emit(B.TrackUnpublished,r,i)}).on(J.TrackUnsubscribed,(r,s)=>{this.emit(B.TrackUnsubscribed,r,s,i)}).on(J.TrackMuted,r=>{this.emitWhenConnected(B.TrackMuted,r,i)}).on(J.TrackUnmuted,r=>{this.emitWhenConnected(B.TrackUnmuted,r,i)}).on(J.ParticipantMetadataChanged,r=>{this.emitWhenConnected(B.ParticipantMetadataChanged,r,i)}).on(J.ParticipantNameChanged,r=>{this.emitWhenConnected(B.ParticipantNameChanged,r,i)}).on(J.AttributesChanged,r=>{this.emitWhenConnected(B.ParticipantAttributesChanged,r,i)}).on(J.ConnectionQualityChanged,r=>{this.emitWhenConnected(B.ConnectionQualityChanged,r,i)}).on(J.ParticipantPermissionsChanged,r=>{this.emitWhenConnected(B.ParticipantPermissionsChanged,r,i)}).on(J.TrackSubscriptionStatusChanged,(r,s)=>{this.emitWhenConnected(B.TrackSubscriptionStatusChanged,r,s,i)}).on(J.TrackSubscriptionFailed,(r,s)=>{this.emit(B.TrackSubscriptionFailed,r,i,s)}).on(J.TrackSubscriptionPermissionChanged,(r,s)=>{this.emitWhenConnected(B.TrackSubscriptionPermissionChanged,r,s,i)}).on(J.Active,()=>{this.emitWhenConnected(B.ParticipantActive,i),i.kind===Bc.AGENT&&this.localParticipant.setActiveAgent(i)}),n&&i.updateInfo(n),i}sendSyncState(){const e=Array.from(this.remoteParticipants.values()).reduce((i,r)=>(i.push(...r.getTrackPublications()),i),[]),n=this.localParticipant.getTrackPublications();this.engine.sendSyncState(e,n)}updateSubscriptions(){for(const e of this.remoteParticipants.values())for(const n of e.videoTrackPublications.values())n.isSubscribed&&P4(n)&&n.emitTrackUpdate()}getRemoteParticipantBySid(e){const n=this.sidToIdentity.get(e);if(n)return this.remoteParticipants.get(n)}registerConnectionReconcile(){this.clearConnectionReconcile();let e=0;this.connectionReconcileInterval=Nt.setInterval(()=>{!this.engine||this.engine.isClosed||!this.engine.verifyTransport()?(e++,this.log.warn("detected connection state mismatch",Object.assign(Object.assign({},this.logContext),{numFailures:e,engine:this.engine?{closed:this.engine.isClosed,transportsConnected:this.engine.verifyTransport()}:void 0})),e>=3&&(this.recreateEngine(),this.handleDisconnect(this.options.stopLocalTrackOnUnpublish,Xn.STATE_MISMATCH))):e=0},VU)}clearConnectionReconcile(){this.connectionReconcileInterval&&Nt.clearInterval(this.connectionReconcileInterval)}setAndEmitConnectionState(e){return e===this.state?!1:(this.state=e,this.emit(B.ConnectionStateChanged,this.state),!0)}emitBufferedEvents(){this.bufferedEvents.forEach(e=>{let[n,i]=e;this.emit(n,...i)}),this.bufferedEvents=[]}emitWhenConnected(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];if(this.state===_e.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([e,i]);else if(this.state===_e.Connected)return this.emit(e,...i);return!1}simulateParticipants(e){return E(this,void 0,void 0,function*(){var n,i;const r=Object.assign({audio:!0,video:!0,useRealTracks:!1},e.publish),s=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},e.participants);if(this.handleDisconnect(),this.roomInfo=new lh({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:et.parse(new Date().getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new Gs({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(B.SignalConnected),this.emit(B.Connected),this.setAndEmitConnectionState(_e.Connected),r.video){const o=new Mm(V.Kind.Video,new Po({source:pt.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:Gn.AUDIO,name:"video-dummy"}),new wu(r.useRealTracks?(yield window.navigator.mediaDevices.getUserMedia({video:!0})).getVideoTracks()[0]:tx(160*((n=s.aspectRatios[0])!==null&&n!==void 0?n:1),160,!0,!0),void 0,!1,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(o),this.localParticipant.emit(J.LocalTrackPublished,o)}if(r.audio){const o=new Mm(V.Kind.Audio,new Po({source:pt.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:Gn.AUDIO}),new Su(r.useRealTracks?(yield navigator.mediaDevices.getUserMedia({audio:!0})).getAudioTracks()[0]:kf(),void 0,!1,this.audioContext,{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext}),{loggerName:this.options.loggerName,loggerContextCb:()=>this.logContext});this.localParticipant.addTrackPublication(o),this.localParticipant.emit(J.LocalTrackPublished,o)}for(let o=0;o<s.count-1;o+=1){let a=new Gs({sid:Math.floor(Math.random()*1e4).toString(),identity:"simulated-".concat(o),state:Wo.ACTIVE,tracks:[],joinedAt:et.parse(Date.now())});const l=this.getOrCreateParticipant(a.identity,a);if(s.video){const d=tx(160*((i=s.aspectRatios[o%s.aspectRatios.length])!==null&&i!==void 0?i:1),160,!1,!0),u=new Po({source:pt.CAMERA,sid:Math.floor(Math.random()*1e4).toString(),type:Gn.AUDIO});l.addSubscribedMediaTrack(d,u.sid,new MediaStream([d]),new RTCRtpReceiver),a.tracks=[...a.tracks,u]}if(s.audio){const d=kf(),u=new Po({source:pt.MICROPHONE,sid:Math.floor(Math.random()*1e4).toString(),type:Gn.AUDIO});l.addSubscribedMediaTrack(d,u.sid,new MediaStream([d]),new RTCRtpReceiver),a.tracks=[...a.tracks,u]}l.updateInfo(a)}})}emit(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];if(e!==B.ActiveSpeakersChanged&&e!==B.TranscriptionReceived){const s=jE(i).filter(o=>o!==void 0);this.log.debug("room event ".concat(e),Object.assign(Object.assign({},this.logContext),{event:e,args:s}))}return super.emit(e,...i)}}Sa.cleanupRegistry=typeof FinalizationRegistry<"u"&&new FinalizationRegistry(t=>{t()});function jE(t){return t.map(e=>{if(e)return Array.isArray(e)?jE(e):typeof e=="object"?"logContext"in e?e.logContext:void 0:e})}var $n;(function(t){t[t.IDLE=0]="IDLE",t[t.RUNNING=1]="RUNNING",t[t.SKIPPED=2]="SKIPPED",t[t.SUCCESS=3]="SUCCESS",t[t.FAILED=4]="FAILED"})($n||($n={}));class hs extends Ni.EventEmitter{constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.status=$n.IDLE,this.logs=[],this.options={},this.url=e,this.token=n,this.name=this.constructor.name,this.room=new Sa(i.roomOptions),this.connectOptions=i.connectOptions,this.options=i}run(e){return E(this,void 0,void 0,function*(){if(this.status!==$n.IDLE)throw Error("check is running already");this.setStatus($n.RUNNING);try{yield this.perform()}catch(n){n instanceof Error&&(this.options.errorsAsWarnings?this.appendWarning(n.message):this.appendError(n.message))}return yield this.disconnect(),yield new Promise(n=>setTimeout(n,500)),this.status!==$n.SKIPPED&&this.setStatus(this.isSuccess()?$n.SUCCESS:$n.FAILED),e&&e(),this.getInfo()})}isSuccess(){return!this.logs.some(e=>e.level==="error")}connect(e){return E(this,void 0,void 0,function*(){return this.room.state===_e.Connected?this.room:(e||(e=this.url),yield this.room.connect(e,this.token,this.connectOptions),this.room)})}disconnect(){return E(this,void 0,void 0,function*(){this.room&&this.room.state!==_e.Disconnected&&(yield this.room.disconnect(),yield new Promise(e=>setTimeout(e,500)))})}skip(){this.setStatus($n.SKIPPED)}switchProtocol(e){return E(this,void 0,void 0,function*(){let n=!1,i=!1;if(this.room.on(B.Reconnecting,()=>{n=!0}),this.room.once(B.Reconnected,()=>{i=!0}),this.room.simulateScenario("force-".concat(e)),yield new Promise(s=>setTimeout(s,1e3)),!n)return;const r=Date.now()+1e4;for(;Date.now()<r;){if(i)return;yield un(100)}throw new Error("Could not reconnect using ".concat(e," protocol after 10 seconds"))})}appendMessage(e){this.logs.push({level:"info",message:e}),this.emit("update",this.getInfo())}appendWarning(e){this.logs.push({level:"warning",message:e}),this.emit("update",this.getInfo())}appendError(e){this.logs.push({level:"error",message:e}),this.emit("update",this.getInfo())}setStatus(e){this.status=e,this.emit("update",this.getInfo())}get engine(){var e;return(e=this.room)===null||e===void 0?void 0:e.engine}getInfo(){return{logs:this.logs,name:this.name,status:this.status,description:this.description}}}class zU extends hs{get description(){return"Cloud regions"}perform(){return E(this,void 0,void 0,function*(){const e=new Dm(this.url,this.token);if(!e.isCloud()){this.skip();return}const n=[],i=new Set;for(let s=0;s<3;s++){const o=yield e.getNextBestRegionUrl();if(!o)break;if(i.has(o))continue;i.add(o);const a=yield this.checkCloudRegion(o);this.appendMessage("".concat(a.region," RTT: ").concat(a.rtt,"ms, duration: ").concat(a.duration,"ms")),n.push(a)}n.sort((s,o)=>(s.duration-o.duration)*.5+(s.rtt-o.rtt)*.5);const r=n[0];this.bestStats=r,this.appendMessage("best Cloud region: ".concat(r.region))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkCloudRegion(e){return E(this,void 0,void 0,function*(){var n,i;yield this.connect(e),this.options.protocol==="tcp"&&(yield this.switchProtocol("tcp"));const r=(n=this.room.serverInfo)===null||n===void 0?void 0:n.region;if(!r)throw new Error("Region not found");const s=yield this.room.localParticipant.streamText({topic:"test"}),o=1e3,l=1e6/o,d="A".repeat(o),u=Date.now();for(let b=0;b<l;b++)yield s.write(d);yield s.close();const h=Date.now(),p=yield(i=this.room.engine.pcManager)===null||i===void 0?void 0:i.publisher.getStats(),g={region:r,rtt:1e4,duration:h-u};return p==null||p.forEach(b=>{b.type==="candidate-pair"&&b.nominated&&(g.rtt=b.currentRoundTripTime*1e3)}),yield this.disconnect(),g})}}const Nf=1e4;class BU extends hs{get description(){return"Connection via UDP vs TCP"}perform(){return E(this,void 0,void 0,function*(){const e=yield this.checkConnectionProtocol("udp"),n=yield this.checkConnectionProtocol("tcp");this.bestStats=e,e.qualityLimitationDurations.bandwidth-n.qualityLimitationDurations.bandwidth>.5||(e.packetsLost-n.packetsLost)/e.packetsSent>.01?(this.appendMessage("best connection quality via tcp"),this.bestStats=n):this.appendMessage("best connection quality via udp");const i=this.bestStats;this.appendMessage("upstream bitrate: ".concat((i.bitrateTotal/i.count/1e3/1e3).toFixed(2)," mbps")),this.appendMessage("RTT: ".concat((i.rttTotal/i.count*1e3).toFixed(2)," ms")),this.appendMessage("jitter: ".concat((i.jitterTotal/i.count*1e3).toFixed(2)," ms")),i.packetsLost>0&&this.appendWarning("packets lost: ".concat((i.packetsLost/i.packetsSent*100).toFixed(2),"%")),i.qualityLimitationDurations.bandwidth>1&&this.appendWarning("bandwidth limited ".concat((i.qualityLimitationDurations.bandwidth/(Nf/1e3)*100).toFixed(2),"%")),i.qualityLimitationDurations.cpu>0&&this.appendWarning("cpu limited ".concat((i.qualityLimitationDurations.cpu/(Nf/1e3)*100).toFixed(2),"%"))})}getInfo(){const e=super.getInfo();return e.data=this.bestStats,e}checkConnectionProtocol(e){return E(this,void 0,void 0,function*(){yield this.connect(),e==="tcp"?yield this.switchProtocol("tcp"):yield this.switchProtocol("udp");const n=document.createElement("canvas");n.width=1280,n.height=720;const i=n.getContext("2d");if(!i)throw new Error("Could not get canvas context");let r=0;const s=()=>{r=(r+1)%360,i.fillStyle="hsl(".concat(r,", 100%, 50%)"),i.fillRect(0,0,n.width,n.height),requestAnimationFrame(s)};s();const a=n.captureStream(30).getVideoTracks()[0],d=(yield this.room.localParticipant.publishTrack(a,{simulcast:!1,degradationPreference:"maintain-resolution",videoEncoding:{maxBitrate:2e6}})).track,u={protocol:e,packetsLost:0,packetsSent:0,qualityLimitationDurations:{},rttTotal:0,jitterTotal:0,bitrateTotal:0,count:0},h=setInterval(()=>E(this,void 0,void 0,function*(){const p=yield d.getRTCStatsReport();p==null||p.forEach(g=>{g.type==="outbound-rtp"?(u.packetsSent=g.packetsSent,u.qualityLimitationDurations=g.qualityLimitationDurations,u.bitrateTotal+=g.targetBitrate,u.count++):g.type==="remote-inbound-rtp"&&(u.packetsLost=g.packetsLost,u.rttTotal+=g.roundTripTime,u.jitterTotal+=g.jitter)})}),1e3);return yield new Promise(p=>setTimeout(p,Nf)),clearInterval(h),a.stop(),n.remove(),yield this.disconnect(),u})}}class WU extends hs{get description(){return"Can publish audio"}perform(){return E(this,void 0,void 0,function*(){var e;const n=yield this.connect(),i=yield NE();if(yield vE(i,1e3))throw new Error("unable to detect audio from microphone");this.appendMessage("detected audio from microphone"),n.localParticipant.publishTrack(i),yield new Promise(a=>setTimeout(a,3e3));const s=yield(e=i.sender)===null||e===void 0?void 0:e.getStats();if(!s)throw new Error("Could not get RTCStats");let o=0;if(s.forEach(a=>{a.type==="outbound-rtp"&&(a.kind==="audio"||!a.kind&&a.mediaType==="audio")&&(o=a.packetsSent)}),o===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(o," audio packets"))})}}class HU extends hs{get description(){return"Can publish video"}perform(){return E(this,void 0,void 0,function*(){var e;const n=yield this.connect(),i=yield DU();yield this.checkForVideo(i.mediaStreamTrack),n.localParticipant.publishTrack(i),yield new Promise(o=>setTimeout(o,5e3));const r=yield(e=i.sender)===null||e===void 0?void 0:e.getStats();if(!r)throw new Error("Could not get RTCStats");let s=0;if(r.forEach(o=>{o.type==="outbound-rtp"&&(o.kind==="video"||!o.kind&&o.mediaType==="video")&&(s+=o.packetsSent)}),s===0)throw new Error("Could not determine packets are sent");this.appendMessage("published ".concat(s," video packets"))})}checkForVideo(e){return E(this,void 0,void 0,function*(){const n=new MediaStream;n.addTrack(e.clone());const i=document.createElement("video");i.srcObject=n,i.muted=!0,yield new Promise(r=>{i.onplay=()=>{setTimeout(()=>{var s,o,a,l;const d=document.createElement("canvas"),u=e.getSettings(),h=(o=(s=u.width)!==null&&s!==void 0?s:i.videoWidth)!==null&&o!==void 0?o:1280,p=(l=(a=u.height)!==null&&a!==void 0?a:i.videoHeight)!==null&&l!==void 0?l:720;d.width=h,d.height=p;const g=d.getContext("2d");g.drawImage(i,0,0);const m=g.getImageData(0,0,d.width,d.height).data;let k=!0;for(let v=0;v<m.length;v+=4)if(m[v]!==0||m[v+1]!==0||m[v+2]!==0){k=!1;break}k?this.appendError("camera appears to be producing only black frames"):this.appendMessage("received video frames"),r()},1e3)},i.play()}),n.getTracks().forEach(r=>r.stop()),i.remove()})}}class $U extends hs{get description(){return"Resuming connection after interruption"}perform(){return E(this,void 0,void 0,function*(){var e;const n=yield this.connect();let i=!1,r=!1,s;const o=new Promise(d=>{setTimeout(d,5e3),s=d}),a=()=>{i=!0};n.on(B.SignalReconnecting,a).on(B.Reconnecting,a).on(B.Reconnected,()=>{r=!0,s(!0)}),(e=n.engine.client.ws)===null||e===void 0||e.close();const l=n.engine.client.onClose;if(l&&l(""),yield o,i){if(!r||n.state!==_e.Connected)throw this.appendWarning("reconnection is only possible in Redis-based configurations"),new Error("Not able to reconnect")}else throw new Error("Did not attempt to reconnect")})}}class qU extends hs{get description(){return"Can connect via TURN"}perform(){return E(this,void 0,void 0,function*(){var e,n;const i=new Ov,r=yield i.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});let s=!1,o=!1,a=!1;for(let l of r.iceServers)for(let d of l.urls)d.startsWith("turn:")?(o=!0,a=!0):d.startsWith("turns:")&&(o=!0,a=!0,s=!0),d.startsWith("stun:")&&(a=!0);a?o&&!s&&this.appendWarning("TURN is configured server side, but TURN/TLS is unavailable."):this.appendWarning("No STUN servers configured on server side."),yield i.close(),!((n=(e=this.connectOptions)===null||e===void 0?void 0:e.rtcConfig)===null||n===void 0)&&n.iceServers||o?yield this.room.connect(this.url,this.token,{rtcConfig:{iceTransportPolicy:"relay"}}):(this.appendWarning("No TURN servers configured."),this.skip(),yield new Promise(l=>setTimeout(l,0)))})}}class KU extends hs{get description(){return"Establishing WebRTC connection"}perform(){return E(this,void 0,void 0,function*(){let e=!1,n=!1;this.room.on(B.SignalConnected,()=>{const i=this.room.engine.client.onTrickle;this.room.engine.client.onTrickle=(r,s)=>{if(r.candidate){const o=new RTCIceCandidate(r);let a="".concat(o.protocol," ").concat(o.address,":").concat(o.port," ").concat(o.type);o.address&&(GU(o.address)?a+=" (private)":o.protocol==="tcp"&&o.tcpType==="passive"?(e=!0,a+=" (passive)"):o.protocol==="udp"&&(n=!0)),this.appendMessage(a)}i&&i(r,s)},this.room.engine.pcManager&&(this.room.engine.pcManager.subscriber.onIceCandidateError=r=>{r instanceof RTCPeerConnectionIceErrorEvent&&this.appendWarning("error with ICE candidate: ".concat(r.errorCode," ").concat(r.errorText," ").concat(r.url))})});try{yield this.connect(),ke.info("now the room is connected")}catch(i){throw this.appendWarning("ports need to be open on firewall in order to connect."),i}e||this.appendWarning("Server is not configured for ICE/TCP"),n||this.appendWarning("No public IPv4 UDP candidates were found. Your server is likely not configured correctly")})}}function GU(t){const e=t.split(".");if(e.length===4){if(e[0]==="10")return!0;if(e[0]==="192"&&e[1]==="168")return!0;if(e[0]==="172"){const n=parseInt(e[1],10);if(n>=16&&n<=31)return!0}}return!1}class QU extends hs{get description(){return"Connecting to signal connection via WebSocket"}perform(){return E(this,void 0,void 0,function*(){var e,n,i;(this.url.startsWith("ws:")||this.url.startsWith("http:"))&&this.appendWarning("Server is insecure, clients may block connections to it");let r=new Ov;const s=yield r.join(this.url,this.token,{autoSubscribe:!0,maxRetries:0,e2eeEnabled:!1,websocketTimeout:15e3});this.appendMessage("Connected to server, version ".concat(s.serverVersion,".")),((e=s.serverInfo)===null||e===void 0?void 0:e.edition)===y1.Cloud&&(!((n=s.serverInfo)===null||n===void 0)&&n.region)&&this.appendMessage("LiveKit Cloud: ".concat((i=s.serverInfo)===null||i===void 0?void 0:i.region)),yield r.close()})}}class N8 extends Ni.EventEmitter{constructor(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};super(),this.options={},this.checkResults=new Map,this.url=e,this.token=n,this.options=i}getNextCheckId(){const e=this.checkResults.size;return this.checkResults.set(e,{logs:[],status:$n.IDLE,name:"",description:""}),e}updateCheck(e,n){this.checkResults.set(e,n),this.emit("checkUpdate",e,n)}isSuccess(){return Array.from(this.checkResults.values()).every(e=>e.status!==$n.FAILED)}getResults(){return Array.from(this.checkResults.values())}createAndRunCheck(e){return E(this,void 0,void 0,function*(){const n=this.getNextCheckId(),i=new e(this.url,this.token,this.options),r=o=>{this.updateCheck(n,o)};i.on("update",r);const s=yield i.run();return i.off("update",r),s})}checkWebsocket(){return E(this,void 0,void 0,function*(){return this.createAndRunCheck(QU)})}checkWebRTC(){return E(this,void 0,void 0,function*(){return this.createAndRunCheck(KU)})}checkTURN(){return E(this,void 0,void 0,function*(){return this.createAndRunCheck(qU)})}checkReconnect(){return E(this,void 0,void 0,function*(){return this.createAndRunCheck($U)})}checkPublishAudio(){return E(this,void 0,void 0,function*(){return this.createAndRunCheck(WU)})}checkPublishVideo(){return E(this,void 0,void 0,function*(){return this.createAndRunCheck(HU)})}checkConnectionProtocol(){return E(this,void 0,void 0,function*(){const e=yield this.createAndRunCheck(BU);if(e.data&&"protocol"in e.data){const n=e.data;this.options.protocol=n.protocol}return e})}
595checkCloudRegion(){return E(this,void 0,void 0,function*(){return this.createAndRunCheck(zU)})}}function I8(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var n;const i=Ls(t)?t.mediaStreamTrack:t,r=i.getSettings();let s={facingMode:(n=e.defaultFacingMode)!==null&&n!==void 0?n:"user",confidence:"low"};if("facingMode"in r){const o=r.facingMode;ke.trace("rawFacingMode",{rawFacingMode:o}),o&&typeof o=="string"&&XU(o)&&(s={facingMode:o,confidence:"high"})}if(["low","medium"].includes(s.confidence)){ke.trace("Try to get facing mode from device label: (".concat(i.label,")"));const o=YU(i.label);o!==void 0&&(s=o)}return s}const kx=new Map([["obs virtual camera",{facingMode:"environment",confidence:"medium"}]]),JU=new Map([["iphone",{facingMode:"environment",confidence:"medium"}],["ipad",{facingMode:"environment",confidence:"medium"}]]);function YU(t){var e;const n=t.trim().toLowerCase();if(n!=="")return kx.has(n)?kx.get(n):(e=Array.from(JU.entries()).find(i=>{let[r]=i;return n.includes(r)}))===null||e===void 0?void 0:e[1]}function XU(t){return t===void 0||["user","environment","left","right"].includes(t)}var Bv={exports:{}},Go=typeof Reflect=="object"?Reflect:null,Sx=Go&&typeof Go.apply=="function"?Go.apply:function(e,n,i){return Function.prototype.apply.call(e,n,i)},Od;Go&&typeof Go.ownKeys=="function"?Od=Go.ownKeys:Object.getOwnPropertySymbols?Od=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Od=function(e){return Object.getOwnPropertyNames(e)};function ZU(t){console&&console.warn&&console.warn(t)}var AE=Number.isNaN||function(e){return e!==e};function Be(){Be.init.call(this)}Bv.exports=Be;Bv.exports.once=i5;Be.EventEmitter=Be;Be.prototype._events=void 0;Be.prototype._eventsCount=0;Be.prototype._maxListeners=void 0;var wx=10;function mh(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Be,"defaultMaxListeners",{enumerable:!0,get:function(){return wx},set:function(t){if(typeof t!="number"||t<0||AE(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");wx=t}});Be.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Be.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||AE(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function OE(t){return t._maxListeners===void 0?Be.defaultMaxListeners:t._maxListeners}Be.prototype.getMaxListeners=function(){return OE(this)};Be.prototype.emit=function(e){for(var n=[],i=1;i<arguments.length;i++)n.push(arguments[i]);var r=e==="error",s=this._events;if(s!==void 0)r=r&&s.error===void 0;else if(!r)return!1;if(r){var o;if(n.length>0&&(o=n[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")Sx(l,this,n);else for(var d=l.length,u=FE(l,d),i=0;i<d;++i)Sx(u[i],this,n);return!0};function DE(t,e,n,i){var r,s,o;if(mh(n),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),o=s[e]),o===void 0)o=s[e]=n,++t._eventsCount;else if(typeof o=="function"?o=s[e]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),r=OE(t),r>0&&o.length>r&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,ZU(a)}return t}Be.prototype.addListener=function(e,n){return DE(this,e,n,!1)};Be.prototype.on=Be.prototype.addListener;Be.prototype.prependListener=function(e,n){return DE(this,e,n,!0)};function e5(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function LE(t,e,n){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=e5.bind(i);return r.listener=n,i.wrapFn=r,r}Be.prototype.once=function(e,n){return mh(n),this.on(e,LE(this,e,n)),this};Be.prototype.prependOnceListener=function(e,n){return mh(n),this.prependListener(e,LE(this,e,n)),this};Be.prototype.removeListener=function(e,n){var i,r,s,o,a;if(mh(n),r=this._events,r===void 0)return this;if(i=r[e],i===void 0)return this;if(i===n||i.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit
595("removeListener",e,i.listener||n));else if(typeof i!="function"){for(s=-1,o=i.length-1;o>=0;o--)if(i[o]===n||i[o].listener===n){a=i[o].listener,s=o;break}if(s<0)return this;s===0?i.shift():t5(i,s),i.length===1&&(r[e]=i[0]),r.removeListener!==void 0&&this.emit("removeListener",e,a||n)}return this};Be.prototype.off=Be.prototype.removeListener;Be.prototype.removeAllListeners=function(e){var n,i,r;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var s=Object.keys(i),o;for(r=0;r<s.length;++r)o=s[r],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=i[e],typeof n=="function")this.removeListener(e,n);else if(n!==void 0)for(r=n.length-1;r>=0;r--)this.removeListener(e,n[r]);return this};function ME(t,e,n){var i=t._events;if(i===void 0)return[];var r=i[e];return r===void 0?[]:typeof r=="function"?n?[r.listener||r]:[r]:n?n5(r):FE(r,r.length)}Be.prototype.listeners=function(e){return ME(this,e,!0)};Be.prototype.rawListeners=function(e){return ME(this,e,!1)};Be.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):UE.call(t,e)};Be.prototype.listenerCount=UE;function UE(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}Be.prototype.eventNames=function(){return this._eventsCount>0?Od(this._events):[]};function FE(t,e){for(var n=new Array(e),i=0;i<e;++i)n[i]=t[i];return n}function t5(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function n5(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}function i5(t,e){return new Promise(function(n,i){function r(o){t.removeListener(e,s),i(o)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",r),n([].slice.call(arguments))}VE(t,e,s,{once:!0}),e!=="error"&&r5(t,r,{once:!0})})}function r5(t,e,n){typeof t.on=="function"&&VE(t,"error",e,n)}function VE(t,e,n,i){if(typeof t.on=="function")i.once?t.once(e,n):t.on(e,n);else if(typeof t.addEventListener=="function")t.addEventListener(e,function r(s){i.once&&t.removeEventListener(e,r),n(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var zE=Bv.exports,ys,It,jt,Tu;function kr(){}function Fe(){Fe.init.call(this)}function BE(t){return t._maxListeners===void 0?Fe.defaultMaxListeners:t._maxListeners}function s5(t,e,n){if(e)t.call(n);else for(var i=t.length,r=yl(t,i),s=0;s<i;++s)r[s].call(n)}function o5(t,e,n,i){if(e)t.call(n,i);else for(var r=t.length,s=yl(t,r),o=0;o<r;++o)s[o].call(n,i)}function a5(t,e,n,i,r){if(e)t.call(n,i,r);else for(var s=t.length,o=yl(t,s),a=0;a<s;++a)o[a].call(n,i,r)}function c5(t,e,n,i,r,s){if(e)t.call(n,i,r,s);else for(var o=t.length,a=yl(t,o),l=0;l<o;++l)a[l].call(n,i,r,s)}function l5(t,e,n,i){if(e)t.apply(n,i);else for(var r=t.length,s=yl(t,r),o=0;o<r;++o)s[o].apply(n,i)}function Cx(t,e,n,i){var r,s,o,a;if(typeof n!="function")throw new TypeError('"listener" argument must be a function');if((s=t._events)?(s.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),o=s[e]):(s=t._events=new kr,t._eventsCount=0),o){if(typeof o=="function"?o=s[e]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),!o.warned&&(r=BE(t))&&r>0&&o.length>r){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=o.length,a=l,typeof console.warn=="function"?console.warn(a):console.log(a)}}else o=s[e]=n,++t._eventsCount;return t}function Tx(t,e,n){var i=!1;function r(){t.removeListener(e,r),i||(i=!0,n.apply(t,arguments))}return r.listener=n,r}function _x(t){var e=this._events;if(e){var n=e[t];if(typeof n=="function")return 1;if(n)return n.length}return 0}function yl(t,e){for(var n=new Array(e);e--;)n[e]=t[e];return n}kr.prototype=Object.create(null),Fe.EventEmitter=Fe,Fe.usingDomains=!1,Fe.prototype.domain=void 0,Fe.prototype._events=void 0,Fe.prototype._maxListeners=void 0,Fe.defaultMaxListeners=10,Fe.init=function(){this.domain=null,Fe.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new kr,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Fe.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},Fe.prototype.getMaxListeners=function(){return BE(this)},Fe.prototype.emit=function(t){var e,n,i,r,s,o,a,l=t==="error";if(o=this._events)l=l&&o.error==null;else if(!l)return!1;if(a=this.domain,l){if(e=arguments[1],!a){if(e instanceof Error)throw e;var d=new Error('Uncaught, unspecified "error" event. ('+e+")");throw d.context=e,d}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=a,e.domainThrown=!1,a.emit("error",e),!1}if(!(n=o[t]))return!1;var u=typeof n=="function";switch(i=arguments.length){case 1:s5(n,u,this);break;case 2:o5(n,u,this,arguments[1]);break;case 3:a5(n,u,this,arguments[1],arguments[2]);break;case 4:c5(n,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(r=new Array(i-1),s=1;s<i;s++)r[s-1]=arguments[s];l5(n,u,this,r)}return!0},Fe.prototype.addListener=function(t,e){return Cx(this,t,e,!1)},Fe.prototype.on=Fe.prototype.addListener,Fe.prototype.prependListener=function(t,e){return Cx(this,t,e,!0)},Fe.prototype.once=function(t,e){if(typeof e!="function")throw new TypeError('"listener" argument must be a function');return this.on(t,Tx(this,t,e)),this},Fe.prototype.prependOnceListener=function(t,e){if(typeof e!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(t,Tx(this,t,e)),this},Fe.prototype.removeListener=function(t,e){var n,i,r,s,o;if(typeof e!="function")throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(n=i[t]))return this;if(n===e||n.listener&&n.listener===e)--this._eventsCount==0?this._events=new kr:(delete i[t],i.removeListener&&this.emit
595("removeListener",t,n.listener||e));else if(typeof n!="function"){for(r=-1,s=n.length;s-- >0;)if(n[s]===e||n[s].listener&&n[s].listener===e){o=n[s].listener,r=s;break}if(r<0)return this;if(n.length===1){if(n[0]=void 0,--this._eventsCount==0)return this._events=new kr,this;delete i[t]}else(function(a,l){for(var d=l,u=d+1,h=a.length;u<h;d+=1,u+=1)a[d]=a[u];a.pop()})(n,r);i.removeListener&&this.emit("removeListener",t,o||e)}return this},Fe.prototype.off=function(t,e){return this.removeListener(t,e)},Fe.prototype.removeAllListeners=function(t){var e,n;if(!(n=this._events))return this;if(!n.removeListener)return arguments.length===0?(this._events=new kr,this._eventsCount=0):n[t]&&(--this._eventsCount==0?this._events=new kr:delete n[t]),this;if(arguments.length===0){for(var i,r=Object.keys(n),s=0;s<r.length;++s)(i=r[s])!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=new kr,this._eventsCount=0,this}if(typeof(e=n[t])=="function")this.removeListener(t,e);else if(e)do this.removeListener(t,e[e.length-1]);while(e[0]);return this},Fe.prototype.listeners=function(t){var e,n=this._events;return n&&(e=n[t])?typeof e=="function"?[e.listener||e]:function(i){for(var r=new Array(i.length),s=0;s<r.length;++s)r[s]=i[s].listener||i[s];return r}(e):[]},Fe.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):_x.call(t,e)},Fe.prototype.listenerCount=_x,Fe.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};class d5 extends Fe{}(function(t){t.Issue="issue",t.NetworkScoresUpdated="network-scores-updated",t.StatsParsingFinished="stats-parsing-finished"})(ys||(ys={})),function(t){t.Network="network",t.CPU="cpu",t.Server="server",t.Stream="stream"}(It||(It={})),function(t){t.OutboundNetworkQuality="outbound-network-quality",t.InboundNetworkQuality="inbound-network-quality",t.OutboundNetworkMediaLatency="outbound-network-media-latency",t.InboundNetworkMediaLatency="inbound-network-media-latency",t.NetworkMediaSyncFailure="network-media-sync-failure",t.OutboundNetworkThroughput="outbound-network-throughput",t.InboundNetworkThroughput="inbound-network-throughput",t.EncoderCPUThrottling="encoder-cpu-throttling",t.DecoderCPUThrottling="decoder-cpu-throttling",t.ServerIssue="server-issue",t.UnknownVideoDecoderIssue="unknown-video-decoder",t.LowInboundMOS="low-inbound-mean-opinion-score",t.LowOutboundMOS="low-outbound-mean-opinion-score",t.FrozenVideoTrack="frozen-video-track",t.MissingVideoStreamData="missing-video-stream-data",t.MissingAudioStreamData="missing-audio-stream-data"}(jt||(jt={})),function(t){t[t.BAD=2.1]="BAD",t[t.POOR=2.6]="POOR",t[t.FAIR=3.1]="FAIR",t[t.GOOD=3.8]="GOOD",t[t.EXCELLENT=4.3]="EXCELLENT"}(Tu||(Tu={}));const Io=class Io extends Fe{constructor(n){super();nt(this,"isStopped",!1);nt(this,"reportTimer");nt(this,"getStatsInterval");nt(this,"compositeStatsParser");this.compositeStatsParser=n.compositeStatsParser,this.getStatsInterval=n.getStatsInterval??1e4}get isRunning(){return!!this.reportTimer&&!this.isStopped}startReporting(){if(this.reportTimer)return;const n=()=>setTimeout(()=>{this.isStopped?this.reportTimer=void 0:this.parseReports().finally(()=>{this.reportTimer=n()})},this.getStatsInterval);this.isStopped=!1,this.reportTimer=n()}stopReporting(){this.isStopped=!0,this.reportTimer&&(clearTimeout(this.reportTimer),this.reportTimer=void 0)}async parseReports(){const n=Date.now(),i=await this.compositeStatsParser.parse(),r=Date.now()-n;this.emit(Io.STATS_REPORTS_PARSED,{timeTaken:r,reportItems:i}),i.forEach(s=>{this.emit(Io.STATS_REPORT_READY_EVENT,s)})}};nt(Io,"STATS_REPORT_READY_EVENT","stats-report-ready"),nt(Io,"STATS_REPORTS_PARSED","stats-reports-parsed");let gc=Io;const Wv=(()=>{const t=new Map;return e=>{const{taskId:n,delayMs:i,maxJitterMs:r,callback:s}=e,o=Math.ceil(Math.random()*(r||0)),a=t.get(n);a&&clearTimeout(a);const l=setTimeout(()=>{s(),t.delete(n)},i+o);t.set(n,l)}})();var Is;class u5{constructor(){ee(this,Is,{})}calculate(e){const{connection:{id:n}}=e,{mos:i,stats:r}=this.calculateOutboundScore(e)||{},{mos:s,stats:o}=this.calculateInboundScore(e)||{};return _(this,Is)[n]=e,Wv({taskId:n,delayMs:35e3,callback:()=>delete _(this,Is)[n]}),{outbound:i,inbound:s,connectionId:n,statsSamples:{inboundStatsSample:o,outboundStatsSample:r}}}calculateOutboundScore(e){var b,m,k,v;const n=[...((b=e.remote)==null?void 0:b.audio.inbound)||[],...((m=e.remote)==null?void 0:m.video.inbound)||[]];if(!n.length)return;const i=_(this,Is)[e.connection.id];if(!i)return;const r=[...((k=i.remote)==null?void 0:k.audio.inbound)||[],...((v=i.remote)==null?void 0:v.video.inbound)||[]],{packetsSent:s}=e.connection,o=i.connection.packetsSent,a=n.reduce((y,x)=>{const S=r.find(w=>w.ssrc===x.ssrc);return{sumJitter:y.sumJitter+x.jitter,packetsLost:y.packetsLost+x.packetsLost,lastPacketsLost:y.lastPacketsLost+((S==null?void 0:S.packetsLost)||0)}},{sumJitter:0,packetsLost:0,lastPacketsLost:0}),l=1e3*e.connection.currentRoundTripTime||0,{sumJitter:d}=a,u=d/n.length,h=s-o,p=a.packetsLost-a.lastPacketsLost,g=h&&p?Math.round(100*p/(h+p)):0;return{mos:this.calculateMOS({avgJitter:u,rtt:l,packetsLoss:g}),stats:{avgJitter:u,rtt:l,packetsLoss:g}}}calculateInboundScore(e){var b,m,k,v;const n=[...(b=e.audio)==null?void 0:b.inbound,...(m=e.video)==null?void 0:m.inbound];if(!n.length)return;const i=_(this,Is)[e.connection.id];if(!i)return;const r=[...(k=i.video)==null?void 0:k.inbound,...(v=i.audio)==null?void 0:v.inbound],{packetsReceived:s}=e.connection,o=i.connection.packetsReceived,a=n.reduce((y,x)=>{const S=r.find(w=>w.ssrc===x.ssrc);return{sumJitter:y.sumJitter+x.jitter,packetsLost:y.packetsLost+x.packetsLost,lastPacketsLost:y.lastPacketsLost+((S==null?void 0:S.packetsLost)||0)}},{sumJitter:0,packetsLost:0,lastPacketsLost:0}),l=1e3*e.connection.currentRoundTripTime||0,{sumJitter:d}=a,u=d/n.length,h=s-o,p=a.packetsLost-a.lastPacketsLost,g=h&&p?Math.round(100*p/(h+p)):0;return{mos:this.calculateMOS({avgJitter:u,rtt:l,packetsLoss:g}),stats:{avgJitter:u,rtt:l,packetsLoss:g}}}calculateMOS({avgJitter:e,rtt:n,packetsLoss:i}){const r=n+2*e+10;let s=r<160?93.2-r/40:93.2-r/120-10;
595return s-=2.5*i,1+.035*s+7e-6*s*(s-60)*(100-s)}}Is=new WeakMap;var zi,Gc,Qc;class cr{constructor(e={}){ee(this,zi,new Map);ee(this,Gc);ee(this,Qc);q(this,Gc,e.statsCleanupTtlMs??35e3),q(this,Qc,e.maxParsedStatsStorageSize??5)}detect(e,n){const i={...e,networkScores:{...n,statsSamples:(n==null?void 0:n.statsSamples)||{}}},r=this.performDetection(i);return this.setLastProcessedStats(e.connection.id,i),this.performPrevStatsCleanup({connectionId:e.connection.id}),r}performPrevStatsCleanup(e){const{connectionId:n,cleanupCallback:i}=e;_(this,zi).has(n)&&Wv({taskId:n,delayMs:_(this,Gc),callback:()=>{this.deleteLastProcessedStats(n),typeof i=="function"&&i()}})}setLastProcessedStats(e,n){if(!e||n.connection.id!==e)return;const i=_(this,zi).get(e)??[];i.push(n),i.length>_(this,Qc)&&i.shift(),_(this,zi).set(e,i)}getLastProcessedStats(e){const n=_(this,zi).get(e);return n==null?void 0:n[n.length-1]}getAllLastProcessedStats(e){return _(this,zi).get(e)??[]}deleteLastProcessedStats(e){_(this,zi).delete(e)}}zi=new WeakMap,Gc=new WeakMap,Qc=new WeakMap;var Jc;class h5 extends cr{constructor(n={}){super(n);ee(this,Jc);q(this,Jc,n.availableOutgoingBitrateThreshold??1e5)}performDetection(n){const i=[],{availableOutgoingBitrate:r}=n.connection;if(r===void 0)return i;const s=n.audio.outbound.reduce((l,d)=>l+d.targetBitrate,0),o=n.video.outbound.reduce((l,d)=>l+d.bitrate,0);if(!s&&!o)return i;const a={availableOutgoingBitrate:r,videoStreamsTotalBitrate:o,audioStreamsTotalTargetBitrate:s};return(s>r||o>0&&r<_(this,Jc))&&i.push({statsSample:a,type:It.Network,reason:jt.OutboundNetworkThroughput}),i}}Jc=new WeakMap;var Yc,Xc,Zc,el;class f5 extends cr{constructor(n={}){super();ee(this,Yc);ee(this,Xc);ee(this,Zc);ee(this,el);q(this,Yc,n.highPacketLossThresholdPct??5),q(this,Xc,n.highJitterThreshold??200),q(this,Zc,n.highJitterBufferDelayThresholdMs??500),q(this,el,n.highRttThresholdMs??250)}performDetection(n){return this.processData(n)}processData(n){var I,L,j,Z;const i=[],r=[...(I=n.audio)==null?void 0:I.inbound,...(L=n.video)==null?void 0:L.inbound];if(!r.length)return i;const s=this.getLastProcessedStats(n.connection.id);if(!s)return i;const o=[...(j=s.video)==null?void 0:j.inbound,...(Z=s.audio)==null?void 0:Z.inbound],{packetsReceived:a}=n.connection,l=s.connection.packetsReceived,d=r.reduce((F,te)=>{const Y=o.find(de=>de.ssrc===te.ssrc),K=(Y==null?void 0:Y.jitterBufferDelay)||0,A=(Y==null?void 0:Y.jitterBufferEmittedCount)||0,U=te.jitterBufferDelay-K,Q=te.jitterBufferEmittedCount-A,se=U&&Q?1e3*U/Q:0;return{sumJitter:F.sumJitter+te.jitter,sumJitterBufferDelayMs:F.sumJitterBufferDelayMs+se,packetsLost:F.packetsLost+te.packetsLost,lastPacketsLost:F.lastPacketsLost+((Y==null?void 0:Y.packetsLost)||0)}},{sumJitter:0,sumJitterBufferDelayMs:0,packetsLost:0,lastPacketsLost:0}),u=1e3*n.connection.currentRoundTripTime||0,{sumJitter:h,sumJitterBufferDelayMs:p}=d,g=h/r.length,b=p/r.length,m=a-l,k=d.packetsLost-d.lastPacketsLost,v=m&&k?Math.round(100*k/(m+k)):0,y=v>_(this,Yc),x=g>=_(this,Xc),S=u>=_(this,el),w=b>_(this,Zc),C=S&&!x&&!y,R=y&&x,P=x&&w,N={rtt:u,packetLossPct:v,avgJitter:g,avgJitterBufferDelay:b};return(x||y)&&i.push({statsSample:N,type:It.Network,reason:jt.InboundNetworkQuality,iceCandidate:n.connection.local.id}),C&&i.push({statsSample:N,type:It.Server,reason:jt.ServerIssue,iceCandidate:n.connection.remote.id}),R&&i.push({statsSample:N,type:It.Network,reason:jt.InboundNetworkMediaLatency,iceCandidate:n.connection.local.id}),P&&i.push({statsSample:N,type:It.Network,reason:jt.NetworkMediaSyncFailure,iceCandidate:n.connection.local.id}),i}}Yc=new WeakMap,Xc=new WeakMap,Zc=new WeakMap,el=new WeakMap;var tl;class p5 extends cr{constructor(n={}){super();ee(this,tl);q(this,tl,n.correctedSamplesThresholdPct??5)}performDetection(n){return this.processData(n)}processData(n){var o;const i=n.audio.inbound,r=[],s=(o=this.getLastProcessedStats(n.connection.id))==null?void 0:o.audio.inbound;return s&&i.forEach(a=>{const l=s.find(m=>m.ssrc===a.ssrc);if(!l)return;const d=a.track.insertedSamplesForDeceleration+a.track.removedSamplesForAcceleration,u=l.track.insertedSamplesForDeceleration+l.track.removedSamplesForAcceleration;if(d===u)return;const h=a.track.totalSamplesReceived-l.track.totalSamplesReceived,p=d-u,g=Math.round(100*p/h),b={correctedSamplesPct:g};g>_(this,tl)&&r.push({statsSample:b,type:It.Network,reason:jt.NetworkMediaSyncFailure,ssrc:a.ssrc})}),r}}tl=new WeakMap;var nl,il;class m5 extends cr{constructor(n={}){super();ee(this,nl);ee(this,il);q(this,nl,n.highPacketLossThresholdPct??5),q(this,il,n.highJitterThreshold??200)}performDetection(n){return this.processData(n)}processData(n){var S,w,C,R;const i=[],r=[...((S=n.remote)==null?void 0:S.audio.inbound)||[],...((w=n.remote)==null?void 0:w.video.inbound)||[]];if(!r.length)return i;const s=this.getLastProcessedStats(n.connection.id);if(!s)return i;const o=[...((C=s.remote)==null?void 0:C.audio.inbound)||[],...((R=s.remote)==null?void 0:R.video.inbound)||[]],{packetsSent:a}=n.connection,l=s.connection.packetsSent,d=r.reduce((P,N)=>{const I=o.find(L=>L.ssrc===N.ssrc);return{sumJitter:P.sumJitter+N.jitter,packetsLost:P.packetsLost+N.packetsLost,lastPacketsLost:P.lastPacketsLost+((I==null?void 0:I.packetsLost)||0)}},{sumJitter:0,packetsLost:0,lastPacketsLost:0}),u=1e3*n.connection.currentRoundTripTime||0,{sumJitter:h}
595=d,p=h/r.length,g=a-l,b=d.packetsLost-d.lastPacketsLost,m=g&&b?Math.round(100*b/(g+b)):0,k=m>_(this,nl),v=p>=_(this,il),y=!k&&v||v||k,x={rtt:u,avgJitter:p,packetLossPct:m};return k&&v&&i.push({statsSample:x,type:It.Network,reason:jt.OutboundNetworkMediaLatency,iceCandidate:n.connection.local.id}),y&&i.push({statsSample:x,type:It.Network,reason:jt.OutboundNetworkQuality,iceCandidate:n.connection.local.id}),i}}nl=new WeakMap,il=new WeakMap;class g5 extends cr{performDetection(e){return this.processData(e)}processData(e){var s;const n=e.video.outbound.filter(o=>o.qualityLimitationReason!=="none"),i=[],r=(s=this.getLastProcessedStats(e.connection.id))==null?void 0:s.video.outbound;return r&&n.forEach(o=>{const a=r.find(d=>d.ssrc===o.ssrc);if(!a)return;const l={qualityLimitationReason:o.qualityLimitationReason};o.framesSent>a.framesSent||(o.qualityLimitationReason==="cpu"&&i.push({statsSample:l,type:It.CPU,reason:jt.EncoderCPUThrottling,ssrc:o.ssrc}),o.qualityLimitationReason==="bandwidth"&&i.push({statsSample:l,type:It.Network,reason:jt.OutboundNetworkThroughput,ssrc:o.ssrc}))}),i}}var js;class v5 extends cr{constructor(){super(...arguments);nt(this,"UNKNOWN_DECODER","unknown");ee(this,js,{})}performDetection(n){return this.processData(n)}performPrevStatsCleanup(n){const{connectionId:i,cleanupCallback:r}=n;super.performPrevStatsCleanup({...n,cleanupCallback:()=>{delete _(this,js)[i],typeof r=="function"&&r()}})}processData(n){var o;const i=[],{id:r}=n.connection,s=(o=this.getLastProcessedStats(r))==null?void 0:o.video.inbound;return n.video.inbound.forEach(a=>{const{decoderImplementation:l,ssrc:d}=a;if(s==null?void 0:s.find(h=>h.ssrc===d))if(l===this.UNKNOWN_DECODER){if(!this.hadLastDecoderWithIssue(r,d)){this.setLastDecoderWithIssue(r,d,this.UNKNOWN_DECODER);const h={mimeType:a.mimeType,decoderImplementation:l};i.push({ssrc:d,statsSample:h,type:It.Stream,reason:jt.UnknownVideoDecoderIssue,trackIdentifier:a.track.trackIdentifier})}}else this.setLastDecoderWithIssue(r,d,void 0)}),i}setLastDecoderWithIssue(n,i,r){const s=_(this,js)[n]??{};r===void 0?delete s[i]:s[i]=r,_(this,js)[n]=s}hadLastDecoderWithIssue(n,i){const r=_(this,js)[n];return(r&&r[i])===this.UNKNOWN_DECODER}}js=new WeakMap;const WE=t=>t.reduce((e,n)=>e+n,0)/t.length,HE=(t,e,n=30)=>{var r,s,o,a,l;const i=[];for(let d=1;d<e.length-1;d+=1){const u=(s=(r=e[d])==null?void 0:r.video)==null?void 0:s.inbound.find(b=>b.ssrc===t);if(!u)continue;const h=(l=(a=(o=e[d-1])==null?void 0:o.video)==null?void 0:a.inbound)==null?void 0:l.find(b=>b.ssrc===t);if(!u||!h)continue;const p=u.timestamp-h.timestamp,g=u.framesDecoded-h.framesDecoded;if(g>0){const b=p/g;i.push(b)}}return i.length<=1?!1:(d=>{const u=((h,p)=>p.reduce((g,b)=>g+(b-h)**2,0)/p.length)(WE(d),d);return Math.sqrt(u)})(i)>n},$E=(t,e)=>{for(let n=1;n<e.length;n+=1){const i=e[n].video.inbound.find(a=>a.ssrc===t);if(!i)continue;const r=e[n-1].video.inbound.find(a=>a.ssrc===t),s=i.frameWidth!==(r==null?void 0:r.frameWidth),o=i.frameHeight!==(r==null?void 0:r.frameHeight);if(s||o)return!0}return!1};var rl,sl,ol;class y5 extends cr{constructor(n={}){super();ee(this,rl);ee(this,sl);ee(this,ol);q(this,rl,n.avgFreezeDurationThresholdMs??1e3),q(this,sl,n.frozenDurationThresholdPct??30),q(this,ol,n.minMosQuality??Tu.BAD)}performDetection(n){const i=n.networkScores.inbound;return i!==void 0&&i<=_(this,ol)?[]:this.processData(n)}processData(n){const i=[],r=this.getAllLastProcessedStats(n.connection.id);if(r.length===0)return[];const s=n.video.inbound.map(o=>{const a=r[r.length-1].video.inbound.find(p=>p.ssrc===o.ssrc);if(!a||$E(o.ssrc,[r[r.length-1],n])||HE(o.ssrc,r))return;const l=o.freezeCount-(a.freezeCount??0),d=1e3*(o.totalFreezesDuration-(a.totalFreezesDuration??0)),u=l>0?d/l:0,h=d/(o.timestamp-a.timestamp)*100;return h>_(this,sl)||u>_(this,rl)?{ssrc:o.ssrc,avgFreezeDurationMs:u,frozenDurationPct:h}:void 0}).filter(o=>o!==void 0);return s.length>0&&(i.push({type:It.Stream,reason:jt.FrozenVideoTrack,statsSample:{ssrcs:s.map(o=>o.ssrc)}}),this.deleteLastProcessedStats(n.connection.id)),i}}rl=new WeakMap,sl=new WeakMap,ol=new WeakMap;var al,cl,ll;class b5 extends cr{constructor(n={}){super(n);ee(this,al);ee(this,cl);ee(this,ll);
595q(this,al,n.volatilityThreshold??8),q(this,cl,n.affectedStreamsPercentThreshold??30),q(this,ll,n.minMosQuality??Tu.BAD)}performDetection(n){return[...this.getAllLastProcessedStats(n.connection.id),n].find(i=>i.networkScores.inbound!==void 0&&i.networkScores.inbound<=_(this,ll))?[]:this.processData(n)}processData(n){const i=[],r=[...this.getAllLastProcessedStats(n.connection.id),n],s=n.video.inbound.map(a=>{if(r.length<5||$E(a.ssrc,r))return;const l=[];for(let u=0;u<r.length-1;u+=1){const h=r[u].video.inbound.find(p=>p.ssrc===a.ssrc);(h==null?void 0:h.framesPerSecond)!==void 0&&l.push(h.framesPerSecond)}if(l.length<5||HE(a.ssrc,r))return;const d=(u=>{if(u.length===0)throw new Error("Cannot calculate volatility for empty array");const h=WE(u);return u.reduce((p,g)=>p+Math.abs(g-h),0)/u.length*100/h})(l);return d>_(this,al)?{ssrc:a.ssrc,allFps:l,volatility:d}:void 0}).filter(a=>!!a);if(s.length===0)return i;const o=s.length/(n.video.inbound.length/100);return o>_(this,cl)&&(i.push({type:It.CPU,reason:jt.DecoderCPUThrottling,statsSample:{affectedStreamsPercent:o,throtthedStreams:s}}),this.deleteLastProcessedStats(n.connection.id)),i}}al=new WeakMap,cl=new WeakMap,ll=new WeakMap;const qE=t=>t.iceConnectionState==="closed"||t.connectionState==="closed",gr=(t,e,n)=>8*((i,r,s)=>{if(!r)return 0;const o=i[s],a=r[s];if(o==null||a==null)return 0;const l=Math.floor(i.timestamp)-Math.floor(r.timestamp);return l===0?0:(Number(o)-Number(a))/l*1e3})(t,e,n);class x5{constructor(e){nt(this,"connections",[]);nt(this,"statsParser");this.statsParser=e.statsParser}listConnections(){return[...this.connections]}addPeerConnection(e){this.connections.push({id:e.id??String(Date.now()+Math.random().toString(32)),pc:e.pc})}removePeerConnection(e){const n=this.connections.findIndex(({pc:i})=>i===e.pc);n>=0&&this.removeConnectionsByIndexes([n])}async parse(){const e=[],n=this.connections.map(async(i,r)=>{if(!qE(i.pc))return this.statsParser.parse(i);e.unshift(r)});return e.length&&this.removeConnectionsByIndexes(e),(await Promise.all(n)).filter(i=>i!==void 0)}removeConnectionsByIndexes(e){e.forEach(n=>{this.connections.splice(n,1)})}}class k5{constructor(e){nt(this,"prevStats",new Map);nt(this,"allowedReportTypes",new Set(["candidate-pair","inbound-rtp","outbound-rtp","remote-outbound-rtp","remote-inbound-rtp","track","transport"]));nt(this,"ignoreSSRCList");nt(this,"logger");this.ignoreSSRCList=e.ignoreSSRCList??[],this.logger=e.logger}get previouslyParsedStatsConnectionsIds(){return[...this.prevStats.keys()]}async parse(e){if(!qE(e.pc))return this.getConnectionStats(e);this.logger.debug("Skip stats parsing. Connection is closed.",{connection:e})}async getConnectionStats(e){const{pc:n,id:i}=e;try{const r=Date.now(),s=n.getReceivers().filter(d=>{var u;return(u=d.track)==null?void 0:u.enabled}),o=n.getSenders().filter(d=>{var u;return(u=d.track)==null?void 0:u.enabled}),a=await Promise.all(s.map(d=>d.getStats())),l=await Promise.all(o.map(d=>d.getStats()));return{id:i,stats:this.mapReportsStats([...a,...l],e),timeTaken:Date.now()-r}}catch(r){return void this.logger.error("Failed to get stats for PC",{id:i,pc:n,error:r})}}mapReportsStats(e,n){const i={audio:{inbound:[],outbound:[]},video:{inbound:[],outbound:[]},connection:{},remote:{video:{inbound:[],outbound:[]},audio:{inbound:[],outbound:[]}}};e.forEach(o=>{o.forEach(a=>{this.allowedReportTypes.has(a.type)&&this.updateMappedStatsWithReportItemData(a,i,o)})});const{id:r}=n,s=this.prevStats.get(r);return s&&this.propagateStatsWithRateValues(i,s.stats),this.prevStats.set(r,{stats:i,ts:Date.now()}),Wv({taskId:r,delayMs:35e3,callback:()=>this.prevStats.delete(r)}),i}updateMappedStatsWithReportItemData(e,n,i){const r=e.type;if(r==="candidate-pair"&&e.state==="succeeded"&&e.nominated)return void(n.connection=this.prepareConnectionStats(e,i));const s=this.getMediaType(e);if(!s)return;const o=e.ssrc;if(!o||!this.ignoreSSRCList.includes(o))if(r!=="outbound-rtp")if(r!=="inbound-rtp")r!=="remote-outbound-rtp"?r==="remote-inbound-rtp"&&(this.mapConnectionStatsIfNecessary(n,e,i),n.remote[s].inbound.push({...e})):n.remote[s].outbound.push({...e});else{const a=i.get(e.trackId)||i.get(e.mediaSourceId)||{};this.mapConnectionStatsIfNecessary(n,e,i);const l={...e,track:{...a}};n[s].inbound.push(l)}else{const a=i.get(e.trackId)||i.get(e.mediaSourceId)||{},l={...e,track:{...a}};n[s].outbound.push(l)}}getMediaType(e){const n=e.mediaType||e.kind;if(!["audio","video"].includes(n)){const{id:i}=e;return i?String(i).includes("Video")?"video":String(i).includes("Audio")?"audio":void 0:void 0}return n}
595propagateStatsWithRateValues(e,n){e.audio.inbound.forEach(i=>{const r=n.audio.inbound.find(({id:s})=>s===i.id);i.bitrate=gr(i,r,"bytesReceived"),i.packetRate=gr(i,r,"packetsReceived")}),e.audio.outbound.forEach(i=>{const r=n.audio.outbound.find(({id:s})=>s===i.id);i.bitrate=gr(i,r,"bytesSent"),i.packetRate=gr(i,r,"packetsSent")}),e.video.inbound.forEach(i=>{const r=n.video.inbound.find(({id:s})=>s===i.id);i.bitrate=gr(i,r,"bytesReceived"),i.packetRate=gr(i,r,"packetsReceived")}),e.video.outbound.forEach(i=>{const r=n.video.outbound.find(({id:s})=>s===i.id);i.bitrate=gr(i,r,"bytesSent"),i.packetRate=gr(i,r,"packetsSent")})}mapConnectionStatsIfNecessary(e,n,i){if(e.connection.id||!n.transportId)return;const r=i.get(n.transportId);if(r&&r.selectedCandidatePairId){const s=i.get(r.selectedCandidatePairId);e.connection=this.prepareConnectionStats(s,i)}}prepareConnectionStats(e,n){if(!e||!n)return{};const i={...e};if(i.remoteCandidateId){const r=n.get(i.remoteCandidateId);i.remote={...r}}if(i.localCandidateId){const r=n.get(i.localCandidateId);i.local={...r}}return i}}var Fr,ca,la;const Eu=class Eu extends cr{constructor(n={}){super();ee(this,Fr,new Map);ee(this,ca);ee(this,la);q(this,ca,n.timeoutMs??15e3),q(this,la,n.steps??3)}performDetection(n){return this.processData(n)}processData(n){const i=[],r=[...this.getAllLastProcessedStats(n.connection.id),n];if(r.length<_(this,la))return i;const s=r.slice(-_(this,la)),o=s.map(l=>l.video.inbound),a=s.map(l=>l.audio.inbound);return i.push(...this.detectMissingData(a,It.Stream,jt.MissingAudioStreamData)),i.push(...this.detectMissingData(o,It.Stream,jt.MissingVideoStreamData)),new Set(_(this,Fr).keys()).forEach(l=>{const d=_(this,Fr).get(l);d&&Date.now()-d>_(this,ca)&&this.removeMarkedIssue(l)}),i}detectMissingData(n,i,r){const s=[],o=n.pop(),a=Eu.mapStatsByTrackId(n);return o.forEach(l=>{const d=l.track.trackIdentifier,u=a.get(d);if(!Array.isArray(u)||u.length===0||l.track.detached||l.track.ended)return;if(!Eu.isAllBytesReceivedDidntChange(l.bytesReceived,u))return void this.removeMarkedIssue(d);if(!this.markIssue(d))return;const h={bytesReceived:l.bytesReceived};s.push({type:i,reason:r,statsSample:h,trackIdentifier:d})}),s}static mapStatsByTrackId(n){const i=new Map;return n.forEach(r=>{r.forEach(s=>{const o=i.get(s.track.trackIdentifier)||[];o.push(s),i.set(s.track.trackIdentifier,o)})}),i}static isAllBytesReceivedDidntChange(n,i){for(let r=0;r<i.length;r+=1)if(i[r].bytesReceived!==n)return!1;return!0}markIssue(n){const i=Date.now(),r=_(this,Fr).get(n);return(!r||i-r>_(this,ca))&&(_(this,Fr).set(n,i),!0)}removeMarkedIssue(n){_(this,Fr).delete(n)}};Fr=new WeakMap,ca=new WeakMap,la=new WeakMap;let Um=Eu;var mi;class S5{constructor(e){nt(this,"eventEmitter");ee(this,mi,!1);nt(this,"detectors",[]);nt(this,"networkScoresCalculator");nt(this,"statsReporter");nt(this,"compositeStatsParser");nt(this,"logger");nt(this,"autoAddPeerConnections");this.logger=e.logger??{debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},this.eventEmitter=e.issueEmitter??new d5,e.onIssues&&this.eventEmitter.on(ys.Issue,e.onIssues),e.onNetworkScoresUpdated&&this.eventEmitter.on(ys.NetworkScoresUpdated,e.onNetworkScoresUpdated),this.detectors=e.detectors??[new g5,new f5,new m5,new p5,new h5,new v5,new y5,new b5,new Um],this.networkScoresCalculator=e.networkScoresCalculator??new u5,this.compositeStatsParser=e.compositeStatsParser??new x5({statsParser:new k5({ignoreSSRCList:e.ignoreSSRCList,logger:this.logger})}),this.statsReporter=e.statsReporter??new gc({compositeStatsParser:this.compositeStatsParser,getStatsInterval:e.getStatsInterval??5e3}),window.wid=this,this.autoAddPeerConnections=e.autoAddPeerConnections??!0,this.autoAddPeerConnections&&this.wrapRTCPeerConnection(),this.statsReporter.on(gc.STATS_REPORT_READY_EVENT,n=>{const i=this.calculateNetworkScores(n.stats);this.detectIssues({data:n.stats},i)}),this.statsReporter.on(gc.STATS_REPORTS_PARSED,n=>{const i={timeTaken:n.timeTaken,ts:Date.now()};e.onStats&&e.onStats(n.reportItems),this.eventEmitter.emit(ys.StatsParsingFinished,i)})}watchNewPeerConnections(){if(!this.autoAddPeerConnections)throw new Error("Auto add peer connections was disabled in the constructor.");_(this,mi)?this.logger.warn("WebRTCIssueDetector is already started. Skip processing"):(this.logger.info("Start watching peer connections"),q(this,mi,!0),this.statsReporter.startReporting())}stopWatchingNewPeerConnections(){_(this,mi)?(this.logger.info("Stop watching peer connections"),q(this,mi,!1),this.statsReporter.stopReporting()):this.logger.warn("WebRTCIssueDetector is already stopped. Skip processing")}handleNewPeerConnection(e,n){_(this,mi)||!this.autoAddPeerConnections?(_(this,mi)||this.autoAddPeerConnections!==!1||(this.logger.info("Starting stats reporting for new peer connection"),q(this,mi,!0),this.statsReporter.startReporting()),this.logger.debug("Handling new peer connection",e),this.compositeStatsParser.addPeerConnection({pc:e,id:n})):this.logger.debug("Skip handling new peer connection. Detector is not running",e)}emitIssues(e){this.eventEmitter.emit(ys.Issue,e)}detectIssues({data:e},n){const i=this.detectors.reduce((r,s)=>[...r,...s.detect(e,n)],[]);i.length>0&&this.emitIssues(i)}calculateNetworkScores(e){const n=this.networkScoresCalculator.calculate(e);return this.eventEmitter.emit(ys.NetworkScoresUpdated,n),n}wrapRTCPeerConnection(){if(!window.RTCPeerConnection)return void this.logger.warn("No RTCPeerConnection found in browser window. Skipping");const e=window.RTCPeerConnection,n=r=>this.handleNewPeerConnection(r);function i(r){const s=new e(r);return n(s),s}i.prototype=e.prototype,window.RTCPeerConnection=i}}mi=new WeakMap;function Vt(t,e,n,i){function r(s){return s instanceof n?s:new n(function(o){o(s)})}
595return new(n||(n=Promise))(function(s,o){function a(u){try{d(i.next(u))}catch(h){o(h)}}function l(u){try{d(i.throw(u))}catch(h){o(h)}}function d(u){u.done?s(u.value):r(u.value).then(a,l)}d((i=i.apply(t,e||[])).next())})}var Qi;(function(t){t.SESSION_STATE_CHANGED="session.state_changed",t.SESSION_STREAM_READY="session.stream_ready",t.SESSION_CONNECTION_QUALITY_CHANGED="session.connection_quality_changed",t.SESSION_DISCONNECTED="session.disconnected"})(Qi||(Qi={}));var Me;(function(t){t.SESSION_UPDATED="session.updated",t.SESSION_STATE_UPDATED="session.state_updated",t.USER_SPEAK_STARTED="user.speak_started",t.USER_SPEAK_ENDED="user.speak_ended",t.USER_TRANSCRIPTION="user.transcription",t.USER_TRANSCRIPTION_CHUNK="user.transcription.chunk",t.AVATAR_TRANSCRIPTION="avatar.transcription",t.AVATAR_TRANSCRIPTION_CHUNK="avatar.transcription.chunk",t.AVATAR_SPEAK_STARTED="avatar.speak_started",t.AVATAR_SPEAK_ENDED="avatar.speak_ended",t.ELEVENLABS_AGENT_EVENT="elevenlabs_agent_event",t.SESSION_STOPPED="session.stopped"})(Me||(Me={}));const w5=t=>{if("event_type"in t)switch(t.event_type){case Me.USER_SPEAK_STARTED:{const e={event_id:t.event_id,event_type:t.event_type,source_event_id:t.source_event_id,session_id:t.session_id};return[Me.USER_SPEAK_STARTED,e]}case Me.USER_SPEAK_ENDED:{const e={event_id:t.event_id,event_type:t.event_type,source_event_id:t.source_event_id,session_id:t.session_id};return[Me.USER_SPEAK_ENDED,e]}case Me.USER_TRANSCRIPTION:{const e={event_id:t.event_id,event_type:t.event_type,source_event_id:t.source_event_id,session_id:t.session_id,text:t.text};return[Me.USER_TRANSCRIPTION,e]}case Me.USER_TRANSCRIPTION_CHUNK:{const e={event_id:t.event_id,event_type:t.event_type,source_event_id:t.source_event_id,session_id:t.session_id,text:t.text};return[Me.USER_TRANSCRIPTION_CHUNK,e]}case Me.AVATAR_SPEAK_STARTED:{const e={event_id:t.event_id,event_type:t.event_type,source_event_id:t.source_event_id,session_id:t.session_id};return[Me.AVATAR_SPEAK_STARTED,e]}case Me.AVATAR_SPEAK_ENDED:{const e={event_id:t.event_id,event_type:t.event_type,source_event_id:t.source_event_id,session_id:t.session_id};return[Me.AVATAR_SPEAK_ENDED,e]}case Me.AVATAR_TRANSCRIPTION:{const e={event_id:t.event_id,event_type:t.event_type,source_event_id:t.source_event_id,session_id:t.session_id,text:t.text};return[Me.AVATAR_TRANSCRIPTION,e]}case Me.AVATAR_TRANSCRIPTION_CHUNK:{const e={event_id:t.event_id,event_type:t.event_type,source_event_id:t.source_event_id,session_id:t.session_id,text:t.text};return[Me.AVATAR_TRANSCRIPTION_CHUNK,e]}case Me.ELEVENLABS_AGENT_EVENT:{const e={event_id:t.event_id,event_type:t.event_type,source_event_id:t.source_event_id,session_id:t.session_id,elevenlabs_event_type:t.elevenlabs_event_type,data:t.data};return[Me.ELEVENLABS_AGENT_EVENT,e]}case Me.SESSION_STOPPED:{const e={event_id:t.event_id,event_type:t.event_type,source_event_id:t.source_event_id,session_id:t.session_id,stop_reason:t.stop_reason};return[Me.SESSION_STOPPED,e]}default:return console.warn("Received event type:",t==null?void 0:t.event_type),console.warn("New unsupported event type"),null}return null};var Xt;(function(t){t.SESSION_UPDATE="session.update",t.SESSION_STOP="session.stop",t.AVATAR_INTERRUPT="avatar.interrupt",t.AVATAR_SPEAK_TEXT="avatar.speak_text",t.AVATAR_SPEAK_RESPONSE="avatar.speak_response",t.AVATAR_SPEAK_AUDIO="avatar.speak_audio",t.AVATAR_START_LISTENING="avatar.start_listening",t.AVATAR_STOP_LISTENING="avatar.stop_listening",t.ELEVENLABS_AGENT_COMMAND="elevenlabs_agent_command"})(Xt||(Xt={}));var Ex;(function(t){t.USER_MESSAGE="user_message",t.CONTEXTUAL_UPDATE="contextual_update",t.USER_ACTIVITY="user_activity",t.CLIENT_TOOL_RESULT="client_tool_result"})(Ex||(Ex={}));var Rr;(function(t){t.FULL="FULL",t.LITE="LITE"})(Rr||(Rr={}));var Li;(function(t){t.FULL="FULL",t.OPENAI_REALTIME="OPENAI_REALTIME",t.ELEVENLABS_AGENT="ELEVENLABS_AGENT",t.GEMINI_REALTIME="GEMINI_REALTIME",t.UNKNOWN="UNKNOWN"})(Li||(Li={}));var Pn;(function(t){t.INACTIVE="INACTIVE",t.CONNECTING="CONNECTING",t.CONNECTED="CONNECTED",t.DISCONNECTING="DISCONNECTING",t.DISCONNECTED="DISCONNECTED"})(Pn||(Pn={}));var bs;(function(t){t.UNKNOWN_REASON="UNKNOWN_REASON",t.CLIENT_INITIATED="CLIENT_INITIATED",t.SESSION_START_FAILED="SESSION_START_FAILED",t.SERVER_INITIATED="SERVER_INITIATED"})(bs||(bs={}));var Px;(function(t){t.af="af",t.sq="sq",t.am="am",t.ar="ar",t.hy="hy",t.as="as",t.ast="ast",t.az="az",t.ba="ba",t.eu="eu",t.be="be",t.bn="bn",t.bs="bs",t.br="br",t.bg="bg",t.my="my",t.ca="ca",t.ceb="ceb",t.zh="zh",t.hr="hr",t.cs="cs",t.da="da",t.nl="nl",t.en="en",t.et="et",t.fo="fo",t.f
595i="fi",t.fr="fr",t.fy="fy",t.ff="ff",t.gd="gd",t.gl="gl",t.lg="lg",t.ka="ka",t.de="de",t.el="el",t.gu="gu",t.ht="ht",t.ha="ha",t.haw="haw",t.he="he",t.hi="hi",t.hu="hu",t.is="is",t.ig="ig",t.ilo="ilo",t.id="id",t.ga="ga",t.it="it",t.ja="ja",t.jv="jv",t.kn="kn",t.kk="kk",t.km="km",t.ko="ko",t.lo="lo",t.la="la",t.lv="lv",t.lb="lb",t.ln="ln",t.lt="lt",t.mk="mk",t.mg="mg",t.ms="ms",t.ml="ml",t.mt="mt",t.mi="mi",t.mr="mr",t.mo="mo",t.mn="mn",t.ne="ne",t.no="no",t.nn="nn",t.oc="oc",t.or="or",t.pa="pa",t.ps="ps",t.fa="fa",t.pl="pl",t.pt="pt",t.ro="ro",t.ru="ru",t.sa="sa",t.sr="sr",t.sn="sn",t.sd="sd",t.si="si",t.sk="sk",t.sl="sl",t.so="so",t.es="es",t.su="su",t.sw="sw",t.ss="ss",t.sv="sv",t.tl="tl",t.tg="tg",t.ta="ta",t.tt="tt",t.te="te",t.th="th",t.bo="bo",t.tn="tn",t.tr="tr",t.tk="tk",t.uk="uk",t.ur="ur",t.uz="uz",t.vi="vi",t.cy="cy",t.wo="wo",t.xh="xh",t.yi="yi",t.yo="yo",t.zu="zu"})(Px||(Px={}));var zt;(function(t){t.UNKNOWN="UNKNOWN",t.GOOD="GOOD",t.BAD="BAD"})(zt||(zt={}));class Hv{constructor(e){this._connectionQuality=zt.UNKNOWN,this.onConnectionQualityChanged=e}get connectionQuality(){return this._connectionQuality}handleStatsChanged(){const e=this.calculateConnectionQuality();e!==this._connectionQuality&&(this._connectionQuality=e,this.onConnectionQualityChanged(e))}start(e){this.stop(!0),this._start(e)}stop(e=!1){this._stop(),this._connectionQuality=zt.UNKNOWN,e||this.onConnectionQualityChanged(zt.UNKNOWN)}}function C5(...t){class e extends Hv{constructor(i){super(i),this.childTrackers=t.map(({getParams:r,TrackerClass:s})=>({tracker:new s(()=>this.handleStatsChanged()),getParams:r}))}calculateConnectionQuality(){const i=this.childTrackers.map(({tracker:r})=>r.connectionQuality);return i.some(r=>r===zt.BAD)?zt.BAD:i.every(r=>r===zt.UNKNOWN)?zt.UNKNOWN:zt.GOOD}_start(i){this.childTrackers.forEach(({tracker:r,getParams:s})=>r.start(s(i)))}_stop(){this.childTrackers.forEach(({tracker:i})=>i.stop(!0))}}return e}class T5 extends Hv{constructor(){super(...arguments),this.room=null,this.liveKitConnectionQuality=Yn.Unknown,this.liveKitConnectionState=null,this.handleConnectionQualityChanged=e=>{this.liveKitConnectionQuality=e,this.handleStatsChanged()},this.handleConnectionStateChanged=e=>{this.liveKitConnectionState=e,this.handleStatsChanged()}}_start(e){this.room=e,this.room.localParticipant.on(J.ConnectionQualityChanged,this.handleConnectionQualityChanged),this.room.on(B.ConnectionStateChanged,this.handleConnectionStateChanged)}_stop(){this.room&&(this.room.localParticipant.off(J.ConnectionQualityChanged,this.handleConnectionQualityChanged),this.room.off(B.ConnectionStateChanged,this.handleConnectionStateChanged))}calculateConnectionQuality(){return[Yn.Lost,Yn.Poor].includes(this.liveKitConnectionQuality)||this.liveKitConnectionState&&[_e.Disconnected,_e.Reconnecting,_e.SignalReconnecting].includes(this.liveKitConnectionState)?zt.BAD:zt.GOOD}}class _5 extends Hv{constructor(){super(...arguments),this.issueDetector=null,this.mosScores=null}_start(e){this.issueDetector=new S5({autoAddPeerConnections:!1,getStatsInterval:3e3,onNetworkScoresUpdated:n=>{this.mosScores=n,this.handleStatsChanged()}}),this.issueDetector.handleNewPeerConnection(e)}_stop(){this.issueDetector&&(this.issueDetector.stopWatchingNewPeerConnections(),this.issueDetector=null),this.mosScores=null}calculateConnectionQuality(){return!this.mosScores||!this.mosScores.inbound&&!this.mosScores.outbound?zt.UNKNOWN:this.mosScores.inbound&&this.mosScores.inbound<3||this.mosScores.outbound&&this.mosScores.outbound<3?zt.BAD:zt.GOOD}}const E5=C5({TrackerClass:T5,getParams:t=>t},{TrackerClass:_5,getParams:t=>{var e;return((e=t.engine.pcManager)===null||e===void 0?void 0:e.subscriber)._pc}});var xs;(function(t){t.MUTED="MUTED",t.UNMUTED="UNMUTED",t.STATE_CHANGED="STATE_CHANGED"})(xs||(xs={}));var _u;(function(t){t.START="user.start_push_to_talk",t.STOP="user.stop_push_to_talk"})(_u||(_u={}));var No;(function(t){t.START_SUCCESS="user.push_to_talk_started",t.START_FAILED="user.push_to_talk_start_failed",t.STOP_SUCCESS="user.push_to_talk_stopped",t.STOP_FAILED="user.push_to_talk_stop_failed"})(No||(No={}));var Mi;(function(t){t.INACTIVE="INACTIVE",t.STARTING="STARTING",t.ACTIVE="ACTIVE"})(Mi||(Mi={}));var Fm;(function(t){t.CONVERSATIONAL="CONVERSATIONAL",t.PUSH_TO_TALK="PUSH_TO_TALK"})(Fm||(Fm={}));const KE="agent-control",GE="agent-response",Rx="https://api.liveavatar.com",Nx=(t,e,n)=>new Promise((i,r)=>{const s=(o,a,l,d)=>{if(d!==GE)return;let u=null;try{const h=new TextDecoder().decode(o);u=JSON.parse(h)}catch{return}if(u&&"event_type"in u){const h=u.event_type;(h===e||h===n)&&(t.removeListener(B.DataReceived,s),h===n?r():i())}};t.on(B.DataReceived,s)});class P5 extends zE.EventEmitter{constructor(e){super(),this._state=Mi.INACTIVE,this.track=null,this.mode=null,this.pushToTalkStarted=!1,this.room=e}get isConnected(){return this.room.state!==_e.Disconnected&&this.room.state!==_e.Connecting}setMode(e){if(this.mode){console.warn("Voice chat mode can only be set once");return}this.mode=e}get state(){return this._state}get isMuted(){var e,n;return(n=(e=this.track)===null||e===void 0?void 0:e.isMuted)!==null&&n!==void 0?n:!0}start(){return Vt(this,arguments,void 0,function*(e={}){if(!this.isConnected){console.warn("Voice chat can only be started when session is active");return}if(this._state!==Mi.INACTIVE){console.warn("Voice chat is already started");return}this.state=Mi.STARTING;const{defaultMuted:n,deviceId:i,mode:r}=e;r&&this.setMode(r);try{this.track=yield NE({echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,deviceId:i})}catch(s){throw this.state=Mi.INACTIVE,s}
595n?(yield this.track.mute(),this.emit(xs.MUTED)):this.emit(xs.UNMUTED),yield this.room.localParticipant.publishTrack(this.track),this.track.on($.Muted,()=>{this.emit(xs.MUTED)}),this.track.on($.Unmuted,()=>{this.emit(xs.UNMUTED)}),this.state=Mi.ACTIVE})}stop(){this.room.localParticipant.getTrackPublications().forEach(e=>{e.track&&e.track.kind===V.Kind.Audio&&e.track.stop()}),this.track&&(this.track.removeAllListeners(),this.track.stop(),this.track=null),this.state=Mi.INACTIVE}mute(){return Vt(this,void 0,void 0,function*(){this.assertActive("Voice chat can only be muted when active")&&this.track&&(yield this.track.mute())})}unmute(){return Vt(this,void 0,void 0,function*(){this.assertActive("Voice chat can only be unmuted when active")&&this.track&&(yield this.track.unmute())})}setDevice(e){return Vt(this,void 0,void 0,function*(){return this.assertActive("Voice chat device can only be set when active")&&this.track?this.track.setDeviceId(e):!1})}startPushToTalk(){return Vt(this,void 0,void 0,function*(){if(!this.assertActive("Push to talk can only be started when voice chat is active"))return;if(console.error("Session interactivity mode",this.mode),this.mode!==Fm.PUSH_TO_TALK){console.warn("Push to talk can only be started in push to talk mode");return}if(this.pushToTalkStarted){console.warn("Push to talk has already been started");return}this.pushToTalkStarted=!0;const e=Nx(this.room,No.START_SUCCESS,No.START_FAILED);this.sendPushToTalkCommand(_u.START);try{yield e,yield this.unmute()}catch(n){throw console.error("Failed to start push to talk",n),this.pushToTalkStarted=!1,n}})}stopPushToTalk(){return Vt(this,void 0,void 0,function*(){if(!this.pushToTalkStarted){console.warn("Push to talk has not been started");return}const e=Nx(this.room,No.STOP_SUCCESS,No.STOP_FAILED);this.sendPushToTalkCommand(_u.STOP);try{yield e,this.pushToTalkStarted=!1}catch(n){throw console.error("Failed to stop push to talk",n),n}})}sendPushToTalkCommand(e){const n=new TextEncoder().encode(JSON.stringify({event_type:e}));this.room.localParticipant.publishData(n,{reliable:!0,topic:KE})}set state(e){this._state!==e&&(this._state=e,this.emit(xs.STATE_CHANGED,e))}assertActive(e){return this.state!==Mi.ACTIVE?(console.warn(e??"Voice chat is not active"),!1):!0}}const R5=500,N5=1e3;class Xl extends Error{constructor(e,n,i){super(e),this.status=null,this.errorCode=n??R5,this.status=i??null}}class I5{constructor(e,n=Rx){this.sessionToken=e,this.apiUrl=n??Rx}request(e,n){return Vt(this,void 0,void 0,function*(){try{const i=yield fetch(`${this.apiUrl}${e}`,Object.assign(Object.assign({},n),{credentials:"include",headers:Object.assign({Authorization:`Bearer ${this.sessionToken}`,"Content-Type":"application/json"},n.headers)}));if(!i.ok){const s=yield i.json();throw new Xl(s.message||`API request failed with status ${i.status}`,s.code,i.status)}const r=yield i.json();if(r.code!==N5)throw new Xl(r.message||"API request failed");return r.data}catch(i){throw i instanceof Xl?i:new Xl("API request failed")}})}startSession(){return Vt(this,void 0,void 0,function*(){return yield this.request("/v1/sessions/start",{method:"POST"})})}stopSession(){return Vt(this,void 0,void 0,function*(){return yield this.request("/v1/sessions/stop",{method:"POST"})})}keepAlive(){return Vt(this,void 0,void 0,function*(){return yield this.request("/v1/sessions/keep-alive",{method:"POST"})})}}function j5(t){const i=t.length,r=[];if(i===0)return r;r.push(t.slice(0,19200));for(let s=19200;s<i;s+=48e3)r.push(t.slice(s,s+48e3));return r}const Ix="heygen",A5="liveavatar-agent-",O5=3e4;function QE(t){try{const e=t.split(".");if(e.length<2)return console.warn("[decodeSessionTokenPayload] Token does not look like a JWT (parts.length =",e.length,"). Raw token (first 40 chars):",t.slice(0,40)),null;const n=e[1];return JSON.parse(atob(n.replace(/-/g,"+").replace(/_/g,"/")))}catch(e){return console.warn("[decodeSessionTokenPayload] Failed to decode session token payload. Raw token (first 40 chars):",t.slice(0,40),"Error:",e),null}}function D5(t){var e;const n=QE(t),i=(e=n==null?void 0:n.start_session_data)===null||e===void 0?void 0:e.mode;return i===Rr.LITE?Rr.LITE:(i===Rr.FULL,Rr.FULL)}function L5(t){const e=QE(t);if(!e)return Li.UNKNOWN;const n=e.start_session_data;if(!n)return Li.UNKNOWN;if(typeof n.agent_type=="string"){const i=n.agent_type.toUpperCase();if(i in Li)return i}return n.elevenlabs_agent_config?Li.ELEVENLABS_AGENT:n.openai_realtime_config?Li.OPENAI_REALTIME:n.gemini_realtime_config?Li.GEMINI_REALTIME:Li.FULL}class M5 extends zE.EventEmitter{constructor(e,n){super(),this.connectionQualityIndicator=new E5(i=>
595this.emit(Qi.SESSION_CONNECTION_QUALITY_CHANGED,i)),this._sessionInfo=null,this._sessionEventSocket=null,this._state=Pn.INACTIVE,this._remoteAudioTrack=null,this._remoteVideoTrack=null,this._mode=D5(e),this._agentType=L5(e),this.config=n??{},this.sessionClient=new I5(e,this.config.apiUrl),this.room=new Sa({adaptiveStream:f4()?{pauseVideoInBackground:!1}:!1,dynacast:p4(),videoCaptureDefaults:{resolution:ka.h720.resolution}}),this._voiceChat=new P5(this.room),this.config.voiceChat&&typeof this.config.voiceChat=="object"&&this.config.voiceChat.mode&&this._voiceChat.setMode(this.config.voiceChat.mode)}get state(){return this._state}get mode(){return this._mode}get agentType(){return this._agentType}get sessionId(){var e,n;return(n=(e=this._sessionInfo)===null||e===void 0?void 0:e.session_id)!==null&&n!==void 0?n:null}get connectionQuality(){return this.connectionQualityIndicator.connectionQuality}get voiceChat(){return this._voiceChat}get maxSessionDuration(){var e,n;return(n=(e=this._sessionInfo)===null||e===void 0?void 0:e.max_session_duration)!==null&&n!==void 0?n:null}start(){return Vt(this,void 0,void 0,function*(){if(this.state!==Pn.INACTIVE){console.warn("Session is already started");return}try{this.state=Pn.CONNECTING,this._sessionInfo=yield this.sessionClient.startSession();const e=this._sessionInfo.livekit_url,n=this._sessionInfo.livekit_client_token,i=this._sessionInfo.ws_url;e&&n&&(this.trackEvents(),yield this.room.connect(e,n),yield this.waitForRequiredParticipants(),this.connectionQualityIndicator.start(this.room)),i&&(yield this.connectWebSocket(i),this.setupWebSocketManagement()),yield this.configureSession(),this.state=Pn.CONNECTED}catch(e){throw console.error("Session start failed:",e),this.cleanup(),this.postStop(bs.SESSION_START_FAILED),e}})}stop(){return Vt(this,void 0,void 0,function*(){this.assertConnected()&&(this.state=Pn.DISCONNECTING,this.cleanup(),this.postStop(bs.CLIENT_INITIATED))})}keepAlive(){return Vt(this,void 0,void 0,function*(){if(this.assertConnected())try{this.sessionClient.keepAlive()}catch(e){throw console.error("Session keep alive error on server:",e),e}})}attach(e){if(!this._remoteVideoTrack||!this._remoteAudioTrack){console.warn("Stream is not yet ready");return}this._remoteVideoTrack.attach(e),this._remoteAudioTrack.attach(e)}message(e){if(!this.assertConnected())throw new Error("Session needs to be connected to send command event");const n=this.generateEventId(),i={event_id:n,event_type:Xt.AVATAR_SPEAK_RESPONSE,text:e};return this.sendCommandEvent(i),n}repeat(e){if(!this.assertConnected())throw new Error("Session needs to be connected to send command event");const n=this.generateEventId(),i={event_id:n,event_type:Xt.AVATAR_SPEAK_TEXT,text:e};return console.warn("sending repeat command event",i),this.sendCommandEvent(i),n}repeatAudio(e){if(!this.assertConnected())throw new Error("Session needs to be connected to send command event");if(!this._sessionEventSocket)throw console.warn("Cannot repeat audio. Please check you're using a supported mode."),new Error("Session needs to be connected to send command event");const n=this.generateEventId(),i={event_id:n,event_type:Xt.AVATAR_SPEAK_AUDIO,audio:e};return this.sendCommandEvent(i),n}startListening(){if(!this.assertConnected())throw new Error("Session needs to be connected to send command event");const e=this.generateEventId(),n={event_id:e,event_type:Xt.AVATAR_START_LISTENING};return this.sendCommandEvent(n),e}stopListening(){if(!this.assertConnected())throw new Error("Session needs to be connected to send command event");const e=this.generateEventId(),n={event_type:Xt.AVATAR_STOP_LISTENING,event_id:e};return this.sendCommandEvent(n),e}interrupt(){if(!this.assertConnected())throw new Error("Session needs to be connected to send command event");const e={event_type:Xt.AVATAR_INTERRUPT};this.sendCommandEvent(e)}trackEvents(){const e=new MediaStream;this.room.on(B.TrackSubscribed,(n,i,r)=>{if(r.identity===Ix&&(n.kind==="video"||n.kind==="audio")){n.kind==="video"?this._remoteVideoTrack=n:this._remoteAudioTrack=n,e.addTrack(n.mediaStreamTrack);const s=e.getVideoTracks().length>0,o=e.getAudioTracks().length>0;
595s&&o&&this.emit(Qi.SESSION_STREAM_READY)}}),this.room.on(B.DataReceived,(n,i,r,s)=>{if(s!==GE)return;let o=null;try{const l=new TextDecoder().decode(n);o=JSON.parse(l)}catch(l){console.error(l)}if(!o)return;const a=w5(o);if(a){const[l,...d]=a;this.emit(l,...d)}}),this.on(Me.SESSION_STOPPED,n=>{console.warn("[SDK:SESSION_STOPPED] Server stopped session, reason:",n.stop_reason),this.cleanup(),this.postStop(bs.SERVER_INITIATED)}),this.room.on(B.ParticipantConnected,n=>{console.warn("participantConnected",n.identity)}),this.room.on(B.TrackUnsubscribed,n=>{console.warn("trackUnsubscribed",n);const i=n.mediaStreamTrack;i&&e.removeTrack(i)}),this.room.on(B.Disconnected,n=>{console.warn("Room disconnected, reason:",n),this.handleRoomDisconnect()}),this.room.on(B.TrackPublished,n=>{console.warn("trackPublished",n)})}waitForRequiredParticipants(){var e;if(this._mode!==Rr.FULL)return Promise.resolve();const n=(e=this._sessionInfo)===null||e===void 0?void 0:e.session_id;if(!n)return Promise.resolve();const i=`${A5}${n}`,r=new Set([Ix,i]);for(const s of this.room.remoteParticipants.values())r.delete(s.identity);return r.size===0?Promise.resolve():new Promise((s,o)=>{const a=u=>{r.delete(u.identity),r.size===0&&(d(),s())},l=setTimeout(()=>{d(),o(new Error(`Timed out waiting for required participants: ${Array.from(r).join(", ")}`))},O5),d=()=>{clearTimeout(l),this.room.off(B.ParticipantConnected,a)};this.room.on(B.ParticipantConnected,a)})}connectWebSocket(e){return Vt(this,void 0,void 0,function*(){return new Promise((n,i)=>{this._sessionEventSocket=new WebSocket(e),this._sessionEventSocket.onopen=()=>{n()}})})}setupWebSocketManagement(){this._sessionEventSocket&&(this._sessionEventSocket.onmessage=e=>{this.handleWebSocketMessage(e)},this._sessionEventSocket.onerror=e=>{console.error("WebSocket error:",e)},this._sessionEventSocket.onclose=e=>{console.warn("WebSocket closed - code:",e.code,"reason:",e.reason,"wasClean:",e.wasClean),this.handleWebSocketDisconnect()})}handleWebSocketMessage(e){let n=null;try{n=JSON.parse(e.data)}catch(s){console.error("Failed to parse WebSocket message:",s);return}if(!n)return;const{type:i,event_id:r}=n;i==="agent.speak_started"?this.emit(Me.AVATAR_SPEAK_STARTED,{event_type:Me.AVATAR_SPEAK_STARTED,event_id:r}):i==="agent.speak_ended"&&this.emit(Me.AVATAR_SPEAK_ENDED,{event_type:Me.AVATAR_SPEAK_ENDED,event_id:r})}handleWebSocketDisconnect(){this.state===Pn.DISCONNECTING||this.state===Pn.DISCONNECTED||(this._sessionEventSocket&&this._sessionEventSocket.readyState===WebSocket.OPEN&&this._sessionEventSocket.close(),this._sessionEventSocket=null,this.cleanup(),this.postStop(bs.UNKNOWN_REASON))}configureSession(){return Vt(this,void 0,void 0,function*(){if(this.config.voiceChat)try{yield this.voiceChat.start(typeof this.config.voiceChat=="boolean"?{}:this.config.voiceChat)}catch(e){console.warn("Failed to start voice chat (microphone may be unavailable):",e)}})}set state(e){this._state!==e&&(this._state=e,this.emit(Qi.SESSION_STATE_CHANGED,e))}cleanup(){return Vt(this,void 0,void 0,function*(){this.connectionQualityIndicator.stop(),this.voiceChat.stop(),this._remoteAudioTrack&&this._remoteAudioTrack.stop(),this._remoteVideoTrack&&this._remoteVideoTrack.stop(),this._remoteAudioTrack=null,this._remoteVideoTrack=null,this.room.localParticipant.removeAllListeners(),this.room.removeAllListeners(),this._sessionEventSocket&&(this._sessionEventSocket.onopen=null,this._sessionEventSocket.onmessage=null,this._sessionEventSocket.onerror=null,this._sessionEventSocket.onclose=null,(this._sessionEventSocket.readyState===WebSocket.OPEN||this._sessionEventSocket.readyState===WebSocket.CONNECTING)&&this._sessionEventSocket.close(),this._sessionEventSocket=null),this.room.state==="connected"&&this.room.disconnect(),yield this.sessionClient.stopSession()})}postStop(e){this.state=Pn.DISCONNECTED,this.emit(Qi.SESSION_DISCONNECTED,e)}handleRoomDisconnect(){this.cleanup(),this.postStop(bs.UNKNOWN_REASON)}sendCommandEvent(e){this._sessionEventSocket&&this._sessionEventSocket.readyState===WebSocket.OPEN?this.sendCommandEventToWebSocket(e):this.room.state==="connected"?this.publishAgentControl(e):console.warn("No active connection to send command event")}publishAgentControl(e){if(this.room.state!=="connected")throw new Error("LiveKit room not connected — cannot publish agent-control payload");const n=new TextEncoder().encode(JSON.stringify(e));this.room.localParticipant.publishData(n,{reliable:!0,topic:KE})}generateEventId(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)})}sendCommandEventToWebSocket(e){if(!this._sessionEventSocket||this._sessionEventSocket.readyState!==WebSocket.OPEN){console.warn("WebSocket not open to send command event");return}const n=e.event_type,i=this.generateEventId();let r=[];switch(n){case Xt.AVATAR_SPEAK_AUDIO:r=j5(e.audio);for(const s of r)this._sessionEventSocket.send(JSON.stringify({type:"agent.speak",event_id:i,audio:s}));this._sessionEventSocket.send(JSON.stringify({type:"agent.speak_end",event_id:i}));return;case Xt.AVATAR_SPEAK_TEXT:case Xt.AVATAR_SPEAK_RESPONSE:throw new Error("Not permitted in LITE mode");case Xt.AVATAR_INTERRUPT:this._sessionEventSocket.send(JSON.stringify({type:"agent.interrupt",event_id:i}));return;case Xt.AVATAR_START_LISTENING:this._sessionEventSocket.send(JSON.stringify({type:"agent.start_listening",event_id:i}));return;case Xt.AVATAR_STOP_LISTENING:this._sessionEventSocket.send(JSON.stringify({type:"agent.stop_listening",event_id:i}));return;default:console.warn("Unsupported command event type:",n);break}}assertConnected(){return this.state!==Pn.CONNECTED?(console.warn("Session is not connected"),!1):!0}}const U5=["What does b² actually do?","Can you automate my CRM by voice?","Book me a demo"];function F5(){const[t,e]=f.useState(!1),[n,i]=f.useState(!1),[r,s]=f.useState("idle"),[o,a]=f.useState(!1),[l,d]=f.useState(!1),[u,h]=f.useState(""),[p,g]=f.useState(""),b=f.useRef(null),m=f.useRef(null),k=f.useRef(!1),[v]=Pi();f.useEffect(()=>{fetch("/api/liveavatar/status").then(P=>P.json()).then(P=>i(!!P.configured)).catch(()=>i(!1))},[]);async function y(){var P;if(!m.current){s("connecting");try{const N=await fetch("/api/liveavatar/session",{method:"POST"});if(!N.ok)throw new Error(((P=await N.json().catch(()=>({})))==null?void 0:P.error)||"session failed");const{token:I}=await N.json(),L=new M5(I);m.current=L,L.on(Qi.SESSION_STREAM_READY,()=>{b.current&&L.attach(b.current),s("live")}),L.on(Qi.SESSION_STATE_CHANGED,j=>{j===Pn.DISCONNECTED&&x()}),L.on(Qi.SESSION_DISCONNECTED,()=>x()),L.on(Me.AVATAR_SPEAK_STARTED,()=>d(!0)),L.on(Me.AVATAR_SPEAK_ENDED,()=>d(!1)),L.on(Me.AVATAR_TRANSCRIPTION,j=>{var Z;return h(((Z=j==null?void 0:j.data)==null?void 0:Z.text)||(j==null?void 0:j.text)||"")}),await L.start()}catch(N){console.error("[Maia] session error:",N),s("error"),m.current=null}}}function x(){const P=m.current;m.current=null,a(!1),d(!1),h(""),s("idle"),P&&P.stop().catch(()=>{})}function S(){const P=m.current;if(!(!P||r!=="live"))try{o?(P.stopListening(),a(!1)):(P.startListening(),a(!0))}catch{}}function w(P){const N=m.current,I=P.trim();if(!(!N||r!=="live"||!I))try{N.message(I),g("")}catch{}}function C(){e(!0),y()}function R(){e(!1),x()}return f.useEffect(()=>()=>x(),[]),f.useEffect(()=>{const P=typeof window<"u"&&window.matchMedia("(min-width: 1024px)").matches;n&&P&&v==="/"&&!k.current&&(k.current=!0,C())},[n,v]),n?c.jsxs(c.Fragment,{children:[!t&&c.jsxs("button",{onClick:C,className:"fixed bottom-6 right-6 z-50 flex items-center gap-2 rounded-full bg-teal-500 px-5 py-3 font-semibold text-[#0b1220] shadow-2xl transition hover:bg-teal-400","data-testid":"maia-launcher",children:[c.jsx(Gi,{className:"h-5 w-5"}),"Talk to Maia"]}),t&&c.jsxs("div",{className:"fixed bottom-6 right-6 z-50 flex max-h-[calc(100dvh-1.5rem)] w-[92vw] max-w-[380px] flex-col overflow-hidden rounded-2xl border border-white/10 bg-[#0b1220] shadow-2xl",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-white/10 px-4 py-3",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold text-white",children:"Maia"}),c.jsx("div",{className:"text-xs text-teal-300",children:"b² Assistant"})]}),c.jsx("button",{onClick:R,className:"rounded-md p-1 text-slate-400 hover:bg-white/10 hover:text-white","aria-label":"Close",children:c.jsx(Si,{className:"h-5 w-5"})})]}),c.jsxs("div",{className:"relative aspect-video max-h-[38dvh] w-full shrink-0 bg-[#132743]",children:[c.jsx("video",{ref:b,autoPlay:!0,playsInl
595ine:!0,className:"h-full w-full object-cover"}),r!=="live"&&c.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-sm text-slate-300",children:[r==="connecting"&&"Connecting to Maia…",r==="error"&&"Maia is unavailable right now.",r==="idle"&&"…"]}),l&&c.jsx("div",{className:"absolute bottom-2 left-2 rounded-full bg-black/50 px-3 py-1 text-xs text-teal-300",children:"Maia is speaking…"}),c.jsxs("button",{onClick:S,disabled:r!=="live",className:`absolute bottom-2 right-2 flex items-center gap-1.5 rounded-full px-3 py-1.5 text-xs font-semibold shadow-lg transition disabled:opacity-40 ${o?"bg-red-500 text-white":"bg-teal-500 text-[#0b1220] hover:bg-teal-400"}`,children:[o?c.jsx(oA,{className:"h-4 w-4"}):c.jsx(mC,{className:"h-4 w-4"}),o?"Stop":"Speak"]})]}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[u&&c.jsx("div",{className:"border-b border-white/10 px-4 py-2 text-xs text-slate-300",children:u}),c.jsx("div",{className:"flex flex-wrap gap-2 px-4 pt-3",children:U5.map(P=>c.jsx("button",{onClick:()=>w(P),disabled:r!=="live",className:"rounded-full border border-white/15 px-3 py-1 text-xs text-slate-300 transition hover:border-teal-400 hover:text-white disabled:opacity-40",children:P},P))})]}),c.jsxs("form",{className:"flex shrink-0 items-center gap-2 p-4",onSubmit:P=>{P.preventDefault(),w(p)},children:[c.jsx("input",{value:p,onChange:P=>g(P.target.value),placeholder:"Ask Maia a question…",disabled:r!=="live",className:"flex-1 rounded-lg border border-white/15 bg-white/5 px-3 py-2 text-sm text-white placeholder:text-slate-500 focus:border-teal-400 focus:outline-none disabled:opacity-50"}),c.jsx("button",{type:"submit",disabled:r!=="live",className:"rounded-lg bg-teal-500 p-2 text-[#0b1220] transition hover:bg-teal-400 disabled:opacity-40","aria-label":"Send",children:c.jsx(Kg,{className:"h-4 w-4"})})]})]})]}):null}class V5 extends f.Component{constructor(n){super(n);nt(this,"handleRetry",()=>{this.setState({hasError:!1,error:null,errorInfo:null})});nt(this,"handleGoHome",()=>{window.location.href="/"});this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,i){this.setState({errorInfo:i}),console.error("ErrorBoundary caught an error:",n,i),typeof window<"u"&&window.Sentry&&window.Sentry.captureException(n,{extra:i})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:c.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-slate-50 to-slate-100 dark:from-slate-900 dark:to-slate-800 p-4",children:c.jsxs(Mc,{className:"max-w-lg w-full shadow-xl",children:[c.jsxs(Xu,{className:"text-center",children:[c.jsx("div",{className:"mx-auto w-16 h-16 bg-red-100 dark:bg-red-900/30 rounded-full flex items-center justify-center mb-4",children:c.jsx(xA,{className:"w-8 h-8 text-red-600 dark:text-red-400"})}),c.jsx(Zu,{className:"text-xl font-semibold text-slate-900 dark:text-slate-100",children:"Something went wrong"}),c.jsx(eh,{className:"text-slate-600 dark:text-slate-400",children:"We encountered an unexpected error. Our team has been notified and is working on a fix."})]}),c.jsx(Uc,{children:!1}),c.jsxs(zC,{className:"flex gap-3 justify-center",children:[c.jsxs(he,{variant:"outline",onClick:this.handleGoHome,className:"gap-2","data-testid":"error-boundary-home-button",children:[c.jsx(qg,{className:"w-4 h-4"}),"Go Home"]}),c.jsxs(he,{onClick:this.handleRetry,className:"gap-2","data-testid":"error-boundary-retry-button",children:[c.jsx(fA,{className:"w-4 h-4"}),"Try Again"]})]})]})}):this.props.children}}const le=()=>c.jsx("div",{className:"min-h-screen flex items-center justify-center",children:c.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"})}),jx=f.lazy(()=>T(()=>import("./home-CKVN_tXo.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Ax=f.lazy(()=>T(()=>import("./auth-BHLXvF8b.js"),__vite__mapDeps([8,9,10,11,12,13,14,2]))),z5=f.lazy(()=>T(()=>import("./admin-login-Da3iMUB2.js"),__vite__mapDeps([15,9,10,11,12,16,2]))),B5=f.lazy(()=>T(()=>import("./dashboard-CYWeCi0k.js"),__vite__mapDeps([17,18,19,20]))),Ox=f.lazy(()=>T(()=>import("./explore-Cn3r_Tnw.js"),__vite__mapDeps([21,22,2,5,23,24,25]))),W5=f.lazy(()=>T(()=>import("./platform-DrCCIpXb.js"),__vite__mapDeps([26,2,7]))),H5=f.lazy(()=>T(()=>import("./solutions-BIIUOenW.js"),[])),$5=f.lazy(()=>T(()=>import("./resources-CjU-bcjz.js"),__vite__mapDeps([27,28,2,29,5,30]))),q5=f.lazy(()=>T(()=>import("./about-CEi0TE0D.js"),__vite__mapDeps([31,22]))),K5=f.lazy(()=>T(()=>import("./contact-BtAUqP9N.js"),__vite__mapDeps([32,9,10,11,33,34,35,2,36,37]))),G5=f.lazy(()=>T(()=>import("./pricing-H5l_qabz.js"),__vite__mapDeps([38,2,39,40,5]))),Q5=f.lazy(()=>T(()=>import("./profile-DnG289kd.js"),__vite__mapDeps([41,42,43,44]))),J5=f.lazy(()=>T(()=>import("./billing-D8UqftRn.js"),__vite__mapDeps([45,7]))),Y5=f.lazy(()=>T(()=>import("./connect-tools-DJJRGJwq.js"),__vite__mapDeps([46,7,47,48]))),X5=f.lazy(()=>T(()=>import("./workspace-config-FakgVL2c.js"),__vite__mapDeps([49,50]))),Z5=f.lazy(()=>T(()=>import("./devices-DnYdvz0d.js"),__vite__mapDeps([51,52,53]))),eF=f.lazy(()=>T(()=>import("./get-gary-BaTxS6bL.js"),__vite__mapDeps([54,55,47,53,52]))),tF=f.lazy(()=>T(()=>import("./skills-CI9qGZg4.js"),__vite__mapDeps([56,50,57,58]))),nF=f.lazy(()=>T(()=>import("./approvals-DOAuxKC4.js"),__vite__mapDeps([59,3]))),iF=f.lazy(()=>T(()=>import("./not-found-DG_rTePy.js"),[])),rF=f.lazy(()=>T(()=>import("./boom-simple-BJnmj4aq.js"),__vite__mapDeps([60,61,62,63]))),sF=f.lazy(()=>T(()=>import("./boom-greeting-BYVz3SqL.js"),__vite__mapDeps([64,63]))),oF=f.lazy(()=>T(()=>import("./boom-control-B45at__D.js"),__vite__mapDeps([65,10,63,66,67,68,69,70]))),aF=f.lazy(()=>T(()=>import("./public-meeting-simple-DY4DBkjm.js"),__vite__mapDeps([71,10]))),cF=f.lazy(()=>T(()=>import("./WebPhonePage-CSWdujuK.js"),__vite__mapDeps([72,73,74,75,76,77,78,33,10,79,13,14,50,80,42,81]))),lF=f.lazy(()=>T(()=>import("./SimpleDialerPage-BLJwmwEL.js"),__vite__mapDeps([82,77,74,75]))),dF=f.lazy(()=>T(()=>import("./EnterpriseDialer-DdF4P6ye.js"),__vite__mapDeps([83,84,74,75]))),uF=f.lazy(()=>T(()=>import("./crm-connect-YJKHjUgf.js"),__vite__mapDeps([85,3,7,86,87]))),hF=f.lazy(()=>T(()=>import("./DialerNavigation-BISq98iX.js"),[])),fF=f.lazy(()=>T(()=>import("./CampaignManager-_oyfjsbB.js"),__vite__mapDeps([79,13,14,33,10,50,80]))),pF=f.lazy(()=>T(()=>import("./email-manager-Cdb7Ok11.js"),__vite__mapDeps([88,10,33,13,14]))),mF=f.lazy(()=>T(()=>import("./test-google-auth-BdgAhsRd.js"),__vite__mapDeps([89,63]))),gF=f.lazy(()=>T(()=>import("./ai-calling-test-Ig-70z7u.js"),__vite__mapDeps([90,10,33,81,7]))),vF=f.lazy(()=>T(()=>import("./resource-library-PylnVGjJ.js"),__vite__mapDeps([91,28,2]))),yF=f.lazy(()=>T(()=>import("./youtube-videos-BrcAcB83.js"),__vite__mapDeps([92,28,2]))),bF=f.lazy(()=>T(()=>import("./privacy-policy-CRba9w3u.js"),__vite__mapDeps([93,94,2]))),xF=f.lazy(()=>T(()=>import("./terms-of-service-A82YC7Ef.js"),__vite__mapDeps([95,94,2]))),kF=f.lazy(()=>T(()=>import("./ai-ethics-BGucWuaB.js"),__vite__mapDeps([96,94,2,30]))),SF=f.lazy(()=>T(()=>import("./acceptable-use-CtdP_niE.js"),__vite__mapDeps([97,94,2]))),wF=f.lazy(()=>T(()=>
595import("./data-processing-Bl8d2Gar.js"),__vite__mapDeps([98,94,2]))),CF=f.lazy(()=>T(()=>import("./maia-CJ-SH0sO.js"),__vite__mapDeps([99,28,2,5]))),TF=f.lazy(()=>T(()=>import("./vaii-D07VfSPt.js"),__vite__mapDeps([100,22,101]))),_F=f.lazy(()=>T(()=>import("./bhconnect-UX6_jeWm.js"),__vite__mapDeps([102,22,23,103]))),EF=f.lazy(()=>T(()=>import("./mydata-C1ATKO75.js"),__vite__mapDeps([104,28,2,105,39]))),PF=f.lazy(()=>T(()=>import("./kubernetes-DclYAg5r.js"),__vite__mapDeps([106,40,107]))),RF=f.lazy(()=>T(()=>import("./aws-BbgBUNdo.js"),__vite__mapDeps([108,109,43]))),NF=f.lazy(()=>T(()=>import("./pinecone-TkMerIxO.js"),__vite__mapDeps([110,2,5]))),IF=f.lazy(()=>T(()=>import("./langchain-BIwmG0rG.js"),__vite__mapDeps([111,2,5]))),jF=f.lazy(()=>T(()=>import("./n8n-Defj7hWq.js"),__vite__mapDeps([112,2,24,39]))),AF=f.lazy(()=>T(()=>import("./zapier-B7zbbD8L.js"),__vite__mapDeps([113,2,114,115,42]))),OF=f.lazy(()=>T(()=>import("./celonis-CBxW-Rdm.js"),__vite__mapDeps([116,2,117]))),DF=f.lazy(()=>T(()=>import("./power-bi-qUYqMYkH.js"),__vite__mapDeps([118,2,119,120]))),LF=f.lazy(()=>T(()=>import("./ai-sdr-BQafSGVV.js"),__vite__mapDeps([121,2,119]))),MF=f.lazy(()=>T(()=>import("./workflow-DQc6i7kg.js"),__vite__mapDeps([122,2,23]))),UF=f.lazy(()=>T(()=>import("./analytics-bsb27ax-.js"),__vite__mapDeps([123,2,5,124,125]))),FF=f.lazy(()=>T(()=>import("./maia-DwvWfksh.js"),__vite__mapDeps([126,94,2,53,39]))),VF=f.lazy(()=>T(()=>import("./gary-BGrBC5Lq.js"),__vite__mapDeps([127,94,2,53,128]))),zF=f.lazy(()=>T(()=>import("./badabing-DBdU6q1P.js"),__vite__mapDeps([129,94,2,40,23,105]))),BF=f.lazy(()=>T(()=>import("./vaii-CLDX4bdL.js"),__vite__mapDeps([130,94,2,131]))),WF=f.lazy(()=>T(()=>import("./mydata-DXW2PD1I.js"),__vite__mapDeps([132,94,2,105]))),HF=f.lazy(()=>T(()=>import("./bhconnect-DWXSPlvQ.js"),__vite__mapDeps([133,94,2,23,134,135]))),$F=f.lazy(()=>T(()=>import("./ambient-CUNKJpBY.js"),__vite__mapDeps([136,94,2,137,3,138]))),qF=f.lazy(()=>T(()=>import("./staffing-recruiting-CY-MdDfp.js"),__vite__mapDeps([139,94,2]))),KF=f.lazy(()=>T(()=>import("./sales-DCpV1QV_.js"),__vite__mapDeps([140,94,2]))),GF=f.lazy(()=>T(()=>import("./legal-5GmL-n92.js"),__vite__mapDeps([141,94,2,142,23]))),QF=f.lazy(()=>T(()=>import("./legal-Cl60dnrF.js"),__vite__mapDeps([143,144,35,33,145,146,147,42,148,137,3,24,124,142,55,2]))),JF=f.lazy(()=>T(()=>import("./legal-segment-sLGKgUjp.js"),__vite__mapDeps([149,144,35,33,2,145,146,147,42,148,137,3,24,124,142,55,150])).then(t=>({default:t.LegalFirmTypePage}))),YF=f.lazy(()=>T(()=>import("./legal-segment-sLGKgUjp.js"),__vite__mapDeps([149,144,35,33,2,145,146,147,42,148,137,3,24,124,142,55,150])).then(t=>({default:t.LegalServicePage}))),XF=f.lazy(()=>T(()=>import("./plumber-BX24x7_2.js"),__vite__mapDeps([151,144,35,33,2,137,152,24,55]))),ZF=f.lazy(()=>T(()=>import("./healthcare-18xQLDrX.js"),__vite__mapDeps([153,144,35,33,154,2,155,137,156,24]))),eV=f.lazy(()=>T(()=>import("./financial-WLYxkVK8.js"),__vite__mapDeps([157,144,35,33,2,148,158,24]))),tV=f.lazy(()=>T(()=>import("./staffing-CY17_OJG.js"),__vite__mapDeps([159,144,35,33,2,147,137,160,24,55]))),nV=f.lazy(()=>T(()=>import("./real-estate-DyRagpqB.js"),__vite__mapDeps([161,144,35,33,2,147,137,160,24,162,55]))),iV=f.lazy(()=>T(()=>import("./sales-CVegvF1b.js"),__vite__mapDeps([163,144,35,33,2,53,164,137,24,55,160]))),rV=f.lazy(()=>T(()=>import("./retail-DPE0WxV9.js"),__vite__mapDeps([165,144,35,33,2,3,166,167,55]))),sV=f.lazy(()=>T(()=>import("./hospitality-I0mvZ_zU.js"),__vite__mapDeps([168,144,35,33,169,2]))),oV=f.lazy(()=>T(()=>import("./education-yg4b0_v5.js"),__vite__mapDeps([170,144,35,33,2,3,155,171,55]))),aV=f.lazy(()=>T(()=>import("./hvac-DNcwML_S.js"),__vite__mapDeps([172,144,35,33,173,2,137,152]))),cV=f.lazy(()=>T(()=>import("./electrician-nIOQxHXf.js"),__vite__mapDeps([174,144,35,33,2,137,152,175]))),lV=f.lazy(()=>T(()=>import("./roofer-nYy95SG5.js"),__vite__mapDeps([176,144,35,33,2,137,177,152]))),dV=f.lazy(()=>T(()=>import("./painter-BfMPhXzz.js"),__vite__mapDeps([178,144,35,33,2,137,147,24,55]))),uV=f.lazy(()=>T(()=>
595import("./general-contractor-BdInQc2H.js"),__vite__mapDeps([179,144,35,33,2,147,137,180]))),hV=f.lazy(()=>T(()=>import("./healthcare-B6w91vjd.js"),__vite__mapDeps([181,94,2,182]))),fV=f.lazy(()=>T(()=>import("./financial-BCvAlv51.js"),__vite__mapDeps([183,94,2]))),pV=f.lazy(()=>T(()=>import("./retail-BWGtGcF3.js"),__vite__mapDeps([184,94,2,185]))),mV=f.lazy(()=>T(()=>import("./hospitality-DikLucoR.js"),__vite__mapDeps([186,94,2,187,137,188]))),gV=f.lazy(()=>T(()=>import("./education-CasdL_Hx.js"),__vite__mapDeps([189,94,2,171,124]))),vV=f.lazy(()=>T(()=>import("./ai-integration-DDnNRPxT.js"),__vite__mapDeps([190,2,23]))),yV=f.lazy(()=>T(()=>import("./knowledge-base-C95cVUOT.js"),__vite__mapDeps([191,2,192]))),bV=f.lazy(()=>T(()=>import("./rag-langchain-BWFe4HKc.js"),__vite__mapDeps([193,2,23]))),xV=f.lazy(()=>T(()=>import("./fine-tuning-CxnYv3F7.js"),__vite__mapDeps([194,2,124]))),kV=f.lazy(()=>T(()=>import("./data-migration-Dvl-0q1-.js"),__vite__mapDeps([195,2,103]))),SV=f.lazy(()=>T(()=>import("./case-studies-BvCmJ8yr.js"),__vite__mapDeps([196,94,2,119]))),wV=f.lazy(()=>T(()=>import("./templates-D3gLXvWo.js"),__vite__mapDeps([197,94,2,42,70,124,198,103]))),CV=f.lazy(()=>T(()=>import("./case-studies-DWW4pf_R.js"),__vite__mapDeps([199,94,2,125,124,119]))),TV=f.lazy(()=>T(()=>import("./blog-D648hpJU.js"),__vite__mapDeps([200,94,2,201]))),_V=f.lazy(()=>T(()=>import("./ai-demo-B0Oaht2_.js"),__vite__mapDeps([202,94,2,203]))),EV=f.lazy(()=>T(()=>import("./ai-voice-demo-B29dON_9.js"),__vite__mapDeps([204,94,2,203]))),PV=f.lazy(()=>T(()=>import("./ai-sales-agent-DIHwoDcr.js"),[])),RV=f.lazy(()=>T(()=>import("./chatbot-config-CKvMEI-O.js"),__vite__mapDeps([205,10,33,13,14,206,207,208,171,5,80,70,58]))),NV=f.lazy(()=>T(()=>import("./ai-config-DGcgEGnO.js"),__vite__mapDeps([209,10,33,13,14,210,206,80,58]))),IV=f.lazy(()=>T(()=>import("./admin-navigation-CUs6A1EO.js"),__vite__mapDeps([211,13,14,69,171,212,213,80,5,44,43]))),jV=f.lazy(()=>T(()=>import("./observability-dashboard-DyQeg-oG.js"),__vite__mapDeps([214,13,14,215,216,217,210,105,81,42,40,218,219,220,221,222]))),Dx=f.lazy(()=>T(()=>import("./user-management-BIB81iC1.js"),__vite__mapDeps([223,10,215,33,13,14,224,225,226,227,228,229,58,81,42,219,220,221,222]))),AV=f.lazy(()=>T(()=>import("./organization-management-CJ29G-el.js"),__vite__mapDeps([230,231,232,220,221,233,234,235,236,43]))),Lx=f.lazy(()=>T(()=>import("./accept-invite-5-BBYSTw.js"),__vite__mapDeps([237,238,10,73,16,81,207,208]))),OV=f.lazy(()=>T(()=>import("./reset-password-BvxEtYgR.js"),__vite__mapDeps([239,238,10,81,207,208]))),DV=f.lazy(()=>T(()=>import("./refer-z4zv1yGb.js"),__vite__mapDeps([240,2,81,36,7,68,188,225]))),LV=f.lazy(()=>T(()=>import("./referrals-DtVZZDKv.js"),__vite__mapDeps([241,238,242,68]))),MV=f.lazy(()=>T(()=>import("./admin-features-CN6btlqb.js"),__vite__mapDeps([243,10,33,35,50,244,84,58]))),UV=f.lazy(()=>T(()=>import("./admin-external-api-keys-DAJgEARM.js"),__vite__mapDeps([245,10,18,210,35,215,50,207,208,68,44,58,42]))),FV=f.lazy(()=>T(()=>import("./api-keys-BXZOm_yy.js"),__vite__mapDeps([246,10,35,44,50,42,58,247,68,207,208,231,232,220,221,233,234,235,236]))),VV=f.lazy(()=>T(()=>import("./doc-management-BohWLJOB.js"),__vite__mapDeps([248,10,33,215,249,80,208,58,70,250,206]))),zV=f.lazy(()=>T(()=>import("./enterprise-BXNn9d_5.js"),__vite__mapDeps([251,39]))),BV=f.lazy(()=>T(()=>import("./professional-Dlsekgs8.js"),__vite__mapDeps([252,39]))),WV=f.lazy(()=>T(()=>import("./demo-CUY4WuRX.js"),__vite__mapDeps([253,39]))),HV=f.lazy(()=>T(()=>import("./free-dbtJ5Tik.js"),__vite__mapDeps([254,39]))),$V=f.lazy(()=>T(()=>import("./client-DDVS8DAH.js"),__vite__mapDeps([255,42]))),qV=f.lazy(()=>T(()=>import("./navigation-hub-7luy0szx.js"),[])),KV=f.lazy(()=>T(()=>import("./navigation-test-DO66829G.js"),__vite__mapDeps([256,13,14,257,80,5,213,171,44,212,69]))),GV=f.lazy(()=>T(()=>import("./voice-test-platform-CZY-UA8l.js"),__vite__mapDeps([258,10,33,74,75]))),QV=f.lazy(()=>T(()=>import("./demo-creator-DGUWBkBO.js"),__vite__mapDeps([259,10,5,30,50,58,36,2,124,260,261,262,4]))),JV=f.lazy(()=>T(()=>import("./website-demo-creator-DsH3QwWc.js"),__vite__mapDeps([263,33,10,50,208,264,68,58,188,265,2,36,266,20,225]))),YV=f.lazy(()=>T(()=>import("./demo-preview-DB_aL19d.js"),__vite__mapDeps([267,188,268,69,20,269,42,225]))),XV=f.lazy(()=>T(()=>
595import("./proposal-creator-CEAWb5Fd.js"),__vite__mapDeps([270,10,33,13,14,271,50,5,272,30,264,36,2,67,208,68,158,58,87]))),ZV=f.lazy(()=>T(()=>import("./proposal-preview-LDX_pJcP.js"),__vite__mapDeps([273,2,274,158,275,226,30,103,227,225,276,185,169,277,128,278,171,192,5,279,280,137,281,282,283,284,164,117,124,119,125,285,7,20,286,6,287,81,147,155,182,42,109,288,39,4,101,29,107,68,40,43,272,70,67,289,69,207,208,156,175,25,290,148,249,291,292,293,224,294,48,250,295,142,296,242,297,298,162,180,299,19,213,146,261,300,301,302,228,44,303,262,87,135,304,305,306,307,244,269,188,308,309,138,131,268,310,266,311,23,166,265,312,264,313,84,74,47,50,314,315,114,52,152,160,316,167,317,206,318,319,105,55,120,3,198,53,320,154,321,322,212,173,323,218,58,324,260,177,86,134,80,229,187,66,75,76,57,115,247,24]))),e6=f.lazy(()=>T(()=>import("./elevenlabs-voice-agent-BynK9nhA.js"),__vite__mapDeps([325,74]))),t6=f.lazy(()=>T(()=>import("./autonomous-agent-config-aLLbHoPY.js"),__vite__mapDeps([326,10,33,212,213,5,42]))),n6=f.lazy(()=>T(()=>import("./elevenlabs-voice-fixed-dUpb6AnP.js"),__vite__mapDeps([327,74]))),If=f.lazy(()=>T(()=>import("./voice-agent-platform-fixed-BAJOwKkk.js"),__vite__mapDeps([328,329,50,212,5,6]))),i6=f.lazy(()=>T(()=>import("./voice-agent-setup-B58nmd8h.js"),__vite__mapDeps([330,10,33,14,35,30]))),r6=f.lazy(()=>T(()=>import("./automation-sequences-BL73Xn3x.js"),__vite__mapDeps([331,10,33,13,14,73,210,329,297,50,24,58,30,68,208,125,124,247,42]))),s6=f.lazy(()=>T(()=>import("./campaign-builder-eyrM5Gpd.js"),__vite__mapDeps([332,10,33,24,68,70,208,50,218,297,247,135,58]))),o6=f.lazy(()=>T(()=>import("./integrations-CgiyXBPi.js"),__vite__mapDeps([333,3,7,281,86,109]))),a6=f.lazy(()=>T(()=>import("./gary-portal-CefIU5gI.js"),__vite__mapDeps([334,84,285,277,294,322,288,47,53,58,5,131]))),c6=f.lazy(()=>T(()=>import("./lead-scoring-CvopqNHK.js"),__vite__mapDeps([335,10,13,14,5,224]))),l6=f.lazy(()=>T(()=>import("./sequence-templates-CEvFH854.js"),__vite__mapDeps([336,10,329,70,224,68]))),d6=f.lazy(()=>T(()=>import("./agent-memory-timeline-By6K5C3o.js"),__vite__mapDeps([337,10,329,33,210,20,5,50,224,42,338,221,220,67,219,222]))),u6=f.lazy(()=>T(()=>import("./api-dashboard-D2d_Xody.js"),__vite__mapDeps([339,13,14,238,81]))),h6=f.lazy(()=>T(()=>import("./crm-analytics-BkOfqz6h.js"),__vite__mapDeps([340,13,14]))),f6=f.lazy(()=>T(()=>import("./crm-dashboard-CKaiwSDz.js"),__vite__mapDeps([341,18,210,22,10,33,50,42,69,216,13,14,188,208,6,5,70,58,342,53,219,220,221,222,338,343,344,345,320,269,346,347,235,348,272]))),p6=f.lazy(()=>T(()=>import("./pitches-5tm0JOqL.js"),__vite__mapDeps([349,33,69,7]))),m6=f.lazy(()=>T(()=>import("./crm-deals-CExYmh6a.js"),__vite__mapDeps([350,50,272]))),Mx=f.lazy(()=>T(()=>import("./crm-calendar-DxmXn-Ok.js"),__vite__mapDeps([351,342,10,33,53,42,219,220,221,222,338,50,343,344,345,320,58,269,346,347,235,348,352,13,14,216,217,30,281]))),Ux=f.lazy(()=>T(()=>import("./phone-numbers-D5Hor8IU.js"),__vite__mapDeps([353,10,13,14,80,198,58,272,50,212,314,315]))),g6=f.lazy(()=>T(()=>import("./chat-memory-CyskHzac.js"),__vite__mapDeps([354,13,14]))),v6=f.lazy(()=>T(()=>import("./sms-dashboard-CTyZVe7G.js"),__vite__mapDeps([355,33,13,14,10,238,212,69]))),y6=f.lazy(()=>T(()=>import("./contact-upload-DBJ2oDXs.js"),__vite__mapDeps([356,10,33,238,13,14,215,70,80]))),b6=f.lazy(()=>T(()=>import("./call-logs-BEmBcevx.js"),__vite__mapDeps([357,73,216,42,231,232,220,221,233,234,235,236]))),x6=f.lazy(()=>T(()=>import("./seo-dashboard-Copxi-ew.js"),__vite__mapDeps([358,28,2,13,14,311,262,208]))),k6=f.lazy(()=>T(()=>import("./seo-guide-CgRYZTt4.js"),__vite__mapDeps([359,13,14,42,69,135]))),jf=f.lazy(()=>T(()=>import("./ai-conference-DyH0lD43.js"),__vite__mapDeps([360,61,62,216,75,76,42,268,324,7,262,2,278,36,74]))),S6=f.lazy(()=>T(()=>import("./ai-conference-dashboard-CGpdkA9h.js"),__vite__mapDeps([361,10,33,220,221,362,50,291,68,219,222]))),w6=f.lazy(()=>T(()=>import("./ai-agent-config-Blt_udrk.js"),__vite__mapDeps([363,10,13,14,33,210,50,313,208,5,206])));f.lazy(()=>T(()=>import("./conference-recording-guide-DwqZ9r1l.js"),__vite__mapDeps([364,10,63,68,80])));const C6=f.lazy(()=>T(()=>import("./unified-communications-CwexDVEB.js"),__vite__mapDeps([365,10,13,14,272,50,7]))),T6=f.lazy(()=>T(()=>import("./unified-communications-dashboard-TVNKwXFo.js"),__vite__mapDeps([366,13,14,30,212,7,6,213,288,78,33,10,79,50,80,42,75,76,74,81,18,210,272,105]))),_6=f.lazy(()=>T(()=>import("./conference-recordings-BreQmzRk.js"),__vite__mapDeps([367,18,210,291,42,70,58]))),E6=f.lazy(()=>T(()=>import("./ai-sdrs-CnufQblF.js"),__vite__mapDeps([368,2,175]))),P6=f.lazy(()=>T(()=>import("./ai-recruiter-tM22N5X7.js"),__vite__mapDeps([369,2,182,319]))),R6=f.lazy(()=>T(()=>import("./crm-automation-B6qlGRmy.js"),__vite__mapDeps([370,2,175])
595)),N6=f.lazy(()=>T(()=>import("./ai-outbound-engine-DPYof84M.js"),__vite__mapDeps([371,2]))),I6=f.lazy(()=>T(()=>import("./ai-assistant-Cte_w1rI.js"),__vite__mapDeps([372,2,301,40,247,39]))),j6=f.lazy(()=>T(()=>import("./enterprise-ai-CeKiAxr7.js"),__vite__mapDeps([373,2,40,23]))),A6=f.lazy(()=>T(()=>import("./saas-platform-mUQCkaLV.js"),__vite__mapDeps([374,2,43]))),O6=f.lazy(()=>T(()=>import("./agentic-ai-Dn1yMOJq.js"),__vite__mapDeps([375,2,5]))),D6=f.lazy(()=>T(()=>import("./agentic-automation-rtG0G4H7.js"),__vite__mapDeps([376,2,24,5]))),L6=f.lazy(()=>T(()=>import("./ai-agents-BCg_8ynj.js"),__vite__mapDeps([377,2,23,40]))),M6=f.lazy(()=>T(()=>import("./ai-and-rpa-CkR6WAqt.js"),__vite__mapDeps([378,2,40,23]))),U6=f.lazy(()=>T(()=>import("./generative-ai-BVJhyAVI.js"),__vite__mapDeps([379,2,5,39]))),F6=f.lazy(()=>T(()=>import("./specialized-ai-CUc6nU3o.js"),__vite__mapDeps([380,2,5]))),V6=f.lazy(()=>T(()=>import("./enterprise-ai-DN1nDk7D.js"),__vite__mapDeps([381,2,24]))),z6=f.lazy(()=>T(()=>import("./ai-assistant-DUTHIedq.js"),__vite__mapDeps([382,28,2,5,42]))),B6=f.lazy(()=>T(()=>import("./what-is-rpa-DxhLCNUt.js"),__vite__mapDeps([383,2,24]))),W6=f.lazy(()=>T(()=>import("./sap-automation-YnuP7JmW.js"),__vite__mapDeps([384,2,24]))),H6=f.lazy(()=>T(()=>import("./web-automation-BIYd2IUO.js"),__vite__mapDeps([385,2,39]))),$6=f.lazy(()=>T(()=>import("./desktop-automation-Ctvn0ABj.js"),__vite__mapDeps([386,2,40]))),q6=f.lazy(()=>T(()=>import("./email-automation-B8kM79F4.js"),__vite__mapDeps([387,2]))),K6=f.lazy(()=>T(()=>import("./no-code-automation-gfYmcDyQ.js"),__vite__mapDeps([388,2,114,24,39]))),G6=f.lazy(()=>T(()=>import("./intelligent-automation-CarsiGHz.js"),__vite__mapDeps([389,2,5,23,40]))),Q6=f.lazy(()=>T(()=>import("./test-automation-Dlcc-5Ja.js"),__vite__mapDeps([390,2,212,279]))),J6=f.lazy(()=>T(()=>import("./marriagementor-CILbHMLH.js"),[])),Y6=f.lazy(()=>T(()=>import("./buy-CKcrNEjB.js"),[])),X6=f.lazy(()=>T(()=>import("./tradeworx-3cMU6Vt9.js"),__vite__mapDeps([391,2]))),Z6=f.lazy(()=>T(()=>import("./traliant-CtTyjGfs.js"),__vite__mapDeps([392,2,42,53]))),ez=f.lazy(()=>T(()=>import("./reps-O2itBY9F.js"),__vite__mapDeps([393,10,394,395,396,344,220,222,80,249,70,7,229,69,87,84,58]))),tz=f.lazy(()=>T(()=>import("./campaign-launcher-D9qBew7x.js"),__vite__mapDeps([397,33,35,10,398,395,396,344,220,222,208,7,55,249,48,58,206,50,84,80,69,298,57,42,262,312,30]))),nz=f.lazy(()=>T(()=>import("./csv-repository-DGAVCQSP.js"),__vite__mapDeps([399,271,14,215,33,398,80,48,249,7,158,42,67,208,70,320,68,58]))),iz=f.lazy(()=>T(()=>import("./contact-pipeline-CToe2EWK.js"),__vite__mapDeps([400,215,35,398,80,30,58]))),rz=f.lazy(()=>T(()=>import("./campaign-scheduler-BRQ8iqNT.js"),__vite__mapDeps([401,281,42,402,232,220,345,219,221,222,403,58,347,235,346,348,338]))),sz=f.lazy(()=>T(()=>import("./campaign-queue-C94yzafr.js"),__vite__mapDeps([404,35,271,14,18,210,220,305,42,58,67,236,221,219,222,338]))),oz=f.lazy(()=>T(()=>import("./meeting-timeline-CVDevkED.js"),__vite__mapDeps([405,217,406,407,219,220,221,222,233,347,343,344,345,396,235,403,362,232,224,42,269,408,236,348,338,402]))),az=f.lazy(()=>T(()=>import("./campaigns-Ddk5cy30.js"),__vite__mapDeps([409,395,396,344,220,222,217,394,215,35,18,210,410,302,329,271,14,50,224,274,42,158,58,81,67,320,68,208,219,221]))),cz=f.lazy(()=>T(()=>import("./campaign-detail-DgYS9v9H.js"),__vite__mapDeps([411,395,396,344,220,222,217,33,10,329,215,13,14,271,35,398,30,208,167,137,287,67,68,42,81,154,280,3,58,311,57,206,320,249,7,219,221]))),lz=f.lazy(()=>T(()=>import("./campaign-analytics-D1AWy-cX.js"),__vite__mapDeps([412,217,13,14,18,210,42,81,276]))),dz=f.lazy(()=>T(()=>import("./video-campaigns-bWr_zimr.js"),__vite__mapDeps([413,217,33,215,50,293,81,208]))),uz=f.lazy(()=>T(()=>import("./video-studio-CLFHMYel.js"),__vite__mapDeps([414,217,33,13,14,215,80,48,302,299,120,208,69,84,58,68,42]))),hz=f.lazy(()=>T(()=>import("./document-storage-D_reW6EZ.js"),__vite__mapDeps([415,33,271,14,10,58,50,250,120,87,68,292,67,167]))),fz=f.lazy(()=>T(()=>import("./watch-WdYuwt-o.js"),__vite__mapDeps([416,33,76,75,284,68,120]))),pz=f.lazy(()=>T(()=>import("./landing-experiments-BFL5Ape0.js"),__vite__mapDeps([417,10,33,13,14,215,73,50,208,311,322,69,310,58]))),mz=f.lazy(()=>T(()=>import("./landing-preview-BGzf1CX_.js"),__vite__mapDeps([418,1,2,3,4,5,6,7,30,208,310,322]))),gz=f.lazy(()=>T(()=>import("./templates-BdnR438D.js"),__vite__mapDeps([419,33,10,13,14,303,50,208,68,320]))),vz=f.lazy(()=>T(()=>import("./contacts-RyVEgc7C.js"),__vite__mapDeps([420,10,33,217,35,215,271,14,80,224,306,58,289,208,219,220,221,222]))),yz=f.lazy(()=>T(()=>import("./contact-detail-DNOdarEc.js"),__vite__mapDeps([421,217,33,10,13,14,30,69,306,321,280,219,220,221,222]))),bz=f.lazy(()=>T(()=>import("./calendar-admin-Bi69dd4N.js"),__vite__mapDeps([422,395,396,344,220,222,10,217,410,302,282,55,7,281,81,69,5]))),xz=f.lazy(()=>T(()=>
595import("./calendar-team-view-DXPuEuru.js"),__vite__mapDeps([423,395,396,344,220,222,35,406,407,219,221,233,347,343,345,235,403,362,217,210,234,30,281,224,42,137,69,58,20,81,408,236]))),kz=f.lazy(()=>T(()=>import("./calendar-settings-B9J42cDi.js"),__vite__mapDeps([424,10,217,30,280,224,42,68,58]))),Sz=f.lazy(()=>T(()=>import("./meeting-optimizer-tYPqdlJ4.js"),__vite__mapDeps([425,13,14,5,42,304,262,81,7,57]))),wz=f.lazy(()=>T(()=>import("./rep-calendar-view-DVetD71M.js"),__vite__mapDeps([426,406,407,219,220,221,222,233,347,343,344,345,396,235,403,362,217,238,30,281,42,234,338]))),Cz=f.lazy(()=>T(()=>import("./calendar-automation-DPU1RQ31.js"),__vite__mapDeps([427,10,217,30,55,206,42,229,58]))),Fx=f.lazy(()=>T(()=>import("./google-integration-wizard-yEtalmH0.js"),__vite__mapDeps([428,10,33,238,73,35,7,302,69,290,80,44,68,81,285]))),Tz=f.lazy(()=>T(()=>import("./enterprise-onboarding-D66mxVbg.js"),__vite__mapDeps([429,35,238,73,7,36,2,69,249,312,30]))),_z=f.lazy(()=>T(()=>import("./workspace-management-5VbBAZph.js"),__vite__mapDeps([430,35,217,238,13,14,7,81]))),Ez=f.lazy(()=>T(()=>import("./control-center-4yaaqvN5.js"),__vite__mapDeps([431,216,73,10,271,14,410,302,432,105,81,218,40,289,42,167,231,232,220,221,233,234,235,236,219,222]))),Pz=f.lazy(()=>T(()=>import("./system-health-BwN86VGD.js"),__vite__mapDeps([433,7,81,42,286,231,232,220,221,233,234,235,236]))),Rz=f.lazy(()=>T(()=>import("./admin-feedback-DdJOh8rA.js"),__vite__mapDeps([434,33,210,309,208,224,42,301,279,20,262]))),Nz=f.lazy(()=>T(()=>import("./client-portal-Bjp1K4gx.js"),__vite__mapDeps([435,217,13,14,35,10,33,281,7,282,69,309,300,50,58,42,224,324,268,279,20,262]))),Iz=f.lazy(()=>T(()=>import("./systems-dashboard-BeztncMB.js"),__vite__mapDeps([436,10,73,216,410,302,42,299,295,105,40,81,55,206,231,232,220,221,233,234,235,236]))),jz=f.lazy(()=>T(()=>import("./confirmation-engine-C1AsGC2i.js"),__vite__mapDeps([437,10,13,14,73,70,42,81,315,318,231,232,220,221,233,234,235,236,219,222]))),Az=f.lazy(()=>T(()=>import("./unified-inbox-leQGoRxc.js"),__vite__mapDeps([438,10,13,14,73,33,329,271,42,224,289,302,323,317,20,208,158,316,231,232,220,221,233,234,235,236,219,222]))),Vx=f.lazy(()=>T(()=>import("./callsheet-BBMfENtm.js"),__vite__mapDeps([439,33,216,73,50,307,80,42,74,58,249,81]))),Oz=f.lazy(()=>T(()=>import("./recruiting-Du79pOZL.js"),__vite__mapDeps([440,50,42]))),Dz=f.lazy(()=>T(()=>import("./recruiting-roles-1AglLHny.js"),__vite__mapDeps([441,10,33,13,14,30,50,269,272,80]))),Lz=f.lazy(()=>T(()=>import("./recruiting-role-detail-QoGPujF6.js"),__vite__mapDeps([442,10,13,14,216,30,269,272,298,80]))),Mz=f.lazy(()=>T(()=>import("./app-owner-dashboard-Drz6Ckwz.js"),__vite__mapDeps([443,13,14,5,80,50]))),Uz=f.lazy(()=>T(()=>import("./owner-usage-dashboard-D55SC25Q.js"),__vite__mapDeps([444,18,210,70]))),Fz=f.lazy(()=>T(()=>import("./recruiting-candidates-BrA2sDnt.js"),__vite__mapDeps([445,30,224]))),Vz=f.lazy(()=>T(()=>import("./confirm-meeting-sLy55Cio.js"),__vite__mapDeps([446,73,63,81,42,219,220,221,222]))),zz=f.lazy(()=>T(()=>import("./clients-BVC6_aXI.js"),__vite__mapDeps([447,10,33,217,50,84,44,58,81,86,135,228]))),Bz=f.lazy(()=>T(()=>import("./admin-meet-bots-DTNUJSBw.js"),__vite__mapDeps([448,18,210,50,42,69,277]))),Wz=f.lazy(()=>T(()=>import("./admin-usage-DRz5P5Xf.js"),__vite__mapDeps([449,13,14,272]))),Hz=f.lazy(()=>T(()=>import("./meeting-recordings-DcWrfuDl.js"),__vite__mapDeps([450,42,277,69]))),$z=f.lazy(()=>T(()=>import("./meet-bot-usage-D77Z_Msf.js"),__vite__mapDeps([451,217,70,42]))),qz=f.lazy(()=>T(()=>import("./dnc-list-CUeUdYsf.js"),__vite__mapDeps([452,10,33,217,308,81,224,70,80,50,58]))),Kz=f.lazy(()=>T(()=>import("./email-accounts-BAmMr1yZ.js"),__vite__mapDeps([453,395,396,344,220,222,35,16,352,13,14,216,217,50,7,58,289,323]))),Gz=f.lazy(()=>T(()=>import("./assistant-BBFbP3D9.js"),__vite__mapDeps([454,216,394,298,58,455,34,456,457,402,232,220,345,219,221,222,338]))),zx=f.lazy(()=>T(()=>import("./analytics-dashboard-n_ttEHI0.js"),__vite__mapDeps([458,13,14,329,410,302,432,455,34,459,456,42,260,218,275]))),Qz=f.lazy(()=>T(()=>import("./workspace-health-CluKNVZW.js"),__vite__mapDeps([460,13,14,81,218,455,34,459,42,457,260]))),Jz=f.lazy(()=>T(()=>import("./campaign-intelligence-bYNm9XZE.js"),__vite__mapDeps([461,13,14,30,42,81,280,218,283,231,232,220,221,233,234,235,236,219,222]))),Yz=f.lazy(()=>T(()=>import("./campaign-health-Bb-q0hpC.js"),__vite__mapDeps([462,296,42,81]))),Xz=f.lazy(()=>T(()=>import("./meeting-tracker-4uVRGVSs.js"),__vite__mapDeps([463,5,219,220,221,222]))),Zz=f.lazy(()=>T(()=>import("./meet-attendance-BXA5Sh27.js"),__vite__mapDeps([464,13,14,20,302,69,42,7,229,227]))),e8=f.lazy(()=>T(()=>import("./booking-pages-Bd1CEVmg.js"),__vite__mapDeps([465,10,33,13,14,73,50,42,135,68,208,320,58]))),t8=f.lazy(()=>T(()=>import("./public-book-CPqcr1oP.js"),__vite__mapDeps([466,10,33,407,219,220,221,222,233,347,343,344,345,396,235,403,362,42,30]))),n8=f.lazy(()=>T(()=>import("./sales-training-CYnJXZiy.js"),__vite__mapDeps([467,10,33,13,14,216,73,5,50,276,75,320,80,42]))),i8=f.lazy(()=>T(()=>import("./index-BPalbcuP.js"),__vite__mapDeps([468,201,257,217,50,42,74,80]))),r8=f.lazy(()=>T(()=>import("./mobile-qr-CfCSRI08.js"),__vite__mapDeps([469,53,52,68])));function W({children:t}){return c.jsxs("div",{className:"brand-lock-teal min-h-screen flex flex-col",children:[c.jsx(iM,{}),c.jsx("main",{className:"flex-grow",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:t})}),c.jsx(rM,{}),c.jsx(F5,{})]})}function ue({children:t}){return c.jsx("div",{className:"brand-lock-teal min-h-screen flex flex-col",children:c.jsx("main",{className:"flex-grow",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:t})})})}function s8(){const[t]=Pi();return f.useEffect(()=>{window.scrollTo(0,0)},[t]),null}function o8(){return console.log("Router rendering, current path:",window.location.pathname),c.jsxs(c.Fragment,{children:[c.jsx(s8,{}),c.jsxs(oI,{children:[c.jsx(D,{path:"/boom-simple",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(rF,{})})}),c.jsx(D,{path:"/boom-greeting",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(sF,{})})}),c.jsx(D,{path:"/meeting/:shortCode",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(aF,{})})}),c.jsx(D,{path:"/boom-control",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(oF,{})})}),c.jsx(D,{path:"/boom-dev",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(jf,{})})}),c.jsx(D,{path:"/test-google-auth",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(mF,{})})}),c.jsx(D,{path:"/ai-calling-test",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(gF,{})})}),c.jsx(D,{path:"/web-phone",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(cF,{})})}),c.jsx(D,{path:"/dialer",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(lF,{})})}),c.jsx(D,{path:"/crm-connect",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(uF,{})})}),c.jsx(D,{path:"/enterprise-dialer",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(dF,{})})}),c.jsx(D,{path:"/campaign-manager",children:c.jsx(ue,{children:c.jsx(fF,{})})}),c.jsx(D,{path:"/dialers",children:c.jsx(ue,{children:c.jsx(hF,{})})}),c.jsx(D,{path:"/confirm/:token",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(Vz,{})})}),c.jsx(D,{path:"/mobile",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(i8,{})})}),c.jsx(D,{path:"/mobile-qr",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(r8,{})})}),c.jsx(D,{path:"/book/:slug",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(t8,{})})}),c.jsx(me,{path:"/booking-pages",children:c.jsx(e8,{})}),c.jsx(D,{path:"/",children:c.jsx(W,{children:c.jsx(jx,{})})}),c.jsx(D,{path:"/home",children:c.jsx(W,{children:c.jsx(jx,{})})}),c.jsx(qe,{path:"/control-center",component:()=>c.jsx(Ez,{})}),c.jsx(qe,{path:"/system-health",component:()=>c.jsx(Pz,{})}),c.jsx(qe,{path:"/admin/feedback",component:()=>c.jsx(Rz,{})}),c.jsx(ce,{path:"/admin/usage",component:()=>c.jsx(Wz,{})}),c.jsx(qe,{path:"/systems-dashboard",component:()=>c.jsx(Iz,{})}),c.jsx(me,{path:"/confirmation-engine",children:c.jsx(jz,{})}),c.jsx(ce,{path:"/unified-inbox",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(En,{featureName:"Unified Inbox",children:c.jsx(Az,{})})})}),c.jsx(ce,{path:"/gary",component:()=>c.jsx(a6,{})}),c.jsx(ce,{path:"/integrations",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(o6,{})})}),c.jsx(me,{path:"/clients",children:c.jsx(zz,{})}),c.jsx(me,{path:"/meeting-recordings",children:c.jsx(Hz,{})}),c.jsx(me,{path:"/meet-bot-usage",children:c.jsx($z,{})}),c.jsx(me,{path:"/dnc",children:c.jsx(qz,{})}),c.jsx(Ql,{path:"/dashboard",component:()=>c.jsx(B5,{})}),c.jsx(me,{path:"/calendar",children:c.jsx(Mx,{})}),c.jsx(D,{path:"/auth",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(Ax,{})})}),c.jsx(D,{path:"/admin-login",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(z5,{})})}),c.jsx(D,{path:"/signup",children:c.jsx(W,{children:c.jsx(Ax,{})})}),c.jsx(D,{path:"/about",children:c.jsx(W,{children:c.jsx(q5,{})})}),c.jsx(me,{path:"/profile",children:c.jsx(Q5,{})}),c.jsx(ce,{path:"/account/billing",component:()=>c.jsx(J5,{})}),c.jsx(ce,{path:"/account/connect-tools",component:()=>c.jsx(Y5,{})}),c.jsx(ce,{path:"/account/workspace",component:()=>c.jsx(X5,{})}),c.jsx(ce,{path:"/account/devices",component:()=>c.jsx(Z5,{})}),c.jsx(ce,{path:"/get-gary",component:()=>c.jsx(eF,{})}),c.jsx(ce,{path:"/account/skills",component:()=>c.jsx(tF,{})}),c.jsx(ce,{path:"/account/approvals",component:()=>c.jsx(nF,{})}),c.jsx(ce,{path:"/account/referrals",component:()=>c.jsx(LV,{})}),c.jsx(tM,{path:"/app-owner",component:()=>c.jsx(Mz,{})}),c.jsx(D,{path:"/contact",children:c.jsx(W,{children:c.jsx(K5,{})})}),c.jsx(D,{path:"/pricing",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(G5,{})})}),c.jsx(D,{path:"/marriagementor",children:c.jsx(ue,{children:c.jsx(J6,{})})}),c.jsx(D,{path:"/buy",children:c.jsx(W,{children:c.jsx(Y6,{})})}),c.jsx(me,{path:"/reps",children:c.jsx(ez,{})}),c.jsx(me,{path:"/email-accounts",children:c.jsx(Kz,{})}),c.jsx(ce,{path:"/assistant",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(Gz,{})})}),c.jsx(me,{path:"/analytics-dashboard",children:c.jsx(En,{featureName:"Analytics Dashboard",children:c.jsx(zx,{})})}),c.jsx(me,{path:"/analytics",children:c.jsx(En,{featureName:"Analytics",children:c.jsx(zx,{})})}),c.jsx(me,{path:"/workspace-health",children:c.jsx(Qz,{})}),c.jsx(me,{path:"/campaign-launcher",children:c.jsx(tz,{})}),c.jsx(me,{path:"/csv-repository",children:c.jsx(nz,{})}),c.jsx(me,{path:"/contact-pipeline",children:c.jsx(iz,{})}),c.jsx(me,{path:"/campaign-scheduler",children:c.jsx(rz,{})}),c.jsx(me,{path:"/campaign-queue",children:c.jsx(sz,{})}),c.jsx(me,{path:"/meeting-timeline",children:c.jsx(oz,{})}),c.jsx(me,{path:"/campaigns",children:c.jsx(az,{})}),c.jsx(me,{path:"/callsheet",children:c.jsx(Vx,{})}),c.jsx(me,{path:"/callsheet/:id",children:c.jsx(Vx,{})}),c.jsx(me,{path:"/recruiting",children:c.jsx(En,{featureName:"AI Recruiter",children:c.jsx(Oz,{})})}),c.jsx(me,{path:"/recruiting/roles",children:c.jsx(En,{featureName:"AI Recruiter - Roles",children:c.jsx(Dz,{})})}),c.jsx(me,{path:"/recruiting/roles/:id",children:c.jsx(En,{featureName:"AI Recruiter - Role Details",children:c.jsx(Lz,{})})}),c.jsx(me,{path:"/recruiting/candidates",children:c.jsx(En,{featureName:"AI Recruiter - Candidates",children:c.jsx(Fz,{})})}),c.jsx(me,{path:"/campaigns/:id",children:c.jsx(cz,{})}),c.jsx(me,{path:"/campaigns/:id/intelligence",children:c.jsx(Jz,{})}),c.jsx(me,{path:"/campaign-analytics",children:c.jsx(lz,{})}),c.jsx(me,{path:"/campaign-health",children:c.jsx(Yz,{})}),c.jsx(me,{path:"/meeting-tracker",children:c.jsx(Xz,{})}),c.jsx(me,{path:"/meet-attendance",children:c.jsx(Zz,{})}),c.jsx(me,{path:"/video-campaigns",children:c.jsx(dz,{})}),c.jsx(me,{path:"/video-studio",children:c.jsx(En,{featureName:"Video Studio",children:c.jsx(uz,{})})}),c.jsx(me,{path:"/documents",children:c.jsx(En,{featureName:"Documents",children:c.jsx(hz,{})})}),c.jsx(D,{path:"/v/:token",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(fz,{})})}),c.jsx(me,{path:"/landing-experiments",children:c.jsx(pz,{})}),c.jsx(me,{path:"/landing/:variant",children:c.jsx(mz,{})}),c.jsx(me,{path:"/templates",children:c.jsx(gz,{})}),c.jsx(ce,{path:"/demo-creator",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(QV,{})})}),c.jsx(ce,{path:"/website-demo-creator",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(JV,{})})}
595),c.jsx(D,{path:"/demo-preview/:token",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(YV,{})})}),c.jsx(ce,{path:"/proposal-creator",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(XV,{})})}),c.jsx(D,{path:"/proposal/:token",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(ZV,{})})}),c.jsx(me,{path:"/contacts",children:c.jsx(vz,{})}),c.jsx(me,{path:"/contacts/:id",children:c.jsx(yz,{})}),c.jsx(qe,{path:"/client-portal",allowClient:!0,component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(Nz,{})})}),c.jsx(qe,{path:"/calendar-admin",allowClient:!0,component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(bz,{})})}),c.jsx(qe,{path:"/calendar-admin/team-view",allowClient:!0,component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(xz,{})})}),c.jsx(qe,{path:"/calendar-admin/rep/:id",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(wz,{})})}),c.jsx(qe,{path:"/calendar-admin/automation",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(Cz,{})})}),c.jsx(qe,{path:"/calendar-admin/settings",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(kz,{})})}),c.jsx(qe,{path:"/meeting-optimizer",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(Sz,{})})}),c.jsx(qe,{path:"/admin/google-integration",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(Fx,{})})}),c.jsx(me,{path:"/google-integration-wizard",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(Fx,{})})}),c.jsx(me,{path:"/enterprise-onboarding",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(Tz,{})})}),c.jsx(qe,{path:"/workspace",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(_z,{})})}),c.jsx(D,{path:"/explore",children:c.jsx(W,{children:c.jsx(Ox,{})})}),c.jsx(D,{path:"/solutions",children:c.jsx(W,{children:c.jsx(H5,{})})}),c.jsx(D,{path:"/resources",children:c.jsx(W,{children:c.jsx($5,{})})}),c.jsx(D,{path:"/platform",children:c.jsx(W,{children:c.jsx(W5,{})})}),c.jsx(D,{path:"/demo",children:c.jsx(ue,{children:c.jsx(Ox,{})})}),c.jsx(D,{path:"/explore/agentic-ai",children:c.jsx(W,{children:c.jsx(O6,{})})}),c.jsx(D,{path:"/explore/agentic-automation",children:c.jsx(W,{children:c.jsx(D6,{})})}),c.jsx(D,{path:"/explore/ai-agents",children:c.jsx(W,{children:c.jsx(L6,{})})}),c.jsx(D,{path:"/explore/ai-and-rpa",children:c.jsx(W,{children:c.jsx(M6,{})})}),c.jsx(D,{path:"/explore/generative-ai",children:c.jsx(W,{children:c.jsx(U6,{})})}),c.jsx(D,{path:"/explore/specialized-ai",children:c.jsx(W,{children:c.jsx(F6,{})})}),c.jsx(D,{path:"/explore/enterprise-ai",children:c.jsx(W,{children:c.jsx(V6,{})})}),c.jsx(D,{path:"/explore/ai-assistant",children:c.jsx(W,{children:c.jsx(z6,{})})}),c.jsx(D,{path:"/explore/what-is-rpa",children:c.jsx(W,{children:c.jsx(B6,{})})}),c.jsx(D,{path:"/explore/sap-automation",children:c.jsx(W,{children:c.jsx(W6,{})})}),c.jsx(D,{path:"/explore/web-automation",children:c.jsx(W,{children:c.jsx(H6,{})})}),c.jsx(D,{path:"/explore/desktop-automation",children:c.jsx(W,{children:c.jsx($6,{})})}),c.jsx(D,{path:"/explore/email-automation",children:c.jsx(W,{children:c.jsx(q6,{})})}),c.jsx(D,{path:"/explore/no-code-automation",children:c.jsx(W,{children:c.jsx(K6,{})})}),c.jsx(D,{path:"/explore/intelligent-automation",children:c.jsx(W,{children:c.jsx(G6,{})})}),c.jsx(D,{path:"/explore/test-automation",children:c.jsx(W,{children:c.jsx(Q6,{})})}),c.jsx(D,{path:"/platform/maia",children:c.jsx(W,{children:c.jsx(CF,{})})}),c.jsx(D,{path:"/platform/vaii",children:c.jsx(W,{children:c.jsx(TF,{})})}),c.jsx(D,{path:"/platform/bhconnect",children:c.jsx(W,{children:c.jsx(_F,{})})}),c.jsx(D,{path:"/platform/mydata",children:c.jsx(W,{children:c.jsx(EF,{})})}),c.jsx(D,{path:"/platform/kubernetes",children:c.jsx(W,{children:c.jsx(PF,{})})}),c.jsx(D,{path:"/platform/aws",children:c.jsx(W,{children:c.jsx(RF,{})})}),c.jsx(D,{path:"/platform/pinecone",children:c.jsx(W,{children:c.jsx(NF,{})})}),c.jsx(D,{path:"/platform/langchain",children:c.jsx(W,{children:c.jsx(IF,{})})}),c.jsx(D,{path:"/platform/n8n",children:c.jsx(W,{children:c.jsx(jF,{})})}),c.jsx(D,{path:"/platform/zapier",children:c.jsx(W,{children:c.jsx(AF,{})})}),c.jsx(D,{path:"/platform/celonis",children:c.jsx(W,{children:c.jsx(OF,{})})}),c.jsx(D,{path:"/platform/power-bi",children:c.jsx(W,{children:c.jsx(DF,{})})}),c.jsx(D,{path:"/platform/ai-sdr",children:c.jsx(W,{children:c.jsx(LF,{})})}),c.jsx(D,{path:"/platform/ai-sdr/case-studies",children:c.jsx(W,{children:c.jsx(SV,{})})}),c.jsx(D,{path:"/platform/workflow",children:c.jsx(W,{children:c.jsx(MF,{})})}),c.jsx(D,{path:"/platform/workflow/templates",children:c.jsx(W,{children:c.jsx(wV,{})})}),c.jsx(D,{path:"/platform/analytics",children:c.jsx(W,{children:c.jsx(UF,{})})}),c.jsx(D,{path:"/platform/analytics/case-studies",children:c.jsx(W,{children:c.jsx(CV,{})})}),c.jsx(D,{path:"/product/maia",children:c.jsx(W,{children:c.jsx(FF,{})})}),c.jsx(D,{path:"/product/gary",children:c.jsx(W,{children:c.jsx(VF,{})})}),c.jsx(D,{path:"/product/badabing",children:c.jsx(W,{children:c.jsx(zF,{})})}),c.jsx(D,{path:"/product/vaii",children:c.jsx(W,{children:c.jsx(BF,{})})}),c.jsx(D,{path:"/product/mydata",children:c.jsx(W,{children:c.jsx(WF,{})})}),c.jsx(D,{path:"/product/bhconnect",children:c.jsx(W,{children:c.jsx(HF,{})})}),c.jsx(D,{path:"/product/ambient",children:c.jsx(W,{children:c.jsx($F,{})})}),c.jsx(D,{path:"/industries/staffing-recruiting",children:c.jsx(W,{children:c.jsx(qF,{})})}),c.jsx(D,{path:"/industries/sales",children:c.jsx(W,{children:c.jsx(KF,{})})}),c.jsx(D,{path:"/industries/legal",children:c.jsx(W,{children:c.jsx(GF,{})})}),c.jsx(D,{path:"/legal",children:c.jsx(W,{children:c.jsx(QF,{})})}),c.jsx(D,{path:"/legal/firms/:slug",children:c.jsx(W,{children:c.jsx(JF,{})})}),c.jsx(D,{path:"/legal/services/:slug",children:c.jsx(W,{children:c.jsx(YF,{})})}),c.jsx(D,{path:"/plumber",children:c.jsx(W,{children:c.jsx(XF,{})})}),c.jsx(D,{path:"/hvac",children:c.jsx(W,{children:c.jsx(aV,{})})}),c.jsx(D,{path:"/electrician",children:c.jsx(W,{children:c.jsx(cV,{})})}),c.jsx(D,{path:"/roofer",children:c.jsx(W,{children:c.jsx(lV,{})})}),c.jsx(D,{path:"/painter",children:c.jsx(W,{children:c.jsx(dV,{})})}),c.jsx(D,{path:"/general-contractor",children:c.jsx(W,{children:c.jsx(uV,{})})}),c.jsx(D,{path:"/healthcare",children:c.jsx(W,{children:c.jsx(ZF,{})})}),c.jsx(D,{path:"/financial",children:c.jsx(W,{children:c.jsx(eV,{})})}),c.jsx(D,{path:"/staffing",children:c.jsx(W,{children:c.jsx(tV,{})})}),c.jsx(D,{path:"/real-estate",children:c.jsx(W,{children:c.jsx(nV,{})})}),c.jsx(D,{path:"/sales",children:c.jsx(W,{children:c.jsx(iV,{})})}),c.jsx(D,{path:"/retail",children:c.jsx(W,{children:c.jsx(rV,{})})}),c.jsx(D,{path:"/hospitality",children:c.jsx(W,{children:c.jsx(sV,{})})}),c.jsx(D,{path:"/education",children:c.jsx(W,{children:c.jsx(oV,{})})}),c.jsx(D,{path:"/industries/healthcare",children:c.jsx(W,{children:c.jsx(hV,{})})}),c.jsx(D,{path:"/industries/financial",children:c.jsx(W,{children:c.jsx(fV,{})})}),c.jsx(D,{path:"/industries/retail",children:c.jsx(W,{children:c.jsx(pV,{})})}),c.jsx(D,{path:"/industries/hospitality",children:c.jsx(W,{children:c.jsx(mV,{})})}),c.jsx(D,{path:"/industries/education",children:c.jsx(W,{children:c.jsx(gV,{})})}),c.jsx(D,{path:"/solutions/ai-integration",children:c.jsx(W,{children:c.jsx(vV,{})})}),c.jsx(D,{path:"/solutions/knowledge-base",children:c.jsx(W,{children:c.jsx(yV,{})})}),c.jsx(D,{path:"/solutions/rag-langchain",children:c.jsx(W,{children:c.jsx(bV,{})})}),c.jsx(D,{path:"/solutions/fine-tuning",children:c.jsx(W,{children:c.jsx(xV,{})})}),c.jsx(D,{path:"/solutions/data-migration",children:c.jsx(W,{children:c.jsx(kV,{})})}),c.jsx(D,{path:"/solutions/ai-sdrs",children:c.jsx(W,{children:c.jsx(E6,{})})}),c.jsx(D,{path:"/solutions/ai-recruiter",children:c.jsx(W,{children:c.jsx(P6,{})})}),c.jsx(D,{path:"/solutions/crm-automation",children:c.jsx(W,{children:c.jsx(R6,{})})}
595),c.jsx(D,{path:"/solutions/ai-outbound-engine",children:c.jsx(W,{children:c.jsx(N6,{})})}),c.jsx(D,{path:"/solutions/ai-assistant",children:c.jsx(W,{children:c.jsx(I6,{})})}),c.jsx(D,{path:"/solutions/enterprise-ai",children:c.jsx(W,{children:c.jsx(j6,{})})}),c.jsx(D,{path:"/solutions/saas-platform",children:c.jsx(W,{children:c.jsx(A6,{})})}),c.jsx(D,{path:"/resources/resource-library",children:c.jsx(W,{children:c.jsx(vF,{})})}),c.jsx(D,{path:"/resources/youtube-videos",children:c.jsx(W,{children:c.jsx(yF,{})})}),c.jsx(D,{path:"/resources/blog",children:c.jsx(W,{children:c.jsx(TV,{})})}),c.jsx(D,{path:"/resources/seo-guide",children:c.jsx(W,{children:c.jsx(k6,{})})}),c.jsx(D,{path:"/policies/privacy-policy",children:c.jsx(W,{children:c.jsx(bF,{})})}),c.jsx(D,{path:"/policies/terms-of-service",children:c.jsx(W,{children:c.jsx(xF,{})})}),c.jsx(D,{path:"/policies/ai-ethics",children:c.jsx(W,{children:c.jsx(kF,{})})}),c.jsx(D,{path:"/policies/acceptable-use",children:c.jsx(W,{children:c.jsx(SF,{})})}),c.jsx(D,{path:"/policies/data-processing",children:c.jsx(W,{children:c.jsx(wF,{})})}),c.jsx(D,{path:"/ai-demo",children:c.jsx(W,{children:c.jsx(_V,{})})}),c.jsx(D,{path:"/ai-voice-demo",children:c.jsx(W,{children:c.jsx(EV,{})})}),c.jsx(ce,{path:"/elevenlabs-voice-agent",component:()=>c.jsx(ue,{children:c.jsx(e6,{})})}),c.jsx(ce,{path:"/voice-fixed",component:()=>c.jsx(ue,{children:c.jsx(n6,{})})}),c.jsx(ce,{path:"/voice-platform",component:()=>c.jsx(En,{featureName:"Voice Platform",children:c.jsx(ue,{children:c.jsx(If,{})})})}),c.jsx(ce,{path:"/voice-test",component:()=>c.jsx(ue,{children:c.jsx(GV,{})})}),c.jsx(ce,{path:"/voice-agent",component:()=>c.jsx(ue,{children:c.jsx(If,{})})}),c.jsx(ce,{path:"/voice-agent-setup",component:()=>c.jsx(ue,{children:c.jsx(i6,{})})}),c.jsx(ce,{path:"/voice-agents",component:()=>c.jsx(En,{featureName:"Voice Agents",children:c.jsx(ue,{children:c.jsx(If,{})})})}),c.jsx(ce,{path:"/sales-training",component:()=>c.jsx(En,{featureName:"Sales Training",children:c.jsx(ue,{children:c.jsx(n8,{})})})}),c.jsx(ce,{path:"/unified-communications",component:()=>c.jsx(ue,{children:c.jsx(C6,{})})}),c.jsx(ce,{path:"/unified-communications-dashboard",component:()=>c.jsx(ue,{children:c.jsx(T6,{})})}),c.jsx(ce,{path:"/autonomous-agent-config",component:()=>c.jsx(ue,{children:c.jsx(t6,{})})}),c.jsx(ce,{path:"/crm-dashboard",component:()=>c.jsx(ue,{children:c.jsx(f6,{})})}),c.jsx(ce,{path:"/pitches",component:()=>c.jsx(ue,{children:c.jsx(p6,{})})}),c.jsx(ce,{path:"/crm-deals",component:()=>c.jsx(ue,{children:c.jsx(m6,{})})}),c.jsx(ce,{path:"/crm-calendar",component:()=>c.jsx(ue,{children:c.jsx(Mx,{})})}),c.jsx(ce,{path:"/phone-numbers",component:()=>c.jsx(ue,{children:c.jsx(Ux,{})})}),c.jsx(ce,{path:"/phone-number-manager",component:()=>c.jsx(ue,{children:c.jsx(Ux,{})})}),c.jsx(ce,{path:"/automation-sequences",component:()=>c.jsx(ue,{children:c.jsx(r6,{})})}),c.jsx(ce,{path:"/campaign-builder",component:()=>c.jsx(ue,{children:c.jsx(s6,{})})}),c.jsx(ce,{path:"/sequence-templates",component:()=>c.jsx(ue,{children:c.jsx(l6,{})})}),c.jsx(ce,{path:"/lead-scoring",component:()=>c.jsx(ue,{children:c.jsx(c6,{})})}),c.jsx(ce,{path:"/agent-memory-timeline",component:()=>c.jsx(ue,{children:c.jsx(d6,{})})}),c.jsx(ce,{path:"/api-dashboard",component:()=>c.jsx(ue,{children:c.jsx(u6,{})})}),c.jsx(ce,{path:"/crm-analytics",component:()=>c.jsx(ue,{children:c.jsx(h6,{})})}),c.jsx(ce,{path:"/chat-memory",component:()=>c.jsx(ue,{children:c.jsx(g6,{})})}),c.jsx(ce,{path:"/sms-dashboard",component:()=>c.jsx(ue,{children:c.jsx(v6,{})})}),c.jsx(ce,{path:"/contact-upload",component:()=>c.jsx(ue,{children:c.jsx(y6,{})})}),c.jsx(ce,{path:"/call-logs",component:()=>c.jsx(ue,{children:c.jsx(b6,{})})}),c.jsx(ce,{path:"/conference-recordings",component:()=>c.jsx(ue,{children:c.jsx(_6,{})})}),c.jsx(ce,{path:"/email-manager",component:()=>c.jsx(ue,{children:c.jsx(pF,{})})}),c.jsx(ce,{path:"/seo-dashboard",component:()=>c.jsx(ue,{children:c.jsx(x6,{})})}),c.jsx(ce,{path:"/ai-conference-dashboard",component:()=>c.jsx(ue,{children:c.jsx(S6,{})})}),c.jsx(D,{path:"/join/:roomName",component:()=>c.jsx(jf,{})}),c.jsx(ce,{path:"/ai-conference/:roomName?",component:()=>c.jsx(ue,{children:c.jsx(jf,{})})}),c.jsx(ce,{path:"/chatbot-config",component:()=>c.jsx(ue,{children:c.jsx(RV,{})})}),c.jsx(ce,{path:"/ai-config",component:()=>c.jsx(NV,{})}),c.jsx(ce,{path:"/ai-agent-config",component:()=>c.jsx(ue,{children:c.jsx(w6,{})})}),c.jsx(ce,{path:"/ai-sales-agent",component:()=>c.jsx(ue,{children:c.jsx(PV,{})})}),c.jsx(qe,{path:"/admin-dashboard",component:()=>c.jsx(Dx,{})}),c.jsx(qe,{path:"/admin/owner-usage",component:()=>c.jsx(Uz,{})}),c.jsx(qe,{path:"/admin-navigation",component:()=>c.jsx(ue,{children:c.jsx(IV,{})})}),c.jsx(qe,{path:"/admin/features",component:()=>c.jsx(ue,{children:c.jsx(MV,{})})}),c.jsx(Ql,{path:"/admin/external-api-keys",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(UV,{})})}),c.jsx(qe,{path:"/admin/doc-management",component:()=>c.jsx(ue,{children:c.jsx(VV,{})})}),c.jsx(qe,{path:"/admin/users",component:()=>c.jsx(Dx,{})}),c.jsx(qe,{path:"/admin/meet-bots",component:()=>c.jsx(Bz,{})}),c.jsx(Ql,{path:"/admin/organizations",component:()=>c.jsx(AV,{})}),c.jsx(Ql,{path:"/admin/observability",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(jV,{})})}),c.jsx(ce,{path:"/api-keys",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(FV,{})})}),c.jsx(D,{path:"/accept-invite",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(Lx,{})})}),c.jsx(D,{path:"/accept-invite/complete",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(Lx,{})})}),c.jsx(D,{path:"/reset-password",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(OV,{})})}),c.jsx(D,{path:"/r/:code",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(DV,{})})}),c.jsx(qe,{path:"/views/enterprise",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(zV,{})})}),c.jsx(qe,{path:"/views/professional",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(BV,{})})}),c.jsx(qe,{path:"/views/demo",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(WV,{})})}),c.jsx(qe,{path:"/views/free",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(HV,{})})}),c.jsx(qe,{path:"/views/client",component:()=>c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx($V,{})})}),c.jsx(qe,{path:"/navigation-hub",component:()=>c.jsx(ue,{children:c.jsx(qV,{})})}),c.jsx(D,{path:"/tradeworx",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(X6,{})})}),c.jsx(D,{path:"/traliant",children:c.jsx(f.Suspense,{fallback:c.jsx(le,{}),children:c.jsx(Z6,{})})}),c.jsx(D,{path:"/navigation-test",children:c.jsx(ue,{children:c.jsx(KV,{})})}),c.jsx(D,{children:c.jsx(W,{children:c.jsx(iF,{})})})]})]})}function a8(){return gO(),null}function c8(){const[t]=Pi(),e=/^\/v\//.test(t);return c.jsxs(c.Fragment,{children:[!e&&c.jsx(a8,{}),c.jsx(o8,{}),c.jsx(lO,{}),!e&&c.jsx(SO,{}),!e&&c.jsx(CO,{})]})}function l8(){return c.jsx(V5,{children:c.jsx(hO,{defaultTheme:"light",children:c.jsx(fO,{children:c.jsx(_I,{client:Eo,children:c.jsx(pO,{children:c.jsx(bO,{children:c.jsx(vO,{children:c.jsx(c8,{})})})})})})})})}const d8=()=>{const t=[T(()=>import("./dashboard-CYWeCi0k.js"),__vite__mapDeps([17,18,19,20])),T(()=>import("./auth-BHLXvF8b.js"),__vite__mapDeps([8,9,10,11,12,13,14,2])),T(()=>import("./about-CEi0TE0D.js"),__vite__mapDeps([31,22])),T(()=>import("./contact-BtAUqP9N.js"),__vite__mapDeps([32,9,10,11,33,34,35,2,36,37])),T(()=>import("./pricing-H5l_qabz.js"),__vite__mapDeps([38,2,39,40,5])),T(()=>Promise.resolve().then(()=>xO),void 0),T(()=>Promise.resolve().then(()=>GD),void 0),T(()=>import("./form-Dill8tQN.js").then(e=>e.h),__vite__mapDeps([9,10]))];return Promise.all(t)};AC(OC());window.addEventListener("vite:preloadError",()=>{sessionStorage.getItem("chunk-reload")||(sessionStorage.setItem("chunk-reload","1"),window.location.reload())});d8().catch(console.error);
595"serviceWorker"in navigator&&(location.pathname.startsWith("/mobile")||window.addEventListener("load",async()=>{try{const e=await navigator.serviceWorker.getRegistrations();if(await Promise.all(e.map(n=>n.unregister())),typeof caches<"u"){const n=await caches.keys();await Promise.all(n.map(i=>caches.delete(i)))}e.length>0&&(sessionStorage.getItem("sw-unregister-reload")||(sessionStorage.setItem("sw-unregister-reload","1"),location.reload()))}catch{}}));hw(document.getElementById("root")).render(c.jsx(l8,{}));export{De as $,Lc as A,he as B,Mc as C,Hj as D,Xh as E,Ry as F,v8 as G,uA as H,Yg as I,zC as J,_T as K,Le as L,av as M,mC as N,bA as O,gd as P,qj as Q,Wl as R,oo as S,xA as T,ub as U,fb as V,sA as W,Si as X,Xx as Y,cu as Z,vr as _,pb as a,dA as a$,lb as a0,nm as a1,db as a2,im as a3,rm as a4,hC as a5,V_ as a6,yA as a7,Yu as a8,Yr as a9,$u as aA,XD as aB,Dc as aC,Vo as aD,Re as aE,Ee as aF,ml as aG,$g as aH,Vw as aI,tt as aJ,wn as aK,YT as aL,VT as aM,B as aN,J as aO,Ei as aP,Sa as aQ,bu as aR,_e as aS,Mm as aT,I8 as aU,FU as aV,jU as aW,Yn as aX,qD as aY,cv as aZ,lv as a_,$p as aa,b8 as ab,lA as ac,iA as ad,pd as ae,io as af,Ow as ag,fA as ah,zj as ai,V as aj,fC as ak,oA as al,m8 as am,bC as an,f8 as ao,zE as ap,Bj as aq,vC as ar,Kg as as,Iy as at,Fj as au,Vj as av,rA as aw,md as ax,G as ay,Hs as az,Pi as b,au as b$,VO as b0,Jj as b1,fs as b2,gA as b3,pA as b4,yC as b5,Qh as b6,qg as b7,_A as b8,Wt as b9,gC as bA,BT as bB,vL as bC,rT as bD,QC as bE,ev as bF,qu as bG,yL as bH,bL as bI,Fw as bJ,tv as bK,zw as bL,gL as bM,Ku as bN,vs as bO,Lj as bP,Mj as bQ,Uj as bR,Jh as bS,Ny as bT,Zj as bU,jy as bV,tA as bW,Yh as bX,aA as bY,Ay as bZ,hA as b_,$j as ba,eA as bb,Xj as bc,Qj as bd,vA as be,Kj as bf,cA as bg,Gj as bh,Yj as bi,Bl as bj,Xy as bk,wA as bl,dv as bm,PT as bn,Oy as bo,iI as bp,mA as bq,kT as br,ST as bs,TT as bt,wT as bu,CT as bv,WD as bw,HD as bx,$D as by,pC as bz,Et as c,kA as c0,CA as c1,TA as c2,Dj as c3,eo as c4,ZI as c5,Y2 as c6,W2 as c7,Z2 as c8,eL as c9,nL as ca,iL as cb,sL as cc,rL as cd,tL as ce,BI as cf,yO as cg,T8 as ch,C8 as ci,S8 as cj,w8 as ck,qI as cl,UC as cm,T as cn,p8 as co,x8 as cp,EA as cq,Qg as cr,QD as cs,no as d,nA as e,Jg as f,or as g,$h as h,Xu as i,c as j,Zu as k,eh as l,Uc as m,Ly as n,Wj as o,Gi as p,Eo as q,f as r,BC as s,_r as t,ya as u,zl as v,Mt as w,Dy as x,po as y,SA as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.