PageSourceSearch

https://chartr.ai/_nuxt/JfTtRLH1.js

js chartr.ai collected 2026-10-02 01:12:42 UTC 61,387 bytes, 8 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./C3xNLmzR.js","./azLd_n8v.js","./entry.BIgMclkq.css"])))=>i.map(i=>d[i]);
2import{a1 as tt,ba as It,o as rt,aI as Kt,v as G,bh as $e,bD as oe,ai as Pa,V as ne,bb as ie,bc as dt,q as g,A as k,bw as ve,bF as Ea,bd as Ht,bi as ae,bH as st,be as $a,bV as Aa,bI as Ra,bJ as Va,bK as La,p as W,bN as za,h as Ft,bW as Ba,b9 as Da,bX as Ua,b8 as _a,bg as Ha,F as ut,bL as Fa,O as ge,bM as ja,bf as qa,Z as Na,aY as Wa,a as v,m as j,w as B,b as $,x as _,n as T,ax as Je,a0 as xe,d as H,$ as qe,e as E,y as ct,t as re,bO as Qt,r as Ya,aG as Zt,I as Ct,k as se,bY as Xa,bZ as Ga,b_ as Ja,b$ as Ka,c0 as Qa,a2 as jt,Y as gt,a3 as Za,a4 as en,br as ea,c1 as tn,bp as an,a6 as Ue,a5 as nn,bU as qt,a7 as ln,a8 as Ke,aK as Nt,a9 as ta,aJ as on,c2 as rn,aw as sn,j as t,l as vt,aL as St,f as et,b5 as aa,H as un,K as dn,D as cn,aj as vn,U as it,aH as fn,b3 as kt,bq as pn,c3 as mn,z as na,R as hn,az as gn,ag as Wt,P as bn,au as yn,J as wn,al as bt,N as Qe,c4 as Cn,am as kn,ak as In,B as yt,L as wt}from"./azLd_n8v.js";import{_ as la}from"./BqLTcp16.js";import{_ as Sn}from"./Seg6PIGp.js";import{u as On,_ as oa}from"./Cae5N5ll.js";import{p as xn}from"./PIT52Pcv.js";import{_ as Mn}from"./CBQustJI.js";import{_ as Tn}from"./DGME9eiZ.js";import{C as Pn,D as En}from"./BDZR8ymN.js";import{aS as $n,aT as An,C as Rn,aU as Vn}from"./JipKld3F.js";import{_ as Ln}from"./CeL9DNAH.js";import{g as zn}from"./CCQGQdCY.js";import{_ as Bn}from"./CfHLCTAq.js";import{a as Dn,_ as Un}from"./DbtpZUXN.js";import{_ as Yt}from"./B5UvVw_E.js";import{u as _n}from"./D-Kom2aI.js";import{u as Hn}from"./D6REltUt.js";import{_ as Fn,u as jn,m as qn}from"./D1QJ6g6E.js";import{_ as Nn}from"./CZUlEyMu.js";import{_ as ia}from"./BeOQvge5.js";import{g as Xt}from"./C7JDPtPu.js";import{_ as Wn}from"./Ctw13_u5.js";import{u as ra}from"./11hKeahR.js";import{g as Yn}from"./P3C-Jxc-.js";import"./B1VB1uqn.js";import"./Bw0hq1tq.js";import"./DWMYxdWX.js";import"./DC30oazE.js";import"./CnsLmpT6.js";import"./BHhNMCyR.js";import"./DshRXTjs.js";import"./lV52sOCG.js";import"./D13RZPyJ.js";import"./CTWdT5IO.js";import"./BF2yxmKh.js";import"./DMNgb7Ps.js";import"./BTQsgl-f.js";import"./wK23-EYW.js";import"./B8Bxw43R.js";import"./Cg2MVkdI.js";function Xn(e,x){return e===x}var Gn=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Gn||{}),Jn=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Jn||{}),Kn=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Kn||{});function Qn(e){requestAnimationFrame(()=>requestAnimationFrame(e))}let sa=Symbol("ListboxContext");function ft(e){let x=ge(sa,null);if(x===null){let d=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(d,ft),d}return x}let Zn=tt({name:"Listbox",emits:{"update:modelValue":e=>!0},props:{as:{type:[Object,String],default:"template"},disabled:{type:[Boolean],default:!1},by:{type:[String,Function],default:()=>Xn},horizontal:{type:[Boolean],default:!1},modelValue:{type:[Object,String,Number,Boolean],default:void 0},defaultValue:{type:[Object,String,Number,Boolean],default:void 0},form:{type:String,optional:!0},name:{type:String,optional:!0},multiple:{type:[Boolean],default:!1}},inheritAttrs:!1,setup(e,{slots:x,attrs:d,emit:s}){let I=g(1),o=g(null),a=g(null),C=g(null),i=g([]),f=g(""),h=g(null),p=g(1);function b(r=u=>u){let u=h.value!==null?i.value[h.value]:null,m=qa(r(i.value.slice()),D=>ie(D.dataRef.domRef)),y=u?m.indexOf(u):null;return y===-1&&(y=null),{options:m,activeOptionIndex:y}}let A=k(()=>e.multiple?1:0),[S,R]=Aa(k(()=>e.modelValue),r=>s("update:modelValue",r),k(()=>e.defaultValue)),q=k(()=>S.value===void 0?$e(A.value,{1:[],0:void 0}):S.value),O={listboxState:I,value:q,mode:A,compare(r,u){if(typeof e.by=="string"){let m=e.by;return r?.[m]===u?.[m]}return e.by(r,u)},orientation:k(()=>e.horizontal?"horizontal":"vertical"),labelRef:o,buttonRef:a,optionsRef:C,disabled:k(()=>e.disabled),options:i,searchQuery:f,activeOptionIndex:h,activationTrigger:p,closeListbox(){e.disabled||I.value!==1&&(I.value=1,h.value=null)},openListbox(){e.disabled||I.value!==0&&(I.value=0)},goToOption(r,u,m){if(e.disabled||I.value===1)return;let y=b(),D=Fa(r===oe.Specific?{focus:oe.Specific,id:u}:{focus:r},{resolveItems:()=>y.options,resolveActiveIndex:()=>y.activeOptionIndex,resolveId:Y=>Y.id,resolveDisabled:Y=>Y.dataRef.disabled});f.value="",h.value=D,p.value=m??1,i.value=y.options},search(r){if(e.disabled||I.value===1)return;let u=f.value!==""?0:1;f.value+=r.toLowerCase();let m=(h.value!==null?i.value.slice(h.value+u).concat(i.value.slice(0,h.value+u)):i.value).find(D=>D.dataRef.textValue.startsWith(f.value)&&!D.dataRef.disabled),y=m?i.value.indexOf(m):-1;y===-1||y===h.value||(h.value=y,p.value=1)},clearSearch(){e.disabled||I.value!==1&&f.value!==""&&(f.value="")},registerOption(r,u){let m=b(y=>[...y,{id:r,dataRef:u}]);i.value=m.options,h.value=m.activeOptionIndex},unregisterOption(r){let u=b(m=>{let y=m.findIndex(D=>D.id===r);return y!==-1&&m.splice(y,1),m});i.value=u.options,h.value=u.activeOptionIndex,p.value=1},theirOnChange(r){e.disabled||R(r)},select(r){e.disabled||R($e(A.value,{0:()=>r,1:()=>{let u=ve(O.value.value).slice(),m=ve(r),y=u.findIndex(D=>O.compare(m,ve(D)));return y===-1?u.push(m):u.splice(y,1),u}}))}};Ra([a,C],(r,u)=>{var m;O.closeListbox(),Va(u,La.Loose)||(r.preventDefault(),(m=ie(a))==null||m.focus())},k(()=>I.value===0)),W(sa,O),za(k(()=>$e(I.value,{0:st.Open,1:st.Closed})));let L=k(()=>{var r;return(r=ie(a))==null?void 0:r.closest("form")});return rt(()=>{G([L],()=>{if(!L.value||e.defaultValue===void 0)return;function r(){O.theirOnChange(e.defaultValue)}return L.value.addEventListener("reset",r),()=>{var u;(u=L.value)==null||u.removeEventListener("reset",r)}},{immediate:!0})}),()=>{let{name:r,modelValue:u,disabled:m,form:y,...D}=e,Y={open:I.value===0,disabled:m,value:q.value};return Ft(ut,[...r!=null&&q.value!=null?Ba({[r]:q.value}).map(([be,fe])=>Ft(Da,Ua({features:_a.Hidden,key:be,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:y,disabled:m,name:be,value:fe}))):[],dt({ourProps:{},theirProps:{...d,...Ha(D,["defaultValue","onUpdate:modelValue","horizontal","multiple","by"])},slot:Y,slots:x,attrs:d,name:"Listbox"})])}}}),el=tt({name:"ListboxButton",props:{as:{type:[Object,String],default:"button"},id:{type:String,default:null}},setup(e,{attrs:x,slots:d,expose:s}){var I;let o=(I=e.id)!=null?I:`headlessui-listbox-button-${It()}`,a=ft("ListboxButton");s({el:a.buttonRef,$el:a.buttonRef});
2function C(p){switch(p.key){case ae.Space:case ae.Enter:case ae.ArrowDown:p.preventDefault(),a.openListbox(),ne(()=>{var b;(b=ie(a.optionsRef))==null||b.focus({preventScroll:!0}),a.value.value||a.goToOption(oe.First)});break;case ae.ArrowUp:p.preventDefault(),a.openListbox(),ne(()=>{var b;(b=ie(a.optionsRef))==null||b.focus({preventScroll:!0}),a.value.value||a.goToOption(oe.Last)});break}}function i(p){p.key===ae.Space&&p.preventDefault()}function f(p){a.disabled.value||(a.listboxState.value===0?(a.closeListbox(),ne(()=>{var b;return(b=ie(a.buttonRef))==null?void 0:b.focus({preventScroll:!0})})):(p.preventDefault(),a.openListbox(),Qn(()=>{var b;return(b=ie(a.optionsRef))==null?void 0:b.focus({preventScroll:!0})})))}let h=$a(k(()=>({as:e.as,type:x.type})),a.buttonRef);return()=>{var p,b;let A={open:a.listboxState.value===0,disabled:a.disabled.value,value:a.value.value},{...S}=e,R={ref:a.buttonRef,id:o,type:h.value,"aria-haspopup":"listbox","aria-controls":(p=ie(a.optionsRef))==null?void 0:p.id,"aria-expanded":a.listboxState.value===0,"aria-labelledby":a.labelRef.value?[(b=ie(a.labelRef))==null?void 0:b.id,o].join(" "):void 0,disabled:a.disabled.value===!0?!0:void 0,onKeydown:C,onKeyup:i,onClick:f};return dt({ourProps:R,theirProps:S,slot:A,attrs:x,slots:d,name:"ListboxButton"})}}}),tl=tt({name:"ListboxOptions",props:{as:{type:[Object,String],default:"ul"},static:{type:Boolean,default:!1},unmount:{type:Boolean,default:!0},id:{type:String,default:null}},setup(e,{attrs:x,slots:d,expose:s}){var I;let o=(I=e.id)!=null?I:`headlessui-listbox-options-${It()}`,a=ft("ListboxOptions"),C=g(null);s({el:a.optionsRef,$el:a.optionsRef});function i(p){switch(C.value&&clearTimeout(C.value),p.key){case ae.Space
2:if(a.searchQuery.value!=="")return p.preventDefault(),p.stopPropagation(),a.search(p.key);case ae.Enter:if(p.preventDefault(),p.stopPropagation(),a.activeOptionIndex.value!==null){let b=a.options.value[a.activeOptionIndex.value];a.select(b.dataRef.value)}a.mode.value===0&&(a.closeListbox(),ne(()=>{var b;return(b=ie(a.buttonRef))==null?void 0:b.focus({preventScroll:!0})}));break;case $e(a.orientation.value,{vertical:ae.ArrowDown,horizontal:ae.ArrowRight}):return p.preventDefault(),p.stopPropagation(),a.goToOption(oe.Next);case $e(a.orientation.value,{vertical:ae.ArrowUp,horizontal:ae.ArrowLeft}):return p.preventDefault(),p.stopPropagation(),a.goToOption(oe.Previous);case ae.Home:case ae.PageUp:return p.preventDefault(),p.stopPropagation(),a.goToOption(oe.First);case ae.End:case ae.PageDown:return p.preventDefault(),p.stopPropagation(),a.goToOption(oe.Last);case ae.Escape:p.preventDefault(),p.stopPropagation(),a.closeListbox(),ne(()=>{var b;return(b=ie(a.buttonRef))==null?void 0:b.focus({preventScroll:!0})});break;case ae.Tab:p.preventDefault(),p.stopPropagation();break;default:p.key.length===1&&(a.search(p.key),C.value=setTimeout(()=>a.clearSearch(),350));break}}let f=Ea(),h=k(()=>f!==null?(f.value&st.Open)===st.Open:a.listboxState.value===0);return()=>{var p,b;let A={open:a.listboxState.value===0},{...S}=e,R={"aria-activedescendant":a.activeOptionIndex.value===null||(p=a.options.value[a.activeOptionIndex.value])==null?void 0:p.id,"aria-multiselectable":a.mode.value===1?!0:void 0,"aria-labelledby":(b=ie(a.buttonRef))==null?void 0:b.id,"aria-orientation":a.orientation.value,id:o,onKeydown:i,role:"listbox",tabIndex:0,ref:a.optionsRef};return dt({ourProps:R,theirProps:S,slot:A,attrs:x,slots:d,features:Ht.RenderStrategy|Ht.Static,visible:h.value,name:"ListboxOptions"})}}}),al=tt({name:"ListboxOption",props:{as:{type:[Object,String],default:"li"},value:{type:[Object,String,Number,Boolean]},disabled:{type:Boolean,default:!1},id:{type:String,default:null}},setup(e,{slots:x,attrs:d,expose:s}){var I;let o=(I=e.id)!=null?I:`headlessui-listbox-option-${It()}`,a=ft("ListboxOption"),C=g(null);s({el:C,$el:C});let i=k(()=>a.activeOptionIndex.value!==null?a.options.value[a.activeOptionIndex.value].id===o:!1),f=k(()=>$e(a.mode.value,{0:()=>a.compare(ve(a.value.value),ve(e.value)),1:()=>ve(a.value.value).some(r=>a.compare(ve(r),ve(e.value)))})),h=k(()=>$e(a.mode.value,{1:()=>{var r;let u=ve(a.value.value);return((r=a.options.value.find(m=>u.some(y=>a.compare(ve(y),ve(m.dataRef.value)))))==null?void 0:r.id)===o},0:()=>f.value})),p=xn(C),b=k(()=>({disabled:e.disabled,value:e.value,get textValue(){return p()},domRef:C}));rt(()=>a.registerOption(o,b)),Kt(()=>a.unregisterOption(o)),rt(()=>{G([a.listboxState,f],()=>{a.listboxState.value===0&&f.value&&$e(a.mode.value,{1:()=>{h.value&&a.goToOption(oe.Specific,o)},0:()=>{a.goToOption(oe.Specific,o)}})},{immediate:!0})}),Pa(()=>{a.listboxState.value===0&&i.value&&a.activationTrigger.value!==0&&ne(()=>{var r,u;return(u=(r=ie(C))==null?void 0:r.scrollIntoView)==null?void 0:u.call(r,{block:"nearest"})})});function A(r){if(e.disabled)return r.preventDefault();a.select(e.value),a.mode.value===0&&(a.closeListbox(),ne(()=>{var u;return(u=ie(a.buttonRef))==null?void 0:u.focus({preventScroll:!0})}
2))}function S(){if(e.disabled)return a.goToOption(oe.Nothing);a.goToOption(oe.Specific,o)}let R=ja();function q(r){R.update(r)}function O(r){R.wasMoved(r)&&(e.disabled||i.value||a.goToOption(oe.Specific,o,0))}function L(r){R.wasMoved(r)&&(e.disabled||i.value&&a.goToOption(oe.Nothing))}return()=>{let{disabled:r}=e,u={active:i.value,selected:f.value,disabled:r},{value:m,disabled:y,...D}=e,Y={id:o,ref:C,role:"option",tabIndex:r===!0?void 0:-1,"aria-disabled":r===!0?!0:void 0,"aria-selected":f.value,disabled:void 0,onClick:A,onFocus:S,onPointerenter:q,onMouseenter:q,onPointermove:O,onMousemove:O,onPointerleave:L,onMouseleave:L};return dt({ourProps:Y,theirProps:D,slot:u,attrs:d,slots:x,name:"ListboxOption"})}}});const ke=ta(Ue.ui.strategy,Ue.ui.select,on),Ze=ta(Ue.ui.strategy,Ue.ui.selectMenu,rn),nl=tt({components:{HCombobox:Qa,HComboboxButton:Ka,HComboboxOptions:Ja,HComboboxOption:Ga,HComboboxInput:Xa,HListbox:Zn,HListboxButton:el,HListboxOptions:tl,HListboxOption:al,UIcon:ct,UAvatar:Zt},inheritAttrs:!1,props:{modelValue:{type:[String,Number,Object,Array,Boolean],default:""},query:{type:String,default:null},by:{type:String,default:void 0},options:{type:Array,default:()=>[]},id:{type:String,default:null},name:{type:String,default:null},required:{type:Boolean,default:!1},icon:{type:String,default:null},loadingIcon:{type:String,default:()=>ke.default.loadingIcon},leadingIcon:{type:String,default:null},trailingIcon:{type:String,default:()=>ke.default.trailingIcon},trailing:{type:Boolean,default:!1},leading:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},selectedIcon:{type:String,default:()=>Ze.default.selectedIcon},disabled:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},searchable:{type:[Boolean,Function],default:!1},searchablePlaceholder:{type:String,default:()=>Ze.default.searchablePlaceholder.label},searchableLazy:{type:Boolean,default:!1},clearSearchOnClose:{type:Boolean,default:()=>Ze.default.clearSearchOnClose},debounce:{type:Number,default:200},creatable:{type:Boolean,default:!1},showCreateOptionWhen:{type:[String,Function],default:()=>Ze.default.showCreateOptionWhen},placeholder:{type:String,default:null},padded:{type:Boolean,default:!0},size:{type:String,default:null,validator(e){return Object.keys(ke.size).includes(e)}},color:{type:String,default:()=>ke.default.color,validator(e){return[...Ue.ui.colors,...Object.keys(ke.color)].includes(e)}},variant:{type:String,default:()=>ke.default.variant,validator(e){return[...Object.keys(ke.variant),...Object.values(ke.color).flatMap(x=>Object.keys(x))].includes(e)}},optionAttribute:{type:String,default:"label"},valueAttribute:{type:String,default:null},searchAttributes:{type:Array,default:null},inputTargetForm:{type:String,default:null},popper:{type:Object,default:()=>({})},selectClass:{type:String,default:null},class:{type:[String,Object,Array],default:()=>""},ui:{type:Object,default:()=>({})},uiMenu:{type:Object,default:()=>({})}},emits:["update:modelValue","update:query","open","close","change"],setup(e,{emit:x,slots:d}){const{ui:s,attrs:I}=jt("select",gt(e,"ui"),ke,gt(e,"class")),{ui:o}=jt("selectMenu",gt(e,"uiMenu"),Ze),a=k(()=>nn({},e.popper,o.value.popper)),[C,i]=On(a.value),f=k(()=>{if(!e.by)return;if(typeof e.by=="function")return e.by;const V=e.by;return V.indexOf(".")>0?(X,N)=>J(X,V)===J(N,V):V}),{size:h,rounded:p}=Za({ui:s,props:e}),{emitFormBlur:b,emitFormChange:A,inputId:S,color:R,size:q,name:O}=en(e,ke),L=k(()=>h.value??q.value),r=g(""),u=k({get(){return e.query??r.value},set(V){r.value=V,x("update:query",V)}}),m=k(()=>{function V(X,N){return f.value&&typeof f.value!="function"&&typeof X=="object"&&typeof N=="object"?qt(X[f.value],N[f.value]):qt(X,N)}function K(X){return e.valueAttribute?J(X,e.valueAttribute):X}if(e.multiple){const X=e.modelValue;return!Array.isArray(X)||!X.length?[]:ee.value.filter(N=>{const _e=K(N);return X.some(ye=>V(ye,_e))})}return ee.value.find(X=>{const N=K(X);return V(N,ve(e.modelValue))})??e.modelValue}),y=k(()=>e.modelValue?Array.isArray(e.modelValue)&&e.modelValue.length?`${e.modelValue.length} selected`:["string","number"].includes(typeof e.modelValue)?e.valueAttribute?J(m.value,e.optionAttribute):e.modelValue:J(e.modelValue,e.optionAttribute):null),D=k(()=>{const V=s.value.color?.[R.value]?.[e.variant]||s.value.variant[e.variant];return ln(Ke(s.value.base,o.value.select,p.value,s.value.size[L.value],s.value.gap[L.value],e.padded?s.value.padding[L.value]:"p-0",V?.replaceAll("{color}",R.value),(Y.value||d.leading)&&s.value.leading.padding[L.value],(be.value||d.trailing)&&s.value.trailing.padding[L.value]),e.placeholder&&(!e.modelValue||Array.isArray(e.modelValue)&&!e.modelValue.length)&&s.value.placeholder,e.selectClass)}),Y=k(()=>e.icon&&e.leading||e.icon&&!e.trailing||e.loading&&!e.trailing||e.leadingIcon),be=k(()=>e.icon&&e.trailing||e.loading&&e.trailing||e.trailingIcon),fe=k(()=>e.loading?e.loadingIcon:e.leadingIcon||e.icon),ue=k(()=>e.loading&&!Y.value?e.loadingIcon:e.trailingIcon||e.icon),Ne=k(()=>Ke(s.value.icon.leading.wrapper,s.value.icon.leading.pointer,s.value.icon.leading.padding[L.value])),Ae=k(()=>Ke(s.value.icon.base,R.value&&Ue.ui.colors.includes(R.value)&&s.value.icon.color.replaceAll("{color}",R.value),s.value.icon.size[L.value],e.loading&&s.value.icon.loading)),Ie=k(()=>Ke(s.value.icon.trailing.wrapper,s.value.icon.trailing.pointer,s.value.icon.trailing.padding[L.value])),pe=k(()=>Ke(s.value.icon.base,R.value&&Ue.ui.colors.includes(R.value)&&s.value.icon.color.replaceAll("{color}",R.value),s.value.icon.size[L.value],e.loading&&!Y.value&&s.value.icon.loading)),Se=e.searchable&&typeof e.searchable=="function"?ea(e.searchable,e.debounce):void 0,ee=tn(async()=>Se?await Se(u.value):e.options||[],[],{lazy:e.searchableLazy});function Re(V){return V.replace(/[.*+?^${}()|[\]\\]/g,K=>`\\${K}`)}function J(V,K){return Nt(V,K)}const te=k(()=>
2{if(!u.value||Se)return ee.value;const V=Re(u.value);return ee.value.filter(K=>(e.searchAttributes?.length?e.searchAttributes:[e.optionAttribute]).some(X=>{if(["string","number"].includes(typeof K))return String(K).search(new RegExp(V,"i"))!==-1;const N=Nt(K,X);return N!=null&&String(N).search(new RegExp(V,"i"))!==-1}))}),de=k(()=>u.value===""||e.showCreateOptionWhen==="empty"&&te.value.length||e.showCreateOptionWhen==="always"&&te.value.find(K=>["string","number"].includes(typeof K)?K===u.value:J(K,e.optionAttribute)===u.value)||typeof e.showCreateOptionWhen=="function"&&!e.showCreateOptionWhen(u.value,te.value)?null:["string","number"].includes(typeof e.modelValue)?u.value:{[e.optionAttribute]:u.value});function We(){e.clearSearchOnClose&&(u.value="")}G(i,V=>{V?x("open"):(We(),x("close"),b())});function Ve(V){ve(e.modelValue)!==V&&(x("update:modelValue",V),x("change",V),A())}function me(V){u.value=V.target.value}return an(()=>sn()),{ui:s,uiMenu:o,attrs:I,name:O,inputId:S,popper:a,trigger:C,container:i,selected:m,label:y,accessor:J,isLeading:Y,isTrailing:be,selectClass:D,leadingIconName:fe,leadingIconClass:Ae,leadingWrapperIconClass:Ne,trailingIconName:ue,trailingIconClass:pe,trailingWrapperIconClass:Ie,filteredOptions:te,createOption:de,query:u,onUpdate:Ve,onQueryChange:me,by:f}}}),ll=["value","required","form"],ol=["id","disabled"],il={class:"truncate"};function rl(e,x,d,s,I,o){const a=ct,C=Wa("HComboboxInput"),i=Zt;return v(),j(Je(e.searchable?"HCombobox":"HListbox"),{by:e.by,name:e.name,"model-value":e.multiple?Array.isArray(e.modelValue)?e.modelValue:[]:e.modelValue,multiple:e.multiple,disabled:e.disabled,as:"div",class:_(e.ui.wrapper),"onUpdate:modelValue":e.onUpdate},{default:B(({open:f})=>[e.required?(v(),$("input",{key:0,value:e.modelValue,required:e.required,class:_(e.uiMenu.required),form:e.inputTargetForm,tabindex:"-1","aria-hidden":"true"},null,10,ll)):T("",!0),(v(),j(Je(e.searchable?"HComboboxButton":"HListboxButton"),{ref:"trigger",as:"div",role:"button",class:_(e.uiMenu.trigger)},{default:B(()=>[xe(e.$slots,"default",{open:f,disabled:e.disabled,loading:e.loading},()=>[H("button",qe({id:e.inputId,class:e.selectClass,disabled:e.disabled,type:"button"},e.attrs),[e.isLeading&&e.leadingIconName||e.$slots.leading?(v(),$("span",{key:0,class:_(e.leadingWrapperIconClass)},[xe(e.$slots,"leading",{selected:e.selected,disabled:e.disabled,loading:e.loading},()=>[E(a,{name:e.leadingIconName,class:_(e.leadingIconClass)},null,8,["name","class"])])],2)):T("",!0),xe(e.$slots,"label",{selected:e.selected},()=>[e.label?(v(),$("span",{key:0,class:_(e.uiMenu.label)},re(e.label),3)):(v(),$("span",{key:1,class:_(e.uiMenu.label)},re(e.placeholder||" "),3))]),e.isTrailing&&e.trailingIconName||e.$slots.trailing?(v(),$("span",{key:1,class:_(e.trailingWrapperIconClass)},[xe(e.$slots,"trailing",{selected:e.selected,disabled:e.disabled,loading:e.loading},()=>[E(a,{name:e.trailingIconName,class:_(e.trailingIconClass),"aria-hidden":"true"},null,8,["name","class"])])],2)):T("",!0)],16,ol)])]),_:2},1032,["class"])),f?(v(),$("div",{key:1,ref:"container",class:_([e.uiMenu.container,e.uiMenu.width])},[E(Qt,qe({appear:""},e.uiMenu.transition),{default:B(()=>[H("div",null,[e.popper.arrow?(v(),$("div",{key:0,"data-popper-arrow":"",class:_(Object.values(e.uiMenu.arrow))},null,2)):T("",!0),(v(),j(Je(e.searchable?"HComboboxOptions":"HListboxOptions"),{static:"",class:_([e.uiMenu.base,e.uiMenu.ring,e.uiMenu.rounded,e.uiMenu.shadow,e.uiMenu.background,e.uiMenu.padding,e.uiMenu.height])},{default:B(()=>[e.searchable?(v(),j(C,{key:0,"display-value":()=>e.query,name:"q",placeholder:e.searchablePlaceholder,autofocus:"",autocomplete:"off",class:_(e.uiMenu.input),onChange:e.onQueryChange},null,8,["display-value","placeholder","class","onChange"])):T("",!0),(v(!0),$(ut,null,Ya(e.filteredOptions,(h,p)=>(v(),j(Je(e.searchable?"HComboboxOption":"HListboxOption"),{key:p,as:"template",value:e.valueAttribute?e.accessor(h,e.valueAttribute):h,disabled:h.disabled},{default:B(({active:b,selected:A,disabled:S})=>[H("li",{class:_([e.uiMenu.option.base,e.uiMenu.option.rounded,e.uiMenu.option.padding,e.uiMenu.option.size,e.uiMenu.option.color,b?e.uiMenu.option.active:e.uiMenu.option.inactive,A&&e.uiMenu.option.selected,S&&e.uiMenu.option.disabled])},[H("div",{class:_(e.uiMenu.option.container)},[xe(e.$slots,"option",{option:h,active:b,selected:A},()=>[h.icon?(v(),j(a,{key:0,name:h.icon,class:_([e.uiMenu.option.icon.base,b?e.uiMenu.option.icon.active:e.uiMenu.option.icon.inactive,h.iconClass]),"aria-hidden":"true"},null,8,["name","class"])):h.avatar?(v(),j(i,qe({key:1,ref_for:!0},{size:e.uiMenu.option.avatar.size,...h.avatar},{class:e.uiMenu.option.avatar.base,"aria-hidden":"true"}),null,16,["class"])):h.chip?(v(),$("span",{key:2,class:_(e.uiMenu.option.chip.base),style:Ct({background:`#${h.chip}`})},null,6)):T("",!0),H("span",il,re(["string","number"].includes(typeof h)?h:e.accessor(h,e.optionAttribute)),1)])],2),A?(v(),$("span",{key:0,class:_([e.uiMenu.option.selectedIcon.wrapper,e.uiMenu.option.selectedIcon.padding])},[E(a,{name:e.selectedIcon,class:_(e.uiMenu.option.selectedIcon.base),"aria-hidden":"true"},null,8,["name","class"])],2)):T("",!0)],2)]),_:2},1032,["value","disabled"]))),128)),e.creatable&&e.createOption?(v(),j(Je(e.searchable?"HComboboxOption":"HListboxOption"),{key:1,value:e.createOption,as:"template"},{default:B(({active:h,selected:p})=>[H("li",{class:_([e.uiMenu.option.base,e.uiMenu.option.rounded,e.uiMenu.option.padding,e.uiMenu.option.size,e.uiMenu.option.color,h?e.uiMenu.option.active:e.uiMenu.option.inactive])},[H("div",{class:_(e.uiMenu.option.container)},[xe(e.$slots,"option-create",{option:e.createOption,active:h,selected:p},()=>[H("span",{class:_(e.uiMenu.option.create)}
2,'Create "'+re(typeof e.createOption=="string"?e.createOption:e.accessor(e.createOption,e.optionAttribute))+'"',3)])],2)],2)]),_:3},8,["value"])):e.searchable&&e.query&&!e.filteredOptions?.length?(v(),$("p",{key:2,class:_(e.uiMenu.option.empty)},[xe(e.$slots,"option-empty",{query:e.query},()=>[se(re(e.uiMenu.default.optionEmpty.label.replace("{query}",e.query)),1)])],2)):e.filteredOptions?.length?T("",!0):(v(),$("p",{key:3,class:_(e.uiMenu.empty)},[xe(e.$slots,"empty",{query:e.query},()=>[se(re(e.uiMenu.default.empty.label),1)])],2))]),_:3},8,["class"]))])]),_:3},16)],2)):T("",!0)]),_:3},8,["by","name","model-value","multiple","disabled","class","onUpdate:modelValue"])}const sl=Object.assign(Na(nl,[["render",rl]]),{__name:"USelectMenu"}),ul={class:"flex items-center justify-between gap-3"},dl={class:"min-w-0 flex-1 flex flex-col items-start space-y-1"},cl={class:"w-full text-left text-purple-900 dark:text-purple-100 text-sm"},vl={key:0,class:"w-full text-left text-xs text-purple-600 dark:text-purple-300 mt-0.5"},fl={key:1,class:"text-xs text-purple-500 dark:text-purple-400 font-medium flex items-center gap-2"},pl={key:0,class:"flex items-center gap-1"},ml={key:1},hl={key:2,class:"text-2xs uppercase leading-loose text-purple-500 dark:text-purple-400"},gl={class:"flex-shrink-0 flex items-center justify-center text-purple-500 dark:text-purple-400 group-hover:text-purple-600 dark:group-hover:text-purple-300 transition-colors"},bl={class:""},yl={__name:"ChartsChartThumb",props:{data:{type:Object,default:()=>({})},footnote:{type:String,default:""},isDeleted:{type:Boolean,default:!1}},setup(e){const x=e,d=k(()=>zn(x.data)),s=k(()=>{const a=x.data?.chartId?.match(/_v(\d+)$/);return a?Number.parseInt(a[1],10):null}),I=ge("activeChartId",g(null)),o=k(()=>x.isActive??I.value===x.data?.chartId);return(a,C)=>{const i=Ln,f=ct,h=vt;return v(),$("div",{class:_(["group cursor-pointer w-full max-w-lg px-4 py-3 rounded-lg transition-all duration-400 shadow",{"bg-purple-200 dark:bg-purple-900 ring-2 ring-purple-500 dark:ring-purple-400":t(o),"bg-purple-100 dark:bg-purple-950/50 ring-1 ring-purple-200 dark:ring-purple-700 hover:ring-purple-300 dark:hover:ring-purple-600":!t(o),"opacity-40":e.isDeleted}])},[H("div",ul,[H("div",dl,[H("div",cl,[E(i,{value:e.data.title,"cache-key":`chart-thumb-title-${e.data.chartId}`},null,8,["value","cache-key"])]),e.data.subtitle?(v(),$("div",vl,[E(i,{value:e.data.subtitle,"cache-key":`chart-thumb-subtitle-${e.data.chartId}`},null,8,["value","cache-key"])])):T("",!0),t(d)?.label||t(s)!==null?(v(),$("div",fl,[t(d)?.label?(v(),$("div",pl,[E(f,{name:t(d)?.icon,class:"h-3 w-3"},null,8,["name"]),se(" "+re(t(d).label),1)])):T("",!0),C[0]||(C[0]=se(" | ",-1)),t(s)!==null?(v(),$("span",ml," v"+re(t(s)),1)):T("",!0)])):T("",!0),e.footnote||a.$slots.footnote?(v(),$("div",hl,[xe(a.$slots,"footnote",{},()=>[se(re(e.footnote),1)])])):T("",!0)]),H("div",gl,[E(f,{name:"i-carbon-arrow-right",class:"h-5 w-5"})])]),H("div",bl,[e.isDeleted?(v(),j(h,{key:0,icon:"i-carbon-undo",size:"sm",variant:"link",class:"underline",trailing:""},{default:B(()=>[...C[1]||(C[1]=[se(" Click to restore ",-1)])]),_:1})):T("",!0)])],2)}}},wl={__name:"ChatInChatChatInput",props:{showChatReference:{type:Boolean,default:!0}},setup(e){const x=ge("submit"),d=ge("stop"),s=ge("chatReference"),I=ge("resetChatReference"),o=ge("input",g("")),a=k(()=>s.value?"Ask about this...":"Ask...");function C(i){x&&(typeof i=="string"?x(i):x(i.text,i.files),o.value="")}return(i,f)=>(v(),j(Fn,qe({modelValue:t(o),"onUpdate:modelValue":f[0]||(f[0]=h=>et(o)?o.value=h:null),placeholder:t(a)},i.$attrs,{onSubmit:C,onStop:t(d)}),St({_:2},[e.showChatReference&&t(s)?{name:"reference",fn:B(()=>[e.showChatReference?(v(),j(Dn,qe({key:0},t(s),{"with-remove-button":"",onRemove:t(I)}),null,16,["onRemove"])):T("",!0)]),key:"0"}:void 0]),1040,["modelValue","placeholder","onStop"]))}},Cl={class:"space-y-4"},kl={key:0},Il={class:"flex items-start justify-between gap-3"},Sl={class:"text-lg font-semibold flex-1 break-words font-grand"},Ol={key:1},xl={class:"flex justify-end gap-2 mt-3"},Ml={key:2,class:"flex items-center gap-2"},Tl={key:3,class:"flex items-center gap-2"},Pl={__name:"ChatInfoModal",props:{modelValue:{type:Boolean,required:!0},currentTitle:{type:String,default:""},username:{type:String,default:null},avatarUrl:{type:String,default:null},chartr:{type:Object,default:null},placeholder:{type:String,default:"Enter title"},showRegenerateButton:{type:Boolean,default:!1}},emits:["update:modelValue","save"],setup(e,{emit:x}){const d=e,s=x,I=ge("generateTitle",null),o=g(""),a=g(!1),C=g(!1),i=k({get:()=>d.modelValue,set:A=>s("update:modelValue",A)});G(()=>d.modelValue,A=>{A&&(o.value=d.currentTitle||"",C.value=!1)});function f(){const A=o.value.trim();A&&A!==d.currentTitle?(s("save",A),C.value=!1):i.value=!1}function h(){i.value=!1}function p(){C.value=!1,o.value=d.currentTitle||""}async function b(){if(I){a.value=!0;try{const A=await I();A&&(o.value=A)}finally{a.value=!1}}}return aa({escape:{usingInput:!0,handler:()=>{i.value&&(C.value?p():h())}}}),(A,S)=>{const R=vt,q=oa,O=Nn,L=dn,r=la,u=un,m=vn;return v(),j(m,{modelValue:t(i),"onUpdate:modelValue":S[2]||(S[2]=y=>et(i)?i.value=y:null)},{default:B(()=>[E(u,null,{default:B(()=>[H("div",Cl,[t(C)?(v(),$("div",Ol,[E(L,null,{default:B(()=>[E(O,{modelValue:t(o),"onUpdate:modelValue":S[1]||(S[1]=y=>et(o)?o.value=y:null),placeholder:e.placeholder,autofocus:"",ui:{icon:{trailing:{pointer:""}}},onKeyup:cn(f,["enter"])},St({_:2},[e.showRegenerateButton&&t(I)?{name:"trailing",fn:B(()=>[E(q,{text:"Generate with AI"},{default:B(()=>[E(R,{icon:"i-heroicons-sparkles-solid",size:"sm",color:"gray",variant:"ghost",loading:t(a),disabled:t(a),onClick:b},null,8,["loading","disabled"])]),_:1})]),key:"0"}:void 0]),1032,["modelValue","placeholder"])]),_:1}),H("div",xl,[E(R,{variant:"ghost",color:"gray",size:"sm",onClick:p},{default:B(()=>[...S[3]||(S[3]=[se(" Cancel ",-1)])]),_:1}),E(R,{color:"primary",size:"sm",disabled:!t(o).trim()||t(o).trim()===e.currentTitle,onClick:f},{default:B(()=>[...S[4]||(S[4]=[se(" Save ",-1)])]),_:1},8,["disabled"])])])):(v(),$("div",kl,[H("div",Il,[H("h3",Sl,re(e.currentTitle||"Untitled Board"),1),E(R,{icon:"i-carbon-edit",size:"sm",variant:"ghost",color:"gray",onClick:S[0]||(S[0]=y=>C.value=!0)})])])),e.username?(v(),$("div",Ml,[S[5]||(S[5]=H("span",{class:"text-xs text-gray-500 dark:text-gray-400"},"Created by",-1)),E(r,{username:e.username,"avatar-url":e.avatarUrl,size:"sm"}
2,null,8,["username","avatar-url"])])):T("",!0),e.chartr?(v(),$("div",Tl,[S[6]||(S[6]=H("span",{class:"text-xs text-gray-500 dark:text-gray-400"},"Using Chartr",-1)),E(ia,{chartr:e.chartr,size:"sm"},null,8,["chartr"])])):T("",!0)])]),_:1})]),_:1},8,["modelValue"])}}},El={ref:"controlBar",class:"flex items-center justify-center gap-1 bg-white dark:bg-gray-800 border-t border-l border-r border-gray-300 dark:border-gray-700 rounded-xl mb-2 px-2 py-1.5 w-fit mx-auto"},Pe=280,Ee=800,lt=180,ot=600,Gt=100,Jt=40,$l={__name:"FloatingYouTubePlayer",props:{isOpen:{type:Boolean,default:!1},videoId:{type:String,default:""},startTime:{type:Number,default:0},allowCustomPosition:{type:Boolean,default:!0}},emits:["close","update:isOpen"],setup(e,{emit:x}){const d=e,s=x,I=ra(),o=I.greaterOrEqual("md"),a=I.greaterOrEqual("lg"),C=g(null),i=g(null),f=g(!1),h=g(!1),p=it("controlBar"),{height:b}=fn(p),A=k(()=>o.value?a.value?600:480:400),S=g(A.value),R=g(A.value*(9/16)+40),q=g(!1),O=g(""),L=g(0),r=g(0),u=g(0),m=g(0),y=g(0),D=g(0);function Y(){return window.YT&&window.YT.Player?(h.value=!0,Promise.resolve()):new Promise(w=>{if(window.onYouTubeIframeAPIReady=()=>{h.value=!0,w()},!document.querySelector('script[src*="youtube.com/iframe_api"]')){const M=document.createElement("script");M.src="https://www.youtube.com/iframe_api",M.async=!0,document.head.appendChild(M)}})}async function be(){if(!(!d.videoId||!C.value))try{await Y(),i.value&&(i.value.destroy(),i.value=null,f.value=!1),i.value=new window.YT.Player(C.value,{height:"100%",width:"100%",videoId:d.videoId,playerVars:{autoplay:1,start:d.startTime,rel:0,modestbranding:1,iv_load_policy:3},events:{onReady:fe,onStateChange:ue,onError:Ne}})}
2catch(w){console.error("Failed to initialize YouTube player:",w)}}function fe(w){f.value=!0,d.startTime>0?(w.target.seekTo(d.startTime,!0),setTimeout(()=>{w.target.playVideo()},100)):w.target.playVideo()}function ue(w){}function Ne(w){console.error("YouTube player error:",w.data)}G([()=>d.isOpen,()=>d.videoId],async()=>{d.isOpen&&d.videoId&&(await ne(),be())},{immediate:!0}),G(()=>d.startTime,w=>{f.value&&i.value&&w>0&&(i.value.seekTo(w,!0),setTimeout(()=>{i.value.playVideo()},100))}),G([S,b],()=>{const w=S.value*.5625;R.value=w+b.value});function Ae(){i.value&&f.value&&i.value.pauseVideo(),s("update:isOpen",!1),s("close")}function Ie(){if(!d.videoId)return;let w=`https://www.youtube.com/watch?v=${d.videoId}`;if(i.value&&f.value)try{const M=Math.floor(i.value.getCurrentTime());M>0&&(w+=`&t=${M}s`)}catch(M){console.error("Failed to get current time:",M)}window.open(w,"_blank")}function pe(w,M="nw"){!o.value||!d.allowCustomPosition||(q.value=!0,O.value=M,L.value=w.clientX,r.value=w.clientY,u.value=S.value,m.value=R.value,y.value=J.value,D.value=te.value,document.addEventListener("mousemove",Se),document.addEventListener("mouseup",ee),document.body.style.userSelect="none",w.preventDefault())}function Se(w){if(!q.value)return;const M=w.clientX-L.value,z=w.clientY-r.value;
2let c=u.value,Q=y.value,Z=D.value;if(O.value==="nw")c=Math.max(Pe,Math.min(Ee,u.value-M)),Q=y.value+(u.value-c),Z=D.value+z;else if(O.value==="n")c=Math.max(lt,Math.min(ot,m.value-b.value-z))*(16/9),c=Math.max(Pe,Math.min(Ee,c)),Z=D.value+z;else if(O.value==="ne")c=Math.max(Pe,Math.min(Ee,u.value+M)),Z=D.value+z;else if(O.value==="e")c=Math.max(Pe,Math.min(Ee,u.value+M));else if(O.value==="se"){const Oe=Math.abs(M)>Math.abs(z)?M:z;c=Math.max(Pe,Math.min(Ee,u.value+Oe))}else O.value==="s"?(c=Math.max(lt,Math.min(ot,m.value-b.value+z))*(16/9),c=Math.max(Pe,Math.min(Ee,c))):(O.value==="sw"||O.value==="w")&&(c=Math.max(Pe,Math.min(Ee,u.value-M)),Q=y.value+(u.value-c));let le=c*(9/16),Me=le+b.value;le<lt?(le=lt,c=le*(16/9),Me=le+b.value):le>ot&&(le=ot,c=le*(16/9),Me=le+b.value);const Ye=window.innerWidth,Xe=window.innerHeight;Q=Math.max(0,Math.min(Ye-c,Q)),Z=Math.max(0,Math.min(Xe-Me,Z)),S.value=Math.round(c),R.value=Math.round(Me),J.value=Math.round(Q),te.value=Math.round(Z)}function ee(){q.value=!1,O.value="",document.removeEventListener("mousemove",Se),document.removeEventListener("mouseup",ee),document.body.style.userSelect=""}function Re(w){w.key==="Escape"&&Ae()}rt(()=>{document.addEventListener("keydown",Re),d.isOpen&&o.value&&d.allowCustomPosition&&de()});const J=kt("youtubePlayerX",Gt),te=kt("youtubePlayerY",Jt);G(()=>d.allowCustomPosition,w=>{w||(J.value=Gt,te.value=Jt)});function de(){if(!o.value||!d.allowCustomPosition)return;const w=window.innerWidth,M=window.innerHeight,z=S.value,c=R.value;let Q=J.value,Z=te.value;Q+z>w&&(Q=Math.max(0,w-z-40)),Q<0&&(Q=0),Z+c>M&&(Z=Math.max(0,M-c-40)),Z<0&&(Z=40),Q!==J.value&&(J.value=Q),Z!==te.value&&(te.value=Z)}const{width:We,height:Ve}=mn();G([We,Ve],()=>{de()}),G(()=>d.isOpen,w=>{w&&o.value&&d.allowCustomPosition&&ne(()=>{de()})});const me=g(!1),V=g(0),K=g(0),X=g(0),N=g(0);function _e(w){if(!o.value||!d.allowCustomPosition)return;me.value=!0;const M=w.touches?w.touches[0].clientX:w.clientX,z=w.touches?w.touches[0].clientY:w.clientY;V.value=M,K.value=z,X.value=J.value,N.value=te.value,document.addEventListener("mousemove",ye),document.addEventListener("mouseup",Le),document.addEventListener("touchmove",ye,{passive:!1}),document.addEventListener("touchend",Le),document.body.style.userSelect="none",w.preventDefault()}function ye(w){if(!me.value)return;const M=w.touches?w.touches[0].clientX:w.clientX,z=w.touches?w.touches[0].clientY:w.clientY,c=M-V.value,Q=z-K.value,Z=window.innerWidth,le=window.innerHeight,Me=S.value,Ye=R.value,Xe=0;let He=X.value+c,Oe=N.value+Q;He=Math.max(Xe,Math.min(Z-Me,He)),Oe=Math.max(0,Math.min(le-Ye,Oe)),J.value=He,te.value=Oe,w.preventDefault()}function Le(){me.value=!1,document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",Le),document.removeEventListener("touchmove",ye),document.removeEventListener("touchend",Le),document.body.style.userSelect=""}return Kt(()=>{document.removeEventListener("keydown",Re),document.removeEventListener("mousemove",Se),document.removeEventListener("mouseup",ee),document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",Le),document.removeEventListener("touchmove",ye),document.removeEventListener("touchend",Le),i.value&&(i.value.destroy(),i.value=null)}),(w,M)=>{const z=vt;return v(),j(pn,{to:"#teleports"},[E(Qt,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 translate-y-4","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"transition-all duration-200 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 translate-y-4"},{default:B(()=>[e.isOpen?(v(),$("div",{key:0,class:_(["fixed z-[60] shadow-2xl",{"bottom-0 left-0 right-0 w-full":!t(o)}]),style:Ct(t(o)&&d.allowCustomPosition?{left:`${t(J)}px`,top:`${t(te)}px`,width:`${t(S)}px`,height:`${t(R)}px`,bottom:"auto",right:"auto"}:t(o)&&!d.allowCustomPosition?{bottom:"40px",right:"40px",width:`${t(S)}px`,height:`${t(R)}px`,left:"auto",top:"auto"}:{})},[t(o)&&d.allowCustomPosition?(v(),$("div",{key:0,class:"absolute top-0 left-0 w-4 h-4 cursor-nwse-resize z-10",onMousedown:M[0]||(M[0]=c=>pe(c,"nw"))},null,32)):T("",!0),t(o)&&d.allowCustomPosition?(v(),$("div",{key:1,class:"absolute top-0 left-4 right-4 h-2 cursor-ns-resize z-10",onMousedown:M[1]||(M[1]=c=>pe(c,"n"))},null,32)):T("",!0),t(o)&&d.allowCustomPosition?(v(),$("div",{key:2,class:"absolute top-0 right-0 w-4 h-4 cursor-nesw-resize z-10",onMousedown:M[2]||(M[2]=c=>pe(c,"ne"))},null,32)):T("",!0),t(o)&&d.allowCustomPosition?(v(),$("div",{key:3,class:"absolute right-0 top-4 bottom-4 w-2 cursor-ew-resize z-10",onMousedown:M[3]||(M[3]=c=>pe(c,"e"))},null,32)):T("",!0),t(o)&&d.allowCustomPosition?(v(),$("div",{key:4,class:"absolute bottom-0 right-0 w-4 h-4 cursor-nwse-resize z-10",onMousedown:M[4]||(M[4]=c=>pe(c,"se"))},null,32)):T("",!0),t(o)&&d.allowCustomPosition?(v(),$("div",{key:5,class:"absolute bottom-0 left-4 right-4 h-2 cursor-ns-resize z-10",onMousedown:M[5]||(M[5]=c=>pe(c,"s"))},null,32)):T("",!0),t(o)&&d.allowCustomPosition?(v(),$("div",{key:6,class:"absolute bottom-0 left-0 w-4 h-4 cursor-nesw-resize z-10",onMousedown:M[6]||(M[6]=c=>pe(c,"sw"))},null,32)):T("",!0),t(o)&&d.allowCustomPosition?(v(),$("div",{key:7,class:"absolute left-0 top-4 bottom-4 w-2 cursor-ew-resize z-10",onMousedown:M[7]||(M[7]=c=>pe(c,"w"))},null,32)):T("",!0),t(q)||t(me)?(v(),$("div",{key:8,class:_(["absolute inset-0 z-20",{"curs
2or-ns-resize":t(q)&&(t(O)==="n"||t(O)==="s"),"cursor-ew-resize":t(q)&&(t(O)==="e"||t(O)==="w"),"cursor-nwse-resize":t(q)&&(t(O)==="nw"||t(O)==="se"),"cursor-nesw-resize":t(q)&&(t(O)==="ne"||t(O)==="sw"),"cursor-move":t(me)}])},null,2)):T("",!0),H("div",El,[E(z,{icon:"i-carbon-move",color:"gray",variant:"ghost",size:"xs",ui:{rounded:"rounded-md"},class:"cursor-move",title:"Move player",onMousedown:M[8]||(M[8]=c=>t(o)&&d.allowCustomPosition?_e(c):null),onTouchstart:M[9]||(M[9]=c=>t(o)&&d.allowCustomPosition?_e(c):null)}),E(z,{icon:"i-carbon-arrow-up-right",color:"gray",variant:"ghost",size:"xs",ui:{rounded:"rounded-md"},title:"Open in new tab",onClick:Ie}),E(z,{icon:"i-carbon-close-large",color:"gray",variant:"ghost",size:"xs",ui:{rounded:"rounded-md"},title:"Close",onClick:Ae})],512),H("div",{class:_(["relative w-full flex-1 rounded-xl overflow-hidden",{"aspect-video":!t(o)}]),style:Ct({height:t(o)?`${t(R)-t(b)}px`:"auto"})},[H("div",{ref_key:"playerRef",ref:C,class:"absolute inset-0 w-full h-full"},null,512)],6)],6)):T("",!0)]),_:1})])}}};function Al({charts:e,sources:x}){const d=new Map,s=e.map((o,a)=>{const C=o.data.chartId.split("_v")[0];d.has(C)||d.set(C,a);const i=e.filter(f=>f.data.chartId.split("_v")[0]===C).map(f=>f.data.chartId);return{...o,allVersionsChartIds:i,baseChartId:C,originalOrder:d.get(C)}}).filter(o=>!o.isDeprecated).filter(o=>!o.isDeleted).sort((o,a)=>{if(o.originalOrder!==a.originalOrder)return o.originalOrder-a.originalOrder;const C=e.findIndex(f=>f.data.chartId===o.data.chartId),i=e.findIndex(f=>f.data.chartId===a.data.chartId);return C-i}),I=e.filter(o=>o.isDeleted).map(o=>o.data.chartId);return{charts:s,sources:x,deletedChartIds:I}}function Rl(){const e=g(!1),x=na();async function d({title:s="board",rootEl:I}={}){const a=hn().value==="dark",C=I||document,i=C.querySelectorAll(".cho-chart__container");if(!i.length){x.add({title:"No charts to export",color:"amber"});return}e.value=!0,await ne();try{const{jsPDF:f}=await gn(async()=>{const{jsPDF:O}=await import("./C3xNLmzR.js").then(L=>L.j);return{jsPDF:O}},__vite__mapDeps([0,1,2]),import.meta.url),h=C.querySelectorAll(".cho-chart__container.opacity-30");h.forEach(O=>O.classList.remove("opacity-30")),await ne();const p=[];for(const O of i){const L=O.querySelectorAll("foreignObject"),r=[];L.forEach(m=>{const y=parseFloat(m.getAttribute("width"));r.push(y),m.setAttribute("width",(y*1.04).toString())}),await ne();const u=await $n(O,{width:O.offsetWidth,height:O.offsetHeight,pixelRatio:2,quality:.85,cacheBust:!0,backgroundColor:a?"#1f2937":"#ffffff",fontEmbedCSS:await An(O)});L.forEach((m,y)=>{m.setAttribute("width",r[y].toString())}),p.push(u)}h.forEach(O=>O.classList.add("opacity-30"));const b=1080,A=1350,S=new f({orientation:"portrait",unit:"px",format:[b,A]}),R=40,q=Vl(b,A,a);for(let O=0;O<p.length;O++){O>0&&S.addPage(),S.addImage(q,"JPEG",0,0,b,A);const L=await Ll(p[O]),r=L.width/L.height,u=b-R*2,m=A-R*2;let y,D;r>u/m?(y=u,D=u/r):(D=m,y=m*r);const Y=(b-y)/2,be=(A-D)/2;S.addImage(p[O],"JPEG",Y,be,y,D)}S.save(`${s}.pdf`)}catch(f){console.error("Error exporting board PDF:",f),x.add({title:"Error exporting PDF",description:f.message,color:"red"})}finally{e.value=!1}}return{isExporting:e,exportBoardPdf:d}}function Vl(e,x,d){const s=document.createElement("canvas");s.width=e,s.height=x;const I=s.getContext("2d");I.fillStyle=d?"#111827":"#f9fafb",I.fillRect(0,0,e,x),I.fillStyle=d?"rgba(255,255,255,0.145)":"rgba(0,0,0,0.25)";for(let o=20;o<e;o+=20)for(let a=20;a<x;a+=20)I.beginPath(),I.arc(o,a,1,0,Math.PI*2),I.fill();return s.toDataURL("image/jpeg",.85)}function Ll(e){return new Promise((x,d)=>{const s=new Image;s.onload=()=>x(s),s.onerror=d,s.src=e})}const zl=["data-testid","data-chat-status","data-stream-updates"],Bl={class:""},Dl={class:"flex items-center"},Ul={class:"font-grand !my-0 truncate pl-1.5 pr-2.5 py-1.5 prose prose-sm dark:prose-invert font-bold max-w-none"},_l={class:"flex items-center gap-x-1"},Hl={key:0,class:"text-amber-500 p-4 rounded-md bg-amber-50 dark:bg-amber-900/20 my-12"},Fl={ref:"chat-container",class:"cho-chat-container fixed bottom-0 left-0 w-full pointer-events-none flex justify-start"},jl={class:"absolute top-0 right-0 left-0 -translate-y-full flex justify-start w-full"},ql=["data-streaming"],Nl={key:1,class:"w-full flex flex-row justify-between items-end gap-x-4 pl-4 pr-6"},Wl={key:0,class:"flex justify-start"},Yl={key:0,class:"space-y-2 border-t border-gray-300 dark:border-gray-700 pt-4"},Lo={__name:"[id].client",setup(e){const x=ge("isDebug",!1),d=ge("debugInfo",g(""));G(x,n=>{n&&(d.value=Mt.value)});const s=na(),I=Wt("profile"),o=g(""),a=g(""),C=g(null),i=g([]),f=g([]),h=g("private"),p=g(!1),b=g(null),A=g(null),S=g(!1);async function R(){if(!I.value)return Qe("/start");const n=S.value;S.value=!S.value;try{await $fetch(`/api/chats/${m.value}/favorite`,{method:n?"DELETE":"POST"})}catch(l){S.value=n,s.add({title:"Error toggling favorite",description:l.message,color:"red"})}}bn({title:()=>`${o.value||"Board"} | chartr.ai`});const q=yn(),O=Wt("isInExtension"),L=g([]),r=_n(),u=wn(),m=k(()=>u.params.id);W("chatId",m);const y=k(()=>p.value?!1:O.value||!a.value?!0:I.value?I.value.username===a.value:!1);W("isUserChatOwner",y);const D=g(!1),Y=g(null);function be(n){Y.value=n,n.chartId&&we(n.chartId),n&&(c.value=!1,z.value=!0)}function fe(){Y.value=null}W("chatReference",Y),W("updateChatReference",be),W("resetChatReference",fe);const ue=g(null);W("activeChartId",ue);const{refreshUserPlan:Ne}=ge("userPlan"),{modelPref:Ae}=jn(),Ie=kt("modelId"),pe=["1","true"].includes(String(bt().public.e2eAuthEnabled).toLowerCase());G(()=>Ie.value,n=>{n!=null&&n!=="auto"&&!qn.some(l=>l.id===n)&&(Ie.value="auto")},{immediate:!0});function Se(){try{const n=new(window.AudioContext||window.webkitAudioContext),l=n.createOscillator(),P=n.createGain();l.connect(P),P.connect(n.destination),l.frequency.setValueAtTime(800,n.currentTime),l.type="sine",P.gain.setValueAtTime(0,n.currentTime),P.gain.linearRampToValueAtTime(.1,n.currentTime+.01),P.gain.exponentialRampToValueAtTime(.001,n.currentTime+.3),l.start(n.currentTime),l.stop(n.currentTime+.3)}catch(n){console.warn("Could not play notification sound:",n)}}const ee=new Pn({transport:new En({api:`/api/chats/${m.value}`,prepareSendMessagesRequest:({messages:n})=>{const l={messages:n,charts:i.value,sources:f.value,title:o.value,chartrId:b.value};return l.modelPref=Ae.value,(I.value?.isAdmin||pe)&&Ie.value&&Ie.value!=="auto"&&(l.modelId=Ie.value),{body:l}}}),onData:n=>{n.type==="data-title"&&(o.value=n.data.title)}}),Re=n=>{ee.messages=n},J=k(()=>ee.messages),te=g(""),de=k(()=>ee.status),We=k(()=>ee.data||[]),Ve=g(0),me=["1","true"].includes(String(bt().public.e2eAuthEnabled).toLowerCase());me&&(G(de,n=>{n==="submitted"&&(Ve.value=0)}),G(J,()=>{de.value==="streaming"&&(Ve.value+=1)},{deep:!0})),ee.onFinish=async()=>{Se(),Ne()},ee.onError=n=>{console.log("chat.onError",n),n.message.includes("429")?s.add({title:"Rate limit exceeded",description:"Please wait a moment before you continue.",color:"orange"}):n.message.includes("403")?s.add({title:"Usage limit exceeded",description:"Check the status of your plan at the settings page",color:"orange",actions:[{label:"Go to settings",onClick:()=>Qe("/settings")}]}):n.statusCode===529?s.add({title:"AI model is overloaded",description:"The AI service is currently experiencing high demand. Try switching to fast mode or retry in a moment.",color:"orange",actions:[{label:"Switch to Fast Mode",onClick:()=>{Ae.value="fast",s.add({title:"Switched to fast mode",description:"Try your request again with faster processing.",color:"green"})}}]}):n.statusCode===400?s.add({title:"Error",description:n.statusMessage,color:"red"}):s.add({title:"Error",description:"Something went wrong, please try again?",color:"red"})},W("input",te),G(We,n=>{if(!Array.isArray(n))return;const l=n.filter(P=>typeof P=="object"&&P!==null&&"title"in P).pop();l?.title&&(o.value=l.title)}),W("stop",ee.stop);function V(n){ee.sendMessage({...n,role:n.role,parts:n.parts||[{type:"text",text:n.content}]})}async function K(n,l=[]){const P=Y.value;if(P&&fe(),!y.value){Vt({q:n,chatReference:P});return}const he=[{type:"text",text:n}];if(l&&l.length>0)try{const F=new FormData;l.forEach(Ce=>{F.append("files",Ce)}),(await $fetch(`/api/chats/${m.value}/upload`,{method:"POST",body:F}
2)).forEach(Ce=>{he.push({type:"file",url:Ce.url,mediaType:Ce.mimeType,filename:Ce.filename})})}catch(F){console.error("[submit] Error uploading files:",F),s.add({title:"Error uploading files",description:"Please try again",color:"red"});return}V({role:"user",content:n,parts:he,metadata:{chatReference:P}})}W("submit",K);function X({text:n}){V({role:"user",content:n})}W("handleSuggestion",X);const N=g({isOpen:!1,videoId:"",startTime:0});function _e({videoId:n,startTime:l=0}){N.value={isOpen:!0,videoId:n,startTime:l}}function ye(){N.value.isOpen=!1}const w=ra().greaterOrEqual("md"),M=k(()=>N.value.isOpen?N.value.videoId:null);W("openFloatingPlayer",_e),W("closeFloatingPlayer",ye),W("floatingPlayerVideoId",M),W("sources",f);const z=g(!!w.value);W("isChatOpen",z);const c=g(!1);W("isChatExpanded",c),G(c,n=>{n&&ne(()=>{Xe.value.scrollToBottom()})});const Q=g(!1);W("isExportPanelOpen",Q);const Z=g(!1);W("isSettingsPanelOpen",Z);const{isExporting:le,exportBoardPdf:Me}=Rl();W("isBoardExporting",le);function Ye(){Me({title:o.value||"board"})}const Xe=it("chat-messages"),He=g(!0),Oe=k(()=>w.value&&c.value&&y.value),ua=it("chat-container");Cn(ua,()=>{w.value||(z.value=!1,c.value=!1)},{ignore:[".ignore-click-outside"]});function da(){z.value?c.value=!c.value:z.value=!0}function ca(){we(null)}const Ot=g(!1);G(c,n=>{n&&(Ot.value=!1)});const xt=k(()=>de.value==="submitted"||de.value==="streaming"),ze=k(()=>xt.value||p.value);W("isChatLoading",ze),G(xt,async n=>{!n&&fa.value&&(z.value=!0,c.value=!0)});const va=k(()=>de.value!=="streaming"?"Loading":at.value?.type==="text"?at.value?.segments?.find(n=>n.type==="chart")?"Charting":"Texting":Yn(at.value)?"Charting":at.value?.type==="reasoning"?"Thinking":"Checking");kn(m,async n=>{if(n){Re([]),te.value="",o.value="",a.value="",C.value=null,L.value=[],ue.value=null,fe(),h.value="private",b.value=null,S.value=!1,i.value=[],f.value=[];try{if(r.value.isNewChat)r.value.chartrId&&(b.value=r.value.chartrId,A.value=r.value.chartrName),$fetch("/api/chats",{method:"POST",body:{id:m.value,messages:[]}}).catch(F=>{console.error("Error creating chat record in background:",F)});else{p.value=!0;const F=await $fetch(`/api/chats/${m.value}`);if(a.value=F.username||"",C.value=F.avatarUrl||null,F.messages&&Re(F.messages),h.value=F.visibility||"private",f.value=F.sources,i.value=F.charts,b.value=F.chartrId||null,A.value=F.chartrName||null,S.value=F.isFav||!1,F.title?o.value=F.title:F.messages.length>0&&await Lt(),q.value&&(L.value=await $fetch(`/api/charts?chatId=${m.value}`)),p.value=!1,u.query.chartId){const ce=u.query.chartId;i.value.some(Ce=>Ce.data.chartId===ce)&&we(ce)}}const{q:l,chatReference:P,files:he}=r.value;if(l||he&&he.length>0){const F=l?[{type:"text",text:l}]:[];if(he&&he.length>0)try{const ce=new FormData;he.forEach(De=>{ce.append("files",De)}),(await $fetch(`/api/chats/${m.value}/upload`,{method:"POST",body:ce})).forEach(De=>{F.push({type:"file",url:De.url,mediaType:De.mimeType,filename:De.filename})})}catch(ce){console.error("[boards/[id]] Error uploading files on initial submit:",ce),s.add({title:"Error uploading files",description:"Please try again",color:"red"})}V({role:"user",content:l||"",parts:F,metadata:{chatReference:P}})}r.value={q:"",chartrId:null,chartrName:null,chatReference:null,files:[],isNewChat:!1}}catch(l){console.error("Error initializing chat:",l),Qe("/start")}}});const{parsedMessages:Mt,otherParts:Tt,charts:pt,sources:Pt,lastParsedMessagePart:at,lastParsedMessageHasNoCharts:fa,lastAssistantMessageSuggestions:Et}=Hn({messages:J,charts:i,sources:f});W("parsedMessages",Mt),G(()=>pt.value,()=>{i.value=pt.value}),G(()=>Pt.value,()=>{f.value=Pt.value}),G(()=>Tt.value.length,()=>{p.value||(c.value||(Ot.value=!0),Tt.value.length===1&&(z.value=!0,c.value=!0))});const pa=k(()=>pt.value.map(n=>n.data.chartId));G(()=>pa.value.length,async()=>{p.value||(we(null),fe(),await ne())});async function we(n){ue.value!==n&&(ue.value=n,Y.value?.chartId!==n&&fe(),n&&(await ne(),$t.value&&$t.value.zoomToChart(n)))}W("setActiveChartId",we);const $t=it("board-flow"),Fe=g(new Map),At=ea(async()=>{if(Fe.value.size!==0){if(ze.value){setTimeout(()=>{At()},100);return}await Ge(),Fe.value.clear()}},100);async function Rt({data:n}){const l=n.chartId;i.value=i.value.map(P=>P.data.chartId===l?{...P,data:{...P.data,...n},updatedAt:new Date().toISOString()}:P),Fe.value.has(l)?Fe.value.set(l,{...Fe.value.get(l),...n}):Fe.value.set(l,n),At()}async function ma({data:n,sourceIndex:l}){l>=0&&l<f.value.length&&(f.value[l]=n,await Ge())}W("updateBoardTitle",zt),W("generateTitle",Lt);async function Vt({q:n,chatReference:l}={}){if(!I.value)return Qe("/start");try{const{chat:P}=await $fetch(`/api/chats/${m.value}/fork`,{method:"POST"});n&&(r.value.q=n),l&&(r.value.chatReference=l),Qe(`/boards/${P.id}`)}catch(P){console.error("Error forking board:",P),s.add({title:"Error",description:"Failed to fork board",color:"red"})}}async function Ge({title:n=void 0}={}){if(y.value)try{await $fetch(`/api/chats/${m.value}`,{method:"PATCH",body:{charts:i.value.map(l=>(delete l.isStreaming,l)),sources:f.value,title:n}})}catch(l){console.error("Error updating messages:",l)}}async function Lt(){try{const{title:n}=await $fetch(`/api/chats/${m.value}/title`,{method:"POST"});return o.value||(o.value=n),n}catch(n){return console.error("Error generating title:",n),null}}const Be=g(!1);function ha(){Be.value=!0}const mt=k(()=>!b.value||!A.value?null:{id:b.value,name:A.value});async function zt(n){try{const{title:l}=await $fetch(`/api/chats/${m.value}/title`,{method:"PUT",body:{title:n}});return o.value=l,Be.value=!1,s.add({title:"Success",description:"Board title updated",color:"green"}),!0}catch(l){return console.error("Error updating title:",l),s.add({title:"Error",description:"Failed to update title",color:"red"}),!1}}function ga({chartId:n}){return L.value.find(l=>l.data.chartId===n)}function ba(n){i.value.some(l=>l.data.chartId===n)?we(n):Dt(n),w.value||(c.value=!1)}function ya({chartId:n,errorMessage:l}){V({role:"user",content:`
3<automated-message>
4  Error in chart: ${n}
5  Error: ${JSON.stringify(l)}.
6  Do not explain the error or reply. Just make the correction and draw the chart again.
7</automated-message>
8    `,metadata:{isFixErrorRequest:!0}})}const Bt=k(()=>Al({charts:i.value,sources:f.value}).charts);async function Dt(n){const l=n.split("_v")[0];i.value=i.value.map(P=>P.data.chartId.split("_v")[0]===l?{...P,isDeprecated:P.data.chartId!==n}:P),we(n),await Ge()}async function wa(n){Y.value?.chartId===n&&fe(),ue.value===n&&we(null),i.value=i.value.map(l=>l.data.chartId.split("_v")[0]===n.split("_v")[0]?{...l,isDeleted:!0}
8:l),await Ge()}function Ut({chartId:n}){return i.value.some(l=>l.data.chartId===n&&l.isDeleted)}async function Ca(n){const l=n.split("_v")[0];i.value=i.value.map(P=>P.data.chartId.split("_v")[0]===l?(delete P.isDeleted,{...P,isDeprecated:P.data.chartId!==n}):P),Ge(),we(n)}const nt=g(!1);async function ka(){h.value==="private"&&y.value&&await _t("unlisted"),nt.value=!0}const Ia=bt().public.appUrl,Sa=k(()=>`${Ia}/boards/${m.value}`);async function _t(n){if(n!==h.value)try{await $fetch(`/api/chats/${m.value}`,{method:"PATCH",body:{visibility:n}}),h.value=n}catch(l){console.error("Error updating visibility:",l),s.add({title:"Error updating visibility",description:l.message,color:"red"})}}const Te=k(()=>Bt.value.map(n=>n.data.chartId));function Oa(){if(Be.value||Te.value.length===0)return;const n=ue.value?Te.value.indexOf(ue.value):-1,l=n<Te.value.length-1?n+1:0;we(Te.value[l])}function xa(){if(Be.value||Te.value.length===0)return;const n=ue.value?Te.value.indexOf(ue.value):0,l=n>0?n-1:Te.value.length-1;we(Te.value[l])}aa({meta_b:{usingInput:!0,handler:()=>{c.value=!c.value}},arrowright:{usingInput:!1,handler:Oa},arrowleft:{usingInput:!1,handler:xa}});const Ma=ge("toggleSidebar");return(n,l)=>{const P=vt,he=la,F=Sn,ce=oa,Ce=sl,De=Mn,Ta=ct,ht=Tn;return v(),$("div",{class:"relative h-dvh w-screen overflow-hidden","data-testid":t(me)?"core-flow-state":void 0,"data-chat-status":t(me)?t(de):void 0,"data-stream-updates":t(me)?t(Ve):void 0},[E(F,{class:"absolute top-0 left-0","rounded-full":""},{default:B(()=>[H("div",Bl,[H("div",Dl,[E(P,{icon:"i-heroicons-bars-3",variant:"ghost",color:"gray",size:"lg",onClick:t(Ma)},null,8,["onClick"]),t(o)?(v(),$("div",{key:0,class:"flex items-center gap-2 cursor-pointer max-w-[11rem] sm:max-w-md lg:max-w-2xl mr-2",onClick:l[0]||(l[0]=U=>ha())},[H("h4",Ul,re(t(o)),1),t(a)?(v(),j(he,{key:0,username:t(a),"avatar-url":t(C),minimal:"",size:"sm",link:!1},null,8,["username","avatar-url"])):T("",!0),t(mt)?(v(),j(ia,{key:1,chartr:t(mt),minimal:"",size:"sm",link:!1},null,8,["chartr"])):T("",!0)])):T("",!0)])])]),_:1}),E(F,{class:"absolute top-0 right-0","rounded-full":""},{default:B(()=>[H("div",_l,[E(ce,{text:"Download PDF"},{default:B(()=>[E(P,{size:"lg",variant:"ghost",color:"gray",icon:"i-carbon-document-pdf",loading:t(le),onClick:Ye},null,8,["loading"])]),_:1}),E(ce,{text:"Fork board"},{default:B(()=>[E(P,{size:"lg",variant:"ghost",color:"gray",icon:"i-carbon-direction-fork",onClick:l[1]||(l[1]=U=>Vt())})]),_:1}),t(q)?(v(),j(ce,{key:0,text:t(S)?"Remove from Saved":"Save"},{default:B(()=>[E(P,{size:"lg",variant:"ghost",color:t(S)?"primary":"gray",icon:t(S)?"i-carbon-bookmark-filled":"i-carbon-bookmark",onClick:R},null,8,["color","icon"])]),_:1},8,["text"])):T("",!0),t(q)?(v(),j(ce,{key:1,text:t(h)==="private"?"Share board":t(Xt)(t(h)).label},{default:B(()=>[E(P,{size:"lg",variant:"ghost",color:t(h)==="private"?"gray":"blue",icon:t(h)==="private"?"i-carbon-share":t(Xt)(t(h)).icon,onClick:ka},null,8,["color","icon"])]),_:1},8,["text"])):T("",!0)])]),_:1}),l[10]||(l[10]=H("div",{id:"board-controls",class:"absolute top-[5rem] right-0 z-30 flex flex-col items-end pointer-events-none"},null,-1)),E(Bn,{ref:"board-flow",charts:t(Bt),sources:t(f),onClick:ca,"onUpdate:chart":Rt,"onUpdate:source":ma},{chart:B(({chart:U})=>[E(Rn,qe(ga({chartId:U.data.chartId})||{data:U.data,origin:{chatId:t(m),chartId:U.data.chartId},username:t(y)?t(I)?.username:t(a),createdAt:U.createdAt,updatedAt:U.updatedAt},{"is-streaming":U.isStreaming,"with-fork-button":"","with-share-button":"","with-fav-button":"",class:"scroll-mt-24","onUpdate:chart":Rt}),St({error:B(({error:je})=>[je?(v(),$(ut,{key:0},[U.isStreaming?T("",!0):(v(),$("div",Hl,[l[9]||(l[9]=se(" Hmm... something's not right. ",-1)),t(ze)?(v(),$(ut,{key:0},[se(" Hold on... ")],64)):(v(),j(P,{key:1,size:"sm",onClick:In(Xl=>ya({chartId:U.data.chartId,errorMessage:je.message}),["stop"])},{default:B(()=>[...l[8]||(l[8]=[se(" Fix with AI ",-1)])]),_:1},8,["onClick"]))]))],64)):T("",!0)]),_:2},[t(y)?{name:"chart-toolbar",fn:B(()=>
8[E(Vn,{"tooltip-text":"Delete chart",icon:"i-carbon-trash-can",color:"red",disabled:t(ze),onClick:je=>wa(U.data.chartId)},null,8,["disabled","onClick"]),U.allVersionsChartIds?.length>1?(v(),j(Ce,{key:0,options:U.allVersionsChartIds,"model-value":U.data.chartId,size:"xs",ui:{background:"bg-orange-100"},class:"my-1 px-2 z-50","onUpdate:modelValue":Dt},{label:B(()=>[se(" v"+re(parseInt(U.data.chartId.match(/_v(\d+)$/)?.[1]||"0")),1)]),option:B(({option:je})=>[se(" v"+re(parseInt(je.match(/_v(\d+)$/)?.[1]||"0")),1)]),_:2},1032,["options","model-value"])):T("",!0)]),key:"0"}:void 0]),1040,["is-streaming"])]),_:1},8,["charts","sources"]),yt(H("div",Fl,[H("div",{class:_(["w-full md:w-[45ch] relative z-50 rounded-t-xl border",{"border-gray-300 dark:border-gray-700":t(c),"border-transparent bg-opacity-0 shadow-none":!t(c),"bg-gray-100 dark:bg-gray-900":t(c)}])},[H("div",jl,[t(ze)&&!t(c)?(v(),$("div",{key:0,"data-testid":"chat-stream-status","data-streaming":t(de)==="streaming",class:"flex items-center gap-2 text-gray-500 dark:text-gray-400 text-xs cursor-pointer bg-gray-300/70 dark:bg-gray-700/70 px-4 py-1 mb-2 ml-4 rounded-xl w-fit pointer-events-auto",onClick:da},[E(De),se(" "+re(t(va))+" ",1),E(Ta,{name:"i-carbon-chevron-up",class:"w-3 h-3"})],8,ql)):(v(),$("div",Nl,[!t(c)&&t(Et).length>0&&!t(Y)?(v(),j(Yt,{key:0,class:"mb-0.5 !gap-y-1 text-left !flex-col !items-start pointer-events-auto",suggestions:t(Et),onSubmit:X},null,8,["suggestions"])):T("",!0),t(z)&&t(c)?(v(),j(P,{key:1,icon:"i-carbon-chevron-down",variant:"solid",class:"rounded-t-xl rounded-b-none pointer-events-auto",onClick:l[2]||(l[2]=()=>{c.value=!1})})):T("",!0),t(z)&&!t(c)?(v(),j(P,{key:2,icon:"i-carbon-chevron-up",variant:"solid",class:"rounded-t-xl rounded-b-none pointer-events-auto",onClick:l[3]||(l[3]=()=>{c.value=!0})})):T("",!0)]))]),t(z)?T("",!0):(v(),$("div",Wl,[E(F,{"rounded-full":"","with-padding":!1},{default:B(()=>[E(P,{icon:"i-carbon-chat-launch",variant:"soft",color:"primary",size:"lg",ui:{rounded:"rounded-full"},onClick:l[4]||(l[4]=U=>z.value=!0)})]),_:1})])),t(z)?yt((v(),j(Un,{key:1,ref:"chat-messages",class:"h-fit max-h-[65svh] pointer-events-auto"},{chart:B(({data:U})=>[U?.chartId?(v(),j(yl,{key:0,id:`chart-thumb_${U.chartId}`,data:U,"is-deleted":Ut({chartId:U.chartId}),onClick:je=>Ut({chartId:U.chartId})?Ca(U.chartId):ba(U.chartId)},null,8,["id","data","is-deleted","onClick"])):T("",!0)]),end:B(()=>[t(ze)?T("",!0):(v(),$("div",Yl,[E(Yt,{suggestions:[{label:"✨ Make it better",prompt:"Critique, think, and make it better"},"😂 Make it funny"],onSubmit:X})])),t(ze)?T("",!0):(v(),j(ht,{key:1,description:"Click on any text in the chart to explore options...",icon:"i-carbon-select-window"})),t(D)?(v(),j(ht,{key:2,description:"Experiencing high demand, we've switched you temporarily to a different model.",variant:"subtle",color:"orange",icon:"i-carbon-status-change",actions:[{variant:"outline",label:"Switch back",color:"orange",click:()=>{D.value=!1}}]},null,8,["actions"])):T("",!0)]),_:1},512)),[[wt,t(c)]]):T("",!0),t(z)?(v(),$("div",{key:2,class:_({"pb-2":!t(c)})},[yt(E(wl,{class:"px-2 pointer-events-auto","with-ai-warning":t(c)},null,8,["with-ai-warning"]),[[wt,t(Oe)||t(He)]])],2)):T("",!0)],2)],512),[[wt,!t(Q)&&(t(w)||!t(Z))]]),E(Wn,{"is-open":t(nt),"onUpdate:isOpen":l[5]||(l[5]=U=>et(nt)?nt.value=U:null),visibility:t(h),title:t(o),"entity-type":"board","is-user-owner":t(y),url:t(Sa),"onUpdate:visibility":_t},{"sharing-info":B(()=>[t(h)!=="private"&&t(y)?(v(),j(ht,{key:0,color:"blue",variant:"subtle",icon:"i-carbon-information",title:"What gets shared",description:"When you share this board, viewers can see what's on your board i.e. charts and sources, but NOT your conversation."})):T("",!0)]),_:1},8,["is-open","visibility","title","is-user-owner","url"]),E(Pl,{modelValue:t(Be),"onUpdate:modelValue":l[6]||(l[6]=U=>et(Be)?Be.value=U:null),"current-title":t(o),username:t(a),"avatar-url":t(C),chartr:t(mt),placeholder:"Enter board title","show-regenerate-button":t(y),onSave:zt},null,8,["modelValue","current-title","username","avatar-url","chartr","show-regenerate-button"]),E($l,{"is-open":t(N).isOpen,"onUpdate:isOpen":l[7]||(l[7]=U=>t(N).isOpen=U),"video-id":t(N).videoId,"start-time":t(N).startTime,onClose:ye},null,8,["is-open","video-id","start-time"])],8,zl)}}};export{Lo as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.