UNPKG

@kmhgmbh/dialer-vue-components

Version:

VueJS components for telephony and dialer functions 2

1,414 lines 444 kB
var $o = Object.defineProperty; var Mo = (f, n, s) => n in f ? $o(f, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : f[n] = s; var Se = (f, n, s) => (Mo(f, typeof n != "symbol" ? n + "" : n, s), s); import { ref as Q, watch as rs, defineComponent as je, onMounted as Rl, resolveComponent as te, openBlock as Z, createBlock as fe, withCtx as Y, createVNode as ee, mergeProps as Ho, createTextVNode as de, createElementVNode as ge, toDisplayString as We, createCommentVNode as Oe, createElementBlock as Re, onUnmounted as Il, normalizeClass as wl, Fragment as Hs, renderList as Hn, unref as lt, computed as Bi } from "vue"; class Fo { constructor(n) { Se(this, "baseUrl"); this.baseUrl = n.baseUrl !== void 0 ? n.baseUrl : "http://localhost:8082"; } /** * Main authentication method. * * Per the Hermes 6.3 login flow, the PT token can be obtained either by * validating an existing session cookie, or by validating login/password * when no session cookie exists. A still-valid cookie from a previous * login causes the login page itself to redirect to the dashboard * (no __HRequestVerificationToken form), so the cookie-based path must be * tried first rather than always going through the full sign-in flow. * * @param username Agent login/ID * @param password Agent password * @param station Agent extension/station number * @returns Private Token response containing PT for AgentLink login */ async authenticate(n, s, a) { try { const u = await this.fetchPrivateToken(); return console.log("✓ Reused existing session cookie, skipping full sign-in"), u; } catch (u) { console.log("ℹ No valid session cookie, performing full sign-in flow", u); } try { const u = await this.fetchVerificationToken(); console.log("✓ Step 1: Verification token obtained"); const t = await this.fetchPublicKey(); console.log("✓ Step 2: Public key obtained"); const h = await this.importPublicKey(t); console.log("✓ Step 3: Public key imported"); const _ = JSON.stringify({ __HRequestVerificationToken: u, login: n, password: s, station: a, timeZone: "W. Europe Standard Time", network: "", InHermesLogin: !0 }), o = await this.encryptDataHybrid(_, h); console.log("✓ Step 4: Login data encrypted"), await this.signIn(u, o), console.log("✓ Step 5: Sign in successful, cookies obtained"); const g = await this.fetchPrivateToken(); return console.log("✓ Step 6: Private Token obtained"), g; } catch (u) { throw console.error("❌ Authentication failed:", u), u; } } /** * Step 1: Fetch __HRequestVerificationToken from login page HTML */ async fetchVerificationToken() { console.log("BASE URL:", this.baseUrl); const n = `${this.baseUrl}/hermes360/Admin/launcher/login`; console.log("🌐 Step 1: Fetching login page from:", n); const s = await fetch(n, { method: "GET", credentials: "include" }); if (console.log("📦 Step 1 Response status:", s.status), console.log("📦 Step 1 Response headers:", Object.fromEntries(s.headers.entries())), s.headers.get("set-cookie") ? console.log("🍪 Step 1 Set-Cookie header received") : console.warn("⚠️ Step 1: No Set-Cookie header in response"), !s.ok) throw new Error(`Failed to fetch login page: ${s.status}`); const u = await s.text(), t = this.parseVerificationToken(u); if (!t) throw new Error("__HRequestVerificationToken not found in login page"); return console.log("✅ Step 1: Verification token extracted"), t; } /** * Parse __HRequestVerificationToken from HTML using DOMParser */ parseVerificationToken(n) { const u = new DOMParser().parseFromString(n, "text/html").querySelector("#login-form"); if (!u) return null; const t = u.querySelector( 'input[name="__HRequestVerificationToken"]' ); return (t == null ? void 0 : t.value) || null; } /** * Step 2: Fetch RSA public key from server (XML format) */ async fetchPublicKey() { const n = `${this.baseUrl}/hermes360/Admin/Launcher/api/Authentification/GetPublicKey`, s = await fetch(n, { method: "GET", credentials: "include", headers: { Accept: "application/json" } }); if (s.headers.get("set-cookie") && console.log("🍪 Step 2 Set-Cookie header received"), !s.ok) throw new Error(`Failed to fetch public key: ${s.status}`); const u = await s.json(); return console.log("✅ Step 2: Public key received"), u.publicKey; } /** * Convert Base64 to Base64URL format (RFC 4648) */ toBase64Url(n) { return n.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, ""); } /** * Import RSA public key from XML format to CryptoKey */ async importPublicKey(n) { const a = new DOMParser().parseFromString(n, "text/xml"), u = a.getElementsByTagName("Modulus")[0], t = a.getElementsByTagName("Exponent")[0]; if (!u || !t) throw new Error("Invalid public key XML format"); const h = u.textContent || "", _ = t.textContent || "", o = this.toBase64Url(h), g = this.toBase64Url(_), m = { kty: "RSA", n: o, e: g, alg: "RSA-OAEP-256", ext: !0 }; return crypto.subtle.importKey( "jwk", m, { name: "RSA-OAEP", hash: "SHA-256" }, !0, ["encrypt"] ); } /** * Step 3: Hybrid encryption using AES-GCM + RSA-OAEP * Based on the encryptDataHybrid function from Login.js */ async encryptDataHybrid(n, s) { const a = await crypto.subtle.generateKey( { name: "AES-GCM", length: 256 }, !0, ["encrypt", "decrypt"] ), t = new TextEncoder().encode(n), h = crypto.getRandomValues(new Uint8Array(12)), _ = await crypto.subtle.encrypt( { name: "AES-GCM", iv: h }, a, t ), o = await crypto.subtle.exportKey("raw", a), g = await crypto.subtle.encrypt( { name: "RSA-OAEP" }, s, o ), m = btoa( String.fromCharCode(...new Uint8Array(_)) ), v = btoa( String.fromCharCode(...new Uint8Array(g)) ), A = btoa(String.fromCharCode(...h)); return { encryptedData: m, encryptedAesKey: v, iv: A }; } /** * Step 4: Sign in with encrypted credentials * This step is crucial for obtaining authentication cookies */ async signIn(n, s) { const a = `${this.baseUrl}/hermes360/Admin/Launcher/api/Authentification/SignIn`; console.log("🌐 Step 4: Signing in to:", a); const u = new URLSearchParams(); u.append("__HRequestVerificationToken", n), u.append("encryptedData", s.encryptedData), u.append("encryptedAesKey", s.encryptedAesKey), u.append("iv", s.iv); const t = await fetch(a, { method: "POST", credentials: "include", headers: { Accept: "application/json, text/javascript, */*; q=0.01", "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8" }, body: u.toString() }); if (t.headers.get("set-cookie") ? console.log("🍪 Step 4 Set-Cookie header received") : console.error("❌ Step 4: No Set-Cookie header! Cookies not received!"), t.status === 401) throw new Error("Authentication failed: Invalid credentials (401)"); if (!t.ok) throw new Error(`Sign in failed: ${t.status}`); try { const _ = await t.json(); if (_.Result && _.Result !== 0) { const g = { 1: "Account is disabled", 2: "Account is blocked", 3: "Password reset required", 7: "Account does not exist" }[_.Result] || `Unknown error (Result: ${_.Result})`; throw new Error(`Sign in failed: ${g}`); } } catch (_) { if (_ instanceof SyntaxError) { console.log("✅ Step 4: Empty response (expected), checking for cookies..."); return; } throw _; } console.log("✅ Step 4: Sign in successful"); } /** * Step 5: Fetch Private Token (PT) for AgentLink login */ async fetchPrivateToken() { const n = `${this.baseUrl}/hermes360/PlateformPublication/api/login/Agent`, s = await fetch(n, { method: "POST", credentials: "include", headers: { Accept: "application/json, text/javascript, */*; q=0.01", "Content-Type": "application/json; charset=UTF-8" }, body: JSON.stringify({ Oid: "", Token: "" }) }); if (!s.ok) throw new Error(`Failed to fetch Private Token: ${s.status}`); const a = await s.json(); if (!a.PT || !a.Oid) throw console.error("❌ Invalid Private Token response"), new Error( "Invalid Private Token response - PT or Oid is empty. This indicates missing authentication cookies (Vocalcom.Application.Token, SessionCookieToken). Check if Step 4 (SignIn) set the cookies correctly." ); return console.log("✅ Step 5: Private Token obtained successfully"), a; } } const z = { CONNECTED: "CONNECTED", DISCONNECTED: "DISCONNECTED", LOGGED_IN: "LOGGED_IN", LOGGED_OUT: "LOGGED_OUT", SESSION_START: "SESSION_START", SESSION_END: "SESSION_END", SESSION_STATE: "SESSION_STATE", AGENT_STATE: "AGENT_STATE", TELEPHONY_STATE: "TELEPHONY_STATE", RECORD_START: "RECORD_START", RECORD_STOP: "RECORD_STOP", ERROR: "ERROR", CONNECTION_ERROR: "CONNECTION_ERROR", CALL_TRANSFERRED: "CALL_TRANSFERRED", DEBUG: "DEBUG" }, qo = { Off: 0, Waiting: 1, Working: 2, Pause: 3 }, ys = { online: ["Online"], afterCall: ["Nach dem Anruf", "After call"], preview: ["Vorschau Aufruf", "Preview call"], onHold: ["Online (Kunde wartend)", "Online (client on Hold)"] }; class Go { constructor() { Se(this, "GLOABL_CONTEXT_TYPE", 0); Se(this, "TELEPHONY_CONTEXT_TYPE", 1); Se(this, "agentLink", {}); Se(this, "subscribers", []); Se(this, "logger", !1); Se(this, "campaign", null); Se(this, "config", null); Se(this, "username", null); Se(this, "password", null); Se(this, "extension", null); Se(this, "isSessionOpened", !1); Se(this, "currentAgentState", null); Se(this, "currentTelephonyState", null); Se(this, "currentCallSessionId", null); Se(this, "isOutboundUser", !1); Se(this, "PhoneNumberTypes", null); Se(this, "isLoggedIn", !1); Se(this, "authService", null); // Stores resolved credentials including PT while waiting for AgentLink to be ready Se(this, "pendingLogin", null); Se(this, "loginRetryIntervalId", null); Se(this, "loginPollingStartedAt", 0); Se(this, "LOGIN_POLLING_INTERVAL_MS", 500); Se(this, "LOGIN_POLLING_TIMEOUT_MS", 3e4); console.log("AgentLinkAdapter created"); } subscribe(n) { if (this.subscribers.includes(n)) { console.log("Subject: Observer has been attached already."); return; } this.subscribers.push(n); } unsubscribe(n) { this.subscribers = this.subscribers.filter((s) => s !== n); } notify(n, s = "", a = void 0) { this.subscribers.forEach((u) => { u.value = { state: n, message: s, code: a }; }); } setConfig(n) { if (this.config = n, n.hermesBaseUrl !== void 0 || n.useHermesAuth) { const s = n.hermesBaseUrl !== void 0 ? n.hermesBaseUrl : ""; this.authService = new Fo({ baseUrl: s }); } } init(n) { this.agentLink || this.notify(z.ERROR, "Please set the config settings"), this.removeAllIdsFromSessionStorage(), !(this.agentLink && this.agentLink.Connected) && (window.parent.Log = (s, a, u) => { this.logger && console.log(s, u); try { this.catchEvents(u); } catch (t) { console.error(t); } }, typeof window.screenRecorder > "u" && (window.screenRecorder = null), typeof window.allowDesktopSharing > "u" && (window.allowDesktopSharing = !1), window.parent.agentlink_object_path = "hermes/", window.parent.agentlink_default_protocol = "WEBSOCKET", window.parent.websock_protocol = "wss", window.parent.websock_proto = "wss", window.parent.websock_port = 443, this.agentLink = new window.AgentLinkClass(443, "wss"), this.PhoneNumberTypes = window.parent.PhoneNumberTypes || {}, Object.assign(this.agentLink, this.config), this.isOutboundUser = n, this.agentLink.attachEvent("OnConnect", (s) => this.onConnect(s)), this.agentLink.attachEvent("OnUserIdentification", () => this.onUserIdentification()), this.agentLink.attachEvent("OnAgentStateChange", (s, a, u) => this.onAgentStateChanged(s, a, u)), this.agentLink.attachEvent("OnSessionOpen", () => this.onSessionOpen()), this.agentLink.attachEvent("OnSessionClose", () => this.onSessionClose()), this.agentLink.attachEvent("OnSessionStateChange", (s, a, u, t) => this.onSessionStateChange(s, a, u, t)), this.agentLink.attachEvent("OnDisconnect", () => this.onDisconnect()), this.agentLink.attachEvent("OnTelephonyRecordStart", (s) => this.onTelephonyRecordStart(s)), this.agentLink.attachEvent("OnTelephonyRecordStop", (s) => this.onTelephonyRecordStop(s)), this.agentLink.Connect()); } isActionReady(n) { try { const s = window.TelephonySessionActionAllowed[n]; return this.agentLink.Telephony.GetSession().ActionIsReady(s); } catch { return !1; } } async login(n, s, a) { if (!(this.agentLink.LoggedIn || this.isLoggedIn)) { this.username = n, this.password = s, this.extension = a; try { if (this.authService) { const u = await this.authService.authenticate(n, s, a); this.pendingLogin = { id: u.Id.toString(), password: u.Password, station: a, pt: u.PT }; } else console.log("⚠️ Using legacy login method (no authService configured)"), this.pendingLogin = { id: n, password: s, station: a }; this._startLoginPolling(); } catch (u) { throw console.error("❌ Login failed:", u), this.pendingLogin = null, u instanceof Error ? this.notify(z.CONNECTION_ERROR, u.message) : this.notify(z.CONNECTION_ERROR, "Authentifizierung fehlgeschlagen"), u; } } } _startLoginPolling() { this.loginRetryIntervalId || (this.loginPollingStartedAt = Date.now(), this._tryLogin(), this.loginRetryIntervalId = setInterval(() => { if (Date.now() - this.loginPollingStartedAt >= this.LOGIN_POLLING_TIMEOUT_MS) { this._stopLoginRetry(), this.pendingLogin = null, this.notify( z.CONNECTION_ERROR, "Anmeldung fehlgeschlagen: AgentLink wurde nicht rechtzeitig bereit (Timeout)." ); return; } this._tryLogin(); }, this.LOGIN_POLLING_INTERVAL_MS)); } _tryLogin() { var h; if (!this.pendingLogin) return; if (this.agentLink.LoggedIn || this.isLoggedIn) { this.pendingLogin = null, this._stopLoginRetry(); return; } const n = window.AgentActionAllowed ?? ((h = window.parent) == null ? void 0 : h.AgentActionAllowed); if (!n || !this.agentLink.ActionIsReady(n.Login)) return; this._stopLoginRetry(); const { id: s, password: a, station: u, pt: t } = this.pendingLogin; this.pendingLogin = null, this.isLoggedIn = !0, console.log("✓ AgentLink login initiated", t ? "with Private Token" : "(legacy)"), this.agentLink.Login(s, a, u, t); } _stopLoginRetry() { this.loginRetryIntervalId && (clearInterval(this.loginRetryIntervalId), this.loginRetryIntervalId = null); } logout() { this.agentLink.LoggedIn && this.agentLink.Logout(), this.isLoggedIn = !1, this.pendingLogin = null, this._stopLoginRetry(), this.removeAllIdsFromSessionStorage(); } call(n, s, a) { s ? this.agentLink.Telephony.GetSession().PreviewCall(n) : this.agentLink.Telephony.ActionIsReady( window.parent.ContextActionAllowed.ManualCall ) ? this.campaign ? this.agentLink.Telephony.ManualCall( this.campaign.id, n, null, null, 1, a ) : this.notify(z.ERROR, "Es ist keine Kampagne gesetzt.") : this.notify(z.ERROR, "Manueller Anruf nicht erlaubt."); } hangup() { const n = this.agentLink.Telephony.GetSession(); n && n.Hangup(), this.isOutboundUser || this.logout(); } hold() { const n = this.agentLink.Telephony.GetSession(); n && n.Hold(); } retrieve() { const n = this.agentLink.Telephony.GetSession(); n && n.Retrieve(); } redial(n) { const s = this.agentLink.Telephony.GetSession(); s && s.Redial(n); } previewCancel() { const n = this.agentLink.Telephony.GetSession(); n && n.PreviewCancel(); } getSessionId() { if (this.agentLink.LoggedIn) { const n = this.agentLink.Telephony.GetSession(); if (n) return n.SessionId; } return null; } getSession() { if (this.agentLink.LoggedIn) { const n = this.agentLink.Telephony.GetSession(); if (n) return n; } return null; } getManualCampaigns() { const n = []; for (let s = 0; s < this.agentLink.ManualCampaigns.Count; s += 1) { const a = JSON.parse(JSON.stringify(this.agentLink.ManualCampaigns.Item(s))), u = { description: a.Description, id: a.CampaignId }; n.push(u); } return n; } setManualCamapaign(n) { this.campaign = n; } setLogger(n) { this.logger = n; } getLogger() { return this.logger; } getCampaigns() { const n = []; for (let s = 0; s < this.agentLink.Campaigns.Count; s += 1) { const a = this.agentLink.Campaigns.Item(s); let u = !0; a.State === window.CampaignStates.Close && (u = !1), n.push({ name: a.Description, queue: a.Queue, campaignId: a.CampaignId, type: a.Type, state: a.State, dialing: a.Dialing, active: u }); } return n; } getQueues() { const n = []; for (let s = 0; s < this.agentLink.Telephony.Queues.Count; s += 1) { const a = this.agentLink.Telephony.Queues.Item(s); n.push({ name: a.Description, queue: a.QueueId, active: a.EnabledBy }); } return n; } getPauseOptions() { const n = []; for (let s = 0; s < this.agentLink.PauseCodes.Count; s += 1) { const a = this.agentLink.PauseCodes.Item(s); n.push({ description: a.Description, code: a.Code, duration: a.Duration }); } return n; } requestPause(n) { this.agentLink.ActionIsReady(window.AgentActionAllowed.Pause) ? this.agentLink.RequestPause(n, 0) : this.notify(z.ERROR, "Pause aktuell nicht möglich."); } stopPause() { this.agentLink.RequestReady(); } startRecording(n) { this.isSessionOpened ? this.agentLink.Record(n) : this.notify(z.ERROR, "Keine aktive Session vorhanden."); } stopRecording() { this.agentLink.RecordStop(!0); } catchEvents(n) { n.includes("MAXRING_ATTEMPTED") && this.notify(z.ERROR, "Max. Ringversuch"), n.includes("InvalidAgentIdentification") && this.notify(z.CONNECTION_ERROR, "Ungültige Anmeldedaten"), n.includes("The phone number dialed is not valid") && this.notify(z.ERROR, "Ungültige Rufnummer"), n.includes("InvalidStationIdentification") && this.notify(z.CONNECTION_ERROR, "Keine Verbindung mit der Nebenstelle möglich"), n.includes("AgentAlreadyMonitored") && this.notify(z.CONNECTION_ERROR, "Die Nebenstelle ist bereits verbunden"), n.includes("StationNotConnected") && this.notify(z.CONNECTION_ERROR, "Station nicht verbunden – bitte SIP/WebRTC-Verbindung prüfen"), n.includes("SipStationAlreadyConnected") && this.notify(z.CONNECTION_ERROR, "Die Station wird bereits von einer anderen Sitzung verwendet"); } // Events onConnect(n) { n ? (this.notify(z.CONNECTED), this._tryLogin()) : (this.isLoggedIn = !1, this.notify(z.DISCONNECTED)); } onUserIdentification() { this.agentLink.LoggedIn ? this.notify(z.LOGGED_IN) : (this.isLoggedIn = !1, this.notify(z.LOGGED_OUT)); } onAgentStateChanged(n, s, a) { n === this.GLOABL_CONTEXT_TYPE && (this.currentAgentState = a, this.notify(z.AGENT_STATE, a, s)), n === this.TELEPHONY_CONTEXT_TYPE && (this.currentTelephonyState = a, this.notify(z.TELEPHONY_STATE, a, s)), this._tryLogin(); } getAgentState() { return this.currentAgentState; } getTelephonyState() { return this.currentTelephonyState; } onSessionOpen() { const n = this.getSession(); this.currentCallSessionId = this.getSessionId(), this.notify(z.SESSION_START, { sessionId: n.SessionId, indice: n.Indice, contactNumber: n.ContactNumber, campaignId: n.CampaignId, campaignType: n.CampaignType, campaignDescription: n.CampaignDescription }), this.isSessionOpened = !0; } onSessionClose() { this.notify(z.SESSION_END, { sessionId: this.currentCallSessionId }), this.currentCallSessionId = null, this.isSessionOpened = !1; } onSessionStateChange(n, s, a, u) { this.notify(z.SESSION_STATE, { contextType: n, sessionId: s, label: u }, a); } onDisconnect() { this.notify(z.DISCONNECTED), this.isLoggedIn = !1; } onTelephonyRecordStart(n) { this.notify(z.RECORD_START, n); } onTelephonyRecordStop(n) { this.notify(z.RECORD_STOP, n); } startQueue(n, s, a) { console.log("Starting Queue: ", a), this.agentLink.StartQueue(n, s), this.addIdToSessionStorage(s); } stopQueue(n, s, a) { console.log("Stoping Queue: ", a), this.agentLink.StopQueue(n, s), this.removeIdFromSessionStorage(s); } doInternalBlindTransfer(n) { this.isActionReady("BlindTransfer") && (this.agentLink.Telephony.GetSession().BlindTransfer(n, this.PhoneNumberTypes.Internal), this.notify(z.CALL_TRANSFERRED)); } doBlindTransfer(n, s = !1) { this.agentLink.Telephony.GetSession().BlindTransfer( n, s ? this.PhoneNumberTypes.External : this.PhoneNumberTypes.Did, "" ), this.notify(z.CALL_TRANSFERRED); } handoverCall() { this.agentLink.Telephony.GetSession().Transfer(), this.notify(z.CALL_TRANSFERRED); } doWarmHandover(n, s = !1) { this.agentLink.Telephony.GetSession().ConsultationCall( n, s ? this.PhoneNumberTypes.External : this.PhoneNumberTypes.Did, "" ), this.notify(z.CALL_TRANSFERRED); } /** * Set the provided call status for the current session * @param callStatus * @returns */ setCallStatus(n) { this.previewCancel(), this.agentLink.Telephony.GetSession().SetCallStatus( n.status, n.details, n.followupDateTime, n.followupPhoneNumber, n.followUpValidity, n.comment ); } /** * Adds the provided campaign id into 'activeCampaigns' value in the session storage * @param { string } id - campaign id */ addIdToSessionStorage(n) { const s = JSON.parse(sessionStorage.getItem("activeCampaigns")) || []; s.includes(n) || (s.push(n), sessionStorage.setItem("activeCampaigns", JSON.stringify(s))); } /** * Removes provided camapign id from the 'activeCampaign' value in the session storage * @param { string } id - campaign id */ removeIdFromSessionStorage(n) { const a = (JSON.parse(sessionStorage.getItem("activeCampaigns")) || []).filter((u) => u !== n); sessionStorage.setItem("activeCampaigns", JSON.stringify(a)); } /** * Checks if the provided campaign id is stored in the session storage * @param { string } id - campaign id * @returns { boolean } */ checkIdInSessionStorage(n) { return (JSON.parse(sessionStorage.getItem("activeCampaigns")) || []).includes(n); } /** * Removes the 'activeCampaigns' key/ values from session storage */ removeAllIdsFromSessionStorage() { sessionStorage.removeItem("activeCampaigns"); } } function Bo() { const f = {}; function n(u, t) { f[u] || (f[u] = []), f[u].push(t); } function s(u, t) { if (!f[u]) return; const h = f[u].indexOf(t); h > -1 && f[u].splice(h, 1); } function a(u, ...t) { f[u] && f[u].forEach((h) => { h(...t); }); } return { on: n, off: s, emit: a }; } function Vo(f) { return f && f.__esModule && Object.prototype.hasOwnProperty.call(f, "default") ? f.default : f; } const Wo = "jssip@3.13.6", jo = "jssip@3.13.6", Ko = !1, Yo = "sha512-Bf1ndrSuqpO87/AG56WACR7kKcCvKOzaIQROu7JUMh0qFaGOV4NuR+wsnaXa7f3/d6xhwVczczFyt1ywJmTjPg==", zo = "/jssip", Qo = {}, Jo = { type: "version", registry: !0, raw: "jssip@3.13.6", name: "jssip", escapedName: "jssip", rawSpec: "3.13.6", saveSpec: null, fetchSpec: "3.13.6" }, Xo = [ "/" ], Zo = "https://registry.npmjs.org/jssip/-/jssip-3.13.6.tgz", ea = "5af3c453b1594a822fe2ffa8a50ceadbd491b40c", ta = "jssip@3.13.6", sa = "/Users/ruslan.ibraev/kmh/dialer-vue-components", na = { url: "https://github.com/versatica/JsSIP/issues" }, ra = !1, ia = [ { name: "José Luis Millán", email: "jmillan@aliax.net", url: "https://github.com/jmillan" }, { name: "Iñaki Baz Castillo", email: "ibc@aliax.net", url: "https://inakibaz.me" } ], la = { debug: "^4.3.1", events: "^3.3.0", "sdp-transform": "^2.14.1" }, oa = !1, aa = "The Javascript SIP library", ua = { "@eslint/eslintrc": "^3.3.3", "@eslint/js": "^9.39.2", "@types/debug": "^4.1.12", "@types/events": "^3.0.3", "@types/jest": "^30.0.0", "@types/node": "^25.0.10", cpx: "^1.5.0", esbuild: "^0.27.2", eslint: "^9.39.1", "eslint-config-prettier": "^10.1.8", "eslint-plugin-jest": "^29.12.1", "eslint-plugin-prettier": "^5.5.5", globals: "^17.0.0", jest: "^30.2.0", "open-cli": "^8.0.0", pegjs: "^0.7.0", prettier: "^3.8.1", "ts-jest": "^29.4.6", typedoc: "^0.28.16", typescript: "^5.9.3", "typescript-eslint": "^8.53.1" }, ca = [ "LICENSE", "README.md", "npm-scripts.mjs", "lib" ], fa = "https://jssip.net", da = [ "sip", "websocket", "webrtc", "node", "browser", "library" ], ha = "MIT", _a = "lib/JsSIP.js", pa = "jssip", ma = { type: "git", url: "git+https://github.com/versatica/JsSIP.git" }, ga = { build: "node npm-scripts.mjs build", coverage: "node npm-scripts.mjs coverage", docs: "node npm-scripts.mjs docs", "docs:check": "node npm-scripts.mjs docs:check", "docs:watch": "node npm-scripts.mjs docs:watch", lint: "node npm-scripts.mjs lint", "lint:fix": "node npm-scripts.mjs lint:fix", release: "node npm-scripts.mjs release", test: "node npm-scripts.mjs test", "typescript:build": "node npm-scripts.mjs typescript:build" }, Ta = "JsSIP", va = "lib/JsSIP.d.ts", Sa = "3.13.6", Nl = { _from: Wo, _id: jo, _inBundle: Ko, _integrity: Yo, _location: zo, _phantomChildren: Qo, _requested: Jo, _requiredBy: Xo, _resolved: Zo, _shasum: ea, _spec: ta, _where: sa, bugs: na, bundleDependencies: ra, contributors: ia, dependencies: la, deprecated: oa, description: aa, devDependencies: ua, files: ca, homepage: fa, keywords: da, license: ha, main: _a, name: pa, repository: ma, scripts: ga, title: Ta, types: va, version: Sa }, Vi = Nl; var Ie = { USER_AGENT: `${Vi.title} ${Vi.version}`, // SIP scheme. SIP: "sip", SIPS: "sips", // End and Failure causes. causes: { // Generic error causes. CONNECTION_ERROR: "Connection Error", REQUEST_TIMEOUT: "Request Timeout", SIP_FAILURE_CODE: "SIP Failure Code", INTERNAL_ERROR: "Internal Error", // SIP error causes. BUSY: "Busy", REJECTED: "Rejected", REDIRECTED: "Redirected", UNAVAILABLE: "Unavailable", NOT_FOUND: "Not Found", ADDRESS_INCOMPLETE: "Address Incomplete", INCOMPATIBLE_SDP: "Incompatible SDP", MISSING_SDP: "Missing SDP", AUTHENTICATION_ERROR: "Authentication Error", // Session error causes. BYE: "Terminated", WEBRTC_ERROR: "WebRTC Error", CANCELED: "Canceled", NO_ANSWER: "No Answer", EXPIRES: "Expires", NO_ACK: "No ACK", DIALOG_ERROR: "Dialog Error", USER_DENIED_MEDIA_ACCESS: "User Denied Media Access", BAD_MEDIA_DESCRIPTION: "Bad Media Description", RTP_TIMEOUT: "RTP Timeout" }, SIP_ERROR_CAUSES: { REDIRECTED: [300, 301, 302, 305, 380], BUSY: [486, 600], REJECTED: [403, 603], NOT_FOUND: [404, 604], UNAVAILABLE: [480, 410, 408, 430], ADDRESS_INCOMPLETE: [484, 424], INCOMPATIBLE_SDP: [488, 606], AUTHENTICATION_ERROR: [401, 407] }, // SIP Methods. ACK: "ACK", BYE: "BYE", CANCEL: "CANCEL", INFO: "INFO", INVITE: "INVITE", MESSAGE: "MESSAGE", NOTIFY: "NOTIFY", OPTIONS: "OPTIONS", REGISTER: "REGISTER", REFER: "REFER", UPDATE: "UPDATE", SUBSCRIBE: "SUBSCRIBE", // DTMF transport methods. DTMF_TRANSPORT: { INFO: "INFO", RFC2833: "RFC2833" }, /* SIP Response Reasons * DOC: https://www.iana.org/assignments/sip-parameters * Copied from https://github.com/versatica/OverSIP/blob/master/lib/oversip/sip/constants.rb#L7 */ REASON_PHRASE: { 100: "Trying", 180: "Ringing", 181: "Call Is Being Forwarded", 182: "Queued", 183: "Session Progress", 199: "Early Dialog Terminated", // draft-ietf-sipcore-199 200: "OK", 202: "Accepted", // RFC 3265 204: "No Notification", // RFC 5839 300: "Multiple Choices", 301: "Moved Permanently", 302: "Moved Temporarily", 305: "Use Proxy", 380: "Alternative Service", 400: "Bad Request", 401: "Unauthorized", 402: "Payment Required", 403: "Forbidden", 404: "Not Found", 405: "Method Not Allowed", 406: "Not Acceptable", 407: "Proxy Authentication Required", 408: "Request Timeout", 410: "Gone", 412: "Conditional Request Failed", // RFC 3903 413: "Request Entity Too Large", 414: "Request-URI Too Long", 415: "Unsupported Media Type", 416: "Unsupported URI Scheme", 417: "Unknown Resource-Priority", // RFC 4412 420: "Bad Extension", 421: "Extension Required", 422: "Session Interval Too Small", // RFC 4028 423: "Interval Too Brief", 424: "Bad Location Information", // RFC 6442 428: "Use Identity Header", // RFC 4474 429: "Provide Referrer Identity", // RFC 3892 430: "Flow Failed", // RFC 5626 433: "Anonymity Disallowed", // RFC 5079 436: "Bad Identity-Info", // RFC 4474 437: "Unsupported Certificate", // RFC 4744 438: "Invalid Identity Header", // RFC 4744 439: "First Hop Lacks Outbound Support", // RFC 5626 440: "Max-Breadth Exceeded", // RFC 5393 469: "Bad Info Package", // draft-ietf-sipcore-info-events 470: "Consent Needed", // RFC 5360 478: "Unresolvable Destination", // Custom code copied from Kamailio. 480: "Temporarily Unavailable", 481: "Call/Transaction Does Not Exist", 482: "Loop Detected", 483: "Too Many Hops", 484: "Address Incomplete", 485: "Ambiguous", 486: "Busy Here", 487: "Request Terminated", 488: "Not Acceptable Here", 489: "Bad Event", // RFC 3265 491: "Request Pending", 493: "Undecipherable", 494: "Security Agreement Required", // RFC 3329 500: "JsSIP Internal Error", 501: "Not Implemented", 502: "Bad Gateway", 503: "Service Unavailable", 504: "Server Time-out", 505: "Version Not Supported", 513: "Message Too Large", 580: "Precondition Failure", // RFC 3312 600: "Busy Everywhere", 603: "Decline", 604: "Does Not Exist Anywhere", 606: "Not Acceptable" }, ALLOWED_METHODS: "INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO,NOTIFY,SUBSCRIBE", ACCEPTED_BODY_TYPES: "application/sdp, application/dtmf-relay", MAX_FORWARDS: 69, SESSION_EXPIRES: 90, MIN_SESSION_EXPIRES: 60, CONNECTION_RECOVERY_MAX_INTERVAL: 30, CONNECTION_RECOVERY_MIN_INTERVAL: 2 }; class Ea extends Error { constructor(n, s) { super(), this.code = 1, this.name = "CONFIGURATION_ERROR", this.parameter = n, this.value = s, this.message = this.value ? `Invalid value ${JSON.stringify(this.value)} for parameter "${this.parameter}"` : `Missing parameter: ${this.parameter}`; } } class Ca extends Error { constructor(n) { super(), this.code = 2, this.name = "INVALID_STATE_ERROR", this.status = n, this.message = `Invalid status: ${n}`; } } class Aa extends Error { constructor(n) { super(), this.code = 3, this.name = "NOT_SUPPORTED_ERROR", this.message = n; } } class ba extends Error { constructor(n) { super(), this.code = 4, this.name = "NOT_READY_ERROR", this.message = n; } } var mt = { ConfigurationError: Ea, InvalidStateError: Ca, NotSupportedError: Aa, NotReadyError: ba }, we = {}, dn, Wi; function Kn() { if (Wi) return dn; Wi = 1; const f = yt(), n = ut(); return dn = class Ol { /** * Parse the given string and returns a NameAddrHeader instance or undefined if * it is an invalid NameAddrHeader. */ static parse(a) { if (a = n.parse(a, "Name_Addr_Header"), a !== -1) return a; } constructor(a, u, t) { if (!a || !(a instanceof f)) throw new TypeError('missing or invalid "uri" parameter'); this._uri = a, this._parameters = {}, this.display_name = u; for (const h in t) Object.prototype.hasOwnProperty.call(t, h) && this.setParam(h, t[h]); } get uri() { return this._uri; } get display_name() { return this._display_name; } set display_name(a) { this._display_name = a === 0 ? "0" : a; } setParam(a, u) { a && (this._parameters[a.toLowerCase()] = typeof u > "u" || u === null ? null : u.toString()); } getParam(a) { if (a) return this._parameters[a.toLowerCase()]; } hasParam(a) { if (a) return this._parameters.hasOwnProperty(a.toLowerCase()) && !0 || !1; } deleteParam(a) { if (a = a.toLowerCase(), this._parameters.hasOwnProperty(a)) { const u = this._parameters[a]; return delete this._parameters[a], u; } } clearParams() { this._parameters = {}; } clone() { return new Ol(this._uri.clone(), this._display_name, JSON.parse(JSON.stringify(this._parameters))); } _quote(a) { return a.replace(/\\/g, "\\\\").replace(/"/g, '\\"'); } toString() { let a = this._display_name ? `"${this._quote(this._display_name)}" ` : ""; a += `<${this._uri.toString()}>`; for (const u in this._parameters) Object.prototype.hasOwnProperty.call(this._parameters, u) && (a += `;${u}`, this._parameters[u] !== null && (a += `=${this._parameters[u]}`)); return a; } }, dn; } var hn, ji; function ut() { return ji || (ji = 1, hn = function() { function f(s) { return '"' + s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\x08/g, "\\b").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\f/g, "\\f").replace(/\r/g, "\\r").replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g, escape) + '"'; } var n = { /* * Parses the input with a generated parser. If the parsing is successfull, * returns a value explicitly or implicitly specified by the grammar from * which the parser was generated (see |PEG.buildParser|). If the parsing is * unsuccessful, throws |PEG.parser.SyntaxError| describing the error. */ parse: function(s, a) { var u = { CRLF: g, DIGIT: m, ALPHA: v, HEXDIG: A, WSP: U, OCTET: H, DQUOTE: k, SP: C, HTAB: ne, alphanum: J, reserved: le, unreserved: S, mark: x, escaped: W, LWS: P, SWS: F, HCOLON: re, TEXT_UTF8_TRIM: L, TEXT_UTF8char: R, UTF8_NONASCII: y, UTF8_CONT: O, LHEX: be, token: K, token_nodot: qe, separators: tt, word: ke, STAR: Ke, SLASH: ze, EQUAL: ae, LPAREN: Qe, RPAREN: st, RAQUOT: nt, LAQUOT: Je, COMMA: G, SEMI: j, COLON: Xe, LDQUOT: Ge, RDQUOT: At, comment: se, ctext: q, quoted_string: oe, quoted_string_clean: ue, qdtext: Ee, quoted_pair: Ce, SIP_URI_noparams: he, SIP_URI: ot, uri_scheme: Be, uri_scheme_sips: us, uri_scheme_sip: cs, userinfo: Ut, user: I, user_unreserved: ie, password: ye, hostport: He, host: ft, hostname: Gs, domainlabel: Bs, toplabel: ir, IPv6reference: Vs, IPv6address: Ws, h16: B, ls32: Ze, IPv4address: qt, dec_octet: Gt, port: lr, uri_parameters: or, uri_parameter: js, transport_param: ar, user_param: ur, method_param: cr, ttl_param: fr, maddr_param: dr, lr_param: hr, other_param: _r, pname: pr, pvalue: mr, paramchar: Bt, param_unreserved: gr, headers: Tr, header: fs, hname: vr, hvalue: Sr, hnv_unreserved: Vt, Request_Response: Xl, Request_Line: Er, Request_URI: Cr, absoluteURI: Ks, hier_part: Ar, net_path: br, abs_path: ds, opaque_part: yr, uric: Wt, uric_no_slash: Rr, path_segments: Ir, segment: hs, param: Ys, pchar: jt, scheme: wr, authority: Nr, srvr: Or, reg_name: xr, query: Dr, SIP_Version: zs, INVITEm: Ur, ACKm: Lr, OPTIONSm: Pr, BYEm: kr, CANCELm: $r, REGISTERm: Mr, SUBSCRIBEm: Hr, NOTIFYm: Fr, REFERm: qr, Method: _s, Status_Line: Gr, Status_Code: Br, extension_code: Vr, Reason_Phrase: Wr, Allow_Events: Zl, Call_ID: eo, Contact: to, contact_param: ps, name_addr: Rt, display_name: ms, contact_params: Qs, c_p_q: jr, c_p_expires: Kr, delta_seconds: It, qvalue: Yr, generic_param: Ne, gen_value: zr, Content_Disposition: so, disp_type: Qr, disp_param: Js, handling_param: Jr, Content_Encoding: no, Content_Length: ro, Content_Type: io, media_type: Xr, m_type: Zr, discrete_type: ei, composite_type: ti, extension_token: gs, x_token: si, m_subtype: ni, m_parameter: Xs, m_value: ri, CSeq: lo, CSeq_value: ii, Expires: oo, Event: ao, event_type: Kt, From: uo, from_param: Zs, tag_param: en, Max_Forwards: co, Min_Expires: fo, Name_Addr_Header: ho, Proxy_Authenticate: _o, challenge: tn, other_challenge: li, auth_param: Yt, digest_cln: Ts, realm: oi, realm_value: ai, domain: ui, URI: vs, nonce: ci, nonce_value: fi, opaque: di, stale: hi, algorithm: _i, qop_options: pi, qop_value: Ss, Proxy_Require: po, Record_Route: mo, rec_route: Es, Reason: go, reason_param: sn, reason_cause: mi, Require: To, Route: vo, route_param: Cs, Subscription_State: So, substate_value: gi, subexp_params: nn, event_reason_value: Ti, Subject: Eo, Supported: Co, To: Ao, to_param: rn, Via: bo, via_param: As, via_params: ln, via_ttl: vi, via_maddr: Si, via_received: Ei, via_branch: Ci, response_port: Ai, rport: bi, sent_protocol: yi, protocol_name: Ri, transport: Ii, sent_by: wi, via_host: Ni, via_port: Oi, ttl: on, WWW_Authenticate: yo, Session_Expires: Ro, s_e_expires: xi, s_e_params: an, s_e_refresher: Di, extension_header: Io, header_value: Ui, message_body: wo, uuid_URI: No, uuid: Li, hex4: vt, hex8: Pi, hex12: ki, Refer_To: Oo, Replaces: xo, call_id: $i, replaces_param: un, to_tag: Mi, from_tag: Hi, early_flag: Fi }; if (a !== void 0) { if (u[a] === void 0) throw new Error("Invalid rule name: " + f(a) + "."); } else a = "CRLF"; var t = 0, h = 0, _ = []; function o(e) { t < h || (t > h && (h = t, _ = []), _.push(e)); } function g() { var e; return s.substr(t, 2) === `\r ` ? (e = `\r `, t += 2) : (e = null, o('"\\r\\n"')), e; } function m() { var e; return /^[0-9]/.test(s.charAt(t)) ? (e = s.charAt(t), t++) : (e = null, o("[0-9]")), e; } function v() { var e; return /^[a-zA-Z]/.test(s.charAt(t)) ? (e = s.charAt(t), t++) : (e = null, o("[a-zA-Z]")), e; } function A() { var e; return /^[0-9a-fA-F]/.test(s.charAt(t)) ? (e = s.charAt(t), t++) : (e = null, o("[0-9a-fA-F]")), e; } function U() { var e; return e = C(), e === null && (e = ne()), e; } function H() { var e; return /^[\0-\xFF]/.test(s.charAt(t)) ? (e = s.charAt(t), t++) : (e = null, o("[\\0-\\xFF]")), e; } function k() { var e; return /^["]/.test(s.charAt(t)) ? (e = s.charAt(t), t++) : (e = null, o('["]')), e; } function C() { var e; return s.charCodeAt(t) === 32 ? (e = " ", t++) : (e = null, o('" "')), e; } function ne() { var e; return s.charCodeAt(t) === 9 ? (e = " ", t++) : (e = null, o('"\\t"')), e; } function J() { var e; return /^[a-zA-Z0-9]/.test(s.charAt(t)) ? (e = s.charAt(t), t++) : (e = null, o("[a-zA-Z0-9]")), e; } function le() { var e; return s.charCodeAt(t) === 59 ? (e = ";", t++) : (e = null, o('";"')), e === null && (s.charCodeAt(t) === 47 ? (e = "/", t++) : (e = null, o('"/"')), e === null && (s.charCodeAt(t) === 63 ? (e = "?", t++) : (e = null, o('"?"')), e === null && (s.charCodeAt(t) === 58 ? (e = ":", t++) : (e = null, o('":"')), e === null && (s.charCodeAt(t) === 64 ? (e = "@", t++) : (e = null, o('"@"')), e === null && (s.charCodeAt(t) === 38 ? (e = "&", t++) : (e = null, o('"&"')), e === null && (s.charCodeAt(t) === 61 ? (e = "=", t++) : (e = null, o('"="')), e === null && (s.charCodeAt(t) === 43 ? (e = "+", t++) : (e = null, o('"+"')), e === null && (s.charCodeAt(t) === 36 ? (e = "$", t++) : (e = null, o('"$"')), e === null && (s.charCodeAt(t) === 44 ? (e = ",", t++) : (e = null, o('","'))))))))))), e; } function S() { var e; return e = J(), e === null && (e = x()), e; } function x() { var e; return s.charCodeAt(t) === 45 ? (e = "-", t++) : (e = null, o('"-"')), e === null && (s.charCodeAt(t) === 95 ? (e = "_", t++) : (e = null, o('"_"')), e === null && (s.charCodeAt(t) === 46 ? (e = ".", t++) : (e = null, o('"."')), e === null && (s.charCodeAt(t) === 33 ? (e = "!", t++) : (e = null, o('"!"')), e === null && (s.charCodeAt(t) === 126 ? (e = "~", t++) : (e = null, o('"~"')), e === null && (s.charCodeAt(t) === 42 ? (e = "*", t++) : (e = null, o('"*"')), e === null && (s.charCodeAt(t) === 39 ? (e = "'", t++) : (e = null, o(`"'"`)), e === null && (s.charCodeAt(t) === 40 ? (e = "(", t++) : (e = null, o('"("')), e === null && (s.charCodeAt(t) === 41 ? (e = ")", t++) : (e = null, o('")"')))))))))), e; } function W() { var e, r, i, l, c; return l = t, c = t, s.charCodeAt(t) === 37 ? (e = "%", t++) : (e = null, o('"%"')), e !== null ? (r = A(), r !== null ? (i = A(), i !== null ? e = [e, r, i] : (e = null, t = c)) : (e = null, t = c)) : (e = null, t = c), e !== null && (e = function(d, p) { return p.join(""); }(l, e)), e === null && (t = l), e; } function P() { var e, r, i, l, c, d; for (l = t, c = t, d = t, e = [], r = U(); r !== null; ) e.push(r), r = U(); if (e !== null ? (r = g(), r !== null ? e = [e, r] : (e = null, t = d)) : (e = null, t = d), e = e !== null ? e : "", e !== null) { if (i = U(), i !== null) for (r = []; i !== null; ) r.push(i), i = U(); else r = null; r !== null ? e = [e, r] : (e = null, t = c); } else e = null, t = c; return e !== null && (e = function(p) { return " "; }()), e === null && (t = l), e; } function F() { var e; return e = P(), e = e !== null ? e : "", e; } function re() { var e, r, i, l, c; for (l = t, c = t, e = [], r = C(), r === null && (r = ne()); r !== null; ) e.push(r), r = C(), r === null && (r = ne()); return e !== null ? (s.charCodeAt(t) === 58 ? (r = ":", t++) : (r = null, o('":"')), r !== null ? (i = F(), i !== null ? e = [e, r, i] : (e = null, t = c)) : (e = null, t = c)) : (e = null, t = c), e !== null && (e = function(d) { return ":"; }()), e === null && (t = l), e; } function L() { var e, r, i, l, c, d, p; if (c = t, d = t, r = R(), r !== null) for (e = []; r !== null; ) e.push(r), r = R(); else e = null; if (e !== null) { for (r = [], p = t, i = [], l = P(); l !== null; ) i.push(l), l = P(); for (i !== null ? (l = R(), l !== null ? i = [i, l] : (i = null, t = p)) : (i = null, t = p); i !== null; ) { for (r.push(i), p = t, i = [], l = P(); l !== null; ) i.push(l), l = P(); i !== null ? (l = R(), l !== null ? i = [i, l] : (i = null, t = p)) : (i = null, t = p); } r !== null ? e = [e, r] : (e = null, t = d); } else e = null, t = d; return e !== null && (e = function(E) { return s.substring(t, E); }(c)), e === null && (t = c), e; } function R() { var e; return /^[!-~]/.test(s.charAt(t)) ? (e = s.charAt(t), t++) : (e = null, o("[!-~]")), e === null && (e = y()), e; } function y() { var e; return /^[\x80-\uFFFF]/.test(s.charAt(t)) ? (e = s.charAt(t), t++) : (e = null, o("[\\x80-\\uFFFF]")), e; } function O() { var e; return /^[\x80-\xBF]/.test(s.charAt(t)) ? (e = s.charAt(t), t++) : (e = null, o("[\\x80-\\xBF]")), e; } function be() { var e; return e = m(), e === null && (/^[a-f]/.test(s.charAt(t)) ? (e = s.charAt(t), t++) : (e = null, o("[a-f]"))), e; } function K() { var e, r, i; if (i = t, r = J(), r === null && (s.charCodeAt(t) === 45 ? (r = "-", t++) : (r = null, o('"-"')), r === null && (s.charCodeAt(t) === 46 ? (r = ".", t++) : (r = null, o('"."')), r === null && (s.charCodeAt(t) === 33 ? (r = "!", t++) : (r = null, o('"!"')), r === null && (s.charCodeAt(t) === 37 ? (r = "%", t++) : (r = null, o('"%"')), r === null && (s.charCodeAt(t) === 42 ? (r = "*", t++) : (r = null, o('"*"')), r === null && (s.charCodeAt(t) === 95 ? (r = "_", t++) : (r = null, o('"_"')), r === null && (s.charCodeAt(t) === 43 ? (r = "+", t++) : (r = null, o('"+"')), r === null && (s.charCodeAt(t) === 96 ? (r = "`", t++) : (r = null, o('"`"')), r === null && (s.charCodeAt(t) === 39 ? (r = "'", t++) : (r = null, o(`"'"`)), r === null && (s.charCodeAt(t) === 126 ? (r = "~", t++) : (r = null, o('"~"')))))))))))), r !== null) for (e = []; r !== null; ) e.push(r), r = J(), r === null && (s.charCodeAt(t) === 45 ? (r = "-", t++) : (r = null, o('"-"')), r === null && (s.charCodeAt(t) === 46 ? (r = ".", t++) : (r = null, o('"."')), r === null && (s.charCodeAt(t) === 33 ? (r = "!", t++) : (r = null, o('"!"')), r === null && (s.charCodeAt(t) === 37 ? (r = "%", t++) : (r = null, o('"%"')), r === null && (s.charCodeAt(t) === 42 ? (r = "*", t++) : (r = null, o('"*"')), r === null && (s.charCodeAt(t) === 95 ? (r = "_", t++) : (r = null, o('"_"')), r === null && (s.charCodeAt(t) === 43 ? (r = "+", t++) : (r = null, o('"+"')), r === null && (s.charCodeAt(t) === 96 ? (r = "`", t++) : (r = null, o('"`"')), r === null && (s.charCodeAt(t) === 39 ? (r = "'", t++) : (r = null, o(`"'"`)), r === null && (s.charCodeAt(t) === 126 ? (r = "~", t++) : (r = null, o('"~"')))))))))))); else e = null; return e !== null && (e = function(l) { return s.substring(t, l); }(i)), e === null && (t = i), e; } function qe() { var e, r, i; if (i = t, r = J(), r === null && (s.charCodeAt(t) === 45 ? (r = "-", t++) : (r = null, o('"-"