@bootstrapware/answers 0.1.0 → 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/AGENTS.md +28 -14
- package/CHANGELOG.md +11 -0
- package/README.md +22 -0
- package/dist/answers.iife.js +1 -1
- package/dist/answers.iife.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +283 -0
- package/dist/server.js +1042 -0
- package/dist/server.js.map +1 -0
- package/package.json +6 -2
package/AGENTS.md
CHANGED
|
@@ -55,7 +55,7 @@ Try these questions, in order, on one session:
|
|
|
55
55
|
4. `get_answers_install_snippet`. `appId` is real. Use `process.env.NEXT_PUBLIC_BSW_ANSWERS_PUBLISHABLE_KEY`. Never invent a key and never put a secret in the snippet.
|
|
56
56
|
5. Keep the adapter in the snippet. It posts to `POST /api/v1/ask?appId=`. Omitting `adapter` does not call that route.
|
|
57
57
|
6. `add_answers_url_source` for each dedicated public page whose body already states the fact (`/pricing`, hours, returns). Do not stop at the homepage.
|
|
58
|
-
7. After the index job succeeds, tell the human to
|
|
58
|
+
7. After the index job succeeds, tell the human to ask through the widget with a test key: a product question, a follow-up that names no product, and a question the pages do not answer. The dashboard retrieval check shows which passages a question finds.
|
|
59
59
|
|
|
60
60
|
`create_answers_app` returns these `nextSteps`, in order:
|
|
61
61
|
|
|
@@ -64,14 +64,14 @@ Try these questions, in order, on one session:
|
|
|
64
64
|
3. Call `ensure_answers_test_publishable` to get or create a test publishable key.
|
|
65
65
|
4. Call `get_answers_install_snippet`. The React package does not call Hosted ask unless you pass an adapter.
|
|
66
66
|
5. Call `add_answers_url_source` with a dedicated public page whose body already states the fact. A homepage of product blurbs is a weak first source.
|
|
67
|
-
6. After the index job succeeds,
|
|
67
|
+
6. After the index job succeeds, ask through the widget with a test key: a product question, a follow-up that names no product, and a question the pages do not answer. The dashboard retrieval check shows which passages a question finds.
|
|
68
68
|
|
|
69
69
|
`publish_answers_app` returns:
|
|
70
70
|
|
|
71
71
|
1. Call `ensure_answers_test_publishable` to get or create a test publishable key.
|
|
72
72
|
2. Call `get_answers_install_snippet` and point the adapter at `POST /api/v1/ask`.
|
|
73
73
|
3. Call `add_answers_url_source` with a dedicated public page whose body already states the fact. A homepage of product blurbs is a weak first source.
|
|
74
|
-
4. After the index job succeeds,
|
|
74
|
+
4. After the index job succeeds, ask through the widget with a test key: a product question, a follow-up that names no product, and a question the pages do not answer. The dashboard retrieval check shows which passages a question finds.
|
|
75
75
|
|
|
76
76
|
```tsx
|
|
77
77
|
import { Answers, createByoAdapter } from "@bootstrapware/answers";
|
|
@@ -129,7 +129,21 @@ Same MCP app config as Path B. Implement `AnswersAdapter` on the customer backen
|
|
|
129
129
|
/>
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
The
|
|
132
|
+
The fastest BYO backend is the engine in this package: `createAnswersBackend` from `@bootstrapware/answers/server` (Node 18+). It indexes your sitemap, URLs, or documents, plus custom Q&A, and its `handler(request)` speaks the same JSON contract as the widget adapter. `OPENAI_API_KEY` stays in server env.
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
import { createAnswersBackend } from "@bootstrapware/answers/server";
|
|
136
|
+
|
|
137
|
+
const answers = createAnswersBackend({
|
|
138
|
+
siteName: "Acme",
|
|
139
|
+
openaiApiKey: process.env.OPENAI_API_KEY,
|
|
140
|
+
sitemap: "https://acme.com/sitemap.xml",
|
|
141
|
+
qa: [{ question: "Do you offer refunds?", answer: "Yes, within 14 days of purchase." }],
|
|
142
|
+
});
|
|
143
|
+
export const POST = (request: Request) => answers.handler(request);
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The full reference app is `examples/answers-nextjs` (markdown knowledge on disk, a JSON visitor log).
|
|
133
147
|
|
|
134
148
|
Citations must be ids you retrieved. The widget links a URL only when that URL is on the returned citation. Other URLs stay text. HTML in the answer stays text.
|
|
135
149
|
|
|
@@ -178,6 +192,7 @@ Draft defaults: `assistantLabel` "Ask", `greeting` "Ask a question this site alr
|
|
|
178
192
|
- `defaultOpen`: modal, window, and launcher start closed unless this is set.
|
|
179
193
|
- `theme`: `light` or `dark`. Omit it and the shell stays the light cream default: no `data-theme`, and no `prefers-color-scheme`.
|
|
180
194
|
- `pageContext`: `{ url, title }`. Omit it and the widget sends `location.href` and `document.title`.
|
|
195
|
+
- `greeting`: empty-state copy. Omit it and the widget shows "Ask a question this site already answers."
|
|
181
196
|
- `onFallback`: called with the sanitized unanswered result.
|
|
182
197
|
- `className`: layout only.
|
|
183
198
|
|
|
@@ -207,26 +222,25 @@ Questions are limited to 1,000 Unicode code points. A longer draft stays in the
|
|
|
207
222
|
|
|
208
223
|
## Publish pages that can be quoted
|
|
209
224
|
|
|
210
|
-
Hosted
|
|
225
|
+
Hosted indexes the main body of each page, split by headings; navigation, headers, footers, and cookie banners are dropped. The model writes a short answer from the best-matching passages and must cite them. It does not use outside knowledge. `list_answers_capabilities` returns `sourceAdvice` with the same rules.
|
|
211
226
|
|
|
212
|
-
1.
|
|
213
|
-
2.
|
|
214
|
-
3.
|
|
215
|
-
4.
|
|
216
|
-
5.
|
|
217
|
-
6. Unanswered is the correct outcome when the pages do not have the fact. Add a URL or a dashboard manual FAQ. Do not send the question through MCP.
|
|
227
|
+
1. Make sure the fact is stated in a page body, not only implied by a homepage card. A pricing page, a support page, and one page per product work well.
|
|
228
|
+
2. Keep each figure next to what it prices (`Hosted is $19.99/month`). An answer whose price or number is not in a cited passage is rejected.
|
|
229
|
+
3. After `add_answers_url_source`, wait for the index job, then use the dashboard retrieval check to see which passages a question finds. Ask through the widget with a test key to see the written answer.
|
|
230
|
+
4. For facts you want stated exactly (prices, refund policy, support contact), add a custom Q&A in the dashboard. Custom Q&A ranks ahead of page text.
|
|
231
|
+
5. Unanswered is the correct outcome when the pages do not have the fact. Add a URL or a custom Q&A. Do not send the question through MCP.
|
|
218
232
|
|
|
219
233
|
## Knowledge, grounding, and provider
|
|
220
234
|
|
|
221
|
-
Hosted knowledge kinds are website root, sitemap, single public URL, PDF, DOCX, TXT, Markdown, and
|
|
235
|
+
Hosted knowledge kinds are website root, sitemap, single public URL, PDF, DOCX, TXT, Markdown, and custom Q&A (a question and its answer). MCP can add a public URL and reindex it. Files, custom Q&A, conversations, and unanswered question text stay on the dashboard.
|
|
222
236
|
|
|
223
237
|
Every Hosted source is visitor-readable. Do not upload private runbooks or secrets. Crawl is public `http` and `https` only. Private hosts are rejected. `robots.txt` is honored. A failed crawl leaves the last good index in place. A page that is only navigation chrome is rejected and does not become a citation.
|
|
224
238
|
|
|
225
|
-
|
|
239
|
+
Retrieval combines keyword and embedding search over the active index (custom Q&A first when it matches). The model answers in 1 to 4 sentences in the visitor's language, citing passages it was given; citations are ids from the retrieved index, and the model does not invent URLs. A draft that cites an unretrieved passage, states a figure no cited passage contains, or writes code not quoted from a passage is retried once and then returns `unanswered` with the configured fallback. Off-topic questions and prompt-injection attempts are declined before retrieval. There is no model-memory fallback. Follow-ups use the last three turns of the session.
|
|
226
240
|
|
|
227
241
|
Unanswered observations store normalized question text even when conversation history is off, so the dashboard can group them. MCP does not return that text.
|
|
228
242
|
|
|
229
|
-
Hosted AI is managed OpenAI, or one Hosted BYOK OpenAI key. The secret route is `GET`, `PUT`, and `DELETE /api/v1/apps/:id/provider` with a secret key. `PUT` accepts only `{ "apiKey" }` and returns the key once. Later reads return a hint. MCP, the browser package, logs, and publishable config do not receive the key. Anthropic and Gemini are not in this version.
|
|
243
|
+
Hosted AI is managed OpenAI (a low-cost chat model plus `text-embedding-3-small`), or one Hosted BYOK OpenAI key. The secret route is `GET`, `PUT`, and `DELETE /api/v1/apps/:id/provider` with a secret key. `PUT` accepts only `{ "apiKey" }` and returns the key once. Later reads return a hint. MCP, the browser package, logs, and publishable config do not receive the key. Anthropic and Gemini are not in this version.
|
|
230
244
|
|
|
231
245
|
## Pricing and retention
|
|
232
246
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
- New server entry `@bootstrapware/answers/server` (Node 18+). Browser entry and widget props are unchanged.
|
|
6
|
+
- `createAnswersBackend({ siteName, openaiApiKey, urls | sitemap | documents, qa })` builds an in-memory index and returns `ask`, `feedback`, `refresh`, and a `handler(request)` that speaks the widget's `/ask` JSON contract. Pair it with `createByoAdapter` in the browser.
|
|
7
|
+
- Pages are split into heading-scoped sections; navigation, headers, footers, cookie banners, and scripts are dropped. Cloudflare-protected emails are decoded.
|
|
8
|
+
- Retrieval fuses keyword (BM25) and embedding (`text-embedding-3-small`) rankings. Custom Q&A (`qa`) ranks ahead of page text when both match.
|
|
9
|
+
- Answers are written by the model from the retrieved passages only (default `gpt-6-luna` at low reasoning effort, falling back to `gpt-4.1-mini`). A draft is rejected when it cites a passage that was not retrieved, states a price or number that no cited passage contains, or writes code that is not quoted from a passage; one retry, then the fallback.
|
|
10
|
+
- Off-topic questions, prompt-injection attempts, and greetings are declined before retrieval. Follow-ups use the last three turns of the session.
|
|
11
|
+
- Lower-level pieces are exported for custom stacks: `extractPage`, `chunkPage`, `MemoryIndex`, `answerQuestion`, `createOpenAiClient`, `reciprocalRankFusion`. Pass `retrieve` to use your own vector store.
|
|
12
|
+
- Document and Q&A inputs accept an optional `id` that becomes the citation id.
|
|
13
|
+
|
|
3
14
|
## 0.1.0
|
|
4
15
|
|
|
5
16
|
- `<Answers>` with `appId`, `publishableKey`, `adapter`, `presentation`, `defaultOpen`, `theme`, `pageContext`, and `onFallback`.
|
package/README.md
CHANGED
|
@@ -41,6 +41,28 @@ The hosted script is `GET https://answers.bootstrapware.co/embed/v1.js`.
|
|
|
41
41
|
|
|
42
42
|
## BYO
|
|
43
43
|
|
|
44
|
+
Run the engine on your server with your OpenAI key. Questions, knowledge, and the key stay on your infrastructure.
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
// app/api/answers/route.ts (Next.js) — any runtime with fetch works
|
|
48
|
+
import { createAnswersBackend } from "@bootstrapware/answers/server";
|
|
49
|
+
|
|
50
|
+
const answers = createAnswersBackend({
|
|
51
|
+
siteName: "Acme",
|
|
52
|
+
openaiApiKey: process.env.OPENAI_API_KEY, // server env only
|
|
53
|
+
sitemap: "https://acme.com/sitemap.xml", // or urls: [...], or documents: [{ id, title, url, text }]
|
|
54
|
+
qa: [{ question: "Do you offer refunds?", answer: "Yes, within 14 days of purchase." }],
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export const POST = (request: Request) => answers.handler(request);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The index is built on the first question and kept in memory. Call `answers.refresh()` after your content changes, or save `answers.index.toJSON()` and pass it back as `snapshot` to skip re-embedding on restart. Pass `retrieve` to use your own vector store instead.
|
|
61
|
+
|
|
62
|
+
Answers come only from the indexed passages. A draft that cites something it did not retrieve, or states a price or number no cited passage contains, is rejected and the visitor gets the fallback. Custom Q&A ranks ahead of page text.
|
|
63
|
+
|
|
64
|
+
Then point the widget at that route:
|
|
65
|
+
|
|
44
66
|
```tsx
|
|
45
67
|
<Answers
|
|
46
68
|
appId="ana_..."
|
package/dist/answers.iife.js
CHANGED
|
@@ -9,7 +9,7 @@ Error generating stack: `+a.message+`
|
|
|
9
9
|
`).replace(ih,"")}function i0(l,t){return t=To(t),To(l)===t}function Kn(){}function C(l,t,a,e,u,n){switch(a){case"children":typeof e=="string"?t==="body"||t==="textarea"&&e===""||Fa(l,e):(typeof e=="number"||typeof e=="bigint")&&t!=="body"&&Fa(l,""+e);break;case"className":Du(l,"class",e);break;case"tabIndex":Du(l,"tabindex",e);break;case"dir":case"role":case"viewBox":case"width":case"height":Du(l,a,e);break;case"style":ir(l,e,n);break;case"data":if(t!=="object"){Du(l,"data",e);break}case"src":case"href":if(e===""&&(t!=="a"||a!=="href")){l.removeAttribute(a);break}if(e==null||typeof e=="function"||typeof e=="symbol"||typeof e=="boolean"){l.removeAttribute(a);break}e=Lu(""+e),l.setAttribute(a,e);break;case"action":case"formAction":if(typeof e=="function"){l.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof n=="function"&&(a==="formAction"?(t!=="input"&&C(l,t,"name",u.name,u,null),C(l,t,"formEncType",u.formEncType,u,null),C(l,t,"formMethod",u.formMethod,u,null),C(l,t,"formTarget",u.formTarget,u,null)):(C(l,t,"encType",u.encType,u,null),C(l,t,"method",u.method,u,null),C(l,t,"target",u.target,u,null)));if(e==null||typeof e=="symbol"||typeof e=="boolean"){l.removeAttribute(a);break}e=Lu(""+e),l.setAttribute(a,e);break;case"onClick":e!=null&&(l.onclick=Kn);break;case"onScroll":e!=null&&x("scroll",l);break;case"onScrollEnd":e!=null&&x("scrollend",l);break;case"dangerouslySetInnerHTML":if(e!=null){if(typeof e!="object"||!("__html"in e))throw Error(g(61));if(a=e.__html,a!=null){if(u.children!=null)throw Error(g(60));l.innerHTML=a}}break;case"multiple":l.multiple=e&&typeof e!="function"&&typeof e!="symbol";break;case"muted":l.muted=e&&typeof e!="function"&&typeof e!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(e==null||typeof e=="function"||typeof e=="boolean"||typeof e=="symbol"){l.removeAttribute("xlink:href");break}a=Lu(""+e),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":e!=null&&typeof e!="function"&&typeof e!="symbol"?l.setAttribute(a,""+e):l.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":e&&typeof e!="function"&&typeof e!="symbol"?l.setAttribute(a,""):l.removeAttribute(a);break;case"capture":case"download":e===!0?l.setAttribute(a,""):e!==!1&&e!=null&&typeof e!="function"&&typeof e!="symbol"?l.setAttribute(a,e):l.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":e!=null&&typeof e!="function"&&typeof e!="symbol"&&!isNaN(e)&&1<=e?l.setAttribute(a,e):l.removeAttribute(a);break;case"rowSpan":case"start":e==null||typeof e=="function"||typeof e=="symbol"||isNaN(e)?l.removeAttribute(a):l.setAttribute(a,e);break;case"popover":x("beforetoggle",l),x("toggle",l),ju(l,"popover",e);break;case"xlinkActuate":ct(l,"http://www.w3.org/1999/xlink","xlink:actuate",e);break;case"xlinkArcrole":ct(l,"http://www.w3.org/1999/xlink","xlink:arcrole",e);break;case"xlinkRole":ct(l,"http://www.w3.org/1999/xlink","xlink:role",e);break;case"xlinkShow":ct(l,"http://www.w3.org/1999/xlink","xlink:show",e);break;case"xlinkTitle":ct(l,"http://www.w3.org/1999/xlink","xlink:title",e);break;case"xlinkType":ct(l,"http://www.w3.org/1999/xlink","xlink:type",e);break;case"xmlBase":ct(l,"http://www.w3.org/XML/1998/namespace","xml:base",e);break;case"xmlLang":ct(l,"http://www.w3.org/XML/1998/namespace","xml:lang",e);break;case"xmlSpace":ct(l,"http://www.w3.org/XML/1998/namespace","xml:space",e);break;case"is":ju(l,"is",e);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Gm.get(a)||a,ju(l,a,e))}}function xc(l,t,a,e,u,n){switch(a){case"style":ir(l,e,n);break;case"dangerouslySetInnerHTML":if(e!=null){if(typeof e!="object"||!("__html"in e))throw Error(g(61));if(a=e.__html,a!=null){if(u.children!=null)throw Error(g(60));l.innerHTML=a}}break;case"children":typeof e=="string"?Fa(l,e):(typeof e=="number"||typeof e=="bigint")&&Fa(l,""+e);break;case"onScroll":e!=null&&x("scroll",l);break;case"onScrollEnd":e!=null&&x("scrollend",l);break;case"onClick":e!=null&&(l.onclick=Kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!lr.hasOwnProperty(a))l:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),t=a.slice(2,u?a.length-7:void 0),n=l[El]||null,n=n!=null?n[a]:null,typeof n=="function"&&l.removeEventListener(t,n,u),typeof e=="function")){typeof n!="function"&&n!==null&&(a in l?l[a]=null:l.hasAttribute(a)&&l.removeAttribute(a)),l.addEventListener(t,e,u);break l}a in l?l[a]=e:e===!0?l.setAttribute(a,""):ju(l,a,e)}}}function dl(l,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":x("error",l),x("load",l);var e=!1,u=!1,n;for(n in a)if(a.hasOwnProperty(n)){var i=a[n];if(i!=null)switch(n){case"src":e=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(g(137,t));default:C(l,t,n,i,a,null)}}u&&C(l,t,"srcSet",a.srcSet,a,null),e&&C(l,t,"src",a.src,a,null);return;case"input":x("invalid",l);var c=n=i=u=null,f=null,o=null;for(e in a)if(a.hasOwnProperty(e)){var y=a[e];if(y!=null)switch(e){case"name":u=y;break;case"type":i=y;break;case"checked":f=y;break;case"defaultChecked":o=y;break;case"value":n=y;break;case"defaultValue":c=y;break;case"children":case"dangerouslySetInnerHTML":if(y!=null)throw Error(g(137,t));break;default:C(l,t,e,y,a,null)}}er(l,n,c,f,o,i,u,!1),cn(l);return;case"select":x("invalid",l),e=i=n=null;for(u in a)if(a.hasOwnProperty(u)&&(c=a[u],c!=null))switch(u){case"value":n=c;break;case"defaultValue":i=c;break;case"multiple":e=c;default:C(l,t,u,c,a,null)}t=n,a=i,l.multiple=!!e,t!=null?Za(l,!!e,t,!1):a!=null&&Za(l,!!e,a,!0);return;case"textarea":x("invalid",l),n=u=e=null;for(i in a)if(a.hasOwnProperty(i)&&(c=a[i],c!=null))switch(i){case"value":e=c;break;case"defaultValue":u=c;break;case"children":n=c;break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(g(91));break;default:C(l,t,i,c,a,null)}nr(l,e,u,n),cn(l);return;case"option":for(f in a)a.hasOwnProperty(f)&&(e=a[f],e!=null)&&(f==="selected"?l.selected=e&&typeof e!="function"&&typeof e!="symbol":C(l,t,f,e,a,null));return;case"dialog":x("beforetoggle",l),x("toggle",l),x("cancel",l),x("close",l);break;case"iframe":case"object":x("load",l);break;case"video":case"audio":for(e=0;e<$e.length;e++)x($e[e],l);break;case"image":x("error",l),x("load",l);break;case"details":x("toggle",l);break;case"embed":case"source":case"link":x("error",l),x("load",l);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(o in a)if(a.hasOwnProperty(o)&&(e=a[o],e!=null))switch(o){case"children":case"dangerouslySetInnerHTML":throw Error(g(137,t));default:C(l,t,o,e,a,null)}return;default:if(Kc(t)){for(y in a)a.hasOwnProperty(y)&&(e=a[y],e!==void 0&&xc(l,t,y,e,a,void 0));return}}for(c in a)a.hasOwnProperty(c)&&(e=a[c],e!=null&&C(l,t,c,e,a,null))}function ch(l,t,a,e){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,n=null,i=null,c=null,f=null,o=null,y=null;for(h in a){var v=a[h];if(a.hasOwnProperty(h)&&v!=null)switch(h){case"checked":break;case"value":break;case"defaultValue":f=v;default:e.hasOwnProperty(h)||C(l,t,h,null,e,v)}}for(var m in e){var h=e[m];if(v=a[m],e.hasOwnProperty(m)&&(h!=null||v!=null))switch(m){case"type":n=h;break;case"name":u=h;break;case"checked":o=h;break;case"defaultChecked":y=h;break;case"value":i=h;break;case"defaultValue":c=h;break;case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(g(137,t));break;default:h!==v&&C(l,t,m,h,e,v)}}lc(l,i,c,f,o,y,n,u);return;case"select":h=i=c=m=null;for(n in a)if(f=a[n],a.hasOwnProperty(n)&&f!=null)switch(n){case"value":break;case"multiple":h=f;default:e.hasOwnProperty(n)||C(l,t,n,null,e,f)}for(u in e)if(n=e[u],f=a[u],e.hasOwnProperty(u)&&(n!=null||f!=null))switch(u){case"value":m=n;break;case"defaultValue":c=n;break;case"multiple":i=n;default:n!==f&&C(l,t,u,n,e,f)}t=c,a=i,e=h,m!=null?Za(l,!!a,m,!1):!!e!=!!a&&(t!=null?Za(l,!!a,t,!0):Za(l,!!a,a?[]:"",!1));return;case"textarea":h=m=null;for(c in a)if(u=a[c],a.hasOwnProperty(c)&&u!=null&&!e.hasOwnProperty(c))switch(c){case"value":break;case"children":break;default:C(l,t,c,null,e,u)}for(i in e)if(u=e[i],n=a[i],e.hasOwnProperty(i)&&(u!=null||n!=null))switch(i){case"value":m=u;break;case"defaultValue":h=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(g(91));break;default:u!==n&&C(l,t,i,u,e,n)}ur(l,m,h);return;case"option":for(var A in a)m=a[A],a.hasOwnProperty(A)&&m!=null&&!e.hasOwnProperty(A)&&(A==="selected"?l.selected=!1:C(l,t,A,null,e,m));for(f in e)m=e[f],h=a[f],e.hasOwnProperty(f)&&m!==h&&(m!=null||h!=null)&&(f==="selected"?l.selected=m&&typeof m!="function"&&typeof m!="symbol":C(l,t,f,m,e,h));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _ in a)m=a[_],a.hasOwnProperty(_)&&m!=null&&!e.hasOwnProperty(_)&&C(l,t,_,null,e,m);for(o in e)if(m=e[o],h=a[o],e.hasOwnProperty(o)&&m!==h&&(m!=null||h!=null))switch(o){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(g(137,t));break;default:C(l,t,o,m,e,h)}return;default:if(Kc(t)){for(var H in a)m=a[H],a.hasOwnProperty(H)&&m!==void 0&&!e.hasOwnProperty(H)&&xc(l,t,H,void 0,e,m);for(y in e)m=e[y],h=a[y],!e.hasOwnProperty(y)||m===h||m===void 0&&h===void 0||xc(l,t,y,m,e,h);return}}for(var r in a)m=a[r],a.hasOwnProperty(r)&&m!=null&&!e.hasOwnProperty(r)&&C(l,t,r,null,e,m);for(v in e)m=e[v],h=a[v],!e.hasOwnProperty(v)||m===h||m==null&&h==null||C(l,t,v,m,e,h)}var Nc=null,Rc=null;function On(l){return l.nodeType===9?l:l.ownerDocument}function wo(l){switch(l){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function c0(l,t){if(l===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return l===1&&t==="foreignObject"?0:l}function Uc(l,t){return l==="textarea"||l==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Li=null;function fh(){var l=window.event;return l&&l.type==="popstate"?l===Li?!1:(Li=l,!0):(Li=null,!1)}var f0=typeof setTimeout=="function"?setTimeout:void 0,sh=typeof clearTimeout=="function"?clearTimeout:void 0,zo=typeof Promise=="function"?Promise:void 0,oh=typeof queueMicrotask=="function"?queueMicrotask:typeof zo<"u"?function(l){return zo.resolve(null).then(l).catch(rh)}:f0;function rh(l){setTimeout(function(){throw l})}function It(l){return l==="head"}function Oo(l,t){var a=t,e=0,u=0;do{var n=a.nextSibling;if(l.removeChild(a),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(0<e&&8>e){a=e;var i=l.ownerDocument;if(a&1&&Ze(i.documentElement),a&2&&Ze(i.body),a&4)for(a=i.head,Ze(a),i=a.firstChild;i;){var c=i.nextSibling,f=i.nodeName;i[cu]||f==="SCRIPT"||f==="STYLE"||f==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=c}}if(u===0){l.removeChild(n),au(t);return}u--}else a==="$"||a==="$?"||a==="$!"?u++:e=a.charCodeAt(0)-48;else e=0;a=n}while(a);au(t)}function Hc(l){var t=l.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Hc(a),Vc(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}l.removeChild(a)}}function dh(l,t,a,e){for(;l.nodeType===1;){var u=a;if(l.nodeName.toLowerCase()!==t.toLowerCase()){if(!e&&(l.nodeName!=="INPUT"||l.type!=="hidden"))break}else if(e){if(!l[cu])switch(t){case"meta":if(!l.hasAttribute("itemprop"))break;return l;case"link":if(n=l.getAttribute("rel"),n==="stylesheet"&&l.hasAttribute("data-precedence"))break;if(n!==u.rel||l.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||l.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||l.getAttribute("title")!==(u.title==null?null:u.title))break;return l;case"style":if(l.hasAttribute("data-precedence"))break;return l;case"script":if(n=l.getAttribute("src"),(n!==(u.src==null?null:u.src)||l.getAttribute("type")!==(u.type==null?null:u.type)||l.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&n&&l.hasAttribute("async")&&!l.hasAttribute("itemprop"))break;return l;default:return l}}else if(t==="input"&&l.type==="hidden"){var n=u.name==null?null:""+u.name;if(u.type==="hidden"&&l.getAttribute("name")===n)return l}else return l;if(l=kl(l.nextSibling),l===null)break}return null}function mh(l,t,a){if(t==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!a||(l=kl(l.nextSibling),l===null))return null;return l}function qc(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState==="complete"}function hh(l,t){var a=l.ownerDocument;if(l.data!=="$?"||a.readyState==="complete")t();else{var e=function(){t(),a.removeEventListener("DOMContentLoaded",e)};a.addEventListener("DOMContentLoaded",e),l._reactRetry=e}}function kl(l){for(;l!=null;l=l.nextSibling){var t=l.nodeType;if(t===1||t===3)break;if(t===8){if(t=l.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return l}var Yc=null;function Mo(l){l=l.previousSibling;for(var t=0;l;){if(l.nodeType===8){var a=l.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return l;t--}else a==="/$"&&t++}l=l.previousSibling}return null}function s0(l,t,a){switch(t=On(a),l){case"html":if(l=t.documentElement,!l)throw Error(g(452));return l;case"head":if(l=t.head,!l)throw Error(g(453));return l;case"body":if(l=t.body,!l)throw Error(g(454));return l;default:throw Error(g(451))}}function Ze(l){for(var t=l.attributes;t.length;)l.removeAttributeNode(t[0]);Vc(l)}var jl=new Map,Do=new Set;function Mn(l){return typeof l.getRootNode=="function"?l.getRootNode():l.nodeType===9?l:l.ownerDocument}var At=Y.d;Y.d={f:yh,r:vh,D:bh,C:gh,L:ph,m:Sh,X:Ah,S:_h,M:Eh};function yh(){var l=At.f(),t=jn();return l||t}function vh(l){var t=ce(l);t!==null&&t.tag===5&&t.type==="form"?ad(t):At.r(l)}var oe=typeof document>"u"?null:document;function o0(l,t,a){var e=oe;if(e&&typeof t=="string"&&t){var u=Cl(t);u='link[rel="'+l+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),Do.has(u)||(Do.add(u),l={rel:l,crossOrigin:a,href:t},e.querySelector(u)===null&&(t=e.createElement("link"),dl(t,"link",l),cl(t),e.head.appendChild(t)))}}function bh(l){At.D(l),o0("dns-prefetch",l,null)}function gh(l,t){At.C(l,t),o0("preconnect",l,t)}function ph(l,t,a){At.L(l,t,a);var e=oe;if(e&&l&&t){var u='link[rel="preload"][as="'+Cl(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+Cl(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+Cl(a.imageSizes)+'"]')):u+='[href="'+Cl(l)+'"]';var n=u;switch(t){case"style":n=ne(l);break;case"script":n=re(l)}jl.has(n)||(l=j({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:l,as:t},a),jl.set(n,l),e.querySelector(u)!==null||t==="style"&&e.querySelector(bu(n))||t==="script"&&e.querySelector(gu(n))||(t=e.createElement("link"),dl(t,"link",l),cl(t),e.head.appendChild(t)))}}function Sh(l,t){At.m(l,t);var a=oe;if(a&&l){var e=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Cl(e)+'"][href="'+Cl(l)+'"]',n=u;switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=re(l)}if(!jl.has(n)&&(l=j({rel:"modulepreload",href:l},t),jl.set(n,l),a.querySelector(u)===null)){switch(e){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(gu(n)))return}e=a.createElement("link"),dl(e,"link",l),cl(e),a.head.appendChild(e)}}}function _h(l,t,a){At.S(l,t,a);var e=oe;if(e&&l){var u=Qa(e).hoistableStyles,n=ne(l);t=t||"default";var i=u.get(n);if(!i){var c={loading:0,preload:null};if(i=e.querySelector(bu(n)))c.loading=5;else{l=j({rel:"stylesheet",href:l,"data-precedence":t},a),(a=jl.get(n))&&Df(l,a);var f=i=e.createElement("link");cl(f),dl(f,"link",l),f._p=new Promise(function(o,y){f.onload=o,f.onerror=y}),f.addEventListener("load",function(){c.loading|=1}),f.addEventListener("error",function(){c.loading|=2}),c.loading|=4,Pu(i,t,e)}i={type:"stylesheet",instance:i,count:1,state:c},u.set(n,i)}}}function Ah(l,t){At.X(l,t);var a=oe;if(a&&l){var e=Qa(a).hoistableScripts,u=re(l),n=e.get(u);n||(n=a.querySelector(gu(u)),n||(l=j({src:l,async:!0},t),(t=jl.get(u))&&xf(l,t),n=a.createElement("script"),cl(n),dl(n,"link",l),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},e.set(u,n))}}function Eh(l,t){At.M(l,t);var a=oe;if(a&&l){var e=Qa(a).hoistableScripts,u=re(l),n=e.get(u);n||(n=a.querySelector(gu(u)),n||(l=j({src:l,async:!0,type:"module"},t),(t=jl.get(u))&&xf(l,t),n=a.createElement("script"),cl(n),dl(n,"link",l),a.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},e.set(u,n))}}function xo(l,t,a,e){var u=(u=Xt.current)?Mn(u):null;if(!u)throw Error(g(446));switch(l){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=ne(a.href),a=Qa(u).hoistableStyles,e=a.get(t),e||(e={type:"style",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){l=ne(a.href);var n=Qa(u).hoistableStyles,i=n.get(l);if(i||(u=u.ownerDocument||u,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(l,i),(n=u.querySelector(bu(l)))&&!n._p&&(i.instance=n,i.state.loading=5),jl.has(l)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},jl.set(l,a),n||Th(u,l,a,i.state))),t&&e===null)throw Error(g(528,""));return i}if(t&&e!==null)throw Error(g(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=re(a),a=Qa(u).hoistableScripts,e=a.get(t),e||(e={type:"script",instance:null,count:0,state:null},a.set(t,e)),e):{type:"void",instance:null,count:0,state:null};default:throw Error(g(444,l))}}function ne(l){return'href="'+Cl(l)+'"'}function bu(l){return'link[rel="stylesheet"]['+l+"]"}function r0(l){return j({},l,{"data-precedence":l.precedence,precedence:null})}function Th(l,t,a,e){l.querySelector('link[rel="preload"][as="style"]['+t+"]")?e.loading=1:(t=l.createElement("link"),e.preload=t,t.addEventListener("load",function(){return e.loading|=1}),t.addEventListener("error",function(){return e.loading|=2}),dl(t,"link",a),cl(t),l.head.appendChild(t))}function re(l){return'[src="'+Cl(l)+'"]'}function gu(l){return"script[async]"+l}function No(l,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var e=l.querySelector('style[data-href~="'+Cl(a.href)+'"]');if(e)return t.instance=e,cl(e),e;var u=j({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return e=(l.ownerDocument||l).createElement("style"),cl(e),dl(e,"style",u),Pu(e,a.precedence,l),t.instance=e;case"stylesheet":u=ne(a.href);var n=l.querySelector(bu(u));if(n)return t.state.loading|=4,t.instance=n,cl(n),n;e=r0(a),(u=jl.get(u))&&Df(e,u),n=(l.ownerDocument||l).createElement("link"),cl(n);var i=n;return i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),dl(n,"link",e),t.state.loading|=4,Pu(n,a.precedence,l),t.instance=n;case"script":return n=re(a.src),(u=l.querySelector(gu(n)))?(t.instance=u,cl(u),u):(e=a,(u=jl.get(n))&&(e=j({},a),xf(e,u)),l=l.ownerDocument||l,u=l.createElement("script"),cl(u),dl(u,"link",e),l.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(g(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(e=t.instance,t.state.loading|=4,Pu(e,a.precedence,l));return t.instance}function Pu(l,t,a){for(var e=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=e.length?e[e.length-1]:null,n=u,i=0;i<e.length;i++){var c=e[i];if(c.dataset.precedence===t)n=c;else if(n!==u)break}n?n.parentNode.insertBefore(l,n.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(l,t.firstChild))}function Df(l,t){l.crossOrigin==null&&(l.crossOrigin=t.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=t.referrerPolicy),l.title==null&&(l.title=t.title)}function xf(l,t){l.crossOrigin==null&&(l.crossOrigin=t.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=t.referrerPolicy),l.integrity==null&&(l.integrity=t.integrity)}var ln=null;function Ro(l,t,a){if(ln===null){var e=new Map,u=ln=new Map;u.set(a,e)}else u=ln,e=u.get(a),e||(e=new Map,u.set(a,e));if(e.has(l))return e;for(e.set(l,null),a=a.getElementsByTagName(l),u=0;u<a.length;u++){var n=a[u];if(!(n[cu]||n[yl]||l==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var i=n.getAttribute(t)||"";i=l+i;var c=e.get(i);c?c.push(n):e.set(i,[n])}}return e}function Uo(l,t,a){l=l.ownerDocument||l,l.head.insertBefore(a,t==="title"?l.querySelector("head > title"):null)}function wh(l,t,a){if(a===1||t.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(l=t.disabled,typeof t.precedence=="string"&&l==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function d0(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}var Ie=null;function zh(){}function Oh(l,t,a){if(Ie===null)throw Error(g(475));var e=Ie;if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(t.state.loading&4)===0){if(t.instance===null){var u=ne(a.href),n=l.querySelector(bu(u));if(n){l=n._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(e.count++,e=Dn.bind(e),l.then(e,e)),t.state.loading|=4,t.instance=n,cl(n);return}n=l.ownerDocument||l,a=r0(a),(u=jl.get(u))&&Df(a,u),n=n.createElement("link"),cl(n);var i=n;i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),dl(n,"link",a),t.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(t,l),(l=t.state.preload)&&(t.state.loading&3)===0&&(e.count++,t=Dn.bind(e),l.addEventListener("load",t),l.addEventListener("error",t))}}function Mh(){if(Ie===null)throw Error(g(475));var l=Ie;return l.stylesheets&&l.count===0&&Bc(l,l.stylesheets),0<l.count?function(t){var a=setTimeout(function(){if(l.stylesheets&&Bc(l,l.stylesheets),l.unsuspend){var e=l.unsuspend;l.unsuspend=null,e()}},6e4);return l.unsuspend=t,function(){l.unsuspend=null,clearTimeout(a)}}:null}function Dn(){if(this.count--,this.count===0){if(this.stylesheets)Bc(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var xn=null;function Bc(l,t){l.stylesheets=null,l.unsuspend!==null&&(l.count++,xn=new Map,t.forEach(Dh,l),xn=null,Dn.call(l))}function Dh(l,t){if(!(t.state.loading&4)){var a=xn.get(l);if(a)var e=a.get(null);else{a=new Map,xn.set(l,a);for(var u=l.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<u.length;n++){var i=u[n];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(a.set(i.dataset.precedence,i),e=i)}e&&a.set(null,e)}u=t.instance,i=u.getAttribute("data-precedence"),n=a.get(i)||e,n===e&&a.set(null,u),a.set(i,u),this.count++,e=Dn.bind(this),u.addEventListener("load",e),u.addEventListener("error",e),n?n.parentNode.insertBefore(u,n.nextSibling):(l=l.nodeType===9?l.head:l,l.insertBefore(u,l.firstChild)),t.state.loading|=4}}var Pe={$$typeof:rt,Provider:null,Consumer:null,_currentValue:ua,_currentValue2:ua,_threadCount:0};function xh(l,t,a,e,u,n,i,c){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=yi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yi(0),this.hiddenUpdates=yi(null),this.identifierPrefix=e,this.onUncaughtError=u,this.onCaughtError=n,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function m0(l,t,a,e,u,n,i,c,f,o,y,v){return l=new xh(l,t,a,i,c,f,o,v),t=1,n===!0&&(t|=24),n=Ml(3,null,null,t),l.current=n,n.stateNode=l,t=ef(),t.refCount++,l.pooledCache=t,t.refCount++,n.memoizedState={element:e,isDehydrated:a,cache:t},nf(n),l}function h0(l){return l?(l=Ba,l):Ba}function y0(l,t,a,e,u,n){u=h0(u),e.context===null?e.context=u:e.pendingContext=u,e=Qt(t),e.payload={element:a},n=n===void 0?null:n,n!==null&&(e.callback=n),a=Zt(l,e,t),a!==null&&(Rl(a,l,t),He(a,l,t))}function Ho(l,t){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var a=l.retryLane;l.retryLane=a!==0&&a<t?a:t}}function Nf(l,t){Ho(l,t),(l=l.alternate)&&Ho(l,t)}function v0(l){if(l.tag===13){var t=fe(l,67108864);t!==null&&Rl(t,l,67108864),Nf(l,67108864)}}var Nn=!0;function Nh(l,t,a,e){var u=z.T;z.T=null;var n=Y.p;try{Y.p=2,Rf(l,t,a,e)}finally{Y.p=n,z.T=u}}function Rh(l,t,a,e){var u=z.T;z.T=null;var n=Y.p;try{Y.p=8,Rf(l,t,a,e)}finally{Y.p=n,z.T=u}}function Rf(l,t,a,e){if(Nn){var u=Gc(e);if(u===null)ji(l,t,e,Rn,a),qo(l,e);else if(Hh(u,l,t,a,e))e.stopPropagation();else if(qo(l,e),t&4&&-1<Uh.indexOf(l)){for(;u!==null;){var n=ce(u);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var i=ta(n.pendingLanes);if(i!==0){var c=n;for(c.pendingLanes|=2,c.entangledLanes|=2;i;){var f=1<<31-xl(i);c.entanglements[1]|=f,i&=~f}nt(n),(G&6)===0&&(An=at()+500,vu(0,!1))}}break;case 13:c=fe(n,2),c!==null&&Rl(c,n,2),jn(),Nf(n,2)}if(n=Gc(e),n===null&&ji(l,t,e,Rn,a),n===u)break;u=n}u!==null&&e.stopPropagation()}else ji(l,t,e,null,a)}}function Gc(l){return l=Jc(l),Uf(l)}var Rn=null;function Uf(l){if(Rn=null,l=Na(l),l!==null){var t=eu(l);if(t===null)l=null;else{var a=t.tag;if(a===13){if(l=Qo(t),l!==null)return l;l=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;l=null}else t!==l&&(l=null)}}return Rn=l,null}function b0(l){switch(l){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Sm()){case Vo:return 2;case Ko:return 8;case nn:case _m:return 32;case Jo:return 268435456;default:return 32}default:return 32}}var Cc=!1,Vt=null,Kt=null,Jt=null,lu=new Map,tu=new Map,qt=[],Uh="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function qo(l,t){switch(l){case"focusin":case"focusout":Vt=null;break;case"dragenter":case"dragleave":Kt=null;break;case"mouseover":case"mouseout":Jt=null;break;case"pointerover":case"pointerout":lu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":tu.delete(t.pointerId)}}function Ee(l,t,a,e,u,n){return l===null||l.nativeEvent!==n?(l={blockedOn:t,domEventName:a,eventSystemFlags:e,nativeEvent:n,targetContainers:[u]},t!==null&&(t=ce(t),t!==null&&v0(t)),l):(l.eventSystemFlags|=e,t=l.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),l)}function Hh(l,t,a,e,u){switch(t){case"focusin":return Vt=Ee(Vt,l,t,a,e,u),!0;case"dragenter":return Kt=Ee(Kt,l,t,a,e,u),!0;case"mouseover":return Jt=Ee(Jt,l,t,a,e,u),!0;case"pointerover":var n=u.pointerId;return lu.set(n,Ee(lu.get(n)||null,l,t,a,e,u)),!0;case"gotpointercapture":return n=u.pointerId,tu.set(n,Ee(tu.get(n)||null,l,t,a,e,u)),!0}return!1}function g0(l){var t=Na(l.target);if(t!==null){var a=eu(t);if(a!==null){if(t=a.tag,t===13){if(t=Qo(a),t!==null){l.blockedOn=t,Dm(l.priority,function(){if(a.tag===13){var e=Nl();e=jc(e);var u=fe(a,e);u!==null&&Rl(u,a,e),Nf(a,e)}});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){l.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}l.blockedOn=null}function tn(l){if(l.blockedOn!==null)return!1;for(var t=l.targetContainers;0<t.length;){var a=Gc(l.nativeEvent);if(a===null){a=l.nativeEvent;var e=new a.constructor(a.type,a);ac=e,a.target.dispatchEvent(e),ac=null}else return t=ce(a),t!==null&&v0(t),l.blockedOn=a,!1;t.shift()}return!0}function Yo(l,t,a){tn(l)&&a.delete(t)}function qh(){Cc=!1,Vt!==null&&tn(Vt)&&(Vt=null),Kt!==null&&tn(Kt)&&(Kt=null),Jt!==null&&tn(Jt)&&(Jt=null),lu.forEach(Yo),tu.forEach(Yo)}function Qu(l,t){l.blockedOn===t&&(l.blockedOn=null,Cc||(Cc=!0,nl.unstable_scheduleCallback(nl.unstable_NormalPriority,qh)))}var Zu=null;function Bo(l){Zu!==l&&(Zu=l,nl.unstable_scheduleCallback(nl.unstable_NormalPriority,function(){Zu===l&&(Zu=null);for(var t=0;t<l.length;t+=3){var a=l[t],e=l[t+1],u=l[t+2];if(typeof e!="function"){if(Uf(e||a)===null)continue;break}var n=ce(a);n!==null&&(l.splice(t,3),t-=3,gc(n,{pending:!0,data:u,method:a.method,action:e},e,u))}}))}function au(l){function t(f){return Qu(f,l)}Vt!==null&&Qu(Vt,l),Kt!==null&&Qu(Kt,l),Jt!==null&&Qu(Jt,l),lu.forEach(t),tu.forEach(t);for(var a=0;a<qt.length;a++){var e=qt[a];e.blockedOn===l&&(e.blockedOn=null)}for(;0<qt.length&&(a=qt[0],a.blockedOn===null);)g0(a),a.blockedOn===null&&qt.shift();if(a=(l.ownerDocument||l).$$reactFormReplay,a!=null)for(e=0;e<a.length;e+=3){var u=a[e],n=a[e+1],i=u[El]||null;if(typeof n=="function")i||Bo(a);else if(i){var c=null;if(n&&n.hasAttribute("formAction")){if(u=n,i=n[El]||null)c=i.formAction;else if(Uf(u)!==null)continue}else c=i.action;typeof c=="function"?a[e+1]=c:(a.splice(e,3),e-=3),Bo(a)}}}function Hf(l){this._internalRoot=l}Jn.prototype.render=Hf.prototype.render=function(l){var t=this._internalRoot;if(t===null)throw Error(g(409));var a=t.current,e=Nl();y0(a,e,l,t,null,null)};Jn.prototype.unmount=Hf.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var t=l.containerInfo;y0(l.current,2,null,l,null,null),jn(),t[ie]=null}};function Jn(l){this._internalRoot=l}Jn.prototype.unstable_scheduleHydration=function(l){if(l){var t=Io();l={blockedOn:null,target:l,priority:t};for(var a=0;a<qt.length&&t!==0&&t<qt[a].priority;a++);qt.splice(a,0,l),a===0&&g0(l)}};var Go=Co.version;if(Go!=="19.1.0")throw Error(g(527,Go,"19.1.0"));Y.findDOMNode=function(l){var t=l._reactInternals;if(t===void 0)throw typeof l.render=="function"?Error(g(188)):(l=Object.keys(l).join(","),Error(g(268,l)));return l=mm(t),l=l!==null?Zo(l):null,l=l===null?null:l.stateNode,l};var Yh={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Te=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Te.isDisabled&&Te.supportsFiber))try{uu=Te.inject(Yh),Dl=Te}catch{}var Te;kn.createRoot=function(l,t){if(!Xo(l))throw Error(g(299));var a=!1,e="",u=md,n=hd,i=yd,c=null;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(e=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(c=t.unstable_transitionCallbacks)),t=m0(l,1,!1,null,null,a,e,u,n,i,c,null),l[ie]=t.current,Mf(l),new Hf(t)};kn.hydrateRoot=function(l,t,a){if(!Xo(l))throw Error(g(299));var e=!1,u="",n=md,i=hd,c=yd,f=null,o=null;return a!=null&&(a.unstable_strictMode===!0&&(e=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(n=a.onUncaughtError),a.onCaughtError!==void 0&&(i=a.onCaughtError),a.onRecoverableError!==void 0&&(c=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(f=a.unstable_transitionCallbacks),a.formState!==void 0&&(o=a.formState)),t=m0(l,1,!0,t,a??null,e,u,n,i,c,f,o),t.context=h0(null),a=t.current,e=Nl(),e=jc(e),u=Qt(e),u.callback=null,Zt(a,u,e),a=e,t.current.lanes=a,iu(t,a),nt(t),l[ie]=t.current,Mf(l),new Jn(t)};kn.version="19.1.0"});var A0=$l((Ay,_0)=>{"use strict";function S0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(S0)}catch(l){console.error(l)}}S0(),_0.exports=p0()});var M0=$l($n=>{"use strict";var ay=Symbol.for("react.transitional.element"),ey=Symbol.for("react.fragment");function O0(l,t,a){var e=null;if(a!==void 0&&(e=""+a),t.key!==void 0&&(e=""+t.key),"key"in t){a={};for(var u in t)u!=="key"&&(a[u]=t[u])}else a=t;return t=a.ref,{$$typeof:ay,type:l,key:e,ref:t!==void 0?t:null,props:a}}$n.Fragment=ey;$n.jsx=O0;$n.jsxs=O0});var Et=$l((My,D0)=>{"use strict";D0.exports=M0()});var ry={};V0(ry,{mount:()=>Cf,unmount:()=>In});function Pn(l,{insertAt:t}={}){if(!l||typeof document>"u")return;let a=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",t==="top"&&a.firstChild?a.insertBefore(e,a.firstChild):a.appendChild(e),e.styleSheet?e.styleSheet.cssText=l:e.appendChild(document.createTextNode(l))}Pn(`.bsw-an{--bsw-an-bg: #f6f6f1;--bsw-an-panel: #fff;--bsw-an-line: #e4e4dc;--bsw-an-muted: #6b6b60;--bsw-an-fg: #1a1a14;--bsw-an-accent: #c8ef00;--bsw-an-accent-fg: #1a1a14;--bsw-an-radius: 12px;position:relative;box-sizing:border-box;display:flex;flex-direction:column;width:100%;max-width:100%;min-width:0;min-height:24rem;font-family:inherit,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;color:var(--bsw-an-fg);background:var(--bsw-an-bg);border:1px solid var(--bsw-an-line);border-radius:var(--bsw-an-radius);overflow:hidden}.bsw-an[data-theme=dark]{--bsw-an-bg: #161714;--bsw-an-panel: #22241c;--bsw-an-fg: #f4f4ee;--bsw-an-muted: #b3b4aa;--bsw-an-line: #4a4c42;--bsw-an-accent: #c8ef00;--bsw-an-accent-fg: #161714;--bsw-an-radius: 12px}.bsw-an *,.bsw-an *:before,.bsw-an *:after{box-sizing:border-box}.bsw-an__header{display:flex;gap:.7rem;align-items:center;padding:.85rem 1rem;background:var(--bsw-an-panel);border-bottom:1px solid var(--bsw-an-line)}.bsw-an__mark{flex:0 0 auto;display:grid;place-items:center;width:1.7rem;height:1.7rem;border-radius:8px;background:var(--bsw-an-accent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--bsw-an-fg) 10%,transparent)}.bsw-an__mark:after{content:"?";font-size:.95rem;font-weight:800;line-height:1;color:var(--bsw-an-accent-fg)}.bsw-an__heading{min-width:0;display:flex;flex-direction:column;gap:.1rem}.bsw-an__title{margin:0;font-size:.95rem;font-weight:650;letter-spacing:-.01em;line-height:1.2}.bsw-an__note,.bsw-an__empty,.bsw-an__count,.bsw-an__excerpt,.bsw-an__status,.bsw-an__thanks{margin:0;color:var(--bsw-an-muted);font-size:.8rem;line-height:1.4}.bsw-an__log{flex:1;min-height:8rem;overflow:auto;padding:1rem .85rem .85rem}.bsw-an__empty{margin:1.5rem .5rem;padding:1.1rem 1rem;text-align:center;background:var(--bsw-an-panel);border:1px dashed var(--bsw-an-line);border-radius:calc(var(--bsw-an-radius) - 2px);line-height:1.5}.bsw-an__turns{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:1rem}.bsw-an__turn{display:flex;flex-direction:column;gap:.55rem}.bsw-an__row{display:flex;flex-direction:column;gap:.4rem;max-width:88%;min-width:0}.bsw-an__row--visitor{align-self:flex-end;align-items:flex-end}.bsw-an__row--reply{align-self:flex-start;align-items:flex-start;max-width:92%}.bsw-an__question,.bsw-an__answer,.bsw-an__fallback,.bsw-an__status{overflow-wrap:anywhere}.bsw-an__question{margin:0;padding:.55rem .8rem;font-weight:600;line-height:1.4;background:color-mix(in srgb,var(--bsw-an-accent) 34%,var(--bsw-an-panel));border-radius:1.05rem 1.05rem .3rem}.bsw-an__answer,.bsw-an__fallback,.bsw-an__status{margin:0;padding:.7rem .85rem;line-height:1.5;background:var(--bsw-an-panel);border:1px solid var(--bsw-an-line);border-radius:.3rem 1.05rem 1.05rem}.bsw-an__fallback{color:var(--bsw-an-muted)}.bsw-an__answer p,.bsw-an__fallback,.bsw-an__excerpt{margin:0}.bsw-an__answer p+p,.bsw-an__answer p+ul,.bsw-an__answer ul+p{margin-top:.45rem}.bsw-an__answer ul{margin:.25rem 0 0;padding-inline-start:1.1rem}.bsw-an__answer a,.bsw-an__source a{color:var(--bsw-an-fg);font-weight:700}.bsw-an__answer code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.92em;background:color-mix(in srgb,var(--bsw-an-fg) 6%,var(--bsw-an-panel));border-radius:4px;padding:.05rem .25rem}.bsw-an__excerpt{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden;overflow-wrap:anywhere}.bsw-an__sources-wrap{width:100%}.bsw-an__sources-toggle{display:inline-flex;align-items:center;gap:.35rem;cursor:pointer;list-style:none;font-size:.75rem;font-weight:650;color:var(--bsw-an-muted);background:var(--bsw-an-panel);border:1px solid var(--bsw-an-line);border-radius:999px;padding:.22rem .65rem .22rem .5rem}.bsw-an__sources-toggle::-webkit-details-marker{display:none}.bsw-an__sources-toggle:before{content:"";width:.4rem;height:.4rem;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);translate:0 -.05rem}.bsw-an__sources-wrap[open] .bsw-an__sources-toggle:before{transform:rotate(45deg);translate:0 -.12rem}.bsw-an__sources-toggle:focus-visible{outline:2px solid var(--bsw-an-accent);outline-offset:2px}.bsw-an__sources{list-style:none;margin:.4rem 0 0;padding:0;display:flex;flex-direction:column;gap:.4rem}.bsw-an__source{border-inline-start:3px solid var(--bsw-an-accent);background:var(--bsw-an-panel);border:1px solid var(--bsw-an-line);border-inline-start-width:3px;border-inline-start-color:var(--bsw-an-accent);border-radius:0 10px 10px 0;padding:.5rem .7rem}.bsw-an__source-title{font-weight:650;font-size:.85rem}.bsw-an__feedback{display:flex;flex-wrap:wrap;gap:.3rem;align-items:center;color:var(--bsw-an-muted);font-size:.75rem}.bsw-an__composer{position:relative;display:flex;flex-direction:column;gap:.45rem;padding:.75rem .85rem .85rem;border-top:1px solid var(--bsw-an-line);background:var(--bsw-an-panel)}.bsw-an__composer-row{display:flex;gap:.5rem;align-items:flex-end}.bsw-an__label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bsw-an__textarea{flex:1 1 auto;width:100%;min-height:2.75rem;max-height:8rem;border:1px solid var(--bsw-an-line);border-radius:14px;padding:.55rem .75rem;font:inherit;line-height:1.4;color:var(--bsw-an-fg);background:var(--bsw-an-bg);resize:none}.bsw-an__button{flex:0 0 auto;align-self:flex-end;border:1px solid transparent;border-radius:999px;background:var(--bsw-an-accent);color:var(--bsw-an-accent-fg);font:inherit;font-weight:700;padding:.5rem .95rem;cursor:pointer}.bsw-an__button--ghost{background:transparent;color:var(--bsw-an-fg);border-color:var(--bsw-an-line);font-weight:600;padding:.2rem .5rem;font-size:.75rem}.bsw-an__button:disabled{cursor:not-allowed;opacity:.6}.bsw-an__button:focus-visible,.bsw-an__textarea:focus-visible{outline:2px solid var(--bsw-an-accent);outline-offset:2px}.bsw-an__error{margin:0;color:var(--bsw-an-fg);font-weight:700;font-size:.8rem}.bsw-an__dots{display:inline-flex;gap:.18rem;margin-inline-end:.45rem;vertical-align:middle}.bsw-an__dots i{width:.35rem;height:.35rem;border-radius:999px;background:var(--bsw-an-muted);animation:bsw-an-dot 1s ease-in-out infinite}.bsw-an__dots i:nth-child(2){animation-delay:.15s}.bsw-an__dots i:nth-child(3){animation-delay:.3s}@keyframes bsw-an-dot{0%,80%,to{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}.bsw-an-frame{--frame-bg: #f6f6f1;--frame-fg: #1a1a14;--frame-line: #e4e4dc;--frame-accent: #c8ef00;--frame-accent-fg: #1a1a14;position:fixed;z-index:40;right:var(--bsw-an-frame-launcher-right, 1.25rem);bottom:var(--bsw-an-frame-launcher-bottom, 1.25rem);font-family:inherit,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}.bsw-an-frame[data-theme=dark]{--frame-bg: #161714;--frame-fg: #f4f4ee;--frame-line: #4a4c42;--frame-accent: #c8ef00;--frame-accent-fg: #161714}.bsw-an--launcher-host{width:auto;min-height:0;border:0;background:transparent}.bsw-an--launcher-closed{border:0;background:transparent}.bsw-an--launcher-open,.bsw-an-frame--window.bsw-an-frame--open,.bsw-an-frame--launcher.bsw-an-frame--open{display:flex;flex-direction:column;right:var(--bsw-an-frame-launcher-right, .75rem);bottom:var(--bsw-an-frame-launcher-bottom, .75rem);width:min(24rem,calc(100vw - 1.5rem));height:min(40rem,calc(100dvh - 1.5rem));max-height:calc(100dvh - 1.5rem)}.bsw-an-frame--modal.bsw-an-frame--open{top:.75rem;right:auto;bottom:auto;left:50%;display:flex;flex-direction:column;width:min(36rem,calc(100vw - 1.5rem));height:min(44rem,calc(100dvh - 1.5rem));max-height:calc(100dvh - 1.5rem);overflow:hidden;transform:translate(-50%)}.bsw-an-frame__backdrop{position:fixed;inset:0;z-index:0;border:0;padding:0;background:#1a1a1466;cursor:pointer}.bsw-an-frame__panel{position:relative;z-index:1;display:flex;flex-direction:column;min-height:0;max-height:100%}.bsw-an--launcher-open .bsw-an-frame__panel,.bsw-an-frame--window.bsw-an-frame--open .bsw-an-frame__panel,.bsw-an-frame--modal.bsw-an-frame--open .bsw-an-frame__panel{flex:1 1 auto}.bsw-an-frame__panel[hidden]{display:none}.bsw-an--launcher-open .bsw-an,.bsw-an-frame--window.bsw-an-frame--open .bsw-an,.bsw-an-frame--modal.bsw-an-frame--open .bsw-an{flex:1 1 auto;height:auto;min-height:0;max-height:100%;box-shadow:0 22px 56px #1a1a142e}.bsw-an-frame__panel .bsw-an__header{padding-inline-end:3rem}@media(max-width:420px){.bsw-an--launcher-open,.bsw-an-frame--window.bsw-an-frame--open,.bsw-an-frame--launcher.bsw-an-frame--open,.bsw-an-frame--modal.bsw-an-frame--open{right:.5rem;width:calc(100vw - 1rem)}.bsw-an-frame--modal.bsw-an-frame--open{right:auto}.bsw-an__header,.bsw-an__composer,.bsw-an__log{padding:.7rem}.bsw-an-frame__panel .bsw-an__header{padding-inline-end:2.75rem}.bsw-an__textarea{min-height:2.5rem}}.bsw-an-frame__close,.bsw-an-frame__trigger,.bsw-an-frame__fab{font:inherit;cursor:pointer}.bsw-an-frame__close{position:absolute;top:.7rem;right:.7rem;z-index:3;width:2rem;height:2rem;margin:0;display:grid;place-items:center;border:1px solid var(--frame-line);background:var(--frame-bg);color:var(--frame-fg);border-radius:999px;padding:0;font-size:.7rem;font-weight:700;line-height:1}.bsw-an-frame__trigger{display:inline-flex;align-items:center;border:1px solid var(--frame-line);background:var(--frame-bg);color:var(--frame-fg);border-radius:999px;padding:.5rem .95rem;font-weight:650;box-shadow:0 10px 28px #1a1a1424}.bsw-an-frame__fab{width:3.5rem;height:3.5rem;border:0;border-radius:999px;background:var(--frame-accent);color:var(--frame-accent-fg);font-weight:700;box-shadow:0 12px 28px #1a1a1429}.bsw-an-frame__close-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bsw-an-frame__close:focus-visible,.bsw-an-frame__trigger:focus-visible,.bsw-an-frame__fab:focus-visible{outline:2px solid var(--frame-fg);outline-offset:2px}@media(prefers-reduced-motion:reduce){.bsw-an *,.bsw-an-frame *{animation:none!important;transition:none!important}}
|
|
10
10
|
`);var B0=Kl(A0(),1);var ml=Kl(ye(),1);var Bh="No answer was found.";function Wn(l){return Array.from(l).length}function qf(l,t){let a=0,e="";for(let u of l){if(a>=t)break;e+=u,a+=1}return e}function Yf(l){if(typeof l!="string")return;let t=l.trim();if(!t)return;let a;try{a=new URL(t)}catch{return}if(!(a.protocol!=="http:"&&a.protocol!=="https:"))return a.toString()}function Gh(l){if(!Array.isArray(l))return[];let t=[],a=new Set;for(let e of l){if(t.length>=20)break;if(!e||typeof e!="object")continue;let u=e;if(typeof u.id!="string"||!u.id.trim())continue;let n=u.id.trim();if(a.has(n))continue;a.add(n);let i=typeof u.title=="string"&&u.title.trim()?qf(u.title.trim(),200):n,c=typeof u.excerpt=="string"&&u.excerpt.trim()?qf(u.excerpt.trim(),500):void 0,f=Yf(u.url);t.push({id:n,title:i,excerpt:c,url:f})}return t}function E0(l){if(!l||typeof l!="object")return null;let t=l;if(typeof t.answerId!="string"||!t.answerId.trim()||typeof t.sessionId!="string")return null;let a=t.answerId.trim(),e=t.sessionId,u=typeof t.fallback=="string"&&t.fallback.trim()?t.fallback.trim():Bh;if(t.outcome==="unanswered")return{sessionId:e,answerId:a,outcome:"unanswered",fallback:u};if(t.outcome!=="answered")return null;let n=typeof t.answer=="string"?t.answer.trim():"";return n?{sessionId:e,answerId:a,outcome:"answered",answer:qf(n,8e3),citations:Gh(t.citations)}:{sessionId:e,answerId:a,outcome:"unanswered",fallback:u}}var T0="bsw-an";var Ch="We could not find that in the Northwind Outfitters sample. Ask about hours, returns, or shipping.";var Xh="Returns are accepted within 30 days of delivery.",Qh="You have 30 days from delivery. Exchanges use that same window.",Zh="Northwind Outfitters is open Monday through Friday, 9am to 5pm US Eastern, and closed Saturday and Sunday.",jh="Saturday and Sunday are closed. Weekday hours are 9am to 5pm US Eastern.",Lh="Standard shipping is free on orders over $50.",Vh="Free standard shipping starts when the order is over $50.",Kh={hours:{id:"ane_hours",title:"Store hours",url:"https://northwind.example/help/hours",excerpt:"Open Monday through Friday, 9am to 5pm US Eastern. Closed Saturday and Sunday."},returns:{id:"ane_returns",title:"Returns",url:"https://northwind.example/help/returns",excerpt:"Returns are accepted within 30 days of delivery. Exchanges use the same 30 day window."},shipping:{id:"ane_shipping",title:"Shipping",url:"https://northwind.example/help/shipping",excerpt:"Standard shipping is free on orders over $50."}},Jh=[{id:"returns",words:["return","returns","refund","refunds","exchange","exchanges"]},{id:"shipping",words:["ship","shipping","delivery"]},{id:"hours",words:["hour","hours","open","opening","weekend","saturday","sunday","weekday","weekdays"]}],kh={hours:Zh,returns:Xh,shipping:Lh},Wh={hours:jh,returns:Qh,shipping:Vh},$h=[{phrase:"how long"},{phrase:"how long do i have"},{phrase:"are you open then",topic:"hours"},{phrase:"what about then"},{phrase:"is there a minimum",topic:"shipping"},{phrase:"how much is free",topic:"shipping"},{phrase:"tell me more"}];function Fh(l){return l.trim().toLowerCase().replace(/[?!.,'"]/g,"").replace(/\s+/g," ").trim()}function Ih(l,t){return new RegExp(`\\b${t}\\b`).test(l)}function Ph(l){for(let t of Jh)if(t.words.some(a=>Ih(l,a)))return t.id;return null}function ly(l,t){let a=$h.find(e=>e.phrase===l);return!a||!t||a.topic&&a.topic!==t?null:t}function ty(l){let t=l.trim();return t?Wn(t)>1e3?"Questions are limited to 1,000 characters.":null:"Enter a question."}function z0(){let l=new Map,t=0;return{async ask(a){let e=ty(a.question);if(e)throw new Error(e);let u=Fh(a.question),n=Ph(u),i=n??ly(u,l.get(a.sessionId));t+=1;let c=`anq_${t.toString(16).padStart(24,"0")}`;return i?(l.set(a.sessionId,i),{sessionId:a.sessionId,answerId:c,outcome:"answered",answer:n?kh[i]:Wh[i],citations:[{...Kh[i]}]}):{sessionId:a.sessionId,answerId:c,outcome:"unanswered",fallback:Ch}},async feedback(){}}}var pu=Kl(ye(),1),Tt=Kl(Et(),1);function x0({presentation:l="section",defaultOpen:t=!1,label:a,className:e,theme:u,children:n}){let[i,c]=(0,pu.useState)(t),f=`${l}\0${t?"1":"0"}`,[o,y]=(0,pu.useState)(f);f!==o&&(y(f),c(t));let v=l==="launcher",m=v||l==="window";if((0,pu.useEffect)(()=>{if(l==="section"||!i)return;function A(_){_.key==="Escape"&&c(!1)}return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[i,l]),l==="section")return n;let h=["bsw-an-frame",`bsw-an-frame--${l}`,i?"bsw-an-frame--open":"",m?"bsw-an--launcher-host":"",m&&i?"bsw-an--launcher-open":"",m&&!i?"bsw-an--launcher-closed":"",e??""].filter(Boolean).join(" ");return(0,Tt.jsxs)("div",{className:h,"data-theme":u,"data-state":i?"open":"closed",children:[i&&(l==="modal"||v)?(0,Tt.jsx)("button",{type:"button",className:"bsw-an-frame__backdrop","aria-label":`Close ${a}`,onClick:()=>c(!1)}):null,(0,Tt.jsxs)("div",{className:"bsw-an-frame__panel",hidden:!i,role:i&&l==="modal"?"dialog":i?"region":void 0,"aria-modal":i&&l==="modal"?!0:void 0,"aria-label":i?a:void 0,children:[(0,Tt.jsxs)("button",{type:"button",className:"bsw-an-frame__close",onClick:()=>c(!1),children:[(0,Tt.jsx)("span",{className:"bsw-an-frame__close-label",children:"Close"}),(0,Tt.jsx)("span",{"aria-hidden":"true",children:"\xD7"})]}),n]}),i?null:(0,Tt.jsx)("button",{type:"button",className:v?"bsw-an-frame__fab":"bsw-an-frame__trigger","aria-label":v?"Open answers":void 0,onClick:()=>c(!0),children:v?"Ask":a})]})}var Pt=Kl(Et(),1);function N0(l,t,a){let e=/(\*\*[^*\n]+\*\*|(?<![A-Za-z0-9])_[^_\n]+_(?![A-Za-z0-9])|`[^`\n]+`|\[[^\]\n]+\]\(https?:\/\/[^)\s]+\))/g,u=[],n=0,i=0,c;for(;c=e.exec(l);){c.index>n&&u.push(l.slice(n,c.index));let f=c[0],o=`${a}-${i++}`;if(f.startsWith("**")&&f.endsWith("**")&&f.length>=4)u.push((0,Pt.jsx)("strong",{children:f.slice(2,-2)},o));else if(f.startsWith("_")&&f.endsWith("_")&&f.length>=3)u.push((0,Pt.jsx)("em",{children:f.slice(1,-1)},o));else if(f.startsWith("`")&&f.endsWith("`")&&f.length>=3)u.push((0,Pt.jsx)("code",{children:f.slice(1,-1)},o));else if(f.startsWith("[")){let y=/^\[([^\]\n]+)\]\((https?:\/\/[^)\s]+)\)$/.exec(f),v=y?.[2]??"",m=Yf(v);y&&m&&(t.has(v)||t.has(m))?u.push((0,Pt.jsx)("a",{href:m,target:"_blank",rel:"noopener noreferrer",children:y[1]},o)):u.push(f)}else u.push(f);n=c.index+f.length}return n<l.length&&u.push(l.slice(n)),u}function R0(l,t){let a=l.split(`
|
|
11
11
|
`),e=[],u=[],n=[],i=0;function c(){if(!u.length)return;let o=u.join(`
|
|
12
|
-
`);e.push((0,Pt.jsx)("p",{children:N0(o,t,`p-${i}`)},`p-${i++}`)),u=[]}function f(){if(!n.length)return;let o=n;e.push((0,Pt.jsx)("ul",{children:o.map((y,v)=>(0,Pt.jsx)("li",{children:N0(y,t,`li-${i}-${v}`)},`li-${i}-${v}`))},`ul-${i++}`)),n=[]}for(let o of a){let y=/^\s*[-*]\s+(.*)$/.exec(o);if(y){c(),n.push(y[1]??"");continue}if(!o.trim()){c(),f();continue}f(),u.push(o)}return c(),f(),e}var uy=/^ans_[0-9a-f]{24}$/;function Bf(l){return`bsw_an_session:${l?.trim()?l.trim():"local"}`}function U0(){let l=new Uint8Array(12);globalThis.crypto.getRandomValues(l);let t="";for(let a of l)t+=a.toString(16).padStart(2,"0");return`ans_${t}`}function Gf(l,t){if(!l)return U0();let a=Bf(t),e=l.getItem(a);if(e&&uy.test(e))return e;let u=U0();return l.setItem(a,u),u}var T=Kl(Et(),1),H0="Questions are limited to 1,000 characters.",q0="Something went wrong. Your question is still here. Try again.",ny="Feedback could not be saved. Try again.";function iy(l){let t=Bf(l),[a,e]=(0,ml.useState)(()=>({key:t,id:Gf(typeof window>"u"?null:window.sessionStorage,l)}));return a.key!==t&&e({key:t,id:Gf(typeof window>"u"?null:window.sessionStorage,l)}),a.id}function cy(l){return l===1?"1 source":`${l} sources`}function fy({citations:l}){return l.length?(0,T.jsxs)("details",{className:"bsw-an__sources-wrap",children:[(0,T.jsx)("summary",{className:"bsw-an__sources-toggle",children:cy(l.length)}),(0,T.jsx)("ul",{className:"bsw-an__sources",children:l.map(t=>(0,T.jsxs)("li",{className:"bsw-an__source","data-citation-id":t.id,children:[t.url?(0,T.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.title}):(0,T.jsx)("span",{className:"bsw-an__source-title",children:t.title}),t.excerpt?(0,T.jsx)("p",{className:"bsw-an__excerpt",children:t.excerpt}):null]},t.id))})]}):null}function sy(l){if(l){let t=typeof l.url=="string"?l.url:void 0,a=typeof l.title=="string"?l.title:void 0;return{url:t,title:a}}return typeof window>"u"?{}:{url:window.location.href,title:document.title}}function Y0(l){let t=l.presentation??"launcher",a=iy(l.appId),e=(0,ml.useRef)(null),u=l.adapter??(l.publishableKey?null:e.current??=z0()),n=l.adapter?"byo":l.publishableKey?"unwired":"local",[i,c]=(0,ml.useState)(""),[f,o]=(0,ml.useState)(!1),[y,v]=(0,ml.useState)(null),[m,h]=(0,ml.useState)(null),[A,_]=(0,ml.useState)([]),H=(0,ml.useRef)(!1),r=(0,ml.useRef)(null),s=(0,ml.useRef)(new Set),d=(0,ml.useRef)(l.onFallback);d.current=l.onFallback,(0,ml.useEffect)(()=>{let w=r.current;w&&(w.scrollTop=w.scrollHeight)},[A,f,y,m]);let b=i.trim(),p=Wn(b),O=p>1e3,S=(0,ml.useId)();async function E(w){if(w.preventDefault(),!u||H.current)return;if(!b){h("Enter a question.");return}if(O){h(H0);return}let Ll=b,wt=sy(l.pageContext);H.current=!0,o(!0),v(Ll),c(""),h(null);try{let Vl=await u.ask({sessionId:a,question:Ll,pageContext:wt}),ll=E0(Vl);if(!ll){c(Ll),h(q0);return}ll.outcome==="unanswered"&&d.current?.(ll),_(C0=>[...C0,{question:Ll,result:ll,feedback:"idle"}])}catch{c(Ll),h(q0)}finally{H.current=!1,o(!1),v(null)}}async function F(w,Ll){if(!u?.feedback||s.current.has(w))return;let wt=A.find(Vl=>Vl.result.answerId===w);if(!(!wt||wt.feedback==="pending"||wt.feedback==="done")){s.current.add(w),_(Vl=>Vl.map(ll=>ll.result.answerId===w?{...ll,feedback:"pending"}:ll));try{await u.feedback({sessionId:a,answerId:w,helpful:Ll}),_(Vl=>Vl.map(ll=>ll.result.answerId===w?{...ll,feedback:"done"}:ll))}catch{s.current.delete(w),_(Vl=>Vl.map(ll=>ll.result.answerId===w?{...ll,feedback:"error"}:ll))}}}let R=(0,T.jsxs)("div",{className:[T0,t==="section"?l.className:""].filter(Boolean).join(" "),"data-theme":l.theme,"data-mode":n,children:[(0,T.jsxs)("header",{className:"bsw-an__header",children:[(0,T.jsx)("span",{className:"bsw-an__mark","aria-hidden":"true"}),(0,T.jsxs)("div",{className:"bsw-an__heading",children:[(0,T.jsx)("h2",{className:"bsw-an__title",children:"Answers"}),n==="local"?(0,T.jsx)("p",{className:"bsw-an__note",children:"Sample answers for Northwind Outfitters."}):null]})]}),(0,T.jsx)("div",{className:"bsw-an__log",ref:r,children:A.length===0&&!y?(0,T.jsx)("p",{className:"bsw-an__empty",children:n==="unwired"?"This page is not ready to answer yet.":n==="local"?"Ask a question. The sample covers hours, returns, and shipping for Northwind Outfitters.":"Ask a question
|
|
12
|
+
`);e.push((0,Pt.jsx)("p",{children:N0(o,t,`p-${i}`)},`p-${i++}`)),u=[]}function f(){if(!n.length)return;let o=n;e.push((0,Pt.jsx)("ul",{children:o.map((y,v)=>(0,Pt.jsx)("li",{children:N0(y,t,`li-${i}-${v}`)},`li-${i}-${v}`))},`ul-${i++}`)),n=[]}for(let o of a){let y=/^\s*[-*]\s+(.*)$/.exec(o);if(y){c(),n.push(y[1]??"");continue}if(!o.trim()){c(),f();continue}f(),u.push(o)}return c(),f(),e}var uy=/^ans_[0-9a-f]{24}$/;function Bf(l){return`bsw_an_session:${l?.trim()?l.trim():"local"}`}function U0(){let l=new Uint8Array(12);globalThis.crypto.getRandomValues(l);let t="";for(let a of l)t+=a.toString(16).padStart(2,"0");return`ans_${t}`}function Gf(l,t){if(!l)return U0();let a=Bf(t),e=l.getItem(a);if(e&&uy.test(e))return e;let u=U0();return l.setItem(a,u),u}var T=Kl(Et(),1),H0="Questions are limited to 1,000 characters.",q0="Something went wrong. Your question is still here. Try again.",ny="Feedback could not be saved. Try again.";function iy(l){let t=Bf(l),[a,e]=(0,ml.useState)(()=>({key:t,id:Gf(typeof window>"u"?null:window.sessionStorage,l)}));return a.key!==t&&e({key:t,id:Gf(typeof window>"u"?null:window.sessionStorage,l)}),a.id}function cy(l){return l===1?"1 source":`${l} sources`}function fy({citations:l}){return l.length?(0,T.jsxs)("details",{className:"bsw-an__sources-wrap",children:[(0,T.jsx)("summary",{className:"bsw-an__sources-toggle",children:cy(l.length)}),(0,T.jsx)("ul",{className:"bsw-an__sources",children:l.map(t=>(0,T.jsxs)("li",{className:"bsw-an__source","data-citation-id":t.id,children:[t.url?(0,T.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.title}):(0,T.jsx)("span",{className:"bsw-an__source-title",children:t.title}),t.excerpt?(0,T.jsx)("p",{className:"bsw-an__excerpt",children:t.excerpt}):null]},t.id))})]}):null}function sy(l){if(l){let t=typeof l.url=="string"?l.url:void 0,a=typeof l.title=="string"?l.title:void 0;return{url:t,title:a}}return typeof window>"u"?{}:{url:window.location.href,title:document.title}}function Y0(l){let t=l.presentation??"launcher",a=iy(l.appId),e=(0,ml.useRef)(null),u=l.adapter??(l.publishableKey?null:e.current??=z0()),n=l.adapter?"byo":l.publishableKey?"unwired":"local",[i,c]=(0,ml.useState)(""),[f,o]=(0,ml.useState)(!1),[y,v]=(0,ml.useState)(null),[m,h]=(0,ml.useState)(null),[A,_]=(0,ml.useState)([]),H=(0,ml.useRef)(!1),r=(0,ml.useRef)(null),s=(0,ml.useRef)(new Set),d=(0,ml.useRef)(l.onFallback);d.current=l.onFallback,(0,ml.useEffect)(()=>{let w=r.current;w&&(w.scrollTop=w.scrollHeight)},[A,f,y,m]);let b=i.trim(),p=Wn(b),O=p>1e3,S=(0,ml.useId)();async function E(w){if(w.preventDefault(),!u||H.current)return;if(!b){h("Enter a question.");return}if(O){h(H0);return}let Ll=b,wt=sy(l.pageContext);H.current=!0,o(!0),v(Ll),c(""),h(null);try{let Vl=await u.ask({sessionId:a,question:Ll,pageContext:wt}),ll=E0(Vl);if(!ll){c(Ll),h(q0);return}ll.outcome==="unanswered"&&d.current?.(ll),_(C0=>[...C0,{question:Ll,result:ll,feedback:"idle"}])}catch{c(Ll),h(q0)}finally{H.current=!1,o(!1),v(null)}}async function F(w,Ll){if(!u?.feedback||s.current.has(w))return;let wt=A.find(Vl=>Vl.result.answerId===w);if(!(!wt||wt.feedback==="pending"||wt.feedback==="done")){s.current.add(w),_(Vl=>Vl.map(ll=>ll.result.answerId===w?{...ll,feedback:"pending"}:ll));try{await u.feedback({sessionId:a,answerId:w,helpful:Ll}),_(Vl=>Vl.map(ll=>ll.result.answerId===w?{...ll,feedback:"done"}:ll))}catch{s.current.delete(w),_(Vl=>Vl.map(ll=>ll.result.answerId===w?{...ll,feedback:"error"}:ll))}}}let R=(0,T.jsxs)("div",{className:[T0,t==="section"?l.className:""].filter(Boolean).join(" "),"data-theme":l.theme,"data-mode":n,children:[(0,T.jsxs)("header",{className:"bsw-an__header",children:[(0,T.jsx)("span",{className:"bsw-an__mark","aria-hidden":"true"}),(0,T.jsxs)("div",{className:"bsw-an__heading",children:[(0,T.jsx)("h2",{className:"bsw-an__title",children:"Answers"}),n==="local"?(0,T.jsx)("p",{className:"bsw-an__note",children:"Sample answers for Northwind Outfitters."}):null]})]}),(0,T.jsx)("div",{className:"bsw-an__log",ref:r,children:A.length===0&&!y?(0,T.jsx)("p",{className:"bsw-an__empty",children:n==="unwired"?"This page is not ready to answer yet.":n==="local"?"Ask a question. The sample covers hours, returns, and shipping for Northwind Outfitters.":l.greeting??"Ask a question this site already answers."}):(0,T.jsxs)("ol",{className:"bsw-an__turns",children:[A.map((w,Ll)=>{let wt=w.result.outcome==="answered"?w.result.citations??[]:[],Vl=new Set(wt.map(ll=>ll.url).filter(ll=>!!ll));return(0,T.jsxs)("li",{className:"bsw-an__turn","data-outcome":w.result.outcome,children:[(0,T.jsx)("div",{className:"bsw-an__row bsw-an__row--visitor",children:(0,T.jsx)("p",{className:"bsw-an__question",children:w.question})}),(0,T.jsxs)("div",{className:"bsw-an__row bsw-an__row--reply",children:[w.result.outcome==="answered"&&w.result.answer?(0,T.jsx)("div",{className:"bsw-an__answer",children:R0(w.result.answer,Vl)}):(0,T.jsx)("p",{className:"bsw-an__fallback",children:w.result.fallback}),(0,T.jsx)(fy,{citations:wt}),u?.feedback?w.feedback==="done"?(0,T.jsx)("p",{className:"bsw-an__thanks",children:"Thanks for the feedback."}):(0,T.jsxs)("div",{className:"bsw-an__feedback",children:[(0,T.jsx)("button",{type:"button",className:"bsw-an__button bsw-an__button--ghost",disabled:w.feedback==="pending",onClick:()=>{F(w.result.answerId,!0)},children:"Helpful"}),(0,T.jsx)("button",{type:"button",className:"bsw-an__button bsw-an__button--ghost",disabled:w.feedback==="pending",onClick:()=>{F(w.result.answerId,!1)},children:"Not helpful"}),w.feedback==="error"?(0,T.jsx)("p",{className:"bsw-an__error",role:"alert",children:ny}):null]}):null]})]},`${w.result.answerId}:${Ll}`)}),y?(0,T.jsxs)("li",{className:"bsw-an__turn","data-pending":"true",children:[(0,T.jsx)("div",{className:"bsw-an__row bsw-an__row--visitor",children:(0,T.jsx)("p",{className:"bsw-an__question",children:y})}),(0,T.jsx)("div",{className:"bsw-an__row bsw-an__row--reply",children:(0,T.jsxs)("p",{className:"bsw-an__status",role:"status",children:[(0,T.jsxs)("span",{className:"bsw-an__dots","aria-hidden":"true",children:[(0,T.jsx)("i",{}),(0,T.jsx)("i",{}),(0,T.jsx)("i",{})]}),"Looking that up."]})})]}):null]})}),(0,T.jsxs)("form",{className:"bsw-an__composer",autoComplete:"off",onSubmit:w=>{E(w)},children:[m?(0,T.jsx)("p",{className:"bsw-an__error",role:"alert",children:m}):null,(0,T.jsx)("label",{className:"bsw-an__label",htmlFor:S,children:"Question"}),(0,T.jsxs)("div",{className:"bsw-an__composer-row",children:[(0,T.jsx)("textarea",{id:S,className:"bsw-an__textarea",rows:2,value:i,disabled:!u||f,placeholder:n==="local"?"Ask about hours, returns, or shipping":"Ask a question",enterKeyHint:"send",onChange:w=>{c(w.target.value),m&&h(null)},onKeyDown:w=>{w.key!=="Enter"||w.shiftKey||(w.preventDefault(),w.currentTarget.form?.requestSubmit())}}),(0,T.jsx)("button",{className:"bsw-an__button",type:"submit",disabled:!u||f||!b||O,children:"Ask"})]}),O?(0,T.jsxs)("p",{className:"bsw-an__count",children:[p," / 1,000",(0,T.jsxs)("span",{className:"bsw-an__error",children:[" ",H0]})]}):p>800?(0,T.jsxs)("p",{className:"bsw-an__count",children:[p," / 1,000"]}):null]})]});return t==="section"?R:(0,T.jsx)(x0,{presentation:t,defaultOpen:l.defaultOpen,label:"Answers",className:l.className,theme:l.theme,children:R})}var G0=Kl(Et(),1),Fn=new WeakMap;function Cf(l,t={}){let a=Fn.get(l);return a||(a=(0,B0.createRoot)(l),Fn.set(l,a)),a.render((0,G0.jsx)(Y0,{...t})),()=>In(l)}function In(l){let t=Fn.get(l);t&&(t.unmount(),Fn.delete(l))}var oy={mount:Cf,unmount:In};typeof window<"u"&&(window.BootstrapwareAnswers=oy);return K0(ry);})();
|
|
13
13
|
/*! Bundled license information:
|
|
14
14
|
|
|
15
15
|
scheduler/cjs/scheduler.production.js:
|