@tenancy.nz/chat-ui 0.1.8 → 0.1.10

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/esm/index.js CHANGED
@@ -14,7 +14,7 @@ var Ke = (r, e, t, n) => ({
14
14
  }
15
15
  });
16
16
  import lm, { useState as ve, useCallback as hr, useRef as Oe, useEffect as xs, useMemo as Sd } from "react";
17
- const OC = ':root{--bg: #f7f9fc;--panel: #ffffff;--text: #0b1324;--muted: #64748b;--accent: #1a73e8;--accent-2: #1a73e8;--danger: #e11d48;--border: #e5e7eb;--pdf-citations-width: 260px}*{box-sizing:border-box}.app{display:grid;grid-template-rows:auto 1fr auto;min-height:100%}.app-header{padding:16px 20px;border-bottom:1px solid var(--border);background:var(--panel);position:sticky;top:0}.app-header h1{margin:0;font-size:18px;letter-spacing:.2px;color:#111827}.app-header .subtitle{margin:4px 0 0;color:var(--muted);font-size:12px}.app-main{display:grid;grid-template-columns:1fr;padding:0}.app-footer{padding:10px 16px;color:var(--muted);border-top:1px solid var(--border);font-size:12px;background:var(--panel)}.chat-container{width:100%;max-width:none;background:var(--panel);border-top:1px solid var(--border);border-bottom:1px solid var(--border);border-radius:0;overflow:hidden;box-shadow:none}.chat-layout{display:grid;grid-template-columns:300px 1fr;min-height:100vh}.sidebar{border-right:1px solid var(--border);background:#fff;padding:10px;display:flex;flex-direction:column;gap:10px}.sidebar-header{display:flex;align-items:center;justify-content:space-between;font-weight:600;color:#0f172a;padding:6px 8px;border-radius:10px;border:1px solid transparent;background:linear-gradient(#fff,#fff) padding-box,linear-gradient(180deg,#0445b7,#0cc1a3) border-box}.sidebar-new{background:transparent;border:none;color:var(--accent);font-size:18px;cursor:pointer}.thread-list{overflow:auto;display:grid;gap:6px;padding-right:4px}.thread-group{display:grid;gap:6px}.thread-group-title{color:#94a3b8;font-size:11px;padding:8px 6px 0;text-transform:uppercase;letter-spacing:.04em}.thread-empty{color:var(--muted);font-size:12px;padding:12px 8px}.thread-item{text-align:left;border:0;background:#fff;color:var(--text);border-radius:8px;padding:8px;display:flex;align-items:flex-start;gap:10px;cursor:pointer}.thread-item:hover{background:#f8fafc}.thread-item.active{background:#f8fafc;box-shadow:inset 0 0 0 1px #e5e7eb}.thread-icon{width:24px;height:24px;color:#94a3b8;display:grid;place-items:center}.thread-text{display:grid;gap:4px}.thread-date{font-size:10px;color:#a4a4a4;font-family:Montserrat,Inter,ui-sans-serif,system-ui}.thread-title{font-size:12px;font-weight:500;color:#0b1324;font-family:Montserrat,Inter,ui-sans-serif,system-ui}.messages-main{display:flex;flex-direction:column}.messages{height:calc(100vh - 100px);overflow:auto;padding:28px 40px;display:flex;flex-direction:column;gap:12px;background:#fff;position:relative}.messages-loading{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:#fffc;-webkit-backdrop-filter:blur(2px) saturate(110%);backdrop-filter:blur(2px) saturate(110%);z-index:5}.messages-loading .loading-inner{display:inline-flex;align-items:center;gap:10px;padding:10px 14px;border-radius:999px;border:1px solid rgba(0,0,0,.06);background:#fff;box-shadow:0 8px 18px #00000014;color:#374151;font-size:13px}.message{display:flex}.message.user{justify-content:flex-end}.message.assistant{justify-content:flex-start;align-items:flex-start;gap:12px}.bubble{max-width:80%;padding:12px 14px;border-radius:12px;line-height:1.6;white-space:normal;word-wrap:break-word;font-size:14px;color:#1f2937;font-family:Montserrat,Inter,ui-sans-serif,system-ui}.message.user .bubble{background:linear-gradient(#fff,#fff) padding-box,linear-gradient(180deg,#0445b7,#0cc1a3) border-box;color:#0b1324;border:1px solid transparent;border-bottom-right-radius:4px}.message.assistant .bubble{background:#fff;border:1px solid #e5e7eb;color:#0b1324;border-bottom-left-radius:4px}.message.assistant .bubble-plain{background:transparent;border:0;padding:0;max-width:72ch;font-size:14px;color:#364152;font-family:Montserrat,Inter,ui-sans-serif,system-ui;line-height:1.55}.message.assistant .bubble-plain p,.bubble p{margin:0 0 8px}.bubble>*:first-child{margin-top:0}.bubble>*:last-child{margin-bottom:0}.bubble ul,.bubble ol{margin:8px 0 8px 18px;padding:0}.bubble li{margin:4px 0}.bubble h1,.bubble h2,.bubble h3,.bubble h4,.bubble h5,.bubble h6{margin:10px 0 6px;line-height:1.3}.bubble pre{margin:8px 0;padding:10px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:8px;overflow:auto}.bubble code:not(pre code){background:#f3f4f6;padding:1px 4px;border-radius:4px}.bubble table{border-collapse:collapse;margin:8px 0}.bubble th,.bubble td{border:1px solid #e5e7eb;padding:6px 8px}.message.assistant .bubble-plain a{color:var(--accent);text-decoration:underline;text-underline-offset:2px}.avatar{width:28px;height:28px;border-radius:9999px;background:transparent;border:0;display:grid;place-items:center;color:var(--accent);font-size:14px;margin-top:3px}.avatar-star{transform:rotate(12deg)}.bubble-pending{opacity:.8;font-style:italic}.msg-toolbar{display:flex;align-items:center;gap:12px;margin-left:40px}.msg-divider{height:1px;background:#e5e7eb;flex:1}.btn-copy{background:transparent;border:1px solid var(--border);color:var(--muted);border-radius:8px;padding:4px 8px;font-size:12px;cursor:pointer;display:inline-flex;align-items:center;gap:6px}.btn-copy:hover{color:#111827;border-color:#cfd8e3}.sources-hud{margin-top:14px;border:1px solid #dbe7ff;background:#f8fafc;padding:6px 6px 8px;border-radius:8px;max-width:86%}.sources-copy{display:flex;align-items:center;gap:6px;margin:8px 0 6px}.msg-subdivider{height:1px;background:#f3f3f3;margin:10px 0 6px}.sources-header{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:6px}.sources-title{font-size:10px;color:#6b7280;margin:0;text-transform:uppercase;letter-spacing:.04em}.sources-list{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:6px}.source-item{display:flex;align-items:center;gap:6px}.source-link{display:inline-flex;align-items:center;gap:6px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;padding:6px 8px;font-size:11px;cursor:pointer;min-width:160px;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.source-link:hover{border-color:#d1d5db;background:#f9fafb}.source-rank{font-weight:600;color:var(--accent)}.source-name{font-weight:500;color:#0b1324;overflow:hidden;text-overflow:ellipsis}.source-page{color:#6b7280}.source-score{margin-left:auto;font-variant-numeric:tabular-nums;color:#6b7280}.source-open{text-decoration:none;font-size:12px}.btn-copy-inline{border:0;background:transparent;padding:0;color:#1a73e8;display:inline-flex;align-items:center;gap:6px;font-size:12px}.btn-copy-inline:hover{text-decoration:underline}.message-divider{height:1px;background:#f3f3f3;margin:10px 0 2px 40px}.message.user{align-items:center;gap:8px}.user-bubble{background:#e8f0fe;border:1px solid #dbe7ff;color:#0b1324;box-shadow:0 1px 2px #0000000a,0 3px 10px #0445b71a}.user-avatar{width:28px;height:28px;border-radius:9999px;background:linear-gradient(#e2e8f0,#e2e8f0) padding-box,linear-gradient(180deg,#0445b7,#0cc1a3) border-box;color:#274a9a;display:grid;place-items:center;font-size:12px;font-weight:600;font-family:Montserrat,Inter,ui-sans-serif,system-ui;border:1px solid transparent}.user-avatar-img{width:28px;height:28px;border-radius:8px;object-fit:cover;display:inline-block}.modal{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:2vh 2vw;z-index:1000;visibility:hidden;opacity:0;pointer-events:none;background:#ffffff8c;-webkit-backdrop-filter:blur(8px) saturate(120%);backdrop-filter:blur(8px) saturate(120%);transition:opacity .12s ease-in-out,visibility .12s ease-in-out}.modal.open{visibility:visible;opacity:1;pointer-events:auto}.modal-content{background:#fff;width:min(92vw,800px);max-width:min(92vw,800px);max-height:680px;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 8px 24px #0000001f;overflow:hidden;display:flex;flex-direction:column}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid rgba(0,0,0,.06)}.modal-title{font-weight:600;color:#111827}.modal-close{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;color:#6b7280;border:0;font-size:20px;line-height:1;width:28px;height:28px;display:inline-grid;place-items:center;border-radius:6px;cursor:pointer}.modal-body{height:680px;overflow:hidden;position:relative;padding:0}.modal-body.panning{cursor:grabbing}.pdf-stage canvas{display:block}.pdf-viewer{position:relative;min-height:320px}.pdf-blocker{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:#fff;z-index:5}.pdf-loading{display:flex;align-items:center;justify-content:center;height:320px}.spinner{width:28px;height:28px;border:3px solid #e5e7eb;border-top-color:var(--accent);border-radius:50%;animation:spin .9s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.composer{padding:14px;border-top:1px solid var(--border);background:#f8fafc}.messages-main .composer{position:sticky;bottom:0;border-top:none;background:#fff;padding:16px}.composer-field{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid #dfe3ea;border-radius:10px;padding:0 6px 0 2px;box-shadow:0 12px 28px #0000001a,0 3px 8px #0445b733}.composer-field:focus-within{border-color:var(--accent);box-shadow:0 16px 36px #0000001f,0 4px 10px #0445b73d}.composer-field input{flex:1;height:46px;border:0;outline:none;background:transparent;padding:0 12px 0 14px;font-size:14px}.composer-field textarea{flex:1;min-height:44px;max-height:200px;border:0;outline:none;background:transparent;padding:10px 12px 10px 14px;font-size:14px;line-height:1.5;resize:none;font-family:inherit}.composer-send{width:36px;height:36px;border-radius:9999px;background:var(--accent);color:#fff;border:none;display:grid;place-items:center;cursor:pointer}.composer-send:disabled{opacity:.6;cursor:not-allowed}.error{color:var(--danger);padding:0 16px 14px;font-size:13px}.empty-hero{display:grid;place-items:center;height:calc(100vh - 140px);background:#fff}.empty-hero-inner{text-align:center}.empty-hero h1{margin:0 0 6px;font-family:Montserrat,Inter,ui-sans-serif;font-weight:800;color:#0b1324;font-size:36px;letter-spacing:.2px}.empty-hero p{margin:0 0 18px;color:#64748b;font-size:16px}.chip-row{display:flex;flex-wrap:wrap;gap:10px;justify-content:center}.chip{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;color:#0b1324;border-radius:9999px;padding:8px 14px;font-size:13px;cursor:pointer;border:1px solid #cfe0ff;box-shadow:0 1px 2px #00000005}.chip:hover{background:#f8fbff;border-color:#bcd3ff}.skeleton{position:relative;overflow:hidden;background:#f3f4f6}.skeleton:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background:linear-gradient(90deg,#fff0,#fff9,#fff0);animation:shimmer 1.2s infinite}@keyframes shimmer{to{transform:translate(100%)}}.skeleton-line{height:12px;border-radius:6px;margin:8px 0}.skeleton-line.sm{height:10px}.skeleton-line.lg{height:14px}.w40{width:40%}.w60{width:60%}.w80{width:80%}.w100{width:100%}.pdf-thumbs{width:130px;min-width:110px;max-width:160px;border-left:1px solid #eef2f7;background:#fbfbfb;overflow:auto}.pdf-thumbs-list{list-style:none;margin:0;padding:8px;display:grid;gap:8px}.pdf-thumb{display:grid;gap:6px;width:100%;border:1px solid #e5e7eb;background:#fff;border-radius:8px;padding:6px;cursor:pointer}.pdf-thumb.active{outline:2px solid #1a73e8;outline-offset:0}.pdf-thumb img{display:block;width:100%;height:auto;border-radius:4px}.thumb-label{font-size:11px;color:#6b7280;justify-self:center}.thumb-skeleton{background:#f3f4f6;border-radius:6px;position:relative;overflow:hidden}.thumb-skeleton:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background:linear-gradient(90deg,#fff0,#fff9,#fff0);animation:shimmer 1.2s infinite}.pdf-citations{flex:0 0 var(--pdf-citations-width);width:var(--pdf-citations-width);border-right:1px solid #eef2f7;background:#fbfbfb;overflow-y:auto;overflow-x:hidden;padding:8px 12px 12px 8px;box-sizing:border-box}.pdf-citations *{max-width:100%;word-break:break-word}.pdf-container{display:flex;width:100%;height:100%;gap:0}.pdf-content{flex:1;min-width:0;overflow:hidden;padding:0 16px}.pdf-toolbar{position:sticky;bottom:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border-top:1px solid rgba(0,0,0,.06);box-shadow:0 -4px 8px #00000008;padding:8px 12px}.pdf-toolbar-left{display:flex;gap:8px}.pdf-btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(180deg,#fff,#f7f7f7);border:1px solid rgba(0,0,0,.12);color:#111827;width:34px;height:34px;display:inline-grid;place-items:center;border-radius:8px;cursor:pointer}.pdf-btn:disabled{opacity:.5;cursor:not-allowed}.pdf-page-label{font-size:13px;color:#374151}.typing-hud{position:sticky;bottom:0;display:flex;justify-content:flex-start;padding:10px 0;background:linear-gradient(180deg,#fff0,#ffffffd9 40%,#fff)}.typing-hud-inner{display:inline-flex;align-items:center;gap:10px;padding:8px 12px;border-radius:999px;border:1px solid rgba(0,0,0,.08);box-shadow:0 4px 14px #0000000f;background:linear-gradient(90deg,#fff,#fafbff,#fff);background-size:200% 100%;color:#3b3b3b;font-size:13px;line-height:1;animation:shimmerBg 2.2s ease-in-out infinite}.typing-dot{width:10px;height:10px;border-radius:50%;background:linear-gradient(180deg,#5446e6,#1a73e8);box-shadow:0 0 0 2px #1a73e81f;animation:pulseDot 1.4s ease-in-out infinite}.typing-text{opacity:.9}.pdf-sources{width:100%}.pdf-sources-title{padding:10px 10px 6px;font-size:12px;font-weight:600;color:#374151}.pdf-sources-list{list-style:none;margin:0;padding:0 12px 12px 8px;display:flex;flex-direction:column;gap:8px;box-sizing:border-box}.pdf-source-item{display:flex;width:100%;text-align:left;gap:8px;padding:10px 12px;border-radius:8px;border:1px solid rgba(0,0,0,.08);background:transparent;color:#111827;cursor:pointer}.pdf-source-item.active{background:#1976d214}.pdf-source-rank{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;background:linear-gradient(180deg,#fff,#f7f7f7);border:1px solid rgba(0,0,0,.12);font-size:12px;color:#374151}.pdf-source-text{display:inline-block;overflow:hidden}.pdf-source-filename{display:block;font-size:12px;font-weight:600;color:#111827}.pdf-source-page{display:block;font-size:11px;color:#6b7280}.pdf-source-snippet{display:block;font-size:11px;color:#6b7280;margin-top:2px;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media (max-width: 1280px){.modal-content{width:95vw}}@media (max-width: 1024px){.pdf-thumbs,.pdf-citations{display:none}.modal-content{width:96vw;height:92vh}}@media (max-width: 640px){.modal-content{width:98vw;height:92vh;border-radius:10px}}@media (max-width: 900px){.chat-layout{grid-template-columns:1fr;position:relative}.sidebar{position:fixed;top:0;bottom:0;left:0;width:min(86vw,320px);max-width:92vw;transform:translate(-100%);transition:transform .2s ease-in-out;z-index:1000;box-shadow:0 10px 30px #0000002e}.chat-container.drawer-open .sidebar{transform:translate(0)}.drawer-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000005c;-webkit-backdrop-filter:saturate(120%) blur(2px);backdrop-filter:saturate(120%) blur(2px);z-index:900}.mobile-bar{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--border);background:#fff;position:sticky;top:0;z-index:10}.sidebar-toggle{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;color:#111827;border:1px solid #e5e7eb;border-radius:8px;width:36px;height:36px;display:inline-grid;place-items:center;cursor:pointer}}@media (min-width: 901px){.mobile-bar{display:none}}.new-messages-chip{position:fixed;left:50%;transform:translate(-50%);bottom:96px;z-index:50}.older-messages{display:flex;justify-content:center;margin:8px 0}.toasts{position:fixed;top:16px;right:16px;display:grid;gap:8px;z-index:2000}.toast{background:#111827;color:#fff;border-radius:8px;padding:10px 12px;font-size:13px;box-shadow:0 10px 20px #0003}.toast.error{background:#b91c1c}.toast.success{background:#065f46}';
17
+ const DC = ':root{--bg: #f7f9fc;--panel: #ffffff;--text: #0b1324;--muted: #64748b;--accent: #1a73e8;--accent-2: #1a73e8;--danger: #e11d48;--border: #e5e7eb;--pdf-citations-width: 260px}*{box-sizing:border-box}.app{display:grid;grid-template-rows:auto 1fr auto;min-height:100%}.app-header{padding:16px 20px;border-bottom:1px solid var(--border);background:var(--panel);position:sticky;top:0}.app-header h1{margin:0;font-size:18px;letter-spacing:.2px;color:#111827}.app-header .subtitle{margin:4px 0 0;color:var(--muted);font-size:12px}.app-main{display:grid;grid-template-columns:1fr;padding:0}.app-footer{padding:10px 16px;color:var(--muted);border-top:1px solid var(--border);font-size:12px;background:var(--panel)}.chat-container{width:100%;max-width:none;background:var(--panel);border-top:1px solid var(--border);border-bottom:1px solid var(--border);border-radius:0;overflow:hidden;box-shadow:none}.chat-layout{display:grid;grid-template-columns:300px 1fr;min-height:100vh}.sidebar{border-right:1px solid var(--border);background:#fff;padding:10px;display:flex;flex-direction:column;gap:10px}.sidebar-header{display:flex;align-items:center;justify-content:space-between;font-weight:600;color:#0f172a;padding:6px 8px;border-radius:10px;border:1px solid transparent;background:linear-gradient(#fff,#fff) padding-box,linear-gradient(180deg,#0445b7,#0cc1a3) border-box}.sidebar-new{background:transparent;border:none;color:var(--accent);font-size:18px;cursor:pointer}.thread-list{overflow:auto;display:grid;gap:6px;padding-right:4px}.thread-group{display:grid;gap:6px}.thread-group-title{color:#94a3b8;font-size:11px;padding:8px 6px 0;text-transform:uppercase;letter-spacing:.04em}.thread-empty{color:var(--muted);font-size:12px;padding:12px 8px}.thread-item{text-align:left;border:0;background:#fff;color:var(--text);border-radius:8px;padding:8px;display:flex;align-items:flex-start;gap:10px;cursor:pointer}.thread-item:hover{background:#f8fafc}.thread-item.active{background:#f8fafc;box-shadow:inset 0 0 0 1px #e5e7eb}.thread-icon{width:24px;height:24px;color:#94a3b8;display:grid;place-items:center}.thread-text{display:grid;gap:4px}.thread-date{font-size:10px;color:#a4a4a4;font-family:Montserrat,Inter,ui-sans-serif,system-ui}.thread-title{font-size:12px;font-weight:500;color:#0b1324;font-family:Montserrat,Inter,ui-sans-serif,system-ui}.messages-main{display:flex;flex-direction:column}.messages{height:calc(100vh - 100px);overflow:auto;padding:28px 40px;display:flex;flex-direction:column;gap:12px;background:#fff;position:relative}.messages-loading{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:#fffc;-webkit-backdrop-filter:blur(2px) saturate(110%);backdrop-filter:blur(2px) saturate(110%);z-index:5}.messages-loading .loading-inner{display:inline-flex;align-items:center;gap:10px;padding:10px 14px;border-radius:999px;border:1px solid rgba(0,0,0,.06);background:#fff;box-shadow:0 8px 18px #00000014;color:#374151;font-size:13px}.message{display:flex}.message.user{justify-content:flex-end}.message.assistant{justify-content:flex-start;align-items:flex-start;gap:12px}.bubble{max-width:80%;padding:12px 14px;border-radius:12px;line-height:1.6;white-space:normal;word-wrap:break-word;font-size:14px;color:#1f2937;font-family:Montserrat,Inter,ui-sans-serif,system-ui}.message.user .bubble{background:linear-gradient(#fff,#fff) padding-box,linear-gradient(180deg,#0445b7,#0cc1a3) border-box;color:#0b1324;border:1px solid transparent;border-bottom-right-radius:4px}.message.assistant .bubble{background:#fff;border:1px solid #e5e7eb;color:#0b1324;border-bottom-left-radius:4px}.message.assistant .bubble-plain{background:transparent;border:0;padding:0;max-width:72ch;font-size:14px;color:#364152;font-family:Montserrat,Inter,ui-sans-serif,system-ui;line-height:1.55}.message.assistant .bubble-plain p,.bubble p{margin:0 0 8px}.bubble>*:first-child{margin-top:0}.bubble>*:last-child{margin-bottom:0}.bubble ul,.bubble ol{margin:8px 0 8px 18px;padding:0}.bubble li{margin:4px 0}.bubble h1,.bubble h2,.bubble h3,.bubble h4,.bubble h5,.bubble h6{margin:10px 0 6px;line-height:1.3}.bubble pre{margin:8px 0;padding:10px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:8px;overflow:auto}.bubble code:not(pre code){background:#f3f4f6;padding:1px 4px;border-radius:4px}.bubble table{border-collapse:collapse;margin:8px 0}.bubble th,.bubble td{border:1px solid #e5e7eb;padding:6px 8px}.message.assistant .bubble-plain a{color:var(--accent);text-decoration:underline;text-underline-offset:2px}.avatar{width:28px;height:28px;border-radius:9999px;background:transparent;border:0;display:grid;place-items:center;color:var(--accent);font-size:14px;margin-top:3px}.avatar-star{transform:rotate(12deg)}.bubble-pending{opacity:.8;font-style:italic}.msg-toolbar{display:flex;align-items:center;gap:12px;margin-left:40px}.msg-divider{height:1px;background:#e5e7eb;flex:1}.btn-copy{background:transparent;border:1px solid var(--border);color:var(--muted);border-radius:8px;padding:4px 8px;font-size:12px;cursor:pointer;display:inline-flex;align-items:center;gap:6px}.btn-copy:hover{color:#111827;border-color:#cfd8e3}.sources-hud{margin-top:14px;border:1px solid #dbe7ff;background:#f8fafc;padding:6px 6px 8px;border-radius:8px;max-width:86%}.sources-copy{display:flex;align-items:center;gap:6px;margin:8px 0 6px}.msg-subdivider{height:1px;background:#f3f3f3;margin:10px 0 6px}.sources-header{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:6px}.sources-title{font-size:10px;color:#6b7280;margin:0;text-transform:uppercase;letter-spacing:.04em}.sources-list{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:6px}.source-item{display:flex;align-items:center;gap:6px}.source-link{display:inline-flex;align-items:center;gap:6px;border:1px solid #e5e7eb;background:#fff;border-radius:8px;padding:6px 8px;font-size:11px;cursor:pointer;min-width:160px;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.source-link:hover{border-color:#d1d5db;background:#f9fafb}.source-rank{font-weight:600;color:var(--accent)}.source-name{font-weight:500;color:#0b1324;overflow:hidden;text-overflow:ellipsis}.source-page{color:#6b7280}.source-score{margin-left:auto;font-variant-numeric:tabular-nums;color:#6b7280}.source-open{text-decoration:none;font-size:12px}.btn-copy-inline{border:0;background:transparent;padding:0;color:#1a73e8;display:inline-flex;align-items:center;gap:6px;font-size:12px}.btn-copy-inline:hover{text-decoration:underline}.message-divider{height:1px;background:#f3f3f3;margin:10px 0 2px 40px}.message.user{align-items:center;gap:8px}.user-bubble{background:#e8f0fe;border:1px solid #dbe7ff;color:#0b1324;box-shadow:0 1px 2px #0000000a,0 3px 10px #0445b71a}.user-avatar{width:28px;height:28px;border-radius:9999px;background:linear-gradient(#e2e8f0,#e2e8f0) padding-box,linear-gradient(180deg,#0445b7,#0cc1a3) border-box;color:#274a9a;display:grid;place-items:center;font-size:12px;font-weight:600;font-family:Montserrat,Inter,ui-sans-serif,system-ui;border:1px solid transparent}.user-avatar-img{width:28px;height:28px;border-radius:8px;object-fit:cover;display:inline-block}.modal{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:2vh 2vw;z-index:1000;visibility:hidden;opacity:0;pointer-events:none;background:#ffffff8c;-webkit-backdrop-filter:blur(8px) saturate(120%);backdrop-filter:blur(8px) saturate(120%);transition:opacity .12s ease-in-out,visibility .12s ease-in-out}.modal.open{visibility:visible;opacity:1;pointer-events:auto}.modal-content{background:#fff;width:min(92vw,800px);max-width:min(92vw,800px);max-height:680px;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 8px 24px #0000001f;overflow:hidden;display:flex;flex-direction:column}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid rgba(0,0,0,.06)}.modal-title{font-weight:600;color:#111827}.modal-close{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;color:#6b7280;border:0;font-size:20px;line-height:1;width:28px;height:28px;display:inline-grid;place-items:center;border-radius:6px;cursor:pointer}.modal-body{height:680px;overflow:hidden;position:relative;padding:0}.modal-body.panning{cursor:grabbing}.pdf-stage canvas{display:block}.pdf-viewer{position:relative;min-height:320px}.pdf-blocker{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:#fff;z-index:5}.pdf-loading{display:flex;align-items:center;justify-content:center;height:320px}.spinner{width:28px;height:28px;border:3px solid #e5e7eb;border-top-color:var(--accent);border-radius:50%;animation:spin .9s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.composer{padding:14px;border-top:1px solid var(--border);background:#f8fafc}.messages-main .composer{position:sticky;bottom:0;border-top:none;background:#fff;padding:16px}.composer-field{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid #dfe3ea;border-radius:10px;padding:0 6px 0 2px;box-shadow:0 12px 28px #0000001a,0 3px 8px #0445b733}.composer-field:focus-within{border-color:var(--accent);box-shadow:0 16px 36px #0000001f,0 4px 10px #0445b73d}.composer-field input{flex:1;height:46px;border:0;outline:none;background:transparent;padding:0 12px 0 14px;font-size:14px}.composer-field textarea{flex:1;min-height:44px;max-height:200px;border:0;outline:none;background:transparent;padding:10px 12px 10px 14px;font-size:14px;line-height:1.5;resize:none;font-family:inherit}.composer-send{width:36px;height:36px;border-radius:9999px;background:var(--accent);color:#fff;border:none;display:grid;place-items:center;cursor:pointer}.composer-send:disabled{opacity:.6;cursor:not-allowed}.error{color:var(--danger);padding:0 16px 14px;font-size:13px}.empty-hero{display:grid;place-items:center;height:calc(100vh - 140px);background:#fff}.empty-hero-inner{text-align:center}.empty-hero h1{margin:0 0 6px;font-family:Montserrat,Inter,ui-sans-serif;font-weight:800;color:#0b1324;font-size:36px;letter-spacing:.2px}.empty-hero p{margin:0 0 18px;color:#64748b;font-size:16px}.chip-row{display:flex;flex-wrap:wrap;gap:10px;justify-content:center}.chip{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;color:#0b1324;border-radius:9999px;padding:8px 14px;font-size:13px;cursor:pointer;border:1px solid #cfe0ff;box-shadow:0 1px 2px #00000005}.chip:hover{background:#f8fbff;border-color:#bcd3ff}.skeleton{position:relative;overflow:hidden;background:#f3f4f6}.skeleton:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background:linear-gradient(90deg,#fff0,#fff9,#fff0);animation:shimmer 1.2s infinite}@keyframes shimmer{to{transform:translate(100%)}}.skeleton-line{height:12px;border-radius:6px;margin:8px 0}.skeleton-line.sm{height:10px}.skeleton-line.lg{height:14px}.w40{width:40%}.w60{width:60%}.w80{width:80%}.w100{width:100%}.pdf-thumbs{width:130px;min-width:110px;max-width:160px;border-left:1px solid #eef2f7;background:#fbfbfb;overflow:auto}.pdf-thumbs-list{list-style:none;margin:0;padding:8px;display:grid;gap:8px}.pdf-thumb{display:grid;gap:6px;width:100%;border:1px solid #e5e7eb;background:#fff;border-radius:8px;padding:6px;cursor:pointer}.pdf-thumb.active{outline:2px solid #1a73e8;outline-offset:0}.pdf-thumb img{display:block;width:100%;height:auto;border-radius:4px}.thumb-label{font-size:11px;color:#6b7280;justify-self:center}.thumb-skeleton{background:#f3f4f6;border-radius:6px;position:relative;overflow:hidden}.thumb-skeleton:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;transform:translate(-100%);background:linear-gradient(90deg,#fff0,#fff9,#fff0);animation:shimmer 1.2s infinite}.pdf-citations{flex:0 0 var(--pdf-citations-width);width:var(--pdf-citations-width);border-right:1px solid #eef2f7;background:#fbfbfb;overflow-y:auto;overflow-x:hidden;padding:8px 12px 12px 8px;box-sizing:border-box}.pdf-citations *{max-width:100%;word-break:break-word}.pdf-container{display:flex;width:100%;height:100%;gap:0}.pdf-content{flex:1;min-width:0;overflow:hidden;padding:0 16px}.pdf-toolbar{position:sticky;bottom:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#fff;border-top:1px solid rgba(0,0,0,.06);box-shadow:0 -4px 8px #00000008;padding:8px 12px}.pdf-toolbar-left{display:flex;gap:8px}.pdf-btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:linear-gradient(180deg,#fff,#f7f7f7);border:1px solid rgba(0,0,0,.12);color:#111827;width:34px;height:34px;display:inline-grid;place-items:center;border-radius:8px;cursor:pointer}.pdf-btn:disabled{opacity:.5;cursor:not-allowed}.pdf-page-label{font-size:13px;color:#374151}.typing-hud{position:sticky;bottom:0;display:flex;justify-content:flex-start;padding:10px 0;background:linear-gradient(180deg,#fff0,#ffffffd9 40%,#fff)}.typing-hud-inner{display:inline-flex;align-items:center;gap:10px;padding:8px 12px;border-radius:999px;border:1px solid rgba(0,0,0,.08);box-shadow:0 4px 14px #0000000f;background:linear-gradient(90deg,#fff,#fafbff,#fff);background-size:200% 100%;color:#3b3b3b;font-size:13px;line-height:1;animation:shimmerBg 2.2s ease-in-out infinite}.typing-dot{width:10px;height:10px;border-radius:50%;background:linear-gradient(180deg,#5446e6,#1a73e8);box-shadow:0 0 0 2px #1a73e81f;animation:pulseDot 1.4s ease-in-out infinite}.typing-text{opacity:.9}.pdf-sources{width:100%}.pdf-sources-title{padding:10px 10px 6px;font-size:12px;font-weight:600;color:#374151}.pdf-sources-list{list-style:none;margin:0;padding:0 12px 12px 8px;display:flex;flex-direction:column;gap:8px;box-sizing:border-box}.pdf-source-item{display:flex;width:100%;text-align:left;gap:8px;padding:10px 12px;border-radius:8px;border:1px solid rgba(0,0,0,.08);background:transparent;color:#111827;cursor:pointer}.pdf-source-item.active{background:#1976d214}.pdf-source-rank{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;background:linear-gradient(180deg,#fff,#f7f7f7);border:1px solid rgba(0,0,0,.12);font-size:12px;color:#374151}.pdf-source-text{display:inline-block;overflow:hidden}.pdf-source-filename{display:block;font-size:12px;font-weight:600;color:#111827}.pdf-source-page{display:block;font-size:11px;color:#6b7280}.pdf-source-snippet{display:block;font-size:11px;color:#6b7280;margin-top:2px;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media (max-width: 1280px){.modal-content{width:95vw}}@media (max-width: 1024px){.pdf-thumbs,.pdf-citations{display:none}.modal-content{width:96vw;height:92vh}}@media (max-width: 640px){.modal-content{width:98vw;height:92vh;border-radius:10px}}@media (max-width: 900px){.chat-layout{grid-template-columns:1fr;position:relative}.sidebar{position:fixed;top:0;bottom:0;left:0;width:min(86vw,320px);max-width:92vw;transform:translate(-100%);transition:transform .2s ease-in-out;z-index:1000;box-shadow:0 10px 30px #0000002e}.chat-container.drawer-open .sidebar{transform:translate(0)}.drawer-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000005c;-webkit-backdrop-filter:saturate(120%) blur(2px);backdrop-filter:saturate(120%) blur(2px);z-index:900}.mobile-bar{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--border);background:#fff;position:sticky;top:0;z-index:10}.sidebar-toggle{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;color:#111827;border:1px solid #e5e7eb;border-radius:8px;width:36px;height:36px;display:inline-grid;place-items:center;cursor:pointer}}@media (min-width: 901px){.mobile-bar{display:none}}.new-messages-chip{position:fixed;left:50%;transform:translate(-50%);bottom:96px;z-index:50}.older-messages{display:flex;justify-content:center;margin:8px 0}.toasts{position:fixed;top:16px;right:16px;display:grid;gap:8px;z-index:2000}.toast{background:#111827;color:#fff;border-radius:8px;padding:10px 12px;font-size:13px;box-shadow:0 10px 20px #0003}.toast.error{background:#b91c1c}.toast.success{background:#065f46}';
18
18
  var sh = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
