@ahoy-ai/web 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @ahoy-ai/web
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - caff64b: The chat says when it can't reach support. A message whose every send attempt got no HTTP response from the Ahoy API (a network error or a timeout each time: offline, a host that doesn't resolve, a dropped connection) is now told apart from one the API answered with an error. In the web chat panel such a message, once it has failed, reads "Couldn't reach support. Tap to retry." on touch screens or "Couldn't reach support. Click to retry." when a mouse or trackpad is the main pointer (`(pointer: fine)`), and the whole line retries it; other failures keep "Not sent" and Retry. While such a message is still being tried, a line above the composer says "Can't reach support right now. We'll keep trying." (in place of the offline banner, which may not be true then), in a polite `aria-live` region. Once such a message has failed, the offline or reconnecting banner stays hidden too (the web panel still shows it if the browser reports no network). All three strings (`chat.unreachable`, `message.unreachable`, `message.unreachableClick`) ship in all 20 languages; React Native always uses the "Tap" wording. In `@ahoy-ai/core`: `ChatMessage.failureReason` and `OutboxItem.failureReason` (`'unreachable' | 'error'`, type `SendFailureReason`), `ChatState.unreachable`, and `isUnreachable(error)`. Sending works as before: 5 automatic attempts with backoff, Retry, and resending on reconnect and foreground.
8
+ - 3fa49b7: A deleted app stands down. When an app is deleted in the Ahoy dashboard, the API answers 410 `app_deleted` on every `/sdk/v1` route and closes the app's sockets. The SDK now treats that answer, at startup or mid-session, as final for the session: no launcher, no chat panel (an open one closes), `Ahoy.open()` does nothing and warns once in the console, nothing more is sent (no reconnects, polling, events, profile updates or push registration), and one console line says why. The one exception is `deleteData()`: the API accepts an end user's data deletion for a deleted app, so the SDK still sends it (token refresh and `DELETE /devices/me`, never a new registration), clears the data on the device and resolves; if an older API answers 410, it still clears the local data and resolves, with one console line saying the server copy was not deleted. A realtime `error` frame with code `app_deleted` stops the SDK without another request. Queued events and the stored session are kept, and nothing is cached: the SDK asks the API again on the next page load or app launch, so an app restored in the dashboard (within 30 days) works again with the same visitors and history. Developers can see it as the `app_deleted` event (`onEvent`), the `app_deleted` status in the core state, `getState().appDeleted` on `window.Ahoy`, and the `useAhoyAppDeleted()` hook in `@ahoy-ai/react`, to hide their own Support button. The panel's `stopped` message carries `{ reason: 'app_deleted' }` (an optional payload within protocol 1; older loaders ignore it).
9
+
10
+ On websites, the loader (`ahoy.js`, and the loader bundled in `@ahoy-ai/web` and `@ahoy-ai/react`) now checks first: at `configure`, alongside the page-idle wait, it sends `GET <api>/sdk/v1/apps/<appId>/status` (a CORS simple request: no cookies, no custom headers, no preflight; the browser may reuse the answer for 5 minutes). On 410 `app_deleted` it creates nothing (no iframe, no launcher, no panel download, no config request), sets `getState().appDeleted`, sends the `app_deleted` event to `onEvent` listeners and logs one console line; `open()` does nothing and warns once, and `deleteData()` loads the panel hidden for that one call. Every other outcome fails open and loads the panel as before: 200, 404 for an App ID that never existed (a typo keeps showing the launcher), other errors, a network error, a Content-Security-Policy that blocks the request, or no answer within 3 seconds. The panel's own 410 handling stays as a second line of defence. Sites with a strict Content-Security-Policy add the Ahoy API to `connect-src` for the check (without it the chat loads as usual).
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [caff64b]
15
+ - Updated dependencies [3fa49b7]
16
+ - @ahoy-ai/core@0.2.0
17
+
3
18
  ## 0.1.1
4
19
 
5
20
  ### Patch Changes
package/README.md CHANGED
@@ -39,7 +39,7 @@ The npm entry is the loader only (about 5 KB gzip): no panel, no Preact, no runt
39
39
 
40
40
  ## `window.Ahoy`
41
41
 
42
- The same names as the mobile SDK where they apply: `configure`, `identify`, `setMetadata`, `track`, `open`, `close`, `onEvent`, `logout`, `deleteData`, `appearance`, `runSetupCheck`. For framework wrappers: `getState()` (`{ ready, open, unread }`) and `subscribe(listener)`.
42
+ The same names as the mobile SDK where they apply: `configure`, `identify`, `setMetadata`, `track`, `open`, `close`, `onEvent`, `logout`, `deleteData`, `appearance`, `runSetupCheck`. For framework wrappers: `getState()` (`{ ready, open, unread, appDeleted }`) and `subscribe(listener)`.
43
43
 
44
44
  - Calls made before the panel is ready are queued. Methods that return a promise resolve once the call is queued for the panel: a refused identity token arrives as an `identity_rejected` event (`Ahoy.onEvent`), and the setup check result is logged in the browser console.
45
45
  - `identify({ token })` takes the same HS256 token as mobile, signed by **your server**. The identity secret never ships to the browser: mint the token in a server route and fetch it after login.
@@ -48,12 +48,14 @@ The same names as the mobile SDK where they apply: `configure`, `identify`, `set
48
48
 
49
49
  ## How it works
50
50
 
51
- - **Loader** (`ahoy.js`, in your page): draws the launcher (a round button in your published accent color, with an unread badge), creates the panel iframe at page idle, and talks to it over `postMessage` (ADR 0017's message table; every message is `{ channel: 'ahoy', protocol: 1, type, payload }`, and both sides check the sender's origin). It adds no inline script or style to your page: strict sites only need `script-src` and `frame-src` for the CDN.
51
+ - **Loader** (`ahoy.js`, in your page): draws the launcher (a round button in your published accent color, with an unread badge), creates the panel iframe at page idle, and talks to it over `postMessage` (ADR 0017's message table; every message is `{ channel: 'ahoy', protocol: 1, type, payload }`, and both sides check the sender's origin). It adds no inline script or style to your page. Before it creates the panel, it checks that the app still exists (below), from your page to the Ahoy API. Sites with a strict Content-Security-Policy allow `script-src` and `frame-src` for the CDN and `connect-src` for the API (`https://api.dev.ahoysupport.com` today); without `connect-src` the browser blocks the check and the chat loads as usual.
52
52
  - **Panel** (`frame.html` on the CDN): `@ahoy-ai/core` with browser adapters and a Preact chat UI. It holds the session (its own `localStorage`, which your page's scripts can't read; browsers partition it per site), the history cache (IndexedDB) and the WebSocket (`/ws?token=`). In private windows or with storage blocked, the session lives in memory and a reload starts a new one.
53
53
  - **Layout**: a 400 × 700 panel 20 px from the side on desktop, as high above the bottom as the launcher; under 640 px the panel covers the viewport with its close button always visible. The launcher hides while the panel is open.
