inline-chat-kit 0.57.0 → 0.58.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/dist/demo.js CHANGED
@@ -1,9 +1,10 @@
1
1
  "use client";
2
- import { et as e, n as t, t as n } from "./ChatExperience-Bawy_cnn.js";
2
+ import { et as e, n as t, t as n } from "./ChatExperience-CrWU56fi.js";
3
3
  import { useCallback as r, useRef as i, useState as a } from "react";
4
4
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
5
  import { AnimatePresence as c, motion as l } from "motion/react";
6
- var u = {
6
+ import { PanelBottom as u, PanelBottomClose as d } from "lucide-react";
7
+ var f = {
7
8
  banner: "ick-banner-qe2q",
8
9
  header: "ick-header-v41q",
9
10
  headerIcon: "ick-headerIcon-hWUJ",
@@ -19,18 +20,18 @@ var u = {
19
20
  };
20
21
  //#endregion
21
22
  //#region src/demo/InlineChatBanner.tsx
22
- function d({ status: e }) {
23
+ function p({ status: e }) {
23
24
  return /* @__PURE__ */ s("div", {
24
- className: u.banner,
25
+ className: f.banner,
25
26
  children: [/* @__PURE__ */ s("div", {
26
- className: u.header,
27
+ className: f.header,
27
28
  children: [/* @__PURE__ */ s("svg", {
28
29
  width: "16",
29
30
  height: "16",
30
31
  viewBox: "0 0 16 16",
31
32
  fill: "none",
32
33
  xmlns: "http://www.w3.org/2000/svg",
33
- className: u.headerIcon,
34
+ className: f.headerIcon,
34
35
  "aria-hidden": !0,
35
36
  children: [
36
37
  /* @__PURE__ */ o("circle", {
@@ -54,27 +55,27 @@ function d({ status: e }) {
54
55
  })
55
56
  ]
56
57
  }), /* @__PURE__ */ s("div", {
57
- className: u.headerText,
58
+ className: f.headerText,
58
59
  children: [/* @__PURE__ */ o("span", {
59
- className: u.title,
60
+ className: f.title,
60
61
  children: "Quick heads up"
61
62
  }), /* @__PURE__ */ o("span", {
62
- className: u.body,
63
+ className: f.body,
63
64
  children: "The answers are scripted — there is no model behind this page. Everything else is the real component, so the list below is what you can actually try."
64
65
  })]
65
66
  })]
66
67
  }), /* @__PURE__ */ s("div", {
67
- className: u.columns,
68
+ className: f.columns,
68
69
  children: [
69
- /* @__PURE__ */ o(f, {
70
+ /* @__PURE__ */ o(m, {
70
71
  label: "Works",
71
72
  items: e.works
72
73
  }),
73
- /* @__PURE__ */ o(f, {
74
+ /* @__PURE__ */ o(m, {
74
75
  label: "Not working",
75
76
  items: e.notWorking
76
77
  }),
77
- /* @__PURE__ */ o(f, {
78
+ /* @__PURE__ */ o(m, {
78
79
  label: "Soon",
79
80
  items: e.soon
80
81
  })
@@ -82,16 +83,16 @@ function d({ status: e }) {
82
83
  })]
83
84
  });
84
85
  }
85
- function f({ label: e, items: t }) {
86
+ function m({ label: e, items: t }) {
86
87
  return /* @__PURE__ */ s("div", {
87
- className: u.column,
88
+ className: f.column,
88
89
  children: [/* @__PURE__ */ o("span", {
89
- className: u.columnLabel,
90
+ className: f.columnLabel,
90
91
  children: e
91
92
  }), /* @__PURE__ */ o("div", {
92
- className: u.items,
93
+ className: f.items,
93
94
  children: t.map((e) => /* @__PURE__ */ o("span", {
94
- className: u.item,
95
+ className: f.item,
95
96
  children: e
96
97
  }, e))
97
98
  })]
@@ -99,7 +100,7 @@ function f({ label: e, items: t }) {
99
100
  }
100
101
  //#endregion
101
102
  //#region src/demo/featureStatus.ts
102
- var p = {
103
+ var h = {
103
104
  works: [
104
105
  "Send, stop, edit",
105
106
  "Multiline input",
@@ -115,16 +116,16 @@ var p = {
115
116
  "Open a plan in a pane",
116
117
  "Reasoning and tools",
117
118
  "Sources and citations",
118
- "Light and dark"
119
+ "Light and dark",
120
+ "A fixed composer"
119
121
  ],
120
122
  notWorking: ["Real model answers", "Real speech to text"],
121
123
  soon: [
122
124
  "Mobile",
123
- "A fixed composer",
124
125
  "Queue a message",
125
126
  "Saved conversations"
126
127
  ]
127
- }, m = {
128
+ }, g = {
128
129
  page: "ick-page-FfCm",
129
130
  container: "ick-container-o-mL",
130
131
  infoContainer: "ick-infoContainer-6g-x",
@@ -139,7 +140,7 @@ var p = {
139
140
  bannerWrapper: "ick-bannerWrapper-URah",
140
141
  buttonWrapper: "ick-buttonWrapper-3eYt",
141
142
  fyi: "ick-fyi-9rqo"
142
- }, h = {
143
+ }, _ = {
143
144
  staggerIn: .07,
144
145
  stiffness: 100,
145
146
  damping: 36,
@@ -150,22 +151,22 @@ var p = {
150
151
  offsetOut: -10,
151
152
  blurOut: 10
152
153
  };
153
- function g({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: a = "This is inline chat experience", version: c = "v1.0.0", description: u = "Exploration of having the input be the same as response. Or better said input morphing into chat bubble and maintains the continuous experience.", status: f = p, motionConfig: g }) {
154
- let _ = {
155
- ...h,
156
- ...g
154
+ function v({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: a = "This is inline chat experience", version: c = "v1.0.0", description: u = "Exploration of having the input be the same as response. Or better said input morphing into chat bubble and maintains the continuous experience.", status: d = h, motionConfig: f }) {
155
+ let m = {
156
+ ..._,
157
+ ...f
157
158
  }, v = {
158
159
  hidden: {},
159
- visible: { transition: { staggerChildren: _.staggerIn } },
160
+ visible: { transition: { staggerChildren: m.staggerIn } },
160
161
  exit: { transition: {
161
- staggerChildren: _.staggerOut,
162
+ staggerChildren: m.staggerOut,
162
163
  staggerDirection: -1
163
164
  } }
164
165
  }, y = {
165
166
  hidden: {
166
167
  opacity: 0,
167
- filter: `blur(${_.blurIn}px)`,
168
- y: _.offsetIn
168
+ filter: `blur(${m.blurIn}px)`,
169
+ y: m.offsetIn
169
170
  },
170
171
  visible: {
171
172
  opacity: 1,
@@ -173,16 +174,16 @@ function g({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: a = "T
173
174
  y: 0,
174
175
  transition: {
175
176
  type: "spring",
176
- stiffness: _.stiffness,
177
- damping: _.damping
177
+ stiffness: m.stiffness,
178
+ damping: m.damping
178
179
  }
179
180
  },
180
181
  exit: {
181
182
  opacity: 0,
182
- filter: `blur(${_.blurOut}px)`,
183
- y: _.offsetOut,
183
+ filter: `blur(${m.blurOut}px)`,
184
+ y: m.offsetOut,
184
185
  transition: {
185
- duration: _.durationOut,
186
+ duration: m.durationOut,
186
187
  ease: [
187
188
  .23,
188
189
  1,
@@ -193,40 +194,40 @@ function g({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: a = "T
193
194
  }
194
195
  };
195
196
  return /* @__PURE__ */ o(l.div, {
196
- className: m.page,
197
+ className: g.page,
197
198
  variants: v,
198
199
  initial: "hidden",
199
200
  animate: "visible",
200
201
  exit: "exit",
201
202
  children: /* @__PURE__ */ s("div", {
202
- className: m.container,
203
+ className: g.container,
203
204
  children: [
204
205
  /* @__PURE__ */ s("div", {
205
- className: m.infoContainer,
206
+ className: g.infoContainer,
206
207
  children: [t && /* @__PURE__ */ o(l.div, {
207
208
  variants: y,
208
209
  children: t
209
210
  }), /* @__PURE__ */ s("div", {
210
- className: m.content,
211
+ className: g.content,
211
212
  children: [/* @__PURE__ */ s("div", {
212
- className: m.introContent,
213
+ className: g.introContent,
213
214
  children: [/* @__PURE__ */ s(l.div, {
214
- className: m.nameContent,
215
+ className: g.nameContent,
215
216
  variants: y,
216
217
  children: [/* @__PURE__ */ o("span", {
217
- className: m.welcome,
218
+ className: g.welcome,
218
219
  children: i
219
220
  }), /* @__PURE__ */ o("span", {
220
- className: m.title,
221
+ className: g.title,
221
222
  children: a
222
223
  })]
223
224
  }), /* @__PURE__ */ o(l.span, {
224
- className: m.version,
225
+ className: g.version,
225
226
  variants: y,
226
227
  children: c
227
228
  })]
228
229
  }), /* @__PURE__ */ o(l.p, {
229
- className: m.description,
230
+ className: g.description,
230
231
  variants: y,
231
232
  children: u
232
233
  })]
@@ -234,8 +235,8 @@ function g({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: a = "T
234
235
  }),
235
236
  /* @__PURE__ */ o(l.div, {
236
237
  variants: y,
237
- className: m.bannerWrapper,
238
- children: /* @__PURE__ */ o(d, { status: f })
238
+ className: g.bannerWrapper,
239
+ children: /* @__PURE__ */ o(p, { status: d })
239
240
  }),
240
241
  /* @__PURE__ */ o(l.div, {
241
242
  variants: y,
@@ -251,7 +252,7 @@ function g({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: a = "T
251
252
  }),
252
253
  /* @__PURE__ */ s(l.div, {
253
254
  variants: y,
254
- className: m.buttonWrapper,
255
+ className: g.buttonWrapper,
255
256
  children: [/* @__PURE__ */ o(e, {
256
257
  variant: "glass",
257
258
  size: "m",
@@ -265,20 +266,20 @@ function g({ logo: t, back: n, onStart: r, welcome: i = "Welcome", title: a = "T
265
266
  }
266
267
  //#endregion
267
268
  //#region src/demo/scriptedApi.ts
268
- var _ = /* @__PURE__ */ new Map(), v = [
269
+ var y = /* @__PURE__ */ new Map(), b = [
269
270
  "Particle physics studies the most fundamental constituents of matter and the forces that act between them.",
270
271
  "The **Standard Model** organises them into three families:",
271
272
  "- twelve fermions — six quarks and six leptons\n- the force-carrying bosons\n- the Higgs, which gives the rest their mass",
272
273
  "The Higgs boson, found at CERN in 2012, completes the picture by giving elementary particles their mass through interaction with the Higgs field."
273
- ], y = [
274
+ ], x = [
274
275
  "The Higgs boson is a *point particle* — it has no measurable spatial extent at any scale we can currently probe.",
275
276
  "| property | value |\n| --- | --- |\n| mass | ~125 GeV/c² |\n| charge | 0 |\n| spin | 0 |",
276
277
  "So 'how big is it' has only one honest answer: it has no size, only `mass` and quantum numbers."
277
- ], b = ["Here is what I would do, in order. The first two are cheap and tell us whether the rest is worth doing."], x = [
278
+ ], S = ["Here is what I would do, in order. The first two are cheap and tell us whether the rest is worth doing."], C = [
278
279
  "The current combined figure is **125.25 GeV/c²**[^1], from ATLAS and CMS together — separately, neither experiment gets there.",
279
280
  "It is known to about a fifth of a percent[^2], which for a particle discovered in 2012 is a remarkably tight number.",
280
281
  "The uncertainty is now dominated by systematics rather than statistics[^3] — more collisions alone will not sharpen it much further."
281
- ], S = [
282
+ ], w = [
282
283
  {
283
284
  id: "atlas-cms",
284
285
  title: "Combined measurement of the Higgs boson mass",
@@ -298,7 +299,7 @@ var _ = /* @__PURE__ */ new Map(), v = [
298
299
  origin: "cms.cern",
299
300
  url: "https://example.com/systematics"
300
301
  }
301
- ], C = [
302
+ ], T = [
302
303
  {
303
304
  id: "read",
304
305
  label: "Read what is being asked",
@@ -314,7 +315,7 @@ var _ = /* @__PURE__ */ new Map(), v = [
314
315
  label: "Check which is the limiting one now",
315
316
  body: "Statistics used to dominate. It is systematics now, and that changes what more data would buy."
316
317
  }
317
- ], w = [
318
+ ], E = [
318
319
  {
319
320
  id: "setup",
320
321
  type: "inputs",
@@ -387,28 +388,28 @@ var _ = /* @__PURE__ */ new Map(), v = [
387
388
  }
388
389
  ]
389
390
  }
390
- ], T = (e) => new Promise((t) => setTimeout(t, e));
391
- async function* E(e) {
392
- for (let t of e.join("\n\n").split(/(\s+)/)) await T(24), yield t;
391
+ ], D = (e) => new Promise((t) => setTimeout(t, e));
392
+ async function* O(e) {
393
+ for (let t of e.join("\n\n").split(/(\s+)/)) await D(24), yield t;
393
394
  }
394
- async function* D(e, t) {
395
+ async function* k(e, t) {
395
396
  let n = "";
396
397
  for (let r of t) n += (n ? "\n\n" : "") + r, yield {
397
398
  kind: "reasoning",
398
399
  id: e,
399
400
  text: n,
400
401
  state: "thinking"
401
- }, await T(420);
402
+ }, await D(420);
402
403
  yield {
403
404
  kind: "reasoning",
404
405
  id: e,
405
406
  state: "done"
406
407
  };
407
408
  }
408
- var O = {
409
+ var A = {
409
410
  query: "higgs boson mass measurement",
410
411
  limit: 3
411
- }, k = {
412
+ }, j = {
412
413
  results: [{
413
414
  title: "ATLAS and CMS combined measurement",
414
415
  url: "https://example.com/atlas-cms",
@@ -420,25 +421,25 @@ var O = {
420
421
  }],
421
422
  took_ms: 412
422
423
  };
423
- async function* A(e) {
424
+ async function* M(e) {
424
425
  yield {
425
426
  kind: "tool",
426
427
  id: e,
427
428
  name: "search_web",
428
429
  state: "running",
429
430
  summary: "Searching the web",
430
- input: O
431
- }, await T(900), yield {
431
+ input: A
432
+ }, await D(900), yield {
432
433
  kind: "tool",
433
434
  id: e,
434
435
  name: "search_web",
435
436
  state: "done",
436
437
  summary: "2 results",
437
- output: k,
438
+ output: j,
438
439
  duration: 412
439
440
  };
440
441
  }
441
- var j = [
442
+ var N = [
442
443
  {
443
444
  id: "read",
444
445
  label: "Read the care plan"
@@ -456,42 +457,42 @@ var j = [
456
457
  label: "Draft the questions for the family"
457
458
  }
458
459
  ];
459
- async function* M(e) {
460
- for (let t = 0; t <= j.length; t++) yield {
460
+ async function* P(e) {
461
+ for (let t = 0; t <= N.length; t++) yield {
461
462
  kind: "tasks",
462
463
  id: e,
463
464
  title: "Plan",
464
465
  collapsible: !0,
465
- tasks: j.map((e, n) => ({
466
+ tasks: N.map((e, n) => ({
466
467
  ...e,
467
468
  state: n < t ? "done" : n === t ? "running" : "pending"
468
469
  }))
469
- }, await T(800);
470
+ }, await D(800);
470
471
  }
471
- async function* N(e) {
472
- for (let t = 0; t < C.length; t++) yield {
472
+ async function* F(e) {
473
+ for (let t = 0; t < T.length; t++) yield {
473
474
  kind: "chain",
474
475
  id: e,
475
476
  state: "thinking",
476
- steps: C.slice(0, t + 1).map((e, n) => ({
477
+ steps: T.slice(0, t + 1).map((e, n) => ({
477
478
  ...e,
478
479
  state: n < t ? "done" : "running"
479
480
  }))
480
- }, await T(700);
481
+ }, await D(700);
481
482
  yield {
482
483
  kind: "chain",
483
484
  id: e,
484
485
  state: "done",
485
- steps: C.map((e) => ({
486
+ steps: T.map((e) => ({
486
487
  ...e,
487
488
  state: "done"
488
489
  }))
489
490
  };
490
491
  }
491
- var P = (e, ...t) => {
492
+ var I = (e, ...t) => {
492
493
  let n = e.toLowerCase();
493
494
  return t.some((e) => n.includes(e));
494
- }, F = ["I can see it. Whatever you send along with a message arrives here the same way the text does — one `attachments` array on the turn, and the composer that held it is the same one that shows it afterwards.", "This demo does not read the picture; there is no model behind it. A real one would get the file and the sentence in the same request."], I = [[
495
+ }, L = ["I can see it. Whatever you send along with a message arrives here the same way the text does — one `attachments` array on the turn, and the composer that held it is the same one that shows it afterwards.", "This demo does not read the picture; there is no model behind it. A real one would get the file and the sentence in the same request."], R = [[
495
496
  "Another way to put it: particle physics is the study of what is left when you stop dividing.",
496
497
  "Everything in the Standard Model is there because dividing it further stopped producing anything smaller — twelve fermions, the bosons that carry the forces between them, and the Higgs.",
497
498
  "The interesting part is not the list. It is that the list is *short*, and that nothing found since 1973 has needed adding to it."
@@ -499,41 +500,41 @@ var P = (e, ...t) => {
499
500
  "Once more, from the other end. Start with the four forces and ask what carries each one.",
500
501
  "Electromagnetism has the photon. The strong force has gluons. The weak force has the W and Z. Gravity has no entry here at all — which is the honest shape of the field's biggest open problem.",
501
502
  "Matter is what those forces act on: quarks, which feel the strong force, and leptons, which do not."
502
- ]], L = "Week 1 — base\nMon rest\nTue 4 km easy, conversational pace\nWed cross-train, 30 min\nThu 5 × 400 m at 5k effort, 90 s jog between\nFri rest\nSat 6 km easy\nSun 20 min walk\n\nWeek 2 — base\nMon rest\nTue 5 km easy\nWed cross-train, 35 min\nThu 6 × 400 m, 90 s jog between\nFri rest\nSat 7 km easy, last kilometre at pace\nSun 20 min walk\n\nWeek 3 — build\nMon rest\nTue 5 km easy\nWed cross-train, 35 min\nThu 4 × 800 m at 5k effort, 2 min jog between\nFri rest\nSat 8 km easy\nSun 20 min walk\n\nWeek 4 — cut back\nMon rest\nTue 4 km easy\nWed cross-train, 30 min\nThu 5 × 400 m, 90 s jog between\nFri rest\nSat 5 km easy\nSun rest\n\nWeek 5 — build\nMon rest\nTue 6 km easy\nWed cross-train, 40 min\nThu 5 × 800 m, 2 min jog between\nFri rest\nSat 9 km easy\nSun 20 min walk\n\nWeek 6 — sharpen\nMon rest\nTue 6 km with 3 km at target pace\nWed cross-train, 30 min\nThu 8 × 400 m, 60 s jog between\nFri rest\nSat 8 km easy\nSun 20 min walk\n\nWeek 7 — sharpen\nMon rest\nTue 5 km with 4 km at target pace\nWed cross-train, 30 min\nThu 6 × 400 m, 60 s jog between\nFri rest\nSat 6 km easy\nSun rest\n\nWeek 8 — taper and race\nMon rest\nTue 4 km easy with 4 × 100 m strides\nWed rest\nThu 3 km easy\nFri rest\nSat race, 5 km\nSun 20 min walk\n\nNotes\nEasy means you can hold a conversation. If you cannot, it is not easy.\nEvery hard day is followed by a rest day; that is where the fitness is made.\nMiss a week and repeat it rather than skipping ahead to catch up.";
503
- async function* R(e, { attachments: t, turnId: n }) {
503
+ ]], z = "Week 1 — base\nMon rest\nTue 4 km easy, conversational pace\nWed cross-train, 30 min\nThu 5 × 400 m at 5k effort, 90 s jog between\nFri rest\nSat 6 km easy\nSun 20 min walk\n\nWeek 2 — base\nMon rest\nTue 5 km easy\nWed cross-train, 35 min\nThu 6 × 400 m, 90 s jog between\nFri rest\nSat 7 km easy, last kilometre at pace\nSun 20 min walk\n\nWeek 3 — build\nMon rest\nTue 5 km easy\nWed cross-train, 35 min\nThu 4 × 800 m at 5k effort, 2 min jog between\nFri rest\nSat 8 km easy\nSun 20 min walk\n\nWeek 4 — cut back\nMon rest\nTue 4 km easy\nWed cross-train, 30 min\nThu 5 × 400 m, 90 s jog between\nFri rest\nSat 5 km easy\nSun rest\n\nWeek 5 — build\nMon rest\nTue 6 km easy\nWed cross-train, 40 min\nThu 5 × 800 m, 2 min jog between\nFri rest\nSat 9 km easy\nSun 20 min walk\n\nWeek 6 — sharpen\nMon rest\nTue 6 km with 3 km at target pace\nWed cross-train, 30 min\nThu 8 × 400 m, 60 s jog between\nFri rest\nSat 8 km easy\nSun 20 min walk\n\nWeek 7 — sharpen\nMon rest\nTue 5 km with 4 km at target pace\nWed cross-train, 30 min\nThu 6 × 400 m, 60 s jog between\nFri rest\nSat 6 km easy\nSun rest\n\nWeek 8 — taper and race\nMon rest\nTue 4 km easy with 4 × 100 m strides\nWed rest\nThu 3 km easy\nFri rest\nSat race, 5 km\nSun 20 min walk\n\nNotes\nEasy means you can hold a conversation. If you cannot, it is not easy.\nEvery hard day is followed by a rest day; that is where the fitness is made.\nMiss a week and repeat it rather than skipping ahead to catch up.";
504
+ async function* B(e, { attachments: t, turnId: n }) {
504
505
  if (t.length > 0) {
505
- yield* D("r", [`${t.length === 1 ? "A file" : `${t.length} files`} came with this.`, "Say what arrived, and be honest that nothing here is looking at it."]), yield* E(F);
506
+ yield* k("r", [`${t.length === 1 ? "A file" : `${t.length} files`} came with this.`, "Say what arrived, and be honest that nothing here is looking at it."]), yield* O(L);
506
507
  return;
507
508
  }
508
- if (P(e, "plan", "training", "5k", "run ", "running", "trening", "trčanj", "trcanj")) {
509
- yield* D("r", ["Eight weeks is the shortest honest 5k build for somebody starting from a base.", "The plan is long. Put it behind a card rather than into the answer — an answer nobody can read past is not an answer."]), yield {
509
+ if (I(e, "plan", "training", "5k", "run ", "running", "trening", "trčanj", "trcanj")) {
510
+ yield* k("r", ["Eight weeks is the shortest honest 5k build for somebody starting from a base.", "The plan is long. Put it behind a card rather than into the answer — an answer nobody can read past is not an answer."]), yield {
510
511
  kind: "artifact",
511
512
  id: "plan",
512
513
  title: "5k training plan",
513
514
  state: "writing"
514
- }, yield "Here is an eight-week plan. Four sessions a week, one of them hard, and a cut-back week in the middle so the fourth week does not become the one you quit in.", await T(900), yield {
515
+ }, yield "Here is an eight-week plan. Four sessions a week, one of them hard, and a cut-back week in the middle so the fourth week does not become the one you quit in.", await D(900), yield {
515
516
  kind: "artifact",
516
517
  id: "plan",
517
518
  meta: "8 weeks · 4 sessions a week",
518
519
  preview: "text",
519
- content: L,
520
+ content: z,
520
521
  state: "done"
521
522
  }, yield " Open it to see the weeks.";
522
523
  return;
523
524
  }
524
- if (P(e, "question", "ask me", "set up", "double-slit", "experiment", "pitanj")) {
525
- yield* D("r", ["They want to be asked rather than to specify the whole thing up front.", "Three is the most anybody answers in one sitting: the geometry, then where the detector goes — which is the only choice that changes the physics — then what to plot."]), yield {
525
+ if (I(e, "question", "ask me", "set up", "double-slit", "experiment", "pitanj")) {
526
+ yield* k("r", ["They want to be asked rather than to specify the whole thing up front.", "Three is the most anybody answers in one sitting: the geometry, then where the detector goes — which is the only choice that changes the physics — then what to plot."]), yield {
526
527
  kind: "question",
527
528
  id: "q",
528
529
  title: "Setting up the run",
529
- questions: w,
530
+ questions: E,
530
531
  answers: {},
531
532
  activeIndex: 0
532
533
  };
533
534
  return;
534
535
  }
535
- if (P(e, "delete", "run ", "send an email", "permission", "approve")) {
536
- yield* D("r", ["This one changes something outside the conversation, so it is not mine to decide.", "Show what it would run, and wait."]), yield {
536
+ if (I(e, "delete", "run ", "send an email", "permission", "approve")) {
537
+ yield* k("r", ["This one changes something outside the conversation, so it is not mine to decide.", "Show what it would run, and wait."]), yield {
537
538
  kind: "approval",
538
539
  id: "ask",
539
540
  title: "Run a command in your shell",
@@ -548,71 +549,71 @@ async function* R(e, { attachments: t, turnId: n }) {
548
549
  };
549
550
  return;
550
551
  }
551
- if (P(e, "plan", "todo", "steps", "what would you do")) {
552
- yield* D("r", ["This is a sequence, not a single answer, so the plan is the answer.", "Order it so the cheap checks come first — if the medication list already matches, the rest is much smaller."]), yield* M("p"), yield* E(b);
552
+ if (I(e, "plan", "todo", "steps", "what would you do")) {
553
+ yield* k("r", ["This is a sequence, not a single answer, so the plan is the answer.", "Order it so the cheap checks come first — if the medication list already matches, the rest is much smaller."]), yield* P("p"), yield* O(S);
553
554
  return;
554
555
  }
555
- if (P(e, "sources", "cite", "how do you know", "izvor")) {
556
- yield* N("c"), yield {
556
+ if (I(e, "sources", "cite", "how do you know", "izvor")) {
557
+ yield* F("c"), yield {
557
558
  kind: "sources",
558
559
  id: "s",
559
- sources: S,
560
+ sources: w,
560
561
  title: "Sources",
561
562
  collapsible: !0
562
- }, yield* E(x);
563
+ }, yield* O(C);
563
564
  return;
564
565
  }
565
- if (P(e, "how big", "mass", "size", "weigh")) {
566
- yield* D("r", ["The question is about the Higgs boson's size, and the honest answer is that it does not have one.", "Better to give the mass instead, and say why size is the wrong question — but check the current figure first."]), yield* A("t"), yield* E(y);
566
+ if (I(e, "how big", "mass", "size", "weigh")) {
567
+ yield* k("r", ["The question is about the Higgs boson's size, and the honest answer is that it does not have one.", "Better to give the mass instead, and say why size is the wrong question — but check the current figure first."]), yield* M("t"), yield* O(x);
567
568
  return;
568
569
  }
569
- let r = (_.get(n) ?? 0) % (I.length + 1);
570
- if (_.set(n, r + 1), r > 0) {
571
- yield* D("r", ["Asked again, so the first answer did not land.", "Same physics, different way in — repeating it in other words is not answering it again."]), yield* E(I[r - 1]);
570
+ let r = (y.get(n) ?? 0) % (R.length + 1);
571
+ if (y.set(n, r + 1), r > 0) {
572
+ yield* k("r", ["Asked again, so the first answer did not land.", "Same physics, different way in — repeating it in other words is not answering it again."]), yield* O(R[r - 1]);
572
573
  return;
573
574
  }
574
- yield* D("r", ["A general question, so the answer should start from what the field is for rather than from a definition.", "Three families is the useful shape: fermions, bosons, and the Higgs."]), yield* E(v);
575
+ yield* k("r", ["A general question, so the answer should start from what the field is for rather than from a definition.", "Three families is the useful shape: fermions, bosons, and the Higgs."]), yield* O(b);
575
576
  }
576
- async function* z() {
577
- yield* E(["Marking a passage and asking about it keeps the question attached to what it is about — so the answer can be short.", "That is the whole of the thread: the quote, one question, one answer."]);
577
+ async function* V() {
578
+ yield* O(["Marking a passage and asking about it keeps the question attached to what it is about — so the answer can be short.", "That is the whole of the thread: the quote, one question, one answer."]);
578
579
  }
579
- async function* B(e, { signal: t }) {
580
+ async function* H(e, { signal: t }) {
580
581
  let n = `this is a scripted transcript standing in for about ${Math.max(1, Math.round(e.size / 12e3))} seconds of speech`.split(" ");
581
582
  for (let e of n) {
582
583
  if (await new Promise((e) => setTimeout(e, 90)), t.aborted) return;
583
584
  yield `${e} `;
584
585
  }
585
586
  }
586
- var V = { plan: "ick-plan-nXLe" }, H = 8e3, U = 900;
587
- function W({ logo: e, back: s, backHref: l = "/", backLabel: u = "Back to home", skipIntro: d = !1, theme: f, onThemeChange: p, cursor: m = !0, animationConfig: h, foldMotion: _, feedDelay: v, introMotion: y }) {
588
- let [b, x] = a(d);
589
- t(f === void 0 ? void 0 : f);
590
- let S = i({}), C = r((e, t, n, r, i) => {
587
+ var U = { plan: "ick-plan-nXLe" }, W = 8e3, G = 900;
588
+ function K({ logo: e, back: s, backHref: l = "/", backLabel: f = "Back to home", skipIntro: p = !1, theme: m, onThemeChange: h, cursor: g = !0, animationConfig: _, foldMotion: y, feedDelay: b, introMotion: x, composer: S = "inline" }) {
589
+ let [C, w] = a(p), [T, D] = a(S), O = T === "docked";
590
+ t(m === void 0 ? void 0 : m);
591
+ let k = i({}), A = r((e, t, n, r, i) => {
591
592
  let a = {
592
- ...S.current[n] ?? {},
593
+ ...k.current[n] ?? {},
593
594
  [r]: i
594
595
  };
595
- S.current[n] = a;
596
- let o = w.findIndex((e) => e.id === r) + 1, s = o >= w.length;
596
+ k.current[n] = a;
597
+ let o = E.findIndex((e) => e.id === r) + 1, s = o >= E.length;
597
598
  e(t, {
598
599
  kind: "question",
599
600
  id: n,
600
601
  title: "Setting up the run",
601
- questions: w,
602
+ questions: E,
602
603
  answers: a,
603
604
  activeIndex: s ? null : o,
604
605
  collapsible: s
605
606
  });
606
- }, []), T = r((e, t, n, r) => {
607
+ }, []), j = r((e, t, n, r) => {
607
608
  e(t, {
608
609
  kind: "question",
609
610
  id: n,
610
- questions: w,
611
- answers: S.current[n] ?? {},
611
+ questions: E,
612
+ answers: k.current[n] ?? {},
612
613
  activeIndex: r,
613
614
  collapsible: !1
614
615
  });
615
- }, []), E = r((e, t, n, r) => {
616
+ }, []), M = r((e, t, n, r) => {
616
617
  e(t, {
617
618
  kind: "approval",
618
619
  id: n,
@@ -638,13 +639,24 @@ function W({ logo: e, back: s, backHref: l = "/", backLabel: u = "Back to home",
638
639
  }, []);
639
640
  return /* @__PURE__ */ o(c, {
640
641
  mode: "wait",
641
- children: b ? /* @__PURE__ */ o(n, {
642
- onSend: R,
643
- onTranscribe: B,
644
- onThreadReply: z,
642
+ children: C ? /* @__PURE__ */ o(n, {
643
+ onSend: B,
644
+ onTranscribe: H,
645
+ onThreadReply: V,
646
+ composer: T,
647
+ actions: [{
648
+ id: "composer",
649
+ label: O ? "Composer in the conversation" : "Composer at the bottom",
650
+ icon: o(O ? d : u, {
651
+ size: 16,
652
+ "aria-hidden": !0
653
+ }),
654
+ active: O,
655
+ onClick: () => D(O ? "inline" : "docked")
656
+ }],
645
657
  title: "inline chat experience",
646
658
  backHref: l,
647
- backLabel: u,
659
+ backLabel: f,
648
660
  placeholder: "Ask me about particle physics…",
649
661
  empty: {
650
662
  title: "Ask me about particle physics",
@@ -659,35 +671,35 @@ function W({ logo: e, back: s, backHref: l = "/", backLabel: u = "Back to home",
659
671
  "Delete the screenshots"
660
672
  ]
661
673
  },
662
- contextTotal: H,
663
- contextBase: U,
674
+ contextTotal: W,
675
+ contextBase: G,
664
676
  artifact: () => ({
665
677
  title: "5k training plan",
666
678
  meta: "8 weeks · 4 sessions a week",
667
679
  children: /* @__PURE__ */ o("pre", {
668
- className: V.plan,
669
- children: L
680
+ className: U.plan,
681
+ children: z
670
682
  })
671
683
  }),
672
- theme: f,
673
- onThemeChange: p,
674
- cursor: m,
684
+ theme: m,
685
+ onThemeChange: h,
686
+ cursor: g,
675
687
  selectionToggle: !0,
676
- animationConfig: h,
677
- foldMotion: _,
678
- feedDelay: v,
679
- onAnswerQuestion: C,
680
- onEditQuestion: T,
681
- onDecideApproval: E
682
- }, "chat") : /* @__PURE__ */ o(g, {
688
+ animationConfig: _,
689
+ foldMotion: y,
690
+ feedDelay: b,
691
+ onAnswerQuestion: A,
692
+ onEditQuestion: j,
693
+ onDecideApproval: M
694
+ }, "chat") : /* @__PURE__ */ o(v, {
683
695
  logo: e,
684
696
  back: s,
685
- onStart: () => x(!0),
686
- motionConfig: y
697
+ onStart: () => w(!0),
698
+ motionConfig: x
687
699
  }, "intro")
688
700
  });
689
701
  }
690
702
  //#endregion
691
- export { W as ChatExperienceDemo, p as INLINE_CHAT_FEATURE_STATUS, d as InlineChatBanner, g as IntroLanding, w as QUESTIONS, L as RUNNING_PLAN, R as scriptedApi, B as scriptedTranscript, z as threadReply };
703
+ export { K as ChatExperienceDemo, h as INLINE_CHAT_FEATURE_STATUS, p as InlineChatBanner, v as IntroLanding, E as QUESTIONS, z as RUNNING_PLAN, B as scriptedApi, H as scriptedTranscript, V as threadReply };
692
704
 
693
705
  //# sourceMappingURL=demo.js.map