19
19
  function cm(r) {
20
20
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
@@ -26985,17 +26985,16 @@ vt.normalizeUnicode;
26985
26985
  vt.setLayerDimensions;
26986
26986
  vt.shadow;
26987
26987
  vt.stopEvent;
26988
- vt.version;
26988
+ var TC = vt.version;
26989
26989
  let Cu = null;
26990
- function TC() {
26991
- var t, n;
26992
- const r = globalThis == null ? void 0 : globalThis.PDFJS_WORKER_URL, e = (n = (t = import.meta) == null ? void 0 : t.env) == null ? void 0 : n.VITE_PDFJS_WORKER_URL;
26993
- return typeof r == "string" && r || typeof e == "string" && e || // Fallback to CDN (ESM worker)
26994
- "https://cdn.jsdelivr.net/npm/pdfjs-dist@4.8.69/legacy/build/pdf.worker.min.mjs";
26995
- }
26996
26990
  function RC() {
26991
+ var n, i;
26992
+ const r = globalThis == null ? void 0 : globalThis.PDFJS_WORKER_URL, e = (i = (n = import.meta) == null ? void 0 : n.env) == null ? void 0 : i.VITE_PDFJS_WORKER_URL;
26993
+ return typeof r == "string" && r ? r : typeof e == "string" && e ? e : `https://cdn.jsdelivr.net/npm/pdfjs-dist@${TC || "4.8.69"}/legacy/build/pdf.worker.min.mjs`;
26994
+ }
26995
+ function IC() {
26997
26996
  return Cu || (Cu = (async () => {
26998
- const r = TC();
26997
+ const r = RC();
26999
26998
  kC.workerSrc = r;
27000
26999
  try {
27001
27000
  await fetch(r, { method: "GET" });
@@ -27004,7 +27003,7 @@ function RC() {
27004
27003
  })(), Cu);
27005
27004
  }
27006
27005
  const am = /* @__PURE__ */ new Map();
27007
- function IC({ fileUrl: r, pageNumber: e, onMeta: t, scrollBehavior: n = "auto", highlights: i }) {
27006
+ function PC({ fileUrl: r, pageNumber: e, onMeta: t, scrollBehavior: n = "auto", highlights: i }) {
27008
27007
  const [s, a] = ve(0), [o, l] = ve(!0), [u, h] = ve(null), [d, f] = ve(0), p = Oe([]), g = Oe([]), m = Oe(null), v = Oe(null), b = Oe(!1), A = Oe(null), E = Oe(null), R = Oe(1), k = hr((O) => {
27009
27008
  try {
27010
27009
  return !O || /^https?:\/\//i.test(O) ? O : new URL(O, window.location.origin).href;
@@ -27128,7 +27127,7 @@ function IC({ fileUrl: r, pageNumber: e, onMeta: t, scrollBehavior: n = "auto",
27128
27127
  let O = !1;
27129
27128
  return (async () => {
27130
27129
  try {
27131
- l(!0), console.debug("[SimplePdfViewer] start load", { fileUrl: r }), await RC();
27130
+ l(!0), console.debug("[SimplePdfViewer] start load", { fileUrl: r }), await IC();
27132
27131
  const L = k(r);
27133
27132
  let I = am.get(L);
27134
27133
  if (I || (I = await CC(L).promise, O || am.set(L, I)), O) return;
@@ -27252,7 +27251,7 @@ function IC({ fileUrl: r, pageNumber: e, onMeta: t, scrollBehavior: n = "auto",
27252
27251
  )) })
27253
27252
  ] });
27254
27253
  }
27255
- function PC({
27254
+ function MC({
27256
27255
  open: r,
27257
27256
  file: e,
27258
27257
  page: t,
@@ -27308,7 +27307,7 @@ function PC({
27308
27307
  }
27309
27308
  ) }),
27310
27309
  /* @__PURE__ */ F.jsx("div", { className: "pdf-content", ref: p, children: /* @__PURE__ */ F.jsx(
27311
- IC,
27310
+ PC,
27312
27311
  {
27313
27312
  fileUrl: e,
27314
27313
  pageNumber: t,
@@ -27351,7 +27350,7 @@ function PC({
27351
27350
  ] })
27352
27351
  ] }) });
27353
27352
  }
27354
- function DC({ user: r, generateToken: e, clientId: t }) {
27353
+ function FC({ user: r, generateToken: e, clientId: t }) {
27355
27354
  const n = "https://fastify.tpsportal.co.nz/api", i = "https://fastify.tpsportal.co.nz/docs", [s, a] = ve([]), [o, l] = ve(""), [u, h] = ve(!1), [d, f] = ve(null), [p, g] = ve(null), [m, v] = ve([]), [b, A] = ve({ open: !1 }), [E, R] = ve(null), k = Oe(null), S = Oe(!0), M = Oe(0), [O, L] = ve(!0), [I, D] = ve(!1), [_, B] = ve(50), [U, $] = ve(!1), [N, H] = ve(!1), q = Oe(null), lt = Oe(null), T = Oe(null), { toasts: bt, pushToast: ft } = Ov(), C = Sd(() => Rv({ apiBase: n, generateToken: e, clientId: t }), [n, e, t]), gt = hr(({ numPages: X }) => R(X), []), Mt = hr(() => {
27356
27355
  const X = k.current;
27357
27356
  X && requestAnimationFrame(() => {
@@ -27624,7 +27623,7 @@ function DC({ user: r, generateToken: e, clientId: t }) {
27624
27623
  }
27625
27624
  ) }),
27626
27625
  /* @__PURE__ */ F.jsx(
27627
- PC,
27626
+ MC,
27628
27627
  {
27629
27628
  open: b.open,
27630
27629
  file: b.file,
@@ -27642,7 +27641,7 @@ function DC({ user: r, generateToken: e, clientId: t }) {
27642
27641
  ] });
27643
27642
  }
27644
27643
  export {
27645
- DC as Chat,
27646
- OC as ChatInlineStyles
27644
+ FC as Chat,
27645
+ DC as ChatInlineStyles
27647
27646
  };
27648
27647
  //# sourceMappingURL=index.js.map