@mavea/mavea 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/DISCLAIMER.md +2 -1
- package/PRIVACY.md +5 -4
- package/README.md +20 -15
- package/TERMS.md +3 -1
- package/dist/.vite/manifest.json +638 -569
- package/dist/assets/AnnotationLayer-qV6CIUZv.js +0 -0
- package/dist/assets/{AppCommandPalette-Dm3SedPO.js → AppCommandPalette-BHaYBZ5e.js} +1 -1
- package/dist/assets/AreaChart-DZGCSEwt.js +1 -0
- package/dist/assets/CadenceCard-P4teI7Se.js +1 -0
- package/dist/assets/CanvasSkeleton-CRGWlafo.js +1 -0
- package/dist/assets/{CheckLogRail-BU_rmAFH.js → CheckLogRail-DkHIHL0E.js} +1 -1
- package/dist/assets/{CommandPalette-E3reEqYR.js → CommandPalette-Bs6tpdZl.js} +1 -1
- package/dist/assets/{ConversationVideoStudio-DEZBpJUz.js → ConversationVideoStudio-C1sd4k53.js} +1 -1
- package/dist/assets/CourseLessonReader-YCcNKEW7.js +2 -0
- package/dist/assets/{CourseRail-C8MJG-zf.js → CourseRail-DXt3bzjU.js} +1 -1
- package/dist/assets/{CoursesApp-DFVkhP2f.js → CoursesApp-Dz6xjf4V.js} +2 -2
- package/dist/assets/{DashPresent-DwWDtjrU.js → DashPresent-5SRScC2i.js} +1 -1
- package/dist/assets/DashboardDetail-8J8TsdQg.css +1 -0
- package/dist/assets/DashboardDetail-DOfm8UCQ.js +2 -0
- package/dist/assets/DashboardLoopGate-Cf0y_HQ7.js +2 -0
- package/dist/assets/DashboardLoopRuntime-CnN5VayH.js +1 -0
- package/dist/assets/DashboardSettings-CE0B2y2y.js +1 -0
- package/dist/assets/DashboardsApp-_gbfdbX6.js +2 -0
- package/dist/assets/{DeepZoomApp-CxdcUeFJ.js → DeepZoomApp-BOLEl-kQ.js} +1 -1
- package/dist/assets/{DelegatePanel-B0kIu8Et.js → DelegatePanel-CHEB-OZl.js} +1 -1
- package/dist/assets/{DemoGallery-B__X0_H3.js → DemoGallery-DBqnu8TR.js} +1 -1
- package/dist/assets/{DropSelect-C3uYlej-.js → DropSelect-DjbdVfIR.js} +1 -1
- package/dist/assets/{ExportModal-CDGlhpdH.js → ExportModal-CLobMv1F.js} +1 -1
- package/dist/assets/{ExtractionPreview-CloJnrQi.js → ExtractionPreview-QZ2VHmsb.js} +2 -2
- package/dist/assets/{FeatureUseNotice-CwHstxBh.js → FeatureUseNotice-Dc8joBGM.js} +1 -1
- package/dist/assets/{FlagshipCommandPalette-CHsD5BSH.js → FlagshipCommandPalette-DnWuBjYI.js} +1 -1
- package/dist/assets/{FlagshipShowcase-D53Q_4m0.js → FlagshipShowcase-3qQDOK6g.js} +1 -1
- package/dist/assets/{FlashcardsApp-CnLfEnDH.js → FlashcardsApp-BQGM-Tr1.js} +1 -1
- package/dist/assets/{GalleryApp-2Ffc6CY6.js → GalleryApp-BWQ-J450.js} +1 -1
- package/dist/assets/{HonestByDesign-5jIu2ZC8.js → HonestByDesign-57LDf-gm.js} +1 -1
- package/dist/assets/{HowItWorks-BiJF84EM.js → HowItWorks-DMfPX3GK.js} +1 -1
- package/dist/assets/{LegalApp-zC-rvTww.js → LegalApp-CcO5Qq6R.js} +1 -1
- package/dist/assets/{LegalMarkdownDocument-CJ-gRHdX.js → LegalMarkdownDocument-Be_fQbZ_.js} +1 -1
- package/dist/assets/{LegalPageShell-Dyd4Uh3r.js → LegalPageShell-B-HY1WG7.js} +1 -1
- package/dist/assets/{LibraryOverlay-_xpWdhLN.js → LibraryOverlay-BilW6q_z.js} +1 -1
- package/dist/assets/LiveApp-C-OPBybd.css +1 -0
- package/dist/assets/LiveApp-DH3OxJFV.js +79 -0
- package/dist/assets/{LiveSettings-BceODlOb.js → LiveSettings-CuVMy7rZ.js} +3 -3
- package/dist/assets/{MindMapViewerDrawer-BuDodC0s.js → MindMapViewerDrawer-DI_S7fRZ.js} +1 -1
- package/dist/assets/{MindShape-CBcCC7hP.js → MindShape-C_Bo9hW9.js} +1 -1
- package/dist/assets/{PinToDashboard-DBIXvhlF.js → PinToDashboard-Cz5UJCmq.js} +1 -1
- package/dist/assets/PlanReview-CmUxzNqL.js +1 -0
- package/dist/assets/{Presence-CKSoyuhE.js → Presence-UqXfH4Y-.js} +1 -1
- package/dist/assets/{PresentationDeck-C518t9pP.js → PresentationDeck-B_EI33Pp.js} +1 -1
- package/dist/assets/{PrismApp-DRLl8841.js → PrismApp-DtLsPiQF.js} +2 -2
- package/dist/assets/{PrismAskController-QRwxRP8D.js → PrismAskController-Bt0k9hAA.js} +1 -1
- package/dist/assets/{PrismBriefingPlayer-Kyb8Vs_w.js → PrismBriefingPlayer-DzdtnFj4.js} +2 -2
- package/dist/assets/{PrismOverlay-Bj7tCu5Q.js → PrismOverlay-D1cDZamt.js} +3 -3
- package/dist/assets/{PrismWorkbench-BCnhkp-S.js → PrismWorkbench-BEIp4MiL.js} +1 -1
- package/dist/assets/{PrivacyApp-DHSRr8wq.js → PrivacyApp-B4DT2RUz.js} +6 -5
- package/dist/assets/{ReplayCard-CKo5reXy.js → ReplayCard-Dx46HCBT.js} +2 -2
- package/dist/assets/{ReplayOverlay-DqAwLshS.js → ReplayOverlay-CnJAxf0u.js} +1 -1
- package/dist/assets/{RewindOverlay-CkJIETE0.js → RewindOverlay-CousnxXo.js} +1 -1
- package/dist/assets/{RippleApp-C76VTaZK.js → RippleApp-D5j2VCt2.js} +2 -2
- package/dist/assets/{RippleAskController-CdlMlRH8.js → RippleAskController-9SxpZnHX.js} +1 -1
- package/dist/assets/{RippleOverlay-Mvz3CXhD.js → RippleOverlay-zcXAHPuJ.js} +2 -2
- package/dist/assets/{SeeDontRead-BkySmnP3.js → SeeDontRead-Dqfzha0V.js} +1 -1
- package/dist/assets/{ShareModal-Cl3ryjgK.js → ShareModal-DWxlrJSz.js} +2 -2
- package/dist/assets/{ShipCourse-Cy5ldKLE.js → ShipCourse-BavQppkt.js} +1 -1
- package/dist/assets/{SignatureLoop-Cdkifjb8.js → SignatureLoop-L8W2h62w.js} +1 -1
- package/dist/assets/{SynthesisApp-C5udWwng.js → SynthesisApp-C2O6pFeM.js} +2 -2
- package/dist/assets/{SynthesisOverlay-1o-CJsyX.js → SynthesisOverlay-DLvwiSMv.js} +1 -1
- package/dist/assets/{TermsApp-DIAESAZs.js → TermsApp-CxY1yorm.js} +4 -2
- package/dist/assets/TopicCanvas-LMI0zC7R.js +2 -0
- package/dist/assets/{TourPrism-Bxp--s0i.js → TourPrism-CI-iJZil.js} +1 -1
- package/dist/assets/TrackerTile-oz6IoG8m.js +2 -0
- package/dist/assets/{TwoSurfaces-C_0XBpwA.js → TwoSurfaces-Rnf-_WgY.js} +1 -1
- package/dist/assets/{WhyMachineOverlay-QDSZx5Y7.js → WhyMachineOverlay-ks9-rRiL.js} +1 -1
- package/dist/assets/WorldOverlay-BaQNNClA.js +2 -0
- package/dist/assets/{WorldOverlay-DRdBQMnb.css → WorldOverlay-D7ay5y4D.css} +1 -1
- package/dist/assets/{WowFeatures-DNEeO2pr.js → WowFeatures-C4efSbNV.js} +1 -1
- package/dist/assets/{ZoomDeck-qdlPe_yl.js → ZoomDeck-CBrr0yfy.js} +1 -1
- package/dist/assets/{annotationAuto-BmKrZ3hU.js → annotationAuto-CDv6Es44.js} +1 -1
- package/dist/assets/{backup-PaRBwjJy.js → backup-ZrlVatXc.js} +1 -1
- package/dist/assets/canvas-Bsx3eSaS.js +1 -0
- package/dist/assets/{capture-CL9ENM-c.js → capture-D8uPIcfj.js} +1 -1
- package/dist/assets/confirmAdd-DzMO9jKV.js +1 -0
- package/dist/assets/{coreIcons-BzqW7Qiz.js → coreIcons-DDTChE1H.js} +1 -1
- package/dist/assets/{dashboardEvents-D-wLCp1A.js → dashboardEvents-DKl5rrTD.js} +1 -1
- package/dist/assets/{dashboards-CdzGklae.css → dashboards-C1u2ks-d.css} +1 -1
- package/dist/assets/dataPending-DGdCvY5Y.js +1 -0
- package/dist/assets/display-CAb_PiGv.js +1 -0
- package/dist/assets/{engine-2U7mvPIl.js → engine-BiM6INsW.js} +1 -1
- package/dist/assets/{engine-BF8FqSbi.css → engine-CTvOaA86.css} +1 -1
- package/dist/assets/{explode-qQ7Fzt6V.js → explode-BgZIWY9m.js} +1 -1
- package/dist/assets/format-g3dP8OI3.js +1 -0
- package/dist/assets/{generate-C9vOL1C2.js → generate-Dl2EJ_SR.js} +1 -1
- package/dist/assets/{generateBeats-DpDpBcgV.js → generateBeats-DZHkvFvh.js} +1 -1
- package/dist/assets/{generateCourse-DU281tDE.js → generateCourse-C9qvaJRo.js} +1 -1
- package/dist/assets/{generateLive-_x2tWkBH.js → generateLive-B6purd69.js} +13 -13
- package/dist/assets/index-Dk0QapqQ.js +22 -0
- package/dist/assets/{index-D4FIsool.css → index-DmKgC_TJ.css} +1 -1
- package/dist/assets/{kokoro-CdL8Kl48.js → kokoro-P_fkcX-A.js} +1 -1
- package/dist/assets/lens-ChFJD9il.js +1 -0
- package/dist/assets/loader-DKJEcbPm.js +2 -0
- package/dist/assets/{model-DxwoIVpo.js → model-BFRTN9Eh.js} +1 -1
- package/dist/assets/{notes-CUeZ1cYu.js → notes-B0-EE0FK.js} +1 -1
- package/dist/assets/{number-Bmf7DqLj.js → number-zqlPMliA.js} +1 -1
- package/dist/assets/{pen-BAEq0JnM.js → pen-DNMslo3e.js} +1 -1
- package/dist/assets/{perfProbe-3Ip5n0yx.js → perfProbe-B9zJpjo9.js} +1 -1
- package/dist/assets/{pin-BwWjjqmt.js → pin-CZAIlpXt.js} +1 -1
- package/dist/assets/{planTracker-BI9z_0gW.js → planTracker-KKAtTBWs.js} +1 -1
- package/dist/assets/{portal-BJzn-Tgn.js → portal-Dogggsub.js} +1 -1
- package/dist/assets/{prewarm-CheeUP2L.js → prewarm-B4ELBOxf.js} +1 -1
- package/dist/assets/{providers-B2OCzEo1.js → providers-BovElgRL.js} +1 -1
- package/dist/assets/{quietHours-DCMczU9R.js → quietHours-CeBje_uU.js} +1 -1
- package/dist/assets/{ready-DZY1bETr.js → ready-jtAUOb62.js} +1 -1
- package/dist/assets/receipts-D7zveV-I.js +1 -0
- package/dist/assets/registry-6DGRAB1m.js +1 -0
- package/dist/assets/{registry-BRbEINOV.js → registry-6MOD-I7p.js} +1 -1
- package/dist/assets/registry-BFrgx1tE.js +1 -0
- package/dist/assets/{registry-BM9FDQxO.js → registry-CD1s3eQ-.js} +1 -1
- package/dist/assets/{registry-ChQGee7C.js → registry-CqhpLHM7.js} +1 -1
- package/dist/assets/registry-Cse2wF7x.css +1 -0
- package/dist/assets/registry-DGNSqTxE.js +1 -0
- package/dist/assets/{registry-D_4_HlMg.js → registry-GeAC3ZD7.js} +1 -1
- package/dist/assets/{relate-BXcg3Ioz.js → relate-BYdM5eiV.js} +1 -1
- package/dist/assets/{replay-rSsGKjEc.js → replay-TYXO0Brm.js} +1 -1
- package/dist/assets/{run-ndUTOxjM.js → run-Df10YPyB.js} +1 -1
- package/dist/assets/{run-CkaYNX89.js → run-DlvA3l28.js} +1 -1
- package/dist/assets/{run-aj7robML.js → run-gmqUaxcL.js} +1 -1
- package/dist/assets/seed-D_P5jyog.js +1 -0
- package/dist/assets/shapes-Cx5SCKgj.js +39 -0
- package/dist/assets/store-CsjDEADX.js +1 -0
- package/dist/assets/tiles-D-s6v-mA.js +1 -0
- package/dist/assets/types-DuEbJpIA.js +1 -0
- package/dist/assets/useDashboardLoop-DDqCFJKY.js +5 -0
- package/dist/assets/{useDashboards-GafZIADI.js → useDashboards-SRk8LqHe.js} +1 -1
- package/dist/assets/{useLiveConfig-DWz7BRdk.js → useLiveConfig-Cpy0_E_-.js} +1 -1
- package/dist/assets/{useStudy-CFIuakaM.js → useStudy-GwNcQWtv.js} +1 -1
- package/dist/assets/validate-sGUCmPAs.js +4 -0
- package/dist/assets/value-Dx7DZob4.js +1 -0
- package/dist/assets/{walkSync-AAocUygp.js → walkSync-CPsd-xu7.js} +1 -1
- package/dist/index.html +3 -3
- package/dist/legal/DISCLAIMER.md +2 -1
- package/dist/legal/PRIVACY.md +5 -4
- package/dist/legal/TERMS.md +3 -1
- package/docs/media/course-lesson.jpg +0 -0
- package/docs/media/living-answer.jpg +0 -0
- package/package.json +3 -1
- package/dist/assets/AnnotationLayer-IiuYsoSa.js +0 -0
- package/dist/assets/CanvasSkeleton-CcHXJqdq.js +0 -2
- package/dist/assets/CourseLessonReader-Bpt-DkJo.js +0 -2
- package/dist/assets/DashboardDetail-D4wkiTux.js +0 -2
- package/dist/assets/DashboardLoopGate-B5UBPsvU.js +0 -2
- package/dist/assets/DashboardLoopRuntime-CAnZX234.js +0 -1
- package/dist/assets/DashboardSettings-eMhHliVh.js +0 -1
- package/dist/assets/DashboardsApp-BwFtTdWa.js +0 -2
- package/dist/assets/LiveApp-BNae3fDZ.css +0 -1
- package/dist/assets/LiveApp-DjcJQURO.js +0 -78
- package/dist/assets/PlanReview-DUQ7OMvV.js +0 -1
- package/dist/assets/TopicCanvas-DkzJORfl.js +0 -2
- package/dist/assets/TrackerTile-CyPD0A6b.js +0 -2
- package/dist/assets/WorldOverlay-DorHCLzw.js +0 -1
- package/dist/assets/canvas-BlkTFnVo.js +0 -1
- package/dist/assets/confirmAdd-CZPBG1xe.js +0 -1
- package/dist/assets/dataPending-lZUzUEo6.js +0 -1
- package/dist/assets/display-BrieMea1.js +0 -1
- package/dist/assets/format-rPI6ZwwH.js +0 -1
- package/dist/assets/index-CfcUMOBf.js +0 -22
- package/dist/assets/receipts-ClyzFFGD.js +0 -1
- package/dist/assets/registry-9QjeHgKs.js +0 -1
- package/dist/assets/registry-D4Xdd7dO.js +0 -1
- package/dist/assets/registry-DScSjt8p.css +0 -1
- package/dist/assets/registry-DuP_q42N.js +0 -1
- package/dist/assets/seed-DN4mRJp-.js +0 -1
- package/dist/assets/shapes-C5fjibEc.js +0 -42
- package/dist/assets/store-B39HvB_l.js +0 -1
- package/dist/assets/tiles-pdNi6MGe.js +0 -1
- package/dist/assets/useDashboardLoop-B_YA5jLs.js +0 -5
- package/dist/assets/validate-CnG23_8J.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,_ as t,g as n,v as r,y as i}from"./index-
|
|
1
|
+
import{S as e,_ as t,g as n,v as r,y as i}from"./index-Dk0QapqQ.js";var a=240,o=5e3,s=45,c=8e3,l=50,u=2.5,d=.25,f=1500;function p(e){if(e.length===0)return 0;let t=[...e].sort((e,t)=>e-t),n=t.length>>1;return t.length%2?t[n]:(t[n-1]+t[n])/2}function m(e,t){if(e.length<s)return`full`;let n=p(e),r=Math.max(l,n*u),i=0;for(let t of e)t>r&&i++;return i/e.length>d||t>f?`lite`:`full`}function h(s){let l={stop:()=>{}};if(typeof window>`u`||typeof requestAnimationFrame!=`function`||typeof performance>`u`||r()!==`auto`)return l;let u=i();if(u&&u.sig===n()&&u.tier===`lite`&&t()===`lite`)return l;let d=!1,f=0,p=0,h=null,g=[],_=0,v=0,y=0,b=!1,x=()=>{d=!0,f&&cancelAnimationFrame(f),p&&clearTimeout(p),h&&=(h.disconnect(),null),window.removeEventListener(`visibilitychange`,E)},S=t=>{x(),e(t),s(t)},C=()=>{g.length=0,y=0,_=0,v=performance.now()},w=()=>{if(m(g,y)===`lite`){if(b){S(`lite`);return}b=!0,C();return}S(`full`)},T=e=>{if(!d){if(document.hidden){f=requestAnimationFrame(T),_=0;return}_!==0&&g.push(e-_),_=e,!((g.length>=a||e-v>=o)&&(w(),d))&&(f=requestAnimationFrame(T))}};function E(){_=0}return p=setTimeout(()=>{if(!d){if(typeof PerformanceObserver==`function`)try{h=new PerformanceObserver(e=>{for(let t of e.getEntries())y+=t.duration}),h.observe({entryTypes:[`longtask`]})}catch{h=null}window.addEventListener(`visibilitychange`,E),C(),f=requestAnimationFrame(T)}},c),{stop:x}}export{h as startPerfProbe};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as e,X as t,a as n,c as r,d as i,o as a,p as o,u as s}from"./store-CsjDEADX.js";import{t as c}from"./providers-BovElgRL.js";import{l,n as u}from"./useLiveConfig-Cpy0_E_-.js";import{n as d}from"./useDashboardLoop-DDqCFJKY.js";var f=`Rewrite the user's question into ONE self-contained search query meant to be re-asked verbatim on a recurring schedule to fetch the CURRENT state of the same thing — never a one-time answer to today's exact wording. Name the specific subject explicitly (a team, a ticker, a tournament and round) so the query stands alone without this conversation for context. Keep language like "live" or "in progress" when the tracked thing genuinely is a live/current-moment state (e.g. a live score) — dropping it would lose exactly what matters. Return ONLY the rewritten query text — no quotes, no preamble, no explanation.`;async function p(e,t,n){let r=e.trim();if(!r)return r;try{let e=await c(n.provider).generate({system:f,history:[],user:`Original ask: "${r}"\nThis produces a "${t}" block.`,maxTokens:120,temperature:.2,thinkingLevel:`low`},n);return(typeof e.raw==`string`?e.raw.trim().replace(/^["']+|["']+$/g,``):``)||r}catch(e){return console.error(`[dashboards] refineRefreshQuery failed, keeping the raw ask`,e),r}}var m=4,h=new Set([`thesis`,`alignmentgauge`,`standingalerts`,`sourceslineage`]);function g(e){let t=0;for(;t<e.length&&h.has(e[t].block.type);)t+=1;return t}function _(c){let f=(Array.isArray(c.block)?c.block:[c.block]).filter(e=>e.type!==`blanks`).slice(0,m);if(f.length===0)return null;let h=c.now??Date.now(),_=c.question?.trim()||void 0,v=f.map(e=>r(e,c.fromSource??`pin`,_)),y,b;if(typeof c.target==`string`){let e=o(c.target);if(!e)return null;y=e.id,b=e.title,a(y,v,{at:g(e.widgets),...c.source?{source:c.source}:{}})}else{let e=s({title:c.target.new.title,question:_,now:h});e.cadence={data:c.target.new.cadence,ai:`manual`},e.nextDataAt=t(e.cadence,h),y=e.id,b=e.title,n(e),a(y,v,c.source?{source:c.source}:{})}if(c.firstCheck!==!1&&(i(y,h),d(y)),_){let t=l(u());if(t.apiKey){let n=v.map(e=>e.id);p(_,f[0].type,t).then(t=>{let r=t.trim();r&&r!==_&&e(y,n,r)})}}return{dashboardId:y,title:b}}export{_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{i as t,t as n}from"./http-Lar_UMKb.js";import{t as r}from"./providers-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{i as t,t as n}from"./http-Lar_UMKb.js";import{t as r}from"./providers-BovElgRL.js";import{t as i}from"./json-B0N3XRZU.js";import{t as a}from"./now-C9-UAzTC.js";var o=e({PLAN_BLOCK_TYPES:()=>s,answerOnce:()=>g,coercePlan:()=>p,fallbackPlan:()=>m,planTracker:()=>h}),s=new Set([`chart`,`scoreboard`,`standings`,`forecast`,`list`,`timeline`]),c=new Set([`15min`,`hourly`,`6h`,`daily`]),l=new Set([`chart`,`scoreboard`,`forecast`,`timeline`]),u=2592e6;function d(e,n){let r=t(e),i=typeof r.start==`string`?Date.parse(r.start):NaN,a=typeof r.end==`string`?Date.parse(r.end):NaN;if(!(!Number.isFinite(i)||!Number.isFinite(a)||a<=i)&&!(i<n-u||i>n+u))return{startAt:i,endAt:a,label:typeof r.label==`string`?r.label.trim().slice(0,60):``}}function f(e,n){let r=t(e),i=typeof r.at==`string`?Date.parse(r.at):NaN;if(Number.isFinite(i)&&!(i<n-6e4||i>n+u))return{at:i,label:typeof r.label==`string`?r.label.trim().slice(0,60):``}}function p(e,r,i=Date.now()){let a=t(e),o=[];for(let e of n(a.metrics).slice(0,2)){let n=t(e);typeof n.label!=`string`||!n.label.trim()||typeof n.query!=`string`||!n.query.trim()||o.push({label:n.label.trim(),query:n.query.trim(),...typeof n.unit==`string`&&n.unit.trim()?{unit:n.unit.trim()}:{}})}let u=[];for(let e of n(a.widgets).slice(0,3)){let n=t(e),r=typeof n.type==`string`?n.type.trim().toLowerCase():``;s.has(r)&&(typeof n.query!=`string`||!n.query.trim()||u.push({blockType:r,query:n.query.trim(),span:l.has(r)?2:1}))}let p=a.kind===`static`?`static`:`live`;if(p===`live`&&o.length===0&&u.length===0)return null;let m=typeof a.title==`string`&&a.title.trim()?a.title.trim().slice(0,80):r.slice(0,80),h=c.has(a.cadence)?a.cadence:`manual`,g=p===`static`&&typeof a.staticReason==`string`&&a.staticReason.trim()?a.staticReason.trim().slice(0,160):void 0,_=d(a.window,i),v=_?void 0:f(a.oneShot,i);return{title:m,metrics:o,widgets:p===`static`&&o.length===0&&u.length===0?[{blockType:`list`,query:r,span:2}]:u,cadence:h,kind:p,...g?{staticReason:g}:{},..._?{window:_}:{},...v?{oneShotAt:v.at,oneShotLabel:v.label}:{}}}function m(e){return{title:e.slice(0,80),metrics:[],widgets:[{blockType:`list`,query:e,span:2}],cadence:`manual`,kind:`live`}}async function h(e,t){let n=e.trim();if(!n)return m(e);try{let e=await r(t.provider).generate({system:a()+` You design a live-tracking dashboard from one sentence of what the user wants to follow. Return ONLY JSON: {"title": string, "kind": "live"|"static", "staticReason"?: string, "metrics": [{"label": string, "query": string, "unit"?: string}], "widgets": [{"type": string, "query": string}], "cadence": "15min"|"hourly"|"6h"|"daily", "window"?: {"start": ISO string, "end": ISO string, "label": string}, "oneShot"?: {"at": ISO string, "label": string}}. RULES: (1) "metrics" are ONLY for things a single number genuinely captures (a price, a temperature, a percentage) — 0-2 of them, each with a self-contained search query for its CURRENT value. Skip metrics entirely when no single number is the point. (2) "widgets" carry everything richer — pick the shape that fits the data: "scoreboard" for game results, "standings" for a league table, "forecast" for weather outlooks, "timeline" for dated events/schedules, "chart" for a numeric series over time, "list" for headlines/updates/anything else. 1-3 widgets, each with a self-contained standing query that (a) names the exact subject so it works with zero conversation context, (b) explicitly asks for the LATEST/CURRENT state as of the moment it is asked — keeping words like "live" or "in progress" when the tracked thing is a live state, and (c) will still make sense re-asked verbatim tomorrow and next month (never bake in a specific date). (3) "cadence" matches how fast the thing really changes: "15min" for market prices and live games, "hourly" for weather and breaking situations, "6h" for slow-moving sagas, "daily" for everything else. (4) "title" is a short, human dashboard name — the subject, not a sentence. Plan the MINIMUM set that covers the ask — no filler. (5) "kind": "static" ONLY when the ask is a fact that genuinely will not change (a mountain's height, a historical date, a physical constant) — give a one-line "staticReason" and still fill in a reasonable live plan as a fallback in case they track it anyway. Default "live" whenever there is any real chance the answer moves. (6) YOU HAVE NO SEARCH ACCESS RIGHT NOW — only set "window" or "oneShot" when the user's OWN WORDS state a concrete date/time (e.g. "the game starts at 7pm" or "check after the Fed meeting on the 31st"); NEVER invent or guess a time you were not given. Omit both fields entirely otherwise — a real live-event window can still be discovered later, during an actual search-grounded check. (7) "window" bounds a recurring cadence to a live event's span (poll fast only while it is actually happening); "oneShot" is a single check at one moment instead of a recurring cadence — use at most one of the two, and only from an explicit user time.`,history:[],user:`Track: ${n}`,maxTokens:600,temperature:.2,thinkingLevel:`low`,format:{type:`object`,properties:{title:{type:`string`},kind:{type:`string`},staticReason:{type:`string`},metrics:{type:`array`,items:{type:`object`,properties:{label:{type:`string`},query:{type:`string`},unit:{type:`string`}},required:[`label`,`query`]}},widgets:{type:`array`,items:{type:`object`,properties:{type:{type:`string`},query:{type:`string`}},required:[`type`,`query`]}},cadence:{type:`string`},window:{type:`object`,description:`ONLY when the user's own words stated a concrete time — never invented.`,properties:{start:{type:`string`},end:{type:`string`},label:{type:`string`}}},oneShot:{type:`object`,description:`ONLY when the user's own words stated a concrete time — never invented.`,properties:{at:{type:`string`},label:{type:`string`}}}},required:[`title`,`widgets`,`cadence`]}},t);return p(i(e.raw),n)??m(n)}catch(e){return console.error(`[dashboards] planTracker failed, falling back to a plain list tracker`,e),m(n)}}async function g(e,o){let s=e.trim();if(!s)return null;try{let e=await r(o.provider).generate({system:a()+` Answer plainly and concretely in 1-3 sentences, using web search. Return ONLY JSON: {"answer": string, "sources": [{"title": string, "url": string}]}. CITE every real source URL actually relied on; omit "sources" entirely if you used no search. Never invent a source or a fact you could not verify.`,history:[],user:s,maxTokens:500,temperature:.15,thinkingLevel:`low`,tools:{webSearch:!0},format:{type:`object`,properties:{answer:{type:`string`},sources:{type:`array`,items:{type:`object`,properties:{title:{type:`string`},url:{type:`string`}},required:[`title`,`url`]}}},required:[`answer`]}},o),c=t(i(e.raw)),l=typeof c.answer==`string`?c.answer.trim():``;if(!l)return null;let u=[];for(let e of n(c.sources)){let n=t(e);typeof n.title==`string`&&typeof n.url==`string`&&u.push({title:n.title,url:n.url})}let d=e.sources?.length?e.sources:u;return{text:l,sources:d,grounded:d.length>0}}catch(e){return console.error(`[dashboards] answerOnce failed`,e),null}}export{o as n,h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-DeHZSEgm.js";import{it as t}from"./index-
|
|
1
|
+
import{t as e}from"./jsx-runtime-DeHZSEgm.js";import{it as t}from"./index-Dk0QapqQ.js";var n=t(),r=e();function i({accent:e,children:t}){return typeof document>`u`?null:(0,n.createPortal)((0,r.jsx)(`div`,{className:`ov-root`,style:{"--ov-c":e},children:t}),document.body)}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./index-
|
|
1
|
+
import{a as e}from"./index-Dk0QapqQ.js";import{t}from"./providers-BovElgRL.js";import{l as n,n as r}from"./useLiveConfig-Cpy0_E_-.js";var i=2e4,a=2e3,o=15e3,s=0,c=!1;function l(o={}){if(!e())return;let c=Date.now();if(!(!o.force&&c-s<i)){s=c;try{let e=n(r()),i=t(e.provider),a=i.warm?i.warm(e):i.probe(e);Promise.resolve(a).catch(()=>{})}catch{}try{let e=new AbortController,t=setTimeout(()=>e.abort(),a);fetch(`/tts/health`,{method:`GET`,signal:e.signal}).then(e=>{e.ok&&u()}).catch(()=>{}).finally(()=>clearTimeout(t))}catch{}}}function u(){if(!c){c=!0;try{let e=new AbortController,t=setTimeout(()=>e.abort(),o);fetch(`/tts/v1/audio/speech`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({model:`kokoro`,input:`Hello.`,voice:`af_heart`,response_format:`pcm`}),signal:e.signal}).then(async t=>{await t.body?.getReader().read(),e.abort()}).catch(()=>{}).finally(()=>clearTimeout(t))}catch{}}}export{l as prewarmLive};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./http-Lar_UMKb.js";import{t as s}from"./blockTypes-DUDdP3pB.js";import"./info-CiqHR5cs.js";import{g as c,m as l}from"./attachments-BW-vki-E.js";var u=[...s];function d(e=u,t){return{type:`object`,properties:{narration:{type:`string`,description:`ONE warm spoken sentence. Emit this FIRST so it can be spoken immediately.`},title:{type:`string`,description:`A short headline for the answer.`},sub:{type:`string`,description:`One short supporting line.`},blocks:{type:`array`,minItems:t===`brief`?1:3,maxItems:18,items:{type:`object`,properties:{type:{type:`string`,enum:[...e]},props:{type:`object`,description:`Fields for this block type.`}},required:[`type`,`props`]}},track:{type:`object`,description:`OMIT unless this answer is a rare ongoing metric worth a living dashboard.`,properties:{score:{type:`number`,description:`0–100: how worth-tracking-over-time this is.`},reason:{type:`string`,description:`Short why, e.g. "weekly burn rate, ongoing".`}},required:[`score`,`reason`]},sources:{type:`array`,description:`OMIT unless this turn used web-search results. Real source URLs actually relied on — never invented.`,items:{type:`object`,properties:{title:{type:`string`},url:{type:`string`}},required:[`title`,`url`]}},causal:{type:`boolean`,description:`true ONLY when this answer explains a mechanism — causes producing an outcome. false for lookups, procedures, comparisons, calculations, or anything you were asked to write.`}},required:[`narration`,`title`,`sub`,`blocks`]}}function f(e){return e.length?`\n\n[The user attached ${e.map(e=>`"${e.name}"`).join(`, `)}, which this model can't read directly. Answer from the question text, and say if you'd need its contents.]`:``}function p(e,t){if(!t?.length)return e;let n=[],r=[];for(let e of t)l(e)?n.push({type:`image`,source:{type:`base64`,media_type:e.mime,data:e.data}}):c(e)?n.push({type:`document`,source:{type:`base64`,media_type:e.mime,data:e.data}}):r.push(e);return n.push({type:`text`,text:e+f(r)}),n}function m(e,t){if(!t?.length)return e;let n=t.filter(l),r=t.filter(e=>!l(e));if(!n.length)return e+f(r);let i=n.map(e=>({type:`image_url`,image_url:{url:`data:${e.mime};base64,${e.data}`}}));return i.push({type:`text`,text:e+f(r)}),i}function h(e,t){let n=(t??[]).filter(l),r=(t??[]).filter(e=>!l(e)),i=n.map(e=>({type:`input_image`,detail:`auto`,image_url:`data:${e.mime};base64,${e.data}`}));return i.push({type:`input_text`,text:e+f(r)}),i}function g(e,t){if(!t?.length)return[{text:e}];let n=[],r=[];for(let e of t)l(e)||c(e)?n.push({inlineData:{mimeType:e.mime,data:e.data}}):r.push(e);return n.push({text:e+f(r)}),n}function _(e,t){return t?.length?e+f(t):e}var v=`/llm/anthropic`,y=`/v1/messages`,b=`/v1/models`,x=`2023-06-01`,S=6e4,C=4e3;function w(e){return{"Content-Type":`application/json`,"x-api-key":e.apiKey??``,"anthropic-version":x,"anthropic-dangerous-direct-browser-access":`true`}}function T(e){return/haiku/i.test(e)?`web_search_20250305`:`web_search_20260209`}var E={id:`anthropic`,capabilities:{constrainedDecoding:!0,streaming:!0,vision:!0,contextWindow:2e5,strengthTier:`frontier`,nativeWebSearch:!0},async probe(e){try{let t=e.baseUrl??v,r=await n(`${t}${b}`,{method:`GET`,headers:w(e)},C);if(!r.ok)return{ok:!1,model:!1,statusCode:r.status};let i=await n(`${t}${y}`,{method:`POST`,headers:w(e),body:JSON.stringify({model:e.model,max_tokens:1,messages:[{role:`user`,content:`ping`}]})},C);return{ok:i.ok,model:i.ok,statusCode:i.status}}catch{return{ok:!1,model:!1}}},async warm(e){try{let t=e.baseUrl??v;await n(`${t}${b}`,{method:`GET`,headers:w(e)},C)}catch{}},async generate(o,s,c){let l=s.baseUrl??v,u=o.systemBase??o.system,f=o.systemBase?o.system.slice(u.length).trimStart():``,m=[{type:`text`,text:u,cache_control:{type:`ephemeral`}},...f?[{type:`text`,text:f}]:[]],h=o.thinkingLevel===`medium`||o.thinkingLevel===`high`,g=o.format===void 0&&!!o.blockTypes?.length,_=o.format===void 0?g?d(o.blockTypes,o.complexity):null:o.format,b=!!o.tools?.webSearch,x=await n(`${l}${y}`,{method:`POST`,headers:w(s),body:JSON.stringify({model:s.model,max_tokens:o.maxTokens??1024,temperature:h?1:o.temperature??.3,...h?{thinking:{type:`adaptive`,display:`summarized`}}:{},system:m,messages:[...o.history,{role:`user`,content:p(o.user,o.attachments)}],..._?{output_config:{format:{type:`json_schema`,schema:_}}}:{},...b?{tools:[{type:T(s.model),name:`web_search`,max_uses:5}]}:{},stream:!0})},S,o.signal);if(!x.ok)throw Error(`anthropic ${x.status}${await e(x)}`);let C=``,E,D=new Map;await r(x,e=>{let n=t(e),r=a(n.type);if(r===`content_block_delta`){let e=t(n.delta),r=a(e.text);r&&(C+=r,c?.(r));let i=t(e.citation),o=a(i.url);o&&!D.has(o)&&D.set(o,{title:a(i.title)||o,url:o})}else if(r===`message_start`){let e=t(t(n.message).usage);E={input:i(e.input_tokens)+i(e.cache_read_input_tokens)+i(e.cache_creation_input_tokens),output:i(e.output_tokens),cachedInput:i(e.cache_read_input_tokens)}}else if(r===`message_delta`){let e=t(n.usage);e.output_tokens!==void 0&&(E={input:E?.input??0,cachedInput:E?.cachedInput??0,output:i(e.output_tokens)})}});let O=D.size?[...D.values()]:void 0;try{return{raw:JSON.parse(C),...O?{sources:O}:{},...E?{usage:E}:{}}}catch{return{raw:C,...O?{sources:O}:{},...E?{usage:E}:{}}}}},D=6e4,O=4e3,k=18e4;function A(e){return/(?:^|\/)(?:o[1-9]|gpt-5)/i.test(e)}function j(e,t){let n=t.code,r=typeof n==`number`?n:Number(a(n))||void 0,i=a(t.type),o=typeof n==`string`?n:``,s=a(t.message)||`request failed`,c=`${i} ${o} ${s}`;return`${e} ${r??(/invalid.?api.?key|unauthorized|authentication/i.test(c)?401:/insufficient.?quota|resource.?exhausted|rate.?limit/i.test(c)?429:void 0)??``} ${s}`.trim()}function M(s){let{id:c,proxyBase:l,apiBase:u=``,capabilities:d,extraHeaders:f,extraBody:p,webSearchTool:h,modelListExhaustive:g=!0,cacheSystemPrefix:v=!1}=s,y=`${u}/v1/chat/completions`,b=`${u}/v1/models`;function x(e){return{"Content-Type":`application/json`,Authorization:`Bearer ${e.apiKey??``}`,...f}}return{id:c,capabilities:d,async probe(e){try{let r=e.baseUrl??l,i=await n(`${r}${b}`,{method:`GET`,headers:x(e)},O);if(!i.ok)return{ok:!1,model:!1,statusCode:i.status};let s=await i.json(),c=o(t(s).data).map(e=>a(t(e).id)),u=c.length===0||c.includes(e.model);return{ok:!0,model:!g||u}}catch{return{ok:!1,model:!1}}},async generate(s,u,f){let g=u.baseUrl??l,b=h&&s.tools?.webSearch?h():void 0,S=A(u.model),C=s.systemBase,w=!!C&&s.system.startsWith(C),T=w?C:s.system,E=w?s.system.slice(C.length).trim():``,O=v&&w?{role:`system`,content:[{type:`text`,text:T,cache_control:{type:`ephemeral`}}]}:{role:`system`,content:T},M=e=>E?Array.isArray(e)?[{type:`text`,text:E},...e]:`${E}\n\n${e}`:e,N=new AbortController,P=setTimeout(()=>N.abort(),k),F=s.signal?AbortSignal.any([s.signal,N.signal]):N.signal;try{let l=await n(`${g}${y}`,{method:`POST`,headers:x(u),body:JSON.stringify({...p??{},model:u.model,...S?{max_completion_tokens:Math.max(s.maxTokens??1024,1500),reasoning_effort:`low`}:{max_tokens:s.maxTokens??1024,temperature:s.temperature??.3},response_format:{type:`json_object`},stream:!0,stream_options:{include_usage:!0},...b?{tools:[b]}:{},messages:[O,...s.history,{role:`user`,content:d.vision?M(m(s.user,s.attachments)):M(_(s.user,s.attachments))}]})},D,F);if(!l.ok)throw Error(`${c} ${l.status}${await e(l)}`);let h=``,v,C=!1,w=new Map,T;try{await r(l,e=>{let n=t(e);if(n.error)return T=j(c,t(n.error)),!0;let r=t(n.usage);if((r.prompt_tokens!==void 0||r.completion_tokens!==void 0)&&(v={input:i(r.prompt_tokens),output:i(r.completion_tokens),cachedInput:i(t(r.prompt_tokens_details).cached_tokens)},C)||C)return!0;let s=t(o(n.choices)[0]),l=t(s.delta),u=a(l.content);u&&(h+=u,f?.(u));let d=a(l.reasoning)||a(l.reasoning_content);if(d&&f?.(d,{reasoning:!0}),b)for(let e of o(l.annotations)){let n=t(e);if(a(n.type)===`url_citation`){let e=t(n.url_citation),r=a(e.url);r&&!w.has(r)&&w.set(r,{url:r,title:a(e.title)||r})}}if(a(s.finish_reason))return C=!0,v?!0:void 0})}catch(e){if(!C||!h)throw e}if(T)throw Error(T);let E=w.size?[...w.values()]:void 0;return{raw:h,...E?{sources:E}:{},...v?{usage:v}:{}}}finally{clearTimeout(P)}}}}var N=6e4,P=4e3,F=3;function I(e,t){let n=Number(e.headers.get(`retry-after`));return Number.isFinite(n)&&n>0?Math.min(n*1e3,1e4):Math.min(800*2**t,8e3)}function L(e,t){return new Promise((n,r)=>{if(t?.aborted)return r(new DOMException(`Aborted`,`AbortError`));let i=setTimeout(n,e);t?.addEventListener(`abort`,()=>{clearTimeout(i),r(new DOMException(`Aborted`,`AbortError`))},{once:!0})})}async function R(e){try{let t=await e.json(),n=typeof t.error?.message==`string`?t.error.message:``,r=typeof t.error?.param==`string`?` (param: ${t.error.param})`:``;return n?` — ${n.slice(0,200)}${r}`:``}catch{return``}}function z(e){let{id:s,proxyBase:c,apiBase:l=``,capabilities:u,extraHeaders:f,webSearchTool:p}=e,m=`${l}/v1/responses`,g=`${l}/v1/models`;function _(e){return{"Content-Type":`application/json`,Authorization:`Bearer ${e.apiKey??``}`,...f}}return{id:s,capabilities:u,async probe(e){try{let r=e.baseUrl??c,i=await n(`${r}${g}`,{method:`GET`,headers:_(e)},P);if(!i.ok){let e=i.status;if(s===`grok`&&e===400)try{(await i.clone().json()).code===`invalid-argument`&&(e=401)}catch{}return{ok:!1,model:!1,statusCode:e}}let l=await i.json(),u=o(t(l).data).map(e=>a(t(e).id));return{ok:!0,model:u.length===0||u.includes(e.model)}}catch{return{ok:!1,model:!1}}},async generate(e,l,f){let g=l.baseUrl??c,v=p&&e.tools?.webSearch?p():void 0,y=A(l.model),b=e.history.map(e=>({role:e.role,content:e.content})),x=u.vision?h(e.user,e.attachments):[{type:`input_text`,text:e.user}],S=e.systemBase,C=S&&e.system.startsWith(S)?S:e.system,w=S&&e.system.startsWith(S)?e.system.slice(S.length).trim():``,T=w?[{type:`input_text`,text:w},...x]:x,E=e.format===void 0&&!!e.blockTypes?.length,D=e.format===void 0?E?d(e.blockTypes,e.complexity):null:e.format,O=v?D?{type:`json_schema`,name:E?`live_canvas`:`live_json`,schema:D,strict:!1}:{type:`text`}:{type:`json_object`},k=O.type===`text`?[]:[{role:`system`,content:`Respond in JSON.`}],M=v&&!E?e.thinkingLevel===`high`?`high`:`medium`:`low`,P={method:`POST`,headers:_(l),body:JSON.stringify({model:l.model,...s===`openai`?{store:!1}:{},instructions:C,input:[...k,...b,{role:`user`,content:T}],text:{format:O},max_output_tokens:y?Math.max(e.maxTokens??1024,M===`high`?12e3:M===`medium`?8e3:1500):e.maxTokens??1024,...y?{reasoning:{effort:M}}:{temperature:e.temperature??.3},stream:!0,...v?{tools:[v]}:{}})},z;for(let t=0;z=await n(`${g}${m}`,P,N,e.signal),!z.ok;t++){if(z.status===429&&t<F&&!e.signal?.aborted){await L(I(z,t),e.signal);continue}throw Error(`${s} ${z.status}${await R(z)}`)}let B=``,V=new Map,H,U;if(await r(z,e=>{let n=t(e),r=a(n.type),c=t(t(n.response).error),l=t(n.error),u=Object.keys(c).length?c:l;if(Object.keys(u).length)return U=j(s,u),!0;if(r===`response.output_text.delta`){let e=a(n.delta);e&&(B+=e,f?.(e));return}if(r===`response.incomplete`){if(!B){let e=a(t(t(n.response).incomplete_details).reason);return U=e===`max_output_tokens`?`${s}: the model used its entire output budget on reasoning and never wrote an answer — raise maxTokens`:`${s}: the model stopped before writing an answer${e?` (${e})`:``}`,!0}return}if(r===`response.completed`){let e=t(n.response);for(let n of o(e.output)){let e=t(n);if(a(e.type)===`message`)for(let n of o(e.content))for(let e of o(t(n).annotations)){let n=t(e);if(a(n.type)!==`url_citation`)continue;let r=a(n.url);r&&!V.has(r)&&V.set(r,{url:r,title:a(n.title)||r})}}let r=t(e.usage);(r.input_tokens!==void 0||r.output_tokens!==void 0)&&(H={input:i(r.input_tokens),output:i(r.output_tokens),cachedInput:i(t(r.input_tokens_details).cached_tokens)});return}}),U)throw Error(U);let W=V.size?[...V.values()]:void 0;return{raw:B,...W?{sources:W}:{},...H?{usage:H}:{}}}}}var B=z({id:`openai`,proxyBase:`/llm/openai`,webSearchTool:()=>({type:`web_search`}),capabilities:{constrainedDecoding:!0,streaming:!0,vision:!0,contextWindow:128e3,strengthTier:`frontier`,nativeWebSearch:!0}}),V=`/llm/gemini`,H=`/v1beta`,U=6e4,W=4e3;function G(e){return{"Content-Type":`application/json`,"x-goog-api-key":e.apiKey??``}}async function K(e){try{let t=await e.json(),n=typeof t.error?.status==`string`?t.error.status:``,r=typeof t.error?.message==`string`?t.error.message:``,i=n&&r?`${n}: ${r.slice(0,160)}`:n||r.slice(0,160);return i?` — ${i}`:``}catch{return``}}function q(e){if(e)return{thinkingLevel:e.toUpperCase()}}function J(e){let t=[];return e.tools?.webSearch&&t.push({google_search:{}}),e.tools?.urlContext&&t.push({url_context:{}}),t.length?t:void 0}function Y(e,n){let r=t(e.groundingMetadata);for(let e of o(r.groundingChunks)){let r=t(t(e).web),i=a(r.uri);!i||n.has(i)||n.set(i,{title:a(r.title)||i,url:i})}}var X={anthropic:E,gemini:{id:`gemini`,capabilities:{constrainedDecoding:!0,streaming:!0,vision:!0,contextWindow:1e6,strengthTier:`frontier`,nativeWebSearch:!0},async probe(e){try{let r=e.baseUrl??V,i=await n(`${r}${H}/models`,{method:`GET`,headers:G(e)},W);if(!i.ok)return{ok:!1,model:!1,statusCode:i.status};let s=await i.json(),c=o(t(s).models).map(e=>a(t(e).name).replace(/^models\//,``));return{ok:!0,model:c.length===0||c.includes(e.model)}}catch{return{ok:!1,model:!1}}},async generate(e,s,c){let l=`${s.baseUrl??V}${H}/models/${encodeURIComponent(s.model)}:streamGenerateContent?alt=sse`,u=e.systemBase,d=e.system,f=``;u&&e.system.startsWith(u)&&(d=u,f=e.system.slice(u.length).trim());let p=g(e.user,e.attachments),m=[...e.history.map(e=>({role:e.role===`assistant`?`model`:`user`,parts:[{text:e.content}]})),{role:`user`,parts:f?[{text:f},...p]:p}],h={temperature:e.temperature??.3,maxOutputTokens:e.maxTokens??1024,responseMimeType:`application/json`},_=q(e.thinkingLevel);_&&(h.thinkingConfig=_);let v=J(e),y=await n(l,{method:`POST`,headers:G(s),body:JSON.stringify({systemInstruction:{parts:[{text:d}]},contents:m,generationConfig:h,...v?{tools:v}:{}})},U,e.signal);if(!y.ok)throw Error(`gemini ${y.status}${await K(y)}`);let b=``,x=new Map,S;await r(y,e=>{let n=t(o(t(e).candidates)[0]),r=o(t(n.content).parts);for(let e of r){let n=a(t(e).text);n&&(b+=n,c?.(n))}Y(n,x);let s=t(e).usageMetadata;s&&(S={input:i(t(s).promptTokenCount),output:i(t(s).candidatesTokenCount),cachedInput:i(t(s).cachedContentTokenCount)})});let C={raw:b};return x.size&&(C.sources=[...x.values()]),S&&(C.usage=S),C}},openai:B,openrouter:M({id:`openrouter`,proxyBase:`/llm/openrouter`,apiBase:`/api`,extraHeaders:{"HTTP-Referer":`https://github.com/TryMaveaAI/mavea`,"X-Title":`Mavéa`},extraBody:{transforms:[`middle-out`]},cacheSystemPrefix:!0,modelListExhaustive:!1,webSearchTool:()=>({type:`openrouter:web_search`,parameters:{engine:`auto`,max_results:5,search_context_size:`medium`}}),capabilities:{constrainedDecoding:!0,streaming:!0,vision:!0,contextWindow:128e3,strengthTier:`frontier`,nativeWebSearch:!0}}),grok:z({id:`grok`,proxyBase:`/llm/grok`,webSearchTool:()=>({type:`web_search`}),capabilities:{constrainedDecoding:!0,streaming:!0,vision:!0,contextWindow:5e5,strengthTier:`frontier`,nativeWebSearch:!0}})};function Z(e){return X[e]}export{A as n,Z as t};
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./http-Lar_UMKb.js";import{t as s}from"./blockTypes-DUDdP3pB.js";import"./info-CiqHR5cs.js";import{g as c,m as l}from"./attachments-BW-vki-E.js";var u=[...s];function d(e=u,t){return{type:`object`,properties:{narration:{type:`string`,description:`ONE warm spoken sentence. Emit this FIRST so it can be spoken immediately.`},title:{type:`string`,description:`A short headline for the answer.`},sub:{type:`string`,description:`One short supporting line.`},blocks:{type:`array`,minItems:t===`brief`?1:3,maxItems:18,items:{type:`object`,properties:{type:{type:`string`,enum:[...e]},props:{type:`object`,description:`Fields for this block type.`}},required:[`type`,`props`]}},track:{type:`object`,description:`OMIT unless this answer is a rare ongoing metric worth a living dashboard.`,properties:{score:{type:`number`,description:`0–100: how worth-tracking-over-time this is.`},reason:{type:`string`,description:`Short why, e.g. "weekly burn rate, ongoing".`}},required:[`score`,`reason`]},sources:{type:`array`,description:`OMIT unless this turn used web-search results. Real source URLs actually relied on — never invented.`,items:{type:`object`,properties:{title:{type:`string`},url:{type:`string`}},required:[`title`,`url`]}},causal:{type:`boolean`,description:`true ONLY when this answer explains a mechanism — causes producing an outcome. false for lookups, procedures, comparisons, calculations, or anything you were asked to write.`}},required:[`narration`,`title`,`sub`,`blocks`]}}function f(e){return e.length?`\n\n[The user attached ${e.map(e=>`"${e.name}"`).join(`, `)}, which this model can't read directly. Answer from the question text, and say if you'd need its contents.]`:``}function p(e,t){if(!t?.length)return e;let n=[],r=[];for(let e of t)l(e)?n.push({type:`image`,source:{type:`base64`,media_type:e.mime,data:e.data}}):c(e)?n.push({type:`document`,source:{type:`base64`,media_type:e.mime,data:e.data}}):r.push(e);return n.push({type:`text`,text:e+f(r)}),n}function m(e,t){if(!t?.length)return e;let n=t.filter(l),r=t.filter(e=>!l(e));if(!n.length)return e+f(r);let i=n.map(e=>({type:`image_url`,image_url:{url:`data:${e.mime};base64,${e.data}`}}));return i.push({type:`text`,text:e+f(r)}),i}function h(e,t){let n=(t??[]).filter(l),r=(t??[]).filter(e=>!l(e)),i=n.map(e=>({type:`input_image`,detail:`auto`,image_url:`data:${e.mime};base64,${e.data}`}));return i.push({type:`input_text`,text:e+f(r)}),i}function g(e,t){if(!t?.length)return[{text:e}];let n=[],r=[];for(let e of t)l(e)||c(e)?n.push({inlineData:{mimeType:e.mime,data:e.data}}):r.push(e);return n.push({text:e+f(r)}),n}function _(e,t){return t?.length?e+f(t):e}var v=`/llm/anthropic`,y=`/v1/messages`,b=`/v1/models`,x=`2023-06-01`,S=6e4,C=4e3;function w(e){return{"Content-Type":`application/json`,"x-api-key":e.apiKey??``,"anthropic-version":x,"anthropic-dangerous-direct-browser-access":`true`}}function T(e){return/haiku/i.test(e)?`web_search_20250305`:`web_search_20260209`}var E={id:`anthropic`,capabilities:{constrainedDecoding:!0,streaming:!0,vision:!0,contextWindow:2e5,strengthTier:`frontier`,nativeWebSearch:!0},async probe(e){try{let t=e.baseUrl??v,r=await n(`${t}${b}`,{method:`GET`,headers:w(e)},C);if(!r.ok)return{ok:!1,model:!1,statusCode:r.status};let i=await n(`${t}${y}`,{method:`POST`,headers:w(e),body:JSON.stringify({model:e.model,max_tokens:1,messages:[{role:`user`,content:`ping`}]})},C);return{ok:i.ok,model:i.ok,statusCode:i.status}}catch{return{ok:!1,model:!1}}},async warm(e){try{let t=e.baseUrl??v;await n(`${t}${b}`,{method:`GET`,headers:w(e)},C)}catch{}},async generate(o,s,c){let l=s.baseUrl??v,u=o.systemBase??o.system,f=o.systemBase?o.system.slice(u.length).trimStart():``,m=[{type:`text`,text:u,cache_control:{type:`ephemeral`}},...f?[{type:`text`,text:f}]:[]],h=o.thinkingLevel===`medium`||o.thinkingLevel===`high`,g=o.format===void 0&&!!o.blockTypes?.length,_=o.format===void 0?g?d(o.blockTypes,o.complexity):null:o.format,b=!!o.tools?.webSearch,x=await n(`${l}${y}`,{method:`POST`,headers:w(s),body:JSON.stringify({model:s.model,max_tokens:o.maxTokens??1024,temperature:h?1:o.temperature??.3,...h?{thinking:{type:`adaptive`,display:`summarized`}}:{},system:m,messages:[...o.history,{role:`user`,content:p(o.user,o.attachments)}],..._?{output_config:{format:{type:`json_schema`,schema:_}}}:{},...b?{tools:[{type:T(s.model),name:`web_search`,max_uses:5}]}:{},stream:!0})},S,o.signal);if(!x.ok)throw Error(`anthropic ${x.status}${await e(x)}`);let C=``,E,D=new Map;await r(x,e=>{let n=t(e),r=a(n.type);if(r===`content_block_delta`){let e=t(n.delta),r=a(e.text);r&&(C+=r,c?.(r));let i=t(e.citation),o=a(i.url);o&&!D.has(o)&&D.set(o,{title:a(i.title)||o,url:o})}else if(r===`message_start`){let e=t(t(n.message).usage);E={input:i(e.input_tokens)+i(e.cache_read_input_tokens)+i(e.cache_creation_input_tokens),output:i(e.output_tokens),cachedInput:i(e.cache_read_input_tokens)}}else if(r===`message_delta`){let e=t(n.usage);e.output_tokens!==void 0&&(E={input:E?.input??0,cachedInput:E?.cachedInput??0,output:i(e.output_tokens)})}});let O=D.size?[...D.values()]:void 0;try{return{raw:JSON.parse(C),...O?{sources:O}:{},...E?{usage:E}:{}}}catch{return{raw:C,...O?{sources:O}:{},...E?{usage:E}:{}}}}},D=6e4,O=4e3,k=18e4;function A(e){return/(?:^|\/)(?:o[1-9]|gpt-5)/i.test(e)}function j(e,t){let n=t.code,r=typeof n==`number`?n:Number(a(n))||void 0,i=a(t.type),o=typeof n==`string`?n:``,s=a(t.message)||`request failed`,c=`${i} ${o} ${s}`;return`${e} ${r??(/invalid.?api.?key|unauthorized|authentication/i.test(c)?401:/insufficient.?quota|resource.?exhausted|rate.?limit/i.test(c)?429:void 0)??``} ${s}`.trim()}function M(s){let{id:c,proxyBase:l,apiBase:u=``,capabilities:d,extraHeaders:f,extraBody:p,webSearchTool:h,modelListExhaustive:g=!0,cacheSystemPrefix:v=!1}=s,y=`${u}/v1/chat/completions`,b=`${u}/v1/models`;function x(e){return{"Content-Type":`application/json`,Authorization:`Bearer ${e.apiKey??``}`,...f}}return{id:c,capabilities:d,async probe(e){try{let r=e.baseUrl??l,i=await n(`${r}${b}`,{method:`GET`,headers:x(e)},O);if(!i.ok)return{ok:!1,model:!1,statusCode:i.status};let s=await i.json(),c=o(t(s).data).map(e=>a(t(e).id)),u=c.length===0||c.includes(e.model);return{ok:!0,model:!g||u}}catch{return{ok:!1,model:!1}}},async generate(s,u,f){let g=u.baseUrl??l,b=h&&s.tools?.webSearch?h():void 0,S=A(u.model),C=s.systemBase,w=!!C&&s.system.startsWith(C),T=w?C:s.system,E=w?s.system.slice(C.length).trim():``,O=v&&w?{role:`system`,content:[{type:`text`,text:T,cache_control:{type:`ephemeral`}}]}:{role:`system`,content:T},M=e=>E?Array.isArray(e)?[{type:`text`,text:E},...e]:`${E}\n\n${e}`:e,N=new AbortController,P=setTimeout(()=>N.abort(),k),F=s.signal?AbortSignal.any([s.signal,N.signal]):N.signal;try{let l=await n(`${g}${y}`,{method:`POST`,headers:x(u),body:JSON.stringify({...p??{},model:u.model,...S?{max_completion_tokens:Math.max(s.maxTokens??1024,1500),reasoning_effort:`low`}:{max_tokens:s.maxTokens??1024,temperature:s.temperature??.3},response_format:{type:`json_object`},stream:!0,stream_options:{include_usage:!0},...b?{tools:[b]}:{},messages:[O,...s.history,{role:`user`,content:d.vision?M(m(s.user,s.attachments)):M(_(s.user,s.attachments))}]})},D,F);if(!l.ok)throw Error(`${c} ${l.status}${await e(l)}`);let h=``,v,C=!1,w=new Map,T;try{await r(l,e=>{let n=t(e);if(n.error)return T=j(c,t(n.error)),!0;let r=t(n.usage);if((r.prompt_tokens!==void 0||r.completion_tokens!==void 0)&&(v={input:i(r.prompt_tokens),output:i(r.completion_tokens),cachedInput:i(t(r.prompt_tokens_details).cached_tokens)},C)||C)return!0;let s=t(o(n.choices)[0]),l=t(s.delta),u=a(l.content);u&&(h+=u,f?.(u));let d=a(l.reasoning)||a(l.reasoning_content);if(d&&f?.(d,{reasoning:!0}),b)for(let e of o(l.annotations)){let n=t(e);if(a(n.type)===`url_citation`){let e=t(n.url_citation),r=a(e.url);r&&!w.has(r)&&w.set(r,{url:r,title:a(e.title)||r})}}if(a(s.finish_reason))return C=!0,v?!0:void 0})}catch(e){if(!C||!h)throw e}if(T)throw Error(T);let E=w.size?[...w.values()]:void 0;return{raw:h,...E?{sources:E}:{},...v?{usage:v}:{}}}finally{clearTimeout(P)}}}}var N=6e4,P=4e3,F=3;function I(e,t){let n=Number(e.headers.get(`retry-after`));return Number.isFinite(n)&&n>0?Math.min(n*1e3,1e4):Math.min(800*2**t,8e3)}function L(e,t){return new Promise((n,r)=>{if(t?.aborted)return r(new DOMException(`Aborted`,`AbortError`));let i=setTimeout(n,e);t?.addEventListener(`abort`,()=>{clearTimeout(i),r(new DOMException(`Aborted`,`AbortError`))},{once:!0})})}async function R(e){try{let t=await e.json(),n=typeof t.error?.message==`string`?t.error.message:``,r=typeof t.error?.param==`string`?` (param: ${t.error.param})`:``;return n?` — ${n.slice(0,200)}${r}`:``}catch{return``}}function z(e){let{id:s,proxyBase:c,apiBase:l=``,capabilities:u,extraHeaders:f,webSearchTool:p,forceSearchToolChoice:m}=e,g=`${l}/v1/responses`,_=`${l}/v1/models`;function v(e){return{"Content-Type":`application/json`,Authorization:`Bearer ${e.apiKey??``}`,...f}}return{id:s,capabilities:u,async probe(e){try{let r=e.baseUrl??c,i=await n(`${r}${_}`,{method:`GET`,headers:v(e)},P);if(!i.ok){let e=i.status;if(s===`grok`&&e===400)try{(await i.clone().json()).code===`invalid-argument`&&(e=401)}catch{}return{ok:!1,model:!1,statusCode:e}}let l=await i.json(),u=o(t(l).data).map(e=>a(t(e).id));return{ok:!0,model:u.length===0||u.includes(e.model)}}catch{return{ok:!1,model:!1}}},async generate(e,l,f){let _=l.baseUrl??c,y=p&&e.tools?.webSearch?p():void 0,b=A(l.model),x=e.history.map(e=>({role:e.role,content:e.content})),S=u.vision?h(e.user,e.attachments):[{type:`input_text`,text:e.user}],C=e.systemBase,w=C&&e.system.startsWith(C)?C:e.system,T=C&&e.system.startsWith(C)?e.system.slice(C.length).trim():``,E=T?[{type:`input_text`,text:T},...S]:S,D=e.format===void 0&&!!e.blockTypes?.length,O=e.format===void 0?D?d(e.blockTypes,e.complexity):null:e.format,k=y?O?{type:`json_schema`,name:D?`live_canvas`:`live_json`,schema:O,strict:!1}:{type:`text`}:{type:`json_object`},M=k.type===`text`?[]:[{role:`system`,content:`Respond in JSON.`}],P=y&&!D?e.thinkingLevel===`high`?`high`:`medium`:`low`,z={method:`POST`,headers:v(l),body:JSON.stringify({model:l.model,...s===`openai`?{store:!1}:{},instructions:w,input:[...M,...x,{role:`user`,content:E}],text:{format:k},max_output_tokens:b?Math.max(e.maxTokens??1024,P===`high`?12e3:P===`medium`?8e3:1500):e.maxTokens??1024,...b?{reasoning:{effort:P}}:{temperature:e.temperature??.3},stream:!0,...y?{tools:[y]}:{},...y&&e.tools?.requireSearch&&m?{tool_choice:m()}:{}})},B;for(let t=0;B=await n(`${_}${g}`,z,N,e.signal),!B.ok;t++){if(B.status===429&&t<F&&!e.signal?.aborted){await L(I(B,t),e.signal);continue}throw Error(`${s} ${B.status}${await R(B)}`)}let V=``,H=new Map,U,W;if(await r(B,e=>{let n=t(e),r=a(n.type),c=t(t(n.response).error),l=t(n.error),u=Object.keys(c).length?c:l;if(Object.keys(u).length)return W=j(s,u),!0;if(r===`response.output_text.delta`){let e=a(n.delta);e&&(V+=e,f?.(e));return}if(r===`response.incomplete`){if(!V){let e=a(t(t(n.response).incomplete_details).reason);return W=e===`max_output_tokens`?`${s}: the model used its entire output budget on reasoning and never wrote an answer — raise maxTokens`:`${s}: the model stopped before writing an answer${e?` (${e})`:``}`,!0}return}if(r===`response.completed`){let e=t(n.response);for(let n of o(e.output)){let e=t(n);if(a(e.type)===`message`)for(let n of o(e.content))for(let e of o(t(n).annotations)){let n=t(e);if(a(n.type)!==`url_citation`)continue;let r=a(n.url);r&&!H.has(r)&&H.set(r,{url:r,title:a(n.title)||r})}}let r=t(e.usage);(r.input_tokens!==void 0||r.output_tokens!==void 0)&&(U={input:i(r.input_tokens),output:i(r.output_tokens),cachedInput:i(t(r.input_tokens_details).cached_tokens)});return}}),W)throw Error(W);let G=H.size?[...H.values()]:void 0;return{raw:V,...G?{sources:G}:{},...U?{usage:U}:{}}}}}var B=z({id:`openai`,proxyBase:`/llm/openai`,webSearchTool:()=>({type:`web_search`}),forceSearchToolChoice:()=>({type:`web_search`}),capabilities:{constrainedDecoding:!0,streaming:!0,vision:!0,contextWindow:128e3,strengthTier:`frontier`,nativeWebSearch:!0}}),V=`/llm/gemini`,H=`/v1beta`,U=6e4,W=4e3;function G(e){return{"Content-Type":`application/json`,"x-goog-api-key":e.apiKey??``}}async function K(e){try{let t=await e.json(),n=typeof t.error?.status==`string`?t.error.status:``,r=typeof t.error?.message==`string`?t.error.message:``,i=n&&r?`${n}: ${r.slice(0,160)}`:n||r.slice(0,160);return i?` — ${i}`:``}catch{return``}}function q(e){if(e)return{thinkingLevel:e.toUpperCase()}}function J(e){let t=[];return e.tools?.webSearch&&t.push({google_search:{}}),e.tools?.urlContext&&t.push({url_context:{}}),t.length?t:void 0}function Y(e,n){let r=t(e.groundingMetadata);for(let e of o(r.groundingChunks)){let r=t(t(e).web),i=a(r.uri);!i||n.has(i)||n.set(i,{title:a(r.title)||i,url:i})}}var X={anthropic:E,gemini:{id:`gemini`,capabilities:{constrainedDecoding:!0,streaming:!0,vision:!0,contextWindow:1e6,strengthTier:`frontier`,nativeWebSearch:!0},async probe(e){try{let r=e.baseUrl??V,i=await n(`${r}${H}/models`,{method:`GET`,headers:G(e)},W);if(!i.ok)return{ok:!1,model:!1,statusCode:i.status};let s=await i.json(),c=o(t(s).models).map(e=>a(t(e).name).replace(/^models\//,``));return{ok:!0,model:c.length===0||c.includes(e.model)}}catch{return{ok:!1,model:!1}}},async generate(e,s,c){let l=`${s.baseUrl??V}${H}/models/${encodeURIComponent(s.model)}:streamGenerateContent?alt=sse`,u=e.systemBase,d=e.system,f=``;u&&e.system.startsWith(u)&&(d=u,f=e.system.slice(u.length).trim());let p=g(e.user,e.attachments),m=[...e.history.map(e=>({role:e.role===`assistant`?`model`:`user`,parts:[{text:e.content}]})),{role:`user`,parts:f?[{text:f},...p]:p}],h={temperature:e.temperature??.3,maxOutputTokens:e.maxTokens??1024,responseMimeType:`application/json`},_=q(e.thinkingLevel);_&&(h.thinkingConfig=_);let v=J(e),y=await n(l,{method:`POST`,headers:G(s),body:JSON.stringify({systemInstruction:{parts:[{text:d}]},contents:m,generationConfig:h,...v?{tools:v}:{}})},U,e.signal);if(!y.ok)throw Error(`gemini ${y.status}${await K(y)}`);let b=``,x=new Map,S;await r(y,e=>{let n=t(o(t(e).candidates)[0]),r=o(t(n.content).parts);for(let e of r){let n=a(t(e).text);n&&(b+=n,c?.(n))}Y(n,x);let s=t(e).usageMetadata;s&&(S={input:i(t(s).promptTokenCount),output:i(t(s).candidatesTokenCount),cachedInput:i(t(s).cachedContentTokenCount)})});let C={raw:b};return x.size&&(C.sources=[...x.values()]),S&&(C.usage=S),C}},openai:B,openrouter:M({id:`openrouter`,proxyBase:`/llm/openrouter`,apiBase:`/api`,extraHeaders:{"HTTP-Referer":`https://github.com/TryMaveaAI/mavea`,"X-Title":`Mavéa`},extraBody:{transforms:[`middle-out`]},cacheSystemPrefix:!0,modelListExhaustive:!1,webSearchTool:()=>({type:`openrouter:web_search`,parameters:{engine:`auto`,max_results:5,search_context_size:`medium`}}),capabilities:{constrainedDecoding:!0,streaming:!0,vision:!0,contextWindow:128e3,strengthTier:`frontier`,nativeWebSearch:!0}}),grok:z({id:`grok`,proxyBase:`/llm/grok`,webSearchTool:()=>({type:`web_search`}),capabilities:{constrainedDecoding:!0,streaming:!0,vision:!0,contextWindow:5e5,strengthTier:`frontier`,nativeWebSearch:!0}})};function Z(e){return X[e]}export{A as n,Z as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{it as r}from"./index-CfcUMOBf.js";import{n as i}from"./http-Lar_UMKb.js";import{S as a,f as o,g as s,n as c,p as l,r as u,w as d,x as f}from"./kokoro-CdL8Kl48.js";import{i as p,t as m}from"./info-CiqHR5cs.js";import{r as h,t as g}from"./store-gohr8YVT.js";import{a as _,t as v}from"./store-BWLbFXiY.js";import{n as ee}from"./DropSelect-C3uYlej-.js";var y=t(),b=e();function te(){let e=(0,y.c)(2),[t,n]=(0,b.useState)(ne),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{if(typeof window>`u`)return;let e=()=>n(h());return window.addEventListener(g,e),()=>window.removeEventListener(g,e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,b.useEffect)(r,i),t}function ne(){return h()}var re=r(),x=n();function S(e){return e.split(` · `)[1]??e}function C({provider:e,value:t,onChange:n,ariaLabel:r=`Model`}){let i=p(e),a=(0,b.useId)(),o=(0,b.useRef)(null),s=(0,b.useRef)(null),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(-1),f=ee(c,o),h=i.suggestedModels,g=t||i.defaultModel,_=e=>`${a}-opt-${e}`,v=()=>{d(h.indexOf(g)),l(!0)},y=e=>{n(e),l(!1),s.current?.focus()};return(0,b.useEffect)(()=>{c&&u>=0&&document.getElementById(_(u))?.scrollIntoView?.({block:`nearest`})},[c,u]),(0,x.jsxs)(`div`,{className:`drop-select`,ref:o,children:[(0,x.jsx)(`input`,{ref:s,className:`setup-input drop-select-input`,role:`combobox`,"aria-expanded":c,"aria-controls":a,"aria-activedescendant":c&&u>=0?_(u):void 0,"aria-autocomplete":`none`,"aria-label":r,value:t,onChange:e=>{n(e.target.value),c||v(),d(-1)},onClick:()=>c?l(!1):v(),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),!c)return v();if(!h.length)return;let t=e.key===`ArrowDown`?1:-1;d(e=>(e+t+h.length)%h.length)}else e.key===`Enter`&&c&&u>=0?(e.preventDefault(),y(h[u])):e.key===`Escape`&&c&&(e.preventDefault(),l(!1))},onBlur:()=>l(!1),placeholder:i.defaultModel||i.modelPlaceholder,spellCheck:!1}),(0,x.jsx)(`button`,{type:`button`,className:`drop-select-chevron`,"aria-label":`Show model options`,"aria-expanded":c,tabIndex:-1,onPointerDown:e=>e.preventDefault(),onClick:()=>{s.current?.focus(),c?l(!1):v()},children:(0,x.jsx)(`svg`,{viewBox:`0 0 12 8`,fill:`none`,"aria-hidden":!0,children:(0,x.jsx)(`path`,{d:`M1 1.5L6 6.5L11 1.5`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),c&&(0,re.createPortal)((0,x.jsxs)(`div`,{className:`drop-select-menu`,style:f,role:`listbox`,id:a,"aria-label":`${S(i.label)} models`,onPointerDown:e=>e.preventDefault(),children:[h.map((e,t)=>(0,x.jsxs)(`div`,{id:_(t),role:`option`,tabIndex:-1,"aria-selected":e===g,className:`drop-select-option`+(t===u?` is-active`:``)+(e===g?` is-current`:``),onMouseEnter:()=>d(t),onClick:()=>y(e),children:[(0,x.jsxs)(`span`,{className:`drop-select-option-head`,children:[(0,x.jsx)(`span`,{className:`drop-select-id`,children:e}),e===i.defaultModel&&(0,x.jsx)(`span`,{className:`drop-select-badge`,children:`Default`})]}),i.modelNotes?.[e]&&(0,x.jsx)(`span`,{className:`drop-select-note`,children:i.modelNotes[e]})]},e)),(0,x.jsxs)(`div`,{className:`drop-select-foot`,children:[(0,x.jsxs)(`span`,{children:[`Any `,S(i.label),` model ID works — type it above.`]}),(0,x.jsx)(`a`,{href:m.sources[e],target:`_blank`,rel:`noreferrer noopener`,children:`All models↗`})]})]}),document.body)]})}function w(){let e=(0,y.c)(5),t,n,r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(`strong`,{children:`Before you connect`}),n=(0,x.jsx)(`p`,{children:`You provide the API keys or connected accounts, and those providers bill you directly under their own terms. Each model, web-search, speech, or connected-service request can consume your quota or incur a third-party charge; automatic and cadence-based features can repeat those requests while Mavéa is open. AI output can be incomplete, inaccurate, offensive, or unsafe; accuracy, quality, and availability are not guaranteed. Verify important information independently. Mavéa is not medical, legal, financial, safety, or other professional advice, or an emergency or monitoring service. To the fullest extent permitted by law, Mavéa and its outputs are provided “as is,” without warranties; you use them at your own risk, and Mavéa is not responsible for decisions, actions, losses, harm, or provider charges arising from their use.`}),r=(0,x.jsx)(`p`,{children:`Anything you type, paste, attach, or upload—including work-related, personal, identifiable, confidential, sensitive, or regulated information—may be sent to the model, search, or connected provider you select. Submit it only when you are authorized to share it and when you accept that provider’s processing and retention practices; Mavéa does not control those third parties.`}),i=(0,x.jsx)(`p`,{children:`Choosing Remember stores an encrypted copy of provider and search keys in this browser, sealed with a device-bound key when browser cryptography is available; otherwise they remain session-only. Encryption at rest is a convenience, not a security guarantee: an unlocked, shared, lost, or compromised device, browser profile, or extension can still expose or misuse keys, and Mavéa is not responsible for key theft, unauthorized use, or resulting charges. Keeping keys secure is your responsibility — use restricted, revocable keys with spending caps on trusted devices you control, revoke a key with its provider immediately if you suspect exposure, and monitor your provider account. Keys pass through this deployment’s request proxy when used; settings exports exclude them.`}),e[0]=t,e[1]=n,e[2]=r,e[3]=i):(t=e[0],n=e[1],r=e[2],i=e[3]);let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,x.jsxs)(`aside`,{className:`provider-responsibility`,"aria-label":`Provider billing, data sharing, and AI output responsibility`,children:[t,n,r,i,(0,x.jsxs)(`nav`,{className:`provider-responsibility-links`,"aria-label":`Terms and privacy documents`,children:[(0,x.jsx)(`a`,{className:`provider-responsibility-link`,href:`#/terms?from=live`,children:`Terms`}),(0,x.jsx)(`a`,{className:`provider-responsibility-link`,href:`#/privacy?from=live`,children:`Privacy`}),(0,x.jsx)(`a`,{className:`provider-responsibility-link`,href:`#/legal?from=live`,children:`Read all important information →`})]})]}),e[4]=a):a=e[4],a}function T(){let e=(0,y.c)(2),[t,n]=(0,b.useState)(E),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{if(typeof window>`u`)return;let e=()=>n(_());return window.addEventListener(v,e),()=>window.removeEventListener(v,e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,b.useEffect)(r,i),t}function E(){return _()}var D=`Hi, I'm ready. Ask me anything.`,O=null,k=null,A=null,j=null,M=0;function N(e){return e===M}function P(e,t){if(e)try{e.pause(),e.src=``}catch{}if(t)try{URL.revokeObjectURL(t)}catch{}}function F(){l(),j?.abort(),j=null,A?.(),A=null,P(O,k),O=null,k=null,M++}async function I(e,t,n){try{let r=await i(`/tts/v1/audio/speech`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({model:`kokoro`,input:D,voice:e.kokoro,response_format:`wav`,speed:1})},1e4,n);if(!r.ok||!N(t))return;let a=await r.blob();if(!a.size||!N(t))return;let s=URL.createObjectURL(a),c=new Audio(s),l=o(c),u=()=>{l(),N(t)&&(O=null,k=null,j=null,A=null),P(c,s)};k=s,O=c,A=l,c.onended=u,c.onerror=u;let d=c.play();d&&typeof d.catch==`function`&&d.catch(u)}catch{}}async function L(e,t){let n=await f(D,e.kokoro);if(!N(t)){l();return}if(n)return;let r=new AbortController;j=r,await I(e,t,r.signal)}function R(e){s()||(d(),F(),L(e,M))}var z=`Voice is off — answers will show as captions only. To hear Mavéa, start the local TTS service (docker compose up -d).`,B=`Mavéa is muted — an audition stays silent until you unmute.`;function V(){let e=(0,y.c)(2),[t,n]=(0,b.useState)(H),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=!0;return c().then(t=>{e&&n(t)}),()=>{e=!1}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,b.useEffect)(r,i),t}function H(){return u()}function U(){let e=(0,y.c)(2),t=V(),n=(0,b.useSyncExternalStore)(a,s),r=t===!1?z:n?B:null;if(!r)return null;let i;return e[0]===r?i=e[1]:(i=(0,x.jsx)(`p`,{className:`voice-off-hint`,role:`status`,children:r}),e[0]=r,e[1]=i),i}var W=350,G={Alt:`altKey`,Control:`ctrlKey`,Shift:`shiftKey`},K=[`altKey`,`ctrlKey`,`metaKey`,`shiftKey`];function q(e,t,n){if(e.key!==t||n!==`any`&&e.code!==t+(n===`left`?`Left`:`Right`))return!1;let r=G[t];return!K.some(t=>t!==r&&e[t])}function J(e){let t=(0,b.useRef)(e);t.current=e,(0,b.useEffect)(()=>{if(!e.enabled)return;let n=e.pttKey||`Alt`,r=e.pttSide||`any`,i=null,a=!1,o=()=>{i!==null&&(window.clearTimeout(i),i=null)},s=()=>{o(),a&&(a=!1,t.current.onStop())},c=e=>{if(!q(e,n,r)){e.key!==n&&s();return}e.repeat||i!==null||a||(i=window.setTimeout(()=>{i=null,a=!0,t.current.onStart()},W))},l=e=>{e.key===n&&s()};return window.addEventListener(`keydown`,c),window.addEventListener(`keyup`,l),window.addEventListener(`blur`,s),()=>{window.removeEventListener(`keydown`,c),window.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,s),s()}},[e.enabled,e.pttKey,e.pttSide])}function Y(e,t=`any`){let n=typeof navigator<`u`&&/mac|iphone|ipad|ipod/i.test(navigator.platform||navigator.userAgent),r=e===`Alt`?n?`⌥`:`Alt`:e===`Control`?n?`⌃`:`Ctrl`:e===`Shift`?n?`⇧`:`Shift`:e;return t===`left`?`Left ${r}`:t===`right`?`Right ${r}`:r}function X(e){return e>=22||e<6}var Z=`mavea-live-quiet-hours-on`,Q=Z;function $(){try{return localStorage.getItem(Z)===`1`}catch{return!1}}function ie(e){try{e?localStorage.setItem(Z,`1`):localStorage.removeItem(Z)}catch{}try{window.dispatchEvent(new CustomEvent(Q))}catch{}}var ae=.45,oe=6e4;function se(){let e=(0,y.c)(2),[t,n]=(0,b.useState)(ce),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=()=>n($()&&X(new Date().getHours()));e();let t=window.setInterval(e,oe);return window.addEventListener(Q,e),()=>{window.clearInterval(t),window.removeEventListener(Q,e)}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,b.useEffect)(r,i),t}function ce(){return $()&&X(new Date().getHours())}export{Y as a,V as c,T as d,w as f,se as i,R as l,te as m,$ as n,J as o,C as p,ie as r,U as s,ae as t,F as u};
|
|
1
|
+
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{it as r}from"./index-Dk0QapqQ.js";import{n as i}from"./http-Lar_UMKb.js";import{S as a,f as o,g as s,n as c,p as l,r as u,w as d,x as f}from"./kokoro-P_fkcX-A.js";import{i as p,t as m}from"./info-CiqHR5cs.js";import{r as h,t as g}from"./store-gohr8YVT.js";import{a as _,t as v}from"./store-BWLbFXiY.js";import{n as ee}from"./DropSelect-DjbdVfIR.js";var y=t(),b=e();function te(){let e=(0,y.c)(2),[t,n]=(0,b.useState)(ne),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{if(typeof window>`u`)return;let e=()=>n(h());return window.addEventListener(g,e),()=>window.removeEventListener(g,e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,b.useEffect)(r,i),t}function ne(){return h()}var re=r(),x=n();function S(e){return e.split(` · `)[1]??e}function C({provider:e,value:t,onChange:n,ariaLabel:r=`Model`}){let i=p(e),a=(0,b.useId)(),o=(0,b.useRef)(null),s=(0,b.useRef)(null),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(-1),f=ee(c,o),h=i.suggestedModels,g=t||i.defaultModel,_=e=>`${a}-opt-${e}`,v=()=>{d(h.indexOf(g)),l(!0)},y=e=>{n(e),l(!1),s.current?.focus()};return(0,b.useEffect)(()=>{c&&u>=0&&document.getElementById(_(u))?.scrollIntoView?.({block:`nearest`})},[c,u]),(0,x.jsxs)(`div`,{className:`drop-select`,ref:o,children:[(0,x.jsx)(`input`,{ref:s,className:`setup-input drop-select-input`,role:`combobox`,"aria-expanded":c,"aria-controls":a,"aria-activedescendant":c&&u>=0?_(u):void 0,"aria-autocomplete":`none`,"aria-label":r,value:t,onChange:e=>{n(e.target.value),c||v(),d(-1)},onClick:()=>c?l(!1):v(),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),!c)return v();if(!h.length)return;let t=e.key===`ArrowDown`?1:-1;d(e=>(e+t+h.length)%h.length)}else e.key===`Enter`&&c&&u>=0?(e.preventDefault(),y(h[u])):e.key===`Escape`&&c&&(e.preventDefault(),l(!1))},onBlur:()=>l(!1),placeholder:i.defaultModel||i.modelPlaceholder,spellCheck:!1}),(0,x.jsx)(`button`,{type:`button`,className:`drop-select-chevron`,"aria-label":`Show model options`,"aria-expanded":c,tabIndex:-1,onPointerDown:e=>e.preventDefault(),onClick:()=>{s.current?.focus(),c?l(!1):v()},children:(0,x.jsx)(`svg`,{viewBox:`0 0 12 8`,fill:`none`,"aria-hidden":!0,children:(0,x.jsx)(`path`,{d:`M1 1.5L6 6.5L11 1.5`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),c&&(0,re.createPortal)((0,x.jsxs)(`div`,{className:`drop-select-menu`,style:f,role:`listbox`,id:a,"aria-label":`${S(i.label)} models`,onPointerDown:e=>e.preventDefault(),children:[h.map((e,t)=>(0,x.jsxs)(`div`,{id:_(t),role:`option`,tabIndex:-1,"aria-selected":e===g,className:`drop-select-option`+(t===u?` is-active`:``)+(e===g?` is-current`:``),onMouseEnter:()=>d(t),onClick:()=>y(e),children:[(0,x.jsxs)(`span`,{className:`drop-select-option-head`,children:[(0,x.jsx)(`span`,{className:`drop-select-id`,children:e}),e===i.defaultModel&&(0,x.jsx)(`span`,{className:`drop-select-badge`,children:`Default`})]}),i.modelNotes?.[e]&&(0,x.jsx)(`span`,{className:`drop-select-note`,children:i.modelNotes[e]})]},e)),(0,x.jsxs)(`div`,{className:`drop-select-foot`,children:[(0,x.jsxs)(`span`,{children:[`Any `,S(i.label),` model ID works — type it above.`]}),(0,x.jsx)(`a`,{href:m.sources[e],target:`_blank`,rel:`noreferrer noopener`,children:`All models↗`})]})]}),document.body)]})}function w(){let e=(0,y.c)(5),t,n,r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(`strong`,{children:`Before you connect`}),n=(0,x.jsx)(`p`,{children:`You provide the API keys or connected accounts, and those providers bill you directly under their own terms. Each model, web-search, speech, or connected-service request can consume your quota or incur a third-party charge; automatic and cadence-based features can repeat those requests while Mavéa is open. AI output can be incomplete, inaccurate, offensive, or unsafe; accuracy, quality, and availability are not guaranteed. Verify important information independently. Mavéa is not medical, legal, financial, safety, or other professional advice, or an emergency or monitoring service. To the fullest extent permitted by law, Mavéa and its outputs are provided “as is,” without warranties; you use them at your own risk, and Mavéa is not responsible for decisions, actions, losses, harm, or provider charges arising from their use.`}),r=(0,x.jsx)(`p`,{children:`Anything you type, paste, attach, or upload—including work-related, personal, identifiable, confidential, sensitive, or regulated information—may be sent to the model, search, or connected provider you select. Submit it only when you are authorized to share it and when you accept that provider’s processing and retention practices; Mavéa does not control those third parties.`}),i=(0,x.jsx)(`p`,{children:`Choosing Remember stores an encrypted copy of provider and search keys in this browser, sealed with a device-bound key when browser cryptography is available; otherwise they remain session-only. Encryption at rest is a convenience, not a security guarantee: an unlocked, shared, lost, or compromised device, browser profile, or extension can still expose or misuse keys, and Mavéa is not responsible for key theft, unauthorized use, or resulting charges. Keeping keys secure is your responsibility — use restricted, revocable keys with spending caps on trusted devices you control, revoke a key with its provider immediately if you suspect exposure, and monitor your provider account. Keys pass through this deployment’s request proxy when used; settings exports exclude them.`}),e[0]=t,e[1]=n,e[2]=r,e[3]=i):(t=e[0],n=e[1],r=e[2],i=e[3]);let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,x.jsxs)(`aside`,{className:`provider-responsibility`,"aria-label":`Provider billing, data sharing, and AI output responsibility`,children:[t,n,r,i,(0,x.jsxs)(`nav`,{className:`provider-responsibility-links`,"aria-label":`Terms and privacy documents`,children:[(0,x.jsx)(`a`,{className:`provider-responsibility-link`,href:`#/terms?from=live`,children:`Terms`}),(0,x.jsx)(`a`,{className:`provider-responsibility-link`,href:`#/privacy?from=live`,children:`Privacy`}),(0,x.jsx)(`a`,{className:`provider-responsibility-link`,href:`#/legal?from=live`,children:`Read all important information →`})]})]}),e[4]=a):a=e[4],a}function T(){let e=(0,y.c)(2),[t,n]=(0,b.useState)(E),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{if(typeof window>`u`)return;let e=()=>n(_());return window.addEventListener(v,e),()=>window.removeEventListener(v,e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,b.useEffect)(r,i),t}function E(){return _()}var D=`Hi, I'm ready. Ask me anything.`,O=null,k=null,A=null,j=null,M=0;function N(e){return e===M}function P(e,t){if(e)try{e.pause(),e.src=``}catch{}if(t)try{URL.revokeObjectURL(t)}catch{}}function F(){l(),j?.abort(),j=null,A?.(),A=null,P(O,k),O=null,k=null,M++}async function I(e,t,n){try{let r=await i(`/tts/v1/audio/speech`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({model:`kokoro`,input:D,voice:e.kokoro,response_format:`wav`,speed:1})},1e4,n);if(!r.ok||!N(t))return;let a=await r.blob();if(!a.size||!N(t))return;let s=URL.createObjectURL(a),c=new Audio(s),l=o(c),u=()=>{l(),N(t)&&(O=null,k=null,j=null,A=null),P(c,s)};k=s,O=c,A=l,c.onended=u,c.onerror=u;let d=c.play();d&&typeof d.catch==`function`&&d.catch(u)}catch{}}async function L(e,t){let n=await f(D,e.kokoro);if(!N(t)){l();return}if(n)return;let r=new AbortController;j=r,await I(e,t,r.signal)}function R(e){s()||(d(),F(),L(e,M))}var z=`Voice is off — answers will show as captions only. To hear Mavéa, start the local TTS service (docker compose up -d).`,B=`Mavéa is muted — an audition stays silent until you unmute.`;function V(){let e=(0,y.c)(2),[t,n]=(0,b.useState)(H),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=!0;return c().then(t=>{e&&n(t)}),()=>{e=!1}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,b.useEffect)(r,i),t}function H(){return u()}function U(){let e=(0,y.c)(2),t=V(),n=(0,b.useSyncExternalStore)(a,s),r=t===!1?z:n?B:null;if(!r)return null;let i;return e[0]===r?i=e[1]:(i=(0,x.jsx)(`p`,{className:`voice-off-hint`,role:`status`,children:r}),e[0]=r,e[1]=i),i}var W=350,G={Alt:`altKey`,Control:`ctrlKey`,Shift:`shiftKey`},K=[`altKey`,`ctrlKey`,`metaKey`,`shiftKey`];function q(e,t,n){if(e.key!==t||n!==`any`&&e.code!==t+(n===`left`?`Left`:`Right`))return!1;let r=G[t];return!K.some(t=>t!==r&&e[t])}function J(e){let t=(0,b.useRef)(e);t.current=e,(0,b.useEffect)(()=>{if(!e.enabled)return;let n=e.pttKey||`Alt`,r=e.pttSide||`any`,i=null,a=!1,o=()=>{i!==null&&(window.clearTimeout(i),i=null)},s=()=>{o(),a&&(a=!1,t.current.onStop())},c=e=>{if(!q(e,n,r)){e.key!==n&&s();return}e.repeat||i!==null||a||(i=window.setTimeout(()=>{i=null,a=!0,t.current.onStart()},W))},l=e=>{e.key===n&&s()};return window.addEventListener(`keydown`,c),window.addEventListener(`keyup`,l),window.addEventListener(`blur`,s),()=>{window.removeEventListener(`keydown`,c),window.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,s),s()}},[e.enabled,e.pttKey,e.pttSide])}function Y(e,t=`any`){let n=typeof navigator<`u`&&/mac|iphone|ipad|ipod/i.test(navigator.platform||navigator.userAgent),r=e===`Alt`?n?`⌥`:`Alt`:e===`Control`?n?`⌃`:`Ctrl`:e===`Shift`?n?`⇧`:`Shift`:e;return t===`left`?`Left ${r}`:t===`right`?`Right ${r}`:r}function X(e){return e>=22||e<6}var Z=`mavea-live-quiet-hours-on`,Q=Z;function $(){try{return localStorage.getItem(Z)===`1`}catch{return!1}}function ie(e){try{e?localStorage.setItem(Z,`1`):localStorage.removeItem(Z)}catch{}try{window.dispatchEvent(new CustomEvent(Q))}catch{}}var ae=.45,oe=6e4;function se(){let e=(0,y.c)(2),[t,n]=(0,b.useState)(ce),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=()=>n($()&&X(new Date().getHours()));e();let t=window.setInterval(e,oe);return window.addEventListener(Q,e),()=>{window.clearInterval(t),window.removeEventListener(Q,e)}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,b.useEffect)(r,i),t}function ce(){return $()&&X(new Date().getHours())}export{Y as a,V as c,T as d,w as f,se as i,R as l,te as m,$ as n,J as o,C as p,ie as r,U as s,ae as t,F as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{n as t}from"./http-Lar_UMKb.js";import{t as n}from"./providers-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{n as t}from"./http-Lar_UMKb.js";import{t as n}from"./providers-BovElgRL.js";var r=e({checkLiveReady:()=>a}),i=2500;async function a(e,r={}){let a=n(e.provider).probe(e).catch(()=>({ok:!1,model:!1})),o=r.tts===!1?Promise.resolve(!1):(async()=>{try{return(await t(`/tts/health`,{method:`GET`},i)).ok}catch{return!1}})(),[{ok:s,model:c,statusCode:l},u]=await Promise.all([a,o]);return{llm:s,tts:u,model:c,statusCode:l}}export{r as n,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./types-C42I77wh.js";import{n as t}from"./citation-BsSvaaer.js";var n=[`contributes`,`causes`,`dampens`,`enables`,`correlates`];function r(e){let t=String(e??``).toLowerCase();return n.includes(t)?t:`contributes`}var i={contributes:`a sole or direct cause`,causes:`the only cause, or a measured effect size`,dampens:`a full offset`,enables:`a cause by itself`,correlates:`causation`},a=240;function o(e,t){if(typeof e!=`string`)return null;let n=e.trim();return n?n.length>t?n.slice(0,t):n:null}function s(e,n,r){let i=e&&typeof e==`object`?e:{},a=r?r.url??null:o(i.url,400),s=r?r.host??(r.url?t(r.url):null):o(i.host,80)??(a?t(a):null),c=o(i.date,40),l=o(i.cell,12),u=typeof i.doc==`number`&&Number.isInteger(i.doc)&&i.doc>=0?i.doc:null,d=typeof i.page==`number`&&Number.isInteger(i.page)&&i.page>=1?i.page:null;return{quote:n,...a?{url:a}:{},...s?{host:s}:{},...c?{date:c}:{},...l?{cell:l}:{},...u===null?{}:{doc:u},...d===null?{}:{page:d}}}function c(e){return e.receipt&&typeof e.receipt==`object`?o(e.receipt.quote,a):o(e.quote,a)}function l(e,t,n){let r=[],i=new Set,l=(e,a)=>{!a||r.length>=3||i.has(a)||!t(a)||(i.add(a),r.push(s(e,a,n?.(a))))};l(e.receipt,c(e));for(let t of Array.isArray(e.receipts)?e.receipts:[])!t||typeof t!=`object`||l(t,o(t.quote,a));return r}function u(t){let n=(t.receipts?.length??0)>0||!!t.receipt;return n&&t.counter?`contested`:n&&e(t.tier)&&t.weight!==void 0?`supported`:`provisional`}export{n as a,c as i,u as n,i as o,s as r,r as s,l as t};
|