@boldare/askdare 0.2.0-rc.2 โ 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 +42 -0
- package/README.md +1 -1
- package/dist/next.js +1 -1
- package/dist/ui/askdare.css +1 -1
- package/dist/ui/avatar.tsx +1 -1
- package/dist/ui/chat.tsx +1 -1
- package/dist/ui/confirm.tsx +1 -1
- package/dist/ui/context.ts +1 -1
- package/dist/ui/feedback.tsx +1 -1
- package/dist/ui/footer.tsx +1 -1
- package/dist/ui/header.tsx +1 -1
- package/dist/ui/icons.tsx +1 -1
- package/dist/ui/index.ts +1 -1
- package/dist/ui/message.tsx +1 -1
- package/dist/ui/panel.tsx +1 -1
- package/dist/ui/welcome.tsx +1 -1
- package/docs/deployment.md +3 -3
- package/docs/getting-started.md +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @boldare/askdare
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1a1659f: New command `npx @boldare/askdare add ui`: copies the source of the chat's default look (React components and their stylesheet) into `components/askdare`, or the folder given with `--dir`, so you can change it freely. It never overwrites files. The copy imports only `@boldare/askdare/react`, and you switch to it by changing one import of `DefaultChat`.
|
|
8
|
+
- ac878e6: The page can now hear what happens in the chat, for analytics such as GA4 or a GTM `dataLayer`: `askdare('on', type, listener)` with the script tag, or `onEvent` on `Root` in React. Events cover the chat opening and closing, messages sent, answers received, ratings, errors and starting over. They carry metadata only, such as counts, durations and outcomes, and never message text. See the "Chat events" guide (ADR-0013).
|
|
9
|
+
- 9bd1b16: Visitors' ratings of answers reach `createChatHandler({ onFeedback })`: ๐, ๐ with an optional comment, or the rating taken back, with the conversation and answer IDs for your own review. Each answer carries an encrypted rating handle in `message.end` and in the history, bound to the visitor or signed-in user, and `POST /feedback` accepts a rating only from them. A bot turns ratings off with `widget.feedback: false`. askdare stores no ratings.
|
|
10
|
+
- 05076dc: The chat shows ๐ and ๐ under each answer when `createChatHandler` has `onFeedback`. After a ๐ it asks "What went wrong?" with an optional comment, a second click takes a rating back, and the browser remembers the visitor's ratings across reloads. New text keys `feedback.*` (English and Polish) and parts `feedback`, `feedback-button`, `feedback-comment` and its children. In your own React markup, use `FeedbackButton` and `actions.rate`. See the new Answer ratings guide.
|
|
11
|
+
- d789913: The config that `npx @boldare/askdare init` writes now reads three optional environment variables. `ASKDARE_INSTRUCTIONS` and `ASKDARE_GREETING` replace the bot's default instructions and greeting, and `ASKDARE_ALLOWED_ORIGINS` lists the other sites that may embed the chat, comma-separated. Blank values fall back to the defaults, and trailing slashes are dropped from origins. Without the variables the bot behaves as before. The starter's Vercel button asks for the instructions and greeting, and its Heroku `app.json` offers all three.
|
|
12
|
+
- 48ddabf: New entry `@boldare/askdare/react`: the chat inside a page of your own Next.js app, without an iframe. `Root` runs one bot's chat, `DefaultChat` is the widget's look ready to place, and the hooks (`useChat`, `useChatState`, `useMessage`) and primitives (`Messages`, `MessageList`, `Message`, `MessageText`, `Composer`, `Input`, `Send` and the rest) let you write your own markup on the same parts and tokens. `getChatConfig({ bots, bot })` from `@boldare/askdare/next` gives a Server Component the public configuration to pass to `Root`. React 19 is a new optional peer dependency; the script-tag widget needs nothing new. The chat talks only to its own origin, and a page that renders it shares its scripts' access to the conversation: on sites that run scripts they don't trust, keep the iframe widget.
|
|
13
|
+
- 94a1e30: `createChatHandler({ onUsage })` reports every chat turn once its answer has streamed, failed turns included: the tokens it used (input, cached and cache-write input, output and reasoning), the model that answered, how long it took and which tools it called, with pseudonyms instead of IDs and never any message text. Use it for cost tracking and tracing. `onError` may now be async too, and a hook that throws no longer reaches the request: askdare logs its error's name instead.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 7c9fb36: Source links under an answer are checked like links inside it: only `http`, `https` and `mailto` URLs become links, and anything else shows as plain text. Before, they relied on the protocol validator alone.
|
|
18
|
+
- 66da550: The README links to askdare.vercel.app/deploy, where the one-click deploy of the starter takes about five minutes.
|
|
19
|
+
- c0c1a7f: docs: the one-click deploy takes about five minutes, and askdare.vercel.app/deploy makes the `CHAT_SECRET` for the Vercel form.
|
|
20
|
+
- 45ef7de: Fixes in the chat inside a page and its default look:
|
|
21
|
+
|
|
22
|
+
- An answer or a transcript returns focus to the message field only when focus was in the chat or nowhere, never from the page's own fields, and without scrolling the page. `actions.focus()` still always moves it.
|
|
23
|
+
- Ratings of one answer go out one at a time: quick ๐ then ๐ ends with what the server took, and a failed one goes back to the last rating it confirmed.
|
|
24
|
+
- A comment after ๐ stays in its form until it is sent, so a failed send no longer loses the text.
|
|
25
|
+
- No new dictation starts while the last one is being transcribed.
|
|
26
|
+
- `<Root>` unmounting stops the answer being streamed and the uploads still running.
|
|
27
|
+
- `Composer`: an `onSubmit` that calls `preventDefault()` takes the message over, Enter in the `Input` goes through `onSubmit` too, and an `onPaste` that prevents the default keeps the files out.
|
|
28
|
+
- Escape outside the chat is left to the page also with `headingLevel={1}`, and Escape that a handler already used is ignored. The question before a new conversation is modal only in the iframe.
|
|
29
|
+
- The default look's stylesheet styles only the chat inside `DefaultChat`, never a headless chat in the same document.
|
|
30
|
+
- The rating buttons and the question after ๐ scroll into view at the end of the conversation, and messages no longer re-render on every change of the chat.
|
|
31
|
+
- 9540d46: The README's "What you get" picture now shows what 0.2 adds: the chat inside your own page with React, ratings of answers, observability with OpenTelemetry, and chat events for analytics.
|
|
32
|
+
- 1c45e8a: With reduced motion, the launcher icon no longer turns as it swaps between chat and close.
|
|
33
|
+
- 8608d69: Starting a new conversation now shows that it is working: the question stays open while the old conversation is deleted, with its icon turning and its buttons waiting. Before, nothing visible happened until the server answered.
|
|
34
|
+
- 8d81c46: The floating chat opens with a livelier animation and now animates out when it closes; the launcher icon turns between chat and close, and phones slide the full-screen chat up. Reduced motion still turns all of it off.
|
|
35
|
+
- eb7b7aa: The chat window is built with Preact 11.2. It looks and works the same.
|
|
36
|
+
|
|
37
|
+
## 0.2.0-rc.3
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- 66da550: The README links to askdare.vercel.app/deploy, where the one-click deploy of the starter takes about five minutes.
|
|
42
|
+
- c0c1a7f: docs: the one-click deploy takes about five minutes, and askdare.vercel.app/deploy makes the `CHAT_SECRET` for the Vercel form.
|
|
43
|
+
- 1c45e8a: With reduced motion, the launcher icon no longer turns as it swaps between chat and close.
|
|
44
|
+
|
|
3
45
|
## 0.2.0-rc.2
|
|
4
46
|
|
|
5
47
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**Dare to ask.** An AI chatbot for any website, served by your Next.js app on the official OpenAI SDK. One route, one script tag, no database.
|
|
6
6
|
|
|
7
|
-
**[Live demo](https://askdare.vercel.app)** ยท **[Documentation](https://askdare.vercel.app/docs)** ยท [GitHub](https://github.com/boldare/askdare) ยท [Changelog](https://github.com/boldare/askdare/blob/main/packages/askdare/CHANGELOG.md)
|
|
7
|
+
**[Live demo](https://askdare.vercel.app)** ยท **[Deploy in 5 minutes](https://askdare.vercel.app/deploy)** ยท **[Documentation](https://askdare.vercel.app/docs)** ยท [GitHub](https://github.com/boldare/askdare) ยท [Changelog](https://github.com/boldare/askdare/blob/main/packages/askdare/CHANGELOG.md)
|
|
8
8
|
|
|
9
9
|
## Three steps
|
|
10
10
|
|
package/dist/next.js
CHANGED
|
@@ -70,7 +70,7 @@ function scrub(text) {
|
|
|
70
70
|
return text.replace(/\b(sk|rk)-[A-Za-z0-9_-]{6,}/g, (key) => `${key.slice(0, 3)}โฆ`);
|
|
71
71
|
}
|
|
72
72
|
// src/generated/assets.ts
|
|
73
|
-
const LOADER_JS = "(function(){function e(){let e=[],t=(t,n)=>{let r=e.findIndex(([e,r])=>e===t&&r===n);r>=0&&e.splice(r,1)};return{on(n,r){return typeof n==`string`&&typeof r==`function`?e.push([n,r]):console.warn(`[askdare] askdare('on') expects an event type and a function.`),()=>t(n,r)},off:t,emit(t){Object.freeze(t);for(let[n,r]of[...e])if(n===`*`||n===t.type)try{r(t)}catch{console.warn(`[askdare] A listener for \"${t.type}\" threw.`)}}}}var t={ready:{},open:{},close:{},\"message.sent\":{length:1,attachments:1,source:1},\"message.received\":{outcome:1,durationMs:1,citations:1},feedback:{rating:1,commented:1},error:{code:1},\"conversation.reset\":{}};function n(e,n){if(typeof e!=`object`||!e)return;let r=e,i=r.type;if(typeof i!=`string`||!Object.hasOwn(t,i))return;let a={type:i,bot:n};for(let e of Object.keys(t[i])){let t=r[e];if(t===null||typeof t==`boolean`||typeof t==`number`&&Number.isFinite(t)||typeof t==`string`&&/^[a-z_]{1,40}$/.test(t))a[e]=t;else if(t!==void 0)return}return a}function r(e){let t=typeof e==`object`&&e?e:{},n={v:1,type:`configure`};return typeof t.greeting==`string`&&(n.greeting=t.greeting),typeof t.context==`string`&&(n.context=t.context),Array.isArray(t.starters)&&(n.starters=t.starters.filter(e=>typeof e==`string`)),n}var i=`\n:host { all: initial; }\n[part=launcher] {\n position: fixed; right: 24px; bottom: 24px; z-index: 2147483000;\n display: flex; align-items: center; justify-content: center; gap: 10px;\n min-width: 56px; height: 56px; padding: 0; border: 0; border-radius: 999px;\n background: var(--a); color: var(--o); cursor: pointer;\n font: 600 15px/1 system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n box-shadow: 0 12px 32px -10px rgb(15 23 42 / .45), 0 2px 6px rgb(15 23 42 / .16);\n transition: transform .16s ease, box-shadow .16s ease;\n}\n[part=launcher]:hover { transform: translateY(-2px); }\n[part=launcher]:focus-visible { outline: 3px solid var(--a); outline-offset: 3px; }\n.pill { padding: 0 22px 0 6px; }\n.av { display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden;\n border-radius: 50%; background: var(--o); color: var(--a); font-size: 14px; }\n.av img { width: 100%; height: 100%; object-fit: cover; }\n/* The orb launcher: the orb with its label, on the panel's background, so it reads as a chat. */\n.orb { height: 60px; padding: 0 22px 0 6px; background: var(--l); color: var(--t);\n box-shadow: 0 14px 34px -12px var(--a), 0 2px 8px rgb(15 23 42 / .12),\n 0 0 0 1px rgb(15 23 42 / .06); }\n:host([data-askdare-scheme=dark]) .orb { background: var(--d); color: var(--u); }\n@media (prefers-color-scheme: dark) {\n :host([data-askdare-scheme=auto]) .orb { background: var(--d); color: var(--u); }\n}\n.ob { position: relative; width: 48px; height: 48px; border-radius: 50%; background: var(--b);\n box-shadow: inset 0 -5px 12px rgb(0 0 0 / .18), inset 0 4px 10px rgb(255 255 255 / .6); }\n.ob::after { content: \"\"; position: absolute; top: 12%; left: 20%; width: 36%; height: 28%;\n border-radius: 50%; background: radial-gradient(closest-side, #fffe, #fff0); }\n[aria-expanded=true], :host .orb[aria-expanded=true] { background: var(--a); color: var(--o); }\n[aria-expanded=true] .av, [aria-expanded=true] .ob, [aria-expanded=true] .lb { display: none; }\n.pill[aria-expanded=true], .orb[aria-expanded=true] { padding: 0; width: 56px; }\n[part=panel] {\n position: fixed; right: 24px; bottom: 96px; z-index: 2147483000;\n width: min(400px, calc(100vw - 48px)); height: min(680px, calc(100dvh - 120px));\n overflow: hidden; border-radius: var(--r); background: var(--l);\n box-shadow: 0 28px 70px -12px rgb(15 23 42 / .4), 0 0 0 1px rgb(15 23 42 / .06);\n transform-origin: bottom right; animation: in .34s cubic-bezier(.3, 1.3, .5, 1);\n}\n/* Closing plays the opening backwards, faster, before the panel is hidden. */\n[part=panel][data-closing] { pointer-events: none;\n animation: out .18s cubic-bezier(.4, 0, 1, 1) forwards; }\n:host([data-askdare-scheme=dark]) [part=panel] { background: var(--d); }\n@media (prefers-color-scheme: dark) {\n :host([data-askdare-scheme=auto]) [part=panel] { background: var(--d); }\n}\n[part=panel][hidden] { display: none; }\n[part=unavailable] { position: absolute; inset: 0; display: grid; place-items: center;\n margin: 0; padding: 24px; background: var(--l); color: var(--t); text-align: center;\n font: 15px/1.5 system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; }\n[part=panel].solo { bottom: 24px; }\n[part=panel].inline { position: relative; inset: auto; z-index: auto; width: 100%; height: 100%;\n border-radius: inherit; box-shadow: none; animation: none; }\niframe { display: block; width: 100%; height: 100%; border: 0; }\n/* The icon turns as it swaps between chat and close; not on the first paint. */\n[data-turned] svg { animation: turn .26s cubic-bezier(.3, 1.4, .5, 1); }\n@keyframes in { from { opacity: 0; transform: translateY(18px) scale(.9); } 50% { opacity: 1; } }\n@keyframes out { to { opacity: 0; transform: translateY(12px) scale(.94); } }\n@keyframes turn { from { opacity: 0; transform: rotate(-90deg) scale(.5); } }\n@keyframes up { from { transform: translateY(100%); } }\n@media (max-width: 480px) {\n [part=panel] { inset: 0; width: 100vw; height: 100dvh; border-radius: 0;\n animation: up .3s cubic-bezier(.2, .8, .2, 1); }\n [part=panel][data-closing] { animation: out .18s ease-in forwards; }\n [aria-expanded=true][data-ready] { display: none; }\n}\n@media (prefers-reduced-motion: reduce) {\n [part=launcher], [part=panel], [part=panel][data-closing], svg { transition: none; animation: none; }\n}\n`,a=`<svg width=\"26\" height=\"26\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\"><path d=\"M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v8a2.5 2.5 0 0 1-2.5 2.5H10l-4.2 3.6A.5.5 0 0 1 5 19.2V16h-.5A.5.5 0 0 1 4 15.5z\" fill=\"currentColor\"/></svg>`,o=`<svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M6 6l12 12M18 6 6 18\"/></svg>`;function s(){try{return JSON.parse(`__ASKDARE_LAUNCHERS__`)}catch{return{}}}function c(){if(window.askdare?.loaded)return;let t=document.currentScript;if(!(t instanceof HTMLScriptElement)||!t.src)return;let c=new URL(t.src),l=t.dataset.bot??c.searchParams.get(`bot`);if(!l){console.warn(`[askdare] Load the widget as widget.js?bot=<bot id>.`);return}let u=c.origin,d=c.pathname.replace(/\\/widget\\.js$/,``),f=t.dataset.mode===`inline`?t.dataset.target:void 0,p=()=>{try{return f?document.querySelector(f):null}catch{return null}};f&&!p()&&document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>m(t,p(),l),{once:!0}):m(t,p(),l);function m(t,c,l){let p=window.askdare;if(p?.loaded)return;let m=Array.isArray(p?.q)?p.q:[];f&&!c&&console.warn(`[askdare] No element matches ${f}.`);let h=c!==null,g=!h&&t.dataset.launcher!==`none`,_=document.documentElement.lang,v=new URLSearchParams({..._?{lang:_}:{},...h?{mode:`inline`}:{}}).toString(),y=`${u}${d}/embed/${encodeURIComponent(l)}${v?`?${v}`:``}`,b=s()[l],x=(b?.locale||_||navigator.language).toLowerCase().split(`-`)[0],S=b?.texts[x??`en`]??b?.texts.en??{label:`Ask us`,open:`Open chat`,close:`Close chat`,unavailable:`The chat couldnโt load. Please try again later.`,title:`Chat`},C=document.createElement(`div`);C.dataset.askdare=l,C.dataset.askdareScheme=b?.scheme??`auto`;for(let[e,t]of[[`--a`,b?.accent??`#1f5fe0`],[`--o`,b?.onAccent??`#ffffff`],[`--b`,b?.orb??`var(--a)`],[`--l`,b?.light??`#ffffff`],[`--d`,b?.dark??`#0a0f1c`],[`--t`,b?.text??`#0d1526`],[`--u`,b?.textDark??`#e8edf7`],[`--r`,b?.radius?`min(${b.radius}, 24px)`:`18px`]])C.style.setProperty(e,t);let w=C.attachShadow({mode:`open`});try{let e=new CSSStyleSheet;e.replaceSync(i),w.adoptedStyleSheets=[e]}catch{let e=document.createElement(`style`);e.textContent=i,w.append(e)}let T=document.createElement(`button`);T.type=`button`,T.className=b?.style??`circle`,T.setAttribute(`part`,`launcher`);let E=b?.style===`pill`||b?.style===`orb`?`${S.label}, ${S.open}`:S.open;T.setAttribute(`aria-label`,E),T.setAttribute(`aria-expanded`,`false`);let D=document.createElement(`span`);D.style.display=`contents`;let O=e=>{D.innerHTML=e?o:b?.style===`circle`||!b?a:``};if(O(!1),b?.style===`pill`||b?.style===`orb`){let e=document.createElement(`span`);if(e.className=b.style===`orb`?`ob`:`av`,b.style===`pill`&&(e.textContent=b.initials),b.style===`pill`&&b.avatar){let t=document.createElement(`img`);t.alt=``,t.src=b.avatar.startsWith(`/`)?`${u}${b.avatar}`:b.avatar,t.onload=()=>e.replaceChildren(t)}let t=document.createElement(`span`);t.className=`lb`,t.setAttribute(`part`,`launcher-label`),t.textContent=S.label,T.append(e,t)}T.append(D);let k=document.createElement(`div`);k.setAttribute(`part`,`panel`),k.setAttribute(`role`,`dialog`),k.setAttribute(`aria-label`,S.title),k.hidden=!0,h?k.className=`inline`:g||(k.className=`solo`),w.append(k),g&&w.append(T);let A,j,M=e(),N=!1,P,F=()=>{N||P||(P=document.createElement(`p`),P.setAttribute(`part`,`unavailable`),P.setAttribute(`role`,`status`),P.textContent=S.unavailable,k.append(P),console.warn(`[askdare] The chat \"${l}\" didn't load on ${location.origin}. Is this origin in the bot's security.allowedOrigins? Check with: npx @boldare/askdare doctor --origin ${location.origin}`))},I,L,R,z,B=()=>!k.hidden&&z===void 0,V=e=>{T.dataset.turned=``,O(e)},H=e=>{j?.close();let t=new MessageChannel;j=t.port1,j.onmessage=e=>{if(e.data?.v===1){if(e.data.type===`close`&&W(),e.data.type===`event`){let t=n(e.data.event,l);t&&M.emit(t)}e.data.type===`ready`&&(N=!0,P?.remove(),P=void 0,T.dataset.ready=``)}},e.contentWindow?.postMessage({v:1,type:`askdare:init`,...L===void 0?{}:{identity:L}},u,[t.port2]),I&&j.postMessage(I)},U=(e=!0)=>{let t=!h&&!B();if(t&&V(!0),!h&&k.hidden){let e=document.activeElement;R=e instanceof HTMLElement&&e!==C?e:void 0}clearTimeout(z),z=void 0,delete k.dataset.closing,A||(A=document.createElement(`iframe`),A.title=`Chat`,A.src=y,A.referrerPolicy=`strict-origin`,A.allow=`clipboard-write; microphone`,A.addEventListener(`load`,()=>A&&H(A)),k.append(A),setTimeout(F,8e3)),k.hidden=!1,T.setAttribute(`aria-expanded`,`true`),T.setAttribute(`aria-label`,S.close),e&&A.focus(),t&&M.emit({type:`open`,bot:l})};function W(){if(h||!B())return;j?.postMessage({v:1,type:`hidden`});let e=()=>{z=void 0,delete k.dataset.closing,k.hidden=!0};matchMedia(`(prefers-reduced-motion: reduce)`).matches?e():(k.dataset.closing=``,z=setTimeout(e,180)),V(!1),T.setAttribute(`aria-expanded`,`false`),T.setAttribute(`aria-label`,E);let t=R?.isConnected?R:g?T:void 0;t&&(window.focus(),t.focus()),M.emit({type:`close`,bot:l})}T.addEventListener(`click`,()=>B()?W():U()),(c??document.body??document.documentElement).append(C),h&&U(!1);let G=((e,t,n)=>{if(e===`on`)return M.on(t,n);e===`off`?M.off(t,n):e===`open`?U():e===`close`?W():e===`toggle`?(B()?W:U)():e===`identify`?(typeof t!=`string`&&t!==null&&console.warn(`[askdare] askdare('identify') expects a token or null; signing out.`),L=typeof t==`string`?t:null,j?.postMessage({v:1,type:`identify`,token:L})):e===`configure`&&(I=r(t),j?.postMessage(I))});Object.defineProperty(G,\"loaded\",{value:!0}),window.askdare=G;for(let e of m)G(...e)}}c()})();";
|
|
73
|
+
const LOADER_JS = "(function(){function e(){let e=[],t=(t,n)=>{let r=e.findIndex(([e,r])=>e===t&&r===n);r>=0&&e.splice(r,1)};return{on(n,r){return typeof n==`string`&&typeof r==`function`?e.push([n,r]):console.warn(`[askdare] askdare('on') expects an event type and a function.`),()=>t(n,r)},off:t,emit(t){Object.freeze(t);for(let[n,r]of[...e])if(n===`*`||n===t.type)try{r(t)}catch{console.warn(`[askdare] A listener for \"${t.type}\" threw.`)}}}}var t={ready:{},open:{},close:{},\"message.sent\":{length:1,attachments:1,source:1},\"message.received\":{outcome:1,durationMs:1,citations:1},feedback:{rating:1,commented:1},error:{code:1},\"conversation.reset\":{}};function n(e,n){if(typeof e!=`object`||!e)return;let r=e,i=r.type;if(typeof i!=`string`||!Object.hasOwn(t,i))return;let a={type:i,bot:n};for(let e of Object.keys(t[i])){let t=r[e];if(t===null||typeof t==`boolean`||typeof t==`number`&&Number.isFinite(t)||typeof t==`string`&&/^[a-z_]{1,40}$/.test(t))a[e]=t;else if(t!==void 0)return}return a}function r(e){let t=typeof e==`object`&&e?e:{},n={v:1,type:`configure`};return typeof t.greeting==`string`&&(n.greeting=t.greeting),typeof t.context==`string`&&(n.context=t.context),Array.isArray(t.starters)&&(n.starters=t.starters.filter(e=>typeof e==`string`)),n}var i=`\n:host { all: initial; }\n[part=launcher] {\n position: fixed; right: 24px; bottom: 24px; z-index: 2147483000;\n display: flex; align-items: center; justify-content: center; gap: 10px;\n min-width: 56px; height: 56px; padding: 0; border: 0; border-radius: 999px;\n background: var(--a); color: var(--o); cursor: pointer;\n font: 600 15px/1 system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n box-shadow: 0 12px 32px -10px rgb(15 23 42 / .45), 0 2px 6px rgb(15 23 42 / .16);\n transition: transform .16s ease, box-shadow .16s ease;\n}\n[part=launcher]:hover { transform: translateY(-2px); }\n[part=launcher]:focus-visible { outline: 3px solid var(--a); outline-offset: 3px; }\n.pill { padding: 0 22px 0 6px; }\n.av { display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden;\n border-radius: 50%; background: var(--o); color: var(--a); font-size: 14px; }\n.av img { width: 100%; height: 100%; object-fit: cover; }\n/* The orb launcher: the orb with its label, on the panel's background, so it reads as a chat. */\n.orb { height: 60px; padding: 0 22px 0 6px; background: var(--l); color: var(--t);\n box-shadow: 0 14px 34px -12px var(--a), 0 2px 8px rgb(15 23 42 / .12),\n 0 0 0 1px rgb(15 23 42 / .06); }\n:host([data-askdare-scheme=dark]) .orb { background: var(--d); color: var(--u); }\n@media (prefers-color-scheme: dark) {\n :host([data-askdare-scheme=auto]) .orb { background: var(--d); color: var(--u); }\n}\n.ob { position: relative; width: 48px; height: 48px; border-radius: 50%; background: var(--b);\n box-shadow: inset 0 -5px 12px rgb(0 0 0 / .18), inset 0 4px 10px rgb(255 255 255 / .6); }\n.ob::after { content: \"\"; position: absolute; top: 12%; left: 20%; width: 36%; height: 28%;\n border-radius: 50%; background: radial-gradient(closest-side, #fffe, #fff0); }\n[aria-expanded=true], :host .orb[aria-expanded=true] { background: var(--a); color: var(--o); }\n[aria-expanded=true] .av, [aria-expanded=true] .ob, [aria-expanded=true] .lb { display: none; }\n.pill[aria-expanded=true], .orb[aria-expanded=true] { padding: 0; width: 56px; }\n[part=panel] {\n position: fixed; right: 24px; bottom: 96px; z-index: 2147483000;\n width: min(400px, calc(100vw - 48px)); height: min(680px, calc(100dvh - 120px));\n overflow: hidden; border-radius: var(--r); background: var(--l);\n box-shadow: 0 28px 70px -12px rgb(15 23 42 / .4), 0 0 0 1px rgb(15 23 42 / .06);\n transform-origin: bottom right; animation: in .34s cubic-bezier(.3, 1.3, .5, 1);\n}\n/* Closing plays the opening backwards, faster, before the panel is hidden. */\n[part=panel][data-closing] { pointer-events: none;\n animation: out .18s cubic-bezier(.4, 0, 1, 1) forwards; }\n:host([data-askdare-scheme=dark]) [part=panel] { background: var(--d); }\n@media (prefers-color-scheme: dark) {\n :host([data-askdare-scheme=auto]) [part=panel] { background: var(--d); }\n}\n[part=panel][hidden] { display: none; }\n[part=unavailable] { position: absolute; inset: 0; display: grid; place-items: center;\n margin: 0; padding: 24px; background: var(--l); color: var(--t); text-align: center;\n font: 15px/1.5 system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; }\n[part=panel].solo { bottom: 24px; }\n[part=panel].inline { position: relative; inset: auto; z-index: auto; width: 100%; height: 100%;\n border-radius: inherit; box-shadow: none; animation: none; }\niframe { display: block; width: 100%; height: 100%; border: 0; }\n/* The icon turns as it swaps between chat and close; not on the first paint. */\n[data-turned] svg { animation: turn .26s cubic-bezier(.3, 1.4, .5, 1); }\n@keyframes in { from { opacity: 0; transform: translateY(18px) scale(.9); } 50% { opacity: 1; } }\n@keyframes out { to { opacity: 0; transform: translateY(12px) scale(.94); } }\n@keyframes turn { from { opacity: 0; transform: rotate(-90deg) scale(.5); } }\n@keyframes up { from { transform: translateY(100%); } }\n@media (max-width: 480px) {\n [part=panel] { inset: 0; width: 100vw; height: 100dvh; border-radius: 0;\n animation: up .3s cubic-bezier(.2, .8, .2, 1); }\n [part=panel][data-closing] { animation: out .18s ease-in forwards; }\n [aria-expanded=true][data-ready] { display: none; }\n}\n@media (prefers-reduced-motion: reduce) {\n [part=launcher], [part=panel], [part=panel][data-closing], svg, [data-turned] svg {\n transition: none; animation: none; }\n}\n`,a=`<svg width=\"26\" height=\"26\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\"><path d=\"M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v8a2.5 2.5 0 0 1-2.5 2.5H10l-4.2 3.6A.5.5 0 0 1 5 19.2V16h-.5A.5.5 0 0 1 4 15.5z\" fill=\"currentColor\"/></svg>`,o=`<svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M6 6l12 12M18 6 6 18\"/></svg>`;function s(){try{return JSON.parse(`__ASKDARE_LAUNCHERS__`)}catch{return{}}}function c(){if(window.askdare?.loaded)return;let t=document.currentScript;if(!(t instanceof HTMLScriptElement)||!t.src)return;let c=new URL(t.src),l=t.dataset.bot??c.searchParams.get(`bot`);if(!l){console.warn(`[askdare] Load the widget as widget.js?bot=<bot id>.`);return}let u=c.origin,d=c.pathname.replace(/\\/widget\\.js$/,``),f=t.dataset.mode===`inline`?t.dataset.target:void 0,p=()=>{try{return f?document.querySelector(f):null}catch{return null}};f&&!p()&&document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,()=>m(t,p(),l),{once:!0}):m(t,p(),l);function m(t,c,l){let p=window.askdare;if(p?.loaded)return;let m=Array.isArray(p?.q)?p.q:[];f&&!c&&console.warn(`[askdare] No element matches ${f}.`);let h=c!==null,g=!h&&t.dataset.launcher!==`none`,_=document.documentElement.lang,v=new URLSearchParams({..._?{lang:_}:{},...h?{mode:`inline`}:{}}).toString(),y=`${u}${d}/embed/${encodeURIComponent(l)}${v?`?${v}`:``}`,b=s()[l],x=(b?.locale||_||navigator.language).toLowerCase().split(`-`)[0],S=b?.texts[x??`en`]??b?.texts.en??{label:`Ask us`,open:`Open chat`,close:`Close chat`,unavailable:`The chat couldnโt load. Please try again later.`,title:`Chat`},C=document.createElement(`div`);C.dataset.askdare=l,C.dataset.askdareScheme=b?.scheme??`auto`;for(let[e,t]of[[`--a`,b?.accent??`#1f5fe0`],[`--o`,b?.onAccent??`#ffffff`],[`--b`,b?.orb??`var(--a)`],[`--l`,b?.light??`#ffffff`],[`--d`,b?.dark??`#0a0f1c`],[`--t`,b?.text??`#0d1526`],[`--u`,b?.textDark??`#e8edf7`],[`--r`,b?.radius?`min(${b.radius}, 24px)`:`18px`]])C.style.setProperty(e,t);let w=C.attachShadow({mode:`open`});try{let e=new CSSStyleSheet;e.replaceSync(i),w.adoptedStyleSheets=[e]}catch{let e=document.createElement(`style`);e.textContent=i,w.append(e)}let T=document.createElement(`button`);T.type=`button`,T.className=b?.style??`circle`,T.setAttribute(`part`,`launcher`);let E=b?.style===`pill`||b?.style===`orb`?`${S.label}, ${S.open}`:S.open;T.setAttribute(`aria-label`,E),T.setAttribute(`aria-expanded`,`false`);let D=document.createElement(`span`);D.style.display=`contents`;let O=e=>{D.innerHTML=e?o:b?.style===`circle`||!b?a:``};if(O(!1),b?.style===`pill`||b?.style===`orb`){let e=document.createElement(`span`);if(e.className=b.style===`orb`?`ob`:`av`,b.style===`pill`&&(e.textContent=b.initials),b.style===`pill`&&b.avatar){let t=document.createElement(`img`);t.alt=``,t.src=b.avatar.startsWith(`/`)?`${u}${b.avatar}`:b.avatar,t.onload=()=>e.replaceChildren(t)}let t=document.createElement(`span`);t.className=`lb`,t.setAttribute(`part`,`launcher-label`),t.textContent=S.label,T.append(e,t)}T.append(D);let k=document.createElement(`div`);k.setAttribute(`part`,`panel`),k.setAttribute(`role`,`dialog`),k.setAttribute(`aria-label`,S.title),k.hidden=!0,h?k.className=`inline`:g||(k.className=`solo`),w.append(k),g&&w.append(T);let A,j,M=e(),N=!1,P,F=()=>{N||P||(P=document.createElement(`p`),P.setAttribute(`part`,`unavailable`),P.setAttribute(`role`,`status`),P.textContent=S.unavailable,k.append(P),console.warn(`[askdare] The chat \"${l}\" didn't load on ${location.origin}. Is this origin in the bot's security.allowedOrigins? Check with: npx @boldare/askdare doctor --origin ${location.origin}`))},I,L,R,z,B=()=>!k.hidden&&z===void 0,V=e=>{T.dataset.turned=``,O(e)},H=e=>{j?.close();let t=new MessageChannel;j=t.port1,j.onmessage=e=>{if(e.data?.v===1){if(e.data.type===`close`&&W(),e.data.type===`event`){let t=n(e.data.event,l);t&&M.emit(t)}e.data.type===`ready`&&(N=!0,P?.remove(),P=void 0,T.dataset.ready=``)}},e.contentWindow?.postMessage({v:1,type:`askdare:init`,...L===void 0?{}:{identity:L}},u,[t.port2]),I&&j.postMessage(I)},U=(e=!0)=>{let t=!h&&!B();if(t&&V(!0),!h&&k.hidden){let e=document.activeElement;R=e instanceof HTMLElement&&e!==C?e:void 0}clearTimeout(z),z=void 0,delete k.dataset.closing,A||(A=document.createElement(`iframe`),A.title=`Chat`,A.src=y,A.referrerPolicy=`strict-origin`,A.allow=`clipboard-write; microphone`,A.addEventListener(`load`,()=>A&&H(A)),k.append(A),setTimeout(F,8e3)),k.hidden=!1,T.setAttribute(`aria-expanded`,`true`),T.setAttribute(`aria-label`,S.close),e&&A.focus(),t&&M.emit({type:`open`,bot:l})};function W(){if(h||!B())return;j?.postMessage({v:1,type:`hidden`});let e=()=>{z=void 0,delete k.dataset.closing,k.hidden=!0};matchMedia(`(prefers-reduced-motion: reduce)`).matches?e():(k.dataset.closing=``,z=setTimeout(e,180)),V(!1),T.setAttribute(`aria-expanded`,`false`),T.setAttribute(`aria-label`,E);let t=R?.isConnected?R:g?T:void 0;t&&(window.focus(),t.focus()),M.emit({type:`close`,bot:l})}T.addEventListener(`click`,()=>B()?W():U()),(c??document.body??document.documentElement).append(C),h&&U(!1);let G=((e,t,n)=>{if(e===`on`)return M.on(t,n);e===`off`?M.off(t,n):e===`open`?U():e===`close`?W():e===`toggle`?(B()?W:U)():e===`identify`?(typeof t!=`string`&&t!==null&&console.warn(`[askdare] askdare('identify') expects a token or null; signing out.`),L=typeof t==`string`?t:null,j?.postMessage({v:1,type:`identify`,token:L})):e===`configure`&&(I=r(t),j?.postMessage(I))});Object.defineProperty(G,\"loaded\",{value:!0}),window.askdare=G;for(let e of m)G(...e)}}c()})();";
|
|
74
74
|
const WIDGET_JS = "var e,t,n,r,i,a,o,s,c,l,u,d=Symbol.for(`pv`),f={},p=[],m=/^m(i|n|o|s|text|space)$/,h=Array.isArray,g=p.slice,_=Object.assign;function v(e){e&&e.parentNode&&e.remove()}function y(e,t,n){var r,i,a,o={},s=arguments.length;for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return s>2&&(o.children=s>3?g.call(arguments,2):n),b(e,o,r,i,null)}function b(n,r,i,a,o){var s={type:n,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:d,__v:o||++t,__i:-1,__u:0};return!o&&e.vnode&&e.vnode(s),s}function x(e){return e.children}function S(e,t){this.props=e,this.context=t,this.__g=0}function C(e,t){if(t==null)return e.__&&C(e.__,e.__i+1);for(var n;t<e.__k.length;t++)if((n=e.__k[t])&&n.__e)return n.__e;return typeof e.type!=`function`||e.props.__P?null:C(e)}function w(t){var n,r=t.__v,i=r.__e,a=[],o=[],s=t.__P;s&&((n=_({constructor:d},r)).__v=r.__v+1,e.vnode&&e.vnode(n),M(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i||C(r),32&r.__u,o),n.__v=r.__v,n.__.__k[n.__i]=n,N(a,n,o),r.__=r.__e=null,n.__e!=i&&T(n))}function T(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),T(e)}function E(t){(8&t.__g||(t.__g|=8,n.push(t),i++))&&r==e.debounceRendering||((r=e.debounceRendering)||queueMicrotask)(D)}function D(){try{for(var e,t=1;n.length;)n.length>t&&n.sort(a),e=n.shift(),t=n.length,8&e.__g&&w(e)}finally{(i=n.length)&&(r||queueMicrotask)(D)}}function O(e,t,n,r,i,a,o,s,c,l,u){var d,m,h,g,_,v,y=r.__k||p,b=t.length;for(c=k(n,t,y,c,b),d=0;d<b;d++)(h=n.__k[d])!=null&&(m=~h.__i&&y[h.__i]||f,h.__i=d,v=M(e,h,m,i,a,o,s,c,l,u),g=h.__e,(m.ref!=h.ref||8&m.__u)&&(m.ref&&P(m.ref,null,h,m),h.ref&&u.push(h.ref,h.__c||g,h)),_||=g,4&h.__u?(c=A(h,c,e,!m.__v),m.__e&&(m.__e=null)):typeof h.type==`function`&&v!==void 0?c=v:g&&(c=g.nextSibling),h.__u&=-21);return n.__e=_,c}function k(e,t,n,r,i){var a,o,s,c,l,u,f,p,m,g=n.length,_=g,v=0,y=0,S=e.__k=Array(i);for(a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o!=`object`||o.constructor===String?o=S[a]=b(null,o):h(o)?o=S[a]=b(x,{children:o}):o.constructor===d&&o.__b?o=S[a]=b(o.type,o.props,o.key,o.ref,o.__v):S[a]=o,c=a+v,o.__=e,o.__b=e.__b+1,s=null,~(l=o.__i=te(o,n,c,_))&&(_--,(s=n[l])&&(s.__u|=2)),s&&s.__v?(o.__u|=16,l==c-1?v--:l==c+1?v++:l!=c&&(l>c?v--:v++,y=1)):(~l||(i>g?v--:i<g&&v++),typeof o.type!=`function`&&(o.__u|=4))):S[a]=null;if(y){for(u=[],f=[],a=0;a<i;a++)if((o=S[a])&&16&o.__u){for(v=0,p=u.length;v<p;)u[m=v+p>>1]<o.__i?v=m+1:p=m;u[v]=o.__i,f[a]=v+1}for(v=u.length;a--;)f[a]&&(f[a]==v?v--:S[a].__u|=4)}if(_)for(a=0;a<g;a++)!(s=n[a])||2&s.__u||(s.__e==r&&(r=C(s)),se(s,s));return r}function A(e,t,n,r){var i,a,o,s;if(typeof e.type==`function`){if(e.props.__P)return t;if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&(i[a].__=e,t=A(i[a],t,n,!1));return t}for(t&&!t.parentNode&&(t=C(e))&&!t.parentNode&&(t=null),o=e.__e,s=t;s&&s.nodeType==8;)s=s.nextSibling;for(o!=s&&(!r&&n.moveBefore&&o.parentNode?n.moveBefore(o,t):n.insertBefore(o,t||null)),t=o;(t&&=t.nextSibling)&&t.nodeType==8&&!t.data.startsWith(`$s`););return t}function ee(e,t){return t||=[],e!=null&&typeof e!=`boolean`&&(h(e)?e.some(function(e){ee(e,t)}):t.push(e)),t}function te(e,t,n,r){var i,a=e.key,o=e.type,s=t[n],c=s&&!(2&s.__u);if(s===null&&a==null||c&&a==s.key&&o==s.type)return n;if(r>+!!c){for(i=n-1;i>=0;i--)if((s=t[i])&&!(2&s.__u)&&a==s.key&&o==s.type)return i;for(i=n+1;i<t.length;i++)if((s=t[i])&&!(2&s.__u)&&a==s.key&&o==s.type)return i}return-1}function ne(e,t,n){n??=``,t[0]==`-`?e.setProperty(t,n):e[t]=n}function j(e,t,n,r,i){var a,o;if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ne(e.style,t);if(n)for(t in n)r&&n[t]==r[t]||ne(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)typeof n!=`function`&&(n=null),typeof r!=`function`&&(r=null),(e.__e||={})[t]=n,n&&r||(o=l[t]||(l[t]=re(t)),(e.__a||={})[t]=c,a=t!=(t=t.replace(s,`$1`)),(t=t.slice(2))[0]<`a`&&(t=t.toLowerCase()),n?e.addEventListener(t,o,a):e.removeEventListener(t,o,a));else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;return}catch{}if(typeof n==`function`)return;n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n)}}function re(t){return function(n){var r=this.__e;if(r){if(r=r[t],n[o]==null)n[o]=c++;else if(n[o]<this.__a[t])return;return r(e.event?e.event(n):n)}}}function M(t,n,r,i,a,o,s,c,l,u){var f,m,g,y,b,w,T,E,D,k,A,ee,te,ne,j,re,M,N,P=n.type;if(n.constructor!==d)return null;128&r.__u&&(l=32&r.__u,f=r.__c.__z)&&(n.__u|=l,m=o=[],f.nodeType==8?c=ie(f,o):o.push(f),c=o[0]||c),(f=e.__b)&&f(n);n:if(typeof P==`function`){g=s.length;try{if(E=n.props,D=(f=P.prototype)&&f.render,k=(f=P.contextType)&&i[f.__c],A=f?k?k.props.value:f.__:i,(y=r.__c)?(n.__c=y,2&y.__g&&(y.__g|=1)):(D?n.__c=y=new P(E,A):(n.__c=y=new S(E,A),y.constructor=P,y.render=ce),k&&k.sub(y),y.state||(y.state={}),y.__n=i,y.__g|=8,y.__h=[],y.__k=[]),D&&(y.__s||(y.__s=y.state),P.getDerivedStateFromProps&&(y.__s==y.state&&(y.__s=_({},y.__s)),_(y.__s,P.getDerivedStateFromProps(E,y.__s)))),b=y.props,w=y.state,y.__v=n,r.__c){if(E!==b&&D&&!P.getDerivedStateFromProps&&y.componentWillReceiveProps&&y.componentWillReceiveProps(E,A),n.__v==r.__v&&!(8&y.__g)||!(4&y.__g)&&y.shouldComponentUpdate&&!1===y.shouldComponentUpdate(E,y.__s,A)){n.__v!=r.__v&&(y.props=E,y.state=y.__s,y.__g&=-9),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),p.push.apply(y.__h,y.__k),y.__k=[],y.__h.length&&s.push(y),c=C(r);break n}y.componentWillUpdate&&y.componentWillUpdate(E,y.__s,A),D&&y.componentDidUpdate&&y.__h.push(function(){y.componentDidUpdate(b,w,T)})}else D&&!P.getDerivedStateFromProps&&y.componentWillMount&&y.componentWillMount(),D&&y.componentDidMount&&y.__h.push(y.componentDidMount);y.context=A,y.props=E,y.__P=t,y.__g&=-5,ee=e.__r,te=D?25:0;do y.__g&=-9,ee&&ee(n),f=y.render(y.props,y.state=y.__s,y.context);while(8&y.__g&&++te<25);D&&(p.push.apply(y.__h,y.__k),y.__k=[]),y.state=y.__s,y.getChildContext&&(i=_({},i,y.getChildContext())),D&&r.__c&&y.getSnapshotBeforeUpdate&&(T=y.getSnapshotBeforeUpdate(b,w)),ne=f&&f.type===x&&f.key==null?f.props.children:f,E.__P&&(f=c,a=(t=E.__P).namespaceURI,l=o=null,r.props&&r.props.__P!=t&&(r.__k.some(function(e){e&&se(e,e)}),r.__k=null),c=r.__k?C(r,0):null),c=O(t,h(ne)?ne:[ne],n,r,i,a,o,s,c,l,u),E.__P&&(n.__e=null,c=f),n.__u&=-161,m&&m.some(v),y.__h.length&&s.push(y),1&y.__g&&(y.__g&=-4)}catch(t){if(s.length=g,n.__v=null,l||o){if(t&&t.then){if(n.__u|=128|l,o){for(~(M=o.indexOf(c||void 0))||(M=o.length);(N=o[M-1])&&N.nodeType==8;)M--;for(;M<o.length;M++)if(N=o[M]){if(o[M]=null,j){if(N==re)break}else{if(N.nodeType!=8)break;N.data.startsWith(`$s`)&&(re=ie(j=N))}}}if(!j){for(;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;j=c}(f=ie(j=n.__c.__z||(n.__c.__z=j)))?(n.__e=j,c=f):n.__e=c,c&&=c.nextSibling}else o&&o.some(v)}else n.__e=r.__e;n.__k||=r.__k||[],t&&t.then||ae(n),e.__e(t,n,r)}}else c=n.__e=oe(r.__e,n,r,i,a,o,s,l,u,t);return(f=e.diffed)&&f(n),c}function ie(e,t){if(e&&e.nodeType==8&&e.data.startsWith(`$s`))for(var n=1;e=e.nextSibling;){if(e.nodeType==8){if(e.data.startsWith(`$s`))n++;else if(e.data.startsWith(`/$s`)&&!--n)return e}t&&t.push(e)}}function ae(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(ae))}function N(t,n,r){for(var i=0;i<r.length;)P(r[i++],r[i++],r[i++]);e.__c&&e.__c(n,t),t.some(function(n){try{t=n.__h,n.__h=[],t.some(function(e){e.call(n)})}catch(t){e.__e(t,n.__v)}})}function oe(t,n,r,i,a,o,s,c,l,u){var d,p,_,y,b,x,S,w,T=r.props||f,E=n.props,D=n.type;if(D==`svg`?a=`http://www.w3.org/2000/svg`:D==`math`?a=`http://www.w3.org/1998/Math/MathML`:a||=`http://www.w3.org/1999/xhtml`,o){for(d=0;d<o.length;d++)if((b=o[d])&&(D?b.localName==D:b.nodeType==3)){t=b,o[d]=null;break}}if(!t){if(w=u.ownerDocument||document,!D)return w.createTextNode(E);t=w.createElementNS(a,D,E.is?E:u),c&&=(e.__m&&e.__m(n,o),!1),o=null}if(D){if(u=D==`template`&&t.content||t,o=D==`textarea`&&E.defaultValue!=null?null:o&&g.call(u.childNodes),!c&&o)for(T={},d=0;d<t.attributes.length;d++)T[(b=t.attributes[d]).name]=b.value;for(d in T)b=T[d],d==`dangerouslySetInnerHTML`?_=b:d==`children`||d in E||d==`value`&&`defaultValue`in E||d==`checked`&&`defaultChecked`in E||j(t,d,null,b,a);for(d in E)b=E[d],d==`children`?y=b:d==`dangerouslySetInnerHTML`?p=b:d==`value`?x=b:d==`checked`?S=b:c&&typeof b!=`function`||T[d]===b||j(t,d,b,T[d],a);p?(c||_&&(p.__html==_.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),n.__k=[]):(_&&(t.textContent=``),(D==`foreignObject`||a==`http://www.w3.org/1998/Math/MathML`&&m.test(D))&&(a=`http://www.w3.org/1999/xhtml`),O(u,h(y)?y:[y],n,r,i,a,o,s,o?o[0]:r.__k&&C(r,0),c,l),o&&o.some(v)),c&&D!=`textarea`||(d=`value`,D==`progress`&&x==null?t.removeAttribute(d):x==null||x===t[d]&&(D!=`progress`||x)||j(t,d,x,T[d],a),d=`checked`,S!=null&&S!=t[d]&&j(t,d,S,T[d],a))}else T===E||c&&t.data==E||(t.data=E);return t}function P(t,n,r,i){try{typeof t==`function`?n?n.__x=t(n)||1:(i&&=i.__c||i.__e)&&(n=i.__x)&&(i.__x=null,typeof n==`function`?n():t(null)):t.current=n}catch(t){e.__e(t,r)}}function se(t,n,r){var i,a,o,s;if(e.unmount&&e.unmount(t),!(i=t.ref)||i.current&&i.current!=t.__e||P(i,null,n,t),i=t.__c){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){e.__e(t,n)}i.__P=i.__n=null}if(i=t.__k)for(s=0;s<i.length;s++)i[s]&&se(i[s],n,typeof t.type!=`function`||r&&!t.props.__P);!r&&(i=t.__c)&&(i=i.__z)&&(a=ie(i,o=[]))&&(i==t.__e&&o.some(v),v(a),v(i)),r||v(t.__e),t.__e=t.__c=t.__=null}function ce(e,t,n){return this.constructor(e,n)}function le(t,n){var r,i,a,o;e.__&&e.__(t,n),n.nodeType==9&&(n=n.documentElement),i=(r=t&&32&t.__u)?null:n.__k,n.__k=b(x,{children:[t]}),a=[],o=[],M(n,n.__k,i||f,f,n.namespaceURI,i?null:n.firstChild?g.call(n.childNodes):null,a,i?i.__e:n.firstChild,r,o),N(a,n.__k,o),n.__k.props.children=null}function ue(e){function t(e){var n,r;return this.getChildContext||(n=/* @__PURE__ */ new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__g|=4,E(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.delete(e),t&&t.call(e)}}),e.children}return t.__c=`__cC`+u++,t.__=e,t.Provider=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}e={__e:function(e,t,n,r){for(var a,o,s;t=t.__;)if((a=t.__c)&&!(1&a.__g)){a.__g|=4;try{if((s=(o=a.constructor)&&o.getDerivedStateFromError)&&a.setState(o.getDerivedStateFromError(e)),a.componentDidCatch&&(a.componentDidCatch(e,r||{}),s=1),s&&8&a.__g)return void(a.__g|=2)}catch(t){e=t}}throw i=0,e}},t=0,S.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=_({},this.state)),typeof e==`function`&&(e=e(_({},n),this.props)),e&&(_(n,e),this.__v&&(t&&this.__k.push(t),E(this)))},S.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),E(this))},S.prototype.render=x,n=[],i=0,a=function(e,t){return e.__v.__b-t.__v.__b},o=Symbol(),s=/(PointerCapture)$|Capture$/i,c=0,l={},u=0;var de,F,fe,pe,me=Object.is,he=0,ge=[],_e=[],I=e,ve=I.__b,ye=I.__r,be=I.diffed,xe=I.__c,Se=I.unmount,Ce=I.__;function we(e,t){I.__h&&I.__h(F,e,he||t),he=0;var n=F.__H||(F.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Te(e){return he=1,Ee(ze,e)}function Ee(e,t,n){var r=we(de++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ze(void 0,t),function(e){var t=(r.__N||r.__)[0],n=r.t(t,e);me(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=F,!F.__f)){F.__f=!0;var i=F.shouldComponentUpdate;F.shouldComponentUpdate=function(e,t,n){var r=this.__H;if(!r)return!0;var a=!1,o=this.props!=e;if(r.__.some(function(e){e.__N&&(a=!0,me(e.__[0],e.__N[0])||(o=!0))}),i){var s=i.call(this,e,t,n);return a?s||o:s}return!a||o}}return r.__}function L(e,t){var n=we(de++,3);!I.__s&&Re(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,F.__H.__h.push(n))}function De(e,t){var n=we(de++,4);!I.__s&&Re(n.__H,t)&&(n.__P=!1,n.__=e,n.u=t,F.__h.push(n))}function R(e){return he=5,Oe(function(){return{current:e}},[])}function Oe(e,t){var n=we(de++,7);return Re(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function ke(e,t){return he=8,Oe(function(){return e},t)}function Ae(e){var t=F.context[e.__c],n=we(de++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(F)),t.props.value):e.__}function je(){var e=we(de++,11);if(!e.__){for(var t=F.__v;!t.__m&&t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__=`P`+n[0]+`-`+n[1]++}return e.__}function Me(){var e;do{for(;e=_e.shift();)try{Ie(e)}catch(t){I.__e(t,{__:(e=e.__P)&&e.__v})}for(;e=ge.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Ie),t.__h.some(Le),t.__h=[]}catch(n){t.__h=[],I.__e(n,e.__v)}}}while(_e.length)}I.__b=function(e){F=null,ve&&ve(e)},I.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ce&&Ce(e,t)},I.__r=function(e){ye&&ye(e),de=0;var t=(F=e.__c).__H;t&&(fe==F?F.__h=[]:(t.__h.some(Ie),t.__h.some(Le),de=0),t.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})),fe=F},I.diffed=function(e){be&&be(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Fe(ge.push(t)),t.__H.__.some(function(e){e.u&&(e.__H=e.u)})),fe=F=null},I.__c=function(e,t){t.some(function(e){try{e.__h.some(Ie),e.__h=e.__h.filter(function(e){return!e.__||Le(e)})}catch(t){e.__h=[function(){throw t}]}}),xe&&xe(e,t)},I.unmount=function(e){Se&&Se(e);var t,n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(r){try{if(r.__P&&r.__c){if(n===void 0){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n&&=n.__c}r.__P=n,Fe(_e.push(r))}else Ie(r)}catch(e){t=e}}),r.__H=void 0,t&&I.__e(t,r.__v))};var Ne=typeof requestAnimationFrame==`function`;function Pe(e){var t,n=function(){clearTimeout(r),Ne&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ne&&(t=requestAnimationFrame(n))}function Fe(e){e!=1&&pe==I.requestAnimationFrame||((pe=I.requestAnimationFrame)||Pe)(Me)}function Ie(e){var t=F,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),F=t}function Le(e){var t=F;e.__c=e.__(),F=t}function Re(e,t){return!e||e.length!=t.length||t.some(function(t,n){return!me(t,e[n])})}function ze(e,t){return typeof t==`function`?t(e):t}var Be=Object.assign;function Ve(e,t){for(var n in e)if(n!=`__source`&&e[n]!==t[n])return!0;for(var r in t)if(r!=`__source`&&!(r in e))return!0;return!1}var He=/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini|asp|fill|st)/;function Ue(e,t){function n(e){var n=this.props.ref;return n!=e.ref&&n&&(typeof n==`function`?n(null):n.current=null),t?!t(this.props,e)||n!=e.ref:Ve(this.props,e)}function r(t){return this.shouldComponentUpdate=n,y(e,t)}return r.displayName=`Memo(`+(e.displayName||e.name)+`)`,r.prototype.isReactComponent=!0,r.type=e,r}var We,Ge,Ke=Symbol.for(`react.element`),qe=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(?!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Je=/[A-Z0-9]/g,Ye=typeof document<`u`,Xe=/* @__PURE__ */ rt(function(t,n,r){var i=e.__s||We?(r||n)():n(),a=Te({t:{__:i,u:n}}),o=a[0].t,s=a[1];return De(function(){o.__=i,o.u=n,Ze(o)&&s({t:o})},[t,i,n]),L(function(){return Ze(o)&&s({t:o}),t(function(){Ze(o)&&s({t:o})})},[t]),i});function Ze(e){try{return!Object.is(e.__,e.u())}catch{return!0}}var Qe=function(e){return/fil|che|rad/.test(e)};function $e(e,t,n){return t.__k??(t.textContent=``),le(e,t),typeof n==`function`&&n(),e?e.__c:null}S.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(S.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var et=e.event;e.event=function(e){return et&&(e=et(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var tt={configurable:!0,get:function(){return this.class}},nt=e.vnode;function rt(t){if(!Ge){Ge=!0;var n=e.__r;e.__r=function(e){n&&n(e),32&e.__u&&(We=e),e.__c};var r=e.diffed;e.diffed=function(e){r&&r(e),We==e&&(We=null)}}return t}e.vnode=function(e){if(typeof e.type==`string`)(function(e){var t=e.props,n=e.type,r={},i=n.indexOf(`-`)==-1;for(var a in t){var o=t[a];if(!(a==`value`&&`defaultValue`in t&&o==null||Ye&&a==`children`&&n==`noscript`||a==`class`||a==`className`)){if(a==`style`&&o&&o.constructor==Object){var s=void 0;for(var c in o)typeof o[c]!=`number`||He.test(c)||(s||=o=Be({},o),o[c]+=`px`)}else if(a==`defaultValue`&&`value`in t&&t.value==null)a=`value`;else if(a==`download`&&!0===o)o=``;else if(a==`translate`&&o===`no`)o=!1;else if(a[0]==`o`&&a[1]==`n`){var l=a.toLowerCase();l==`ondoubleclick`?a=`ondblclick`:l!=`onchange`||n!=`input`&&n!=`textarea`||Qe(t.type)?l==`onfocus`?a=`onfocusin`:l==`onblur`&&(a=`onfocusout`):l=a=`oninput`,l==`oninput`&&r[a=l]&&(a=`oninputCapture`)}else i&&qe.test(a)?a=a.replace(Je,`-$&`).toLowerCase():o===null&&(o=void 0);r[a]=o}}if(n==`select`){var u=r.defaultValue==null?r.multiple&&Array.isArray(r.value)?r.value:null:r.defaultValue;u!=null&&(r.value=ee(t.children).forEach(function(e){e.props.selected=r.multiple?u.indexOf(e.props.value)!=-1:u==e.props.value}))}t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,\"className\",tt)):t.className&&(r.class=r.className=t.className),e.props=r})(e);else if(typeof e.type==`function`&&(`ref`in e.props&&`prototype`in e.type&&e.type.prototype.render&&(e.ref=e.props.ref,delete e.props.ref),e.type.defaultProps)){var t=Be({},e.props);for(var n in e.type.defaultProps)t[n]===void 0&&(t[n]=e.type.defaultProps[n]);e.props=t}e.ref&&!(`ref`in e.props)&&Object.defineProperty(e.props,\"ref\",{value:e.ref,configurable:!0,writable:!0}),e.$$typeof=Ke,nt&&nt(e)};function it(e){return!!e.__k&&(le(null,e),!0)}function at(e){return{render:function(t){$e(t,e)},unmount:function(){it(e)}}}function ot(e,t={}){return e.replace(/\\{(\\w+)\\}/g,(e,n)=>n in t?String(t[n]):e)}function st(e,t,n,r){let i=`other`;try{i=new Intl.PluralRules(r).select(n)}catch{}return ot(e[`${t}.${i}`]??e[`${t}.other`]??``,{count:n})}function ct(e){return(t,n)=>ot(e[t]??t,n)}var lt=e=>({id:e.id,role:e.role,text:e.text,citations:e.citations,attachments:e.attachments,status:`done`,...e.feedback?{feedback:e.feedback}:{}});function ut(e,t){let n=(t,n)=>e.map(e=>e.id===t?n(e):e);switch(t.type){case`message.start`:return[...e,{id:t.messageId,role:`assistant`,text:``,citations:[],attachments:0,status:`streaming`}];case`text.delta`:return n(t.messageId,e=>({...e,text:e.text+t.delta}));case`citation`:return n(t.messageId,e=>({...e,citations:[...e.citations,{index:t.index,title:t.title,url:t.url}]}));case`message.end`:return n(t.messageId,e=>({...e,status:`done`,...t.feedback?{feedback:t.feedback}:{}}));default:return e}}var dt=e=>e.map(e=>e.status===`streaming`?{...e,status:`error`}:e);function ft(e,t){if(e.type===`reasoning`)return e.state===`started`?t(`status.thinking`):null;if(e.type===`tool.status`)return e.state===`running`?e.name===`file_search`?t(`status.searching`):t(`status.tool`,{name:e.name}):null;if(e.type===`text.delta`||e.type===`message.end`)return null}var pt=[`invalid_input`,`unauthorized`,`session_expired`,`not_found`,`rate_limited`,`budget_exceeded`,`bot_unavailable`,`content_blocked`,`timeout`,`upstream_error`,`internal_error`],mt=[`completed`,`max_steps`,`max_output_tokens`,`timeout`,`content_filter`,`aborted`],ht=[`conversation.created`,`user.ack`,`message.start`,`reasoning`,`text.delta`,`citation`,`tool.status`,`message.end`,`error`],gt=e=>typeof e==`object`&&!!e&&!Array.isArray(e),z=(e,t=0,n=1/0)=>typeof e==`string`&&e.length>=t&&e.length<=n,_t=(e,t)=>typeof e==`number`&&Number.isSafeInteger(e)&&e>=t,vt=(e,t)=>t.includes(e),yt=e=>z(e,1,128);function bt(e){return gt(e)&&z(e.handle,1,4096)&&typeof e.key==`string`&&/^[0-9a-f]{16,64}$/.test(e.key)?{handle:e.handle,key:e.key}:void 0}function xt(e){if(typeof e!=`string`||!/^https?:\\/\\/[^\\s/?#]+[^\\s]*$/i.test(e))return!1;try{let{protocol:t}=new URL(e);return t===`http:`||t===`https:`}catch{return!1}}function St(e){if(gt(e)&&_t(e.index,1)&&z(e.title,1)&&(e.url===void 0||xt(e.url)))return{index:e.index,title:e.title,...e.url===void 0?{}:{url:e.url}}}function Ct(e){if(!gt(e))return;let t={};for(let[n,r]of Object.entries(e)){if(n.length>32||!(z(r,0,200)||typeof r==`number`&&Number.isFinite(r)))return;t[n]=r}return t}function wt(e){if(!gt(e))return;let t=e.messageId;switch(e.type){case`conversation.created`:return z(e.resumeToken,1)?{type:`conversation.created`,resumeToken:e.resumeToken}:void 0;case`user.ack`:case`message.start`:return yt(t)?{type:e.type,messageId:t}:void 0;case`reasoning`:return yt(t)&&vt(e.state,[`started`,`done`])?{type:`reasoning`,messageId:t,state:e.state}:void 0;case`text.delta`:return yt(t)&&z(e.delta)?{type:`text.delta`,messageId:t,delta:e.delta}:void 0;case`citation`:{let n=St(e);return yt(t)&&n?{type:`citation`,messageId:t,...n}:void 0}case`tool.status`:return yt(t)&&z(e.callId,1,128)&&z(e.name,1,64)&&vt(e.state,[`running`,`done`,`error`])?{type:`tool.status`,messageId:t,callId:e.callId,name:e.name,state:e.state}:void 0;case`message.end`:{let{resumeToken:n}=e;if(!yt(t)||!vt(e.reason,mt)||n!==void 0&&!z(n,1))return;let r=e.feedback===void 0?void 0:bt(e.feedback);return e.feedback!==void 0&&!r?void 0:{type:`message.end`,messageId:t,reason:e.reason,...typeof n==`string`?{resumeToken:n}:{},...r?{feedback:r}:{}}}case`error`:{let{code:t,message:n,retryAfterMs:r,key:i,params:a}=e;if(!vt(t,pt)||!z(n,0,500)||r!==void 0&&!_t(r,0)||i!==void 0&&!z(i,0,64))return;let o=a===void 0?void 0:Ct(a);return a!==void 0&&!o?void 0:{type:`error`,code:t,message:n,...r===void 0?{}:{retryAfterMs:r},...i===void 0?{}:{key:i},...o?{params:o}:{}}}default:return}}function Tt(e){if(!gt(e)||!z(e.id,1,256)||!vt(e.role,[`user`,`assistant`])||!z(e.text)||!Array.isArray(e.citations)||!_t(e.attachments,0))return;let t=e.citations.map(St);if(t.some(e=>e===void 0))return;let n=e.feedback===void 0?void 0:bt(e.feedback);if(e.feedback===void 0||n)return{id:e.id,role:e.role,text:e.text,citations:t,attachments:e.attachments,...n?{feedback:n}:{}}}function Et(e){if(!gt(e)||!Array.isArray(e.messages))return;let t=e.messages.map(Tt);return t.some(e=>e===void 0)?void 0:{messages:t}}var Dt=new Set(ht);function Ot(e){if(!Dt.has(e.event))return{ok:!1,reason:`unknown_type`,type:e.event};let t;try{t=JSON.parse(e.data)}catch{return{ok:!1,reason:`invalid_json`,type:e.event}}let n=wt(t);return!n||n.type!==e.event?{ok:!1,reason:`invalid_payload`,type:e.event}:{ok:!0,event:n}}var kt=class{#e=``;#t=!1;#n=!1;#r=``;#i=[];push(e){let t=e;!this.#n&&t.length>0&&(this.#n=!0,t.charCodeAt(0)===65279&&(t=t.slice(1))),this.#t&&t.startsWith(`\n`)&&(t=t.slice(1)),this.#t=!1,this.#e+=t;let n=[],r=0;for(let e=0;e<this.#e.length;e+=1){let t=this.#e[e];if(t!==`\n`&&t!==`\\r`)continue;let i=this.#e.slice(r,e);t===`\\r`&&(e+1===this.#e.length?this.#t=!0:this.#e[e+1]===`\n`&&(e+=1)),r=e+1;let a=this.#a(i);a&&n.push(a)}return this.#e=this.#e.slice(r),n}#a(e){if(e===``)return this.#o();if(e.startsWith(`:`))return;let t=e.indexOf(`:`),n=t===-1?e:e.slice(0,t),r=t===-1?``:e.slice(t+1);r.startsWith(` `)&&(r=r.slice(1)),n===`event`?this.#r=r:n===`data`&&this.#i.push(r)}#o(){let e=this.#i.length>0,t={event:this.#r===``?`message`:this.#r,data:this.#i.join(`\n`)};return this.#r=``,this.#i=[],e?t:void 0}},At=e=>({contentType:`application/json`,body:JSON.stringify(e)}),jt=30,Mt=class extends Error{event;constructor(e){super(e.message),this.event=e}},Nt=class{#e;#t;#n;#r;#i;#a;#o;#s=!1;#c;#l;#u;constructor(e){this.#e=e,this.#t=e.fetch??((e,t)=>fetch(e,t)),this.#n=e.botId}#d(e,t,n){return{type:`error`,code:e,key:t,message:this.#e.translate?.(t)??n}}#f(e){let t=e.key?this.#e.translate?.(e.key,e.params):void 0;return t?{...e,message:t}:e}async identify(e){if(e===this.#o)return!1;this.#o=e,this.#s=!0,await this.#a?.catch(()=>void 0);let t=this.#p();this.#u=this.#r?.accessToken??this.#u,this.#r=void 0;try{await this.#g(!1)}catch{}return this.#p()!==t}#p(){let e=`askdare:${this.#n}:resume`;return this.#l?`${e}:${this.#l}`:e}reset(){this.#i=void 0,this.#e.storage.remove(this.#p())}hasConversation(){return this.#e.storage.get(this.#p())!==void 0}async loadHistory(e){let t=this.#e.storage.get(this.#p());if(!t)return[];let n=await this.#h(`POST`,`/history`,()=>At({botId:this.#e.botId,resumeToken:t}),e);if(n.status===404)return this.reset(),[];if(!n.ok)throw Error(`History request failed with ${n.status}`);return Et(await n.json())?.messages??[]}async deleteConversation(){let e=this.#e.storage.get(this.#p());try{e&&await this.#h(`DELETE`,`/conversation`,()=>At({botId:this.#e.botId,resumeToken:e}))}finally{this.reset()}}ratings(){try{let e=JSON.parse(this.#e.storage.get(this.#m())??`{}`);return typeof e!=`object`||!e?{}:Object.fromEntries(Object.entries(e).filter(e=>e[1]===`up`||e[1]===`down`))}catch{return{}}}rememberRating(e,t){let{[e]:n,...r}=this.ratings(),i=Object.entries(t?{...r,[e]:t}:r).slice(-100);this.#e.storage.set(this.#m(),JSON.stringify(Object.fromEntries(i)))}#m(){return`askdare:${this.#n}:ratings`}async rate(e,t,n){try{let r=await this.#h(`POST`,`/feedback`,()=>At({botId:this.#e.botId,feedback:e,rating:t,...n?{comment:n}:{}}));return r.ok?void 0:(await this.#b(r,!1)).message}catch(e){return this.#v(e,`upstream_error`).message}}async upload(e,t,n){try{let r=await this.#h(`POST`,`/attachments`,()=>({contentType:`application/octet-stream`,body:e,headers:{\"x-askdare-bot\":this.#e.botId,\"x-askdare-filename\":encodeURIComponent(t)}}),n);if(!r.ok)return{ok:!1,message:(await this.#b(r)).message};let i=(await r.json()).attachment;return typeof i?.id!=`string`||i.kind!==`image`&&i.kind!==`pdf`||typeof i.name!=`string`?{ok:!1,message:this.#d(`upstream_error`,`error.uploadFailed`,`The file could not be uploaded.`).message}:{ok:!0,file:{id:i.id,kind:i.kind,name:i.name}}}catch(e){return{ok:!1,message:this.#v(e,`upstream_error`).message}}}async transcribe(e,t){try{let n=await this.#h(`POST`,`/transcriptions`,()=>({contentType:`application/octet-stream`,body:e,headers:{\"x-askdare-bot\":this.#e.botId,\"x-askdare-languages\":t.join(`,`)}}));if(!n.ok)return{ok:!1,message:(await this.#b(n)).message};let r=await n.json();return typeof r.text==`string`?{ok:!0,text:r.text}:{ok:!1,message:this.#d(`upstream_error`,`error.transcriptionFailed`,`The recording could not be transcribed.`).message}}catch(e){return{ok:!1,message:this.#v(e,`upstream_error`).message}}}async send(e,t,n){let r=e.context===this.#i?void 0:e.context;try{let i=await this.#h(`POST`,`/messages`,()=>{let t=this.#e.storage.get(this.#p());return At({botId:this.#e.botId,text:e.text,locale:this.#e.locale,...e.attachments?.length?{attachments:e.attachments}:{},...r?{context:r}:{},...t?{resumeToken:t}:{}})},n);if(!i.ok||!i.body){t(await this.#b(i));return}if(i.headers.get(`x-askdare-protocol`)!==`1`){t(this.#d(`bot_unavailable`,`error.updated`,`The assistant was updated. Please reload the page.`));return}await this.#x(i.body,e=>{e.type===`message.start`&&r&&(this.#i=r),t(e)},n)}catch(e){if(n?.aborted)return;t(this.#v(e,e instanceof DOMException&&e.name===`TimeoutError`?`timeout`:`upstream_error`))}}async#h(e,t,n,r){let i=async i=>{let a=await this.#g(i),{contentType:o,body:s,headers:c}=n();return this.#t(`${this.#e.basePath}${t}`,{method:e,headers:{...c,\"content-type\":o,authorization:`Bearer ${a.accessToken}`},body:s,...r?{signal:r}:{}})},a=await i(!1);return a.status===401?i(!0):a}async#g(e){let t=Date.now()/1e3;return!e&&!this.#s&&this.#r&&this.#r.expiresAt-jt>t?this.#r:(this.#a??=this.#_().finally(()=>{this.#a=void 0}),this.#a)}async#_(){let e=this.#e.storage.get(this.#p()),t=this.#r?.accessToken??this.#u,n=this.#o,r=this.#p(),i=await this.#t(`${this.#e.basePath}/session`,{method:`POST`,headers:{\"content-type\":`application/json`},body:JSON.stringify({botId:this.#e.botId,...e?{resumeToken:e}:{},...t?{accessToken:t}:{},...n===void 0?{}:{identityToken:n}})});if(!i.ok)throw new Mt(await this.#b(i,!1));let a=await i.json();return this.#o===n&&(this.#s=!1),this.#u=void 0,this.#l=a.identified?a.identityKey:void 0,n&&!a.identified&&this.#c!==n&&(this.#c=n,console.warn(`[askdare] askdare('identify') was refused (${a.identityProblem??`unknown`}); the chat continues anonymously.`)),a.resumeToken?(this.#e.storage.set(this.#p(),a.resumeToken),r!==this.#p()&&this.#e.storage.remove(r)):!a.resumable&&e&&r===this.#p()&&this.reset(),this.#r={accessToken:a.accessToken,expiresAt:a.expiresAt},this.#r}#v(e,t){return e instanceof Mt?e.event:this.#y(t)}#y(e){return this.#d(e,`error.connection`,`Connection problem. Please try again.`)}async#b(e,t=!0){let n={};try{n=await e.json()}catch{}t&&e.status===404&&n.error?.code===`not_found`&&this.reset();let r=Ot({event:`error`,data:JSON.stringify({type:`error`,...n.error})});return r.ok&&r.event.type===`error`?this.#f(r.event):this.#d(`upstream_error`,`error.upstream_error`,`The assistant is temporarily unavailable. Please try again.`)}async#x(e,t,n){let r=e.getReader(),i=new TextDecoder,a=new kt,o=this.#e.watchdogMs??45e3,s,c=!1,l=()=>{clearTimeout(s),s=setTimeout(()=>{c=!0,r.cancel()},o)},u=()=>void r.cancel();n?.addEventListener(`abort`,u,{once:!0});try{for(l();;){let{done:e,value:n}=await r.read();if(e)break;l();for(let e of a.push(i.decode(n,{stream:!0}))){let n=Ot(e);n.ok&&(n.event.type===`conversation.created`||n.event.type===`message.end`&&n.event.resumeToken?this.#e.storage.set(this.#p(),n.event.resumeToken):n.event.type===`error`&&n.event.code===`not_found`&&this.reset(),t(n.event.type===`error`?this.#f(n.event):n.event))}}c&&t(this.#d(`timeout`,`error.stalled`,`The connection stalled. Please try again.`))}finally{clearTimeout(s),n?.removeEventListener(`abort`,u)}}};function Pt(){let e=[],t=(t,n)=>{let r=e.findIndex(([e,r])=>e===t&&r===n);r>=0&&e.splice(r,1)};return{on(n,r){return typeof n==`string`&&typeof r==`function`?e.push([n,r]):console.warn(`[askdare] askdare('on') expects an event type and a function.`),()=>t(n,r)},off:t,emit(t){Object.freeze(t);for(let[n,r]of[...e])if(n===`*`||n===t.type)try{r(t)}catch{console.warn(`[askdare] A listener for \"${t.type}\" threw.`)}}}}var Ft=2048,It=.85,Lt=/\\.(png|jpe?g|webp|gif|heic|heif|avif|bmp)$/i,Rt=class extends Error{},zt=e=>e.type===`application/pdf`||/\\.pdf$/i.test(e.name),Bt=e=>e.type.startsWith(`image/`)&&e.type!==`image/svg+xml`||Lt.test(e.name),Vt=e=>e.replace(/\\.[^.]*$/,``)||`image`;function Ht(e){return[...e.images?[`image/png`,`image/jpeg`,`image/webp`,`image/gif`,`image/heic`]:[],...e.pdf?[`application/pdf`]:[]].join(`,`)}async function Ut(e,t,n){let r=document.createElement(`canvas`);r.width=t,r.height=n;let i=r.getContext(`2d`);if(!i)throw new Rt;return i.fillStyle=`#fff`,i.fillRect(0,0,t,n),i.drawImage(e,0,0,t,n),new Promise((e,t)=>r.toBlob(n=>n?e(n):t(new Rt),`image/jpeg`,It))}async function Wt(e,t){if(t.pdf&&zt(e))return{blob:e,name:e.name,kind:`pdf`};if(!t.images||!Bt(e))throw new Rt;let n;try{n=await createImageBitmap(e,{imageOrientation:`from-image`})}catch{throw new Rt}try{let t=Math.min(1,Ft/Math.max(n.width,n.height)),r=Math.max(1,Math.round(n.width*t)),i=Math.max(1,Math.round(n.height*t));return{blob:await Ut(n,r,i),name:`${Vt(e.name)}.jpg`,kind:`image`}}finally{n.close()}}var Gt=[`audio/webm;codecs=opus`,`audio/webm`,`audio/mp4;codecs=mp4a.40.2`,`audio/mp4`],Kt=32e3;function qt(){if(typeof MediaRecorder<`u`)return Gt.find(e=>MediaRecorder.isTypeSupported(e))}function Jt(){return!navigator.mediaDevices?.getUserMedia||!qt()?!1:document.featurePolicy?.allowsFeature(`microphone`)??!0}var Yt=class extends Error{reason;constructor(e,t){super(`Microphone ${e}`,t),this.reason=e}};async function Xt(e){let t=qt();if(!t)throw new Yt(`failed`);let n;try{n=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0}})}catch(e){let t=e instanceof DOMException?e.name:``;throw t===`NotAllowedError`||t===`SecurityError`?new Yt(`blocked`,{cause:e}):t===`NotFoundError`||t===`OverconstrainedError`?new Yt(`missing`,{cause:e}):new Yt(`failed`,{cause:e})}try{return Zt(n,t,e)}catch(e){for(let e of n.getTracks())e.stop();throw new Yt(`failed`,{cause:e})}}function Zt(e,t,n){let r=new MediaRecorder(e,{mimeType:t,audioBitsPerSecond:Kt}),i=[];r.addEventListener(`dataavailable`,e=>{e.data.size>0&&i.push(e.data)});let a=new Promise(e=>r.addEventListener(`stop`,()=>e(),{once:!0})),o=new AudioContext,s=o.createAnalyser();s.fftSize=512,o.createMediaStreamSource(e).connect(s);let c=new Uint8Array(s.fftSize),l=()=>{for(let t of e.getTracks())t.stop();o.close()},u,d=()=>{clearTimeout(u),r.state!==`inactive`&&r.stop()};return r.start(250),u=setTimeout(d,n*1e3),{level(){s.getByteTimeDomainData(c);let e=0;for(let t of c){let n=(t-128)/128;e+=n*n}return Math.min(1,Math.sqrt(e/c.length)*4)},async stop(){return d(),await a,l(),new Blob(i,{type:t.split(`;`)[0]??t})},cancel(){d(),l()}}}function Qt(e){return e.phase===`ready`&&!e.busy&&!e.files.some(e=>e.status===`uploading`)&&(e.draft.trim()!==``||e.files.some(e=>e.status===`ready`))}function $t(){return{get(e){try{return window.localStorage.getItem(e)??void 0}catch{return}},set(e,t){try{window.localStorage.setItem(e,t)}catch{}},remove(e){try{window.localStorage.removeItem(e)}catch{}}}}var en=2e3;function tn(){let e={input:/* @__PURE__ */ new Set,dictation:/* @__PURE__ */ new Set},t,n=(t,n)=>{let r=!1;for(let i of e[t])r=i(n)||r;return r};return{focus(e,r=!1){t=n(e,r)?void 0:{target:e,explicit:r,at:Date.now()}},onFocus(n,r){return e[n].add(r),t?.target===n&&Date.now()-t.at<en&&r(t?.explicit??!1)&&(t=void 0),()=>e[n].delete(r)}}}var nn={blocked:`microphone.blocked`,missing:`microphone.missing`,failed:`microphone.failed`},rn=500,an=e=>`${Math.floor(e/1e5)/10} MB`;function on(e){for(let t of e)t.previewUrl&&URL.revokeObjectURL(t.previewUrl)}function sn(e,t={}){let n=ct(e.widget.texts),r=t.client??new Nt({basePath:e.basePath,botId:e.botId,locale:e.widget.locale,storage:$t(),translate:(t,r)=>e.widget.texts[t]===void 0?void 0:n(t,r)}),i=t.recorder??{canRecord:Jt,startRecording:Xt},a=e.voice,o=e.attachments,s={phase:`starting`,busy:!1,messages:[],draft:``,error:void 0,activity:null,files:[],dictation:`idle`,elapsed:0,canDictate:!1,page:t.page??{},ratings:{},commenting:void 0},c=s,l=/* @__PURE__ */ new Set,u=e=>{c={...c,...e};for(let e of l)e()},d=Pt(),f=e.botId,p=!1,m=()=>{p||(p=!0,d.emit({type:`ready`,bot:f}))},{focus:h,onFocus:g}=tn(),_=0,v=()=>`local_${++_}`,y,b=!1,x=!1,S=Promise.resolve(),C,w,T,E=/* @__PURE__ */ new Map,D=/* @__PURE__ */ new Map,O,k=!1,A,ee,te=()=>{clearTimeout(A),clearInterval(ee),O?.cancel(),O=void 0,c.dictation!==`idle`&&u({dictation:`idle`})},ne=()=>{if(C?.abort(),!r.hasConversation()){C=void 0,x=!0,u({phase:`ready`}),m();return}let e=new AbortController;C=e,u({phase:`loading`}),r.loadHistory(e.signal).then(t=>{e.signal.aborted||(x=!0,u({messages:t.map(lt)}))}).catch(t=>{e.signal.aborted||u({error:t instanceof Mt?t.message:n(`error.history`)})}).finally(()=>{C===e&&(C=void 0,u({phase:`ready`}),x&&m())})},j=()=>{document.visibilityState===`hidden`&&te()},re=e=>{for(let t of[...e])D.get(t)?.abort(),D.delete(t)},M=async e=>{if(!o)return;let t=v(),i=e=>u({files:c.files.map(n=>n.key===t?{...n,...e}:n)}),a=new AbortController;D.set(t,a),u({files:[...c.files,{key:t,name:e.name,status:`uploading`}]});let s=e=>{D.delete(t),a.signal.aborted||i({status:`error`,error:e})},l;try{l=await Wt(e,o)}catch{s(n(`attachment.unsupported`));return}if(l.blob.size>o.maxBytes){s(n(`attachment.tooLarge`,{size:an(o.maxBytes)}));return}if(a.signal.aborted)return;let d=l.kind===`image`?URL.createObjectURL(l.blob):void 0;i({name:l.name,kind:l.kind,previewUrl:d});let f=await r.upload(l.blob,l.name,a.signal);D.delete(t),a.signal.aborted?on([{previewUrl:d}]):i(f.ok?{status:`ready`,handle:f.file.id,name:f.file.name}:{status:`error`,error:f.message})},ie={async send(t){let i=(t??c.draft).trim(),a=c.files.some(e=>e.status===`uploading`);if(t===void 0?!Qt(c):c.phase!==`ready`||c.busy||a||i===``)return;let o=c.files.filter(e=>e.status===`ready`),s=o.flatMap(({name:e,kind:t,previewUrl:n})=>t?[{name:e,kind:t,previewUrl:n}]:[]),l=o.flatMap(e=>e.handle?[e.handle]:[]);on(c.files.filter(e=>e.status!==`ready`)),u({files:[],...t===void 0?{draft:``}:{},error:void 0,busy:!0,messages:[...c.messages,{id:v(),role:`user`,text:i,citations:[],attachments:s.length,files:s,status:`done`}]}),d.emit({type:`message.sent`,bot:f,length:[...i].length,attachments:s.length,source:t===void 0?`typed`:`starter`});let p=e.pageContext?c.page.context:void 0,m=new AbortController;w=m;let g=Date.now(),_=!1,y,b=e=>{if(T!==b)return;T=void 0;let t=c.messages.find(e=>e.id===y);d.emit({type:`message.received`,bot:f,outcome:e,durationMs:Date.now()-g,citations:t?.citations.length??0})};T=b,await r.send({text:i,attachments:l,context:p},e=>{let t=ft(e,n);t!==void 0&&u({activity:t}),e.type===`message.start`&&(y=e.messageId),e.type===`error`?(_=!0,d.emit({type:`error`,bot:f,code:e.code}),u({error:e.message,messages:dt(c.messages)})):u({messages:ut(c.messages,e)})},m.signal),w===m&&(w=void 0),b(_?`failed`:m.signal.aborted?`stopped`:`completed`),m.signal.aborted?u({activity:null,busy:!1,messages:dt(c.messages)}):(u({activity:null,busy:!1}),h(`input`))},setDraft(e){u({draft:e})},addFiles(e){if(!o||e.length===0)return;let t=o.maxPerMessage-c.files.length;e.length>t&&u({error:n(`attachment.tooMany`,{count:o.maxPerMessage})});for(let n of e.slice(0,Math.max(0,t)))M(n)},removeFile(e){re([e]),on(c.files.filter(t=>t.key===e)),u({files:c.files.filter(t=>t.key!==e)})},async startDictation(){if(!a||O||k||c.dictation!==`idle`)return;u({error:void 0}),k=!0;let e;try{e=await i.startRecording(a.maxSeconds)}catch(e){u({error:n(nn[e instanceof Yt?e.reason:`failed`])});return}finally{k=!1}if(!y){e.cancel();return}O=e,u({elapsed:0,dictation:`recording`}),h(`dictation`),A=setTimeout(()=>void ie.finishDictation(),a.maxSeconds*1e3);let t=Date.now();ee=setInterval(()=>{let e=Math.min(a.maxSeconds,Math.floor((Date.now()-t)/1e3));e!==c.elapsed&&u({elapsed:e})},250)},async finishDictation(){let t=O;if(!t)return;O=void 0,clearTimeout(A),clearInterval(ee),u({dictation:`transcribing`});let i=await t.stop();if(i.size<1e3){u({dictation:`idle`,error:n(`dictation.empty`)});return}let a=[...navigator.languages.slice(0,2),e.widget.locale],o=await r.transcribe(i,a);if(u({dictation:`idle`}),!o.ok)u({error:o.message});else if(o.text){let e=c.draft;u({draft:e.trim()?`${e.trimEnd()} ${o.text}`:o.text})}h(`input`)},cancelDictation(){te(),h(`input`)},async newConversation(){u({busy:!0}),await r.deleteConversation().catch(()=>void 0),on(c.messages.flatMap(e=>e.files??[])),re(D.keys()),on(c.files),u({files:[],messages:[],error:void 0,busy:!1,commenting:void 0}),d.emit({type:`conversation.reset`,bot:f}),h(`input`)},async rate(e,t,n){let i=c.messages.find(t=>t.id===e)?.feedback;if(!i)return;let{key:a}=i,o=c.ratings[a],s=n?.trim().slice(0,rn),l=t===`down`&&!!s,p=e=>{let{[a]:t,...n}=c.ratings;return e?{...n,[a]:e}:n},m=E.get(a)??{confirmed:o,latest:0,queue:Promise.resolve()};E.set(a,m);let h=++m.latest;u({ratings:p(t),error:void 0,commenting:l||t===`down`&&o!==`down`?e:void 0});let g=m.queue.then(()=>r.rate(i.handle,t,t===null?void 0:s));m.queue=g;let _=await g;_||(m.confirmed=t??void 0,r.rememberRating(a,t),d.emit({type:`feedback`,bot:f,rating:t,commented:l})),m.latest===h&&(_?u({ratings:p(m.confirmed),error:_,...l?{}:{commenting:void 0}}):l&&c.commenting===e&&u({commenting:void 0}))},dismissComment(){c.commenting!==void 0&&u({commenting:void 0})},focus(){h(`input`,!0)}};return{config:e,actions:ie,t:n,subscribe(e){return l.add(e),()=>l.delete(e)},getSnapshot:()=>c,getServerSnapshot:()=>s,start(e={}){if(y)return;let t={};y=t,u({ratings:r.ratings(),canDictate:a!==void 0&&i.canRecord(),...c.phase===`starting`&&r.hasConversation()?{phase:`loading`}:{}}),document.addEventListener(`visibilitychange`,j),(e.handshake??Promise.resolve()).then(()=>S,()=>S).finally(()=>{y===t&&(b=!0,x?(c.phase!==`ready`&&u({phase:`ready`}),m()):ne())})},stop(){y&&(y=void 0,document.removeEventListener(`visibilitychange`,j),C?.abort(),C=void 0,T?.(`stopped`),w?.abort(),w=void 0,te(),D.size>0&&(re(D.keys()),u({files:c.files.filter(e=>e.status!==`uploading`)})))},identify(e){S=S.then(async()=>{await r.identify(e)&&(x=!1,u({messages:[],error:void 0,commenting:void 0}),b&&y&&ne())})},configure(e){u({page:e})},hide(){te()},level:()=>O?.level(),onFocus:g,onEvent:e=>d.on(`*`,e)}}var cn=async()=>{};function ln(e,t){let n={phase:`ready`,busy:t.busy??!1,messages:t.messages,draft:t.draft??``,error:t.error,activity:t.activity??null,files:t.pending??[],dictation:t.dictation??`idle`,elapsed:t.elapsed??0,canDictate:e.voice!==void 0,page:{},ratings:t.ratings??{},commenting:t.commenting},r=n,i=/* @__PURE__ */ new Set,a=e=>{n={...n,...e};for(let e of i)e()},{focus:o,onFocus:s}=tn();return{config:e,actions:{send:cn,setDraft:e=>a({draft:e}),addFiles:()=>{},removeFile:()=>{},startDictation:cn,finishDictation:cn,cancelDictation:()=>{},newConversation:cn,rate:cn,dismissComment:()=>a({commenting:void 0}),focus:()=>o(`input`)},t:ct(e.widget.texts),subscribe(e){return i.add(e),()=>i.delete(e)},getSnapshot:()=>n,getServerSnapshot:()=>r,start:()=>{},stop:()=>{},identify:()=>{},configure:e=>a({page:e}),hide:()=>{},level:()=>void 0,onFocus:s,onEvent:()=>()=>{}}}var un=Symbol.for(`pv`),dn=0;Array.isArray;function B(t,n,r,i,a,o){n||={};var s,c,l=n;if(`ref`in l&&typeof t!=`function`)for(c in l={},n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:t,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:un,__v:--dn,__i:-1,__u:0};return(a||o)&&(u.__source=a,u.__self=o),e.vnode&&e.vnode(u),u}var fn=ue(null),pn=ue(null);function mn({store:e,children:t}){return/* @__PURE__ */ B(fn.Provider,{value:e,children:t})}function V(){let e=Ae(fn);if(!e)throw Error(`[askdare] Chat components must be inside <Root>.`);return e}function hn(e){return Xe(e.subscribe,e.getSnapshot,e.getServerSnapshot)}function H(){let e=V(),t=hn(e),{config:n}=e,{page:r}=t,i=Oe(()=>({id:n.botId,title:n.widget.title,subtitle:n.widget.subtitle,greeting:r.greeting??n.widget.greeting,starters:r.starters??n.widget.starters,placeholder:n.widget.placeholder,avatar:n.widget.avatar,locale:n.widget.locale,disclosure:n.widget.disclosure,preset:n.widget.preset,variants:n.widget.variants,attachments:n.attachments,maxDictationSeconds:n.voice?.maxSeconds,texts:n.widget.texts}),[n,r]);return{state:t,actions:e.actions,bot:i,t:e.t}}function gn(e){let t=V();return Xe(t.subscribe,()=>e(t.getSnapshot()),()=>e(t.getServerSnapshot()))}function _n({message:e,children:t}){return/* @__PURE__ */ B(pn.Provider,{value:e,children:t})}function vn(){let e=Ae(pn);if(!e)throw Error(`[askdare] useMessage() works only inside <MessageList>.`);return e}function yn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var bn=yn();function xn(e){bn=e}var Sn={exec:()=>null};function Cn(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function U(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(W.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var wn=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),W={codeRemoveIndent:/^(?: {0,3}\\t| {1,4})/gm,outputLinkReplace:/\\\\([\\[\\]])/g,indentCodeCompensation:/^(\\s+)(?:```)/,beginningSpace:/^\\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \\t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\\n/g,tabCharGlobal:/\\t/g,leadingSpaceTab:/^[ \\t]+/,multipleSpaceGlobal:/\\s+/g,blankLine:/^[ \\t]*$/,doubleBlankLine:/\\n[ \\t]*\\n[ \\t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\\n {0,3}((?:=+|-+)[ \\t]*)(?=\\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \\t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \\t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\\[[ xX]\\][ \\t]+\\S/,listReplaceTask:/^\\[[ xX]\\][ \\t]+/,listTaskCheckbox:/\\[[ xX]\\]/,anyLine:/\\n.*\\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\\||\\| *$/g,tableRowBlankLine:/\\n[ \\t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\\s|>)/i,endPreScriptTag:/^<\\/(pre|code|kbd|script)(\\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/,unicodeAlphaNumeric:/[\\p{L}\\p{N}]/u,numericCharacterReference:/&#(?:(\\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,escapeTest:/[&<>\"']/,escapeReplace:/[&<>\"']/g,escapeTestNoEncode:/[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/,escapeReplaceNoEncode:/[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,caret:/(^|[^\\[])\\^/g,percentDecode:/%25/g,findPipe:/\\|/g,splitPipe:/ \\|/,slashPipe:/\\\\\\|/g,carriageReturn:/\\r\\n|\\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\\S*/,endingNewline:/\\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\\\n]*)?(?:\\\\n|$))`),nextBulletRegex:Cn(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ ][^\\\\n]*)?(?:\\\\n|$))`)),hrRegex:Cn(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\\\*[ ]*){3,})(?:\\\\n+|$)`)),fencesBeginRegex:Cn(e=>RegExp(`^ {0,${e}}(?:\\`\\`\\`|~~~)`)),headingBeginRegex:Cn(e=>RegExp(`^ {0,${e}}#{1,6}(?:\\\\s|$)`)),pedanticHeadingBeginRegex:Cn(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Cn(e=>RegExp(`^ {0,${e}}(?:</?(?:${zn})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)`,`i`)),blockquoteBeginRegex:Cn(e=>RegExp(`^ {0,${e}}>`))},Tn=/^(?:[ \\t]*(?:\\n|$))+/,En=/^((?: {4}| {0,3}\\t)[^\\n]+(?:\\n(?:[ \\t]*(?:\\n|$))*)?)+/,Dn=/^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}(?:(?=`)\\1`*|(?=~)\\1~*) *(?=\\n|$)|$)/,On=/^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/,kn=/^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/,An=/ {0,3}(?:[*+-]|\\d{1,9}[.)])/,jn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\\n(?!\\s*?\\n|bull |fences|blockquote|heading|hr|html|table))+?)\\n {0,3}(=+|-+)[ \\t]*(?:\\n+|$)/,Mn=U(jn).replace(/bull/g,An).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/\\|table/g,``).getRegex(),Nn=U(jn).replace(/bull/g,An).replace(/blockCode/g,/(?: {4}| {0,3}\\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/).replace(/html/g,/ {0,3}<[^\\n>]+>\\n/).replace(/table/g,/ {0,3}\\|?(?:[:\\- ]*\\|)+[\\:\\- ]*\\n/).getRegex(),Pn=/^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \\t]+\\n)[^\\n]+)*)/,Fn=/^[^\\n]+/,In=/(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\\\n]|\\n(?![ \\t]*\\n))+/,Ln=U(/^ {0,3}\\[(label)\\]: *(?:\\n[ \\t]*)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n[ \\t]*)?| *\\n[ \\t]*)(title))? *(?:\\n+|$)/).replace(`label`,In).replace(`title`,/(?:\"(?:\\\\[\\s\\S]|[^\"\\\\])*\"|'(?:\\\\[\\s\\S]|[^'\\\\\\n]|\\n(?!\\n))*'|\\((?:\\\\[\\s\\S]|[^()\\\\])*\\))/).getRegex(),Rn=U(/^(bull)([ \\t][^\\n]*?)?(?:\\n|$)/).replace(/bull/g,An).getRegex(),zn=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Bn=/<!--(?:-?>|[\\s\\S]*?(?:-->|$))/,Vn=U(`^ {0,3}(?:<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n*|$)|comment[^\\\\n]*(\\\\n+|$)|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>[^\\\\n]*\\\\n*|$)|<![A-Z][\\\\s\\\\S]*?(?:>[^\\\\n]*\\\\n*|$)|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>[^\\\\n]*\\\\n*|$)|</?(tag)(?:[ \\\\t]+|\\\\n|/?>|$)[\\\\s\\\\S]*?(?:(?:\\\\n[ ]*)+\\\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ ]*)+\\\\n|$)|</[a-z][a-z0-9-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ ]*)+\\\\n|$))`,`i`).replace(`comment`,Bn).replace(`tag`,zn).replace(`attribute`,/ +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/).getRegex(),Hn=e=>U(Pn).replace(`hr`,On).replace(`heading`,` {0,3}#{1,6}(?:\\\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`,\" {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)\").replace(`list`,e).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)`).replace(`tag`,zn).getRegex(),Un=Hn(/ {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]/),Wn=Hn(/ {0,3}(?:[*+-]|\\d{1,9}[.)])(?:[ \\t]|\\n|$)/),Gn={blockquote:U(/^( {0,3}> ?(?:(?![ \\t]*(?:\\n|$))(paragraph)|[^\\n]*)(?:\\n|$))+/).replace(`paragraph`,Wn).getRegex(),code:En,def:Ln,fences:Dn,heading:kn,hr:On,html:Vn,lheading:Mn,list:Rn,newline:Tn,paragraph:Un,table:Sn,text:Fn},Kn=U(`^ *([^\\\\n ].*)\\\\n {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)`).replace(`hr`,On).replace(`heading`,` {0,3}#{1,6}(?:\\\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\\\n]`).replace(`fences`,\" {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)\").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\\\t]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)`).replace(`tag`,zn).getRegex(),qn={...Gn,lheading:Nn,table:Kn,paragraph:U(Pn).replace(`hr`,On).replace(`heading`,` {0,3}#{1,6}(?:\\\\s|$)`).replace(`|lheading`,``).replace(`table`,Kn).replace(`blockquote`,` {0,3}>`).replace(`fences`,\" {0,3}(?:`{3,}(?=[^`\\\\n]*(?:\\\\n|$))|~~~)[^\\\\n]*(?:\\\\n|$)\").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\\\t]+[^ \\\\t\\\\n]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\\\s>]|$)|!--)|<\\\\?|<![A-Za-z]|<!\\\\[CDATA\\\\[)`).replace(`tag`,zn).getRegex()},Jn={...Gn,html:U(`^ *(?:comment(?: *\\\\n|\\\\s*$)|<(tag)[\\\\s\\\\S]+?</\\\\1>(?: *\\\\n{2,}|\\\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\\\s[^'\"/>\\\\s]*)*?/?>(?: *\\\\n{2,}|\\\\s*$))`).replace(`comment`,Bn).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b`).getRegex(),def:/^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,heading:/^(#{1,6})(.*)(?:\\n+|$)/,fences:Sn,lheading:/^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,paragraph:U(Pn).replace(`hr`,On).replace(`heading`,` *#{1,6} *[^\n]`).replace(`lheading`,Mn).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Yn=/^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/,Xn=/^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/,Zn=/^( {2,}|\\\\)\\n(?!\\s*$)[ \\t]*/,Qn=/^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/,G=/[\\p{P}\\p{S}]/u,$n=/[\\s\\p{P}\\p{S}]/u,er=/[^\\s\\p{P}\\p{S}]/u,tr=U(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,$n).getRegex(),nr=/[\\p{Pi}\\p{Ps}\"']/u,rr=/(?!~)[\\p{P}\\p{S}]/u,ir=/(?!~)[\\s\\p{P}\\p{S}]/u,ar=/(?:[^\\s\\p{P}\\p{S}]|~)/u,or=U(/link|precode-code|html/,`g`).replace(`link`,/\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)/).replace(`precode-`,wn?\"(?<!`)()\":\"(^^|[^`])\").replace(`code`,/(?<b>`+)[^`]+\\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),sr=/^(?:\\*+(?:((?!\\*)punct)|([^\\s*]))?)|^_+(?:((?!_)punct)|([^\\s_]))?/,cr=U(sr,`u`).replace(/punct/g,G).getRegex(),lr=U(sr,`u`).replace(/punct/g,rr).getRegex(),ur=U(/^(?:\\*+(?:((?!\\*)(?!openQuote)punct)|([^\\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\\s_]))?/,`u`).replace(/openQuote/g,nr).replace(/punct/g,G).getRegex(),dr=`^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)|(?!\\\\*)punctSpace(\\\\*+)(?=notPunctSpace)|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)|notPunctSpace(\\\\*+)(?=notPunctSpace)`,fr=U(dr,`gu`).replace(/notPunctSpace/g,er).replace(/punctSpace/g,$n).replace(/punct/g,G).getRegex(),pr=U(dr,`gu`).replace(/notPunctSpace/g,ar).replace(/punctSpace/g,ir).replace(/punct/g,rr).getRegex(),mr=U(`^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)|(?!\\\\*)[\\\\s](\\\\*+)(?=notPunctSpace)|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)|(?:(?!\\\\*)punct|notPunctSpace)(\\\\*+)(?!\\\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,er).replace(/punctSpace/g,$n).replace(/punct/g,G).getRegex(),hr=U(`^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,er).replace(/punctSpace/g,$n).replace(/punct/g,G).getRegex(),gr=U(`^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\\\s](_+)(?=notPunctSpace)|[\\\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,er).replace(/punctSpace/g,$n).replace(/punct/g,G).getRegex(),_r=U(/^~~?(?:((?!~)punct)|[^\\s~])/,`u`).replace(/punct/g,G).getRegex(),vr=U(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,er).replace(/punctSpace/g,$n).replace(/punct/g,G).getRegex(),yr=U(/\\\\(punct)/,`gu`).replace(/punct/g,G).getRegex(),br=U(/(`+)(?:[^`]|[^`][\\s\\S]*?[^`])\\1(?!`)|`+|\\\\(punct)/,`gu`).replace(/punct/g,G).getRegex(),xr=U(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Sr=U(Bn).replace(`(?:-->|$)`,`-->`).getRegex(),Cr=U(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\\\s*/?>|^<\\\\?[\\\\s\\\\S]*?\\\\?>|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>`).replace(`comment`,Sr).replace(`attribute`,/\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/).getRegex(),wr=/\\[(?:\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]/,Tr=U(/(?:\\[(?:brackets|\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\])|[^\\[\\]\\\\`])*?/).replace(`brackets`,wr).getRegex(),Er=U(/^!?\\[(label)\\]\\([ \\t\\n]*(href)(?:(?:[ \\t]+(?:\\n[ \\t]*)?|\\n[ \\t]*)(title))?[ \\t\\n]*\\)/).replace(`label`,Tr).replace(`href`,/<(?:\\\\.|[^\\n<>\\\\])+>|[^ \\t\\n\\x00-\\x1f]+|(?=\\))/).replace(`title`,/\"(?:\\\\[\\s\\S]|[^\"\\\\])*\"|'(?:\\\\[\\s\\S]|[^'\\\\])*'|\\((?:\\\\[\\s\\S]|[^)\\\\])*\\)/).getRegex(),Dr=U(/^!?\\[(label)\\]\\[(ref)\\]/).replace(`label`,Tr).replace(`ref`,In).getRegex(),Or=U(/^!?\\[(ref)\\](?:\\[\\])?/).replace(`ref`,In).getRegex(),kr=/(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\]){1,999}/,Ar=U(/(?:[^\\[\\]\\\\`]*(?:\\[(?:brackets|\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\\]))){0,999}?[^\\[\\]\\\\`]*?/).replace(`brackets`,wr).getRegex(),jr=U(`reflink|nolink(?!\\\\()`,`g`).replace(`reflink`,U(/^!?\\[(label)\\]\\[(ref)\\]/).replace(`label`,Ar).replace(`ref`,kr).getRegex()).replace(`nolink`,U(/^!?\\[(ref)\\](?:\\[\\])?/).replace(`ref`,kr).getRegex()).getRegex(),Mr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Nr=U(/(?:mailto:email|xmpp:email(?:\\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\\w-])/).getRegex(),Pr={_backpedal:Sn,anyPunctuation:yr,anyPunctuationOutsideCode:br,autolink:xr,blockSkip:or,br:Zn,code:Xn,del:Sn,delLDelim:Sn,delRDelim:Sn,emStrongLDelim:cr,emStrongRDelimAst:fr,emStrongRDelimUnd:hr,escape:Yn,link:Er,nolink:Or,punctuation:tr,reflink:Dr,reflinkSearch:jr,tag:Cr,text:Qn,url:Sn},Fr={...Pr,emStrongLDelim:ur,emStrongRDelimAst:mr,emStrongRDelimUnd:gr,link:U(/^!?\\[(label)\\]\\((.*?)\\)/).replace(`label`,Tr).getRegex(),reflink:U(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/).replace(`label`,Tr).getRegex()},Ir={...Pr,emStrongRDelimAst:pr,emStrongLDelim:lr,delLDelim:_r,delRDelim:vr,url:U(/^emailProtocol|^((?:protocol):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/).replace(`emailProtocol`,Nr).replace(`protocol`,Mr).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,del:/^(~~?)(?=[^\\s~])((?:\\\\[\\s\\S]|[^\\\\])*?(?:\\\\[\\s\\S]|[^\\s~\\\\]))\\1(?=[^~]|$)/,text:U(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|protocol:\\/\\/|wwwStart|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@))))/).replace(`protocol`,Mr).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace(`wwwStart`,wn?`(?<![^\\\\s*_~(])www\\\\.`:`www\\\\.`).getRegex()},Lr={...Ir,br:U(Zn).replace(`{2,}`,`*`).getRegex(),text:U(Ir.text).replace(`\\\\b_`,`\\\\b_| {2,}\\\\n`).replace(/\\{2,\\}/g,`*`).getRegex()},Rr={normal:Gn,gfm:qn,pedantic:Jn},zr={normal:Pr,gfm:Ir,breaks:Lr,pedantic:Fr},Br={\"&\":`&`,\"<\":`<`,\">\":`>`,'\"':`"`,\"'\":`'`},Vr=e=>Br[e];function K(e,t){if(t){if(W.escapeTest.test(e))return e.replace(W.escapeReplace,Vr)}else if(W.escapeTestNoEncode.test(e))return e.replace(W.escapeReplaceNoEncode,Vr);return e}function Hr(e){return W.numericCharacterReference.test(e)?e.replace(W.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`๏ฟฝ`:r===38?`&`:String.fromCodePoint(r)}):e}function Ur(e){try{e=encodeURI(e).replace(W.percentDecode,`%`)}catch{return null}return e}function Wr(e,t){let n=e.replace(W.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\\\`;)r=!r;return r?`|`:` |`}).split(W.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(W.slashPipe,`|`);return n}function q(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Gr(e){let t=e.split(`\n`),n=t.length-1;for(;n>=0&&W.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`\n`)}function Kr(e){return e.trim().replace(W.multipleSpaceGlobal,` `).toLowerCase().toUpperCase().toLowerCase()}function qr(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}var Jr=/* @__PURE__ */ new WeakMap;function Yr(e){let t={\"*\":-1,_:-1},n=-1,r=e.length;for(let i=0;i<r;i++){let a=e[i];if(a!==`*`&&a!==`_`&&a!==`~`)continue;let o=i===0?`\n`:e[i-1],s=i+1;for(;s<r&&e[s]===a;)s++;o!==` `&&o!==` `&&o!==`\n`&&o!==`\\r`&&o!==`\\f`&&(a===`~`?n=i:t[a]=i),i=s-1}return{maskedSrc:e,lastPossibleEmStrongCloserIndex:t,lastPossibleDelCloserIndex:n}}function Xr(e,t){let n=Yr(t),r=Jr.get(e);r?r.push(n):Jr.set(e,[n])}function Zr(e){let t=Jr.get(e);t&&(t.pop(),t.length===0&&Jr.delete(e))}function Qr(e,t,n){let r=Jr.get(e)?.at(-1);return r&&r.maskedSrc===t?r.lastPossibleEmStrongCloserIndex[n]:Yr(t).lastPossibleEmStrongCloserIndex[n]}function $r(e,t){let n=Jr.get(e)?.at(-1);return n&&n.maskedSrc===t?n.lastPossibleDelCloserIndex:Yr(t).lastPossibleDelCloserIndex}function ei(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function ti(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function ni(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`\n`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`\n`)}function ri(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\\\`){i++;continue}if(t[i]===\"`\"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var ii=class{options;rules;lexer;constructor(e){this.options=e||bn}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Gr(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=ni(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=q(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:q(t[0],`\n`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:q(t[0],`\n`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=q(t[0],`\n`).split(`\n`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`\n`),c=s.replace(this.rules.other.blockquoteMarkerWhitespace,(e,t,n)=>t+ei(n,t.length)).replace(this.rules.other.blockquoteSetextReplace,`\n $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}\n${s}`:s,r=r?`${r}\n${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`||u?.type===`table`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`\n`),o=t.raw+`\n`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\\n/,``),l=c?c.split(`\n`).length:0,d=l?e.slice(0,-l):e;if(d.length>0&&(n=`${n}\n${d.join(`\n`)}`),r=r.substring(0,r.length-t.text.length)+s.text,e=e.slice(d.length),e.length>0&&this.rules.other.blockquoteStart.test(e[0]))continue;break}if(u?.type===`list`){let t=u,a=t.raw+`\n`+e.join(`\n`),o=this.list(a);i[i.length-1]=o;let s=o.raw.length>t.raw.length?a.slice(t.raw.length+1,o.raw.length).split(`\n`).length:0;if(s>0){let t=e.slice(0,s).join(`\n`);n=`${n}\n${t}`,r=`${r}\n${t}`}e=e.slice(s)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\\\d{1,9}\\\\${i.slice(-1)}`:`\\\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`\n`,1)[0],d=t[1].length,f=this.options.pedantic?ei(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>ei(e,d)),p=e.split(`\n`,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(h):this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h);for(;e;){let c=e.split(`\n`,1)[0],l;if(p=c,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),l=p):l=p.replace(this.rules.other.leadingSpaceTab,e=>ei(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(l.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`\n`+l.slice(h);else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||o.test(f)||n.test(f))break;let e=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(p)&&this.rules.block.lheading.test(`${f}\n${p}`)?` ${l.replace(/^ {0,3}/,``)}`:p;a+=`\n`+e}m=!p.trim(),e=e.substring(c.length+1),f=l.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Gr(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&qr(t[2],`()`)!==-1)return;let e=Kr(t[1]),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:q(t[0],`\n`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Wr(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`\n`):[],a={type:`table`,raw:q(t[0],`\n`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Wr(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:q(t[0],`\n`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`\n`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&ri(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=q(r.slice(0,-1),`\\\\`);if((r.length-e.length)%2==0)return}else{let e=qr(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=q(t[0].slice(0,-1),`\\\\`);if((t[0].length-i.length)%2==0)return;let a=t[2],o=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(a);e&&(a=e[1],o=e[3])}else o=t[3]?t[3].slice(1,-1):``;return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(a=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a.slice(1):a.slice(1,-1)),ti(t,{href:a&&a.replace(this.rules.inline.anyPunctuation,`$1`),title:o&&o.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&ri(e,n[1],r,this.rules))return;let i=t[Kr(n[2]||n[1])];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return ti(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let i=r[0][0],a=n===i,o=t.length-e.length,s=o;for(;!this.options.pedantic&&s>0&&t[s-1]===i;)s--;let c=[...t.slice(Math.max(0,s-2),s)].at(-1)??``,l=c===`*`||c===`_`||!!this.rules.inline.punctuation.exec(c);s<o&&(n=c);let u=s<o?l:!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let d=r[1]||r[3]||``;if(!d||!n||u){let n=[...r[0]].length-1,u,f,p=n,m=0,h=o-s+n,g=!this.options.pedantic&&!!c.trim()&&(!!d||i===`*`&&!l);if(i!==`*`&&i!==`_`)return;let _=i===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,v=Qr(this,t,i),y=t.length-e.length+n;if(v<y)return;t=t.slice(-1*e.length+n);let b=v-y;for(_.lastIndex=0;(r=_.exec(t))!==null&&!(r.index>b);){if(u=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!u)continue;if(f=[...u].length,r[3]||r[4]){p+=f;continue}if(r[5]||r[6]||g){if(a&&(r[5]||r[6]))break;if(h%3&&!((h+f)%3)){m+=f;continue}}if(p-=f,p>0)continue;f=Math.min(f,f+p+m);let t=[...r[0]][0].length,i=e.slice(0,n+r.index+t+f);if(Math.min(n,f)%2){let e=i.slice(1,-1);return{type:`em`,raw:i,text:e,tokens:this.lexer.inlineTokens(e)}}let o=i.slice(2,-2);return{type:`strong`,raw:i,text:o,tokens:this.lexer.inlineTokens(o)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim,c=$r(this,t),l=t.length-e.length+n;if(c<l)return;t=t.slice(-1*e.length+n);let u=c-l;for(s.lastIndex=0;(r=s.exec(t))!==null&&!(r.index>u);){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:Hr(t[0]),escaped:e}}}},J=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||bn,this.options.tokenizer=this.options.tokenizer||new ii,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:W,block:Rr.normal,inline:zr.normal};this.options.pedantic?(t.block=Rr.pedantic,t.inline=zr.pedantic):this.options.gfm&&(t.block=Rr.gfm,t.inline=this.options.breaks?zr.breaks:zr.gfm),this.tokenizer.rules=t}static get rules(){return{block:Rr,inline:zr}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(W.carriageReturn,`\n`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.state.inRawBlock=!1,this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(W.tabCharGlobal,` `).replace(W.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`\n`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`\n`)?``:`\n`)+i.raw,n.text+=`\n`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`\n`)?``:`\n`)+i.raw,n.text+=`\n`+i.raw,this.inlineQueue.at(-1).src=n.text):(this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}),t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`\n`)?``:`\n`)+i.raw,r.text+=`\n`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`\n`)?``:`\n`)+i.raw,n.text+=`\n`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,Kr(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e.includes(`*`)||e.includes(`_`)||e.includes(`~`)||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==ii.prototype.emStrong||this.tokenizer.del!==ii.prototype.del?this.#n(e):e;Xr(this.tokenizer,n);try{return this.#t(e,n,t)}finally{Zr(this.tokenizer)}}#t(e,t,n){let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(t=>(o=t.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let t=n.at(-1);o.type===`text`&&t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o);continue}if((o=this.tokenizer.emStrong(e,t,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,t,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let t=n.at(-1);t?.type===`text`?(t.raw+=o.raw,t.text+=o.text):n.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#n(e){let t=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,n=t=>{let r=t.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,Kr(t.slice(r+1,-1))))return t;if(r>1&&t.charAt(0)!==`!`){let i=t.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,n)+`][`+`a`.repeat(t.length-r-2)+`]`}return`[`+`a`.repeat(t.length-2)+`]`};t=t.replace(e,n)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),t=t.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},ai=class{options;parser;constructor(e){this.options=e||bn}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(W.notSpaceStart)?.[0],i=e?e.replace(W.endingNewline,``)+`\n`:``;return r?`<pre><code class=\"language-`+K(r)+`\">`+(n?i:K(i,!0))+`</code></pre>\n`:`<pre><code>`+(n?i:K(i,!0))+`</code></pre>\n`}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return`<hr>\n`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start=\"`+n+`\"`:``;return`<`+i+a+`>\n`+r+`</`+i+`>\n`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return`<input `+(e?`checked=\"\" `:``)+`disabled=\"\" type=\"checkbox\"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>\n<thead>\n`+t+`</thead>\n`+r+`</table>\n`}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align=\"${e.align}\">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${K(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?K(n,!0):this.parser.parseInline(r),o=Ur(e);if(o===null)return a;e=K(o,i);let s=`<a href=\"`+e+`\"`;return t&&(s+=` title=\"`+K(t)+`\"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Ur(e);if(i===null)return K(n);e=i;let a=`<img src=\"${K(e)}\" alt=\"${K(n)}\"`;return t&&(a+=` title=\"${K(t)}\"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:K(e.text)}},oi=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return``}checkbox({raw:e}){return e}},Y=class e{options;renderer;textRenderer;constructor(e){this.options=e||bn,this.options.renderer=this.options.renderer||new ai,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new oi,this.textRenderer.parser=this}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with \"`+i.type+`\" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with \"`+a.type+`\" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},si=class{options;block;constructor(e){this.options=e||bn}static passThroughHooks=/* @__PURE__ */ new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=/* @__PURE__ */ new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?J.lex:J.lexInline}provideParser(e=this.block){return e?Y.parse:Y.parseInline}};function ci(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var li=new class{defaults=yn();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Y;Renderer=ai;TextRenderer=oi;Lexer=J;Tokenizer=ii;Hooks=si;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(ci(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)ci(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)ci(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;ci(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);ci(n,this.walkTokens(i,t))}):e.tokens&&ci(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ai(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n===!1?``:n??``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ii(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new si;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=si.passThroughHooks.has(n)?e=>{if(t.options.async&&si.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(t.options.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return ci(n,r.call(this,e)),t&&ci(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return J.lex(e,t??this.defaults)}parser(e,t){return Y.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(/* @__PURE__ */ Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(/* @__PURE__ */ Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(/* @__PURE__ */ Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?J.lex:J.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Y.parse:Y.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?J.lex:J.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Y.parse:Y.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`\nPlease report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+K(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function X(e,t){return li.parse(e,t)}X.options=X.setOptions=function(e){return li.setOptions(e),X.defaults=li.defaults,xn(X.defaults),X},X.getDefaults=yn,X.defaults=bn;function ui(...e){return li.use(...e),X.defaults=li.defaults,xn(X.defaults),X}X.use=ui,X.walkTokens=function(e,t){return li.walkTokens(e,t)},X.parseInline=li.parseInline,X.Parser=Y,X.parser=Y.parse,X.Renderer=ai,X.TextRenderer=oi,X.Lexer=J,X.lexer=J.lex,X.Tokenizer=ii,X.Hooks=si,X.parse=X,X.options,X.setOptions,X.walkTokens,X.parseInline,Y.parse,J.lex;var di=/* @__PURE__ */ new Set([`http:`,`https:`,`mailto:`]),fi=16;function pi(e){try{let t=new URL(e);return di.has(t.protocol)?t.href:``}catch{return``}}var mi={amp:`&`,lt:`<`,gt:`>`,quot:`\"`,apos:`'`,nbsp:`\\xA0`,copy:`ยฉ`,reg:`ยฎ`,trade:`โข`,hellip:`โฆ`,mdash:`โ`,ndash:`โ`,lsquo:`โ`,rsquo:`โ`,ldquo:`โ`,rdquo:`โ`,laquo:`ยซ`,raquo:`ยป`,bull:`โข`,middot:`ยท`,deg:`ยฐ`,plusmn:`ยฑ`,times:`ร`,divide:`รท`,euro:`โฌ`,pound:`ยฃ`,yen:`ยฅ`,cent:`ยข`,sect:`ยง`,para:`ยถ`};function hi(e){return e.includes(`&`)?e.replace(/&(#\\d{1,7}|#[xX][\\da-fA-F]{1,6}|[a-zA-Z]{2,8});/g,(e,t)=>{if(t[0]!==`#`)return mi[t]??e;let n=t[1]===`x`||t[1]===`X`?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return n>0&&n<=1114111&&(n<55296||n>57343)?String.fromCodePoint(n):`๏ฟฝ`}):e}function Z(e,t){return t>fi?[(e??[]).map(e=>e.raw).join(``)]:(e??[]).map((e,n)=>{switch(e.type){case`text`:return`tokens`in e&&e.tokens?Z(e.tokens,t+1):hi(e.text);case`escape`:return e.text;case`strong`:return/* @__PURE__ */ B(`strong`,{children:Z(e.tokens,t+1)},n);case`em`:return/* @__PURE__ */ B(`em`,{children:Z(e.tokens,t+1)},n);case`del`:return/* @__PURE__ */ B(`del`,{children:Z(e.tokens,t+1)},n);case`codespan`:return/* @__PURE__ */ B(`code`,{children:e.text},n);case`br`:return/* @__PURE__ */ B(`br`,{},n);case`link`:{let r=pi(hi(e.href));return r?/* @__PURE__ */ B(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer nofollow`,children:Z(e.tokens,t+1)},n):/* @__PURE__ */ B(`span`,{children:Z(e.tokens,t+1)},n)}case`image`:return e.text?/* @__PURE__ */ B(`span`,{\"data-ask-part\":`image-alt`,children:[`[`,hi(e.text),`]`]},n):null;default:return null}})}function gi(e,t,n){return e.map((e,r)=>/* @__PURE__ */ B(t?`th`:`td`,{style:e.align?{textAlign:e.align}:void 0,children:Z(e.tokens,n+1)},r))}function _i(e,t){return t>fi?[e.map(e=>e.raw).join(``)]:e.map((e,n)=>{switch(e.type){case`paragraph`:return/* @__PURE__ */ B(`p`,{children:Z(e.tokens,t+1)},n);case`text`:return e.tokens?Z(e.tokens,t+1):hi(e.text);case`heading`:return/* @__PURE__ */ B(`h${Math.min(Math.max(e.depth,1),6)}`,{children:Z(e.tokens,t+1)},n);case`code`:return/* @__PURE__ */ B(`pre`,{children:/* @__PURE__ */ B(`code`,{children:e.text})},n);case`blockquote`:return/* @__PURE__ */ B(`blockquote`,{children:_i(e.tokens??[],t+1)},n);case`hr`:return/* @__PURE__ */ B(`hr`,{},n);case`list`:{let r=e.items.map((e,n)=>/* @__PURE__ */ B(`li`,{children:[e.task&&/* @__PURE__ */ B(`input`,{type:`checkbox`,checked:e.checked??!1,disabled:!0}),_i(e.tokens.filter(e=>e.type!==`checkbox`),t+1)]},n));return e.ordered?/* @__PURE__ */ B(`ol`,{start:typeof e.start==`number`?e.start:void 0,children:r},n):/* @__PURE__ */ B(`ul`,{children:r},n)}case`table`:return/* @__PURE__ */ B(`table`,{children:[/* @__PURE__ */ B(`thead`,{children:/* @__PURE__ */ B(`tr`,{children:gi(e.header,!0,t)})}),/* @__PURE__ */ B(`tbody`,{children:e.rows.map((e,n)=>/* @__PURE__ */ B(`tr`,{children:gi(e,!1,t)},n))})]},n);default:return null}})}var vi=e=>e.split(/\\n{2,}/).map((e,t)=>/* @__PURE__ */ B(`p`,{children:e},t));function yi(e){try{return _i(J.lex(e,{gfm:!0}),0)}catch{return vi(e)}}var bi=class extends S{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?vi(this.props.text):this.props.children}},xi=/* @__PURE__ */ Ue(function({text:e}){return/* @__PURE__ */ B(bi,{text:e,children:yi(e)})});function Si(e,t){return ke(n=>{e.current=n,typeof t==`function`?t(n):t&&(t.current=n)},[e,t])}var Ci=[`[data-ask-part=\"panel\"]`,`[data-askdare-root]`,`[data-ask-part=\"composer\"]`];function wi(e,t=!1){let n=e.current;if(!n?.isConnected)return!1;if(t)return n.focus(),!0;let{activeElement:r,body:i,documentElement:a}=n.ownerDocument,o=Ci.map(e=>n.closest(e)).find(Boolean)??n;return(!r||r===i||r===a||o.contains(r))&&n.focus({preventScroll:!0}),!0}var Ti=e=>e.role===`user`||e.status===`streaming`||e.text!==``||e.citations.length>0;function Ei({ref:e,...t}){let n=R(null),r=gn(e=>e.phase===`loading`),i=gn(e=>e.messages.at(-1));return L(()=>{let e=n.current;e&&i&&(e.scrollTop=e.scrollHeight)},[i,gn(e=>e.commenting)]),/* @__PURE__ */ B(`div`,{\"data-ask-part\":`messages`,role:`log`,\"aria-live\":`polite`,\"aria-relevant\":`additions`,\"aria-busy\":r,...t,ref:Si(n,e)})}function Di({children:e}){return/* @__PURE__ */ B(x,{children:gn(e=>e.messages).filter(Ti).map(t=>/* @__PURE__ */ B(_n,{message:t,children:e},t.id))})}function Oi(e){let t=vn();return/* @__PURE__ */ B(`div`,{\"data-ask-part\":`message`,\"data-role\":t.role,\"data-status\":t.status,...e})}function ki(e){let t=vn(),{t:n}=V();return t.text===``?t.status===`streaming`?/* @__PURE__ */ B(`div`,{\"data-ask-part\":`bubble`,...e,children:/* @__PURE__ */ B(`span`,{\"data-ask-part\":`typing`,role:`img`,\"aria-label\":n(`status.typing`),children:[/* @__PURE__ */ B(`i`,{}),/* @__PURE__ */ B(`i`,{}),/* @__PURE__ */ B(`i`,{})]})}):null:/* @__PURE__ */ B(`div`,{\"data-ask-part\":`bubble`,...e,children:t.role===`assistant`?/* @__PURE__ */ B(xi,{text:t.text}):t.text})}function Ai(e){let t=vn(),{t:n}=V();return t.citations.length===0?null:/* @__PURE__ */ B(`ol`,{\"data-ask-part\":`citations`,\"aria-label\":n(`message.sources`),...e,children:t.citations.map(e=>{let t=e.url?pi(e.url):``;return/* @__PURE__ */ B(`li`,{\"data-ask-part\":`citation`,children:t?/* @__PURE__ */ B(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer nofollow`,children:e.title}):/* @__PURE__ */ B(`span`,{children:e.title})},e.index)})})}function ji({files:e,list:t,onRemove:n,...r}){let{t:i}=V();return/* @__PURE__ */ B(`ul`,{\"data-ask-part\":t,\"aria-label\":i(`attachment.list`),...r,children:e.map((e,t)=>{let r=`status`in e?e:void 0;return/* @__PURE__ */ B(`li`,{\"data-ask-part\":`attachment`,\"data-kind\":e.kind,\"data-status\":r?.status,children:[e.previewUrl?/* @__PURE__ */ B(`img`,{\"data-ask-part\":`attachment-preview`,src:e.previewUrl,alt:``}):/* @__PURE__ */ B(`span`,{\"data-ask-part\":`attachment-badge`,\"aria-hidden\":`true`,children:e.kind===`image`?`IMG`:e.kind===`pdf`?`PDF`:`FILE`}),/* @__PURE__ */ B(`span`,{\"data-ask-part\":`attachment-name`,children:e.name}),r?.status===`uploading`&&/* @__PURE__ */ B(`span`,{\"data-ask-part\":`attachment-status`,children:i(`attachment.uploading`)}),r?.status===`error`&&/* @__PURE__ */ B(`span`,{\"data-ask-part\":`attachment-status`,role:`alert`,children:r.error}),r&&n&&/* @__PURE__ */ B(`button`,{type:`button`,\"data-ask-part\":`attachment-remove`,\"aria-label\":i(`attachment.remove`,{name:e.name}),onClick:()=>n(r),children:`ร`})]},r?.key??t)})})}function Mi({ref:e,...t}){let n=vn(),{widget:r}=V().config;return n.files&&n.files.length>0?/* @__PURE__ */ B(ji,{files:n.files,list:`message-attachments`,...t,ref:e}):n.attachments===0?null:/* @__PURE__ */ B(`p`,{\"data-ask-part\":`attachments-note`,...t,ref:e,children:st(r.texts,`message.attachments`,n.attachments,r.locale)})}function Ni(e){e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`}var Pi=e=>`${Math.floor(e/60)}:${String(Math.floor(e%60)).padStart(2,`0`)}`;function Fi({onSubmit:e,...t}){let{actions:n}=H();return/* @__PURE__ */ B(`form`,{\"data-ask-part\":`composer`,onSubmit:t=>{e?.(t),t.defaultPrevented||(t.preventDefault(),n.send())},...t})}function Ii({ref:e,onKeyDown:t,onPaste:n,onChange:r,...i}){let a=R(null),{state:o,actions:s,bot:c}=H(),l=V(),{draft:u}=o;return De(()=>{a.current&&Ni(a.current)},[u]),L(()=>l.onFocus(`input`,e=>wi(a,e)),[l]),/* @__PURE__ */ B(`textarea`,{\"data-ask-part\":`input`,rows:1,placeholder:c.placeholder,\"aria-label\":c.placeholder,...i,ref:Si(a,e),value:u,onChange:e=>{r?.(e),s.setDraft(e.target.value)},onKeyDown:e=>{if(t?.(e),!e.defaultPrevented&&e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing){e.preventDefault();let t=e.currentTarget.closest(`form[data-ask-part=\"composer\"]`);t?t.requestSubmit():s.send()}},onPaste:e=>{if(n?.(e),e.defaultPrevented)return;let t=Array.from(e.clipboardData.files);c.attachments&&t.length!==0&&(e.preventDefault(),s.addFiles(t))}})}function Li(e){let{state:t,t:n}=H();return/* @__PURE__ */ B(`button`,{type:`submit`,\"data-ask-part\":`send`,\"aria-label\":n(`composer.send`),title:n(`composer.send`),disabled:!Qt(t),...e})}function Ri({onClick:e,...t}){let n=R(null),{state:r,actions:i,bot:a,t:o}=H(),s=a.attachments;return s?/* @__PURE__ */ B(x,{children:[/* @__PURE__ */ B(`input`,{ref:n,type:`file`,hidden:!0,multiple:!0,accept:Ht(s),onChange:e=>{i.addFiles(Array.from(e.target.files??[])),e.target.value=``}}),/* @__PURE__ */ B(`button`,{type:`button`,\"data-ask-part\":`attach`,\"aria-label\":o(`composer.attach`),title:o(`composer.attach`),disabled:r.busy||r.files.length>=s.maxPerMessage,onClick:t=>{e?.(t),n.current?.click()},...t})]}):null}function zi(e){let{state:t,actions:n}=H();return t.files.length===0?null:/* @__PURE__ */ B(ji,{files:t.files,list:`attachments`,onRemove:e=>n.removeFile(e.key),...e})}function Bi({onClick:e,...t}){let{state:n,actions:r,t:i}=H();return n.canDictate?/* @__PURE__ */ B(`button`,{type:`button`,\"data-ask-part\":`voice`,\"aria-label\":i(`composer.dictate`),title:i(`composer.dictate`),onClick:t=>{e?.(t),r.startDictation()},...t}):null}function Vi({cancelIcon:e=`ร`,...t}){let n=R(null),r=R(null),i=V(),{state:a,actions:o,bot:s,t:c}=H(),{dictation:l}=a;return L(()=>i.onFocus(`dictation`,e=>wi(r,e)),[i]),L(()=>{if(l!==`recording`)return;let e=requestAnimationFrame(function t(){let r=i.level();r!==void 0&&n.current?.style.setProperty(`--ask-level`,r.toFixed(3)),e=requestAnimationFrame(t)});return()=>cancelAnimationFrame(e)},[l,i]),l===`idle`?null:/* @__PURE__ */ B(`div`,{\"data-ask-part\":`recorder`,\"data-state\":l,...t,children:[/* @__PURE__ */ B(`span`,{\"data-ask-part\":`recorder-level`,ref:n,\"aria-hidden\":`true`}),/* @__PURE__ */ B(`span`,{\"data-ask-part\":`recorder-label`,role:`status`,children:c(l===`recording`?`dictation.listening`:`dictation.transcribing`)}),l===`recording`&&/* @__PURE__ */ B(x,{children:[/* @__PURE__ */ B(`span`,{\"data-ask-part\":`recorder-time`,children:[Pi(a.elapsed),` / `,Pi(s.maxDictationSeconds??0)]}),/* @__PURE__ */ B(`button`,{type:`button`,\"data-ask-part\":`recorder-cancel`,\"aria-label\":c(`dictation.cancel`),title:c(`dictation.cancel`),onClick:()=>o.cancelDictation(),children:e}),/* @__PURE__ */ B(`button`,{type:`button`,\"data-ask-part\":`recorder-done`,ref:r,onClick:()=>void o.finishDictation(),children:c(`dictation.done`)})]})]})}function Hi({rating:e,onClick:t,...n}){let r=vn(),{actions:i,t:a}=V(),o=r.feedback?.key,s=gn(e=>o?e.ratings[o]:void 0);if(!o||r.role!==`assistant`||r.status!==`done`)return null;let c=a(e===`up`?`feedback.up`:`feedback.down`);return/* @__PURE__ */ B(`button`,{type:`button`,\"data-ask-part\":`feedback-button`,\"data-rating\":e,\"aria-pressed\":s===e,\"aria-label\":c,title:c,onClick:n=>{t?.(n),i.rate(r.id,s===e?null:e)},...n})}function Ui(e){let{state:t,t:n}=H(),r=t.phase===`loading`?n(`status.loading`):t.activity;return r?/* @__PURE__ */ B(`p`,{\"data-ask-part\":`status`,role:`status`,...e,children:r}):null}function Wi(e){let t=H().state.error;return t?/* @__PURE__ */ B(`p`,{\"data-ask-part\":`error`,role:`alert`,...e,children:t}):null}var Gi=e=>e.dataTransfer.types.includes(`Files`);function Ki({landmark:e=`region`,onDragOver:t,onDragLeave:n,onDrop:r,...i}){let{state:a,actions:o,bot:s}=H(),[c,l]=Te(!1),u={\"data-ask-part\":`panel`,\"data-dragging\":c||void 0,\"data-busy\":a.busy||a.dictation!==`idle`||void 0,onDragOver:e=>{t?.(e),s.attachments&&Gi(e)&&(e.preventDefault(),l(!0))},onDragLeave:e=>{n?.(e);let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||l(!1)},onDrop:e=>{r?.(e),s.attachments&&Gi(e)&&(e.preventDefault(),l(!1),o.addFiles(Array.from(e.dataTransfer.files)))}};return e===`main`?/* @__PURE__ */ B(`main`,{...u,...i}):/* @__PURE__ */ B(`section`,{\"aria-label\":s.title,...u,...i})}var qi=1e3,Ji=/^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$/;function Yi(e){if(e===null)return null;if(typeof e==`string`)return e.length<=4096&&Ji.test(e)?e:(console.warn(`[askdare] askdare('identify') got something that isn't a JWT; signing out.`),null)}function Xi(e){let t=typeof e.greeting==`string`?e.greeting.trim():``,n=Array.isArray(e.starters)?e.starters.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(e=>e.length>0&&e.length<=80).slice(0,4):void 0,r=typeof e.context==`string`?e.context.trim():``;return{...t&&t.length<=500?{greeting:t}:{},...n?{starters:n}:{},...r?{context:r.slice(0,qi)}:{}}}function Q({children:e,size:t=20}){return/* @__PURE__ */ B(`svg`,{viewBox:`0 0 24 24`,width:t,height:t,\"aria-hidden\":`true`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,children:e})}var Zi=()=>/* @__PURE__ */ B(Q,{children:/* @__PURE__ */ B(`path`,{d:`M12 19V5M5.5 11.5 12 5l6.5 6.5`})}),Qi=()=>/* @__PURE__ */ B(Q,{children:/* @__PURE__ */ B(`path`,{d:`M20 11.5 12.2 19.3a5 5 0 0 1-7.1-7.1l8.1-8.1a3.4 3.4 0 0 1 4.8 4.8l-8 8a1.8 1.8 0 0 1-2.6-2.6l7.3-7.3`})}),$i=()=>/* @__PURE__ */ B(Q,{children:[/* @__PURE__ */ B(`rect`,{x:`9`,y:`3`,width:`6`,height:`11`,rx:`3`}),/* @__PURE__ */ B(`path`,{d:`M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21`})]}),ea=({size:e=18})=>/* @__PURE__ */ B(Q,{size:e,children:/* @__PURE__ */ B(`path`,{d:`M6 6l12 12M18 6 6 18`})}),ta=()=>/* @__PURE__ */ B(Q,{size:18,children:/* @__PURE__ */ B(`path`,{d:`M4 12a8 8 0 1 0 2.4-5.7M4 4v4.5h4.5`})}),na=()=>/* @__PURE__ */ B(Q,{size:18,children:/* @__PURE__ */ B(`path`,{d:`M5 12.5l4.5 4.5L19 7.5`})}),ra=({size:e=16})=>/* @__PURE__ */ B(Q,{size:e,children:[/* @__PURE__ */ B(`path`,{d:`M12 3.5c.5 4.3 2.2 6 6.5 6.5-4.3.5-6 2.2-6.5 6.5-.5-4.3-2.2-6-6.5-6.5 4.3-.5 6-2.2 6.5-6.5Z`}),/* @__PURE__ */ B(`path`,{d:`M18.5 15.5c.2 1.6.9 2.3 2.5 2.5-1.6.2-2.3.9-2.5 2.5-.2-1.6-.9-2.3-2.5-2.5 1.6-.2 2.3-.9 2.5-2.5Z`})]}),ia=()=>/* @__PURE__ */ B(Q,{size:16,children:/* @__PURE__ */ B(`path`,{d:`M5 12h14M13 6l6 6-6 6`})}),aa=()=>/* @__PURE__ */ B(Q,{size:16,children:/* @__PURE__ */ B(`path`,{d:`M7 10.5v9.5M7 10.5l4.2-7a2.2 2.2 0 0 1 2.6 2.7L13 9.5h5.2a2 2 0 0 1 2 2.4l-1.2 6.5a2 2 0 0 1-2 1.6H4.5V10.5H7Z`})}),oa=()=>/* @__PURE__ */ B(Q,{size:16,children:/* @__PURE__ */ B(`path`,{d:`M17 13.5V4M17 13.5l-4.2 7a2.2 2.2 0 0 1-2.6-2.7l.8-3.3H5.8a2 2 0 0 1-2-2.4L5 5.6A2 2 0 0 1 7 4h12.5v9.5H17Z`})});function sa(e){if(e.key!==`Tab`)return;let t=Array.from(e.currentTarget.querySelectorAll(`button`)),n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}function ca({modal:e,busy:t,onCancel:n,onAccept:r}){let{t:i}=H(),a=R(null),o=je();return L(()=>{let e=requestAnimationFrame(()=>a.current?.querySelector(`button`)?.focus());return()=>cancelAnimationFrame(e)},[]),/* @__PURE__ */ B(`div`,{\"data-ask-part\":`confirm-backdrop`,children:/* @__PURE__ */ B(`div`,{ref:a,\"data-ask-part\":`confirm`,role:`alertdialog`,\"aria-modal\":e||void 0,\"aria-describedby\":o,\"aria-label\":i(`header.newConversation`),\"aria-busy\":t||void 0,onKeyDown:sa,children:[/* @__PURE__ */ B(`span`,{\"data-ask-part\":`confirm-icon`,\"aria-hidden\":`true`,children:/* @__PURE__ */ B(ta,{})}),/* @__PURE__ */ B(`p`,{id:o,\"data-ask-part\":`confirm-text`,children:i(`confirm.newConversation`)}),/* @__PURE__ */ B(`div`,{\"data-ask-part\":`confirm-actions`,children:[/* @__PURE__ */ B(`button`,{type:`button`,\"data-ask-part\":`confirm-cancel`,\"aria-disabled\":t||void 0,onClick:t?void 0:n,children:i(`confirm.cancel`)}),/* @__PURE__ */ B(`button`,{type:`button`,\"data-ask-part\":`confirm-accept`,\"aria-disabled\":t||void 0,onClick:t?void 0:r,children:i(`confirm.accept`)})]})]})})}var la=/* @__PURE__ */ ue(null);function ua(){let e=Ae(la);if(!e)throw Error(`[askdare] The default look only works inside <DefaultChat>.`);return e}var da=e=>`h${Math.min(Math.max(e,1),6)}`;function fa(){let{state:e,bot:t,t:n}=H();return/* @__PURE__ */ B(x,{children:[/* @__PURE__ */ B(Fi,{children:[/* @__PURE__ */ B(zi,{}),/* @__PURE__ */ B(`div`,{\"data-ask-part\":`composer-box`,children:e.dictation===`idle`?/* @__PURE__ */ B(x,{children:[/* @__PURE__ */ B(Ri,{children:/* @__PURE__ */ B(Qi,{})}),/* @__PURE__ */ B(Ii,{}),/* @__PURE__ */ B(Bi,{children:/* @__PURE__ */ B($i,{})}),/* @__PURE__ */ B(Li,{children:[/* @__PURE__ */ B(Zi,{}),/* @__PURE__ */ B(`span`,{\"data-ask-part\":`send-label`,\"aria-hidden\":`true`,children:n(`composer.send`)})]})]}):/* @__PURE__ */ B(Vi,{cancelIcon:/* @__PURE__ */ B(ea,{})})})]}),t.disclosure!==!1&&/* @__PURE__ */ B(`p`,{\"data-ask-part\":`disclosure`,children:[n(`disclosure.text`),t.disclosure.privacyUrl&&/* @__PURE__ */ B(x,{children:[` `,/* @__PURE__ */ B(`a`,{href:t.disclosure.privacyUrl,target:`_blank`,rel:`noopener noreferrer`,children:n(`disclosure.privacy`)})]})]})]})}var pa=e=>e.split(/\\s+/).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()??``).join(``)||`AI`;function ma({size:e}){let{bot:t}=ua(),n=t.avatar?`image`:t.variants.avatar;return n===`none`?null:/* @__PURE__ */ B(`span`,{\"data-ask-part\":`avatar`,\"data-kind\":n,\"data-size\":e,\"aria-hidden\":`true`,children:[n===`image`&&/* @__PURE__ */ B(`img`,{src:t.avatar,alt:``}),n===`orb`&&/* @__PURE__ */ B(`span`,{\"data-ask-part\":`orb`}),n===`icon`&&/* @__PURE__ */ B(ra,{size:e===`large`?28:16}),n===`initials`&&pa(t.title)]})}function ha(){let{state:e,bot:t,t:n}=H(),{headingLevel:r,onClose:i,askStartOver:a,restartRef:o}=ua(),s=da(r);return/* @__PURE__ */ B(`header`,{\"data-ask-part\":`header`,children:[/* @__PURE__ */ B(`div`,{\"data-ask-part\":`identity`,children:[/* @__PURE__ */ B(ma,{size:`small`}),/* @__PURE__ */ B(`div`,{\"data-ask-part\":`identity-text`,children:[/* @__PURE__ */ B(s,{\"data-ask-part\":`title`,children:t.title}),t.subtitle&&/* @__PURE__ */ B(`p`,{\"data-ask-part\":`subtitle`,children:t.subtitle})]})]}),/* @__PURE__ */ B(`div`,{\"data-ask-part\":`actions`,children:[e.messages.length>0&&/* @__PURE__ */ B(`button`,{ref:o,type:`button`,\"data-ask-part\":`new-conversation`,\"aria-label\":n(`header.newConversation`),\"aria-haspopup\":`dialog`,title:n(`header.newConversation`),disabled:e.busy,onClick:a,children:/* @__PURE__ */ B(ta,{})}),i&&/* @__PURE__ */ B(`button`,{type:`button`,\"data-ask-part\":`close`,\"aria-label\":n(`header.close`),title:n(`header.close`),onClick:i,children:/* @__PURE__ */ B(ea,{})})]})]})}var ga=500;function _a(){let e=vn(),{actions:t,t:n}=H(),[r,i]=Te(``),[a,o]=Te(!1),s=R(null),c=je();return L(()=>s.current?.focus(),[]),/* @__PURE__ */ B(`form`,{\"data-ask-part\":`feedback-comment`,onSubmit:n=>{n.preventDefault(),r.trim()?(o(!0),t.rate(e.id,`down`,r).finally(()=>o(!1))):t.dismissComment()},children:[/* @__PURE__ */ B(`label`,{htmlFor:c,children:n(`feedback.comment`)}),/* @__PURE__ */ B(`textarea`,{ref:s,id:c,\"data-ask-part\":`feedback-comment-input`,rows:2,maxLength:ga,value:r,onChange:e=>i(e.target.value)}),/* @__PURE__ */ B(`div`,{\"data-ask-part\":`feedback-comment-actions`,children:[/* @__PURE__ */ B(`button`,{type:`button`,\"data-ask-part\":`feedback-skip`,onClick:t.dismissComment,children:n(`feedback.skip`)}),/* @__PURE__ */ B(`button`,{type:`submit`,\"data-ask-part\":`feedback-send`,disabled:a||r.trim()===``,children:n(`feedback.send`)})]})]})}function va(){let e=vn(),{t}=ua(),n=gn(t=>t.commenting===e.id);return!e.feedback||e.role!==`assistant`||e.status!==`done`?null:/* @__PURE__ */ B(x,{children:[/* @__PURE__ */ B(`div`,{\"data-ask-part\":`feedback`,role:`group`,\"aria-label\":t(`feedback.label`),children:[/* @__PURE__ */ B(Hi,{rating:`up`,children:/* @__PURE__ */ B(aa,{})}),/* @__PURE__ */ B(Hi,{rating:`down`,children:/* @__PURE__ */ B(oa,{})})]}),n&&/* @__PURE__ */ B(_a,{})]})}function ya(){return/* @__PURE__ */ B(Oi,{children:[vn().role===`assistant`&&/* @__PURE__ */ B(ma,{size:`small`}),/* @__PURE__ */ B(`div`,{\"data-ask-part\":`message-body`,children:[/* @__PURE__ */ B(ki,{}),/* @__PURE__ */ B(Mi,{}),/* @__PURE__ */ B(Ai,{}),/* @__PURE__ */ B(va,{})]})]})}function ba(e){return e.split(`**`).map((e,t)=>t%2==1?/* @__PURE__ */ B(`strong`,{children:e},t):e)}function xa(){let{state:e,actions:t,bot:n}=H();if(n.starters.length===0)return null;let r=n.variants.welcome===`intro`,i=e.busy||e.phase!==`ready`;return/* @__PURE__ */ B(`ul`,{\"data-ask-part\":`starters`,\"aria-label\":n.texts[`welcome.suggestions`],children:n.starters.map(e=>/* @__PURE__ */ B(`li`,{children:/* @__PURE__ */ B(`button`,{type:`button`,\"data-ask-part\":`starter`,disabled:i,onClick:()=>void t.send(e),children:[B(r?na:ra,{}),/* @__PURE__ */ B(`span`,{children:e}),n.variants.welcome===`persona`&&/* @__PURE__ */ B(ia,{})]})},e))})}function Sa(){let{bot:e}=H(),t=da(ua().headingLevel+1),n=e.variants.welcome;return n===`intro`?/* @__PURE__ */ B(`section`,{\"data-ask-part\":`welcome`,\"data-layout\":`intro`,\"aria-label\":e.texts[`welcome.label`],children:/* @__PURE__ */ B(`div`,{\"data-ask-part\":`intro`,children:[/* @__PURE__ */ B(ma,{size:`small`}),/* @__PURE__ */ B(`div`,{\"data-ask-part\":`intro-card`,children:[/* @__PURE__ */ B(`p`,{\"data-ask-part\":`greeting`,children:ba(e.greeting)}),/* @__PURE__ */ B(xa,{})]})]})}):n===`persona`?/* @__PURE__ */ B(`section`,{\"data-ask-part\":`welcome`,\"data-layout\":`persona`,\"aria-label\":e.texts[`welcome.label`],children:[/* @__PURE__ */ B(`div`,{\"data-ask-part\":`persona`,children:[/* @__PURE__ */ B(ma,{size:`large`}),/* @__PURE__ */ B(`div`,{children:[/* @__PURE__ */ B(t,{\"data-ask-part\":`persona-name`,children:e.title}),/* @__PURE__ */ B(`span`,{\"data-ask-part\":`presence`,children:e.texts[`welcome.online`]})]})]}),/* @__PURE__ */ B(`p`,{\"data-ask-part\":`greeting`,children:ba(e.greeting)}),/* @__PURE__ */ B(xa,{})]}):/* @__PURE__ */ B(`section`,{\"data-ask-part\":`welcome`,\"data-layout\":`hero`,\"aria-label\":e.texts[`welcome.label`],children:[/* @__PURE__ */ B(ma,{size:`large`}),/* @__PURE__ */ B(t,{\"data-ask-part\":`greeting`,children:ba(e.greeting)}),/* @__PURE__ */ B(xa,{})]})}function Ca({headingLevel:e=2,onClose:t,components:n={},ownsDocument:r=!1}){let{state:i,actions:a,bot:o,t:s}=H(),[c,l]=Te(!1),[u,d]=Te(!1),f=R(null),p=ke(()=>l(!0),[]),m=Oe(()=>({bot:o,t:s,headingLevel:e,onClose:t,askStartOver:p,restartRef:f}),[o,s,e,t,p]),h=()=>{u||(l(!1),requestAnimationFrame(()=>f.current?.focus()))},g=e===1,_=R(null),v=R(()=>{});v.current=()=>{c?h():i.commenting===void 0?i.dictation===`recording`?a.cancelDictation():t?.():a.dismissComment()},L(()=>{let e=e=>{if(e.key!==`Escape`||e.defaultPrevented||e.isComposing)return;let t=e.target instanceof Node&&_.current?.contains(e.target);(r||t)&&v.current()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]);let y=n.Header??ha,b=n.Welcome??Sa,x=n.Message??ya,S=n.Footer??fa,C=Oe(()=>/* @__PURE__ */ B(x,{}),[x]),w=i.messages.length===0&&i.phase!==`loading`;return/* @__PURE__ */ B(la.Provider,{value:m,children:/* @__PURE__ */ B(Ki,{ref:_,landmark:g?`main`:`region`,children:[/* @__PURE__ */ B(y,{}),c&&/* @__PURE__ */ B(ca,{modal:r,busy:u,onCancel:h,onAccept:async()=>{d(!0),await a.newConversation(),d(!1),l(!1)}}),/* @__PURE__ */ B(Ei,{children:[w&&/* @__PURE__ */ B(b,{}),/* @__PURE__ */ B(Di,{children:C}),/* @__PURE__ */ B(Ui,{})]}),/* @__PURE__ */ B(Wi,{}),/* @__PURE__ */ B(S,{})]})})}function wa({store:e,bridge:t,inline:n=!1}){return L(()=>{n||e.actions.focus()},[n,e]),/* @__PURE__ */ B(mn,{store:e,children:/* @__PURE__ */ B(Ca,{headingLevel:1,onClose:Oe(()=>t.embedded&&!n?()=>{e.hide(),t.close()}:void 0,[t,n,e]),ownsDocument:!0})})}function Ta(e,t){let n=!0,r=()=>{},i=t.onConfigure(t=>e.configure(t)),a=t.onHidden(()=>e.hide()),o=e.onEvent(e=>t.emit(e));return e.start({handshake:t.handshake.then(()=>{n&&(r=t.onIdentify(t=>e.identify(t)))})}),()=>{n=!1,i(),a(),r(),e.stop(),o()}}var Ea=`data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2040%2040%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22s%22%20x2%3D%220%22%20y2%3D%221%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%239cc9ff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23fde2c4%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20fill%3D%22url(%23s)%22%2F%3E%3Ccircle%20cx%3D%2229%22%20cy%3D%2212%22%20r%3D%225%22%20fill%3D%22%23fff6d5%22%2F%3E%3Cpath%20d%3D%22M0%2030l11-11%209%209%206-5%2014%2012v5H0z%22%20fill%3D%22%234f7d6a%22%2F%3E%3C%2Fsvg%3E`,$=(e,t,n,r={})=>({id:e,role:t,text:n,citations:[],attachments:0,status:`done`,...r}),Da=[$(`u1`,`user`,`What does the Business plan include?`),$(`a1`,`assistant`,`The **Business** plan is built for larger teams:\n\n- Unlimited users and **1 TB** of storage\n- Single sign-on with SAML and an audit log\n- Priority support, first reply within 4 business hours\n\n| Billing | Price per user |\n| --- | --- |\n| Monthly | โฌ15 |\n| Yearly | โฌ12 |`,{citations:[{index:1,title:`Brightloop pricing and plans`,url:`https://example.com/pricing`},{index:2,title:`Brightloop security and privacy`,url:`https://example.com/security`}]}),$(`u2`,`user`,`Can we try it first?`),$(`a2`,`assistant`,`Yes. Every paid plan starts with a **14-day free trial**, and you donโt need a card to start it.`)],Oa={welcome:{messages:[]},conversation:{messages:Da},streaming:{messages:[...Da.slice(0,2),$(`u2`,`user`,`How do I move our projects from Trello?`),$(`a2`,`assistant`,`Go to **Settings โ Import** and choose Trello. Brightloop brings over`,{status:`streaming`})],busy:!0},attachments:{messages:[$(`u1`,`user`,`Is this the right screen for exporting?`,{attachments:2,files:[{name:`screenshot.jpg`,kind:`image`,previewUrl:Ea},{name:`export-guide.pdf`,kind:`pdf`}]}),$(`a1`,`assistant`,``,{status:`streaming`})],pending:[{key:`p1`,name:`invoice-march.pdf`,kind:`pdf`,status:`ready`,handle:`h`},{key:`p2`,name:`team-photo.jpg`,kind:`image`,status:`uploading`,previewUrl:Ea},{key:`p3`,name:`notes.svg`,status:`error`,error:`This file type is not supported.`}],busy:!0,activity:`Searching documentsโฆ`},error:{messages:[...Da.slice(0,2),$(`u2`,`user`,`And the Enterprise plan?`),$(`a2`,`assistant`,`Enterprise adds`,{status:`error`})],error:`The assistant took too long to respond. Please try again.`,draft:`And the Enterprise plan?`},listening:{messages:Da.slice(0,2),dictation:`recording`,elapsed:7},feedback:{messages:Da.map(e=>e.role===`assistant`?{...e,feedback:{handle:`h`,key:e.id}}:e),ratings:{a1:`up`,a2:`down`},commenting:`a2`}},ka=3e3;function Aa(e){let t=window.parent!==window,n,r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set,a,o=/* @__PURE__ */ new Set,s,c=e=>{if(e!==void 0){s=e;for(let t of o)t(e)}},l=()=>{},u=new Promise(e=>{l=e,t?setTimeout(e,ka):e()}),d=/* @__PURE__ */ new Set([window.location.origin,...e]),f=e=>{if(n||e.source!==window.parent||!d.has(e.origin))return;let t=e.data;t?.v===1&&t.type===`askdare:init`&&e.ports[0]&&(n=e.ports[0],n.onmessage=e=>{if(e.data?.v===1){if(e.data.type===`hidden`)for(let e of r)e();else if(e.data.type===`configure`){a=Xi(e.data);for(let e of i)e(a)}else e.data.type===`identify`&&c(Yi(e.data.token))}},n.start(),n.postMessage({v:1,type:`ready`}),window.removeEventListener(`message`,f),c(Yi(t.identity)),l())};return t&&window.addEventListener(`message`,f),{embedded:t,close(){n?.postMessage({v:1,type:`close`})},emit(e){n?.postMessage({v:1,type:`event`,event:e})},onHidden(e){return r.add(e),()=>r.delete(e)},onConfigure(e){return i.add(e),a&&e(a),()=>i.delete(e)},handshake:u,onIdentify(e){return o.add(e),s!==void 0&&e(s),()=>o.delete(e)}}}function ja(){let e=document.getElementById(`askdare-config`),t=JSON.parse(e?.textContent??`null`);if(!t?.botId||!t.basePath)throw Error(`[askdare] Missing embed configuration.`);return t}var Ma=ja(),Na=document.getElementById(`askdare-root`);if(Na){let e=Ma.gallery?Oa[Ma.gallery]:void 0,t=e?ln(Ma,e):sn(Ma),n=Aa(Ma.allowedOrigins);Ta(t,n),at(Na).render(/* @__PURE__ */ B(wa,{store:t,bridge:n,inline:new URLSearchParams(window.location.search).get(`mode`)===`inline`}))}";
|
|
75
75
|
const WIDGET_CSS = "@layer askdare{[data-askdare-root]{--ask-color-accent:#6b52e0;--ask-color-on-accent:#fff;--ask-color-background:#fdfbfd;--ask-color-surface:#f5f0f7;--ask-color-text:#242424;--ask-color-muted:#5f5a68;--ask-color-border:#2424241a;--ask-color-danger:#b42318;--ask-color-success:#067647;--ask-color-user-bubble:#c2386f;--ask-color-on-user-bubble:#fff;--ask-backdrop:none;--ask-orb:radial-gradient(circle at 50% 28%, #ffa3c6, #b8a1f6 60%, #7dd8d0);--ask-font-family:system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;--ask-font-family-heading:var(--ask-font-family);--ask-font-size:15px;--ask-radius:18px;--ask-space:8px;--ask-radius-small:calc(var(--ask-radius) * .6);--ask-shadow:0 1px 2px color-mix(in srgb, var(--ask-color-text) 6%, transparent), 0 8px 24px -10px color-mix(in srgb, var(--ask-color-text) 18%, transparent);--ask-ring:0 0 0 3px color-mix(in srgb, var(--ask-color-accent) 24%, transparent);--ask-glass:color-mix(in srgb, var(--ask-color-surface) 68%, transparent);--ask-ease:cubic-bezier(.2, .8, .2, 1);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}[data-askdare-root][data-ask-density=compact]{--ask-space:6px}:where([data-ask-skin],[data-ask-skin] *),:where([data-ask-skin] *):before,:where([data-ask-skin] *):after{box-sizing:border-box}:where([data-ask-skin]) :is(button,input){font:inherit;color:inherit}:where([data-ask-skin]) :focus-visible{outline:2px solid var(--ask-color-accent);outline-offset:2px}:where([data-ask-skin] a){cursor:pointer;text-decoration:underline}:where([data-ask-skin] :is(svg,img)){vertical-align:baseline;display:inline}:where([data-ask-part=bubble] pre):where([data-ask-skin] *){font-family:ui-monospace,SFMono-Regular,Menlo,monospace}:where([data-ask-skin] :is(strong,b)){font-weight:bolder}:where([data-ask-skin] em){font-style:italic}:where([data-ask-skin] del){text-decoration:line-through}:where([data-ask-part=bubble] ul):where([data-ask-skin] *){list-style-type:disc}:where([data-ask-part=bubble] ol):where([data-ask-skin] *){list-style-type:decimal}:where([data-ask-part=bubble] :is(ul,ol) ul):where([data-ask-skin] *){list-style-type:circle}:where([data-ask-part=bubble] :is(ul,ol) :is(ul,ol) ul):where([data-ask-skin] *){list-style-type:square}:where([data-ask-part=bubble] h5):where([data-ask-skin] *){margin-block:1.67em;font-size:.83em;font-weight:700}:where([data-ask-part=bubble] h6):where([data-ask-skin] *){margin-block:2.33em;font-size:.67em;font-weight:700}:where([data-ask-part=bubble] hr):where([data-ask-skin] *){color:gray;border:1px inset;margin:.5em auto}[data-ask-part=panel]:where([data-ask-skin] *){background:var(--ask-backdrop), var(--ask-color-background);background-color:var(--ask-color-background);height:100%;color:var(--ask-color-text);font:var(--ask-font-size) / 1.55 var(--ask-font-family);-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility;flex-direction:column;display:flex;position:relative}[data-ask-part=header]:where([data-ask-skin] *){justify-content:space-between;align-items:center;gap:var(--ask-space);padding:calc(var(--ask-space) * 1.5) calc(var(--ask-space) * 1.5) calc(var(--ask-space) * 1.5) calc(var(--ask-space) * 2);border-bottom:1px solid var(--ask-color-border);background:var(--ask-color-background);display:flex}[data-askdare-root][data-ask-surface=glass] [data-ask-part=header]:where([data-ask-skin] *){background:color-mix(in srgb, var(--ask-color-background) 55%, transparent);-webkit-backdrop-filter:blur(18px)saturate(150%);backdrop-filter:blur(18px)saturate(150%);border-bottom-color:color-mix(in srgb, var(--ask-color-border) 70%, transparent)}[data-ask-part=identity]:where([data-ask-skin] *){align-items:center;gap:calc(var(--ask-space) * 1.25);min-width:0;display:flex}[data-ask-part=identity-text]:where([data-ask-skin] *){min-width:0}[data-ask-part=title]:where([data-ask-skin] *){font-family:var(--ask-font-family-heading);letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:1rem;font-weight:600;line-height:1.3;overflow:hidden}[data-askdare-root][data-ask-welcome=persona] [data-ask-part=title]:where([data-ask-skin] *){letter-spacing:0;font-size:1.15rem;font-weight:300}[data-ask-part=subtitle]:where([data-ask-skin] *){color:var(--ask-color-muted);text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:.8rem;line-height:1.35;overflow:hidden}[data-ask-part=actions]:where([data-ask-skin] *){flex:none;gap:2px;display:flex}:is([data-ask-part=new-conversation],[data-ask-part=close]):where([data-ask-skin] *){width:34px;height:34px;color:var(--ask-color-muted);cursor:pointer;transition:background-color .15s var(--ask-ease), color .15s var(--ask-ease);background:0 0;border:0;border-radius:50%;place-items:center;padding:0;display:grid}:is([data-ask-part=new-conversation],[data-ask-part=close]):hover:where([data-ask-skin] *){background:var(--ask-color-surface);color:var(--ask-color-text)}[data-ask-part=avatar]:where([data-ask-skin] *){width:30px;height:30px;font-family:var(--ask-font-family);letter-spacing:.02em;border-radius:50%;flex:none;place-items:center;font-size:.75rem;font-weight:600;display:grid;overflow:hidden}[data-ask-part=avatar][data-size=large]:where([data-ask-skin] *){width:72px;height:72px;font-size:1.5rem}[data-ask-part=avatar] img:where([data-ask-skin] *){object-fit:cover;width:100%;height:100%}[data-ask-part=avatar][data-kind=initials]:where([data-ask-skin] *){background:var(--ask-color-user-bubble);color:var(--ask-color-on-user-bubble)}[data-ask-part=avatar][data-kind=icon]:where([data-ask-skin] *){background:var(--ask-color-accent);color:var(--ask-color-on-accent);border-radius:30%}[data-ask-part=avatar][data-kind=orb]:where([data-ask-skin] *){overflow:visible}[data-ask-part=avatar][data-kind=orb][data-size=large]:where([data-ask-skin] *){filter:drop-shadow(0 14px 22px color-mix(in srgb, var(--ask-color-accent) 32%, transparent))}[data-ask-part=orb]:where([data-ask-skin] *){background:var(--ask-orb);border-radius:50%;width:100%;height:100%;animation:6s ease-in-out infinite ask-breathe;display:block;position:relative;overflow:hidden;box-shadow:inset 0 -5px 12px #0000002e,inset 0 4px 10px #ffffff8c}[data-ask-part=orb]:where([data-ask-skin] *):before{content:\"\";background:conic-gradient(from 0deg, transparent 0 55%, #ffffff73 70%, transparent 85%);mix-blend-mode:soft-light;animation:9s linear infinite ask-spin;position:absolute;inset:-35%}[data-ask-part=orb]:where([data-ask-skin] *):after{content:\"\";background:radial-gradient(closest-side,#ffffffe6,#fff0);border-radius:50%;width:36%;height:28%;position:absolute;top:13%;left:20%}[data-ask-part=panel][data-busy] [data-ask-part=orb]:where([data-ask-skin] *){animation-duration:1.4s}[data-ask-part=messages]:where([data-ask-skin] *){gap:calc(var(--ask-space) * 1.5);overscroll-behavior:contain;padding:calc(var(--ask-space) * 2);scrollbar-width:thin;scrollbar-color:color-mix(in srgb, var(--ask-color-text) 18%, transparent) transparent;flex-direction:column;flex:1;display:flex;overflow-y:auto}[data-ask-part=status]:where([data-ask-skin] *){align-items:center;gap:var(--ask-space);color:var(--ask-color-muted);margin:0;font-size:.85rem;display:flex}[data-ask-part=status]:where([data-ask-skin] *):before{content:\"\";background:var(--ask-color-accent);border-radius:50%;width:8px;height:8px;animation:1.2s ease-in-out infinite ask-pulse}[data-ask-part=message]:where([data-ask-skin] *){align-items:flex-start;gap:var(--ask-space);max-width:88%;animation:ask-rise .26s var(--ask-ease) both;display:flex}[data-ask-part=message][data-role=user]:where([data-ask-skin] *){align-self:flex-end}[data-ask-part=message]>[data-ask-part=avatar]:where([data-ask-skin] *){margin-top:2px}[data-ask-part=message-body]:where([data-ask-skin] *){gap:calc(var(--ask-space) * .75);flex-direction:column;min-width:0;display:flex}[data-ask-part=message][data-role=user] [data-ask-part=message-body]:where([data-ask-skin] *){align-items:flex-end}[data-ask-part=bubble]:where([data-ask-skin] *){padding:calc(var(--ask-space) * 1.25) calc(var(--ask-space) * 1.75);border-radius:var(--ask-radius);overflow-wrap:anywhere;white-space:pre-wrap}[data-ask-part=message][data-role=assistant] [data-ask-part=bubble]:where([data-ask-skin] *){border-top-left-radius:calc(var(--ask-radius-small) * .6);background:var(--ask-color-surface);white-space:normal}[data-ask-part=message][data-role=user] [data-ask-part=bubble]:where([data-ask-skin] *){border-bottom-right-radius:calc(var(--ask-radius-small) * .6);background:var(--ask-color-user-bubble);color:var(--ask-color-on-user-bubble)}[data-ask-part=message][data-status=error] [data-ask-part=bubble]:where([data-ask-skin] *){opacity:.6}[data-askdare-root][data-ask-surface=glass] [data-ask-part=message][data-role=assistant] [data-ask-part=bubble]:where([data-ask-skin] *){border:1px solid color-mix(in srgb, var(--ask-color-background) 60%, transparent);background:var(--ask-glass);-webkit-backdrop-filter:blur(12px)saturate(140%);backdrop-filter:blur(12px)saturate(140%);box-shadow:0 1px 2px color-mix(in srgb, var(--ask-color-text) 5%, transparent)}[data-askdare-root][data-ask-bubbles=plain] [data-ask-part=message][data-role=assistant] [data-ask-part=bubble]:where([data-ask-skin] *){box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none;background:0 0;border:0;padding-inline:0}[data-ask-part=bubble]>:first-child:where([data-ask-skin] *){margin-top:0}[data-ask-part=bubble]>:last-child:where([data-ask-skin] *){margin-bottom:0}[data-ask-part=bubble] :is(p,ul,ol,pre,table,blockquote):where([data-ask-skin] *){margin:0 0 var(--ask-space)}[data-ask-part=bubble] :is(h1,h2,h3,h4):where([data-ask-skin] *){margin:calc(var(--ask-space) * 1.5) 0 calc(var(--ask-space) * .75);font-size:1em;font-weight:650;line-height:1.35}[data-ask-part=bubble] :is(ul,ol):where([data-ask-skin] *){padding-left:calc(var(--ask-space) * 2.5)}[data-ask-part=bubble] li+li:where([data-ask-skin] *){margin-top:2px}[data-ask-part=bubble] blockquote:where([data-ask-skin] *){padding-left:calc(var(--ask-space) * 1.5);border-left:3px solid var(--ask-color-border);color:var(--ask-color-muted)}[data-ask-part=bubble] code:where([data-ask-skin] *){background:color-mix(in srgb, var(--ask-color-text) 7%, transparent);border-radius:5px;padding:.1em .35em;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.88em}[data-ask-part=bubble] pre:where([data-ask-skin] *){padding:calc(var(--ask-space) * 1.25);border-radius:var(--ask-radius-small);background:color-mix(in srgb, var(--ask-color-text) 6%, transparent);overflow-x:auto}[data-ask-part=bubble] pre code:where([data-ask-skin] *){background:0 0;padding:0}[data-ask-part=bubble] table:where([data-ask-skin] *){border-collapse:collapse;font-size:.92em;display:block;overflow-x:auto}[data-ask-part=bubble] :is(th,td):where([data-ask-skin] *){border-bottom:1px solid var(--ask-color-border);text-align:left;padding:5px 10px}[data-ask-part=bubble] th:where([data-ask-skin] *){font-weight:600}[data-ask-part=bubble] a:where([data-ask-skin] *){color:var(--ask-color-accent);text-underline-offset:2px;text-decoration-thickness:1px}[data-ask-part=typing]:where([data-ask-skin] *){gap:4px;padding:6px 2px;display:inline-flex}[data-ask-part=typing] i:where([data-ask-skin] *){background:var(--ask-color-muted);border-radius:50%;width:7px;height:7px;animation:1.2s ease-in-out infinite ask-dot}[data-ask-part=typing] i:nth-child(2):where([data-ask-skin] *){animation-delay:.15s}[data-ask-part=typing] i:nth-child(3):where([data-ask-skin] *){animation-delay:.3s}[data-ask-part=attachments-note]:where([data-ask-skin] *){color:var(--ask-color-muted);margin:0;font-size:.8rem}[data-ask-part=citations]:where([data-ask-skin] *){counter-reset:ask-citation;flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none;display:flex}[data-ask-part=citation]:where([data-ask-skin] *){border:1px solid var(--ask-color-border);background:var(--ask-color-background);counter-increment:ask-citation;border-radius:999px;align-items:center;gap:6px;max-width:100%;padding:3px 10px 3px 4px;font-size:.78rem;line-height:1.4;display:inline-flex}[data-ask-part=citation]:where([data-ask-skin] *):before{content:counter(ask-citation);background:var(--ask-color-surface);min-width:18px;height:18px;color:var(--ask-color-muted);border-radius:999px;flex:none;place-items:center;font-size:.7rem;font-weight:600;display:grid}[data-ask-part=citation] :is(a,span):where([data-ask-skin] *){color:var(--ask-color-text);text-overflow:ellipsis;white-space:nowrap;text-decoration:none;overflow:hidden}[data-ask-part=citation] a:hover:where([data-ask-skin] *){color:var(--ask-color-accent);text-decoration:underline}[data-ask-part=feedback]:where([data-ask-skin] *){gap:2px;margin-top:-2px;display:flex}[data-ask-part=feedback-button]:where([data-ask-skin] *){width:28px;height:28px;color:var(--ask-color-muted);cursor:pointer;transition:background-color .15s var(--ask-ease), color .15s var(--ask-ease);background:0 0;border:0;border-radius:50%;place-items:center;padding:0;display:grid}[data-ask-part=feedback-button]:hover:where([data-ask-skin] *){background:var(--ask-color-surface);color:var(--ask-color-text)}[data-ask-part=feedback-button][aria-pressed=true]:where([data-ask-skin] *){background:color-mix(in srgb, var(--ask-color-accent) 16%, transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--ask-color-accent) 45%, transparent);color:var(--ask-color-text)}[data-ask-part=feedback-comment]:where([data-ask-skin] *){gap:calc(var(--ask-space) * .75);width:min(320px,100%);padding:calc(var(--ask-space) * 1.25);border:1px solid var(--ask-color-border);border-radius:var(--ask-radius-small);background:var(--ask-color-background);flex-direction:column;font-size:.88rem;display:flex}[data-ask-part=feedback-comment] label:where([data-ask-skin] *){font-weight:600}[data-ask-part=feedback-comment-input]:where([data-ask-skin] *){border:1px solid var(--ask-color-border);border-radius:calc(var(--ask-radius-small) * .7);background:var(--ask-color-background);width:100%;min-height:52px;color:inherit;font:inherit;resize:vertical;margin:0;padding:6px 8px;line-height:1.4}[data-ask-part=feedback-comment-actions]:where([data-ask-skin] *){justify-content:flex-end;gap:var(--ask-space);display:flex}:is([data-ask-part=feedback-skip],[data-ask-part=feedback-send]):where([data-ask-skin] *){border:1px solid var(--ask-color-border);color:var(--ask-color-text);cursor:pointer;background:0 0;border-radius:999px;padding:5px 12px;font-size:.85rem;font-weight:600}[data-ask-part=feedback-send]:where([data-ask-skin] *){border-color:var(--ask-color-accent);background:var(--ask-color-accent);color:var(--ask-color-on-accent)}[data-ask-part=feedback-send]:disabled:where([data-ask-skin] *){opacity:.45;cursor:default}[data-ask-part=welcome]:where([data-ask-skin] *){gap:calc(var(--ask-space) * 1.5);flex-direction:column;display:flex}[data-ask-part=welcome][data-layout=hero]:where([data-ask-skin] *){padding:calc(var(--ask-space) * 2) calc(var(--ask-space) * .5);text-align:center;align-items:center;margin:auto 0}[data-ask-part=welcome][data-layout=hero] [data-ask-part=greeting]:where([data-ask-skin] *){max-width:300px;margin:calc(var(--ask-space) * 1.5) 0 0;font-family:var(--ask-font-family-heading);letter-spacing:-.02em;text-wrap:balance;font-size:1.45rem;font-weight:600;line-height:1.25}[data-ask-part=starters]:where([data-ask-skin] *){gap:var(--ask-space);width:100%;margin:calc(var(--ask-space) * .5) 0 0;flex-direction:column;padding:0;list-style:none;display:flex}[data-ask-part=starter]:where([data-ask-skin] *){align-items:center;gap:calc(var(--ask-space) * 1.25);width:100%;padding:calc(var(--ask-space) * 1.25) calc(var(--ask-space) * 1.75);border:1px solid var(--ask-color-border);border-radius:var(--ask-radius-small);background:var(--ask-color-background);box-shadow:0 1px 2px color-mix(in srgb, var(--ask-color-text) 5%, transparent);text-align:left;cursor:pointer;transition:border-color .15s var(--ask-ease), transform .15s var(--ask-ease), box-shadow .15s var(--ask-ease);font-size:.92rem;line-height:1.4;display:flex}[data-ask-part=starter] svg:where([data-ask-skin] *){color:var(--ask-color-accent);flex:none}[data-ask-part=starter] span:where([data-ask-skin] *){flex:1}[data-ask-part=starter]:hover:not(:disabled):where([data-ask-skin] *){border-color:color-mix(in srgb, var(--ask-color-accent) 45%, var(--ask-color-border));box-shadow:var(--ask-shadow);transform:translateY(-1px)}[data-ask-part=starter]:disabled:where([data-ask-skin] *){opacity:.55;cursor:default}[data-askdare-root][data-ask-surface=glass] [data-ask-part=starter]:where([data-ask-skin] *){border-color:color-mix(in srgb, var(--ask-color-background) 70%, var(--ask-color-border));background:var(--ask-glass);-webkit-backdrop-filter:blur(12px)saturate(140%);backdrop-filter:blur(12px)saturate(140%)}[data-ask-part=welcome][data-layout=persona]:where([data-ask-skin] *){padding-top:calc(var(--ask-space) * 2);margin-top:auto}[data-ask-part=persona]:where([data-ask-skin] *){align-items:center;gap:calc(var(--ask-space) * 2);display:flex}[data-ask-part=persona] [data-ask-part=avatar][data-size=large]:where([data-ask-skin] *){border-radius:22px;width:64px;height:64px}[data-ask-part=persona-name]:where([data-ask-skin] *){font-family:var(--ask-font-family-heading);letter-spacing:-.01em;margin:0 0 6px;font-size:1.75rem;font-weight:300;line-height:1.1}[data-ask-part=presence]:where([data-ask-skin] *){border:1px solid var(--ask-color-border);color:var(--ask-color-muted);border-radius:999px;align-items:center;gap:6px;padding:2px 10px 2px 8px;font-size:.75rem;font-weight:500;display:inline-flex}[data-ask-part=presence]:where([data-ask-skin] *):before{content:\"\";background:var(--ask-color-success);width:7px;height:7px;box-shadow:0 0 0 3px color-mix(in srgb, var(--ask-color-success) 20%, transparent);border-radius:50%}[data-ask-part=welcome][data-layout=persona] [data-ask-part=greeting]:where([data-ask-skin] *){margin:calc(var(--ask-space) * .5) 0 0;font-size:1rem;line-height:1.6}[data-ask-part=welcome][data-layout=persona] [data-ask-part=starter]:where([data-ask-skin] *){padding:calc(var(--ask-space) * 1.4) calc(var(--ask-space) * 2.25);background:var(--ask-color-accent);box-shadow:none;color:var(--ask-color-on-accent);border-color:#0000;border-radius:999px;font-weight:500}[data-ask-part=welcome][data-layout=persona] [data-ask-part=starter] svg:where([data-ask-skin] *){color:inherit}[data-ask-part=welcome][data-layout=persona] [data-ask-part=starter] svg:first-child:where([data-ask-skin] *){display:none}[data-ask-part=welcome][data-layout=persona] [data-ask-part=starter]:hover:not(:disabled):where([data-ask-skin] *){box-shadow:0 8px 20px -10px color-mix(in srgb, var(--ask-color-accent) 70%, transparent)}[data-ask-part=intro]:where([data-ask-skin] *){align-items:flex-start;gap:var(--ask-space);animation:ask-rise .26s var(--ask-ease) both;display:flex}[data-ask-part=intro]>[data-ask-part=avatar]:where([data-ask-skin] *){margin-top:2px}[data-ask-part=intro-card]:where([data-ask-skin] *){min-width:0;padding:calc(var(--ask-space) * 1.25) calc(var(--ask-space) * 1.75);border-radius:var(--ask-radius);border-top-left-radius:calc(var(--ask-radius-small) * .6);background:var(--ask-color-surface);flex:1}[data-askdare-root][data-ask-surface=glass] [data-ask-part=intro-card]:where([data-ask-skin] *){border:1px solid color-mix(in srgb, var(--ask-color-background) 60%, transparent);background:var(--ask-glass);-webkit-backdrop-filter:blur(12px)saturate(140%);backdrop-filter:blur(12px)saturate(140%)}[data-ask-part=welcome][data-layout=intro] [data-ask-part=greeting]:where([data-ask-skin] *){margin:0;font-size:1.02rem}[data-ask-part=intro-card] [data-ask-part=starters]:where([data-ask-skin] *){margin-top:var(--ask-space);gap:0;padding:0}[data-ask-part=welcome][data-layout=intro] li+li:where([data-ask-skin] *){border-top:1px solid var(--ask-color-border)}[data-ask-part=welcome][data-layout=intro] [data-ask-part=starter]:where([data-ask-skin] *){padding:calc(var(--ask-space) * 1.1) 0;box-shadow:none;background:0 0;border:0;border-radius:0;font-size:.98rem}[data-ask-part=welcome][data-layout=intro] [data-ask-part=starter] svg:where([data-ask-skin] *){color:var(--ask-color-success)}[data-ask-part=welcome][data-layout=intro] [data-ask-part=starter]:hover:not(:disabled):where([data-ask-skin] *){box-shadow:none;text-underline-offset:3px;text-decoration:underline;transform:none}[data-ask-part=confirm-backdrop]:where([data-ask-skin] *){z-index:5;padding:calc(var(--ask-space) * 2);background:color-mix(in srgb, var(--ask-color-background) 60%, transparent);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);animation:ask-fade .16s var(--ask-ease);place-items:center;display:grid;position:absolute;inset:0}[data-ask-part=confirm]:where([data-ask-skin] *){justify-items:center;gap:calc(var(--ask-space) * 1.5);width:min(300px,100%);padding:calc(var(--ask-space) * 2.5) calc(var(--ask-space) * 2) calc(var(--ask-space) * 2);border:1px solid var(--ask-color-border);border-radius:var(--ask-radius);background:var(--ask-color-surface);box-shadow:var(--ask-shadow);text-align:center;animation:ask-pop .2s var(--ask-ease);display:grid}[data-ask-part=confirm-icon]:where([data-ask-skin] *){background:color-mix(in srgb, var(--ask-color-accent) 12%, transparent);width:44px;height:44px;color:var(--ask-color-accent);border-radius:50%;place-items:center;display:grid}[data-ask-part=confirm-text]:where([data-ask-skin] *){color:var(--ask-color-text);text-wrap:balance;margin:0;font-size:.95rem;line-height:1.45}[data-ask-part=confirm-actions]:where([data-ask-skin] *){gap:var(--ask-space);width:100%;margin-top:calc(var(--ask-space) / 2);display:flex}:is([data-ask-part=confirm-cancel],[data-ask-part=confirm-accept]):where([data-ask-skin] *){padding:calc(var(--ask-space) * 1.1) var(--ask-space);border:1px solid var(--ask-color-border);border-radius:var(--ask-radius-small);color:var(--ask-color-text);font:inherit;cursor:pointer;transition:background .15s var(--ask-ease);background:0 0;flex:1;font-size:.9rem;font-weight:600}[data-ask-part=confirm-cancel]:hover:where([data-ask-skin] *){background:color-mix(in srgb, var(--ask-color-text) 6%, transparent)}[data-ask-part=confirm-accept]:where([data-ask-skin] *){border-color:var(--ask-color-accent);background:var(--ask-color-accent);color:var(--ask-color-on-accent)}[data-ask-part=confirm-accept]:hover:where([data-ask-skin] *){background:color-mix(in srgb, var(--ask-color-accent) 80%, var(--ask-color-background))}[data-ask-part=confirm][aria-busy=true] [data-ask-part=confirm-icon] svg:where([data-ask-skin] *){animation:.9s linear infinite ask-spin}[data-ask-part=confirm][aria-busy=true] button:where([data-ask-skin] *){cursor:progress}[data-ask-part=confirm-cancel][aria-disabled=true]:where([data-ask-skin] *){opacity:.5}@keyframes ask-fade{0%{opacity:0}}@keyframes ask-pop{0%{opacity:0;transform:translateY(6px)scale(.97)}}[data-ask-part=error]:where([data-ask-skin] *){margin:0 calc(var(--ask-space) * 1.5) var(--ask-space);padding:var(--ask-space) calc(var(--ask-space) * 1.5);border:1px solid color-mix(in srgb, var(--ask-color-danger) 30%, transparent);border-radius:var(--ask-radius-small);background:color-mix(in srgb, var(--ask-color-danger) 8%, var(--ask-color-background));color:var(--ask-color-danger);font-size:.88rem}[data-ask-part=panel][data-dragging]:where([data-ask-skin] *){outline:2px dashed var(--ask-color-accent);outline-offset:-6px}[data-ask-part=composer]:where([data-ask-skin] *){gap:var(--ask-space);padding:var(--ask-space) calc(var(--ask-space) * 1.5) calc(var(--ask-space) * 1.5);flex-direction:column;display:flex}[data-ask-part=composer-box]:where([data-ask-skin] *){border:1px solid var(--ask-color-border);border-radius:calc(var(--ask-radius) + 4px);background:var(--ask-color-background);box-shadow:var(--ask-shadow);transition:border-color .15s var(--ask-ease), box-shadow .15s var(--ask-ease);align-items:flex-end;gap:4px;padding:6px;display:flex}[data-ask-part=composer-box]:focus-within:where([data-ask-skin] *){border-color:color-mix(in srgb, var(--ask-color-accent) 55%, var(--ask-color-border));box-shadow:var(--ask-shadow), var(--ask-ring)}[data-askdare-root][data-ask-surface=glass] [data-ask-part=composer-box]:where([data-ask-skin] *){background:color-mix(in srgb, var(--ask-color-background) 78%, transparent);-webkit-backdrop-filter:blur(16px)saturate(150%);backdrop-filter:blur(16px)saturate(150%)}[data-askdare-root][data-ask-composer=gradient] [data-ask-part=composer-box]:where([data-ask-skin] *){background:linear-gradient(var(--ask-color-background), var(--ask-color-background)) padding-box, var(--ask-orb) border-box;border:1.5px solid #0000}[data-askdare-root][data-ask-composer=gradient] [data-ask-part=composer-box]:focus-within:where([data-ask-skin] *){border-color:#0000}[data-ask-part=input]:where([data-ask-skin] *){min-height:36px;max-height:140px;color:inherit;font:inherit;resize:none;background:0 0;border:0;outline:0;flex:1;margin:0;padding:7px 8px;line-height:1.45}[data-ask-part=input]:where([data-ask-skin] *)::placeholder{color:var(--ask-color-muted);opacity:1}:is([data-ask-part=attach],[data-ask-part=voice],[data-ask-part=send],[data-ask-part=recorder-cancel]):where([data-ask-skin] *){cursor:pointer;width:36px;height:36px;transition:background-color .15s var(--ask-ease), color .15s var(--ask-ease), transform .15s var(--ask-ease), opacity .15s var(--ask-ease);border:0;border-radius:50%;flex:none;place-items:center;padding:0;display:grid}:is([data-ask-part=attach],[data-ask-part=voice],[data-ask-part=recorder-cancel]):where([data-ask-skin] *){color:var(--ask-color-muted);background:0 0}:is([data-ask-part=attach],[data-ask-part=voice],[data-ask-part=recorder-cancel]):hover:not(:disabled):where([data-ask-skin] *){background:var(--ask-color-surface);color:var(--ask-color-text)}[data-ask-part=send]:where([data-ask-skin] *){background:var(--ask-color-accent);color:var(--ask-color-on-accent)}[data-ask-part=send]:hover:not(:disabled):where([data-ask-skin] *){transform:translateY(-1px)}[data-ask-part=send-label]:where([data-ask-skin] *){display:none}:is([data-ask-part=attach],[data-ask-part=voice],[data-ask-part=send]):disabled:where([data-ask-skin] *){opacity:.35;cursor:default}[data-ask-part=disclosure]:where([data-ask-skin] *){margin:calc(var(--ask-space) * -.5) 0 0;padding:0 calc(var(--ask-space) * 2) calc(var(--ask-space) * 1.25);color:var(--ask-color-muted);text-align:center;font-size:.72rem;line-height:1.4}[data-ask-part=disclosure] a:where([data-ask-skin] *){color:inherit;text-underline-offset:2px}:is([data-ask-part=attachments],[data-ask-part=message-attachments]):where([data-ask-skin] *){flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none;display:flex}[data-ask-part=message-attachments]:where([data-ask-skin] *){justify-content:flex-end}[data-ask-part=attachment]:where([data-ask-skin] *){border:1px solid var(--ask-color-border);border-radius:var(--ask-radius-small);background:var(--ask-color-background);align-items:center;gap:8px;max-width:100%;padding:4px 6px 4px 4px;font-size:.82rem;display:flex}[data-ask-part=attachment][data-status=error]:where([data-ask-skin] *){border-color:var(--ask-color-danger)}:is([data-ask-part=attachment-preview],[data-ask-part=attachment-badge]):where([data-ask-skin] *){border-radius:calc(var(--ask-radius-small) * .7);flex:none;width:34px;height:34px}[data-ask-part=attachment-preview]:where([data-ask-skin] *){object-fit:cover}[data-ask-part=attachment-badge]:where([data-ask-skin] *){background:var(--ask-color-surface);color:var(--ask-color-muted);letter-spacing:.04em;place-items:center;font-size:.65rem;font-weight:700;display:grid}[data-ask-part=attachment-name]:where([data-ask-skin] *){text-overflow:ellipsis;white-space:nowrap;max-width:160px;overflow:hidden}[data-ask-part=attachment-status]:where([data-ask-skin] *){color:var(--ask-color-muted)}[data-ask-part=attachment][data-status=error] [data-ask-part=attachment-status]:where([data-ask-skin] *){color:var(--ask-color-danger)}[data-ask-part=attachment-remove]:where([data-ask-skin] *){color:var(--ask-color-muted);cursor:pointer;background:0 0;border:0;padding:0 4px;font-size:1.1em}[data-ask-part=recorder]:where([data-ask-skin] *){align-items:center;gap:var(--ask-space);flex:1;min-height:36px;padding-left:10px;display:flex}[data-ask-part=recorder-level]:where([data-ask-skin] *){background:var(--ask-color-danger);width:14px;height:14px;box-shadow:0 0 0 calc(var(--ask-level,0) * 10px) color-mix(in srgb, var(--ask-color-danger) 18%, transparent);transform:scale(calc(.7 + var(--ask-level,0) * .6));border-radius:50%;flex:none;transition:transform 80ms linear,box-shadow 80ms linear}[data-ask-part=recorder][data-state=transcribing] [data-ask-part=recorder-level]:where([data-ask-skin] *){background:var(--ask-color-muted);box-shadow:none;animation:1.2s ease-in-out infinite ask-pulse;transform:none}[data-ask-part=recorder-label]:where([data-ask-skin] *){font-weight:600}[data-ask-part=recorder-time]:where([data-ask-skin] *){color:var(--ask-color-muted);font-variant-numeric:tabular-nums;margin-right:auto}[data-ask-part=recorder][data-state=transcribing] [data-ask-part=recorder-label]:where([data-ask-skin] *){margin-right:auto}[data-ask-part=recorder-done]:where([data-ask-skin] *){height:36px;padding:0 calc(var(--ask-space) * 2);background:var(--ask-color-accent);color:var(--ask-color-on-accent);cursor:pointer;border:0;border-radius:999px;font-weight:600}@media (max-width:480px){[data-ask-part=input]:where([data-ask-skin] *){font-size:16px}}@keyframes ask-rise{0%{opacity:0;transform:translateY(6px)}}@keyframes ask-dot{0%,60%,to{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}@keyframes ask-pulse{50%{opacity:.35}}@keyframes ask-breathe{50%{filter:saturate(1.15)brightness(1.04);transform:scale(1.04)}}@keyframes ask-spin{to{transform:rotate(360deg)}}[data-askdare-root]:is([data-ask-preset=aura],[data-ask-preset=halo]) [data-ask-part=starters]:where([data-ask-skin] *){flex-flow:wrap;justify-content:center;gap:8px}[data-askdare-root]:is([data-ask-preset=aura],[data-ask-preset=halo]) [data-ask-part=starter]:where([data-ask-skin] *){border-radius:999px;width:auto;padding:7px 14px 7px 11px;font-size:.82rem}[data-askdare-root][data-ask-preset=aura] [data-ask-part=welcome][data-layout=hero]:where([data-ask-skin] *){isolation:isolate;position:relative}[data-askdare-root][data-ask-preset=aura] [data-ask-part=welcome][data-layout=hero]:where([data-ask-skin] *):before{content:\"\";z-index:-1;background:radial-gradient(circle, color-mix(in srgb, var(--ask-color-text) 9%, transparent) 1px, transparent 1.4px) 0 0 / 14px 14px;pointer-events:none;position:absolute;inset:-6% 0 34%;-webkit-mask-image:radial-gradient(closest-side,#000 20%,#0000 100%);mask-image:radial-gradient(closest-side,#000 20%,#0000 100%)}[data-askdare-root][data-ask-preset=aura] [data-ask-part=welcome][data-layout=hero] [data-ask-part=avatar][data-size=large]:where([data-ask-skin] *){width:116px;height:116px;filter:drop-shadow(0 22px 26px color-mix(in srgb, var(--ask-color-accent) 22%, transparent));-webkit-box-reflect:below 6px linear-gradient(transparent 52%, #ffffff6b);margin-bottom:30px}[data-askdare-root][data-ask-preset=aura] [data-ask-part=orb]:where([data-ask-skin] *){box-shadow:inset 0 -10px 22px #ffffff59,inset 0 8px 16px #ffffffa6,inset 0 0 0 1px #ffffff80}[data-askdare-root][data-ask-preset=aura] [data-ask-part=welcome][data-layout=hero] [data-ask-part=greeting]:where([data-ask-skin] *){letter-spacing:-.03em;max-width:320px;font-size:1.6rem;font-weight:700}[data-askdare-root][data-ask-preset=aura] [data-layout=hero] [data-ask-part=greeting]:has(strong):where([data-ask-skin] *){color:color-mix(in srgb, var(--ask-color-text) 58%, var(--ask-color-background));font-weight:500}[data-askdare-root][data-ask-preset=aura] [data-ask-part=greeting] strong:where([data-ask-skin] *){color:var(--ask-color-text);font-weight:700}[data-askdare-root][data-ask-preset=aura] [data-ask-part=starter]:where([data-ask-skin] *){background:var(--ask-color-background);-webkit-backdrop-filter:none;backdrop-filter:none}[data-askdare-root][data-ask-preset=aura]{--ask-aura-gradient-end:var(--ask-color-accent)}[data-askdare-root][data-ask-preset=aura][data-ask-scheme=dark]{--ask-aura-gradient-end:color-mix(in srgb, var(--ask-color-accent) 55%, #000)}@media (prefers-color-scheme:dark){[data-askdare-root][data-ask-preset=aura][data-ask-scheme=auto]{--ask-aura-gradient-end:color-mix(in srgb, var(--ask-color-accent) 55%, #000)}}[data-askdare-root][data-ask-preset=aura] [data-ask-part=message][data-role=user] [data-ask-part=bubble]:where([data-ask-skin] *),[data-askdare-root][data-ask-preset=aura] [data-ask-part=send]:where([data-ask-skin] *){background:linear-gradient(115deg, var(--ask-color-user-bubble), var(--ask-aura-gradient-end));color:var(--ask-color-on-user-bubble)}[data-askdare-root][data-ask-preset=aura] [data-ask-part=message][data-role=user] [data-ask-part=bubble]:where([data-ask-skin] *){border-radius:20px 20px 6px}[data-askdare-root][data-ask-preset=aura] [data-ask-part=composer-box]:where([data-ask-skin] *){border-radius:22px;flex-wrap:wrap;align-items:center;padding:10px 10px 8px}[data-askdare-root][data-ask-preset=aura] [data-ask-part=input]:where([data-ask-skin] *){flex:1 0 100%;order:-1;min-height:44px;padding:4px 8px 6px}[data-askdare-root][data-ask-preset=aura] :is([data-ask-part=attach],[data-ask-part=voice]):where([data-ask-skin] *){border:1px solid var(--ask-color-border);background:var(--ask-color-background);border-radius:999px;width:34px;height:32px}[data-askdare-root][data-ask-preset=aura] :is([data-ask-part=voice],[data-ask-part=send]:not([data-ask-part=voice]~*)):where([data-ask-skin] *){margin-left:auto}[data-askdare-root][data-ask-preset=aura] [data-ask-part=send]:where([data-ask-skin] *){border-radius:999px;gap:6px;width:auto;height:32px;padding:0 14px 0 10px;display:inline-flex}[data-askdare-root][data-ask-preset=aura] [data-ask-part=send] svg:where([data-ask-skin] *){width:16px;height:16px}[data-askdare-root][data-ask-preset=aura] [data-ask-part=send-label]:where([data-ask-skin] *){font-size:.82rem;font-weight:600;display:inline}[data-askdare-root][data-ask-preset=halo] [data-ask-part=welcome][data-layout=hero] [data-ask-part=avatar][data-size=large]:where([data-ask-skin] *){width:104px;height:104px;box-shadow:0 0 0 12px color-mix(in srgb, var(--ask-color-accent) 9%, transparent), 0 0 0 26px color-mix(in srgb, var(--ask-color-accent) 5%, transparent), 0 26px 50px -14px color-mix(in srgb, var(--ask-color-accent) 45%, transparent);filter:none;border-radius:50%;margin:18px 0 14px}[data-askdare-root][data-ask-preset=halo] [data-ask-part=orb]:where([data-ask-skin] *){box-shadow:inset 0 0 0 2px #ffffff8c, inset 0 -12px 24px color-mix(in srgb, var(--ask-color-accent) 35%, transparent), inset 0 10px 18px #ffffffb3}[data-askdare-root][data-ask-preset=halo] [data-ask-part=welcome][data-layout=hero] [data-ask-part=greeting]:where([data-ask-skin] *){letter-spacing:-.035em;font-size:1.7rem;font-weight:700}[data-askdare-root][data-ask-preset=halo] [data-ask-part=message][data-role=user] [data-ask-part=bubble]:where([data-ask-skin] *){border-radius:18px 18px 6px}[data-askdare-root][data-ask-preset=halo] [data-ask-part=composer-box]:where([data-ask-skin] *){box-shadow:0 10px 30px -14px color-mix(in srgb, var(--ask-color-accent) 45%, transparent);border-radius:999px;align-items:center;padding:6px 6px 6px 10px}[data-askdare-root][data-ask-preset=halo] :is([data-ask-part=voice],[data-ask-part=send]):where([data-ask-skin] *){background:color-mix(in srgb, var(--ask-color-accent) 15%, var(--ask-color-background));width:40px;height:40px;color:var(--ask-color-accent)}[data-askdare-root][data-ask-preset=halo] [data-ask-part=input]:where([data-ask-skin] *){align-self:center}[data-askdare-root][data-ask-preset=sage] [data-ask-part=welcome][data-layout=persona]:where([data-ask-skin] *){padding:calc(var(--ask-space) * 2.25);border:1px solid var(--ask-color-border);background:linear-gradient(160deg, var(--ask-color-background) 30%, color-mix(in srgb, var(--ask-color-surface) 70%, var(--ask-color-background)));box-shadow:var(--ask-shadow);border-radius:26px}[data-askdare-root][data-ask-preset=sage] [data-ask-part=persona]:where([data-ask-skin] *){flex-direction:row-reverse;justify-content:space-between}[data-askdare-root][data-ask-preset=sage] [data-ask-part=welcome] [data-ask-part=persona] [data-ask-part=avatar][data-size=large]:where([data-ask-skin] *){border-radius:50%;width:84px;height:84px}[data-askdare-root][data-ask-preset=sage] [data-ask-part=persona-name]:where([data-ask-skin] *){letter-spacing:-.03em;order:2;margin:10px 0 0;font-size:1.9rem;font-weight:300}[data-askdare-root][data-ask-preset=sage] [data-ask-part=persona]>div:where([data-ask-skin] *){flex-direction:column;align-items:flex-start;display:flex}[data-askdare-root][data-ask-preset=sage] [data-ask-part=presence]:where([data-ask-skin] *){background:var(--ask-color-background);box-shadow:0 1px 2px color-mix(in srgb, var(--ask-color-text) 8%, transparent);color:var(--ask-color-text);border-color:#0000;padding:3px 10px 3px 8px}[data-askdare-root][data-ask-preset=sage] [data-ask-part=welcome][data-layout=persona] [data-ask-part=greeting]:where([data-ask-skin] *){color:var(--ask-color-muted);font-weight:300}[data-askdare-root][data-ask-preset=sage] [data-ask-part=starters]:where([data-ask-skin] *){flex-flow:wrap;gap:8px}[data-askdare-root][data-ask-preset=sage] [data-ask-part=starter]:where([data-ask-skin] *){border-radius:999px;width:auto;padding:8px 16px;font-size:.85rem}[data-askdare-root][data-ask-preset=sage] [data-ask-part=starter] svg:where([data-ask-skin] *){display:none}[data-askdare-root][data-ask-preset=sage] li:first-child>[data-ask-part=starter]:where([data-ask-skin] *){border-color:var(--ask-color-accent);background:var(--ask-color-accent);color:var(--ask-color-on-accent)}[data-askdare-root][data-ask-preset=sage] [data-ask-part=message][data-role=user] [data-ask-part=bubble]:where([data-ask-skin] *){border:1px solid var(--ask-color-border);box-shadow:0 1px 2px color-mix(in srgb, var(--ask-color-text) 6%, transparent)}[data-askdare-root][data-ask-preset=sage] [data-ask-part=composer-box]:where([data-ask-skin] *){border-radius:999px;align-items:center;padding:6px 6px 6px 8px;position:relative}[data-askdare-root][data-ask-preset=sage] [data-ask-part=composer-box]:has(>[data-ask-part=voice]):where([data-ask-skin] *){margin-right:54px}[data-askdare-root][data-ask-preset=sage] [data-ask-part=send]:where([data-ask-skin] *){width:40px;height:40px}[data-askdare-root][data-ask-preset=sage] [data-ask-part=voice]:where([data-ask-skin] *){border:1px solid var(--ask-color-border);background:var(--ask-color-background);width:46px;height:46px;box-shadow:var(--ask-shadow);color:var(--ask-color-text);position:absolute;top:50%;right:-54px;transform:translateY(-50%)}@media (prefers-reduced-motion:reduce){:where([data-ask-skin],[data-ask-skin] *),:where([data-ask-skin] *):before,:where([data-ask-skin] *):after{transition:none!important;animation:none!important}[data-ask-part=recorder-level]:where([data-ask-skin] *){opacity:calc(.4 + var(--ask-level,0) * .6);transform:none}}html,body,#askdare-root{height:100%;margin:0}body{background:var(--ask-backdrop), var(--ask-color-background);background-color:var(--ask-color-background);color:var(--ask-color-text);font:var(--ask-font-size) / 1.55 var(--ask-font-family);-webkit-font-smoothing:antialiased;text-rendering:optimizelegibility}}\n/*$vite$:1*/";
|
|
76
76
|
const WIDGET_JS_FILE = "widget.327682f9ed55.js";
|
package/dist/ui/askdare.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Ejected from @boldare/askdare@0.2.0
|
|
1
|
+
/* Ejected from @boldare/askdare@0.2.0 with `npx @boldare/askdare add ui`. This copy is yours to change. */
|
|
2
2
|
/*
|
|
3
3
|
* Default skin of the chat (ADR-0008, ADR-0011), in the iframe and inside a page. Everything is
|
|
4
4
|
* built on the public styling API: the --ask-* tokens (set per bot by the theme stylesheet), the
|
package/dist/ui/avatar.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @boldare/askdare@0.2.0
|
|
1
|
+
// Ejected from @boldare/askdare@0.2.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
|
|
2
2
|
import type { ReactElement } from 'react';
|
|
3
3
|
import { useSkin } from './context';
|
|
4
4
|
import { SparkIcon } from './icons';
|
package/dist/ui/chat.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @boldare/askdare@0.2.0
|
|
1
|
+
// Ejected from @boldare/askdare@0.2.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
4
|
// The entry of an ejected copy (`npx @boldare/askdare add ui`): the same DefaultChat as in
|
package/dist/ui/confirm.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @boldare/askdare@0.2.0
|
|
1
|
+
// Ejected from @boldare/askdare@0.2.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
|
|
2
2
|
import { useChat } from '@boldare/askdare/react';
|
|
3
3
|
import { type KeyboardEvent, type ReactElement, useEffect, useId, useRef } from 'react';
|
|
4
4
|
import { RestartIcon } from './icons';
|
package/dist/ui/context.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @boldare/askdare@0.2.0
|
|
1
|
+
// Ejected from @boldare/askdare@0.2.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
|
|
2
2
|
import type { ChatBot, Translate } from '@boldare/askdare/react';
|
|
3
3
|
import { type Context, createContext, type RefObject, useContext } from 'react';
|
|
4
4
|
|
package/dist/ui/feedback.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @boldare/askdare@0.2.0
|
|
1
|
+
// Ejected from @boldare/askdare@0.2.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
|
|
2
2
|
import { FeedbackButton, useChat, useChatState, useMessage } from '@boldare/askdare/react';
|
|
3
3
|
import { type FormEvent, type ReactElement, useEffect, useId, useRef, useState } from 'react';
|
|
4
4
|
import { useSkin } from './context';
|
package/dist/ui/footer.tsx
CHANGED
package/dist/ui/header.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @boldare/askdare@0.2.0
|
|
1
|
+
// Ejected from @boldare/askdare@0.2.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
|
|
2
2
|
import { useChat } from '@boldare/askdare/react';
|
|
3
3
|
import type { ReactElement } from 'react';
|
|
4
4
|
import { Avatar } from './avatar';
|
package/dist/ui/icons.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @boldare/askdare@0.2.0
|
|
1
|
+
// Ejected from @boldare/askdare@0.2.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
|
|
2
2
|
import type { ReactElement, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/** Line icons on a 24px grid, drawn with the current text color. */
|
package/dist/ui/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @boldare/askdare@0.2.0
|
|
1
|
+
// Ejected from @boldare/askdare@0.2.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
4
|
// The default look of the chat (ADR-0011): what `npx @boldare/askdare add ui` copies into an app.
|
package/dist/ui/message.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @boldare/askdare@0.2.0
|
|
1
|
+
// Ejected from @boldare/askdare@0.2.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
|
|
2
2
|
import { Citations, Message, MessageFiles, MessageText, useMessage } from '@boldare/askdare/react';
|
|
3
3
|
import type { ReactElement } from 'react';
|
|
4
4
|
import { Avatar } from './avatar';
|
package/dist/ui/panel.tsx
CHANGED
package/dist/ui/welcome.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @boldare/askdare@0.2.0
|
|
1
|
+
// Ejected from @boldare/askdare@0.2.0 with `npx @boldare/askdare add ui`. This copy is yours to change.
|
|
2
2
|
import { useChat } from '@boldare/askdare/react';
|
|
3
3
|
import type { ReactElement, ReactNode } from 'react';
|
|
4
4
|
import { Avatar } from './avatar';
|
package/docs/deployment.md
CHANGED
|
@@ -16,11 +16,11 @@ Set them in your host's settings, never in files you commit.
|
|
|
16
16
|
|
|
17
17
|
## One-click deploy
|
|
18
18
|
|
|
19
|
-
To see askdare running on a host before you add it to your own app, deploy the [starter](https://github.com/boldare/askdare/tree/main/examples/starter): the app that `npx @boldare/askdare init` makes of a fresh `create-next-app`, with one bot.
|
|
19
|
+
To see askdare running on a host before you add it to your own app, deploy the [starter](https://github.com/boldare/askdare/tree/main/examples/starter): the app that `npx @boldare/askdare init` makes of a fresh `create-next-app`, with one bot. It takes about five minutes, and [askdare.vercel.app/deploy](https://askdare.vercel.app/deploy) walks you through it.
|
|
20
20
|
|
|
21
|
-
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fboldare%2Faskdare%2Ftree%2Fmain%2Fexamples%2Fstarter&project-name=askdare-chat&repository-name=askdare-chat&env=OPENAI_API_KEY%2CCHAT_SECRET%2CASKDARE_MODEL%2CASKDARE_INSTRUCTIONS%2CASKDARE_GREETING&envDefaults=%7B%22ASKDARE_MODEL%22%3A%22gpt-6.1-terra%22%2C%22ASKDARE_INSTRUCTIONS%22%3A%22You%20are%20the%20assistant%20on%20our%20website.%20Answer%20briefly%20and%20politely.%20If%20you%20do%20not%20know%20something%2C%20say%20so.%22%2C%22ASKDARE_GREETING%22%3A%22Hi%21%20How%20can%20I%20help%3F%22%7D&envDescription=OPENAI_API_KEY%3A%20a%20key%20from%20a%20dedicated%20OpenAI%20project%20with%20a%20hard%20spend%20limit.%20CHAT_SECRET%3A%20at%20least%2032%20random%20characters%
|
|
21
|
+
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fboldare%2Faskdare%2Ftree%2Fmain%2Fexamples%2Fstarter&project-name=askdare-chat&repository-name=askdare-chat&env=OPENAI_API_KEY%2CCHAT_SECRET%2CASKDARE_MODEL%2CASKDARE_INSTRUCTIONS%2CASKDARE_GREETING&envDefaults=%7B%22ASKDARE_MODEL%22%3A%22gpt-6.1-terra%22%2C%22ASKDARE_INSTRUCTIONS%22%3A%22You%20are%20the%20assistant%20on%20our%20website.%20Answer%20briefly%20and%20politely.%20If%20you%20do%20not%20know%20something%2C%20say%20so.%22%2C%22ASKDARE_GREETING%22%3A%22Hi%21%20How%20can%20I%20help%3F%22%7D&envDescription=OPENAI_API_KEY%3A%20a%20key%20from%20a%20dedicated%20OpenAI%20project%20with%20a%20hard%20spend%20limit.%20CHAT_SECRET%3A%20at%20least%2032%20random%20characters%3B%20askdare.vercel.app%2Fdeploy%20makes%20one%20for%20you.%20ASKDARE_MODEL%3A%20a%20current%20OpenAI%20model%20your%20project%20may%20use.%20ASKDARE_INSTRUCTIONS%3A%20what%20the%20bot%20does%20and%20how%20it%20answers.%20ASKDARE_GREETING%3A%20the%20first%20message%20in%20the%20chat.&envLink=https%3A%2F%2Faskdare.vercel.app%2Fdeploy)
|
|
22
22
|
|
|
23
|
-
- **Vercel:** the button copies the starter into a new repository on your Git account, then asks for the variables. Enter your `OPENAI_API_KEY` and a new `CHAT_SECRET` of at least 32 characters
|
|
23
|
+
- **Vercel:** the button copies the starter into a new repository on your Git account, then asks for the variables. Enter your `OPENAI_API_KEY` and a new `CHAT_SECRET` of at least 32 characters: copy one from [askdare.vercel.app/deploy](https://askdare.vercel.app/deploy), which makes it in your browser, or run `node -e "console.log(require('node:crypto').randomBytes(32).toString('base64url'))"`. `ASKDARE_MODEL` comes filled in with the starter's model; change it to one your project may use. `ASKDARE_INSTRUCTIONS` (what the bot does) and `ASKDARE_GREETING` (its first message) come filled in with the starter's defaults; change them to give the bot its job. To embed the chat on other sites later, add `ASKDARE_ALLOWED_ORIGINS` under **Settings โ Environment Variables** and redeploy.
|
|
24
24
|
- **Heroku:** a Heroku button only deploys an app at the root of a repository, so it works from your own copy of the starter. Create one with `npx create-next-app --example https://github.com/boldare/askdare/tree/main/examples/starter my-chat`, push it to GitHub, then open `https://www.heroku.com/deploy?template=https://github.com/<you>/<repo>`. The starter's `app.json` asks for `OPENAI_API_KEY`, generates `CHAT_SECRET`, fills in `ASKDARE_MODEL`, offers the optional `ASKDARE_INSTRUCTIONS`, `ASKDARE_GREETING` and `ASKDARE_ALLOWED_ORIGINS`, and runs one web dyno with the `Procfile` from [Heroku](#heroku).
|
|
25
25
|
|
|
26
26
|
These settings live in your host's environment variables, which win over the defaults in `askdare.config.ts`. Change them there and redeploy, or delete them and edit the config in your repository.
|
package/docs/getting-started.md
CHANGED
|
@@ -4,9 +4,9 @@ From an empty Next.js app to a working chat in about 15 minutes. You need Node 2
|
|
|
4
4
|
|
|
5
5
|
No Next.js app yet? Create one with the [Next.js installation guide](https://nextjs.org/docs/app/getting-started/installation), then come back.
|
|
6
6
|
|
|
7
|
-
Just want to see it running first? Deploy the starter app in one click, then come back to add askdare to your own app:
|
|
7
|
+
Just want to see it running first? Deploy the starter app in one click, in about five minutes ([askdare.vercel.app/deploy](https://askdare.vercel.app/deploy) walks you through it), then come back to add askdare to your own app:
|
|
8
8
|
|
|
9
|
-
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fboldare%2Faskdare%2Ftree%2Fmain%2Fexamples%2Fstarter&project-name=askdare-chat&repository-name=askdare-chat&env=OPENAI_API_KEY%2CCHAT_SECRET%2CASKDARE_MODEL%2CASKDARE_INSTRUCTIONS%2CASKDARE_GREETING&envDefaults=%7B%22ASKDARE_MODEL%22%3A%22gpt-6.1-terra%22%2C%22ASKDARE_INSTRUCTIONS%22%3A%22You%20are%20the%20assistant%20on%20our%20website.%20Answer%20briefly%20and%20politely.%20If%20you%20do%20not%20know%20something%2C%20say%20so.%22%2C%22ASKDARE_GREETING%22%3A%22Hi%21%20How%20can%20I%20help%3F%22%7D&envDescription=OPENAI_API_KEY%3A%20a%20key%20from%20a%20dedicated%20OpenAI%20project%20with%20a%20hard%20spend%20limit.%20CHAT_SECRET%3A%20at%20least%2032%20random%20characters%
|
|
9
|
+
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fboldare%2Faskdare%2Ftree%2Fmain%2Fexamples%2Fstarter&project-name=askdare-chat&repository-name=askdare-chat&env=OPENAI_API_KEY%2CCHAT_SECRET%2CASKDARE_MODEL%2CASKDARE_INSTRUCTIONS%2CASKDARE_GREETING&envDefaults=%7B%22ASKDARE_MODEL%22%3A%22gpt-6.1-terra%22%2C%22ASKDARE_INSTRUCTIONS%22%3A%22You%20are%20the%20assistant%20on%20our%20website.%20Answer%20briefly%20and%20politely.%20If%20you%20do%20not%20know%20something%2C%20say%20so.%22%2C%22ASKDARE_GREETING%22%3A%22Hi%21%20How%20can%20I%20help%3F%22%7D&envDescription=OPENAI_API_KEY%3A%20a%20key%20from%20a%20dedicated%20OpenAI%20project%20with%20a%20hard%20spend%20limit.%20CHAT_SECRET%3A%20at%20least%2032%20random%20characters%3B%20askdare.vercel.app%2Fdeploy%20makes%20one%20for%20you.%20ASKDARE_MODEL%3A%20a%20current%20OpenAI%20model%20your%20project%20may%20use.%20ASKDARE_INSTRUCTIONS%3A%20what%20the%20bot%20does%20and%20how%20it%20answers.%20ASKDARE_GREETING%3A%20the%20first%20message%20in%20the%20chat.&envLink=https%3A%2F%2Faskdare.vercel.app%2Fdeploy)
|
|
10
10
|
|
|
11
11
|
[Deployment](deployment.md#one-click-deploy) covers what to fill in, Heroku, and how to check the live app with `doctor`.
|
|
12
12
|
|
package/package.json
CHANGED