54
54
  - **Launcher place**: the side and the bottom offset (0 to 200 px, default bottom right, 20 px up) come from the published chat design (the dashboard's chat design editor, or `ahoy_set_chat_design`), so the button can clear a cookie bar or a bottom navigation. A side set in code (`data-position`, `position`) wins over the published side. The panel waits up to 3 seconds for the published design before the launcher appears, so it shows once, in place.
55
55
  - **Accessibility**: the panel is a labelled dialog; focus moves to the message field on open and back to the launcher on close, Escape closes, Tab stays inside, and new support messages are announced through a live region.
56
+ - **Sending**: messages go out one at a time in order. Network errors, timeouts, 429 and 5xx retry with backoff; after 5 attempts the message shows a retry action, and it is retried on its own when the socket reconnects or the tab becomes visible again. When no attempt got any answer from the Ahoy API (offline, or the host can't be reached), a polite live line above the composer says "Can't reach support right now. We'll keep trying." while it is still being tried, and the failed message reads "Couldn't reach support. Tap to retry." on touch screens or "… Click to retry." with a mouse or trackpad (the whole line retries). A message the API answered with an error shows "Not sent" with Retry.
56
57
  - **Photos**: a file picker (the phone's own picker offers the camera), resized on a canvas to 2,048 px on the longest edge as JPEG, then uploaded with the same presigned POST as mobile. Queued photos keep their bytes in IndexedDB, so they survive a reload.
58
+ - **Deleted apps**: when the app was deleted in the Ahoy dashboard, the API answers 410 `app_deleted`. The loader asks first: at `configure`, alongside the page-idle wait, it sends `GET <api>/sdk/v1/apps/<appId>/status` (no cookies, no custom headers, so no preflight; the browser may reuse the answer for 5 minutes). On 410 `app_deleted` it creates nothing: no iframe, no launcher, no panel download and no config request: the page fetches nothing from Ahoy beyond `ahoy.js` (on the script-tag route) and this check. Any other answer (including 404 for an App ID that never existed, so a typo still shows the launcher), a network error, a blocked request or no answer within 3 seconds loads the panel as before; the check never delays the panel past the 3 seconds the idle wait can already take. The panel's own check stays as a second line: it learns about the deletion at startup (from `GET /config` or the registration), before it answers `ready`, so the launcher never appears; if the app is deleted during a visit, an open panel closes and the launcher is removed. `Ahoy.open()` then does nothing and warns once in the console, `getState().appDeleted` is `true`, `onEvent` listeners get an `app_deleted` event, and the panel sends nothing more (no reconnects or polling). `Ahoy.deleteData()` still works: the panel sends the end user's data deletion, which the API accepts for a deleted app, and clears the data stored in the browser. When the loader's check found the app deleted, `deleteData()` loads the panel hidden for that one call. Nothing is stored: the next page load asks again (the browser may reuse the status answer for up to 5 minutes), so an app restored in the dashboard within 30 days works again with the same visitors and history.
57
59
  - **Allowed websites**: the panel sends your page's origin (from the referrer) when it registers, and again on every token refresh and device update, so a returning visitor's stored session is checked too. If the app lists allowed websites (dashboard App settings → Web) and yours isn't one, the API refuses (403 `origin_not_allowed`): the launcher never appears (or is removed, when the list changed during a visit), the panel sends nothing more until the page reloads, and the console says why.
58
60
  - **`apiUrl`**: used only with `environment: 'development'` (a local API while building). In production the panel always uses the hosted API and the console says the `apiUrl` was ignored.
59
61
  - **Setup check** (`environment: 'development'`): sent once per SDK version and origin, the first time the chat's socket connects (or falls back to polling), so it can report the origin, the config and the socket.
@@ -79,14 +81,14 @@ CDN layout (what `ahoy-sdk/.github/workflows/deploy-cdn.yml` publishes): `dist/a
79
81
 
80
82
  - `http://localhost:4400/web/v1/ahoy.js`, `.../frame.html`: the loader and the panel (with the frame CSP).
81
83
  - `http://127.0.0.1:4400/demo/?app=app_demo`: a host page with the two-line snippet (`&api=`, `&launcher=false`, `&position=left`, `&language=`, `&open=1` to call `Ahoy.open()` through the stub).
82
- - `http://127.0.0.1:4400/demo/strict?app=app_demo`: the same under `script-src`/`frame-src` only, no inline script.
84
+ - `http://127.0.0.1:4400/demo/strict?app=app_demo`: the same under a strict CSP (`script-src`/`frame-src` the panel server, `connect-src` the API), no inline script; `&connect=none` leaves the API out of `connect-src` (the loader's status check is blocked and fails open).
83
85
 
84
86
  `AHOY_API_URL` (default `http://localhost:8787`) is the API the panel uses there; `PORT` changes the port; `AHOY_DEV_WATCH=1` rebuilds on each request. The local API must accept the panel's origin in CORS (CONTRACT C10).
85
87
 
86
88
  ### End-to-end tests
87
89
 
88
- `pnpm e2e` starts `e2e/mock-api.mjs` (a mock `/sdk/v1` and `/ws` on port 8840) and the panel server, then runs `e2e/chat.spec.ts` on Chromium, Firefox and WebKit: anonymous chat (registration as web with the origin, the web setup check, `page` metadata), SPA navigation, photo upload (resized to 2,048 px, JPEG), identify with a token and a refused token, reconnect after a dropped socket, the unread badge across a reload, the mobile viewport, the desktop panel size, keyboard and axe (WCAG 2.1 AA), the queue stub, a strict-CSP page, a refused origin, and a returning visitor refused at the token refresh or a device update after the allowed list changed.
90
+ `pnpm e2e` starts `e2e/mock-api.mjs` (a mock `/sdk/v1` and `/ws` on port 8840) and the panel server, then runs `e2e/chat.spec.ts` on Chromium, Firefox and WebKit: anonymous chat (registration as web with the origin, the web setup check, `page` metadata), SPA navigation, photo upload (resized to 2,048 px, JPEG), identify with a token and a refused token, reconnect after a dropped socket, the unread badge across a reload, the mobile viewport, the desktop panel size, keyboard and axe (WCAG 2.1 AA), the queue stub, a strict-CSP page (with and without the API in `connect-src`), a deleted app (no iframe, no panel download, only the status request), a refused origin, and a returning visitor refused at the token refresh or a device update after the allowed list changed.
89
91
 
90
- Against a real API: `AHOY_E2E_API_URL=http://localhost:8787 AHOY_E2E_APP_ID=app_demo pnpm e2e` (tests that need the mock's controls are skipped). `AHOY_E2E_REUSE=1` reuses servers you started yourself.
92
+ Against a real API: `AHOY_E2E_API_URL=http://localhost:8787 AHOY_E2E_APP_ID=app_demo pnpm e2e` (tests that need the mock's controls are skipped). `AHOY_E2E_REUSE=1` reuses servers you started yourself; `AHOY_E2E_PANEL_PORT=8841` runs the panel server on another port than 4400, and `AHOY_E2E_MOCK_PORT=8842` the mock API on another port than 8840.
91
93
 
92
94
  Browsers: `npx playwright install chromium-headless-shell firefox webkit` (userland, in `~/.cache/ms-playwright`). WebKit on Linux needs `libevent-2.1-7t64 libavif16 libmanette-0.2-0` (`sudo npx playwright install-deps webkit`). On the build machine they were installed without sudo: `apt-get download` of those packages plus `libgav1-1` and `libhidapi-hidraw0`, extracted with `dpkg -x` to `~/.local/opt/playwright-webkit-deps`, and symlinked into `~/.cache/ms-playwright/webkit-2388/minibrowser-wpe/sys/lib` (redo after a Playwright browser update).
package/dist/ahoy.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! Ahoy web loader 0.1.1 | MIT */
2
- "use strict";(()=>{var M=Object.defineProperty;var k=(o,e,t)=>e in o?M(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var s=(o,e,t)=>k(o,typeof e!="symbol"?e+"":e,t);var _=[1],v="ahoy";var g=new Set(["ready","unread","resize","event","opened","closed","stopped"]);function b(o){return{channel:v,protocol:1,...o}}function A(o,e){if(!o||typeof o!="object")return null;let t=o;return t.channel!==v||typeof t.type!="string"||!e.has(t.type)||typeof t.protocol!="number"||!_.includes(t.protocol)?null:o}function y(o){if(!o)return null;try{let{protocol:e,host:t}=new URL(o);return e!=="http:"&&e!=="https:"?null:`${e}//${t}`.toLowerCase()}catch{return null}}function a(o,e){for(let[t,i]of Object.entries(e))o.style.setProperty(t,i,"important")}var d=2147483e3;var w="http://www.w3.org/2000/svg",C="M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v9a2.5 2.5 0 0 1-2.5 2.5H10l-4.2 3.6A.5.5 0 0 1 5 20.2V17h0a2.5 2.5 0 0 1-1-2Z",u=class{constructor(e,t){s(this,"doc",e);s(this,"host");s(this,"button");s(this,"badge");s(this,"label");s(this,"unread",0);this.label=t.label,this.host=e.createElement("div"),this.host.setAttribute("data-ahoy","launcher"),a(this.host,{position:"fixed","z-index":String(d),margin:"0"});let i=this.host.attachShadow?this.host.attachShadow({mode:"open"}):this.host,n=e.createElement("button");n.type="button",n.setAttribute("aria-haspopup","dialog"),n.setAttribute("aria-expanded","false"),n.setAttribute("aria-controls",t.controls),a(n,{all:"initial",display:"flex","align-items":"center","justify-content":"center",width:"56px",height:"56px","border-radius":"50%",cursor:"pointer","box-shadow":"0 6px 20px rgba(15, 23, 42, 0.24)",transition:"transform .15s ease",position:"relative",outline:"none"}),n.addEventListener("click",t.onClick),n.addEventListener("pointerenter",()=>a(n,{transform:"scale(1.06)"})),n.addEventListener("pointerleave",()=>a(n,{transform:"none"})),n.addEventListener("focus",()=>{H(n,":focus-visible")&&a(n,{"box-shadow":"0 0 0 3px #ffffff, 0 0 0 6px #111827"})}),n.addEventListener("blur",()=>a(n,{"box-shadow":"0 6px 20px rgba(15, 23, 42, 0.24)"}));let r=e.createElementNS(w,"svg");r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("width","28"),r.setAttribute("height","28"),r.setAttribute("aria-hidden","true"),r.setAttribute("focusable","false");let l=e.createElementNS(w,"path");l.setAttribute("d",C),l.setAttribute("fill","#ffffff"),r.appendChild(l),n.appendChild(r);let p=e.createElement("span");p.setAttribute("aria-hidden","true"),a(p,{all:"initial",position:"absolute",top:"-4px",right:"-4px","min-width":"20px",height:"20px",padding:"0 6px","box-sizing":"border-box","border-radius":"10px",background:"#d92d20",color:"#ffffff",font:'600 12px/20px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',"text-align":"center",border:"2px solid #ffffff",display:"none"}),n.appendChild(p),i.appendChild(n),this.button=n,this.badge=p,this.setPosition(t.position,t.bottomOffset),this.setAccent(t.accent),this.render()}setPosition(e,t){a(this.host,{bottom:`${t}px`,...e==="left"?{left:"20px",right:"auto"}:{right:"20px",left:"auto"}})}setAccent(e){a(this.button,{background:e})}setLabel(e){this.label=e,this.render()}setUnread(e){this.unread=Math.max(0,Math.floor(e)),this.render()}setExpanded(e){this.button.setAttribute("aria-expanded",String(e))}setVisible(e){a(this.host,{display:e?"block":"none"})}focus(){this.button.focus()}remove(){this.host.remove()}render(){let e=this.unread;this.badge.textContent=e>99?"99+":String(e),a(this.badge,{display:e>0?"block":"none"}),this.button.setAttribute("aria-label",e>0?`${this.label} (${e})`:this.label)}};function H(o,e){try{return o.matches(e)}catch{return!0}}var E=Symbol.for("ahoy.history"),m="ahoy:locationchange";function x(o,e){let t=o.history;if(!t[E]){t[E]=!0;for(let r of["pushState","replaceState"]){let l=t[r];t[r]=function(...p){let f=l.apply(this,p);return o.dispatchEvent(new Event(m)),f}}}let i=null,n=()=>{let r=o.location.pathname||"/";r!==i&&(i=r,e(r))};return o.addEventListener("popstate",n),o.addEventListener(m,n),n(),()=>{o.removeEventListener("popstate",n),o.removeEventListener(m,n)}}var T="https://cdn.ahoysupport.com",R="/web/v1/frame.html",W=/^app_[A-Za-z0-9]+$/,U=400,O=700,c=20,N=200,D=640,$=1e4,V=500,F=0,h=class{constructor(e={window,document},t=null){s(this,"env",e);s(this,"scriptSrc",t);s(this,"options",null);s(this,"frameUrl","");s(this,"frameOrigin","");s(this,"iframe",null);s(this,"launcher",null);s(this,"state",{ready:!1,open:!1,unread:0});s(this,"listeners",new Set);s(this,"subscribers",new Set);s(this,"queue",[]);s(this,"wantOpen",!1);s(this,"mode","panel");s(this,"panelHeight",O);s(this,"position","right");s(this,"bottomOffset",c);s(this,"title","Support");s(this,"currentAppearance",{});s(this,"cleanups",[]);s(this,"idleHandle",null);s(this,"returnFocus",null);s(this,"stopped",!1);s(this,"warned",new Set);s(this,"frameId",`ahoy-frame-${++F}`)}configure(e){if(!e||typeof e.appId!="string"||!W.test(e.appId)){console.error('[Ahoy] configure: appId must look like "app_XXXX".');return}let t=this.options;this.options={...e},e.appearance&&(this.currentAppearance={...e.appearance});let i=this.resolveFrameUrl(e);if(t&&t.appId===e.appId&&t.apiUrl===e.apiUrl&&i===this.frameUrl&&(this.iframe||this.idleHandle)){this.applyLauncherVisibility(),this.state.ready&&this.sendConfigure();return}this.teardown(t===null),this.frameUrl=i,this.frameOrigin=y(i)??"";let n=l=>this.onMessage(l);this.env.window.addEventListener("message",n);let r=()=>this.layout();this.env.window.addEventListener("resize",r),this.cleanups.push(()=>this.env.window.removeEventListener("message",n),()=>this.env.window.removeEventListener("resize",r)),this.wantOpen?this.mount():this.idleHandle=q(this.env.window,()=>this.mount())}identify(e){return this.send({type:"identify",payload:[e]}),Promise.resolve()}setMetadata(e,t){return this.send({type:"setMetadata",payload:t?[e,t]:[e]}),Promise.resolve()}track(e,t,i){let n=[e];(t!==void 0||i!==void 0)&&n.push(t),i!==void 0&&n.push(i),this.send({type:"track",payload:n})}open(){this.stopped||(this.wantOpen=!0,this.options&&(this.iframe||this.mount(),this.state.ready&&this.post({type:"open"})))}close(){this.wantOpen=!1,this.state.ready&&this.post({type:"close"})}onEvent(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}logout(){return this.send({type:"logout"}),Promise.resolve()}deleteData(){return this.send({type:"deleteData"}),Promise.resolve()}get appearance(){return this.currentAppearance}set appearance(e){this.currentAppearance={...e??{}},this.options&&(this.options.appearance=this.currentAppearance),this.state.ready&&this.sendConfigure()}runSetupCheck(){return this.send({type:"runSetupCheck"}),Promise.resolve()}registerPush(){return this.warnOnce("registerPush","[Ahoy] registerPush: push is not available on web yet."),Promise.resolve({registered:!1,reason:"unsupported"})}notificationBehavior(){return this.warnOnce("notificationBehavior","[Ahoy] notificationBehavior: not available on web."),null}onOffer(e){return this.warnOnce("onOffer","[Ahoy] onOffer: offer cards are not shown on web."),()=>{}}setPaywalls(e){this.warnOnce("setPaywalls","[Ahoy] setPaywalls: paywall offers are not shown on web.")}getState(){return this.state}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}destroy(){this.teardown(),this.options=null,this.wantOpen=!1}resolveFrameUrl(e){return`${(e.cdnUrl??null??y(this.scriptSrc)??T).replace(/\/+$/,"")}${R}`}mount(){if(this.idleHandle?.(),this.idleHandle=null,this.iframe||!this.options)return;let e=this.env.document,t=e.createElement("iframe");t.id=this.frameId,t.title=this.title,t.src=this.frameUrl,t.referrerPolicy="origin",t.setAttribute("allow","clipboard-write"),t.setAttribute("data-ahoy","panel"),a(t,{position:"fixed",border:"0",margin:"0",padding:"0","z-index":String(d+1),background:"transparent","color-scheme":"normal","max-width":"100vw",display:"none"});let i=Date.now(),n=setInterval(()=>{if(this.state.ready||this.stopped){clearInterval(n);return}if(Date.now()-i>$){clearInterval(n),this.warnOnce("not_ready",`[Ahoy] The chat panel (${this.frameUrl}) did not start. A Content-Security-Policy without frame-src ${this.frameOrigin}, an ad blocker or a network error can cause this.`);return}this.sendConfigure()},V);t.addEventListener("load",()=>{!this.state.ready&&!this.stopped&&this.sendConfigure()}),(e.body??e.documentElement).appendChild(t),this.iframe=t,this.cleanups.push(()=>{t.remove(),clearInterval(n)})}sendConfigure(){let e=this.options;if(!e)return;let t=this.env.document;this.postNow({type:"configure",payload:{appId:e.appId,environment:e.environment==="development"?"development":"production",hostOrigin:this.env.window.location.origin,language:e.language,pageLanguage:t.documentElement.lang||void 0,appearance:this.currentAppearance,apiUrl:e.apiUrl,position:e.position==="left"||e.position==="right"?e.position:void 0,protocol:1}})}onMessage(e){if(!this.iframe||e.source!==this.iframe.contentWindow||e.origin!==this.frameOrigin)return;let t=A(e.data,g);if(t)switch(t.type){case"ready":return this.onReady(t.payload);case"unread":return this.setState({unread:Math.max(0,Number(t.payload?.count)||0)});case"resize":return this.mode=t.payload?.mode==="full"?"full":"panel",typeof t.payload?.height=="number"&&t.payload.height>0&&(this.panelHeight=Math.min(O,t.payload.height)),this.layout();case"event":return this.dispatch(t.payload);case"opened":return this.onOpened();case"closed":return this.onClosed();case"stopped":return this.onStopped()}}onStopped(){this.stopped=!0,this.queue=[],this.wantOpen=!1,this.launcher?.remove(),this.launcher=null,this.setState({ready:!1,open:!1,unread:0}),this.layout()}onReady(e){typeof e?.title=="string"&&e.title&&(this.title=e.title),(e?.position==="left"||e?.position==="right")&&(this.position=e.position),typeof e?.bottomOffset=="number"&&Number.isFinite(e.bottomOffset)&&(this.bottomOffset=Math.min(N,Math.max(0,Math.round(e.bottomOffset))));let t=typeof e?.accent=="string"?e.accent:"#0A6FD8";if(this.iframe&&(this.iframe.title=this.title),this.options?.launcher!==!1){if(this.launcher)this.launcher.setAccent(t),this.launcher.setPosition(this.position,this.bottomOffset),this.launcher.setLabel(this.title);else{this.launcher=new u(this.env.document,{position:this.position,bottomOffset:this.bottomOffset,accent:t,label:this.title,controls:this.frameId,onClick:()=>this.open()}),(this.env.document.body??this.env.document.documentElement).appendChild(this.launcher.host);let r=this.launcher;this.cleanups.push(()=>r.remove())}this.launcher.setUnread(this.state.unread)}let i=!this.state.ready;if(this.setState({ready:!0}),this.applyLauncherVisibility(),this.layout(),!i)return;let n=this.queue;this.queue=[];for(let r of n)this.post(r);this.cleanups.push(x(this.env.window,r=>this.post({type:"page",payload:{path:r}}))),this.wantOpen&&this.post({type:"open"})}onOpened(){let e=this.env.document.activeElement;this.returnFocus=e instanceof HTMLElement&&e!==this.iframe?e:null,this.wantOpen=!0,this.setState({open:!0}),this.launcher?.setExpanded(!0),this.applyLauncherVisibility(),this.layout(),this.iframe?.focus()}onClosed(){this.wantOpen=!1,this.mode="panel",this.setState({open:!1}),this.launcher?.setExpanded(!1),this.applyLauncherVisibility(),this.layout();let e=this.launcher?null:this.returnFocus;this.launcher?this.launcher.focus():e?.isConnected&&e.focus(),this.returnFocus=null}applyLauncherVisibility(){if(!this.launcher)return;let e=this.options?.launcher!==!1&&this.state.ready&&!this.state.open;this.launcher.setVisible(e)}layout(){let e=this.iframe;if(!e)return;if(!this.state.open){a(e,{display:"none"});return}let t=this.env.window,i=this.mode==="full"||t.innerWidth<D;if(e.setAttribute("data-mode",i?"full":"panel"),i){a(e,{display:"block",top:"0",left:"0",right:"auto",bottom:"auto",width:"100%",height:"100%","border-radius":"0","box-shadow":"none"});return}let n=Math.max(320,Math.min(this.panelHeight,t.innerHeight-this.bottomOffset-c));a(e,{display:"block",top:"auto",bottom:`${this.bottomOffset}px`,left:this.position==="left"?`${c}px`:"auto",right:this.position==="left"?"auto":`${c}px`,width:`${U}px`,height:`${n}px`,"border-radius":"16px","box-shadow":"0 12px 48px rgba(15, 23, 42, 0.28)"})}send(e){this.stopped||(this.state.ready?this.post(e):this.queue.push(e))}post(e){this.postNow(e)}postNow(e){let t=this.iframe?.contentWindow;if(!(!t||!this.frameOrigin))try{t.postMessage(b(e),this.frameOrigin)}catch{}}dispatch(e){if(!(!e||typeof e.type!="string"))for(let t of[...this.listeners])try{t(e)}catch(i){console.warn("[Ahoy] onEvent listener threw",i)}}setState(e){let t={...this.state,...e};if(!(t.ready===this.state.ready&&t.open===this.state.open&&t.unread===this.state.unread)){this.state=t,this.launcher?.setUnread(t.unread);for(let i of[...this.subscribers])i()}}warnOnce(e,t){this.options?.environment!=="development"||this.warned.has(e)||(this.warned.add(e),console.warn(t))}teardown(e=!1){this.idleHandle?.(),this.idleHandle=null;for(let t of this.cleanups.splice(0))t();this.iframe=null,this.launcher=null,this.stopped=!1,this.mode="panel",e||(this.queue=[]),this.setState({ready:!1,open:!1,unread:0})}};function q(o,e){let t=o.requestIdleCallback;if(typeof t=="function"){let n=t.call(o,e,{timeout:3e3});return()=>o.cancelIdleCallback?.(n)}let i=setTimeout(e,200);return()=>clearTimeout(i)}function z(o){return o instanceof h||!!o&&typeof o.subscribe=="function"}function P(o=window,e=null,t=null){let i=o,n=i.Ahoy;if(z(n))return n;let r=new h({window:o,document:o.document},e);i.Ahoy=r,t&&r.configure(t);let l=n;return B(r,l&&Array.isArray(l.q)?l.q:[]),r}function B(o,e){for(let t of e){if(!Array.isArray(t)||typeof t[0]!="string")continue;let i=o[t[0]];if(typeof i!="function")continue;let n=t[1]&&typeof t[1]=="object"?Array.from(t[1]):[];try{i.apply(o,n)}catch(r){console.warn(`[Ahoy] Ahoy.${t[0]} from the snippet failed`,r)}}}function L(o){if(!o)return null;let e=f=>o.getAttribute(`data-${f}`)??void 0,t=e("app-id");if(!t)return null;let i={appId:t},n=e("environment");(n==="development"||n==="production")&&(i.environment=n);let r=e("api-url");r&&(i.apiUrl=r);let l=e("language");l&&(i.language=l),e("launcher")==="false"&&(i.launcher=!1);let p=e("position");return(p==="left"||p==="right")&&(i.position=p),i}var S=document.currentScript instanceof HTMLScriptElement?document.currentScript:document.querySelector('script[data-app-id][src*="ahoy.js"]');P(window,S?.src??null,L(S));})();
1
+ /*! Ahoy web loader 0.2.0 | MIT */
2
+ "use strict";(()=>{var k=Object.defineProperty;var H=(i,e,t)=>e in i?k(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var r=(i,e,t)=>H(i,typeof e!="symbol"?e+"":e,t);var I="https://api.dev.ahoysupport.com";function v(i,e){return(i==="development"&&e||I).replace(/\/+$/,"")}var T=[1],g="ahoy";var b=new Set(["ready","unread","resize","event","opened","closed","stopped"]);function A(i){return{channel:g,protocol:1,...i}}function w(i,e){if(!i||typeof i!="object")return null;let t=i;return t.channel!==g||typeof t.type!="string"||!e.has(t.type)||typeof t.protocol!="number"||!T.includes(t.protocol)?null:i}function y(i){if(!i)return null;try{let{protocol:e,host:t}=new URL(i);return e!=="http:"&&e!=="https:"?null:`${e}//${t}`.toLowerCase()}catch{return null}}function l(i,e){for(let[t,n]of Object.entries(e))i.style.setProperty(t,n,"important")}var u=2147483e3;var E="http://www.w3.org/2000/svg",C="M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v9a2.5 2.5 0 0 1-2.5 2.5H10l-4.2 3.6A.5.5 0 0 1 5 20.2V17h0a2.5 2.5 0 0 1-1-2Z",c=class{constructor(e,t){r(this,"doc",e);r(this,"host");r(this,"button");r(this,"badge");r(this,"label");r(this,"unread",0);this.label=t.label,this.host=e.createElement("div"),this.host.setAttribute("data-ahoy","launcher"),l(this.host,{position:"fixed","z-index":String(u),margin:"0"});let n=this.host.attachShadow?this.host.attachShadow({mode:"open"}):this.host,o=e.createElement("button");o.type="button",o.setAttribute("aria-haspopup","dialog"),o.setAttribute("aria-expanded","false"),o.setAttribute("aria-controls",t.controls),l(o,{all:"initial",display:"flex","align-items":"center","justify-content":"center",width:"56px",height:"56px","border-radius":"50%",cursor:"pointer","box-shadow":"0 6px 20px rgba(15, 23, 42, 0.24)",transition:"transform .15s ease",position:"relative",outline:"none"}),o.addEventListener("click",t.onClick),o.addEventListener("pointerenter",()=>l(o,{transform:"scale(1.06)"})),o.addEventListener("pointerleave",()=>l(o,{transform:"none"})),o.addEventListener("focus",()=>{D(o,":focus-visible")&&l(o,{"box-shadow":"0 0 0 3px #ffffff, 0 0 0 6px #111827"})}),o.addEventListener("blur",()=>l(o,{"box-shadow":"0 6px 20px rgba(15, 23, 42, 0.24)"}));let s=e.createElementNS(E,"svg");s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("width","28"),s.setAttribute("height","28"),s.setAttribute("aria-hidden","true"),s.setAttribute("focusable","false");let a=e.createElementNS(E,"path");a.setAttribute("d",C),a.setAttribute("fill","#ffffff"),s.appendChild(a),o.appendChild(s);let p=e.createElement("span");p.setAttribute("aria-hidden","true"),l(p,{all:"initial",position:"absolute",top:"-4px",right:"-4px","min-width":"20px",height:"20px",padding:"0 6px","box-sizing":"border-box","border-radius":"10px",background:"#d92d20",color:"#ffffff",font:'600 12px/20px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',"text-align":"center",border:"2px solid #ffffff",display:"none"}),o.appendChild(p),n.appendChild(o),this.button=o,this.badge=p,this.setPosition(t.position,t.bottomOffset),this.setAccent(t.accent),this.render()}setPosition(e,t){l(this.host,{bottom:`${t}px`,...e==="left"?{left:"20px",right:"auto"}:{right:"20px",left:"auto"}})}setAccent(e){l(this.button,{background:e})}setLabel(e){this.label=e,this.render()}setUnread(e){this.unread=Math.max(0,Math.floor(e)),this.render()}setExpanded(e){this.button.setAttribute("aria-expanded",String(e))}setVisible(e){l(this.host,{display:e?"block":"none"})}focus(){this.button.focus()}remove(){this.host.remove()}render(){let e=this.unread;this.badge.textContent=e>99?"99+":String(e),l(this.badge,{display:e>0?"block":"none"}),this.button.setAttribute("aria-label",e>0?`${this.label} (${e})`:this.label)}};function D(i,e){try{return i.matches(e)}catch{return!0}}var O=Symbol.for("ahoy.history"),m="ahoy:locationchange";function x(i,e){let t=i.history;if(!t[O]){t[O]=!0;for(let s of["pushState","replaceState"]){let a=t[s];t[s]=function(...p){let h=a.apply(this,p);return i.dispatchEvent(new Event(m)),h}}}let n=null,o=()=>{let s=i.location.pathname||"/";s!==n&&(n=s,e(s))};return i.addEventListener("popstate",o),i.addEventListener(m,o),o(),()=>{i.removeEventListener("popstate",o),i.removeEventListener(m,o)}}var R="https://cdn.ahoysupport.com",W="/web/v1/frame.html",N=/^app_[A-Za-z0-9]+$/,$=400,P=700,f=20,F=200,q=640,V=1e4,z=500,Y=3e3,B=0,d=class{constructor(e={window,document},t=null){r(this,"env",e);r(this,"scriptSrc",t);r(this,"options",null);r(this,"frameUrl","");r(this,"frameOrigin","");r(this,"iframe",null);r(this,"launcher",null);r(this,"state",{ready:!1,open:!1,unread:0,appDeleted:!1});r(this,"listeners",new Set);r(this,"subscribers",new Set);r(this,"queue",[]);r(this,"wantOpen",!1);r(this,"mode","panel");r(this,"panelHeight",P);r(this,"position","right");r(this,"bottomOffset",f);r(this,"title","Support");r(this,"currentAppearance",{});r(this,"cleanups",[]);r(this,"idleHandle",null);r(this,"returnFocus",null);r(this,"stopped",!1);r(this,"gate","live");r(this,"mountWanted",!1);r(this,"warned",new Set);r(this,"frameId",`ahoy-frame-${++B}`)}configure(e){if(!e||typeof e.appId!="string"||!N.test(e.appId)){console.error('[Ahoy] configure: appId must look like "app_XXXX".');return}let t=this.options;this.options={...e},e.appearance&&(this.currentAppearance={...e.appearance});let n=this.resolveFrameUrl(e);if(t&&t.appId===e.appId&&t.apiUrl===e.apiUrl&&n===this.frameUrl&&(this.iframe||this.idleHandle||this.gate!=="live")){this.applyLauncherVisibility(),this.state.ready&&this.sendConfigure();return}this.teardown(t===null),this.frameUrl=n,this.frameOrigin=y(n)??"";let o=a=>this.onMessage(a);this.env.window.addEventListener("message",o);let s=()=>this.layout();this.env.window.addEventListener("resize",s),this.cleanups.push(()=>this.env.window.removeEventListener("message",o),()=>this.env.window.removeEventListener("resize",s)),this.checkStatus(e),this.wantOpen?this.mount():this.idleHandle=X(this.env.window,()=>this.mount())}identify(e){return this.send({type:"identify",payload:[e]}),Promise.resolve()}setMetadata(e,t){return this.send({type:"setMetadata",payload:t?[e,t]:[e]}),Promise.resolve()}track(e,t,n){let o=[e];(t!==void 0||n!==void 0)&&o.push(t),n!==void 0&&o.push(n),this.send({type:"track",payload:o})}open(){if(this.stopped){this.state.appDeleted&&!this.warned.has("open_app_deleted")&&(this.warned.add("open_app_deleted"),console.warn(`[Ahoy] open() ignored: app ${this.options?.appId??""} was deleted in the Ahoy dashboard.`));return}this.wantOpen=!0,this.options&&(this.iframe||this.mount(),this.state.ready&&this.post({type:"open"}))}close(){this.wantOpen=!1,this.state.ready&&this.post({type:"close"})}onEvent(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}logout(){return this.send({type:"logout"}),Promise.resolve()}deleteData(){return this.stopped&&this.state.appDeleted?this.iframe?this.post({type:"deleteData"}):this.eraseWithoutPanel():this.send({type:"deleteData"}),Promise.resolve()}get appearance(){return this.currentAppearance}set appearance(e){this.currentAppearance={...e??{}},this.options&&(this.options.appearance=this.currentAppearance),this.state.ready&&this.sendConfigure()}runSetupCheck(){return this.send({type:"runSetupCheck"}),Promise.resolve()}registerPush(){return this.warnOnce("registerPush","[Ahoy] registerPush: push is not available on web yet."),Promise.resolve({registered:!1,reason:"unsupported"})}notificationBehavior(){return this.warnOnce("notificationBehavior","[Ahoy] notificationBehavior: not available on web."),null}onOffer(e){return this.warnOnce("onOffer","[Ahoy] onOffer: offer cards are not shown on web."),()=>{}}setPaywalls(e){this.warnOnce("setPaywalls","[Ahoy] setPaywalls: paywall offers are not shown on web.")}getState(){return this.state}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}destroy(){this.teardown(),this.options=null,this.wantOpen=!1}resolveFrameUrl(e){return`${(e.cdnUrl??null??y(this.scriptSrc)??R).replace(/\/+$/,"")}${W}`}checkStatus(e){let t=this.env.window;if(typeof t.fetch!="function")return;this.gate="pending";let n=typeof AbortController=="function"?new AbortController:null,o=!1,s=M=>{if(!o){if(o=!0,clearTimeout(a),M)return this.onAppDeletedBeforePanel();this.gate="live",this.mountWanted&&this.mount()}},a=setTimeout(()=>{n?.abort(),s(!1)},Y);this.cleanups.push(()=>{o=!0,clearTimeout(a),n?.abort()});let p=`${v(e.environment,e.apiUrl)}/sdk/v1/apps/${e.appId}/status`,h;try{h=t.fetch(p,{credentials:"omit",...n?{signal:n.signal}:{}})}catch{return s(!1)}h.then(G).then(s,()=>s(!1))}onAppDeletedBeforePanel(){let e=this.queue.some(t=>t.type==="deleteData");this.gate="deleted",this.stopped=!0,this.queue=[],this.wantOpen=!1,this.mountWanted=!1,this.idleHandle?.(),this.idleHandle=null,this.setState({appDeleted:!0}),console.warn(`[Ahoy] App ${this.options?.appId??""} was deleted in the Ahoy dashboard, so the chat is off and nothing is loaded. It checks again on the next page load; restoring the app in the dashboard turns the chat back on (within 5 minutes for visitors who already saw it off).`),this.dispatch({type:"app_deleted",at:Date.now()}),e&&this.eraseWithoutPanel()}eraseWithoutPanel(){this.queue=[{type:"deleteData"}],this.mount(!0)}mount(e=!1){if(this.idleHandle?.(),this.idleHandle=null,this.iframe||!this.options)return;if(!e&&this.gate!=="live"){this.mountWanted=this.gate==="pending";return}let t=this.env.document,n=t.createElement("iframe");n.id=this.frameId,n.title=this.title,n.src=this.frameUrl,n.referrerPolicy="origin",n.setAttribute("allow","clipboard-write"),n.setAttribute("data-ahoy","panel"),l(n,{position:"fixed",border:"0",margin:"0",padding:"0","z-index":String(u+1),background:"transparent","color-scheme":"normal","max-width":"100vw",display:"none"});let o=Date.now(),s=setInterval(()=>{if(this.state.ready||this.stopped){clearInterval(s);return}if(Date.now()-o>V){clearInterval(s),this.warnOnce("not_ready",`[Ahoy] The chat panel (${this.frameUrl}) did not start. A Content-Security-Policy without frame-src ${this.frameOrigin}, an ad blocker or a network error can cause this.`);return}this.sendConfigure()},z);n.addEventListener("load",()=>{!this.state.ready&&!this.stopped&&this.sendConfigure()}),(t.body??t.documentElement).appendChild(n),this.iframe=n,this.cleanups.push(()=>{n.remove(),clearInterval(s)})}sendConfigure(){let e=this.options;if(!e)return;let t=this.env.document;this.postNow({type:"configure",payload:{appId:e.appId,environment:e.environment==="development"?"development":"production",hostOrigin:this.env.window.location.origin,language:e.language,pageLanguage:t.documentElement.lang||void 0,appearance:this.currentAppearance,apiUrl:e.apiUrl,position:e.position==="left"||e.position==="right"?e.position:void 0,protocol:1}})}onMessage(e){if(!this.iframe||e.source!==this.iframe.contentWindow||e.origin!==this.frameOrigin)return;let t=w(e.data,b);if(t)switch(t.type){case"ready":return this.onReady(t.payload);case"unread":return this.setState({unread:Math.max(0,Number(t.payload?.count)||0)});case"resize":return this.mode=t.payload?.mode==="full"?"full":"panel",typeof t.payload?.height=="number"&&t.payload.height>0&&(this.panelHeight=Math.min(P,t.payload.height)),this.layout();case"event":return this.dispatch(t.payload);case"opened":return this.onOpened();case"closed":return this.onClosed();case"stopped":return this.onStopped(t.payload?.reason)}}onStopped(e){let t=e==="app_deleted"&&this.queue.some(n=>n.type==="deleteData");this.stopped=!0,this.queue=[],this.wantOpen=!1,this.launcher?.remove(),this.launcher=null,this.setState({ready:!1,open:!1,unread:0,appDeleted:e==="app_deleted"}),this.layout(),t&&this.post({type:"deleteData"})}onReady(e){if(this.stopped){let s=this.queue;this.queue=[];for(let a of s)this.post(a);return}typeof e?.title=="string"&&e.title&&(this.title=e.title),(e?.position==="left"||e?.position==="right")&&(this.position=e.position),typeof e?.bottomOffset=="number"&&Number.isFinite(e.bottomOffset)&&(this.bottomOffset=Math.min(F,Math.max(0,Math.round(e.bottomOffset))));let t=typeof e?.accent=="string"?e.accent:"#0A6FD8";if(this.iframe&&(this.iframe.title=this.title),this.options?.launcher!==!1){if(this.launcher)this.launcher.setAccent(t),this.launcher.setPosition(this.position,this.bottomOffset),this.launcher.setLabel(this.title);else{this.launcher=new c(this.env.document,{position:this.position,bottomOffset:this.bottomOffset,accent:t,label:this.title,controls:this.frameId,onClick:()=>this.open()}),(this.env.document.body??this.env.document.documentElement).appendChild(this.launcher.host);let s=this.launcher;this.cleanups.push(()=>s.remove())}this.launcher.setUnread(this.state.unread)}let n=!this.state.ready;if(this.setState({ready:!0}),this.applyLauncherVisibility(),this.layout(),!n)return;let o=this.queue;this.queue=[];for(let s of o)this.post(s);this.cleanups.push(x(this.env.window,s=>this.post({type:"page",payload:{path:s}}))),this.wantOpen&&this.post({type:"open"})}onOpened(){let e=this.env.document.activeElement;this.returnFocus=e instanceof HTMLElement&&e!==this.iframe?e:null,this.wantOpen=!0,this.setState({open:!0}),this.launcher?.setExpanded(!0),this.applyLauncherVisibility(),this.layout(),this.iframe?.focus()}onClosed(){this.wantOpen=!1,this.mode="panel",this.setState({open:!1}),this.launcher?.setExpanded(!1),this.applyLauncherVisibility(),this.layout();let e=this.launcher?null:this.returnFocus;this.launcher?this.launcher.focus():e?.isConnected&&e.focus(),this.returnFocus=null}applyLauncherVisibility(){if(!this.launcher)return;let e=this.options?.launcher!==!1&&this.state.ready&&!this.state.open;this.launcher.setVisible(e)}layout(){let e=this.iframe;if(!e)return;if(!this.state.open){l(e,{display:"none"});return}let t=this.env.window,n=this.mode==="full"||t.innerWidth<q;if(e.setAttribute("data-mode",n?"full":"panel"),n){l(e,{display:"block",top:"0",left:"0",right:"auto",bottom:"auto",width:"100%",height:"100%","border-radius":"0","box-shadow":"none"});return}let o=Math.max(320,Math.min(this.panelHeight,t.innerHeight-this.bottomOffset-f));l(e,{display:"block",top:"auto",bottom:`${this.bottomOffset}px`,left:this.position==="left"?`${f}px`:"auto",right:this.position==="left"?"auto":`${f}px`,width:`${$}px`,height:`${o}px`,"border-radius":"16px","box-shadow":"0 12px 48px rgba(15, 23, 42, 0.28)"})}send(e){this.stopped||(this.state.ready?this.post(e):this.queue.push(e))}post(e){this.postNow(e)}postNow(e){let t=this.iframe?.contentWindow;if(!(!t||!this.frameOrigin))try{t.postMessage(A(e),this.frameOrigin)}catch{}}dispatch(e){if(!(!e||typeof e.type!="string"))for(let t of[...this.listeners])try{t(e)}catch(n){console.warn("[Ahoy] onEvent listener threw",n)}}setState(e){let t={...this.state,...e};if(!(t.ready===this.state.ready&&t.open===this.state.open&&t.unread===this.state.unread&&t.appDeleted===this.state.appDeleted)){this.state=t,this.launcher?.setUnread(t.unread);for(let n of[...this.subscribers])n()}}warnOnce(e,t){this.options?.environment!=="development"||this.warned.has(e)||(this.warned.add(e),console.warn(t))}teardown(e=!1){this.idleHandle?.(),this.idleHandle=null;for(let t of this.cleanups.splice(0))t();this.iframe=null,this.launcher=null,this.stopped=!1,this.gate="live",this.mountWanted=!1,this.mode="panel",e||(this.queue=[]),this.setState({ready:!1,open:!1,unread:0,appDeleted:!1})}};async function G(i){return i.status!==410?!1:(await i.json())?.error?.code==="app_deleted"}function X(i,e){let t=i.requestIdleCallback;if(typeof t=="function"){let o=t.call(i,e,{timeout:3e3});return()=>i.cancelIdleCallback?.(o)}let n=setTimeout(e,200);return()=>clearTimeout(n)}function j(i){return i instanceof d||!!i&&typeof i.subscribe=="function"}function _(i=window,e=null,t=null){let n=i,o=n.Ahoy;if(j(o))return o;let s=new d({window:i,document:i.document},e);n.Ahoy=s,t&&s.configure(t);let a=o;return Q(s,a&&Array.isArray(a.q)?a.q:[]),s}function Q(i,e){for(let t of e){if(!Array.isArray(t)||typeof t[0]!="string")continue;let n=i[t[0]];if(typeof n!="function")continue;let o=t[1]&&typeof t[1]=="object"?Array.from(t[1]):[];try{n.apply(i,o)}catch(s){console.warn(`[Ahoy] Ahoy.${t[0]} from the snippet failed`,s)}}}function L(i){if(!i)return null;let e=h=>i.getAttribute(`data-${h}`)??void 0,t=e("app-id");if(!t)return null;let n={appId:t},o=e("environment");(o==="development"||o==="production")&&(n.environment=o);let s=e("api-url");s&&(n.apiUrl=s);let a=e("language");a&&(n.language=a),e("launcher")==="false"&&(n.launcher=!1);let p=e("position");return(p==="left"||p==="right")&&(n.position=p),n}var S=document.currentScript instanceof HTMLScriptElement?document.currentScript:document.querySelector('script[data-app-id][src*="ahoy.js"]');_(window,S?.src??null,L(S));})();
@@ -0,0 +1,7 @@
1
+ export declare const DEFAULT_API_URL: string;
2
+ /**
3
+ * The API the SDK uses: the page's `apiUrl` only in development (a local or self-hosted API while
4
+ * building); production always uses the built-in hosted API.
5
+ */
6
+ export declare function apiUrlFor(environment: string | undefined, apiUrl: string | undefined): string;
7
+ //# sourceMappingURL=api-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-url.d.ts","sourceRoot":"","sources":["../../src/api-url.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,eAAe,QAGW,CAAC;AAExC;;;GAGG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAE7F"}
@@ -0,0 +1,11 @@
1
+ export const DEFAULT_API_URL = typeof __AHOY_DEFAULT_API_URL__ === 'string' && __AHOY_DEFAULT_API_URL__
2
+ ? __AHOY_DEFAULT_API_URL__
3
+ : 'https://api.dev.ahoysupport.com';
4
+ /**
5
+ * The API the SDK uses: the page's `apiUrl` only in development (a local or self-hosted API while
6
+ * building); production always uses the built-in hosted API.
7
+ */
8
+ export function apiUrlFor(environment, apiUrl) {
9
+ return ((environment === 'development' && apiUrl) || DEFAULT_API_URL).replace(/\/+$/, '');
10
+ }
11
+ //# sourceMappingURL=api-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-url.js","sourceRoot":"","sources":["../../src/api-url.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,eAAe,GAC1B,OAAO,wBAAwB,KAAK,QAAQ,IAAI,wBAAwB;IACtE,CAAC,CAAC,wBAAwB;IAC1B,CAAC,CAAC,iCAAiC,CAAC;AAExC;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,WAA+B,EAAE,MAA0B;IACnF,OAAO,CAAC,CAAC,WAAW,KAAK,aAAa,IAAI,MAAM,CAAC,IAAI,eAAe,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC5F,CAAC"}
@@ -8,6 +8,12 @@ export declare const DEFAULT_CDN_URL = "https://cdn.ahoysupport.com";
8
8
  /** The panel of this loader's major (ADR 0017: loader and panel always match on `/v1/`). */
9
9
  export declare const FRAME_PATH = "/web/v1/frame.html";
10
10
  export declare const FULL_SCREEN_BELOW = 640;
11
+ /**
12
+ * The longest the panel waits for the app status check before it loads anyway (fail-open). The
13
+ * same as the idle wait's own limit, so on a slow API the launcher is no later than an idle wait
14
+ * that runs out today.
15
+ */
16
+ export declare const STATUS_TIMEOUT_MS = 3000;
11
17
  export interface AhoyWebOptions {
12
18
  /** Public App ID from the dashboard, e.g. `app_XXXX`. */
13
19
  appId: string;
@@ -43,6 +49,12 @@ export interface AhoyWebState {
43
49
  open: boolean;
44
50
  /** Unread support messages, for a badge on your own button. */
45
51
  unread: number;
52
+ /**
53
+ * The app was deleted in the Ahoy dashboard: no launcher, no panel, `open()` does nothing.
54
+ * Checked again on the next page load (the browser may reuse the answer for up to 5 minutes);
55
+ * an app restored in the dashboard works again.
56
+ */
57
+ appDeleted: boolean;
46
58
  }
47
59
  /**
48
60
  * `window.Ahoy`: the same names as the mobile SDK where they apply (ADR 0017). Calls made before
@@ -108,6 +120,9 @@ export declare class AhoyLoader implements AhoyWeb {
108
120
  private returnFocus;
109
121
  /** The panel stopped for good (`stopped`): no launcher, nothing sent, until a reload. */
110
122
  private stopped;
123
+ private gate;
124
+ /** The panel was due (page idle or `open()`) while the status check ran. */
125
+ private mountWanted;
111
126
  private readonly warned;
112
127
  private readonly frameId;
113
128
  constructor(env?: Environment,
@@ -135,6 +150,23 @@ export declare class AhoyLoader implements AhoyWeb {
135
150
  subscribe(listener: () => void): () => void;
136
151
  destroy(): void;
137
152
  private resolveFrameUrl;
153
+ /**
154
+ * Asks the API whether the app still exists, so a deleted app's site loads no panel (no panel
155
+ * download, no config request). A CORS simple request (no custom headers, no cookies, no
156
+ * preflight) that the browser may answer from its HTTP cache (`max-age=300`). Only 410
157
+ * `app_deleted` stops the loader; any other answer, a network error, a Content-Security-Policy
158
+ * without the API in `connect-src`, or no answer within `STATUS_TIMEOUT_MS` loads the panel as
159
+ * before, and the panel's own 410 handling still applies.
160
+ */
161
+ private checkStatus;
162
+ /** 410 `app_deleted` before the panel loaded: nothing is created, as if the panel had stopped. */
163
+ private onAppDeletedBeforePanel;
164
+ /**
165
+ * `deleteData()` for a deleted app whose panel never loaded: the end user's erasure still goes
166
+ * (the API accepts it), so the panel loads hidden for that one call. It stops for the deleted app
167
+ * and the queued deletion goes through `onStopped`.
168
+ */
169
+ private eraseWithoutPanel;
138
170
  private mount;
139
171
  private sendConfigure;
140
172
  private onMessage;
@@ -1 +1 @@
1
- {"version":3,"file":"ahoy.d.ts","sourceRoot":"","sources":["../../../src/loader/ahoy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAEf,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAOL,KAAK,gBAAgB,EAItB,MAAM,gBAAgB,CAAC;AAKxB;;;GAGG;AACH,eAAO,MAAM,eAAe,gCAAgC,CAAC;AAG7D,4FAA4F;AAC5F,eAAO,MAAM,UAAU,uBAAuB,CAAC;AAS/C,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAMrC,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,6FAA6F;IAC7F,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,+DAA+D;AAC/D,MAAM,WAAW,YA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AO,CAAC,eAAe;IAQvB;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW;IAoCnB,kGAAkG;IAClG,OAAO,CAAC,uBAAuB;IAoB/B;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,KAAK;IA2Db,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,SAAS;IA2BjB;;;OAGG;IACH,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,OAAO;IAyDf,OAAO,CAAC,QAAQ;IAYhB,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,uBAAuB;IAM/B;;;OAGG;IACH,OAAO,CAAC,MAAM;IAyCd,OAAO,CAAC,IAAI;IAMZ,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,QAAQ;IAehB,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,QAAQ;CAajB;AAqBD,iFAAiF;AACjF,wBAAgB,UAAU,IAAI,OAAO,CAEpC"}
@@ -1,3 +1,4 @@
1
+ import { apiUrlFor } from '../api-url.js';
1
2
  import { PANEL_TYPES, PROTOCOL, envelope, originOf, readMessage, } from '../protocol.js';
2
3
  import { Launcher } from './launcher.js';
3
4
  import { watchNavigation } from './navigation.js';
@@ -21,6 +22,12 @@ export const FULL_SCREEN_BELOW = 640;
21
22
  const READY_TIMEOUT_MS = 10_000;
22
23
  /** How often `configure` is sent again until `ready`. */
23
24
  const HANDSHAKE_MS = 500;
25
+ /**
26
+ * The longest the panel waits for the app status check before it loads anyway (fail-open). The
27
+ * same as the idle wait's own limit, so on a slow API the launcher is no later than an idle wait
28
+ * that runs out today.
29
+ */
30
+ export const STATUS_TIMEOUT_MS = 3_000;
24
31
  let frameCounter = 0;
25
32
  /** The loader behind `window.Ahoy`: launcher, iframe, postMessage and the queue. */
26
33
  export class AhoyLoader {
@@ -31,7 +38,7 @@ export class AhoyLoader {
31
38
  frameOrigin = '';
32
39
  iframe = null;
33
40
  launcher = null;
34
- state = { ready: false, open: false, unread: 0 };
41
+ state = { ready: false, open: false, unread: 0, appDeleted: false };
35
42
  listeners = new Set();
36
43
  subscribers = new Set();
37
44
  queue = [];
@@ -48,6 +55,9 @@ export class AhoyLoader {
48
55
  returnFocus = null;
49
56
  /** The panel stopped for good (`stopped`): no launcher, nothing sent, until a reload. */
50
57
  stopped = false;
58
+ gate = 'live';
59
+ /** The panel was due (page idle or `open()`) while the status check ran. */
60
+ mountWanted = false;
51
61
  warned = new Set();
52
62
  frameId = `ahoy-frame-${++frameCounter}`;
53
63
  constructor(env = { window, document },
@@ -70,7 +80,7 @@ export class AhoyLoader {
70
80
  previous.appId === options.appId &&
71
81
  previous.apiUrl === options.apiUrl &&
72
82
  frameUrl === this.frameUrl &&
73
- (this.iframe || this.idleHandle)) {
83
+ (this.iframe || this.idleHandle || this.gate !== 'live')) {
74
84
  // Same app: forward the new settings without reloading the panel; its `ready` answers
75
85
  // with the launcher's place.
76
86
  this.applyLauncherVisibility();
@@ -87,6 +97,8 @@ export class AhoyLoader {
87
97
  const onResize = () => this.layout();
88
98
  this.env.window.addEventListener('resize', onResize);
89
99
  this.cleanups.push(() => this.env.window.removeEventListener('message', onMessage), () => this.env.window.removeEventListener('resize', onResize));
100
+ // A deleted app gets no panel at all; the check runs alongside the idle wait.
101
+ this.checkStatus(options);
90
102
  // Hidden at page idle, so the unread badge is right before the first open (ADR 0017).
91
103
  if (this.wantOpen)
92
104
  this.mount();
@@ -110,8 +122,14 @@ export class AhoyLoader {
110
122
  this.send({ type: 'track', payload: args });
111
123
  }
112
124
  open() {
113
- if (this.stopped)
125
+ if (this.stopped) {
126
+ if (this.state.appDeleted && !this.warned.has('open_app_deleted')) {
127
+ // Every environment (like the panel's own line): a site's own button does nothing now.
128
+ this.warned.add('open_app_deleted');
129
+ console.warn(`[Ahoy] open() ignored: app ${this.options?.appId ?? ''} was deleted in the Ahoy dashboard.`);
130
+ }
114
131
  return;
132
+ }
115
133
  this.wantOpen = true;
116
134
  if (!this.options)
117
135
  return;
@@ -136,7 +154,15 @@ export class AhoyLoader {
136
154
  return Promise.resolve();
137
155
  }
138
156
  deleteData() {
139
- this.send({ type: 'deleteData' });
157
+ // A deleted app's panel still takes this one call: the API accepts the erasure.
158
+ if (this.stopped && this.state.appDeleted) {
159
+ if (this.iframe)
160
+ this.post({ type: 'deleteData' });
161
+ else
162
+ this.eraseWithoutPanel();
163
+ }
164
+ else
165
+ this.send({ type: 'deleteData' });
140
166
  return Promise.resolve();
141
167
  }
142
168
  get appearance() {
@@ -191,11 +217,91 @@ export class AhoyLoader {
191
217
  const base = options.cdnUrl ?? built ?? originOf(this.scriptSrc) ?? DEFAULT_CDN_URL;
192
218
  return `${base.replace(/\/+$/, '')}${FRAME_PATH}`;
193
219
  }
194
- mount() {
220
+ /**
221
+ * Asks the API whether the app still exists, so a deleted app's site loads no panel (no panel
222
+ * download, no config request). A CORS simple request (no custom headers, no cookies, no
223
+ * preflight) that the browser may answer from its HTTP cache (`max-age=300`). Only 410
224
+ * `app_deleted` stops the loader; any other answer, a network error, a Content-Security-Policy
225
+ * without the API in `connect-src`, or no answer within `STATUS_TIMEOUT_MS` loads the panel as
226
+ * before, and the panel's own 410 handling still applies.
227
+ */
228
+ checkStatus(options) {
229
+ const win = this.env.window;
230
+ if (typeof win.fetch !== 'function')
231
+ return;
232
+ this.gate = 'pending';
233
+ const controller = typeof AbortController === 'function' ? new AbortController() : null;
234
+ let settled = false;
235
+ const settle = (deleted) => {
236
+ if (settled)
237
+ return;
238
+ settled = true;
239
+ clearTimeout(timer);
240
+ if (deleted)
241
+ return this.onAppDeletedBeforePanel();
242
+ this.gate = 'live';
243
+ if (this.mountWanted)
244
+ this.mount();
245
+ };
246
+ const timer = setTimeout(() => {
247
+ controller?.abort();
248
+ settle(false);
249
+ }, STATUS_TIMEOUT_MS);
250
+ this.cleanups.push(() => {
251
+ settled = true;
252
+ clearTimeout(timer);
253
+ controller?.abort();
254
+ });
255
+ const url = `${apiUrlFor(options.environment, options.apiUrl)}/sdk/v1/apps/${options.appId}/status`;
256
+ let request;
257
+ try {
258
+ request = win.fetch(url, {
259
+ credentials: 'omit',
260
+ ...(controller ? { signal: controller.signal } : {}),
261
+ });
262
+ }
263
+ catch {
264
+ return settle(false);
265
+ }
266
+ request.then(isAppDeletedAnswer).then(settle, () => settle(false));
267
+ }
268
+ /** 410 `app_deleted` before the panel loaded: nothing is created, as if the panel had stopped. */
269
+ onAppDeletedBeforePanel() {
270
+ const erase = this.queue.some((m) => m.type === 'deleteData');
271
+ this.gate = 'deleted';
272
+ this.stopped = true;
273
+ this.queue = [];
274
+ this.wantOpen = false;
275
+ this.mountWanted = false;
276
+ this.idleHandle?.();
277
+ this.idleHandle = null;
278
+ this.setState({ appDeleted: true });
279
+ // Every environment (the panel's own line is never printed: it never loads).
280
+ console.warn(`[Ahoy] App ${this.options?.appId ?? ''} was deleted in the Ahoy dashboard, so the chat is ` +
281
+ 'off and nothing is loaded. It checks again on the next page load; restoring the app in ' +
282
+ 'the dashboard turns the chat back on (within 5 minutes for visitors who already saw it off).');
283
+ this.dispatch({ type: 'app_deleted', at: Date.now() });
284
+ if (erase)
285
+ this.eraseWithoutPanel();
286
+ }
287
+ /**
288
+ * `deleteData()` for a deleted app whose panel never loaded: the end user's erasure still goes
289
+ * (the API accepts it), so the panel loads hidden for that one call. It stops for the deleted app
290
+ * and the queued deletion goes through `onStopped`.
291
+ */
292
+ eraseWithoutPanel() {
293
+ this.queue = [{ type: 'deleteData' }];
294
+ this.mount(true);
295
+ }
296
+ mount(force = false) {
195
297
  this.idleHandle?.();
196
298
  this.idleHandle = null;
197
299
  if (this.iframe || !this.options)
198
300
  return;
301
+ if (!force && this.gate !== 'live') {
302
+ this.mountWanted = this.gate === 'pending';
303
+ return;
304
+ }
199
305
  const doc = this.env.document;
200
306
  const iframe = doc.createElement('iframe');
201
307
  iframe.id = this.frameId;
@@ -292,23 +398,36 @@ export class AhoyLoader {
292
398
  case 'closed':
293
399
  return this.onClosed();
294
400
  case 'stopped':
295
- return this.onStopped();
401
+ return this.onStopped(message.payload?.reason);
296
402
  }
297
403
  }
298
404
  /**
299
405
  * The panel refused to run (its console line says why): the launcher goes, the frame stays
300
406
  * hidden and loaded so `open()` doesn't start it again, and later calls are dropped.
301
407
  */
302
- onStopped() {
408
+ onStopped(reason) {
409
+ // A deletion asked for before the panel was ready still goes, for a deleted app.
410
+ const erase = reason === 'app_deleted' && this.queue.some((m) => m.type === 'deleteData');
303
411
  this.stopped = true;
304
412
  this.queue = [];
305
413
  this.wantOpen = false;
306
414
  this.launcher?.remove();
307
415
  this.launcher = null;
308
- this.setState({ ready: false, open: false, unread: 0 });
416
+ this.setState({ ready: false, open: false, unread: 0, appDeleted: reason === 'app_deleted' });
309
417
  this.layout();
418
+ if (erase)
419
+ this.post({ type: 'deleteData' });
310
420
  }
311
421
  onReady(payload) {
422
+ if (this.stopped) {
423
+ // The panel loaded only for a deleted app's `deleteData()`, and the app is live again
424
+ // (a status answer from the browser cache): the deletion goes, nothing is shown.
425
+ const queued = this.queue;
426
+ this.queue = [];
427
+ for (const message of queued)
428
+ this.post(message);
429
+ return;
430
+ }
312
431
  if (typeof payload?.title === 'string' && payload.title)
313
432
  this.title = payload.title;
314
433
  if (payload?.position === 'left' || payload?.position === 'right') {
@@ -467,7 +586,8 @@ export class AhoyLoader {
467
586
  const next = { ...this.state, ...patch };
468
587
  if (next.ready === this.state.ready &&
469
588
  next.open === this.state.open &&
470
- next.unread === this.state.unread) {
589
+ next.unread === this.state.unread &&
590
+ next.appDeleted === this.state.appDeleted) {
471
591
  return;
472
592
  }
473
593
  this.state = next;
@@ -489,12 +609,21 @@ export class AhoyLoader {
489
609
  this.iframe = null;
490
610
  this.launcher = null;
491
611
  this.stopped = false;
612
+ this.gate = 'live';
613
+ this.mountWanted = false;
492
614
  this.mode = 'panel';
493
615
  if (!keepQueue)
494
616
  this.queue = [];
495
- this.setState({ ready: false, open: false, unread: 0 });
617
+ this.setState({ ready: false, open: false, unread: 0, appDeleted: false });
496
618
  }
497
619
  }
620
+ /** True for the API's 410 `app_deleted` (any other answer: false). */
621
+ async function isAppDeletedAnswer(response) {
622
+ if (response.status !== 410)
623
+ return false;
624
+ const body = (await response.json());
625
+ return body?.error?.code === 'app_deleted';
626
+ }
498
627
  /** Runs `run` when the page is idle (or soon, where `requestIdleCallback` is missing). */
499
628
  function whenIdle(win, run) {
500
629
  const ric = win
@@ -1 +1 @@
1
- {"version":3,"file":"ahoy.js","sourceRoot":"","sources":["../../../src/loader/ahoy.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,GAMZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAE1C;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,6BAA6B,CAAC;AAG7D,4FAA4F;AAC5F,MAAM,CAAC,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAE/C,MAAM,MAAM,GAAG,oBAAoB,CAAC;AACpC,6FAA6F;AAC7F,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,IAAI,GAAG,EAAE,CAAC;AAChB,+EAA+E;AAC/E,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AACrC,uFAAuF;AACvF,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAChC,yDAAyD;AACzD,MAAM,YAAY,GAAG,GAAG,CAAC;AAmFzB,IAAI,YAAY,GAAG,CAAC,CAAC;AAErB,oFAAoF;AACpF,MAAM,OAAO,UAAU;IA2BF;IAEA;IA5BX,OA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0FAA0F;AAC1F,SAAS,QAAQ,CAAC,GAAW,EAAE,GAAe;IAC5C,MAAM,GAAG,GAAI,GAAwE;SAClF,mBAAmB,CAAC;IACvB,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;QACtD,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IACD,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,UAAU;IACxB,OAAO,IAAI,UAAU,EAAE,CAAC;AAC1B,CAAC"}
@@ -93,12 +93,19 @@ export type PanelMessage = {
93
93
  type: 'closed';
94
94
  }
95
95
  /**
96
- * The panel stopped for good (origin not in the app's allowed websites, invalid
97
- * configuration): the loader removes the launcher and stops the handshake until a reload.
96
+ * The panel stopped for good (origin not in the app's allowed websites, the app was deleted in
97
+ * the dashboard, invalid configuration): the loader removes the launcher and stops the
98
+ * handshake until a reload. `reason` (optional, added within protocol 1) is
99
+ * `app_deleted` for a deleted app; older loaders ignore it.
98
100
  */
99
101
  | {
100
102
  type: 'stopped';
103
+ payload?: {
104
+ reason?: StopReason;
105
+ };
101
106
  };
107
+ /** Why the panel stopped, when the loader should know (`stopped`). */
108
+ export type StopReason = 'app_deleted';
102
109
  export type Envelope<M> = M & {
103
110
  channel: typeof CHANNEL;
104
111
  protocol: number;
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,SAAS,EACT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CAAC;AAEH,MAAM,UAAU,QAAQ,CAA6B,OAAU;IAC7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC;AAC9D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,IAAa,EACb,KAA0B;IAE1B,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACnD,MAAM,CAAC,GAAG,IAAiE,CAAC;IAC5E,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3F,IAAI,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7F,OAAO,IAAmB,CAAC;AAC7B,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,QAAQ,CAAC,GAA8B;IACrD,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,IAAI,CAAC;QACH,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACxC,IAAI,QAAQ,KAAK,OAAO,IAAI,QAAQ,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC/D,OAAO,GAAG,QAAQ,KAAK,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -1,3 +1,3 @@
1
1
  /** This package's version, kept in sync with package.json by a test. Sent as `X-Ahoy-Sdk: web/<version>`. */
2
- export declare const WEB_VERSION = "0.1.1";
2
+ export declare const WEB_VERSION = "0.2.0";
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -1,3 +1,3 @@
1
1
  /** This package's version, kept in sync with package.json by a test. Sent as `X-Ahoy-Sdk: web/<version>`. */
2
- export const WEB_VERSION = '0.1.1';
2
+ export const WEB_VERSION = '0.2.0';
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahoy-ai/web",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "In-app support chat for websites and web apps: an AI agent that answers from your docs and hands off to your team. The loader for bundlers; the script tag is served from Ahoy's CDN.",
5
5
  "keywords": [
6
6
  "support",
@@ -37,8 +37,18 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
+ "scripts": {
41
+ "build": "rm -rf dist && tsc -p tsconfig.build.json && node scripts/build.mjs",
42
+ "typecheck": "tsc --noEmit -p tsconfig.json",
43
+ "test": "jest",
44
+ "size": "node scripts/check-size.mjs",
45
+ "dev": "node scripts/dev-server.mjs",
46
+ "e2e": "playwright test",
47
+ "mock:api": "node e2e/mock-api.mjs",
48
+ "prepare": "tsc -p tsconfig.build.json"
49
+ },
40
50
  "dependencies": {
41
- "@ahoy-ai/core": "0.1.1"
51
+ "@ahoy-ai/core": "workspace:*"
42
52
  },
43
53
  "devDependencies": {
44
54
  "@axe-core/playwright": "^4.14.0",
@@ -58,14 +68,5 @@
58
68
  "preact": "^10.29.8",
59
69
  "typescript": "~5.9.3",
60
70
  "ws": "^8.22.2"
61
- },
62
- "scripts": {
63
- "build": "rm -rf dist && tsc -p tsconfig.build.json && node scripts/build.mjs",
64
- "typecheck": "tsc --noEmit -p tsconfig.json",
65
- "test": "jest",
66
- "size": "node scripts/check-size.mjs",
67
- "dev": "node scripts/dev-server.mjs",
68
- "e2e": "playwright test",
69
- "mock:api": "node e2e/mock-api.mjs"
70
71
  }
71
- }
72
+ }