this.#current)}set current(value){set$1(this.#current,value)}},updated_listener.v=()=>updated.current=!0);function update(new_page){Object.assign(page$3,new_page)}const noop_span={spanContext(){return noop_span_context},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},noop_span_context={traceId:"",
spanId:"",traceFlags:0},{onMount}=svelte,untrack=untrack$1??(value=>value()),ICON_REL_ATTRIBUTES=new Set(["icon","shortcut icon","apple-touch-icon"]);let rendering_error=null;const scroll_positions=get$2(SCROLL_KEY)??{},snapshots=get$2(SNAPSHOT_KEY)??{},stores={url:notifiable_store({}),page:notifiable_store({}),navigating:writable(null),updated:create_updated_store()};function update_scroll_positions(index2){scroll_positions[index2]=scroll_state()}function clear_onward_history(current_history_index2,current_navigation_index2){
let i=current_history_index2+1;for(;scroll_positions[i];)delete scroll_positions[i],i+=1;for(i=current_navigation_index2+1;snapshots[i];)delete snapshots[i],i+=1}function native_navigation(url2,replace2=!1){return replace2?location.replace(url2.href):location.href=url2.href,new Promise(noop$2)}async function update_service_worker(){if("serviceWorker"in navigator){const registration=await navigator.serviceWorker.getRegistration(base||"/");registration&&await registration.update()}}let routes,default_layout_loader,
-default_error_loader,container,target,app$1;const invalidated=[],components=[];let load_cache=null;function discard_load_cache(){load_cache?.fork?.then(f=>f?.discard()),load_cache=null}const reroute_cache=new Map,before_navigate_callbacks=new Set,on_navigate_callbacks=new Set,after_navigate_callbacks=new Set;let current={branch:[],error:null,url:null},hydrated=!1,started=!1,autoscroll=!0,is_navigating=!1,hash_navigating=!1,has_navigated=!1,force_invalidation=!1,root$1_,current_history_index,current_navigation_index,
+default_error_loader,container,target,app$1;const invalidated=[],components=[];let load_cache=null;function discard_load_cache(){load_cache?.fork?.then(f=>f?.discard()),load_cache=null}const reroute_cache=new Map,before_navigate_callbacks=new Set,on_navigate_callbacks=new Set,after_navigate_callbacks=new Set;let current={branch:[],error:null,url:null},hydrated=!1,started=!1,autoscroll=!0,is_navigating=!1,hash_navigating=!1,has_navigated=!1,force_invalidation=!1,root$1$,current_history_index,current_navigation_index,
token;const preload_tokens=new Set,query_map=new Map;async function start$1(_app,_target,hydrate2){globalThis.__sveltekit__&&(globalThis.__sveltekit__.query,globalThis.__sveltekit__.prerender),document.URL!==location.href&&(location.href=location.href),app$1=_app,await _app.hooks.init?.(),routes=parse$5(_app),container=document.documentElement,target=_target,default_layout_loader=_app.nodes[0],default_error_loader=_app.nodes[1],default_layout_loader(),default_error_loader(),current_history_index=
history.state?.[HISTORY_INDEX],current_navigation_index=history.state?.[NAVIGATION_INDEX],current_history_index||(current_history_index=current_navigation_index=Date.now(),history.replaceState({...history.state,[HISTORY_INDEX]:current_history_index,[NAVIGATION_INDEX]:current_navigation_index},""));const scroll=scroll_positions[current_history_index];function restore_scroll(){scroll&&(history.scrollRestoration="manual",scrollTo(scroll.x,scroll.y))}hydrate2?(restore_scroll(),await _hydrate(target,
hydrate2)):(await navigate({type:"enter",url:resolve_url(app$1.hash?decode_hash(new URL(location.href)):location.href),replace_state:!0}),restore_scroll()),_start_router()}function reset_invalidation(){invalidated.length=0,force_invalidation=!1}function capture_snapshot(index2){components.some(c2=>c2?.snapshot)&&(snapshots[index2]=components.map(c2=>c2?.snapshot?.capture()))}function restore_snapshot(index2){snapshots[index2]?.forEach((value,i)=>{components[i]?.snapshot?.restore(value)})}function persist_state(){
update_scroll_positions(current_history_index),set(SCROLL_KEY,scroll_positions),capture_snapshot(current_navigation_index),set(SNAPSHOT_KEY,snapshots)}async function _goto(url2,options,redirect_count,nav_token){let query_keys;options.invalidateAll&&discard_load_cache(),await navigate({type:"goto",url:resolve_url(url2),keepfocus:options.keepFocus,noscroll:options.noScroll,replace_state:options.replaceState,state:options.state,redirect_count,nav_token,accept:()=>{options.invalidateAll&&(force_invalidation=
!0,query_keys=[],query_map.forEach((entries,id2)=>{for(const payload of entries.keys())query_keys.push(id2+"/"+payload)})),options.invalidate&&options.invalidate.forEach(push_invalidated)}}),options.invalidateAll&&tick().then(tick).then(()=>{query_map.forEach((entries,id2)=>{entries.forEach(({resource},payload)=>{query_keys?.includes(id2+"/"+payload)&&resource.refresh?.()})})})}async function _preload_data(intent){if(intent.id!==load_cache?.id){discard_load_cache();const preload2={};preload_tokens.
add(preload2),load_cache={id:intent.id,token:preload2,promise:load_route({...intent,preload:preload2}).then(result=>(preload_tokens.delete(preload2),result.type==="loaded"&&result.state.error&&discard_load_cache(),result)),fork:null}}return load_cache.promise}async function _preload_code(url2){const route=(await get_navigation_intent(url2,!1))?.route;route&&await Promise.all([...route.layouts,route.leaf].filter(Boolean).map(load2=>load2[1]()))}async function initialize(result,target2,hydrate2){const nav={
-params:current.params,route:{id:current.route?.id??null},url:new URL(location.href)};current={...result.state,nav};const style2=document.querySelector("style[data-sveltekit]");if(style2&&style2.remove(),Object.assign(page$3,result.props.page),root$1_=new app$1.root({target:target2,props:{...result.props,stores,components},hydrate:hydrate2,sync:!1,transformError:void 0}),await Promise.resolve(),restore_snapshot(current_navigation_index),hydrate2){const navigation={from:null,to:{...nav,scroll:scroll_positions[current_history_index]??
+params:current.params,route:{id:current.route?.id??null},url:new URL(location.href)};current={...result.state,nav};const style2=document.querySelector("style[data-sveltekit]");if(style2&&style2.remove(),Object.assign(page$3,result.props.page),root$1$=new app$1.root({target:target2,props:{...result.props,stores,components},hydrate:hydrate2,sync:!1,transformError:void 0}),await Promise.resolve(),restore_snapshot(current_navigation_index),hydrate2){const navigation={from:null,to:{...nav,scroll:scroll_positions[current_history_index]??
scroll_state()},willUnload:!1,type:"enter",complete:Promise.resolve()};after_navigate_callbacks.forEach(fn=>fn(navigation))}started=!0}async function get_navigation_result_from_branch({url:url2,params,branch:branch2,errors:errors2,status,error:error2,route,form}){let slash="never";if(base&&(url2.pathname===base||url2.pathname===base+"/"))slash="always";else for(const node2 of branch2)node2?.slash!==void 0&&(slash=node2.slash);url2.pathname=normalize_path(url2.pathname,slash),url2.search=url2.search;
const result={type:"loaded",state:{url:url2,params,branch:branch2,error:error2,route},props:{constructors:compact(branch2).map(branch_node=>branch_node.node.component),page:clone_page(page$3)}};form!==void 0&&(result.props.form=form);let data={},data_changed=!page$3,p2=0;for(let i=0;i<Math.max(branch2.length,current.branch.length);i+=1){const node2=branch2[i],prev2=current.branch[i];node2?.data!==prev2?.data&&(data_changed=!0),node2&&(data={...data,...node2.data},data_changed&&(result.props[`dat\
a_${p2}`]=data),p2+=1)}return(!current.url||url2.href!==current.url.href||current.error!==error2||form!==void 0&&form!==page$3.form||data_changed)&&(result.props.page={error:error2,params,route:{id:route?.id??null},state:{},status,url:new URL(url2),form:form??null,data:data_changed?data:page$3.data}),result}async function load_node({loader,parent,url:url2,params,route,server_data_node}){let data=null,is_tracking=!0;const uses={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},
check()&&(await update_service_worker(),await native_navigation(url2,replace_state));if(reset_invalidation(),update_scroll_positions(previous_history_index),capture_snapshot(previous_navigation_index),navigation_result.props.page.url.pathname!==url2.pathname&&(url2.pathname=navigation_result.props.page.url.pathname),state2=popped?popped.state:state2,!popped){const change=replace_state?0:1,entry={[HISTORY_INDEX]:current_history_index+=change,[NAVIGATION_INDEX]:current_navigation_index+=change,[STATES_KEY]:state2};
(replace_state?history.replaceState:history.pushState).call(history,entry,"",url2),replace_state||clear_onward_history(current_history_index,current_navigation_index)}const load_cache_fork=intent&&load_cache?.id===intent.id?load_cache.fork:null;load_cache?.fork&&!load_cache_fork&&discard_load_cache(),load_cache=null,navigation_result.props.page.state=state2;let commit_promise;if(started){const after_navigate=(await Promise.all(Array.from(on_navigate_callbacks,fn=>fn(nav.navigation)))).filter(value=>typeof value==
"function");if(after_navigate.length>0){let cleanup=function(){after_navigate.forEach(fn=>{after_navigate_callbacks.delete(fn)})};after_navigate.push(cleanup),after_navigate.forEach(fn=>{after_navigate_callbacks.add(fn)})}const target2=nav.navigation.to;current={...navigation_result.state,nav:{params:target2.params,route:target2.route,url:target2.url}},navigation_result.props.page&&(navigation_result.props.page.url=url2);const fork=load_cache_fork&&await load_cache_fork;fork?commit_promise=fork.
-commit():(rendering_error=null,root$1_.$set(navigation_result.props),rendering_error&&Object.assign(navigation_result.props.page,rendering_error),update(navigation_result.props.page),commit_promise=settled?.()),has_navigated=!0}else await initialize(navigation_result,target,!1);const{activeElement}=document;await commit_promise,await tick(),await tick();let deep_linked=null;if(autoscroll){const scroll=popped?popped.scroll:noscroll?scroll_state():null;scroll?scrollTo(scroll.x,scroll.y):(deep_linked=
+commit():(rendering_error=null,root$1$.$set(navigation_result.props),rendering_error&&Object.assign(navigation_result.props.page,rendering_error),update(navigation_result.props.page),commit_promise=settled?.()),has_navigated=!0}else await initialize(navigation_result,target,!1);const{activeElement}=document;await commit_promise,await tick(),await tick();let deep_linked=null;if(autoscroll){const scroll=popped?popped.scroll:noscroll?scroll_state():null;scroll?scrollTo(scroll.x,scroll.y):(deep_linked=
url2.hash&&document.getElementById(get_id(url2)))?deep_linked.scrollIntoView():scrollTo(0,0)}const changed_focus=document.activeElement!==activeElement&&document.activeElement!==document.body;!keepfocus&&!changed_focus&&reset_focus(url2,!deep_linked),autoscroll=!0,navigation_result.props.page&&(rendering_error&&Object.assign(navigation_result.props.page,rendering_error),Object.assign(page$3,navigation_result.props.page)),is_navigating=!1,type2==="popstate"&&restore_snapshot(current_navigation_index),
nav.fulfil(void 0),nav.navigation.to&&(nav.navigation.to.scroll=scroll_state()),after_navigate_callbacks.forEach(fn=>fn(nav.navigation)),stores.navigating.set(navigating.current=null)}async function server_fallback(url2,route,error2,status,replace_state){return url2.origin===origin&&url2.pathname===location.pathname&&!hydrated?await load_root_error_page({status,error:error2,url:url2,route}):await native_navigation(url2,replace_state)}function setup_preload(){let mousemove_timeout,current_a={element:void 0,
href:void 0},current_priority;container.addEventListener("mousemove",event2=>{const target2=event2.target;clearTimeout(mousemove_timeout),mousemove_timeout=setTimeout(()=>{preload2(target2,PRELOAD_PRIORITIES.hover)},20)});function tap2(event2){event2.defaultPrevented||preload2(event2.composedPath()[0],PRELOAD_PRIORITIES.tap)}container.addEventListener("mousedown",tap2),container.addEventListener("touchstart",tap2,{passive:!0});const observer=new IntersectionObserver(entries=>{for(const entry of entries)
if(!(options.reload||same_url))if(priority<=options.preload_data){current_a={element:a,href:a.href},current_priority=PRELOAD_PRIORITIES.tap;const intent=await get_navigation_intent(url2,!1);if(!intent)return;_preload_data(intent)}else priority<=options.preload_code&&(current_a={element:a,href:a.href},current_priority=priority,_preload_code(url2))}function after_navigate(){observer.disconnect();for(const a of container.querySelectorAll("a")){const{url:url2,external,download}=get_link_info(a,base,
app$1.hash);if(external||download)continue;const options=get_router_options(a);options.reload||(options.preload_code===PRELOAD_PRIORITIES.viewport&&observer.observe(a),options.preload_code===PRELOAD_PRIORITIES.eager&&_preload_code(url2))}}after_navigate_callbacks.add(after_navigate),after_navigate()}function handle_error(error2,event2){if(error2 instanceof HttpError)return error2.body;const status=get_status(error2),message=get_message(error2);return app$1.hooks.handleError({error:error2,event:event2,
status,message})??{message}}function add_navigation_callback(callbacks,callback){onMount(()=>(callbacks.add(callback),()=>{callbacks.delete(callback)}))}function afterNavigate(callback){add_navigation_callback(after_navigate_callbacks,callback)}function beforeNavigate(callback){add_navigation_callback(before_navigate_callbacks,callback)}function goto(url2,opts={}){return url2=new URL(resolve_url(url2)),url2.origin!==origin?Promise.reject(new Error("goto: invalid URL")):_goto(url2,opts,0)}function push_invalidated(resource){
-if(typeof resource=="function")invalidated.push(resource);else{const{href}=new URL(resource,location.href);invalidated.push(url2=>url2.href===href)}}function replaceState(url2,state2){const opts={[HISTORY_INDEX]:current_history_index,[NAVIGATION_INDEX]:current_navigation_index,[PAGE_URL_KEY]:page$3.url.href,[STATES_KEY]:state2};history.replaceState(opts,"",resolve_url(url2)),page$3.state=state2,root$1_.$set({page:untrack(()=>clone_page(page$3))})}function _start_router(){history.scrollRestoration=
+if(typeof resource=="function")invalidated.push(resource);else{const{href}=new URL(resource,location.href);invalidated.push(url2=>url2.href===href)}}function replaceState(url2,state2){const opts={[HISTORY_INDEX]:current_history_index,[NAVIGATION_INDEX]:current_navigation_index,[PAGE_URL_KEY]:page$3.url.href,[STATES_KEY]:state2};history.replaceState(opts,"",resolve_url(url2)),page$3.state=state2,root$1$.$set({page:untrack(()=>clone_page(page$3))})}function _start_router(){history.scrollRestoration=
"manual",addEventListener("beforeunload",e=>{let should_block=!1;if(persist_state(),!is_navigating){const nav=create_navigation(current,void 0,null,"leave"),navigation={...nav.navigation,cancel:()=>{should_block=!0,nav.reject(new Error("navigation cancelled"))}};before_navigate_callbacks.forEach(fn=>fn(navigation))}should_block?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&persist_state()}),navigator.
connection?.saveData||setup_preload(),container.addEventListener("click",async event2=>{if(event2.button||event2.which!==1||event2.metaKey||event2.ctrlKey||event2.shiftKey||event2.altKey||event2.defaultPrevented)return;const a=find_anchor(event2.composedPath()[0],container);if(!a)return;const{url:url2,external,target:target2,download}=get_link_info(a,base,app$1.hash);if(!url2)return;if(target2==="_parent"||target2==="_top"){if(window.parent!==window)return}else if(target2&&target2!=="_self")return;
const options=get_router_options(a);if(!(a instanceof SVGAElement)&&url2.protocol!==location.protocol&&!(url2.protocol==="https:"||url2.protocol==="http:")||download)return;const[nonhash,hash2]=(app$1.hash?url2.hash.replace(/^#/,""):url2.href).split("#"),same_pathname=nonhash===strip_hash(location);if(external||options.reload&&(!same_pathname||!hash2)){_before_navigate({url:url2,type:"link",event:event2})?is_navigating=!0:event2.preventDefault();return}if(hash2!==void 0&&same_pathname){const[,current_hash]=current.
return new URL(dep,importerUrl).href},seen={},__vitePreload=function(baseModule,deps,importerUrl){let promise=Promise.resolve();if(deps&&deps.length>0){let allSettled=function(promises$2){return Promise.all(promises$2.map(p2=>Promise.resolve(p2).then(value$1=>({status:"fulfilled",value:value$1}),reason=>({status:"rejected",reason}))))};const links=document.getElementsByTagName("link"),cspNonceMeta=document.querySelector("meta[property=csp-nonce]"),cspNonce=cspNonceMeta?.nonce||cspNonceMeta?.getAttribute(
"nonce");promise=allSettled(deps.map(dep=>{if(dep=assetsURL(dep,importerUrl),dep in seen)return;seen[dep]=!0;const isCss=dep.endsWith(".css"),cssSelector=isCss?'[rel="stylesheet"]':"";if(importerUrl)for(let i$1=links.length-1;i$1>=0;i$1--){const link$12=links[i$1];if(link$12.href===dep&&(!isCss||link$12.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${dep}"]${cssSelector}`))return;const link2=document.createElement("link");if(link2.rel=isCss?"stylesheet":scriptRel,isCss||(link2.
as="script"),link2.crossOrigin="",link2.href=dep,cspNonce&&link2.setAttribute("nonce",cspNonce),document.head.appendChild(link2),isCss)return new Promise((res,rej)=>{link2.addEventListener("load",res),link2.addEventListener("error",()=>rej(new Error(`Unable to preload CSS for ${dep}`)))})}))}function handlePreloadError(err$2){const e$1=new Event("vite:preloadError",{cancelable:!0});if(e$1.payload=err$2,window.dispatchEvent(e$1),!e$1.defaultPrevented)throw err$2}return promise.then(res=>{for(const item of res||
-[])item.status==="rejected"&&handlePreloadError(item.reason);return baseModule().catch(handlePreloadError)})},matchers={},PUBLIC_VERSION="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(PUBLIC_VERSION);var root_7$w=from_html('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),root$1Z=from_html("<!> <!>",
+[])item.status==="rejected"&&handlePreloadError(item.reason);return baseModule().catch(handlePreloadError)})},matchers={},PUBLIC_VERSION="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(PUBLIC_VERSION);var root_7$w=from_html('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),root$1_=from_html("<!> <!>",
1);function Root$6($$anchor,$$props){push$1($$props,!0);let components2=prop($$props,"components",23,()=>[]),data_0=prop($$props,"data_0",3,null),data_1=prop($$props,"data_1",3,null),data_2=prop($$props,"data_2",3,null);user_pre_effect(()=>$$props.stores.page.set($$props.page)),user_effect(()=>{$$props.stores,$$props.page,$$props.constructors,components2(),$$props.form,data_0(),data_1(),data_2(),$$props.stores.page.notify()});let mounted=state$1(!1),navigated=state$1(!1),title2=state$1(null);onMount$1(
-()=>{const unsubscribe=$$props.stores.page.subscribe(()=>{get$3(mounted)&&(set$1(navigated,!0),tick().then(()=>{set$1(title2,document.title||"untitled page",!0)}))});return set$1(mounted,!0),unsubscribe});const Pyramid_2=user_derived(()=>$$props.constructors[2]);var fragment=root$1Z(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{const Pyramid_0=user_derived(()=>$$props.constructors[0]);var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>get$3(Pyramid_0),($$anchor3,Pyramid_0_1)=>{
+()=>{const unsubscribe=$$props.stores.page.subscribe(()=>{get$3(mounted)&&(set$1(navigated,!0),tick().then(()=>{set$1(title2,document.title||"untitled page",!0)}))});return set$1(mounted,!0),unsubscribe});const Pyramid_2=user_derived(()=>$$props.constructors[2]);var fragment=root$1_(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{const Pyramid_0=user_derived(()=>$$props.constructors[0]);var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>get$3(Pyramid_0),($$anchor3,Pyramid_0_1)=>{
bind_this(Pyramid_0_1($$anchor3,{get data(){return data_0()},get form(){return $$props.form},get params(){return $$props.page.params},children:($$anchor4,$$slotProps)=>{var fragment_2=comment$2(),node_2=first_child(fragment_2);{var consequent=$$anchor5=>{const Pyramid_1=user_derived(()=>$$props.constructors[1]);var fragment_3=comment$2(),node_3=first_child(fragment_3);component(node_3,()=>get$3(Pyramid_1),($$anchor6,Pyramid_1_1)=>{bind_this(Pyramid_1_1($$anchor6,{get data(){return data_1()},get form(){
return $$props.form},get params(){return $$props.page.params},children:($$anchor7,$$slotProps2)=>{var fragment_4=comment$2(),node_4=first_child(fragment_4);component(node_4,()=>get$3(Pyramid_2),($$anchor8,Pyramid_2_1)=>{bind_this(Pyramid_2_1($$anchor8,{get data(){return data_2()},get form(){return $$props.form},get params(){return $$props.page.params}}),$$value=>components2()[2]=$$value,()=>components2()?.[2])}),append($$anchor7,fragment_4)},$$slots:{default:!0}}),$$value=>components2()[1]=$$value,
()=>components2()?.[1])}),append($$anchor5,fragment_3)},alternate=$$anchor5=>{const Pyramid_1=user_derived(()=>$$props.constructors[1]);var fragment_5=comment$2(),node_5=first_child(fragment_5);component(node_5,()=>get$3(Pyramid_1),($$anchor6,Pyramid_1_2)=>{bind_this(Pyramid_1_2($$anchor6,{get data(){return data_1()},get form(){return $$props.form},get params(){return $$props.page.params}}),$$value=>components2()[1]=$$value,()=>components2()?.[1])}),append($$anchor5,fragment_5)};if_block(node_2,
$$render=>{$$props.constructors[2]?$$render(consequent):$$render(alternate,-1)})}append($$anchor4,fragment_2)},$$slots:{default:!0}}),$$value=>components2()[0]=$$value,()=>components2()?.[0])}),append($$anchor2,fragment_1)},alternate_1=$$anchor2=>{const Pyramid_0=user_derived(()=>$$props.constructors[0]);var fragment_6=comment$2(),node_6=first_child(fragment_6);component(node_6,()=>get$3(Pyramid_0),($$anchor3,Pyramid_0_2)=>{bind_this(Pyramid_0_2($$anchor3,{get data(){return data_0()},get form(){
return $$props.form},get params(){return $$props.page.params}}),$$value=>components2()[0]=$$value,()=>components2()?.[0])}),append($$anchor2,fragment_6)};if_block(node2,$$render=>{$$props.constructors[1]?$$render(consequent_1):$$render(alternate_1,-1)})}var node_7=sibling(node2,2);{var consequent_3=$$anchor2=>{var div=root_7$w(),node_8=child(div);{var consequent_2=$$anchor3=>{var text2=text$8();template_effect(()=>set_text(text2,get$3(title2))),append($$anchor3,text2)};if_block(node_8,$$render=>{
-get$3(navigated)&&$$render(consequent_2)})}reset(div),append($$anchor2,div)};if_block(node_7,$$render=>{get$3(mounted)&&$$render(consequent_3)})}append($$anchor,fragment),pop()}const root$1Y=asClassComponent(Root$6),nodes=[()=>__vitePreload(()=>Promise.resolve().then(()=>_0),void 0,import.meta.url),()=>__vitePreload(()=>Promise.resolve().then(()=>_1),void 0,import.meta.url),()=>__vitePreload(()=>Promise.resolve().then(()=>_2),void 0,import.meta.url),()=>__vitePreload(
+get$3(navigated)&&$$render(consequent_2)})}reset(div),append($$anchor2,div)};if_block(node_7,$$render=>{get$3(mounted)&&$$render(consequent_3)})}append($$anchor,fragment),pop()}const root$1Z=asClassComponent(Root$6),nodes=[()=>__vitePreload(()=>Promise.resolve().then(()=>_0),void 0,import.meta.url),()=>__vitePreload(()=>Promise.resolve().then(()=>_1),void 0,import.meta.url),()=>__vitePreload(()=>Promise.resolve().then(()=>_2),void 0,import.meta.url),()=>__vitePreload(
()=>Promise.resolve().then(()=>_3),void 0,import.meta.url),()=>__vitePreload(()=>Promise.resolve().then(()=>_4),void 0,import.meta.url),()=>__vitePreload(()=>Promise.resolve().then(()=>_5),void 0,import.meta.url),()=>__vitePreload(()=>Promise.resolve().then(()=>_6),void 0,import.meta.url),()=>__vitePreload(()=>Promise.resolve().then(()=>_7),void 0,import.meta.url)],server_loads=[],dictionary={"/(chat)":[4,[2]],"/(chat)/chat/[id]":[5,[2]],"/settin\
gs/chat/[section]":[6,[3]],"/settings/mcp":[7,[3]]},hooks={handleError:(({error:error2})=>{console.error(error2)}),reroute:(()=>{}),transport:{}},decoders=Object.fromEntries(Object.entries(hooks.transport).map(([k,v])=>[k,v.decode])),encoders=Object.fromEntries(Object.entries(hooks.transport).map(([k,v])=>[k,v.encode])),hash=!0,decode$2=(type2,value)=>decoders[type2](value),app=Object.freeze(Object.defineProperty({__proto__:null,decode:decode$2,decoders,dictionary,encoders,hash,hooks,matchers,nodes,
-root:root$1Y,server_loads},Symbol.toStringTag,{value:"Module"}));function start(element2,options){start$1(app,element2,options)}const page$2={get params(){return page$3.params},get route(){return page$3.route},get status(){return page$3.status},get url(){return page$3.url}};stores.updated.check;const page$1=page$2,linear=x=>x;function cubic_out(t){const f=t-1;return f*f*f+1}function split_css_unit(value){const split=typeof value=="string"&&value.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return split?[
+root:root$1Z,server_loads},Symbol.toStringTag,{value:"Module"}));function start(element2,options){start$1(app,element2,options)}const page$2={get params(){return page$3.params},get route(){return page$3.route},get status(){return page$3.status},get url(){return page$3.url}};stores.updated.check;const page$1=page$2,linear=x=>x;function cubic_out(t){const f=t-1;return f*f*f+1}function split_css_unit(value){const split=typeof value=="string"&&value.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return split?[
parseFloat(split[1]),split[2]||"px"]:[value,"px"]}function fade(node2,{delay=0,duration:duration2=400,easing=linear}={}){const o=+getComputedStyle(node2).opacity;return{delay,duration:duration2,easing,css:t=>`opacity: ${t*o}`}}function fly(node2,{delay=0,duration:duration2=400,easing=cubic_out,x=0,y=0,opacity=0}={}){const style2=getComputedStyle(node2),target_opacity=+style2.opacity,transform2=style2.transform==="none"?"":style2.transform,od=target_opacity*(1-opacity),[x_value,x_unit]=split_css_unit(
x),[y_value,y_unit]=split_css_unit(y);return{delay,duration:duration2,easing,css:(t,u)=>`
transform: ${transform2} translate(${(1-t)*x_value}${x_unit}, ${(1-t)*y_value}${y_unit});
extend}}),executeMerge=(classnames,config2)=>{const base2=cx(classnames);return!base2||!(config2?.twMerge??!0)?base2:((!state.cachedTwMerge||state.didTwMergeConfigChange)&&(state.didTwMergeConfigChange=!1,state.cachedTwMerge=createTwMerge(state.cachedTwMergeConfig)),state.cachedTwMerge(base2)||void 0)},cnMerge=(...classnames)=>config2=>executeMerge(classnames,config2),{tv}=getTailwindVariants(cnMerge);const buttonVariants=tv({base:"focus-visible:border-ring focus-visible:ring-ring/50 aria-invali\
d:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",variants:{variant:{default:"bg-primary text-primary-foregrou\
nd shadow-sm hover:bg-primary/90",destructive:"bg-destructive shadow-sm hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white!",outline:"shadow-sm hover:text-accent-foreground hover:bg-muted-foreground/10 backdrop-blur-sm dark:border-input border",secondary:"bg-background dark:bg-muted-foreground/15 dark:text-secondary-foreground shadow-sm text-foreground hover:bg-muted-foreground/20 dark:hover:bg-muted-foreground/25",ghost:"\
-hover:text-accent-foreground hover:bg-muted-foreground/10 backdrop-blur-sm",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4","icon-lg":"size-10",icon:"size-9","icon-sm":"size-5 rounded-sm"}},defaultVariants:{variant:"default",size:"default"}});var root_1$1b=from_html("<a><!></a>"),root_2$1D=from_html("<button><!></button>");function Button($$anchor,$$props){
-push$1($$props,!0);let variant=prop($$props,"variant",3,"default"),size2=prop($$props,"size",3,"default"),ref2=prop($$props,"ref",15,null),href=prop($$props,"href",3,void 0),type2=prop($$props,"type",3,"button"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","class","variant","size","ref","href","type","disabled","children"]);var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var a=root_1$1b();attribute_effect(a,$0=>({"data-slot":"button",class:$0,href:$$props.
-disabled?void 0:href(),"aria-disabled":$$props.disabled,role:$$props.disabled?"link":void 0,tabindex:$$props.disabled?-1:void 0,...restProps}),[()=>cn$1(buttonVariants({variant:variant(),size:size2()}),$$props.class)],void 0,void 0,"svelte-1q39rn8");var node_1=child(a);snippet(node_1,()=>$$props.children??noop$3),reset(a),bind_this(a,$$value=>ref2($$value),()=>ref2()),append($$anchor2,a)},alternate=$$anchor2=>{var button=root_2$1D();attribute_effect(button,$0=>({"data-slot":"button",class:$0,type:type2(),
+hover:text-accent-foreground hover:bg-muted-foreground/10 backdrop-blur-sm",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4","icon-lg":"size-10",icon:"size-9","icon-sm":"size-5 rounded-sm"}},defaultVariants:{variant:"default",size:"default"}});var root_1$1c=from_html("<a><!></a>"),root_2$1C=from_html("<button><!></button>");function Button($$anchor,$$props){
+push$1($$props,!0);let variant=prop($$props,"variant",3,"default"),size2=prop($$props,"size",3,"default"),ref2=prop($$props,"ref",15,null),href=prop($$props,"href",3,void 0),type2=prop($$props,"type",3,"button"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","class","variant","size","ref","href","type","disabled","children"]);var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var a=root_1$1c();attribute_effect(a,$0=>({"data-slot":"button",class:$0,href:$$props.
+disabled?void 0:href(),"aria-disabled":$$props.disabled,role:$$props.disabled?"link":void 0,tabindex:$$props.disabled?-1:void 0,...restProps}),[()=>cn$1(buttonVariants({variant:variant(),size:size2()}),$$props.class)],void 0,void 0,"svelte-1q39rn8");var node_1=child(a);snippet(node_1,()=>$$props.children??noop$3),reset(a),bind_this(a,$$value=>ref2($$value),()=>ref2()),append($$anchor2,a)},alternate=$$anchor2=>{var button=root_2$1C();attribute_effect(button,$0=>({"data-slot":"button",class:$0,type:type2(),
disabled:$$props.disabled,...restProps}),[()=>cn$1(buttonVariants({variant:variant(),size:size2()}),$$props.class)],void 0,void 0,"svelte-1q39rn8");var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3),reset(button),bind_this(button,$$value=>ref2($$value),()=>ref2()),append($$anchor2,button)};if_block(node2,$$render=>{href()?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}function isFunction$2(value){return typeof value=="function"}function isObject$2(value){
return value!==null&&typeof value=="object"}const CLASS_VALUE_PRIMITIVE_TYPES=["string","number","bigint","boolean"];function isClassValue(value){return value==null||CLASS_VALUE_PRIMITIVE_TYPES.includes(typeof value)?!0:Array.isArray(value)?value.every(item=>isClassValue(item)):typeof value=="object"?Object.getPrototypeOf(value)===Object.prototype:!1}const BoxSymbol$1=Symbol("box"),isWritableSymbol$1=Symbol("is-writable");function boxWith$1(getter,setter){const derived2=user_derived(getter);return setter?
{[BoxSymbol$1]:!0,[isWritableSymbol$1]:!0,get current(){return get$3(derived2)},set current(v){setter(v)}}:{[BoxSymbol$1]:!0,get current(){return getter()}}}function isBox$1(value){return isObject$2(value)&&BoxSymbol$1 in value}function isWritableBox$1(value){return isBox$1(value)&&isWritableSymbol$1 in value}function boxFrom$1(value){return isBox$1(value)?value:isFunction$2(value)?boxWith$1(value):simpleBox(value)}function boxFlatten$1(boxes){return Object.entries(boxes).reduce((acc,[key2,b])=>isBox$1(
pen":boolToEmptyStrOrUndef(this.root.nestedOpenCount>0),"data-nested":boolToEmptyStrOrUndef(this.root.parent!==null),...getDataTransitionAttrs(this.root.overlayPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return get$3(this.#props)}set props(value){set$1(this.#props,value)}get shouldRender(){return this.root.overlayPresence.shouldRender}}class AlertDialogCancelState{static create(opts){return new AlertDialogCancelState(opts,DialogRootContext.get())}opts;root;attachment;constructor(opts,root2){
this.opts=opts,this.root=root2,this.attachment=attachRef(this.opts.ref,v=>this.root.cancelNode=v),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===SPACE||e.key===ENTER)&&(e.preventDefault(),this.root.handleClose())}#props=user_derived(()=>({id:this.opts.id.current,[this.root.getBitsAttr("cancel")]:"",onclick:this.onclick,onkeydown:this.onkeydown,
tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return get$3(this.#props)}set props(value){set$1(this.#props,value)}}function Alert_dialog($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15,!1),onOpenChange=prop($$props,"onOpenChange",3,noop$1),onOpenChangeComplete=prop($$props,"onOpenChangeComplete",3,noop$1);DialogRootState.create({variant:boxWith$1(()=>"alert-dialog"),open:boxWith$1(()=>open2(),v=>{open2(v),onOpenChange()(v)}),onOpenChangeComplete:boxWith$1(
-()=>onOpenChangeComplete())});var fragment=comment$2(),node2=first_child(fragment);snippet(node2,()=>$$props.children??noop$3),append($$anchor,fragment),pop()}var root_2$1C=from_html("<div><!></div>");function Dialog_title$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),level=prop($$props,"level",3,2),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","ref","child","children","level"]);
-const titleState=DialogTitleState.create({id:boxWith$1(()=>id2()),level:boxWith$1(()=>level()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,titleState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1C();attribute_effect(div,
-()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_2$1B=from_html("<button><!></button>");function Alert_dialog_action$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,[
-"$$slots","$$events","$$legacy","children","child","id","ref"]);const actionState=DialogActionState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,actionState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1B();
-attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_2$1A=from_html("<button><!></button>");function Alert_dialog_cancel$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),
+()=>onOpenChangeComplete())});var fragment=comment$2(),node2=first_child(fragment);snippet(node2,()=>$$props.children??noop$3),append($$anchor,fragment),pop()}var root_2$1B=from_html("<div><!></div>");function Dialog_title$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),level=prop($$props,"level",3,2),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","ref","child","children","level"]);
+const titleState=DialogTitleState.create({id:boxWith$1(()=>id2()),level:boxWith$1(()=>level()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,titleState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1B();attribute_effect(div,
+()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_2$1A=from_html("<button><!></button>");function Alert_dialog_action$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,[
+"$$slots","$$events","$$legacy","children","child","id","ref"]);const actionState=DialogActionState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,actionState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1A();
+attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_2$1z=from_html("<button><!></button>");function Alert_dialog_cancel$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),
disabled=prop($$props,"disabled",3,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","ref","children","child","disabled"]);const cancelState=AlertDialogCancelState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),disabled:boxWith$1(()=>!!disabled())}),mergedProps=user_derived(()=>mergeProps(restProps,cancelState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);
-snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1A();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}function Portal_consumer($$anchor,$$props){var fragment=comment$2(),node2=first_child(
+snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1z();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}function Portal_consumer($$anchor,$$props){var fragment=comment$2(),node2=first_child(
fragment);key$1(node2,()=>$$props.children,$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.children??noop$3),append($$anchor2,fragment_1)}),append($$anchor,fragment)}const BitsConfigContext=new Context$1("BitsConfig");function getBitsConfig(){const fallback2=new BitsConfigState(null,{});return BitsConfigContext.getOr(fallback2).opts}class BitsConfigState{opts;constructor(parent,opts){const resolveConfigOption=createConfigResolver(parent,opts);this.
opts={defaultPortalTo:resolveConfigOption(config2=>config2.defaultPortalTo),defaultLocale:resolveConfigOption(config2=>config2.defaultLocale)}}}function createConfigResolver(parent,currentOpts){return getter=>boxWith$1(()=>{const value=getter(currentOpts)?.current;if(value!==void 0)return value;if(parent!==null)return getter(parent.opts)?.current})}function createPropResolver(configOption,fallback2){return getProp=>{const config2=getBitsConfig();return boxWith$1(()=>{const propValue=getProp();if(propValue!==
void 0)return propValue;const option2=configOption(config2).current;return option2!==void 0?option2:fallback2})}}const resolvePortalToProp=createPropResolver(config2=>config2.defaultPortalTo,"body");function Portal$2($$anchor,$$props){push$1($$props,!0);const to=resolvePortalToProp(()=>$$props.to),context=getAllContexts();let target2=user_derived(getTarget);function getTarget(){if(!isBrowser$2||$$props.disabled)return null;let localTarget=null;return typeof to.current=="string"?localTarget=document.
0&&!hasStableGutter&&(document.body.style.paddingRight=`${config2.padding}px`,document.body.style.marginRight=`${config2.margin}px`,document.body.style.setProperty("--scrollbar-width",`${verticalScrollbarWidth}px`)),document.body.style.overflow="hidden",isIOS&&(stopTouchMoveListener=on(document,"touchmove",e=>{e.target===document.documentElement&&(e.touches.length>1||e.preventDefault())},{passive:!1})),afterTick(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),
onDestroyEffect(()=>()=>{stopTouchMoveListener?.()}),{get lockMap(){return lockMap},resetBodyStyle,scheduleCleanupIfNoNewLocks,cancelPendingCleanup,ensureInitialStyleCaptured}});class BodyScrollLock{#id=useId();#initialState;#restoreScrollDelay=()=>null;#countState;locked;constructor(initialState,restoreScrollDelay=()=>null){this.#initialState=initialState,this.#restoreScrollDelay=restoreScrollDelay,this.#countState=bodyLockStackCount.get(),this.#countState&&(this.#countState.cancelPendingCleanup(),
this.#countState.ensureInitialStyleCaptured(),this.#countState.lockMap.set(this.#id,this.#initialState??!1),this.locked=boxWith$1(()=>this.#countState.lockMap.get(this.#id)??!1,v=>this.#countState.lockMap.set(this.#id,v)),onDestroyEffect(()=>{if(this.#countState.lockMap.delete(this.#id),isAnyLocked(this.#countState.lockMap))return;const restoreScrollDelay2=this.#restoreScrollDelay();this.#countState.scheduleCleanupIfNoNewLocks(restoreScrollDelay2,()=>{this.#countState.resetBodyStyle()})}))}}function isAnyLocked(map2){
-for(const[_,value]of map2)if(value)return!0;return!1}function Scroll_lock($$anchor,$$props){push$1($$props,!0);let preventScroll=prop($$props,"preventScroll",3,!0),restoreScrollDelay=prop($$props,"restoreScrollDelay",3,null);preventScroll()&&new BodyScrollLock(preventScroll(),()=>restoreScrollDelay()),pop()}var root_6$A=from_html("<!> <!>",1),root_8$A=from_html("<!> <div><!></div>",1);function Alert_dialog_content$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,
+for(const[_,value]of map2)if(value)return!0;return!1}function Scroll_lock($$anchor,$$props){push$1($$props,!0);let preventScroll=prop($$props,"preventScroll",3,!0),restoreScrollDelay=prop($$props,"restoreScrollDelay",3,null);preventScroll()&&new BodyScrollLock(preventScroll(),()=>restoreScrollDelay()),pop()}var root_6$z=from_html("<!> <!>",1),root_8$z=from_html("<!> <div><!></div>",1);function Alert_dialog_content$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,
"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),forceMount=prop($$props,"forceMount",3,!1),interactOutsideBehavior=prop($$props,"interactOutsideBehavior",3,"ignore"),onCloseAutoFocus=prop($$props,"onCloseAutoFocus",3,noop$1),onEscapeKeydown=prop($$props,"onEscapeKeydown",3,noop$1),onOpenAutoFocus=prop($$props,"onOpenAutoFocus",3,noop$1),onInteractOutside=prop($$props,"onInteractOutside",3,noop$1),preventScroll=prop($$props,"preventScroll",3,!0),trapFocus=prop($$props,"trapFocus",3,!0),
restoreScrollDelay=prop($$props,"restoreScrollDelay",3,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","interactOutsideBehavior","onCloseAutoFocus","onEscapeKeydown","onOpenAutoFocus","onInteractOutside","preventScroll","trapFocus","restoreScrollDelay"]);const contentState=DialogContentState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,contentState.props));var fragment=comment$2(),
node2=first_child(fragment);{var consequent_2=$$anchor2=>{Focus_scope($$anchor2,{get ref(){return contentState.opts.ref},loop:!0,get trapFocus(){return trapFocus()},get enabled(){return contentState.root.opts.open.current},get onCloseAutoFocus(){return onCloseAutoFocus()},onOpenAutoFocus:e=>{onOpenAutoFocus()(e),!e.defaultPrevented&&(e.preventDefault(),afterSleep(0,()=>contentState.opts.ref.current?.focus()))},focusScope:($$anchor3,$$arg0)=>{let focusScopeProps=()=>$$arg0?.().props;Escape_layer(
$$anchor3,spread_props(()=>get$3(mergedProps),{get enabled(){return contentState.root.opts.open.current},get ref(){return contentState.opts.ref},onEscapeKeydown:e=>{onEscapeKeydown()(e),!e.defaultPrevented&&contentState.root.handleClose()},children:($$anchor4,$$slotProps)=>{Dismissible_layer($$anchor4,spread_props(()=>get$3(mergedProps),{get ref(){return contentState.opts.ref},get enabled(){return contentState.root.opts.open.current},get interactOutsideBehavior(){return interactOutsideBehavior()},
-onInteractOutside:e=>{onInteractOutside()(e),!e.defaultPrevented&&contentState.root.handleClose()},children:($$anchor5,$$slotProps2)=>{Text_selection_layer($$anchor5,spread_props(()=>get$3(mergedProps),{get ref(){return contentState.opts.ref},get enabled(){return contentState.root.opts.open.current},children:($$anchor6,$$slotProps3)=>{var fragment_5=comment$2(),node_1=first_child(fragment_5);{var consequent_1=$$anchor7=>{var fragment_6=root_6$A(),node_2=first_child(fragment_6);{var consequent=$$anchor8=>{
-Scroll_lock($$anchor8,{get preventScroll(){return preventScroll()},get restoreScrollDelay(){return restoreScrollDelay()}})};if_block(node_2,$$render=>{contentState.root.opts.open.current&&$$render(consequent)})}var node_3=sibling(node_2,2);{let $0=user_derived(()=>({props:mergeProps(get$3(mergedProps),focusScopeProps()),...contentState.snippetProps}));snippet(node_3,()=>$$props.child,()=>get$3($0))}append($$anchor7,fragment_6)},alternate=$$anchor7=>{var fragment_8=root_8$A(),node_4=first_child(fragment_8);
+onInteractOutside:e=>{onInteractOutside()(e),!e.defaultPrevented&&contentState.root.handleClose()},children:($$anchor5,$$slotProps2)=>{Text_selection_layer($$anchor5,spread_props(()=>get$3(mergedProps),{get ref(){return contentState.opts.ref},get enabled(){return contentState.root.opts.open.current},children:($$anchor6,$$slotProps3)=>{var fragment_5=comment$2(),node_1=first_child(fragment_5);{var consequent_1=$$anchor7=>{var fragment_6=root_6$z(),node_2=first_child(fragment_6);{var consequent=$$anchor8=>{
+Scroll_lock($$anchor8,{get preventScroll(){return preventScroll()},get restoreScrollDelay(){return restoreScrollDelay()}})};if_block(node_2,$$render=>{contentState.root.opts.open.current&&$$render(consequent)})}var node_3=sibling(node_2,2);{let $0=user_derived(()=>({props:mergeProps(get$3(mergedProps),focusScopeProps()),...contentState.snippetProps}));snippet(node_3,()=>$$props.child,()=>get$3($0))}append($$anchor7,fragment_6)},alternate=$$anchor7=>{var fragment_8=root_8$z(),node_4=first_child(fragment_8);
Scroll_lock(node_4,{get preventScroll(){return preventScroll()}});var div=sibling(node_4,2);attribute_effect(div,$0=>({...$0}),[()=>mergeProps(get$3(mergedProps),focusScopeProps())]);var node_5=child(div);snippet(node_5,()=>$$props.children??noop$3),reset(div),append($$anchor7,fragment_8)};if_block(node_1,$$render=>{$$props.child?$$render(consequent_1):$$render(alternate,-1)})}append($$anchor6,fragment_5)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};
-if_block(node2,$$render=>{(contentState.shouldRender||forceMount())&&$$render(consequent_2)})}append($$anchor,fragment),pop()}var root_3$13=from_html("<div><!></div>");function Dialog_overlay$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),forceMount=prop($$props,"forceMount",3,!1),ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]);const overlayState=DialogOverlayState.
+if_block(node2,$$render=>{(contentState.shouldRender||forceMount())&&$$render(consequent_2)})}append($$anchor,fragment),pop()}var root_3$14=from_html("<div><!></div>");function Dialog_overlay$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),forceMount=prop($$props,"forceMount",3,!1),ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]);const overlayState=DialogOverlayState.
create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,overlayState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{var consequent=$$anchor3=>{var fragment_2=comment$2(),node_2=first_child(fragment_2);{let $0=user_derived(()=>({props:mergeProps(get$3(mergedProps)),...overlayState.snippetProps}));snippet(node_2,()=>$$props.child,()=>get$3(
-$0))}append($$anchor3,fragment_2)},alternate=$$anchor3=>{var div=root_3$13();attribute_effect(div,$0=>({...$0}),[()=>mergeProps(get$3(mergedProps))]);var node_3=child(div);snippet(node_3,()=>$$props.children??noop$3,()=>overlayState.snippetProps),reset(div),append($$anchor3,div)};if_block(node_1,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment_1)};if_block(node2,$$render=>{(overlayState.shouldRender||forceMount())&&$$render(consequent_1)})}append($$anchor,
-fragment),pop()}var root_2$1z=from_html("<div><!></div>");function Dialog_description$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","children","child","ref"]);const descriptionState=DialogDescriptionState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,descriptionState.
-props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1z();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):
+$0))}append($$anchor3,fragment_2)},alternate=$$anchor3=>{var div=root_3$14();attribute_effect(div,$0=>({...$0}),[()=>mergeProps(get$3(mergedProps))]);var node_3=child(div);snippet(node_3,()=>$$props.children??noop$3,()=>overlayState.snippetProps),reset(div),append($$anchor3,div)};if_block(node_1,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment_1)};if_block(node2,$$render=>{(overlayState.shouldRender||forceMount())&&$$render(consequent_1)})}append($$anchor,
+fragment),pop()}var root_2$1y=from_html("<div><!></div>");function Dialog_description$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","children","child","ref"]);const descriptionState=DialogDescriptionState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,descriptionState.
+props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1y();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):
$$render(alternate,-1)})}append($$anchor,fragment),pop()}const checkboxAttrs=createBitsAttrs({component:"checkbox",parts:["root","group","group-label","input"]}),CheckboxGroupContext=new Context$1("Checkbox.Group"),CheckboxRootContext=new Context$1("Checkbox.Root");class CheckboxRootState{static create(opts,group=null){return CheckboxRootContext.set(new CheckboxRootState(opts,group))}opts;group;#trueName=user_derived(()=>this.group&&this.group.opts.name.current?this.group.opts.name.current:this.
opts.name.current);get trueName(){return get$3(this.#trueName)}set trueName(value){set$1(this.#trueName,value)}#trueRequired=user_derived(()=>this.group&&this.group.opts.required.current?!0:this.opts.required.current);get trueRequired(){return get$3(this.#trueRequired)}set trueRequired(value){set$1(this.#trueRequired,value)}#trueDisabled=user_derived(()=>this.group&&this.group.opts.disabled.current?!0:this.opts.disabled.current);get trueDisabled(){return get$3(this.#trueDisabled)}set trueDisabled(value){
set$1(this.#trueDisabled,value)}#trueReadonly=user_derived(()=>this.group&&this.group.opts.readonly.current?!0:this.opts.readonly.current);get trueReadonly(){return get$3(this.#trueReadonly)}set trueReadonly(value){set$1(this.#trueReadonly,value)}attachment;constructor(opts,group){this.opts=opts,this.group=group,this.attachment=attachRef(this.opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),watch$1.pre([()=>snapshot(this.group?.opts.value.current),()=>this.
set$1(this.#snippetProps,value)}#props=user_derived(()=>({id:this.opts.id.current,role:"checkbox",type:this.opts.type.current,disabled:this.trueDisabled,"aria-checked":getAriaChecked(this.opts.checked.current,this.opts.indeterminate.current),"aria-required":boolToStr(this.trueRequired),"aria-readonly":boolToStr(this.trueReadonly),"data-disabled":boolToEmptyStrOrUndef(this.trueDisabled),"data-readonly":boolToEmptyStrOrUndef(this.trueReadonly),"data-state":getCheckboxDataState(this.opts.checked.current,
this.opts.indeterminate.current),[checkboxAttrs.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return get$3(this.#props)}set props(value){set$1(this.#props,value)}}class CheckboxInputState{static create(){return new CheckboxInputState(CheckboxRootContext.get())}root;#trueChecked=user_derived(()=>this.root.group?!!(this.root.opts.value.current!==void 0&&this.root.group.opts.value.current.includes(this.root.opts.value.current)):this.root.opts.checked.current);get trueChecked(){
return get$3(this.#trueChecked)}set trueChecked(value){set$1(this.#trueChecked,value)}#shouldRender=user_derived(()=>!!this.root.trueName);get shouldRender(){return get$3(this.#shouldRender)}set shouldRender(value){set$1(this.#shouldRender,value)}constructor(root2){this.root=root2,this.onfocus=this.onfocus.bind(this)}onfocus(_){isHTMLElement$1(this.root.opts.ref.current)&&this.root.opts.ref.current.focus()}#props=user_derived(()=>({type:"checkbox",checked:this.root.opts.checked.current===!0,disabled:this.
-root.trueDisabled,required:this.root.trueRequired,name:this.root.trueName,value:this.root.opts.value.current,readonly:this.root.trueReadonly,onfocus:this.onfocus}));get props(){return get$3(this.#props)}set props(value){set$1(this.#props,value)}}function getCheckboxDataState(checked,indeterminate){return indeterminate?"indeterminate":checked?"checked":"unchecked"}enable_legacy_mode_flag();var root_1$1a=from_html("<input/>"),root_2$1y=from_html("<input/>");function Hidden_input($$anchor,$$props){
-push$1($$props,!0);let value=prop($$props,"value",15),restProps=rest_props($$props,["$$slots","$$events","$$legacy","value"]);const mergedProps=user_derived(()=>mergeProps(restProps,{"aria-hidden":"true",tabindex:-1,style:{...srOnlyStyles$1,position:"absolute",top:"0",left:"0"}}));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var input=root_1$1a();attribute_effect(input,()=>({...get$3(mergedProps),value:value()}),void 0,void 0,void 0,void 0,!0),append($$anchor2,
-input)},alternate=$$anchor2=>{var input_1=root_2$1y();attribute_effect(input_1,()=>({...get$3(mergedProps)}),void 0,void 0,void 0,void 0,!0),bind_value(input_1,value),append($$anchor2,input_1)};if_block(node2,$$render=>{get$3(mergedProps).type==="checkbox"?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}function Checkbox_input($$anchor,$$props){push$1($$props,!1);const inputState=CheckboxInputState.create();init();var fragment=comment$2(),node2=first_child(fragment);
-{var consequent=$$anchor2=>{Hidden_input($$anchor2,spread_props(()=>inputState.props))};if_block(node2,$$render=>{inputState.shouldRender&&$$render(consequent)})}append($$anchor,fragment),pop()}var root_2$1x=from_html("<button><!></button>"),root$1X=from_html("<!> <!>",1);function Checkbox$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let checked=prop($$props,"checked",15,!1),ref2=prop($$props,"ref",15,null),disabled=prop($$props,"disabled",3,!1),required2=prop($$props,"required",
+root.trueDisabled,required:this.root.trueRequired,name:this.root.trueName,value:this.root.opts.value.current,readonly:this.root.trueReadonly,onfocus:this.onfocus}));get props(){return get$3(this.#props)}set props(value){set$1(this.#props,value)}}function getCheckboxDataState(checked,indeterminate){return indeterminate?"indeterminate":checked?"checked":"unchecked"}enable_legacy_mode_flag();var root_1$1b=from_html("<input/>"),root_2$1x=from_html("<input/>");function Hidden_input($$anchor,$$props){
+push$1($$props,!0);let value=prop($$props,"value",15),restProps=rest_props($$props,["$$slots","$$events","$$legacy","value"]);const mergedProps=user_derived(()=>mergeProps(restProps,{"aria-hidden":"true",tabindex:-1,style:{...srOnlyStyles$1,position:"absolute",top:"0",left:"0"}}));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var input=root_1$1b();attribute_effect(input,()=>({...get$3(mergedProps),value:value()}),void 0,void 0,void 0,void 0,!0),append($$anchor2,
+input)},alternate=$$anchor2=>{var input_1=root_2$1x();attribute_effect(input_1,()=>({...get$3(mergedProps)}),void 0,void 0,void 0,void 0,!0),bind_value(input_1,value),append($$anchor2,input_1)};if_block(node2,$$render=>{get$3(mergedProps).type==="checkbox"?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}function Checkbox_input($$anchor,$$props){push$1($$props,!1);const inputState=CheckboxInputState.create();init();var fragment=comment$2(),node2=first_child(fragment);
+{var consequent=$$anchor2=>{Hidden_input($$anchor2,spread_props(()=>inputState.props))};if_block(node2,$$render=>{inputState.shouldRender&&$$render(consequent)})}append($$anchor,fragment),pop()}var root_2$1w=from_html("<button><!></button>"),root$1Y=from_html("<!> <!>",1);function Checkbox$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let checked=prop($$props,"checked",15,!1),ref2=prop($$props,"ref",15,null),disabled=prop($$props,"disabled",3,!1),required2=prop($$props,"required",
3,!1),name=prop($$props,"name",3,void 0),value=prop($$props,"value",3,"on"),id2=prop($$props,"id",19,()=>createId(uid2)),indeterminate=prop($$props,"indeterminate",15,!1),type2=prop($$props,"type",3,"button"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","checked","ref","onCheckedChange","children","disabled","required","name","value","id","indeterminate","onIndeterminateChange","child","type","readonly"]);const group=CheckboxGroupContext.getOr(null);group&&value()&&(group.opts.value.
current.includes(value())?checked(!0):checked(!1)),watch$1.pre(()=>value(),()=>{group&&value()&&(group.opts.value.current.includes(value())?checked(!0):checked(!1))});const rootState=CheckboxRootState.create({checked:boxWith$1(()=>checked(),v=>{checked(v),$$props.onCheckedChange?.(v)}),disabled:boxWith$1(()=>disabled()??!1),required:boxWith$1(()=>required2()),name:boxWith$1(()=>name()),value:boxWith$1(()=>value()),id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),indeterminate:boxWith$1(
-()=>indeterminate(),v=>{indeterminate(v),$$props.onIndeterminateChange?.(v)}),type:boxWith$1(()=>type2()),readonly:boxWith$1(()=>!!$$props.readonly)},group),mergedProps=user_derived(()=>mergeProps({...restProps},rootState.props));var fragment=root$1X(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{let $0=user_derived(()=>({props:get$3(mergedProps),...rootState.snippetProps}));snippet(node_1,()=>$$props.child,()=>get$3($0))}append(
-$$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1x();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3,()=>rootState.snippetProps),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}var node_3=sibling(node2,2);Checkbox_input(node_3,{}),append($$anchor,fragment),pop()}const collapsibleAttrs=createBitsAttrs({component:"collapsible",parts:[
+()=>indeterminate(),v=>{indeterminate(v),$$props.onIndeterminateChange?.(v)}),type:boxWith$1(()=>type2()),readonly:boxWith$1(()=>!!$$props.readonly)},group),mergedProps=user_derived(()=>mergeProps({...restProps},rootState.props));var fragment=root$1Y(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{let $0=user_derived(()=>({props:get$3(mergedProps),...rootState.snippetProps}));snippet(node_1,()=>$$props.child,()=>get$3($0))}append(
+$$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1w();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3,()=>rootState.snippetProps),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}var node_3=sibling(node2,2);Checkbox_input(node_3,{}),append($$anchor,fragment),pop()}const collapsibleAttrs=createBitsAttrs({component:"collapsible",parts:[
"root","content","trigger"]}),CollapsibleRootContext=new Context$1("Collapsible.Root");class CollapsibleRootState{static create(opts){return CollapsibleRootContext.set(new CollapsibleRootState(opts))}opts;attachment;#contentNode=state$1(null);get contentNode(){return get$3(this.#contentNode)}set contentNode(value){set$1(this.#contentNode,value,!0)}contentPresence;#contentId=state$1(void 0);get contentId(){return get$3(this.#contentId)}set contentId(value){set$1(this.#contentId,value,!0)}constructor(opts){
this.opts=opts,this.toggleOpen=this.toggleOpen.bind(this),this.attachment=attachRef(this.opts.ref),this.contentPresence=new PresenceManager({ref:boxWith$1(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}})}toggleOpen(){this.opts.open.current=!this.opts.open.current}#props=user_derived(()=>({id:this.opts.id.current,"data-state":getDataOpenClosed(this.opts.open.current),"data-disabled":boolToEmptyStrOrUndef(this.opts.disabled.
current),[collapsibleAttrs.root]:"",...this.attachment}));get props(){return get$3(this.#props)}set props(value){set$1(this.#props,value)}}class CollapsibleContentState{static create(opts){return new CollapsibleContentState(opts,CollapsibleRootContext.get())}opts;root;attachment;#present=user_derived(()=>this.opts.hiddenUntilFound.current?this.root.opts.open.current:this.opts.forceMount.current||this.root.opts.open.current);get present(){return get$3(this.#present)}set present(value){set$1(this.#present,
this.root.opts.open.current),...getDataTransitionAttrs(this.root.contentPresence.transitionStatus),"data-disabled":boolToEmptyStrOrUndef(this.root.opts.disabled.current),[collapsibleAttrs.content]:"",...this.opts.hiddenUntilFound.current&&!this.shouldRender?{}:{hidden:this.opts.hiddenUntilFound.current?!this.shouldRender:this.opts.forceMount.current?void 0:!this.shouldRender},...this.attachment}));get props(){return get$3(this.#props)}set props(value){set$1(this.#props,value)}}class CollapsibleTriggerState{static create(opts){
return new CollapsibleTriggerState(opts,CollapsibleRootContext.get())}opts;root;attachment;#isDisabled=user_derived(()=>this.opts.disabled.current||this.root.opts.disabled.current);constructor(opts,root2){this.opts=opts,this.root=root2,this.attachment=attachRef(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){if(!get$3(this.#isDisabled)){if(e.button!==0)return e.preventDefault();this.root.toggleOpen()}}onkeydown(e){get$3(this.#isDisabled)||(e.
key===SPACE||e.key===ENTER)&&(e.preventDefault(),this.root.toggleOpen())}#props=user_derived(()=>({id:this.opts.id.current,type:"button",disabled:get$3(this.#isDisabled),"aria-controls":this.root.contentId,"aria-expanded":boolToStr(this.root.opts.open.current),"data-state":getDataOpenClosed(this.root.opts.open.current),"data-disabled":boolToEmptyStrOrUndef(get$3(this.#isDisabled)),[collapsibleAttrs.trigger]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return get$3(
-this.#props)}set props(value){set$1(this.#props,value)}}var root_2$1w=from_html("<div><!></div>");function Collapsible$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),open2=prop($$props,"open",15,!1),disabled=prop($$props,"disabled",3,!1),onOpenChange=prop($$props,"onOpenChange",3,noop$1),onOpenChangeComplete=prop($$props,"onOpenChangeComplete",3,noop$1),restProps=rest_props($$props,["$$slots","$$event\
+this.#props)}set props(value){set$1(this.#props,value)}}var root_2$1v=from_html("<div><!></div>");function Collapsible$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),open2=prop($$props,"open",15,!1),disabled=prop($$props,"disabled",3,!1),onOpenChange=prop($$props,"onOpenChange",3,noop$1),onOpenChangeComplete=prop($$props,"onOpenChangeComplete",3,noop$1),restProps=rest_props($$props,["$$slots","$$event\
s","$$legacy","children","child","id","ref","open","disabled","onOpenChange","onOpenChangeComplete"]);const rootState=CollapsibleRootState.create({open:boxWith$1(()=>open2(),v=>{open2(v),onOpenChange()(v)}),disabled:boxWith$1(()=>disabled()),id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),onOpenChangeComplete:boxWith$1(()=>onOpenChangeComplete())}),mergedProps=user_derived(()=>mergeProps(restProps,rootState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{
-var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1w();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_2$1v=from_html("<div><!\
+var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1v();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_2$1u=from_html("<div><!\
></div>");function Collapsible_content$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let ref2=prop($$props,"ref",15,null),forceMount=prop($$props,"forceMount",3,!1),hiddenUntilFound=prop($$props,"hiddenUntilFound",3,!1),id2=prop($$props,"id",19,()=>createId(uid2)),restProps=rest_props($$props,["$$slots","$$events","$$legacy","child","ref","forceMount","hiddenUntilFound","children","id"]);const contentState=CollapsibleContentState.create({id:boxWith$1(()=>id2()),forceMount:boxWith$1(
()=>forceMount()),hiddenUntilFound:boxWith$1(()=>hiddenUntilFound()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,contentState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{let $0=user_derived(()=>({...contentState.snippetProps,props:get$3(mergedProps)}));snippet(node_1,()=>$$props.child,()=>get$3($0))}append($$anchor2,fragment_1)},alternate=$$anchor2=>{
-var div=root_2$1v();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_2$1u=from_html("<button><!></button>");function Collapsible_trigger$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(
+var div=root_2$1u();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_2$1t=from_html("<button><!></button>");function Collapsible_trigger$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(
uid2)),disabled=prop($$props,"disabled",3,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","children","child","ref","id","disabled"]);const triggerState=CollapsibleTriggerState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),disabled:boxWith$1(()=>disabled())}),mergedProps=user_derived(()=>mergeProps(restProps,triggerState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);
-snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1u();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}const sides=["top","right","bottom","left"],min=Math.min,max=Math.max,round=Math.
+snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1t();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}const sides=["top","right","bottom","left"],min=Math.min,max=Math.max,round=Math.
round,floor=Math.floor,createCoords=v=>({x:v,y:v}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$1(start2,value,end){return max(start2,min(value,end))}function evaluate(value,param){return typeof value=="function"?value(param):value}function getSide$1(placement){return placement.split("-")[0]}function getAlignment(placement){return placement.split("-")[1]}function getOppositeAxis(axis){return axis==="x"?"y":"x"}
function getAxisLength(axis){return axis==="y"?"height":"width"}const yAxisSides=new Set(["top","bottom"]);function getSideAxis(placement){return yAxisSides.has(getSide$1(placement))?"y":"x"}function getAlignmentAxis(placement){return getOppositeAxis(getSideAxis(placement))}function getAlignmentSides(placement,rects,rtl){rtl===void 0&&(rtl=!1);const alignment=getAlignment(placement),alignmentAxis=getAlignmentAxis(placement),length=getAxisLength(alignmentAxis);let mainAlignmentSide=alignmentAxis===
"x"?alignment===(rtl?"end":"start")?"right":"left":alignment==="start"?"bottom":"top";return rects.reference[length]>rects.floating[length]&&(mainAlignmentSide=getOppositePlacement(mainAlignmentSide)),[mainAlignmentSide,getOppositePlacement(mainAlignmentSide)]}function getExpandedPlacements(placement){const oppositePlacement=getOppositePlacement(placement);return[getOppositeAlignmentPlacement(placement),oppositePlacement,getOppositeAlignmentPlacement(oppositePlacement)]}function getOppositeAlignmentPlacement(placement){
handleAutoScroll,watch$1([()=>this.root.viewportNode,()=>this.content.isPositioned],()=>{if(!(!this.root.viewportNode||!this.content.isPositioned))return this.handleScroll(!0),on(this.root.viewportNode,"scroll",()=>this.handleScroll())})}handleScroll=(manual=!1)=>{if(manual||this.scrollButtonState.handleUserScroll(),!this.root.viewportNode)return;const paddingTop=Number.parseInt(getComputedStyle(this.root.viewportNode).paddingTop,10);this.canScrollUp=this.root.viewportNode.scrollTop-paddingTop>.1};handleAutoScroll=()=>{
!this.root.viewportNode||!this.root.highlightedNode||(this.root.viewportNode.scrollTop=this.root.viewportNode.scrollTop-this.root.highlightedNode.offsetHeight)};#props=user_derived(()=>({...this.scrollButtonState.props,[this.root.getBitsAttr("scroll-up-button")]:""}));get props(){return get$3(this.#props)}set props(value){set$1(this.#props,value)}}function Select_hidden_input($$anchor,$$props){push$1($$props,!0);let value=prop($$props,"value",15);const hiddenInputState=SelectHiddenInputState.create(
{value:boxWith$1(()=>value())});var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{Hidden_input($$anchor2,spread_props(()=>hiddenInputState.props,{get autocomplete(){return $$props.autocomplete},get value(){return value()},set value($$value){value($$value)}}))};if_block(node2,$$render=>{hiddenInputState.shouldRender&&$$render(consequent)})}append($$anchor,fragment),pop()}function Floating_layer_anchor($$anchor,$$props){push$1($$props,!0);let tooltip=prop($$props,"to\
-oltip",3,!1);FloatingAnchorState.create({id:boxWith$1(()=>$$props.id),virtualEl:boxWith$1(()=>$$props.virtualEl),ref:$$props.ref},tooltip());var fragment=comment$2(),node2=first_child(fragment);snippet(node2,()=>$$props.children??noop$3),append($$anchor,fragment),pop()}var root_4$K=from_svg('<svg viewBox="0 0 30 10" preserveAspectRatio="none" data-arrow=""><polygon points="0,0 30,0 15,10" fill="currentColor"></polygon></svg>'),root_2$1t=from_html("<span><!></span>");function Arrow($$anchor,$$props){
+oltip",3,!1);FloatingAnchorState.create({id:boxWith$1(()=>$$props.id),virtualEl:boxWith$1(()=>$$props.virtualEl),ref:$$props.ref},tooltip());var fragment=comment$2(),node2=first_child(fragment);snippet(node2,()=>$$props.children??noop$3),append($$anchor,fragment),pop()}var root_4$L=from_svg('<svg viewBox="0 0 30 10" preserveAspectRatio="none" data-arrow=""><polygon points="0,0 30,0 15,10" fill="currentColor"></polygon></svg>'),root_2$1s=from_html("<span><!></span>");function Arrow($$anchor,$$props){
push$1($$props,!0);let id2=prop($$props,"id",19,useId),width=prop($$props,"width",3,10),height=prop($$props,"height",3,5),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","children","child","width","height"]);const mergedProps=user_derived(()=>mergeProps(restProps,{id:id2()}));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),
-append($$anchor2,fragment_1)},alternate_1=$$anchor2=>{var span=root_2$1t();attribute_effect(span,()=>({...get$3(mergedProps)}));var node_2=child(span);{var consequent_1=$$anchor3=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);snippet(node_3,()=>$$props.children??noop$3),append($$anchor3,fragment_2)},alternate=$$anchor3=>{var svg2=root_4$K();template_effect(()=>{set_attribute(svg2,"width",width()),set_attribute(svg2,"height",height())}),append($$anchor3,svg2)};if_block(node_2,$$render=>{
+append($$anchor2,fragment_1)},alternate_1=$$anchor2=>{var span=root_2$1s();attribute_effect(span,()=>({...get$3(mergedProps)}));var node_2=child(span);{var consequent_1=$$anchor3=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);snippet(node_3,()=>$$props.children??noop$3),append($$anchor3,fragment_2)},alternate=$$anchor3=>{var svg2=root_4$L();template_effect(()=>{set_attribute(svg2,"width",width()),set_attribute(svg2,"height",height())}),append($$anchor3,svg2)};if_block(node_2,$$render=>{
$$props.children?$$render(consequent_1):$$render(alternate,-1)})}reset(span),append($$anchor2,span)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate_1,-1)})}append($$anchor,fragment),pop()}function Floating_layer_arrow($$anchor,$$props){push$1($$props,!0);let id2=prop($$props,"id",19,useId),ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","ref"]);const arrowState=FloatingArrowState.create({id:boxWith$1(()=>id2()),
ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,arrowState.props));Arrow($$anchor,spread_props(()=>get$3(mergedProps))),pop()}function Floating_layer_content($$anchor,$$props){push$1($$props,!0);let side=prop($$props,"side",3,"bottom"),sideOffset=prop($$props,"sideOffset",3,0),align=prop($$props,"align",3,"center"),alignOffset=prop($$props,"alignOffset",3,0),arrowPadding=prop($$props,"arrowPadding",3,0),avoidCollisions=prop($$props,"avoidCollisions",3,!0),
collisionBoundary=prop($$props,"collisionBoundary",19,()=>[]),collisionPadding=prop($$props,"collisionPadding",3,0),hideWhenDetached=prop($$props,"hideWhenDetached",3,!1),onPlaced=prop($$props,"onPlaced",3,()=>{}),sticky=prop($$props,"sticky",3,"partial"),updatePositionStrategy=prop($$props,"updatePositionStrategy",3,"optimized"),strategy=prop($$props,"strategy",3,"fixed"),dir=prop($$props,"dir",3,"ltr"),style2=prop($$props,"style",19,()=>({})),wrapperId=prop($$props,"wrapperId",19,useId),customAnchor=prop(
()=>hideWhenDetached()),onPlaced:boxWith$1(()=>onPlaced()),sticky:boxWith$1(()=>sticky()),updatePositionStrategy:boxWith$1(()=>updatePositionStrategy()),strategy:boxWith$1(()=>strategy()),dir:boxWith$1(()=>dir()),style:boxWith$1(()=>style2()),enabled:boxWith$1(()=>$$props.enabled),wrapperId:boxWith$1(()=>wrapperId()),customAnchor:boxWith$1(()=>customAnchor())},tooltip()),mergedProps=user_derived(()=>mergeProps(contentState.wrapperProps,{style:{pointerEvents:"auto"}}));var fragment=comment$2(),node2=first_child(
fragment);snippet(node2,()=>$$props.content??noop$3,()=>({props:contentState.props,wrapperProps:get$3(mergedProps)})),append($$anchor,fragment),pop()}function Floating_layer_content_static($$anchor,$$props){push$1($$props,!0),onMount$1(()=>{$$props.onPlaced?.()});var fragment=comment$2(),node2=first_child(fragment);snippet(node2,()=>$$props.content??noop$3,()=>({props:{},wrapperProps:{}})),append($$anchor,fragment),pop()}function Popper_content($$anchor,$$props){let isStatic=prop($$props,"isStat\
ic",3,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{Floating_layer_content_static($$anchor2,{get content(){return $$props.content},get onPlaced(){return $$props.onPlaced}})},alternate=$$anchor2=>{Floating_layer_content($$anchor2,spread_props({get content(){return $$props.content},get onPlaced(){return $$props.onPlaced}},()=>restProps))};if_block(node2,$$render=>{
-isStatic()?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment)}var root_1$19=from_html("<!> <!>",1);function Popper_layer_inner($$anchor,$$props){push$1($$props,!0);let interactOutsideBehavior=prop($$props,"interactOutsideBehavior",3,"close"),trapFocus=prop($$props,"trapFocus",3,!0),isValidEvent2=prop($$props,"isValidEvent",3,()=>!1),customAnchor=prop($$props,"customAnchor",3,null),isStatic=prop($$props,"isStatic",3,!1),tooltip=prop($$props,"tooltip",3,!1),contentPointerEvents=prop(
+isStatic()?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment)}var root_1$1a=from_html("<!> <!>",1);function Popper_layer_inner($$anchor,$$props){push$1($$props,!0);let interactOutsideBehavior=prop($$props,"interactOutsideBehavior",3,"close"),trapFocus=prop($$props,"trapFocus",3,!0),isValidEvent2=prop($$props,"isValidEvent",3,()=>!1),customAnchor=prop($$props,"customAnchor",3,null),isStatic=prop($$props,"isStatic",3,!1),tooltip=prop($$props,"tooltip",3,!1),contentPointerEvents=prop(
$$props,"contentPointerEvents",3,"auto"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAut\
oFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);const resolvedPreventScroll=user_derived(()=>$$props.preventScroll??!0),effectiveStrategy=user_derived(()=>$$props.strategy??(get$3(resolvedPreventScroll)?"fixed":"absolute"));Popper_content($$anchor,{get isStatic(){return isStatic()},get id(){return $$props.id},get side(){return $$props.side},get sideOffset(){return $$props.sideOffset},
get align(){return $$props.align},get alignOffset(){return $$props.alignOffset},get arrowPadding(){return $$props.arrowPadding},get avoidCollisions(){return $$props.avoidCollisions},get collisionBoundary(){return $$props.collisionBoundary},get collisionPadding(){return $$props.collisionPadding},get sticky(){return $$props.sticky},get hideWhenDetached(){return $$props.hideWhenDetached},get updatePositionStrategy(){return $$props.updatePositionStrategy},get strategy(){return get$3(effectiveStrategy)},
-get dir(){return $$props.dir},get wrapperId(){return $$props.wrapperId},get style(){return $$props.style},get onPlaced(){return $$props.onPlaced},get customAnchor(){return customAnchor()},get enabled(){return $$props.enabled},get tooltip(){return tooltip()},content:($$anchor2,$$arg0)=>{let floatingProps=()=>$$arg0?.().props,wrapperProps=()=>$$arg0?.().wrapperProps;var fragment_1=root_1$19(),node2=first_child(fragment_1);{var consequent=$$anchor3=>{Scroll_lock($$anchor3,{get preventScroll(){return get$3(
+get dir(){return $$props.dir},get wrapperId(){return $$props.wrapperId},get style(){return $$props.style},get onPlaced(){return $$props.onPlaced},get customAnchor(){return customAnchor()},get enabled(){return $$props.enabled},get tooltip(){return tooltip()},content:($$anchor2,$$arg0)=>{let floatingProps=()=>$$arg0?.().props,wrapperProps=()=>$$arg0?.().wrapperProps;var fragment_1=root_1$1a(),node2=first_child(fragment_1);{var consequent=$$anchor3=>{Scroll_lock($$anchor3,{get preventScroll(){return get$3(
resolvedPreventScroll)}})},consequent_1=$$anchor3=>{Scroll_lock($$anchor3,{get preventScroll(){return get$3(resolvedPreventScroll)}})};if_block(node2,$$render=>{$$props.forceMount&&$$props.enabled?$$render(consequent):$$props.forceMount||$$render(consequent_1,1)})}var node_1=sibling(node2,2);Focus_scope(node_1,{get onOpenAutoFocus(){return $$props.onOpenAutoFocus},get onCloseAutoFocus(){return $$props.onCloseAutoFocus},get loop(){return $$props.loop},get enabled(){return $$props.enabled},get trapFocus(){
return trapFocus()},get forceMount(){return $$props.forceMount},get ref(){return $$props.ref},focusScope:($$anchor3,$$arg02)=>{let focusScopeProps=()=>$$arg02?.().props;Escape_layer($$anchor3,{get onEscapeKeydown(){return $$props.onEscapeKeydown},get escapeKeydownBehavior(){return $$props.escapeKeydownBehavior},get enabled(){return $$props.enabled},get ref(){return $$props.ref},children:($$anchor4,$$slotProps)=>{Dismissible_layer($$anchor4,{get id(){return $$props.id},get onInteractOutside(){return $$props.
onInteractOutside},get onFocusOutside(){return $$props.onFocusOutside},get interactOutsideBehavior(){return interactOutsideBehavior()},get isValidEvent(){return isValidEvent2()},get enabled(){return $$props.enabled},get ref(){return $$props.ref},children:($$anchor5,$$arg03)=>{let dismissibleProps=()=>$$arg03?.().props;Text_selection_layer($$anchor5,{get id(){return $$props.id},get preventOverflowTextSelection(){return $$props.preventOverflowTextSelection},get onPointerDown(){return $$props.onPointerDown},
get preventOverflowTextSelection(){return $$props.preventOverflowTextSelection},get id(){return $$props.id},get onPointerDown(){return $$props.onPointerDown},get onPointerUp(){return $$props.onPointerUp},get side(){return $$props.side},get sideOffset(){return $$props.sideOffset},get align(){return $$props.align},get alignOffset(){return $$props.alignOffset},get arrowPadding(){return $$props.arrowPadding},get avoidCollisions(){return $$props.avoidCollisions},get collisionBoundary(){return $$props.
collisionBoundary},get collisionPadding(){return $$props.collisionPadding},get sticky(){return $$props.sticky},get hideWhenDetached(){return $$props.hideWhenDetached},get updatePositionStrategy(){return $$props.updatePositionStrategy},get strategy(){return $$props.strategy},get dir(){return $$props.dir},get preventScroll(){return $$props.preventScroll},get wrapperId(){return $$props.wrapperId},get style(){return $$props.style},get onPlaced(){return $$props.onPlaced},get customAnchor(){return customAnchor()},
get isStatic(){return isStatic()},get enabled(){return $$props.enabled},get onInteractOutside(){return $$props.onInteractOutside},get onCloseAutoFocus(){return $$props.onCloseAutoFocus},get onOpenAutoFocus(){return $$props.onOpenAutoFocus},get interactOutsideBehavior(){return interactOutsideBehavior()},get loop(){return $$props.loop},get trapFocus(){return trapFocus()},get isValidEvent(){return isValidEvent2()},get onFocusOutside(){return $$props.onFocusOutside}},()=>restProps,{forceMount:!0}))}
-var root_4$J=from_html("<div><div><!></div></div>"),root_8$z=from_html("<div><div><!></div></div>");function Select_content$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),forceMount=prop($$props,"forceMount",3,!1),side=prop($$props,"side",3,"bottom"),onInteractOutside=prop($$props,"onInteractOutside",3,noop$1),onEscapeKeydown=prop($$props,"onEscapeKeydown",3,noop$1),preventScroll=prop($$props,"prevent\
+var root_4$K=from_html("<div><div><!></div></div>"),root_8$y=from_html("<div><div><!></div></div>");function Select_content$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),forceMount=prop($$props,"forceMount",3,!1),side=prop($$props,"side",3,"bottom"),onInteractOutside=prop($$props,"onInteractOutside",3,noop$1),onEscapeKeydown=prop($$props,"onEscapeKeydown",3,noop$1),preventScroll=prop($$props,"prevent\
Scroll",3,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","ref","forceMount","side","onInteractOutside","onEscapeKeydown","children","child","preventScroll","style"]);const contentState=SelectContentState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),onInteractOutside:boxWith$1(()=>onInteractOutside()),onEscapeKeydown:boxWith$1(()=>onEscapeKeydown())}),mergedProps=user_derived(()=>mergeProps(restProps,contentState.props));var fragment=comment$2(),node2=first_child(
fragment);{var consequent_1=$$anchor2=>{Popper_layer_force_mount($$anchor2,spread_props(()=>get$3(mergedProps),()=>contentState.popperProps,{get ref(){return contentState.opts.ref},get side(){return side()},get enabled(){return contentState.root.opts.open.current},get id(){return id2()},get preventScroll(){return preventScroll()},forceMount:!0,get shouldRender(){return contentState.shouldRender},popper:($$anchor3,$$arg0)=>{let props=()=>$$arg0?.().props,wrapperProps=()=>$$arg0?.().wrapperProps;const finalProps=user_derived(
-()=>mergeProps(props(),{style:contentState.props.style},{style:$$props.style}));var fragment_2=comment$2(),node_1=first_child(fragment_2);{var consequent=$$anchor4=>{var fragment_3=comment$2(),node_2=first_child(fragment_3);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_2,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_3)},alternate=$$anchor4=>{var div=root_4$J();attribute_effect(div,()=>({...wrapperProps()}));
+()=>mergeProps(props(),{style:contentState.props.style},{style:$$props.style}));var fragment_2=comment$2(),node_1=first_child(fragment_2);{var consequent=$$anchor4=>{var fragment_3=comment$2(),node_2=first_child(fragment_3);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_2,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_3)},alternate=$$anchor4=>{var div=root_4$K();attribute_effect(div,()=>({...wrapperProps()}));
var div_1=child(div);attribute_effect(div_1,()=>({...get$3(finalProps)}));var node_3=child(div_1);snippet(node_3,()=>$$props.children??noop$3),reset(div_1),reset(div),append($$anchor4,div)};if_block(node_1,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor3,fragment_2)},$$slots:{popper:!0}}))},consequent_3=$$anchor2=>{Popper_layer($$anchor2,spread_props(()=>get$3(mergedProps),()=>contentState.popperProps,{get ref(){return contentState.opts.ref},get side(){return side()},
get open(){return contentState.root.opts.open.current},get id(){return id2()},get preventScroll(){return preventScroll()},forceMount:!1,get shouldRender(){return contentState.shouldRender},popper:($$anchor3,$$arg0)=>{let props=()=>$$arg0?.().props,wrapperProps=()=>$$arg0?.().wrapperProps;const finalProps=user_derived(()=>mergeProps(props(),{style:contentState.props.style},{style:$$props.style}));var fragment_5=comment$2(),node_4=first_child(fragment_5);{var consequent_2=$$anchor4=>{var fragment_6=comment$2(),
-node_5=first_child(fragment_6);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_5,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_6)},alternate_1=$$anchor4=>{var div_2=root_8$z();attribute_effect(div_2,()=>({...wrapperProps()}));var div_3=child(div_2);attribute_effect(div_3,()=>({...get$3(finalProps)}));var node_6=child(div_3);snippet(node_6,()=>$$props.children??noop$3),reset(div_3),reset(div_2),append($$anchor4,
+node_5=first_child(fragment_6);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_5,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_6)},alternate_1=$$anchor4=>{var div_2=root_8$y();attribute_effect(div_2,()=>({...wrapperProps()}));var div_3=child(div_2);attribute_effect(div_3,()=>({...get$3(finalProps)}));var node_6=child(div_3);snippet(node_6,()=>$$props.children??noop$3),reset(div_3),reset(div_2),append($$anchor4,
div_2)};if_block(node_4,$$render=>{$$props.child?$$render(consequent_2):$$render(alternate_1,-1)})}append($$anchor3,fragment_5)},$$slots:{popper:!0}}))};if_block(node2,$$render=>{forceMount()?$$render(consequent_1):forceMount()||$$render(consequent_3,1)})}append($$anchor,fragment),pop()}function Mounted($$anchor,$$props){push$1($$props,!0);let mounted=prop($$props,"mounted",15,!1),onMountedChange=prop($$props,"onMountedChange",3,noop$1);onMountEffect(()=>(mounted(!0),onMountedChange()(!0),()=>{mounted(
-!1),onMountedChange()(!1)})),pop()}var root_2$1s=from_html("<div><!></div>"),root$1W=from_html("<!> <!>",1);function Select_item$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),label=prop($$props,"label",19,()=>$$props.value),disabled=prop($$props,"disabled",3,!1),onHighlight=prop($$props,"onHighlight",3,noop$1),onUnhighlight=prop($$props,"onUnhighlight",3,noop$1),restProps=rest_props($$props,["$$slots",
-"$$events","$$legacy","id","ref","value","label","disabled","children","child","onHighlight","onUnhighlight"]);const itemState=SelectItemState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),value:boxWith$1(()=>$$props.value),disabled:boxWith$1(()=>disabled()),label:boxWith$1(()=>label()),onHighlight:boxWith$1(()=>onHighlight()),onUnhighlight:boxWith$1(()=>onUnhighlight())}),mergedProps=user_derived(()=>mergeProps(restProps,itemState.props));var fragment=root$1W(),node2=first_child(
-fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{let $0=user_derived(()=>({props:get$3(mergedProps),...itemState.snippetProps}));snippet(node_1,()=>$$props.child,()=>get$3($0))}append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1s();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3,()=>itemState.snippetProps),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{
-$$props.child?$$render(consequent):$$render(alternate,-1)})}var node_3=sibling(node2,2);Mounted(node_3,{get mounted(){return itemState.mounted},set mounted($$value){itemState.mounted=$$value}}),append($$anchor,fragment),pop()}var root_2$1r=from_html("<div><!></div>");function Select_viewport($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id",
-"ref","children","child"]);const viewportState=SelectViewportState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,viewportState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1r();attribute_effect(
-div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_3$12=from_html("<div><!></div>"),root_1$18=from_html("<!> <!>",1);function Select_scroll_down_button$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,
-null),delay=prop($$props,"delay",3,()=>50),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","ref","delay","child","children"]);const scrollButtonState=SelectScrollDownButtonState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),delay:boxWith$1(()=>delay())}),mergedProps=user_derived(()=>mergeProps(restProps,scrollButtonState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{var fragment_1=root_1$18(),node_1=first_child(
-fragment_1);Mounted(node_1,{get mounted(){return scrollButtonState.scrollButtonState.mounted},set mounted($$value){scrollButtonState.scrollButtonState.mounted=$$value}});var node_2=sibling(node_1,2);{var consequent=$$anchor3=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);snippet(node_3,()=>$$props.child,()=>({props:restProps})),append($$anchor3,fragment_2)},alternate=$$anchor3=>{var div=root_3$12();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_4=child(div);snippet(node_4,
-()=>$$props.children??noop$3),reset(div),append($$anchor3,div)};if_block(node_2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment_1)};if_block(node2,$$render=>{scrollButtonState.canScrollDown&&$$render(consequent_1)})}append($$anchor,fragment),pop()}var root_3$11=from_html("<div><!></div>"),root_1$17=from_html("<!> <!>",1);function Select_scroll_up_button$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(
-uid2)),ref2=prop($$props,"ref",15,null),delay=prop($$props,"delay",3,()=>50),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","ref","delay","child","children"]);const scrollButtonState=SelectScrollUpButtonState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),delay:boxWith$1(()=>delay())}),mergedProps=user_derived(()=>mergeProps(restProps,scrollButtonState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{var fragment_1=root_1$17(),
-node_1=first_child(fragment_1);Mounted(node_1,{get mounted(){return scrollButtonState.scrollButtonState.mounted},set mounted($$value){scrollButtonState.scrollButtonState.mounted=$$value}});var node_2=sibling(node_1,2);{var consequent=$$anchor3=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);snippet(node_3,()=>$$props.child,()=>({props:restProps})),append($$anchor3,fragment_2)},alternate=$$anchor3=>{var div=root_3$11();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_4=child(
+!1),onMountedChange()(!1)})),pop()}var root_2$1r=from_html("<div><!></div>"),root$1X=from_html("<!> <!>",1);function Select_item$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),label=prop($$props,"label",19,()=>$$props.value),disabled=prop($$props,"disabled",3,!1),onHighlight=prop($$props,"onHighlight",3,noop$1),onUnhighlight=prop($$props,"onUnhighlight",3,noop$1),restProps=rest_props($$props,["$$slots",
+"$$events","$$legacy","id","ref","value","label","disabled","children","child","onHighlight","onUnhighlight"]);const itemState=SelectItemState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),value:boxWith$1(()=>$$props.value),disabled:boxWith$1(()=>disabled()),label:boxWith$1(()=>label()),onHighlight:boxWith$1(()=>onHighlight()),onUnhighlight:boxWith$1(()=>onUnhighlight())}),mergedProps=user_derived(()=>mergeProps(restProps,itemState.props));var fragment=root$1X(),node2=first_child(
+fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{let $0=user_derived(()=>({props:get$3(mergedProps),...itemState.snippetProps}));snippet(node_1,()=>$$props.child,()=>get$3($0))}append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1r();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3,()=>itemState.snippetProps),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{
+$$props.child?$$render(consequent):$$render(alternate,-1)})}var node_3=sibling(node2,2);Mounted(node_3,{get mounted(){return itemState.mounted},set mounted($$value){itemState.mounted=$$value}}),append($$anchor,fragment),pop()}var root_2$1q=from_html("<div><!></div>");function Select_viewport($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id",
+"ref","children","child"]);const viewportState=SelectViewportState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,viewportState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1q();attribute_effect(
+div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_3$13=from_html("<div><!></div>"),root_1$19=from_html("<!> <!>",1);function Select_scroll_down_button$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,
+null),delay=prop($$props,"delay",3,()=>50),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","ref","delay","child","children"]);const scrollButtonState=SelectScrollDownButtonState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),delay:boxWith$1(()=>delay())}),mergedProps=user_derived(()=>mergeProps(restProps,scrollButtonState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{var fragment_1=root_1$19(),node_1=first_child(
+fragment_1);Mounted(node_1,{get mounted(){return scrollButtonState.scrollButtonState.mounted},set mounted($$value){scrollButtonState.scrollButtonState.mounted=$$value}});var node_2=sibling(node_1,2);{var consequent=$$anchor3=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);snippet(node_3,()=>$$props.child,()=>({props:restProps})),append($$anchor3,fragment_2)},alternate=$$anchor3=>{var div=root_3$13();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_4=child(div);snippet(node_4,
+()=>$$props.children??noop$3),reset(div),append($$anchor3,div)};if_block(node_2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment_1)};if_block(node2,$$render=>{scrollButtonState.canScrollDown&&$$render(consequent_1)})}append($$anchor,fragment),pop()}var root_3$12=from_html("<div><!></div>"),root_1$18=from_html("<!> <!>",1);function Select_scroll_up_button$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(
+uid2)),ref2=prop($$props,"ref",15,null),delay=prop($$props,"delay",3,()=>50),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","ref","delay","child","children"]);const scrollButtonState=SelectScrollUpButtonState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),delay:boxWith$1(()=>delay())}),mergedProps=user_derived(()=>mergeProps(restProps,scrollButtonState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{var fragment_1=root_1$18(),
+node_1=first_child(fragment_1);Mounted(node_1,{get mounted(){return scrollButtonState.scrollButtonState.mounted},set mounted($$value){scrollButtonState.scrollButtonState.mounted=$$value}});var node_2=sibling(node_1,2);{var consequent=$$anchor3=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);snippet(node_3,()=>$$props.child,()=>({props:restProps})),append($$anchor3,fragment_2)},alternate=$$anchor3=>{var div=root_3$12();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_4=child(
div);snippet(node_4,()=>$$props.children??noop$3),reset(div),append($$anchor3,div)};if_block(node_2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment_1)};if_block(node2,$$render=>{scrollButtonState.canScrollUp&&$$render(consequent_1)})}append($$anchor,fragment),pop()}function Menu_sub($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15,!1),onOpenChange=prop($$props,"onOpenChange",3,noop$1),onOpenChangeComplete=prop($$props,"onOpenC\
-hangeComplete",3,noop$1);MenuSubmenuState.create({open:boxWith$1(()=>open2(),v=>{open2(v),onOpenChange()?.(v)}),onOpenChangeComplete:boxWith$1(()=>onOpenChangeComplete())}),Floating_layer($$anchor,{children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}}),pop()}var root_2$1q=from_html("<div><!></div>");function Menu_item($$anchor,$$props){const uid2=props_id();push$1(
+hangeComplete",3,noop$1);MenuSubmenuState.create({open:boxWith$1(()=>open2(),v=>{open2(v),onOpenChange()?.(v)}),onOpenChangeComplete:boxWith$1(()=>onOpenChangeComplete())}),Floating_layer($$anchor,{children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}}),pop()}var root_2$1p=from_html("<div><!></div>");function Menu_item($$anchor,$$props){const uid2=props_id();push$1(
$$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(uid2)),disabled=prop($$props,"disabled",3,!1),onSelect=prop($$props,"onSelect",3,noop$1),closeOnSelect=prop($$props,"closeOnSelect",3,!0),restProps=rest_props($$props,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const itemState=MenuItemState.create({id:boxWith$1(()=>id2()),disabled:boxWith$1(()=>disabled()),onSelect:boxWith$1(()=>onSelect()),ref:boxWith$1(
-()=>ref2(),v=>ref2(v)),closeOnSelect:boxWith$1(()=>closeOnSelect())}),mergedProps=user_derived(()=>mergeProps(restProps,itemState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1q();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,
-()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_2$1p=from_html("<div><!></div>");function Menu_separator($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(uid2)),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","id","child","children"]);const separatorState=MenuSeparatorState.
-create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,separatorState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1p();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(
-node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_4$I=from_html("<div><div><!></div></div>"),root_8$y=from_html("<div><div><!></div></div>");function Menu_sub_content($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),loop2=prop($$props,"loop",3,!0),onInteractOutside=prop(
+()=>ref2(),v=>ref2(v)),closeOnSelect:boxWith$1(()=>closeOnSelect())}),mergedProps=user_derived(()=>mergeProps(restProps,itemState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1p();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,
+()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_2$1o=from_html("<div><!></div>");function Menu_separator($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(uid2)),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","id","child","children"]);const separatorState=MenuSeparatorState.
+create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,separatorState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1o();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(
+node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_4$J=from_html("<div><div><!></div></div>"),root_8$x=from_html("<div><div><!></div></div>");function Menu_sub_content($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),loop2=prop($$props,"loop",3,!0),onInteractOutside=prop(
$$props,"onInteractOutside",3,noop$1),forceMount=prop($$props,"forceMount",3,!1),onEscapeKeydown=prop($$props,"onEscapeKeydown",3,noop$1),interactOutsideBehavior=prop($$props,"interactOutsideBehavior",3,"defer-otherwise-close"),escapeKeydownBehavior=prop($$props,"escapeKeydownBehavior",3,"defer-otherwise-close"),onOpenAutoFocusProp=prop($$props,"onOpenAutoFocus",3,noop$1),onCloseAutoFocusProp=prop($$props,"onCloseAutoFocus",3,noop$1),onFocusOutside=prop($$props,"onFocusOutside",3,noop$1),side=prop(
$$props,"side",3,"right"),trapFocus=prop($$props,"trapFocus",3,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","ref","children","child","loop","onInteractOutside","forceMount","onEscapeKeydown","interactOutsideBehavior","escapeKeydownBehavior","onOpenAutoFocus","onCloseAutoFocus","onFocusOutside","side","trapFocus","style"]);const subContentState=MenuContentState.create({id:boxWith$1(()=>id2()),loop:boxWith$1(()=>loop2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),isSub:!0,onCloseAutoFocus:boxWith$1(
()=>handleCloseAutoFocus)});function onkeydown(e){const isKeyDownInside=e.currentTarget.contains(e.target),isCloseKey=SUB_CLOSE_KEYS[subContentState.parentMenu.root.opts.dir.current].includes(e.key);isKeyDownInside&&isCloseKey&&(subContentState.parentMenu.onClose(),subContentState.parentMenu.triggerNode?.focus(),e.preventDefault())}const dataAttr=user_derived(()=>subContentState.parentMenu.root.getBitsAttr("sub-content")),mergedProps=user_derived(()=>mergeProps(restProps,subContentState.props,{side:side(),
onEscapeKeydown()(e),!e.defaultPrevented&&subContentState.parentMenu.onClose()}function handleOnFocusOutside(e){if(onFocusOutside()(e),e.defaultPrevented||!isHTMLElement$1(e.target)||e.target.id===subContentState.parentMenu.triggerNode?.id)return;if(subContentState.parentMenu.parentMenu?.contentNode?.contains(e.target)){subContentState.parentMenu.onClose(),e.preventDefault();return}const subContentSelector=`[${subContentState.parentMenu.root.getBitsAttr("sub-content")}]`;if(e.target.closest(subContentSelector)){
e.preventDefault();return}subContentState.parentMenu.onClose()}var fragment=comment$2(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{Popper_layer_force_mount($$anchor2,spread_props(()=>get$3(mergedProps),{get ref(){return subContentState.opts.ref},get interactOutsideBehavior(){return interactOutsideBehavior()},get escapeKeydownBehavior(){return escapeKeydownBehavior()},onOpenAutoFocus:handleOpenAutoFocus,get enabled(){return subContentState.parentMenu.opts.open.current},onInteractOutside:handleInteractOutside,
onEscapeKeydown:handleEscapeKeydown,onFocusOutside:handleOnFocusOutside,preventScroll:!1,get loop(){return loop2()},get trapFocus(){return trapFocus()},get shouldRender(){return subContentState.shouldRender},popper:($$anchor3,$$arg0)=>{let props=()=>$$arg0?.().props,wrapperProps=()=>$$arg0?.().wrapperProps;const finalProps=user_derived(()=>mergeProps(props(),get$3(mergedProps),{style:getFloatingContentCSSVars("menu")},{style:$$props.style}));var fragment_2=comment$2(),node_1=first_child(fragment_2);
-{var consequent=$$anchor4=>{var fragment_3=comment$2(),node_2=first_child(fragment_3);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...subContentState.snippetProps}));snippet(node_2,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_3)},alternate=$$anchor4=>{var div=root_4$I();attribute_effect(div,()=>({...wrapperProps()}));var div_1=child(div);attribute_effect(div_1,()=>({...get$3(finalProps)}));var node_3=child(div_1);snippet(node_3,()=>$$props.children??
+{var consequent=$$anchor4=>{var fragment_3=comment$2(),node_2=first_child(fragment_3);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...subContentState.snippetProps}));snippet(node_2,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_3)},alternate=$$anchor4=>{var div=root_4$J();attribute_effect(div,()=>({...wrapperProps()}));var div_1=child(div);attribute_effect(div_1,()=>({...get$3(finalProps)}));var node_3=child(div_1);snippet(node_3,()=>$$props.children??
noop$3),reset(div_1),reset(div),append($$anchor4,div)};if_block(node_1,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor3,fragment_2)},$$slots:{popper:!0}}))},consequent_3=$$anchor2=>{Popper_layer($$anchor2,spread_props(()=>get$3(mergedProps),{get ref(){return subContentState.opts.ref},get interactOutsideBehavior(){return interactOutsideBehavior()},get escapeKeydownBehavior(){return escapeKeydownBehavior()},onCloseAutoFocus:handleCloseAutoFocus,onOpenAutoFocus:handleOpenAutoFocus,
get open(){return subContentState.parentMenu.opts.open.current},onInteractOutside:handleInteractOutside,onEscapeKeydown:handleEscapeKeydown,onFocusOutside:handleOnFocusOutside,preventScroll:!1,get loop(){return loop2()},get trapFocus(){return trapFocus()},get shouldRender(){return subContentState.shouldRender},popper:($$anchor3,$$arg0)=>{let props=()=>$$arg0?.().props,wrapperProps=()=>$$arg0?.().wrapperProps;const finalProps=user_derived(()=>mergeProps(props(),get$3(mergedProps),{style:getFloatingContentCSSVars(
-"menu")},{style:$$props.style}));var fragment_5=comment$2(),node_4=first_child(fragment_5);{var consequent_2=$$anchor4=>{var fragment_6=comment$2(),node_5=first_child(fragment_6);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...subContentState.snippetProps}));snippet(node_5,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_6)},alternate_1=$$anchor4=>{var div_2=root_8$y();attribute_effect(div_2,()=>({...wrapperProps()}));var div_3=child(div_2);attribute_effect(
-div_3,()=>({...get$3(finalProps)}));var node_6=child(div_3);snippet(node_6,()=>$$props.children??noop$3),reset(div_3),reset(div_2),append($$anchor4,div_2)};if_block(node_4,$$render=>{$$props.child?$$render(consequent_2):$$render(alternate_1,-1)})}append($$anchor3,fragment_5)},$$slots:{popper:!0}}))};if_block(node2,$$render=>{forceMount()?$$render(consequent_1):forceMount()||$$render(consequent_3,1)})}append($$anchor,fragment),pop()}var root_3$10=from_html("<div><!></div>");function Menu_sub_trigger($$anchor,$$props){
+"menu")},{style:$$props.style}));var fragment_5=comment$2(),node_4=first_child(fragment_5);{var consequent_2=$$anchor4=>{var fragment_6=comment$2(),node_5=first_child(fragment_6);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...subContentState.snippetProps}));snippet(node_5,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_6)},alternate_1=$$anchor4=>{var div_2=root_8$x();attribute_effect(div_2,()=>({...wrapperProps()}));var div_3=child(div_2);attribute_effect(
+div_3,()=>({...get$3(finalProps)}));var node_6=child(div_3);snippet(node_6,()=>$$props.children??noop$3),reset(div_3),reset(div_2),append($$anchor4,div_2)};if_block(node_4,$$render=>{$$props.child?$$render(consequent_2):$$render(alternate_1,-1)})}append($$anchor3,fragment_5)},$$slots:{popper:!0}}))};if_block(node2,$$render=>{forceMount()?$$render(consequent_1):forceMount()||$$render(consequent_3,1)})}append($$anchor,fragment),pop()}var root_3$11=from_html("<div><!></div>");function Menu_sub_trigger($$anchor,$$props){
const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),disabled=prop($$props,"disabled",3,!1),ref2=prop($$props,"ref",15,null),onSelect=prop($$props,"onSelect",3,noop$1),openDelay=prop($$props,"openDelay",3,0),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","disabled","ref","children","child","onSelect","openDelay"]);const subTriggerState=MenuSubTriggerState.create({disabled:boxWith$1(()=>disabled()),onSelect:boxWith$1(()=>onSelect()),id:boxWith$1(
()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),openDelay:boxWith$1(()=>openDelay())}),mergedProps=user_derived(()=>mergeProps(restProps,subTriggerState.props));Floating_layer_anchor($$anchor,{get id(){return id2()},get ref(){return subTriggerState.opts.ref},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);{var consequent=$$anchor3=>{var fragment_2=comment$2(),node_1=first_child(fragment_2);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),
-append($$anchor3,fragment_2)},alternate=$$anchor3=>{var div=root_3$10();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor3,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment_1)},$$slots:{default:!0}}),pop()}function isPointInPolygon(point2,polygon){const[x,y]=point2;let isInside=!1;const length=polygon.length;for(let i=0,j=length-1;i<length;j=
+append($$anchor3,fragment_2)},alternate=$$anchor3=>{var div=root_3$11();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor3,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment_1)},$$slots:{default:!0}}),pop()}function isPointInPolygon(point2,polygon){const[x,y]=point2;let isInside=!1;const length=polygon.length;for(let i=0,j=length-1;i<length;j=
i++){const[xi,yi]=polygon[i]??[0,0],[xj,yj]=polygon[j]??[0,0];yi>=y!=yj>=y&&x<=(xj-xi)*(y-yi)/(yj-yi)+xi&&(isInside=!isInside)}return isInside}function isInsideRect(point2,rect){return point2[0]>=rect.left&&point2[0]<=rect.right&&point2[1]>=rect.top&&point2[1]<=rect.bottom}function getSide(triggerRect,contentRect){const triggerCenterX=triggerRect.left+triggerRect.width/2,triggerCenterY=triggerRect.top+triggerRect.height/2,contentCenterX=contentRect.left+contentRect.width/2,contentCenterY=contentRect.
top+contentRect.height/2,deltaX=contentCenterX-triggerCenterX,deltaY=contentCenterY-triggerCenterY;return Math.abs(deltaX)>Math.abs(deltaY)?deltaX>0?"right":"left":deltaY>0?"bottom":"top"}class SafePolygon{#opts;#buffer;#transitIntentTimeout;#exitPoint=null;#exitTarget=null;#transitTargets=[];#trackedTriggerNode=null;#leaveFallbackRafId=null;#transitIntentTimeoutId=null;#cancelLeaveFallback(){this.#leaveFallbackRafId!==null&&(cancelAnimationFrame(this.#leaveFallbackRafId),this.#leaveFallbackRafId=
null)}#scheduleLeaveFallback(){this.#cancelLeaveFallback(),this.#leaveFallbackRafId=requestAnimationFrame(()=>{this.#leaveFallbackRafId=null,!(!this.#exitPoint||!this.#exitTarget)&&(this.#clearTracking(),this.#opts.onPointerExit())})}#cancelTransitIntentTimeout(){this.#transitIntentTimeoutId!==null&&(clearTimeout(this.#transitIntentTimeoutId),this.#transitIntentTimeoutId=null)}#scheduleTransitIntentTimeout(){this.#transitIntentTimeout!==null&&(this.#cancelTransitIntentTimeout(),this.#transitIntentTimeoutId=
root.handleDelayedHoverClose()}})}onpointerdown(_){this.root.markInteraction()}onfocusin(e){const target2=e.target;isElement$1(target2)&&isTabbable(target2)&&this.root.markInteraction()}onpointerenter(e){isTouch(e)||this.root.cancelDelayedClose()}onpointerleave(e){isTouch(e)}onInteractOutside=e=>{if(this.opts.onInteractOutside.current(e),e.defaultPrevented||!isElement$1(e.target))return;const closestTrigger=e.target.closest(popoverAttrs.selector("trigger"));if(!(closestTrigger&&closestTrigger===
this.root.triggerNode)){if(this.opts.customAnchor.current){if(isElement$1(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(e.target))return}else if(typeof this.opts.customAnchor.current=="string"){const el=document.querySelector(this.opts.customAnchor.current);if(el&&el.contains(e.target))return}}this.root.handleClose()}};onEscapeKeydown=e=>{this.opts.onEscapeKeydown.current(e),!e.defaultPrevented&&this.root.handleClose()};get shouldRender(){return this.root.contentPresence.
shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}#snippetProps=user_derived(()=>({open:this.root.opts.open.current}));get snippetProps(){return get$3(this.#snippetProps)}set snippetProps(value){set$1(this.#snippetProps,value)}#props=user_derived(()=>({id:this.opts.id.current,tabindex:-1,"data-state":getDataOpenClosed(this.root.opts.open.current),...getDataTransitionAttrs(this.root.contentPresence.transitionStatus),[popoverAttrs.content]:"",
-style:{pointerEvents:"auto",contain:"layout style"},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return get$3(this.#props)}set props(value){set$1(this.#props,value)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}}var root_4$H=from_html("<div><div><!></div></div>"),root_8$x=from_html("<div><div><!></div></div>");function Popover_content$1($$anchor,$$props){
+style:{pointerEvents:"auto",contain:"layout style"},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment}));get props(){return get$3(this.#props)}set props(value){set$1(this.#props,value)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown}}var root_4$I=from_html("<div><div><!></div></div>"),root_8$w=from_html("<div><div><!></div></div>");function Popover_content$1($$anchor,$$props){
const uid2=props_id();push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(uid2)),forceMount=prop($$props,"forceMount",3,!1),onOpenAutoFocus=prop($$props,"onOpenAutoFocus",3,noop$1),onCloseAutoFocus=prop($$props,"onCloseAutoFocus",3,noop$1),onEscapeKeydown=prop($$props,"onEscapeKeydown",3,noop$1),onInteractOutside=prop($$props,"onInteractOutside",3,noop$1),trapFocus=prop($$props,"trapFocus",3,!0),preventScroll=prop($$props,"preventScroll",3,!1),customAnchor=prop(
$$props,"customAnchor",3,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","customAnchor","style"]);const contentState=PopoverContentState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),onInteractOutside:boxWith$1(()=>onInteractOutside()),onEscapeKeydown:boxWith$1(()=>onEscapeKeydown()),customAnchor:boxWith$1(()=>customAnchor())}),
mergedProps=user_derived(()=>mergeProps(restProps,contentState.props)),effectiveTrapFocus=user_derived(()=>trapFocus()&&contentState.shouldTrapFocus);function handleOpenAutoFocus(e){contentState.shouldTrapFocus||e.preventDefault(),onOpenAutoFocus()(e)}var fragment=comment$2(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{Popper_layer_force_mount($$anchor2,spread_props(()=>get$3(mergedProps),()=>contentState.popperProps,{get ref(){return contentState.opts.ref},get enabled(){return contentState.
root.opts.open.current},get id(){return id2()},get trapFocus(){return get$3(effectiveTrapFocus)},get preventScroll(){return preventScroll()},loop:!0,forceMount:!0,get customAnchor(){return customAnchor()},onOpenAutoFocus:handleOpenAutoFocus,get onCloseAutoFocus(){return onCloseAutoFocus()},get shouldRender(){return contentState.shouldRender},popper:($$anchor3,$$arg0)=>{let props=()=>$$arg0?.().props,wrapperProps=()=>$$arg0?.().wrapperProps;const finalProps=user_derived(()=>mergeProps(props(),{style:getFloatingContentCSSVars(
-"popover")},{style:$$props.style}));var fragment_2=comment$2(),node_1=first_child(fragment_2);{var consequent=$$anchor4=>{var fragment_3=comment$2(),node_2=first_child(fragment_3);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_2,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_3)},alternate=$$anchor4=>{var div=root_4$H();attribute_effect(div,()=>({...wrapperProps()}));var div_1=child(div);attribute_effect(div_1,
+"popover")},{style:$$props.style}));var fragment_2=comment$2(),node_1=first_child(fragment_2);{var consequent=$$anchor4=>{var fragment_3=comment$2(),node_2=first_child(fragment_3);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_2,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_3)},alternate=$$anchor4=>{var div=root_4$I();attribute_effect(div,()=>({...wrapperProps()}));var div_1=child(div);attribute_effect(div_1,
()=>({...get$3(finalProps)}));var node_3=child(div_1);snippet(node_3,()=>$$props.children??noop$3),reset(div_1),reset(div),append($$anchor4,div)};if_block(node_1,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor3,fragment_2)},$$slots:{popper:!0}}))},consequent_3=$$anchor2=>{Popper_layer($$anchor2,spread_props(()=>get$3(mergedProps),()=>contentState.popperProps,{get ref(){return contentState.opts.ref},get open(){return contentState.root.opts.open.current},get id(){
return id2()},get trapFocus(){return get$3(effectiveTrapFocus)},get preventScroll(){return preventScroll()},loop:!0,forceMount:!1,get customAnchor(){return customAnchor()},onOpenAutoFocus:handleOpenAutoFocus,get onCloseAutoFocus(){return onCloseAutoFocus()},get shouldRender(){return contentState.shouldRender},popper:($$anchor3,$$arg0)=>{let props=()=>$$arg0?.().props,wrapperProps=()=>$$arg0?.().wrapperProps;const finalProps=user_derived(()=>mergeProps(props(),{style:getFloatingContentCSSVars("po\
-pover")},{style:$$props.style}));var fragment_5=comment$2(),node_4=first_child(fragment_5);{var consequent_2=$$anchor4=>{var fragment_6=comment$2(),node_5=first_child(fragment_6);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_5,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_6)},alternate_1=$$anchor4=>{var div_2=root_8$x();attribute_effect(div_2,()=>({...wrapperProps()}));var div_3=child(div_2);attribute_effect(
-div_3,()=>({...get$3(finalProps)}));var node_6=child(div_3);snippet(node_6,()=>$$props.children??noop$3),reset(div_3),reset(div_2),append($$anchor4,div_2)};if_block(node_4,$$render=>{$$props.child?$$render(consequent_2):$$render(alternate_1,-1)})}append($$anchor3,fragment_5)},$$slots:{popper:!0}}))};if_block(node2,$$render=>{forceMount()?$$render(consequent_1):forceMount()||$$render(consequent_3,1)})}append($$anchor,fragment),pop()}var root_3$$=from_html("<button><!></button>");function Popover_trigger$1($$anchor,$$props){
+pover")},{style:$$props.style}));var fragment_5=comment$2(),node_4=first_child(fragment_5);{var consequent_2=$$anchor4=>{var fragment_6=comment$2(),node_5=first_child(fragment_6);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_5,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_6)},alternate_1=$$anchor4=>{var div_2=root_8$w();attribute_effect(div_2,()=>({...wrapperProps()}));var div_3=child(div_2);attribute_effect(
+div_3,()=>({...get$3(finalProps)}));var node_6=child(div_3);snippet(node_6,()=>$$props.children??noop$3),reset(div_3),reset(div_2),append($$anchor4,div_2)};if_block(node_4,$$render=>{$$props.child?$$render(consequent_2):$$render(alternate_1,-1)})}append($$anchor3,fragment_5)},$$slots:{popper:!0}}))};if_block(node2,$$render=>{forceMount()?$$render(consequent_1):forceMount()||$$render(consequent_3,1)})}append($$anchor,fragment),pop()}var root_3$10=from_html("<button><!></button>");function Popover_trigger$1($$anchor,$$props){
const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),type2=prop($$props,"type",3,"button"),disabled=prop($$props,"disabled",3,!1),openOnHover=prop($$props,"openOnHover",3,!1),openDelay=prop($$props,"openDelay",3,700),closeDelay=prop($$props,"closeDelay",3,300),restProps=rest_props($$props,["$$slots","$$events","$$legacy","children","child","id","ref","type","disabled","openOnHover","openDelay","closeDelay"]);const triggerState=PopoverTriggerState.
create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),disabled:boxWith$1(()=>!!disabled()),openOnHover:boxWith$1(()=>openOnHover()),openDelay:boxWith$1(()=>openDelay()),closeDelay:boxWith$1(()=>closeDelay())}),mergedProps=user_derived(()=>mergeProps(restProps,triggerState.props,{type:type2()}));Floating_layer_anchor($$anchor,{get id(){return id2()},get ref(){return triggerState.opts.ref},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);{var consequent=$$anchor3=>{
-var fragment_2=comment$2(),node_1=first_child(fragment_2);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor3,fragment_2)},alternate=$$anchor3=>{var button=root_3$$();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3),reset(button),append($$anchor3,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment_1)},$$slots:{default:!0}}),
+var fragment_2=comment$2(),node_1=first_child(fragment_2);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor3,fragment_2)},alternate=$$anchor3=>{var button=root_3$10();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3),reset(button),append($$anchor3,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment_1)},$$slots:{default:!0}}),
pop()}function Dialog($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15,!1),onOpenChange=prop($$props,"onOpenChange",3,noop$1),onOpenChangeComplete=prop($$props,"onOpenChangeComplete",3,noop$1);DialogRootState.create({variant:boxWith$1(()=>"dialog"),open:boxWith$1(()=>open2(),v=>{open2(v),onOpenChange()(v)}),onOpenChangeComplete:boxWith$1(()=>onOpenChangeComplete())});var fragment=comment$2(),node2=first_child(fragment);snippet(node2,()=>$$props.children??noop$3),append($$anchor,
-fragment),pop()}var root_2$1o=from_html("<button><!></button>");function Dialog_close($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),disabled=prop($$props,"disabled",3,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]);const closeState=DialogCloseState.create({variant:boxWith$1(()=>"close"),id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(
-v)),disabled:boxWith$1(()=>!!disabled())}),mergedProps=user_derived(()=>mergeProps(restProps,closeState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1o();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.
-children??noop$3),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_6$z=from_html("<!> <!>",1),root_8$w=from_html("<!> <div><!></div>",1);function Dialog_content$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),forceMount=prop($$props,"forceMount",3,!1),onCloseAutoFocus=prop($$props,"onCl\
+fragment),pop()}var root_2$1n=from_html("<button><!></button>");function Dialog_close($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),disabled=prop($$props,"disabled",3,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]);const closeState=DialogCloseState.create({variant:boxWith$1(()=>"close"),id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(
+v)),disabled:boxWith$1(()=>!!disabled())}),mergedProps=user_derived(()=>mergeProps(restProps,closeState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1n();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.
+children??noop$3),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_6$y=from_html("<!> <!>",1),root_8$v=from_html("<!> <div><!></div>",1);function Dialog_content$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),forceMount=prop($$props,"forceMount",3,!1),onCloseAutoFocus=prop($$props,"onCl\
oseAutoFocus",3,noop$1),onOpenAutoFocus=prop($$props,"onOpenAutoFocus",3,noop$1),onEscapeKeydown=prop($$props,"onEscapeKeydown",3,noop$1),onInteractOutside=prop($$props,"onInteractOutside",3,noop$1),trapFocus=prop($$props,"trapFocus",3,!0),preventScroll=prop($$props,"preventScroll",3,!0),restoreScrollDelay=prop($$props,"restoreScrollDelay",3,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","onCloseAutoFocus","onOpenAutoFocus","onEscap\
eKeydown","onInteractOutside","trapFocus","preventScroll","restoreScrollDelay"]);const contentState=DialogContentState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,contentState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent_2=$$anchor2=>{Focus_scope($$anchor2,{get ref(){return contentState.opts.ref},loop:!0,get trapFocus(){return trapFocus()},get enabled(){return contentState.root.opts.open.
current},get onOpenAutoFocus(){return onOpenAutoFocus()},get onCloseAutoFocus(){return onCloseAutoFocus()},focusScope:($$anchor3,$$arg0)=>{let focusScopeProps=()=>$$arg0?.().props;Escape_layer($$anchor3,spread_props(()=>get$3(mergedProps),{get enabled(){return contentState.root.opts.open.current},get ref(){return contentState.opts.ref},onEscapeKeydown:e=>{onEscapeKeydown()(e),!e.defaultPrevented&&contentState.root.handleClose()},children:($$anchor4,$$slotProps)=>{Dismissible_layer($$anchor4,spread_props(
()=>get$3(mergedProps),{get ref(){return contentState.opts.ref},get enabled(){return contentState.root.opts.open.current},onInteractOutside:e=>{onInteractOutside()(e),!e.defaultPrevented&&contentState.root.handleClose()},children:($$anchor5,$$slotProps2)=>{Text_selection_layer($$anchor5,spread_props(()=>get$3(mergedProps),{get ref(){return contentState.opts.ref},get enabled(){return contentState.root.opts.open.current},children:($$anchor6,$$slotProps3)=>{var fragment_5=comment$2(),node_1=first_child(
-fragment_5);{var consequent_1=$$anchor7=>{var fragment_6=root_6$z(),node_2=first_child(fragment_6);{var consequent=$$anchor8=>{Scroll_lock($$anchor8,{get preventScroll(){return preventScroll()},get restoreScrollDelay(){return restoreScrollDelay()}})};if_block(node_2,$$render=>{contentState.root.opts.open.current&&$$render(consequent)})}var node_3=sibling(node_2,2);{let $0=user_derived(()=>({props:mergeProps(get$3(mergedProps),focusScopeProps()),...contentState.snippetProps}));snippet(node_3,()=>$$props.
-child,()=>get$3($0))}append($$anchor7,fragment_6)},alternate=$$anchor7=>{var fragment_8=root_8$w(),node_4=first_child(fragment_8);Scroll_lock(node_4,{get preventScroll(){return preventScroll()}});var div=sibling(node_4,2);attribute_effect(div,$0=>({...$0}),[()=>mergeProps(get$3(mergedProps),focusScopeProps())]);var node_5=child(div);snippet(node_5,()=>$$props.children??noop$3),reset(div),append($$anchor7,fragment_8)};if_block(node_1,$$render=>{$$props.child?$$render(consequent_1):$$render(alternate,
+fragment_5);{var consequent_1=$$anchor7=>{var fragment_6=root_6$y(),node_2=first_child(fragment_6);{var consequent=$$anchor8=>{Scroll_lock($$anchor8,{get preventScroll(){return preventScroll()},get restoreScrollDelay(){return restoreScrollDelay()}})};if_block(node_2,$$render=>{contentState.root.opts.open.current&&$$render(consequent)})}var node_3=sibling(node_2,2);{let $0=user_derived(()=>({props:mergeProps(get$3(mergedProps),focusScopeProps()),...contentState.snippetProps}));snippet(node_3,()=>$$props.
+child,()=>get$3($0))}append($$anchor7,fragment_6)},alternate=$$anchor7=>{var fragment_8=root_8$v(),node_4=first_child(fragment_8);Scroll_lock(node_4,{get preventScroll(){return preventScroll()}});var div=sibling(node_4,2);attribute_effect(div,$0=>({...$0}),[()=>mergeProps(get$3(mergedProps),focusScopeProps())]);var node_5=child(div);snippet(node_5,()=>$$props.children??noop$3),reset(div),append($$anchor7,fragment_8)};if_block(node_1,$$render=>{$$props.child?$$render(consequent_1):$$render(alternate,
-1)})}append($$anchor6,fragment_5)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};if_block(node2,$$render=>{(contentState.shouldRender||forceMount())&&$$render(consequent_2)})}append($$anchor,fragment),pop()}function Menu($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15,!1),dir=prop($$props,"dir",3,"ltr"),onOpenChange=prop($$props,"onOpenChange",3,noop$1),onOpenChangeComplete=prop($$props,"onOpenChangeComplete",3,noop$1),
variant=prop($$props,"_internal_variant",3,"dropdown-menu"),shouldSkipExitAnimation=prop($$props,"_internal_should_skip_exit_animation",3,void 0);const root2=MenuRootState.create({variant:boxWith$1(()=>variant()),dir:boxWith$1(()=>dir()),onClose:()=>{open2(!1),onOpenChange()(!1)},shouldSkipExitAnimation:()=>shouldSkipExitAnimation()?.()??!1});MenuMenuState.create({open:boxWith$1(()=>open2(),v=>{open2(v),onOpenChange()(v)}),onOpenChangeComplete:boxWith$1(()=>onOpenChangeComplete())},root2),Floating_layer(
-$$anchor,{children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}}),pop()}var root_4$G=from_html("<div><div><!></div></div>"),root_8$v=from_html("<div><div><!></div></div>");function Dropdown_menu_content$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),loop2=prop($$props,"l\
+$$anchor,{children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}}),pop()}var root_4$H=from_html("<div><div><!></div></div>"),root_8$u=from_html("<div><div><!></div></div>");function Dropdown_menu_content$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),loop2=prop($$props,"l\
oop",3,!0),onInteractOutside=prop($$props,"onInteractOutside",3,noop$1),onEscapeKeydown=prop($$props,"onEscapeKeydown",3,noop$1),onCloseAutoFocus=prop($$props,"onCloseAutoFocus",3,noop$1),forceMount=prop($$props,"forceMount",3,!1),trapFocus=prop($$props,"trapFocus",3,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const contentState=MenuContentState.create(
{id:boxWith$1(()=>id2()),loop:boxWith$1(()=>loop2()),ref:boxWith$1(()=>ref2(),v=>ref2(v)),onCloseAutoFocus:boxWith$1(()=>onCloseAutoFocus())}),mergedProps=user_derived(()=>mergeProps(restProps,contentState.props));function handleInteractOutside(e){if(contentState.handleInteractOutside(e),!e.defaultPrevented&&(onInteractOutside()(e),!e.defaultPrevented)){if(e.target&&e.target instanceof Element){const subContentSelector=`[${contentState.parentMenu.root.getBitsAttr("sub-content")}]`;if(e.target.closest(
subContentSelector))return}contentState.parentMenu.onClose()}}function handleEscapeKeydown(e){onEscapeKeydown()(e),!e.defaultPrevented&&contentState.parentMenu.onClose()}var fragment=comment$2(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{Popper_layer_force_mount($$anchor2,spread_props(()=>get$3(mergedProps),()=>contentState.popperProps,{get ref(){return contentState.opts.ref},get enabled(){return contentState.parentMenu.opts.open.current},onInteractOutside:handleInteractOutside,onEscapeKeydown:handleEscapeKeydown,
get trapFocus(){return trapFocus()},get loop(){return loop2()},forceMount:!0,get id(){return id2()},get shouldRender(){return contentState.shouldRender},popper:($$anchor3,$$arg0)=>{let props=()=>$$arg0?.().props,wrapperProps=()=>$$arg0?.().wrapperProps;const finalProps=user_derived(()=>mergeProps(props(),{style:getFloatingContentCSSVars("dropdown-menu")},{style:$$props.style}));var fragment_2=comment$2(),node_1=first_child(fragment_2);{var consequent=$$anchor4=>{var fragment_3=comment$2(),node_2=first_child(
-fragment_3);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_2,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_3)},alternate=$$anchor4=>{var div=root_4$G();attribute_effect(div,()=>({...wrapperProps()}));var div_1=child(div);attribute_effect(div_1,()=>({...get$3(finalProps)}));var node_3=child(div_1);snippet(node_3,()=>$$props.children??noop$3),reset(div_1),reset(div),append($$anchor4,div)};if_block(node_1,$$render=>{
+fragment_3);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_2,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_3)},alternate=$$anchor4=>{var div=root_4$H();attribute_effect(div,()=>({...wrapperProps()}));var div_1=child(div);attribute_effect(div_1,()=>({...get$3(finalProps)}));var node_3=child(div_1);snippet(node_3,()=>$$props.children??noop$3),reset(div_1),reset(div),append($$anchor4,div)};if_block(node_1,$$render=>{
$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor3,fragment_2)},$$slots:{popper:!0}}))},consequent_3=$$anchor2=>{Popper_layer($$anchor2,spread_props(()=>get$3(mergedProps),()=>contentState.popperProps,{get ref(){return contentState.opts.ref},get open(){return contentState.parentMenu.opts.open.current},onInteractOutside:handleInteractOutside,onEscapeKeydown:handleEscapeKeydown,get trapFocus(){return trapFocus()},get loop(){return loop2()},forceMount:!1,get id(){return id2()},
get shouldRender(){return contentState.shouldRender},popper:($$anchor3,$$arg0)=>{let props=()=>$$arg0?.().props,wrapperProps=()=>$$arg0?.().wrapperProps;const finalProps=user_derived(()=>mergeProps(props(),{style:getFloatingContentCSSVars("dropdown-menu")},{style:$$props.style}));var fragment_5=comment$2(),node_4=first_child(fragment_5);{var consequent_2=$$anchor4=>{var fragment_6=comment$2(),node_5=first_child(fragment_6);{let $0=user_derived(()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),
-...contentState.snippetProps}));snippet(node_5,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_6)},alternate_1=$$anchor4=>{var div_2=root_8$v();attribute_effect(div_2,()=>({...wrapperProps()}));var div_3=child(div_2);attribute_effect(div_3,()=>({...get$3(finalProps)}));var node_6=child(div_3);snippet(node_6,()=>$$props.children??noop$3),reset(div_3),reset(div_2),append($$anchor4,div_2)};if_block(node_4,$$render=>{$$props.child?$$render(consequent_2):$$render(alternate_1,-1)})}append($$anchor3,
-fragment_5)},$$slots:{popper:!0}}))};if_block(node2,$$render=>{forceMount()?$$render(consequent_1):forceMount()||$$render(consequent_3,1)})}append($$anchor,fragment),pop()}var root_3$_=from_html("<button><!></button>");function Menu_trigger($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),disabled=prop($$props,"disabled",3,!1),type2=prop($$props,"type",3,"button"),restProps=rest_props($$props,["$$slots","\
+...contentState.snippetProps}));snippet(node_5,()=>$$props.child,()=>get$3($0))}append($$anchor4,fragment_6)},alternate_1=$$anchor4=>{var div_2=root_8$u();attribute_effect(div_2,()=>({...wrapperProps()}));var div_3=child(div_2);attribute_effect(div_3,()=>({...get$3(finalProps)}));var node_6=child(div_3);snippet(node_6,()=>$$props.children??noop$3),reset(div_3),reset(div_2),append($$anchor4,div_2)};if_block(node_4,$$render=>{$$props.child?$$render(consequent_2):$$render(alternate_1,-1)})}append($$anchor3,
+fragment_5)},$$slots:{popper:!0}}))};if_block(node2,$$render=>{forceMount()?$$render(consequent_1):forceMount()||$$render(consequent_3,1)})}append($$anchor,fragment),pop()}var root_3$$=from_html("<button><!></button>");function Menu_trigger($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),disabled=prop($$props,"disabled",3,!1),type2=prop($$props,"type",3,"button"),restProps=rest_props($$props,["$$slots","\
$$events","$$legacy","id","ref","child","children","disabled","type"]);const triggerState=DropdownMenuTriggerState.create({id:boxWith$1(()=>id2()),disabled:boxWith$1(()=>disabled()??!1),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,triggerState.props,{type:type2()}));Floating_layer_anchor($$anchor,{get id(){return id2()},get ref(){return triggerState.opts.ref},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);{var consequent=$$anchor3=>{
-var fragment_2=comment$2(),node_1=first_child(fragment_2);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor3,fragment_2)},alternate=$$anchor3=>{var button=root_3$_();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3),reset(button),append($$anchor3,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment_1)},$$slots:{default:!0}}),
+var fragment_2=comment$2(),node_1=first_child(fragment_2);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor3,fragment_2)},alternate=$$anchor3=>{var button=root_3$$();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3),reset(button),append($$anchor3,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment_1)},$$slots:{default:!0}}),
pop()}const labelAttrs=createBitsAttrs({component:"label",parts:["root"]});class LabelRootState{static create(opts){return new LabelRootState(opts)}opts;attachment;constructor(opts){this.opts=opts,this.attachment=attachRef(this.opts.ref),this.onmousedown=this.onmousedown.bind(this)}onmousedown(e){e.detail>1&&e.preventDefault()}#props=user_derived(()=>({id:this.opts.id.current,[labelAttrs.root]:"",onmousedown:this.onmousedown,...this.attachment}));get props(){return get$3(this.#props)}set props(value){
-set$1(this.#props,value)}}var root_2$1n=from_html("<label><!></label>");function Label$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","children","child","id","ref","for"]);const rootState=LabelRootState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,rootState.props,{for:$$props.
-for}));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var label=root_2$1n();attribute_effect(label,()=>({...get$3(mergedProps),for:$$props.for}));var node_2=child(label);snippet(node_2,()=>$$props.children??noop$3),reset(label),append($$anchor2,label)};if_block(node2,$$render=>{$$props.child?
+set$1(this.#props,value)}}var root_2$1m=from_html("<label><!></label>");function Label$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","children","child","id","ref","for"]);const rootState=LabelRootState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,rootState.props,{for:$$props.
+for}));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var label=root_2$1m();attribute_effect(label,()=>({...get$3(mergedProps),for:$$props.for}));var node_2=child(label);snippet(node_2,()=>$$props.children??noop$3),reset(label),append($$anchor2,label)};if_block(node2,$$render=>{$$props.child?
$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}class SvelteResizeObserver{#node;#onResize;constructor(node2,onResize){this.#node=node2,this.#onResize=onResize,this.handler=this.handler.bind(this),user_effect(this.handler)}handler(){let rAF=0;const _node=this.#node();if(!_node)return;const resizeObserver=new ResizeObserver(()=>{cancelAnimationFrame(rAF),rAF=window.requestAnimationFrame(this.#onResize)});return resizeObserver.observe(_node),()=>{window.cancelAnimationFrame(
rAF),resizeObserver.unobserve(_node)}}}class Presence{opts;present;#afterAnimations;#isPresent=state$1(!1);#hasMounted=!1;#transitionStatus=state$1(void 0);#transitionFrame=null;constructor(opts){this.opts=opts,this.present=this.opts.open,set$1(this.#isPresent,opts.open.current,!0),this.#afterAnimations=new AnimationsComplete({ref:this.opts.ref,afterTick:this.opts.open}),onDestroyEffect(()=>this.#clearTransitionFrame()),watch$1(()=>this.present.current,isOpen=>{if(!this.#hasMounted){this.#hasMounted=
!0;return}this.#clearTransitionFrame(),isOpen&&set$1(this.#isPresent,!0),set$1(this.#transitionStatus,isOpen?"starting":"ending",!0),isOpen&&(this.#transitionFrame=window.requestAnimationFrame(()=>{this.#transitionFrame=null,this.present.current&&set$1(this.#transitionStatus,void 0)})),this.#afterAnimations.run(()=>{isOpen===this.present.current&&(isOpen||set$1(this.#isPresent,!1),set$1(this.#transitionStatus,void 0))})})}#_isPresent=user_derived(()=>get$3(this.#isPresent));get isPresent(){return get$3(
sizes,dir="ltr"}){const thumbSizePx=getThumbSize(sizes),thumbCenter=thumbSizePx/2,offset2=pointerOffset||thumbCenter,thumbOffsetFromEnd=thumbSizePx-offset2,minPointerPos=sizes.scrollbar.paddingStart+offset2,maxPointerPos=sizes.scrollbar.size-sizes.scrollbar.paddingEnd-thumbOffsetFromEnd,maxScrollPos=sizes.content-sizes.viewport,scrollRange=dir==="ltr"?[0,maxScrollPos]:[maxScrollPos*-1,0];return linearScale([minPointerPos,maxPointerPos],scrollRange)(pointerPos)}function getThumbOffsetFromScroll({
scrollPos,sizes,dir="ltr"}){const thumbSizePx=getThumbSize(sizes),scrollbarPadding=sizes.scrollbar.paddingStart+sizes.scrollbar.paddingEnd,scrollbar=sizes.scrollbar.size-scrollbarPadding,maxScrollPos=sizes.content-sizes.viewport,maxThumbPos=scrollbar-thumbSizePx,scrollClampRange=dir==="ltr"?[0,maxScrollPos]:[maxScrollPos*-1,0],scrollWithoutMomentum=clamp(scrollPos,scrollClampRange[0],scrollClampRange[1]);return linearScale([0,maxScrollPos],[0,maxThumbPos])(scrollWithoutMomentum)}function linearScale(input,output){
return value=>{if(input[0]===input[1]||output[0]===output[1])return output[0];const ratio=(output[1]-output[0])/(input[1]-input[0]);return output[0]+ratio*(value-input[0])}}function isScrollingWithinScrollbarBounds(scrollPos,maxScrollPos){return scrollPos>0&&scrollPos<maxScrollPos}function addUnlinkedScrollListener(node2,handler){let prevPosition={left:node2.scrollLeft,top:node2.scrollTop},rAF=0;const win=getWindow$1(node2);return(function loop2(){const position2={left:node2.scrollLeft,top:node2.
-scrollTop},isHorizontalScroll=prevPosition.left!==position2.left,isVerticalScroll=prevPosition.top!==position2.top;(isHorizontalScroll||isVerticalScroll)&&handler(),prevPosition=position2,rAF=win.requestAnimationFrame(loop2)})(),()=>win.cancelAnimationFrame(rAF)}var root_2$1m=from_html("<div><!></div>");function Scroll_area$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(uid2)),type2=prop($$props,"type",3,"ho\
+scrollTop},isHorizontalScroll=prevPosition.left!==position2.left,isVerticalScroll=prevPosition.top!==position2.top;(isHorizontalScroll||isVerticalScroll)&&handler(),prevPosition=position2,rAF=win.requestAnimationFrame(loop2)})(),()=>win.cancelAnimationFrame(rAF)}var root_2$1l=from_html("<div><!></div>");function Scroll_area$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(uid2)),type2=prop($$props,"type",3,"ho\
ver"),dir=prop($$props,"dir",3,"ltr"),scrollHideDelay=prop($$props,"scrollHideDelay",3,600),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","id","type","dir","scrollHideDelay","children","child"]);const rootState=ScrollAreaRootState.create({type:boxWith$1(()=>type2()),dir:boxWith$1(()=>dir()),scrollHideDelay:boxWith$1(()=>scrollHideDelay()),id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,rootState.props));var fragment=comment$2(),
-node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1m();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,
-fragment),pop()}var root$1V=from_html("<div><div><!></div></div>");function Scroll_area_viewport($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(uid2)),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","id","children"]);const viewportState=ScrollAreaViewportState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,viewportState.
-props)),mergedContentProps=user_derived(()=>mergeProps({},viewportState.contentProps));var div=root$1V();attribute_effect(div,()=>({...get$3(mergedProps)}));var div_1=child(div);attribute_effect(div_1,()=>({...get$3(mergedContentProps)}));var node2=child(div_1);snippet(node2,()=>$$props.children??noop$3),reset(div_1),reset(div),append($$anchor,div),pop()}var root_2$1l=from_html("<div><!></div>");function Scroll_area_scrollbar_shared($$anchor,$$props){push$1($$props,!0);let restProps=rest_props($$props,
-["$$slots","$$events","$$legacy","child","children"]);const scrollbarSharedState=ScrollAreaScrollbarSharedState.create(),mergedProps=user_derived(()=>mergeProps(restProps,scrollbarSharedState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1l();attribute_effect(div,()=>({
+node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1l();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,
+fragment),pop()}var root$1W=from_html("<div><div><!></div></div>");function Scroll_area_viewport($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(uid2)),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","id","children"]);const viewportState=ScrollAreaViewportState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,viewportState.
+props)),mergedContentProps=user_derived(()=>mergeProps({},viewportState.contentProps));var div=root$1W();attribute_effect(div,()=>({...get$3(mergedProps)}));var div_1=child(div);attribute_effect(div_1,()=>({...get$3(mergedContentProps)}));var node2=child(div_1);snippet(node2,()=>$$props.children??noop$3),reset(div_1),reset(div),append($$anchor,div),pop()}var root_2$1k=from_html("<div><!></div>");function Scroll_area_scrollbar_shared($$anchor,$$props){push$1($$props,!0);let restProps=rest_props($$props,
+["$$slots","$$events","$$legacy","child","children"]);const scrollbarSharedState=ScrollAreaScrollbarSharedState.create(),mergedProps=user_derived(()=>mergeProps(restProps,scrollbarSharedState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1k();attribute_effect(div,()=>({
...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}function Scroll_area_scrollbar_x($$anchor,$$props){push$1($$props,!0);let restProps=rest_props($$props,["$$slots","$$events","$$legacy"]);const isMounted=new IsMounted,scrollbarXState=ScrollAreaScrollbarXState.create({mounted:boxWith$1(()=>isMounted.current)}),
mergedProps=user_derived(()=>mergeProps(restProps,scrollbarXState.props));Scroll_area_scrollbar_shared($$anchor,spread_props(()=>get$3(mergedProps))),pop()}function Scroll_area_scrollbar_y($$anchor,$$props){push$1($$props,!0);let restProps=rest_props($$props,["$$slots","$$events","$$legacy"]);const isMounted=new IsMounted,scrollbarYState=ScrollAreaScrollbarYState.create({mounted:boxWith$1(()=>isMounted.current)}),mergedProps=user_derived(()=>mergeProps(restProps,scrollbarYState.props));Scroll_area_scrollbar_shared(
$$anchor,spread_props(()=>get$3(mergedProps))),pop()}function Scroll_area_scrollbar_visible($$anchor,$$props){push$1($$props,!0);let restProps=rest_props($$props,["$$slots","$$events","$$legacy"]);const scrollbarVisibleState=ScrollAreaScrollbarVisibleState.create();var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{Scroll_area_scrollbar_x($$anchor2,spread_props(()=>restProps))},alternate=$$anchor2=>{Scroll_area_scrollbar_y($$anchor2,spread_props(()=>restProps))};if_block(
ible":"hidden"})),open2=user_derived(()=>forceMount()||scrollbarHoverState.isVisible&&scrollbarAutoState.isVisible);Presence_layer($$anchor,{get open(){return get$3(open2)},get ref(){return scrollbarAutoState.scrollbar.opts.ref},presence:$$anchor2=>{Scroll_area_scrollbar_visible($$anchor2,spread_props(()=>get$3(mergedProps)))},$$slots:{presence:!0}}),pop()}function Scroll_area_scrollbar$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,
"id",19,()=>createId(uid2)),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","id","orientation"]);const scrollbarState=ScrollAreaScrollbarState.create({orientation:boxWith$1(()=>$$props.orientation),id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),type2=user_derived(()=>scrollbarState.root.opts.type.current);var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{Scroll_area_scrollbar_hover($$anchor2,spread_props(()=>restProps,{get id(){return id2()}}))},
consequent_1=$$anchor2=>{Scroll_area_scrollbar_scroll($$anchor2,spread_props(()=>restProps,{get id(){return id2()}}))},consequent_2=$$anchor2=>{Scroll_area_scrollbar_auto($$anchor2,spread_props(()=>restProps,{get id(){return id2()}}))},consequent_3=$$anchor2=>{Scroll_area_scrollbar_visible($$anchor2,spread_props(()=>restProps,{get id(){return id2()}}))};if_block(node2,$$render=>{get$3(type2)==="hover"?$$render(consequent):get$3(type2)==="scroll"?$$render(consequent_1,1):get$3(type2)==="auto"?$$render(
-consequent_2,2):get$3(type2)==="always"&&$$render(consequent_3,3)})}append($$anchor,fragment),pop()}var root_2$1k=from_html("<div><!></div>");function Scroll_area_thumb_impl($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","id","child","children","present"]);const isMounted=new IsMounted,thumbState=ScrollAreaThumbImplState.create({id:boxWith$1(()=>$$props.id),ref:boxWith$1(()=>ref2(),v=>ref2(v)),mounted:boxWith$1(
-()=>isMounted.current)}),mergedProps=user_derived(()=>mergeProps(restProps,thumbState.props,{style:{hidden:!$$props.present}}));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1k();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.
+consequent_2,2):get$3(type2)==="always"&&$$render(consequent_3,3)})}append($$anchor,fragment),pop()}var root_2$1j=from_html("<div><!></div>");function Scroll_area_thumb_impl($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","id","child","children","present"]);const isMounted=new IsMounted,thumbState=ScrollAreaThumbImplState.create({id:boxWith$1(()=>$$props.id),ref:boxWith$1(()=>ref2(),v=>ref2(v)),mounted:boxWith$1(
+()=>isMounted.current)}),mergedProps=user_derived(()=>mergeProps(restProps,thumbState.props,{style:{hidden:!$$props.present}}));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1j();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.
children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}function Scroll_area_thumb($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),forceMount=prop($$props,"forceMount",3,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","ref","forceMount"]);const scrollbarState=ScrollAreaScrollbarVisibleContext.
-get();{const presence=($$anchor2,$$arg0)=>{let present=()=>$$arg0?.().present;Scroll_area_thumb_impl($$anchor2,spread_props(()=>restProps,{get id(){return id2()},get present(){return present()},get ref(){return ref2()},set ref($$value){ref2($$value)}}))};let $0=user_derived(()=>forceMount()||scrollbarState.hasThumb);Presence_layer($$anchor,{get open(){return get$3($0)},get ref(){return scrollbarState.scrollbar.opts.ref},presence,$$slots:{presence:!0}})}pop()}var root_2$1j=from_html("<div><!></di\
+get();{const presence=($$anchor2,$$arg0)=>{let present=()=>$$arg0?.().present;Scroll_area_thumb_impl($$anchor2,spread_props(()=>restProps,{get id(){return id2()},get present(){return present()},get ref(){return ref2()},set ref($$value){ref2($$value)}}))};let $0=user_derived(()=>forceMount()||scrollbarState.hasThumb);Presence_layer($$anchor,{get open(){return get$3($0)},get ref(){return scrollbarState.scrollbar.opts.ref},presence,$$slots:{presence:!0}})}pop()}var root_2$1i=from_html("<div><!></di\
v>");function Scroll_area_corner_impl($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","id","children","child"]);const cornerState=ScrollAreaCornerImplState.create({id:boxWith$1(()=>$$props.id),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,cornerState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),
-node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1j();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}function Scroll_area_corner($$anchor,$$props){const uid2=props_id();
+node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var div=root_2$1i();attribute_effect(div,()=>({...get$3(mergedProps)}));var node_2=child(div);snippet(node_2,()=>$$props.children??noop$3),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}function Scroll_area_corner($$anchor,$$props){const uid2=props_id();
push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(uid2)),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","id"]);const scrollAreaState=ScrollAreaRootContext.get(),hasBothScrollbarsVisible=user_derived(()=>!!(scrollAreaState.scrollbarXNode&&scrollAreaState.scrollbarYNode)),hasCorner=user_derived(()=>scrollAreaState.opts.type.current!=="scroll"&&get$3(hasBothScrollbarsVisible));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{
-Scroll_area_corner_impl($$anchor2,spread_props(()=>restProps,{get id(){return id2()},get ref(){return ref2()},set ref($$value){ref2($$value)}}))};if_block(node2,$$render=>{get$3(hasCorner)&&$$render(consequent)})}append($$anchor,fragment),pop()}var root$1U=from_html("<!> <!>",1);function Select($$anchor,$$props){push$1($$props,!0);let value=prop($$props,"value",15),onValueChange=prop($$props,"onValueChange",3,noop$1),name=prop($$props,"name",3,""),disabled=prop($$props,"disabled",3,!1),open2=prop(
+Scroll_area_corner_impl($$anchor2,spread_props(()=>restProps,{get id(){return id2()},get ref(){return ref2()},set ref($$value){ref2($$value)}}))};if_block(node2,$$render=>{get$3(hasCorner)&&$$render(consequent)})}append($$anchor,fragment),pop()}var root$1V=from_html("<!> <!>",1);function Select($$anchor,$$props){push$1($$props,!0);let value=prop($$props,"value",15),onValueChange=prop($$props,"onValueChange",3,noop$1),name=prop($$props,"name",3,""),disabled=prop($$props,"disabled",3,!1),open2=prop(
$$props,"open",15,!1),onOpenChange=prop($$props,"onOpenChange",3,noop$1),onOpenChangeComplete=prop($$props,"onOpenChangeComplete",3,noop$1),loop2=prop($$props,"loop",3,!1),scrollAlignment=prop($$props,"scrollAlignment",3,"nearest"),required2=prop($$props,"required",3,!1),items2=prop($$props,"items",19,()=>[]),allowDeselect=prop($$props,"allowDeselect",3,!1);function handleDefaultValue(){value()===void 0&&value($$props.type==="single"?"":[])}handleDefaultValue(),watch$1.pre(()=>value(),()=>{handleDefaultValue()});
let inputValue=state$1("");const rootState=SelectRootState.create({type:$$props.type,value:boxWith$1(()=>value(),v=>{value(v),onValueChange()(v)}),disabled:boxWith$1(()=>disabled()),required:boxWith$1(()=>required2()),open:boxWith$1(()=>open2(),v=>{open2(v),onOpenChange()(v)}),loop:boxWith$1(()=>loop2()),scrollAlignment:boxWith$1(()=>scrollAlignment()),name:boxWith$1(()=>name()),isCombobox:!1,items:boxWith$1(()=>items2()),allowDeselect:boxWith$1(()=>allowDeselect()),inputValue:boxWith$1(()=>get$3(
-inputValue),v=>set$1(inputValue,v,!0)),onOpenChangeComplete:boxWith$1(()=>onOpenChangeComplete())});var fragment=root$1U(),node2=first_child(fragment);Floating_layer(node2,{children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}});var node_2=sibling(node2,2);{var consequent_1=$$anchor2=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);{var consequent=$$anchor3=>{
+inputValue),v=>set$1(inputValue,v,!0)),onOpenChangeComplete:boxWith$1(()=>onOpenChangeComplete())});var fragment=root$1V(),node2=first_child(fragment);Floating_layer(node2,{children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}});var node_2=sibling(node2,2);{var consequent_1=$$anchor2=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);{var consequent=$$anchor3=>{
Select_hidden_input($$anchor3,{get autocomplete(){return $$props.autocomplete}})},alternate=$$anchor3=>{var fragment_4=comment$2(),node_4=first_child(fragment_4);each(node_4,16,()=>rootState.opts.value.current,item=>item,($$anchor4,item)=>{Select_hidden_input($$anchor4,{get value(){return item},get autocomplete(){return $$props.autocomplete}})}),append($$anchor3,fragment_4)};if_block(node_3,$$render=>{rootState.opts.value.current.length===0?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,
-fragment_2)},d2=user_derived(()=>Array.isArray(rootState.opts.value.current)),alternate_1=$$anchor2=>{Select_hidden_input($$anchor2,{get autocomplete(){return $$props.autocomplete},get value(){return rootState.opts.value.current},set value($$value){rootState.opts.value.current=$$value}})};if_block(node_2,$$render=>{get$3(d2)?$$render(consequent_1):$$render(alternate_1,-1)})}append($$anchor,fragment),pop()}var root_3$Z=from_html("<button><!></button>");function Select_trigger$1($$anchor,$$props){
+fragment_2)},d2=user_derived(()=>Array.isArray(rootState.opts.value.current)),alternate_1=$$anchor2=>{Select_hidden_input($$anchor2,{get autocomplete(){return $$props.autocomplete},get value(){return rootState.opts.value.current},set value($$value){rootState.opts.value.current=$$value}})};if_block(node_2,$$render=>{get$3(d2)?$$render(consequent_1):$$render(alternate_1,-1)})}append($$anchor,fragment),pop()}var root_3$_=from_html("<button><!></button>");function Select_trigger$1($$anchor,$$props){
const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),type2=prop($$props,"type",3,"button"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","id","ref","child","children","type"]);const triggerState=SelectTriggerState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,triggerState.props,{type:type2()}));var fragment=comment$2(),node2=first_child(
-fragment);component(node2,()=>Floating_layer_anchor,($$anchor2,FloatingLayer_Anchor)=>{FloatingLayer_Anchor($$anchor2,{get id(){return id2()},get ref(){return triggerState.opts.ref},children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{var consequent=$$anchor4=>{var fragment_2=comment$2(),node_2=first_child(fragment_2);snippet(node_2,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor4,fragment_2)},alternate=$$anchor4=>{var button=root_3$Z();
+fragment);component(node2,()=>Floating_layer_anchor,($$anchor2,FloatingLayer_Anchor)=>{FloatingLayer_Anchor($$anchor2,{get id(){return id2()},get ref(){return triggerState.opts.ref},children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{var consequent=$$anchor4=>{var fragment_2=comment$2(),node_2=first_child(fragment_2);snippet(node_2,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor4,fragment_2)},alternate=$$anchor4=>{var button=root_3$_();
attribute_effect(button,()=>({...get$3(mergedProps)}));var node_3=child(button);snippet(node_3,()=>$$props.children??noop$3),reset(button),append($$anchor4,button)};if_block(node_1,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}const switchAttrs=createBitsAttrs({component:"switch",parts:["root","thumb"]}),SwitchRootContext=new Context$1("Switch.Root");class SwitchRootState{static create(opts){
return SwitchRootContext.set(new SwitchRootState(opts))}opts;attachment;constructor(opts){this.opts=opts,this.attachment=attachRef(opts.ref),this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this)}#toggle(){this.opts.checked.current=!this.opts.checked.current}onkeydown(e){!(e.key===ENTER||e.key===SPACE)||this.opts.disabled.current||(e.preventDefault(),this.#toggle())}onclick(_){this.opts.disabled.current||this.#toggle()}#sharedProps=user_derived(()=>({"data-disabled":boolToEmptyStrOrUndef(
this.opts.disabled.current),"data-state":getDataChecked(this.opts.checked.current),"data-required":boolToEmptyStrOrUndef(this.opts.required.current)}));get sharedProps(){return get$3(this.#sharedProps)}set sharedProps(value){set$1(this.#sharedProps,value)}#snippetProps=user_derived(()=>({checked:this.opts.checked.current}));get snippetProps(){return get$3(this.#snippetProps)}set snippetProps(value){set$1(this.#snippetProps,value)}#props=user_derived(()=>({...this.sharedProps,id:this.opts.id.current,
role:"switch",disabled:boolToTrueOrUndef(this.opts.disabled.current),"aria-checked":getAriaChecked(this.opts.checked.current,!1),"aria-required":boolToStr(this.opts.required.current),[switchAttrs.root]:"",onclick:this.onclick,onkeydown:this.onkeydown,...this.attachment}));get props(){return get$3(this.#props)}set props(value){set$1(this.#props,value)}}class SwitchInputState{static create(){return new SwitchInputState(SwitchRootContext.get())}root;#shouldRender=user_derived(()=>this.root.opts.name.
current!==void 0);get shouldRender(){return get$3(this.#shouldRender)}set shouldRender(value){set$1(this.#shouldRender,value)}constructor(root2){this.root=root2}#props=user_derived(()=>({type:"checkbox",name:this.root.opts.name.current,value:this.root.opts.value.current,checked:this.root.opts.checked.current,disabled:this.root.opts.disabled.current,required:this.root.opts.required.current}));get props(){return get$3(this.#props)}set props(value){set$1(this.#props,value)}}class SwitchThumbState{static create(opts){
return new SwitchThumbState(opts,SwitchRootContext.get())}opts;root;attachment;constructor(opts,root2){this.opts=opts,this.root=root2,this.attachment=attachRef(opts.ref)}#snippetProps=user_derived(()=>({checked:this.root.opts.checked.current}));get snippetProps(){return get$3(this.#snippetProps)}set snippetProps(value){set$1(this.#snippetProps,value)}#props=user_derived(()=>({...this.root.sharedProps,id:this.opts.id.current,[switchAttrs.thumb]:"",...this.attachment}));get props(){return get$3(this.#props)}set props(value){
-set$1(this.#props,value)}}function Switch_input($$anchor,$$props){push$1($$props,!1);const inputState=SwitchInputState.create();init();var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{Hidden_input($$anchor2,spread_props(()=>inputState.props))};if_block(node2,$$render=>{inputState.shouldRender&&$$render(consequent)})}append($$anchor,fragment),pop()}var root_2$1i=from_html("<button><!></button>"),root$1T=from_html("<!> <!>",1);function Switch$1($$anchor,$$props){const uid2=props_id();
+set$1(this.#props,value)}}function Switch_input($$anchor,$$props){push$1($$props,!1);const inputState=SwitchInputState.create();init();var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{Hidden_input($$anchor2,spread_props(()=>inputState.props))};if_block(node2,$$render=>{inputState.shouldRender&&$$render(consequent)})}append($$anchor,fragment),pop()}var root_2$1h=from_html("<button><!></button>"),root$1U=from_html("<!> <!>",1);function Switch$1($$anchor,$$props){const uid2=props_id();
push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(uid2)),disabled=prop($$props,"disabled",3,!1),required2=prop($$props,"required",3,!1),checked=prop($$props,"checked",15,!1),value=prop($$props,"value",3,"on"),name=prop($$props,"name",3,void 0),type2=prop($$props,"type",3,"button"),onCheckedChange=prop($$props,"onCheckedChange",3,noop$1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","required","ch\
-ecked","value","name","type","onCheckedChange"]);const rootState=SwitchRootState.create({checked:boxWith$1(()=>checked(),v=>{checked(v),onCheckedChange()?.(v)}),disabled:boxWith$1(()=>disabled()??!1),required:boxWith$1(()=>required2()),value:boxWith$1(()=>value()),name:boxWith$1(()=>name()),id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,rootState.props,{type:type2()}));var fragment=root$1T(),node2=first_child(fragment);{var consequent=$$anchor2=>{
-var fragment_1=comment$2(),node_1=first_child(fragment_1);{let $0=user_derived(()=>({props:get$3(mergedProps),...rootState.snippetProps}));snippet(node_1,()=>$$props.child,()=>get$3($0))}append($$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1i();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3,()=>rootState.snippetProps),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(
-consequent):$$render(alternate,-1)})}var node_3=sibling(node2,2);Switch_input(node_3,{}),append($$anchor,fragment),pop()}var root_2$1h=from_html("<span><!></span>");function Switch_thumb($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(uid2)),restProps=rest_props($$props,["$$slots","$$events","$$legacy","child","children","ref","id"]);const thumbState=SwitchThumbState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(
-()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,thumbState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{let $0=user_derived(()=>({props:get$3(mergedProps),...thumbState.snippetProps}));snippet(node_1,()=>$$props.child,()=>get$3($0))}append($$anchor2,fragment_1)},alternate=$$anchor2=>{var span=root_2$1h();attribute_effect(span,()=>({...get$3(mergedProps)}));var node_2=child(
+ecked","value","name","type","onCheckedChange"]);const rootState=SwitchRootState.create({checked:boxWith$1(()=>checked(),v=>{checked(v),onCheckedChange()?.(v)}),disabled:boxWith$1(()=>disabled()??!1),required:boxWith$1(()=>required2()),value:boxWith$1(()=>value()),name:boxWith$1(()=>name()),id:boxWith$1(()=>id2()),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,rootState.props,{type:type2()}));var fragment=root$1U(),node2=first_child(fragment);{var consequent=$$anchor2=>{
+var fragment_1=comment$2(),node_1=first_child(fragment_1);{let $0=user_derived(()=>({props:get$3(mergedProps),...rootState.snippetProps}));snippet(node_1,()=>$$props.child,()=>get$3($0))}append($$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1h();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3,()=>rootState.snippetProps),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(
+consequent):$$render(alternate,-1)})}var node_3=sibling(node2,2);Switch_input(node_3,{}),append($$anchor,fragment),pop()}var root_2$1g=from_html("<span><!></span>");function Switch_thumb($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let ref2=prop($$props,"ref",15,null),id2=prop($$props,"id",19,()=>createId(uid2)),restProps=rest_props($$props,["$$slots","$$events","$$legacy","child","children","ref","id"]);const thumbState=SwitchThumbState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(
+()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,thumbState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{let $0=user_derived(()=>({props:get$3(mergedProps),...thumbState.snippetProps}));snippet(node_1,()=>$$props.child,()=>get$3($0))}append($$anchor2,fragment_1)},alternate=$$anchor2=>{var span=root_2$1g();attribute_effect(span,()=>({...get$3(mergedProps)}));var node_2=child(
span);snippet(node_2,()=>$$props.children??noop$3,()=>thumbState.snippetProps),reset(span),append($$anchor2,span)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}class TimeoutFn{#interval;#cb;#timer=null;constructor(cb,interval){this.#cb=cb,this.#interval=interval,this.stop=this.stop.bind(this),this.start=this.start.bind(this),onDestroyEffect(this.stop)}#clear(){this.#timer!==null&&(window.clearTimeout(this.#timer),this.#timer=
null)}stop(){this.#clear()}start(...args){this.#clear(),this.#timer=window.setTimeout(()=>{this.#timer=null,this.#cb(...args)},this.#interval)}}const tooltipAttrs=createBitsAttrs({component:"tooltip",parts:["content","trigger"]}),TooltipProviderContext=new Context$1("Tooltip.Provider"),TooltipRootContext=new Context$1("Tooltip.Root");class TooltipTriggerRegistryState{#triggers=state$1(proxy(new Map));get triggers(){return get$3(this.#triggers)}set triggers(value){set$1(this.#triggers,value,!0)}#activeTriggerId=state$1(
null);get activeTriggerId(){return get$3(this.#activeTriggerId)}set activeTriggerId(value){set$1(this.#activeTriggerId,value,!0)}#activeTriggerNode=user_derived(()=>{const activeTriggerId=this.activeTriggerId;return activeTriggerId===null?null:this.triggers.get(activeTriggerId)?.node??null});get activeTriggerNode(){return get$3(this.#activeTriggerNode)}set activeTriggerNode(value){set$1(this.#activeTriggerNode,value)}#activePayload=user_derived(()=>{const activeTriggerId=this.activeTriggerId;return activeTriggerId===
return this.root.contentPresence.shouldRender}#snippetProps=user_derived(()=>({open:this.root.opts.open.current}));get snippetProps(){return get$3(this.#snippetProps)}set snippetProps(value){set$1(this.#snippetProps,value)}#props=user_derived(()=>({id:this.opts.id.current,"data-state":this.root.stateAttr,"data-disabled":boolToEmptyStrOrUndef(this.root.disabled),...getDataTransitionAttrs(this.root.contentPresence.transitionStatus),style:{outline:"none"},[tooltipAttrs.content]:"",...this.attachment}));get props(){
return get$3(this.#props)}set props(value){set$1(this.#props,value)}popperProps={onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown,onOpenAutoFocus:this.onOpenAutoFocus,onCloseAutoFocus:this.onCloseAutoFocus}}function Tooltip($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15,!1),triggerId=prop($$props,"triggerId",15,null),onOpenChange=prop($$props,"onOpenChange",3,noop$1),onOpenChangeComplete=prop($$props,"onOpenChangeComplete",3,noop$1);const rootState=TooltipRootState.
create({open:boxWith$1(()=>open2(),v=>{open2(v),onOpenChange()(v)}),triggerId:boxWith$1(()=>triggerId(),v=>{triggerId(v)}),delayDuration:boxWith$1(()=>$$props.delayDuration),disableCloseOnTriggerClick:boxWith$1(()=>$$props.disableCloseOnTriggerClick),disableHoverableContent:boxWith$1(()=>$$props.disableHoverableContent),ignoreNonKeyboardFocus:boxWith$1(()=>$$props.ignoreNonKeyboardFocus),disabled:boxWith$1(()=>$$props.disabled),onOpenChangeComplete:boxWith$1(()=>onOpenChangeComplete()),tether:boxWith$1(
-()=>$$props.tether)});Floating_layer($$anchor,{tooltip:!0,children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3,()=>({open:rootState.opts.open.current,triggerId:rootState.activeTriggerId,payload:rootState.activePayload})),append($$anchor2,fragment_1)},$$slots:{default:!0}}),pop()}var root_4$F=from_html("<div><div><!></div></div>"),root_8$u=from_html("<div><div><!></div></div>");function Tooltip_content$1($$anchor,$$props){
+()=>$$props.tether)});Floating_layer($$anchor,{tooltip:!0,children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3,()=>({open:rootState.opts.open.current,triggerId:rootState.activeTriggerId,payload:rootState.activePayload})),append($$anchor2,fragment_1)},$$slots:{default:!0}}),pop()}var root_4$G=from_html("<div><div><!></div></div>"),root_8$t=from_html("<div><div><!></div></div>");function Tooltip_content$1($$anchor,$$props){
const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),ref2=prop($$props,"ref",15,null),side=prop($$props,"side",3,"top"),sideOffset=prop($$props,"sideOffset",3,0),align=prop($$props,"align",3,"center"),avoidCollisions=prop($$props,"avoidCollisions",3,!0),arrowPadding=prop($$props,"arrowPadding",3,0),sticky=prop($$props,"sticky",3,"partial"),hideWhenDetached=prop($$props,"hideWhenDetached",3,!1),collisionPadding=prop($$props,"collisionPadding",3,0),onInteractOutside=prop(
$$props,"onInteractOutside",3,noop$1),onEscapeKeydown=prop($$props,"onEscapeKeydown",3,noop$1),forceMount=prop($$props,"forceMount",3,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","children","child","id","ref","side","sideOffset","align","avoidCollisions","arrowPadding","sticky","strategy","hideWhenDetached","customAnchor","collisionPadding","onInteractOutside","onEscapeKeydown","forceMount","style"]);const contentState=TooltipContentState.create({id:boxWith$1(()=>id2()),ref:boxWith$1(
()=>ref2(),v=>ref2(v)),onInteractOutside:boxWith$1(()=>onInteractOutside()),onEscapeKeydown:boxWith$1(()=>onEscapeKeydown())}),floatingProps=user_derived(()=>({side:side(),sideOffset:sideOffset(),align:align(),avoidCollisions:avoidCollisions(),arrowPadding:arrowPadding(),sticky:sticky(),hideWhenDetached:hideWhenDetached(),collisionPadding:collisionPadding(),strategy:$$props.strategy,customAnchor:$$props.customAnchor??contentState.root.triggerNode})),mergedProps=user_derived(()=>mergeProps(restProps,
get$3(floatingProps),contentState.props));var fragment=comment$2(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{{const popper=($$anchor3,$$arg0)=>{let props=()=>$$arg0?.().props,wrapperProps=()=>$$arg0?.().wrapperProps;const finalProps=user_derived(()=>mergeProps(props(),{style:getFloatingContentCSSVars("tooltip")},{style:$$props.style}));var fragment_2=comment$2(),node_1=first_child(fragment_2);{var consequent=$$anchor4=>{var fragment_3=comment$2(),node_2=first_child(fragment_3);{let $02=user_derived(
-()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_2,()=>$$props.child,()=>get$3($02))}append($$anchor4,fragment_3)},alternate=$$anchor4=>{var div=root_4$F();attribute_effect(div,()=>({...wrapperProps()}));var div_1=child(div);attribute_effect(div_1,()=>({...get$3(finalProps)}));var node_3=child(div_1);snippet(node_3,()=>$$props.children??noop$3),reset(div_1),reset(div),append($$anchor4,div)};if_block(node_1,$$render=>{$$props.child?$$render(consequent):
+()=>({props:get$3(finalProps),wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_2,()=>$$props.child,()=>get$3($02))}append($$anchor4,fragment_3)},alternate=$$anchor4=>{var div=root_4$G();attribute_effect(div,()=>({...wrapperProps()}));var div_1=child(div);attribute_effect(div_1,()=>({...get$3(finalProps)}));var node_3=child(div_1);snippet(node_3,()=>$$props.children??noop$3),reset(div_1),reset(div),append($$anchor4,div)};if_block(node_1,$$render=>{$$props.child?$$render(consequent):
$$render(alternate,-1)})}append($$anchor3,fragment_2)};let $0=user_derived(()=>contentState.root.disableHoverableContent?"none":"auto");Popper_layer_force_mount($$anchor2,spread_props(()=>get$3(mergedProps),()=>contentState.popperProps,{get enabled(){return contentState.root.opts.open.current},get id(){return id2()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!0,get ref(){return contentState.opts.ref},tooltip:!0,get shouldRender(){return contentState.shouldRender},get contentPointerEvents(){
return get$3($0)},popper,$$slots:{popper:!0}}))}},consequent_3=$$anchor2=>{{const popper=($$anchor3,$$arg0)=>{let props=()=>$$arg0?.().props,wrapperProps=()=>$$arg0?.().wrapperProps;const finalProps=user_derived(()=>mergeProps(props(),{style:getFloatingContentCSSVars("tooltip")},{style:$$props.style}));var fragment_5=comment$2(),node_4=first_child(fragment_5);{var consequent_2=$$anchor4=>{var fragment_6=comment$2(),node_5=first_child(fragment_6);{let $02=user_derived(()=>({props:get$3(finalProps),
-wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_5,()=>$$props.child,()=>get$3($02))}append($$anchor4,fragment_6)},alternate_1=$$anchor4=>{var div_2=root_8$u();attribute_effect(div_2,()=>({...wrapperProps()}));var div_3=child(div_2);attribute_effect(div_3,()=>({...get$3(finalProps)}));var node_6=child(div_3);snippet(node_6,()=>$$props.children??noop$3),reset(div_3),reset(div_2),append($$anchor4,div_2)};if_block(node_4,$$render=>{$$props.child?$$render(consequent_2):$$render(
+wrapperProps:wrapperProps(),...contentState.snippetProps}));snippet(node_5,()=>$$props.child,()=>get$3($02))}append($$anchor4,fragment_6)},alternate_1=$$anchor4=>{var div_2=root_8$t();attribute_effect(div_2,()=>({...wrapperProps()}));var div_3=child(div_2);attribute_effect(div_3,()=>({...get$3(finalProps)}));var node_6=child(div_3);snippet(node_6,()=>$$props.children??noop$3),reset(div_3),reset(div_2),append($$anchor4,div_2)};if_block(node_4,$$render=>{$$props.child?$$render(consequent_2):$$render(
alternate_1,-1)})}append($$anchor3,fragment_5)};let $0=user_derived(()=>contentState.root.disableHoverableContent?"none":"auto");Popper_layer($$anchor2,spread_props(()=>get$3(mergedProps),()=>contentState.popperProps,{get open(){return contentState.root.opts.open.current},get id(){return id2()},trapFocus:!1,loop:!1,preventScroll:!1,forceMount:!1,get ref(){return contentState.opts.ref},tooltip:!0,get shouldRender(){return contentState.shouldRender},get contentPointerEvents(){return get$3($0)},popper,
-$$slots:{popper:!0}}))}};if_block(node2,$$render=>{forceMount()?$$render(consequent_1):forceMount()||$$render(consequent_3,1)})}append($$anchor,fragment),pop()}var root_2$1g=from_html("<button><!></button>");function Tooltip_trigger$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),disabled=prop($$props,"disabled",3,!1),type2=prop($$props,"type",3,"button"),tabindex=prop($$props,"tabindex",3,0),ref2=prop($$props,"ref",15,null),restProps=rest_props(
+$$slots:{popper:!0}}))}};if_block(node2,$$render=>{forceMount()?$$render(consequent_1):forceMount()||$$render(consequent_3,1)})}append($$anchor,fragment),pop()}var root_2$1f=from_html("<button><!></button>");function Tooltip_trigger$1($$anchor,$$props){const uid2=props_id();push$1($$props,!0);let id2=prop($$props,"id",19,()=>createId(uid2)),disabled=prop($$props,"disabled",3,!1),type2=prop($$props,"type",3,"button"),tabindex=prop($$props,"tabindex",3,0),ref2=prop($$props,"ref",15,null),restProps=rest_props(
$$props,["$$slots","$$events","$$legacy","children","child","id","disabled","payload","tether","type","tabindex","ref"]);const triggerState=TooltipTriggerState.create({id:boxWith$1(()=>id2()),disabled:boxWith$1(()=>disabled()??!1),tabindex:boxWith$1(()=>tabindex()??0),payload:boxWith$1(()=>$$props.payload),tether:boxWith$1(()=>$$props.tether),ref:boxWith$1(()=>ref2(),v=>ref2(v))}),mergedProps=user_derived(()=>mergeProps(restProps,triggerState.props,{type:type2()}));var fragment=comment$2(),node2=first_child(
-fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1g();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,
+fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.child,()=>({props:get$3(mergedProps)})),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var button=root_2$1f();attribute_effect(button,()=>({...get$3(mergedProps)}));var node_2=child(button);snippet(node_2,()=>$$props.children??noop$3),reset(button),append($$anchor2,button)};if_block(node2,$$render=>{$$props.child?$$render(consequent):$$render(alternate,-1)})}append($$anchor,
fragment),pop()}function Tooltip_arrow($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref"]);Floating_layer_arrow($$anchor,spread_props(()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}})),pop()}function Tooltip_provider($$anchor,$$props){push$1($$props,!0);let delayDuration=prop($$props,"delayDuration",3,700),disableCloseOnTriggerClick=prop($$props,"disableCloseOnTriggerClick",3,!1),disableHoverableContent=prop(
$$props,"disableHoverableContent",3,!1),disabled=prop($$props,"disabled",3,!1),ignoreNonKeyboardFocus=prop($$props,"ignoreNonKeyboardFocus",3,!1),skipDelayDuration=prop($$props,"skipDelayDuration",3,300);TooltipProviderState.create({delayDuration:boxWith$1(()=>delayDuration()),disableCloseOnTriggerClick:boxWith$1(()=>disableCloseOnTriggerClick()),disableHoverableContent:boxWith$1(()=>disableHoverableContent()),disabled:boxWith$1(()=>disabled()),ignoreNonKeyboardFocus:boxWith$1(()=>ignoreNonKeyboardFocus()),
skipDelayDuration:boxWith$1(()=>skipDelayDuration())});var fragment=comment$2(),node2=first_child(fragment);snippet(node2,()=>$$props.children??noop$3),append($$anchor,fragment),pop()}function Tooltip_trigger($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref"]);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Tooltip_trigger$1,($$anchor2,TooltipPrimitive_Trigger)=>{TooltipPrimitive_Trigger(
-$$anchor2,spread_props({"data-slot":"tooltip-trigger",class:"cursor-pointer"},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))}),append($$anchor,fragment),pop()}var root_3$Y=from_html("<div></div>"),root_2$1f=from_html("<!> <!>",1);function Tooltip_content($$anchor,$$props){push$1($$props,!0);const tooltipContent=$$anchor2=>{var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Tooltip_content$1,($$anchor3,TooltipPrimitive_Content)=>{TooltipPrimitive_Content(
-$$anchor3,spread_props({"data-slot":"tooltip-content",get sideOffset(){return sideOffset()},get side(){return side()},get class(){return get$3(contentClass)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},children:($$anchor4,$$slotProps)=>{var fragment_1=root_2$1f(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.children??noop$3);var node_2=sibling(node_1,2);{const child2=($$anchor5,$$arg0)=>{let props=()=>$$arg0?.().props;var div=root_3$Y();attribute_effect(
+$$anchor2,spread_props({"data-slot":"tooltip-trigger",class:"cursor-pointer"},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))}),append($$anchor,fragment),pop()}var root_3$Z=from_html("<div></div>"),root_2$1e=from_html("<!> <!>",1);function Tooltip_content($$anchor,$$props){push$1($$props,!0);const tooltipContent=$$anchor2=>{var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Tooltip_content$1,($$anchor3,TooltipPrimitive_Content)=>{TooltipPrimitive_Content(
+$$anchor3,spread_props({"data-slot":"tooltip-content",get sideOffset(){return sideOffset()},get side(){return side()},get class(){return get$3(contentClass)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},children:($$anchor4,$$slotProps)=>{var fragment_1=root_2$1e(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.children??noop$3);var node_2=sibling(node_1,2);{const child2=($$anchor5,$$arg0)=>{let props=()=>$$arg0?.().props;var div=root_3$Z();attribute_effect(
div,$0=>({class:$0,...props()}),[()=>cn$1("z-50 size-2.5 rotate-45 rounded-[2px] bg-primary","data-[side=top]:translate-x-1/2 data-[side=top]:translate-y-[calc(-50%_+_2px)]","data-[side=bottom]:-translate-x-1/2 data-[side=bottom]:-translate-y-[calc(-50%_+_1px)]","data-[side=right]:translate-x-[calc(50%_+_2px)] data-[side=right]:translate-y-1/2","data-[side=left]:-translate-y-[calc(50%_-_3px)]",$$props.arrowClasses)]),append($$anchor5,div)};component(node_2,()=>Tooltip_arrow,($$anchor5,TooltipPrimitive_Arrow)=>{
TooltipPrimitive_Arrow($$anchor5,{child:child2,$$slots:{child:!0}})})}append($$anchor4,fragment_1)},$$slots:{default:!0}}))}),append($$anchor2,fragment)};let ref2=prop($$props,"ref",15,null),sideOffset=prop($$props,"sideOffset",3,0),side=prop($$props,"side",3,"top"),noPortal=prop($$props,"noPortal",3,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","sideOffset","side","children","arrowClasses","noPortal"]);const contentClass=user_derived(()=>cn$1("z-50 w-fit origin\
-(--bits-tooltip-content-transform-origin) animate-in rounded-md bg-primary px-3 py-1.5 text-xs text-balance text-primary-foreground fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",$$props.class));var fragment_2=comment$2(),node_3=first_child(fragment_2);{var consequent=$$anchor2=>{
t",FileExtensionText2.SWIFT=".swift",FileExtensionText2.DART=".dart",FileExtensionText2.VUE=".vue",FileExtensionText2.SVELTE=".svelte",FileExtensionText2.TEX=".tex",FileExtensionText2.BIB=".bib",FileExtensionText2.CU=".cu",FileExtensionText2.CUH=".cuh",FileExtensionText2.COMP=".comp",FileExtensionText2.HPP=".hpp",FileExtensionText2.HS=".hs",FileExtensionText2.PROPERTIES=".properties",FileExtensionText2.CS=".cs",FileExtensionText2))(FileExtensionText||{}),MimeTypePrefix=(MimeTypePrefix2=>(MimeTypePrefix2.
IMAGE="image/",MimeTypePrefix2.TEXT="text",MimeTypePrefix2))(MimeTypePrefix||{}),MimeTypeIncludes=(MimeTypeIncludes2=>(MimeTypeIncludes2.JSON="json",MimeTypeIncludes2.JAVASCRIPT="javascript",MimeTypeIncludes2.TYPESCRIPT="typescript",MimeTypeIncludes2))(MimeTypeIncludes||{}),UriPattern=(UriPattern2=>(UriPattern2.DATABASE_KEYWORD="database",UriPattern2.DATABASE_SCHEME="db://",UriPattern2))(UriPattern||{}),MimeTypeApplication=(MimeTypeApplication2=>(MimeTypeApplication2.PDF="application/pdf",MimeTypeApplication2.
OCTET_STREAM="application/octet-stream",MimeTypeApplication2))(MimeTypeApplication||{}),MimeTypeAudio=(MimeTypeAudio2=>(MimeTypeAudio2.MP3_MPEG="audio/mpeg",MimeTypeAudio2.MP3="audio/mp3",MimeTypeAudio2.MP4="audio/mp4",MimeTypeAudio2.WAV="audio/wav",MimeTypeAudio2.WEBM="audio/webm",MimeTypeAudio2.WEBM_OPUS="audio/webm;codecs=opus",MimeTypeAudio2))(MimeTypeAudio||{}),MimeTypeImage=(MimeTypeImage2=>(MimeTypeImage2.JPEG="image/jpeg",MimeTypeImage2.JPG="image/jpg",MimeTypeImage2.PNG="image/png",MimeTypeImage2.
-GIF="image/gif",MimeTypeImage2.WEBP="image/webp",MimeTypeImage2.SVG="image/svg+xml",MimeTypeImage2))(MimeTypeImage||{}),MimeTypeText=(MimeTypeText2=>(MimeTypeText2.PLAIN="text/plain",MimeTypeText2.MARKDOWN="text/markdown",MimeTypeText2.ASCIIDOC="text/asciidoc",MimeTypeText2.JAVASCRIPT="text/javascript",MimeTypeText2.JAVASCRIPT_APP="application/javascript",MimeTypeText2.TYPESCRIPT="text/typescript",MimeTypeText2.JSX="text/jsx",MimeTypeText2.TSX="text/tsx",MimeTypeText2.CSS="text/css",MimeTypeText2.
-HTML="text/html",MimeTypeText2.JSON="application/json",MimeTypeText2.XML_TEXT="text/xml",MimeTypeText2.XML_APP="application/xml",MimeTypeText2.YAML_TEXT="text/yaml",MimeTypeText2.YAML_APP="application/yaml",MimeTypeText2.CSV="text/csv",MimeTypeText2.PYTHON="text/x-python",MimeTypeText2.JAVA="text/x-java-source",MimeTypeText2.CPP_HDR="text/x-c++hdr",MimeTypeText2.CPP_SRC="text/x-c++src",MimeTypeText2.CSHARP="text/x-csharp",MimeTypeText2.HASKELL="text/x-haskell",MimeTypeText2.C_SRC="text/x-csrc",MimeTypeText2.
-C_HDR="text/x-chdr",MimeTypeText2.PHP="text/x-php",MimeTypeText2.RUBY="text/x-ruby",MimeTypeText2.GO="text/x-go",MimeTypeText2.RUST="text/x-rust",MimeTypeText2.SHELL="text/x-shellscript",MimeTypeText2.BAT="application/x-bat",MimeTypeText2.SQL="text/x-sql",MimeTypeText2.R="text/x-r",MimeTypeText2.SCALA="text/x-scala",MimeTypeText2.KOTLIN="text/x-kotlin",MimeTypeText2.SWIFT="text/x-swift",MimeTypeText2.DART="text/x-dart",MimeTypeText2.VUE="text/x-vue",MimeTypeText2.SVELTE="text/x-svelte",MimeTypeText2.
-TEX="text/x-tex",MimeTypeText2.TEX_APP="application/x-tex",MimeTypeText2.LATEX="application/x-latex",MimeTypeText2.BIBTEX="text/x-bibtex",MimeTypeText2.CUDA="text/x-cuda",MimeTypeText2.PROPERTIES="text/properties",MimeTypeText2))(MimeTypeText||{}),MCPConnectionPhase=(MCPConnectionPhase2=>(MCPConnectionPhase2.IDLE="idle",MCPConnectionPhase2.TRANSPORT_CREATING="transport_creating",MCPConnectionPhase2.TRANSPORT_READY="transport_ready",MCPConnectionPhase2.INITIALIZING="initializing",MCPConnectionPhase2.
-CAPABILITIES_EXCHANGED="capabilities_exchanged",MCPConnectionPhase2.LISTING_TOOLS="listing_tools",MCPConnectionPhase2.CONNECTED="connected",MCPConnectionPhase2.ERROR="error",MCPConnectionPhase2.DISCONNECTED="disconnected",MCPConnectionPhase2))(MCPConnectionPhase||{}),MCPLogLevel=(MCPLogLevel2=>(MCPLogLevel2.INFO="info",MCPLogLevel2.WARN="warn",MCPLogLevel2.ERROR="error",MCPLogLevel2))(MCPLogLevel||{}),MCPTransportType=(MCPTransportType2=>(MCPTransportType2.WEBSOCKET="websocket",MCPTransportType2.
-STREAMABLE_HTTP="streamable_http",MCPTransportType2.SSE="sse",MCPTransportType2))(MCPTransportType||{}),HealthCheckStatus=(HealthCheckStatus2=>(HealthCheckStatus2.IDLE="idle",HealthCheckStatus2.CONNECTING="connecting",HealthCheckStatus2.SUCCESS="success",HealthCheckStatus2.ERROR="error",HealthCheckStatus2))(HealthCheckStatus||{}),MCPContentType=(MCPContentType2=>(MCPContentType2.TEXT="text",MCPContentType2.IMAGE="image",MCPContentType2.RESOURCE="resource",MCPContentType2))(MCPContentType||{}),JsonSchemaType=(JsonSchemaType2=>(JsonSchemaType2.
-OBJECT="object",JsonSchemaType2))(JsonSchemaType||{}),MCPRefType=(MCPRefType2=>(MCPRefType2.PROMPT="ref/prompt",MCPRefType2.RESOURCE="ref/resource",MCPRefType2))(MCPRefType||{}),ModelModality=(ModelModality2=>(ModelModality2.TEXT="TEXT",ModelModality2.AUDIO="AUDIO",ModelModality2.VISION="VISION",ModelModality2))(ModelModality||{}),ServerRole=(ServerRole2=>(ServerRole2.MODEL="model",ServerRole2.ROUTER="router",ServerRole2))(ServerRole||{}),ServerModelStatus=(ServerModelStatus2=>(ServerModelStatus2.
-UNLOADED="unloaded",ServerModelStatus2.LOADING="loading",ServerModelStatus2.LOADED="loaded",ServerModelStatus2.SLEEPING="sleeping",ServerModelStatus2.FAILED="failed",ServerModelStatus2))(ServerModelStatus||{}),ParameterSource=(ParameterSource2=>(ParameterSource2.DEFAULT="default",ParameterSource2.CUSTOM="custom",ParameterSource2))(ParameterSource||{}),SyncableParameterType=(SyncableParameterType2=>(SyncableParameterType2.NUMBER="number",SyncableParameterType2.STRING="string",SyncableParameterType2.
-BOOLEAN="boolean",SyncableParameterType2))(SyncableParameterType||{}),SettingsFieldType=(SettingsFieldType2=>(SettingsFieldType2.INPUT="input",SettingsFieldType2.TEXTAREA="textarea",SettingsFieldType2.CHECKBOX="checkbox",SettingsFieldType2.SELECT="select",SettingsFieldType2))(SettingsFieldType||{}),ColorMode=(ColorMode2=>(ColorMode2.LIGHT="light",ColorMode2.DARK="dark",ColorMode2.SYSTEM="system",ColorMode2))(ColorMode||{}),TooltipSide=(TooltipSide2=>(TooltipSide2.TOP="top",TooltipSide2.RIGHT="ri\
-ght",TooltipSide2.BOTTOM="bottom",TooltipSide2.LEFT="left",TooltipSide2))(TooltipSide||{}),McpPromptVariant=(McpPromptVariant2=>(McpPromptVariant2.MESSAGE="message",McpPromptVariant2.ATTACHMENT="attachment",McpPromptVariant2))(McpPromptVariant||{}),UrlProtocol=(UrlProtocol2=>(UrlProtocol2.DATA="data:",UrlProtocol2.HTTP="http://",UrlProtocol2.HTTPS="https://",UrlProtocol2.WEBSOCKET="ws://",UrlProtocol2.WEBSOCKET_SECURE="wss://",UrlProtocol2))(UrlProtocol||{}),HtmlInputType=(HtmlInputType2=>(HtmlInputType2.
-FILE="file",HtmlInputType2))(HtmlInputType||{}),KeyboardKey=(KeyboardKey2=>(KeyboardKey2.ENTER="Enter",KeyboardKey2.ESCAPE="Escape",KeyboardKey2.ARROW_UP="ArrowUp",KeyboardKey2.ARROW_DOWN="ArrowDown",KeyboardKey2.ARROW_LEFT="ArrowLeft",KeyboardKey2.ARROW_RIGHT="ArrowRight",KeyboardKey2.TAB="Tab",KeyboardKey2.D_LOWER="d",KeyboardKey2.D_UPPER="D",KeyboardKey2.E_UPPER="E",KeyboardKey2.K_LOWER="k",KeyboardKey2.O_LOWER="o",KeyboardKey2.O_UPPER="O",KeyboardKey2.SPACE=" ",KeyboardKey2))(KeyboardKey||{}),
-ToolSource=(ToolSource2=>(ToolSource2.BUILTIN="builtin",ToolSource2.MCP="mcp",ToolSource2.CUSTOM="custom",ToolSource2))(ToolSource||{}),ToolPermissionDecision=(ToolPermissionDecision2=>(ToolPermissionDecision2.ALWAYS="always",ToolPermissionDecision2.ALWAYS_SERVER="always_server",ToolPermissionDecision2.ONCE="once",ToolPermissionDecision2.DENY="deny",ToolPermissionDecision2))(ToolPermissionDecision||{}),ToolResponseField=(ToolResponseField2=>(ToolResponseField2.PLAIN_TEXT="plain_text_response",ToolResponseField2.
-ERROR="error",ToolResponseField2))(ToolResponseField||{}),root_5$x=from_html("<p> </p>"),root_1$16=from_html("<!> <!>",1);function ActionIcon($$anchor,$$props){push$1($$props,!0);let variant=prop($$props,"variant",3,"ghost"),size2=prop($$props,"size",3,"sm"),className=prop($$props,"class",3,""),disabled=prop($$props,"disabled",3,!1),iconSize=prop($$props,"iconSize",3,"h-3 w-3"),tooltipSide=prop($$props,"tooltipSide",19,()=>TooltipSide.TOP),stopPropagationOnClick=prop($$props,"stopPropagationOnCl\
-ick",3,!1);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$5,($$anchor2,Tooltip_Root)=>{Tooltip_Root($$anchor2,{children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$16(),node_1=first_child(fragment_1);component(node_1,()=>Tooltip_trigger,($$anchor4,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor4,{children:($$anchor5,$$slotProps2)=>{{let $0=user_derived(()=>$$props.ariaLabel||$$props.tooltip);Button($$anchor5,{get variant(){return variant()},get size(){return size2()},
-get disabled(){return disabled()},onclick:e=>{stopPropagationOnClick()&&e.stopPropagation(),$$props.onclick?.(e)},get class(){return`h-6 w-6 p-0 ${className()??""} flex hover:bg-transparent data-[state=open]:bg-transparent!`},get"aria-label"(){return get$3($0)},children:($$anchor6,$$slotProps3)=>{var fragment_3=comment$2(),node_2=first_child(fragment_3);{var consequent=$$anchor7=>{const IconComponent=user_derived(()=>$$props.icon);var fragment_4=comment$2(),node_3=first_child(fragment_4);component(
-node_3,()=>get$3(IconComponent),($$anchor8,IconComponent_1)=>{IconComponent_1($$anchor8,{get class(){return iconSize()}})}),append($$anchor7,fragment_4)};if_block(node_2,$$render=>{$$props.icon&&$$render(consequent)})}append($$anchor6,fragment_3)},$$slots:{default:!0}})}},$$slots:{default:!0}})});var node_4=sibling(node_1,2);component(node_4,()=>Tooltip_content,($$anchor4,Tooltip_Content)=>{Tooltip_Content($$anchor4,{get side(){return tooltipSide()},children:($$anchor5,$$slotProps2)=>{var p2=root_5$x(),
-text2=child(p2,!0);reset(p2),template_effect(()=>set_text(text2,$$props.tooltip)),append($$anchor5,p2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}const defaultAttributes={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var root$1S=from_svg("<svg><!><!></svg>");function Icon($$anchor,$$props){push$1($$props,
-!0);const color=prop($$props,"color",3,"currentColor"),size2=prop($$props,"size",3,24),strokeWidth=prop($$props,"strokeWidth",3,2),absoluteStrokeWidth=prop($$props,"absoluteStrokeWidth",3,!1),iconNode=prop($$props,"iconNode",19,()=>[]),props=rest_props($$props,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]);var svg2=root$1S();attribute_effect(svg2,$0=>({...defaultAttributes,...props,width:size2(),height:size2(),stroke:color(),"st\
-roke-width":$0,class:["lucide-icon lucide",$$props.name&&`lucide-${$$props.name}`,$$props.class]}),[()=>absoluteStrokeWidth()?Number(strokeWidth())*24/Number(size2()):strokeWidth()]);var node2=child(svg2);each(node2,17,iconNode,index$2,($$anchor2,$$item)=>{var $$array=user_derived(()=>to_array(get$3($$item),2));let tag=()=>get$3($$array)[0],attrs=()=>get$3($$array)[1];var fragment=comment$2(),node_1=first_child(fragment);element$4(node_1,tag,!0,($$element,$$anchor3)=>{attribute_effect($$element,
+GIF="image/gif",MimeTypeImage2.WEBP="image/webp",MimeTypeImage2.SVG="image/svg+xml",MimeTypeImage2.ICO="image/x-icon",MimeTypeImage2.ICO_MICROSOFT="image/vnd.microsoft.icon",MimeTypeImage2))(MimeTypeImage||{}),MimeTypeText=(MimeTypeText2=>(MimeTypeText2.PLAIN="text/plain",MimeTypeText2.MARKDOWN="text/markdown",MimeTypeText2.ASCIIDOC="text/asciidoc",MimeTypeText2.JAVASCRIPT="text/javascript",MimeTypeText2.JAVASCRIPT_APP="application/javascript",MimeTypeText2.TYPESCRIPT="text/typescript",MimeTypeText2.
+JSX="text/jsx",MimeTypeText2.TSX="text/tsx",MimeTypeText2.CSS="text/css",MimeTypeText2.HTML="text/html",MimeTypeText2.JSON="application/json",MimeTypeText2.XML_TEXT="text/xml",MimeTypeText2.XML_APP="application/xml",MimeTypeText2.YAML_TEXT="text/yaml",MimeTypeText2.YAML_APP="application/yaml",MimeTypeText2.CSV="text/csv",MimeTypeText2.PYTHON="text/x-python",MimeTypeText2.JAVA="text/x-java-source",MimeTypeText2.CPP_HDR="text/x-c++hdr",MimeTypeText2.CPP_SRC="text/x-c++src",MimeTypeText2.CSHARP="te\
+xt/x-csharp",MimeTypeText2.HASKELL="text/x-haskell",MimeTypeText2.C_SRC="text/x-csrc",MimeTypeText2.C_HDR="text/x-chdr",MimeTypeText2.PHP="text/x-php",MimeTypeText2.RUBY="text/x-ruby",MimeTypeText2.GO="text/x-go",MimeTypeText2.RUST="text/x-rust",MimeTypeText2.SHELL="text/x-shellscript",MimeTypeText2.BAT="application/x-bat",MimeTypeText2.SQL="text/x-sql",MimeTypeText2.R="text/x-r",MimeTypeText2.SCALA="text/x-scala",MimeTypeText2.KOTLIN="text/x-kotlin",MimeTypeText2.SWIFT="text/x-swift",MimeTypeText2.
+DART="text/x-dart",MimeTypeText2.VUE="text/x-vue",MimeTypeText2.SVELTE="text/x-svelte",MimeTypeText2.TEX="text/x-tex",MimeTypeText2.TEX_APP="application/x-tex",MimeTypeText2.LATEX="application/x-latex",MimeTypeText2.BIBTEX="text/x-bibtex",MimeTypeText2.CUDA="text/x-cuda",MimeTypeText2.PROPERTIES="text/properties",MimeTypeText2))(MimeTypeText||{}),MCPConnectionPhase=(MCPConnectionPhase2=>(MCPConnectionPhase2.IDLE="idle",MCPConnectionPhase2.TRANSPORT_CREATING="transport_creating",MCPConnectionPhase2.
+TRANSPORT_READY="transport_ready",MCPConnectionPhase2.INITIALIZING="initializing",MCPConnectionPhase2.CAPABILITIES_EXCHANGED="capabilities_exchanged",MCPConnectionPhase2.LISTING_TOOLS="listing_tools",MCPConnectionPhase2.CONNECTED="connected",MCPConnectionPhase2.ERROR="error",MCPConnectionPhase2.DISCONNECTED="disconnected",MCPConnectionPhase2))(MCPConnectionPhase||{}),MCPLogLevel=(MCPLogLevel2=>(MCPLogLevel2.INFO="info",MCPLogLevel2.WARN="warn",MCPLogLevel2.ERROR="error",MCPLogLevel2))(MCPLogLevel||
+{}),MCPTransportType=(MCPTransportType2=>(MCPTransportType2.WEBSOCKET="websocket",MCPTransportType2.STREAMABLE_HTTP="streamable_http",MCPTransportType2.SSE="sse",MCPTransportType2))(MCPTransportType||{}),HealthCheckStatus=(HealthCheckStatus2=>(HealthCheckStatus2.IDLE="idle",HealthCheckStatus2.CONNECTING="connecting",HealthCheckStatus2.SUCCESS="success",HealthCheckStatus2.ERROR="error",HealthCheckStatus2))(HealthCheckStatus||{}),MCPContentType=(MCPContentType2=>(MCPContentType2.TEXT="text",MCPContentType2.
+IMAGE="image",MCPContentType2.RESOURCE="resource",MCPContentType2))(MCPContentType||{}),JsonSchemaType=(JsonSchemaType2=>(JsonSchemaType2.OBJECT="object",JsonSchemaType2))(JsonSchemaType||{}),MCPRefType=(MCPRefType2=>(MCPRefType2.PROMPT="ref/prompt",MCPRefType2.RESOURCE="ref/resource",MCPRefType2))(MCPRefType||{}),ModelModality=(ModelModality2=>(ModelModality2.TEXT="TEXT",ModelModality2.AUDIO="AUDIO",ModelModality2.VISION="VISION",ModelModality2))(ModelModality||{}),ServerRole=(ServerRole2=>(ServerRole2.
+MODEL="model",ServerRole2.ROUTER="router",ServerRole2))(ServerRole||{}),ServerModelStatus=(ServerModelStatus2=>(ServerModelStatus2.UNLOADED="unloaded",ServerModelStatus2.LOADING="loading",ServerModelStatus2.LOADED="loaded",ServerModelStatus2.SLEEPING="sleeping",ServerModelStatus2.FAILED="failed",ServerModelStatus2))(ServerModelStatus||{}),ParameterSource=(ParameterSource2=>(ParameterSource2.DEFAULT="default",ParameterSource2.CUSTOM="custom",ParameterSource2))(ParameterSource||{}),SyncableParameterType=(SyncableParameterType2=>(SyncableParameterType2.
+NUMBER="number",SyncableParameterType2.STRING="string",SyncableParameterType2.BOOLEAN="boolean",SyncableParameterType2))(SyncableParameterType||{}),SettingsFieldType=(SettingsFieldType2=>(SettingsFieldType2.INPUT="input",SettingsFieldType2.TEXTAREA="textarea",SettingsFieldType2.CHECKBOX="checkbox",SettingsFieldType2.SELECT="select",SettingsFieldType2))(SettingsFieldType||{}),ColorMode=(ColorMode2=>(ColorMode2.LIGHT="light",ColorMode2.DARK="dark",ColorMode2.SYSTEM="system",ColorMode2))(ColorMode||
+{}),TooltipSide=(TooltipSide2=>(TooltipSide2.TOP="top",TooltipSide2.RIGHT="right",TooltipSide2.BOTTOM="bottom",TooltipSide2.LEFT="left",TooltipSide2))(TooltipSide||{}),McpPromptVariant=(McpPromptVariant2=>(McpPromptVariant2.MESSAGE="message",McpPromptVariant2.ATTACHMENT="attachment",McpPromptVariant2))(McpPromptVariant||{}),UrlProtocol=(UrlProtocol2=>(UrlProtocol2.DATA="data:",UrlProtocol2.HTTP="http:",UrlProtocol2.HTTPS="https:",UrlProtocol2.WEBSOCKET="ws:",UrlProtocol2.WEBSOCKET_SECURE="wss:",
+UrlProtocol2))(UrlProtocol||{}),HtmlInputType=(HtmlInputType2=>(HtmlInputType2.FILE="file",HtmlInputType2))(HtmlInputType||{}),KeyboardKey=(KeyboardKey2=>(KeyboardKey2.ENTER="Enter",KeyboardKey2.ESCAPE="Escape",KeyboardKey2.ARROW_UP="ArrowUp",KeyboardKey2.ARROW_DOWN="ArrowDown",KeyboardKey2.ARROW_LEFT="ArrowLeft",KeyboardKey2.ARROW_RIGHT="ArrowRight",KeyboardKey2.TAB="Tab",KeyboardKey2.D_LOWER="d",KeyboardKey2.D_UPPER="D",KeyboardKey2.E_UPPER="E",KeyboardKey2.K_LOWER="k",KeyboardKey2.O_LOWER="o",
+KeyboardKey2.O_UPPER="O",KeyboardKey2.SPACE=" ",KeyboardKey2))(KeyboardKey||{}),ToolSource=(ToolSource2=>(ToolSource2.BUILTIN="builtin",ToolSource2.MCP="mcp",ToolSource2.CUSTOM="custom",ToolSource2))(ToolSource||{}),ToolPermissionDecision=(ToolPermissionDecision2=>(ToolPermissionDecision2.ALWAYS="always",ToolPermissionDecision2.ALWAYS_SERVER="always_server",ToolPermissionDecision2.ONCE="once",ToolPermissionDecision2.DENY="deny",ToolPermissionDecision2))(ToolPermissionDecision||{}),ToolResponseField=(ToolResponseField2=>(ToolResponseField2.
+PLAIN_TEXT="plain_text_response",ToolResponseField2.ERROR="error",ToolResponseField2))(ToolResponseField||{}),root_5$w=from_html("<p> </p>"),root_1$17=from_html("<!> <!>",1);function ActionIcon($$anchor,$$props){push$1($$props,!0);let variant=prop($$props,"variant",3,"ghost"),size2=prop($$props,"size",3,"sm"),className=prop($$props,"class",3,""),disabled=prop($$props,"disabled",3,!1),iconSize=prop($$props,"iconSize",3,"h-3 w-3"),tooltipSide=prop($$props,"tooltipSide",19,()=>TooltipSide.TOP),stopPropagationOnClick=prop(
+$$props,"stopPropagationOnClick",3,!1);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$5,($$anchor2,Tooltip_Root)=>{Tooltip_Root($$anchor2,{children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$17(),node_1=first_child(fragment_1);component(node_1,()=>Tooltip_trigger,($$anchor4,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor4,{children:($$anchor5,$$slotProps2)=>{{let $0=user_derived(()=>$$props.ariaLabel||$$props.tooltip);Button($$anchor5,{get variant(){return variant()},
+get size(){return size2()},get disabled(){return disabled()},onclick:e=>{stopPropagationOnClick()&&e.stopPropagation(),$$props.onclick?.(e)},get class(){return`h-6 w-6 p-0 ${className()??""} flex hover:bg-transparent data-[state=open]:bg-transparent!`},get"aria-label"(){return get$3($0)},children:($$anchor6,$$slotProps3)=>{var fragment_3=comment$2(),node_2=first_child(fragment_3);{var consequent=$$anchor7=>{const IconComponent=user_derived(()=>$$props.icon);var fragment_4=comment$2(),node_3=first_child(
+fragment_4);component(node_3,()=>get$3(IconComponent),($$anchor8,IconComponent_1)=>{IconComponent_1($$anchor8,{get class(){return iconSize()}})}),append($$anchor7,fragment_4)};if_block(node_2,$$render=>{$$props.icon&&$$render(consequent)})}append($$anchor6,fragment_3)},$$slots:{default:!0}})}},$$slots:{default:!0}})});var node_4=sibling(node_1,2);component(node_4,()=>Tooltip_content,($$anchor4,Tooltip_Content)=>{Tooltip_Content($$anchor4,{get side(){return tooltipSide()},children:($$anchor5,$$slotProps2)=>{
+var p2=root_5$w(),text2=child(p2,!0);reset(p2),template_effect(()=>set_text(text2,$$props.tooltip)),append($$anchor5,p2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}const defaultAttributes={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var root$1T=from_svg("<svg><!><!></svg>");function Icon($$anchor,$$props){
+push$1($$props,!0);const color=prop($$props,"color",3,"currentColor"),size2=prop($$props,"size",3,24),strokeWidth=prop($$props,"strokeWidth",3,2),absoluteStrokeWidth=prop($$props,"absoluteStrokeWidth",3,!1),iconNode=prop($$props,"iconNode",19,()=>[]),props=rest_props($$props,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]);var svg2=root$1T();attribute_effect(svg2,$0=>({...defaultAttributes,...props,width:size2(),height:size2(),stroke:color(),
+"stroke-width":$0,class:["lucide-icon lucide",$$props.name&&`lucide-${$$props.name}`,$$props.class]}),[()=>absoluteStrokeWidth()?Number(strokeWidth())*24/Number(size2()):strokeWidth()]);var node2=child(svg2);each(node2,17,iconNode,index$2,($$anchor2,$$item)=>{var $$array=user_derived(()=>to_array(get$3($$item),2));let tag=()=>get$3($$array)[0],attrs=()=>get$3($$array)[1];var fragment=comment$2(),node_1=first_child(fragment);element$4(node_1,tag,!0,($$element,$$anchor3)=>{attribute_effect($$element,
()=>({...attrs()}))}),append($$anchor2,fragment)});var node_2=sibling(node2);snippet(node_2,()=>$$props.children??noop$3),reset(svg2),append($$anchor,svg2),pop()}function Arrow_big_up($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M9 18v-6H5l7-7 7 7h-4v6H9z"}]];Icon($$anchor,spread_props({name:"arrow-big-up"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(
fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Arrow_right($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]];Icon($$anchor,spread_props({name:"arrow-right"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,
()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Arrow_up($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]];Icon($$anchor,spread_props({name:"arrow-up"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),
ok-open-text"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Braces($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"}],["path",{d:"M16 21h1a2 2 0 0 \
0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"}]];Icon($$anchor,spread_props({name:"braces"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Brain($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12 5a3 3 0 1 \
0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516"}],["path",{d:"M19.967 17.484A4 4 0 0\
- 1 18 18"}]];Icon($$anchor,spread_props({name:"brain"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Cable($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1\
- 0 0 1-1 1"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9"}],["path",{d:"M21 21v-2h-4"}],["path",{d:"M3 5h4V3"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3"}]];Icon($$anchor,spread_props({name:"cable"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Check($$anchor,$$props){
-push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M20 6 9 17l-5-5"}]];Icon($$anchor,spread_props({name:"check"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Chevron_down($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,
-["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m6 9 6 6 6-6"}]];Icon($$anchor,spread_props({name:"chevron-down"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Chevron_left($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[
-["path",{d:"m15 18-6-6 6-6"}]];Icon($$anchor,spread_props({name:"chevron-left"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Chevron_up($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m18 15-6-6-6 6"}]];Icon($$anchor,
-spread_props({name:"chevron-up"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Chevron_right($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m9 18 6-6-6-6"}]];Icon($$anchor,spread_props({name:"chevron-right"},()=>props,
-{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Chevrons_up_down($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m7 15 5 5 5-5"}],["path",{d:"m7 9 5-5 5 5"}]];Icon($$anchor,spread_props({name:"chevrons-up-down"},()=>props,{get iconNode(){
-return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Circle_alert($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"10"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16"}]];Icon($$anchor,spread_props(
-{name:"circle-alert"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Circle_check_big($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}],["path",{d:"m9 11 3 3L22 4"}]];Icon($$anchor,spread_props(
-{name:"circle-check-big"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Circle_x($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m15 9-6 6"}],["path",{d:"m9 9 6 6"}]];Icon($$anchor,
-spread_props({name:"circle-x"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Clock($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"10"}],["polyline",{points:"12 6 12 12 16 14"}]];Icon($$anchor,spread_props(
-{name:"clock"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Code($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m16 18 6-6-6-6"}],["path",{d:"m8 6-6 6 6 6"}]];Icon($$anchor,spread_props({name:"code"},()=>props,{get iconNode(){
-return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Copy($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];Icon($$anchor,spread_props(
-{name:"copy"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Database($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5"}],["path",{d:"M3 12A9 3 0 0 0 \
-21 12"}]];Icon($$anchor,spread_props({name:"database"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Download($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-\
-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];Icon($$anchor,spread_props({name:"download"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Ellipsis($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"1"}],["circ\
-le",{cx:"19",cy:"12",r:"1"}],["circle",{cx:"5",cy:"12",r:"1"}]];Icon($$anchor,spread_props({name:"ellipsis"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function External_link($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"\
-M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]];Icon($$anchor,spread_props({name:"external-link"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Eye($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$event\
-s","$$legacy"]);const iconNode=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];Icon($$anchor,spread_props({name:"eye"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function File_text($$anchor,$$props){
-push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]];Icon($$anchor,spread_props({name:"file-text"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??
-noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function File_x($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}],["path",{d:"m14.5 12.5-5 5"}],["path",{d:"m9.5 12.5 5 5"}]];Icon($$anchor,spread_props({name:"file-x"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),
-node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function File$1($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}]];Icon($$anchor,spread_props({name:"file"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{
-var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Flask_conical($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2"}],["path",{d:"M6.453 15h11.094"}],["path",{d:"M8.5 2h7"}]];Icon($$anchor,spread_props(
-{name:"flask-conical"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Folder_open($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0\
- 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"}]];Icon($$anchor,spread_props({name:"folder-open"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Funnel($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[
-["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z"}]];Icon($$anchor,spread_props({name:"funnel"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Gauge($$anchor,$$props){push$1($$props,!0);let props=rest_props(
-$$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m12 14 4-4"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}]];Icon($$anchor,spread_props({name:"gauge"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Git_branch($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$\
-$slots","$$events","$$legacy"]);const iconNode=[["line",{x1:"6",x2:"6",y1:"3",y2:"15"}],["circle",{cx:"18",cy:"6",r:"3"}],["circle",{cx:"6",cy:"18",r:"3"}],["path",{d:"M18 9a9 9 0 0 1-9 9"}]];Icon($$anchor,spread_props({name:"git-branch"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Globe($$anchor,$$props){
-push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}],["path",{d:"M2 12h20"}]];Icon($$anchor,spread_props({name:"globe"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}
-function Heart_off($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["line",{x1:"2",y1:"2",x2:"22",y2:"22"}],["path",{d:"M16.5 16.5 12 21l-7-7c-1.5-1.45-3-3.2-3-5.5a5.5 5.5 0 0 1 2.14-4.35"}],["path",{d:"M8.76 3.1c1.15.22 2.13.78 3.24 1.9 1.5-1.5 2.74-2 4.5-2A5.5 5.5 0 0 1 22 8.5c0 2.12-1.3 3.78-2.67 5.17"}]];Icon($$anchor,spread_props({name:"heart-off"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{
-var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Heart($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"}]];Icon($$anchor,spread_props({name:"heart"},()=>props,{get iconNode(){
-return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Image$1($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];Icon(
-$$anchor,spread_props({name:"image"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Info$1($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];Icon(
-$$anchor,spread_props({name:"info"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Key($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"}],["path",{d:"m21 2\
--9.6 9.6"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5"}]];Icon($$anchor,spread_props({name:"key"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Layers($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12.83 2.18a2 2 0 0 0-1\
-.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17"}]];Icon($$anchor,spread_props({name:"layers"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,
-fragment_1)},$$slots:{default:!0}})),pop()}function List_checks($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m3 17 2 2 4-4"}],["path",{d:"m3 7 2 2 4-4"}],["path",{d:"M13 6h8"}],["path",{d:"M13 12h8"}],["path",{d:"M13 18h8"}]];Icon($$anchor,spread_props({name:"list-checks"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(
-node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function List_restart($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M21 6H3"}],["path",{d:"M7 12H3"}],["path",{d:"M7 18H3"}],["path",{d:"M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14"}],["path",{d:"M11 10v4h4"}]];Icon($$anchor,spread_props({name:"list-restart"},()=>props,{get iconNode(){return iconNode},
-children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Loader_circle($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];Icon($$anchor,spread_props({name:"loader-circle"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{
-var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Message_square($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}]];Icon($$anchor,spread_props({name:"message-square"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{
-var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Mic($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22"}]];Icon($$anchor,spread_props({name:"mic"},()=>props,{get iconNode(){
-return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Minus($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M5 12h14"}]];Icon($$anchor,spread_props({name:"minus"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),
-node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Monitor($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21"}]];Icon($$anchor,spread_props({name:"monitor"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{
-var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Moon($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"}]];Icon($$anchor,spread_props({name:"moon"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(
-fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Music($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M9 18V5l12-2v13"}],["circle",{cx:"6",cy:"18",r:"3"}],["circle",{cx:"18",cy:"16",r:"3"}]];Icon($$anchor,spread_props({name:"music"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(
-fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Package($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"}],["path",{d:"M12 22V12"}],["polyline",{points:"3.29 7 12 12 20.71 7"}],["path",{d:"m7.5 4.27 9 5.15"}]];Icon($$anchor,
-spread_props({name:"package"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Panel_left_close($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"\
-m16 15-3-3 3-3"}]];Icon($$anchor,spread_props({name:"panel-left-close"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Panel_left($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],
-["path",{d:"M9 3v18"}]];Icon($$anchor,spread_props({name:"panel-left"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Pencil_ruler($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7\
- 5.3a2.41 2.41 0 0 0 0 3.4L7 13"}],["path",{d:"m8 6 2-2"}],["path",{d:"m18 16 2-2"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];Icon($$anchor,spread_props({name:"pencil-ruler"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(
-fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Pencil($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];Icon($$anchor,spread_props({name:"pencil"},()=>props,{get iconNode(){return iconNode},
-children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Plus($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];Icon($$anchor,spread_props({name:"plus"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),
-node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Power_off($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68"}],["path",{d:"M12 2v4"}],["path",{d:"m2 2 20 20"}]];Icon($$anchor,spread_props({name:"power-off"},()=>props,{get iconNode(){return iconNode},
-children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Power($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12 2v10"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04"}]];Icon($$anchor,spread_props({name:"power"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{
-var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Radio($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5"}],["circle",{cx:"12",cy:"12",r:"2"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5"}],["path",{d:"M19.1 4.9C23 8.8 23\
- 15.1 19.1 19"}]];Icon($$anchor,spread_props({name:"radio"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Refresh_cw($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}],
-["path",{d:"M21 3v5h-5"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}],["path",{d:"M8 16H3v5"}]];Icon($$anchor,spread_props({name:"refresh-cw"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Rotate_ccw($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots",
-"$$events","$$legacy"]);const iconNode=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}]];Icon($$anchor,spread_props({name:"rotate-ccw"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Rotate_cw($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,
-["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}]];Icon($$anchor,spread_props({name:"rotate-cw"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Search($$anchor,$$props){push$1($$props,!0);let props=rest_props(
-$$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];Icon($$anchor,spread_props({name:"search"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Server($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots",
-"$$events","$$legacy"]);const iconNode=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18"}]];Icon($$anchor,spread_props({name:"server"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{
-default:!0}})),pop()}function Settings$1($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.2\
-5a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}],["circle",{cx:"12",cy:"12",r:"3"}]];Icon($$anchor,spread_props({name:"settings"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append(
-$$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Shield_question($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3"}],["path",{d:"M12 17h.01"}]];Icon($$anchor,spread_props({name:"shield-question"},
-()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Sliders_vertical($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["line",{x1:"4",x2:"4",y1:"21",y2:"14"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3"}],["line",{x1:"12",x2:"12",y1:"21",y2:"\
-12"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16"}]];Icon($$anchor,spread_props({name:"sliders-vertical"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,
-fragment_1)},$$slots:{default:!0}})),pop()}function Sparkles($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"}],["path",{d:"M20 3v4"}],["path",{d:"M22 5h-4"}],["path",
-{d:"M4 17v2"}],["path",{d:"M5 18H3"}]];Icon($$anchor,spread_props({name:"sparkles"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Square_pen($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2\
- 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"}]];Icon($$anchor,spread_props({name:"square-pen"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Square($$anchor,$$props){push$1($$props,
-!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}]];Icon($$anchor,spread_props({name:"square"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Sun($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,[
-"$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]];Icon($$anchor,spread_props({name:"sun"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);
-snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Timer_off($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M10 2h4"}],["path",{d:"M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7"}],["path",{d:"M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2"}],["path",{d:"m2 2 20 20"}],["path",{d:"M12 12v-2"}]];Icon($$anchor,spread_props({name:"timer-off"},()=>props,{get iconNode(){
-return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Trash_2($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M3 6h18"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}],["line",{x1:"10",x2:"10",y1:"\
-11",y2:"17"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17"}]];Icon($$anchor,spread_props({name:"trash-2"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Triangle_alert($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m21.73\
- 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];Icon($$anchor,spread_props({name:"triangle-alert"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Upload($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slot\
-s","$$events","$$legacy"]);const iconNode=[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]];Icon($$anchor,spread_props({name:"upload"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Whole_word($$anchor,$$props){push$1($$props,!0);let props=rest_props(
-$$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"7",cy:"12",r:"3"}],["path",{d:"M10 9v6"}],["circle",{cx:"17",cy:"12",r:"3"}],["path",{d:"M14 7v8"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1"}]];Icon($$anchor,spread_props({name:"whole-word"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),
-pop()}function Wrench($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"}]];Icon($$anchor,spread_props({name:"wrench"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,
-()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function X($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];Icon($$anchor,spread_props({name:"x"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,
-fragment_1)},$$slots:{default:!0}})),pop()}function Zap($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];Icon($$anchor,spread_props({name:"zap"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(
-fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}const ATTACHMENT_SAVED_REGEX=/\[Attachment saved: ([^\]]+)\]/,NEWLINE_SEPARATOR=`
+ 1 18 18"}]];Icon($$anchor,spread_props({name:"brain"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Check($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M20 6 9 17l-5-5"}]];Icon($$anchor,spread_props({name:"check"},
+()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Chevron_down($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m6 9 6 6 6-6"}]];Icon($$anchor,spread_props({name:"chevron-down"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{
+var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Chevron_left($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m15 18-6-6 6-6"}]];Icon($$anchor,spread_props({name:"chevron-left"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(
+fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Chevron_up($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m18 15-6-6-6 6"}]];Icon($$anchor,spread_props({name:"chevron-up"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??
+noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Chevron_right($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m9 18 6-6-6-6"}]];Icon($$anchor,spread_props({name:"chevron-right"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{
+default:!0}})),pop()}function Chevrons_up_down($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m7 15 5 5 5-5"}],["path",{d:"m7 9 5-5 5 5"}]];Icon($$anchor,spread_props({name:"chevrons-up-down"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),
+pop()}function Circle_alert($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"10"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16"}]];Icon($$anchor,spread_props({name:"circle-alert"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append(
+$$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Circle_check_big($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}],["path",{d:"m9 11 3 3L22 4"}]];Icon($$anchor,spread_props({name:"circle-check-big"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),
+append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Circle_x($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m15 9-6 6"}],["path",{d:"m9 9 6 6"}]];Icon($$anchor,spread_props({name:"circle-x"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),
+append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Clock($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"10"}],["polyline",{points:"12 6 12 12 16 14"}]];Icon($$anchor,spread_props({name:"clock"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,
+fragment_1)},$$slots:{default:!0}})),pop()}function Code($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m16 18 6-6-6-6"}],["path",{d:"m8 6-6 6 6 6"}]];Icon($$anchor,spread_props({name:"code"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),
+pop()}function Copy($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];Icon($$anchor,spread_props({name:"copy"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,
+fragment_1)},$$slots:{default:!0}})),pop()}function Database($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5"}],["path",{d:"M3 12A9 3 0 0 0 21 12"}]];Icon($$anchor,spread_props({name:"database"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.
+children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Download($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];Icon($$anchor,spread_props({name:"download"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);
+snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Ellipsis($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"19",cy:"12",r:"1"}],["circle",{cx:"5",cy:"12",r:"1"}]];Icon($$anchor,spread_props({name:"ellipsis"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(
+fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function External_link($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]];Icon($$anchor,spread_props({name:"external-link"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{
+var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Eye($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];Icon($$anchor,spread_props({name:"eye"},()=>props,{get iconNode(){
+return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function File_text($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}],["path",{d:"M10 9H8"}],["path",{d:"M16\
+ 13H8"}],["path",{d:"M16 17H8"}]];Icon($$anchor,spread_props({name:"file-text"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function File_x($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2\
+ 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}],["path",{d:"m14.5 12.5-5 5"}],["path",{d:"m9.5 12.5 5 5"}]];Icon($$anchor,spread_props({name:"file-x"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function File$1($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots",
+"$$events","$$legacy"]);const iconNode=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}]];Icon($$anchor,spread_props({name:"file"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Flask_conical($$anchor,$$props){push$1($$props,!0);let props=rest_props(
+$$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2"}],["path",{d:"M6.453 15h11.094"}],["path",{d:"M8.5 2h7"}]];Icon($$anchor,spread_props({name:"flask-conical"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{
+default:!0}})),pop()}function Folder_open($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"}]];Icon($$anchor,spread_props({name:"folder-open"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),
+node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Funnel($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z"}]];Icon($$anchor,spread_props({name:"funnel"},()=>props,{get iconNode(){return iconNode},
+children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Gauge($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m12 14 4-4"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}]];Icon($$anchor,spread_props({name:"gauge"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{
+var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Git_branch($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["line",{x1:"6",x2:"6",y1:"3",y2:"15"}],["circle",{cx:"18",cy:"6",r:"3"}],["circle",{cx:"6",cy:"18",r:"3"}],["path",{d:"M18 9a9 9 0 0 1-9 9"}]];Icon($$anchor,spread_props({name:"git-branch"},()=>props,{
+get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Globe($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}],["path",{d:"M2 12h20"}]];Icon($$anchor,spread_props(
+{name:"globe"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Heart_off($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["line",{x1:"2",y1:"2",x2:"22",y2:"22"}],["path",{d:"M16.5 16.5 12 21l-7-7c-1.5-1.45-3-3.2-3-5.5a5.5 5.5 0 0 1\
+ 2.14-4.35"}],["path",{d:"M8.76 3.1c1.15.22 2.13.78 3.24 1.9 1.5-1.5 2.74-2 4.5-2A5.5 5.5 0 0 1 22 8.5c0 2.12-1.3 3.78-2.67 5.17"}]];Icon($$anchor,spread_props({name:"heart-off"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Heart($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,[
+"$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"}]];Icon($$anchor,spread_props({name:"heart"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Image$1($$anchor,$$props){
+push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];Icon($$anchor,spread_props({name:"image"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},
+$$slots:{default:!0}})),pop()}function Info$1($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];Icon($$anchor,spread_props({name:"info"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},
+$$slots:{default:!0}})),pop()}function Key($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"}],["path",{d:"m21 2-9.6 9.6"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5"}]];Icon($$anchor,spread_props({name:"key"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.
+children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Layers($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 \
+0 0 22 17"}]];Icon($$anchor,spread_props({name:"layers"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function List_checks($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m3 17 2 2 4-4"}],["path",{d:"m3 7 2 2 4-4"}],["path",{
+d:"M13 6h8"}],["path",{d:"M13 12h8"}],["path",{d:"M13 18h8"}]];Icon($$anchor,spread_props({name:"list-checks"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function List_restart($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"\
+M21 6H3"}],["path",{d:"M7 12H3"}],["path",{d:"M7 18H3"}],["path",{d:"M12 18a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L11 14"}],["path",{d:"M11 10v4h4"}]];Icon($$anchor,spread_props({name:"list-restart"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Loader_circle($$anchor,$$props){
+push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];Icon($$anchor,spread_props({name:"loader-circle"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Message_square($$anchor,$$props){push$1($$props,!0);let props=rest_props(
+$$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}]];Icon($$anchor,spread_props({name:"message-square"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Mic($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,
+["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22"}]];Icon($$anchor,spread_props({name:"mic"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Minus($$anchor,$$props){
+push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M5 12h14"}]];Icon($$anchor,spread_props({name:"minus"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Monitor($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","\
+$$events","$$legacy"]);const iconNode=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21"}]];Icon($$anchor,spread_props({name:"monitor"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Moon($$anchor,$$props){push$1(
+$$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"}]];Icon($$anchor,spread_props({name:"moon"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Music($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,
+["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M9 18V5l12-2v13"}],["circle",{cx:"6",cy:"18",r:"3"}],["circle",{cx:"18",cy:"16",r:"3"}]];Icon($$anchor,spread_props({name:"music"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Package($$anchor,$$props){push$1($$props,!0);let props=rest_props(
+$$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"}],["path",{d:"M12 22V12"}],["polyline",{points:"3.29 7 12 12 20.71 7"}],["path",{d:"m7.5 4.27 9 5.15"}]];Icon($$anchor,spread_props({name:"package"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.
+children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Panel_left_close($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}],["path",{d:"m16 15-3-3 3-3"}]];Icon($$anchor,spread_props({name:"panel-left-close"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(
+fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Panel_left($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}]];Icon($$anchor,spread_props({name:"panel-left"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(
+fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Pencil_ruler($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13"}],["path",{d:"m8 6 2-2"}],["path",{d:"m18 16 2-2"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17"}],["path",{d:"M21.174 6\
+.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];Icon($$anchor,spread_props({name:"pencil-ruler"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Pencil($$anchor,$$props){push$1($$props,!0);let props=rest_props(
+$$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];Icon($$anchor,spread_props({name:"pencil"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),
+pop()}function Plus($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];Icon($$anchor,spread_props({name:"plus"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Power_off($$anchor,$$props){
+push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68"}],["path",{d:"M12 2v4"}],["path",{d:"m2 2 20 20"}]];Icon($$anchor,spread_props({name:"power-off"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{
+default:!0}})),pop()}function Power($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12 2v10"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04"}]];Icon($$anchor,spread_props({name:"power"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}
+function Radio($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5"}],["circle",{cx:"12",cy:"12",r:"2"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19"}]];Icon($$anchor,spread_props({name:"radio"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),
+node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Refresh_cw($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}],["path",{d:"M8 16H3v5"}]];Icon($$anchor,spread_props({name:"refresh-cw"},
+()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Rotate_ccw($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}]];Icon($$anchor,spread_props({name:"\
+rotate-ccw"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Rotate_cw($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}]];Icon($$anchor,spread_props(
+{name:"rotate-cw"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Search($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];Icon($$anchor,spread_props({name:"search"},
+()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Server($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2"}],["line",{
+x1:"6",x2:"6.01",y1:"6",y2:"6"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18"}]];Icon($$anchor,spread_props({name:"server"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Settings$1($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["p\
+ath",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0\
+-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}],["circle",{cx:"12",cy:"12",r:"3"}]];Icon($$anchor,spread_props({name:"settings"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Shield_question($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots",
+"$$events","$$legacy"]);const iconNode=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3"}],["path",{d:"M12 17h.01"}]];Icon($$anchor,spread_props({name:"shield-question"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.
+children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Sliders_vertical($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["line",{x1:"4",x2:"4",y1:"21",y2:"14"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3"}],["line",{x1:"2",x2:"6",y1:"14",
+y2:"14"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16"}]];Icon($$anchor,spread_props({name:"sliders-vertical"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Sparkles($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$lega\
+cy"]);const iconNode=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"}],["path",{d:"M20 3v4"}],["path",{d:"M22 5h-4"}],["path",{d:"M4 17v2"}],["path",{d:"M5 18H3"}]];Icon($$anchor,spread_props({name:"sparkles"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{
+var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Square_pen($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.8\
+52z"}]];Icon($$anchor,spread_props({name:"square-pen"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Square($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}]];Icon($$anchor,spread_props(
+{name:"square"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Sun($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],
+["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]];Icon($$anchor,spread_props({name:"sun"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Timer_off($$anchor,$$props){push$1($$props,!0);let props=rest_props(
+$$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M10 2h4"}],["path",{d:"M4.6 11a8 8 0 0 0 1.7 8.7 8 8 0 0 0 8.7 1.7"}],["path",{d:"M7.4 7.4a8 8 0 0 1 10.3 1 8 8 0 0 1 .9 10.2"}],["path",{d:"m2 2 20 20"}],["path",{d:"M12 12v-2"}]];Icon($$anchor,spread_props({name:"timer-off"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},
+$$slots:{default:!0}})),pop()}function Trash_2($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M3 6h18"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17"}]];Icon($$anchor,spread_props({name:"trash-2"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),
+node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Triangle_alert($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];Icon($$anchor,spread_props({name:"triangle-alert"},()=>props,{get iconNode(){return iconNode},
+children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Upload($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]];Icon($$anchor,spread_props({name:"upload"},()=>props,{get iconNode(){
+return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Whole_word($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["circle",{cx:"7",cy:"12",r:"3"}],["path",{d:"M10 9v6"}],["circle",{cx:"17",cy:"12",r:"3"}],["path",{d:"M14 7v8"}],["path",{d:"M22 17v1c0 .5-.5 1-1 1H\
+3c-.5 0-1-.5-1-1v-1"}]];Icon($$anchor,spread_props({name:"whole-word"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Wrench($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1\
+.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"}]];Icon($$anchor,spread_props({name:"wrench"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function X($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$lega\
+cy"]);const iconNode=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];Icon($$anchor,spread_props({name:"x"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Zap($$anchor,$$props){push$1($$props,!0);let props=rest_props($$props,["$$slots","$$events","$$legacy"]);const iconNode=[["path",{d:"M4 14a\
+1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];Icon($$anchor,spread_props({name:"zap"},()=>props,{get iconNode(){return iconNode},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);snippet(node2,()=>$$props.children??noop$3),append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}const ATTACHMENT_SAVED_REGEX=/\[Attachment saved: ([^\]]+)\]/,NEWLINE_SEPARATOR=`\
+
`,LLM_ERROR_BLOCK_START=`
\`\`\`
border border-border/30 dark:border-border/20
shadow-sm backdrop-blur-lg!
rounded-t-lg!
-`,CHAT_FORM_POPOVER_MAX_HEIGHT="max-h-80",GOOGLE_FAVICON_BASE_URL="https://www.google.com/s2/favicons",DEFAULT_FAVICON_SIZE=32,DOMAIN_SEPARATOR=".",ROOT_DOMAIN_MIN_PARTS=2,MS_PER_SECOND=1e3,SECONDS_PER_MINUTE=60,SECONDS_PER_HOUR=3600,SHORT_DURATION_THRESHOLD=1,MEDIUM_DURATION_THRESHOLD=10,DEFAULT_PERFORMANCE_TIME="0s",KEY_VALUE_PAIR_KEY_MAX_LENGTH=256,KEY_VALUE_PAIR_VALUE_MAX_LENGTH=8192,KEY_VALUE_PAIR_UNSAFE_KEY_RE=/[\x00-\x1F\x7F]/g,KEY_VALUE_PAIR_UNSAFE_VALUE_RE=/[\x00-\x08\x0A-\x0D\x0E-\x1F\x7F]/g,
-CODE_BLOCK_REGEXP=/(```[\s\S]*?```|`[^`\n]+`)/g,LATEX_MATH_AND_CODE_PATTERN=new RegExp("(```[\\S\\s]*?```|`.*?`)|(?<!\\\\)\\\\\\[([\\S\\s]*?[^\\\\])\\\\]|(?<!\\\\)\\\\\\((.*?)\\\\\\)","g"),LATEX_LINEBREAK_REGEXP=/\$\$([\s\S]*?\\\\[\s\S]*?)\$\$/,LINE_BREAK=/\r?\n/,PHRASE_PARENTS=new Set(["paragraph","heading","emphasis","strong","delete","link","linkReference","tableCell"]),NBSP=" ",TAB_AS_SPACES=NBSP.repeat(4),ALWAYS_ALLOWED_TOOLS_LOCALSTORAGE_KEY="LlamaCppWebui.alwaysAllowedTools",CONFIG_LOCALSTORAGE_KEY="\
-LlamaCppWebui.config",DISABLED_TOOLS_LOCALSTORAGE_KEY="LlamaCppWebui.disabledTools",FAVORITE_MODELS_LOCALSTORAGE_KEY="LlamaCppWebui.favoriteModels",MCP_DEFAULT_ENABLED_LOCALSTORAGE_KEY="LlamaCppWebui.mcpDefaultEnabled",USER_OVERRIDES_LOCALSTORAGE_KEY="LlamaCppWebui.userOverrides",IMAGE_NOT_ERROR_BOUND_SELECTOR="img:not([data-error-bound])",DATA_ERROR_BOUND_ATTR="errorBound",DATA_ERROR_HANDLED_ATTR="errorHandled",BOOL_TRUE_STRING="true",DEFAULT_CLIENT_VERSION="1.0.0",DEFAULT_IMAGE_MIME_TYPE=MimeTypeImage.
-PNG,MCP_ALLOWED_ICON_MIME_TYPES=new Set([MimeTypeImage.PNG,MimeTypeImage.JPEG,MimeTypeImage.JPG,MimeTypeImage.SVG,MimeTypeImage.WEBP]),MCP_PROTOCOL_VERSION="2025-06-18",DEFAULT_MCP_CONFIG={protocolVersion:MCP_PROTOCOL_VERSION,capabilities:{tools:{listChanged:!0}},clientInfo:{name:"llama-webui-mcp",version:DEFAULT_CLIENT_VERSION},requestTimeoutSeconds:300,connectionTimeoutMs:1e4},MCP_SERVER_ID_PREFIX="LlamaCpp-WebUI-MCP-Server",MCP_RECONNECT_INITIAL_DELAY=1e3,MCP_RECONNECT_BACKOFF_MULTIPLIER=2,MCP_RECONNECT_MAX_DELAY=3e4,
-MCP_RECONNECT_ATTEMPT_TIMEOUT_MS=15e3,EXPECTED_THEMED_ICON_PAIR_COUNT=2,CORS_PROXY_URL_PARAM="url",MCP_SESSION_ID_VISIBLE_CHARS=5,MCP_PARTIAL_REDACT_HEADERS=new Map([["mcp-session-id",MCP_SESSION_ID_VISIBLE_CHARS]]),REDACTED_HEADERS=new Set(["authorization","api-key","cookie","mcp-session-id","proxy-authorization","set-cookie","x-auth-token","x-api-key"]),MCP_TRANSPORT_LABELS={[MCPTransportType.WEBSOCKET]:"WebSocket",[MCPTransportType.STREAMABLE_HTTP]:"HTTP",[MCPTransportType.SSE]:"SSE"},MCP_TRANSPORT_ICONS={
-[MCPTransportType.WEBSOCKET]:Zap,[MCPTransportType.STREAMABLE_HTTP]:Globe,[MCPTransportType.SSE]:Radio},MCP_SERVER_URL_PLACEHOLDER="https://mcp.example.com/sse",MIN_AUTOCOMPLETE_INPUT_LENGTH=1,IMAGE_FILE_EXTENSION_REGEX=/\.(png|jpg|jpeg|gif|svg|webp)$/i,CODE_FILE_EXTENSION_REGEX=/\.(js|ts|json|yaml|yml|xml|html|css|py|rs|go|java|cpp|c|h|rb|sh|toml)$/i,TEXT_FILE_EXTENSION_REGEX=/\.(txt|md|log)$/i,PROTOCOL_PREFIX_REGEX=/^[a-z]+:\/\//,FILE_EXTENSION_REGEX=/\.[^.]+$/,DISPLAY_NAME_SEPARATOR_REGEX=/[-_]/,
-DATA_URI_BASE64_REGEX=/^data:([^;]+);base64,([A-Za-z0-9+/]+=*)$/,MCP_ATTACHMENT_NAME_PREFIX="mcp-attachment",MCP_RESOURCE_ATTACHMENT_ID_PREFIX="res",DEFAULT_IMAGE_EXTENSION="img",DEFAULT_RESOURCE_FILENAME="resource.txt",PATH_SEPARATOR="/",RESOURCE_TEXT_CONTENT_SEPARATOR=`
+`,CHAT_FORM_POPOVER_MAX_HEIGHT="max-h-80",MS_PER_SECOND=1e3,SECONDS_PER_MINUTE=60,SECONDS_PER_HOUR=3600,SHORT_DURATION_THRESHOLD=1,MEDIUM_DURATION_THRESHOLD=10,DEFAULT_PERFORMANCE_TIME="0s",KEY_VALUE_PAIR_KEY_MAX_LENGTH=256,KEY_VALUE_PAIR_VALUE_MAX_LENGTH=8192,KEY_VALUE_PAIR_UNSAFE_KEY_RE=/[\x00-\x1F\x7F]/g,KEY_VALUE_PAIR_UNSAFE_VALUE_RE=/[\x00-\x08\x0A-\x0D\x0E-\x1F\x7F]/g,CODE_BLOCK_REGEXP=/(```[\s\S]*?```|`[^`\n]+`)/g,LATEX_MATH_AND_CODE_PATTERN=new RegExp("(```[\\S\\s]*?```|`.*?`)|(?<!\\\\)\\\\\\[(\
+[\\S\\s]*?[^\\\\])\\\\]|(?<!\\\\)\\\\\\((.*?)\\\\\\)","g"),LATEX_LINEBREAK_REGEXP=/\$\$([\s\S]*?\\\\[\s\S]*?)\$\$/,LINE_BREAK=/\r?\n/,PHRASE_PARENTS=new Set(["paragraph","heading","emphasis","strong","delete","link","linkReference","tableCell"]),NBSP=" ",TAB_AS_SPACES=NBSP.repeat(4),ALWAYS_ALLOWED_TOOLS_LOCALSTORAGE_KEY="LlamaCppWebui.alwaysAllowedTools",CONFIG_LOCALSTORAGE_KEY="LlamaCppWebui.config",DISABLED_TOOLS_LOCALSTORAGE_KEY="LlamaCppWebui.disabledTools",FAVORITE_MODELS_LOCALSTORAGE_KEY="\
+LlamaCppWebui.favoriteModels",MCP_DEFAULT_ENABLED_LOCALSTORAGE_KEY="LlamaCppWebui.mcpDefaultEnabled",USER_OVERRIDES_LOCALSTORAGE_KEY="LlamaCppWebui.userOverrides",IMAGE_NOT_ERROR_BOUND_SELECTOR="img:not([data-error-bound])",DATA_ERROR_BOUND_ATTR="errorBound",DATA_ERROR_HANDLED_ATTR="errorHandled",BOOL_TRUE_STRING="true",DEFAULT_CLIENT_VERSION="1.0.0",DEFAULT_IMAGE_MIME_TYPE=MimeTypeImage.PNG,MCP_ALLOWED_ICON_MIME_TYPES=new Set([MimeTypeImage.PNG,MimeTypeImage.JPEG,MimeTypeImage.JPG,MimeTypeImage.
+SVG,MimeTypeImage.WEBP,MimeTypeImage.ICO,MimeTypeImage.ICO_MICROSOFT]),MCP_PROTOCOL_VERSION="2025-06-18",DEFAULT_MCP_CONFIG={protocolVersion:MCP_PROTOCOL_VERSION,capabilities:{tools:{listChanged:!0}},clientInfo:{name:"llama-webui-mcp",version:DEFAULT_CLIENT_VERSION},requestTimeoutSeconds:300,connectionTimeoutMs:1e4},MCP_SERVER_ID_PREFIX="LlamaCpp-WebUI-MCP-Server",MCP_RECONNECT_INITIAL_DELAY=1e3,MCP_RECONNECT_BACKOFF_MULTIPLIER=2,MCP_RECONNECT_MAX_DELAY=3e4,MCP_RECONNECT_ATTEMPT_TIMEOUT_MS=15e3,
+EXPECTED_THEMED_ICON_PAIR_COUNT=2,CORS_PROXY_URL_PARAM="url",MCP_SESSION_ID_VISIBLE_CHARS=5,MCP_PARTIAL_REDACT_HEADERS=new Map([["mcp-session-id",MCP_SESSION_ID_VISIBLE_CHARS]]),REDACTED_HEADERS=new Set(["authorization","api-key","cookie","mcp-session-id","proxy-authorization","set-cookie","x-auth-token","x-api-key"]),MCP_TRANSPORT_LABELS={[MCPTransportType.WEBSOCKET]:"WebSocket",[MCPTransportType.STREAMABLE_HTTP]:"HTTP",[MCPTransportType.SSE]:"SSE"},MCP_TRANSPORT_ICONS={[MCPTransportType.WEBSOCKET]:Zap,
+[MCPTransportType.STREAMABLE_HTTP]:Globe,[MCPTransportType.SSE]:Radio},MCP_SERVER_URL_PLACEHOLDER="https://mcp.example.com/sse",MIN_AUTOCOMPLETE_INPUT_LENGTH=1,IMAGE_FILE_EXTENSION_REGEX=/\.(png|jpg|jpeg|gif|svg|webp)$/i,CODE_FILE_EXTENSION_REGEX=/\.(js|ts|json|yaml|yml|xml|html|css|py|rs|go|java|cpp|c|h|rb|sh|toml)$/i,TEXT_FILE_EXTENSION_REGEX=/\.(txt|md|log)$/i,PROTOCOL_PREFIX_REGEX=/^[a-z]+:\/\//,FILE_EXTENSION_REGEX=/\.[^.]+$/,DISPLAY_NAME_SEPARATOR_REGEX=/[-_]/,DATA_URI_BASE64_REGEX=/^data:([^;]+);base64,([A-Za-z0-9+/]+=*)$/,
+MCP_ATTACHMENT_NAME_PREFIX="mcp-attachment",MCP_RESOURCE_ATTACHMENT_ID_PREFIX="res",DEFAULT_IMAGE_EXTENSION="img",DEFAULT_RESOURCE_FILENAME="resource.txt",PATH_SEPARATOR="/",RESOURCE_TEXT_CONTENT_SEPARATOR=`
`,RESOURCE_UNKNOWN_TYPE="unknown type",BINARY_CONTENT_LABEL="Binary content",IMAGE_MIME_TO_EXTENSION={[MimeTypeImage.JPEG]:"jpg",[MimeTypeImage.JPG]:"jpg",[MimeTypeImage.PNG]:"png",[MimeTypeImage.GIF]:"gif",[MimeTypeImage.WEBP]:"webp"},EXPORT_CONV_ID_TRIM_LENGTH=8,EXPORT_CONV_NAME_SUFFIX_MAX_LENGTH=20,ISO_TIMESTAMP_SLICE_LENGTH=19,NON_ALPHANUMERIC_REGEX=/[^a-z0-9]/gi,EXPORT_CONV_NONALNUM_REPLACEMENT="_",MULTIPLE_UNDERSCORE_REGEX=/_+/g,ISO_DATE_TIME_SEPARATOR="T",ISO_DATE_TIME_SEPARATOR_REPLACEMENT="\
_",ISO_TIME_SEPARATOR=":",ISO_TIME_SEPARATOR_REPLACEMENT="-",MODEL_ID_NOT_FOUND=-1,MODEL_ID_ORG_SEPARATOR="/",MODEL_ID_SEGMENT_SEPARATOR="-",MODEL_ID_QUANTIZATION_SEPARATOR=":",MODEL_QUANTIZATION_SEGMENT_RE=/^(I?Q\d+(_[A-Z0-9]+)*|F\d+|BF\d+|MXFP\d+(_[A-Z0-9]+)*)$/i,MODEL_CUSTOM_QUANTIZATION_PREFIX_RE=/^UD$/i,MODEL_PARAMS_RE=/^\d+(\.\d+)?[BbMmKkTt]$/,MODEL_ACTIVATED_PARAMS_RE=/^[Aa]\d+(\.\d+)?[BbMmKkTt]$/,MODEL_IGNORED_SEGMENTS=new Set(["GGUF","GGML"]),PRECISION_MULTIPLIER=1e6,PROCESSING_INFO_TIMEOUT=2e3,
GO+"",FileExtensionText.GO,MimeTypeText.GO,FileTypeText.RUST+"",FileExtensionText.RS,MimeTypeText.RUST,FileTypeText.SHELL+"",FileExtensionText.SH,FileExtensionText.BAT,MimeTypeText.SHELL,MimeTypeText.BAT,FileTypeText.SQL+"",FileExtensionText.SQL,MimeTypeText.SQL,FileTypeText.R+"",FileExtensionText.R,MimeTypeText.R,FileTypeText.SCALA+"",FileExtensionText.SCALA,MimeTypeText.SCALA,FileTypeText.KOTLIN+"",FileExtensionText.KT,MimeTypeText.KOTLIN,FileTypeText.SWIFT+"",FileExtensionText.SWIFT,MimeTypeText.
SWIFT,FileTypeText.DART+"",FileExtensionText.DART,MimeTypeText.DART,FileTypeText.VUE+"",FileExtensionText.VUE,MimeTypeText.VUE,FileTypeText.SVELTE+"",FileExtensionText.SVELTE,MimeTypeText.SVELTE,FileTypeText.LATEX+"",FileExtensionText.TEX,MimeTypeText.LATEX,MimeTypeText.TEX,MimeTypeText.TEX_APP,FileTypeText.BIBTEX+"",FileExtensionText.BIB,MimeTypeText.BIBTEX,FileTypeText.CUDA+"",FileExtensionText.CU,FileExtensionText.CUH,MimeTypeText.CUDA,FileTypeText.VULKAN+"",FileExtensionText.COMP,MimeTypeText.
PLAIN,FileTypeText.HASKELL+"",FileExtensionText.HS,MimeTypeText.HASKELL,FileTypeText.CSHARP+"",FileExtensionText.CS,MimeTypeText.CSHARP,FileTypeText.PROPERTIES+"",FileExtensionText.PROPERTIES,MimeTypeText.PROPERTIES;const BR_PATTERN=/<br\s*\/?\s*>/gi,LIST_PATTERN=/^<ul>([\s\S]*)<\/ul>$/i,LI_PATTERN=/<li>([\s\S]*?)<\/li>/gi,TOOL_GROUP_LABELS={[ToolSource.BUILTIN]:"Built-in",[ToolSource.CUSTOM]:"JSON Schema"},TOOL_SERVER_LABELS={[ToolSource.BUILTIN]:"Built-in Tools",[ToolSource.CUSTOM]:"Custom Too\
-ls"},TOOLTIP_DELAY_DURATION=500;var root$1R=from_svg('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 174 174" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1"><g id="shape-320b5b95-d08d-8089-8007-585a8e498184"><defs><clipPath id="frame-clip-320b5b95-d08d-8089-8007-585a8e498184-render-1" class="frame-clip frame-clip-def"><rect rx="0" ry="0" x="0" y="0" width="174.00000000000045" height="174" transform="matrix(1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000)"><\
+ls"},TOOLTIP_DELAY_DURATION=500;var root$1S=from_svg('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 174 174" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1"><g id="shape-320b5b95-d08d-8089-8007-585a8e498184"><defs><clipPath id="frame-clip-320b5b95-d08d-8089-8007-585a8e498184-render-1" class="frame-clip frame-clip-def"><rect rx="0" ry="0" x="0" y="0" width="174.00000000000045" height="174" transform="matrix(1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000)"><\
/rect></clipPath></defs><g class="frame-container-wrapper"><g class="frame-container-blur"><g class="frame-container-shadows"><g clip-path="url(#frame-clip-320b5b95-d08d-8089-8007-585a8e498184-render-1)" fill="none"><g class="fills" id="fills-320b5b95-d08d-8089-8007-585a8e498184"><rect rx="0" ry="0" x="0" y="0" width="174.00000000000045" height="174" transform="matrix(1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000)" class="frame-background"></rect></g><g class="frame-children"><g id=\
"shape-320b5b95-d08d-8089-8007-585a974337b1"><g class="fills" id="fills-320b5b95-d08d-8089-8007-585a974337b1"><path d="M15.5587158203125,81.5927734375L83.44091796875,13.7105712890625C92.813720703125,4.3380126953125,108.0096435546875,4.3380126953125,117.3817138671875,13.7105712890625L117.3817138671875,13.7105712890625C126.7547607421875,23.08306884765625,126.7547607421875,38.27911376953125,117.3817138671875,47.65167236328125L66.1168212890625,98.9169921875" fill="none" stroke-linecap="round" style=\
"fill: none;"></path></g><g fill="none" stroke-linecap="round" id="strokes-b954dcef-3e3e-8015-8007-585acd4382b6-320b5b95-d08d-8089-8007-585a974337b1" class="strokes"><g class="stroke-shape"><path d="M15.5587158203125,81.5927734375L83.44091796875,13.7105712890625C92.813720703125,4.3380126953125,108.0096435546875,4.3380126953125,117.3817138671875,13.7105712890625L117.3817138671875,13.7105712890625C126.7547607421875,23.08306884765625,126.7547607421875,38.27911376953125,117.3817138671875,47.65167236\
158203125,98.26885986328125L117.1165771484375,47.7105712890625C126.489501953125,38.3380126953125,141.6854248046875,38.3380126953125,151.0584716796875,47.7105712890625L151.4114990234375,48.0640869140625C160.7845458984375,57.43670654296875,160.7845458984375,72.6326904296875,151.4114990234375,82.00518798828125L90.018310546875,143.39886474609375C86.8941650390625,146.52288818359375,86.8941650390625,151.587890625,90.018310546875,154.71185302734375L102.62451171875,167.31890869140625" style="fill: none;\
stroke-width: 12; stroke: currentColor; stroke-opacity: 1;"></path></g></g></g><g id="shape-320b5b95-d08d-8089-8007-585a974337b3"><g class="fills" id="fills-320b5b95-d08d-8089-8007-585a974337b3"><path d="M99.79296875,30.68115234375L49.588134765625,80.8857421875C40.215576171875,90.258056640625,40.215576171875,105.45404052734375,49.588134765625,114.82708740234375L49.588134765625,114.82708740234375C58.9608154296875,124.19903564453125,74.1566162109375,124.19903564453125,83.529296875,114.82708740234\
375L133.7340087890625,64.62225341796875" fill="none" stroke-linecap="round" style="fill: none;"></path></g><g fill="none" stroke-linecap="round" id="strokes-b954dcef-3e3e-8015-8007-585acd44c5c9-320b5b95-d08d-8089-8007-585a974337b3" class="strokes"><g class="stroke-shape"><path d="M99.79296875,30.68115234375L49.588134765625,80.8857421875C40.215576171875,90.258056640625,40.215576171875,105.45404052734375,49.588134765625,114.82708740234375L49.588134765625,114.82708740234375C58.9608154296875,124.199\
-03564453125,74.1566162109375,124.19903564453125,83.529296875,114.82708740234375L133.7340087890625,64.62225341796875" style="fill: none; stroke-width: 12; stroke: currentColor; stroke-opacity: 1;"></path></g></g></g></g></g></g></g></g></g></svg>');function McpLogo($$anchor,$$props){let className=prop($$props,"class",3,""),style2=prop($$props,"style",3,"");var svg2=root$1R();template_effect(()=>{set_class(svg2,0,clsx(className())),set_style(svg2,style2())}),append($$anchor,svg2)}const FORK_TREE_DEPTH_PADDING=8,
+03564453125,74.1566162109375,124.19903564453125,83.529296875,114.82708740234375L133.7340087890625,64.62225341796875" style="fill: none; stroke-width: 12; stroke: currentColor; stroke-opacity: 1;"></path></g></g></g></g></g></g></g></g></g></svg>');function McpLogo($$anchor,$$props){let className=prop($$props,"class",3,""),style2=prop($$props,"style",3,"");var svg2=root$1S();template_effect(()=>{set_class(svg2,0,clsx(className())),set_style(svg2,style2())}),append($$anchor,svg2)}const FORK_TREE_DEPTH_PADDING=8,
SYSTEM_MESSAGE_PLACEHOLDER="System message",APP_NAME="llama.cpp",ICON_STRIP_TRANSITION_DURATION=150,ICON_STRIP_TRANSITION_DELAY_MULTIPLIER=50,SIDEBAR_ACTIONS_ITEMS=[{icon:Square_pen,tooltip:"New chat",route:"?new_chat=true#/",keys:["shift","cmd","o"]},{icon:Search,tooltip:"Search",keys:["cmd","k"]},{icon:McpLogo,tooltip:"MCP Servers",route:"#/settings/mcp",activeRouteId:"/settings/mcp"},{icon:Settings$1,tooltip:"Settings",route:"#/settings/chat/general",activeRoutePrefix:"/settings/chat"}],URI_SCHEME_SEPARATOR="\
-://",TEMPLATE_EXPRESSION_REGEX=/\{([+#./;?&]?)([^}]+)\}/g,URI_TEMPLATE_OPERATORS={RESERVED:"+",FRAGMENT:"#",PATH_SEGMENT:"/",LABEL:".",PATH_PARAM:";",FORM_QUERY:"?",FORM_CONTINUATION:"&"},URI_TEMPLATE_SEPARATORS={COMMA:",",SLASH:"/",PERIOD:".",SEMICOLON:";",QUERY_PREFIX:"?",QUERY_CONTINUATION:"&"},VARIABLE_EXPLODE_MODIFIER_REGEX=/[*]$/,VARIABLE_PREFIX_MODIFIER_REGEX=/:[\d]+$/,LEADING_SLASHES_REGEX=/^\/+/,DEFAULT_MOBILE_BREAKPOINT=768;class IsMobile extends MediaQuery{constructor(breakpoint=DEFAULT_MOBILE_BREAKPOINT){
+://",TEMPLATE_EXPRESSION_REGEX=/\{([+#./;?&]?)([^}]+)\}/g,URI_TEMPLATE_OPERATORS={RESERVED:"+",FRAGMENT:"#",PATH_SEGMENT:"/",LABEL:".",PATH_PARAM:";",FORM_QUERY:"?",FORM_CONTINUATION:"&"},URI_TEMPLATE_SEPARATORS={COMMA:",",SLASH:"/",PERIOD:".",SEMICOLON:";",QUERY_PREFIX:"?",QUERY_CONTINUATION:"&"},VARIABLE_EXPLODE_MODIFIER_REGEX=/[*]$/,VARIABLE_PREFIX_MODIFIER_REGEX=/:[\d]+$/,LEADING_SLASHES_REGEX=/^\/+/,STD=["com","net","org","gov","edu"],STD_MIL=[...STD,"mil"],ccTLD_PREFIXES={ar:STD,bd:STD,bg:STD,
+cn:STD_MIL,eg:STD,gr:STD,hk:STD,hr:STD,lk:STD,mx:STD_MIL,my:STD_MIL,ng:STD,ph:STD,pk:STD,pl:STD,ro:STD,ru:STD,sa:STD,si:STD,tr:STD,tw:STD,ua:STD,ve:STD,au:[...STD_MIL,"id","asn","csiro"],br:[...STD_MIL,"art","eco","eng","inf","med","psi","tmp","etc","adm","adv","arq","bio","bmd","cim","cng","cnt","coop","ecn","esp","far","fm","fnd","fot","fst","g12","ggf","imb","ind","jor","jus","leg","lel","mat","mp","mus","not","ntr","odo","ppg","pro","psc","qsl","rec","slg","srv","trd","tur","tv","vet","vlog",
+"wiki","zlg"],id:[...STD_MIL,"co","go","or","web","sch"],in:[...STD_MIL,"co","gen","ind","firm","ernet","nic"],kr:[...STD_MIL,"co","go","or","ac","re"],nz:[...STD_MIL,"co","gen","geek","kiwi","maori","school","govt","health","iwi","parliament"],sg:[...STD,"per"],th:["co","go","or","in","ac","mi","net"],ae:["co","net","org","gov","ac","sch"],hu:["co","net","org","gov","edu"],il:["co","net","org","gov","ac","muni"],jp:["ac","ad","co","ed","go","gr","lg","ne","or"],ke:["co","or","ne","go","ac","sc"],
+rs:["co","net","org","gov","edu"],uk:["co","org","net","ac","gov","mil","nhs","police","mod","ltd","plc","me","sch"],za:["co","org","net","web","law","mil"]},WILDCARD_BASES={br:["nom","blog"],jp:["kobe","kyoto","nagoya","osaka","sapporo","sendai","tokyo","yokohama","aichi","akita","aomori","chiba","ehime","fukui","fukuoka","fukushima","gifu","gunma","hiroshima","hokkaido","hyogo","ibaraki","ishikawa","iwate","kagawa","kagoshima","kanagawa","kochi","kumamoto","mie","miyagi","miyazaki","nagano","n\
+ara","niigata","oita","okayama","okinawa","saga","saitama","shiga","shimane","shizuoka","tochigi","tokushima","tottori","toyama","wakayama","yamagata","yamaguchi","yamanashi"]};function buildSuffixSet(suffixes){const set2=new Set;for(const[tld,parts]of Object.entries(suffixes))for(const part of parts)set2.add(`${part}.${tld}`);return set2}const TWO_PART_PUBLIC_SUFFIXES=buildSuffixSet(ccTLD_PREFIXES),WILDCARD_PUBLIC_SUFFIXES=buildSuffixSet(WILDCARD_BASES),DEFAULT_MOBILE_BREAKPOINT=768;class IsMobile extends MediaQuery{constructor(breakpoint=DEFAULT_MOBILE_BREAKPOINT){
super(`max-width: ${breakpoint-1}px`)}}const SYNCABLE_PARAMETERS=[{key:"temperature",serverKey:"temperature",type:SyncableParameterType.NUMBER,canSync:!0},{key:"top_k",serverKey:"top_k",type:SyncableParameterType.NUMBER,canSync:!0},{key:"top_p",serverKey:"top_p",type:SyncableParameterType.NUMBER,canSync:!0},{key:"min_p",serverKey:"min_p",type:SyncableParameterType.NUMBER,canSync:!0},{key:"dynatemp_range",serverKey:"dynatemp_range",type:SyncableParameterType.NUMBER,canSync:!0},{key:"dynatemp_expo\
nent",serverKey:"dynatemp_exponent",type:SyncableParameterType.NUMBER,canSync:!0},{key:"xtc_probability",serverKey:"xtc_probability",type:SyncableParameterType.NUMBER,canSync:!0},{key:"xtc_threshold",serverKey:"xtc_threshold",type:SyncableParameterType.NUMBER,canSync:!0},{key:"typ_p",serverKey:"typ_p",type:SyncableParameterType.NUMBER,canSync:!0},{key:"repeat_last_n",serverKey:"repeat_last_n",type:SyncableParameterType.NUMBER,canSync:!0},{key:"repeat_penalty",serverKey:"repeat_penalty",type:SyncableParameterType.
NUMBER,canSync:!0},{key:"presence_penalty",serverKey:"presence_penalty",type:SyncableParameterType.NUMBER,canSync:!0},{key:"frequency_penalty",serverKey:"frequency_penalty",type:SyncableParameterType.NUMBER,canSync:!0},{key:"dry_multiplier",serverKey:"dry_multiplier",type:SyncableParameterType.NUMBER,canSync:!0},{key:"dry_base",serverKey:"dry_base",type:SyncableParameterType.NUMBER,canSync:!0},{key:"dry_allowed_length",serverKey:"dry_allowed_length",type:SyncableParameterType.NUMBER,canSync:!0},
libExports);function highlightCode(code2,language2){if(!code2)return"";try{const lang=language2.toLowerCase();return HighlightJS$1.getLanguage(lang)?HighlightJS$1.highlight(code2,{language:lang}).value:HighlightJS$1.highlightAuto(code2).value}catch{return code2.replace(AMPERSAND_REGEX,"&").replace(LT_REGEX,"<").replace(GT_REGEX,">")}}function detectIncompleteCodeBlock(markdown2){const fencePattern=new RegExp(FENCE_PATTERN.source,FENCE_PATTERN.flags),fences=[];let fenceMatch;for(;(fenceMatch=
fencePattern.exec(markdown2))!==null;){const pos=fenceMatch[0].startsWith(NEWLINE)?fenceMatch.index+1:fenceMatch.index;fences.push(pos)}if(fences.length%2===0)return null;const openingIndex=fences[fences.length-1],langMatch=markdown2.slice(openingIndex+3).match(LANG_PATTERN),language2=langMatch?.[1]||DEFAULT_LANGUAGE,codeStartIndex=openingIndex+3+(langMatch?.[0]?.length??0),code2=markdown2.slice(codeStartIndex);return{language:language2,code:code2,openingIndex}}function setConfigValue(config2,key2,value){
key2 in config2&&(config2[key2]=value)}function getConfigValue(config2,key2){return config2[key2]}function configToParameterRecord(config2,keys2){const record2={};for(const key2 of keys2){const value=getConfigValue(config2,key2);value!==void 0&&(record2[key2]=value)}return record2}function buildProxiedUrl(targetUrl){const proxyPath=`${base}${CORS_PROXY_ENDPOINT}`,proxyUrl=new URL(proxyPath,window.location.origin);return proxyUrl.searchParams.set(CORS_PROXY_URL_PARAM,targetUrl),proxyUrl}function buildProxiedHeaders(headers){
-const proxiedHeaders={};for(const[key2,value]of Object.entries(headers))proxiedHeaders[`x-proxy-header-${key2}`]=value;return proxiedHeaders}function getProxiedUrlString(targetUrl){return buildProxiedUrl(targetUrl).href}function createMessageCountMap(exportedData){const countMap=new Map;for(const item of exportedData)countMap.set(item.conv.id,item.messages.length);return countMap}const bars=Array(12).fill(0);var root_1$15=from_html('<div class="sonner-loading-bar"></div>'),root$1Q=from_html('<di\
-v><div class="sonner-spinner"></div></div>');function Loader($$anchor,$$props){push$1($$props,!0);var div=root$1Q(),div_1=child(div);each(div_1,23,()=>bars,(_,i)=>`spinner-bar-${i}`,($$anchor2,_)=>{var div_2=root_1$15();append($$anchor2,div_2)}),reset(div_1),reset(div),template_effect($0=>{set_class(div,1,$0),set_attribute(div,"data-visible",$$props.visible)},[()=>clsx(["sonner-loading-wrapper",$$props.class].filter(Boolean).join(" "))]),append($$anchor,div),pop()}function cn(...classes){return classes.
-filter(Boolean).join(" ")}const isBrowser$1=typeof document<"u",defaultWindow$2=typeof window<"u"?window:void 0;function getActiveElement$2(document2){let activeElement=document2.activeElement;for(;activeElement?.shadowRoot;){const node2=activeElement.shadowRoot.activeElement;if(node2===activeElement)break;activeElement=node2}return activeElement}let ActiveElement$2=class{#document;#subscribe;constructor(options={}){const{window:window2=defaultWindow$2,document:document2=window2?.document}=options;
-window2!==void 0&&(this.#document=document2,this.#subscribe=createSubscriber(update2=>{const cleanupFocusIn=on(window2,"focusin",update2),cleanupFocusOut=on(window2,"focusout",update2);return()=>{cleanupFocusIn(),cleanupFocusOut()}}))}get current(){return this.#subscribe?.(),this.#document?getActiveElement$2(this.#document):null}};new ActiveElement$2;class Context2{#name;#key;constructor(name){this.#name=name,this.#key=Symbol(name)}get key(){return this.#key}exists(){return hasContext(this.#key)}get(){
-const context=getContext(this.#key);if(context===void 0)throw new Error(`Context "${this.#name}" not found`);return context}getOr(fallback2){const context=getContext(this.#key);return context===void 0?fallback2:context}set(context){return setContext(this.#key,context)}}const sonnerContext=new Context2("<Toaster/>");let toastsCounter=0;class ToastState{#toasts=state$1(proxy([]));get toasts(){return get$3(this.#toasts)}set toasts(value){set$1(this.#toasts,value,!0)}#heights=state$1(proxy([]));get heights(){
-return get$3(this.#heights)}set heights(value){set$1(this.#heights,value,!0)}#findToastIdx=id2=>{const idx=this.toasts.findIndex(toast2=>toast2.id===id2);return idx===-1?null:idx};addToast=data=>{isBrowser$1&&this.toasts.unshift(data)};updateToast=({id:id2,data,type:type2,message})=>{const toastIdx=this.toasts.findIndex(toast2=>toast2.id===id2),toastToUpdate=this.toasts[toastIdx];this.toasts[toastIdx]={...toastToUpdate,...data,id:id2,title:message,type:type2,updated:!0}};create=data=>{const{message,
-...rest}=data,id2=typeof data?.id=="number"||data.id&&data.id?.length>0?data.id:toastsCounter++,dismissable=data.dismissable===void 0?!0:data.dismissable,type2=data.type===void 0?"default":data.type;return untrack$1(()=>{this.toasts.find(toast2=>toast2.id===id2)?this.updateToast({id:id2,data,type:type2,message,dismissable}):this.addToast({...rest,id:id2,title:message,dismissable,type:type2})}),id2};dismiss=id2=>(untrack$1(()=>{if(id2===void 0){this.toasts=this.toasts.map(toast2=>({...toast2,dismiss:!0}));
-return}const toastIdx=this.toasts.findIndex(toast2=>toast2.id===id2);this.toasts[toastIdx]&&(this.toasts[toastIdx]={...this.toasts[toastIdx],dismiss:!0})}),id2);remove=id2=>{if(id2===void 0){this.toasts=[];return}const toastIdx=this.#findToastIdx(id2);if(toastIdx!==null)return this.toasts.splice(toastIdx,1),id2};message=(message,data)=>this.create({...data,type:"default",message});error=(message,data)=>this.create({...data,type:"error",message});success=(message,data)=>this.create({...data,type:"\
-success",message});info=(message,data)=>this.create({...data,type:"info",message});warning=(message,data)=>this.create({...data,type:"warning",message});loading=(message,data)=>this.create({...data,type:"loading",message});promise=(promise,data)=>{if(!data)return;let id2;data.loading!==void 0&&(id2=this.create({...data,promise,type:"loading",message:typeof data.loading=="string"?data.loading:data.loading()}));const p2=promise instanceof Promise?promise:promise();let shouldDismiss=id2!==void 0;return p2.
-then(response=>{if(typeof response=="object"&&response&&"ok"in response&&typeof response.ok=="boolean"&&!response.ok){shouldDismiss=!1;const message=constructPromiseErrorMessage(response);this.create({id:id2,type:"error",message})}else if(data.success!==void 0){shouldDismiss=!1;const message=typeof data.success=="function"?data.success(response):data.success;this.create({id:id2,type:"success",message})}}).catch(error2=>{if(data.error!==void 0){shouldDismiss=!1;const message=typeof data.error=="f\
-unction"?data.error(error2):data.error;this.create({id:id2,type:"error",message})}}).finally(()=>{shouldDismiss&&(this.dismiss(id2),id2=void 0),data.finally?.()}),id2};custom=(component2,data)=>{const id2=data?.id||toastsCounter++;return this.create({component:component2,id:id2,...data}),id2};removeHeight=id2=>{this.heights=this.heights.filter(height=>height.toastId!==id2)};setHeight=data=>{const toastIdx=this.#findToastIdx(data.toastId);if(toastIdx===null){this.heights.push(data);return}this.heights[toastIdx]=
-data};reset=()=>{this.toasts=[],this.heights=[]}}function constructPromiseErrorMessage(response){return response&&typeof response=="object"&&"status"in response?`HTTP error! Status: ${response.status}`:`Error! ${response}`}const toastState=new ToastState;function toastFunction(message,data){return toastState.create({message,...data})}class SonnerState{#activeToasts=user_derived(()=>toastState.toasts.filter(toast2=>!toast2.dismiss));get toasts(){return get$3(this.#activeToasts)}}const basicToast=toastFunction,
-toast=Object.assign(basicToast,{success:toastState.success,info:toastState.info,warning:toastState.warning,error:toastState.error,custom:toastState.custom,message:toastState.message,promise:toastState.promise,dismiss:toastState.dismiss,loading:toastState.loading,getActiveToasts:()=>toastState.toasts.filter(toast2=>!toast2.dismiss)});function isAction(action2){return action2.label!==void 0}function useDocumentHidden(){let current2=state$1(proxy(typeof document<"u"?document.hidden:!1));return user_effect(
-()=>on(document,"visibilitychange",()=>{set$1(current2,document.hidden,!0)})),{get current(){return get$3(current2)}}}const TOAST_LIFETIME$1=4e3,GAP$1=14,SWIPE_THRESHOLD=45,TIME_BEFORE_UNMOUNT=200,SCALE_MULTIPLIER=.05,DEFAULT_TOAST_CLASSES={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function getDefaultSwipeDirections(position2){const[y,x]=position2.split("-"),directions=[];return y&&
-directions.push(y),x&&directions.push(x),directions}function getDampening(delta){return 1/(1.5+Math.abs(delta)/20)}var root_2$1e=from_html("<div><!></div>"),root_4$E=from_html('<button data-close-button=""><!></button>'),root_7$v=from_html('<div data-icon=""><!> <!></div>'),root_20$5=from_html('<div data-description=""><!></div>'),root_25$4=from_html('<button data-button="" data-cancel=""> </button>'),root_28$1=from_html('<button data-button=""> </button>'),root_6$y=from_html('<!> <div data-cont\
-ent=""><div data-title=""><!></div> <!></div> <!> <!>',1),root$1P=from_html('<li data-sonner-toast=""><!> <!></li>');function Toast($$anchor,$$props){push$1($$props,!0);const LoadingIcon=$$anchor2=>{var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor3=>{var div=root_2$1e(),node_1=child(div);snippet(node_1,()=>$$props.loadingIcon),reset(div),template_effect($0=>{set_class(div,1,$0),set_attribute(div,"data-visible",get$3(toastType)==="loading")},[()=>clsx(cn(get$3(classes)?.
-loader,$$props.toast?.classes?.loader,"sonner-loader"))]),append($$anchor3,div)},alternate=$$anchor3=>{{let $0=user_derived(()=>cn(get$3(classes)?.loader,$$props.toast.classes?.loader)),$1=user_derived(()=>get$3(toastType)==="loading");Loader($$anchor3,{get class(){return get$3($0)},get visible(){return get$3($1)}})}};if_block(node2,$$render=>{$$props.loadingIcon?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment)};let cancelButtonStyle=prop($$props,"cancelButtonStyle",3,""),
-actionButtonStyle=prop($$props,"actionButtonStyle",3,""),descriptionClass=prop($$props,"descriptionClass",3,""),unstyled=prop($$props,"unstyled",3,!1),defaultRichColors=prop($$props,"defaultRichColors",3,!1);const defaultClasses={...DEFAULT_TOAST_CLASSES};let mounted=state$1(!1),removed=state$1(!1),swiping=state$1(!1),swipeOut=state$1(!1),isSwiped=state$1(!1),offsetBeforeRemove=state$1(0),initialHeight=state$1(0),remainingTime=$$props.toast.duration||$$props.duration||TOAST_LIFETIME$1,toastRef=state$1(
-void 0),swipeDirection=state$1(null),swipeOutDirection=state$1(null);const isFront=user_derived(()=>$$props.index===0),isVisible=user_derived(()=>$$props.index+1<=$$props.visibleToasts),toastType=user_derived(()=>$$props.toast.type),dismissable=user_derived(()=>$$props.toast.dismissable!==!1),toastClass=user_derived(()=>$$props.toast.class||""),toastDescriptionClass=user_derived(()=>$$props.toast.descriptionClass||""),heightIndex=user_derived(()=>toastState.heights.findIndex(height=>height.toastId===
-$$props.toast.id)||0),closeButton=user_derived(()=>$$props.toast.closeButton??$$props.closeButton),duration2=user_derived(()=>$$props.toast.duration??$$props.duration??TOAST_LIFETIME$1);let pointerStart=null;const coords=user_derived(()=>$$props.position.split("-")),toastsHeightBefore=user_derived(()=>toastState.heights.reduce((prev2,curr,reducerIndex)=>reducerIndex>=get$3(heightIndex)?prev2:prev2+curr.height,0)),isDocumentHidden=useDocumentHidden(),invert=user_derived(()=>$$props.toast.invert||
-$$props.invert),disabled=user_derived(()=>get$3(toastType)==="loading"),classes=user_derived(()=>({...defaultClasses,...$$props.classes})),toastTitle=user_derived(()=>$$props.toast.title),toastDescription=user_derived(()=>$$props.toast.description);let closeTimerStartTime=state$1(0),lastCloseTimerStartTime=state$1(0);const offset2=user_derived(()=>Math.round(get$3(heightIndex)*GAP$1+get$3(toastsHeightBefore)));user_effect(()=>{get$3(toastTitle),get$3(toastDescription);let scale2;$$props.expanded||
-$$props.expandByDefault?scale2=1:scale2=1-$$props.index*SCALE_MULTIPLIER;const toastEl=untrack$1(()=>get$3(toastRef));if(toastEl===void 0)return;toastEl.style.setProperty("height","auto");const offsetHeight=toastEl.offsetHeight,rectHeight=toastEl.getBoundingClientRect().height,scaledRectHeight=Math.round(rectHeight/scale2+Number.EPSILON&100)/100;toastEl.style.removeProperty("height");let finalHeight;Math.abs(scaledRectHeight-offsetHeight)<1?finalHeight=scaledRectHeight:finalHeight=offsetHeight,set$1(
-initialHeight,finalHeight,!0),untrack$1(()=>{toastState.setHeight({toastId:$$props.toast.id,height:finalHeight})})});function deleteToast(){set$1(removed,!0),set$1(offsetBeforeRemove,get$3(offset2),!0),toastState.removeHeight($$props.toast.id),setTimeout(()=>{toastState.remove($$props.toast.id)},TIME_BEFORE_UNMOUNT)}let timeoutId;const isPromiseLoadingOrInfiniteDuration=user_derived(()=>$$props.toast.promise&&get$3(toastType)==="loading"||$$props.toast.duration===Number.POSITIVE_INFINITY);function startTimer(){
-set$1(closeTimerStartTime,new Date().getTime(),!0),timeoutId=setTimeout(()=>{$$props.toast.onAutoClose?.($$props.toast),deleteToast()},remainingTime)}function pauseTimer(){if(get$3(lastCloseTimerStartTime)<get$3(closeTimerStartTime)){const elapsedTime=new Date().getTime()-get$3(closeTimerStartTime);remainingTime=remainingTime-elapsedTime}set$1(lastCloseTimerStartTime,new Date().getTime(),!0)}user_effect(()=>{$$props.toast.updated&&(clearTimeout(timeoutId),remainingTime=get$3(duration2),startTimer())}),
-user_effect(()=>(get$3(isPromiseLoadingOrInfiniteDuration)||($$props.expanded||$$props.interacting||isDocumentHidden.current?pauseTimer():startTimer()),()=>clearTimeout(timeoutId))),onMount$1(()=>{set$1(mounted,!0);const height=get$3(toastRef)?.getBoundingClientRect().height;return set$1(initialHeight,height,!0),toastState.setHeight({toastId:$$props.toast.id,height}),()=>{toastState.removeHeight($$props.toast.id)}}),user_effect(()=>{$$props.toast.delete&&untrack$1(()=>{deleteToast(),$$props.toast.
-onDismiss?.($$props.toast)})});const handlePointerDown=event2=>{if(get$3(disabled))return;set$1(offsetBeforeRemove,get$3(offset2),!0);const target2=event2.target;target2.setPointerCapture(event2.pointerId),target2.tagName!=="BUTTON"&&(set$1(swiping,!0),pointerStart={x:event2.clientX,y:event2.clientY})},handlePointerUp=()=>{if(get$3(swipeOut)||!get$3(dismissable))return;pointerStart=null;const swipeAmountX=Number(get$3(toastRef)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),swipeAmountY=Number(
-get$3(toastRef)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),timeTaken=new Date().getTime()-0,swipeAmount=get$3(swipeDirection)==="x"?swipeAmountX:swipeAmountY,velocity=Math.abs(swipeAmount)/timeTaken;if(Math.abs(swipeAmount)>=SWIPE_THRESHOLD||velocity>.11){set$1(offsetBeforeRemove,get$3(offset2),!0),$$props.toast.onDismiss?.($$props.toast),get$3(swipeDirection)==="x"?set$1(swipeOutDirection,swipeAmountX>0?"right":"left",!0):set$1(swipeOutDirection,swipeAmountY>0?"down":"up",
-!0),deleteToast(),set$1(swipeOut,!0);return}else get$3(toastRef)?.style.setProperty("--swipe-amount-x","0px"),get$3(toastRef)?.style.setProperty("--swipe-amount-y","0px");set$1(isSwiped,!1),set$1(swiping,!1),set$1(swipeDirection,null)},handlePointerMove=event2=>{if(!pointerStart||!get$3(dismissable)||(window.getSelection()?.toString().length??-1)>0)return;const yDelta=event2.clientY-pointerStart.y,xDelta=event2.clientX-pointerStart.x,swipeDirections=$$props.swipeDirections??getDefaultSwipeDirections(
-$$props.position);!get$3(swipeDirection)&&(Math.abs(xDelta)>1||Math.abs(yDelta)>1)&&set$1(swipeDirection,Math.abs(xDelta)>Math.abs(yDelta)?"x":"y",!0);let swipeAmount={x:0,y:0};if(get$3(swipeDirection)==="y"){if(swipeDirections.includes("top")||swipeDirections.includes("bottom"))if(swipeDirections.includes("top")&&yDelta<0||swipeDirections.includes("bottom")&&yDelta>0)swipeAmount.y=yDelta;else{const dampenedDelta=yDelta*getDampening(yDelta);swipeAmount.y=Math.abs(dampenedDelta)<Math.abs(yDelta)?
-dampenedDelta:yDelta}}else if(get$3(swipeDirection)==="x"&&(swipeDirections.includes("left")||swipeDirections.includes("right")))if(swipeDirections.includes("left")&&xDelta<0||swipeDirections.includes("right")&&xDelta>0)swipeAmount.x=xDelta;else{const dampenedDelta=xDelta*getDampening(xDelta);swipeAmount.x=Math.abs(dampenedDelta)<Math.abs(xDelta)?dampenedDelta:xDelta}(Math.abs(swipeAmount.x)>0||Math.abs(swipeAmount.y)>0)&&set$1(isSwiped,!0),get$3(toastRef)?.style.setProperty("--swipe-amount-x",`${swipeAmount.
-x}px`),get$3(toastRef)?.style.setProperty("--swipe-amount-y",`${swipeAmount.y}px`)},handleDragEnd=()=>{set$1(swiping,!1),set$1(swipeDirection,null),pointerStart=null},icon=user_derived(()=>$$props.toast.icon?$$props.toast.icon:get$3(toastType)==="success"?$$props.successIcon:get$3(toastType)==="error"?$$props.errorIcon:get$3(toastType)==="warning"?$$props.warningIcon:get$3(toastType)==="info"?$$props.infoIcon:get$3(toastType)==="loading"?$$props.loadingIcon:null);var li2=root$1P();set_attribute(
-li2,"tabindex",0);let styles2;var node_2=child(li2);{var consequent_1=$$anchor2=>{var button=root_4$E(),node_3=child(button);snippet(node_3,()=>$$props.closeIcon??noop$3),reset(button),template_effect($0=>{set_attribute(button,"aria-label",$$props.closeButtonAriaLabel),set_attribute(button,"data-disabled",get$3(disabled)),set_class(button,1,$0)},[()=>clsx(cn(get$3(classes)?.closeButton,$$props.toast?.classes?.closeButton))]),delegated("click",button,()=>{get$3(disabled)||!get$3(dismissable)||(deleteToast(),
-$$props.toast.onDismiss?.($$props.toast))}),append($$anchor2,button)};if_block(node_2,$$render=>{get$3(closeButton)&&!$$props.toast.component&&get$3(toastType)!=="loading"&&$$props.closeIcon!==null&&$$render(consequent_1)})}var node_4=sibling(node_2,2);{var consequent_2=$$anchor2=>{const Component=user_derived(()=>$$props.toast.component);var fragment_2=comment$2(),node_5=first_child(fragment_2);component(node_5,()=>get$3(Component),($$anchor3,Component_1)=>{Component_1($$anchor3,spread_props(()=>$$props.
-toast.componentProps,{closeToast:deleteToast}))}),append($$anchor2,fragment_2)},alternate_4=$$anchor2=>{var fragment_3=root_6$y(),node_6=first_child(fragment_3);{var consequent_11=$$anchor3=>{var div_1=root_7$v(),node_7=child(div_1);{var consequent_4=$$anchor4=>{var fragment_4=comment$2(),node_8=first_child(fragment_4);{var consequent_3=$$anchor5=>{var fragment_5=comment$2(),node_9=first_child(fragment_5);component(node_9,()=>$$props.toast.icon,($$anchor6,toast_icon)=>{toast_icon($$anchor6,{})}),
-append($$anchor5,fragment_5)},alternate_1=$$anchor5=>{LoadingIcon($$anchor5)};if_block(node_8,$$render=>{$$props.toast.icon?$$render(consequent_3):$$render(alternate_1,-1)})}append($$anchor4,fragment_4)};if_block(node_7,$$render=>{($$props.toast.promise||get$3(toastType)==="loading")&&$$render(consequent_4)})}var node_10=sibling(node_7,2);{var consequent_10=$$anchor4=>{var fragment_7=comment$2(),node_11=first_child(fragment_7);{var consequent_5=$$anchor5=>{var fragment_8=comment$2(),node_12=first_child(
-fragment_8);component(node_12,()=>$$props.toast.icon,($$anchor6,toast_icon_1)=>{toast_icon_1($$anchor6,{})}),append($$anchor5,fragment_8)},consequent_6=$$anchor5=>{var fragment_9=comment$2(),node_13=first_child(fragment_9);snippet(node_13,()=>$$props.successIcon??noop$3),append($$anchor5,fragment_9)},consequent_7=$$anchor5=>{var fragment_10=comment$2(),node_14=first_child(fragment_10);snippet(node_14,()=>$$props.errorIcon??noop$3),append($$anchor5,fragment_10)},consequent_8=$$anchor5=>{var fragment_11=comment$2(),
-node_15=first_child(fragment_11);snippet(node_15,()=>$$props.warningIcon??noop$3),append($$anchor5,fragment_11)},consequent_9=$$anchor5=>{var fragment_12=comment$2(),node_16=first_child(fragment_12);snippet(node_16,()=>$$props.infoIcon??noop$3),append($$anchor5,fragment_12)};if_block(node_11,$$render=>{$$props.toast.icon?$$render(consequent_5):get$3(toastType)==="success"?$$render(consequent_6,1):get$3(toastType)==="error"?$$render(consequent_7,2):get$3(toastType)==="warning"?$$render(consequent_8,
-3):get$3(toastType)==="info"&&$$render(consequent_9,4)})}append($$anchor4,fragment_7)};if_block(node_10,$$render=>{$$props.toast.type!=="loading"&&$$render(consequent_10)})}reset(div_1),template_effect($0=>set_class(div_1,1,$0),[()=>clsx(cn(get$3(classes)?.icon,$$props.toast?.classes?.icon))]),append($$anchor3,div_1)};if_block(node_6,$$render=>{(get$3(toastType)||$$props.toast.icon||$$props.toast.promise)&&$$props.toast.icon!==null&&(get$3(icon)!==null||$$props.toast.icon)&&$$render(consequent_11)})}
-var div_2=sibling(node_6,2),div_3=child(div_2),node_17=child(div_3);{var consequent_13=$$anchor3=>{var fragment_13=comment$2(),node_18=first_child(fragment_13);{var consequent_12=$$anchor4=>{const Title=user_derived(()=>$$props.toast.title);var fragment_14=comment$2(),node_19=first_child(fragment_14);component(node_19,()=>get$3(Title),($$anchor5,Title_1)=>{Title_1($$anchor5,spread_props(()=>$$props.toast.componentProps))}),append($$anchor4,fragment_14)},alternate_2=$$anchor4=>{var text2=text$8();
-template_effect(()=>set_text(text2,$$props.toast.title)),append($$anchor4,text2)};if_block(node_18,$$render=>{typeof $$props.toast.title!="string"?$$render(consequent_12):$$render(alternate_2,-1)})}append($$anchor3,fragment_13)};if_block(node_17,$$render=>{$$props.toast.title&&$$render(consequent_13)})}reset(div_3);var node_20=sibling(div_3,2);{var consequent_15=$$anchor3=>{var div_4=root_20$5(),node_21=child(div_4);{var consequent_14=$$anchor4=>{const Description=user_derived(()=>$$props.toast.
-description);var fragment_16=comment$2(),node_22=first_child(fragment_16);component(node_22,()=>get$3(Description),($$anchor5,Description_1)=>{Description_1($$anchor5,spread_props(()=>$$props.toast.componentProps))}),append($$anchor4,fragment_16)},alternate_3=$$anchor4=>{var text_1=text$8();template_effect(()=>set_text(text_1,$$props.toast.description)),append($$anchor4,text_1)};if_block(node_21,$$render=>{typeof $$props.toast.description!="string"?$$render(consequent_14):$$render(alternate_3,-1)})}
-reset(div_4),template_effect($0=>set_class(div_4,1,$0),[()=>clsx(cn(descriptionClass(),get$3(toastDescriptionClass),get$3(classes)?.description,$$props.toast.classes?.description))]),append($$anchor3,div_4)};if_block(node_20,$$render=>{$$props.toast.description&&$$render(consequent_15)})}reset(div_2);var node_23=sibling(div_2,2);{var consequent_18=$$anchor3=>{var fragment_18=comment$2(),node_24=first_child(fragment_18);{var consequent_16=$$anchor4=>{var fragment_19=comment$2(),node_25=first_child(
-fragment_19);component(node_25,()=>$$props.toast.cancel,($$anchor5,toast_cancel)=>{toast_cancel($$anchor5,{})}),append($$anchor4,fragment_19)},consequent_17=$$anchor4=>{var button_1=root_25$4(),text_2=child(button_1,!0);reset(button_1),template_effect($0=>{set_style(button_1,$$props.toast.cancelButtonStyle??cancelButtonStyle()),set_class(button_1,1,$0),set_text(text_2,$$props.toast.cancel.label)},[()=>clsx(cn(get$3(classes)?.cancelButton,$$props.toast?.classes?.cancelButton))]),delegated("click",
-button_1,event2=>{isAction($$props.toast.cancel)&&get$3(dismissable)&&($$props.toast.cancel?.onClick?.(event2),deleteToast())}),append($$anchor4,button_1)},d2=user_derived(()=>isAction($$props.toast.cancel));if_block(node_24,$$render=>{typeof $$props.toast.cancel=="function"?$$render(consequent_16):get$3(d2)&&$$render(consequent_17,1)})}append($$anchor3,fragment_18)};if_block(node_23,$$render=>{$$props.toast.cancel&&$$render(consequent_18)})}var node_26=sibling(node_23,2);{var consequent_21=$$anchor3=>{
-var fragment_20=comment$2(),node_27=first_child(fragment_20);{var consequent_19=$$anchor4=>{var fragment_21=comment$2(),node_28=first_child(fragment_21);component(node_28,()=>$$props.toast.action,($$anchor5,toast_action)=>{toast_action($$anchor5,{})}),append($$anchor4,fragment_21)},consequent_20=$$anchor4=>{var button_2=root_28$1(),text_3=child(button_2,!0);reset(button_2),template_effect($0=>{set_style(button_2,$$props.toast.actionButtonStyle??actionButtonStyle()),set_class(button_2,1,$0),set_text(
-text_3,$$props.toast.action.label)},[()=>clsx(cn(get$3(classes)?.actionButton,$$props.toast?.classes?.actionButton))]),delegated("click",button_2,event2=>{isAction($$props.toast.action)&&($$props.toast.action?.onClick(event2),!event2.defaultPrevented&&deleteToast())}),append($$anchor4,button_2)},d_12=user_derived(()=>isAction($$props.toast.action));if_block(node_27,$$render=>{typeof $$props.toast.action=="function"?$$render(consequent_19):get$3(d_12)&&$$render(consequent_20,1)})}append($$anchor3,
-fragment_20)};if_block(node_26,$$render=>{$$props.toast.action&&$$render(consequent_21)})}template_effect($0=>set_class(div_3,1,$0),[()=>clsx(cn(get$3(classes)?.title,$$props.toast?.classes?.title))]),append($$anchor2,fragment_3)};if_block(node_4,$$render=>{$$props.toast.component?$$render(consequent_2):$$render(alternate_4,-1)})}reset(li2),bind_this(li2,$$value=>set$1(toastRef,$$value),()=>get$3(toastRef)),template_effect(($0,$1,$2)=>{set_class(li2,1,$0),set_attribute(li2,"data-rich-colors",$$props.
-toast.richColors??defaultRichColors()),set_attribute(li2,"data-styled",!($$props.toast.component||$$props.toast.unstyled||unstyled())),set_attribute(li2,"data-mounted",get$3(mounted)),set_attribute(li2,"data-promise",$1),set_attribute(li2,"data-swiped",get$3(isSwiped)),set_attribute(li2,"data-removed",get$3(removed)),set_attribute(li2,"data-visible",get$3(isVisible)),set_attribute(li2,"data-y-position",get$3(coords)[0]),set_attribute(li2,"data-x-position",get$3(coords)[1]),set_attribute(li2,"dat\
-a-index",$$props.index),set_attribute(li2,"data-front",get$3(isFront)),set_attribute(li2,"data-swiping",get$3(swiping)),set_attribute(li2,"data-dismissable",get$3(dismissable)),set_attribute(li2,"data-type",get$3(toastType)),set_attribute(li2,"data-invert",get$3(invert)),set_attribute(li2,"data-swipe-out",get$3(swipeOut)),set_attribute(li2,"data-swipe-direction",get$3(swipeOutDirection)),set_attribute(li2,"data-expanded",$2),styles2=set_style(li2,`${$$props.style} ${$$props.toast.style}`,styles2,
-{"--index":$$props.index,"--toasts-before":$$props.index,"--z-index":toastState.toasts.length-$$props.index,"--offset":`${get$3(removed)?get$3(offsetBeforeRemove):get$3(offset2)}px`,"--initial-height":$$props.expandByDefault?"auto":`${get$3(initialHeight)}px`})},[()=>clsx(cn($$props.class,get$3(toastClass),get$3(classes)?.toast,$$props.toast?.classes?.toast,get$3(classes)?.[get$3(toastType)],$$props.toast?.classes?.[get$3(toastType)])),()=>!!$$props.toast.promise,()=>!!($$props.expanded||$$props.
-expandByDefault&&get$3(mounted))]),delegated("pointermove",li2,handlePointerMove),delegated("pointerup",li2,handlePointerUp),delegated("pointerdown",li2,handlePointerDown),event("dragend",li2,handleDragEnd),append($$anchor,li2),pop()}delegate(["pointermove","pointerup","pointerdown","click"]);var root$1O=from_svg('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 \
-0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function SuccessIcon($$anchor){var svg2=root$1O();append($$anchor,svg2)}var root$1N=from_svg('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5\
-A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function ErrorIcon($$anchor){var svg2=root$1N();append($$anchor,svg2)}var root$1M=from_svg('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-\
-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 \
-1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function WarningIcon($$anchor){var svg2=root$1M();append($$anchor,svg2)}var root$1L=from_svg('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d\
-="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function InfoIcon($$anchor){var svg2=root$1L();append($$anchor,svg2)}var root$1K=from_svg('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" st\
-roke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function CloseIcon($$anchor){var svg2=root$1K();append($$anchor,svg2)}const VISIBLE_TOASTS_AMOUNT=3,VIEWPORT_OFFSET="24px",MOBILE_VIEWPORT_OFFSET="16px",TOAST_LIFETIME=4e3,TOAST_WIDTH=356,GAP=14,DARK="dark",LIGHT="light";function getOffsetObject(defaultOffset,mobileOffset){const styles2={};return[defaultOffset,mobileOffset].forEach(
-(offset2,index2)=>{const isMobile=index2===1,prefix=isMobile?"--mobile-offset":"--offset",defaultValue=isMobile?MOBILE_VIEWPORT_OFFSET:VIEWPORT_OFFSET;function assignAll(offset3){["top","right","bottom","left"].forEach(key2=>{styles2[`${prefix}-${key2}`]=typeof offset3=="number"?`${offset3}px`:offset3})}typeof offset2=="number"||typeof offset2=="string"?assignAll(offset2):typeof offset2=="object"?["top","right","bottom","left"].forEach(key2=>{const value=offset2[key2];value===void 0?styles2[`${prefix}\
--${key2}`]=defaultValue:styles2[`${prefix}-${key2}`]=typeof value=="number"?`${value}px`:value}):assignAll(defaultValue)}),styles2}var root_2$1d=from_html("<ol></ol>"),root$1J=from_html('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function Toaster($$anchor,$$props){push$1($$props,!0);function getInitialTheme(t){return t!=="system"?t:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?
-DARK:LIGHT}let invert=prop($$props,"invert",3,!1),position2=prop($$props,"position",3,"bottom-right"),hotkey=prop($$props,"hotkey",19,()=>["altKey","KeyT"]),expand=prop($$props,"expand",3,!1),closeButton=prop($$props,"closeButton",3,!1),offset2=prop($$props,"offset",3,VIEWPORT_OFFSET),mobileOffset=prop($$props,"mobileOffset",3,MOBILE_VIEWPORT_OFFSET),theme=prop($$props,"theme",3,"light"),richColors=prop($$props,"richColors",3,!1),duration2=prop($$props,"duration",3,TOAST_LIFETIME),visibleToasts=prop(
-$$props,"visibleToasts",3,VISIBLE_TOASTS_AMOUNT),toastOptions=prop($$props,"toastOptions",19,()=>({})),dir=prop($$props,"dir",7,"auto"),gap=prop($$props,"gap",3,GAP),containerAriaLabel=prop($$props,"containerAriaLabel",3,"Notifications"),closeButtonAriaLabel=prop($$props,"closeButtonAriaLabel",3,"Close toast"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","t\
-oastOptions","dir","gap","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function getDocumentDirection(){if(dir()!=="auto")return dir();if(typeof window>"u"||typeof document>"u")return"ltr";const dirAttribute=document.documentElement.getAttribute("dir");return dirAttribute==="auto"||!dirAttribute?(untrack$1(()=>dir(
-window.getComputedStyle(document.documentElement).direction??"ltr")),dir()):(untrack$1(()=>dir(dirAttribute)),dirAttribute)}const possiblePositions=user_derived(()=>Array.from(new Set([position2(),...toastState.toasts.filter(toast2=>toast2.position).map(toast2=>toast2.position)].filter(Boolean))));let expanded=state$1(!1),interacting=state$1(!1),actualTheme=state$1(proxy(getInitialTheme(theme()))),listRef=state$1(void 0),lastFocusedElementRef=state$1(null),isFocusWithin=state$1(!1);const hotkeyLabel=user_derived(
-()=>hotkey().join("+").replace(/Key/g,"").replace(/Digit/g,""));user_effect(()=>{toastState.toasts.length<=1&&set$1(expanded,!1)}),user_effect(()=>{const toastsToDismiss=toastState.toasts.filter(toast2=>toast2.dismiss&&!toast2.delete);if(toastsToDismiss.length>0){const updatedToasts=toastState.toasts.map(toast2=>toastsToDismiss.find(dismissToast=>dismissToast.id===toast2.id)?{...toast2,delete:!0}:toast2);toastState.toasts=updatedToasts}}),user_effect(()=>()=>{get$3(listRef)&&get$3(lastFocusedElementRef)&&
-(get$3(lastFocusedElementRef).focus({preventScroll:!0}),set$1(lastFocusedElementRef,null),set$1(isFocusWithin,!1))}),onMount$1(()=>(toastState.reset(),on(document,"keydown",event2=>{hotkey().every(key2=>event2[key2]||event2.code===key2)&&(set$1(expanded,!0),get$3(listRef)?.focus()),event2.code==="Escape"&&(document.activeElement===get$3(listRef)||get$3(listRef)?.contains(document.activeElement))&&set$1(expanded,!1)}))),user_effect(()=>{if(theme()!=="system"&&set$1(actualTheme,theme()),typeof window<
-"u"){theme()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?set$1(actualTheme,DARK):set$1(actualTheme,LIGHT));const mediaQueryList=window.matchMedia("(prefers-color-scheme: dark)"),changeHandler=({matches:matches2})=>{set$1(actualTheme,matches2?DARK:LIGHT,!0)};"addEventListener"in mediaQueryList?mediaQueryList.addEventListener("change",changeHandler):mediaQueryList.addListener(changeHandler)}});const handleBlur=event2=>{$$props.onblur?.(event2),get$3(isFocusWithin)&&
-!event2.currentTarget.contains(event2.relatedTarget)&&(set$1(isFocusWithin,!1),get$3(lastFocusedElementRef)&&(get$3(lastFocusedElementRef).focus({preventScroll:!0}),set$1(lastFocusedElementRef,null)))},handleFocus=event2=>{$$props.onfocus?.(event2),!(event2.target instanceof HTMLElement&&event2.target.dataset.dismissable==="false")&&(get$3(isFocusWithin)||(set$1(isFocusWithin,!0),set$1(lastFocusedElementRef,event2.relatedTarget,!0)))},handlePointerDown=event2=>{$$props.onpointerdown?.(event2),!(event2.
-target instanceof HTMLElement&&event2.target.dataset.dismissable==="false")&&set$1(interacting,!0)},handleMouseEnter=event2=>{$$props.onmouseenter?.(event2),set$1(expanded,!0)},handleMouseLeave=event2=>{$$props.onmouseleave?.(event2),get$3(interacting)||set$1(expanded,!1)},handleMouseMove=event2=>{$$props.onmousemove?.(event2),set$1(expanded,!0)},handleDragEnd=event2=>{$$props.ondragend?.(event2),set$1(expanded,!1)},handlePointerUp=event2=>{$$props.onpointerup?.(event2),set$1(interacting,!1)};sonnerContext.
-set(new SonnerState);var section2=root$1J();set_attribute(section2,"tabindex",-1);var node2=child(section2);{var consequent_10=$$anchor2=>{var fragment=comment$2(),node_1=first_child(fragment);each(node_1,18,()=>get$3(possiblePositions),position3=>position3,($$anchor3,position3,index2,$$array)=>{const computed_const=user_derived(()=>{const[y,x]=position3.split("-");return{y,x}}),offsetObject=user_derived(()=>getOffsetObject(offset2(),mobileOffset()));var ol=root_2$1d();attribute_effect(ol,$0=>({
-tabindex:-1,dir:$0,class:$$props.class,"data-sonner-toaster":!0,"data-sonner-theme":get$3(actualTheme),"data-y-position":get$3(computed_const).y,"data-x-position":get$3(computed_const).x,style:$$props.style,onblur:handleBlur,onfocus:handleFocus,onmouseenter:handleMouseEnter,onmousemove:handleMouseMove,onmouseleave:handleMouseLeave,ondragend:handleDragEnd,onpointerdown:handlePointerDown,onpointerup:handlePointerUp,...restProps,[STYLE]:{"--front-toast-height":`${toastState.heights[0]?.height}px`,"\
---width":`${TOAST_WIDTH}px`,"--gap":`${gap()}px`,"--offset-top":get$3(offsetObject)["--offset-top"],"--offset-right":get$3(offsetObject)["--offset-right"],"--offset-bottom":get$3(offsetObject)["--offset-bottom"],"--offset-left":get$3(offsetObject)["--offset-left"],"--mobile-offset-top":get$3(offsetObject)["--mobile-offset-top"],"--mobile-offset-right":get$3(offsetObject)["--mobile-offset-right"],"--mobile-offset-bottom":get$3(offsetObject)["--mobile-offset-bottom"],"--mobile-offset-left":get$3(offsetObject)["\
---mobile-offset-left"]}}),[()=>getDocumentDirection()],void 0,void 0,"svelte-nbs0zk"),each(ol,23,()=>toastState.toasts.filter(toast2=>!toast2.position&&get$3(index2)===0||toast2.position===position3),toast2=>toast2.id,($$anchor4,toast2,index3,$$array_1)=>{{const successIcon=$$anchor5=>{var fragment_2=comment$2(),node_2=first_child(fragment_2);{var consequent=$$anchor6=>{var fragment_3=comment$2(),node_3=first_child(fragment_3);snippet(node_3,()=>$$props.successIcon??noop$3),append($$anchor6,fragment_3)},
-consequent_1=$$anchor6=>{SuccessIcon($$anchor6)};if_block(node_2,$$render=>{$$props.successIcon?$$render(consequent):$$props.successIcon!==null&&$$render(consequent_1,1)})}append($$anchor5,fragment_2)},errorIcon=$$anchor5=>{var fragment_5=comment$2(),node_4=first_child(fragment_5);{var consequent_2=$$anchor6=>{var fragment_6=comment$2(),node_5=first_child(fragment_6);snippet(node_5,()=>$$props.errorIcon??noop$3),append($$anchor6,fragment_6)},consequent_3=$$anchor6=>{ErrorIcon($$anchor6)};if_block(
-node_4,$$render=>{$$props.errorIcon?$$render(consequent_2):$$props.errorIcon!==null&&$$render(consequent_3,1)})}append($$anchor5,fragment_5)},warningIcon=$$anchor5=>{var fragment_8=comment$2(),node_6=first_child(fragment_8);{var consequent_4=$$anchor6=>{var fragment_9=comment$2(),node_7=first_child(fragment_9);snippet(node_7,()=>$$props.warningIcon??noop$3),append($$anchor6,fragment_9)},consequent_5=$$anchor6=>{WarningIcon($$anchor6)};if_block(node_6,$$render=>{$$props.warningIcon?$$render(consequent_4):
-$$props.warningIcon!==null&&$$render(consequent_5,1)})}append($$anchor5,fragment_8)},infoIcon=$$anchor5=>{var fragment_11=comment$2(),node_8=first_child(fragment_11);{var consequent_6=$$anchor6=>{var fragment_12=comment$2(),node_9=first_child(fragment_12);snippet(node_9,()=>$$props.infoIcon??noop$3),append($$anchor6,fragment_12)},consequent_7=$$anchor6=>{InfoIcon($$anchor6)};if_block(node_8,$$render=>{$$props.infoIcon?$$render(consequent_6):$$props.infoIcon!==null&&$$render(consequent_7,1)})}append(
-$$anchor5,fragment_11)},closeIcon=$$anchor5=>{var fragment_14=comment$2(),node_10=first_child(fragment_14);{var consequent_8=$$anchor6=>{var fragment_15=comment$2(),node_11=first_child(fragment_15);snippet(node_11,()=>$$props.closeIcon??noop$3),append($$anchor6,fragment_15)},consequent_9=$$anchor6=>{CloseIcon($$anchor6)};if_block(node_10,$$render=>{$$props.closeIcon?$$render(consequent_8):$$props.closeIcon!==null&&$$render(consequent_9,1)})}append($$anchor5,fragment_14)};let $0=user_derived(()=>toastOptions()?.
-duration??duration2()),$1=user_derived(()=>toastOptions()?.class??""),$2=user_derived(()=>toastOptions()?.descriptionClass||""),$3=user_derived(()=>toastOptions()?.style??""),$4=user_derived(()=>toastOptions().classes||{}),$5=user_derived(()=>toastOptions().unstyled??!1),$6=user_derived(()=>toastOptions()?.cancelButtonStyle??""),$7=user_derived(()=>toastOptions()?.actionButtonStyle??""),$8=user_derived(()=>toastOptions()?.closeButtonAriaLabel??closeButtonAriaLabel());Toast($$anchor4,{get index(){
-return get$3(index3)},get toast(){return get$3(toast2)},get defaultRichColors(){return richColors()},get duration(){return get$3($0)},get class(){return get$3($1)},get descriptionClass(){return get$3($2)},get invert(){return invert()},get visibleToasts(){return visibleToasts()},get closeButton(){return closeButton()},get interacting(){return get$3(interacting)},get position(){return position3},get style(){return get$3($3)},get classes(){return get$3($4)},get unstyled(){return get$3($5)},get cancelButtonStyle(){
-return get$3($6)},get actionButtonStyle(){return get$3($7)},get closeButtonAriaLabel(){return get$3($8)},get expandByDefault(){return expand()},get expanded(){return get$3(expanded)},get loadingIcon(){return $$props.loadingIcon},successIcon,errorIcon,warningIcon,infoIcon,closeIcon,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),reset(ol),bind_this(ol,$$value=>set$1(listRef,$$value),()=>get$3(listRef)),template_effect(()=>ol.dir=ol.dir),append($$anchor3,ol)}),append(
-$$anchor2,fragment)};if_block(node2,$$render=>{toastState.toasts.length>0&&$$render(consequent_10)})}reset(section2),template_effect(()=>set_attribute(section2,"aria-label",`${containerAriaLabel()??""} ${get$3(hotkeyLabel)??""}`)),append($$anchor,section2),pop()}async function copyToClipboard(text2,successMessage="Copied to clipboard",errorMessage="Failed to copy to clipboard"){try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(text2),toast.success(
-successMessage),!0;const textArea=document.createElement("textarea");textArea.value=text2,textArea.style.position="fixed",textArea.style.left="-999999px",textArea.style.top="-999999px",document.body.appendChild(textArea),textArea.focus(),textArea.select();const successful=document.execCommand("copy");if(document.body.removeChild(textArea),successful)return toast.success(successMessage),!0;throw new Error("execCommand failed")}catch(error2){return console.error("Failed to copy to clipboard:",error2),
-toast.error(errorMessage),!1}}async function copyCodeToClipboard(rawCode,successMessage="Code copied to clipboard",errorMessage="Failed to copy code"){return copyToClipboard(rawCode,successMessage,errorMessage)}function formatMessageForClipboard(content2,extras,asPlainText=!1){const textAttachments=extras?.filter(extra=>extra.type===AttachmentType.TEXT||extra.type===AttachmentType.LEGACY_CONTEXT||extra.type===AttachmentType.MCP_PROMPT||extra.type===AttachmentType.MCP_RESOURCE)??[];if(textAttachments.
-length===0)return content2;if(asPlainText){const parts=[content2];for(const att of textAttachments)parts.push(att.content);return parts.join(`
+const proxiedHeaders={};for(const[key2,value]of Object.entries(headers))proxiedHeaders[`x-proxy-header-${key2}`]=value;return proxiedHeaders}function isIpAddress(hostname){return!!(hostname.includes(":")||/^\d{1,3}(\.\d{1,3}){3}$/.test(hostname))}function extractRootDomain(url2){const hostname=url2.hostname.toLowerCase();if(!hostname||isIpAddress(hostname))return null;const parts=hostname.split(".");if(parts.length<2)return null;if(parts.length>=3){const suffix2=`${parts[parts.length-2]}.${parts[parts.
+length-1]}`;if(TWO_PART_PUBLIC_SUFFIXES.has(suffix2))return parts.slice(-3).join(".")}for(let i=2;i<=parts.length;i++){const candidate=parts.slice(-i).join(".");if(WILDCARD_PUBLIC_SUFFIXES.has(candidate))return parts.length===i+1?hostname:parts.slice(-(i+2)).join(".")}return parts.slice(-2).join(".")}function sanitizeExternalUrl(raw2){try{const url2=new URL(raw2);return url2.protocol!==UrlProtocol.HTTP&&url2.protocol!==UrlProtocol.HTTPS?null:url2.href}catch{return null}}function createMessageCountMap(exportedData){
+const countMap=new Map;for(const item of exportedData)countMap.set(item.conv.id,item.messages.length);return countMap}const bars=Array(12).fill(0);var root_1$16=from_html('<div class="sonner-loading-bar"></div>'),root$1R=from_html('<div><div class="sonner-spinner"></div></div>');function Loader($$anchor,$$props){push$1($$props,!0);var div=root$1R(),div_1=child(div);each(div_1,23,()=>bars,(_,i)=>`spinner-bar-${i}`,($$anchor2,_)=>{var div_2=root_1$16();append($$anchor2,div_2)}),reset(div_1),reset(
+div),template_effect($0=>{set_class(div,1,$0),set_attribute(div,"data-visible",$$props.visible)},[()=>clsx(["sonner-loading-wrapper",$$props.class].filter(Boolean).join(" "))]),append($$anchor,div),pop()}function cn(...classes){return classes.filter(Boolean).join(" ")}const isBrowser$1=typeof document<"u",defaultWindow$2=typeof window<"u"?window:void 0;function getActiveElement$2(document2){let activeElement=document2.activeElement;for(;activeElement?.shadowRoot;){const node2=activeElement.shadowRoot.
+activeElement;if(node2===activeElement)break;activeElement=node2}return activeElement}let ActiveElement$2=class{#document;#subscribe;constructor(options={}){const{window:window2=defaultWindow$2,document:document2=window2?.document}=options;window2!==void 0&&(this.#document=document2,this.#subscribe=createSubscriber(update2=>{const cleanupFocusIn=on(window2,"focusin",update2),cleanupFocusOut=on(window2,"focusout",update2);return()=>{cleanupFocusIn(),cleanupFocusOut()}}))}get current(){return this.#subscribe?.(),
+this.#document?getActiveElement$2(this.#document):null}};new ActiveElement$2;class Context2{#name;#key;constructor(name){this.#name=name,this.#key=Symbol(name)}get key(){return this.#key}exists(){return hasContext(this.#key)}get(){const context=getContext(this.#key);if(context===void 0)throw new Error(`Context "${this.#name}" not found`);return context}getOr(fallback2){const context=getContext(this.#key);return context===void 0?fallback2:context}set(context){return setContext(this.#key,context)}}
+const sonnerContext=new Context2("<Toaster/>");let toastsCounter=0;class ToastState{#toasts=state$1(proxy([]));get toasts(){return get$3(this.#toasts)}set toasts(value){set$1(this.#toasts,value,!0)}#heights=state$1(proxy([]));get heights(){return get$3(this.#heights)}set heights(value){set$1(this.#heights,value,!0)}#findToastIdx=id2=>{const idx=this.toasts.findIndex(toast2=>toast2.id===id2);return idx===-1?null:idx};addToast=data=>{isBrowser$1&&this.toasts.unshift(data)};updateToast=({id:id2,data,
+type:type2,message})=>{const toastIdx=this.toasts.findIndex(toast2=>toast2.id===id2),toastToUpdate=this.toasts[toastIdx];this.toasts[toastIdx]={...toastToUpdate,...data,id:id2,title:message,type:type2,updated:!0}};create=data=>{const{message,...rest}=data,id2=typeof data?.id=="number"||data.id&&data.id?.length>0?data.id:toastsCounter++,dismissable=data.dismissable===void 0?!0:data.dismissable,type2=data.type===void 0?"default":data.type;return untrack$1(()=>{this.toasts.find(toast2=>toast2.id===
+id2)?this.updateToast({id:id2,data,type:type2,message,dismissable}):this.addToast({...rest,id:id2,title:message,dismissable,type:type2})}),id2};dismiss=id2=>(untrack$1(()=>{if(id2===void 0){this.toasts=this.toasts.map(toast2=>({...toast2,dismiss:!0}));return}const toastIdx=this.toasts.findIndex(toast2=>toast2.id===id2);this.toasts[toastIdx]&&(this.toasts[toastIdx]={...this.toasts[toastIdx],dismiss:!0})}),id2);remove=id2=>{if(id2===void 0){this.toasts=[];return}const toastIdx=this.#findToastIdx(id2);
+if(toastIdx!==null)return this.toasts.splice(toastIdx,1),id2};message=(message,data)=>this.create({...data,type:"default",message});error=(message,data)=>this.create({...data,type:"error",message});success=(message,data)=>this.create({...data,type:"success",message});info=(message,data)=>this.create({...data,type:"info",message});warning=(message,data)=>this.create({...data,type:"warning",message});loading=(message,data)=>this.create({...data,type:"loading",message});promise=(promise,data)=>{if(!data)
+return;let id2;data.loading!==void 0&&(id2=this.create({...data,promise,type:"loading",message:typeof data.loading=="string"?data.loading:data.loading()}));const p2=promise instanceof Promise?promise:promise();let shouldDismiss=id2!==void 0;return p2.then(response=>{if(typeof response=="object"&&response&&"ok"in response&&typeof response.ok=="boolean"&&!response.ok){shouldDismiss=!1;const message=constructPromiseErrorMessage(response);this.create({id:id2,type:"error",message})}else if(data.success!==
+void 0){shouldDismiss=!1;const message=typeof data.success=="function"?data.success(response):data.success;this.create({id:id2,type:"success",message})}}).catch(error2=>{if(data.error!==void 0){shouldDismiss=!1;const message=typeof data.error=="function"?data.error(error2):data.error;this.create({id:id2,type:"error",message})}}).finally(()=>{shouldDismiss&&(this.dismiss(id2),id2=void 0),data.finally?.()}),id2};custom=(component2,data)=>{const id2=data?.id||toastsCounter++;return this.create({component:component2,
+id:id2,...data}),id2};removeHeight=id2=>{this.heights=this.heights.filter(height=>height.toastId!==id2)};setHeight=data=>{const toastIdx=this.#findToastIdx(data.toastId);if(toastIdx===null){this.heights.push(data);return}this.heights[toastIdx]=data};reset=()=>{this.toasts=[],this.heights=[]}}function constructPromiseErrorMessage(response){return response&&typeof response=="object"&&"status"in response?`HTTP error! Status: ${response.status}`:`Error! ${response}`}const toastState=new ToastState;function toastFunction(message,data){
+return toastState.create({message,...data})}class SonnerState{#activeToasts=user_derived(()=>toastState.toasts.filter(toast2=>!toast2.dismiss));get toasts(){return get$3(this.#activeToasts)}}const basicToast=toastFunction,toast=Object.assign(basicToast,{success:toastState.success,info:toastState.info,warning:toastState.warning,error:toastState.error,custom:toastState.custom,message:toastState.message,promise:toastState.promise,dismiss:toastState.dismiss,loading:toastState.loading,getActiveToasts:()=>toastState.
+toasts.filter(toast2=>!toast2.dismiss)});function isAction(action2){return action2.label!==void 0}function useDocumentHidden(){let current2=state$1(proxy(typeof document<"u"?document.hidden:!1));return user_effect(()=>on(document,"visibilitychange",()=>{set$1(current2,document.hidden,!0)})),{get current(){return get$3(current2)}}}const TOAST_LIFETIME$1=4e3,GAP$1=14,SWIPE_THRESHOLD=45,TIME_BEFORE_UNMOUNT=200,SCALE_MULTIPLIER=.05,DEFAULT_TOAST_CLASSES={toast:"",title:"",description:"",loader:"",closeButton:"",
+cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function getDefaultSwipeDirections(position2){const[y,x]=position2.split("-"),directions=[];return y&&directions.push(y),x&&directions.push(x),directions}function getDampening(delta){return 1/(1.5+Math.abs(delta)/20)}var root_2$1d=from_html("<div><!></div>"),root_4$F=from_html('<button data-close-button=""><!></button>'),root_7$v=from_html('<div data-icon=""><!> <!></div>'),root_20$5=from_html(
+'<div data-description=""><!></div>'),root_25$4=from_html('<button data-button="" data-cancel=""> </button>'),root_28$1=from_html('<button data-button=""> </button>'),root_6$x=from_html('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),root$1Q=from_html('<li data-sonner-toast=""><!> <!></li>');function Toast($$anchor,$$props){push$1($$props,!0);const LoadingIcon=$$anchor2=>{var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor3=>{var div=root_2$1d(),
+node_1=child(div);snippet(node_1,()=>$$props.loadingIcon),reset(div),template_effect($0=>{set_class(div,1,$0),set_attribute(div,"data-visible",get$3(toastType)==="loading")},[()=>clsx(cn(get$3(classes)?.loader,$$props.toast?.classes?.loader,"sonner-loader"))]),append($$anchor3,div)},alternate=$$anchor3=>{{let $0=user_derived(()=>cn(get$3(classes)?.loader,$$props.toast.classes?.loader)),$1=user_derived(()=>get$3(toastType)==="loading");Loader($$anchor3,{get class(){return get$3($0)},get visible(){
+return get$3($1)}})}};if_block(node2,$$render=>{$$props.loadingIcon?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment)};let cancelButtonStyle=prop($$props,"cancelButtonStyle",3,""),actionButtonStyle=prop($$props,"actionButtonStyle",3,""),descriptionClass=prop($$props,"descriptionClass",3,""),unstyled=prop($$props,"unstyled",3,!1),defaultRichColors=prop($$props,"defaultRichColors",3,!1);const defaultClasses={...DEFAULT_TOAST_CLASSES};let mounted=state$1(!1),removed=state$1(!1),
+swiping=state$1(!1),swipeOut=state$1(!1),isSwiped=state$1(!1),offsetBeforeRemove=state$1(0),initialHeight=state$1(0),remainingTime=$$props.toast.duration||$$props.duration||TOAST_LIFETIME$1,toastRef=state$1(void 0),swipeDirection=state$1(null),swipeOutDirection=state$1(null);const isFront=user_derived(()=>$$props.index===0),isVisible=user_derived(()=>$$props.index+1<=$$props.visibleToasts),toastType=user_derived(()=>$$props.toast.type),dismissable=user_derived(()=>$$props.toast.dismissable!==!1),
+toastClass=user_derived(()=>$$props.toast.class||""),toastDescriptionClass=user_derived(()=>$$props.toast.descriptionClass||""),heightIndex=user_derived(()=>toastState.heights.findIndex(height=>height.toastId===$$props.toast.id)||0),closeButton=user_derived(()=>$$props.toast.closeButton??$$props.closeButton),duration2=user_derived(()=>$$props.toast.duration??$$props.duration??TOAST_LIFETIME$1);let pointerStart=null;const coords=user_derived(()=>$$props.position.split("-")),toastsHeightBefore=user_derived(
+()=>toastState.heights.reduce((prev2,curr,reducerIndex)=>reducerIndex>=get$3(heightIndex)?prev2:prev2+curr.height,0)),isDocumentHidden=useDocumentHidden(),invert=user_derived(()=>$$props.toast.invert||$$props.invert),disabled=user_derived(()=>get$3(toastType)==="loading"),classes=user_derived(()=>({...defaultClasses,...$$props.classes})),toastTitle=user_derived(()=>$$props.toast.title),toastDescription=user_derived(()=>$$props.toast.description);let closeTimerStartTime=state$1(0),lastCloseTimerStartTime=state$1(
+0);const offset2=user_derived(()=>Math.round(get$3(heightIndex)*GAP$1+get$3(toastsHeightBefore)));user_effect(()=>{get$3(toastTitle),get$3(toastDescription);let scale2;$$props.expanded||$$props.expandByDefault?scale2=1:scale2=1-$$props.index*SCALE_MULTIPLIER;const toastEl=untrack$1(()=>get$3(toastRef));if(toastEl===void 0)return;toastEl.style.setProperty("height","auto");const offsetHeight=toastEl.offsetHeight,rectHeight=toastEl.getBoundingClientRect().height,scaledRectHeight=Math.round(rectHeight/
+scale2+Number.EPSILON&100)/100;toastEl.style.removeProperty("height");let finalHeight;Math.abs(scaledRectHeight-offsetHeight)<1?finalHeight=scaledRectHeight:finalHeight=offsetHeight,set$1(initialHeight,finalHeight,!0),untrack$1(()=>{toastState.setHeight({toastId:$$props.toast.id,height:finalHeight})})});function deleteToast(){set$1(removed,!0),set$1(offsetBeforeRemove,get$3(offset2),!0),toastState.removeHeight($$props.toast.id),setTimeout(()=>{toastState.remove($$props.toast.id)},TIME_BEFORE_UNMOUNT)}
+let timeoutId;const isPromiseLoadingOrInfiniteDuration=user_derived(()=>$$props.toast.promise&&get$3(toastType)==="loading"||$$props.toast.duration===Number.POSITIVE_INFINITY);function startTimer(){set$1(closeTimerStartTime,new Date().getTime(),!0),timeoutId=setTimeout(()=>{$$props.toast.onAutoClose?.($$props.toast),deleteToast()},remainingTime)}function pauseTimer(){if(get$3(lastCloseTimerStartTime)<get$3(closeTimerStartTime)){const elapsedTime=new Date().getTime()-get$3(closeTimerStartTime);remainingTime=
+remainingTime-elapsedTime}set$1(lastCloseTimerStartTime,new Date().getTime(),!0)}user_effect(()=>{$$props.toast.updated&&(clearTimeout(timeoutId),remainingTime=get$3(duration2),startTimer())}),user_effect(()=>(get$3(isPromiseLoadingOrInfiniteDuration)||($$props.expanded||$$props.interacting||isDocumentHidden.current?pauseTimer():startTimer()),()=>clearTimeout(timeoutId))),onMount$1(()=>{set$1(mounted,!0);const height=get$3(toastRef)?.getBoundingClientRect().height;return set$1(initialHeight,height,
+!0),toastState.setHeight({toastId:$$props.toast.id,height}),()=>{toastState.removeHeight($$props.toast.id)}}),user_effect(()=>{$$props.toast.delete&&untrack$1(()=>{deleteToast(),$$props.toast.onDismiss?.($$props.toast)})});const handlePointerDown=event2=>{if(get$3(disabled))return;set$1(offsetBeforeRemove,get$3(offset2),!0);const target2=event2.target;target2.setPointerCapture(event2.pointerId),target2.tagName!=="BUTTON"&&(set$1(swiping,!0),pointerStart={x:event2.clientX,y:event2.clientY})},handlePointerUp=()=>{
+if(get$3(swipeOut)||!get$3(dismissable))return;pointerStart=null;const swipeAmountX=Number(get$3(toastRef)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),swipeAmountY=Number(get$3(toastRef)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),timeTaken=new Date().getTime()-0,swipeAmount=get$3(swipeDirection)==="x"?swipeAmountX:swipeAmountY,velocity=Math.abs(swipeAmount)/timeTaken;if(Math.abs(swipeAmount)>=SWIPE_THRESHOLD||velocity>.11){set$1(offsetBeforeRemove,get$3(
+offset2),!0),$$props.toast.onDismiss?.($$props.toast),get$3(swipeDirection)==="x"?set$1(swipeOutDirection,swipeAmountX>0?"right":"left",!0):set$1(swipeOutDirection,swipeAmountY>0?"down":"up",!0),deleteToast(),set$1(swipeOut,!0);return}else get$3(toastRef)?.style.setProperty("--swipe-amount-x","0px"),get$3(toastRef)?.style.setProperty("--swipe-amount-y","0px");set$1(isSwiped,!1),set$1(swiping,!1),set$1(swipeDirection,null)},handlePointerMove=event2=>{if(!pointerStart||!get$3(dismissable)||(window.
+getSelection()?.toString().length??-1)>0)return;const yDelta=event2.clientY-pointerStart.y,xDelta=event2.clientX-pointerStart.x,swipeDirections=$$props.swipeDirections??getDefaultSwipeDirections($$props.position);!get$3(swipeDirection)&&(Math.abs(xDelta)>1||Math.abs(yDelta)>1)&&set$1(swipeDirection,Math.abs(xDelta)>Math.abs(yDelta)?"x":"y",!0);let swipeAmount={x:0,y:0};if(get$3(swipeDirection)==="y"){if(swipeDirections.includes("top")||swipeDirections.includes("bottom"))if(swipeDirections.includes(
+"top")&&yDelta<0||swipeDirections.includes("bottom")&&yDelta>0)swipeAmount.y=yDelta;else{const dampenedDelta=yDelta*getDampening(yDelta);swipeAmount.y=Math.abs(dampenedDelta)<Math.abs(yDelta)?dampenedDelta:yDelta}}else if(get$3(swipeDirection)==="x"&&(swipeDirections.includes("left")||swipeDirections.includes("right")))if(swipeDirections.includes("left")&&xDelta<0||swipeDirections.includes("right")&&xDelta>0)swipeAmount.x=xDelta;else{const dampenedDelta=xDelta*getDampening(xDelta);swipeAmount.x=
+Math.abs(dampenedDelta)<Math.abs(xDelta)?dampenedDelta:xDelta}(Math.abs(swipeAmount.x)>0||Math.abs(swipeAmount.y)>0)&&set$1(isSwiped,!0),get$3(toastRef)?.style.setProperty("--swipe-amount-x",`${swipeAmount.x}px`),get$3(toastRef)?.style.setProperty("--swipe-amount-y",`${swipeAmount.y}px`)},handleDragEnd=()=>{set$1(swiping,!1),set$1(swipeDirection,null),pointerStart=null},icon=user_derived(()=>$$props.toast.icon?$$props.toast.icon:get$3(toastType)==="success"?$$props.successIcon:get$3(toastType)===
+"error"?$$props.errorIcon:get$3(toastType)==="warning"?$$props.warningIcon:get$3(toastType)==="info"?$$props.infoIcon:get$3(toastType)==="loading"?$$props.loadingIcon:null);var li2=root$1Q();set_attribute(li2,"tabindex",0);let styles2;var node_2=child(li2);{var consequent_1=$$anchor2=>{var button=root_4$F(),node_3=child(button);snippet(node_3,()=>$$props.closeIcon??noop$3),reset(button),template_effect($0=>{set_attribute(button,"aria-label",$$props.closeButtonAriaLabel),set_attribute(button,"dat\
+a-disabled",get$3(disabled)),set_class(button,1,$0)},[()=>clsx(cn(get$3(classes)?.closeButton,$$props.toast?.classes?.closeButton))]),delegated("click",button,()=>{get$3(disabled)||!get$3(dismissable)||(deleteToast(),$$props.toast.onDismiss?.($$props.toast))}),append($$anchor2,button)};if_block(node_2,$$render=>{get$3(closeButton)&&!$$props.toast.component&&get$3(toastType)!=="loading"&&$$props.closeIcon!==null&&$$render(consequent_1)})}var node_4=sibling(node_2,2);{var consequent_2=$$anchor2=>{
+const Component=user_derived(()=>$$props.toast.component);var fragment_2=comment$2(),node_5=first_child(fragment_2);component(node_5,()=>get$3(Component),($$anchor3,Component_1)=>{Component_1($$anchor3,spread_props(()=>$$props.toast.componentProps,{closeToast:deleteToast}))}),append($$anchor2,fragment_2)},alternate_4=$$anchor2=>{var fragment_3=root_6$x(),node_6=first_child(fragment_3);{var consequent_11=$$anchor3=>{var div_1=root_7$v(),node_7=child(div_1);{var consequent_4=$$anchor4=>{var fragment_4=comment$2(),
+node_8=first_child(fragment_4);{var consequent_3=$$anchor5=>{var fragment_5=comment$2(),node_9=first_child(fragment_5);component(node_9,()=>$$props.toast.icon,($$anchor6,toast_icon)=>{toast_icon($$anchor6,{})}),append($$anchor5,fragment_5)},alternate_1=$$anchor5=>{LoadingIcon($$anchor5)};if_block(node_8,$$render=>{$$props.toast.icon?$$render(consequent_3):$$render(alternate_1,-1)})}append($$anchor4,fragment_4)};if_block(node_7,$$render=>{($$props.toast.promise||get$3(toastType)==="loading")&&$$render(
+consequent_4)})}var node_10=sibling(node_7,2);{var consequent_10=$$anchor4=>{var fragment_7=comment$2(),node_11=first_child(fragment_7);{var consequent_5=$$anchor5=>{var fragment_8=comment$2(),node_12=first_child(fragment_8);component(node_12,()=>$$props.toast.icon,($$anchor6,toast_icon_1)=>{toast_icon_1($$anchor6,{})}),append($$anchor5,fragment_8)},consequent_6=$$anchor5=>{var fragment_9=comment$2(),node_13=first_child(fragment_9);snippet(node_13,()=>$$props.successIcon??noop$3),append($$anchor5,
+fragment_9)},consequent_7=$$anchor5=>{var fragment_10=comment$2(),node_14=first_child(fragment_10);snippet(node_14,()=>$$props.errorIcon??noop$3),append($$anchor5,fragment_10)},consequent_8=$$anchor5=>{var fragment_11=comment$2(),node_15=first_child(fragment_11);snippet(node_15,()=>$$props.warningIcon??noop$3),append($$anchor5,fragment_11)},consequent_9=$$anchor5=>{var fragment_12=comment$2(),node_16=first_child(fragment_12);snippet(node_16,()=>$$props.infoIcon??noop$3),append($$anchor5,fragment_12)};
+if_block(node_11,$$render=>{$$props.toast.icon?$$render(consequent_5):get$3(toastType)==="success"?$$render(consequent_6,1):get$3(toastType)==="error"?$$render(consequent_7,2):get$3(toastType)==="warning"?$$render(consequent_8,3):get$3(toastType)==="info"&&$$render(consequent_9,4)})}append($$anchor4,fragment_7)};if_block(node_10,$$render=>{$$props.toast.type!=="loading"&&$$render(consequent_10)})}reset(div_1),template_effect($0=>set_class(div_1,1,$0),[()=>clsx(cn(get$3(classes)?.icon,$$props.toast?.
+classes?.icon))]),append($$anchor3,div_1)};if_block(node_6,$$render=>{(get$3(toastType)||$$props.toast.icon||$$props.toast.promise)&&$$props.toast.icon!==null&&(get$3(icon)!==null||$$props.toast.icon)&&$$render(consequent_11)})}var div_2=sibling(node_6,2),div_3=child(div_2),node_17=child(div_3);{var consequent_13=$$anchor3=>{var fragment_13=comment$2(),node_18=first_child(fragment_13);{var consequent_12=$$anchor4=>{const Title=user_derived(()=>$$props.toast.title);var fragment_14=comment$2(),node_19=first_child(
+fragment_14);component(node_19,()=>get$3(Title),($$anchor5,Title_1)=>{Title_1($$anchor5,spread_props(()=>$$props.toast.componentProps))}),append($$anchor4,fragment_14)},alternate_2=$$anchor4=>{var text2=text$8();template_effect(()=>set_text(text2,$$props.toast.title)),append($$anchor4,text2)};if_block(node_18,$$render=>{typeof $$props.toast.title!="string"?$$render(consequent_12):$$render(alternate_2,-1)})}append($$anchor3,fragment_13)};if_block(node_17,$$render=>{$$props.toast.title&&$$render(consequent_13)})}
+reset(div_3);var node_20=sibling(div_3,2);{var consequent_15=$$anchor3=>{var div_4=root_20$5(),node_21=child(div_4);{var consequent_14=$$anchor4=>{const Description=user_derived(()=>$$props.toast.description);var fragment_16=comment$2(),node_22=first_child(fragment_16);component(node_22,()=>get$3(Description),($$anchor5,Description_1)=>{Description_1($$anchor5,spread_props(()=>$$props.toast.componentProps))}),append($$anchor4,fragment_16)},alternate_3=$$anchor4=>{var text_1=text$8();template_effect(
+()=>set_text(text_1,$$props.toast.description)),append($$anchor4,text_1)};if_block(node_21,$$render=>{typeof $$props.toast.description!="string"?$$render(consequent_14):$$render(alternate_3,-1)})}reset(div_4),template_effect($0=>set_class(div_4,1,$0),[()=>clsx(cn(descriptionClass(),get$3(toastDescriptionClass),get$3(classes)?.description,$$props.toast.classes?.description))]),append($$anchor3,div_4)};if_block(node_20,$$render=>{$$props.toast.description&&$$render(consequent_15)})}reset(div_2);var node_23=sibling(
+div_2,2);{var consequent_18=$$anchor3=>{var fragment_18=comment$2(),node_24=first_child(fragment_18);{var consequent_16=$$anchor4=>{var fragment_19=comment$2(),node_25=first_child(fragment_19);component(node_25,()=>$$props.toast.cancel,($$anchor5,toast_cancel)=>{toast_cancel($$anchor5,{})}),append($$anchor4,fragment_19)},consequent_17=$$anchor4=>{var button_1=root_25$4(),text_2=child(button_1,!0);reset(button_1),template_effect($0=>{set_style(button_1,$$props.toast.cancelButtonStyle??cancelButtonStyle()),
+set_class(button_1,1,$0),set_text(text_2,$$props.toast.cancel.label)},[()=>clsx(cn(get$3(classes)?.cancelButton,$$props.toast?.classes?.cancelButton))]),delegated("click",button_1,event2=>{isAction($$props.toast.cancel)&&get$3(dismissable)&&($$props.toast.cancel?.onClick?.(event2),deleteToast())}),append($$anchor4,button_1)},d2=user_derived(()=>isAction($$props.toast.cancel));if_block(node_24,$$render=>{typeof $$props.toast.cancel=="function"?$$render(consequent_16):get$3(d2)&&$$render(consequent_17,
+1)})}append($$anchor3,fragment_18)};if_block(node_23,$$render=>{$$props.toast.cancel&&$$render(consequent_18)})}var node_26=sibling(node_23,2);{var consequent_21=$$anchor3=>{var fragment_20=comment$2(),node_27=first_child(fragment_20);{var consequent_19=$$anchor4=>{var fragment_21=comment$2(),node_28=first_child(fragment_21);component(node_28,()=>$$props.toast.action,($$anchor5,toast_action)=>{toast_action($$anchor5,{})}),append($$anchor4,fragment_21)},consequent_20=$$anchor4=>{var button_2=root_28$1(),
+text_3=child(button_2,!0);reset(button_2),template_effect($0=>{set_style(button_2,$$props.toast.actionButtonStyle??actionButtonStyle()),set_class(button_2,1,$0),set_text(text_3,$$props.toast.action.label)},[()=>clsx(cn(get$3(classes)?.actionButton,$$props.toast?.classes?.actionButton))]),delegated("click",button_2,event2=>{isAction($$props.toast.action)&&($$props.toast.action?.onClick(event2),!event2.defaultPrevented&&deleteToast())}),append($$anchor4,button_2)},d_12=user_derived(()=>isAction($$props.
+toast.action));if_block(node_27,$$render=>{typeof $$props.toast.action=="function"?$$render(consequent_19):get$3(d_12)&&$$render(consequent_20,1)})}append($$anchor3,fragment_20)};if_block(node_26,$$render=>{$$props.toast.action&&$$render(consequent_21)})}template_effect($0=>set_class(div_3,1,$0),[()=>clsx(cn(get$3(classes)?.title,$$props.toast?.classes?.title))]),append($$anchor2,fragment_3)};if_block(node_4,$$render=>{$$props.toast.component?$$render(consequent_2):$$render(alternate_4,-1)})}reset(
+li2),bind_this(li2,$$value=>set$1(toastRef,$$value),()=>get$3(toastRef)),template_effect(($0,$1,$2)=>{set_class(li2,1,$0),set_attribute(li2,"data-rich-colors",$$props.toast.richColors??defaultRichColors()),set_attribute(li2,"data-styled",!($$props.toast.component||$$props.toast.unstyled||unstyled())),set_attribute(li2,"data-mounted",get$3(mounted)),set_attribute(li2,"data-promise",$1),set_attribute(li2,"data-swiped",get$3(isSwiped)),set_attribute(li2,"data-removed",get$3(removed)),set_attribute(
+li2,"data-visible",get$3(isVisible)),set_attribute(li2,"data-y-position",get$3(coords)[0]),set_attribute(li2,"data-x-position",get$3(coords)[1]),set_attribute(li2,"data-index",$$props.index),set_attribute(li2,"data-front",get$3(isFront)),set_attribute(li2,"data-swiping",get$3(swiping)),set_attribute(li2,"data-dismissable",get$3(dismissable)),set_attribute(li2,"data-type",get$3(toastType)),set_attribute(li2,"data-invert",get$3(invert)),set_attribute(li2,"data-swipe-out",get$3(swipeOut)),set_attribute(
+li2,"data-swipe-direction",get$3(swipeOutDirection)),set_attribute(li2,"data-expanded",$2),styles2=set_style(li2,`${$$props.style} ${$$props.toast.style}`,styles2,{"--index":$$props.index,"--toasts-before":$$props.index,"--z-index":toastState.toasts.length-$$props.index,"--offset":`${get$3(removed)?get$3(offsetBeforeRemove):get$3(offset2)}px`,"--initial-height":$$props.expandByDefault?"auto":`${get$3(initialHeight)}px`})},[()=>clsx(cn($$props.class,get$3(toastClass),get$3(classes)?.toast,$$props.
+toast?.classes?.toast,get$3(classes)?.[get$3(toastType)],$$props.toast?.classes?.[get$3(toastType)])),()=>!!$$props.toast.promise,()=>!!($$props.expanded||$$props.expandByDefault&&get$3(mounted))]),delegated("pointermove",li2,handlePointerMove),delegated("pointerup",li2,handlePointerUp),delegated("pointerdown",li2,handlePointerDown),event("dragend",li2,handleDragEnd),append($$anchor,li2),pop()}delegate(["pointermove","pointerup","pointerdown","click"]);var root$1P=from_svg('<svg xmlns="http://ww\
+w.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function SuccessIcon($$anchor){var svg2=root$1P();append($$anchor,svg2)}var root$1O=from_svg('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"\
+ height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function ErrorIcon($$anchor){var svg2=root$1O();append($$anchor,svg2)}var root$1N=from_svg('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,\
+0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.04\
+2 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function WarningIcon($$anchor){var svg2=root$1N();append($$anchor,svg2)}var root$1M=from_svg(
+'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function InfoIcon($$anchor){var svg2=root$1M();append($$anchor,svg2)}var root$1L=from_svg(
+'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function CloseIcon($$anchor){var svg2=root$1L();append($$anchor,svg2)}const VISIBLE_TOASTS_AMOUNT=3,VIEWPORT_OFFSET="24px",MOBILE_VIEWPORT_OFFSET="16px",TOAST_LIFETIME=4e3,TOAST_WIDTH=356,GAP=14,
+DARK="dark",LIGHT="light";function getOffsetObject(defaultOffset,mobileOffset){const styles2={};return[defaultOffset,mobileOffset].forEach((offset2,index2)=>{const isMobile=index2===1,prefix=isMobile?"--mobile-offset":"--offset",defaultValue=isMobile?MOBILE_VIEWPORT_OFFSET:VIEWPORT_OFFSET;function assignAll(offset3){["top","right","bottom","left"].forEach(key2=>{styles2[`${prefix}-${key2}`]=typeof offset3=="number"?`${offset3}px`:offset3})}typeof offset2=="number"||typeof offset2=="string"?assignAll(
+offset2):typeof offset2=="object"?["top","right","bottom","left"].forEach(key2=>{const value=offset2[key2];value===void 0?styles2[`${prefix}-${key2}`]=defaultValue:styles2[`${prefix}-${key2}`]=typeof value=="number"?`${value}px`:value}):assignAll(defaultValue)}),styles2}var root_2$1c=from_html("<ol></ol>"),root$1K=from_html('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function Toaster($$anchor,$$props){push$1($$props,!0);function getInitialTheme(t){
+return t!=="system"?t:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?DARK:LIGHT}let invert=prop($$props,"invert",3,!1),position2=prop($$props,"position",3,"bottom-right"),hotkey=prop($$props,"hotkey",19,()=>["altKey","KeyT"]),expand=prop($$props,"expand",3,!1),closeButton=prop($$props,"closeButton",3,!1),offset2=prop($$props,"offset",3,VIEWPORT_OFFSET),mobileOffset=prop($$props,"mobileOffset",3,MOBILE_VIEWPORT_OFFSET),theme=prop($$props,"theme",3,
+"light"),richColors=prop($$props,"richColors",3,!1),duration2=prop($$props,"duration",3,TOAST_LIFETIME),visibleToasts=prop($$props,"visibleToasts",3,VISIBLE_TOASTS_AMOUNT),toastOptions=prop($$props,"toastOptions",19,()=>({})),dir=prop($$props,"dir",7,"auto"),gap=prop($$props,"gap",3,GAP),containerAriaLabel=prop($$props,"containerAriaLabel",3,"Notifications"),closeButtonAriaLabel=prop($$props,"closeButtonAriaLabel",3,"Close toast"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","in\
+vert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function getDocumentDirection(){if(dir()!=="auto")return dir();if(typeof window>"u"||typeof document>"u")return"ltr";
+const dirAttribute=document.documentElement.getAttribute("dir");return dirAttribute==="auto"||!dirAttribute?(untrack$1(()=>dir(window.getComputedStyle(document.documentElement).direction??"ltr")),dir()):(untrack$1(()=>dir(dirAttribute)),dirAttribute)}const possiblePositions=user_derived(()=>Array.from(new Set([position2(),...toastState.toasts.filter(toast2=>toast2.position).map(toast2=>toast2.position)].filter(Boolean))));let expanded=state$1(!1),interacting=state$1(!1),actualTheme=state$1(proxy(
+getInitialTheme(theme()))),listRef=state$1(void 0),lastFocusedElementRef=state$1(null),isFocusWithin=state$1(!1);const hotkeyLabel=user_derived(()=>hotkey().join("+").replace(/Key/g,"").replace(/Digit/g,""));user_effect(()=>{toastState.toasts.length<=1&&set$1(expanded,!1)}),user_effect(()=>{const toastsToDismiss=toastState.toasts.filter(toast2=>toast2.dismiss&&!toast2.delete);if(toastsToDismiss.length>0){const updatedToasts=toastState.toasts.map(toast2=>toastsToDismiss.find(dismissToast=>dismissToast.
+id===toast2.id)?{...toast2,delete:!0}:toast2);toastState.toasts=updatedToasts}}),user_effect(()=>()=>{get$3(listRef)&&get$3(lastFocusedElementRef)&&(get$3(lastFocusedElementRef).focus({preventScroll:!0}),set$1(lastFocusedElementRef,null),set$1(isFocusWithin,!1))}),onMount$1(()=>(toastState.reset(),on(document,"keydown",event2=>{hotkey().every(key2=>event2[key2]||event2.code===key2)&&(set$1(expanded,!0),get$3(listRef)?.focus()),event2.code==="Escape"&&(document.activeElement===get$3(listRef)||get$3(
+listRef)?.contains(document.activeElement))&&set$1(expanded,!1)}))),user_effect(()=>{if(theme()!=="system"&&set$1(actualTheme,theme()),typeof window<"u"){theme()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?set$1(actualTheme,DARK):set$1(actualTheme,LIGHT));const mediaQueryList=window.matchMedia("(prefers-color-scheme: dark)"),changeHandler=({matches:matches2})=>{set$1(actualTheme,matches2?DARK:LIGHT,!0)};"addEventListener"in mediaQueryList?mediaQueryList.
+addEventListener("change",changeHandler):mediaQueryList.addListener(changeHandler)}});const handleBlur=event2=>{$$props.onblur?.(event2),get$3(isFocusWithin)&&!event2.currentTarget.contains(event2.relatedTarget)&&(set$1(isFocusWithin,!1),get$3(lastFocusedElementRef)&&(get$3(lastFocusedElementRef).focus({preventScroll:!0}),set$1(lastFocusedElementRef,null)))},handleFocus=event2=>{$$props.onfocus?.(event2),!(event2.target instanceof HTMLElement&&event2.target.dataset.dismissable==="false")&&(get$3(
+isFocusWithin)||(set$1(isFocusWithin,!0),set$1(lastFocusedElementRef,event2.relatedTarget,!0)))},handlePointerDown=event2=>{$$props.onpointerdown?.(event2),!(event2.target instanceof HTMLElement&&event2.target.dataset.dismissable==="false")&&set$1(interacting,!0)},handleMouseEnter=event2=>{$$props.onmouseenter?.(event2),set$1(expanded,!0)},handleMouseLeave=event2=>{$$props.onmouseleave?.(event2),get$3(interacting)||set$1(expanded,!1)},handleMouseMove=event2=>{$$props.onmousemove?.(event2),set$1(
+expanded,!0)},handleDragEnd=event2=>{$$props.ondragend?.(event2),set$1(expanded,!1)},handlePointerUp=event2=>{$$props.onpointerup?.(event2),set$1(interacting,!1)};sonnerContext.set(new SonnerState);var section2=root$1K();set_attribute(section2,"tabindex",-1);var node2=child(section2);{var consequent_10=$$anchor2=>{var fragment=comment$2(),node_1=first_child(fragment);each(node_1,18,()=>get$3(possiblePositions),position3=>position3,($$anchor3,position3,index2,$$array)=>{const computed_const=user_derived(
+()=>{const[y,x]=position3.split("-");return{y,x}}),offsetObject=user_derived(()=>getOffsetObject(offset2(),mobileOffset()));var ol=root_2$1c();attribute_effect(ol,$0=>({tabindex:-1,dir:$0,class:$$props.class,"data-sonner-toaster":!0,"data-sonner-theme":get$3(actualTheme),"data-y-position":get$3(computed_const).y,"data-x-position":get$3(computed_const).x,style:$$props.style,onblur:handleBlur,onfocus:handleFocus,onmouseenter:handleMouseEnter,onmousemove:handleMouseMove,onmouseleave:handleMouseLeave,
+ondragend:handleDragEnd,onpointerdown:handlePointerDown,onpointerup:handlePointerUp,...restProps,[STYLE]:{"--front-toast-height":`${toastState.heights[0]?.height}px`,"--width":`${TOAST_WIDTH}px`,"--gap":`${gap()}px`,"--offset-top":get$3(offsetObject)["--offset-top"],"--offset-right":get$3(offsetObject)["--offset-right"],"--offset-bottom":get$3(offsetObject)["--offset-bottom"],"--offset-left":get$3(offsetObject)["--offset-left"],"--mobile-offset-top":get$3(offsetObject)["--mobile-offset-top"],"--\
+mobile-offset-right":get$3(offsetObject)["--mobile-offset-right"],"--mobile-offset-bottom":get$3(offsetObject)["--mobile-offset-bottom"],"--mobile-offset-left":get$3(offsetObject)["--mobile-offset-left"]}}),[()=>getDocumentDirection()],void 0,void 0,"svelte-nbs0zk"),each(ol,23,()=>toastState.toasts.filter(toast2=>!toast2.position&&get$3(index2)===0||toast2.position===position3),toast2=>toast2.id,($$anchor4,toast2,index3,$$array_1)=>{{const successIcon=$$anchor5=>{var fragment_2=comment$2(),node_2=first_child(
+fragment_2);{var consequent=$$anchor6=>{var fragment_3=comment$2(),node_3=first_child(fragment_3);snippet(node_3,()=>$$props.successIcon??noop$3),append($$anchor6,fragment_3)},consequent_1=$$anchor6=>{SuccessIcon($$anchor6)};if_block(node_2,$$render=>{$$props.successIcon?$$render(consequent):$$props.successIcon!==null&&$$render(consequent_1,1)})}append($$anchor5,fragment_2)},errorIcon=$$anchor5=>{var fragment_5=comment$2(),node_4=first_child(fragment_5);{var consequent_2=$$anchor6=>{var fragment_6=comment$2(),
+node_5=first_child(fragment_6);snippet(node_5,()=>$$props.errorIcon??noop$3),append($$anchor6,fragment_6)},consequent_3=$$anchor6=>{ErrorIcon($$anchor6)};if_block(node_4,$$render=>{$$props.errorIcon?$$render(consequent_2):$$props.errorIcon!==null&&$$render(consequent_3,1)})}append($$anchor5,fragment_5)},warningIcon=$$anchor5=>{var fragment_8=comment$2(),node_6=first_child(fragment_8);{var consequent_4=$$anchor6=>{var fragment_9=comment$2(),node_7=first_child(fragment_9);snippet(node_7,()=>$$props.
+warningIcon??noop$3),append($$anchor6,fragment_9)},consequent_5=$$anchor6=>{WarningIcon($$anchor6)};if_block(node_6,$$render=>{$$props.warningIcon?$$render(consequent_4):$$props.warningIcon!==null&&$$render(consequent_5,1)})}append($$anchor5,fragment_8)},infoIcon=$$anchor5=>{var fragment_11=comment$2(),node_8=first_child(fragment_11);{var consequent_6=$$anchor6=>{var fragment_12=comment$2(),node_9=first_child(fragment_12);snippet(node_9,()=>$$props.infoIcon??noop$3),append($$anchor6,fragment_12)},
+consequent_7=$$anchor6=>{InfoIcon($$anchor6)};if_block(node_8,$$render=>{$$props.infoIcon?$$render(consequent_6):$$props.infoIcon!==null&&$$render(consequent_7,1)})}append($$anchor5,fragment_11)},closeIcon=$$anchor5=>{var fragment_14=comment$2(),node_10=first_child(fragment_14);{var consequent_8=$$anchor6=>{var fragment_15=comment$2(),node_11=first_child(fragment_15);snippet(node_11,()=>$$props.closeIcon??noop$3),append($$anchor6,fragment_15)},consequent_9=$$anchor6=>{CloseIcon($$anchor6)};if_block(
+node_10,$$render=>{$$props.closeIcon?$$render(consequent_8):$$props.closeIcon!==null&&$$render(consequent_9,1)})}append($$anchor5,fragment_14)};let $0=user_derived(()=>toastOptions()?.duration??duration2()),$1=user_derived(()=>toastOptions()?.class??""),$2=user_derived(()=>toastOptions()?.descriptionClass||""),$3=user_derived(()=>toastOptions()?.style??""),$4=user_derived(()=>toastOptions().classes||{}),$5=user_derived(()=>toastOptions().unstyled??!1),$6=user_derived(()=>toastOptions()?.cancelButtonStyle??
+""),$7=user_derived(()=>toastOptions()?.actionButtonStyle??""),$8=user_derived(()=>toastOptions()?.closeButtonAriaLabel??closeButtonAriaLabel());Toast($$anchor4,{get index(){return get$3(index3)},get toast(){return get$3(toast2)},get defaultRichColors(){return richColors()},get duration(){return get$3($0)},get class(){return get$3($1)},get descriptionClass(){return get$3($2)},get invert(){return invert()},get visibleToasts(){return visibleToasts()},get closeButton(){return closeButton()},get interacting(){
+return get$3(interacting)},get position(){return position3},get style(){return get$3($3)},get classes(){return get$3($4)},get unstyled(){return get$3($5)},get cancelButtonStyle(){return get$3($6)},get actionButtonStyle(){return get$3($7)},get closeButtonAriaLabel(){return get$3($8)},get expandByDefault(){return expand()},get expanded(){return get$3(expanded)},get loadingIcon(){return $$props.loadingIcon},successIcon,errorIcon,warningIcon,infoIcon,closeIcon,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,
+infoIcon:!0,closeIcon:!0}})}}),reset(ol),bind_this(ol,$$value=>set$1(listRef,$$value),()=>get$3(listRef)),template_effect(()=>ol.dir=ol.dir),append($$anchor3,ol)}),append($$anchor2,fragment)};if_block(node2,$$render=>{toastState.toasts.length>0&&$$render(consequent_10)})}reset(section2),template_effect(()=>set_attribute(section2,"aria-label",`${containerAriaLabel()??""} ${get$3(hotkeyLabel)??""}`)),append($$anchor,section2),pop()}async function copyToClipboard(text2,successMessage="Copied to cli\
+pboard",errorMessage="Failed to copy to clipboard"){try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(text2),toast.success(successMessage),!0;const textArea=document.createElement("textarea");textArea.value=text2,textArea.style.position="fixed",textArea.style.left="-999999px",textArea.style.top="-999999px",document.body.appendChild(textArea),textArea.focus(),textArea.select();const successful=document.execCommand("copy");if(document.body.removeChild(
+textArea),successful)return toast.success(successMessage),!0;throw new Error("execCommand failed")}catch(error2){return console.error("Failed to copy to clipboard:",error2),toast.error(errorMessage),!1}}async function copyCodeToClipboard(rawCode,successMessage="Code copied to clipboard",errorMessage="Failed to copy code"){return copyToClipboard(rawCode,successMessage,errorMessage)}function formatMessageForClipboard(content2,extras,asPlainText=!1){const textAttachments=extras?.filter(extra=>extra.
+type===AttachmentType.TEXT||extra.type===AttachmentType.LEGACY_CONTEXT||extra.type===AttachmentType.MCP_PROMPT||extra.type===AttachmentType.MCP_RESOURCE)??[];if(textAttachments.length===0)return content2;if(asPlainText){const parts=[content2];for(const att of textAttachments)parts.push(att.content);return parts.join(`
`)}const clipboardAttachments=textAttachments.map(att=>{if(att.type===AttachmentType.MCP_PROMPT){const mcpAtt=att;return{type:AttachmentType.MCP_PROMPT,name:mcpAtt.name,serverName:mcpAtt.serverName,promptName:mcpAtt.promptName,content:mcpAtt.content,arguments:mcpAtt.arguments}}return{type:AttachmentType.TEXT,name:att.name,content:att.content}});return`${JSON.stringify(content2)}
${JSON.stringify(clipboardAttachments,null,2)}`}function parseClipboardContent(clipboardText){const defaultResult={message:clipboardText,textAttachments:[],mcpPromptAttachments:[]};if(!clipboardText.startsWith('"'))return defaultResult;try{let stringEndIndex=-1,escaped=!1;for(let i=1;i<clipboardText.length;i++){const char=clipboardText[i];if(escaped){escaped=!1;continue}if(char==="\\"){escaped=!0;continue}if(char==='"'){stringEndIndex=i;break}}if(stringEndIndex===-1)return defaultResult;const jsonStringPart=clipboardText.
SLASH);case URI_TEMPLATE_OPERATORS.LABEL:return URI_TEMPLATE_SEPARATORS.PERIOD+expandedParts.join(URI_TEMPLATE_SEPARATORS.PERIOD);case URI_TEMPLATE_OPERATORS.PATH_PARAM:return varNames.filter((_,i)=>expandedParts[i]).map((name,i)=>`${URI_TEMPLATE_SEPARATORS.SEMICOLON}${name}=${expandedParts[i]}`).join("");case URI_TEMPLATE_OPERATORS.FORM_QUERY:return URI_TEMPLATE_SEPARATORS.QUERY_PREFIX+varNames.filter((_,i)=>expandedParts[i]).map((name,i)=>`${encodeURIComponent(name)}=${encodeURIComponent(expandedParts[i])}`).
join(URI_TEMPLATE_SEPARATORS.COMMA);case URI_TEMPLATE_OPERATORS.FORM_CONTINUATION:return URI_TEMPLATE_SEPARATORS.QUERY_CONTINUATION+varNames.filter((_,i)=>expandedParts[i]).map((name,i)=>`${encodeURIComponent(name)}=${encodeURIComponent(expandedParts[i])}`).join(URI_TEMPLATE_SEPARATORS.COMMA);default:return expandedParts.map(v=>encodeURIComponent(v)).join(URI_TEMPLATE_SEPARATORS.COMMA)}})}function isTemplateComplete(template,values){return extractTemplateVariables(template).every(v=>(values[v.name]??
"").trim()!=="")}function createBase64DataUrl(mimeType,base64Data){return`data:${mimeType};base64,${base64Data}`}function parseHeadersToArray(headersJson){if(!headersJson?.trim())return[];try{const parsed=JSON.parse(headersJson);if(typeof parsed=="object"&&parsed!==null&&!Array.isArray(parsed))return Object.entries(parsed).map(([key2,value])=>({key:key2,value:String(value)}))}catch{return[]}return[]}function serializeHeaders(pairs){const validPairs=pairs.filter(p2=>p2.key.trim());if(validPairs.length===
-0)return"";const obj={};for(const pair of validPairs)obj[pair.key.trim()]=pair.value;return JSON.stringify(obj)}function getFaviconUrl(urlString,useProxy=!0){try{const url2=new URL(urlString),hostnameParts=url2.hostname.split(DOMAIN_SEPARATOR),rootDomain=hostnameParts.length>=ROOT_DOMAIN_MIN_PARTS?hostnameParts.slice(-ROOT_DOMAIN_MIN_PARTS).join(DOMAIN_SEPARATOR):url2.hostname,googleFaviconUrl=`${GOOGLE_FAVICON_BASE_URL}?domain=${rootDomain}&sz=${DEFAULT_FAVICON_SIZE}`;return useProxy?getProxiedUrlString(
-googleFaviconUrl):googleFaviconUrl}catch{return null}}function deriveSingleTurnSections(message,toolMessages=[],streamingToolCalls=[],isStreaming=!1){const sections=[];if(message.reasoningContent){const toolCalls2=parseToolCalls(message.toolCalls),hasContentAfterReasoning=!!message.content?.trim()||toolCalls2.length>0||streamingToolCalls.length>0,isPending=isStreaming&&!hasContentAfterReasoning;sections.push({type:isPending?AgenticSectionType.REASONING_PENDING:AgenticSectionType.REASONING,content:message.
-reasoningContent})}message.content?.trim()&§ions.push({type:AgenticSectionType.TEXT,content:message.content});const toolCalls=parseToolCalls(message.toolCalls);for(const tc of toolCalls){const resultMsg=toolMessages.find(m=>m.toolCallId===tc.id),type2=resultMsg?AgenticSectionType.TOOL_CALL:isStreaming?AgenticSectionType.TOOL_CALL_PENDING:AgenticSectionType.TOOL_CALL;sections.push({type:type2,content:resultMsg?.content||"",toolName:tc.function?.name,toolArgs:tc.function?.arguments,toolResult:resultMsg?.
-content,toolResultExtras:resultMsg?.extra})}for(const tc of streamingToolCalls)tc.id&&toolCalls.find(t=>t.id===tc.id)||sections.push({type:AgenticSectionType.TOOL_CALL_STREAMING,content:"",toolName:tc.function?.name,toolArgs:tc.function?.arguments});return sections}function deriveAgenticSections(message,toolMessages=[],streamingToolCalls=[],isStreaming=!1){if(!toolMessages.some(m=>m.role===MessageRole.ASSISTANT))return deriveSingleTurnSections(message,toolMessages,streamingToolCalls,isStreaming);
-const sections=[],firstTurnToolMsgs=collectToolMessages(toolMessages,0);sections.push(...deriveSingleTurnSections(message,firstTurnToolMsgs));let i=firstTurnToolMsgs.length;for(;i<toolMessages.length;){const msg=toolMessages[i];if(msg.role===MessageRole.ASSISTANT){const turnToolMsgs=collectToolMessages(toolMessages,i+1),isLastTurn=i+1+turnToolMsgs.length>=toolMessages.length;sections.push(...deriveSingleTurnSections(msg,turnToolMsgs,isLastTurn?streamingToolCalls:[],isLastTurn&&isStreaming)),i+=1+
-turnToolMsgs.length}else i++}return sections}function collectToolMessages(messages,startIndex){const result=[];for(let i=startIndex;i<messages.length&&messages[i].role===MessageRole.TOOL;i++)result.push(messages[i]);return result}function parseToolResultWithImages(toolResult,extras){return toolResult.split(NEWLINE_SEPARATOR).map(line=>{const match=line.match(ATTACHMENT_SAVED_REGEX);if(!match||!extras)return{text:line};const attachmentName=match[1],image2=extras.find(e=>e.type===AttachmentType.IMAGE&&
-e.name===attachmentName);return{text:line,image:image2}})}function parseToolCalls(toolCallsJson){if(!toolCallsJson)return[];try{const parsed=JSON.parse(toolCallsJson);return Array.isArray(parsed)?parsed:[]}catch{return[]}}function hasAgenticContent(message,toolMessages=[]){return message.toolCalls&&parseToolCalls(message.toolCalls).length>0?!0:toolMessages.length>0}var dexie_min$1={exports:{}},dexie_min=dexie_min$1.exports,hasRequiredDexie_min;function requireDexie_min(){return hasRequiredDexie_min||
-(hasRequiredDexie_min=1,(function(module,exports$1){(function(e,t){module.exports=t()})(dexie_min,function(){var s2=function(e2,t2){return(s2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e3,t3){e3.__proto__=t3}||function(e3,t3){for(var n2 in t3)Object.prototype.hasOwnProperty.call(t3,n2)&&(e3[n2]=t3[n2])})(e2,t2)},_=function(){return(_=Object.assign||function(e2){for(var t2,n2=1,r3=arguments.length;n2<r3;n2++)for(var i2 in t2=arguments[n2])Object.prototype.hasOwnProperty.call(
-t2,i2)&&(e2[i2]=t2[i2]);return e2}).apply(this,arguments)};function i(e2,t2,n2){for(var r3,i2=0,o2=t2.length;i2<o2;i2++)!r3&&i2 in t2||((r3=r3||Array.prototype.slice.call(t2,0,i2))[i2]=t2[i2]);return e2.concat(r3||Array.prototype.slice.call(t2))}var f=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:commonjsGlobal,x=Object.keys,k=Array.isArray;function a(t2,n2){return typeof n2!="object"||x(n2).forEach(function(e2){t2[e2]=n2[e2]}),t2}typeof Promise>"u"||f.Promise||(f.
-Promise=Promise);var c2=Object.getPrototypeOf,n={}.hasOwnProperty;function m(e2,t2){return n.call(e2,t2)}function r2(t2,n2){typeof n2=="function"&&(n2=n2(c2(t2))),(typeof Reflect>"u"?x:Reflect.ownKeys)(n2).forEach(function(e2){l(t2,e2,n2[e2])})}var u=Object.defineProperty;function l(e2,t2,n2,r3){u(e2,t2,a(n2&&m(n2,"get")&&typeof n2.get=="function"?{get:n2.get,set:n2.set,configurable:!0}:{value:n2,configurable:!0,writable:!0},r3))}function o(t2){return{from:function(e2){return t2.prototype=Object.
-create(e2.prototype),l(t2.prototype,"constructor",t2),{extend:r2.bind(null,t2.prototype)}}}}var h2=Object.getOwnPropertyDescriptor,d2=[].slice;function b(e2,t2,n2){return d2.call(e2,t2,n2)}function p2(e2,t2){return t2(e2)}function y(e2){if(!e2)throw new Error("Assertion Failed")}function v(e2){f.setImmediate?setImmediate(e2):setTimeout(e2,0)}function O(e2,t2){if(typeof t2=="string"&&m(e2,t2))return e2[t2];if(!t2)return e2;if(typeof t2!="string"){for(var n2=[],r3=0,i2=t2.length;r3<i2;++r3){var o2=O(
-e2,t2[r3]);n2.push(o2)}return n2}var a2=t2.indexOf(".");if(a2!==-1){var u2=e2[t2.substr(0,a2)];return u2==null?void 0:O(u2,t2.substr(a2+1))}}function P(e2,t2,n2){if(e2&&t2!==void 0&&!("isFrozen"in Object&&Object.isFrozen(e2)))if(typeof t2!="string"&&"length"in t2){y(typeof n2!="string"&&"length"in n2);for(var r3=0,i2=t2.length;r3<i2;++r3)P(e2,t2[r3],n2[r3])}else{var o2,a2,u2=t2.indexOf(".");u2!==-1?(o2=t2.substr(0,u2),(a2=t2.substr(u2+1))===""?n2===void 0?k(e2)&&!isNaN(parseInt(o2))?e2.splice(o2,
-1):delete e2[o2]:e2[o2]=n2:P(u2=!(u2=e2[o2])||!m(e2,o2)?e2[o2]={}:u2,a2,n2)):n2===void 0?k(e2)&&!isNaN(parseInt(t2))?e2.splice(t2,1):delete e2[t2]:e2[t2]=n2}}function g(e2){var t2,n2={};for(t2 in e2)m(e2,t2)&&(n2[t2]=e2[t2]);return n2}var t=[].concat;function w(e2){return t.apply([],e2)}var e="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKe\
-y".split(",").concat(w([8,16,32,64].map(function(t2){return["Int","Uint","Float"].map(function(e2){return e2+t2+"Array"})}))).filter(function(e2){return f[e2]}),K=new Set(e.map(function(e2){return f[e2]})),E=null;function S2(e2){return E=new WeakMap,e2=(function e3(t2){if(!t2||typeof t2!="object")return t2;var n2=E.get(t2);if(n2)return n2;if(k(t2)){n2=[],E.set(t2,n2);for(var r3=0,i2=t2.length;r3<i2;++r3)n2.push(e3(t2[r3]))}else if(K.has(t2.constructor))n2=t2;else{var o2,a2=c2(t2);for(o2 in n2=a2===
-Object.prototype?{}:Object.create(a2),E.set(t2,n2),t2)m(t2,o2)&&(n2[o2]=e3(t2[o2]))}return n2})(e2),E=null,e2}var j={}.toString;function A(e2){return j.call(e2).slice(8,-1)}var C=typeof Symbol<"u"?Symbol.iterator:"@@iterator",T2=typeof C=="symbol"?function(e2){var t2;return e2!=null&&(t2=e2[C])&&t2.apply(e2)}:function(){return null};function q2(e2,t2){return t2=e2.indexOf(t2),0<=t2&&e2.splice(t2,1),0<=t2}var D2={};function I(e2){var t2,n2,r3,i2;if(arguments.length===1){if(k(e2))return e2.slice();
-if(this===D2&&typeof e2=="string")return[e2];if(i2=T2(e2)){for(n2=[];!(r3=i2.next()).done;)n2.push(r3.value);return n2}if(e2==null)return[e2];if(typeof(t2=e2.length)!="number")return[e2];for(n2=new Array(t2);t2--;)n2[t2]=e2[t2];return n2}for(t2=arguments.length,n2=new Array(t2);t2--;)n2[t2]=arguments[t2];return n2}var B=typeof Symbol<"u"?function(e2){return e2[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},R=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","\
-NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],F=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(R),M={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Trans\
-action has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function N(e2,t2){this.name=e2,this.message=t2}function L(e2,t2){return e2+". Errors: "+Object.keys(t2).map(function(e3){return t2[e3].toString()}).filter(function(e3,t3,n2){return n2.indexOf(e3)===t3}).join(`
+0)return"";const obj={};for(const pair of validPairs)obj[pair.key.trim()]=pair.value;return JSON.stringify(obj)}function deriveSingleTurnSections(message,toolMessages=[],streamingToolCalls=[],isStreaming=!1){const sections=[];if(message.reasoningContent){const toolCalls2=parseToolCalls(message.toolCalls),hasContentAfterReasoning=!!message.content?.trim()||toolCalls2.length>0||streamingToolCalls.length>0,isPending=isStreaming&&!hasContentAfterReasoning;sections.push({type:isPending?AgenticSectionType.
+REASONING_PENDING:AgenticSectionType.REASONING,content:message.reasoningContent})}message.content?.trim()&§ions.push({type:AgenticSectionType.TEXT,content:message.content});const toolCalls=parseToolCalls(message.toolCalls);for(const tc of toolCalls){const resultMsg=toolMessages.find(m=>m.toolCallId===tc.id),type2=resultMsg?AgenticSectionType.TOOL_CALL:isStreaming?AgenticSectionType.TOOL_CALL_PENDING:AgenticSectionType.TOOL_CALL;sections.push({type:type2,content:resultMsg?.content||"",toolName:tc.
+function?.name,toolArgs:tc.function?.arguments,toolResult:resultMsg?.content,toolResultExtras:resultMsg?.extra})}for(const tc of streamingToolCalls)tc.id&&toolCalls.find(t=>t.id===tc.id)||sections.push({type:AgenticSectionType.TOOL_CALL_STREAMING,content:"",toolName:tc.function?.name,toolArgs:tc.function?.arguments});return sections}function deriveAgenticSections(message,toolMessages=[],streamingToolCalls=[],isStreaming=!1){if(!toolMessages.some(m=>m.role===MessageRole.ASSISTANT))return deriveSingleTurnSections(
+message,toolMessages,streamingToolCalls,isStreaming);const sections=[],firstTurnToolMsgs=collectToolMessages(toolMessages,0);sections.push(...deriveSingleTurnSections(message,firstTurnToolMsgs));let i=firstTurnToolMsgs.length;for(;i<toolMessages.length;){const msg=toolMessages[i];if(msg.role===MessageRole.ASSISTANT){const turnToolMsgs=collectToolMessages(toolMessages,i+1),isLastTurn=i+1+turnToolMsgs.length>=toolMessages.length;sections.push(...deriveSingleTurnSections(msg,turnToolMsgs,isLastTurn?
+streamingToolCalls:[],isLastTurn&&isStreaming)),i+=1+turnToolMsgs.length}else i++}return sections}function collectToolMessages(messages,startIndex){const result=[];for(let i=startIndex;i<messages.length&&messages[i].role===MessageRole.TOOL;i++)result.push(messages[i]);return result}function parseToolResultWithImages(toolResult,extras){return toolResult.split(NEWLINE_SEPARATOR).map(line=>{const match=line.match(ATTACHMENT_SAVED_REGEX);if(!match||!extras)return{text:line};const attachmentName=match[1],
+image2=extras.find(e=>e.type===AttachmentType.IMAGE&&e.name===attachmentName);return{text:line,image:image2}})}function parseToolCalls(toolCallsJson){if(!toolCallsJson)return[];try{const parsed=JSON.parse(toolCallsJson);return Array.isArray(parsed)?parsed:[]}catch{return[]}}function hasAgenticContent(message,toolMessages=[]){return message.toolCalls&&parseToolCalls(message.toolCalls).length>0?!0:toolMessages.length>0}var dexie_min$1={exports:{}},dexie_min=dexie_min$1.exports,hasRequiredDexie_min;
+function requireDexie_min(){return hasRequiredDexie_min||(hasRequiredDexie_min=1,(function(module,exports$1){(function(e,t){module.exports=t()})(dexie_min,function(){var s2=function(e2,t2){return(s2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e3,t3){e3.__proto__=t3}||function(e3,t3){for(var n2 in t3)Object.prototype.hasOwnProperty.call(t3,n2)&&(e3[n2]=t3[n2])})(e2,t2)},_=function(){return(_=Object.assign||function(e2){for(var t2,n2=1,r3=arguments.length;n2<r3;n2++)for(var i2 in t2=
+arguments[n2])Object.prototype.hasOwnProperty.call(t2,i2)&&(e2[i2]=t2[i2]);return e2}).apply(this,arguments)};function i(e2,t2,n2){for(var r3,i2=0,o2=t2.length;i2<o2;i2++)!r3&&i2 in t2||((r3=r3||Array.prototype.slice.call(t2,0,i2))[i2]=t2[i2]);return e2.concat(r3||Array.prototype.slice.call(t2))}var f=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:commonjsGlobal,x=Object.keys,k=Array.isArray;function a(t2,n2){return typeof n2!="object"||x(n2).forEach(function(e2){
+t2[e2]=n2[e2]}),t2}typeof Promise>"u"||f.Promise||(f.Promise=Promise);var c2=Object.getPrototypeOf,n={}.hasOwnProperty;function m(e2,t2){return n.call(e2,t2)}function r2(t2,n2){typeof n2=="function"&&(n2=n2(c2(t2))),(typeof Reflect>"u"?x:Reflect.ownKeys)(n2).forEach(function(e2){l(t2,e2,n2[e2])})}var u=Object.defineProperty;function l(e2,t2,n2,r3){u(e2,t2,a(n2&&m(n2,"get")&&typeof n2.get=="function"?{get:n2.get,set:n2.set,configurable:!0}:{value:n2,configurable:!0,writable:!0},r3))}function o(t2){
+return{from:function(e2){return t2.prototype=Object.create(e2.prototype),l(t2.prototype,"constructor",t2),{extend:r2.bind(null,t2.prototype)}}}}var h2=Object.getOwnPropertyDescriptor,d2=[].slice;function b(e2,t2,n2){return d2.call(e2,t2,n2)}function p2(e2,t2){return t2(e2)}function y(e2){if(!e2)throw new Error("Assertion Failed")}function v(e2){f.setImmediate?setImmediate(e2):setTimeout(e2,0)}function O(e2,t2){if(typeof t2=="string"&&m(e2,t2))return e2[t2];if(!t2)return e2;if(typeof t2!="string"){
+for(var n2=[],r3=0,i2=t2.length;r3<i2;++r3){var o2=O(e2,t2[r3]);n2.push(o2)}return n2}var a2=t2.indexOf(".");if(a2!==-1){var u2=e2[t2.substr(0,a2)];return u2==null?void 0:O(u2,t2.substr(a2+1))}}function P(e2,t2,n2){if(e2&&t2!==void 0&&!("isFrozen"in Object&&Object.isFrozen(e2)))if(typeof t2!="string"&&"length"in t2){y(typeof n2!="string"&&"length"in n2);for(var r3=0,i2=t2.length;r3<i2;++r3)P(e2,t2[r3],n2[r3])}else{var o2,a2,u2=t2.indexOf(".");u2!==-1?(o2=t2.substr(0,u2),(a2=t2.substr(u2+1))===""?
+n2===void 0?k(e2)&&!isNaN(parseInt(o2))?e2.splice(o2,1):delete e2[o2]:e2[o2]=n2:P(u2=!(u2=e2[o2])||!m(e2,o2)?e2[o2]={}:u2,a2,n2)):n2===void 0?k(e2)&&!isNaN(parseInt(t2))?e2.splice(t2,1):delete e2[t2]:e2[t2]=n2}}function g(e2){var t2,n2={};for(t2 in e2)m(e2,t2)&&(n2[t2]=e2[t2]);return n2}var t=[].concat;function w(e2){return t.apply([],e2)}var e="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uin\
+t8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(w([8,16,32,64].map(function(t2){return["Int","Uint","Float"].map(function(e2){return e2+t2+"Array"})}))).filter(function(e2){return f[e2]}),K=new Set(e.map(function(e2){return f[e2]})),E=null;function S2(e2){return E=new WeakMap,e2=(function e3(t2){if(!t2||typeof t2!="object")return t2;var n2=E.get(t2);if(n2)return n2;if(k(t2)){n2=[],E.set(t2,n2);for(var r3=0,i2=t2.length;r3<i2;++r3)n2.push(e3(t2[r3]))}else if(K.has(t2.constructor))
+n2=t2;else{var o2,a2=c2(t2);for(o2 in n2=a2===Object.prototype?{}:Object.create(a2),E.set(t2,n2),t2)m(t2,o2)&&(n2[o2]=e3(t2[o2]))}return n2})(e2),E=null,e2}var j={}.toString;function A(e2){return j.call(e2).slice(8,-1)}var C=typeof Symbol<"u"?Symbol.iterator:"@@iterator",T2=typeof C=="symbol"?function(e2){var t2;return e2!=null&&(t2=e2[C])&&t2.apply(e2)}:function(){return null};function q2(e2,t2){return t2=e2.indexOf(t2),0<=t2&&e2.splice(t2,1),0<=t2}var D2={};function I(e2){var t2,n2,r3,i2;if(arguments.
+length===1){if(k(e2))return e2.slice();if(this===D2&&typeof e2=="string")return[e2];if(i2=T2(e2)){for(n2=[];!(r3=i2.next()).done;)n2.push(r3.value);return n2}if(e2==null)return[e2];if(typeof(t2=e2.length)!="number")return[e2];for(n2=new Array(t2);t2--;)n2[t2]=e2[t2];return n2}for(t2=arguments.length,n2=new Array(t2);t2--;)n2[t2]=arguments[t2];return n2}var B=typeof Symbol<"u"?function(e2){return e2[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},R=["Unknown","Constraint","Data","Tran\
+sactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],F=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(R),M={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transact\
+ion aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function N(e2,t2){this.name=e2,this.message=t2}function L(e2,t2){return e2+". Errors: "+Object.keys(t2).map(function(e3){return t2[e3].toString()}).filter(function(e3,t3,n2){return n2.indexOf(e3)===t3}).join(`
`)}function U(e2,t2,n2,r3){this.failures=t2,this.failedKeys=r3,this.successCount=n2,this.message=L(e2,t2)}function V(e2,t2){this.name="BulkError",this.failures=Object.keys(t2).map(function(e3){return t2[e3]}),this.failuresByPos=t2,this.message=L(e2,this.failures)}o(N).from(Error).extend({toString:function(){return this.name+": "+this.message}}),o(U).from(N),o(V).from(N);var z=F.reduce(function(e2,t2){return e2[t2]=t2+"Error",e2},{}),W=N,Y=F.reduce(function(e2,n2){var r3=n2+"Error";function t2(e3,t3){
this.name=r3,e3?typeof e3=="string"?(this.message="".concat(e3).concat(t3?`
`+t3:""),this.inner=t3||null):typeof e3=="object"&&(this.message="".concat(e3.name," ").concat(e3.message),this.inner=e3):(this.message=M[n2]||r3,this.inner=null)}return o(t2).from(W),e2[n2]=t2,e2},{});Y.Syntax=SyntaxError,Y.Type=TypeError,Y.Range=RangeError;var $=R.reduce(function(e2,t2){return e2[t2+"Error"]=Y[t2],e2},{}),Q=F.reduce(function(e2,t2){return["Syntax","Type","Range"].indexOf(t2)===-1&&(e2[t2+"Error"]=Y[t2]),e2},{});function G(){}function X2(e2){return e2}function H(t2,n2){return t2==
size}:body2 instanceof URLSearchParams?{kind:"urlsearchparams",size:body2.toString().length}:body2 instanceof FormData?{kind:"formdata"}:body2 instanceof ArrayBuffer?{kind:"arraybuffer",size:body2.byteLength}:ArrayBuffer.isView(body2)?{kind:body2.constructor.name,size:body2.byteLength}:{kind:typeof body2}}function formatDiagnosticErrorMessage(error2){const message=error2 instanceof Error?error2.message:String(error2);return message.includes("Failed to fetch")?`${message} (check CORS?)`:message}function extractJsonRpcMethods(body2){
if(typeof body2=="string")try{const parsed=JSON.parse(body2),methods=(Array.isArray(parsed)?parsed:[parsed]).map(message=>typeof message?.method=="string"?message.method:void 0).filter(method=>!!method);return methods.length>0?methods:void 0}catch{return}}function throwIfAborted(signal){if(signal?.aborted)throw new DOMException("Operation was aborted","AbortError")}function isAbortError(error2){return error2 instanceof DOMException&&error2.name==="AbortError"||error2 instanceof Error&&error2.name===
"AbortError"}function uuid$1(){return globalThis.crypto?.randomUUID?.()??Math.random().toString(36).substring(2)}function remToPx(rem){const val=parseFloat(rem),fontSize=parseFloat(getComputedStyle(document.documentElement).fontSize);return val*fontSize}function ActionIconCopyToClipboard($$anchor,$$props){push$1($$props,!1);let ariaLabel=prop($$props,"ariaLabel",8,"Copy to clipboard"),canCopy=prop($$props,"canCopy",8,!0),text2=prop($$props,"text",8);init();{let $0=derived_safe_equal(()=>!canCopy());
-ActionIcon($$anchor,{get icon(){return Copy},get tooltip(){return ariaLabel()},iconSize:"h-4 w-4",get disabled(){return get$3($0)},onclick:()=>canCopy()&©ToClipboard(text2())})}pop()}var root$1I=from_html("<button><!> <!></button>");function BadgeInfo($$anchor,$$props){let className=prop($$props,"class",3,"");var button=root$1I(),node2=child(button);{var consequent=$$anchor2=>{var fragment=comment$2(),node_1=first_child(fragment);snippet(node_1,()=>$$props.icon),append($$anchor2,fragment)};if_block(
-node2,$$render=>{$$props.icon&&$$render(consequent)})}var node_2=sibling(node2,2);snippet(node_2,()=>$$props.children),reset(button),template_effect(()=>set_class(button,1,clsx(["inline-flex cursor-pointer items-center gap-1 rounded-sm bg-muted-foreground/15 px-1.5 py-0.75",className()]))),delegated("click",button,function(...$$args){$$props.onclick?.apply(this,$$args)}),append($$anchor,button)}delegate(["click"]);var root_3$X=from_html("<!> Vision",1),root_4$D=from_html("<!> Audio",1),root_2$1c=from_html(
-"<span><!></span>");function BadgesModality($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,"");var fragment=comment$2(),node2=first_child(fragment);each(node2,16,()=>$$props.modalities,modality=>modality,($$anchor2,modality)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{var consequent_1=$$anchor3=>{var span=root_2$1c(),node_2=child(span);{var consequent=$$anchor4=>{var fragment_2=root_3$X(),node_3=first_child(fragment_2);Eye(node_3,{class:"h-3 w-3"}),next$1(),
-append($$anchor4,fragment_2)},alternate=$$anchor4=>{var fragment_3=root_4$D(),node_4=first_child(fragment_3);Mic(node_4,{class:"h-3 w-3"}),next$1(),append($$anchor4,fragment_3)};if_block(node_2,$$render=>{modality===ModelModality.VISION?$$render(consequent):$$render(alternate,-1)})}reset(span),template_effect(()=>set_class(span,1,clsx(["inline-flex items-center gap-1 rounded-md bg-muted px-2 py-1 text-xs font-medium",className()]))),append($$anchor3,span)};if_block(node_1,$$render=>{(modality===
-ModelModality.VISION||modality===ModelModality.AUDIO)&&$$render(consequent_1)})}append($$anchor2,fragment_1)}),append($$anchor,fragment),pop()}var root_6$x=from_html('<div class="flex flex-wrap items-start justify-end gap-3"></div>'),root_2$1b=from_html("<div><!></div>"),root$1H=from_html("<!> <!> <!>",1);function ChatAttachmentsList($$anchor,$$props){push$1($$props,!0);const attachmentitem=($$anchor2,item=noop$3)=>{ChatAttachmentsListItem($$anchor2,{get imageClass(){return imageClass()},get imageHeight(){
+ActionIcon($$anchor,{get icon(){return Copy},get tooltip(){return ariaLabel()},iconSize:"h-4 w-4",get disabled(){return get$3($0)},onclick:()=>canCopy()&©ToClipboard(text2())})}pop()}var root$1J=from_html("<button><!> <!></button>");function BadgeInfo($$anchor,$$props){let className=prop($$props,"class",3,"");var button=root$1J(),node2=child(button);{var consequent=$$anchor2=>{var fragment=comment$2(),node_1=first_child(fragment);snippet(node_1,()=>$$props.icon),append($$anchor2,fragment)};if_block(
+node2,$$render=>{$$props.icon&&$$render(consequent)})}var node_2=sibling(node2,2);snippet(node_2,()=>$$props.children),reset(button),template_effect(()=>set_class(button,1,clsx(["inline-flex cursor-pointer items-center gap-1 rounded-sm bg-muted-foreground/15 px-1.5 py-0.75",className()]))),delegated("click",button,function(...$$args){$$props.onclick?.apply(this,$$args)}),append($$anchor,button)}delegate(["click"]);var root_3$Y=from_html("<!> Vision",1),root_4$E=from_html("<!> Audio",1),root_2$1b=from_html(
+"<span><!></span>");function BadgesModality($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,"");var fragment=comment$2(),node2=first_child(fragment);each(node2,16,()=>$$props.modalities,modality=>modality,($$anchor2,modality)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{var consequent_1=$$anchor3=>{var span=root_2$1b(),node_2=child(span);{var consequent=$$anchor4=>{var fragment_2=root_3$Y(),node_3=first_child(fragment_2);Eye(node_3,{class:"h-3 w-3"}),next$1(),
+append($$anchor4,fragment_2)},alternate=$$anchor4=>{var fragment_3=root_4$E(),node_4=first_child(fragment_3);Mic(node_4,{class:"h-3 w-3"}),next$1(),append($$anchor4,fragment_3)};if_block(node_2,$$render=>{modality===ModelModality.VISION?$$render(consequent):$$render(alternate,-1)})}reset(span),template_effect(()=>set_class(span,1,clsx(["inline-flex items-center gap-1 rounded-md bg-muted px-2 py-1 text-xs font-medium",className()]))),append($$anchor3,span)};if_block(node_1,$$render=>{(modality===
+ModelModality.VISION||modality===ModelModality.AUDIO)&&$$render(consequent_1)})}append($$anchor2,fragment_1)}),append($$anchor,fragment),pop()}var root_6$w=from_html('<div class="flex flex-wrap items-start justify-end gap-3"></div>'),root_2$1a=from_html("<div><!></div>"),root$1I=from_html("<!> <!> <!>",1);function ChatAttachmentsList($$anchor,$$props){push$1($$props,!0);const attachmentitem=($$anchor2,item=noop$3)=>{ChatAttachmentsListItem($$anchor2,{get imageClass(){return imageClass()},get imageHeight(){
return imageHeight()},get imageWidth(){return imageWidth()},get item(){return item()},get limitToSingleRow(){return limitToSingleRow()},get onFileRemove(){return $$props.onFileRemove},onMcpResourcePreview:openMcpResourcePreview,onPreview:(i,event2)=>openPreview(i,event2),get readonly(){return readonly2()}})};let className=prop($$props,"class",3,""),style2=prop($$props,"style",3,""),attachments=prop($$props,"attachments",19,()=>[]),readonly2=prop($$props,"readonly",3,!1),uploadedFiles=prop($$props,
"uploadedFiles",27,()=>proxy([])),imageClass=prop($$props,"imageClass",3,""),imageHeight=prop($$props,"imageHeight",3,"h-24"),imageWidth=prop($$props,"imageWidth",3,"w-auto"),limitToSingleRow=prop($$props,"limitToSingleRow",3,!1),carouselRef=state$1(void 0),mcpResourcePreviewOpen=state$1(!1),mcpResourcePreviewExtra=state$1(null),previewFocusIndex=state$1(0),viewAllDialogOpen=state$1(!1),displayItems=user_derived(()=>getAttachmentDisplayItems({uploadedFiles:uploadedFiles(),attachments:attachments()}));
-function openPreview(item,event2){event2?.stopPropagation(),event2?.preventDefault();const index2=get$3(displayItems).filter(i=>!isMcpPrompt(i)&&!isMcpResource(i)).findIndex(i=>i.id===item.id);set$1(previewFocusIndex,index2>=0?index2:0,!0),set$1(viewAllDialogOpen,!0)}function openMcpResourcePreview(extra){set$1(mcpResourcePreviewExtra,extra,!0),set$1(mcpResourcePreviewOpen,!0)}user_effect(()=>{get$3(carouselRef)&&get$3(displayItems).length&&get$3(carouselRef).resetScroll()});var fragment_1=root$1H(),
-node2=first_child(fragment_1);{var consequent_1=$$anchor2=>{var div=root_2$1b(),node_1=child(div);{var consequent=$$anchor3=>{bind_this(HorizontalScrollCarousel($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_3=comment$2(),node_2=first_child(fragment_3);each(node_2,17,()=>get$3(displayItems),item=>item.id,($$anchor5,item)=>{attachmentitem($$anchor5,()=>get$3(item))}),append($$anchor4,fragment_3)},$$slots:{default:!0}}),$$value=>set$1(carouselRef,$$value,!0),()=>get$3(carouselRef))},alternate=$$anchor3=>{
-var div_1=root_6$x();each(div_1,21,()=>get$3(displayItems),item=>item.id,($$anchor4,item)=>{attachmentitem($$anchor4,()=>get$3(item))}),reset(div_1),append($$anchor3,div_1)};if_block(node_1,$$render=>{limitToSingleRow()?$$render(consequent):$$render(alternate,-1)})}reset(div),template_effect(()=>{set_class(div,1,clsx(className())),set_style(div,style2())}),append($$anchor2,div)};if_block(node2,$$render=>{get$3(displayItems).length>0&&$$render(consequent_1)})}var node_3=sibling(node2,2);DialogChatAttachmentsPreview(
+function openPreview(item,event2){event2?.stopPropagation(),event2?.preventDefault();const index2=get$3(displayItems).filter(i=>!isMcpPrompt(i)&&!isMcpResource(i)).findIndex(i=>i.id===item.id);set$1(previewFocusIndex,index2>=0?index2:0,!0),set$1(viewAllDialogOpen,!0)}function openMcpResourcePreview(extra){set$1(mcpResourcePreviewExtra,extra,!0),set$1(mcpResourcePreviewOpen,!0)}user_effect(()=>{get$3(carouselRef)&&get$3(displayItems).length&&get$3(carouselRef).resetScroll()});var fragment_1=root$1I(),
+node2=first_child(fragment_1);{var consequent_1=$$anchor2=>{var div=root_2$1a(),node_1=child(div);{var consequent=$$anchor3=>{bind_this(HorizontalScrollCarousel($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_3=comment$2(),node_2=first_child(fragment_3);each(node_2,17,()=>get$3(displayItems),item=>item.id,($$anchor5,item)=>{attachmentitem($$anchor5,()=>get$3(item))}),append($$anchor4,fragment_3)},$$slots:{default:!0}}),$$value=>set$1(carouselRef,$$value,!0),()=>get$3(carouselRef))},alternate=$$anchor3=>{
+var div_1=root_6$w();each(div_1,21,()=>get$3(displayItems),item=>item.id,($$anchor4,item)=>{attachmentitem($$anchor4,()=>get$3(item))}),reset(div_1),append($$anchor3,div_1)};if_block(node_1,$$render=>{limitToSingleRow()?$$render(consequent):$$render(alternate,-1)})}reset(div),template_effect(()=>{set_class(div,1,clsx(className())),set_style(div,style2())}),append($$anchor2,div)};if_block(node2,$$render=>{get$3(displayItems).length>0&&$$render(consequent_1)})}var node_3=sibling(node2,2);DialogChatAttachmentsPreview(
node_3,{get activeModelId(){return $$props.activeModelId},get attachments(){return attachments()},get previewFocusIndex(){return get$3(previewFocusIndex)},get uploadedFiles(){return uploadedFiles()},get open(){return get$3(viewAllDialogOpen)},set open($$value){set$1(viewAllDialogOpen,$$value,!0)}});var node_4=sibling(node_3,2);{var consequent_2=$$anchor2=>{DialogMcpResourcePreview($$anchor2,{get extra(){return get$3(mcpResourcePreviewExtra)},get open(){return get$3(mcpResourcePreviewOpen)},set open($$value){
set$1(mcpResourcePreviewOpen,$$value,!0)}})};if_block(node_4,$$render=>{get$3(mcpResourcePreviewExtra)&&$$render(consequent_2)})}append($$anchor,fragment_1),pop()}function ChatAttachmentsListItem($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),imageClass=prop($$props,"imageClass",3,""),imageHeight=prop($$props,"imageHeight",3,"h-24"),imageWidth=prop($$props,"imageWidth",3,"w-auto"),limitToSingleRow=prop($$props,"limitToSingleRow",3,!1),readonly2=prop($$props,"readon\
ly",3,!1);const scrollClasses=user_derived(()=>limitToSingleRow()?"first:ml-4 last:mr-4":"");function toMcpResourceAttachment(extra,id2){return{id:id2,resource:{uri:extra.uri,name:extra.name,title:extra.name,serverName:extra.serverName}}}var fragment=comment$2(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{const mcpPrompt=user_derived(()=>$$props.item.attachment?.type===AttachmentType.MCP_PROMPT?$$props.item.attachment:$$props.item.uploadedFile?.mcpPrompt?{type:AttachmentType.MCP_PROMPT,
""} ${get$3(scrollClasses)??""}`},get id(){return $$props.item.id},get name(){return $$props.item.name},get preview(){return $$props.item.preview},get readonly(){return readonly2()},get onRemove(){return $$props.onFileRemove},get height(){return imageHeight()},get width(){return imageWidth()},get imageClass(){return imageClass()},onclick:()=>$$props.onPreview?.($$props.item)})},consequent_4=$$anchor2=>{ChatAttachmentsListItemThumbnailFile($$anchor2,{get class(){return`flex-shrink-0 cursor-pointe\
r ${className()??""} ${get$3(scrollClasses)??""}`},get id(){return $$props.item.id},get name(){return $$props.item.name},get size(){return $$props.item.size},get readonly(){return readonly2()},get onRemove(){return $$props.onFileRemove},get textContent(){return $$props.item.textContent},get attachment(){return $$props.item.attachment},get uploadedFile(){return $$props.item.uploadedFile},onclick:()=>$$props.onPreview?.($$props.item)})},d_2=user_derived(()=>isPdfFile$1($$props.item.attachment,$$props.
item.uploadedFile)),alternate=$$anchor2=>{ChatAttachmentsListItemThumbnailFile($$anchor2,{get class(){return`flex-shrink-0 cursor-pointer ${className()??""} ${get$3(scrollClasses)??""}`},get id(){return $$props.item.id},get name(){return $$props.item.name},get size(){return $$props.item.size},get readonly(){return readonly2()},get onRemove(){return $$props.onFileRemove},get textContent(){return $$props.item.textContent},get attachment(){return $$props.item.attachment},get uploadedFile(){return $$props.
-item.uploadedFile},onclick:()=>$$props.onPreview?.($$props.item)})};if_block(node2,$$render=>{get$3(d2)?$$render(consequent_1):get$3(d_12)?$$render(consequent_2,1):$$props.item.isImage&&$$props.item.preview?$$render(consequent_3,2):get$3(d_2)?$$render(consequent_4,3):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_1$14=from_html('<div class="absolute top-10 right-2 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100"><!></div>'),root$1G=from_html(
-"<div><!> <!></div>");function ChatAttachmentsListItemMcpPrompt($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),isLoading2=prop($$props,"isLoading",3,!1),readonly2=prop($$props,"readonly",3,!1);var div=root$1G(),node2=child(div);ChatMessageMcpPromptContent(node2,{get isLoading(){return isLoading2()},get loadError(){return $$props.loadError},get prompt(){return $$props.prompt},get variant(){return McpPromptVariant.ATTACHMENT}});var node_1=sibling(node2,2);{var consequent=$$anchor2=>{
-var div_1=root_1$14(),node_2=child(div_1);ActionIcon(node_2,{get icon(){return X},tooltip:"Remove",stopPropagationOnClick:!0,onclick:()=>$$props.onRemove?.()}),reset(div_1),append($$anchor2,div_1)};if_block(node_1,$$render=>{!readonly2()&&$$props.onRemove&&$$render(consequent)})}reset(div),template_effect(()=>set_class(div,1,`group relative ${className()??""}`)),append($$anchor,div),pop()}const NEVER=Object.freeze({status:"aborted"});function $constructor(name,initializer2,params){function init2(inst,def){
+item.uploadedFile},onclick:()=>$$props.onPreview?.($$props.item)})};if_block(node2,$$render=>{get$3(d2)?$$render(consequent_1):get$3(d_12)?$$render(consequent_2,1):$$props.item.isImage&&$$props.item.preview?$$render(consequent_3,2):get$3(d_2)?$$render(consequent_4,3):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_1$15=from_html('<div class="absolute top-10 right-2 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100"><!></div>'),root$1H=from_html(
+"<div><!> <!></div>");function ChatAttachmentsListItemMcpPrompt($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),isLoading2=prop($$props,"isLoading",3,!1),readonly2=prop($$props,"readonly",3,!1);var div=root$1H(),node2=child(div);ChatMessageMcpPromptContent(node2,{get isLoading(){return isLoading2()},get loadError(){return $$props.loadError},get prompt(){return $$props.prompt},get variant(){return McpPromptVariant.ATTACHMENT}});var node_1=sibling(node2,2);{var consequent=$$anchor2=>{
+var div_1=root_1$15(),node_2=child(div_1);ActionIcon(node_2,{get icon(){return X},tooltip:"Remove",stopPropagationOnClick:!0,onclick:()=>$$props.onRemove?.()}),reset(div_1),append($$anchor2,div_1)};if_block(node_1,$$render=>{!readonly2()&&$$props.onRemove&&$$render(consequent)})}reset(div),template_effect(()=>set_class(div,1,`group relative ${className()??""}`)),append($$anchor,div),pop()}const NEVER=Object.freeze({status:"aborted"});function $constructor(name,initializer2,params){function init2(inst,def){
if(inst._zod||Object.defineProperty(inst,"_zod",{value:{def,constr:_,traits:new Set},enumerable:!1}),inst._zod.traits.has(name))return;inst._zod.traits.add(name),initializer2(inst,def);const proto=_.prototype,keys2=Object.keys(proto);for(let i=0;i<keys2.length;i++){const k=keys2[i];k in inst||(inst[k]=proto[k].bind(inst))}}const Parent=params?.Parent??Object;class Definition extends Parent{}Object.defineProperty(Definition,"name",{value:name});function _(def){var _a2;const inst=params?.Parent?new Definition:
this;init2(inst,def),(_a2=inst._zod).deferred??(_a2.deferred=[]);for(const fn of inst._zod.deferred)fn();return inst}return Object.defineProperty(_,"init",{value:init2}),Object.defineProperty(_,Symbol.hasInstance,{value:inst=>params?.Parent&&inst instanceof params.Parent?!0:inst?._zod?.traits?.has(name)}),Object.defineProperty(_,"name",{value:name}),_}class $ZodAsyncError extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class $ZodEncodeError extends Error{constructor(name){
super(`Encountered unidirectional transform during encode: ${name}`),this.name="ZodEncodeError"}}const globalConfig={};function config(newConfig){return globalConfig}function getEnumValues(entries){const numericValues=Object.values(entries).filter(v=>typeof v=="number");return Object.entries(entries).filter(([k,_])=>numericValues.indexOf(+k)===-1).map(([_,v])=>v)}function jsonStringifyReplacer(_,value){return typeof value=="bigint"?value.toString():value}function cached(getter){return{get value(){
error2.code===404}static createTransport(serverName,config2,onLog){if(!config2.url)throw new Error("MCP server configuration is missing url");const useProxy=config2.useProxy??!1,requestInit={};if(config2.headers&&(requestInit.headers=config2.useProxy?buildProxiedHeaders(config2.headers):config2.headers),useProxy&&(requestInit.headers={...getAuthHeaders(),...requestInit.headers}),config2.credentials&&(requestInit.credentials=config2.credentials),config2.transport===MCPTransportType.WEBSOCKET){if(useProxy)
throw new Error("WebSocket transport is not supported when using CORS proxy. Use HTTP transport instead.");const url22=new URL(config2.url);return{transport:new WebSocketClientTransport(url22),type:MCPTransportType.WEBSOCKET,stopPhaseLogging:()=>{}}}const url2=useProxy?buildProxiedUrl(config2.url):new URL(config2.url),{fetch:diagnosticFetch,disable:stopPhaseLogging}=this.createDiagnosticFetch(serverName,config2,requestInit,url2,useProxy,onLog);try{return{transport:new StreamableHTTPClientTransport(
url2,{requestInit,fetch:diagnosticFetch}),type:MCPTransportType.STREAMABLE_HTTP,stopPhaseLogging}}catch(httpError){console.warn("[MCPService] StreamableHTTP failed, trying SSE transport...",httpError);try{return{transport:new SSEClientTransport(url2,{requestInit,fetch:diagnosticFetch,eventSourceInit:{fetch:diagnosticFetch}}),type:MCPTransportType.SSE,stopPhaseLogging}}catch(sseError){const httpMsg=httpError instanceof Error?httpError.message:String(httpError),sseMsg=sseError instanceof Error?sseError.
-message:String(sseError);throw new Error(`Failed to create transport. StreamableHTTP: ${httpMsg}; SSE: ${sseMsg}`)}}}static extractServerInfo(impl){if(impl)return{name:impl.name,version:impl.version,title:impl.title,description:impl.description,websiteUrl:impl.websiteUrl,icons:impl.icons?.map(icon=>({src:icon.src,mimeType:icon.mimeType,sizes:icon.sizes}))}}static async connect(serverName,serverConfig,clientInfo,capabilities,onPhase,listChangedHandlers){const startTime=performance.now(),effectiveClientInfo=clientInfo??
-DEFAULT_MCP_CONFIG.clientInfo,effectiveCapabilities=capabilities??DEFAULT_MCP_CONFIG.capabilities;onPhase?.(MCPConnectionPhase.TRANSPORT_CREATING,this.createLog(MCPConnectionPhase.TRANSPORT_CREATING,`Creating transport for ${serverConfig.url}`));const{transport,type:transportType,stopPhaseLogging}=this.createTransport(serverName,serverConfig,log=>onPhase?.(log.phase,log));transportType===MCPTransportType.WEBSOCKET&&(transport.onclose=()=>{console.log(`[MCPService][${serverName}] WebSocket closed\
-, notifying for reconnection`),onPhase?.(MCPConnectionPhase.DISCONNECTED,this.createLog(MCPConnectionPhase.DISCONNECTED,"WebSocket connection closed"))}),onPhase?.(MCPConnectionPhase.TRANSPORT_READY,this.createLog(MCPConnectionPhase.TRANSPORT_READY,`Transport ready (${transportType})`),{transportType});const client=new Client({name:effectiveClientInfo.name,version:effectiveClientInfo.version??DEFAULT_CLIENT_VERSION},{capabilities:effectiveCapabilities,listChanged:listChangedHandlers}),runtimeErrorHandler=error2=>{
-console.error(`[MCPService][${serverName}] Protocol error after initialize:`,error2)};client.onerror=error2=>{onPhase?.(MCPConnectionPhase.ERROR,this.createLog(MCPConnectionPhase.ERROR,`Protocol error: ${error2.message}`,MCPLogLevel.ERROR,{error:this.summarizeError(error2)}))},onPhase?.(MCPConnectionPhase.INITIALIZING,this.createLog(MCPConnectionPhase.INITIALIZING,"Sending initialize request...")),console.log(`[MCPService][${serverName}] Connecting to server...`);try{await client.connect(transport),
-stopPhaseLogging(),client.onerror=runtimeErrorHandler}catch(error2){client.onerror=runtimeErrorHandler;const url2=serverConfig.useProxy??!1?buildProxiedUrl(serverConfig.url):new URL(serverConfig.url);throw onPhase?.(MCPConnectionPhase.ERROR,this.createLog(MCPConnectionPhase.ERROR,`Connection failed during initialize: ${error2 instanceof Error?error2.message:String(error2)}`,MCPLogLevel.ERROR,{error:this.summarizeError(error2),config:{serverName,configuredUrl:serverConfig.url,effectiveUrl:url2.href,
-transportType,useProxy:serverConfig.useProxy??!1,headers:sanitizeHeaders(serverConfig.headers,Object.keys(serverConfig.headers??{}),MCP_PARTIAL_REDACT_HEADERS),credentials:serverConfig.credentials},browser:this.getBrowserContext(url2,serverConfig.useProxy??!1),hints:this.getConnectionHints(url2,serverConfig,error2)})),error2}const serverVersion=client.getServerVersion(),serverCapabilities=client.getServerCapabilities(),instructions=client.getInstructions(),serverInfo=this.extractServerInfo(serverVersion);
-onPhase?.(MCPConnectionPhase.CAPABILITIES_EXCHANGED,this.createLog(MCPConnectionPhase.CAPABILITIES_EXCHANGED,"Capabilities exchanged successfully",MCPLogLevel.INFO,{serverCapabilities,serverInfo}),{serverInfo,serverCapabilities,clientCapabilities:effectiveCapabilities,instructions}),onPhase?.(MCPConnectionPhase.LISTING_TOOLS,this.createLog(MCPConnectionPhase.LISTING_TOOLS,"Listing available tools...")),console.log(`[MCPService][${serverName}] Connected, listing tools...`);const tools=await this.
-listTools({client,transport,tools:[],serverName,transportType,connectionTimeMs:0}),connectionTimeMs=Math.round(performance.now()-startTime);return onPhase?.(MCPConnectionPhase.CONNECTED,this.createLog(MCPConnectionPhase.CONNECTED,`Connection established with ${tools.length} tools (${connectionTimeMs}ms)`)),console.log(`[MCPService][${serverName}] Initialization complete with ${tools.length} tools in ${connectionTimeMs}ms`),{client,transport,tools,serverName,transportType,serverInfo,serverCapabilities,
-clientCapabilities:effectiveCapabilities,protocolVersion:DEFAULT_MCP_CONFIG.protocolVersion,instructions,connectionTimeMs}}static async disconnect(connection){console.log(`[MCPService][${connection.serverName}] Disconnecting...`);try{connection.transport.onclose&&(connection.transport.onclose=void 0),await connection.client.close()}catch(error2){console.warn(`[MCPService][${connection.serverName}] Error during disconnect:`,error2)}}static async listTools(connection){try{return(await connection.client.
-listTools()).tools??[]}catch(error2){if(this.isSessionExpiredError(error2))throw error2;return console.warn(`[MCPService][${connection.serverName}] Failed to list tools:`,error2),[]}}static async listPrompts(connection){try{return(await connection.client.listPrompts()).prompts??[]}catch(error2){if(this.isSessionExpiredError(error2))throw error2;return console.warn(`[MCPService][${connection.serverName}] Failed to list prompts:`,error2),[]}}static async getPrompt(connection,name,args){try{return await connection.
-client.getPrompt({name,arguments:args})}catch(error2){throw console.error(`[MCPService][${connection.serverName}] Failed to get prompt:`,error2),error2}}static async callTool(connection,params,signal){throwIfAborted(signal);try{const result=await connection.client.callTool({name:params.name,arguments:params.arguments},void 0,{signal});return{content:this.formatToolResult(result),isError:result.isError??!1}}catch(error2){if(isAbortError(error2)||this.isSessionExpiredError(error2))throw error2;const message=error2 instanceof
+message:String(sseError);throw new Error(`Failed to create transport. StreamableHTTP: ${httpMsg}; SSE: ${sseMsg}`)}}}static extractServerInfo(impl){if(impl)return{name:impl.name,version:impl.version,title:impl.title,description:impl.description,websiteUrl:impl.websiteUrl,icons:impl.icons?.map(icon=>({src:icon.src,mimeType:icon.mimeType,sizes:icon.sizes,theme:icon.theme}))}}static async connect(serverName,serverConfig,clientInfo,capabilities,onPhase,listChangedHandlers){const startTime=performance.
+now(),effectiveClientInfo=clientInfo??DEFAULT_MCP_CONFIG.clientInfo,effectiveCapabilities=capabilities??DEFAULT_MCP_CONFIG.capabilities;onPhase?.(MCPConnectionPhase.TRANSPORT_CREATING,this.createLog(MCPConnectionPhase.TRANSPORT_CREATING,`Creating transport for ${serverConfig.url}`));const{transport,type:transportType,stopPhaseLogging}=this.createTransport(serverName,serverConfig,log=>onPhase?.(log.phase,log));transportType===MCPTransportType.WEBSOCKET&&(transport.onclose=()=>{console.log(`[MCPSe\
+rvice][${serverName}] WebSocket closed, notifying for reconnection`),onPhase?.(MCPConnectionPhase.DISCONNECTED,this.createLog(MCPConnectionPhase.DISCONNECTED,"WebSocket connection closed"))}),onPhase?.(MCPConnectionPhase.TRANSPORT_READY,this.createLog(MCPConnectionPhase.TRANSPORT_READY,`Transport ready (${transportType})`),{transportType});const client=new Client({name:effectiveClientInfo.name,version:effectiveClientInfo.version??DEFAULT_CLIENT_VERSION},{capabilities:effectiveCapabilities,listChanged:listChangedHandlers}),
+runtimeErrorHandler=error2=>{console.error(`[MCPService][${serverName}] Protocol error after initialize:`,error2)};client.onerror=error2=>{onPhase?.(MCPConnectionPhase.ERROR,this.createLog(MCPConnectionPhase.ERROR,`Protocol error: ${error2.message}`,MCPLogLevel.ERROR,{error:this.summarizeError(error2)}))},onPhase?.(MCPConnectionPhase.INITIALIZING,this.createLog(MCPConnectionPhase.INITIALIZING,"Sending initialize request..."));try{await client.connect(transport),stopPhaseLogging(),client.onerror=
+runtimeErrorHandler}catch(error2){client.onerror=runtimeErrorHandler;const url2=serverConfig.useProxy??!1?buildProxiedUrl(serverConfig.url):new URL(serverConfig.url);throw onPhase?.(MCPConnectionPhase.ERROR,this.createLog(MCPConnectionPhase.ERROR,`Connection failed during initialize: ${error2 instanceof Error?error2.message:String(error2)}`,MCPLogLevel.ERROR,{error:this.summarizeError(error2),config:{serverName,configuredUrl:serverConfig.url,effectiveUrl:url2.href,transportType,useProxy:serverConfig.
+useProxy??!1,headers:sanitizeHeaders(serverConfig.headers,Object.keys(serverConfig.headers??{}),MCP_PARTIAL_REDACT_HEADERS),credentials:serverConfig.credentials},browser:this.getBrowserContext(url2,serverConfig.useProxy??!1),hints:this.getConnectionHints(url2,serverConfig,error2)})),error2}const serverVersion=client.getServerVersion(),serverCapabilities=client.getServerCapabilities(),instructions=client.getInstructions(),serverInfo=this.extractServerInfo(serverVersion);onPhase?.(MCPConnectionPhase.
+CAPABILITIES_EXCHANGED,this.createLog(MCPConnectionPhase.CAPABILITIES_EXCHANGED,"Capabilities exchanged successfully",MCPLogLevel.INFO,{serverCapabilities,serverInfo}),{serverInfo,serverCapabilities,clientCapabilities:effectiveCapabilities,instructions}),onPhase?.(MCPConnectionPhase.LISTING_TOOLS,this.createLog(MCPConnectionPhase.LISTING_TOOLS,"Listing available tools...")),console.log(`[MCPService][${serverName}] Connected, listing tools...`);const tools=await this.listTools({client,transport,tools:[],
+serverName,transportType,connectionTimeMs:0}),connectionTimeMs=Math.round(performance.now()-startTime);return onPhase?.(MCPConnectionPhase.CONNECTED,this.createLog(MCPConnectionPhase.CONNECTED,`Connection established with ${tools.length} tools (${connectionTimeMs}ms)`)),console.log(`[MCPService][${serverName}] Initialization complete with ${tools.length} tools in ${connectionTimeMs}ms`),{client,transport,tools,serverName,transportType,serverInfo,serverCapabilities,clientCapabilities:effectiveCapabilities,
+protocolVersion:DEFAULT_MCP_CONFIG.protocolVersion,instructions,connectionTimeMs}}static async disconnect(connection){console.log(`[MCPService][${connection.serverName}] Disconnecting...`);try{connection.transport.onclose&&(connection.transport.onclose=void 0),await connection.client.close()}catch(error2){console.warn(`[MCPService][${connection.serverName}] Error during disconnect:`,error2)}}static async listTools(connection){try{return(await connection.client.listTools()).tools??[]}catch(error2){
+if(this.isSessionExpiredError(error2))throw error2;return console.warn(`[MCPService][${connection.serverName}] Failed to list tools:`,error2),[]}}static async listPrompts(connection){try{return(await connection.client.listPrompts()).prompts??[]}catch(error2){if(this.isSessionExpiredError(error2))throw error2;return console.warn(`[MCPService][${connection.serverName}] Failed to list prompts:`,error2),[]}}static async getPrompt(connection,name,args){try{return await connection.client.getPrompt({name,
+arguments:args})}catch(error2){throw console.error(`[MCPService][${connection.serverName}] Failed to get prompt:`,error2),error2}}static async callTool(connection,params,signal){throwIfAborted(signal);try{const result=await connection.client.callTool({name:params.name,arguments:params.arguments},void 0,{signal});return{content:this.formatToolResult(result),isError:result.isError??!1}}catch(error2){if(isAbortError(error2)||this.isSessionExpiredError(error2))throw error2;const message=error2 instanceof
Error?error2.message:String(error2);throw new Error(`Tool "${params.name}" execution failed on server "${connection.serverName}": ${message}`,{cause:error2 instanceof Error?error2:void 0})}}static formatToolResult(result){const content2=result.content;return Array.isArray(content2)?content2.map(item=>this.formatSingleContent(item)).filter(Boolean).join(`
`):""}static formatSingleContent(content2){if(content2.type===MCPContentType.TEXT&&content2.text)return content2.text;if(content2.type===MCPContentType.IMAGE&&content2.data)return createBase64DataUrl(content2.mimeType??DEFAULT_IMAGE_MIME_TYPE,content2.data);if(content2.type===MCPContentType.RESOURCE&&content2.resource){const resource=content2.resource;return resource.text?resource.text:resource.blob?resource.blob:JSON.stringify(resource)}return content2.data&&content2.mimeType?createBase64DataUrl(
content2.mimeType,content2.data):JSON.stringify(content2)}static async complete(connection,ref2,argument){try{return(await connection.client.complete({ref:ref2,argument})).completion}catch(error2){return console.error("[MCPService] Failed to get completions:",error2),null}}static async listResources(connection,cursor){try{const result=await connection.client.listResources(cursor?{cursor}:void 0);return{resources:result.resources??[],nextCursor:result.nextCursor}}catch(error2){if(this.isSessionExpiredError(
current):update2(),derivedMode2});return{get current(){return get$3(current2)}}}function createDerivedTheme(){const current2=user_derived(()=>{if(customTheme.current,!isBrowser)return;function update2(){document.documentElement.setAttribute("data-theme",customTheme.current)}return disableTransitions.current?withoutTransition(update2,untrack$1(()=>synchronousModeChanges.current)):update2(),customTheme.current});return{get current(){return get$3(current2)}}}const derivedMode=createDerivedMode(),derivedTheme=createDerivedTheme();
function setMode(mode){userPrefersMode.current=mode}function setTheme(newTheme){customTheme.current=newTheme}function setInitialMode({defaultMode="system",themeColors:themeColors2,darkClassNames:darkClassNames2=["dark"],lightClassNames:lightClassNames2=[],defaultTheme="",modeStorageKey:modeStorageKey2="mode-watcher-mode",themeStorageKey:themeStorageKey2="mode-watcher-theme"}){const rootEl=document.documentElement,mode=localStorage.getItem(modeStorageKey2)??defaultMode,theme=localStorage.getItem(themeStorageKey2)??defaultTheme,light=mode==="light"||mode==="system"&&window.matchMedia("(prefers-color-sche\
me: light)").matches;if(light?(darkClassNames2.length&&rootEl.classList.remove(...darkClassNames2.filter(Boolean)),lightClassNames2.length&&rootEl.classList.add(...lightClassNames2.filter(Boolean))):(lightClassNames2.length&&rootEl.classList.remove(...lightClassNames2.filter(Boolean)),darkClassNames2.length&&rootEl.classList.add(...darkClassNames2.filter(Boolean))),rootEl.style.colorScheme=light?"light":"dark",themeColors2){const themeMetaEl=document.querySelector('meta[name="theme-color"]');themeMetaEl&&
-themeMetaEl.setAttribute("content",mode==="light"?themeColors2.light:themeColors2.dark)}theme&&(rootEl.setAttribute("data-theme",theme),localStorage.setItem(themeStorageKey2,theme)),localStorage.setItem(modeStorageKey2,mode)}var root_1$13=from_html('<meta name="theme-color"/>');function Mode_watcher_lite($$anchor,$$props){push$1($$props,!0);var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var meta=root_1$13();template_effect(()=>set_attribute(meta,"content",$$props.
-themeColors.dark)),append($$anchor2,meta)};if_block(node2,$$render=>{$$props.themeColors&&$$render(consequent)})}append($$anchor,fragment),pop()}var root_2$1a=from_html('<meta name="theme-color"/>'),root_1$12=from_html("<!> <!>",1);function Mode_watcher_full($$anchor,$$props){push$1($$props,!0);let trueNonce=prop($$props,"trueNonce",3,"");head$1("1funsus",$$anchor2=>{var fragment=root_1$12(),node2=first_child(fragment);{var consequent=$$anchor3=>{var meta=root_2$1a();template_effect(()=>set_attribute(
+themeMetaEl.setAttribute("content",mode==="light"?themeColors2.light:themeColors2.dark)}theme&&(rootEl.setAttribute("data-theme",theme),localStorage.setItem(themeStorageKey2,theme)),localStorage.setItem(modeStorageKey2,mode)}var root_1$14=from_html('<meta name="theme-color"/>');function Mode_watcher_lite($$anchor,$$props){push$1($$props,!0);var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var meta=root_1$14();template_effect(()=>set_attribute(meta,"content",$$props.
+themeColors.dark)),append($$anchor2,meta)};if_block(node2,$$render=>{$$props.themeColors&&$$render(consequent)})}append($$anchor,fragment),pop()}var root_2$19=from_html('<meta name="theme-color"/>'),root_1$13=from_html("<!> <!>",1);function Mode_watcher_full($$anchor,$$props){push$1($$props,!0);let trueNonce=prop($$props,"trueNonce",3,"");head$1("1funsus",$$anchor2=>{var fragment=root_1$13(),node2=first_child(fragment);{var consequent=$$anchor3=>{var meta=root_2$19();template_effect(()=>set_attribute(
meta,"content",$$props.themeColors.dark)),append($$anchor3,meta)};if_block(node2,$$render=>{$$props.themeColors&&$$render(consequent)})}var node_1=sibling(node2,2);html$6(node_1,()=>`<script${trueNonce()?` nonce=${trueNonce()}`:""}>(`+setInitialMode.toString()+")("+JSON.stringify($$props.initConfig)+");<\/script>"),append($$anchor2,fragment)}),pop()}function Mode_watcher($$anchor,$$props){push$1($$props,!0);let track2=prop($$props,"track",3,!0),defaultMode=prop($$props,"defaultMode",3,"system"),
disableTransitionsProp=prop($$props,"disableTransitions",3,!0),darkClassNamesProp=prop($$props,"darkClassNames",19,()=>["dark"]),lightClassNamesProp=prop($$props,"lightClassNames",19,()=>[]),defaultTheme=prop($$props,"defaultTheme",3,""),nonce=prop($$props,"nonce",3,""),themeStorageKeyProp=prop($$props,"themeStorageKey",3,"mode-watcher-theme"),modeStorageKeyProp=prop($$props,"modeStorageKey",3,"mode-watcher-mode"),disableHeadScriptInjection=prop($$props,"disableHeadScriptInjection",3,!1),synchronousModeChangesProp=prop(
$$props,"synchronousModeChanges",3,!1);modeStorageKey.current=modeStorageKeyProp(),themeStorageKey.current=themeStorageKeyProp(),darkClassNames.current=darkClassNamesProp(),lightClassNames.current=lightClassNamesProp(),disableTransitions.current=disableTransitionsProp(),themeColors.current=$$props.themeColors,synchronousModeChanges.current=synchronousModeChangesProp(),user_pre_effect(()=>{synchronousModeChanges.current=synchronousModeChangesProp()}),user_pre_effect(()=>{disableTransitions.current=
void 0&&(this._isInitializing=state2.isInitializing),state2.error!==void 0&&(this._error=state2.error),state2.toolCount!==void 0&&(this._toolCount=state2.toolCount),state2.connectedServers!==void 0&&(this._connectedServers=state2.connectedServers)}updateHealthCheck(serverId,state2){this._healthChecks={...this._healthChecks,[serverId]:state2}}getHealthCheckState(serverId){return this._healthChecks[serverId]??{status:HealthCheckStatus.IDLE}}hasHealthCheck(serverId){return serverId in this._healthChecks&&
this._healthChecks[serverId].status!==HealthCheckStatus.IDLE}clearHealthCheck(serverId){const{[serverId]:_removed,...rest}=this._healthChecks;this._healthChecks=rest}clearAllHealthChecks(){this._healthChecks={}}clearError(){this._error=null}getServers(){return parseMcpServerSettings(config$1().mcpServers)}getConnections(){return this.connections}getServerLabel(server){const healthState=this.getHealthCheckState(server.id);return healthState?.status===HealthCheckStatus.SUCCESS&&(healthState.serverInfo?.
title||healthState.serverInfo?.name||server.name)||server.url}getServerById(serverId){return this.getServers().find(s2=>s2.id===serverId)}getServerDisplayName(serverId){const server=this.getServerById(serverId);return server?this.getServerLabel(server):serverId}#isValidIconUri(src){try{return src.startsWith(UrlProtocol.DATA)?!0:new URL(src).protocol===UrlProtocol.HTTPS}catch{return!1}}#getMcpIconUrl(icons,isDark=!1){if(!icons?.length)return null;const validIcons=icons.filter(icon=>!(!icon.src||!this.#isValidIconUri(
-icon.src)||icon.mimeType&&!MCP_ALLOWED_ICON_MIME_TYPES.has(icon.mimeType)));if(validIcons.length===0)return null;const preferredTheme=isDark?ColorMode.DARK:ColorMode.LIGHT,themedIcon=validIcons.find(icon=>icon.theme===preferredTheme);if(themedIcon)return this.#proxyIconSrc(themedIcon.src);const universalIcons=validIcons.filter(icon=>!icon.theme);return universalIcons.length===EXPECTED_THEMED_ICON_PAIR_COUNT?this.#proxyIconSrc(universalIcons[isDark?1:0].src):universalIcons.length>0?this.#proxyIconSrc(
-universalIcons[0].src):this.#proxyIconSrc(validIcons[0].src)}#proxyIconSrc(src){return src.startsWith("data:")||!this._proxyAvailable?src:getProxiedUrlString(src)}getServerFavicon(serverId){const server=this.getServerById(serverId);if(!server)return null;const isDark=derivedMode.current===ColorMode.DARK,healthState=this.getHealthCheckState(serverId);if(healthState.status===HealthCheckStatus.SUCCESS&&healthState.serverInfo?.icons){const mcpIconUrl=this.#getMcpIconUrl(healthState.serverInfo.icons,
-isDark);if(mcpIconUrl)return mcpIconUrl}return getFaviconUrl(server.url,this._proxyAvailable)}isAnyServerLoading(){return this.getServers().some(s2=>{const state2=this.getHealthCheckState(s2.id);return state2.status===HealthCheckStatus.IDLE||state2.status===HealthCheckStatus.CONNECTING})}getServersSorted(){const servers=this.getServers();return this.isAnyServerLoading()?servers:[...servers].sort((a,b)=>this.getServerLabel(a).localeCompare(this.getServerLabel(b)))}addServer(serverData){const servers=this.
-getServers(),newServer={id:serverData.id||(uuid$1()??`server-${Date.now()}`),enabled:serverData.enabled,url:serverData.url.trim(),name:serverData.name,headers:serverData.headers?.trim()||void 0,requestTimeoutSeconds:DEFAULT_MCP_CONFIG.requestTimeoutSeconds,useProxy:serverData.useProxy};settingsStore.updateConfig("mcpServers",JSON.stringify([...servers,newServer]))}updateServer(id2,updates){const servers=this.getServers();settingsStore.updateConfig("mcpServers",JSON.stringify(servers.map(server=>server.
-id===id2?{...server,...updates}:server)))}removeServer(id2){const servers=this.getServers();settingsStore.updateConfig("mcpServers",JSON.stringify(servers.filter(s2=>s2.id!==id2))),this.clearHealthCheck(id2)}hasAvailableServers(){return parseMcpServerSettings(config$1().mcpServers).some(s2=>s2.enabled&&s2.url.trim())}hasEnabledServers(perChatOverrides){return!!this.#buildMcpClientConfig(config$1(),perChatOverrides)}getEnabledServersForConversation(perChatOverrides){return this.getServers().filter(
-server=>this.#checkServerEnabled(server,perChatOverrides))}async ensureInitialized(perChatOverrides){const mcpConfig=this.#buildMcpClientConfig(config$1(),perChatOverrides),signature=mcpConfig?JSON.stringify(mcpConfig):null;return signature?this.isInitialized&&this.configSignature===signature?!0:this.initPromise&&this.configSignature===signature?this.initPromise:((this.connections.size>0||this.initPromise)&&await this.shutdown(),this.initialize(signature,mcpConfig)):(await this.shutdown(),!1)}async initialize(signature,mcpConfig){
-this.updateState({isInitializing:!0,error:null}),this.configSignature=signature;const serverEntries=Object.entries(mcpConfig.servers);return serverEntries.length===0?(this.updateState({isInitializing:!1,toolCount:0,connectedServers:[]}),!1):(this.initPromise=this.doInitialize(signature,mcpConfig,serverEntries),this.initPromise)}async doInitialize(signature,mcpConfig,serverEntries){const clientInfo=mcpConfig.clientInfo??DEFAULT_MCP_CONFIG.clientInfo,capabilities=mcpConfig.capabilities??DEFAULT_MCP_CONFIG.
-capabilities,results=await Promise.allSettled(serverEntries.map(async([name,serverConfig])=>{this.serverConfigs.set(name,serverConfig);const listChangedHandlers=this.createListChangedHandlers(name),connection=await MCPService.connect(name,serverConfig,clientInfo,capabilities,phase=>{phase===MCPConnectionPhase.DISCONNECTED&&(console.log(`[MCPStore][${name}] Connection lost, starting auto-reconnect`),this.autoReconnect(name))},listChangedHandlers);return{name,connection}}));if(this.configSignature!==
-signature){for(const result of results)result.status==="fulfilled"&&await MCPService.disconnect(result.value.connection).catch(console.warn);return!1}for(const result of results)if(result.status==="fulfilled"){const{name,connection}=result.value;this.connections.set(name,connection);for(const tool of connection.tools)this.toolsIndex.has(tool.name)&&console.warn(`[MCPStore] Tool name conflict: "${tool.name}" exists in "${this.toolsIndex.get(tool.name)}" and "${name}". Using tool from "${name}".`),
-this.toolsIndex.set(tool.name,name)}else console.error("[MCPStore] Failed to connect:",result.reason);return this.connections.size===0&&serverEntries.length>0?(this.updateState({isInitializing:!1,error:"All MCP server connections failed",toolCount:0,connectedServers:[]}),this.initPromise=null,!1):(this.updateState({isInitializing:!1,error:null,toolCount:this.toolsIndex.size,connectedServers:Array.from(this.connections.keys())}),this.initPromise=null,!0)}createListChangedHandlers(serverName){return{
-tools:{onChanged:(error2,tools)=>{if(error2){console.warn(`[MCPStore][${serverName}] Tools list changed error:`,error2);return}this.handleToolsListChanged(serverName,tools??[])}},prompts:{onChanged:error2=>{if(error2){console.warn(`[MCPStore][${serverName}] Prompts list changed error:`,error2);return}}}}}handleToolsListChanged(serverName,tools){const connection=this.connections.get(serverName);if(connection){for(const[toolName,ownerServer]of this.toolsIndex.entries())ownerServer===serverName&&this.
-toolsIndex.delete(toolName);connection.tools=tools;for(const tool of tools)this.toolsIndex.has(tool.name)&&console.warn(`[MCPStore] Tool name conflict after list change: "${tool.name}" exists in "${this.toolsIndex.get(tool.name)}" and "${serverName}". Using tool from "${serverName}".`),this.toolsIndex.set(tool.name,serverName);this.updateState({toolCount:this.toolsIndex.size})}}acquireConnection(){this.activeFlowCount++}async releaseConnection(shutdownIfUnused=!1){this.activeFlowCount=Math.max(0,
-this.activeFlowCount-1),shutdownIfUnused&&this.activeFlowCount===0&&await this.shutdown()}getActiveFlowCount(){return this.activeFlowCount}async shutdown(){this.initPromise&&(await this.initPromise.catch(()=>{}),this.initPromise=null),this.connections.size!==0&&(await Promise.all(Array.from(this.connections.values()).map(conn=>MCPService.disconnect(conn).catch(error2=>console.warn(`[MCPStore] Error disconnecting ${conn.serverName}:`,error2)))),this.connections.clear(),this.toolsIndex.clear(),this.
-serverConfigs.clear(),this.configSignature=null,this.updateState({isInitializing:!1,error:null,toolCount:0,connectedServers:[]}))}async reconnectServer(serverName){const serverConfig=this.serverConfigs.get(serverName);if(!serverConfig)throw new Error(`[MCPStore] No config found for ${serverName}, cannot reconnect`);const oldConnection=this.connections.get(serverName);oldConnection&&(await MCPService.disconnect(oldConnection).catch(console.warn),this.connections.delete(serverName)),console.log(`[\
-MCPStore][${serverName}] Session expired, reconnecting with fresh session...`);const listChangedHandlers=this.createListChangedHandlers(serverName),connection=await MCPService.connect(serverName,serverConfig,DEFAULT_MCP_CONFIG.clientInfo,DEFAULT_MCP_CONFIG.capabilities,phase=>{phase===MCPConnectionPhase.DISCONNECTED&&(console.log(`[MCPStore][${serverName}] Connection lost, starting auto-reconnect`),this.autoReconnect(serverName))},listChangedHandlers);this.connections.set(serverName,connection);
-for(const tool of connection.tools)this.toolsIndex.set(tool.name,serverName);console.log(`[MCPStore][${serverName}] Session recovered successfully`)}async autoReconnect(serverName){if(this.reconnectingServers.has(serverName)){console.log(`[MCPStore][${serverName}] Reconnection already in progress, skipping`);return}const serverConfig=this.serverConfigs.get(serverName);if(!serverConfig){console.error(`[MCPStore] No config found for ${serverName}, cannot reconnect`);return}this.reconnectingServers.
-add(serverName);let backoff=MCP_RECONNECT_INITIAL_DELAY,needsReconnect=!1;try{for(;;){await new Promise(resolve2=>setTimeout(resolve2,backoff)),console.log(`[MCPStore][${serverName}] Auto-reconnecting...`);try{const timeoutPromise=new Promise((_,reject)=>setTimeout(()=>reject(new Error(`Reconnect attempt timed out after ${MCP_RECONNECT_ATTEMPT_TIMEOUT_MS}ms`)),MCP_RECONNECT_ATTEMPT_TIMEOUT_MS));needsReconnect=!1;const listChangedHandlers=this.createListChangedHandlers(serverName),connectPromise=MCPService.
-connect(serverName,serverConfig,DEFAULT_MCP_CONFIG.clientInfo,DEFAULT_MCP_CONFIG.capabilities,phase=>{phase===MCPConnectionPhase.DISCONNECTED&&(this.reconnectingServers.has(serverName)?needsReconnect=!0:(console.log(`[MCPStore][${serverName}] Connection lost, restarting auto-reconnect`),this.autoReconnect(serverName)))},listChangedHandlers),connection=await Promise.race([connectPromise,timeoutPromise]);this.connections.set(serverName,connection);for(const tool of connection.tools)this.toolsIndex.
-set(tool.name,serverName);console.log(`[MCPStore][${serverName}] Reconnected successfully`);break}catch(error2){console.warn(`[MCPStore][${serverName}] Reconnection failed:`,error2),backoff=Math.min(backoff*MCP_RECONNECT_BACKOFF_MULTIPLIER,MCP_RECONNECT_MAX_DELAY)}}}finally{this.reconnectingServers.delete(serverName),needsReconnect&&(console.log(`[MCPStore][${serverName}] Deferred disconnect detected, restarting auto-reconnect`),this.autoReconnect(serverName))}}getToolDefinitionsForLLM(){const tools=[];
-for(const connection of this.connections.values())for(const tool of connection.tools){const rawSchema=tool.inputSchema??{type:JsonSchemaType.OBJECT,properties:{},required:[]};tools.push({type:ToolCallType.FUNCTION,function:{name:tool.name,description:tool.description,parameters:this.normalizeSchemaProperties(rawSchema)}})}return tools}normalizeSchemaProperties(schema){if(!schema||typeof schema!="object")return schema;const normalized={...schema};if(normalized.properties&&typeof normalized.properties==
-"object"){const props=normalized.properties,normalizedProps={};for(const[key2,prop2]of Object.entries(props)){if(!prop2||typeof prop2!="object"){normalizedProps[key2]=prop2;continue}const normalizedProp={...prop2};if(!normalizedProp.type&&normalizedProp.default!==void 0){const defaultVal=normalizedProp.default;typeof defaultVal=="string"?normalizedProp.type="string":typeof defaultVal=="number"?normalizedProp.type=Number.isInteger(defaultVal)?"integer":"number":typeof defaultVal=="boolean"?normalizedProp.
-type="boolean":Array.isArray(defaultVal)?normalizedProp.type="array":typeof defaultVal=="object"&&defaultVal!==null&&(normalizedProp.type="object")}normalizedProp.properties&&Object.assign(normalizedProp,this.normalizeSchemaProperties(normalizedProp)),normalizedProp.items&&typeof normalizedProp.items=="object"&&(normalizedProp.items=this.normalizeSchemaProperties(normalizedProp.items)),normalizedProps[key2]=normalizedProp}normalized.properties=normalizedProps}return normalized}getToolNames(){return Array.
-from(this.toolsIndex.keys())}hasTool(toolName){return this.toolsIndex.has(toolName)}getToolServer(toolName){return this.toolsIndex.get(toolName)}hasPromptsSupport(){for(const connection of this.connections.values())if(connection.serverCapabilities?.prompts)return!0;return!1}hasPromptsCapability(perChatOverrides){if(perChatOverrides!==void 0){const enabledServerIds=new Set(perChatOverrides.filter(o=>o.enabled).map(o=>o.serverId));if(enabledServerIds.size===0)return!1;for(const[serverId,state2]of Object.
-entries(this._healthChecks))if(enabledServerIds.has(serverId)&&state2.status===HealthCheckStatus.SUCCESS&&state2.capabilities?.server?.prompts!==void 0)return!0;for(const[serverName,connection]of this.connections)if(enabledServerIds.has(serverName)&&connection.serverCapabilities?.prompts)return!0;return!1}for(const state2 of Object.values(this._healthChecks))if(state2.status===HealthCheckStatus.SUCCESS&&state2.capabilities?.server?.prompts!==void 0)return!0;for(const connection of this.connections.
-values())if(connection.serverCapabilities?.prompts)return!0;return!1}async getAllPrompts(){const results=[];for(const[serverName,connection]of this.connections){if(!connection.serverCapabilities?.prompts)continue;const prompts=await MCPService.listPrompts(connection);for(const prompt of prompts)results.push({name:prompt.name,description:prompt.description,title:prompt.title,serverName,arguments:prompt.arguments?.map(arg=>({name:arg.name,description:arg.description,required:arg.required}))})}return results}async getPrompt(serverName,promptName,args){
-const connection=this.connections.get(serverName);if(!connection)throw new Error(`Server "${serverName}" not found for prompt "${promptName}"`);return MCPService.getPrompt(connection,promptName,args)}async executeTool(toolCall,signal){const toolName=toolCall.function.name,serverName=this.toolsIndex.get(toolName);if(!serverName)throw new Error(`Unknown tool: ${toolName}`);const connection=this.connections.get(serverName);if(!connection)throw new Error(`Server "${serverName}" is not connected`);const args=this.
-parseToolArguments(toolCall.function.arguments);try{return await MCPService.callTool(connection,{name:toolName,arguments:args},signal)}catch(error2){if(MCPService.isSessionExpiredError(error2)){await this.reconnectServer(serverName);const newConnection=this.connections.get(serverName);if(!newConnection)throw new Error(`Failed to reconnect to "${serverName}"`);return MCPService.callTool(newConnection,{name:toolName,arguments:args},signal)}throw error2}}async executeToolByName(toolName,args,signal){
-const serverName=this.toolsIndex.get(toolName);if(!serverName)throw new Error(`Unknown tool: ${toolName}`);const connection=this.connections.get(serverName);if(!connection)throw new Error(`Server "${serverName}" is not connected`);try{return await MCPService.callTool(connection,{name:toolName,arguments:args},signal)}catch(error2){if(MCPService.isSessionExpiredError(error2)){await this.reconnectServer(serverName);const newConnection=this.connections.get(serverName);if(!newConnection)throw new Error(
-`Failed to reconnect to "${serverName}"`);return MCPService.callTool(newConnection,{name:toolName,arguments:args},signal)}throw error2}}parseToolArguments(args){if(typeof args=="string"){const trimmed=args.trim();if(trimmed==="")return{};try{const parsed=JSON.parse(trimmed);if(typeof parsed!="object"||parsed===null||Array.isArray(parsed))throw new Error(`Tool arguments must be an object, got ${Array.isArray(parsed)?"array":typeof parsed}`);return parsed}catch(error2){throw new Error(`Failed to p\
-arse tool arguments as JSON: ${error2.message}`)}}if(typeof args=="object"&&args!==null&&!Array.isArray(args))return args;throw new Error(`Invalid tool arguments type: ${typeof args}`)}async getPromptCompletions(serverName,promptName,argumentName,argumentValue){const connection=this.connections.get(serverName);return connection?connection.serverCapabilities?.completions?MCPService.complete(connection,{type:MCPRefType.PROMPT,name:promptName},{name:argumentName,value:argumentValue}):null:(console.
-warn(`[MCPStore] Server "${serverName}" is not connected`),null)}async getResourceCompletions(serverName,uriTemplate,argumentName,argumentValue){const connection=this.connections.get(serverName);return connection?connection.serverCapabilities?.completions?MCPService.complete(connection,{type:MCPRefType.RESOURCE,uri:uriTemplate},{name:argumentName,value:argumentValue}):null:(console.warn(`[MCPStore] Server "${serverName}" is not connected`),null)}async readResourceByUri(serverName,uri2){const connection=this.
-connections.get(serverName);if(!connection)return console.error(`[MCPStore] No connection found for server: ${serverName}`),null;try{return(await MCPService.readResource(connection,uri2)).contents}catch(error2){return console.error(`[MCPStore] Failed to read resource ${uri2}:`,error2),null}}parseHeaders(headersJson){if(headersJson?.trim())try{const parsed=JSON.parse(headersJson);if(typeof parsed=="object"&&parsed!==null&&!Array.isArray(parsed))return parsed}catch{console.warn("[MCPStore] Failed \
-to parse custom headers JSON:",headersJson)}}async runHealthChecksForServers(servers,skipIfChecked=!0,promoteToActive=!1){const serversToCheck=skipIfChecked?servers.filter(s2=>!this.hasHealthCheck(s2.id)&&s2.url.trim()):servers.filter(s2=>s2.url.trim());if(serversToCheck.length===0)return;const BATCH_SIZE=5;for(let i=0;i<serversToCheck.length;i+=BATCH_SIZE){const batch=serversToCheck.slice(i,i+BATCH_SIZE);await Promise.allSettled(batch.map(server=>this.runHealthCheck(server,promoteToActive)))}}getExistingConnection(serverId){
-return this.connections.get(serverId)}async runHealthCheck(server,promoteToActive=!1){const existingConnection=this.connections.get(server.id);if(existingConnection)try{const tools=await MCPService.listTools(existingConnection),capabilities=this.#buildCapabilitiesInfo(existingConnection.serverCapabilities,existingConnection.clientCapabilities);this.updateHealthCheck(server.id,{status:HealthCheckStatus.SUCCESS,tools:tools.map(tool=>({name:tool.name,description:tool.description,title:tool.title})),
-serverInfo:existingConnection.serverInfo,capabilities,transportType:existingConnection.transportType,protocolVersion:existingConnection.protocolVersion,instructions:existingConnection.instructions,connectionTimeMs:existingConnection.connectionTimeMs,logs:[]});return}catch(error2){console.warn(`[MCPStore] Failed to reuse connection for ${server.id}, creating new one:`,error2),this.connections.delete(server.id)}const trimmedUrl=server.url.trim(),logs=[];let currentPhase=MCPConnectionPhase.IDLE;if(!trimmedUrl){
-this.updateHealthCheck(server.id,{status:HealthCheckStatus.ERROR,message:"Please enter a server URL first.",logs:[]});return}this.updateHealthCheck(server.id,{status:HealthCheckStatus.CONNECTING,phase:MCPConnectionPhase.TRANSPORT_CREATING,logs:[]});const timeoutMs=Math.round(server.requestTimeoutSeconds*1e3),headers=this.parseHeaders(server.headers);try{const serverConfig={url:trimmedUrl,transport:detectMcpTransportFromUrl(trimmedUrl),handshakeTimeoutMs:DEFAULT_MCP_CONFIG.connectionTimeoutMs,requestTimeoutMs:timeoutMs,
-headers,useProxy:server.useProxy};this.serverConfigs.set(server.id,serverConfig);const connection=await MCPService.connect(server.id,serverConfig,DEFAULT_MCP_CONFIG.clientInfo,DEFAULT_MCP_CONFIG.capabilities,(phase,log)=>{currentPhase=phase,logs.push(log),this.updateHealthCheck(server.id,{status:HealthCheckStatus.CONNECTING,phase,logs:[...logs]}),phase===MCPConnectionPhase.DISCONNECTED&&promoteToActive&&(console.log(`[MCPStore][${server.id}] Connection lost during health check, starting auto-rec\
-onnect`),this.autoReconnect(server.id))}),tools=connection.tools.map(tool=>({name:tool.name,description:tool.description,title:tool.title})),capabilities=this.#buildCapabilitiesInfo(connection.serverCapabilities,connection.clientCapabilities);this.updateHealthCheck(server.id,{status:HealthCheckStatus.SUCCESS,tools,serverInfo:connection.serverInfo,capabilities,transportType:connection.transportType,protocolVersion:connection.protocolVersion,instructions:connection.instructions,connectionTimeMs:connection.
-connectionTimeMs,logs}),promoteToActive&&server.enabled?this.promoteHealthCheckToConnection(server.id,connection):await MCPService.disconnect(connection)}catch(error2){const message=error2 instanceof Error?error2.message:"Unknown error occurred";logs.at(-1)?.phase!==MCPConnectionPhase.ERROR&&logs.push({timestamp:new Date,phase:MCPConnectionPhase.ERROR,message:`Connection failed: ${message}`,level:MCPLogLevel.ERROR}),this.updateHealthCheck(server.id,{status:HealthCheckStatus.ERROR,message,phase:currentPhase,
-logs})}}promoteHealthCheckToConnection(serverId,connection){for(const tool of connection.tools)this.toolsIndex.has(tool.name)&&console.warn(`[MCPStore] Tool name conflict during promotion: "${tool.name}" exists in "${this.toolsIndex.get(tool.name)}" and "${serverId}". Using tool from "${serverId}".`),this.toolsIndex.set(tool.name,serverId);this.connections.set(serverId,connection),this.updateState({toolCount:this.toolsIndex.size,connectedServers:Array.from(this.connections.keys())})}getServersStatus(){
-const statuses=[];for(const[name,connection]of this.connections)statuses.push({name,isConnected:!0,toolCount:connection.tools.length,error:void 0});return statuses}getServerInstructions(){const results=[];for(const[serverName,connection]of this.connections)connection.instructions&&results.push({serverName,serverTitle:connection.serverInfo?.title||connection.serverInfo?.name,instructions:connection.instructions});return results}getHealthCheckInstructions(){const results=[];for(const[serverId,state2]of Object.
-entries(this._healthChecks))state2.status===HealthCheckStatus.SUCCESS&&state2.instructions&&results.push({serverId,serverTitle:state2.serverInfo?.title||state2.serverInfo?.name,instructions:state2.instructions});return results}hasServerInstructions(){for(const connection of this.connections.values())if(connection.instructions)return!0;return!1}hasResourcesCapability(perChatOverrides){if(perChatOverrides!==void 0){const enabledServerIds=new Set(perChatOverrides.filter(o=>o.enabled).map(o=>o.serverId));
-if(enabledServerIds.size===0)return!1;for(const[serverId,state2]of Object.entries(this._healthChecks))if(enabledServerIds.has(serverId)&&state2.status===HealthCheckStatus.SUCCESS&&state2.capabilities?.server?.resources!==void 0)return!0;for(const[serverName,connection]of this.connections)if(enabledServerIds.has(serverName)&&MCPService.supportsResources(connection))return!0;return!1}for(const state2 of Object.values(this._healthChecks))if(state2.status===HealthCheckStatus.SUCCESS&&state2.capabilities?.
-server?.resources!==void 0)return!0;for(const connection of this.connections.values())if(MCPService.supportsResources(connection))return!0;return!1}getServersWithResources(){const servers=[];for(const[name,connection]of this.connections)MCPService.supportsResources(connection)&&!servers.includes(name)&&servers.push(name);for(const[serverId,state2]of Object.entries(this._healthChecks))!servers.includes(serverId)&&state2.status===HealthCheckStatus.SUCCESS&&state2.capabilities?.server?.resources!==
-void 0&&servers.push(serverId);return servers}async fetchAllResources(forceRefresh=!1){const serversWithResources=this.getServersWithResources();if(serversWithResources.length!==0){if(!forceRefresh&&serversWithResources.every(serverName=>{const serverRes=mcpResourceStore.getServerResources(serverName);return!serverRes||!serverRes.lastFetched?!1:Date.now()-serverRes.lastFetched.getTime()<DEFAULT_CACHE_TTL_MS})){console.log("[MCPStore] Using cached resources");return}mcpResourceStore.setLoading(!0);
-try{await Promise.all(serversWithResources.map(serverName=>this.fetchServerResources(serverName)))}finally{mcpResourceStore.setLoading(!1)}}}async fetchServerResources(serverName){const connection=this.connections.get(serverName);if(!connection){console.warn(`[MCPStore] No connection found for server: ${serverName}`);return}if(MCPService.supportsResources(connection)){mcpResourceStore.setServerLoading(serverName,!0);try{const[resources,templates]=await Promise.all([MCPService.listAllResources(connection),
-MCPService.listAllResourceTemplates(connection)]);mcpResourceStore.setServerResources(serverName,resources,templates)}catch(error2){const message=error2 instanceof Error?error2.message:String(error2);mcpResourceStore.setServerError(serverName,message),console.error(`[MCPStore][${serverName}] Failed to fetch resources:`,error2)}}}async readResource(uri2){const cached2=mcpResourceStore.getCachedContent(uri2);if(cached2)return cached2.content;const serverName=mcpResourceStore.findServerForUri(uri2);
-if(!serverName)return console.error(`[MCPStore] No server found for resource URI: ${uri2}`),null;const connection=this.connections.get(serverName);if(!connection)return console.error(`[MCPStore] No connection found for server: ${serverName}`),null;try{const result=await MCPService.readResource(connection,uri2),resourceInfo=mcpResourceStore.findResourceByUri(uri2);return resourceInfo&&mcpResourceStore.cacheResourceContent(resourceInfo,result.contents),result.contents}catch(error2){return console.
-error(`[MCPStore] Failed to read resource ${uri2}:`,error2),null}}async subscribeToResource(uri2){const serverName=mcpResourceStore.findServerForUri(uri2);if(!serverName)return console.error(`[MCPStore] No server found for resource URI: ${uri2}`),!1;const connection=this.connections.get(serverName);if(!connection)return console.error(`[MCPStore] No connection found for server: ${serverName}`),!1;if(!MCPService.supportsResourceSubscriptions(connection))return!1;try{return await MCPService.subscribeResource(
-connection,uri2),mcpResourceStore.addSubscription(uri2,serverName),!0}catch(error2){return console.error(`[MCPStore] Failed to subscribe to resource ${uri2}:`,error2),!1}}async unsubscribeFromResource(uri2){const serverName=mcpResourceStore.findServerForUri(uri2);if(!serverName)return console.error(`[MCPStore] No server found for resource URI: ${uri2}`),!1;const connection=this.connections.get(serverName);if(!connection)return console.error(`[MCPStore] No connection found for server: ${serverName}`),
-!1;try{return await MCPService.unsubscribeResource(connection,uri2),mcpResourceStore.removeSubscription(uri2),!0}catch(error2){return console.error(`[MCPStore] Failed to unsubscribe from resource ${uri2}:`,error2),!1}}async attachResource(uri2){const resourceInfo=mcpResourceStore.findResourceByUri(uri2);if(!resourceInfo)return console.error(`[MCPStore] Resource not found: ${uri2}`),null;if(mcpResourceStore.isAttached(uri2))return null;const attachment=mcpResourceStore.addAttachment(resourceInfo);
-try{const content2=await this.readResource(uri2);content2?mcpResourceStore.updateAttachmentContent(attachment.id,content2):mcpResourceStore.updateAttachmentError(attachment.id,"Failed to read resource")}catch(error2){const message=error2 instanceof Error?error2.message:String(error2);mcpResourceStore.updateAttachmentError(attachment.id,message)}return mcpResourceStore.getAttachment(attachment.id)??null}removeResourceAttachment(attachmentId){mcpResourceStore.removeAttachment(attachmentId)}clearResourceAttachments(){
-mcpResourceStore.clearAttachments()}getResourceContextForChat(){return mcpResourceStore.formatAttachmentsForContext()}consumeResourceAttachmentsAsExtras(){const extras=mcpResourceStore.toMessageExtras();return extras.length>0&&mcpResourceStore.clearAttachments(),extras}}const mcpStore=new MCPStore;var root_2$19=from_html('<button type="button"><!> <span class="max-w-[150px] truncate text-xs"> </span> <!></button>'),root_8$t=from_html('<img class="h-3 w-3 shrink-0 rounded-sm"/>'),root_7$u=from_html(
-'<div class="flex items-center gap-1 text-xs"><!> <span class="truncate"> </span></div>'),root_1$11=from_html("<!> <!>",1);function ChatAttachmentsListItemMcpResource($$anchor,$$props){push$1($$props,!0);const ResourceIcon=user_derived(()=>getResourceIcon($$props.attachment.resource.mimeType,$$props.attachment.resource.uri)),serverName=user_derived(()=>mcpStore.getServerDisplayName($$props.attachment.resource.serverName)),favicon=user_derived(()=>mcpStore.getServerFavicon($$props.attachment.resource.
-serverName));function getStatusClass(attachment){return attachment.error?"border-red-500/50 bg-red-500/10":(attachment.loading,"border-border/50 bg-muted/30")}var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$5,($$anchor2,Tooltip_Root)=>{Tooltip_Root($$anchor2,{children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$11(),node_1=first_child(fragment_1);component(node_1,()=>Tooltip_trigger,($$anchor4,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor4,{children:($$anchor5,$$slotProps2)=>{
-var button=root_2$19(),node_2=child(button);{var consequent=$$anchor6=>{Loader_circle($$anchor6,{class:"h-3 w-3 animate-spin text-muted-foreground"})},consequent_1=$$anchor6=>{Circle_alert($$anchor6,{class:"h-3 w-3 text-red-500"})},alternate=$$anchor6=>{var fragment_4=comment$2(),node_3=first_child(fragment_4);component(node_3,()=>get$3(ResourceIcon),($$anchor7,ResourceIcon_1)=>{ResourceIcon_1($$anchor7,{class:"h-3 w-3 text-muted-foreground"})}),append($$anchor6,fragment_4)};if_block(node_2,$$render=>{
-$$props.attachment.loading?$$render(consequent):$$props.attachment.error?$$render(consequent_1,1):$$render(alternate,-1)})}var span=sibling(node_2,2),text2=child(span,!0);reset(span);var node_4=sibling(span,2);{var consequent_2=$$anchor6=>{ActionIcon($$anchor6,{class:"-my-2 -mr-1.5 bg-transparent",get icon(){return X},iconSize:"h-2 w-2",onclick:()=>$$props.onRemove?.($$props.attachment.id),stopPropagationOnClick:!0,tooltip:"Remove"})};if_block(node_4,$$render=>{$$props.onRemove&&$$render(consequent_2)})}
-reset(button),template_effect(($0,$1)=>{set_class(button,1,$0),button.disabled=!$$props.onclick,set_text(text2,$1)},[()=>clsx(["flex flex-shrink-0 items-center gap-1.5 rounded-md border px-2 py-0.75 text-sm transition-colors",getStatusClass($$props.attachment),$$props.onclick&&"cursor-pointer hover:bg-muted/50",$$props.class]),()=>getResourceDisplayName($$props.attachment.resource)]),delegated("click",button,function(...$$args){$$props.onclick?.apply(this,$$args)}),append($$anchor5,button)},$$slots:{
-default:!0}})});var node_5=sibling(node_1,2);component(node_5,()=>Tooltip_content,($$anchor4,Tooltip_Content)=>{Tooltip_Content($$anchor4,{children:($$anchor5,$$slotProps2)=>{var div=root_7$u(),node_6=child(div);{var consequent_3=$$anchor6=>{var img=root_8$t();template_effect(()=>{set_attribute(img,"alt",$$props.attachment.resource.serverName),set_attribute(img,"src",get$3(favicon))}),event("error",img,e=>{e.currentTarget.style.display="none"}),replay_events(img),append($$anchor6,img)};if_block(
-node_6,$$render=>{get$3(favicon)&&$$render(consequent_3)})}var span_1=sibling(node_6,2),text_1=child(span_1,!0);reset(span_1),reset(div),template_effect(()=>set_text(text_1,get$3(serverName))),append($$anchor5,div)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}delegate(["click"]);const info$1=($$anchor,text2=noop$3)=>{var fragment=comment$2(),node_2=first_child(fragment);{var consequent_1=$$anchor2=>{var span=root_6$w(),text_3=child(
-span,!0);reset(span),template_effect(()=>set_text(text_3,text2())),append($$anchor2,span)};if_block(node_2,$$render=>{text2()&&$$render(consequent_1)})}append($$anchor,fragment)};var root_2$18=from_html("<div></div>"),root_1$10=from_html('<div class="relative"><div> </div> <!></div>'),root_3$W=from_html('<div class="absolute top-2 right-2 opacity-0 transition-opacity group-hover:opacity-100"><!></div>'),root_4$C=from_html('<div class="flex h-8 w-8 items-center justify-center rounded bg-primary/1\
-0 text-xs font-medium text-primary"> </div>'),root_6$w=from_html('<span class="text-xs text-muted-foreground"> </span>'),root_9$m=from_html('<div class="flex items-start gap-3"><div class="flex min-w-0 flex-1 flex-col items-start text-left"><span class="w-full truncate text-sm font-medium text-foreground"> </span> <!> <!></div></div>'),root_11$f=from_html('<span class="mb-3 block truncate text-sm font-medium text-foreground"> </span> <!>',1),root_7$t=from_html('<button type="button"><!> <div><!>\
-</div></button>'),root_13$e=from_html('<button type="button"><!> <div class="flex flex-col items-start gap-0.5"><span> </span> <!></div> <!></button>');function ChatAttachmentsListItemThumbnailFile($$anchor,$$props){push$1($$props,!0);const textPreview=($$anchor2,content2=noop$3)=>{var div=root_1$10(),div_1=child(div),text_1=child(div_1,!0);reset(div_1);var node2=sibling(div_1,2);{var consequent=$$anchor3=>{var div_2=root_2$18();template_effect(()=>set_class(div_2,1,`pointer-events-none absolute\
- right-0 bottom-0 left-0 h-4 bg-gradient-to-t from-muted to-transparent ${readonly2()?"h-6":""}`)),append($$anchor3,div_2)};if_block(node2,$$render=>{content2().length>150&&$$render(consequent)})}reset(div),template_effect($0=>{set_class(div_1,1,`font-mono text-xs leading-relaxed break-words whitespace-pre-wrap text-muted-foreground ${readonly2()?"":"max-h-3rem line-height-1.2"}`),set_text(text_1,$0)},[()=>getPreviewText(content2())]),append($$anchor2,div)},removeButton=$$anchor2=>{var div_3=root_3$W(),
-node_1=child(div_3);ActionIcon(node_1,{get icon(){return X},tooltip:"Remove",stopPropagationOnClick:!0,onclick:()=>$$props.onRemove?.($$props.id)}),reset(div_3),append($$anchor2,div_3)},fileIcon=$$anchor2=>{var div_4=root_4$C(),text_2=child(div_4,!0);reset(div_4),template_effect(()=>set_text(text_2,get$3(fileTypeLabel))),append($$anchor2,div_4)};let className=prop($$props,"class",3,""),readonly2=prop($$props,"readonly",3,!1),isPdf=user_derived(()=>isPdfFile$1($$props.attachment,$$props.uploadedFile)),
-isPdfWithContent=user_derived(()=>get$3(isPdf)&&!!$$props.textContent),isText=user_derived(()=>isTextFile($$props.attachment,$$props.uploadedFile)),isTextWithContent=user_derived(()=>get$3(isText)&&!!$$props.textContent),fileTypeLabel=user_derived(()=>{if($$props.uploadedFile?.type)return getFileTypeLabel($$props.uploadedFile.type);if($$props.attachment){if("mimeType"in $$props.attachment&&$$props.attachment.mimeType)return getFileTypeLabel($$props.attachment.mimeType);if($$props.attachment.type)
-return getFileTypeLabel($$props.attachment.type)}return getFileTypeLabel($$props.name)}),pdfProcessingMode=user_derived(()=>$$props.attachment?.type===AttachmentType.PDF?$$props.attachment.processedAsImages?"Sent as Image":"Sent as Text":null);var fragment_1=comment$2(),node_3=first_child(fragment_1);{var consequent_6=$$anchor2=>{var button=root_7$t(),node_4=child(button);{var consequent_2=$$anchor3=>{removeButton($$anchor3)};if_block(node_4,$$render=>{readonly2()||$$render(consequent_2)})}var div_5=sibling(
-node_4,2),node_5=child(div_5);{var consequent_4=$$anchor3=>{var div_6=root_9$m(),div_7=child(div_6),span_1=child(div_7),text_4=child(span_1,!0);reset(span_1);var node_6=sibling(span_1,2);{let $0=user_derived(()=>get$3(pdfProcessingMode)||($$props.size?formatFileSize($$props.size):void 0));info$1(node_6,()=>get$3($0))}var node_7=sibling(node_6,2);{var consequent_3=$$anchor4=>{textPreview($$anchor4,()=>$$props.textContent)};if_block(node_7,$$render=>{$$props.textContent&&$$render(consequent_3)})}reset(
-div_7),reset(div_6),template_effect(()=>set_text(text_4,$$props.name)),append($$anchor3,div_6)},alternate=$$anchor3=>{var fragment_4=root_11$f(),span_2=first_child(fragment_4),text_5=child(span_2,!0);reset(span_2);var node_8=sibling(span_2,2);{var consequent_5=$$anchor4=>{textPreview($$anchor4,()=>$$props.textContent)};if_block(node_8,$$render=>{$$props.textContent&&$$render(consequent_5)})}template_effect(()=>set_text(text_5,$$props.name)),append($$anchor3,fragment_4)};if_block(node_5,$$render=>{
-readonly2()?$$render(consequent_4):$$render(alternate,-1)})}reset(div_5),reset(button),template_effect(()=>{set_attribute(button,"aria-label",readonly2()?`Preview ${$$props.name}`:void 0),set_class(button,1,`rounded-lg border border-border bg-muted p-3 ${className()??""} cursor-pointer ${readonly2()?"w-full max-w-2xl transition-shadow hover:shadow-md":`group relative text-left ${$$props.textContent?"max-h-24 max-w-72":"max-w-36"}`} overflow-hidden`),set_class(div_5,1,clsx([!readonly2()&&"pr-8","\
-overflow-hidden"]))}),delegated("click",button,function(...$$args){$$props.onclick?.apply(this,$$args)}),append($$anchor2,button)},alternate_1=$$anchor2=>{var button_1=root_13$e(),node_9=child(button_1);fileIcon(node_9);var div_8=sibling(node_9,2),span_3=child(div_8),text_6=child(span_3,!0);reset(span_3);var node_10=sibling(span_3,2);{let $0=user_derived(()=>get$3(pdfProcessingMode)||($$props.size?formatFileSize($$props.size):void 0));info$1(node_10,()=>get$3($0))}reset(div_8);var node_11=sibling(
-div_8,2);{var consequent_7=$$anchor3=>{removeButton($$anchor3)};if_block(node_11,$$render=>{readonly2()||$$render(consequent_7)})}reset(button_1),template_effect(()=>{set_class(button_1,1,`group flex items-center gap-3 rounded-lg border border-border bg-muted p-3 ${className()??""} relative`),set_class(span_3,1,`max-w-24 truncate text-sm font-medium text-foreground ${readonly2()?"":"group-hover:pr-6"} md:max-w-32`),set_text(text_6,$$props.name)}),delegated("click",button_1,function(...$$args){$$props.
-onclick?.apply(this,$$args)}),append($$anchor2,button_1)};if_block(node_3,$$render=>{get$3(isTextWithContent)||get$3(isPdfWithContent)?$$render(consequent_6):$$render(alternate_1,-1)})}append($$anchor,fragment_1),pop()}delegate(["click"]);var root_1$$=from_html("<img/>"),root_2$17=from_html('<button class="block h-full w-full rounded-lg focus:ring-2 focus:ring-primary focus:ring-offset-2 focus:outline-none" type="button"><!></button>'),root_4$B=from_html('<div class="absolute top-1 right-1 flex \
-items-center justify-center opacity-0 transition-opacity group-hover:opacity-100"><!></div>'),root$1F=from_html("<div><!> <!></div>");function ChatAttachmentsListItemThumbnailImage($$anchor,$$props){push$1($$props,!0);const image2=$$anchor2=>{var img=root_1$$();template_effect(()=>{set_attribute(img,"src",$$props.preview),set_attribute(img,"alt",$$props.name),set_class(img,1,`${height()??""} ${width()??""} cursor-pointer object-cover ${imageClass()??""}`)}),append($$anchor2,img)};let className=prop(
-$$props,"class",3,""),height=prop($$props,"height",3,"h-16"),imageClass=prop($$props,"imageClass",3,""),readonly2=prop($$props,"readonly",3,!1),width=prop($$props,"width",3,"w-auto");var div=root$1F(),node2=child(div);{var consequent=$$anchor2=>{var button=root_2$17(),node_1=child(button);image2(node_1),reset(button),template_effect(()=>set_attribute(button,"aria-label",`Preview ${$$props.name??""}`)),delegated("click",button,function(...$$args){$$props.onclick?.apply(this,$$args)}),append($$anchor2,
-button)},alternate=$$anchor2=>{image2($$anchor2)};if_block(node2,$$render=>{$$props.onclick?$$render(consequent):$$render(alternate,-1)})}var node_2=sibling(node2,2);{var consequent_1=$$anchor2=>{var div_1=root_4$B(),node_3=child(div_1);ActionIcon(node_3,{class:"text-white",get icon(){return X},onclick:()=>$$props.onRemove?.($$props.id),stopPropagationOnClick:!0,tooltip:"Remove"}),reset(div_1),append($$anchor2,div_1)};if_block(node_2,$$render=>{readonly2()||$$render(consequent_1)})}reset(div),template_effect(
-()=>set_class(div,1,`group relative overflow-hidden rounded-lg bg-muted shadow-lg dark:border dark:border-muted ${className()??""}`)),append($$anchor,div),pop()}delegate(["click"]);class ModelsService{static async list(){return apiFetch(API_MODELS.LIST)}static async listRouter(){return apiFetch(API_MODELS.LIST)}static async load(modelId,extraArgs){const payload={model:modelId};return extraArgs&&extraArgs.length>0&&(payload.extra_args=extraArgs),apiPost(API_MODELS.LOAD,payload)}static async unload(modelId){
-return apiPost(API_MODELS.UNLOAD,{model:modelId})}static isModelLoaded(model){return model.status.value===ServerModelStatus.LOADED}static isModelLoading(model){return model.status.value===ServerModelStatus.LOADING}static parseModelId(modelId){const result={raw:modelId,orgName:null,modelName:null,params:null,activatedParams:null,quantization:null,tags:[]},colonIdx=modelId.indexOf(MODEL_ID_QUANTIZATION_SEPARATOR);let modelPath;colonIdx!==MODEL_ID_NOT_FOUND?(result.quantization=modelId.slice(colonIdx+
-1)||null,modelPath=modelId.slice(0,colonIdx)):modelPath=modelId;const slashIdx=modelPath.indexOf(MODEL_ID_ORG_SEPARATOR);let modelStr;slashIdx!==MODEL_ID_NOT_FOUND?(result.orgName=modelPath.slice(0,slashIdx),modelStr=modelPath.slice(slashIdx+1)):modelStr=modelPath;const dotIdx=modelStr.lastIndexOf(".");if(dotIdx!==MODEL_ID_NOT_FOUND&&!result.quantization){const afterDot=modelStr.slice(dotIdx+1);MODEL_QUANTIZATION_SEGMENT_RE.test(afterDot)&&(result.quantization=afterDot,modelStr=modelStr.slice(0,
-dotIdx))}const segments=modelStr.split(MODEL_ID_SEGMENT_SEPARATOR);if(!result.quantization&&segments.length>1){const last=segments[segments.length-1],secondLast=segments.length>2?segments[segments.length-2]:null;MODEL_QUANTIZATION_SEGMENT_RE.test(last)&&(secondLast&&MODEL_CUSTOM_QUANTIZATION_PREFIX_RE.test(secondLast)?(result.quantization=`${secondLast}-${last}`,segments.splice(segments.length-2,2)):(result.quantization=last,segments.pop()))}let paramsIdx=MODEL_ID_NOT_FOUND,activatedParamsIdx=MODEL_ID_NOT_FOUND;
-for(let i=0;i<segments.length;i++){const seg=segments[i];paramsIdx===MODEL_ID_NOT_FOUND&&MODEL_PARAMS_RE.test(seg)?(paramsIdx=i,result.params=seg.toUpperCase()):paramsIdx!==MODEL_ID_NOT_FOUND&&MODEL_ACTIVATED_PARAMS_RE.test(seg)&&(activatedParamsIdx=i,result.activatedParams=seg.toUpperCase())}const pivotIdx=paramsIdx!==MODEL_ID_NOT_FOUND?paramsIdx:segments.length;return result.modelName=segments.slice(0,pivotIdx).join(MODEL_ID_SEGMENT_SEPARATOR)||null,paramsIdx!==MODEL_ID_NOT_FOUND&&(result.tags=
-segments.slice(paramsIdx+1).filter((_,relIdx)=>{const absIdx=paramsIdx+1+relIdx;return absIdx===activatedParamsIdx?!1:!MODEL_IGNORED_SEGMENTS.has(segments[absIdx].toUpperCase())})),result}}class ModelsStore{#models=state$1(proxy([]));get models(){return get$3(this.#models)}set models(value){set$1(this.#models,value,!0)}#routerModels=state$1(proxy([]));get routerModels(){return get$3(this.#routerModels)}set routerModels(value){set$1(this.#routerModels,value,!0)}#loading=state$1(!1);get loading(){
-return get$3(this.#loading)}set loading(value){set$1(this.#loading,value,!0)}#updating=state$1(!1);get updating(){return get$3(this.#updating)}set updating(value){set$1(this.#updating,value,!0)}#error=state$1(null);get error(){return get$3(this.#error)}set error(value){set$1(this.#error,value,!0)}#selectedModelId=state$1(null);get selectedModelId(){return get$3(this.#selectedModelId)}set selectedModelId(value){set$1(this.#selectedModelId,value,!0)}#selectedModelName=state$1(null);get selectedModelName(){
-return get$3(this.#selectedModelName)}set selectedModelName(value){set$1(this.#selectedModelName,value,!0)}#modelUsage=state$1(proxy(new Map));get modelUsage(){return get$3(this.#modelUsage)}set modelUsage(value){set$1(this.#modelUsage,value,!0)}modelLoadingStates=new SvelteMap;#favoriteModelIds=state$1(proxy(this.loadFavoritesFromStorage()));get favoriteModelIds(){return get$3(this.#favoriteModelIds)}set favoriteModelIds(value){set$1(this.#favoriteModelIds,value,!0)}modelPropsCache=new TTLCache(
-{ttlMs:MODEL_PROPS_CACHE_TTL_MS,maxEntries:MODEL_PROPS_CACHE_MAX_ENTRIES});#modelPropsFetching=state$1(proxy(new Set));get modelPropsFetching(){return get$3(this.#modelPropsFetching)}set modelPropsFetching(value){set$1(this.#modelPropsFetching,value,!0)}#propsCacheVersion=state$1(0);get propsCacheVersion(){return get$3(this.#propsCacheVersion)}set propsCacheVersion(value){set$1(this.#propsCacheVersion,value,!0)}get selectedModel(){return this.selectedModelId?this.models.find(model=>model.id===this.
-selectedModelId)??null:null}get loadedModelIds(){return this.routerModels.filter(m=>m.status.value===ServerModelStatus.LOADED||m.status.value===ServerModelStatus.SLEEPING).map(m=>m.id)}get loadingModelIds(){return Array.from(this.modelLoadingStates.entries()).filter(([,loading])=>loading).map(([id2])=>id2)}get singleModelName(){if(serverStore.isRouterMode)return null;const props=serverStore.props;return props?.model_alias?props.model_alias:props?.model_path&&props.model_path.split(/(\\|\/)/).pop()||
-null}getModelModalities(modelId){const model=this.models.find(m=>m.model===modelId||m.id===modelId);if(model?.modalities)return model.modalities;const props=this.modelPropsCache.get(modelId);return props?.modalities?{vision:props.modalities.vision??!1,audio:props.modalities.audio??!1}:null}modelSupportsVision(modelId){return this.getModelModalities(modelId)?.vision??!1}modelSupportsAudio(modelId){return this.getModelModalities(modelId)?.audio??!1}getModelModalitiesArray(modelId){const modalities=this.
-getModelModalities(modelId);if(!modalities)return[];const result=[];return modalities.vision&&result.push(ModelModality.VISION),modalities.audio&&result.push(ModelModality.AUDIO),result}getModelProps(modelId){return this.modelPropsCache.get(modelId)}getModelContextSize(modelId){const nCtx=this.getModelProps(modelId)?.default_generation_settings?.n_ctx;return typeof nCtx=="number"?nCtx:null}get selectedModelContextSize(){return this.selectedModelName?this.getModelContextSize(this.selectedModelName):
-null}isModelPropsFetching(modelId){return this.modelPropsFetching.has(modelId)}isModelLoaded(modelId){const model=this.routerModels.find(m=>m.id===modelId);return model?.status.value===ServerModelStatus.LOADED||model?.status.value===ServerModelStatus.SLEEPING||!1}isModelOperationInProgress(modelId){return this.modelLoadingStates.get(modelId)??!1}getModelStatus(modelId){return this.routerModels.find(m=>m.id===modelId)?.status.value??null}getModelUsage(modelId){return this.modelUsage.get(modelId)??
-new SvelteSet}isModelInUse(modelId){const usage=this.modelUsage.get(modelId);return usage!==void 0&&usage.size>0}async fetch(force=!1){if(!this.loading&&!(this.models.length>0&&!force)){this.loading=!0,this.error=null;try{serverStore.props||await serverStore.fetch();const response=await ModelsService.list(),models=response.data.map((item,index2)=>{const details=response.models?.[index2],rawCapabilities=Array.isArray(details?.capabilities)?details?.capabilities:[],displayNameSource=details?.name&&
-details.name.trim().length>0?details.name:item.id,displayName=this.toDisplayName(displayNameSource),modelId=details?.model||item.id;return{id:item.id,name:displayName,model:modelId,description:details?.description,capabilities:rawCapabilities.filter(value=>!!value),details:details?.details,meta:item.meta??null,parsedId:ModelsService.parseModelId(modelId),aliases:item.aliases??[],tags:item.tags??[]}});this.models=models;const serverProps2=serverStore.props;if(serverStore.isModelMode&&this.models.
-length>0&&serverProps2?.modalities){const modalities={vision:serverProps2.modalities.vision??!1,audio:serverProps2.modalities.audio??!1};this.modelPropsCache.set(this.models[0].model,serverProps2),this.models=this.models.map((model,index2)=>index2===0?{...model,modalities}:model)}}catch(error2){throw this.models=[],this.error=error2 instanceof Error?error2.message:"Failed to load models",error2}finally{this.loading=!1}}}async fetchRouterModels(){try{const response=await ModelsService.listRouter();
-this.routerModels=response.data,await this.fetchModalitiesForLoadedModels();const o=this.models.filter(option2=>this.getModelProps(option2.model)?.webui!==!1);o.length===1&&this.isModelLoaded(o[0].model)&&this.selectModelById(o[0].id)}catch(error2){console.warn("Failed to fetch router models:",error2),this.routerModels=[]}}async fetchModelProps(modelId){const cached2=this.modelPropsCache.get(modelId);if(cached2)return cached2;if(serverStore.isRouterMode&&!this.isModelLoaded(modelId)||this.modelPropsFetching.
-has(modelId))return null;this.modelPropsFetching.add(modelId);try{const props=await PropsService.fetchForModel(modelId);return this.modelPropsCache.set(modelId,props),props}catch(error2){return console.warn(`Failed to fetch props for model ${modelId}:`,error2),null}finally{this.modelPropsFetching.delete(modelId)}}async fetchModalitiesForLoadedModels(){const loadedModelIds2=this.loadedModelIds;if(loadedModelIds2.length===0)return;const propsPromises=loadedModelIds2.map(modelId=>this.fetchModelProps(
-modelId));try{const results=await Promise.all(propsPromises);this.models=this.models.map(model=>{const modelIndex=loadedModelIds2.indexOf(model.model);if(modelIndex===-1)return model;const props=results[modelIndex];if(!props?.modalities)return model;const modalities={vision:props.modalities.vision??!1,audio:props.modalities.audio??!1};return{...model,modalities}}),this.propsCacheVersion++}catch(error2){console.warn("Failed to fetch modalities for loaded models:",error2)}}async updateModelModalities(modelId){
-try{const props=await this.fetchModelProps(modelId);if(!props?.modalities)return;const modalities={vision:props.modalities.vision??!1,audio:props.modalities.audio??!1};this.models=this.models.map(model=>model.model===modelId?{...model,modalities}:model),this.propsCacheVersion++}catch(error2){console.warn(`Failed to update modalities for model ${modelId}:`,error2)}}async selectModelById(modelId){if(!modelId||this.updating||this.selectedModelId===modelId)return;const option2=this.models.find(model=>model.
-id===modelId);if(!option2)throw new Error("Selected model is not available");this.updating=!0,this.error=null;try{this.selectedModelId=option2.id,this.selectedModelName=option2.model}finally{this.updating=!1}}selectModelByName(modelName){const option2=this.models.find(model=>model.model===modelName);option2&&(this.selectedModelId=option2.id,this.selectedModelName=option2.model)}clearSelection(){this.selectedModelId=null,this.selectedModelName=null}findModelByName(modelName){return this.models.find(
-model=>model.model===modelName)??null}findModelById(modelId){return this.models.find(model=>model.id===modelId)??null}hasModel(modelName){return this.models.some(model=>model.model===modelName)}static STATUS_POLL_INTERVAL=500;async pollForModelStatus(modelId,expectedStatus){let attempt=0;for(;;){await this.fetchRouterModels();const currentStatus=this.getModelStatus(modelId);if(currentStatus===expectedStatus)return;if(currentStatus===ServerModelStatus.FAILED)throw new Error(`Model failed to ${expectedStatus===
-ServerModelStatus.LOADED?"load":"unload"}`);if(expectedStatus===ServerModelStatus.LOADED&¤tStatus===ServerModelStatus.UNLOADED&&attempt>2)throw new Error("Model was unloaded unexpectedly during loading");attempt++,await new Promise(resolve2=>setTimeout(resolve2,ModelsStore.STATUS_POLL_INTERVAL))}}async loadModel(modelId){if(!this.isModelLoaded(modelId)&&!this.modelLoadingStates.get(modelId)){this.modelLoadingStates.set(modelId,!0),this.error=null;try{await ModelsService.load(modelId),await this.
-pollForModelStatus(modelId,ServerModelStatus.LOADED),await this.updateModelModalities(modelId),toast.success(`Model loaded: ${this.toDisplayName(modelId)}`)}catch(error2){throw this.error=error2 instanceof Error?error2.message:"Failed to load model",toast.error(`Failed to load model: ${this.toDisplayName(modelId)}`),error2}finally{this.modelLoadingStates.set(modelId,!1)}}}async unloadModel(modelId){if(this.isModelLoaded(modelId)&&!this.modelLoadingStates.get(modelId)){this.modelLoadingStates.set(
-modelId,!0),this.error=null;try{await ModelsService.unload(modelId),await this.pollForModelStatus(modelId,ServerModelStatus.UNLOADED),toast.info(`Model unloaded: ${this.toDisplayName(modelId)}`)}catch(error2){throw this.error=error2 instanceof Error?error2.message:"Failed to unload model",toast.error(`Failed to unload model: ${this.toDisplayName(modelId)}`),error2}finally{this.modelLoadingStates.set(modelId,!1)}}}async ensureModelLoaded(modelId){this.isModelLoaded(modelId)||await this.loadModel(
-modelId)}isFavorite(modelId){return this.favoriteModelIds.has(modelId)}toggleFavorite(modelId){const next2=new SvelteSet(this.favoriteModelIds);next2.has(modelId)?next2.delete(modelId):next2.add(modelId),this.favoriteModelIds=next2;try{localStorage.setItem(FAVORITE_MODELS_LOCALSTORAGE_KEY,JSON.stringify([...next2]))}catch{toast.error("Failed to save favorite models to local storage")}}loadFavoritesFromStorage(){try{const raw2=localStorage.getItem(FAVORITE_MODELS_LOCALSTORAGE_KEY);return raw2?new Set(
-JSON.parse(raw2)):new Set}catch{return toast.error("Failed to load favorite models from local storage"),new Set}}toDisplayName(id2){const candidate=id2.split(/\\|\//).pop();return candidate&&candidate.trim().length>0?candidate:id2}clear(){this.models=[],this.routerModels=[],this.loading=!1,this.updating=!1,this.error=null,this.selectedModelId=null,this.selectedModelName=null,this.modelUsage.clear(),this.modelLoadingStates.clear(),this.modelPropsCache.clear(),this.modelPropsFetching.clear()}pruneExpiredCache(){
-return this.modelPropsCache.prune()}}const modelsStore=new ModelsStore,modelOptions=()=>modelsStore.models,routerModels=()=>modelsStore.routerModels,modelsLoading=()=>modelsStore.loading,modelsUpdating=()=>modelsStore.updating,selectedModelId=()=>modelsStore.selectedModelId,selectedModelName=()=>modelsStore.selectedModelName,singleModelName=()=>modelsStore.singleModelName,selectedModelContextSize=()=>modelsStore.selectedModelContextSize;var root_1$_=from_html("<!> <!>",1),root$1E=from_html('<div\
-><div class="relative flex min-h-0 flex-1 items-center justify-center overflow-hidden"><!> <div class="flex h-full w-full flex-col items-center justify-start overflow-auto py-4"><!> <!></div></div></div>');function ChatAttachmentsPreview($$anchor,$$props){push$1($$props,!0);let uploadedFiles=prop($$props,"uploadedFiles",19,()=>[]),attachments=prop($$props,"attachments",19,()=>[]),className=prop($$props,"class",3,""),previewFocusIndex=prop($$props,"previewFocusIndex",3,0),allItems=user_derived(()=>getAttachmentDisplayItems(
-{uploadedFiles:uploadedFiles(),attachments:attachments()}).filter(item=>!isMcpPrompt(item)&&!isMcpResource(item)).map(item=>({...item,isImage:isImageFile(item.attachment,item.uploadedFile),isAudio:isAudioFile(item.attachment,item.uploadedFile)}))),currentIndex=state$1(0);user_effect(()=>{previewFocusIndex()>=0&&previewFocusIndex()<get$3(allItems).length&&set$1(currentIndex,previewFocusIndex())}),user_effect(()=>{const handler=e=>{e.detail<0?set$1(currentIndex,get$3(currentIndex)>0?get$3(currentIndex)-
-1:get$3(allItems).length-1,!0):set$1(currentIndex,get$3(currentIndex)<get$3(allItems).length-1?get$3(currentIndex)+1:0,!0)};return document.addEventListener("chat-attachments-nav",handler),()=>document.removeEventListener("chat-attachments-nav",handler)}),user_effect(()=>{const index2=get$3(currentIndex);setTimeout(()=>{document.querySelector(`[data-thumbnail-index="${index2}"]`)?.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},0)});let currentItem=user_derived(()=>get$3(allItems)[get$3(
-currentIndex)]??null),displayName=user_derived(()=>get$3(currentItem)?.name||get$3(currentItem)?.uploadedFile?.name||get$3(currentItem)?.attachment?.name||"Unknown File"),isAudio=user_derived(()=>get$3(currentItem)?isAudioFile(get$3(currentItem).attachment,get$3(currentItem).uploadedFile):!1),isImage2=user_derived(()=>get$3(currentItem)?isImageFile(get$3(currentItem).attachment,get$3(currentItem).uploadedFile):!1),isPdf=user_derived(()=>get$3(currentItem)?isPdfFile$1(get$3(currentItem).attachment,
-get$3(currentItem).uploadedFile):!1),isText=user_derived(()=>get$3(currentItem)?isTextFile(get$3(currentItem).attachment,get$3(currentItem).uploadedFile):!1),displayPreview=user_derived(()=>get$3(currentItem)?.uploadedFile?.preview||(get$3(isImage2)&&get$3(currentItem)?.attachment&&"base64Url"in get$3(currentItem).attachment?get$3(currentItem).attachment.base64Url:get$3(currentItem)?.preview)),displayTextContent=user_derived(()=>get$3(currentItem)?.uploadedFile?.textContent||(get$3(currentItem)?.
-attachment&&"content"in get$3(currentItem).attachment?get$3(currentItem).attachment.content:get$3(currentItem)?.textContent)),language2=user_derived(()=>getLanguageFromFilename(get$3(displayName))),fileSize=user_derived(()=>get$3(currentItem)?.size?formatFileSize(get$3(currentItem).size):""),hasVisionModality=user_derived(()=>get$3(currentItem)&&$$props.activeModelId?modelsStore.modelSupportsVision($$props.activeModelId):!1),audioSrc=user_derived(()=>get$3(isAudio)&&get$3(currentItem)?get$3(currentItem).
-uploadedFile?.preview??(get$3(currentItem).attachment&&"mimeType"in get$3(currentItem).attachment&&"base64Data"in get$3(currentItem).attachment?createBase64DataUrl(get$3(currentItem).attachment.mimeType,get$3(currentItem).attachment.base64Data):null):null);function prev2(){set$1(currentIndex,get$3(currentIndex)>0?get$3(currentIndex)-1:get$3(allItems).length-1,!0)}function next2(){set$1(currentIndex,get$3(currentIndex)<get$3(allItems).length-1?get$3(currentIndex)+1:0,!0)}function onNavigate(index2){
-set$1(currentIndex,index2,!0)}var $$exports={prev:prev2,next:next2},div=root$1E(),div_1=child(div),node2=child(div_1);{let $0=user_derived(()=>get$3(allItems).length>1);ChatAttachmentsPreviewNavButtons(node2,{onPrev:prev2,onNext:next2,get show(){return get$3($0)}})}var div_2=sibling(node2,2),node_1=child(div_2);{var consequent=$$anchor2=>{var fragment=root_1$_(),node_2=first_child(fragment);ChatAttachmentsPreviewFileInfo(node_2,{get displayName(){return get$3(displayName)},get fileSize(){return get$3(
-fileSize)}});var node_3=sibling(node_2,2);ChatAttachmentsPreviewCurrentItem(node_3,{get currentItem(){return get$3(currentItem)},get isImage(){return get$3(isImage2)},get isAudio(){return get$3(isAudio)},get isPdf(){return get$3(isPdf)},get isText(){return get$3(isText)},get displayPreview(){return get$3(displayPreview)},get displayTextContent(){return get$3(displayTextContent)},get audioSrc(){return get$3(audioSrc)},get language(){return get$3(language2)},get hasVisionModality(){return get$3(hasVisionModality)},
-get activeModelId(){return $$props.activeModelId}}),append($$anchor2,fragment)};if_block(node_1,$$render=>{get$3(currentItem)&&$$render(consequent)})}var node_4=sibling(node_1,2);return ChatAttachmentsPreviewThumbnailStrip(node_4,{get items(){return get$3(allItems)},get currentIndex(){return get$3(currentIndex)},onNavigate}),reset(div_2),reset(div_1),reset(div),template_effect(()=>set_class(div,1,`${className()??""} flex flex-col text-white`)),append($$anchor,div),pop($$exports)}var root_1$Z=from_html(
-"<!> <!>",1);function ChatAttachmentsPreviewNavButtons($$anchor,$$props){var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=root_1$Z(),node_1=first_child(fragment_1);Button(node_1,{variant:"secondary",size:"icon",class:"absolute top-1/2 left-4 z-10 h-8 w-8 -translate-y-1/2 rounded-full bg-background/5 p-0 text-white!",get onclick(){return $$props.onPrev},"aria-label":"Previous",children:($$anchor3,$$slotProps)=>{Chevron_left($$anchor3,{class:"size-4"})},
-$$slots:{default:!0}});var node_2=sibling(node_1,2);Button(node_2,{variant:"secondary",size:"icon",class:"absolute top-1/2 right-4 z-10 h-8 w-8 -translate-y-1/2 rounded-full bg-background/5 p-0 text-white!",get onclick(){return $$props.onNext},"aria-label":"Next",children:($$anchor3,$$slotProps)=>{Chevron_right($$anchor3,{class:"size-4"})},$$slots:{default:!0}}),append($$anchor2,fragment_1)};if_block(node2,$$render=>{$$props.show&&$$render(consequent)})}append($$anchor,fragment)}var root_1$Y=from_html(
-'<p class="text-xs text-white/60"> </p>'),root$1D=from_html('<div class="sticky top-0 z-[20] mb-4 rounded-lg bg-black/5 px-4 py-2 text-center backdrop-blur-md"><p class="font-medium text-white"> </p> <!></div>');function ChatAttachmentsPreviewFileInfo($$anchor,$$props){var div=root$1D(),p2=child(div),text2=child(p2,!0);reset(p2);var node2=sibling(p2,2);{var consequent=$$anchor2=>{var p_1=root_1$Y(),text_1=child(p_1,!0);reset(p_1),template_effect(()=>set_text(text_1,$$props.fileSize)),append($$anchor2,
-p_1)};if_block(node2,$$render=>{$$props.fileSize&&$$render(consequent)})}reset(div),template_effect(()=>set_text(text2,$$props.displayName)),append($$anchor,div)}var root_1$X=from_html('<div data-slot="checkbox-indicator" class="text-current transition-none"><!></div>');function Checkbox($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),checked=prop($$props,"checked",15,!1),indeterminate=prop($$props,"indeterminate",15,!1),restProps=rest_props($$props,["$$slots","$$events",
-"$$legacy","ref","checked","indeterminate","class"]);var fragment=comment$2(),node2=first_child(fragment);{const children=($$anchor2,$$arg0)=>{let checked2=()=>$$arg0?.().checked,indeterminate2=()=>$$arg0?.().indeterminate;var div=root_1$X(),node_1=child(div);{var consequent=$$anchor3=>{Check($$anchor3,{class:"size-3.5"})},consequent_1=$$anchor3=>{Minus($$anchor3,{class:"size-3.5"})};if_block(node_1,$$render=>{checked2()?$$render(consequent):indeterminate2()&&$$render(consequent_1,1)})}reset(div),
-append($$anchor2,div)};let $0=user_derived(()=>cn$1("peer flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/\
-30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",$$props.class));component(node2,()=>Checkbox$1,($$anchor2,CheckboxPrimitive_Root)=>{CheckboxPrimitive_Root($$anchor2,spread_props({"data-slot":"checkbox",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},get checked(){return checked()},set checked($$value){checked($$value)},get indeterminate(){return indeterminate()},set indeterminate($$value){indeterminate($$value)},
-children,$$slots:{default:!0}}))})}append($$anchor,fragment),pop()}var root_1$W=from_html("<input/>"),root_2$16=from_html("<input/>");function Input($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),value=prop($$props,"value",15),files=prop($$props,"files",15),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","value","type","files","class"]);var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var input=root_1$W();attribute_effect(
-input,$0=>({"data-slot":"input",class:$0,type:"file",...restProps}),[()=>cn$1("flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/5\
-0","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",$$props.class)],void 0,void 0,void 0,!0),bind_this(input,$$value=>ref2($$value),()=>ref2()),bind_files(input,files),bind_value(input,value),append($$anchor2,input)},alternate=$$anchor2=>{var input_1=root_2$16();attribute_effect(input_1,$0=>({"data-slot":"input",class:$0,style:"backdrop-filter: blur(0.5rem);",type:$$props.type,...restProps}),[()=>cn$1("flex h-9 w-full min-w-0 rounded-md bor\
-der border-input bg-background px-3 py-1 text-base shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",$$props.class)],void 0,
-void 0,void 0,!0),bind_this(input_1,$$value=>ref2($$value),()=>ref2()),bind_value(input_1,value),append($$anchor2,input_1)};if_block(node2,$$render=>{$$props.type==="file"?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_1$V=from_html('<button type="button" class="absolute top-1/2 right-3 -translate-y-1/2 transform cursor-pointer text-muted-foreground transition-colors hover:text-foreground"><!></button>'),root$1C=from_html("<div><!> <!> <!></div>");function SearchInput($$anchor,$$props){
-push$1($$props,!0);let value=prop($$props,"value",15,""),placeholder=prop($$props,"placeholder",3,"Search..."),ref2=prop($$props,"ref",15,null),isCancelAlwaysVisible=prop($$props,"isCancelAlwaysVisible",3,!1),showClearButton=user_derived(()=>isCancelAlwaysVisible()||!!value()||!!$$props.onClose);function handleInput(event2){const target2=event2.target;value(target2.value),$$props.onInput?.(target2.value)}function handleClear(){value()?(value(""),$$props.onInput?.(""),ref2()?.focus()):$$props.onClose?.()}
-var div=root$1C(),node2=child(div);Search(node2,{class:"absolute top-1/2 left-3 z-10 h-4 w-4 -translate-y-1/2 transform text-muted-foreground"});var node_1=sibling(node2,2);{let $0=user_derived(()=>get$3(showClearButton)?"pr-9":"");Input(node_1,{get id(){return $$props.id},get class(){return`pl-9 ${get$3($0)??""}`},oninput:handleInput,get onkeydown(){return $$props.onKeyDown},get placeholder(){return placeholder()},type:"search",get value(){return value()},set value($$value){value($$value)},get ref(){
-return ref2()},set ref($$value){ref2($$value)}})}var node_2=sibling(node_1,2);{var consequent=$$anchor2=>{var button=root_1$V(),node_3=child(button);X(node_3,{class:"h-4 w-4"}),reset(button),template_effect(()=>set_attribute(button,"aria-label",value()?"Clear search":"Close")),delegated("click",button,handleClear),append($$anchor2,button)};if_block(node_2,$$render=>{get$3(showClearButton)&&$$render(consequent)})}reset(div),template_effect(()=>set_class(div,1,`relative ${$$props.class??""}`)),append(
-$$anchor,div),pop()}delegate(["click"]);var root_1$U=from_html("<!> <!>",1);function Scroll_area_scrollbar($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),orientation=prop($$props,"orientation",3,"vertical"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","orientation","children"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("flex touch-none p-px transition-colors select-none",orientation()==="vertical"&&
-"h-full w-2.5 border-l border-l-transparent",orientation()==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",$$props.class));component(node2,()=>Scroll_area_scrollbar$1,($$anchor2,ScrollAreaPrimitive_Scrollbar)=>{ScrollAreaPrimitive_Scrollbar($$anchor2,spread_props({"data-slot":"scroll-area-scrollbar",get orientation(){return orientation()},get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$U(),
-node_1=first_child(fragment_1);snippet(node_1,()=>$$props.children??noop$3);var node_2=sibling(node_1,2);component(node_2,()=>Scroll_area_thumb,($$anchor4,ScrollAreaPrimitive_Thumb)=>{ScrollAreaPrimitive_Thumb($$anchor4,{"data-slot":"scroll-area-thumb",class:"relative flex-1 rounded-full bg-border"})}),append($$anchor3,fragment_1)},$$slots:{default:!0}}))})}append($$anchor,fragment),pop()}var root_1$T=from_html("<!> <!> <!> <!>",1);function Scroll_area($$anchor,$$props){push$1($$props,!0);let ref2=prop(
-$$props,"ref",15,null),orientation=prop($$props,"orientation",3,"vertical"),scrollbarXClasses=prop($$props,"scrollbarXClasses",3,""),scrollbarYClasses=prop($$props,"scrollbarYClasses",3,""),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","orientation","scrollbarXClasses","scrollbarYClasses","children"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("relative",$$props.class));component(node2,()=>Scroll_area$1,($$anchor2,ScrollAreaPrimitive_Root)=>{
-ScrollAreaPrimitive_Root($$anchor2,spread_props({"data-slot":"scroll-area",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$T(),node_1=first_child(fragment_1);component(node_1,()=>Scroll_area_viewport,($$anchor4,ScrollAreaPrimitive_Viewport)=>{ScrollAreaPrimitive_Viewport($$anchor4,{"data-slot":"scroll-area-viewport",class:"size-full rounded-[inherit] ring-ring/10 outline-ring/50 transi\
-tion-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 dark:ring-ring/20 dark:outline-ring/40",children:($$anchor5,$$slotProps2)=>{var fragment_2=comment$2(),node_2=first_child(fragment_2);snippet(node_2,()=>$$props.children??noop$3),append($$anchor5,fragment_2)},$$slots:{default:!0}})});var node_3=sibling(node_1,2);{var consequent=$$anchor4=>{Scroll_area_scrollbar($$anchor4,{orientation:"vertical",get class(){return scrollbarYClasses()}})};if_block(node_3,$$render=>{(orientation()===
-"vertical"||orientation()==="both")&&$$render(consequent)})}var node_4=sibling(node_3,2);{var consequent_1=$$anchor4=>{Scroll_area_scrollbar($$anchor4,{orientation:"horizontal",get class(){return scrollbarXClasses()}})};if_block(node_4,$$render=>{(orientation()==="horizontal"||orientation()==="both")&&$$render(consequent_1)})}var node_5=sibling(node_4,2);component(node_5,()=>Scroll_area_corner,($$anchor4,ScrollAreaPrimitive_Corner)=>{ScrollAreaPrimitive_Corner($$anchor4,{})}),append($$anchor3,fragment_1)},
-$$slots:{default:!0}}))})}append($$anchor,fragment),pop()}var root_3$V=from_html('<tr><td colspan="3" class="p-8 text-center text-sm text-muted-foreground"><!></td></tr>'),root_7$s=from_html('<tr class="cursor-pointer border-b transition-colors hover:bg-muted/50"><td class="p-3"><!></td><td class="p-3 text-sm"><div class="max-w-[17rem] truncate"> </div></td><td class="p-3 text-sm text-muted-foreground"> </td></tr>'),root_2$15=from_html('<table class="w-full"><thead class="sticky top-0 z-10 bg-mu\
-ted"><tr class="border-b"><th class="w-12 p-3 text-left"><!></th><th class="p-3 text-left text-sm font-medium">Conversation Name</th><th class="w-32 p-3 text-left text-sm font-medium">Messages</th></tr></thead><tbody><!></tbody></table>'),root$1B=from_html('<div class="space-y-4"><!> <div class="flex items-center justify-between text-sm text-muted-foreground"><span> <!></span></div> <div class="overflow-hidden rounded-md border"><!></div> <div class="flex justify-end gap-2"><!> <!></div></div>');
-function ConversationSelection($$anchor,$$props){push$1($$props,!0);let messageCountMap=prop($$props,"messageCountMap",19,()=>new Map),searchQuery=state$1(""),selectedIds=state$1(getInitialSelectedIds()),lastClickedId=state$1(null);function getInitialSelectedIds(){return new SvelteSet($$props.conversations.map(c2=>c2.id))}let filteredConversations=user_derived(()=>$$props.conversations.filter(conv=>(conv.name||"Untitled conversation").toLowerCase().includes(get$3(searchQuery).toLowerCase()))),allSelected=user_derived(
-()=>get$3(filteredConversations).length>0&&get$3(filteredConversations).every(conv=>get$3(selectedIds).has(conv.id))),someSelected=user_derived(()=>get$3(filteredConversations).some(conv=>get$3(selectedIds).has(conv.id))&&!get$3(allSelected));function toggleConversation(id2,shiftKey=!1){const newSet=new SvelteSet(get$3(selectedIds));if(shiftKey&&get$3(lastClickedId)!==null){const lastIndex=get$3(filteredConversations).findIndex(c2=>c2.id===get$3(lastClickedId)),currentIndex=get$3(filteredConversations).
-findIndex(c2=>c2.id===id2);if(lastIndex!==-1&¤tIndex!==-1){const start2=Math.min(lastIndex,currentIndex),end=Math.max(lastIndex,currentIndex),shouldSelect=!newSet.has(id2);for(let i=start2;i<=end;i++)shouldSelect?newSet.add(get$3(filteredConversations)[i].id):newSet.delete(get$3(filteredConversations)[i].id);set$1(selectedIds,newSet);return}}newSet.has(id2)?newSet.delete(id2):newSet.add(id2),set$1(selectedIds,newSet),set$1(lastClickedId,id2,!0)}function toggleAll(){if(get$3(allSelected)){const newSet=new SvelteSet(
-get$3(selectedIds));get$3(filteredConversations).forEach(conv=>newSet.delete(conv.id)),set$1(selectedIds,newSet)}else{const newSet=new SvelteSet(get$3(selectedIds));get$3(filteredConversations).forEach(conv=>newSet.add(conv.id)),set$1(selectedIds,newSet)}}function handleConfirm(){const selected=$$props.conversations.filter(conv=>get$3(selectedIds).has(conv.id));$$props.onConfirm(selected)}function handleCancel(){set$1(selectedIds,getInitialSelectedIds()),set$1(searchQuery,""),set$1(lastClickedId,
-null),$$props.onCancel()}function reset$1(){set$1(selectedIds,getInitialSelectedIds()),set$1(searchQuery,""),set$1(lastClickedId,null)}var $$exports={reset:reset$1},div=root$1B(),node2=child(div);SearchInput(node2,{placeholder:"Search conversations...",get value(){return get$3(searchQuery)},set value($$value){set$1(searchQuery,$$value,!0)}});var div_1=sibling(node2,2),span=child(div_1),text2=child(span),node_1=sibling(text2);{var consequent=$$anchor2=>{var text_1=text$8();template_effect(()=>set_text(
-text_1,`(${get$3(filteredConversations).length??""} shown)`)),append($$anchor2,text_1)};if_block(node_1,$$render=>{get$3(searchQuery)&&$$render(consequent)})}reset(span),reset(div_1);var div_2=sibling(div_1,2),node_2=child(div_2);Scroll_area(node_2,{class:"h-[400px]",children:($$anchor2,$$slotProps)=>{var table2=root_2$15(),thead2=child(table2),tr2=child(thead2),th=child(tr2),node_3=child(th);Checkbox(node_3,{get checked(){return get$3(allSelected)},get indeterminate(){return get$3(someSelected)},
-onCheckedChange:toggleAll}),reset(th),next$1(2),reset(tr2),reset(thead2);var tbody2=sibling(thead2),node_4=child(tbody2);{var consequent_2=$$anchor3=>{var tr_1=root_3$V(),td=child(tr_1),node_5=child(td);{var consequent_1=$$anchor4=>{var text_2=text$8();template_effect(()=>set_text(text_2,`No conversations found matching "${get$3(searchQuery)??""}"`)),append($$anchor4,text_2)},alternate=$$anchor4=>{var text_3=text$8("No conversations available");append($$anchor4,text_3)};if_block(node_5,$$render=>{
-get$3(searchQuery)?$$render(consequent_1):$$render(alternate,-1)})}reset(td),reset(tr_1),append($$anchor3,tr_1)},alternate_1=$$anchor3=>{var fragment_2=comment$2(),node_6=first_child(fragment_2);each(node_6,17,()=>get$3(filteredConversations),conv=>conv.id,($$anchor4,conv)=>{var tr_2=root_7$s(),td_1=child(tr_2),node_7=child(td_1);{let $0=user_derived(()=>get$3(selectedIds).has(get$3(conv).id));Checkbox(node_7,{get checked(){return get$3($0)},onclick:event2=>{event2.preventDefault(),event2.stopPropagation(),
-toggleConversation(get$3(conv).id,event2.shiftKey)}})}reset(td_1);var td_2=sibling(td_1),div_3=child(td_2),text_4=child(div_3,!0);reset(div_3),reset(td_2);var td_3=sibling(td_2),text_5=child(td_3,!0);reset(td_3),reset(tr_2),template_effect($0=>{set_attribute(div_3,"title",get$3(conv).name||"Untitled conversation"),set_text(text_4,get$3(conv).name||"Untitled conversation"),set_text(text_5,$0)},[()=>messageCountMap().get(get$3(conv).id)??0]),delegated("click",tr_2,event2=>toggleConversation(get$3(
-conv).id,event2.shiftKey)),append($$anchor4,tr_2)}),append($$anchor3,fragment_2)};if_block(node_4,$$render=>{get$3(filteredConversations).length===0?$$render(consequent_2):$$render(alternate_1,-1)})}reset(tbody2),reset(table2),append($$anchor2,table2)},$$slots:{default:!0}}),reset(div_2);var div_4=sibling(div_2,2),node_8=child(div_4);Button(node_8,{variant:"outline",onclick:handleCancel,children:($$anchor2,$$slotProps)=>{next$1();var text_6=text$8("Cancel");append($$anchor2,text_6)},$$slots:{default:!0}});
-var node_9=sibling(node_8,2);{let $0=user_derived(()=>get$3(selectedIds).size===0);Button(node_9,{onclick:handleConfirm,get disabled(){return get$3($0)},children:($$anchor2,$$slotProps)=>{next$1();var text_7=text$8();template_effect(()=>set_text(text_7,`${$$props.mode==="export"?"Export":"Import"} (${get$3(selectedIds).size??""})`)),append($$anchor2,text_7)},$$slots:{default:!0}})}return reset(div_4),reset(div),template_effect(()=>set_text(text2,`${get$3(selectedIds).size??""} of ${$$props.conversations.
-length??""} selected `)),append($$anchor,div),pop($$exports)}delegate(["click"]);var root$1A=from_html('<div><button aria-label="Scroll left"><!></button> <div><!></div> <button aria-label="Scroll right"><!></button></div>');function HorizontalScrollCarousel($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),gapSize=prop($$props,"gapSize",3,"3"),canScrollLeft=state$1(!1),canScrollRight=state$1(!1),scrollContainer=state$1(void 0);function scrollLeft(event2){event2?.stopPropagation(),
-event2?.preventDefault(),get$3(scrollContainer)&&get$3(scrollContainer).scrollBy({left:get$3(scrollContainer).clientWidth*-.67,behavior:"smooth"})}function scrollRight(event2){event2?.stopPropagation(),event2?.preventDefault(),get$3(scrollContainer)&&get$3(scrollContainer).scrollBy({left:get$3(scrollContainer).clientWidth*.67,behavior:"smooth"})}function updateScrollButtons(){if(!get$3(scrollContainer))return;const{scrollLeft:scrollLeft2,scrollWidth,clientWidth}=get$3(scrollContainer);set$1(canScrollLeft,
-scrollLeft2>0),set$1(canScrollRight,scrollLeft2<scrollWidth-clientWidth-1);const isScrollable=scrollWidth>clientWidth;$$props.onScrollableChange?.(isScrollable)}function resetScroll(){get$3(scrollContainer)&&(get$3(scrollContainer).scrollLeft=0,setTimeout(()=>{updateScrollButtons()},0))}user_effect(()=>{get$3(scrollContainer)&&setTimeout(()=>{updateScrollButtons()},0)});var $$exports={resetScroll},div=root$1A(),button=child(div),node2=child(button);Chevron_left(node2,{class:"h-4 w-4"}),reset(button);
-var div_1=sibling(button,2),node_1=child(div_1);snippet(node_1,()=>$$props.children??noop$3),reset(div_1),bind_this(div_1,$$value=>set$1(scrollContainer,$$value),()=>get$3(scrollContainer));var button_1=sibling(div_1,2),node_2=child(button_1);return Chevron_right(node_2,{class:"h-4 w-4"}),reset(button_1),reset(div),template_effect(()=>{set_class(div,1,`relative ${className()??""}`),set_class(button,1,`absolute top-1/2 left-4 z-10 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-\
-full bg-background/25 shadow-md backdrop-blur-xs transition-opacity hover:bg-background/45 ${get$3(canScrollLeft)?"opacity-100":"pointer-events-none opacity-0"}`),set_class(div_1,1,`scrollbar-hide flex items-start gap-${gapSize()??""} overflow-x-auto`),set_class(button_1,1,`absolute top-1/2 right-4 z-10 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-full bg-background/25 shadow-md backdrop-blur-xs transition-opacity hover:bg-background/45 ${get$3(canScrollRight)?"opacity-100":
-"pointer-events-none opacity-0"}`)}),delegated("click",button,scrollLeft),event("scroll",div_1,updateScrollButtons),delegated("click",button_1,scrollRight),append($$anchor,div),pop($$exports)}delegate(["click"]);var root_3$U=from_html('<span class="block truncate"> </span>'),root_4$A=from_html("<p> </p>"),root_2$14=from_html("<!> <!>",1),root_5$w=from_html("<span> </span>");function TruncatedText($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),showTooltip=prop($$props,
-"showTooltip",3,!0),textElement=state$1(void 0),isTruncated=state$1(!1);function checkTruncation(){get$3(textElement)&&set$1(isTruncated,get$3(textElement).scrollWidth>get$3(textElement).clientWidth)}user_effect(()=>{if(get$3(textElement)){checkTruncation();const observer=new ResizeObserver(checkTruncation);return observer.observe(get$3(textElement)),()=>observer.disconnect()}});var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(
-fragment_1);component(node_1,()=>Root$5,($$anchor3,Tooltip_Root)=>{Tooltip_Root($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_2=root_2$14(),node_2=first_child(fragment_2);component(node_2,()=>Tooltip_trigger,($$anchor5,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor5,{get class(){return className()},children:($$anchor6,$$slotProps2)=>{var span=root_3$U(),text_1=child(span,!0);reset(span),bind_this(span,$$value=>set$1(textElement,$$value),()=>get$3(textElement)),template_effect(()=>set_text(
-text_1,$$props.text)),append($$anchor6,span)},$$slots:{default:!0}})});var node_3=sibling(node_2,2);component(node_3,()=>Tooltip_content,($$anchor5,Tooltip_Content)=>{Tooltip_Content($$anchor5,{class:"z-[9999]",children:($$anchor6,$$slotProps2)=>{var p2=root_4$A(),text_2=child(p2,!0);reset(p2),template_effect(()=>set_text(text_2,$$props.text)),append($$anchor6,p2)},$$slots:{default:!0}})}),append($$anchor4,fragment_2)},$$slots:{default:!0}})}),append($$anchor2,fragment_1)},alternate=$$anchor2=>{
-var span_1=root_5$w(),text_3=child(span_1,!0);reset(span_1),bind_this(span_1,$$value=>set$1(textElement,$$value),()=>get$3(textElement)),template_effect(()=>{set_class(span_1,1,`${className()??""} block truncate`),set_text(text_3,$$props.text)}),append($$anchor2,span_1)};if_block(node2,$$render=>{get$3(isTruncated)&&showTooltip()?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_3$T=from_html("<span>⌘</span>"),root_5$v=from_html("<span></span>"),root_1$S=from_html(
-"<!> <!>",1),root$1z=from_html("<kbd></kbd>");function KeyboardShortcutInfo($$anchor,$$props){push$1($$props,!0);let variant=prop($$props,"variant",3,"default"),className=prop($$props,"class",3,""),variantClasses=user_derived(()=>variant()==="destructive"?"text-destructive":"text-muted-foreground");var kbd=root$1z();each(kbd,21,()=>$$props.keys,index$2,($$anchor2,key2,index2)=>{var fragment=root_1$S(),node2=first_child(fragment);{var consequent=$$anchor3=>{{let $0=user_derived(()=>variant()==="d\
-estructive"?"text-destructive":"");Arrow_big_up($$anchor3,{get class(){return`h-1 w-1 ${get$3($0)??""} -mr-1`}})}},consequent_1=$$anchor3=>{var span=root_3$T();template_effect(()=>set_class(span,1,clsx(variant()==="destructive"?"text-destructive":""))),append($$anchor3,span)},alternate=$$anchor3=>{var text2=text$8();template_effect($0=>set_text(text2,$0),[()=>get$3(key2).toUpperCase()]),append($$anchor3,text2)};if_block(node2,$$render=>{get$3(key2)==="shift"?$$render(consequent):get$3(key2)==="c\
-md"?$$render(consequent_1,1):$$render(alternate,-1)})}var node_1=sibling(node2,2);{var consequent_2=$$anchor3=>{var span_1=root_5$v();append($$anchor3,span_1)};if_block(node_1,$$render=>{index2<$$props.keys.length-1&&$$render(consequent_2)})}append($$anchor2,fragment)}),reset(kbd),template_effect(()=>set_class(kbd,1,`px-1 pointer-events-none inline-flex select-none items-center gap-0.5 font-sans text-md font-medium opacity-0 transition-opacity -my-1 ${get$3(variantClasses)??""} ${className()??""}`)),
-append($$anchor,kbd),pop()}var root$1y=from_html('<div class="code-block-actions"><!> <!></div>');function CodeBlockActions($$anchor,$$props){push$1($$props,!0);let disabled=prop($$props,"disabled",3,!1);const showPreview=user_derived(()=>$$props.language?.toLowerCase()===FileTypeText.HTML);var div=root$1y(),node2=child(div);{let $0=user_derived(()=>!disabled()),$1=user_derived(()=>disabled()?"Code incomplete":"Copy code");ActionIconCopyToClipboard(node2,{get text(){return $$props.code},get canCopy(){
-return get$3($0)},get ariaLabel(){return get$3($1)}})}var node_1=sibling(node2,2);{var consequent=$$anchor2=>{{let $0=user_derived(()=>disabled()?"Code incomplete":"Preview code");ActionIcon($$anchor2,{get icon(){return Eye},get tooltip(){return get$3($0)},get disabled(){return disabled()},onclick:()=>$$props.onPreview($$props.code,$$props.language)})}};if_block(node_1,$$render=>{get$3(showPreview)&&$$render(consequent)})}reset(div),append($$anchor,div),pop()}var root_4$z=from_html('<img class="\
-h-12 w-12 object-cover"/>'),root_5$u=from_html('<div class="bg-foreground-muted/50 flex h-12 w-12 flex-col items-center justify-center gap-0.5 py-1"><!> <span class="font-mono text-[9px] text-white/60"> </span></div>'),root_3$S=from_html("<button><!></button>"),root_1$R=from_html('<div class="sticky bottom-0 z-10 mt-4 flex-shrink-0"><!></div>');function ChatAttachmentsPreviewThumbnailStrip($$anchor,$$props){push$1($$props,!0);function getFileExtension(name){const parts=name.split(".");return parts.
-length>1?parts.pop()?.toUpperCase()??"":""}var fragment=comment$2(),node2=first_child(fragment);{var consequent_2=$$anchor2=>{var div=root_1$R(),node_1=child(div);HorizontalScrollCarousel(node_1,{class:"max-w-full",children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_2=first_child(fragment_1);each(node_2,19,()=>$$props.items,item=>item.id,($$anchor4,item,index2)=>{var button=root_3$S(),node_3=child(button);{var consequent=$$anchor5=>{var img=root_4$z();template_effect(()=>{set_attribute(
-img,"src",get$3(item).preview),set_attribute(img,"alt",get$3(item).name)}),append($$anchor5,img)},alternate_1=$$anchor5=>{var div_1=root_5$u(),node_4=child(div_1);{var consequent_1=$$anchor6=>{Music($$anchor6,{class:"h-4 w-4 text-white/70"})},alternate=$$anchor6=>{File_text($$anchor6,{class:"h-4 w-4 text-white/70"})};if_block(node_4,$$render=>{get$3(item).isAudio?$$render(consequent_1):$$render(alternate,-1)})}var span=sibling(node_4,2),text2=child(span,!0);reset(span),reset(div_1),template_effect(
-$0=>set_text(text2,$0),[()=>getFileExtension(get$3(item).name)]),append($$anchor5,div_1)};if_block(node_3,$$render=>{get$3(item).isImage&&get$3(item).preview?$$render(consequent):$$render(alternate_1,-1)})}reset(button),template_effect(()=>{set_attribute(button,"data-thumbnail-index",get$3(index2)),set_class(button,1,clsx(["relative flex-shrink-0 cursor-pointer overflow-hidden rounded border-2 bg-black/80 backdrop-blur-sm transition-all hover:opacity-90",get$3(index2)===$$props.currentIndex?"bor\
-der-white":"border-transparent opacity-60","[&:not(:first-child)]:last:mr-4 [&:not(:last-child)]:first:ml-4"])),set_attribute(button,"aria-label",`Go to ${get$3(item).name}`)}),delegated("click",button,()=>$$props.onNavigate(get$3(index2))),append($$anchor4,button)}),append($$anchor3,fragment_1)},$$slots:{default:!0}}),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.items.length>1&&$$render(consequent_2)})}append($$anchor,fragment),pop()}delegate(["click"]);const alertVariants=tv(
-{base:"relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});var root$1x=from_html("<div><!></div>");function Alert($$anchor,$$props){
-push$1($$props,!0);let ref2=prop($$props,"ref",15,null),variant=prop($$props,"variant",3,"default"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","variant","children"]);var div=root$1x();attribute_effect(div,$0=>({"data-slot":"alert",class:$0,...restProps,role:"alert"}),[()=>cn$1(alertVariants({variant:variant()}),$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,
-div),pop()}var root$1w=from_html("<div><!></div>");function Alert_description($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$1w();attribute_effect(div,$0=>({"data-slot":"alert-description",class:$0,...restProps}),[()=>cn$1("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",$$props.class)]);var node2=child(div);snippet(node2,
-()=>$$props.children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}var root$1v=from_html("<div><!></div>");function Alert_title($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$1v();attribute_effect(div,$0=>({"data-slot":"alert-title",class:$0,...restProps}),[()=>cn$1("col-start-2 line-clamp-1 min-h-4 font-medium tracking\
--tight",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}class AudioRecorder{mediaRecorder=null;audioChunks=[];stream=null;recordingState=!1;async startRecording(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),this.initializeRecorder(this.stream),this.audioChunks=[],this.mediaRecorder.start(100),this.
-recordingState=!0}catch(error2){throw console.error("Failed to start recording:",error2),new Error("Failed to access microphone. Please check permissions.")}}async stopRecording(){return new Promise((resolve2,reject)=>{const recorder=this.mediaRecorder,chunks=this.audioChunks,stream=this.stream;if(!recorder||recorder.state==="inactive"){reject(new Error("No active recording to stop"));return}this.mediaRecorder=null,this.audioChunks=[],this.stream=null,this.recordingState=!1,recorder.onstop=()=>{
-const audioBlob=new Blob(chunks,{type:recorder.mimeType||MimeTypeAudio.WAV});if(stream)for(const track2 of stream.getTracks())track2.stop();resolve2(audioBlob)},recorder.onerror=event2=>{if(console.error("Recording error:",event2),stream)for(const track2 of stream.getTracks())track2.stop();reject(new Error("Recording failed"))},recorder.stop()})}isRecording(){return this.recordingState}cancelRecording(){const recorder=this.mediaRecorder,stream=this.stream;if(this.mediaRecorder=null,this.audioChunks=
-[],this.stream=null,this.recordingState=!1,recorder&&recorder.state!=="inactive"&&(recorder.onstop=null,recorder.onerror=null,recorder.stop()),stream)for(const track2 of stream.getTracks())track2.stop()}initializeRecorder(stream){const options={};MediaRecorder.isTypeSupported(MimeTypeAudio.WAV)?options.mimeType=MimeTypeAudio.WAV:MediaRecorder.isTypeSupported(MimeTypeAudio.WEBM_OPUS)?options.mimeType=MimeTypeAudio.WEBM_OPUS:MediaRecorder.isTypeSupported(MimeTypeAudio.WEBM)?options.mimeType=MimeTypeAudio.
-WEBM:MediaRecorder.isTypeSupported(MimeTypeAudio.MP4)?options.mimeType=MimeTypeAudio.MP4:console.warn("No preferred audio format supported, using default"),this.mediaRecorder=new MediaRecorder(stream,options),this.mediaRecorder.ondataavailable=event2=>{event2.data.size>0&&this.audioChunks.push(event2.data)},this.mediaRecorder.onstop=()=>{this.recordingState=!1},this.mediaRecorder.onerror=event2=>{console.error("MediaRecorder error:",event2),this.recordingState=!1}}}async function convertToWav(audioBlob){
-try{if(audioBlob.type.includes("wav"))return audioBlob;const arrayBuffer=await audioBlob.arrayBuffer(),audioContext=new(window.AudioContext||window.webkitAudioContext);try{const audioBuffer=await audioContext.decodeAudioData(arrayBuffer);return audioBufferToWav(audioBuffer)}finally{audioContext.close()}}catch(error2){return console.error("Failed to convert audio to WAV:",error2),audioBlob}}function audioBufferToWav(buffer){const length=buffer.length,numberOfChannels=buffer.numberOfChannels,sampleRate=buffer.
-sampleRate,blockAlign=numberOfChannels*2,byteRate=sampleRate*blockAlign,dataSize=length*blockAlign,bufferSize=44+dataSize,arrayBuffer=new ArrayBuffer(bufferSize),view=new DataView(arrayBuffer),writeString=(offset2,string2)=>{for(let i=0;i<string2.length;i++)view.setUint8(offset2+i,string2.charCodeAt(i))};writeString(0,"RIFF"),view.setUint32(4,bufferSize-8,!0),writeString(8,"WAVE"),writeString(12,"fmt "),view.setUint32(16,16,!0),view.setUint16(20,1,!0),view.setUint16(22,numberOfChannels,!0),view.
-setUint32(24,sampleRate,!0),view.setUint32(28,byteRate,!0),view.setUint16(32,blockAlign,!0),view.setUint16(34,16,!0),writeString(36,"data"),view.setUint32(40,dataSize,!0);const channels=new Array(numberOfChannels);for(let c2=0;c2<numberOfChannels;c2++)channels[c2]=buffer.getChannelData(c2);const pcm=new Int16Array(arrayBuffer,44,length*numberOfChannels);let p2=0;for(let i=0;i<length;i++)for(let c2=0;c2<numberOfChannels;c2++){let s2=channels[c2][i];s2>1?s2=1:s2<-1&&(s2=-1),pcm[p2++]=s2*32767}return new Blob(
-[arrayBuffer],{type:MimeTypeAudio.WAV})}function createAudioFile(audioBlob,filename){const timestamp=new Date().toISOString().replace(/[:.]/g,"-"),extension2=audioBlob.type.includes("wav")?"wav":"mp3",defaultFilename=`recording-${timestamp}.${extension2}`;return new File([audioBlob],defaultFilename,{type:audioBlob.type,lastModified:Date.now()})}function isAudioRecordingSupported(){return!!(typeof navigator<"u"&&navigator.mediaDevices&&typeof navigator.mediaDevices.getUserMedia=="function"&&typeof window<
-"u"&&window.MediaRecorder)}const isNodeJS=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],LINE_FACTOR=1.35,RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},AnnotationEditorPrefix="pdfjs_internal_edito\
-r_",AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101,COMMENT:102},AnnotationEditorParamsType={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},
-TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},util_ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,
-INSET:4,UNDERLINE:5},VerbosityLevel={ERRORS:0,WARNINGS:1,INFOS:5},OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,
-setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,
-beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,
-paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},DrawOPS={moveTo:0,lineTo:1,curveTo:2,closePath:3},PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let verbosity=VerbosityLevel.WARNINGS;function setVerbosityLevel(level){Number.isInteger(level)&&(verbosity=level)}function getVerbosityLevel(){return verbosity}function info(msg){verbosity>=VerbosityLevel.INFOS&&console.log(`Info: ${msg}`)}function warn(msg){verbosity>=VerbosityLevel.
-WARNINGS&&console.log(`Warning: ${msg}`)}function unreachable(msg){throw new Error(msg)}function assert$1(cond,msg){cond||unreachable(msg)}function _isValidProtocol(url2){switch(url2?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function createValidAbsoluteUrl(url2,baseUrl=null,options=null){if(!url2)return null;if(options&&typeof url2=="string"&&(options.addDefaultProtocol&&url2.startsWith("www.")&&url2.match(/\./g)?.length>=2&&(url2=`http://${url2}`),
-options.tryConvertEncoding))try{url2=stringToUTF8String(url2)}catch{}const absoluteUrl=baseUrl?URL.parse(url2,baseUrl):URL.parse(url2);return _isValidProtocol(absoluteUrl)?absoluteUrl:null}function updateUrlHash(url2,hash2,allowRel=!1){const res=URL.parse(url2);return res?(res.hash=hash2,res.href):allowRel&&createValidAbsoluteUrl(url2,"http://example.com")?url2.split("#",1)[0]+`${hash2?`#${hash2}`:""}`:""}function shadow(obj,prop2,value,nonSerializable=!1){return Object.defineProperty(obj,prop2,
-{value,enumerable:!nonSerializable,configurable:!0,writable:!1}),value}const BaseException=(function(){function BaseException2(message,name){this.message=message,this.name=name}return BaseException2.prototype=new Error,BaseException2.constructor=BaseException2,BaseException2})();class PasswordException extends BaseException{constructor(msg,code2){super(msg,"PasswordException"),this.code=code2}}class UnknownErrorException extends BaseException{constructor(msg,details){super(msg,"UnknownErrorExcep\
-tion"),this.details=details}}class InvalidPDFException extends BaseException{constructor(msg){super(msg,"InvalidPDFException")}}class ResponseException extends BaseException{constructor(msg,status,missing){super(msg,"ResponseException"),this.status=status,this.missing=missing}}class FormatError extends BaseException{constructor(msg){super(msg,"FormatError")}}class AbortException extends BaseException{constructor(msg){super(msg,"AbortException")}}function bytesToString(bytes){(typeof bytes!="obje\
-ct"||bytes?.length===void 0)&&unreachable("Invalid argument for bytesToString");const length=bytes.length,MAX_ARGUMENT_COUNT=8192;if(length<MAX_ARGUMENT_COUNT)return String.fromCharCode.apply(null,bytes);const strBuf=[];for(let i=0;i<length;i+=MAX_ARGUMENT_COUNT){const chunkEnd=Math.min(i+MAX_ARGUMENT_COUNT,length),chunk=bytes.subarray(i,chunkEnd);strBuf.push(String.fromCharCode.apply(null,chunk))}return strBuf.join("")}function stringToBytes(str){typeof str!="string"&&unreachable("Invalid argum\
-ent for stringToBytes");const length=str.length,bytes=new Uint8Array(length);for(let i=0;i<length;++i)bytes[i]=str.charCodeAt(i)&255;return bytes}function string32(value){return String.fromCharCode(value>>24&255,value>>16&255,value>>8&255,value&255)}function isLittleEndian(){const buffer8=new Uint8Array(4);return buffer8[0]=1,new Uint32Array(buffer8.buffer,0,1)[0]===1}function isEvalSupported(){try{return new Function(""),!0}catch{return!1}}class util_FeatureTest{static get isLittleEndian(){return shadow(
-this,"isLittleEndian",isLittleEndian())}static get isEvalSupported(){return shadow(this,"isEvalSupported",isEvalSupported())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return shadow(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){const{platform:platform2,userAgent}=navigator;return shadow(this,"platform",{isAndroid:userAgent.includes("Android"),isLinux:platform2.
-includes("Linux"),isMac:platform2.includes("Mac"),isWindows:platform2.includes("Win"),isFirefox:userAgent.includes("Firefox")})}static get isCSSRoundSupported(){return shadow(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const hexNumbers=Array.from(Array(256).keys(),n=>n.toString(16).padStart(2,"0"));class Util{static makeHexColor(r2,g,b){return`#${hexNumbers[r2]}${hexNumbers[g]}${hexNumbers[b]}`}static scaleMinMax(transform2,minMax){let temp;transform2[0]?(transform2[0]<
-0&&(temp=minMax[0],minMax[0]=minMax[2],minMax[2]=temp),minMax[0]*=transform2[0],minMax[2]*=transform2[0],transform2[3]<0&&(temp=minMax[1],minMax[1]=minMax[3],minMax[3]=temp),minMax[1]*=transform2[3],minMax[3]*=transform2[3]):(temp=minMax[0],minMax[0]=minMax[1],minMax[1]=temp,temp=minMax[2],minMax[2]=minMax[3],minMax[3]=temp,transform2[1]<0&&(temp=minMax[1],minMax[1]=minMax[3],minMax[3]=temp),minMax[1]*=transform2[1],minMax[3]*=transform2[1],transform2[2]<0&&(temp=minMax[0],minMax[0]=minMax[2],minMax[2]=
-temp),minMax[0]*=transform2[2],minMax[2]*=transform2[2]),minMax[0]+=transform2[4],minMax[1]+=transform2[5],minMax[2]+=transform2[4],minMax[3]+=transform2[5]}static transform(m1,m2){return[m1[0]*m2[0]+m1[2]*m2[1],m1[1]*m2[0]+m1[3]*m2[1],m1[0]*m2[2]+m1[2]*m2[3],m1[1]*m2[2]+m1[3]*m2[3],m1[0]*m2[4]+m1[2]*m2[5]+m1[4],m1[1]*m2[4]+m1[3]*m2[5]+m1[5]]}static applyTransform(p2,m,pos=0){const p0=p2[pos],p1=p2[pos+1];p2[pos]=p0*m[0]+p1*m[2]+m[4],p2[pos+1]=p0*m[1]+p1*m[3]+m[5]}static applyTransformToBezier(p2,transform2,pos=0){
-const m0=transform2[0],m1=transform2[1],m2=transform2[2],m3=transform2[3],m4=transform2[4],m5=transform2[5];for(let i=0;i<6;i+=2){const pI=p2[pos+i],pI1=p2[pos+i+1];p2[pos+i]=pI*m0+pI1*m2+m4,p2[pos+i+1]=pI*m1+pI1*m3+m5}}static applyInverseTransform(p2,m){const p0=p2[0],p1=p2[1],d2=m[0]*m[3]-m[1]*m[2];p2[0]=(p0*m[3]-p1*m[2]+m[2]*m[5]-m[4]*m[3])/d2,p2[1]=(-p0*m[1]+p1*m[0]+m[4]*m[1]-m[5]*m[0])/d2}static axialAlignedBoundingBox(rect,transform2,output){const m0=transform2[0],m1=transform2[1],m2=transform2[2],
-m3=transform2[3],m4=transform2[4],m5=transform2[5],r0=rect[0],r1=rect[1],r2=rect[2],r3=rect[3];let a0=m0*r0+m4,a2=a0,a1=m0*r2+m4,a3=a1,b0=m3*r1+m5,b2=b0,b1=m3*r3+m5,b3=b1;if(m1!==0||m2!==0){const m1r0=m1*r0,m1r2=m1*r2,m2r1=m2*r1,m2r3=m2*r3;a0+=m2r1,a3+=m2r1,a1+=m2r3,a2+=m2r3,b0+=m1r0,b3+=m1r0,b1+=m1r2,b2+=m1r2}output[0]=Math.min(output[0],a0,a1,a2,a3),output[1]=Math.min(output[1],b0,b1,b2,b3),output[2]=Math.max(output[2],a0,a1,a2,a3),output[3]=Math.max(output[3],b0,b1,b2,b3)}static inverseTransform(m){
-const d2=m[0]*m[3]-m[1]*m[2];return[m[3]/d2,-m[1]/d2,-m[2]/d2,m[0]/d2,(m[2]*m[5]-m[4]*m[3])/d2,(m[4]*m[1]-m[5]*m[0])/d2]}static singularValueDecompose2dScale(matrix,output){const m0=matrix[0],m1=matrix[1],m2=matrix[2],m3=matrix[3],a=m0**2+m1**2,b=m0*m2+m1*m3,c2=m2**2+m3**2,first=(a+c2)/2,second=Math.sqrt(first**2-(a*c2-b**2));output[0]=Math.sqrt(first+second||1),output[1]=Math.sqrt(first-second||1)}static normalizeRect(rect){const r2=rect.slice(0);return rect[0]>rect[2]&&(r2[0]=rect[2],r2[2]=rect[0]),
-rect[1]>rect[3]&&(r2[1]=rect[3],r2[3]=rect[1]),r2}static intersect(rect1,rect2){const xLow=Math.max(Math.min(rect1[0],rect1[2]),Math.min(rect2[0],rect2[2])),xHigh=Math.min(Math.max(rect1[0],rect1[2]),Math.max(rect2[0],rect2[2]));if(xLow>xHigh)return null;const yLow=Math.max(Math.min(rect1[1],rect1[3]),Math.min(rect2[1],rect2[3])),yHigh=Math.min(Math.max(rect1[1],rect1[3]),Math.max(rect2[1],rect2[3]));return yLow>yHigh?null:[xLow,yLow,xHigh,yHigh]}static pointBoundingBox(x,y,minMax){minMax[0]=Math.
-min(minMax[0],x),minMax[1]=Math.min(minMax[1],y),minMax[2]=Math.max(minMax[2],x),minMax[3]=Math.max(minMax[3],y)}static rectBoundingBox(x0,y0,x1,y1,minMax){minMax[0]=Math.min(minMax[0],x0,x1),minMax[1]=Math.min(minMax[1],y0,y1),minMax[2]=Math.max(minMax[2],x0,x1),minMax[3]=Math.max(minMax[3],y0,y1)}static#getExtremumOnCurve(x0,x1,x2,x3,y0,y1,y2,y3,t,minMax){if(t<=0||t>=1)return;const mt=1-t,tt=t*t,ttt=tt*t,x=mt*(mt*(mt*x0+3*t*x1)+3*tt*x2)+ttt*x3,y=mt*(mt*(mt*y0+3*t*y1)+3*tt*y2)+ttt*y3;minMax[0]=
-Math.min(minMax[0],x),minMax[1]=Math.min(minMax[1],y),minMax[2]=Math.max(minMax[2],x),minMax[3]=Math.max(minMax[3],y)}static#getExtremum(x0,x1,x2,x3,y0,y1,y2,y3,a,b,c2,minMax){if(Math.abs(a)<1e-12){Math.abs(b)>=1e-12&&this.#getExtremumOnCurve(x0,x1,x2,x3,y0,y1,y2,y3,-c2/b,minMax);return}const delta=b**2-4*c2*a;if(delta<0)return;const sqrtDelta=Math.sqrt(delta),a2=2*a;this.#getExtremumOnCurve(x0,x1,x2,x3,y0,y1,y2,y3,(-b+sqrtDelta)/a2,minMax),this.#getExtremumOnCurve(x0,x1,x2,x3,y0,y1,y2,y3,(-b-sqrtDelta)/
-a2,minMax)}static bezierBoundingBox(x0,y0,x1,y1,x2,y2,x3,y3,minMax){minMax[0]=Math.min(minMax[0],x0,x3),minMax[1]=Math.min(minMax[1],y0,y3),minMax[2]=Math.max(minMax[2],x0,x3),minMax[3]=Math.max(minMax[3],y0,y3),this.#getExtremum(x0,x1,x2,x3,y0,y1,y2,y3,3*(-x0+3*(x1-x2)+x3),6*(x0-2*x1+x2),3*(x1-x0),minMax),this.#getExtremum(x0,x1,x2,x3,y0,y1,y2,y3,3*(-y0+3*(y1-y2)+y3),6*(y0-2*y1+y2),3*(y1-y0),minMax)}}function stringToUTF8String(str){return decodeURIComponent(escape(str))}let NormalizeRegex=null,
-NormalizationMap=null;function normalizeUnicode(str){return NormalizeRegex||(NormalizeRegex=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,NormalizationMap=new Map([["ſt","ſt"]])),str.replaceAll(NormalizeRegex,(_,p1,p2)=>p1?
-p1.normalize("NFKC"):NormalizationMap.get(p2))}function getUuid(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const buf=new Uint8Array(32);return crypto.getRandomValues(buf),bytesToString(buf)}const AnnotationPrefix="pdfjs_internal_id_";function _isValidExplicitDest(validRef,validName,dest){if(!Array.isArray(dest)||dest.length<2)return!1;const[page2,zoom,...args]=dest;if(!validRef(page2)&&!Number.isInteger(page2)||!validName(zoom))return!1;const argsLen=args.length;let allowNull=!0;
-switch(zoom.name){case"XYZ":if(argsLen<2||argsLen>3)return!1;break;case"Fit":case"FitB":return argsLen===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(argsLen>1)return!1;break;case"FitR":if(argsLen!==4)return!1;allowNull=!1;break;default:return!1}for(const arg of args)if(!(typeof arg=="number"||allowNull&&arg===null))return!1;return!0}function MathClamp(v,min2,max2){return Math.min(Math.max(v,min2),max2)}function toBase64Util(arr){return Uint8Array.prototype.toBase64?arr.toBase64():btoa(bytesToString(
-arr))}function fromBase64Util(str){return Uint8Array.fromBase64?Uint8Array.fromBase64(str):stringToBytes(atob(str))}typeof Promise.try!="function"&&(Promise.try=function(fn,...args){return new Promise(resolve2=>{resolve2(fn(...args))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(numbers){return numbers.reduce((a,b)=>a+b,0)});const SVG_NS="http://www.w3.org/2000/svg";class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function fetchData(url2,type2="\
-text"){if(isValidFetchUrl(url2,document.baseURI)){const response=await fetch(url2);if(!response.ok)throw new Error(response.statusText);switch(type2){case"arraybuffer":return response.arrayBuffer();case"blob":return response.blob();case"json":return response.json()}return response.text()}return new Promise((resolve2,reject)=>{const request=new XMLHttpRequest;request.open("GET",url2,!0),request.responseType=type2,request.onreadystatechange=()=>{if(request.readyState===XMLHttpRequest.DONE){if(request.
-status===200||request.status===0){switch(type2){case"arraybuffer":case"blob":case"json":resolve2(request.response);return}resolve2(request.responseText);return}reject(new Error(request.statusText))}},request.send(null)})}class PageViewport{constructor({viewBox,userUnit,scale:scale2,rotation,offsetX=0,offsetY=0,dontFlip=!1}){this.viewBox=viewBox,this.userUnit=userUnit,this.scale=scale2,this.rotation=rotation,this.offsetX=offsetX,this.offsetY=offsetY,scale2*=userUnit;const centerX=(viewBox[2]+viewBox[0])/
-2,centerY=(viewBox[3]+viewBox[1])/2;let rotateA,rotateB,rotateC,rotateD;switch(rotation%=360,rotation<0&&(rotation+=360),rotation){case 180:rotateA=-1,rotateB=0,rotateC=0,rotateD=1;break;case 90:rotateA=0,rotateB=1,rotateC=1,rotateD=0;break;case 270:rotateA=0,rotateB=-1,rotateC=-1,rotateD=0;break;case 0:rotateA=1,rotateB=0,rotateC=0,rotateD=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}dontFlip&&(rotateC=-rotateC,rotateD=-rotateD);let offsetCanvasX,
-offsetCanvasY,width,height;rotateA===0?(offsetCanvasX=Math.abs(centerY-viewBox[1])*scale2+offsetX,offsetCanvasY=Math.abs(centerX-viewBox[0])*scale2+offsetY,width=(viewBox[3]-viewBox[1])*scale2,height=(viewBox[2]-viewBox[0])*scale2):(offsetCanvasX=Math.abs(centerX-viewBox[0])*scale2+offsetX,offsetCanvasY=Math.abs(centerY-viewBox[1])*scale2+offsetY,width=(viewBox[2]-viewBox[0])*scale2,height=(viewBox[3]-viewBox[1])*scale2),this.transform=[rotateA*scale2,rotateB*scale2,rotateC*scale2,rotateD*scale2,
-offsetCanvasX-rotateA*scale2*centerX-rotateC*scale2*centerY,offsetCanvasY-rotateB*scale2*centerX-rotateD*scale2*centerY],this.width=width,this.height=height}get rawDims(){const dims=this.viewBox;return shadow(this,"rawDims",{pageWidth:dims[2]-dims[0],pageHeight:dims[3]-dims[1],pageX:dims[0],pageY:dims[1]})}clone({scale:scale2=this.scale,rotation=this.rotation,offsetX=this.offsetX,offsetY=this.offsetY,dontFlip=!1}={}){return new PageViewport({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:scale2,
-rotation,offsetX,offsetY,dontFlip})}convertToViewportPoint(x,y){const p2=[x,y];return Util.applyTransform(p2,this.transform),p2}convertToViewportRectangle(rect){const topLeft=[rect[0],rect[1]];Util.applyTransform(topLeft,this.transform);const bottomRight=[rect[2],rect[3]];return Util.applyTransform(bottomRight,this.transform),[topLeft[0],topLeft[1],bottomRight[0],bottomRight[1]]}convertToPdfPoint(x,y){const p2=[x,y];return Util.applyInverseTransform(p2,this.transform),p2}}class RenderingCancelledException extends BaseException{constructor(msg,extraDelay=0){
-super(msg,"RenderingCancelledException"),this.extraDelay=extraDelay}}function isDataScheme(url2){const ii=url2.length;let i=0;for(;i<ii&&url2[i].trim()==="";)i++;return url2.substring(i,i+5).toLowerCase()==="data:"}function isPdfFile(filename){return typeof filename=="string"&&/\.pdf$/i.test(filename)}function getFilenameFromUrl(url2){return[url2]=url2.split(/[#?]/,1),url2.substring(url2.lastIndexOf("/")+1)}function getPdfFilenameFromUrl(url2,defaultFilename="document.pdf"){if(typeof url2!="stri\
-ng")return defaultFilename;if(isDataScheme(url2))return warn('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),defaultFilename;const newURL=(urlString=>{try{return new URL(urlString)}catch{try{return new URL(decodeURIComponent(urlString))}catch{try{return new URL(urlString,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(urlString),"https://foo.bar")}catch{return null}}}}})(url2);if(!newURL)return defaultFilename;const decode2=name=>{try{let decoded=decodeURIComponent(
-name);return decoded.includes("/")?(decoded=decoded.split("/").at(-1),decoded.test(/^\.pdf$/i)?decoded:name):decoded}catch{return name}},pdfRegex=/\.pdf$/i,filename=newURL.pathname.split("/").at(-1);if(pdfRegex.test(filename))return decode2(filename);if(newURL.searchParams.size>0){const values=Array.from(newURL.searchParams.values()).reverse();for(const value of values)if(pdfRegex.test(value))return decode2(value);const keys2=Array.from(newURL.searchParams.keys()).reverse();for(const key2 of keys2)
-if(pdfRegex.test(key2))return decode2(key2)}if(newURL.hash){const hashFilename=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(newURL.hash);if(hashFilename)return decode2(hashFilename[0])}return defaultFilename}class StatTimer{started=Object.create(null);times=[];time(name){name in this.started&&warn(`Timer is already running for ${name}`),this.started[name]=Date.now()}timeEnd(name){name in this.started||warn(`Timer has not been started for ${name}`),this.times.push({name,start:this.started[name],end:Date.
-now()}),delete this.started[name]}toString(){const outBuf=[];let longest=0;for(const{name}of this.times)longest=Math.max(name.length,longest);for(const{name,start:start2,end}of this.times)outBuf.push(`${name.padEnd(longest)} ${end-start2}ms
+icon.src)||icon.mimeType&&!MCP_ALLOWED_ICON_MIME_TYPES.has(icon.mimeType)));if(validIcons.length===0)return null;const preferredTheme=isDark?ColorMode.DARK:ColorMode.LIGHT,themedIcon=validIcons.find(icon=>icon.theme===preferredTheme);if(themedIcon)return themedIcon.src;const universalIcons=validIcons.filter(icon=>!icon.theme);return universalIcons.length===EXPECTED_THEMED_ICON_PAIR_COUNT?universalIcons[isDark?1:0].src:universalIcons.length>0?universalIcons[0].src:validIcons[0].src}getServerFavicon(serverId){
+const server=this.getServerById(serverId);if(!server)return null;const isDark=derivedMode.current===ColorMode.DARK,healthState=this.getHealthCheckState(serverId);if(healthState.status===HealthCheckStatus.SUCCESS&&healthState.serverInfo?.icons){const mcpIconUrl=this.#getMcpIconUrl(healthState.serverInfo.icons,isDark);if(mcpIconUrl)return mcpIconUrl}const fallbackUrl=this.#getServerFaviconFallback(server.url);return fallbackUrl||null}#getServerFaviconFallback(serverUrl){try{const url2=new URL(serverUrl),
+rootDomain=extractRootDomain(url2);if(!rootDomain)return null;const origin2=`${url2.protocol}//${rootDomain}`,candidates=["favicon.ico","favicon.svg","favicon.png"];for(const path2 of candidates){const faviconUrl=`${origin2}/${path2}`;if(this.#isValidIconUri(faviconUrl))return faviconUrl}}catch{}return null}isAnyServerLoading(){return this.getServers().some(s2=>{const state2=this.getHealthCheckState(s2.id);return state2.status===HealthCheckStatus.IDLE||state2.status===HealthCheckStatus.CONNECTING})}getServersSorted(){
+const servers=this.getServers();return this.isAnyServerLoading()?servers:[...servers].sort((a,b)=>this.getServerLabel(a).localeCompare(this.getServerLabel(b)))}addServer(serverData){const servers=this.getServers(),newServer={id:serverData.id||(uuid$1()??`server-${Date.now()}`),enabled:serverData.enabled,url:serverData.url.trim(),name:serverData.name,headers:serverData.headers?.trim()||void 0,requestTimeoutSeconds:DEFAULT_MCP_CONFIG.requestTimeoutSeconds,useProxy:serverData.useProxy};settingsStore.
+updateConfig("mcpServers",JSON.stringify([...servers,newServer]))}updateServer(id2,updates){const servers=this.getServers();settingsStore.updateConfig("mcpServers",JSON.stringify(servers.map(server=>server.id===id2?{...server,...updates}:server)))}removeServer(id2){const servers=this.getServers();settingsStore.updateConfig("mcpServers",JSON.stringify(servers.filter(s2=>s2.id!==id2))),this.clearHealthCheck(id2)}hasAvailableServers(){return parseMcpServerSettings(config$1().mcpServers).some(s2=>s2.
+enabled&&s2.url.trim())}hasEnabledServers(perChatOverrides){return!!this.#buildMcpClientConfig(config$1(),perChatOverrides)}getEnabledServersForConversation(perChatOverrides){return this.getServers().filter(server=>this.#checkServerEnabled(server,perChatOverrides))}async ensureInitialized(perChatOverrides){const mcpConfig=this.#buildMcpClientConfig(config$1(),perChatOverrides),signature=mcpConfig?JSON.stringify(mcpConfig):null;return signature?this.isInitialized&&this.configSignature===signature?
+!0:this.initPromise&&this.configSignature===signature?this.initPromise:((this.connections.size>0||this.initPromise)&&await this.shutdown(),this.initialize(signature,mcpConfig)):(await this.shutdown(),!1)}async initialize(signature,mcpConfig){this.updateState({isInitializing:!0,error:null}),this.configSignature=signature;const serverEntries=Object.entries(mcpConfig.servers);return serverEntries.length===0?(this.updateState({isInitializing:!1,toolCount:0,connectedServers:[]}),!1):(this.initPromise=
+this.doInitialize(signature,mcpConfig,serverEntries),this.initPromise)}async doInitialize(signature,mcpConfig,serverEntries){const clientInfo=mcpConfig.clientInfo??DEFAULT_MCP_CONFIG.clientInfo,capabilities=mcpConfig.capabilities??DEFAULT_MCP_CONFIG.capabilities,results=await Promise.allSettled(serverEntries.map(async([name,serverConfig])=>{this.serverConfigs.set(name,serverConfig);const listChangedHandlers=this.createListChangedHandlers(name),connection=await MCPService.connect(name,serverConfig,
+clientInfo,capabilities,phase=>{phase===MCPConnectionPhase.DISCONNECTED&&(console.log(`[MCPStore][${name}] Connection lost, starting auto-reconnect`),this.autoReconnect(name))},listChangedHandlers);return{name,connection}}));if(this.configSignature!==signature){for(const result of results)result.status==="fulfilled"&&await MCPService.disconnect(result.value.connection).catch(console.warn);return!1}for(const result of results)if(result.status==="fulfilled"){const{name,connection}=result.value;this.
+connections.set(name,connection);for(const tool of connection.tools)this.toolsIndex.has(tool.name)&&console.warn(`[MCPStore] Tool name conflict: "${tool.name}" exists in "${this.toolsIndex.get(tool.name)}" and "${name}". Using tool from "${name}".`),this.toolsIndex.set(tool.name,name)}else console.error("[MCPStore] Failed to connect:",result.reason);return this.connections.size===0&&serverEntries.length>0?(this.updateState({isInitializing:!1,error:"All MCP server connections failed",toolCount:0,
+connectedServers:[]}),this.initPromise=null,!1):(this.updateState({isInitializing:!1,error:null,toolCount:this.toolsIndex.size,connectedServers:Array.from(this.connections.keys())}),this.initPromise=null,!0)}createListChangedHandlers(serverName){return{tools:{onChanged:(error2,tools)=>{if(error2){console.warn(`[MCPStore][${serverName}] Tools list changed error:`,error2);return}this.handleToolsListChanged(serverName,tools??[])}},prompts:{onChanged:error2=>{if(error2){console.warn(`[MCPStore][${serverName}\
+] Prompts list changed error:`,error2);return}}}}}handleToolsListChanged(serverName,tools){const connection=this.connections.get(serverName);if(connection){for(const[toolName,ownerServer]of this.toolsIndex.entries())ownerServer===serverName&&this.toolsIndex.delete(toolName);connection.tools=tools;for(const tool of tools)this.toolsIndex.has(tool.name)&&console.warn(`[MCPStore] Tool name conflict after list change: "${tool.name}" exists in "${this.toolsIndex.get(tool.name)}" and "${serverName}". U\
+sing tool from "${serverName}".`),this.toolsIndex.set(tool.name,serverName);this.updateState({toolCount:this.toolsIndex.size})}}acquireConnection(){this.activeFlowCount++}async releaseConnection(shutdownIfUnused=!1){this.activeFlowCount=Math.max(0,this.activeFlowCount-1),shutdownIfUnused&&this.activeFlowCount===0&&await this.shutdown()}getActiveFlowCount(){return this.activeFlowCount}async shutdown(){this.initPromise&&(await this.initPromise.catch(()=>{}),this.initPromise=null),this.connections.
+size!==0&&(await Promise.all(Array.from(this.connections.values()).map(conn=>MCPService.disconnect(conn).catch(error2=>console.warn(`[MCPStore] Error disconnecting ${conn.serverName}:`,error2)))),this.connections.clear(),this.toolsIndex.clear(),this.serverConfigs.clear(),this.configSignature=null,this.updateState({isInitializing:!1,error:null,toolCount:0,connectedServers:[]}))}async reconnectServer(serverName){const serverConfig=this.serverConfigs.get(serverName);if(!serverConfig)throw new Error(
+`[MCPStore] No config found for ${serverName}, cannot reconnect`);const oldConnection=this.connections.get(serverName);oldConnection&&(await MCPService.disconnect(oldConnection).catch(console.warn),this.connections.delete(serverName)),console.log(`[MCPStore][${serverName}] Session expired, reconnecting with fresh session...`);const listChangedHandlers=this.createListChangedHandlers(serverName),connection=await MCPService.connect(serverName,serverConfig,DEFAULT_MCP_CONFIG.clientInfo,DEFAULT_MCP_CONFIG.
+capabilities,phase=>{phase===MCPConnectionPhase.DISCONNECTED&&(console.log(`[MCPStore][${serverName}] Connection lost, starting auto-reconnect`),this.autoReconnect(serverName))},listChangedHandlers);this.connections.set(serverName,connection);for(const tool of connection.tools)this.toolsIndex.set(tool.name,serverName);console.log(`[MCPStore][${serverName}] Session recovered successfully`)}async autoReconnect(serverName){if(this.reconnectingServers.has(serverName)){console.log(`[MCPStore][${serverName}\
+] Reconnection already in progress, skipping`);return}const serverConfig=this.serverConfigs.get(serverName);if(!serverConfig){console.error(`[MCPStore] No config found for ${serverName}, cannot reconnect`);return}this.reconnectingServers.add(serverName);let backoff=MCP_RECONNECT_INITIAL_DELAY,needsReconnect=!1;try{for(;;){await new Promise(resolve2=>setTimeout(resolve2,backoff)),console.log(`[MCPStore][${serverName}] Auto-reconnecting...`);try{const timeoutPromise=new Promise((_,reject)=>setTimeout(
+()=>reject(new Error(`Reconnect attempt timed out after ${MCP_RECONNECT_ATTEMPT_TIMEOUT_MS}ms`)),MCP_RECONNECT_ATTEMPT_TIMEOUT_MS));needsReconnect=!1;const listChangedHandlers=this.createListChangedHandlers(serverName),connectPromise=MCPService.connect(serverName,serverConfig,DEFAULT_MCP_CONFIG.clientInfo,DEFAULT_MCP_CONFIG.capabilities,phase=>{phase===MCPConnectionPhase.DISCONNECTED&&(this.reconnectingServers.has(serverName)?needsReconnect=!0:(console.log(`[MCPStore][${serverName}] Connection l\
+ost, restarting auto-reconnect`),this.autoReconnect(serverName)))},listChangedHandlers),connection=await Promise.race([connectPromise,timeoutPromise]);this.connections.set(serverName,connection);for(const tool of connection.tools)this.toolsIndex.set(tool.name,serverName);console.log(`[MCPStore][${serverName}] Reconnected successfully`);break}catch(error2){console.warn(`[MCPStore][${serverName}] Reconnection failed:`,error2),backoff=Math.min(backoff*MCP_RECONNECT_BACKOFF_MULTIPLIER,MCP_RECONNECT_MAX_DELAY)}}}finally{
+this.reconnectingServers.delete(serverName),needsReconnect&&(console.log(`[MCPStore][${serverName}] Deferred disconnect detected, restarting auto-reconnect`),this.autoReconnect(serverName))}}getToolDefinitionsForLLM(){const tools=[];for(const connection of this.connections.values())for(const tool of connection.tools){const rawSchema=tool.inputSchema??{type:JsonSchemaType.OBJECT,properties:{},required:[]};tools.push({type:ToolCallType.FUNCTION,function:{name:tool.name,description:tool.description,
+parameters:this.normalizeSchemaProperties(rawSchema)}})}return tools}normalizeSchemaProperties(schema){if(!schema||typeof schema!="object")return schema;const normalized={...schema};if(normalized.properties&&typeof normalized.properties=="object"){const props=normalized.properties,normalizedProps={};for(const[key2,prop2]of Object.entries(props)){if(!prop2||typeof prop2!="object"){normalizedProps[key2]=prop2;continue}const normalizedProp={...prop2};if(!normalizedProp.type&&normalizedProp.default!==
+void 0){const defaultVal=normalizedProp.default;typeof defaultVal=="string"?normalizedProp.type="string":typeof defaultVal=="number"?normalizedProp.type=Number.isInteger(defaultVal)?"integer":"number":typeof defaultVal=="boolean"?normalizedProp.type="boolean":Array.isArray(defaultVal)?normalizedProp.type="array":typeof defaultVal=="object"&&defaultVal!==null&&(normalizedProp.type="object")}normalizedProp.properties&&Object.assign(normalizedProp,this.normalizeSchemaProperties(normalizedProp)),normalizedProp.
+items&&typeof normalizedProp.items=="object"&&(normalizedProp.items=this.normalizeSchemaProperties(normalizedProp.items)),normalizedProps[key2]=normalizedProp}normalized.properties=normalizedProps}return normalized}getToolNames(){return Array.from(this.toolsIndex.keys())}hasTool(toolName){return this.toolsIndex.has(toolName)}getToolServer(toolName){return this.toolsIndex.get(toolName)}hasPromptsSupport(){for(const connection of this.connections.values())if(connection.serverCapabilities?.prompts)
+return!0;return!1}hasPromptsCapability(perChatOverrides){if(perChatOverrides!==void 0){const enabledServerIds=new Set(perChatOverrides.filter(o=>o.enabled).map(o=>o.serverId));if(enabledServerIds.size===0)return!1;for(const[serverId,state2]of Object.entries(this._healthChecks))if(enabledServerIds.has(serverId)&&state2.status===HealthCheckStatus.SUCCESS&&state2.capabilities?.server?.prompts!==void 0)return!0;for(const[serverName,connection]of this.connections)if(enabledServerIds.has(serverName)&&
+connection.serverCapabilities?.prompts)return!0;return!1}for(const state2 of Object.values(this._healthChecks))if(state2.status===HealthCheckStatus.SUCCESS&&state2.capabilities?.server?.prompts!==void 0)return!0;for(const connection of this.connections.values())if(connection.serverCapabilities?.prompts)return!0;return!1}async getAllPrompts(){const results=[];for(const[serverName,connection]of this.connections){if(!connection.serverCapabilities?.prompts)continue;const prompts=await MCPService.listPrompts(
+connection);for(const prompt of prompts)results.push({name:prompt.name,description:prompt.description,title:prompt.title,serverName,arguments:prompt.arguments?.map(arg=>({name:arg.name,description:arg.description,required:arg.required}))})}return results}async getPrompt(serverName,promptName,args){const connection=this.connections.get(serverName);if(!connection)throw new Error(`Server "${serverName}" not found for prompt "${promptName}"`);return MCPService.getPrompt(connection,promptName,args)}async executeTool(toolCall,signal){
+const toolName=toolCall.function.name,serverName=this.toolsIndex.get(toolName);if(!serverName)throw new Error(`Unknown tool: ${toolName}`);const connection=this.connections.get(serverName);if(!connection)throw new Error(`Server "${serverName}" is not connected`);const args=this.parseToolArguments(toolCall.function.arguments);try{return await MCPService.callTool(connection,{name:toolName,arguments:args},signal)}catch(error2){if(MCPService.isSessionExpiredError(error2)){await this.reconnectServer(
+serverName);const newConnection=this.connections.get(serverName);if(!newConnection)throw new Error(`Failed to reconnect to "${serverName}"`);return MCPService.callTool(newConnection,{name:toolName,arguments:args},signal)}throw error2}}async executeToolByName(toolName,args,signal){const serverName=this.toolsIndex.get(toolName);if(!serverName)throw new Error(`Unknown tool: ${toolName}`);const connection=this.connections.get(serverName);if(!connection)throw new Error(`Server "${serverName}" is not \
+connected`);try{return await MCPService.callTool(connection,{name:toolName,arguments:args},signal)}catch(error2){if(MCPService.isSessionExpiredError(error2)){await this.reconnectServer(serverName);const newConnection=this.connections.get(serverName);if(!newConnection)throw new Error(`Failed to reconnect to "${serverName}"`);return MCPService.callTool(newConnection,{name:toolName,arguments:args},signal)}throw error2}}parseToolArguments(args){if(typeof args=="string"){const trimmed=args.trim();if(trimmed===
+"")return{};try{const parsed=JSON.parse(trimmed);if(typeof parsed!="object"||parsed===null||Array.isArray(parsed))throw new Error(`Tool arguments must be an object, got ${Array.isArray(parsed)?"array":typeof parsed}`);return parsed}catch(error2){throw new Error(`Failed to parse tool arguments as JSON: ${error2.message}`)}}if(typeof args=="object"&&args!==null&&!Array.isArray(args))return args;throw new Error(`Invalid tool arguments type: ${typeof args}`)}async getPromptCompletions(serverName,promptName,argumentName,argumentValue){
+const connection=this.connections.get(serverName);return connection?connection.serverCapabilities?.completions?MCPService.complete(connection,{type:MCPRefType.PROMPT,name:promptName},{name:argumentName,value:argumentValue}):null:(console.warn(`[MCPStore] Server "${serverName}" is not connected`),null)}async getResourceCompletions(serverName,uriTemplate,argumentName,argumentValue){const connection=this.connections.get(serverName);return connection?connection.serverCapabilities?.completions?MCPService.
+complete(connection,{type:MCPRefType.RESOURCE,uri:uriTemplate},{name:argumentName,value:argumentValue}):null:(console.warn(`[MCPStore] Server "${serverName}" is not connected`),null)}async readResourceByUri(serverName,uri2){const connection=this.connections.get(serverName);if(!connection)return console.error(`[MCPStore] No connection found for server: ${serverName}`),null;try{return(await MCPService.readResource(connection,uri2)).contents}catch(error2){return console.error(`[MCPStore] Failed to \
+read resource ${uri2}:`,error2),null}}parseHeaders(headersJson){if(headersJson?.trim())try{const parsed=JSON.parse(headersJson);if(typeof parsed=="object"&&parsed!==null&&!Array.isArray(parsed))return parsed}catch{console.warn("[MCPStore] Failed to parse custom headers JSON:",headersJson)}}async runHealthChecksForServers(servers,skipIfChecked=!0,promoteToActive=!1){const serversToCheck=skipIfChecked?servers.filter(s2=>!this.hasHealthCheck(s2.id)&&s2.url.trim()):servers.filter(s2=>s2.url.trim());
+if(serversToCheck.length===0)return;const BATCH_SIZE=5;for(let i=0;i<serversToCheck.length;i+=BATCH_SIZE){const batch=serversToCheck.slice(i,i+BATCH_SIZE);await Promise.allSettled(batch.map(server=>this.runHealthCheck(server,promoteToActive)))}}getExistingConnection(serverId){return this.connections.get(serverId)}async runHealthCheck(server,promoteToActive=!1){const existingConnection=this.connections.get(server.id);if(existingConnection)try{const tools=await MCPService.listTools(existingConnection),
+capabilities=this.#buildCapabilitiesInfo(existingConnection.serverCapabilities,existingConnection.clientCapabilities);this.updateHealthCheck(server.id,{status:HealthCheckStatus.SUCCESS,tools:tools.map(tool=>({name:tool.name,description:tool.description,title:tool.title})),serverInfo:existingConnection.serverInfo,capabilities,transportType:existingConnection.transportType,protocolVersion:existingConnection.protocolVersion,instructions:existingConnection.instructions,connectionTimeMs:existingConnection.
+connectionTimeMs,logs:[]});return}catch(error2){console.warn(`[MCPStore] Failed to reuse connection for ${server.id}, creating new one:`,error2),this.connections.delete(server.id)}const trimmedUrl=server.url.trim(),logs=[];let currentPhase=MCPConnectionPhase.IDLE;if(!trimmedUrl){this.updateHealthCheck(server.id,{status:HealthCheckStatus.ERROR,message:"Please enter a server URL first.",logs:[]});return}this.updateHealthCheck(server.id,{status:HealthCheckStatus.CONNECTING,phase:MCPConnectionPhase.
+TRANSPORT_CREATING,logs:[]});const timeoutMs=Math.round(server.requestTimeoutSeconds*1e3),headers=this.parseHeaders(server.headers);try{const serverConfig={url:trimmedUrl,transport:detectMcpTransportFromUrl(trimmedUrl),handshakeTimeoutMs:DEFAULT_MCP_CONFIG.connectionTimeoutMs,requestTimeoutMs:timeoutMs,headers,useProxy:server.useProxy};this.serverConfigs.set(server.id,serverConfig);const connection=await MCPService.connect(server.id,serverConfig,DEFAULT_MCP_CONFIG.clientInfo,DEFAULT_MCP_CONFIG.capabilities,
+(phase,log)=>{currentPhase=phase,logs.push(log),this.updateHealthCheck(server.id,{status:HealthCheckStatus.CONNECTING,phase,logs:[...logs]}),phase===MCPConnectionPhase.DISCONNECTED&&promoteToActive&&(console.log(`[MCPStore][${server.id}] Connection lost during health check, starting auto-reconnect`),this.autoReconnect(server.id))}),tools=connection.tools.map(tool=>({name:tool.name,description:tool.description,title:tool.title})),capabilities=this.#buildCapabilitiesInfo(connection.serverCapabilities,
+connection.clientCapabilities);this.updateHealthCheck(server.id,{status:HealthCheckStatus.SUCCESS,tools,serverInfo:connection.serverInfo,capabilities,transportType:connection.transportType,protocolVersion:connection.protocolVersion,instructions:connection.instructions,connectionTimeMs:connection.connectionTimeMs,logs}),promoteToActive&&server.enabled?this.promoteHealthCheckToConnection(server.id,connection):await MCPService.disconnect(connection)}catch(error2){const message=error2 instanceof Error?
+error2.message:"Unknown error occurred";logs.at(-1)?.phase!==MCPConnectionPhase.ERROR&&logs.push({timestamp:new Date,phase:MCPConnectionPhase.ERROR,message:`Connection failed: ${message}`,level:MCPLogLevel.ERROR}),this.updateHealthCheck(server.id,{status:HealthCheckStatus.ERROR,message,phase:currentPhase,logs})}}promoteHealthCheckToConnection(serverId,connection){for(const tool of connection.tools)this.toolsIndex.has(tool.name)&&console.warn(`[MCPStore] Tool name conflict during promotion: "${tool.
+name}" exists in "${this.toolsIndex.get(tool.name)}" and "${serverId}". Using tool from "${serverId}".`),this.toolsIndex.set(tool.name,serverId);this.connections.set(serverId,connection),this.updateState({toolCount:this.toolsIndex.size,connectedServers:Array.from(this.connections.keys())})}getServersStatus(){const statuses=[];for(const[name,connection]of this.connections)statuses.push({name,isConnected:!0,toolCount:connection.tools.length,error:void 0});return statuses}getServerInstructions(){const results=[];
+for(const[serverName,connection]of this.connections)connection.instructions&&results.push({serverName,serverTitle:connection.serverInfo?.title||connection.serverInfo?.name,instructions:connection.instructions});return results}getHealthCheckInstructions(){const results=[];for(const[serverId,state2]of Object.entries(this._healthChecks))state2.status===HealthCheckStatus.SUCCESS&&state2.instructions&&results.push({serverId,serverTitle:state2.serverInfo?.title||state2.serverInfo?.name,instructions:state2.
+instructions});return results}hasServerInstructions(){for(const connection of this.connections.values())if(connection.instructions)return!0;return!1}hasResourcesCapability(perChatOverrides){if(perChatOverrides!==void 0){const enabledServerIds=new Set(perChatOverrides.filter(o=>o.enabled).map(o=>o.serverId));if(enabledServerIds.size===0)return!1;for(const[serverId,state2]of Object.entries(this._healthChecks))if(enabledServerIds.has(serverId)&&state2.status===HealthCheckStatus.SUCCESS&&state2.capabilities?.
+server?.resources!==void 0)return!0;for(const[serverName,connection]of this.connections)if(enabledServerIds.has(serverName)&&MCPService.supportsResources(connection))return!0;return!1}for(const state2 of Object.values(this._healthChecks))if(state2.status===HealthCheckStatus.SUCCESS&&state2.capabilities?.server?.resources!==void 0)return!0;for(const connection of this.connections.values())if(MCPService.supportsResources(connection))return!0;return!1}getServersWithResources(){const servers=[];for(const[
+name,connection]of this.connections)MCPService.supportsResources(connection)&&!servers.includes(name)&&servers.push(name);for(const[serverId,state2]of Object.entries(this._healthChecks))!servers.includes(serverId)&&state2.status===HealthCheckStatus.SUCCESS&&state2.capabilities?.server?.resources!==void 0&&servers.push(serverId);return servers}async fetchAllResources(forceRefresh=!1){const serversWithResources=this.getServersWithResources();if(serversWithResources.length!==0){if(!forceRefresh&&serversWithResources.
+every(serverName=>{const serverRes=mcpResourceStore.getServerResources(serverName);return!serverRes||!serverRes.lastFetched?!1:Date.now()-serverRes.lastFetched.getTime()<DEFAULT_CACHE_TTL_MS})){console.log("[MCPStore] Using cached resources");return}mcpResourceStore.setLoading(!0);try{await Promise.all(serversWithResources.map(serverName=>this.fetchServerResources(serverName)))}finally{mcpResourceStore.setLoading(!1)}}}async fetchServerResources(serverName){const connection=this.connections.get(
+serverName);if(!connection){console.warn(`[MCPStore] No connection found for server: ${serverName}`);return}if(MCPService.supportsResources(connection)){mcpResourceStore.setServerLoading(serverName,!0);try{const[resources,templates]=await Promise.all([MCPService.listAllResources(connection),MCPService.listAllResourceTemplates(connection)]);mcpResourceStore.setServerResources(serverName,resources,templates)}catch(error2){const message=error2 instanceof Error?error2.message:String(error2);mcpResourceStore.
+setServerError(serverName,message),console.error(`[MCPStore][${serverName}] Failed to fetch resources:`,error2)}}}async readResource(uri2){const cached2=mcpResourceStore.getCachedContent(uri2);if(cached2)return cached2.content;const serverName=mcpResourceStore.findServerForUri(uri2);if(!serverName)return console.error(`[MCPStore] No server found for resource URI: ${uri2}`),null;const connection=this.connections.get(serverName);if(!connection)return console.error(`[MCPStore] No connection found f\
+or server: ${serverName}`),null;try{const result=await MCPService.readResource(connection,uri2),resourceInfo=mcpResourceStore.findResourceByUri(uri2);return resourceInfo&&mcpResourceStore.cacheResourceContent(resourceInfo,result.contents),result.contents}catch(error2){return console.error(`[MCPStore] Failed to read resource ${uri2}:`,error2),null}}async subscribeToResource(uri2){const serverName=mcpResourceStore.findServerForUri(uri2);if(!serverName)return console.error(`[MCPStore] No server fou\
+nd for resource URI: ${uri2}`),!1;const connection=this.connections.get(serverName);if(!connection)return console.error(`[MCPStore] No connection found for server: ${serverName}`),!1;if(!MCPService.supportsResourceSubscriptions(connection))return!1;try{return await MCPService.subscribeResource(connection,uri2),mcpResourceStore.addSubscription(uri2,serverName),!0}catch(error2){return console.error(`[MCPStore] Failed to subscribe to resource ${uri2}:`,error2),!1}}async unsubscribeFromResource(uri2){
+const serverName=mcpResourceStore.findServerForUri(uri2);if(!serverName)return console.error(`[MCPStore] No server found for resource URI: ${uri2}`),!1;const connection=this.connections.get(serverName);if(!connection)return console.error(`[MCPStore] No connection found for server: ${serverName}`),!1;try{return await MCPService.unsubscribeResource(connection,uri2),mcpResourceStore.removeSubscription(uri2),!0}catch(error2){return console.error(`[MCPStore] Failed to unsubscribe from resource ${uri2}\
+:`,error2),!1}}async attachResource(uri2){const resourceInfo=mcpResourceStore.findResourceByUri(uri2);if(!resourceInfo)return console.error(`[MCPStore] Resource not found: ${uri2}`),null;if(mcpResourceStore.isAttached(uri2))return null;const attachment=mcpResourceStore.addAttachment(resourceInfo);try{const content2=await this.readResource(uri2);content2?mcpResourceStore.updateAttachmentContent(attachment.id,content2):mcpResourceStore.updateAttachmentError(attachment.id,"Failed to read resource")}catch(error2){
+const message=error2 instanceof Error?error2.message:String(error2);mcpResourceStore.updateAttachmentError(attachment.id,message)}return mcpResourceStore.getAttachment(attachment.id)??null}removeResourceAttachment(attachmentId){mcpResourceStore.removeAttachment(attachmentId)}clearResourceAttachments(){mcpResourceStore.clearAttachments()}getResourceContextForChat(){return mcpResourceStore.formatAttachmentsForContext()}consumeResourceAttachmentsAsExtras(){const extras=mcpResourceStore.toMessageExtras();
+return extras.length>0&&mcpResourceStore.clearAttachments(),extras}}const mcpStore=new MCPStore;var root_2$18=from_html('<button type="button"><!> <span class="max-w-[150px] truncate text-xs"> </span> <!></button>'),root_8$s=from_html('<img class="h-3 w-3 shrink-0 rounded-sm"/>'),root_7$u=from_html('<div class="flex items-center gap-1 text-xs"><!> <span class="truncate"> </span></div>'),root_1$12=from_html("<!> <!>",1);function ChatAttachmentsListItemMcpResource($$anchor,$$props){push$1($$props,
+!0);const ResourceIcon=user_derived(()=>getResourceIcon($$props.attachment.resource.mimeType,$$props.attachment.resource.uri)),serverName=user_derived(()=>mcpStore.getServerDisplayName($$props.attachment.resource.serverName)),favicon=user_derived(()=>mcpStore.getServerFavicon($$props.attachment.resource.serverName));function getStatusClass(attachment){return attachment.error?"border-red-500/50 bg-red-500/10":(attachment.loading,"border-border/50 bg-muted/30")}var fragment=comment$2(),node2=first_child(
+fragment);component(node2,()=>Root$5,($$anchor2,Tooltip_Root)=>{Tooltip_Root($$anchor2,{children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$12(),node_1=first_child(fragment_1);component(node_1,()=>Tooltip_trigger,($$anchor4,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor4,{children:($$anchor5,$$slotProps2)=>{var button=root_2$18(),node_2=child(button);{var consequent=$$anchor6=>{Loader_circle($$anchor6,{class:"h-3 w-3 animate-spin text-muted-foreground"})},consequent_1=$$anchor6=>{Circle_alert(
+$$anchor6,{class:"h-3 w-3 text-red-500"})},alternate=$$anchor6=>{var fragment_4=comment$2(),node_3=first_child(fragment_4);component(node_3,()=>get$3(ResourceIcon),($$anchor7,ResourceIcon_1)=>{ResourceIcon_1($$anchor7,{class:"h-3 w-3 text-muted-foreground"})}),append($$anchor6,fragment_4)};if_block(node_2,$$render=>{$$props.attachment.loading?$$render(consequent):$$props.attachment.error?$$render(consequent_1,1):$$render(alternate,-1)})}var span=sibling(node_2,2),text2=child(span,!0);reset(span);
+var node_4=sibling(span,2);{var consequent_2=$$anchor6=>{ActionIcon($$anchor6,{class:"-my-2 -mr-1.5 bg-transparent",get icon(){return X},iconSize:"h-2 w-2",onclick:()=>$$props.onRemove?.($$props.attachment.id),stopPropagationOnClick:!0,tooltip:"Remove"})};if_block(node_4,$$render=>{$$props.onRemove&&$$render(consequent_2)})}reset(button),template_effect(($0,$1)=>{set_class(button,1,$0),button.disabled=!$$props.onclick,set_text(text2,$1)},[()=>clsx(["flex flex-shrink-0 items-center gap-1.5 rounde\
+d-md border px-2 py-0.75 text-sm transition-colors",getStatusClass($$props.attachment),$$props.onclick&&"cursor-pointer hover:bg-muted/50",$$props.class]),()=>getResourceDisplayName($$props.attachment.resource)]),delegated("click",button,function(...$$args){$$props.onclick?.apply(this,$$args)}),append($$anchor5,button)},$$slots:{default:!0}})});var node_5=sibling(node_1,2);component(node_5,()=>Tooltip_content,($$anchor4,Tooltip_Content)=>{Tooltip_Content($$anchor4,{children:($$anchor5,$$slotProps2)=>{
+var div=root_7$u(),node_6=child(div);{var consequent_3=$$anchor6=>{var img=root_8$s();template_effect(()=>{set_attribute(img,"alt",$$props.attachment.resource.serverName),set_attribute(img,"src",get$3(favicon))}),event("error",img,e=>{e.currentTarget.style.display="none"}),replay_events(img),append($$anchor6,img)};if_block(node_6,$$render=>{get$3(favicon)&&$$render(consequent_3)})}var span_1=sibling(node_6,2),text_1=child(span_1,!0);reset(span_1),reset(div),template_effect(()=>set_text(text_1,get$3(
+serverName))),append($$anchor5,div)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}delegate(["click"]);const info$1=($$anchor,text2=noop$3)=>{var fragment=comment$2(),node_2=first_child(fragment);{var consequent_1=$$anchor2=>{var span=root_6$v(),text_3=child(span,!0);reset(span),template_effect(()=>set_text(text_3,text2())),append($$anchor2,span)};if_block(node_2,$$render=>{text2()&&$$render(consequent_1)})}append($$anchor,fragment)};
+var root_2$17=from_html("<div></div>"),root_1$11=from_html('<div class="relative"><div> </div> <!></div>'),root_3$X=from_html('<div class="absolute top-2 right-2 opacity-0 transition-opacity group-hover:opacity-100"><!></div>'),root_4$D=from_html('<div class="flex h-8 w-8 items-center justify-center rounded bg-primary/10 text-xs font-medium text-primary"> </div>'),root_6$v=from_html('<span class="text-xs text-muted-foreground"> </span>'),root_9$m=from_html('<div class="flex items-start gap-3"><d\
+iv class="flex min-w-0 flex-1 flex-col items-start text-left"><span class="w-full truncate text-sm font-medium text-foreground"> </span> <!> <!></div></div>'),root_11$f=from_html('<span class="mb-3 block truncate text-sm font-medium text-foreground"> </span> <!>',1),root_7$t=from_html('<button type="button"><!> <div><!></div></button>'),root_13$d=from_html('<button type="button"><!> <div class="flex flex-col items-start gap-0.5"><span> </span> <!></div> <!></button>');function ChatAttachmentsListItemThumbnailFile($$anchor,$$props){
+push$1($$props,!0);const textPreview=($$anchor2,content2=noop$3)=>{var div=root_1$11(),div_1=child(div),text_1=child(div_1,!0);reset(div_1);var node2=sibling(div_1,2);{var consequent=$$anchor3=>{var div_2=root_2$17();template_effect(()=>set_class(div_2,1,`pointer-events-none absolute right-0 bottom-0 left-0 h-4 bg-gradient-to-t from-muted to-transparent ${readonly2()?"h-6":""}`)),append($$anchor3,div_2)};if_block(node2,$$render=>{content2().length>150&&$$render(consequent)})}reset(div),template_effect(
+$0=>{set_class(div_1,1,`font-mono text-xs leading-relaxed break-words whitespace-pre-wrap text-muted-foreground ${readonly2()?"":"max-h-3rem line-height-1.2"}`),set_text(text_1,$0)},[()=>getPreviewText(content2())]),append($$anchor2,div)},removeButton=$$anchor2=>{var div_3=root_3$X(),node_1=child(div_3);ActionIcon(node_1,{get icon(){return X},tooltip:"Remove",stopPropagationOnClick:!0,onclick:()=>$$props.onRemove?.($$props.id)}),reset(div_3),append($$anchor2,div_3)},fileIcon=$$anchor2=>{var div_4=root_4$D(),
+text_2=child(div_4,!0);reset(div_4),template_effect(()=>set_text(text_2,get$3(fileTypeLabel))),append($$anchor2,div_4)};let className=prop($$props,"class",3,""),readonly2=prop($$props,"readonly",3,!1),isPdf=user_derived(()=>isPdfFile$1($$props.attachment,$$props.uploadedFile)),isPdfWithContent=user_derived(()=>get$3(isPdf)&&!!$$props.textContent),isText=user_derived(()=>isTextFile($$props.attachment,$$props.uploadedFile)),isTextWithContent=user_derived(()=>get$3(isText)&&!!$$props.textContent),fileTypeLabel=user_derived(
+()=>{if($$props.uploadedFile?.type)return getFileTypeLabel($$props.uploadedFile.type);if($$props.attachment){if("mimeType"in $$props.attachment&&$$props.attachment.mimeType)return getFileTypeLabel($$props.attachment.mimeType);if($$props.attachment.type)return getFileTypeLabel($$props.attachment.type)}return getFileTypeLabel($$props.name)}),pdfProcessingMode=user_derived(()=>$$props.attachment?.type===AttachmentType.PDF?$$props.attachment.processedAsImages?"Sent as Image":"Sent as Text":null);var fragment_1=comment$2(),
+node_3=first_child(fragment_1);{var consequent_6=$$anchor2=>{var button=root_7$t(),node_4=child(button);{var consequent_2=$$anchor3=>{removeButton($$anchor3)};if_block(node_4,$$render=>{readonly2()||$$render(consequent_2)})}var div_5=sibling(node_4,2),node_5=child(div_5);{var consequent_4=$$anchor3=>{var div_6=root_9$m(),div_7=child(div_6),span_1=child(div_7),text_4=child(span_1,!0);reset(span_1);var node_6=sibling(span_1,2);{let $0=user_derived(()=>get$3(pdfProcessingMode)||($$props.size?formatFileSize(
+$$props.size):void 0));info$1(node_6,()=>get$3($0))}var node_7=sibling(node_6,2);{var consequent_3=$$anchor4=>{textPreview($$anchor4,()=>$$props.textContent)};if_block(node_7,$$render=>{$$props.textContent&&$$render(consequent_3)})}reset(div_7),reset(div_6),template_effect(()=>set_text(text_4,$$props.name)),append($$anchor3,div_6)},alternate=$$anchor3=>{var fragment_4=root_11$f(),span_2=first_child(fragment_4),text_5=child(span_2,!0);reset(span_2);var node_8=sibling(span_2,2);{var consequent_5=$$anchor4=>{
+textPreview($$anchor4,()=>$$props.textContent)};if_block(node_8,$$render=>{$$props.textContent&&$$render(consequent_5)})}template_effect(()=>set_text(text_5,$$props.name)),append($$anchor3,fragment_4)};if_block(node_5,$$render=>{readonly2()?$$render(consequent_4):$$render(alternate,-1)})}reset(div_5),reset(button),template_effect(()=>{set_attribute(button,"aria-label",readonly2()?`Preview ${$$props.name}`:void 0),set_class(button,1,`rounded-lg border border-border bg-muted p-3 ${className()??""}\
+ cursor-pointer ${readonly2()?"w-full max-w-2xl transition-shadow hover:shadow-md":`group relative text-left ${$$props.textContent?"max-h-24 max-w-72":"max-w-36"}`} overflow-hidden`),set_class(div_5,1,clsx([!readonly2()&&"pr-8","overflow-hidden"]))}),delegated("click",button,function(...$$args){$$props.onclick?.apply(this,$$args)}),append($$anchor2,button)},alternate_1=$$anchor2=>{var button_1=root_13$d(),node_9=child(button_1);fileIcon(node_9);var div_8=sibling(node_9,2),span_3=child(div_8),text_6=child(
+span_3,!0);reset(span_3);var node_10=sibling(span_3,2);{let $0=user_derived(()=>get$3(pdfProcessingMode)||($$props.size?formatFileSize($$props.size):void 0));info$1(node_10,()=>get$3($0))}reset(div_8);var node_11=sibling(div_8,2);{var consequent_7=$$anchor3=>{removeButton($$anchor3)};if_block(node_11,$$render=>{readonly2()||$$render(consequent_7)})}reset(button_1),template_effect(()=>{set_class(button_1,1,`group flex items-center gap-3 rounded-lg border border-border bg-muted p-3 ${className()??
+""} relative`),set_class(span_3,1,`max-w-24 truncate text-sm font-medium text-foreground ${readonly2()?"":"group-hover:pr-6"} md:max-w-32`),set_text(text_6,$$props.name)}),delegated("click",button_1,function(...$$args){$$props.onclick?.apply(this,$$args)}),append($$anchor2,button_1)};if_block(node_3,$$render=>{get$3(isTextWithContent)||get$3(isPdfWithContent)?$$render(consequent_6):$$render(alternate_1,-1)})}append($$anchor,fragment_1),pop()}delegate(["click"]);var root_1$10=from_html("<img/>"),
+root_2$16=from_html('<button class="block h-full w-full rounded-lg focus:ring-2 focus:ring-primary focus:ring-offset-2 focus:outline-none" type="button"><!></button>'),root_4$C=from_html('<div class="absolute top-1 right-1 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100"><!></div>'),root$1G=from_html("<div><!> <!></div>");function ChatAttachmentsListItemThumbnailImage($$anchor,$$props){push$1($$props,!0);const image2=$$anchor2=>{var img=root_1$10();template_effect(
+()=>{set_attribute(img,"src",$$props.preview),set_attribute(img,"alt",$$props.name),set_class(img,1,`${height()??""} ${width()??""} cursor-pointer object-cover ${imageClass()??""}`)}),append($$anchor2,img)};let className=prop($$props,"class",3,""),height=prop($$props,"height",3,"h-16"),imageClass=prop($$props,"imageClass",3,""),readonly2=prop($$props,"readonly",3,!1),width=prop($$props,"width",3,"w-auto");var div=root$1G(),node2=child(div);{var consequent=$$anchor2=>{var button=root_2$16(),node_1=child(
+button);image2(node_1),reset(button),template_effect(()=>set_attribute(button,"aria-label",`Preview ${$$props.name??""}`)),delegated("click",button,function(...$$args){$$props.onclick?.apply(this,$$args)}),append($$anchor2,button)},alternate=$$anchor2=>{image2($$anchor2)};if_block(node2,$$render=>{$$props.onclick?$$render(consequent):$$render(alternate,-1)})}var node_2=sibling(node2,2);{var consequent_1=$$anchor2=>{var div_1=root_4$C(),node_3=child(div_1);ActionIcon(node_3,{class:"text-white",get icon(){
+return X},onclick:()=>$$props.onRemove?.($$props.id),stopPropagationOnClick:!0,tooltip:"Remove"}),reset(div_1),append($$anchor2,div_1)};if_block(node_2,$$render=>{readonly2()||$$render(consequent_1)})}reset(div),template_effect(()=>set_class(div,1,`group relative overflow-hidden rounded-lg bg-muted shadow-lg dark:border dark:border-muted ${className()??""}`)),append($$anchor,div),pop()}delegate(["click"]);class ModelsService{static async list(){return apiFetch(API_MODELS.LIST)}static async listRouter(){
+return apiFetch(API_MODELS.LIST)}static async load(modelId,extraArgs){const payload={model:modelId};return extraArgs&&extraArgs.length>0&&(payload.extra_args=extraArgs),apiPost(API_MODELS.LOAD,payload)}static async unload(modelId){return apiPost(API_MODELS.UNLOAD,{model:modelId})}static isModelLoaded(model){return model.status.value===ServerModelStatus.LOADED}static isModelLoading(model){return model.status.value===ServerModelStatus.LOADING}static parseModelId(modelId){const result={raw:modelId,
+orgName:null,modelName:null,params:null,activatedParams:null,quantization:null,tags:[]},colonIdx=modelId.indexOf(MODEL_ID_QUANTIZATION_SEPARATOR);let modelPath;colonIdx!==MODEL_ID_NOT_FOUND?(result.quantization=modelId.slice(colonIdx+1)||null,modelPath=modelId.slice(0,colonIdx)):modelPath=modelId;const slashIdx=modelPath.indexOf(MODEL_ID_ORG_SEPARATOR);let modelStr;slashIdx!==MODEL_ID_NOT_FOUND?(result.orgName=modelPath.slice(0,slashIdx),modelStr=modelPath.slice(slashIdx+1)):modelStr=modelPath;const dotIdx=modelStr.
+lastIndexOf(".");if(dotIdx!==MODEL_ID_NOT_FOUND&&!result.quantization){const afterDot=modelStr.slice(dotIdx+1);MODEL_QUANTIZATION_SEGMENT_RE.test(afterDot)&&(result.quantization=afterDot,modelStr=modelStr.slice(0,dotIdx))}const segments=modelStr.split(MODEL_ID_SEGMENT_SEPARATOR);if(!result.quantization&&segments.length>1){const last=segments[segments.length-1],secondLast=segments.length>2?segments[segments.length-2]:null;MODEL_QUANTIZATION_SEGMENT_RE.test(last)&&(secondLast&&MODEL_CUSTOM_QUANTIZATION_PREFIX_RE.
+test(secondLast)?(result.quantization=`${secondLast}-${last}`,segments.splice(segments.length-2,2)):(result.quantization=last,segments.pop()))}let paramsIdx=MODEL_ID_NOT_FOUND,activatedParamsIdx=MODEL_ID_NOT_FOUND;for(let i=0;i<segments.length;i++){const seg=segments[i];paramsIdx===MODEL_ID_NOT_FOUND&&MODEL_PARAMS_RE.test(seg)?(paramsIdx=i,result.params=seg.toUpperCase()):paramsIdx!==MODEL_ID_NOT_FOUND&&MODEL_ACTIVATED_PARAMS_RE.test(seg)&&(activatedParamsIdx=i,result.activatedParams=seg.toUpperCase())}
+const pivotIdx=paramsIdx!==MODEL_ID_NOT_FOUND?paramsIdx:segments.length;return result.modelName=segments.slice(0,pivotIdx).join(MODEL_ID_SEGMENT_SEPARATOR)||null,paramsIdx!==MODEL_ID_NOT_FOUND&&(result.tags=segments.slice(paramsIdx+1).filter((_,relIdx)=>{const absIdx=paramsIdx+1+relIdx;return absIdx===activatedParamsIdx?!1:!MODEL_IGNORED_SEGMENTS.has(segments[absIdx].toUpperCase())})),result}}class ModelsStore{#models=state$1(proxy([]));get models(){return get$3(this.#models)}set models(value){set$1(
+this.#models,value,!0)}#routerModels=state$1(proxy([]));get routerModels(){return get$3(this.#routerModels)}set routerModels(value){set$1(this.#routerModels,value,!0)}#loading=state$1(!1);get loading(){return get$3(this.#loading)}set loading(value){set$1(this.#loading,value,!0)}#updating=state$1(!1);get updating(){return get$3(this.#updating)}set updating(value){set$1(this.#updating,value,!0)}#error=state$1(null);get error(){return get$3(this.#error)}set error(value){set$1(this.#error,value,!0)}#selectedModelId=state$1(
+null);get selectedModelId(){return get$3(this.#selectedModelId)}set selectedModelId(value){set$1(this.#selectedModelId,value,!0)}#selectedModelName=state$1(null);get selectedModelName(){return get$3(this.#selectedModelName)}set selectedModelName(value){set$1(this.#selectedModelName,value,!0)}#modelUsage=state$1(proxy(new Map));get modelUsage(){return get$3(this.#modelUsage)}set modelUsage(value){set$1(this.#modelUsage,value,!0)}modelLoadingStates=new SvelteMap;#favoriteModelIds=state$1(proxy(this.
+loadFavoritesFromStorage()));get favoriteModelIds(){return get$3(this.#favoriteModelIds)}set favoriteModelIds(value){set$1(this.#favoriteModelIds,value,!0)}modelPropsCache=new TTLCache({ttlMs:MODEL_PROPS_CACHE_TTL_MS,maxEntries:MODEL_PROPS_CACHE_MAX_ENTRIES});#modelPropsFetching=state$1(proxy(new Set));get modelPropsFetching(){return get$3(this.#modelPropsFetching)}set modelPropsFetching(value){set$1(this.#modelPropsFetching,value,!0)}#propsCacheVersion=state$1(0);get propsCacheVersion(){return get$3(
+this.#propsCacheVersion)}set propsCacheVersion(value){set$1(this.#propsCacheVersion,value,!0)}get selectedModel(){return this.selectedModelId?this.models.find(model=>model.id===this.selectedModelId)??null:null}get loadedModelIds(){return this.routerModels.filter(m=>m.status.value===ServerModelStatus.LOADED||m.status.value===ServerModelStatus.SLEEPING).map(m=>m.id)}get loadingModelIds(){return Array.from(this.modelLoadingStates.entries()).filter(([,loading])=>loading).map(([id2])=>id2)}get singleModelName(){
+if(serverStore.isRouterMode)return null;const props=serverStore.props;return props?.model_alias?props.model_alias:props?.model_path&&props.model_path.split(/(\\|\/)/).pop()||null}getModelModalities(modelId){const model=this.models.find(m=>m.model===modelId||m.id===modelId);if(model?.modalities)return model.modalities;const props=this.modelPropsCache.get(modelId);return props?.modalities?{vision:props.modalities.vision??!1,audio:props.modalities.audio??!1}:null}modelSupportsVision(modelId){return this.
+getModelModalities(modelId)?.vision??!1}modelSupportsAudio(modelId){return this.getModelModalities(modelId)?.audio??!1}getModelModalitiesArray(modelId){const modalities=this.getModelModalities(modelId);if(!modalities)return[];const result=[];return modalities.vision&&result.push(ModelModality.VISION),modalities.audio&&result.push(ModelModality.AUDIO),result}getModelProps(modelId){return this.modelPropsCache.get(modelId)}getModelContextSize(modelId){const nCtx=this.getModelProps(modelId)?.default_generation_settings?.
+n_ctx;return typeof nCtx=="number"?nCtx:null}get selectedModelContextSize(){return this.selectedModelName?this.getModelContextSize(this.selectedModelName):null}isModelPropsFetching(modelId){return this.modelPropsFetching.has(modelId)}isModelLoaded(modelId){const model=this.routerModels.find(m=>m.id===modelId);return model?.status.value===ServerModelStatus.LOADED||model?.status.value===ServerModelStatus.SLEEPING||!1}isModelOperationInProgress(modelId){return this.modelLoadingStates.get(modelId)??
+!1}getModelStatus(modelId){return this.routerModels.find(m=>m.id===modelId)?.status.value??null}getModelUsage(modelId){return this.modelUsage.get(modelId)??new SvelteSet}isModelInUse(modelId){const usage=this.modelUsage.get(modelId);return usage!==void 0&&usage.size>0}async fetch(force=!1){if(!this.loading&&!(this.models.length>0&&!force)){this.loading=!0,this.error=null;try{serverStore.props||await serverStore.fetch();const response=await ModelsService.list(),models=response.data.map((item,index2)=>{
+const details=response.models?.[index2],rawCapabilities=Array.isArray(details?.capabilities)?details?.capabilities:[],displayNameSource=details?.name&&details.name.trim().length>0?details.name:item.id,displayName=this.toDisplayName(displayNameSource),modelId=details?.model||item.id;return{id:item.id,name:displayName,model:modelId,description:details?.description,capabilities:rawCapabilities.filter(value=>!!value),details:details?.details,meta:item.meta??null,parsedId:ModelsService.parseModelId(modelId),
+aliases:item.aliases??[],tags:item.tags??[]}});this.models=models;const serverProps2=serverStore.props;if(serverStore.isModelMode&&this.models.length>0&&serverProps2?.modalities){const modalities={vision:serverProps2.modalities.vision??!1,audio:serverProps2.modalities.audio??!1};this.modelPropsCache.set(this.models[0].model,serverProps2),this.models=this.models.map((model,index2)=>index2===0?{...model,modalities}:model)}}catch(error2){throw this.models=[],this.error=error2 instanceof Error?error2.
+message:"Failed to load models",error2}finally{this.loading=!1}}}async fetchRouterModels(){try{const response=await ModelsService.listRouter();this.routerModels=response.data,await this.fetchModalitiesForLoadedModels();const o=this.models.filter(option2=>this.getModelProps(option2.model)?.webui!==!1);o.length===1&&this.isModelLoaded(o[0].model)&&this.selectModelById(o[0].id)}catch(error2){console.warn("Failed to fetch router models:",error2),this.routerModels=[]}}async fetchModelProps(modelId){const cached2=this.
+modelPropsCache.get(modelId);if(cached2)return cached2;if(serverStore.isRouterMode&&!this.isModelLoaded(modelId)||this.modelPropsFetching.has(modelId))return null;this.modelPropsFetching.add(modelId);try{const props=await PropsService.fetchForModel(modelId);return this.modelPropsCache.set(modelId,props),props}catch(error2){return console.warn(`Failed to fetch props for model ${modelId}:`,error2),null}finally{this.modelPropsFetching.delete(modelId)}}async fetchModalitiesForLoadedModels(){const loadedModelIds2=this.
+loadedModelIds;if(loadedModelIds2.length===0)return;const propsPromises=loadedModelIds2.map(modelId=>this.fetchModelProps(modelId));try{const results=await Promise.all(propsPromises);this.models=this.models.map(model=>{const modelIndex=loadedModelIds2.indexOf(model.model);if(modelIndex===-1)return model;const props=results[modelIndex];if(!props?.modalities)return model;const modalities={vision:props.modalities.vision??!1,audio:props.modalities.audio??!1};return{...model,modalities}}),this.propsCacheVersion++}catch(error2){
+console.warn("Failed to fetch modalities for loaded models:",error2)}}async updateModelModalities(modelId){try{const props=await this.fetchModelProps(modelId);if(!props?.modalities)return;const modalities={vision:props.modalities.vision??!1,audio:props.modalities.audio??!1};this.models=this.models.map(model=>model.model===modelId?{...model,modalities}:model),this.propsCacheVersion++}catch(error2){console.warn(`Failed to update modalities for model ${modelId}:`,error2)}}async selectModelById(modelId){
+if(!modelId||this.updating||this.selectedModelId===modelId)return;const option2=this.models.find(model=>model.id===modelId);if(!option2)throw new Error("Selected model is not available");this.updating=!0,this.error=null;try{this.selectedModelId=option2.id,this.selectedModelName=option2.model}finally{this.updating=!1}}selectModelByName(modelName){const option2=this.models.find(model=>model.model===modelName);option2&&(this.selectedModelId=option2.id,this.selectedModelName=option2.model)}clearSelection(){
+this.selectedModelId=null,this.selectedModelName=null}findModelByName(modelName){return this.models.find(model=>model.model===modelName)??null}findModelById(modelId){return this.models.find(model=>model.id===modelId)??null}hasModel(modelName){return this.models.some(model=>model.model===modelName)}static STATUS_POLL_INTERVAL=500;async pollForModelStatus(modelId,expectedStatus){let attempt=0;for(;;){await this.fetchRouterModels();const currentStatus=this.getModelStatus(modelId);if(currentStatus===
+expectedStatus)return;if(currentStatus===ServerModelStatus.FAILED)throw new Error(`Model failed to ${expectedStatus===ServerModelStatus.LOADED?"load":"unload"}`);if(expectedStatus===ServerModelStatus.LOADED&¤tStatus===ServerModelStatus.UNLOADED&&attempt>2)throw new Error("Model was unloaded unexpectedly during loading");attempt++,await new Promise(resolve2=>setTimeout(resolve2,ModelsStore.STATUS_POLL_INTERVAL))}}async loadModel(modelId){if(!this.isModelLoaded(modelId)&&!this.modelLoadingStates.
+get(modelId)){this.modelLoadingStates.set(modelId,!0),this.error=null;try{await ModelsService.load(modelId),await this.pollForModelStatus(modelId,ServerModelStatus.LOADED),await this.updateModelModalities(modelId),toast.success(`Model loaded: ${this.toDisplayName(modelId)}`)}catch(error2){throw this.error=error2 instanceof Error?error2.message:"Failed to load model",toast.error(`Failed to load model: ${this.toDisplayName(modelId)}`),error2}finally{this.modelLoadingStates.set(modelId,!1)}}}async unloadModel(modelId){
+if(this.isModelLoaded(modelId)&&!this.modelLoadingStates.get(modelId)){this.modelLoadingStates.set(modelId,!0),this.error=null;try{await ModelsService.unload(modelId),await this.pollForModelStatus(modelId,ServerModelStatus.UNLOADED),toast.info(`Model unloaded: ${this.toDisplayName(modelId)}`)}catch(error2){throw this.error=error2 instanceof Error?error2.message:"Failed to unload model",toast.error(`Failed to unload model: ${this.toDisplayName(modelId)}`),error2}finally{this.modelLoadingStates.set(
+modelId,!1)}}}async ensureModelLoaded(modelId){this.isModelLoaded(modelId)||await this.loadModel(modelId)}isFavorite(modelId){return this.favoriteModelIds.has(modelId)}toggleFavorite(modelId){const next2=new SvelteSet(this.favoriteModelIds);next2.has(modelId)?next2.delete(modelId):next2.add(modelId),this.favoriteModelIds=next2;try{localStorage.setItem(FAVORITE_MODELS_LOCALSTORAGE_KEY,JSON.stringify([...next2]))}catch{toast.error("Failed to save favorite models to local storage")}}loadFavoritesFromStorage(){
+try{const raw2=localStorage.getItem(FAVORITE_MODELS_LOCALSTORAGE_KEY);return raw2?new Set(JSON.parse(raw2)):new Set}catch{return toast.error("Failed to load favorite models from local storage"),new Set}}toDisplayName(id2){const candidate=id2.split(/\\|\//).pop();return candidate&&candidate.trim().length>0?candidate:id2}clear(){this.models=[],this.routerModels=[],this.loading=!1,this.updating=!1,this.error=null,this.selectedModelId=null,this.selectedModelName=null,this.modelUsage.clear(),this.modelLoadingStates.
+clear(),this.modelPropsCache.clear(),this.modelPropsFetching.clear()}pruneExpiredCache(){return this.modelPropsCache.prune()}}const modelsStore=new ModelsStore,modelOptions=()=>modelsStore.models,routerModels=()=>modelsStore.routerModels,modelsLoading=()=>modelsStore.loading,modelsUpdating=()=>modelsStore.updating,selectedModelId=()=>modelsStore.selectedModelId,selectedModelName=()=>modelsStore.selectedModelName,singleModelName=()=>modelsStore.singleModelName,selectedModelContextSize=()=>modelsStore.
+selectedModelContextSize;var root_1$$=from_html("<!> <!>",1),root$1F=from_html('<div><div class="relative flex min-h-0 flex-1 items-center justify-center overflow-hidden"><!> <div class="flex h-full w-full flex-col items-center justify-start overflow-auto py-4"><!> <!></div></div></div>');function ChatAttachmentsPreview($$anchor,$$props){push$1($$props,!0);let uploadedFiles=prop($$props,"uploadedFiles",19,()=>[]),attachments=prop($$props,"attachments",19,()=>[]),className=prop($$props,"class",3,
+""),previewFocusIndex=prop($$props,"previewFocusIndex",3,0),allItems=user_derived(()=>getAttachmentDisplayItems({uploadedFiles:uploadedFiles(),attachments:attachments()}).filter(item=>!isMcpPrompt(item)&&!isMcpResource(item)).map(item=>({...item,isImage:isImageFile(item.attachment,item.uploadedFile),isAudio:isAudioFile(item.attachment,item.uploadedFile)}))),currentIndex=state$1(0);user_effect(()=>{previewFocusIndex()>=0&&previewFocusIndex()<get$3(allItems).length&&set$1(currentIndex,previewFocusIndex())}),
+user_effect(()=>{const handler=e=>{e.detail<0?set$1(currentIndex,get$3(currentIndex)>0?get$3(currentIndex)-1:get$3(allItems).length-1,!0):set$1(currentIndex,get$3(currentIndex)<get$3(allItems).length-1?get$3(currentIndex)+1:0,!0)};return document.addEventListener("chat-attachments-nav",handler),()=>document.removeEventListener("chat-attachments-nav",handler)}),user_effect(()=>{const index2=get$3(currentIndex);setTimeout(()=>{document.querySelector(`[data-thumbnail-index="${index2}"]`)?.scrollIntoView(
+{behavior:"smooth",inline:"center",block:"nearest"})},0)});let currentItem=user_derived(()=>get$3(allItems)[get$3(currentIndex)]??null),displayName=user_derived(()=>get$3(currentItem)?.name||get$3(currentItem)?.uploadedFile?.name||get$3(currentItem)?.attachment?.name||"Unknown File"),isAudio=user_derived(()=>get$3(currentItem)?isAudioFile(get$3(currentItem).attachment,get$3(currentItem).uploadedFile):!1),isImage2=user_derived(()=>get$3(currentItem)?isImageFile(get$3(currentItem).attachment,get$3(
+currentItem).uploadedFile):!1),isPdf=user_derived(()=>get$3(currentItem)?isPdfFile$1(get$3(currentItem).attachment,get$3(currentItem).uploadedFile):!1),isText=user_derived(()=>get$3(currentItem)?isTextFile(get$3(currentItem).attachment,get$3(currentItem).uploadedFile):!1),displayPreview=user_derived(()=>get$3(currentItem)?.uploadedFile?.preview||(get$3(isImage2)&&get$3(currentItem)?.attachment&&"base64Url"in get$3(currentItem).attachment?get$3(currentItem).attachment.base64Url:get$3(currentItem)?.
+preview)),displayTextContent=user_derived(()=>get$3(currentItem)?.uploadedFile?.textContent||(get$3(currentItem)?.attachment&&"content"in get$3(currentItem).attachment?get$3(currentItem).attachment.content:get$3(currentItem)?.textContent)),language2=user_derived(()=>getLanguageFromFilename(get$3(displayName))),fileSize=user_derived(()=>get$3(currentItem)?.size?formatFileSize(get$3(currentItem).size):""),hasVisionModality=user_derived(()=>get$3(currentItem)&&$$props.activeModelId?modelsStore.modelSupportsVision(
+$$props.activeModelId):!1),audioSrc=user_derived(()=>get$3(isAudio)&&get$3(currentItem)?get$3(currentItem).uploadedFile?.preview??(get$3(currentItem).attachment&&"mimeType"in get$3(currentItem).attachment&&"base64Data"in get$3(currentItem).attachment?createBase64DataUrl(get$3(currentItem).attachment.mimeType,get$3(currentItem).attachment.base64Data):null):null);function prev2(){set$1(currentIndex,get$3(currentIndex)>0?get$3(currentIndex)-1:get$3(allItems).length-1,!0)}function next2(){set$1(currentIndex,
+get$3(currentIndex)<get$3(allItems).length-1?get$3(currentIndex)+1:0,!0)}function onNavigate(index2){set$1(currentIndex,index2,!0)}var $$exports={prev:prev2,next:next2},div=root$1F(),div_1=child(div),node2=child(div_1);{let $0=user_derived(()=>get$3(allItems).length>1);ChatAttachmentsPreviewNavButtons(node2,{onPrev:prev2,onNext:next2,get show(){return get$3($0)}})}var div_2=sibling(node2,2),node_1=child(div_2);{var consequent=$$anchor2=>{var fragment=root_1$$(),node_2=first_child(fragment);ChatAttachmentsPreviewFileInfo(
+node_2,{get displayName(){return get$3(displayName)},get fileSize(){return get$3(fileSize)}});var node_3=sibling(node_2,2);ChatAttachmentsPreviewCurrentItem(node_3,{get currentItem(){return get$3(currentItem)},get isImage(){return get$3(isImage2)},get isAudio(){return get$3(isAudio)},get isPdf(){return get$3(isPdf)},get isText(){return get$3(isText)},get displayPreview(){return get$3(displayPreview)},get displayTextContent(){return get$3(displayTextContent)},get audioSrc(){return get$3(audioSrc)},
+get language(){return get$3(language2)},get hasVisionModality(){return get$3(hasVisionModality)},get activeModelId(){return $$props.activeModelId}}),append($$anchor2,fragment)};if_block(node_1,$$render=>{get$3(currentItem)&&$$render(consequent)})}var node_4=sibling(node_1,2);return ChatAttachmentsPreviewThumbnailStrip(node_4,{get items(){return get$3(allItems)},get currentIndex(){return get$3(currentIndex)},onNavigate}),reset(div_2),reset(div_1),reset(div),template_effect(()=>set_class(div,1,`${className()??
+""} flex flex-col text-white`)),append($$anchor,div),pop($$exports)}var root_1$_=from_html("<!> <!>",1);function ChatAttachmentsPreviewNavButtons($$anchor,$$props){var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=root_1$_(),node_1=first_child(fragment_1);Button(node_1,{variant:"secondary",size:"icon",class:"absolute top-1/2 left-4 z-10 h-8 w-8 -translate-y-1/2 rounded-full bg-background/5 p-0 text-white!",get onclick(){return $$props.onPrev},"aria-l\
+abel":"Previous",children:($$anchor3,$$slotProps)=>{Chevron_left($$anchor3,{class:"size-4"})},$$slots:{default:!0}});var node_2=sibling(node_1,2);Button(node_2,{variant:"secondary",size:"icon",class:"absolute top-1/2 right-4 z-10 h-8 w-8 -translate-y-1/2 rounded-full bg-background/5 p-0 text-white!",get onclick(){return $$props.onNext},"aria-label":"Next",children:($$anchor3,$$slotProps)=>{Chevron_right($$anchor3,{class:"size-4"})},$$slots:{default:!0}}),append($$anchor2,fragment_1)};if_block(node2,
+$$render=>{$$props.show&&$$render(consequent)})}append($$anchor,fragment)}var root_1$Z=from_html('<p class="text-xs text-white/60"> </p>'),root$1E=from_html('<div class="sticky top-0 z-[20] mb-4 rounded-lg bg-black/5 px-4 py-2 text-center backdrop-blur-md"><p class="font-medium text-white"> </p> <!></div>');function ChatAttachmentsPreviewFileInfo($$anchor,$$props){var div=root$1E(),p2=child(div),text2=child(p2,!0);reset(p2);var node2=sibling(p2,2);{var consequent=$$anchor2=>{var p_1=root_1$Z(),text_1=child(
+p_1,!0);reset(p_1),template_effect(()=>set_text(text_1,$$props.fileSize)),append($$anchor2,p_1)};if_block(node2,$$render=>{$$props.fileSize&&$$render(consequent)})}reset(div),template_effect(()=>set_text(text2,$$props.displayName)),append($$anchor,div)}var root_1$Y=from_html('<div data-slot="checkbox-indicator" class="text-current transition-none"><!></div>');function Checkbox($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),checked=prop($$props,"checked",15,!1),indeterminate=prop(
+$$props,"indeterminate",15,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","checked","indeterminate","class"]);var fragment=comment$2(),node2=first_child(fragment);{const children=($$anchor2,$$arg0)=>{let checked2=()=>$$arg0?.().checked,indeterminate2=()=>$$arg0?.().indeterminate;var div=root_1$Y(),node_1=child(div);{var consequent=$$anchor3=>{Check($$anchor3,{class:"size-3.5"})},consequent_1=$$anchor3=>{Minus($$anchor3,{class:"size-3.5"})};if_block(node_1,$$render=>{checked2()?
+$$render(consequent):indeterminate2()&&$$render(consequent_1,1)})}reset(div),append($$anchor2,div)};let $0=user_derived(()=>cn$1("peer flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=ch\
+ecked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",$$props.class));component(node2,()=>Checkbox$1,($$anchor2,CheckboxPrimitive_Root)=>{CheckboxPrimitive_Root($$anchor2,spread_props({"data-slot":"checkbox",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},get checked(){return checked()},set checked($$value){checked($$value)},get indeterminate(){
+return indeterminate()},set indeterminate($$value){indeterminate($$value)},children,$$slots:{default:!0}}))})}append($$anchor,fragment),pop()}var root_1$X=from_html("<input/>"),root_2$15=from_html("<input/>");function Input($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),value=prop($$props,"value",15),files=prop($$props,"files",15),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","value","type","files","class"]);var fragment=comment$2(),node2=first_child(
+fragment);{var consequent=$$anchor2=>{var input=root_1$X();attribute_effect(input,$0=>({"data-slot":"input",class:$0,type:"file",...restProps}),[()=>cn$1("flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 pt-1.5 text-sm font-medium shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","\
+focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",$$props.class)],void 0,void 0,void 0,!0),bind_this(input,$$value=>ref2($$value),()=>ref2()),bind_files(input,files),bind_value(input,value),append($$anchor2,input)},alternate=$$anchor2=>{var input_1=root_2$15();attribute_effect(input_1,$0=>({"data-slot":"input",class:$0,style:"backdrop-filter: blur(0.5rem);",type:$$props.
+type,...restProps}),[()=>cn$1("flex h-9 w-full min-w-0 rounded-md border border-input bg-background px-3 py-1 text-base shadow-xs ring-offset-background transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destruc\
+tive/20 dark:aria-invalid:ring-destructive/40",$$props.class)],void 0,void 0,void 0,!0),bind_this(input_1,$$value=>ref2($$value),()=>ref2()),bind_value(input_1,value),append($$anchor2,input_1)};if_block(node2,$$render=>{$$props.type==="file"?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_1$W=from_html('<button type="button" class="absolute top-1/2 right-3 -translate-y-1/2 transform cursor-pointer text-muted-foreground transition-colors hover:text-foregroun\
+d"><!></button>'),root$1D=from_html("<div><!> <!> <!></div>");function SearchInput($$anchor,$$props){push$1($$props,!0);let value=prop($$props,"value",15,""),placeholder=prop($$props,"placeholder",3,"Search..."),ref2=prop($$props,"ref",15,null),isCancelAlwaysVisible=prop($$props,"isCancelAlwaysVisible",3,!1),showClearButton=user_derived(()=>isCancelAlwaysVisible()||!!value()||!!$$props.onClose);function handleInput(event2){const target2=event2.target;value(target2.value),$$props.onInput?.(target2.
+value)}function handleClear(){value()?(value(""),$$props.onInput?.(""),ref2()?.focus()):$$props.onClose?.()}var div=root$1D(),node2=child(div);Search(node2,{class:"absolute top-1/2 left-3 z-10 h-4 w-4 -translate-y-1/2 transform text-muted-foreground"});var node_1=sibling(node2,2);{let $0=user_derived(()=>get$3(showClearButton)?"pr-9":"");Input(node_1,{get id(){return $$props.id},get class(){return`pl-9 ${get$3($0)??""}`},oninput:handleInput,get onkeydown(){return $$props.onKeyDown},get placeholder(){
+return placeholder()},type:"search",get value(){return value()},set value($$value){value($$value)},get ref(){return ref2()},set ref($$value){ref2($$value)}})}var node_2=sibling(node_1,2);{var consequent=$$anchor2=>{var button=root_1$W(),node_3=child(button);X(node_3,{class:"h-4 w-4"}),reset(button),template_effect(()=>set_attribute(button,"aria-label",value()?"Clear search":"Close")),delegated("click",button,handleClear),append($$anchor2,button)};if_block(node_2,$$render=>{get$3(showClearButton)&&
+$$render(consequent)})}reset(div),template_effect(()=>set_class(div,1,`relative ${$$props.class??""}`)),append($$anchor,div),pop()}delegate(["click"]);var root_1$V=from_html("<!> <!>",1);function Scroll_area_scrollbar($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),orientation=prop($$props,"orientation",3,"vertical"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","orientation","children"]);var fragment=comment$2(),node2=first_child(fragment);
+{let $0=user_derived(()=>cn$1("flex touch-none p-px transition-colors select-none",orientation()==="vertical"&&"h-full w-2.5 border-l border-l-transparent",orientation()==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",$$props.class));component(node2,()=>Scroll_area_scrollbar$1,($$anchor2,ScrollAreaPrimitive_Scrollbar)=>{ScrollAreaPrimitive_Scrollbar($$anchor2,spread_props({"data-slot":"scroll-area-scrollbar",get orientation(){return orientation()},get class(){return get$3($0)}},()=>restProps,
+{get ref(){return ref2()},set ref($$value){ref2($$value)},children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$V(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.children??noop$3);var node_2=sibling(node_1,2);component(node_2,()=>Scroll_area_thumb,($$anchor4,ScrollAreaPrimitive_Thumb)=>{ScrollAreaPrimitive_Thumb($$anchor4,{"data-slot":"scroll-area-thumb",class:"relative flex-1 rounded-full bg-border"})}),append($$anchor3,fragment_1)},$$slots:{default:!0}}))})}append($$anchor,fragment),
+pop()}var root_1$U=from_html("<!> <!> <!> <!>",1);function Scroll_area($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),orientation=prop($$props,"orientation",3,"vertical"),scrollbarXClasses=prop($$props,"scrollbarXClasses",3,""),scrollbarYClasses=prop($$props,"scrollbarYClasses",3,""),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","orientation","scrollbarXClasses","scrollbarYClasses","children"]);var fragment=comment$2(),node2=first_child(fragment);
+{let $0=user_derived(()=>cn$1("relative",$$props.class));component(node2,()=>Scroll_area$1,($$anchor2,ScrollAreaPrimitive_Root)=>{ScrollAreaPrimitive_Root($$anchor2,spread_props({"data-slot":"scroll-area",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$U(),node_1=first_child(fragment_1);component(node_1,()=>Scroll_area_viewport,($$anchor4,ScrollAreaPrimitive_Viewport)=>{ScrollAreaPrimitive_Viewport(
+$$anchor4,{"data-slot":"scroll-area-viewport",class:"size-full rounded-[inherit] ring-ring/10 outline-ring/50 transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 dark:ring-ring/20 dark:outline-ring/40",children:($$anchor5,$$slotProps2)=>{var fragment_2=comment$2(),node_2=first_child(fragment_2);snippet(node_2,()=>$$props.children??noop$3),append($$anchor5,fragment_2)},$$slots:{default:!0}})});var node_3=sibling(node_1,2);{var consequent=$$anchor4=>{Scroll_area_scrollbar($$anchor4,
+{orientation:"vertical",get class(){return scrollbarYClasses()}})};if_block(node_3,$$render=>{(orientation()==="vertical"||orientation()==="both")&&$$render(consequent)})}var node_4=sibling(node_3,2);{var consequent_1=$$anchor4=>{Scroll_area_scrollbar($$anchor4,{orientation:"horizontal",get class(){return scrollbarXClasses()}})};if_block(node_4,$$render=>{(orientation()==="horizontal"||orientation()==="both")&&$$render(consequent_1)})}var node_5=sibling(node_4,2);component(node_5,()=>Scroll_area_corner,
+($$anchor4,ScrollAreaPrimitive_Corner)=>{ScrollAreaPrimitive_Corner($$anchor4,{})}),append($$anchor3,fragment_1)},$$slots:{default:!0}}))})}append($$anchor,fragment),pop()}var root_3$W=from_html('<tr><td colspan="3" class="p-8 text-center text-sm text-muted-foreground"><!></td></tr>'),root_7$s=from_html('<tr class="cursor-pointer border-b transition-colors hover:bg-muted/50"><td class="p-3"><!></td><td class="p-3 text-sm"><div class="max-w-[17rem] truncate"> </div></td><td class="p-3 text-sm tex\
+t-muted-foreground"> </td></tr>'),root_2$14=from_html('<table class="w-full"><thead class="sticky top-0 z-10 bg-muted"><tr class="border-b"><th class="w-12 p-3 text-left"><!></th><th class="p-3 text-left text-sm font-medium">Conversation Name</th><th class="w-32 p-3 text-left text-sm font-medium">Messages</th></tr></thead><tbody><!></tbody></table>'),root$1C=from_html('<div class="space-y-4"><!> <div class="flex items-center justify-between text-sm text-muted-foreground"><span> <!></span></div> \
+<div class="overflow-hidden rounded-md border"><!></div> <div class="flex justify-end gap-2"><!> <!></div></div>');function ConversationSelection($$anchor,$$props){push$1($$props,!0);let messageCountMap=prop($$props,"messageCountMap",19,()=>new Map),searchQuery=state$1(""),selectedIds=state$1(getInitialSelectedIds()),lastClickedId=state$1(null);function getInitialSelectedIds(){return new SvelteSet($$props.conversations.map(c2=>c2.id))}let filteredConversations=user_derived(()=>$$props.conversations.
+filter(conv=>(conv.name||"Untitled conversation").toLowerCase().includes(get$3(searchQuery).toLowerCase()))),allSelected=user_derived(()=>get$3(filteredConversations).length>0&&get$3(filteredConversations).every(conv=>get$3(selectedIds).has(conv.id))),someSelected=user_derived(()=>get$3(filteredConversations).some(conv=>get$3(selectedIds).has(conv.id))&&!get$3(allSelected));function toggleConversation(id2,shiftKey=!1){const newSet=new SvelteSet(get$3(selectedIds));if(shiftKey&&get$3(lastClickedId)!==
+null){const lastIndex=get$3(filteredConversations).findIndex(c2=>c2.id===get$3(lastClickedId)),currentIndex=get$3(filteredConversations).findIndex(c2=>c2.id===id2);if(lastIndex!==-1&¤tIndex!==-1){const start2=Math.min(lastIndex,currentIndex),end=Math.max(lastIndex,currentIndex),shouldSelect=!newSet.has(id2);for(let i=start2;i<=end;i++)shouldSelect?newSet.add(get$3(filteredConversations)[i].id):newSet.delete(get$3(filteredConversations)[i].id);set$1(selectedIds,newSet);return}}newSet.has(id2)?
+newSet.delete(id2):newSet.add(id2),set$1(selectedIds,newSet),set$1(lastClickedId,id2,!0)}function toggleAll(){if(get$3(allSelected)){const newSet=new SvelteSet(get$3(selectedIds));get$3(filteredConversations).forEach(conv=>newSet.delete(conv.id)),set$1(selectedIds,newSet)}else{const newSet=new SvelteSet(get$3(selectedIds));get$3(filteredConversations).forEach(conv=>newSet.add(conv.id)),set$1(selectedIds,newSet)}}function handleConfirm(){const selected=$$props.conversations.filter(conv=>get$3(selectedIds).
+has(conv.id));$$props.onConfirm(selected)}function handleCancel(){set$1(selectedIds,getInitialSelectedIds()),set$1(searchQuery,""),set$1(lastClickedId,null),$$props.onCancel()}function reset$1(){set$1(selectedIds,getInitialSelectedIds()),set$1(searchQuery,""),set$1(lastClickedId,null)}var $$exports={reset:reset$1},div=root$1C(),node2=child(div);SearchInput(node2,{placeholder:"Search conversations...",get value(){return get$3(searchQuery)},set value($$value){set$1(searchQuery,$$value,!0)}});var div_1=sibling(
+node2,2),span=child(div_1),text2=child(span),node_1=sibling(text2);{var consequent=$$anchor2=>{var text_1=text$8();template_effect(()=>set_text(text_1,`(${get$3(filteredConversations).length??""} shown)`)),append($$anchor2,text_1)};if_block(node_1,$$render=>{get$3(searchQuery)&&$$render(consequent)})}reset(span),reset(div_1);var div_2=sibling(div_1,2),node_2=child(div_2);Scroll_area(node_2,{class:"h-[400px]",children:($$anchor2,$$slotProps)=>{var table2=root_2$14(),thead2=child(table2),tr2=child(
+thead2),th=child(tr2),node_3=child(th);Checkbox(node_3,{get checked(){return get$3(allSelected)},get indeterminate(){return get$3(someSelected)},onCheckedChange:toggleAll}),reset(th),next$1(2),reset(tr2),reset(thead2);var tbody2=sibling(thead2),node_4=child(tbody2);{var consequent_2=$$anchor3=>{var tr_1=root_3$W(),td=child(tr_1),node_5=child(td);{var consequent_1=$$anchor4=>{var text_2=text$8();template_effect(()=>set_text(text_2,`No conversations found matching "${get$3(searchQuery)??""}"`)),append(
+$$anchor4,text_2)},alternate=$$anchor4=>{var text_3=text$8("No conversations available");append($$anchor4,text_3)};if_block(node_5,$$render=>{get$3(searchQuery)?$$render(consequent_1):$$render(alternate,-1)})}reset(td),reset(tr_1),append($$anchor3,tr_1)},alternate_1=$$anchor3=>{var fragment_2=comment$2(),node_6=first_child(fragment_2);each(node_6,17,()=>get$3(filteredConversations),conv=>conv.id,($$anchor4,conv)=>{var tr_2=root_7$s(),td_1=child(tr_2),node_7=child(td_1);{let $0=user_derived(()=>get$3(
+selectedIds).has(get$3(conv).id));Checkbox(node_7,{get checked(){return get$3($0)},onclick:event2=>{event2.preventDefault(),event2.stopPropagation(),toggleConversation(get$3(conv).id,event2.shiftKey)}})}reset(td_1);var td_2=sibling(td_1),div_3=child(td_2),text_4=child(div_3,!0);reset(div_3),reset(td_2);var td_3=sibling(td_2),text_5=child(td_3,!0);reset(td_3),reset(tr_2),template_effect($0=>{set_attribute(div_3,"title",get$3(conv).name||"Untitled conversation"),set_text(text_4,get$3(conv).name||"\
+Untitled conversation"),set_text(text_5,$0)},[()=>messageCountMap().get(get$3(conv).id)??0]),delegated("click",tr_2,event2=>toggleConversation(get$3(conv).id,event2.shiftKey)),append($$anchor4,tr_2)}),append($$anchor3,fragment_2)};if_block(node_4,$$render=>{get$3(filteredConversations).length===0?$$render(consequent_2):$$render(alternate_1,-1)})}reset(tbody2),reset(table2),append($$anchor2,table2)},$$slots:{default:!0}}),reset(div_2);var div_4=sibling(div_2,2),node_8=child(div_4);Button(node_8,{
+variant:"outline",onclick:handleCancel,children:($$anchor2,$$slotProps)=>{next$1();var text_6=text$8("Cancel");append($$anchor2,text_6)},$$slots:{default:!0}});var node_9=sibling(node_8,2);{let $0=user_derived(()=>get$3(selectedIds).size===0);Button(node_9,{onclick:handleConfirm,get disabled(){return get$3($0)},children:($$anchor2,$$slotProps)=>{next$1();var text_7=text$8();template_effect(()=>set_text(text_7,`${$$props.mode==="export"?"Export":"Import"} (${get$3(selectedIds).size??""})`)),append(
+$$anchor2,text_7)},$$slots:{default:!0}})}return reset(div_4),reset(div),template_effect(()=>set_text(text2,`${get$3(selectedIds).size??""} of ${$$props.conversations.length??""} selected `)),append($$anchor,div),pop($$exports)}delegate(["click"]);var root$1B=from_html('<div><button aria-label="Scroll left"><!></button> <div><!></div> <button aria-label="Scroll right"><!></button></div>');function HorizontalScrollCarousel($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,
+""),gapSize=prop($$props,"gapSize",3,"3"),canScrollLeft=state$1(!1),canScrollRight=state$1(!1),scrollContainer=state$1(void 0);function scrollLeft(event2){event2?.stopPropagation(),event2?.preventDefault(),get$3(scrollContainer)&&get$3(scrollContainer).scrollBy({left:get$3(scrollContainer).clientWidth*-.67,behavior:"smooth"})}function scrollRight(event2){event2?.stopPropagation(),event2?.preventDefault(),get$3(scrollContainer)&&get$3(scrollContainer).scrollBy({left:get$3(scrollContainer).clientWidth*
+.67,behavior:"smooth"})}function updateScrollButtons(){if(!get$3(scrollContainer))return;const{scrollLeft:scrollLeft2,scrollWidth,clientWidth}=get$3(scrollContainer);set$1(canScrollLeft,scrollLeft2>0),set$1(canScrollRight,scrollLeft2<scrollWidth-clientWidth-1);const isScrollable=scrollWidth>clientWidth;$$props.onScrollableChange?.(isScrollable)}function resetScroll(){get$3(scrollContainer)&&(get$3(scrollContainer).scrollLeft=0,setTimeout(()=>{updateScrollButtons()},0))}user_effect(()=>{get$3(scrollContainer)&&
+setTimeout(()=>{updateScrollButtons()},0)});var $$exports={resetScroll},div=root$1B(),button=child(div),node2=child(button);Chevron_left(node2,{class:"h-4 w-4"}),reset(button);var div_1=sibling(button,2),node_1=child(div_1);snippet(node_1,()=>$$props.children??noop$3),reset(div_1),bind_this(div_1,$$value=>set$1(scrollContainer,$$value),()=>get$3(scrollContainer));var button_1=sibling(div_1,2),node_2=child(button_1);return Chevron_right(node_2,{class:"h-4 w-4"}),reset(button_1),reset(div),template_effect(
+()=>{set_class(div,1,`relative ${className()??""}`),set_class(button,1,`absolute top-1/2 left-4 z-10 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-full bg-background/25 shadow-md backdrop-blur-xs transition-opacity hover:bg-background/45 ${get$3(canScrollLeft)?"opacity-100":"pointer-events-none opacity-0"}`),set_class(div_1,1,`scrollbar-hide flex items-start gap-${gapSize()??""} overflow-x-auto`),set_class(button_1,1,`absolute top-1/2 right-4 z-10 flex h-6 w-6 -translate-y-1/\
+2 items-center justify-center rounded-full bg-background/25 shadow-md backdrop-blur-xs transition-opacity hover:bg-background/45 ${get$3(canScrollRight)?"opacity-100":"pointer-events-none opacity-0"}`)}),delegated("click",button,scrollLeft),event("scroll",div_1,updateScrollButtons),delegated("click",button_1,scrollRight),append($$anchor,div),pop($$exports)}delegate(["click"]);var root_3$V=from_html('<span class="block truncate"> </span>'),root_4$B=from_html("<p> </p>"),root_2$13=from_html("<!> <\
+!>",1),root_5$v=from_html("<span> </span>");function TruncatedText($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),showTooltip=prop($$props,"showTooltip",3,!0),textElement=state$1(void 0),isTruncated=state$1(!1);function checkTruncation(){get$3(textElement)&&set$1(isTruncated,get$3(textElement).scrollWidth>get$3(textElement).clientWidth)}user_effect(()=>{if(get$3(textElement)){checkTruncation();const observer=new ResizeObserver(checkTruncation);return observer.observe(
+get$3(textElement)),()=>observer.disconnect()}});var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Root$5,($$anchor3,Tooltip_Root)=>{Tooltip_Root($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_2=root_2$13(),node_2=first_child(fragment_2);component(node_2,()=>Tooltip_trigger,($$anchor5,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor5,{get class(){return`${className()??""} min-w-0`},
+children:($$anchor6,$$slotProps2)=>{var span=root_3$V(),text_1=child(span,!0);reset(span),bind_this(span,$$value=>set$1(textElement,$$value),()=>get$3(textElement)),template_effect(()=>set_text(text_1,$$props.text)),append($$anchor6,span)},$$slots:{default:!0}})});var node_3=sibling(node_2,2);component(node_3,()=>Tooltip_content,($$anchor5,Tooltip_Content)=>{Tooltip_Content($$anchor5,{class:"z-[9999]",children:($$anchor6,$$slotProps2)=>{var p2=root_4$B(),text_2=child(p2,!0);reset(p2),template_effect(
+()=>set_text(text_2,$$props.text)),append($$anchor6,p2)},$$slots:{default:!0}})}),append($$anchor4,fragment_2)},$$slots:{default:!0}})}),append($$anchor2,fragment_1)},alternate=$$anchor2=>{var span_1=root_5$v(),text_3=child(span_1,!0);reset(span_1),bind_this(span_1,$$value=>set$1(textElement,$$value),()=>get$3(textElement)),template_effect(()=>{set_class(span_1,1,`${className()??""} block min-w-0 truncate`),set_text(text_3,$$props.text)}),append($$anchor2,span_1)};if_block(node2,$$render=>{get$3(
+isTruncated)&&showTooltip()?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_3$U=from_html("<span>⌘</span>"),root_5$u=from_html("<span></span>"),root_1$T=from_html("<!> <!>",1),root$1A=from_html("<kbd></kbd>");function KeyboardShortcutInfo($$anchor,$$props){push$1($$props,!0);let variant=prop($$props,"variant",3,"default"),className=prop($$props,"class",3,""),variantClasses=user_derived(()=>variant()==="destructive"?"text-destructive":"text-muted-foregroun\
+d");var kbd=root$1A();each(kbd,21,()=>$$props.keys,index$2,($$anchor2,key2,index2)=>{var fragment=root_1$T(),node2=first_child(fragment);{var consequent=$$anchor3=>{{let $0=user_derived(()=>variant()==="destructive"?"text-destructive":"");Arrow_big_up($$anchor3,{get class(){return`h-1 w-1 ${get$3($0)??""} -mr-1`}})}},consequent_1=$$anchor3=>{var span=root_3$U();template_effect(()=>set_class(span,1,clsx(variant()==="destructive"?"text-destructive":""))),append($$anchor3,span)},alternate=$$anchor3=>{
+var text2=text$8();template_effect($0=>set_text(text2,$0),[()=>get$3(key2).toUpperCase()]),append($$anchor3,text2)};if_block(node2,$$render=>{get$3(key2)==="shift"?$$render(consequent):get$3(key2)==="cmd"?$$render(consequent_1,1):$$render(alternate,-1)})}var node_1=sibling(node2,2);{var consequent_2=$$anchor3=>{var span_1=root_5$u();append($$anchor3,span_1)};if_block(node_1,$$render=>{index2<$$props.keys.length-1&&$$render(consequent_2)})}append($$anchor2,fragment)}),reset(kbd),template_effect(()=>set_class(
+kbd,1,`px-1 pointer-events-none inline-flex select-none items-center gap-0.5 font-sans text-md font-medium opacity-0 transition-opacity -my-1 ${get$3(variantClasses)??""} ${className()??""}`)),append($$anchor,kbd),pop()}var root$1z=from_html('<div class="code-block-actions"><!> <!></div>');function CodeBlockActions($$anchor,$$props){push$1($$props,!0);let disabled=prop($$props,"disabled",3,!1);const showPreview=user_derived(()=>$$props.language?.toLowerCase()===FileTypeText.HTML);var div=root$1z(),
+node2=child(div);{let $0=user_derived(()=>!disabled()),$1=user_derived(()=>disabled()?"Code incomplete":"Copy code");ActionIconCopyToClipboard(node2,{get text(){return $$props.code},get canCopy(){return get$3($0)},get ariaLabel(){return get$3($1)}})}var node_1=sibling(node2,2);{var consequent=$$anchor2=>{{let $0=user_derived(()=>disabled()?"Code incomplete":"Preview code");ActionIcon($$anchor2,{get icon(){return Eye},get tooltip(){return get$3($0)},get disabled(){return disabled()},onclick:()=>$$props.
+onPreview($$props.code,$$props.language)})}};if_block(node_1,$$render=>{get$3(showPreview)&&$$render(consequent)})}reset(div),append($$anchor,div),pop()}var root_4$A=from_html('<img class="h-12 w-12 object-cover"/>'),root_5$t=from_html('<div class="bg-foreground-muted/50 flex h-12 w-12 flex-col items-center justify-center gap-0.5 py-1"><!> <span class="font-mono text-[9px] text-white/60"> </span></div>'),root_3$T=from_html("<button><!></button>"),root_1$S=from_html('<div class="sticky bottom-0 z\
+-10 mt-4 flex-shrink-0"><!></div>');function ChatAttachmentsPreviewThumbnailStrip($$anchor,$$props){push$1($$props,!0);function getFileExtension(name){const parts=name.split(".");return parts.length>1?parts.pop()?.toUpperCase()??"":""}var fragment=comment$2(),node2=first_child(fragment);{var consequent_2=$$anchor2=>{var div=root_1$S(),node_1=child(div);HorizontalScrollCarousel(node_1,{class:"max-w-full",children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_2=first_child(fragment_1);
+each(node_2,19,()=>$$props.items,item=>item.id,($$anchor4,item,index2)=>{var button=root_3$T(),node_3=child(button);{var consequent=$$anchor5=>{var img=root_4$A();template_effect(()=>{set_attribute(img,"src",get$3(item).preview),set_attribute(img,"alt",get$3(item).name)}),append($$anchor5,img)},alternate_1=$$anchor5=>{var div_1=root_5$t(),node_4=child(div_1);{var consequent_1=$$anchor6=>{Music($$anchor6,{class:"h-4 w-4 text-white/70"})},alternate=$$anchor6=>{File_text($$anchor6,{class:"h-4 w-4 t\
+ext-white/70"})};if_block(node_4,$$render=>{get$3(item).isAudio?$$render(consequent_1):$$render(alternate,-1)})}var span=sibling(node_4,2),text2=child(span,!0);reset(span),reset(div_1),template_effect($0=>set_text(text2,$0),[()=>getFileExtension(get$3(item).name)]),append($$anchor5,div_1)};if_block(node_3,$$render=>{get$3(item).isImage&&get$3(item).preview?$$render(consequent):$$render(alternate_1,-1)})}reset(button),template_effect(()=>{set_attribute(button,"data-thumbnail-index",get$3(index2)),
+set_class(button,1,clsx(["relative flex-shrink-0 cursor-pointer overflow-hidden rounded border-2 bg-black/80 backdrop-blur-sm transition-all hover:opacity-90",get$3(index2)===$$props.currentIndex?"border-white":"border-transparent opacity-60","[&:not(:first-child)]:last:mr-4 [&:not(:last-child)]:first:ml-4"])),set_attribute(button,"aria-label",`Go to ${get$3(item).name}`)}),delegated("click",button,()=>$$props.onNavigate(get$3(index2))),append($$anchor4,button)}),append($$anchor3,fragment_1)},$$slots:{
+default:!0}}),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.items.length>1&&$$render(consequent_2)})}append($$anchor,fragment),pop()}delegate(["click"]);const alertVariants=tv({base:"relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",variants:{variant:{default:"bg-card text-card-foreground",destructive:"\
+text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});var root$1y=from_html("<div><!></div>");function Alert($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),variant=prop($$props,"variant",3,"default"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","variant","children"]);var div=root$1y();attribute_effect(div,$0=>({"data-slot":"alert",class:$0,...restProps,role:"\
+alert"}),[()=>cn$1(alertVariants({variant:variant()}),$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}var root$1x=from_html("<div><!></div>");function Alert_description($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$1x();attribute_effect(div,$0=>({"d\
+ata-slot":"alert-description",class:$0,...restProps}),[()=>cn$1("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}var root$1w=from_html("<div><!></div>");function Alert_title($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$sl\
+ots","$$events","$$legacy","ref","class","children"]);var div=root$1w();attribute_effect(div,$0=>({"data-slot":"alert-title",class:$0,...restProps}),[()=>cn$1("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}class AudioRecorder{mediaRecorder=null;audioChunks=[];stream=null;recordingState=!1;async startRecording(){try{
+this.stream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),this.initializeRecorder(this.stream),this.audioChunks=[],this.mediaRecorder.start(100),this.recordingState=!0}catch(error2){throw console.error("Failed to start recording:",error2),new Error("Failed to access microphone. Please check permissions.")}}async stopRecording(){return new Promise((resolve2,reject)=>{const recorder=this.mediaRecorder,chunks=this.audioChunks,stream=this.
+stream;if(!recorder||recorder.state==="inactive"){reject(new Error("No active recording to stop"));return}this.mediaRecorder=null,this.audioChunks=[],this.stream=null,this.recordingState=!1,recorder.onstop=()=>{const audioBlob=new Blob(chunks,{type:recorder.mimeType||MimeTypeAudio.WAV});if(stream)for(const track2 of stream.getTracks())track2.stop();resolve2(audioBlob)},recorder.onerror=event2=>{if(console.error("Recording error:",event2),stream)for(const track2 of stream.getTracks())track2.stop();
+reject(new Error("Recording failed"))},recorder.stop()})}isRecording(){return this.recordingState}cancelRecording(){const recorder=this.mediaRecorder,stream=this.stream;if(this.mediaRecorder=null,this.audioChunks=[],this.stream=null,this.recordingState=!1,recorder&&recorder.state!=="inactive"&&(recorder.onstop=null,recorder.onerror=null,recorder.stop()),stream)for(const track2 of stream.getTracks())track2.stop()}initializeRecorder(stream){const options={};MediaRecorder.isTypeSupported(MimeTypeAudio.
+WAV)?options.mimeType=MimeTypeAudio.WAV:MediaRecorder.isTypeSupported(MimeTypeAudio.WEBM_OPUS)?options.mimeType=MimeTypeAudio.WEBM_OPUS:MediaRecorder.isTypeSupported(MimeTypeAudio.WEBM)?options.mimeType=MimeTypeAudio.WEBM:MediaRecorder.isTypeSupported(MimeTypeAudio.MP4)?options.mimeType=MimeTypeAudio.MP4:console.warn("No preferred audio format supported, using default"),this.mediaRecorder=new MediaRecorder(stream,options),this.mediaRecorder.ondataavailable=event2=>{event2.data.size>0&&this.audioChunks.
+push(event2.data)},this.mediaRecorder.onstop=()=>{this.recordingState=!1},this.mediaRecorder.onerror=event2=>{console.error("MediaRecorder error:",event2),this.recordingState=!1}}}async function convertToWav(audioBlob){try{if(audioBlob.type.includes("wav"))return audioBlob;const arrayBuffer=await audioBlob.arrayBuffer(),audioContext=new(window.AudioContext||window.webkitAudioContext);try{const audioBuffer=await audioContext.decodeAudioData(arrayBuffer);return audioBufferToWav(audioBuffer)}finally{
+audioContext.close()}}catch(error2){return console.error("Failed to convert audio to WAV:",error2),audioBlob}}function audioBufferToWav(buffer){const length=buffer.length,numberOfChannels=buffer.numberOfChannels,sampleRate=buffer.sampleRate,blockAlign=numberOfChannels*2,byteRate=sampleRate*blockAlign,dataSize=length*blockAlign,bufferSize=44+dataSize,arrayBuffer=new ArrayBuffer(bufferSize),view=new DataView(arrayBuffer),writeString=(offset2,string2)=>{for(let i=0;i<string2.length;i++)view.setUint8(
+offset2+i,string2.charCodeAt(i))};writeString(0,"RIFF"),view.setUint32(4,bufferSize-8,!0),writeString(8,"WAVE"),writeString(12,"fmt "),view.setUint32(16,16,!0),view.setUint16(20,1,!0),view.setUint16(22,numberOfChannels,!0),view.setUint32(24,sampleRate,!0),view.setUint32(28,byteRate,!0),view.setUint16(32,blockAlign,!0),view.setUint16(34,16,!0),writeString(36,"data"),view.setUint32(40,dataSize,!0);const channels=new Array(numberOfChannels);for(let c2=0;c2<numberOfChannels;c2++)channels[c2]=buffer.
+getChannelData(c2);const pcm=new Int16Array(arrayBuffer,44,length*numberOfChannels);let p2=0;for(let i=0;i<length;i++)for(let c2=0;c2<numberOfChannels;c2++){let s2=channels[c2][i];s2>1?s2=1:s2<-1&&(s2=-1),pcm[p2++]=s2*32767}return new Blob([arrayBuffer],{type:MimeTypeAudio.WAV})}function createAudioFile(audioBlob,filename){const timestamp=new Date().toISOString().replace(/[:.]/g,"-"),extension2=audioBlob.type.includes("wav")?"wav":"mp3",defaultFilename=`recording-${timestamp}.${extension2}`;return new File(
+[audioBlob],defaultFilename,{type:audioBlob.type,lastModified:Date.now()})}function isAudioRecordingSupported(){return!!(typeof navigator<"u"&&navigator.mediaDevices&&typeof navigator.mediaDevices.getUserMedia=="function"&&typeof window<"u"&&window.MediaRecorder)}const isNodeJS=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],LINE_FACTOR=1.35,RenderingIntentFlag={
+ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},AnnotationEditorPrefix="pdfjs_internal_editor_",AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,SIGNATURE:101,COMMENT:102},AnnotationEditorParamsType={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,
+HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},util_ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,
+UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},VerbosityLevel={ERRORS:0,WARNINGS:1,INFOS:5},OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,
+curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,
+setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,
+endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},DrawOPS={moveTo:0,lineTo:1,curveTo:2,closePath:3},PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let verbosity=VerbosityLevel.WARNINGS;function setVerbosityLevel(level){
+Number.isInteger(level)&&(verbosity=level)}function getVerbosityLevel(){return verbosity}function info(msg){verbosity>=VerbosityLevel.INFOS&&console.log(`Info: ${msg}`)}function warn(msg){verbosity>=VerbosityLevel.WARNINGS&&console.log(`Warning: ${msg}`)}function unreachable(msg){throw new Error(msg)}function assert$1(cond,msg){cond||unreachable(msg)}function _isValidProtocol(url2){switch(url2?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function createValidAbsoluteUrl(url2,baseUrl=null,options=null){
+if(!url2)return null;if(options&&typeof url2=="string"&&(options.addDefaultProtocol&&url2.startsWith("www.")&&url2.match(/\./g)?.length>=2&&(url2=`http://${url2}`),options.tryConvertEncoding))try{url2=stringToUTF8String(url2)}catch{}const absoluteUrl=baseUrl?URL.parse(url2,baseUrl):URL.parse(url2);return _isValidProtocol(absoluteUrl)?absoluteUrl:null}function updateUrlHash(url2,hash2,allowRel=!1){const res=URL.parse(url2);return res?(res.hash=hash2,res.href):allowRel&&createValidAbsoluteUrl(url2,
+"http://example.com")?url2.split("#",1)[0]+`${hash2?`#${hash2}`:""}`:""}function shadow(obj,prop2,value,nonSerializable=!1){return Object.defineProperty(obj,prop2,{value,enumerable:!nonSerializable,configurable:!0,writable:!1}),value}const BaseException=(function(){function BaseException2(message,name){this.message=message,this.name=name}return BaseException2.prototype=new Error,BaseException2.constructor=BaseException2,BaseException2})();class PasswordException extends BaseException{constructor(msg,code2){
+super(msg,"PasswordException"),this.code=code2}}class UnknownErrorException extends BaseException{constructor(msg,details){super(msg,"UnknownErrorException"),this.details=details}}class InvalidPDFException extends BaseException{constructor(msg){super(msg,"InvalidPDFException")}}class ResponseException extends BaseException{constructor(msg,status,missing){super(msg,"ResponseException"),this.status=status,this.missing=missing}}class FormatError extends BaseException{constructor(msg){super(msg,"For\
+matError")}}class AbortException extends BaseException{constructor(msg){super(msg,"AbortException")}}function bytesToString(bytes){(typeof bytes!="object"||bytes?.length===void 0)&&unreachable("Invalid argument for bytesToString");const length=bytes.length,MAX_ARGUMENT_COUNT=8192;if(length<MAX_ARGUMENT_COUNT)return String.fromCharCode.apply(null,bytes);const strBuf=[];for(let i=0;i<length;i+=MAX_ARGUMENT_COUNT){const chunkEnd=Math.min(i+MAX_ARGUMENT_COUNT,length),chunk=bytes.subarray(i,chunkEnd);
+strBuf.push(String.fromCharCode.apply(null,chunk))}return strBuf.join("")}function stringToBytes(str){typeof str!="string"&&unreachable("Invalid argument for stringToBytes");const length=str.length,bytes=new Uint8Array(length);for(let i=0;i<length;++i)bytes[i]=str.charCodeAt(i)&255;return bytes}function string32(value){return String.fromCharCode(value>>24&255,value>>16&255,value>>8&255,value&255)}function isLittleEndian(){const buffer8=new Uint8Array(4);return buffer8[0]=1,new Uint32Array(buffer8.
+buffer,0,1)[0]===1}function isEvalSupported(){try{return new Function(""),!0}catch{return!1}}class util_FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",isLittleEndian())}static get isEvalSupported(){return shadow(this,"isEvalSupported",isEvalSupported())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return shadow(this,"isImageDecoderSupported",typeof ImageDecoder<
+"u")}static get platform(){const{platform:platform2,userAgent}=navigator;return shadow(this,"platform",{isAndroid:userAgent.includes("Android"),isLinux:platform2.includes("Linux"),isMac:platform2.includes("Mac"),isWindows:platform2.includes("Win"),isFirefox:userAgent.includes("Firefox")})}static get isCSSRoundSupported(){return shadow(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const hexNumbers=Array.from(Array(256).keys(),n=>n.toString(16).padStart(2,"0"));
+class Util{static makeHexColor(r2,g,b){return`#${hexNumbers[r2]}${hexNumbers[g]}${hexNumbers[b]}`}static scaleMinMax(transform2,minMax){let temp;transform2[0]?(transform2[0]<0&&(temp=minMax[0],minMax[0]=minMax[2],minMax[2]=temp),minMax[0]*=transform2[0],minMax[2]*=transform2[0],transform2[3]<0&&(temp=minMax[1],minMax[1]=minMax[3],minMax[3]=temp),minMax[1]*=transform2[3],minMax[3]*=transform2[3]):(temp=minMax[0],minMax[0]=minMax[1],minMax[1]=temp,temp=minMax[2],minMax[2]=minMax[3],minMax[3]=temp,
+transform2[1]<0&&(temp=minMax[1],minMax[1]=minMax[3],minMax[3]=temp),minMax[1]*=transform2[1],minMax[3]*=transform2[1],transform2[2]<0&&(temp=minMax[0],minMax[0]=minMax[2],minMax[2]=temp),minMax[0]*=transform2[2],minMax[2]*=transform2[2]),minMax[0]+=transform2[4],minMax[1]+=transform2[5],minMax[2]+=transform2[4],minMax[3]+=transform2[5]}static transform(m1,m2){return[m1[0]*m2[0]+m1[2]*m2[1],m1[1]*m2[0]+m1[3]*m2[1],m1[0]*m2[2]+m1[2]*m2[3],m1[1]*m2[2]+m1[3]*m2[3],m1[0]*m2[4]+m1[2]*m2[5]+m1[4],m1[1]*
+m2[4]+m1[3]*m2[5]+m1[5]]}static applyTransform(p2,m,pos=0){const p0=p2[pos],p1=p2[pos+1];p2[pos]=p0*m[0]+p1*m[2]+m[4],p2[pos+1]=p0*m[1]+p1*m[3]+m[5]}static applyTransformToBezier(p2,transform2,pos=0){const m0=transform2[0],m1=transform2[1],m2=transform2[2],m3=transform2[3],m4=transform2[4],m5=transform2[5];for(let i=0;i<6;i+=2){const pI=p2[pos+i],pI1=p2[pos+i+1];p2[pos+i]=pI*m0+pI1*m2+m4,p2[pos+i+1]=pI*m1+pI1*m3+m5}}static applyInverseTransform(p2,m){const p0=p2[0],p1=p2[1],d2=m[0]*m[3]-m[1]*m[2];
+p2[0]=(p0*m[3]-p1*m[2]+m[2]*m[5]-m[4]*m[3])/d2,p2[1]=(-p0*m[1]+p1*m[0]+m[4]*m[1]-m[5]*m[0])/d2}static axialAlignedBoundingBox(rect,transform2,output){const m0=transform2[0],m1=transform2[1],m2=transform2[2],m3=transform2[3],m4=transform2[4],m5=transform2[5],r0=rect[0],r1=rect[1],r2=rect[2],r3=rect[3];let a0=m0*r0+m4,a2=a0,a1=m0*r2+m4,a3=a1,b0=m3*r1+m5,b2=b0,b1=m3*r3+m5,b3=b1;if(m1!==0||m2!==0){const m1r0=m1*r0,m1r2=m1*r2,m2r1=m2*r1,m2r3=m2*r3;a0+=m2r1,a3+=m2r1,a1+=m2r3,a2+=m2r3,b0+=m1r0,b3+=m1r0,
+b1+=m1r2,b2+=m1r2}output[0]=Math.min(output[0],a0,a1,a2,a3),output[1]=Math.min(output[1],b0,b1,b2,b3),output[2]=Math.max(output[2],a0,a1,a2,a3),output[3]=Math.max(output[3],b0,b1,b2,b3)}static inverseTransform(m){const d2=m[0]*m[3]-m[1]*m[2];return[m[3]/d2,-m[1]/d2,-m[2]/d2,m[0]/d2,(m[2]*m[5]-m[4]*m[3])/d2,(m[4]*m[1]-m[5]*m[0])/d2]}static singularValueDecompose2dScale(matrix,output){const m0=matrix[0],m1=matrix[1],m2=matrix[2],m3=matrix[3],a=m0**2+m1**2,b=m0*m2+m1*m3,c2=m2**2+m3**2,first=(a+c2)/
+2,second=Math.sqrt(first**2-(a*c2-b**2));output[0]=Math.sqrt(first+second||1),output[1]=Math.sqrt(first-second||1)}static normalizeRect(rect){const r2=rect.slice(0);return rect[0]>rect[2]&&(r2[0]=rect[2],r2[2]=rect[0]),rect[1]>rect[3]&&(r2[1]=rect[3],r2[3]=rect[1]),r2}static intersect(rect1,rect2){const xLow=Math.max(Math.min(rect1[0],rect1[2]),Math.min(rect2[0],rect2[2])),xHigh=Math.min(Math.max(rect1[0],rect1[2]),Math.max(rect2[0],rect2[2]));if(xLow>xHigh)return null;const yLow=Math.max(Math.min(
+rect1[1],rect1[3]),Math.min(rect2[1],rect2[3])),yHigh=Math.min(Math.max(rect1[1],rect1[3]),Math.max(rect2[1],rect2[3]));return yLow>yHigh?null:[xLow,yLow,xHigh,yHigh]}static pointBoundingBox(x,y,minMax){minMax[0]=Math.min(minMax[0],x),minMax[1]=Math.min(minMax[1],y),minMax[2]=Math.max(minMax[2],x),minMax[3]=Math.max(minMax[3],y)}static rectBoundingBox(x0,y0,x1,y1,minMax){minMax[0]=Math.min(minMax[0],x0,x1),minMax[1]=Math.min(minMax[1],y0,y1),minMax[2]=Math.max(minMax[2],x0,x1),minMax[3]=Math.max(
+minMax[3],y0,y1)}static#getExtremumOnCurve(x0,x1,x2,x3,y0,y1,y2,y3,t,minMax){if(t<=0||t>=1)return;const mt=1-t,tt=t*t,ttt=tt*t,x=mt*(mt*(mt*x0+3*t*x1)+3*tt*x2)+ttt*x3,y=mt*(mt*(mt*y0+3*t*y1)+3*tt*y2)+ttt*y3;minMax[0]=Math.min(minMax[0],x),minMax[1]=Math.min(minMax[1],y),minMax[2]=Math.max(minMax[2],x),minMax[3]=Math.max(minMax[3],y)}static#getExtremum(x0,x1,x2,x3,y0,y1,y2,y3,a,b,c2,minMax){if(Math.abs(a)<1e-12){Math.abs(b)>=1e-12&&this.#getExtremumOnCurve(x0,x1,x2,x3,y0,y1,y2,y3,-c2/b,minMax);return}
+const delta=b**2-4*c2*a;if(delta<0)return;const sqrtDelta=Math.sqrt(delta),a2=2*a;this.#getExtremumOnCurve(x0,x1,x2,x3,y0,y1,y2,y3,(-b+sqrtDelta)/a2,minMax),this.#getExtremumOnCurve(x0,x1,x2,x3,y0,y1,y2,y3,(-b-sqrtDelta)/a2,minMax)}static bezierBoundingBox(x0,y0,x1,y1,x2,y2,x3,y3,minMax){minMax[0]=Math.min(minMax[0],x0,x3),minMax[1]=Math.min(minMax[1],y0,y3),minMax[2]=Math.max(minMax[2],x0,x3),minMax[3]=Math.max(minMax[3],y0,y3),this.#getExtremum(x0,x1,x2,x3,y0,y1,y2,y3,3*(-x0+3*(x1-x2)+x3),6*(x0-
+2*x1+x2),3*(x1-x0),minMax),this.#getExtremum(x0,x1,x2,x3,y0,y1,y2,y3,3*(-y0+3*(y1-y2)+y3),6*(y0-2*y1+y2),3*(y1-y0),minMax)}}function stringToUTF8String(str){return decodeURIComponent(escape(str))}let NormalizeRegex=null,NormalizationMap=null;function normalizeUnicode(str){return NormalizeRegex||(NormalizeRegex=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,
+NormalizationMap=new Map([["ſt","ſt"]])),str.replaceAll(NormalizeRegex,(_,p1,p2)=>p1?p1.normalize("NFKC"):NormalizationMap.get(p2))}function getUuid(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const buf=new Uint8Array(32);return crypto.getRandomValues(buf),bytesToString(buf)}const AnnotationPrefix="pdfjs_internal_id_";function _isValidExplicitDest(validRef,validName,dest){if(!Array.isArray(dest)||dest.length<2)return!1;const[page2,zoom,...args]=dest;if(!validRef(page2)&&
+!Number.isInteger(page2)||!validName(zoom))return!1;const argsLen=args.length;let allowNull=!0;switch(zoom.name){case"XYZ":if(argsLen<2||argsLen>3)return!1;break;case"Fit":case"FitB":return argsLen===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(argsLen>1)return!1;break;case"FitR":if(argsLen!==4)return!1;allowNull=!1;break;default:return!1}for(const arg of args)if(!(typeof arg=="number"||allowNull&&arg===null))return!1;return!0}function MathClamp(v,min2,max2){return Math.min(Math.max(v,min2),
+max2)}function toBase64Util(arr){return Uint8Array.prototype.toBase64?arr.toBase64():btoa(bytesToString(arr))}function fromBase64Util(str){return Uint8Array.fromBase64?Uint8Array.fromBase64(str):stringToBytes(atob(str))}typeof Promise.try!="function"&&(Promise.try=function(fn,...args){return new Promise(resolve2=>{resolve2(fn(...args))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(numbers){return numbers.reduce((a,b)=>a+b,0)});const SVG_NS="http://www.w3.org/2000/svg";class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.
+CSS/this.PDF}async function fetchData(url2,type2="text"){if(isValidFetchUrl(url2,document.baseURI)){const response=await fetch(url2);if(!response.ok)throw new Error(response.statusText);switch(type2){case"arraybuffer":return response.arrayBuffer();case"blob":return response.blob();case"json":return response.json()}return response.text()}return new Promise((resolve2,reject)=>{const request=new XMLHttpRequest;request.open("GET",url2,!0),request.responseType=type2,request.onreadystatechange=()=>{if(request.
+readyState===XMLHttpRequest.DONE){if(request.status===200||request.status===0){switch(type2){case"arraybuffer":case"blob":case"json":resolve2(request.response);return}resolve2(request.responseText);return}reject(new Error(request.statusText))}},request.send(null)})}class PageViewport{constructor({viewBox,userUnit,scale:scale2,rotation,offsetX=0,offsetY=0,dontFlip=!1}){this.viewBox=viewBox,this.userUnit=userUnit,this.scale=scale2,this.rotation=rotation,this.offsetX=offsetX,this.offsetY=offsetY,scale2*=
+userUnit;const centerX=(viewBox[2]+viewBox[0])/2,centerY=(viewBox[3]+viewBox[1])/2;let rotateA,rotateB,rotateC,rotateD;switch(rotation%=360,rotation<0&&(rotation+=360),rotation){case 180:rotateA=-1,rotateB=0,rotateC=0,rotateD=1;break;case 90:rotateA=0,rotateB=1,rotateC=1,rotateD=0;break;case 270:rotateA=0,rotateB=-1,rotateC=-1,rotateD=0;break;case 0:rotateA=1,rotateB=0,rotateC=0,rotateD=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}dontFlip&&
+(rotateC=-rotateC,rotateD=-rotateD);let offsetCanvasX,offsetCanvasY,width,height;rotateA===0?(offsetCanvasX=Math.abs(centerY-viewBox[1])*scale2+offsetX,offsetCanvasY=Math.abs(centerX-viewBox[0])*scale2+offsetY,width=(viewBox[3]-viewBox[1])*scale2,height=(viewBox[2]-viewBox[0])*scale2):(offsetCanvasX=Math.abs(centerX-viewBox[0])*scale2+offsetX,offsetCanvasY=Math.abs(centerY-viewBox[1])*scale2+offsetY,width=(viewBox[2]-viewBox[0])*scale2,height=(viewBox[3]-viewBox[1])*scale2),this.transform=[rotateA*
+scale2,rotateB*scale2,rotateC*scale2,rotateD*scale2,offsetCanvasX-rotateA*scale2*centerX-rotateC*scale2*centerY,offsetCanvasY-rotateB*scale2*centerX-rotateD*scale2*centerY],this.width=width,this.height=height}get rawDims(){const dims=this.viewBox;return shadow(this,"rawDims",{pageWidth:dims[2]-dims[0],pageHeight:dims[3]-dims[1],pageX:dims[0],pageY:dims[1]})}clone({scale:scale2=this.scale,rotation=this.rotation,offsetX=this.offsetX,offsetY=this.offsetY,dontFlip=!1}={}){return new PageViewport({viewBox:this.
+viewBox.slice(),userUnit:this.userUnit,scale:scale2,rotation,offsetX,offsetY,dontFlip})}convertToViewportPoint(x,y){const p2=[x,y];return Util.applyTransform(p2,this.transform),p2}convertToViewportRectangle(rect){const topLeft=[rect[0],rect[1]];Util.applyTransform(topLeft,this.transform);const bottomRight=[rect[2],rect[3]];return Util.applyTransform(bottomRight,this.transform),[topLeft[0],topLeft[1],bottomRight[0],bottomRight[1]]}convertToPdfPoint(x,y){const p2=[x,y];return Util.applyInverseTransform(
+p2,this.transform),p2}}class RenderingCancelledException extends BaseException{constructor(msg,extraDelay=0){super(msg,"RenderingCancelledException"),this.extraDelay=extraDelay}}function isDataScheme(url2){const ii=url2.length;let i=0;for(;i<ii&&url2[i].trim()==="";)i++;return url2.substring(i,i+5).toLowerCase()==="data:"}function isPdfFile(filename){return typeof filename=="string"&&/\.pdf$/i.test(filename)}function getFilenameFromUrl(url2){return[url2]=url2.split(/[#?]/,1),url2.substring(url2.
+lastIndexOf("/")+1)}function getPdfFilenameFromUrl(url2,defaultFilename="document.pdf"){if(typeof url2!="string")return defaultFilename;if(isDataScheme(url2))return warn('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),defaultFilename;const newURL=(urlString=>{try{return new URL(urlString)}catch{try{return new URL(decodeURIComponent(urlString))}catch{try{return new URL(urlString,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(urlString),"https://foo.bar")}catch{
+return null}}}}})(url2);if(!newURL)return defaultFilename;const decode2=name=>{try{let decoded=decodeURIComponent(name);return decoded.includes("/")?(decoded=decoded.split("/").at(-1),decoded.test(/^\.pdf$/i)?decoded:name):decoded}catch{return name}},pdfRegex=/\.pdf$/i,filename=newURL.pathname.split("/").at(-1);if(pdfRegex.test(filename))return decode2(filename);if(newURL.searchParams.size>0){const values=Array.from(newURL.searchParams.values()).reverse();for(const value of values)if(pdfRegex.test(
+value))return decode2(value);const keys2=Array.from(newURL.searchParams.keys()).reverse();for(const key2 of keys2)if(pdfRegex.test(key2))return decode2(key2)}if(newURL.hash){const hashFilename=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(newURL.hash);if(hashFilename)return decode2(hashFilename[0])}return defaultFilename}class StatTimer{started=Object.create(null);times=[];time(name){name in this.started&&warn(`Timer is already running for ${name}`),this.started[name]=Date.now()}timeEnd(name){name in this.
+started||warn(`Timer has not been started for ${name}`),this.times.push({name,start:this.started[name],end:Date.now()}),delete this.started[name]}toString(){const outBuf=[];let longest=0;for(const{name}of this.times)longest=Math.max(name.length,longest);for(const{name,start:start2,end}of this.times)outBuf.push(`${name.padEnd(longest)} ${end-start2}ms
`);return outBuf.join("")}}function isValidFetchUrl(url2,baseUrl){const res=baseUrl?URL.parse(url2,baseUrl):URL.parse(url2);return res?.protocol==="http:"||res?.protocol==="https:"}function noContextMenu(e){e.preventDefault()}function stopEvent(e){e.preventDefault(),e.stopPropagation()}function deprecated(details){console.log("Deprecated API usage: "+details)}class PDFDateString{static#regex;static toDateObject(input){if(input instanceof Date)return input;if(!input||typeof input!="string")return null;
this.#regex||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const matches2=this.#regex.exec(input);if(!matches2)return null;const year=parseInt(matches2[1],10);let month=parseInt(matches2[2],10);month=month>=1&&month<=12?month-1:0;let day=parseInt(matches2[3],10);day=day>=1&&day<=31?day:1;let hour=parseInt(matches2[4],10);hour=hour>=0&&hour<=23?hour:0;let minute=parseInt(matches2[5],10);minute=minute>=0&&minute<=59?minute:0;let second=parseInt(
matches2[6],10);second=second>=0&&second<=59?second:0;const universalTimeRelation=matches2[7]||"Z";let offsetHour=parseInt(matches2[8],10);offsetHour=offsetHour>=0&&offsetHour<=23?offsetHour:0;let offsetMinute=parseInt(matches2[9],10)||0;return offsetMinute=offsetMinute>=0&&offsetMinute<=59?offsetMinute:0,universalTimeRelation==="-"?(hour+=offsetHour,minute+=offsetMinute):universalTimeRelation==="+"&&(hour-=offsetHour,minute-=offsetMinute),new Date(Date.UTC(year,month,day,hour,minute,second))}}function getXfaPageViewport(xfaPage,{
name,size:file.size,type:file.type,file};try{if(getFileTypeCategory(file.type)===FileTypeCategory.IMAGE){let preview=await readFileAsDataURL(file);if(isSvgMimeType(file.type))try{preview=await svgBase64UrlToPngDataURL(preview)}catch(err){console.error("Failed to convert SVG to PNG:",err)}else if(isWebpMimeType(file.type))try{preview=await webpBase64UrlToPngDataURL(preview)}catch(err){console.error("Failed to convert WebP to PNG:",err)}results.push({...base2,preview})}else if(getFileTypeCategory(
file.type)===FileTypeCategory.PDF){try{const textContent=await convertPDFToText(file);results.push({...base2,textContent})}catch(err){console.warn("Failed to extract text from PDF, adding without content:",err),results.push(base2)}const hasVisionSupport=activeModelId?modelsStore.modelSupportsVision(activeModelId):!1,currentConfig=settingsStore.config;hasVisionSupport&&!currentConfig.pdfAsImage&&toast.info("You can enable parsing PDF as images with vision models.",{duration:8e3,action:{label:"Ena\
ble PDF as Images",onClick:()=>{settingsStore.updateConfig("pdfAsImage",!0),toast.success("PDF parsing as images enabled!",{duration:3e3})}}})}else if(getFileTypeCategory(file.type)===FileTypeCategory.AUDIO){const preview=await readFileAsDataURL(file);results.push({...base2,preview})}else try{const textContent=await readFileAsUTF8(file);results.push({...base2,textContent})}catch(err){console.warn("Failed to read file as text, adding without content:",err),results.push(base2)}}catch(error2){console.
-error("Error processing file",file.name,error2),results.push(base2)}}return results}var root_1$Q=from_html("<!> Text",1),root_3$R=from_html('<div class="mr-1 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"></div>'),root_2$13=from_html("<!> Pages",1),root_8$s=from_html('<span class="inline-flex">The selected model does not support vision. Only the extracted <span class="mx-1 cursor-pointer underline">text</span> will be sent to the model.</span>'),root_6$v=from_html(
-"<!> <!> <!>",1),root_9$l=from_html('<div class="flex flex-1 items-center justify-center p-8"><div class="text-center"><div class="mx-auto mb-4 h-8 w-8 animate-spin rounded-full border-4 border-white border-t-transparent"></div> <p class="text-white/70">Converting PDF to images...</p></div></div>'),root_10$g=from_html('<div class="flex flex-1 items-center justify-center p-8"><div class="text-center"><!> <p class="mb-4 text-white/70">Failed to load PDF images</p> <p class="text-sm text-white/50">\
- </p></div></div>'),root_12$9=from_html('<p class="mb-2 text-sm text-white/50"> </p> <img class="mx-auto max-w-[85vw] rounded-lg shadow-lg"/> <div class="h-4"></div>',1),root_13$d=from_html('<div class="flex flex-1 items-center justify-center p-8"><div class="text-center"><!> <p class="text-white/70">No PDF pages available</p></div></div>'),root_14$7=from_html('<div class="px-4 pb-4"><!></div>'),root$1u=from_html('<div class="mb-4 flex items-center justify-end gap-2"><!> <!></div> <!> <!> <!>',1);
+error("Error processing file",file.name,error2),results.push(base2)}}return results}var root_1$R=from_html("<!> Text",1),root_3$S=from_html('<div class="mr-1 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"></div>'),root_2$12=from_html("<!> Pages",1),root_8$r=from_html('<span class="inline-flex">The selected model does not support vision. Only the extracted <span class="mx-1 cursor-pointer underline">text</span> will be sent to the model.</span>'),root_6$u=from_html(
+"<!> <!> <!>",1),root_9$l=from_html('<div class="flex flex-1 items-center justify-center p-8"><div class="text-center"><div class="mx-auto mb-4 h-8 w-8 animate-spin rounded-full border-4 border-white border-t-transparent"></div> <p class="text-white/70">Converting PDF to images...</p></div></div>'),root_10$f=from_html('<div class="flex flex-1 items-center justify-center p-8"><div class="text-center"><!> <p class="mb-4 text-white/70">Failed to load PDF images</p> <p class="text-sm text-white/50">\
+ </p></div></div>'),root_12$9=from_html('<p class="mb-2 text-sm text-white/50"> </p> <img class="mx-auto max-w-[85vw] rounded-lg shadow-lg"/> <div class="h-4"></div>',1),root_13$c=from_html('<div class="flex flex-1 items-center justify-center p-8"><div class="text-center"><!> <p class="text-white/70">No PDF pages available</p></div></div>'),root_14$7=from_html('<div class="px-4 pb-4"><!></div>'),root$1v=from_html('<div class="mb-4 flex items-center justify-end gap-2"><!> <!></div> <!> <!> <!>',1);
function ChatAttachmentsPreviewCurrentItemPdf($$anchor,$$props){push$1($$props,!0);let pdfViewMode=state$1(proxy(PdfViewMode.PAGES)),pdfImages=state$1(proxy([])),pdfImagesLoading=state$1(!1),pdfImagesError=state$1(null),language2=user_derived(()=>getLanguageFromFilename($$props.displayName));async function loadPdfImages(){if(!(get$3(pdfImages).length>0||get$3(pdfImagesLoading)||!$$props.currentItem)){set$1(pdfImagesLoading,!0),set$1(pdfImagesError,null);try{let file=null;if($$props.currentItem.uploadedFile?.
file)file=$$props.currentItem.uploadedFile.file;else if($$props.currentItem.attachment){if("images"in $$props.currentItem.attachment&&$$props.currentItem.attachment.images&&Array.isArray($$props.currentItem.attachment.images)&&$$props.currentItem.attachment.images.length>0){set$1(pdfImages,$$props.currentItem.attachment.images,!0);return}if("base64Data"in $$props.currentItem.attachment&&$$props.currentItem.attachment.base64Data){const base64Data=$$props.currentItem.attachment.base64Data,byteCharacters=atob(
base64Data),byteNumbers=new Array(byteCharacters.length);for(let i=0;i<byteCharacters.length;i++)byteNumbers[i]=byteCharacters.charCodeAt(i);const byteArray=new Uint8Array(byteNumbers);file=new File([byteArray],$$props.displayName,{type:"application/pdf"})}}if(file)set$1(pdfImages,await convertPDFToImage(file),!0);else throw new Error("No PDF file available for conversion")}catch(error2){set$1(pdfImagesError,error2 instanceof Error?error2.message:"Failed to load PDF images",!0)}finally{set$1(pdfImagesLoading,
-!1)}}}user_effect(()=>{get$3(pdfViewMode)===PdfViewMode.PAGES&&loadPdfImages()});var fragment=root$1u(),div=first_child(fragment),node2=child(div);{let $0=user_derived(()=>get$3(pdfViewMode)===PdfViewMode.TEXT?"default":"outline");Button(node2,{get variant(){return get$3($0)},size:"sm",onclick:()=>set$1(pdfViewMode,PdfViewMode.TEXT,!0),get disabled(){return get$3(pdfImagesLoading)},children:($$anchor2,$$slotProps)=>{var fragment_1=root_1$Q(),node_1=first_child(fragment_1);File_text(node_1,{class:"\
-mr-1 h-4 w-4"}),next$1(),append($$anchor2,fragment_1)},$$slots:{default:!0}})}var node_2=sibling(node2,2);{let $0=user_derived(()=>get$3(pdfViewMode)===PdfViewMode.PAGES?"default":"outline");Button(node_2,{get variant(){return get$3($0)},size:"sm",onclick:()=>set$1(pdfViewMode,PdfViewMode.PAGES,!0),get disabled(){return get$3(pdfImagesLoading)},children:($$anchor2,$$slotProps)=>{var fragment_2=root_2$13(),node_3=first_child(fragment_2);{var consequent=$$anchor3=>{var div_1=root_3$R();append($$anchor3,
-div_1)},alternate=$$anchor3=>{Eye($$anchor3,{class:"mr-1 h-4 w-4"})};if_block(node_3,$$render=>{get$3(pdfImagesLoading)?$$render(consequent):$$render(alternate,-1)})}next$1(),append($$anchor2,fragment_2)},$$slots:{default:!0}})}reset(div);var node_4=sibling(div,2);{var consequent_1=$$anchor2=>{var fragment_4=comment$2(),node_5=first_child(fragment_4);component(node_5,()=>Alert,($$anchor3,Alert_Root)=>{Alert_Root($$anchor3,{class:"mb-4 max-w-4xl",children:($$anchor4,$$slotProps)=>{var fragment_5=root_6$v(),
-node_6=first_child(fragment_5);Info$1(node_6,{class:"h-4 w-4"});var node_7=sibling(node_6,2);component(node_7,()=>Alert_title,($$anchor5,Alert_Title)=>{Alert_Title($$anchor5,{children:($$anchor6,$$slotProps2)=>{next$1();var text2=text$8("Preview only");append($$anchor6,text2)},$$slots:{default:!0}})});var node_8=sibling(node_7,2);component(node_8,()=>Alert_description,($$anchor5,Alert_Description)=>{Alert_Description($$anchor5,{children:($$anchor6,$$slotProps2)=>{var span=root_8$s(),span_1=sibling(
-child(span));next$1(),reset(span),delegated("click",span_1,()=>set$1(pdfViewMode,PdfViewMode.TEXT,!0)),append($$anchor6,span)},$$slots:{default:!0}})}),append($$anchor4,fragment_5)},$$slots:{default:!0}})}),append($$anchor2,fragment_4)};if_block(node_4,$$render=>{!$$props.hasVisionModality&&$$props.activeModelId&&$$props.currentItem&&$$render(consequent_1)})}var node_9=sibling(node_4,2);{var consequent_2=$$anchor2=>{var div_2=root_9$l();append($$anchor2,div_2)},consequent_3=$$anchor2=>{var div_3=root_10$g(),
+!1)}}}user_effect(()=>{get$3(pdfViewMode)===PdfViewMode.PAGES&&loadPdfImages()});var fragment=root$1v(),div=first_child(fragment),node2=child(div);{let $0=user_derived(()=>get$3(pdfViewMode)===PdfViewMode.TEXT?"default":"outline");Button(node2,{get variant(){return get$3($0)},size:"sm",onclick:()=>set$1(pdfViewMode,PdfViewMode.TEXT,!0),get disabled(){return get$3(pdfImagesLoading)},children:($$anchor2,$$slotProps)=>{var fragment_1=root_1$R(),node_1=first_child(fragment_1);File_text(node_1,{class:"\
+mr-1 h-4 w-4"}),next$1(),append($$anchor2,fragment_1)},$$slots:{default:!0}})}var node_2=sibling(node2,2);{let $0=user_derived(()=>get$3(pdfViewMode)===PdfViewMode.PAGES?"default":"outline");Button(node_2,{get variant(){return get$3($0)},size:"sm",onclick:()=>set$1(pdfViewMode,PdfViewMode.PAGES,!0),get disabled(){return get$3(pdfImagesLoading)},children:($$anchor2,$$slotProps)=>{var fragment_2=root_2$12(),node_3=first_child(fragment_2);{var consequent=$$anchor3=>{var div_1=root_3$S();append($$anchor3,
+div_1)},alternate=$$anchor3=>{Eye($$anchor3,{class:"mr-1 h-4 w-4"})};if_block(node_3,$$render=>{get$3(pdfImagesLoading)?$$render(consequent):$$render(alternate,-1)})}next$1(),append($$anchor2,fragment_2)},$$slots:{default:!0}})}reset(div);var node_4=sibling(div,2);{var consequent_1=$$anchor2=>{var fragment_4=comment$2(),node_5=first_child(fragment_4);component(node_5,()=>Alert,($$anchor3,Alert_Root)=>{Alert_Root($$anchor3,{class:"mb-4 max-w-4xl",children:($$anchor4,$$slotProps)=>{var fragment_5=root_6$u(),
+node_6=first_child(fragment_5);Info$1(node_6,{class:"h-4 w-4"});var node_7=sibling(node_6,2);component(node_7,()=>Alert_title,($$anchor5,Alert_Title)=>{Alert_Title($$anchor5,{children:($$anchor6,$$slotProps2)=>{next$1();var text2=text$8("Preview only");append($$anchor6,text2)},$$slots:{default:!0}})});var node_8=sibling(node_7,2);component(node_8,()=>Alert_description,($$anchor5,Alert_Description)=>{Alert_Description($$anchor5,{children:($$anchor6,$$slotProps2)=>{var span=root_8$r(),span_1=sibling(
+child(span));next$1(),reset(span),delegated("click",span_1,()=>set$1(pdfViewMode,PdfViewMode.TEXT,!0)),append($$anchor6,span)},$$slots:{default:!0}})}),append($$anchor4,fragment_5)},$$slots:{default:!0}})}),append($$anchor2,fragment_4)};if_block(node_4,$$render=>{!$$props.hasVisionModality&&$$props.activeModelId&&$$props.currentItem&&$$render(consequent_1)})}var node_9=sibling(node_4,2);{var consequent_2=$$anchor2=>{var div_2=root_9$l();append($$anchor2,div_2)},consequent_3=$$anchor2=>{var div_3=root_10$f(),
div_4=child(div_3),node_10=child(div_4);File_text(node_10,{class:"mx-auto mb-4 h-16 w-16 text-white/50"});var p2=sibling(node_10,4),text_1=child(p2,!0);reset(p2),reset(div_4),reset(div_3),template_effect(()=>set_text(text_1,get$3(pdfImagesError))),append($$anchor2,div_3)},consequent_4=$$anchor2=>{var fragment_6=comment$2(),node_11=first_child(fragment_6);each(node_11,18,()=>get$3(pdfImages),image2=>image2,($$anchor3,image2,index2)=>{var fragment_7=root_12$9(),p_1=first_child(fragment_7),text_2=child(
-p_1);reset(p_1);var img=sibling(p_1,2);next$1(2),template_effect(()=>{set_text(text_2,`Page ${get$3(index2)+1}`),set_attribute(img,"src",image2),set_attribute(img,"alt",`PDF Page ${get$3(index2)+1}`)}),append($$anchor3,fragment_7)}),append($$anchor2,fragment_6)},alternate_1=$$anchor2=>{var div_5=root_13$d(),div_6=child(div_5),node_12=child(div_6);File_text(node_12,{class:"mx-auto mb-4 h-16 w-16 text-white/50"}),next$1(2),reset(div_6),reset(div_5),append($$anchor2,div_5)};if_block(node_9,$$render=>{
+p_1);reset(p_1);var img=sibling(p_1,2);next$1(2),template_effect(()=>{set_text(text_2,`Page ${get$3(index2)+1}`),set_attribute(img,"src",image2),set_attribute(img,"alt",`PDF Page ${get$3(index2)+1}`)}),append($$anchor3,fragment_7)}),append($$anchor2,fragment_6)},alternate_1=$$anchor2=>{var div_5=root_13$c(),div_6=child(div_5),node_12=child(div_6);File_text(node_12,{class:"mx-auto mb-4 h-16 w-16 text-white/50"}),next$1(2),reset(div_6),reset(div_5),append($$anchor2,div_5)};if_block(node_9,$$render=>{
get$3(pdfImagesLoading)?$$render(consequent_2):get$3(pdfImagesError)?$$render(consequent_3,1):get$3(pdfImages).length>0?$$render(consequent_4,2):$$render(alternate_1,-1)})}var node_13=sibling(node_9,2);{var consequent_5=$$anchor2=>{var div_7=root_14$7(),node_14=child(div_7);SyntaxHighlightedCode(node_14,{class:"max-w-4xl",get code(){return $$props.displayTextContent},get language(){return get$3(language2)},maxHeight:"none"}),reset(div_7),append($$anchor2,div_7)};if_block(node_13,$$render=>{get$3(
-pdfViewMode)===PdfViewMode.TEXT&&$$props.displayTextContent&&$$render(consequent_5)})}append($$anchor,fragment),pop()}delegate(["click"]);var root_1$P=from_html('<div class="flex flex-1 items-center justify-center"><img class="max-h-[80vh] max-w-[80vw] rounded-lg object-contain shadow-lg"/></div>');function ChatAttachmentsPreviewCurrentItemImage($$anchor,$$props){push$1($$props,!0);var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var div=root_1$P(),img=child(div);
-reset(div),template_effect(()=>{set_attribute(img,"src",$$props.displayPreview),set_attribute(img,"alt",$$props.currentItem?.name||"preview")}),append($$anchor2,div)};if_block(node2,$$render=>{$$props.displayPreview&&$$render(consequent)})}append($$anchor,fragment),pop()}var root_1$O=from_html('<audio controls="" class="mb-4 w-full">Your browser does not support the audio element.</audio>'),root_2$12=from_html('<p class="mb-4 text-white/70">Audio preview not available</p>'),root$1t=from_html('<d\
-iv class="flex flex-1 items-center justify-center p-8"><div class="w-full max-w-md text-center"><!> <!> <p class="text-sm text-white/50"> </p></div></div>');function ChatAttachmentsPreviewCurrentItemAudio($$anchor,$$props){push$1($$props,!0);var div=root$1t(),div_1=child(div),node2=child(div_1);Music(node2,{class:"mx-auto mb-4 h-16 w-16 text-white/50"});var node_1=sibling(node2,2);{var consequent=$$anchor2=>{var audio=root_1$O();template_effect(()=>set_attribute(audio,"src",$$props.audioSrc)),append(
-$$anchor2,audio)},alternate=$$anchor2=>{var p2=root_2$12();append($$anchor2,p2)};if_block(node_1,$$render=>{$$props.audioSrc?$$render(consequent):$$render(alternate,-1)})}var p_1=sibling(node_1,2),text2=child(p_1,!0);reset(p_1),reset(div_1),reset(div),template_effect(()=>set_text(text2,$$props.currentItem?.name||"Audio")),append($$anchor,div),pop()}var root_1$N=from_html('<div class="px-4 pb-4"><!></div>');function ChatAttachmentsPreviewCurrentItemText($$anchor,$$props){var fragment=comment$2(),
-node2=first_child(fragment);{var consequent=$$anchor2=>{var div=root_1$N(),node_1=child(div);SyntaxHighlightedCode(node_1,{class:"max-w-4xl",get code(){return $$props.displayTextContent},get language(){return $$props.language},maxHeight:"none"}),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.displayTextContent&&$$render(consequent)})}append($$anchor,fragment)}var root$1s=from_html('<div class="flex flex-1 items-center justify-center p-8"><div class="text-center"><!> <p class\
-="text-white/70">Preview not available for this file type</p></div></div>');function ChatAttachmentsPreviewCurrentItemUnavailable($$anchor,$$props){var div=root$1s(),div_1=child(div),node2=child(div_1);component(node2,()=>$$props.IconComponent,($$anchor2,IconComponent_1)=>{IconComponent_1($$anchor2,{class:"mx-auto mb-4 h-16 w-16 text-white/50"})}),next$1(2),reset(div_1),reset(div),append($$anchor,div)}function ChatAttachmentsPreviewCurrentItem($$anchor,$$props){push$1($$props,!0);let IconComponent=user_derived(
+pdfViewMode)===PdfViewMode.TEXT&&$$props.displayTextContent&&$$render(consequent_5)})}append($$anchor,fragment),pop()}delegate(["click"]);var root_1$Q=from_html('<div class="flex flex-1 items-center justify-center"><img class="max-h-[80vh] max-w-[80vw] rounded-lg object-contain shadow-lg"/></div>');function ChatAttachmentsPreviewCurrentItemImage($$anchor,$$props){push$1($$props,!0);var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var div=root_1$Q(),img=child(div);
+reset(div),template_effect(()=>{set_attribute(img,"src",$$props.displayPreview),set_attribute(img,"alt",$$props.currentItem?.name||"preview")}),append($$anchor2,div)};if_block(node2,$$render=>{$$props.displayPreview&&$$render(consequent)})}append($$anchor,fragment),pop()}var root_1$P=from_html('<audio controls="" class="mb-4 w-full">Your browser does not support the audio element.</audio>'),root_2$11=from_html('<p class="mb-4 text-white/70">Audio preview not available</p>'),root$1u=from_html('<d\
+iv class="flex flex-1 items-center justify-center p-8"><div class="w-full max-w-md text-center"><!> <!> <p class="text-sm text-white/50"> </p></div></div>');function ChatAttachmentsPreviewCurrentItemAudio($$anchor,$$props){push$1($$props,!0);var div=root$1u(),div_1=child(div),node2=child(div_1);Music(node2,{class:"mx-auto mb-4 h-16 w-16 text-white/50"});var node_1=sibling(node2,2);{var consequent=$$anchor2=>{var audio=root_1$P();template_effect(()=>set_attribute(audio,"src",$$props.audioSrc)),append(
+$$anchor2,audio)},alternate=$$anchor2=>{var p2=root_2$11();append($$anchor2,p2)};if_block(node_1,$$render=>{$$props.audioSrc?$$render(consequent):$$render(alternate,-1)})}var p_1=sibling(node_1,2),text2=child(p_1,!0);reset(p_1),reset(div_1),reset(div),template_effect(()=>set_text(text2,$$props.currentItem?.name||"Audio")),append($$anchor,div),pop()}var root_1$O=from_html('<div class="px-4 pb-4"><!></div>');function ChatAttachmentsPreviewCurrentItemText($$anchor,$$props){var fragment=comment$2(),
+node2=first_child(fragment);{var consequent=$$anchor2=>{var div=root_1$O(),node_1=child(div);SyntaxHighlightedCode(node_1,{class:"max-w-4xl",get code(){return $$props.displayTextContent},get language(){return $$props.language},maxHeight:"none"}),reset(div),append($$anchor2,div)};if_block(node2,$$render=>{$$props.displayTextContent&&$$render(consequent)})}append($$anchor,fragment)}var root$1t=from_html('<div class="flex flex-1 items-center justify-center p-8"><div class="text-center"><!> <p class\
+="text-white/70">Preview not available for this file type</p></div></div>');function ChatAttachmentsPreviewCurrentItemUnavailable($$anchor,$$props){var div=root$1t(),div_1=child(div),node2=child(div_1);component(node2,()=>$$props.IconComponent,($$anchor2,IconComponent_1)=>{IconComponent_1($$anchor2,{class:"mx-auto mb-4 h-16 w-16 text-white/50"})}),next$1(2),reset(div_1),reset(div),append($$anchor,div)}function ChatAttachmentsPreviewCurrentItem($$anchor,$$props){push$1($$props,!0);let IconComponent=user_derived(
()=>$$props.isImage?Image$1:$$props.isText||$$props.isPdf?File_text:$$props.isAudio?Music:File$1),isUnavailable=user_derived(()=>!$$props.isPdf&&!$$props.isImage&&!($$props.isText&&$$props.displayTextContent)&&!$$props.isAudio);var fragment=comment$2(),node2=first_child(fragment);{var consequent_5=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);key$1(node_1,()=>$$props.currentItem.id,$$anchor3=>{var fragment_2=comment$2(),node_2=first_child(fragment_2);{var consequent=$$anchor4=>{
ChatAttachmentsPreviewCurrentItemPdf($$anchor4,{get currentItem(){return $$props.currentItem},get displayName(){return $$props.currentItem.name},get displayTextContent(){return $$props.displayTextContent},get hasVisionModality(){return $$props.hasVisionModality},get activeModelId(){return $$props.activeModelId}})},consequent_1=$$anchor4=>{ChatAttachmentsPreviewCurrentItemImage($$anchor4,{get currentItem(){return $$props.currentItem},get displayPreview(){return $$props.displayPreview}})},consequent_2=$$anchor4=>{
ChatAttachmentsPreviewCurrentItemText($$anchor4,{get displayTextContent(){return $$props.displayTextContent},get language(){return $$props.language}})},consequent_3=$$anchor4=>{ChatAttachmentsPreviewCurrentItemAudio($$anchor4,{get currentItem(){return $$props.currentItem},get audioSrc(){return $$props.audioSrc}})},consequent_4=$$anchor4=>{ChatAttachmentsPreviewCurrentItemUnavailable($$anchor4,{get IconComponent(){return get$3(IconComponent)}})};if_block(node_2,$$render=>{$$props.isPdf?$$render(consequent):
currentConfig.dry_penalty_last_n)),currentConfig.samplers&&(apiOptions.samplers=currentConfig.samplers),apiOptions.backend_sampling=currentConfig.backend_sampling,currentConfig.custom&&(apiOptions.custom=currentConfig.custom),apiOptions}cancelPreEncode(){this.preEncodeAbortController&&(this.preEncodeAbortController.abort(),this.preEncodeAbortController=null)}async triggerPreEncode(allMessages,assistantMessage,assistantContent,model,excludeReasoning){this.cancelPreEncode(),this.preEncodeAbortController=
new AbortController;const signal=this.preEncodeAbortController.signal;try{if(!await ChatService.areAllSlotsIdle(model,signal)||signal.aborted)return;const messagesWithAssistant=[...allMessages,{...assistantMessage,content:assistantContent}];await ChatService.preEncode(messagesWithAssistant,model,excludeReasoning,signal)}catch(err){isAbortError(err)||console.warn("[ChatStore] Pre-encode failed:",err)}}}const chatStore=new ChatStore,activeProcessingState=()=>chatStore.activeProcessingState,errorDialog=()=>chatStore.
errorDialogState,getAddFilesHandler=()=>chatStore.getAddFilesHandler(),getAllLoadingChats=()=>chatStore.getAllLoadingChats(),isChatStreaming=()=>chatStore.isStreaming(),isEditing=()=>chatStore.isEditing(),isLoading=()=>chatStore.isLoading,pendingEditMessageId=()=>chatStore.pendingEditMessageId,chatPendingMessageContent=convId=>chatStore.pendingMessageContent(convId),chatPendingMessageExtras=convId=>chatStore.pendingMessageExtras(convId),chatClearPendingMessage=convId=>chatStore.clearPendingMessage(
-convId),chatInjectPendingMessage=(convId,content2,extras)=>chatStore.injectPendingMessage(convId,content2,extras);var root$1r=from_html('<!> <form><!> <div data-slot="input-area"><!> <div class="flex-column relative min-h-[48px] items-center rounded-3xl py-2 pb-2.25 shadow-sm transition-all focus-within:shadow-md md:!py-3"><!> <!> <!></div></div></form> <!>',1);function ChatForm($$anchor,$$props){push$1($$props,!0);let attachments=prop($$props,"attachments",19,()=>[]),className=prop($$props,"cla\
+convId),chatInjectPendingMessage=(convId,content2,extras)=>chatStore.injectPendingMessage(convId,content2,extras);var root$1s=from_html('<!> <form><!> <div data-slot="input-area"><!> <div class="flex-column relative min-h-[48px] items-center rounded-3xl py-2 pb-2.25 shadow-sm transition-all focus-within:shadow-md md:!py-3"><!> <!> <!></div></div></form> <!>',1);function ChatForm($$anchor,$$props){push$1($$props,!0);let attachments=prop($$props,"attachments",19,()=>[]),className=prop($$props,"cla\
ss",3,""),disabled=prop($$props,"disabled",3,!1),isLoading2=prop($$props,"isLoading",3,!1),placeholder=prop($$props,"placeholder",3,"Type a message..."),showMcpPromptButton=prop($$props,"showMcpPromptButton",3,!1),showAddButton=prop($$props,"showAddButton",3,!0),showModelSelector=prop($$props,"showModelSelector",3,!0),uploadedFiles=prop($$props,"uploadedFiles",31,()=>proxy([])),value=prop($$props,"value",15,""),audioRecorder,chatFormActionsRef=state$1(void 0),fileInputRef=state$1(void 0),pickersRef=state$1(
void 0),textareaRef=state$1(void 0),isRecording=state$1(!1),recordingSupported=state$1(!1),isPromptPickerOpen=state$1(!1),promptSearchQuery=state$1(""),isInlineResourcePickerOpen=state$1(!1),resourceSearchQuery=state$1(""),isResourceDialogOpen=state$1(!1),preSelectedResourceUri=state$1(void 0),currentConfig=user_derived(config$1),pasteLongTextToFileLength=user_derived(()=>{const n=Number(get$3(currentConfig).pasteLongTextToFileLen);return Number.isNaN(n)?Number(SETTING_CONFIG_DEFAULT.pasteLongTextToFileLen):
n}),isRouter=user_derived(isRouterMode),conversationModel=user_derived(()=>chatStore.getConversationModel(activeMessages())),activeModelId=user_derived(()=>{const options=modelOptions();if(!get$3(isRouter))return options.length>0?options[0].model:null;const selectedId=selectedModelId();if(selectedId){const model=options.find(m=>m.id===selectedId);if(model)return model.model}if(get$3(conversationModel)){const model=options.find(m=>m.model===get$3(conversationModel));if(model)return model.model}return null}),
size:promptText.length,file:new File([promptText],`${f.name}${FileExtensionText.TXT}`,{type:MimeTypeText.PLAIN})}:f)),$$props.onUploadedFilesChange?.(uploadedFiles())}function handlePromptLoadError(placeholderId,error2){uploadedFiles(uploadedFiles().map(f=>f.id===placeholderId?{...f,isLoading:!1,loadError:error2}:f)),$$props.onUploadedFilesChange?.(uploadedFiles())}function handlePromptPickerClose(){set$1(isPromptPickerOpen,!1),set$1(promptSearchQuery,""),get$3(textareaRef)?.focus()}function handleInlineResourcePickerClose(){
set$1(isInlineResourcePickerOpen,!1),set$1(resourceSearchQuery,""),get$3(textareaRef)?.focus()}function handleInlineResourceSelect(){value().startsWith(RESOURCE_TRIGGER_PREFIX)&&(value(""),$$props.onValueChange?.("")),set$1(isInlineResourcePickerOpen,!1),set$1(resourceSearchQuery,""),get$3(textareaRef)?.focus()}function handleBrowseResources(){set$1(isInlineResourcePickerOpen,!1),set$1(resourceSearchQuery,""),value().startsWith(RESOURCE_TRIGGER_PREFIX)&&(value(""),$$props.onValueChange?.("")),set$1(
isResourceDialogOpen,!0)}async function handleMicClick(){if(!audioRecorder||!get$3(recordingSupported)){console.warn("Audio recording not supported");return}if(get$3(isRecording)){set$1(isRecording,!1);try{const audioBlob=await audioRecorder.stopRecording(),wavBlob=await convertToWav(audioBlob),audioFile=createAudioFile(wavBlob);$$props.onFilesAdd?.([audioFile])}catch(error2){console.error("Failed to stop recording:",error2)}}else try{await audioRecorder.startRecording(),set$1(isRecording,!0)}catch(error2){
-console.error("Failed to start recording:",error2)}}var $$exports={focus:focus2,resetTextareaHeight,openModelSelector,checkModelSelected},fragment=root$1r(),node2=first_child(fragment);bind_this(ChatFormFileInputInvisible(node2,{onFileSelect:handleFileSelect}),$$value=>set$1(fileInputRef,$$value,!0),()=>get$3(fileInputRef));var form=sibling(node2,2),node_1=child(form);bind_this(ChatFormPickers(node_1,{get isPromptPickerOpen(){return get$3(isPromptPickerOpen)},get promptSearchQuery(){return get$3(
+console.error("Failed to start recording:",error2)}}var $$exports={focus:focus2,resetTextareaHeight,openModelSelector,checkModelSelected},fragment=root$1s(),node2=first_child(fragment);bind_this(ChatFormFileInputInvisible(node2,{onFileSelect:handleFileSelect}),$$value=>set$1(fileInputRef,$$value,!0),()=>get$3(fileInputRef));var form=sibling(node2,2),node_1=child(form);bind_this(ChatFormPickers(node_1,{get isPromptPickerOpen(){return get$3(isPromptPickerOpen)},get promptSearchQuery(){return get$3(
promptSearchQuery)},get isInlineResourcePickerOpen(){return get$3(isInlineResourcePickerOpen)},get resourceSearchQuery(){return get$3(resourceSearchQuery)},onPromptPickerClose:handlePromptPickerClose,onInlineResourcePickerClose:handleInlineResourcePickerClose,onInlineResourceSelect:handleInlineResourceSelect,onPromptLoadStart:handlePromptLoadStart,onPromptLoadComplete:handlePromptLoadComplete,onPromptLoadError:handlePromptLoadError,onInlineResourceBrowse:handleBrowseResources}),$$value=>set$1(pickersRef,
$$value,!0),()=>get$3(pickersRef));var div=sibling(node_1,2),node_2=child(div);{let $0=user_derived(()=>get$3(activeModelId)??void 0);ChatAttachmentsList(node_2,{get attachments(){return attachments()},onFileRemove:handleFileRemove,limitToSingleRow:!0,class:"py-5",style:"scroll-padding: 1rem;",get activeModelId(){return get$3($0)},get uploadedFiles(){return uploadedFiles()},set uploadedFiles($$value){uploadedFiles($$value)}})}var div_1=sibling(node_2,2),node_3=child(div_1);bind_this(ChatFormTextarea(
node_3,{class:"px-5 py-1.5 md:pt-0",onKeydown:handleKeydown,onInput:()=>{handleInput(),$$props.onValueChange?.(value())},get disabled(){return disabled()},get placeholder(){return placeholder()},get value(){return value()},set value($$value){value($$value)}}),$$value=>set$1(textareaRef,$$value,!0),()=>get$3(textareaRef));var node_4=sibling(node_3,2);{var consequent=$$anchor2=>{ChatFormMcpResourcesList($$anchor2,{class:"mb-3",onResourceClick:uri2=>{set$1(preSelectedResourceUri,uri2,!0),set$1(isResourceDialogOpen,
"$$legacy","ref"]);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Menu_trigger,($$anchor2,DropdownMenuPrimitive_Trigger)=>{DropdownMenuPrimitive_Trigger($$anchor2,spread_props({"data-slot":"dropdown-menu-trigger"},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))}),append($$anchor,fragment),pop()}function Dropdown_menu_sub_content($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$\
$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("z-50 max-h-(--bits-dropdown-menu-content-available-height) min-w-[8rem] origin-(--bits-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-border bg-popover p-1.5 text-popover-foreground shadow-md outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[\
side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 dark:border-border/20",$$props.class));component(node2,()=>Menu_sub_content,($$anchor2,DropdownMenuPrimitive_SubContent)=>{DropdownMenuPrimitive_SubContent($$anchor2,spread_props({"data-slot":"dropdown-menu-sub-content",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},
-set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}var root_1$M=from_html("<!> <!>",1);function Dropdown_menu_sub_trigger($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","inset","children"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-hig\
+set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}var root_1$N=from_html("<!> <!>",1);function Dropdown_menu_sub_trigger($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","inset","children"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-hig\
hlighted:bg-accent data-highlighted:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",$$props.class));component(node2,()=>Menu_sub_trigger,($$anchor2,DropdownMenuPrimitive_SubTrigger)=>{DropdownMenuPrimitive_SubTrigger($$anchor2,spread_props(
-{"data-slot":"dropdown-menu-sub-trigger",get"data-inset"(){return $$props.inset},get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$M(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.children??noop$3);var node_2=sibling(node_1,2);Chevron_right(node_2,{class:"ml-auto size-4"}),append($$anchor3,fragment_1)},$$slots:{default:!0}}))})}append($$anchor,fragment),pop()}const Sub=Menu_sub,
+{"data-slot":"dropdown-menu-sub-trigger",get"data-inset"(){return $$props.inset},get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$N(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.children??noop$3);var node_2=sibling(node_1,2);Chevron_right(node_2,{class:"ml-auto size-4"}),append($$anchor3,fragment_1)},$$slots:{default:!0}}))})}append($$anchor,fragment),pop()}const Sub=Menu_sub,
Root$4=Menu;function useAttachmentMenu(getFlags,getCallbacks,close2){const modalityFlags=user_derived(getFlags),callbacks=user_derived(()=>{const cbs=getCallbacks(),wrap2=fn=>()=>{close2(),fn?.()};return{[AttachmentAction.FILE_UPLOAD]:wrap2(cbs.onFileUpload),[AttachmentAction.SYSTEM_PROMPT_CLICK]:wrap2(cbs.onSystemPromptClick),[AttachmentAction.MCP_PROMPT_CLICK]:wrap2(cbs.onMcpPromptClick),[AttachmentAction.MCP_RESOURCES_CLICK]:wrap2(cbs.onMcpResourcesClick)}});function isItemEnabled(enabledWhen){
-return!enabledWhen||enabledWhen==="always"?!0:!!get$3(modalityFlags)[enabledWhen]}function isItemVisible(visibleWhen){return visibleWhen?!!get$3(modalityFlags)[visibleWhen]:!0}function getSystemMessageTooltip(){return page$1.params.id?"Inject custom system message at the beginning of the conversation":"Add custom system message for a new conversation"}return{get callbacks(){return get$3(callbacks)},isItemEnabled,isItemVisible,getSystemMessageTooltip}}var root_6$u=from_html("<!> <span> </span>",1),
-root_10$f=from_html("<!> <span> </span>",1),root_11$e=from_html("<p> </p>"),root_8$r=from_html("<!> <!>",1),root_16$5=from_html("<!> <span> </span>",1),root_17$7=from_html("<p>PDFs will be converted to text. Image-based PDFs may not work properly.</p>"),root_13$c=from_html("<!> <!>",1),root_22$1=from_html("<!> <span> </span>",1),root_23$4=from_html("<p> </p>"),root_20$4=from_html("<!> <!>",1),root_26$2=from_html("<!> <span> </span>",1),root_3$Q=from_html("<!> <!> <!> <!> <!> <!> <!>",1),root_1$L=from_html(
-"<!> <!>",1),root$1q=from_html("<div><!></div>");function ChatFormActionAddDropdown($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),disabled=prop($$props,"disabled",3,!1),hasAudioModality=prop($$props,"hasAudioModality",3,!1),hasVisionModality=prop($$props,"hasVisionModality",3,!1),hasMcpPromptsSupport=prop($$props,"hasMcpPromptsSupport",3,!1),hasMcpResourcesSupport=prop($$props,"hasMcpResourcesSupport",3,!1),dropdownOpen=state$1(!1);function handleMcpSettingsClick(){
-set$1(dropdownOpen,!1),$$props.onMcpSettingsClick?.()}const attachmentMenu=useAttachmentMenu(()=>({hasVisionModality:hasVisionModality(),hasAudioModality:hasAudioModality(),hasMcpPromptsSupport:hasMcpPromptsSupport(),hasMcpResourcesSupport:hasMcpResourcesSupport()}),()=>({onFileUpload:$$props.onFileUpload,onSystemPromptClick:$$props.onSystemPromptClick,onMcpPromptClick:$$props.onMcpPromptClick,onMcpResourcesClick:$$props.onMcpResourcesClick}),()=>{set$1(dropdownOpen,!1)});var div=root$1q(),node2=child(
-div);component(node2,()=>Root$4,($$anchor2,DropdownMenu_Root)=>{DropdownMenu_Root($$anchor2,{get open(){return get$3(dropdownOpen)},set open($$value){set$1(dropdownOpen,$$value,!0)},children:($$anchor3,$$slotProps)=>{var fragment=root_1$L(),node_1=first_child(fragment);component(node_1,()=>Dropdown_menu_trigger,($$anchor4,DropdownMenu_Trigger)=>{DropdownMenu_Trigger($$anchor4,{name:"Attach files",get disabled(){return disabled()},children:($$anchor5,$$slotProps2)=>{var fragment_1=comment$2(),node_2=first_child(
-fragment_1);snippet(node_2,()=>$$props.trigger,()=>({disabled:disabled()})),append($$anchor5,fragment_1)},$$slots:{default:!0}})});var node_3=sibling(node_1,2);component(node_3,()=>Dropdown_menu_content,($$anchor4,DropdownMenu_Content)=>{DropdownMenu_Content($$anchor4,{align:"start",class:"w-48",children:($$anchor5,$$slotProps2)=>{var fragment_2=root_3$Q(),node_4=first_child(fragment_2);each(node_4,17,()=>ATTACHMENT_FILE_ITEMS,item=>item.id,($$anchor6,item)=>{const enabled=user_derived(()=>attachmentMenu.
+return!enabledWhen||enabledWhen==="always"?!0:!!get$3(modalityFlags)[enabledWhen]}function isItemVisible(visibleWhen){return visibleWhen?!!get$3(modalityFlags)[visibleWhen]:!0}function getSystemMessageTooltip(){return page$1.params.id?"Inject custom system message at the beginning of the conversation":"Add custom system message for a new conversation"}return{get callbacks(){return get$3(callbacks)},isItemEnabled,isItemVisible,getSystemMessageTooltip}}var root_6$t=from_html("<!> <span> </span>",1),
+root_10$e=from_html("<!> <span> </span>",1),root_11$e=from_html("<p> </p>"),root_8$q=from_html("<!> <!>",1),root_16$5=from_html("<!> <span> </span>",1),root_17$8=from_html("<p>PDFs will be converted to text. Image-based PDFs may not work properly.</p>"),root_13$b=from_html("<!> <!>",1),root_22$1=from_html("<!> <span> </span>",1),root_23$5=from_html("<p> </p>"),root_20$4=from_html("<!> <!>",1),root_26$1=from_html("<!> <span> </span>",1),root_3$R=from_html("<!> <!> <!> <!> <!> <!> <!>",1),root_1$M=from_html(
+"<!> <!>",1),root$1r=from_html("<div><!></div>");function ChatFormActionAddDropdown($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),disabled=prop($$props,"disabled",3,!1),hasAudioModality=prop($$props,"hasAudioModality",3,!1),hasVisionModality=prop($$props,"hasVisionModality",3,!1),hasMcpPromptsSupport=prop($$props,"hasMcpPromptsSupport",3,!1),hasMcpResourcesSupport=prop($$props,"hasMcpResourcesSupport",3,!1),dropdownOpen=state$1(!1);function handleMcpSettingsClick(){
+set$1(dropdownOpen,!1),$$props.onMcpSettingsClick?.()}const attachmentMenu=useAttachmentMenu(()=>({hasVisionModality:hasVisionModality(),hasAudioModality:hasAudioModality(),hasMcpPromptsSupport:hasMcpPromptsSupport(),hasMcpResourcesSupport:hasMcpResourcesSupport()}),()=>({onFileUpload:$$props.onFileUpload,onSystemPromptClick:$$props.onSystemPromptClick,onMcpPromptClick:$$props.onMcpPromptClick,onMcpResourcesClick:$$props.onMcpResourcesClick}),()=>{set$1(dropdownOpen,!1)});var div=root$1r(),node2=child(
+div);component(node2,()=>Root$4,($$anchor2,DropdownMenu_Root)=>{DropdownMenu_Root($$anchor2,{get open(){return get$3(dropdownOpen)},set open($$value){set$1(dropdownOpen,$$value,!0)},children:($$anchor3,$$slotProps)=>{var fragment=root_1$M(),node_1=first_child(fragment);component(node_1,()=>Dropdown_menu_trigger,($$anchor4,DropdownMenu_Trigger)=>{DropdownMenu_Trigger($$anchor4,{name:"Attach files",get disabled(){return disabled()},children:($$anchor5,$$slotProps2)=>{var fragment_1=comment$2(),node_2=first_child(
+fragment_1);snippet(node_2,()=>$$props.trigger,()=>({disabled:disabled()})),append($$anchor5,fragment_1)},$$slots:{default:!0}})});var node_3=sibling(node_1,2);component(node_3,()=>Dropdown_menu_content,($$anchor4,DropdownMenu_Content)=>{DropdownMenu_Content($$anchor4,{align:"start",class:"w-48",children:($$anchor5,$$slotProps2)=>{var fragment_2=root_3$R(),node_4=first_child(fragment_2);each(node_4,17,()=>ATTACHMENT_FILE_ITEMS,item=>item.id,($$anchor6,item)=>{const enabled=user_derived(()=>attachmentMenu.
isItemEnabled(get$3(item).enabledWhen));var fragment_3=comment$2(),node_5=first_child(fragment_3);{var consequent=$$anchor7=>{var fragment_4=comment$2(),node_6=first_child(fragment_4);{let $0=user_derived(()=>get$3(item).class??"");component(node_6,()=>Dropdown_menu_item,($$anchor8,DropdownMenu_Item)=>{DropdownMenu_Item($$anchor8,{get class(){return`${get$3($0)??""} flex cursor-pointer items-center gap-2`},onclick:()=>attachmentMenu.callbacks[get$3(item).action](),children:($$anchor9,$$slotProps3)=>{
-var fragment_5=root_6$u(),node_7=first_child(fragment_5);component(node_7,()=>get$3(item).icon,($$anchor10,item_icon)=>{item_icon($$anchor10,{class:"h-4 w-4"})});var span=sibling(node_7,2),text2=child(span,!0);reset(span),template_effect(()=>set_text(text2,get$3(item).label)),append($$anchor9,fragment_5)},$$slots:{default:!0}})})}append($$anchor7,fragment_4)},consequent_1=$$anchor7=>{var fragment_6=comment$2(),node_8=first_child(fragment_6);component(node_8,()=>Root$5,($$anchor8,Tooltip_Root)=>{
-Tooltip_Root($$anchor8,{get delayDuration(){return TOOLTIP_DELAY_DURATION},children:($$anchor9,$$slotProps3)=>{var fragment_7=root_8$r(),node_9=first_child(fragment_7);component(node_9,()=>Tooltip_trigger,($$anchor10,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor10,{class:"w-full",children:($$anchor11,$$slotProps4)=>{var fragment_8=comment$2(),node_10=first_child(fragment_8);{let $0=user_derived(()=>get$3(item).class??"");component(node_10,()=>Dropdown_menu_item,($$anchor12,DropdownMenu_Item_1)=>{DropdownMenu_Item_1(
-$$anchor12,{get class(){return`${get$3($0)??""} flex cursor-pointer items-center gap-2`},disabled:!0,children:($$anchor13,$$slotProps5)=>{var fragment_9=root_10$f(),node_11=first_child(fragment_9);component(node_11,()=>get$3(item).icon,($$anchor14,item_icon_1)=>{item_icon_1($$anchor14,{class:"h-4 w-4"})});var span_1=sibling(node_11,2),text_1=child(span_1,!0);reset(span_1),template_effect(()=>set_text(text_1,get$3(item).label)),append($$anchor13,fragment_9)},$$slots:{default:!0}})})}append($$anchor11,
+var fragment_5=root_6$t(),node_7=first_child(fragment_5);component(node_7,()=>get$3(item).icon,($$anchor10,item_icon)=>{item_icon($$anchor10,{class:"h-4 w-4"})});var span=sibling(node_7,2),text2=child(span,!0);reset(span),template_effect(()=>set_text(text2,get$3(item).label)),append($$anchor9,fragment_5)},$$slots:{default:!0}})})}append($$anchor7,fragment_4)},consequent_1=$$anchor7=>{var fragment_6=comment$2(),node_8=first_child(fragment_6);component(node_8,()=>Root$5,($$anchor8,Tooltip_Root)=>{
+Tooltip_Root($$anchor8,{get delayDuration(){return TOOLTIP_DELAY_DURATION},children:($$anchor9,$$slotProps3)=>{var fragment_7=root_8$q(),node_9=first_child(fragment_7);component(node_9,()=>Tooltip_trigger,($$anchor10,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor10,{class:"w-full",children:($$anchor11,$$slotProps4)=>{var fragment_8=comment$2(),node_10=first_child(fragment_8);{let $0=user_derived(()=>get$3(item).class??"");component(node_10,()=>Dropdown_menu_item,($$anchor12,DropdownMenu_Item_1)=>{DropdownMenu_Item_1(
+$$anchor12,{get class(){return`${get$3($0)??""} flex cursor-pointer items-center gap-2`},disabled:!0,children:($$anchor13,$$slotProps5)=>{var fragment_9=root_10$e(),node_11=first_child(fragment_9);component(node_11,()=>get$3(item).icon,($$anchor14,item_icon_1)=>{item_icon_1($$anchor14,{class:"h-4 w-4"})});var span_1=sibling(node_11,2),text_1=child(span_1,!0);reset(span_1),template_effect(()=>set_text(text_1,get$3(item).label)),append($$anchor13,fragment_9)},$$slots:{default:!0}})})}append($$anchor11,
fragment_8)},$$slots:{default:!0}})});var node_12=sibling(node_9,2);component(node_12,()=>Tooltip_content,($$anchor10,Tooltip_Content)=>{Tooltip_Content($$anchor10,{side:"right",children:($$anchor11,$$slotProps4)=>{var p2=root_11$e(),text_2=child(p2,!0);reset(p2),template_effect(()=>set_text(text_2,get$3(item).disabledTooltip)),append($$anchor11,p2)},$$slots:{default:!0}})}),append($$anchor9,fragment_7)},$$slots:{default:!0}})}),append($$anchor7,fragment_6)};if_block(node_5,$$render=>{get$3(enabled)?
-$$render(consequent):get$3(item).disabledTooltip&&$$render(consequent_1,1)})}append($$anchor6,fragment_3)});var node_13=sibling(node_4,2);{var consequent_3=$$anchor6=>{var fragment_10=comment$2(),node_14=first_child(fragment_10);component(node_14,()=>Root$5,($$anchor7,Tooltip_Root_1)=>{Tooltip_Root_1($$anchor7,{get delayDuration(){return TOOLTIP_DELAY_DURATION},children:($$anchor8,$$slotProps3)=>{var fragment_11=root_13$c(),node_15=first_child(fragment_11);component(node_15,()=>Tooltip_trigger,($$anchor9,Tooltip_Trigger_1)=>{
+$$render(consequent):get$3(item).disabledTooltip&&$$render(consequent_1,1)})}append($$anchor6,fragment_3)});var node_13=sibling(node_4,2);{var consequent_3=$$anchor6=>{var fragment_10=comment$2(),node_14=first_child(fragment_10);component(node_14,()=>Root$5,($$anchor7,Tooltip_Root_1)=>{Tooltip_Root_1($$anchor7,{get delayDuration(){return TOOLTIP_DELAY_DURATION},children:($$anchor8,$$slotProps3)=>{var fragment_11=root_13$b(),node_15=first_child(fragment_11);component(node_15,()=>Tooltip_trigger,($$anchor9,Tooltip_Trigger_1)=>{
Tooltip_Trigger_1($$anchor9,{class:"w-full",children:($$anchor10,$$slotProps4)=>{var fragment_12=comment$2(),node_16=first_child(fragment_12);component(node_16,()=>Dropdown_menu_item,($$anchor11,DropdownMenu_Item_2)=>{DropdownMenu_Item_2($$anchor11,{class:"flex cursor-pointer items-center gap-2",get onclick(){return attachmentMenu.callbacks.onFileUpload},children:($$anchor12,$$slotProps5)=>{const pdfItem=user_derived(()=>ATTACHMENT_FILE_ITEMS.find(i=>i.id===AttachmentMenuItemId.PDF));var fragment_13=comment$2(),
node_17=first_child(fragment_13);{var consequent_2=$$anchor13=>{var fragment_14=root_16$5(),node_18=first_child(fragment_14);component(node_18,()=>get$3(pdfItem).icon,($$anchor14,pdfItem_icon)=>{pdfItem_icon($$anchor14,{class:"h-4 w-4"})});var span_2=sibling(node_18,2),text_3=child(span_2,!0);reset(span_2),template_effect(()=>set_text(text_3,get$3(pdfItem).label)),append($$anchor13,fragment_14)};if_block(node_17,$$render=>{get$3(pdfItem)&&$$render(consequent_2)})}append($$anchor12,fragment_13)},
-$$slots:{default:!0}})}),append($$anchor10,fragment_12)},$$slots:{default:!0}})});var node_19=sibling(node_15,2);component(node_19,()=>Tooltip_content,($$anchor9,Tooltip_Content_1)=>{Tooltip_Content_1($$anchor9,{side:"right",children:($$anchor10,$$slotProps4)=>{var p_1=root_17$7();append($$anchor10,p_1)},$$slots:{default:!0}})}),append($$anchor8,fragment_11)},$$slots:{default:!0}})}),append($$anchor6,fragment_10)},d2=user_derived(()=>!attachmentMenu.isItemEnabled("hasVisionModality"));if_block(node_13,
+$$slots:{default:!0}})}),append($$anchor10,fragment_12)},$$slots:{default:!0}})});var node_19=sibling(node_15,2);component(node_19,()=>Tooltip_content,($$anchor9,Tooltip_Content_1)=>{Tooltip_Content_1($$anchor9,{side:"right",children:($$anchor10,$$slotProps4)=>{var p_1=root_17$8();append($$anchor10,p_1)},$$slots:{default:!0}})}),append($$anchor8,fragment_11)},$$slots:{default:!0}})}),append($$anchor6,fragment_10)},d2=user_derived(()=>!attachmentMenu.isItemEnabled("hasVisionModality"));if_block(node_13,
$$render=>{get$3(d2)&&$$render(consequent_3)})}var node_20=sibling(node_13,2);component(node_20,()=>Dropdown_menu_separator,($$anchor6,DropdownMenu_Separator)=>{DropdownMenu_Separator($$anchor6,{})});var node_21=sibling(node_20,2);each(node_21,17,()=>ATTACHMENT_EXTRA_ITEMS,item=>item.id,($$anchor6,item)=>{var fragment_15=comment$2(),node_22=first_child(fragment_15);{var consequent_4=$$anchor7=>{var fragment_16=comment$2(),node_23=first_child(fragment_16);component(node_23,()=>Root$5,($$anchor8,Tooltip_Root_2)=>{
Tooltip_Root_2($$anchor8,{get delayDuration(){return TOOLTIP_DELAY_DURATION},children:($$anchor9,$$slotProps3)=>{var fragment_17=root_20$4(),node_24=first_child(fragment_17);component(node_24,()=>Tooltip_trigger,($$anchor10,Tooltip_Trigger_2)=>{Tooltip_Trigger_2($$anchor10,{class:"w-full",children:($$anchor11,$$slotProps4)=>{var fragment_18=comment$2(),node_25=first_child(fragment_18);component(node_25,()=>Dropdown_menu_item,($$anchor12,DropdownMenu_Item_3)=>{DropdownMenu_Item_3($$anchor12,{class:"\
flex cursor-pointer items-center gap-2",onclick:()=>attachmentMenu.callbacks[get$3(item).action](),children:($$anchor13,$$slotProps5)=>{var fragment_19=root_22$1(),node_26=first_child(fragment_19);component(node_26,()=>get$3(item).icon,($$anchor14,item_icon_2)=>{item_icon_2($$anchor14,{class:"h-4 w-4"})});var span_3=sibling(node_26,2),text_4=child(span_3,!0);reset(span_3),template_effect(()=>set_text(text_4,get$3(item).label)),append($$anchor13,fragment_19)},$$slots:{default:!0}})}),append($$anchor11,
-fragment_18)},$$slots:{default:!0}})});var node_27=sibling(node_24,2);component(node_27,()=>Tooltip_content,($$anchor10,Tooltip_Content_2)=>{Tooltip_Content_2($$anchor10,{side:"right",children:($$anchor11,$$slotProps4)=>{var p_2=root_23$4(),text_5=child(p_2,!0);reset(p_2),template_effect($0=>set_text(text_5,$0),[()=>attachmentMenu.getSystemMessageTooltip()]),append($$anchor11,p_2)},$$slots:{default:!0}})}),append($$anchor9,fragment_17)},$$slots:{default:!0}})}),append($$anchor7,fragment_16)};if_block(
+fragment_18)},$$slots:{default:!0}})});var node_27=sibling(node_24,2);component(node_27,()=>Tooltip_content,($$anchor10,Tooltip_Content_2)=>{Tooltip_Content_2($$anchor10,{side:"right",children:($$anchor11,$$slotProps4)=>{var p_2=root_23$5(),text_5=child(p_2,!0);reset(p_2),template_effect($0=>set_text(text_5,$0),[()=>attachmentMenu.getSystemMessageTooltip()]),append($$anchor11,p_2)},$$slots:{default:!0}})}),append($$anchor9,fragment_17)},$$slots:{default:!0}})}),append($$anchor7,fragment_16)};if_block(
node_22,$$render=>{get$3(item).id===AttachmentMenuItemId.SYSTEM_MESSAGE&&$$render(consequent_4)})}append($$anchor6,fragment_15)});var node_28=sibling(node_21,2);ChatFormActionAddToolsSubmenu(node_28,{});var node_29=sibling(node_28,2);ChatFormActionAddMcpServersSubmenu(node_29,{onMcpSettingsClick:handleMcpSettingsClick});var node_30=sibling(node_29,2);each(node_30,17,()=>ATTACHMENT_MCP_ITEMS,item=>item.id,($$anchor6,item)=>{var fragment_20=comment$2(),node_31=first_child(fragment_20);{var consequent_5=$$anchor7=>{
-var fragment_21=comment$2(),node_32=first_child(fragment_21);component(node_32,()=>Dropdown_menu_item,($$anchor8,DropdownMenu_Item_4)=>{DropdownMenu_Item_4($$anchor8,{class:"flex cursor-pointer items-center gap-2",onclick:()=>attachmentMenu.callbacks[get$3(item).action](),children:($$anchor9,$$slotProps3)=>{var fragment_22=root_26$2(),node_33=first_child(fragment_22);component(node_33,()=>get$3(item).icon,($$anchor10,item_icon_3)=>{item_icon_3($$anchor10,{class:"h-4 w-4"})});var span_4=sibling(node_33,
+var fragment_21=comment$2(),node_32=first_child(fragment_21);component(node_32,()=>Dropdown_menu_item,($$anchor8,DropdownMenu_Item_4)=>{DropdownMenu_Item_4($$anchor8,{class:"flex cursor-pointer items-center gap-2",onclick:()=>attachmentMenu.callbacks[get$3(item).action](),children:($$anchor9,$$slotProps3)=>{var fragment_22=root_26$1(),node_33=first_child(fragment_22);component(node_33,()=>get$3(item).icon,($$anchor10,item_icon_3)=>{item_icon_3($$anchor10,{class:"h-4 w-4"})});var span_4=sibling(node_33,
2),text_6=child(span_4,!0);reset(span_4),template_effect(()=>set_text(text_6,get$3(item).label)),append($$anchor9,fragment_22)},$$slots:{default:!0}})}),append($$anchor7,fragment_21)},d_12=user_derived(()=>attachmentMenu.isItemVisible(get$3(item).visibleWhen));if_block(node_31,$$render=>{get$3(d_12)&&$$render(consequent_5)})}append($$anchor6,fragment_20)}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment)},$$slots:{default:!0}})}),reset(div),template_effect(()=>set_class(
div,1,`flex items-center gap-1 ${className()??""}`)),append($$anchor,div),pop()}function Sheet_overlay($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",$$props.class));
component(node2,()=>Dialog_overlay$1,($$anchor2,SheetPrimitive_Overlay)=>{SheetPrimitive_Overlay($$anchor2,spread_props({"data-slot":"sheet-overlay",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}const sheetVariants=tv({base:`border-border/30 dark:border-border/20 data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-sm transition ease-in-out data-[state=close\
d]:duration-300 data-[state=open]:duration-500 ${PANEL_CLASSES}`,variants:{side:{top:"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",bottom:"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",left:"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",right:"data-[state=closed]:slide-out-to-right data-[\
-state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"}},defaultVariants:{side:"right"}});var root_3$P=from_html('<!> <span class="sr-only">Close</span>',1),root_2$11=from_html("<!> <!>",1),root_1$K=from_html("<!> <!>",1);function Sheet_content($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),side=prop($$props,"side",3,"right"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","side","portalProps","children"]);var fragment=comment$2(),
-node2=first_child(fragment);component(node2,()=>Portal$2,($$anchor2,SheetPrimitive_Portal)=>{SheetPrimitive_Portal($$anchor2,spread_props(()=>$$props.portalProps,{children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$K(),node_1=first_child(fragment_1);Sheet_overlay(node_1,{});var node_2=sibling(node_1,2);{let $0=user_derived(()=>cn$1(sheetVariants({side:side()}),$$props.class));component(node_2,()=>Dialog_content$1,($$anchor4,SheetPrimitive_Content)=>{SheetPrimitive_Content($$anchor4,spread_props(
-{"data-slot":"sheet-content",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$11(),node_3=first_child(fragment_2);snippet(node_3,()=>$$props.children??noop$3);var node_4=sibling(node_3,2);component(node_4,()=>Dialog_close,($$anchor6,SheetPrimitive_Close)=>{SheetPrimitive_Close($$anchor6,{class:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover\
-:opacity-100 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none",children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$P(),node_5=first_child(fragment_3);X(node_5,{class:"size-4"}),next$1(2),append($$anchor7,fragment_3)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}}))})}append($$anchor3,fragment_1)},$$slots:{default:!0}}))}),append($$anchor,fragment),pop()}var root$1p=from_html("<di\
-v><!></div>");function Sheet_header($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$1p();attribute_effect(div,$0=>({"data-slot":"sheet-header",class:$0,...restProps}),[()=>cn$1("flex flex-col gap-1.5 p-4",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}
+state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm"}},defaultVariants:{side:"right"}});var root_3$Q=from_html('<!> <span class="sr-only">Close</span>',1),root_2$10=from_html("<!> <!>",1),root_1$L=from_html("<!> <!>",1);function Sheet_content($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),side=prop($$props,"side",3,"right"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","side","portalProps","children"]);var fragment=comment$2(),
+node2=first_child(fragment);component(node2,()=>Portal$2,($$anchor2,SheetPrimitive_Portal)=>{SheetPrimitive_Portal($$anchor2,spread_props(()=>$$props.portalProps,{children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$L(),node_1=first_child(fragment_1);Sheet_overlay(node_1,{});var node_2=sibling(node_1,2);{let $0=user_derived(()=>cn$1(sheetVariants({side:side()}),$$props.class));component(node_2,()=>Dialog_content$1,($$anchor4,SheetPrimitive_Content)=>{SheetPrimitive_Content($$anchor4,spread_props(
+{"data-slot":"sheet-content",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$10(),node_3=first_child(fragment_2);snippet(node_3,()=>$$props.children??noop$3);var node_4=sibling(node_3,2);component(node_4,()=>Dialog_close,($$anchor6,SheetPrimitive_Close)=>{SheetPrimitive_Close($$anchor6,{class:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover\
+:opacity-100 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none",children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$Q(),node_5=first_child(fragment_3);X(node_5,{class:"size-4"}),next$1(2),append($$anchor7,fragment_3)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}}))})}append($$anchor3,fragment_1)},$$slots:{default:!0}}))}),append($$anchor,fragment),pop()}var root$1q=from_html("<di\
+v><!></div>");function Sheet_header($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$1q();attribute_effect(div,$0=>({"data-slot":"sheet-header",class:$0,...restProps}),[()=>cn$1("flex flex-col gap-1.5 p-4",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}
function Sheet_title($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("font-semibold text-foreground",$$props.class));component(node2,()=>Dialog_title$1,($$anchor2,SheetPrimitive_Title)=>{SheetPrimitive_Title($$anchor2,spread_props({"data-slot":"sheet-title",get class(){return get$3($0)}},()=>restProps,{get ref(){
return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}function Sheet_description($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("text-sm text-muted-foreground",$$props.class));component(node2,()=>Dialog_description$1,($$anchor2,SheetPrimitive_Description)=>{SheetPrimitive_Description(
-$$anchor2,spread_props({"data-slot":"sheet-description",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}const Root$3=Dialog;var root_3$O=from_html("<!> <!>",1),root_7$r=from_html('<button type="button"><!> <span> </span></button>'),root_10$e=from_html('<button type="button" disabled=""><!> <span> </span></button>'),root_11$d=from_html("<p> </p>"),root_9$k=from_html("<!> <!>",1),root_15$a=from_html('<butto\
-n type="button"><!> <span> </span></button>'),root_16$4=from_html("<p>PDFs will be converted to text. Image-based PDFs may not work properly.</p>"),root_14$6=from_html("<!> <!>",1),root_20$3=from_html('<button type="button"><!> <span> </span></button>'),root_21$5=from_html("<p> </p>"),root_19$9=from_html("<!> <!>",1),root_23$3=from_html('<button type="button"><!> <span> </span></button>'),root_2$10=from_html('<!> <div class="flex flex-col gap-1 px-1.5 pb-2"><!> <!> <!> <div class="my-2 border-t"\
-></div> <a href="#/settings/mcp" class="flex items-center gap-3 px-3 py-2"><!> <span class="text-sm">MCP Servers</span></a> <a href="#/settings/chat/tools" class="flex items-center gap-3 px-3 py-2"><!> <span class="text-sm">Tools</span></a> <!></div>',1),root_1$J=from_html("<!> <!>",1),root$1o=from_html("<div><!></div>");function ChatFormActionAddSheet($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),disabled=prop($$props,"disabled",3,!1),hasAudioModality=prop($$props,
+$$anchor2,spread_props({"data-slot":"sheet-description",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}const Root$3=Dialog;var root_3$P=from_html("<!> <!>",1),root_7$r=from_html('<button type="button"><!> <span> </span></button>'),root_10$d=from_html('<button type="button" disabled=""><!> <span> </span></button>'),root_11$d=from_html("<p> </p>"),root_9$k=from_html("<!> <!>",1),root_15$9=from_html('<butto\
+n type="button"><!> <span> </span></button>'),root_16$4=from_html("<p>PDFs will be converted to text. Image-based PDFs may not work properly.</p>"),root_14$6=from_html("<!> <!>",1),root_20$3=from_html('<button type="button"><!> <span> </span></button>'),root_21$4=from_html("<p> </p>"),root_19$9=from_html("<!> <!>",1),root_23$4=from_html('<button type="button"><!> <span> </span></button>'),root_2$$=from_html('<!> <div class="flex flex-col gap-1 px-1.5 pb-2"><!> <!> <!> <div class="my-2 border-t">\
+</div> <a href="#/settings/mcp" class="flex items-center gap-3 px-3 py-2"><!> <span class="text-sm">MCP Servers</span></a> <a href="#/settings/chat/tools" class="flex items-center gap-3 px-3 py-2"><!> <span class="text-sm">Tools</span></a> <!></div>',1),root_1$K=from_html("<!> <!>",1),root$1p=from_html("<div><!></div>");function ChatFormActionAddSheet($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),disabled=prop($$props,"disabled",3,!1),hasAudioModality=prop($$props,
"hasAudioModality",3,!1),hasVisionModality=prop($$props,"hasVisionModality",3,!1),hasMcpPromptsSupport=prop($$props,"hasMcpPromptsSupport",3,!1),hasMcpResourcesSupport=prop($$props,"hasMcpResourcesSupport",3,!1),sheetOpen=state$1(!1);const attachmentMenu=useAttachmentMenu(()=>({hasVisionModality:hasVisionModality(),hasAudioModality:hasAudioModality(),hasMcpPromptsSupport:hasMcpPromptsSupport(),hasMcpResourcesSupport:hasMcpResourcesSupport()}),()=>({onFileUpload:$$props.onFileUpload,onSystemPromptClick:$$props.
-onSystemPromptClick,onMcpPromptClick:$$props.onMcpPromptClick,onMcpResourcesClick:$$props.onMcpResourcesClick}),()=>{set$1(sheetOpen,!1)}),sheetItemClass="flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-left text-sm transition-colors hover:bg-accent active:bg-accent disabled:cursor-not-allowed disabled:opacity-50";var div=root$1o(),node2=child(div);component(node2,()=>Root$3,($$anchor2,Sheet_Root)=>{Sheet_Root($$anchor2,{get open(){return get$3(sheetOpen)},set open($$value){set$1(sheetOpen,
-$$value,!0)},children:($$anchor3,$$slotProps)=>{var fragment=root_1$J(),node_1=first_child(fragment);snippet(node_1,()=>$$props.trigger,()=>({disabled:disabled(),onclick:()=>set$1(sheetOpen,!0)}));var node_2=sibling(node_1,2);component(node_2,()=>Sheet_content,($$anchor4,Sheet_Content)=>{Sheet_Content($$anchor4,{side:"bottom",class:"max-h-[85vh] gap-0 overflow-y-auto",children:($$anchor5,$$slotProps2)=>{var fragment_1=root_2$10(),node_3=first_child(fragment_1);component(node_3,()=>Sheet_header,($$anchor6,Sheet_Header)=>{
-Sheet_Header($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_2=root_3$O(),node_4=first_child(fragment_2);component(node_4,()=>Sheet_title,($$anchor8,Sheet_Title)=>{Sheet_Title($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();var text2=text$8("Add to chat");append($$anchor9,text2)},$$slots:{default:!0}})});var node_5=sibling(node_4,2);component(node_5,()=>Sheet_description,($$anchor8,Sheet_Description)=>{Sheet_Description($$anchor8,{class:"sr-only",children:($$anchor9,$$slotProps4)=>{
+onSystemPromptClick,onMcpPromptClick:$$props.onMcpPromptClick,onMcpResourcesClick:$$props.onMcpResourcesClick}),()=>{set$1(sheetOpen,!1)}),sheetItemClass="flex w-full items-center gap-3 rounded-md px-3 py-2.5 text-left text-sm transition-colors hover:bg-accent active:bg-accent disabled:cursor-not-allowed disabled:opacity-50";var div=root$1p(),node2=child(div);component(node2,()=>Root$3,($$anchor2,Sheet_Root)=>{Sheet_Root($$anchor2,{get open(){return get$3(sheetOpen)},set open($$value){set$1(sheetOpen,
+$$value,!0)},children:($$anchor3,$$slotProps)=>{var fragment=root_1$K(),node_1=first_child(fragment);snippet(node_1,()=>$$props.trigger,()=>({disabled:disabled(),onclick:()=>set$1(sheetOpen,!0)}));var node_2=sibling(node_1,2);component(node_2,()=>Sheet_content,($$anchor4,Sheet_Content)=>{Sheet_Content($$anchor4,{side:"bottom",class:"max-h-[85vh] gap-0 overflow-y-auto",children:($$anchor5,$$slotProps2)=>{var fragment_1=root_2$$(),node_3=first_child(fragment_1);component(node_3,()=>Sheet_header,($$anchor6,Sheet_Header)=>{
+Sheet_Header($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_2=root_3$P(),node_4=first_child(fragment_2);component(node_4,()=>Sheet_title,($$anchor8,Sheet_Title)=>{Sheet_Title($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();var text2=text$8("Add to chat");append($$anchor9,text2)},$$slots:{default:!0}})});var node_5=sibling(node_4,2);component(node_5,()=>Sheet_description,($$anchor8,Sheet_Description)=>{Sheet_Description($$anchor8,{class:"sr-only",children:($$anchor9,$$slotProps4)=>{
next$1();var text_1=text$8("Add files, system prompt or configure MCP servers");append($$anchor9,text_1)},$$slots:{default:!0}})}),append($$anchor7,fragment_2)},$$slots:{default:!0}})});var div_1=sibling(node_3,2),node_6=child(div_1);each(node_6,17,()=>ATTACHMENT_FILE_ITEMS,item=>item.id,($$anchor6,item)=>{const enabled=user_derived(()=>attachmentMenu.isItemEnabled(get$3(item).enabledWhen));var fragment_3=comment$2(),node_7=first_child(fragment_3);{var consequent=$$anchor7=>{var button=root_7$r();
set_class(button,1,clsx(sheetItemClass));var node_8=child(button);component(node_8,()=>get$3(item).icon,($$anchor8,item_icon)=>{item_icon($$anchor8,{class:"h-4 w-4 shrink-0"})});var span=sibling(node_8,2),text_2=child(span,!0);reset(span),reset(button),template_effect(()=>set_text(text_2,get$3(item).label)),delegated("click",button,()=>attachmentMenu.callbacks[get$3(item).action]()),append($$anchor7,button)},consequent_1=$$anchor7=>{var fragment_4=comment$2(),node_9=first_child(fragment_4);component(
-node_9,()=>Root$5,($$anchor8,Tooltip_Root)=>{Tooltip_Root($$anchor8,{get delayDuration(){return TOOLTIP_DELAY_DURATION},children:($$anchor9,$$slotProps3)=>{var fragment_5=root_9$k(),node_10=first_child(fragment_5);component(node_10,()=>Tooltip_trigger,($$anchor10,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor10,{children:($$anchor11,$$slotProps4)=>{var button_1=root_10$e();set_class(button_1,1,clsx(sheetItemClass));var node_11=child(button_1);component(node_11,()=>get$3(item).icon,($$anchor12,item_icon_1)=>{
+node_9,()=>Root$5,($$anchor8,Tooltip_Root)=>{Tooltip_Root($$anchor8,{get delayDuration(){return TOOLTIP_DELAY_DURATION},children:($$anchor9,$$slotProps3)=>{var fragment_5=root_9$k(),node_10=first_child(fragment_5);component(node_10,()=>Tooltip_trigger,($$anchor10,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor10,{children:($$anchor11,$$slotProps4)=>{var button_1=root_10$d();set_class(button_1,1,clsx(sheetItemClass));var node_11=child(button_1);component(node_11,()=>get$3(item).icon,($$anchor12,item_icon_1)=>{
item_icon_1($$anchor12,{class:"h-4 w-4 shrink-0"})});var span_1=sibling(node_11,2),text_3=child(span_1,!0);reset(span_1),reset(button_1),template_effect(()=>set_text(text_3,get$3(item).label)),append($$anchor11,button_1)},$$slots:{default:!0}})});var node_12=sibling(node_10,2);component(node_12,()=>Tooltip_content,($$anchor10,Tooltip_Content)=>{Tooltip_Content($$anchor10,{side:"right",children:($$anchor11,$$slotProps4)=>{var p2=root_11$d(),text_4=child(p2,!0);reset(p2),template_effect(()=>set_text(
text_4,get$3(item).disabledTooltip)),append($$anchor11,p2)},$$slots:{default:!0}})}),append($$anchor9,fragment_5)},$$slots:{default:!0}})}),append($$anchor7,fragment_4)};if_block(node_7,$$render=>{get$3(enabled)?$$render(consequent):get$3(item).disabledTooltip&&$$render(consequent_1,1)})}append($$anchor6,fragment_3)});var node_13=sibling(node_6,2);{var consequent_3=$$anchor6=>{const pdfItem=user_derived(()=>ATTACHMENT_FILE_ITEMS.find(i=>i.id===AttachmentMenuItemId.PDF));var fragment_6=comment$2(),
-node_14=first_child(fragment_6);{var consequent_2=$$anchor7=>{var fragment_7=comment$2(),node_15=first_child(fragment_7);component(node_15,()=>Root$5,($$anchor8,Tooltip_Root_1)=>{Tooltip_Root_1($$anchor8,{get delayDuration(){return TOOLTIP_DELAY_DURATION},children:($$anchor9,$$slotProps3)=>{var fragment_8=root_14$6(),node_16=first_child(fragment_8);component(node_16,()=>Tooltip_trigger,($$anchor10,Tooltip_Trigger_1)=>{Tooltip_Trigger_1($$anchor10,{children:($$anchor11,$$slotProps4)=>{var button_2=root_15$a();
+node_14=first_child(fragment_6);{var consequent_2=$$anchor7=>{var fragment_7=comment$2(),node_15=first_child(fragment_7);component(node_15,()=>Root$5,($$anchor8,Tooltip_Root_1)=>{Tooltip_Root_1($$anchor8,{get delayDuration(){return TOOLTIP_DELAY_DURATION},children:($$anchor9,$$slotProps3)=>{var fragment_8=root_14$6(),node_16=first_child(fragment_8);component(node_16,()=>Tooltip_trigger,($$anchor10,Tooltip_Trigger_1)=>{Tooltip_Trigger_1($$anchor10,{children:($$anchor11,$$slotProps4)=>{var button_2=root_15$9();
set_class(button_2,1,clsx(sheetItemClass));var node_17=child(button_2);component(node_17,()=>get$3(pdfItem).icon,($$anchor12,pdfItem_icon)=>{pdfItem_icon($$anchor12,{class:"h-4 w-4 shrink-0"})});var span_2=sibling(node_17,2),text_5=child(span_2,!0);reset(span_2),reset(button_2),template_effect(()=>set_text(text_5,get$3(pdfItem).label)),delegated("click",button_2,()=>attachmentMenu.callbacks[get$3(pdfItem).action]()),append($$anchor11,button_2)},$$slots:{default:!0}})});var node_18=sibling(node_16,
2);component(node_18,()=>Tooltip_content,($$anchor10,Tooltip_Content_1)=>{Tooltip_Content_1($$anchor10,{side:"right",children:($$anchor11,$$slotProps4)=>{var p_1=root_16$4();append($$anchor11,p_1)},$$slots:{default:!0}})}),append($$anchor9,fragment_8)},$$slots:{default:!0}})}),append($$anchor7,fragment_7)};if_block(node_14,$$render=>{get$3(pdfItem)&&$$render(consequent_2)})}append($$anchor6,fragment_6)},d2=user_derived(()=>!attachmentMenu.isItemEnabled("hasVisionModality"));if_block(node_13,$$render=>{
get$3(d2)&&$$render(consequent_3)})}var node_19=sibling(node_13,2);each(node_19,17,()=>ATTACHMENT_EXTRA_ITEMS,item=>item.id,($$anchor6,item)=>{var fragment_9=comment$2(),node_20=first_child(fragment_9);{var consequent_4=$$anchor7=>{var fragment_10=comment$2(),node_21=first_child(fragment_10);component(node_21,()=>Root$5,($$anchor8,Tooltip_Root_2)=>{Tooltip_Root_2($$anchor8,{get delayDuration(){return TOOLTIP_DELAY_DURATION},children:($$anchor9,$$slotProps3)=>{var fragment_11=root_19$9(),node_22=first_child(
fragment_11);component(node_22,()=>Tooltip_trigger,($$anchor10,Tooltip_Trigger_2)=>{Tooltip_Trigger_2($$anchor10,{children:($$anchor11,$$slotProps4)=>{var button_3=root_20$3();set_class(button_3,1,clsx(sheetItemClass));var node_23=child(button_3);component(node_23,()=>get$3(item).icon,($$anchor12,item_icon_2)=>{item_icon_2($$anchor12,{class:"h-4 w-4 shrink-0"})});var span_3=sibling(node_23,2),text_6=child(span_3,!0);reset(span_3),reset(button_3),template_effect(()=>set_text(text_6,get$3(item).label)),
-delegated("click",button_3,()=>attachmentMenu.callbacks[get$3(item).action]()),append($$anchor11,button_3)},$$slots:{default:!0}})});var node_24=sibling(node_22,2);component(node_24,()=>Tooltip_content,($$anchor10,Tooltip_Content_2)=>{Tooltip_Content_2($$anchor10,{side:"right",children:($$anchor11,$$slotProps4)=>{var p_2=root_21$5(),text_7=child(p_2,!0);reset(p_2),template_effect($0=>set_text(text_7,$0),[()=>attachmentMenu.getSystemMessageTooltip()]),append($$anchor11,p_2)},$$slots:{default:!0}})}),
+delegated("click",button_3,()=>attachmentMenu.callbacks[get$3(item).action]()),append($$anchor11,button_3)},$$slots:{default:!0}})});var node_24=sibling(node_22,2);component(node_24,()=>Tooltip_content,($$anchor10,Tooltip_Content_2)=>{Tooltip_Content_2($$anchor10,{side:"right",children:($$anchor11,$$slotProps4)=>{var p_2=root_21$4(),text_7=child(p_2,!0);reset(p_2),template_effect($0=>set_text(text_7,$0),[()=>attachmentMenu.getSystemMessageTooltip()]),append($$anchor11,p_2)},$$slots:{default:!0}})}),
append($$anchor9,fragment_11)},$$slots:{default:!0}})}),append($$anchor7,fragment_10)};if_block(node_20,$$render=>{get$3(item).id===AttachmentMenuItemId.SYSTEM_MESSAGE&&$$render(consequent_4)})}append($$anchor6,fragment_9)});var a=sibling(node_19,4),node_25=child(a);McpLogo(node_25,{class:"inline h-4 w-4"}),next$1(2),reset(a);var a_1=sibling(a,2),node_26=child(a_1);Pencil_ruler(node_26,{class:"inline h-4 w-4"}),next$1(2),reset(a_1);var node_27=sibling(a_1,2);each(node_27,17,()=>ATTACHMENT_MCP_ITEMS,
-item=>item.id,($$anchor6,item)=>{var fragment_12=comment$2(),node_28=first_child(fragment_12);{var consequent_5=$$anchor7=>{var button_4=root_23$3();set_class(button_4,1,clsx(sheetItemClass));var node_29=child(button_4);component(node_29,()=>get$3(item).icon,($$anchor8,item_icon_3)=>{item_icon_3($$anchor8,{class:"h-4 w-4 shrink-0"})});var span_4=sibling(node_29,2),text_8=child(span_4,!0);reset(span_4),reset(button_4),template_effect(()=>set_text(text_8,get$3(item).label)),delegated("click",button_4,
+item=>item.id,($$anchor6,item)=>{var fragment_12=comment$2(),node_28=first_child(fragment_12);{var consequent_5=$$anchor7=>{var button_4=root_23$4();set_class(button_4,1,clsx(sheetItemClass));var node_29=child(button_4);component(node_29,()=>get$3(item).icon,($$anchor8,item_icon_3)=>{item_icon_3($$anchor8,{class:"h-4 w-4 shrink-0"})});var span_4=sibling(node_29,2),text_8=child(span_4,!0);reset(span_4),reset(button_4),template_effect(()=>set_text(text_8,get$3(item).label)),delegated("click",button_4,
()=>attachmentMenu.callbacks[get$3(item).action]()),append($$anchor7,button_4)},d_12=user_derived(()=>attachmentMenu.isItemVisible(get$3(item).visibleWhen));if_block(node_28,$$render=>{get$3(d_12)&&$$render(consequent_5)})}append($$anchor6,fragment_12)}),reset(div_1),append($$anchor5,fragment_1)},$$slots:{default:!0}})}),append($$anchor3,fragment)},$$slots:{default:!0}})}),reset(div),template_effect(()=>set_class(div,1,`flex items-center gap-1 ${className()??""}`)),append($$anchor,div),pop()}delegate(
-["click"]);var root_3$N=from_html('<span class="sr-only"> </span> <!>',1),root_4$y=from_html("<p> </p>"),root_1$I=from_html("<!> <!>",1);function ChatFormActionAddButton($$anchor,$$props){let disabled=prop($$props,"disabled",3,!1);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$5,($$anchor2,Tooltip_Root)=>{Tooltip_Root($$anchor2,{children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$I(),node_1=first_child(fragment_1);component(node_1,()=>Tooltip_trigger,($$anchor4,Tooltip_Trigger)=>{
-Tooltip_Trigger($$anchor4,{class:"w-full",children:($$anchor5,$$slotProps2)=>{Button($$anchor5,{class:"file-upload-button h-8 w-8 rounded-full p-0",get disabled(){return disabled()},get onclick(){return $$props.onclick},variant:"secondary",type:"button",children:($$anchor6,$$slotProps3)=>{var fragment_3=root_3$N(),span=first_child(fragment_3),text2=child(span,!0);reset(span);var node_2=sibling(span,2);Plus(node_2,{class:"h-4 w-4"}),template_effect(()=>set_text(text2,ATTACHMENT_TOOLTIP_TEXT)),append(
-$$anchor6,fragment_3)},$$slots:{default:!0}})},$$slots:{default:!0}})});var node_3=sibling(node_1,2);component(node_3,()=>Tooltip_content,($$anchor4,Tooltip_Content)=>{Tooltip_Content($$anchor4,{children:($$anchor5,$$slotProps2)=>{var p2=root_4$y(),text_1=child(p2,!0);reset(p2),template_effect(()=>set_text(text_1,ATTACHMENT_TOOLTIP_TEXT)),append($$anchor5,p2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment)}function ChatFormActionsAdd($$anchor,$$props){
+["click"]);var root_3$O=from_html('<span class="sr-only"> </span> <!>',1),root_4$z=from_html("<p> </p>"),root_1$J=from_html("<!> <!>",1);function ChatFormActionAddButton($$anchor,$$props){let disabled=prop($$props,"disabled",3,!1);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$5,($$anchor2,Tooltip_Root)=>{Tooltip_Root($$anchor2,{children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$J(),node_1=first_child(fragment_1);component(node_1,()=>Tooltip_trigger,($$anchor4,Tooltip_Trigger)=>{
+Tooltip_Trigger($$anchor4,{class:"w-full",children:($$anchor5,$$slotProps2)=>{Button($$anchor5,{class:"file-upload-button h-8 w-8 rounded-full p-0",get disabled(){return disabled()},get onclick(){return $$props.onclick},variant:"secondary",type:"button",children:($$anchor6,$$slotProps3)=>{var fragment_3=root_3$O(),span=first_child(fragment_3),text2=child(span,!0);reset(span);var node_2=sibling(span,2);Plus(node_2,{class:"h-4 w-4"}),template_effect(()=>set_text(text2,ATTACHMENT_TOOLTIP_TEXT)),append(
+$$anchor6,fragment_3)},$$slots:{default:!0}})},$$slots:{default:!0}})});var node_3=sibling(node_1,2);component(node_3,()=>Tooltip_content,($$anchor4,Tooltip_Content)=>{Tooltip_Content($$anchor4,{children:($$anchor5,$$slotProps2)=>{var p2=root_4$z(),text_1=child(p2,!0);reset(p2),template_effect(()=>set_text(text_1,ATTACHMENT_TOOLTIP_TEXT)),append($$anchor5,p2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment)}function ChatFormActionsAdd($$anchor,$$props){
push$1($$props,!0);let disabled=prop($$props,"disabled",3,!1),hasAudioModality=prop($$props,"hasAudioModality",3,!1),hasMcpPromptsSupport=prop($$props,"hasMcpPromptsSupport",3,!1),hasMcpResourcesSupport=prop($$props,"hasMcpResourcesSupport",3,!1),hasVisionModality=prop($$props,"hasVisionModality",3,!1);const isMobile=new IsMobile;var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{ChatFormActionAddSheet($$anchor2,{get disabled(){return disabled()},get hasAudioModality(){
return hasAudioModality()},get hasVisionModality(){return hasVisionModality()},get hasMcpPromptsSupport(){return hasMcpPromptsSupport()},get hasMcpResourcesSupport(){return hasMcpResourcesSupport()},get onFileUpload(){return $$props.onFileUpload},get onMcpPromptClick(){return $$props.onMcpPromptClick},get onMcpResourcesClick(){return $$props.onMcpResourcesClick},trigger:($$anchor3,$$arg0)=>{let disabled2=()=>$$arg0?.().disabled,onclick=()=>$$arg0?.().onclick;ChatFormActionAddButton($$anchor3,{get disabled(){
return disabled2()},get onclick(){return onclick()}})},$$slots:{trigger:!0}})},alternate=$$anchor2=>{ChatFormActionAddDropdown($$anchor2,{get disabled(){return disabled()},get hasAudioModality(){return hasAudioModality()},get hasVisionModality(){return hasVisionModality()},get hasMcpPromptsSupport(){return hasMcpPromptsSupport()},get hasMcpResourcesSupport(){return hasMcpResourcesSupport()},get onFileUpload(){return $$props.onFileUpload},get onMcpPromptClick(){return $$props.onMcpPromptClick},get onMcpResourcesClick(){
-return $$props.onMcpResourcesClick},get onMcpSettingsClick(){return $$props.onMcpSettingsClick},get onSystemPromptClick(){return $$props.onSystemPromptClick},trigger:$$anchor3=>{ChatFormActionAddButton($$anchor3,{get disabled(){return disabled()}})},$$slots:{trigger:!0}})};if_block(node2,$$render=>{isMobile.current?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_3$M=from_html('<span class="sr-only"> </span> <!>',1),root_7$q=from_html("<p>Current model does \
-not support audio</p>"),root_1$H=from_html("<!> <!>",1),root$1n=from_html("<div><!></div>");function ChatFormActionRecord($$anchor,$$props){let className=prop($$props,"class",3,""),disabled=prop($$props,"disabled",3,!1),hasAudioModality=prop($$props,"hasAudioModality",3,!1),isLoading2=prop($$props,"isLoading",3,!1),isRecording=prop($$props,"isRecording",3,!1);var div=root$1n(),node2=child(div);component(node2,()=>Root$5,($$anchor2,Tooltip_Root)=>{Tooltip_Root($$anchor2,{children:($$anchor3,$$slotProps)=>{
-var fragment=root_1$H(),node_1=first_child(fragment);component(node_1,()=>Tooltip_trigger,($$anchor4,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor4,{children:($$anchor5,$$slotProps2)=>{{let $0=user_derived(()=>isRecording()?"animate-pulse bg-red-500 text-white hover:bg-red-600":""),$1=user_derived(()=>disabled()||isLoading2()||!hasAudioModality());Button($$anchor5,{get class(){return`h-8 w-8 rounded-full p-0 ${get$3($0)??""}`},get disabled(){return get$3($1)},get onclick(){return $$props.onMicClick},
-type:"button",children:($$anchor6,$$slotProps3)=>{var fragment_2=root_3$M(),span=first_child(fragment_2),text2=child(span,!0);reset(span);var node_2=sibling(span,2);{var consequent=$$anchor7=>{Square($$anchor7,{class:"h-4 w-4 animate-pulse fill-white"})},alternate=$$anchor7=>{Mic($$anchor7,{class:"h-4 w-4"})};if_block(node_2,$$render=>{isRecording()?$$render(consequent):$$render(alternate,-1)})}template_effect(()=>set_text(text2,isRecording()?"Stop recording":"Start recording")),append($$anchor6,
+return $$props.onMcpResourcesClick},get onMcpSettingsClick(){return $$props.onMcpSettingsClick},get onSystemPromptClick(){return $$props.onSystemPromptClick},trigger:$$anchor3=>{ChatFormActionAddButton($$anchor3,{get disabled(){return disabled()}})},$$slots:{trigger:!0}})};if_block(node2,$$render=>{isMobile.current?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),pop()}var root_3$N=from_html('<span class="sr-only"> </span> <!>',1),root_7$q=from_html("<p>Current model does \
+not support audio</p>"),root_1$I=from_html("<!> <!>",1),root$1o=from_html("<div><!></div>");function ChatFormActionRecord($$anchor,$$props){let className=prop($$props,"class",3,""),disabled=prop($$props,"disabled",3,!1),hasAudioModality=prop($$props,"hasAudioModality",3,!1),isLoading2=prop($$props,"isLoading",3,!1),isRecording=prop($$props,"isRecording",3,!1);var div=root$1o(),node2=child(div);component(node2,()=>Root$5,($$anchor2,Tooltip_Root)=>{Tooltip_Root($$anchor2,{children:($$anchor3,$$slotProps)=>{
+var fragment=root_1$I(),node_1=first_child(fragment);component(node_1,()=>Tooltip_trigger,($$anchor4,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor4,{children:($$anchor5,$$slotProps2)=>{{let $0=user_derived(()=>isRecording()?"animate-pulse bg-red-500 text-white hover:bg-red-600":""),$1=user_derived(()=>disabled()||isLoading2()||!hasAudioModality());Button($$anchor5,{get class(){return`h-8 w-8 rounded-full p-0 ${get$3($0)??""}`},get disabled(){return get$3($1)},get onclick(){return $$props.onMicClick},
+type:"button",children:($$anchor6,$$slotProps3)=>{var fragment_2=root_3$N(),span=first_child(fragment_2),text2=child(span,!0);reset(span);var node_2=sibling(span,2);{var consequent=$$anchor7=>{Square($$anchor7,{class:"h-4 w-4 animate-pulse fill-white"})},alternate=$$anchor7=>{Mic($$anchor7,{class:"h-4 w-4"})};if_block(node_2,$$render=>{isRecording()?$$render(consequent):$$render(alternate,-1)})}template_effect(()=>set_text(text2,isRecording()?"Stop recording":"Start recording")),append($$anchor6,
fragment_2)},$$slots:{default:!0}})}},$$slots:{default:!0}})});var node_3=sibling(node_1,2);{var consequent_1=$$anchor4=>{var fragment_5=comment$2(),node_4=first_child(fragment_5);component(node_4,()=>Tooltip_content,($$anchor5,Tooltip_Content)=>{Tooltip_Content($$anchor5,{children:($$anchor6,$$slotProps2)=>{var p2=root_7$q();append($$anchor6,p2)},$$slots:{default:!0}})}),append($$anchor4,fragment_5)};if_block(node_3,$$render=>{hasAudioModality()||$$render(consequent_1)})}append($$anchor3,fragment)},
-$$slots:{default:!0}})}),reset(div),template_effect(()=>set_class(div,1,`flex items-center gap-1 ${className()??""}`)),append($$anchor,div)}var root_1$G=from_html('<div class="mr-auto flex items-center gap-2"><!></div>'),root_4$x=from_html('<span class="sr-only">Stop</span> <!>',1),root$1m=from_html('<div style="container-type: inline-size"><!> <!> <!></div>');function ChatFormActions($$anchor,$$props){push$1($$props,!0);let canSend=prop($$props,"canSend",3,!1),canSubmit=prop($$props,"canSubmit",
+$$slots:{default:!0}})}),reset(div),template_effect(()=>set_class(div,1,`flex items-center gap-1 ${className()??""}`)),append($$anchor,div)}var root_1$H=from_html('<div class="mr-auto flex items-center gap-2"><!></div>'),root_4$y=from_html('<span class="sr-only">Stop</span> <!>',1),root$1n=from_html('<div style="container-type: inline-size"><!> <!> <!></div>');function ChatFormActions($$anchor,$$props){push$1($$props,!0);let canSend=prop($$props,"canSend",3,!1),canSubmit=prop($$props,"canSubmit",
3,!1),className=prop($$props,"class",3,""),disabled=prop($$props,"disabled",3,!1),isLoading2=prop($$props,"isLoading",3,!1),isRecording=prop($$props,"isRecording",3,!1),showAddButton=prop($$props,"showAddButton",3,!0),showModelSelector=prop($$props,"showModelSelector",3,!0),uploadedFiles=prop($$props,"uploadedFiles",19,()=>[]),currentConfig=user_derived(config$1),hasMcpPromptsSupport=user_derived(()=>{const perChatOverrides=conversationsStore.getAllMcpServerOverrides();return mcpStore.hasPromptsCapability(
perChatOverrides)}),hasMcpResourcesSupport=user_derived(()=>{const perChatOverrides=conversationsStore.getAllMcpServerOverrides();return mcpStore.hasResourcesCapability(perChatOverrides)}),hasAudioModality=state$1(!1),hasVisionModality=state$1(!1),hasModelSelected=state$1(!1),isSelectedModelInCache=state$1(!0),submitTooltip=state$1(""),hasAudioAttachments=user_derived(()=>uploadedFiles().some(file=>getFileTypeCategory(file.type)===FileTypeCategory.AUDIO)),shouldShowRecordButton=user_derived(()=>get$3(
-hasAudioModality)&&!canSubmit()&&!get$3(hasAudioAttachments)&&get$3(currentConfig).autoMicOnEmpty),selectorModelRef=state$1(void 0);function openModelSelector(){get$3(selectorModelRef)?.open()}var $$exports={openModelSelector},div=root$1m(),node2=child(div);{var consequent=$$anchor2=>{var div_1=root_1$G(),node_1=child(div_1);ChatFormActionsAdd(node_1,{get disabled(){return disabled()},get hasAudioModality(){return get$3(hasAudioModality)},get hasVisionModality(){return get$3(hasVisionModality)},
+hasAudioModality)&&!canSubmit()&&!get$3(hasAudioAttachments)&&get$3(currentConfig).autoMicOnEmpty),selectorModelRef=state$1(void 0);function openModelSelector(){get$3(selectorModelRef)?.open()}var $$exports={openModelSelector},div=root$1n(),node2=child(div);{var consequent=$$anchor2=>{var div_1=root_1$H(),node_1=child(div_1);ChatFormActionsAdd(node_1,{get disabled(){return disabled()},get hasAudioModality(){return get$3(hasAudioModality)},get hasVisionModality(){return get$3(hasVisionModality)},
get hasMcpPromptsSupport(){return get$3(hasMcpPromptsSupport)},get hasMcpResourcesSupport(){return get$3(hasMcpResourcesSupport)},get onFileUpload(){return $$props.onFileUpload},get onSystemPromptClick(){return $$props.onSystemPromptClick},get onMcpPromptClick(){return $$props.onMcpPromptClick},get onMcpResourcesClick(){return $$props.onMcpResourcesClick},onMcpSettingsClick:()=>goto("#/settings/mcp")}),reset(div_1),append($$anchor2,div_1)};if_block(node2,$$render=>{showAddButton()&&$$render(consequent)})}
var node_2=sibling(node2,2);{var consequent_1=$$anchor2=>{bind_this(ChatFormActionModels($$anchor2,{get disabled(){return disabled()},forceForegroundText:!0,useGlobalSelection:!0,get hasAudioModality(){return get$3(hasAudioModality)},set hasAudioModality($$value){set$1(hasAudioModality,$$value,!0)},get hasVisionModality(){return get$3(hasVisionModality)},set hasVisionModality($$value){set$1(hasVisionModality,$$value,!0)},get hasModelSelected(){return get$3(hasModelSelected)},set hasModelSelected($$value){
set$1(hasModelSelected,$$value,!0)},get isSelectedModelInCache(){return get$3(isSelectedModelInCache)},set isSelectedModelInCache($$value){set$1(isSelectedModelInCache,$$value,!0)},get submitTooltip(){return get$3(submitTooltip)},set submitTooltip($$value){set$1(submitTooltip,$$value,!0)}}),$$value=>set$1(selectorModelRef,$$value,!0),()=>get$3(selectorModelRef))};if_block(node_2,$$render=>{showModelSelector()&&$$render(consequent_1)})}var node_3=sibling(node_2,2);{var consequent_2=$$anchor2=>{Button(
-$$anchor2,{type:"button",variant:"secondary",get onclick(){return $$props.onStop},class:"group h-8 w-8 rounded-full p-0 hover:bg-destructive/10!",children:($$anchor3,$$slotProps)=>{var fragment_2=root_4$x(),node_4=sibling(first_child(fragment_2),2);Square(node_4,{class:"h-8 w-8 fill-muted-foreground stroke-muted-foreground group-hover:fill-destructive group-hover:stroke-destructive hover:fill-destructive hover:stroke-destructive"}),append($$anchor3,fragment_2)},$$slots:{default:!0}})},consequent_3=$$anchor2=>{
+$$anchor2,{type:"button",variant:"secondary",get onclick(){return $$props.onStop},class:"group h-8 w-8 rounded-full p-0 hover:bg-destructive/10!",children:($$anchor3,$$slotProps)=>{var fragment_2=root_4$y(),node_4=sibling(first_child(fragment_2),2);Square(node_4,{class:"h-8 w-8 fill-muted-foreground stroke-muted-foreground group-hover:fill-destructive group-hover:stroke-destructive hover:fill-destructive hover:stroke-destructive"}),append($$anchor3,fragment_2)},$$slots:{default:!0}})},consequent_3=$$anchor2=>{
ChatFormActionRecord($$anchor2,{get disabled(){return disabled()},get hasAudioModality(){return get$3(hasAudioModality)},get isLoading(){return isLoading2()},get isRecording(){return isRecording()},get onMicClick(){return $$props.onMicClick}})},alternate=$$anchor2=>{{let $0=user_derived(()=>canSend()&&(showModelSelector()?get$3(hasModelSelected)&&get$3(isSelectedModelInCache):!0)),$1=user_derived(()=>showModelSelector()&&get$3(hasModelSelected)&&!get$3(isSelectedModelInCache));ChatFormActionSubmit(
$$anchor2,{get canSend(){return get$3($0)},get disabled(){return disabled()},get tooltipLabel(){return get$3(submitTooltip)},get showErrorState(){return get$3($1)}})}};if_block(node_3,$$render=>{isLoading2()&&!canSubmit()?$$render(consequent_2):get$3(shouldShowRecordButton)?$$render(consequent_3,1):$$render(alternate,-1)})}return reset(div),template_effect(()=>set_class(div,1,`flex w-full items-center gap-3 ${className()??""} ${showAddButton()?"":"justify-end"}`)),append($$anchor,div),pop($$exports)}
-var root_2$$=from_html('<span class="sr-only">Send</span> <!>',1),root_6$t=from_html("<p> </p>"),root_4$w=from_html("<!> <!>",1);function ChatFormActionSubmit($$anchor,$$props){const submitButton=($$anchor2,$$arg0)=>{let props=derived_safe_equal(()=>fallback($$arg0?.(),()=>({}),!0));{let $0=user_derived(()=>["h-8 w-8 rounded-full p-0",showErrorState()&&"bg-red-400/10 text-red-400 hover:bg-red-400/20 hover:text-red-400 disabled:opacity-100"]);Button($$anchor2,spread_props({type:"submit",get disabled(){
-return get$3(isDisabled)},get class(){return get$3($0)}},()=>get$3(props),{children:($$anchor3,$$slotProps)=>{var fragment_1=root_2$$(),node2=sibling(first_child(fragment_1),2);Arrow_up(node2,{class:"h-12 w-12"}),append($$anchor3,fragment_1)},$$slots:{default:!0}}))}};let canSend=prop($$props,"canSend",3,!1),disabled=prop($$props,"disabled",3,!1),showErrorState=prop($$props,"showErrorState",3,!1),isDisabled=user_derived(()=>!canSend()||disabled());var fragment_2=comment$2(),node_1=first_child(fragment_2);
-{var consequent=$$anchor2=>{var fragment_3=comment$2(),node_2=first_child(fragment_3);component(node_2,()=>Root$5,($$anchor3,Tooltip_Root)=>{Tooltip_Root($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_4=root_4$w(),node_3=first_child(fragment_4);component(node_3,()=>Tooltip_trigger,($$anchor5,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor5,{children:($$anchor6,$$slotProps2)=>{submitButton($$anchor6)},$$slots:{default:!0}})});var node_4=sibling(node_3,2);component(node_4,()=>Tooltip_content,
-($$anchor5,Tooltip_Content)=>{Tooltip_Content($$anchor5,{children:($$anchor6,$$slotProps2)=>{var p2=root_6$t(),text2=child(p2,!0);reset(p2),template_effect(()=>set_text(text2,$$props.tooltipLabel)),append($$anchor6,p2)},$$slots:{default:!0}})}),append($$anchor4,fragment_4)},$$slots:{default:!0}})}),append($$anchor2,fragment_3)},alternate=$$anchor2=>{submitButton($$anchor2)};if_block(node_1,$$render=>{$$props.tooltipLabel?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment_2)}function ChatFormActionModels($$anchor,$$props){
+var root_2$_=from_html('<span class="sr-only">Send</span> <!>',1),root_6$s=from_html("<p> </p>"),root_4$x=from_html("<!> <!>",1);function ChatFormActionSubmit($$anchor,$$props){const submitButton=($$anchor2,$$arg0)=>{let props=derived_safe_equal(()=>fallback($$arg0?.(),()=>({}),!0));{let $0=user_derived(()=>["h-8 w-8 rounded-full p-0",showErrorState()&&"bg-red-400/10 text-red-400 hover:bg-red-400/20 hover:text-red-400 disabled:opacity-100"]);Button($$anchor2,spread_props({type:"submit",get disabled(){
+return get$3(isDisabled)},get class(){return get$3($0)}},()=>get$3(props),{children:($$anchor3,$$slotProps)=>{var fragment_1=root_2$_(),node2=sibling(first_child(fragment_1),2);Arrow_up(node2,{class:"h-12 w-12"}),append($$anchor3,fragment_1)},$$slots:{default:!0}}))}};let canSend=prop($$props,"canSend",3,!1),disabled=prop($$props,"disabled",3,!1),showErrorState=prop($$props,"showErrorState",3,!1),isDisabled=user_derived(()=>!canSend()||disabled());var fragment_2=comment$2(),node_1=first_child(fragment_2);
+{var consequent=$$anchor2=>{var fragment_3=comment$2(),node_2=first_child(fragment_3);component(node_2,()=>Root$5,($$anchor3,Tooltip_Root)=>{Tooltip_Root($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_4=root_4$x(),node_3=first_child(fragment_4);component(node_3,()=>Tooltip_trigger,($$anchor5,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor5,{children:($$anchor6,$$slotProps2)=>{submitButton($$anchor6)},$$slots:{default:!0}})});var node_4=sibling(node_3,2);component(node_4,()=>Tooltip_content,
+($$anchor5,Tooltip_Content)=>{Tooltip_Content($$anchor5,{children:($$anchor6,$$slotProps2)=>{var p2=root_6$s(),text2=child(p2,!0);reset(p2),template_effect(()=>set_text(text2,$$props.tooltipLabel)),append($$anchor6,p2)},$$slots:{default:!0}})}),append($$anchor4,fragment_4)},$$slots:{default:!0}})}),append($$anchor2,fragment_3)},alternate=$$anchor2=>{submitButton($$anchor2)};if_block(node_1,$$render=>{$$props.tooltipLabel?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment_2)}function ChatFormActionModels($$anchor,$$props){
push$1($$props,!0);let disabled=prop($$props,"disabled",3,!1),forceForegroundText=prop($$props,"forceForegroundText",3,!1),hasAudioModality=prop($$props,"hasAudioModality",15,!1),hasVisionModality=prop($$props,"hasVisionModality",15,!1),hasModelSelected=prop($$props,"hasModelSelected",15,!1),isSelectedModelInCache=prop($$props,"isSelectedModelInCache",15,!0),submitTooltip=prop($$props,"submitTooltip",15,""),useGlobalSelection=prop($$props,"useGlobalSelection",3,!1),isRouter=user_derived(isRouterMode),
isOffline=user_derived(()=>!!serverError()),conversationModel=user_derived(()=>chatStore.getConversationModel(activeMessages())),lastSyncedConversationModel=null;user_effect(()=>{if(get$3(conversationModel)&&get$3(conversationModel)!==lastSyncedConversationModel)lastSyncedConversationModel=get$3(conversationModel),modelsStore.selectModelByName(get$3(conversationModel));else if(get$3(isRouter)&&!modelsStore.selectedModelId&&modelsStore.loadedModelIds.length>0){lastSyncedConversationModel=null;const first=modelOptions().
find(m=>modelsStore.loadedModelIds.includes(m.model));first&&modelsStore.selectModelById(first.id)}});let activeModelId=user_derived(()=>{const options=modelOptions();if(!get$3(isRouter))return options.length>0?options[0].model:null;const selectedId=selectedModelId();if(selectedId){const model=options.find(m=>m.id===selectedId);if(model)return model.model}if(get$3(conversationModel)){const model=options.find(m=>m.model===get$3(conversationModel));if(model)return model.model}return null}),modelPropsVersion=state$1(
reduce((n,g)=>n+g.tools.length,0)),noToolsInfoMessage=user_derived(()=>toolsStore.loading||toolsStore.toolGroups.length>0?null:toolsStore.isToolsEndpointUnreachable?"To enable Built-In Tools you need to run llama-server with --tools all or --tools <name> flag. To see MCP Tools you need to add / enable MCP Server(s).":toolsStore.error?null:"To enable Built-In Tools you need to run llama-server with --tools all or --tools <name> flag. To see MCP Tools you need to add / enable MCP Server(s).");function getGroupCheckedState(group){
return{checked:toolsStore.isGroupFullyEnabled(group),indeterminate:toolsStore.isGroupPartiallyEnabled(group)}}function getEnabledToolCount(group){return group.tools.filter(tool=>toolsStore.isToolEnabled(tool.function.name)).length}function getFavicon(group){if(group.source!==ToolSource.MCP)return null;for(const server of mcpStore.getServersSorted())if(mcpStore.getServerLabel(server)===group.label)return mcpStore.getServerFavicon(server.id);return null}function isGroupDisabled(group){return group.
source===ToolSource.MCP&&!!group.serverId&&!conversationsStore.isMcpServerEnabledForChat(group.serverId)}function toggleGroupExpanded(label){expandedGroups.has(label)?expandedGroups.delete(label):expandedGroups.add(label)}function handleOpen(){toolsStore.builtinTools.length===0&&!toolsStore.loading&&toolsStore.fetchBuiltinTools(),mcpStore.runHealthChecksForServers(mcpStore.getServersSorted().filter(s2=>s2.enabled))}return{expandedGroups,get groups(){return get$3(groups)},get activeGroups(){return get$3(
-activeGroups)},get totalToolCount(){return get$3(totalToolCount)},get noToolsInfoMessage(){return get$3(noToolsInfoMessage)},getGroupCheckedState,getEnabledToolCount,getFavicon,isGroupDisabled,toggleGroupExpanded,handleOpen}}var root_2$_=from_html("<!> <span>Tools</span>",1),root_5$t=from_html('<div class="px-3 py-4 text-center text-sm text-muted-foreground"><!> Loading tools...</div>'),root_6$s=from_html('<div class="grid gap-2.5 px-3 py-4 text-sm text-muted-foreground"><span class="flex gap-2"\
-><!> <span>Run llama-server with <code>--tools</code> flag to enable <strong>Built-in Tools</strong>.</span></span> <span class="flex gap-2"><!> <span> <strong>MCP Tools</strong>.</span></span></div>'),root_7$p=from_html('<div class="px-3 py-4 text-center text-sm text-muted-foreground">Failed to load tools</div>'),root_8$q=from_html('<div class="flex gap-2 px-3 py-4 text-sm text-muted-foreground"><!> <span> </span></div>'),root_9$j=from_html('<div class="px-3 py-4 text-center text-sm text-muted-\
-foreground">No tools available</div>'),root_16$3=from_html('<img alt="" class="h-4 w-4 shrink-0 rounded-sm"/>'),root_13$b=from_html('<!> <span class="inline-flex min-w-0 items-center gap-1.5 font-medium"><!> <span class="truncate"> </span></span> <span class="ml-auto shrink-0 text-xs text-muted-foreground"> </span>',1),root_19$8=from_html("<p> </p>"),root_17$6=from_html("<!> <!>",1),root_21$4=from_html('<button type="button" class="flex w-full items-center gap-2 rounded px-2 py-1.5 text-left tex\
-t-sm transition-colors hover:bg-muted/50"><!> <span class="min-w-0 flex-1 truncate font-mono text-[12px]"> </span></button>'),root_20$2=from_html('<div class="ml-4 flex flex-col gap-0.5 border-l border-border/50 pl-2"></div>'),root_12$8=from_html('<div class="flex items-center gap-1"><!> <!></div> <!>',1),root_10$d=from_html('<div class="max-h-80 overflow-y-auto p-2 pr-1"></div>'),root_1$F=from_html("<!> <!>",1);function ChatFormActionAddToolsSubmenu($$anchor,$$props){push$1($$props,!0);const toolsPanel=useToolsPanel(),
-hasMcpServersAvailable=user_derived(()=>mcpStore.getServersSorted().length>0);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Sub,($$anchor2,DropdownMenu_Sub)=>{DropdownMenu_Sub($$anchor2,{onOpenChange:open2=>open2&&toolsPanel.handleOpen(),children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$F(),node_1=first_child(fragment_1);component(node_1,()=>Dropdown_menu_sub_trigger,($$anchor4,DropdownMenu_SubTrigger)=>{DropdownMenu_SubTrigger($$anchor4,{class:"flex cursor-poin\
-ter items-center gap-2",children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$_(),node_2=first_child(fragment_2);Pencil_ruler(node_2,{class:"h-4 w-4"}),next$1(2),append($$anchor5,fragment_2)},$$slots:{default:!0}})});var node_3=sibling(node_1,2);component(node_3,()=>Dropdown_menu_sub_content,($$anchor4,DropdownMenu_SubContent)=>{DropdownMenu_SubContent($$anchor4,{class:"w-72 p-0",children:($$anchor5,$$slotProps2)=>{var fragment_3=comment$2(),node_4=first_child(fragment_3);{var consequent_4=$$anchor6=>{
-var fragment_4=comment$2(),node_5=first_child(fragment_4);{var consequent=$$anchor7=>{var div=root_5$t(),node_6=child(div);Loader_circle(node_6,{class:"mx-auto mb-1 h-4 w-4 animate-spin"}),next$1(),reset(div),append($$anchor7,div)},consequent_1=$$anchor7=>{var div_1=root_6$s(),span=child(div_1),node_7=child(span);Info$1(node_7,{class:"mt-0.5 h-4 w-4 shrink-0"}),next$1(2),reset(span);var span_1=sibling(span,2),node_8=child(span_1);Info$1(node_8,{class:"mt-0.5 h-4 w-4 shrink-0"});var span_2=sibling(
-node_8,2),text2=child(span_2);next$1(2),reset(span_2),reset(span_1),reset(div_1),template_effect(()=>set_text(text2,`${get$3(hasMcpServersAvailable)?"Enable":"Add"} MCP Server(s) to access `)),append($$anchor7,div_1)},consequent_2=$$anchor7=>{var div_2=root_7$p();append($$anchor7,div_2)},consequent_3=$$anchor7=>{var div_3=root_8$q(),node_9=child(div_3);Info$1(node_9,{class:"mt-0.5 h-4 w-4 shrink-0"});var span_3=sibling(node_9,2),text_1=child(span_3,!0);reset(span_3),reset(div_3),template_effect(
-()=>set_text(text_1,toolsPanel.noToolsInfoMessage)),append($$anchor7,div_3)},alternate=$$anchor7=>{var div_4=root_9$j();append($$anchor7,div_4)};if_block(node_5,$$render=>{toolsStore.loading?$$render(consequent):toolsStore.isToolsEndpointUnreachable?$$render(consequent_1,1):toolsStore.error?$$render(consequent_2,2):toolsPanel.noToolsInfoMessage?$$render(consequent_3,3):$$render(alternate,-1)})}append($$anchor6,fragment_4)},alternate_2=$$anchor6=>{var div_5=root_10$d();each(div_5,21,()=>toolsPanel.
+activeGroups)},get totalToolCount(){return get$3(totalToolCount)},get noToolsInfoMessage(){return get$3(noToolsInfoMessage)},getGroupCheckedState,getEnabledToolCount,getFavicon,isGroupDisabled,toggleGroupExpanded,handleOpen}}var root_2$Z=from_html("<!> <span>Tools</span>",1),root_5$s=from_html('<div class="px-3 py-4 text-center text-sm text-muted-foreground"><!> Loading tools...</div>'),root_6$r=from_html('<div class="grid gap-2.5 px-3 py-4 text-sm text-muted-foreground"><span class="flex gap-2"\
+><!> <span>Run llama-server with <code>--tools</code> flag to enable <strong>Built-in Tools</strong>.</span></span> <span class="flex gap-2"><!> <span> <strong>MCP Tools</strong>.</span></span></div>'),root_7$p=from_html('<div class="px-3 py-4 text-center text-sm text-muted-foreground">Failed to load tools</div>'),root_8$p=from_html('<div class="flex gap-2 px-3 py-4 text-sm text-muted-foreground"><!> <span> </span></div>'),root_9$j=from_html('<div class="px-3 py-4 text-center text-sm text-muted-\
+foreground">No tools available</div>'),root_16$3=from_html('<img alt="" class="h-4 w-4 shrink-0 rounded-sm"/>'),root_13$a=from_html('<!> <span class="inline-flex min-w-0 items-center gap-1.5 font-medium"><!> <span class="truncate"> </span></span> <span class="ml-auto shrink-0 text-xs text-muted-foreground"> </span>',1),root_19$8=from_html("<p> </p>"),root_17$7=from_html("<!> <!>",1),root_21$3=from_html('<button type="button" class="flex w-full items-center gap-2 rounded px-2 py-1.5 text-left tex\
+t-sm transition-colors hover:bg-muted/50"><!> <span class="min-w-0 flex-1 truncate font-mono text-[12px]"> </span></button>'),root_20$2=from_html('<div class="ml-4 flex flex-col gap-0.5 border-l border-border/50 pl-2"></div>'),root_12$8=from_html('<div class="flex items-center gap-1"><!> <!></div> <!>',1),root_10$c=from_html('<div class="max-h-80 overflow-y-auto p-2 pr-1"></div>'),root_1$G=from_html("<!> <!>",1);function ChatFormActionAddToolsSubmenu($$anchor,$$props){push$1($$props,!0);const toolsPanel=useToolsPanel(),
+hasMcpServersAvailable=user_derived(()=>mcpStore.getServersSorted().length>0);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Sub,($$anchor2,DropdownMenu_Sub)=>{DropdownMenu_Sub($$anchor2,{onOpenChange:open2=>open2&&toolsPanel.handleOpen(),children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$G(),node_1=first_child(fragment_1);component(node_1,()=>Dropdown_menu_sub_trigger,($$anchor4,DropdownMenu_SubTrigger)=>{DropdownMenu_SubTrigger($$anchor4,{class:"flex cursor-poin\
+ter items-center gap-2",children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$Z(),node_2=first_child(fragment_2);Pencil_ruler(node_2,{class:"h-4 w-4"}),next$1(2),append($$anchor5,fragment_2)},$$slots:{default:!0}})});var node_3=sibling(node_1,2);component(node_3,()=>Dropdown_menu_sub_content,($$anchor4,DropdownMenu_SubContent)=>{DropdownMenu_SubContent($$anchor4,{class:"w-72 p-0",children:($$anchor5,$$slotProps2)=>{var fragment_3=comment$2(),node_4=first_child(fragment_3);{var consequent_4=$$anchor6=>{
+var fragment_4=comment$2(),node_5=first_child(fragment_4);{var consequent=$$anchor7=>{var div=root_5$s(),node_6=child(div);Loader_circle(node_6,{class:"mx-auto mb-1 h-4 w-4 animate-spin"}),next$1(),reset(div),append($$anchor7,div)},consequent_1=$$anchor7=>{var div_1=root_6$r(),span=child(div_1),node_7=child(span);Info$1(node_7,{class:"mt-0.5 h-4 w-4 shrink-0"}),next$1(2),reset(span);var span_1=sibling(span,2),node_8=child(span_1);Info$1(node_8,{class:"mt-0.5 h-4 w-4 shrink-0"});var span_2=sibling(
+node_8,2),text2=child(span_2);next$1(2),reset(span_2),reset(span_1),reset(div_1),template_effect(()=>set_text(text2,`${get$3(hasMcpServersAvailable)?"Enable":"Add"} MCP Server(s) to access `)),append($$anchor7,div_1)},consequent_2=$$anchor7=>{var div_2=root_7$p();append($$anchor7,div_2)},consequent_3=$$anchor7=>{var div_3=root_8$p(),node_9=child(div_3);Info$1(node_9,{class:"mt-0.5 h-4 w-4 shrink-0"});var span_3=sibling(node_9,2),text_1=child(span_3,!0);reset(span_3),reset(div_3),template_effect(
+()=>set_text(text_1,toolsPanel.noToolsInfoMessage)),append($$anchor7,div_3)},alternate=$$anchor7=>{var div_4=root_9$j();append($$anchor7,div_4)};if_block(node_5,$$render=>{toolsStore.loading?$$render(consequent):toolsStore.isToolsEndpointUnreachable?$$render(consequent_1,1):toolsStore.error?$$render(consequent_2,2):toolsPanel.noToolsInfoMessage?$$render(consequent_3,3):$$render(alternate,-1)})}append($$anchor6,fragment_4)},alternate_2=$$anchor6=>{var div_5=root_10$c();each(div_5,21,()=>toolsPanel.
activeGroups,group=>group.label,($$anchor7,group)=>{const isExpanded=user_derived(()=>toolsPanel.expandedGroups.has(get$3(group).label)),computed_const=user_derived(()=>{const{checked,indeterminate}=toolsPanel.getGroupCheckedState(get$3(group));return{checked,indeterminate}}),favicon=user_derived(()=>toolsPanel.getFavicon(get$3(group)));var fragment_5=comment$2(),node_10=first_child(fragment_5);component(node_10,()=>Collapsible,($$anchor8,Collapsible_Root)=>{Collapsible_Root($$anchor8,{get open(){
-return get$3(isExpanded)},onOpenChange:()=>toolsPanel.toggleGroupExpanded(get$3(group).label),children:($$anchor9,$$slotProps3)=>{var fragment_6=root_12$8(),div_6=first_child(fragment_6),node_11=child(div_6);component(node_11,()=>Collapsible_trigger,($$anchor10,Collapsible_Trigger)=>{Collapsible_Trigger($$anchor10,{class:"flex min-w-0 flex-1 items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-muted/50",children:($$anchor11,$$slotProps4)=>{var fragment_7=root_13$b(),node_12=first_child(fragment_7);
+return get$3(isExpanded)},onOpenChange:()=>toolsPanel.toggleGroupExpanded(get$3(group).label),children:($$anchor9,$$slotProps3)=>{var fragment_6=root_12$8(),div_6=first_child(fragment_6),node_11=child(div_6);component(node_11,()=>Collapsible_trigger,($$anchor10,Collapsible_Trigger)=>{Collapsible_Trigger($$anchor10,{class:"flex min-w-0 flex-1 items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-muted/50",children:($$anchor11,$$slotProps4)=>{var fragment_7=root_13$a(),node_12=first_child(fragment_7);
{var consequent_5=$$anchor12=>{Chevron_down($$anchor12,{class:"h-3.5 w-3.5 shrink-0"})},alternate_1=$$anchor12=>{Chevron_right($$anchor12,{class:"h-3.5 w-3.5 shrink-0"})};if_block(node_12,$$render=>{get$3(isExpanded)?$$render(consequent_5):$$render(alternate_1,-1)})}var span_4=sibling(node_12,2),node_13=child(span_4);{var consequent_6=$$anchor12=>{var img=root_16$3();template_effect(()=>set_attribute(img,"src",get$3(favicon))),event("error",img,e=>{e.currentTarget.style.display="none"}),replay_events(
img),append($$anchor12,img)};if_block(node_13,$$render=>{get$3(favicon)&&$$render(consequent_6)})}var span_5=sibling(node_13,2),text_2=child(span_5,!0);reset(span_5),reset(span_4);var span_6=sibling(span_4,2),text_3=child(span_6);reset(span_6),template_effect($0=>{set_text(text_2,get$3(group).label),set_text(text_3,`${$0??""}/${get$3(group).tools.length??""}`)},[()=>toolsPanel.getEnabledToolCount(get$3(group))]),append($$anchor11,fragment_7)},$$slots:{default:!0}})});var node_14=sibling(node_11,
-2);component(node_14,()=>Root$5,($$anchor10,Tooltip_Root)=>{Tooltip_Root($$anchor10,{children:($$anchor11,$$slotProps4)=>{var fragment_10=root_17$6(),node_15=first_child(fragment_10);component(node_15,()=>Tooltip_trigger,($$anchor12,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor12,{children:($$anchor13,$$slotProps5)=>{Checkbox($$anchor13,{get checked(){return get$3(computed_const).checked},get indeterminate(){return get$3(computed_const).indeterminate},onCheckedChange:()=>toolsStore.toggleGroup(get$3(
+2);component(node_14,()=>Root$5,($$anchor10,Tooltip_Root)=>{Tooltip_Root($$anchor10,{children:($$anchor11,$$slotProps4)=>{var fragment_10=root_17$7(),node_15=first_child(fragment_10);component(node_15,()=>Tooltip_trigger,($$anchor12,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor12,{children:($$anchor13,$$slotProps5)=>{Checkbox($$anchor13,{get checked(){return get$3(computed_const).checked},get indeterminate(){return get$3(computed_const).indeterminate},onCheckedChange:()=>toolsStore.toggleGroup(get$3(
group)),class:"mr-2 h-4 w-4 shrink-0"})},$$slots:{default:!0}})});var node_16=sibling(node_15,2);component(node_16,()=>Tooltip_content,($$anchor12,Tooltip_Content)=>{Tooltip_Content($$anchor12,{side:"right",children:($$anchor13,$$slotProps5)=>{var p2=root_19$8(),text_4=child(p2);reset(p2),template_effect(()=>set_text(text_4,`${get$3(computed_const).checked?"Disable":"Enable"}
- ${get$3(group).tools.length??""} tool${get$3(group).tools.length!==1?"s":""}`)),append($$anchor13,p2)},$$slots:{default:!0}})}),append($$anchor11,fragment_10)},$$slots:{default:!0}})}),reset(div_6);var node_17=sibling(div_6,2);component(node_17,()=>Collapsible_content,($$anchor10,Collapsible_Content)=>{Collapsible_Content($$anchor10,{children:($$anchor11,$$slotProps4)=>{var div_7=root_20$2();each(div_7,21,()=>get$3(group).tools,tool=>tool.function.name,($$anchor12,tool)=>{var button=root_21$4(),
+ ${get$3(group).tools.length??""} tool${get$3(group).tools.length!==1?"s":""}`)),append($$anchor13,p2)},$$slots:{default:!0}})}),append($$anchor11,fragment_10)},$$slots:{default:!0}})}),reset(div_6);var node_17=sibling(div_6,2);component(node_17,()=>Collapsible_content,($$anchor10,Collapsible_Content)=>{Collapsible_Content($$anchor10,{children:($$anchor11,$$slotProps4)=>{var div_7=root_20$2();each(div_7,21,()=>get$3(group).tools,tool=>tool.function.name,($$anchor12,tool)=>{var button=root_21$3(),
node_18=child(button);{let $0=user_derived(()=>toolsStore.isToolEnabled(get$3(tool).function.name));Checkbox(node_18,{get checked(){return get$3($0)},onCheckedChange:()=>toolsStore.toggleTool(get$3(tool).function.name),class:"h-4 w-4 shrink-0"})}var span_7=sibling(node_18,2),text_5=child(span_7,!0);reset(span_7),reset(button),template_effect(()=>set_text(text_5,get$3(tool).function.name)),delegated("click",button,()=>toolsStore.toggleTool(get$3(tool).function.name)),append($$anchor12,button)}),reset(
div_7),append($$anchor11,div_7)},$$slots:{default:!0}})}),append($$anchor9,fragment_6)},$$slots:{default:!0}})}),append($$anchor7,fragment_5)}),reset(div_5),append($$anchor6,div_5)};if_block(node_4,$$render=>{toolsPanel.totalToolCount===0?$$render(consequent_4):$$render(alternate_2,-1)})}append($$anchor5,fragment_3)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}delegate(["click"]);function Switch($$anchor,$$props){push$1($$props,
!0);let ref2=prop($$props,"ref",15,null),checked=prop($$props,"checked",15,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","checked"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("peer inline-flex h-[1.15rem] w-8 shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allo\
wed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",$$props.class));component(node2,()=>Switch$1,($$anchor2,SwitchPrimitive_Root)=>{SwitchPrimitive_Root($$anchor2,spread_props({"data-slot":"switch",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},get checked(){return checked()},set checked($$value){checked($$value)},children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),
node_1=first_child(fragment_1);{let $02=user_derived(()=>cn$1("pointer-events-none block size-4 rounded-full bg-background ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground"));component(node_1,()=>Switch_thumb,($$anchor4,SwitchPrimitive_Thumb)=>{SwitchPrimitive_Thumb($$anchor4,{"data-slot":"switch-thumb",get class(){return get$3($02)}})})}append(
-$$anchor3,fragment_1)},$$slots:{default:!0}}))})}append($$anchor,fragment),pop()}var root_3$L=from_html("<!> <span>MCP Servers</span>",1),root_7$o=from_html("<!> <span>Manage MCP Servers</span>",1),root_10$c=from_html('<img alt="" class="h-4 w-4 shrink-0 rounded-sm"/>'),root_11$c=from_html('<span class="shrink-0 rounded bg-destructive/15 px-1.5 py-0.5 text-xs text-destructive">Error</span>'),root_9$i=from_html('<button type="button" class="flex w-full items-center justify-between gap-2 rounded-s\
-m px-2 py-2 text-left transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50"><div class="flex min-w-0 flex-1 items-center gap-2"><!> <span class="truncate text-sm"> </span> <!></div> <!></button>'),root_8$p=from_html('<div class="max-h-64 overflow-y-auto"></div>'),root_13$a=from_html("<!> <span>Add MCP Servers</span>",1),root_12$7=from_html('<div class="px-2 py-3 text-center text-sm text-muted-foreground">No MCP servers configured</div> <!> <!>',1),root_2$Z=from_html(
-"<!> <!>",1);function ChatFormActionAddMcpServersSubmenu($$anchor,$$props){push$1($$props,!0);let mcpSearchQuery=state$1(""),allMcpServers=user_derived(()=>mcpStore.getServersSorted()),mcpServers=user_derived(()=>get$3(allMcpServers).filter(s2=>s2.enabled)),hasMcpServers=user_derived(()=>get$3(mcpServers).length>0),filteredMcpServers=user_derived(()=>{const query=get$3(mcpSearchQuery).toLowerCase().trim();return query?get$3(mcpServers).filter(s2=>{const name=getServerLabel(s2).toLowerCase(),url2=s2.
-url.toLowerCase();return name.includes(query)||url2.includes(query)}):get$3(mcpServers)});function getServerLabel(server){return mcpStore.getServerLabel(server)}function isServerEnabledForChat(serverId){return conversationsStore.isMcpServerEnabledForChat(serverId)}async function toggleServerForChat(serverId){await conversationsStore.toggleMcpServerForChat(serverId)}function handleMcpSubMenuOpen(open2){open2&&(set$1(mcpSearchQuery,""),mcpStore.runHealthChecksForServers(get$3(allMcpServers)))}function handleMcpSettingsClick(){
-$$props.onMcpSettingsClick?.(),goto(`${get$3(hasMcpServers)?"":"?add"}#/settings/mcp`)}var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$4,($$anchor2,DropdownMenu_Root)=>{DropdownMenu_Root($$anchor2,{children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Sub,($$anchor4,DropdownMenu_Sub)=>{DropdownMenu_Sub($$anchor4,{onOpenChange:handleMcpSubMenuOpen,children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$Z(),
-node_2=first_child(fragment_2);component(node_2,()=>Dropdown_menu_sub_trigger,($$anchor6,DropdownMenu_SubTrigger)=>{DropdownMenu_SubTrigger($$anchor6,{class:"flex cursor-pointer items-center gap-2",children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$L(),node_3=first_child(fragment_3);McpLogo(node_3,{class:"h-4 w-4"}),next$1(2),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var node_4=sibling(node_2,2);component(node_4,()=>Dropdown_menu_sub_content,($$anchor6,DropdownMenu_SubContent)=>{
-DropdownMenu_SubContent($$anchor6,{class:"w-72 pt-0",children:($$anchor7,$$slotProps3)=>{var fragment_4=comment$2(),node_5=first_child(fragment_4);{var consequent_2=$$anchor8=>{{const footer2=$$anchor9=>{var fragment_6=comment$2(),node_6=first_child(fragment_6);component(node_6,()=>Dropdown_menu_item,($$anchor10,DropdownMenu_Item)=>{DropdownMenu_Item($$anchor10,{class:"flex cursor-pointer items-center gap-2",onclick:handleMcpSettingsClick,children:($$anchor11,$$slotProps4)=>{var fragment_7=root_7$o(),
-node_7=first_child(fragment_7);Settings$1(node_7,{class:"h-4 w-4"}),next$1(2),append($$anchor11,fragment_7)},$$slots:{default:!0}})}),append($$anchor9,fragment_6)};let $0=user_derived(()=>get$3(filteredMcpServers).length===0);DropdownMenuSearchable($$anchor8,{placeholder:"Search servers...",emptyMessage:"No servers found",get isEmpty(){return get$3($0)},get searchValue(){return get$3(mcpSearchQuery)},set searchValue($$value){set$1(mcpSearchQuery,$$value,!0)},footer:footer2,children:($$anchor9,$$slotProps4)=>{
-var div=root_8$p();each(div,21,()=>get$3(filteredMcpServers),server=>server.id,($$anchor10,server)=>{const healthState=user_derived(()=>mcpStore.getHealthCheckState(get$3(server).id)),hasError=user_derived(()=>get$3(healthState).status===HealthCheckStatus.ERROR),isEnabledForChat=user_derived(()=>isServerEnabledForChat(get$3(server).id));var button=root_9$i(),div_1=child(button),node_8=child(div_1);{var consequent=$$anchor11=>{var img=root_10$c();template_effect($02=>set_attribute(img,"src",$02),
-[()=>mcpStore.getServerFavicon(get$3(server).id)]),event("error",img,e=>{e.currentTarget.style.display="none"}),replay_events(img),append($$anchor11,img)},d2=user_derived(()=>mcpStore.getServerFavicon(get$3(server).id));if_block(node_8,$$render=>{get$3(d2)&&$$render(consequent)})}var span=sibling(node_8,2),text2=child(span,!0);reset(span);var node_9=sibling(span,2);{var consequent_1=$$anchor11=>{var span_1=root_11$c();append($$anchor11,span_1)};if_block(node_9,$$render=>{get$3(hasError)&&$$render(
-consequent_1)})}reset(div_1);var node_10=sibling(div_1,2);Switch(node_10,{get checked(){return get$3(isEnabledForChat)},get disabled(){return get$3(hasError)},onclick:e=>e.stopPropagation(),onCheckedChange:()=>toggleServerForChat(get$3(server).id)}),reset(button),template_effect($02=>{button.disabled=get$3(hasError),set_text(text2,$02)},[()=>getServerLabel(get$3(server))]),delegated("click",button,()=>!get$3(hasError)&&toggleServerForChat(get$3(server).id)),append($$anchor10,button)}),reset(div),
-append($$anchor9,div)},$$slots:{footer:!0,default:!0}})}},alternate=$$anchor8=>{var fragment_8=root_12$7(),node_11=sibling(first_child(fragment_8),2);component(node_11,()=>Dropdown_menu_separator,($$anchor9,DropdownMenu_Separator)=>{DropdownMenu_Separator($$anchor9,{})});var node_12=sibling(node_11,2);component(node_12,()=>Dropdown_menu_item,($$anchor9,DropdownMenu_Item_1)=>{DropdownMenu_Item_1($$anchor9,{class:"flex cursor-pointer items-center gap-2",onclick:handleMcpSettingsClick,children:($$anchor10,$$slotProps4)=>{
-var fragment_9=root_13$a(),node_13=first_child(fragment_9);Plus(node_13,{class:"h-4 w-4"}),next$1(2),append($$anchor10,fragment_9)},$$slots:{default:!0}})}),append($$anchor8,fragment_8)};if_block(node_5,$$render=>{get$3(hasMcpServers)?$$render(consequent_2):$$render(alternate,-1)})}append($$anchor7,fragment_4)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}delegate(["click"]);
-var root$1l=from_html('<input type="file"/>');function ChatFormFileInputInvisible($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),multiple=prop($$props,"multiple",3,!0),fileInputElement;function click(){fileInputElement?.click()}function handleFileSelect(event2){const input=event2.target;input.files&&$$props.onFileSelect?.(Array.from(input.files))}var $$exports={click},input_1=root$1l();return bind_this(input_1,$$value=>fileInputElement=$$value,()=>fileInputElement),
-template_effect(()=>{input_1.multiple=multiple(),set_class(input_1,1,`hidden ${className()??""}`)}),delegated("change",input_1,handleFileSelect),append($$anchor,input_1),pop($$exports)}delegate(["change"]);var root_1$E=from_html("<div><!></div>");function ChatFormMcpResourcesList($$anchor,$$props){push$1($$props,!0);const attachments=user_derived(mcpResourceAttachments),hasAttachments=user_derived(mcpHasResourceAttachments);function handleRemove(attachmentId){mcpStore.removeResourceAttachment(attachmentId)}
-function handleResourceClick(uri2){$$props.onResourceClick?.(uri2)}var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var div=root_1$E(),node_1=child(div);HorizontalScrollCarousel(node_1,{gapSize:"2",children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_2=first_child(fragment_1);each(node_2,19,()=>get$3(attachments),attachment=>attachment.id,($$anchor4,attachment,i)=>{{let $0=user_derived(()=>get$3(i)===0?"ml-3":"");ChatAttachmentsListItemMcpResource($$anchor4,
-{get class(){return get$3($0)},get attachment(){return get$3(attachment)},onRemove:handleRemove,onclick:()=>handleResourceClick(get$3(attachment).resource.uri)})}}),append($$anchor3,fragment_1)},$$slots:{default:!0}}),reset(div),template_effect(()=>set_class(div,1,clsx($$props.class))),append($$anchor2,div)};if_block(node2,$$render=>{get$3(hasAttachments)&&$$render(consequent)})}append($$anchor,fragment),pop()}var root$1k=from_html('<div><textarea style="max-height: var(--max-message-height);"><\
-/textarea></div>');function ChatFormTextarea($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),disabled=prop($$props,"disabled",3,!1),placeholder=prop($$props,"placeholder",3,"Ask anything..."),value=prop($$props,"value",15,""),textareaElement;onMount$1(()=>{textareaElement&&(autoResizeTextarea(textareaElement),textareaElement.focus())});function getElement(){return textareaElement}function focus2(){textareaElement?.focus()}function resetHeight(){textareaElement&&(textareaElement.
-style.height="1rem")}var $$exports={getElement,focus:focus2,resetHeight},div=root$1k(),textarea=child(div);return remove_textarea_child(textarea),bind_this(textarea,$$value=>textareaElement=$$value,()=>textareaElement),reset(div),template_effect(()=>{set_class(div,1,`flex-1 ${className()??""}`),set_class(textarea,1,clsx(["text-md min-h-12 w-full resize-none border-0 bg-transparent p-0 leading-6 outline-none placeholder:text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",disabled()&&
-"cursor-not-allowed"])),textarea.disabled=disabled(),set_attribute(textarea,"placeholder",placeholder())}),delegated("keydown",textarea,function(...$$args){$$props.onKeydown?.apply(this,$$args)}),delegated("input",textarea,event2=>{autoResizeTextarea(event2.currentTarget),$$props.onInput?.()}),event("paste",textarea,function(...$$args){$$props.onPaste?.apply(this,$$args)}),bind_value(textarea,value),append($$anchor,div),pop($$exports)}delegate(["keydown","input"]);const badgeVariants=tv({base:"f\
-ocus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transp\
-arent",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",tertiary:"bg-foreground/15 dark:bg-foreground/10 text-foreground [a&]:hover:bg-foreground/25 border-transparent",destructive:"bg-destructive [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/70 border-transparent text-white",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{
-variant:"default"}});function Badge($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),variant=prop($$props,"variant",3,"default"),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","href","class","variant","children"]);var fragment=comment$2(),node2=first_child(fragment);element$4(node2,()=>$$props.href?"a":"span",!1,($$element,$$anchor2)=>{bind_this($$element,$$value=>ref2($$value),()=>ref2()),attribute_effect($$element,$0=>({"data-slot":"badge",href:$$props.
-href,class:$0,...restProps}),[()=>cn$1(badgeVariants({variant:variant()}),$$props.class,"backdrop-blur-sm")]);var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.children??noop$3),append($$anchor2,fragment_1)}),append($$anchor,fragment),pop()}var root_2$Y=from_html('<div class="p-4"><!> <!></div>');function ChatFormPickerMcpPrompts($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),isOpen=prop($$props,"isOpen",7,!1),searchQuery=prop($$props,
-"searchQuery",3,""),prompts=state$1(proxy([])),isLoading2=state$1(!1),selectedPrompt=state$1(null),promptArgs=state$1(proxy({})),selectedIndex=state$1(0),internalSearchQuery=state$1(""),promptError=state$1(null),selectedIndexBeforeArgumentForm=state$1(null),suggestions=proxy({}),loadingSuggestions=proxy({}),activeAutocomplete=state$1(null),autocompleteIndex=state$1(0),serverSettingsMap=user_derived(()=>{const servers=mcpStore.getServers(),map2=new SvelteMap;for(const server of servers)map2.set(server.
-id,server);return map2});user_effect(()=>{isOpen()?(loadPrompts(),set$1(selectedIndex,0)):(set$1(selectedPrompt,null),set$1(promptArgs,{},!0),set$1(promptError,null))}),user_effect(()=>{get$3(filteredPrompts).length>0&&get$3(selectedIndex)>=get$3(filteredPrompts).length&&set$1(selectedIndex,0)});async function loadPrompts(){set$1(isLoading2,!0);try{const perChatOverrides=conversationsStore.getAllMcpServerOverrides();if(!await mcpStore.ensureInitialized(perChatOverrides)){set$1(prompts,[],!0);return}
-set$1(prompts,await mcpStore.getAllPrompts(),!0)}catch(error2){console.error("[ChatFormPickerMcpPrompts] Failed to load prompts:",error2),set$1(prompts,[],!0)}finally{set$1(isLoading2,!1)}}function handlePromptClick(prompt){const args=prompt.arguments??[];args.length>0?(set$1(selectedIndexBeforeArgumentForm,get$3(selectedIndex),!0),set$1(selectedPrompt,prompt,!0),set$1(promptArgs,{},!0),set$1(promptError,null),requestAnimationFrame(()=>{const firstInput=document.querySelector(`#arg-${args[0].name}`);
-firstInput&&firstInput.focus()})):executePrompt(prompt,{})}async function executePrompt(prompt,args){set$1(promptError,null);const placeholderId=uuid$1(),nonEmptyArgs=Object.fromEntries(Object.entries(args).filter(([,value])=>value.trim()!=="")),argsToPass=Object.keys(nonEmptyArgs).length>0?nonEmptyArgs:void 0;$$props.onPromptLoadStart?.(placeholderId,prompt,argsToPass),$$props.onClose?.();try{const result=await mcpStore.getPrompt(prompt.serverName,prompt.name,args);$$props.onPromptLoadComplete?.(
-placeholderId,result)}catch(error2){const errorMessage=error2 instanceof Error?error2.message:"Unknown error executing prompt";$$props.onPromptLoadError?.(placeholderId,errorMessage)}}function handleArgumentSubmit(event2){event2.preventDefault(),get$3(selectedPrompt)&&executePrompt(get$3(selectedPrompt),get$3(promptArgs))}const fetchCompletions=debounce(async(argName,value)=>{if(!get$3(selectedPrompt)||value.length<1){suggestions[argName]=[];return}loadingSuggestions[argName]=!0;try{const result=await mcpStore.
-getPromptCompletions(get$3(selectedPrompt).serverName,get$3(selectedPrompt).name,argName,value);if(result&&result.values.length>0){const filteredValues=result.values.filter(v=>v.trim()!=="");filteredValues.length>0?(suggestions[argName]=filteredValues,set$1(activeAutocomplete,argName,!0),set$1(autocompleteIndex,0)):suggestions[argName]=[]}else suggestions[argName]=[]}catch(error2){console.error("[ChatFormPickerMcpPrompts] Failed to fetch completions:",error2),suggestions[argName]=[]}finally{loadingSuggestions[argName]=
-!1}},200);function handleArgInput(argName,value){get$3(promptArgs)[argName]=value,fetchCompletions(argName,value)}function selectSuggestion(argName,value){get$3(promptArgs)[argName]=value,suggestions[argName]=[],set$1(activeAutocomplete,null)}function handleArgKeydown(event2,argName){const argSuggestions=suggestions[argName]??[];if(event2.key===KeyboardKey.ESCAPE){event2.preventDefault(),event2.stopPropagation(),handleCancelArgumentForm();return}argSuggestions.length===0||get$3(activeAutocomplete)!==
-argName||(event2.key===KeyboardKey.ARROW_DOWN?(event2.preventDefault(),set$1(autocompleteIndex,Math.min(get$3(autocompleteIndex)+1,argSuggestions.length-1),!0)):event2.key===KeyboardKey.ARROW_UP?(event2.preventDefault(),set$1(autocompleteIndex,Math.max(get$3(autocompleteIndex)-1,0),!0)):event2.key===KeyboardKey.ENTER&&argSuggestions[get$3(autocompleteIndex)]&&(event2.preventDefault(),event2.stopPropagation(),selectSuggestion(argName,argSuggestions[get$3(autocompleteIndex)])))}function handleArgBlur(argName){
-setTimeout(()=>{get$3(activeAutocomplete)===argName&&(suggestions[argName]=[],set$1(activeAutocomplete,null))},150)}function handleArgFocus(argName){(suggestions[argName]?.length??0)>0&&set$1(activeAutocomplete,argName,!0)}function handleCancelArgumentForm(){get$3(selectedIndexBeforeArgumentForm)!==null&&(set$1(selectedIndex,get$3(selectedIndexBeforeArgumentForm),!0),set$1(selectedIndexBeforeArgumentForm,null)),set$1(selectedPrompt,null),set$1(promptArgs,{},!0),set$1(promptError,null)}function handleKeydown(event2){
-return isOpen()?event2.key===KeyboardKey.ESCAPE?(event2.preventDefault(),get$3(selectedPrompt)?handleCancelArgumentForm():$$props.onClose?.(),!0):event2.key===KeyboardKey.ARROW_DOWN?(event2.preventDefault(),get$3(filteredPrompts).length>0&&set$1(selectedIndex,(get$3(selectedIndex)+1)%get$3(filteredPrompts).length),!0):event2.key===KeyboardKey.ARROW_UP?(event2.preventDefault(),get$3(filteredPrompts).length>0&&set$1(selectedIndex,get$3(selectedIndex)===0?get$3(filteredPrompts).length-1:get$3(selectedIndex)-
-1,!0),!0):event2.key===KeyboardKey.ENTER&&!get$3(selectedPrompt)?(event2.preventDefault(),get$3(filteredPrompts)[get$3(selectedIndex)]&&handlePromptClick(get$3(filteredPrompts)[get$3(selectedIndex)]),!0):!1:!1}let filteredPrompts=user_derived(()=>{const sortedServers=mcpStore.getServersSorted(),serverOrderMap=new Map(sortedServers.map((server,index2)=>[server.id,index2])),sortedPrompts=[...get$3(prompts)].sort((a,b)=>{const orderA=serverOrderMap.get(a.serverName)??Number.MAX_SAFE_INTEGER,orderB=serverOrderMap.
-get(b.serverName)??Number.MAX_SAFE_INTEGER;return orderA-orderB}),query=(searchQuery()||get$3(internalSearchQuery)).toLowerCase();return query?sortedPrompts.filter(prompt=>prompt.name.toLowerCase().includes(query)||prompt.title?.toLowerCase().includes(query)||prompt.description?.toLowerCase().includes(query)):sortedPrompts}),showSearchInput=user_derived(()=>get$3(prompts).length>3);var $$exports={handleKeydown};return ChatFormPickerPopover($$anchor,{get class(){return className()},srLabel:"Open \
-prompt picker",get onClose(){return $$props.onClose},onKeydown:handleKeydown,get isOpen(){return isOpen()},set isOpen($$value){isOpen($$value)},children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);{var consequent_1=$$anchor3=>{const prompt=user_derived(()=>get$3(selectedPrompt)),server=user_derived(()=>get$3(serverSettingsMap).get(get$3(prompt).serverName)),serverLabel=user_derived(()=>get$3(server)?mcpStore.getServerLabel(get$3(server)):get$3(prompt).serverName);
-var div=root_2$Y(),node_1=child(div);{const titleExtra=$$anchor4=>{var fragment_2=comment$2(),node_2=first_child(fragment_2);{var consequent=$$anchor5=>{Badge($$anchor5,{variant:"secondary",children:($$anchor6,$$slotProps2)=>{next$1();var text2=text$8();template_effect(()=>set_text(text2,`${get$3(prompt).arguments.length??""} arg${get$3(prompt).arguments.length>1?"s":""}`)),append($$anchor6,text2)},$$slots:{default:!0}})};if_block(node_2,$$render=>{get$3(prompt).arguments?.length&&$$render(consequent)})}
-append($$anchor4,fragment_2)};let $0=user_derived(()=>get$3(prompt).title||get$3(prompt).name);ChatFormPickerItemHeader(node_1,{get server(){return get$3(server)},get serverLabel(){return get$3(serverLabel)},get title(){return get$3($0)},get description(){return get$3(prompt).description},titleExtra,$$slots:{titleExtra:!0}})}var node_3=sibling(node_1,2);ChatFormPromptPickerArgumentForm(node_3,{get prompt(){return get$3(selectedPrompt)},get promptArgs(){return get$3(promptArgs)},get suggestions(){
-return suggestions},get loadingSuggestions(){return loadingSuggestions},get activeAutocomplete(){return get$3(activeAutocomplete)},get autocompleteIndex(){return get$3(autocompleteIndex)},get promptError(){return get$3(promptError)},onArgInput:handleArgInput,onArgKeydown:handleArgKeydown,onArgBlur:handleArgBlur,onArgFocus:handleArgFocus,onSelectSuggestion:selectSuggestion,onSubmit:handleArgumentSubmit,onCancel:handleCancelArgumentForm}),reset(div),append($$anchor3,div)},alternate=$$anchor3=>{ChatFormPickerList(
-$$anchor3,{get items(){return get$3(filteredPrompts)},get isLoading(){return get$3(isLoading2)},get selectedIndex(){return get$3(selectedIndex)},get showSearchInput(){return get$3(showSearchInput)},searchPlaceholder:"Search prompts...",emptyMessage:"No MCP prompts available",itemKey:prompt=>prompt.serverName+":"+prompt.name,get searchQuery(){return get$3(internalSearchQuery)},set searchQuery($$value){set$1(internalSearchQuery,$$value,!0)},item:($$anchor4,prompt=noop$3,index2=noop$3,isSelected=noop$3)=>{
-const server=user_derived(()=>get$3(serverSettingsMap).get(prompt().serverName)),serverLabel=user_derived(()=>get$3(server)?mcpStore.getServerLabel(get$3(server)):prompt().serverName);ChatFormPickerListItem($$anchor4,{get dataIndex(){return index2()},get isSelected(){return isSelected()},onclick:()=>handlePromptClick(prompt()),children:($$anchor5,$$slotProps2)=>{{const titleExtra=$$anchor6=>{var fragment_8=comment$2(),node_4=first_child(fragment_8);{var consequent_2=$$anchor7=>{Badge($$anchor7,{
-variant:"secondary",children:($$anchor8,$$slotProps3)=>{next$1();var text_1=text$8();template_effect(()=>set_text(text_1,`${prompt().arguments.length??""} arg${prompt().arguments.length>1?"s":""}`)),append($$anchor8,text_1)},$$slots:{default:!0}})};if_block(node_4,$$render=>{prompt().arguments?.length&&$$render(consequent_2)})}append($$anchor6,fragment_8)};let $0=user_derived(()=>prompt().title||prompt().name);ChatFormPickerItemHeader($$anchor5,{get server(){return get$3(server)},get serverLabel(){
-return get$3(serverLabel)},get title(){return get$3($0)},get description(){return prompt().description},titleExtra,$$slots:{titleExtra:!0}})}},$$slots:{default:!0}})},skeleton:$$anchor4=>{ChatFormPickerListItemSkeleton($$anchor4,{titleWidth:"w-32",showBadge:!0})},$$slots:{item:!0,skeleton:!0}})};if_block(node2,$$render=>{get$3(selectedPrompt)?$$render(consequent_1):$$render(alternate,-1)})}append($$anchor2,fragment_1)},$$slots:{default:!0}}),pop($$exports)}function Label($$anchor,$$props){push$1(
-$$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",$$props.class));component(node2,()=>Label$1,($$anchor2,LabelPrimitive_Root)=>{
-LabelPrimitive_Root($$anchor2,spread_props({"data-slot":"label",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}var root_2$X=from_html('<span class="text-destructive">*</span>'),root_3$K=from_html('<span class="text-xs text-muted-foreground/50">...</span>'),root_1$D=from_html("<span> <!></span> <!>",1),root_5$s=from_html('<button type="button"> </button>'),root_4$v=from_html('<div class="absolute top-full\
- right-0 left-0 z-10 mt-1 max-h-32 overflow-y-auto rounded-lg border border-border/50 bg-background shadow-lg"></div>'),root$1j=from_html('<div class="relative grid gap-1"><!> <!> <!></div>');function ChatFormPromptPickerArgumentInput($$anchor,$$props){push$1($$props,!0);let value=prop($$props,"value",3,""),suggestions=prop($$props,"suggestions",19,()=>[]),isLoadingSuggestions=prop($$props,"isLoadingSuggestions",3,!1),isAutocompleteActive=prop($$props,"isAutocompleteActive",3,!1),autocompleteIndex=prop(
-$$props,"autocompleteIndex",3,0);var div=root$1j(),node2=child(div);Label(node2,{get for(){return`arg-${$$props.argument.name??""}`},class:"mb-1 text-muted-foreground",children:($$anchor2,$$slotProps)=>{var fragment=root_1$D(),span=first_child(fragment),text2=child(span),node_1=sibling(text2);{var consequent=$$anchor3=>{var span_1=root_2$X();append($$anchor3,span_1)};if_block(node_1,$$render=>{$$props.argument.required&&$$render(consequent)})}reset(span);var node_2=sibling(span,2);{var consequent_1=$$anchor3=>{
-var span_2=root_3$K();append($$anchor3,span_2)};if_block(node_2,$$render=>{isLoadingSuggestions()&&$$render(consequent_1)})}template_effect(()=>set_text(text2,`${$$props.argument.name??""} `)),append($$anchor2,fragment)},$$slots:{default:!0}});var node_3=sibling(node2,2);{let $0=user_derived(()=>$$props.argument.description||$$props.argument.name);Input(node_3,{get id(){return`arg-${$$props.argument.name??""}`},type:"text",get value(){return value()},oninput:e=>$$props.onInput(e.currentTarget.value),
-get onkeydown(){return $$props.onKeydown},get onblur(){return $$props.onBlur},get onfocus(){return $$props.onFocus},get placeholder(){return get$3($0)},get required(){return $$props.argument.required},autocomplete:"off"})}var node_4=sibling(node_3,2);{var consequent_2=$$anchor2=>{var div_1=root_4$v();each(div_1,22,suggestions,suggestion=>suggestion,($$anchor3,suggestion,i)=>{var button=root_5$s(),text_1=child(button,!0);reset(button),template_effect(()=>{set_class(button,1,`w-full px-3 py-1.5 te\
-xt-left text-sm hover:bg-accent ${get$3(i)===autocompleteIndex()?"bg-accent":""}`),set_text(text_1,suggestion)}),delegated("mousedown",button,()=>$$props.onSelectSuggestion(suggestion)),append($$anchor3,button)}),reset(div_1),transition(3,div_1,()=>fly,()=>({y:-5,duration:100})),append($$anchor2,div_1)};if_block(node_4,$$render=>{isAutocompleteActive()&&suggestions().length>0&&$$render(consequent_2)})}reset(div),append($$anchor,div),pop()}delegate(["mousedown"]);var root_2$W=from_html('<div clas\
-s="flex items-start gap-2 rounded-lg border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive" role="alert"><span class="shrink-0">⚠</span> <span> </span></div>'),root$1i=from_html('<form class="space-y-3 pt-4"><!> <!> <div class="mt-8 flex justify-end gap-2"><!> <!></div></form>');function ChatFormPromptPickerArgumentForm($$anchor,$$props){push$1($$props,!0);var form=root$1i(),node2=child(form);each(node2,17,()=>$$props.prompt.arguments??[],arg=>arg.name,($$anchor2,arg)=>{
-{let $0=user_derived(()=>$$props.promptArgs[get$3(arg).name]??""),$1=user_derived(()=>$$props.suggestions[get$3(arg).name]??[]),$2=user_derived(()=>$$props.loadingSuggestions[get$3(arg).name]??!1),$3=user_derived(()=>$$props.activeAutocomplete===get$3(arg).name),$4=user_derived(()=>$$props.activeAutocomplete===get$3(arg).name?$$props.autocompleteIndex:0);ChatFormPromptPickerArgumentInput($$anchor2,{get argument(){return get$3(arg)},get value(){return get$3($0)},get suggestions(){return get$3($1)},
-get isLoadingSuggestions(){return get$3($2)},get isAutocompleteActive(){return get$3($3)},get autocompleteIndex(){return get$3($4)},onInput:value=>$$props.onArgInput(get$3(arg).name,value),onKeydown:e=>$$props.onArgKeydown(e,get$3(arg).name),onBlur:()=>$$props.onArgBlur(get$3(arg).name),onFocus:()=>$$props.onArgFocus(get$3(arg).name),onSelectSuggestion:value=>$$props.onSelectSuggestion(get$3(arg).name,value)})}});var node_1=sibling(node2,2);{var consequent=$$anchor2=>{var div=root_2$W(),span=sibling(
-child(div),2),text2=child(span,!0);reset(span),reset(div),template_effect(()=>set_text(text2,$$props.promptError)),append($$anchor2,div)};if_block(node_1,$$render=>{$$props.promptError&&$$render(consequent)})}var div_1=sibling(node_1,2),node_2=child(div_1);Button(node_2,{type:"button",size:"sm",get onclick(){return $$props.onCancel},variant:"secondary",children:($$anchor2,$$slotProps)=>{next$1();var text_1=text$8("Cancel");append($$anchor2,text_1)},$$slots:{default:!0}});var node_3=sibling(node_2,
-2);Button(node_3,{size:"sm",type:"submit",children:($$anchor2,$$slotProps)=>{next$1();var text_2=text$8("Use Prompt");append($$anchor2,text_2)},$$slots:{default:!0}}),reset(div_1),reset(form),event("submit",form,function(...$$args){$$props.onSubmit?.apply(this,$$args)}),append($$anchor,form),pop()}function Popover($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","open"]);var fragment=comment$2(),node2=first_child(
-fragment);component(node2,()=>Popover$1,($$anchor2,PopoverPrimitive_Root)=>{PopoverPrimitive_Root($$anchor2,spread_props(()=>restProps,{get open(){return open2()},set open($$value){open2($$value)}}))}),append($$anchor,fragment),pop()}function Popover_portal($$anchor,$$props){let restProps=rest_props($$props,["$$slots","$$events","$$legacy"]);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Portal$2,($$anchor2,PopoverPrimitive_Portal)=>{PopoverPrimitive_Portal($$anchor2,spread_props(
-()=>restProps))}),append($$anchor,fragment)}function Popover_content($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),sideOffset=prop($$props,"sideOffset",3,4),align=prop($$props,"align",3,"center"),collisionPadding=prop($$props,"collisionPadding",3,8),avoidCollisions=prop($$props,"avoidCollisions",3,!0),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","sideOffset","side","align","collisionPadding","avoidCollisions","portalProps"]);Popover_portal(
-$$anchor,spread_props(()=>$$props.portalProps,{children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);{let $0=user_derived(()=>cn$1("z-50 w-72 origin-(--bits-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out da\
-ta-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",$$props.class));component(node2,()=>Popover_content$1,($$anchor3,PopoverPrimitive_Content)=>{PopoverPrimitive_Content($$anchor3,spread_props({"data-slot":"popover-content",get sideOffset(){return sideOffset()},get side(){return $$props.side},get align(){return align()},get collisionPadding(){return collisionPadding()},get avoidCollisions(){return avoidCollisions()},
-get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Popover_trigger($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("",$$props.class));component(node2,()=>Popover_trigger$1,($$anchor2,PopoverPrimitive_Trigger)=>{
-PopoverPrimitive_Trigger($$anchor2,spread_props({"data-slot":"popover-trigger",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}var root_2$V=from_html('<span class="sr-only"> </span>'),root_1$C=from_html("<!> <!>",1);function ChatFormPickerPopover($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),isOpen=prop($$props,"isOpen",15,!1),srLabel=prop($$props,"srLabel",3,"Open picker");
-var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Popover,($$anchor2,Popover_Root)=>{Popover_Root($$anchor2,{onOpenChange:open2=>{open2||$$props.onClose?.()},get open(){return isOpen()},set open($$value){isOpen($$value)},children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$C(),node_1=first_child(fragment_1);component(node_1,()=>Popover_trigger,($$anchor4,Popover_Trigger)=>{Popover_Trigger($$anchor4,{class:"pointer-events-none absolute inset-0 opacity-0",tabindex:-1,"ar\
-ia-hidden":"true",children:($$anchor5,$$slotProps2)=>{var span=root_2$V(),text2=child(span,!0);reset(span),template_effect(()=>set_text(text2,srLabel())),append($$anchor5,span)},$$slots:{default:!0}})});var node_2=sibling(node_1,2);component(node_2,()=>Popover_content,($$anchor4,Popover_Content)=>{Popover_Content($$anchor4,{side:"top",align:"start",sideOffset:12,get class(){return`w-[var(--bits-popover-anchor-width)] max-w-none rounded-xl border-border/50 p-0 shadow-xl ${className()??""}`},get onkeydown(){
-return $$props.onKeydown},onOpenAutoFocus:event2=>event2.preventDefault(),children:($$anchor5,$$slotProps2)=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);snippet(node_3,()=>$$props.children),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_2$U=from_html('<div class="absolute top-0 right-0 left-0 z-10 p-2 pb-0"><!></div>'),root_5$r=from_html('<div class="py-6 text-center text-sm tex\
-t-muted-foreground"> </div>'),root_1$B=from_html("<!> <div><!></div> <!>",1);function ChatFormPickerList($$anchor,$$props){push$1($$props,!0);let searchQuery=prop($$props,"searchQuery",15),searchPlaceholder=prop($$props,"searchPlaceholder",3,"Search..."),emptyMessage=prop($$props,"emptyMessage",3,"No items available"),listContainer=state$1(null);user_effect(()=>{if(get$3(listContainer)&&$$props.selectedIndex>=0&&$$props.selectedIndex<$$props.items.length){const selectedElement=get$3(listContainer).
-querySelector(`[data-picker-index="${$$props.selectedIndex}"]`);selectedElement&&selectedElement.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}}),Scroll_area($$anchor,{children:($$anchor2,$$slotProps)=>{var fragment_1=root_1$B(),node2=first_child(fragment_1);{var consequent=$$anchor3=>{var div=root_2$U(),node_1=child(div);SearchInput(node_1,{get placeholder(){return searchPlaceholder()},get value(){return searchQuery()},set value($$value){searchQuery($$value)}}),reset(div),
-append($$anchor3,div)};if_block(node2,$$render=>{$$props.showSearchInput&&$$render(consequent)})}var div_1=sibling(node2,2),node_2=child(div_1);{var consequent_2=$$anchor3=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);{var consequent_1=$$anchor4=>{var fragment_3=comment$2(),node_4=first_child(fragment_3);snippet(node_4,()=>$$props.skeleton),append($$anchor4,fragment_3)};if_block(node_3,$$render=>{$$props.skeleton&&$$render(consequent_1)})}append($$anchor3,fragment_2)},consequent_3=$$anchor3=>{
-var div_2=root_5$r(),text2=child(div_2,!0);reset(div_2),template_effect(()=>set_text(text2,emptyMessage())),append($$anchor3,div_2)},alternate=$$anchor3=>{var fragment_4=comment$2(),node_5=first_child(fragment_4);each(node_5,19,()=>$$props.items,(itemData,index2)=>$$props.itemKey(itemData,index2),($$anchor4,itemData,index2)=>{var fragment_5=comment$2(),node_6=first_child(fragment_5);snippet(node_6,()=>$$props.item,()=>get$3(itemData),()=>get$3(index2),()=>get$3(index2)===$$props.selectedIndex),append(
-$$anchor4,fragment_5)}),append($$anchor3,fragment_4)};if_block(node_2,$$render=>{$$props.isLoading?$$render(consequent_2):$$props.items.length===0?$$render(consequent_3,1):$$render(alternate,-1)})}reset(div_1),bind_this(div_1,$$value=>set$1(listContainer,$$value),()=>get$3(listContainer));var node_7=sibling(div_1,2);{var consequent_4=$$anchor3=>{var fragment_6=comment$2(),node_8=first_child(fragment_6);snippet(node_8,()=>$$props.footer),append($$anchor3,fragment_6)};if_block(node_7,$$render=>{$$props.
-footer&&$$render(consequent_4)})}template_effect(()=>set_class(div_1,1,clsx([`${CHAT_FORM_POPOVER_MAX_HEIGHT} p-2`,$$props.showSearchInput&&"pt-13"]))),append($$anchor2,fragment_1)},$$slots:{default:!0}}),pop()}var root$1h=from_html('<button type="button"><!></button>');function ChatFormPickerListItem($$anchor,$$props){let isSelected=prop($$props,"isSelected",3,!1);var button=root$1h(),node2=child(button);snippet(node2,()=>$$props.children),reset(button),template_effect(()=>{set_attribute(button,
-"data-picker-index",$$props.dataIndex),set_class(button,1,`flex w-full cursor-pointer items-start gap-3 rounded-lg px-3 py-2 text-left hover:bg-accent/50 ${isSelected()?"bg-accent/50":""}`)}),delegated("click",button,function(...$$args){$$props.onclick?.apply(this,$$args)}),append($$anchor,button)}delegate(["click"]);var root_1$A=from_html('<img alt="" class="h-3 w-3 shrink-0 rounded-sm"/>'),root_3$J=from_html('<p class="mt-0.5 truncate text-sm text-muted-foreground"> </p>'),root$1g=from_html('<\
-div class="min-w-0 flex-1"><div class="mb-0.5 flex items-center gap-1.5 text-xs text-muted-foreground"><!> <span> </span></div> <div class="flex items-center gap-2"><span class="font-medium"> </span> <!></div> <!> <!></div>');function ChatFormPickerItemHeader($$anchor,$$props){push$1($$props,!0);let faviconUrl=user_derived(()=>$$props.server?mcpStore.getServerFavicon($$props.server.id):null);var div=root$1g(),div_1=child(div),node2=child(div_1);{var consequent=$$anchor2=>{var img=root_1$A();template_effect(
-()=>set_attribute(img,"src",get$3(faviconUrl))),event("error",img,e=>{e.currentTarget.style.display="none"}),replay_events(img),append($$anchor2,img)};if_block(node2,$$render=>{get$3(faviconUrl)&&$$render(consequent)})}var span=sibling(node2,2),text2=child(span,!0);reset(span),reset(div_1);var div_2=sibling(div_1,2),span_1=child(div_2),text_1=child(span_1,!0);reset(span_1);var node_1=sibling(span_1,2);{var consequent_1=$$anchor2=>{var fragment=comment$2(),node_2=first_child(fragment);snippet(node_2,
-()=>$$props.titleExtra),append($$anchor2,fragment)};if_block(node_1,$$render=>{$$props.titleExtra&&$$render(consequent_1)})}reset(div_2);var node_3=sibling(div_2,2);{var consequent_2=$$anchor2=>{var p2=root_3$J(),text_2=child(p2,!0);reset(p2),template_effect(()=>set_text(text_2,$$props.description)),append($$anchor2,p2)};if_block(node_3,$$render=>{$$props.description&&$$render(consequent_2)})}var node_4=sibling(node_3,2);{var consequent_3=$$anchor2=>{var fragment_1=comment$2(),node_5=first_child(
-fragment_1);snippet(node_5,()=>$$props.subtitle),append($$anchor2,fragment_1)};if_block(node_4,$$render=>{$$props.subtitle&&$$render(consequent_3)})}reset(div),template_effect(()=>{set_text(text2,$$props.serverLabel),set_text(text_1,$$props.title)}),append($$anchor,div),pop()}var root_1$z=from_html('<div class="h-4 w-12 animate-pulse rounded-full bg-muted"></div>'),root$1f=from_html('<div class="flex w-full items-start gap-3 rounded-lg px-3 py-2"><div class="min-w-0 flex-1 space-y-2"><div class=\
-"mb-2 flex items-center gap-1.5"><div class="h-3 w-3 shrink-0 animate-pulse rounded-sm bg-muted"></div> <div class="h-3 w-24 animate-pulse rounded bg-muted"></div></div> <div class="flex items-center gap-2"><div></div> <!></div> <div class="h-3 w-full animate-pulse rounded bg-muted"></div></div></div>');function ChatFormPickerListItemSkeleton($$anchor,$$props){let titleWidth=prop($$props,"titleWidth",3,"w-48"),showBadge=prop($$props,"showBadge",3,!1);var div=root$1f(),div_1=child(div),div_2=sibling(
-child(div_1),2),div_3=child(div_2),node2=sibling(div_3,2);{var consequent=$$anchor2=>{var div_4=root_1$z();append($$anchor2,div_4)};if_block(node2,$$render=>{showBadge()&&$$render(consequent)})}reset(div_2),next$1(2),reset(div_1),reset(div),template_effect(()=>set_class(div_3,1,`h-4 ${titleWidth()??""} animate-pulse rounded bg-muted`)),append($$anchor,div)}var root_5$q=from_html('<span class="inline-flex items-center rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary">\
-attached</span>'),root_6$r=from_html('<p class="mt-0.5 truncate text-xs text-muted-foreground/60"> </p>'),root_10$b=from_html("<!> Browse all",1);function ChatFormPickerMcpResources($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),isOpen=prop($$props,"isOpen",7,!1),searchQuery=prop($$props,"searchQuery",3,""),resources=state$1(proxy([])),isLoading2=state$1(!1),selectedIndex=state$1(0),internalSearchQuery=state$1(""),serverSettingsMap=user_derived(()=>{const servers=mcpStore.
-getServers(),map2=new SvelteMap;for(const server of servers)map2.set(server.id,server);return map2});user_effect(()=>{isOpen()&&(loadResources(),set$1(selectedIndex,0))}),user_effect(()=>{get$3(filteredResources).length>0&&get$3(selectedIndex)>=get$3(filteredResources).length&&set$1(selectedIndex,0)});async function loadResources(){set$1(isLoading2,!0);try{const perChatOverrides=conversationsStore.getAllMcpServerOverrides();if(!await mcpStore.ensureInitialized(perChatOverrides)){set$1(resources,
-[],!0);return}await mcpStore.fetchAllResources(),set$1(resources,mcpResourceStore.getAllResourceInfos(),!0)}catch(error2){console.error("[ChatFormPickerMcpResources] Failed to load resources:",error2),set$1(resources,[],!0)}finally{set$1(isLoading2,!1)}}function handleResourceClick(resource){mcpStore.attachResource(resource.uri),$$props.onResourceSelect?.(resource),$$props.onClose?.()}function isResourceAttached(uri2){return mcpResourceStore.isAttached(uri2)}function handleKeydown(event2){return isOpen()?
-event2.key===KeyboardKey.ESCAPE?(event2.preventDefault(),$$props.onClose?.(),!0):event2.key===KeyboardKey.ARROW_DOWN?(event2.preventDefault(),get$3(filteredResources).length>0&&set$1(selectedIndex,(get$3(selectedIndex)+1)%get$3(filteredResources).length),!0):event2.key===KeyboardKey.ARROW_UP?(event2.preventDefault(),get$3(filteredResources).length>0&&set$1(selectedIndex,get$3(selectedIndex)===0?get$3(filteredResources).length-1:get$3(selectedIndex)-1,!0),!0):event2.key===KeyboardKey.ENTER?(event2.
-preventDefault(),get$3(filteredResources)[get$3(selectedIndex)]&&handleResourceClick(get$3(filteredResources)[get$3(selectedIndex)]),!0):!1:!1}let filteredResources=user_derived(()=>{const sortedServers=mcpStore.getServersSorted(),serverOrderMap=new Map(sortedServers.map((server,index2)=>[server.id,index2])),sortedResources=[...get$3(resources)].sort((a,b)=>{const orderA=serverOrderMap.get(a.serverName)??Number.MAX_SAFE_INTEGER,orderB=serverOrderMap.get(b.serverName)??Number.MAX_SAFE_INTEGER;return orderA-
-orderB}),query=(searchQuery()||get$3(internalSearchQuery)).toLowerCase();return query?sortedResources.filter(resource=>resource.name.toLowerCase().includes(query)||resource.title?.toLowerCase().includes(query)||resource.description?.toLowerCase().includes(query)||resource.uri.toLowerCase().includes(query)):sortedResources}),showSearchInput=user_derived(()=>get$3(resources).length>3);var $$exports={handleKeydown};return ChatFormPickerPopover($$anchor,{get class(){return className()},srLabel:"Open\
- resource picker",get onClose(){return $$props.onClose},onKeydown:handleKeydown,get isOpen(){return isOpen()},set isOpen($$value){isOpen($$value)},children:($$anchor2,$$slotProps)=>{ChatFormPickerList($$anchor2,{get items(){return get$3(filteredResources)},get isLoading(){return get$3(isLoading2)},get selectedIndex(){return get$3(selectedIndex)},get showSearchInput(){return get$3(showSearchInput)},searchPlaceholder:"Search resources...",emptyMessage:"No MCP resources available",itemKey:resource=>resource.
-serverName+":"+resource.uri,get searchQuery(){return get$3(internalSearchQuery)},set searchQuery($$value){set$1(internalSearchQuery,$$value,!0)},item:($$anchor3,resource=noop$3,index2=noop$3,isSelected=noop$3)=>{const server=user_derived(()=>get$3(serverSettingsMap).get(resource().serverName)),serverLabel=user_derived(()=>get$3(server)?mcpStore.getServerLabel(get$3(server)):resource().serverName);ChatFormPickerListItem($$anchor3,{get dataIndex(){return index2()},get isSelected(){return isSelected()},
-onclick:()=>handleResourceClick(resource()),children:($$anchor4,$$slotProps2)=>{{const titleExtra=$$anchor5=>{var fragment_4=comment$2(),node2=first_child(fragment_4);{var consequent=$$anchor6=>{var span=root_5$q();append($$anchor6,span)},d2=user_derived(()=>isResourceAttached(resource().uri));if_block(node2,$$render=>{get$3(d2)&&$$render(consequent)})}append($$anchor5,fragment_4)},subtitle=$$anchor5=>{var p2=root_6$r(),text2=child(p2,!0);reset(p2),template_effect(()=>set_text(text2,resource().uri)),
-append($$anchor5,p2)};let $0=user_derived(()=>resource().title||resource().name);ChatFormPickerItemHeader($$anchor4,{get server(){return get$3(server)},get serverLabel(){return get$3(serverLabel)},get title(){return get$3($0)},get description(){return resource().description},titleExtra,subtitle,$$slots:{titleExtra:!0,subtitle:!0}})}},$$slots:{default:!0}})},skeleton:$$anchor3=>{ChatFormPickerListItemSkeleton($$anchor3,{})},footer:$$anchor3=>{var fragment_6=comment$2(),node_1=first_child(fragment_6);
-{var consequent_1=$$anchor4=>{Button($$anchor4,{class:"fixed right-3 bottom-3",type:"button",get onclick(){return $$props.onBrowse},variant:"secondary",size:"sm",children:($$anchor5,$$slotProps2)=>{var fragment_8=root_10$b(),node_2=first_child(fragment_8);Folder_open(node_2,{class:"h-3 w-3"}),next$1(),append($$anchor5,fragment_8)},$$slots:{default:!0}})};if_block(node_1,$$render=>{$$props.onBrowse&&get$3(resources).length>3&&$$render(consequent_1)})}append($$anchor3,fragment_6)},$$slots:{item:!0,
-skeleton:!0,footer:!0}})},$$slots:{default:!0}}),pop($$exports)}var root$1e=from_html("<!> <!>",1);function ChatFormPickers($$anchor,$$props){push$1($$props,!0);let promptPickerRef=state$1(void 0),resourcePickerRef=state$1(void 0);function handleKeydown(event2){return!!($$props.isPromptPickerOpen&&get$3(promptPickerRef)?.handleKeydown(event2)||$$props.isInlineResourcePickerOpen&&get$3(resourcePickerRef)?.handleKeydown(event2))}var $$exports={handleKeydown},fragment=root$1e(),node2=first_child(fragment);
-bind_this(ChatFormPickerMcpPrompts(node2,{get isOpen(){return $$props.isPromptPickerOpen},get searchQuery(){return $$props.promptSearchQuery},get onClose(){return $$props.onPromptPickerClose},get onPromptLoadStart(){return $$props.onPromptLoadStart},get onPromptLoadComplete(){return $$props.onPromptLoadComplete},get onPromptLoadError(){return $$props.onPromptLoadError}}),$$value=>set$1(promptPickerRef,$$value,!0),()=>get$3(promptPickerRef));var node_1=sibling(node2,2);return bind_this(ChatFormPickerMcpResources(
-node_1,{get isOpen(){return $$props.isInlineResourcePickerOpen},get searchQuery(){return $$props.resourceSearchQuery},get onClose(){return $$props.onInlineResourcePickerClose},get onResourceSelect(){return $$props.onInlineResourceSelect},get onBrowse(){return $$props.onInlineResourceBrowse}}),$$value=>set$1(resourcePickerRef,$$value,!0),()=>get$3(resourcePickerRef)),append($$anchor,fragment),pop($$exports)}const MESSAGE_EDIT_KEY=Symbol.for(CONTEXT_KEY_MESSAGE_EDIT);function setMessageEditContext(ctx){
-return setContext(MESSAGE_EDIT_KEY,ctx)}function getMessageEditContext(){return getContext(MESSAGE_EDIT_KEY)}const CHAT_ACTIONS_KEY=Symbol.for(CONTEXT_KEY_CHAT_ACTIONS);function setChatActionsContext(ctx){return setContext(CHAT_ACTIONS_KEY,ctx)}function getChatActionsContext(){return getContext(CHAT_ACTIONS_KEY)}const CHAT_SETTINGS_CONFIG_KEY=Symbol.for(CONTEXT_KEY_CHAT_SETTINGS_CONFIG);function setChatSettingsConfigContext(ctx){return setContext(CHAT_SETTINGS_CONFIG_KEY,ctx)}const PROCESSING_INFO_KEY=Symbol.
-for(CONTEXT_KEY_PROCESSING_INFO);function setProcessingInfoContext(ctx){return setContext(PROCESSING_INFO_KEY,ctx)}function getProcessingInfoContext(){return getContext(PROCESSING_INFO_KEY)}var root$1d=from_html("<!> <!>",1);function ChatMessages($$anchor,$$props){push$1($$props,!0);let messages=prop($$props,"messages",19,()=>[]),allConversationMessages=state$1(proxy([]));const currentConfig=config$1();setChatActionsContext({copy:async message=>{const asPlainText=!!currentConfig.copyTextAttachmentsAsPlainText,
-clipboardContent=formatMessageForClipboard(message.content,message.extra,asPlainText);await copyToClipboard(clipboardContent,"Message copied to clipboard")},delete:async message=>{await chatStore.deleteMessage(message.id),refreshAllMessages()},navigateToSibling:async siblingId=>{await conversationsStore.navigateToSibling(siblingId)},editWithBranching:async(message,newContent,newExtras)=>{$$props.onUserAction?.(),await chatStore.editMessageWithBranching(message.id,newContent,newExtras),refreshAllMessages()},
-editWithReplacement:async(message,newContent,shouldBranch)=>{$$props.onUserAction?.(),await chatStore.editAssistantMessage(message.id,newContent,shouldBranch),refreshAllMessages()},editUserMessagePreserveResponses:async(message,newContent,newExtras)=>{$$props.onUserAction?.(),await chatStore.editUserMessagePreserveResponses(message.id,newContent,newExtras),refreshAllMessages()},regenerateWithBranching:async(message,modelOverride)=>{$$props.onUserAction?.(),await chatStore.regenerateMessageWithBranching(
-message.id,modelOverride),refreshAllMessages()},continueAssistantMessage:async message=>{$$props.onUserAction?.(),await chatStore.continueAssistantMessage(message.id),refreshAllMessages()},forkConversation:async(message,options)=>{await conversationsStore.forkConversation(message.id,options)}});function refreshAllMessages(){const conversation=activeConversation();conversation?conversationsStore.getConversationMessages(conversation.id).then(messages2=>{set$1(allConversationMessages,messages2,!0)}):
-set$1(allConversationMessages,[],!0)}user_effect(()=>{activeConversation()&&refreshAllMessages()});let displayMessages=user_derived(()=>{if(!messages().length)return[];const filteredMessages=currentConfig.showSystemMessage?messages():messages().filter(msg=>msg.type!==MessageRole.SYSTEM),result=[];for(let i=0;i<filteredMessages.length;i++){const msg=filteredMessages[i];if(msg.role===MessageRole.TOOL)continue;const toolMessages=[];if(msg.role===MessageRole.ASSISTANT&&hasAgenticContent(msg)){let j=i+
-1;for(;j<filteredMessages.length;){const next2=filteredMessages[j];if(next2.role===MessageRole.TOOL)toolMessages.push(next2),j++;else if(next2.role===MessageRole.ASSISTANT)toolMessages.push(next2),j++;else break}i=j-1}else if(msg.role===MessageRole.ASSISTANT){let j=i+1;for(;j<filteredMessages.length&&filteredMessages[j].role===MessageRole.TOOL;)toolMessages.push(filteredMessages[j]),j++}const siblingInfo=getMessageSiblings(get$3(allConversationMessages),msg.id);result.push({message:msg,toolMessages,
-isLastAssistantMessage:!1,siblingInfo:siblingInfo||{message:msg,siblingIds:[msg.id],currentIndex:0,totalSiblings:1}})}for(let i=result.length-1;i>=0;i--)if(result[i].message.role===MessageRole.ASSISTANT){result[i].isLastAssistantMessage=!0;break}return result});var fragment=root$1d(),node2=first_child(fragment);each(node2,17,()=>get$3(displayMessages),({message,toolMessages,isLastAssistantMessage,siblingInfo})=>message.id,($$anchor2,$$item)=>{let message=()=>get$3($$item).message,toolMessages=()=>get$3(
-$$item).toolMessages,isLastAssistantMessage=()=>get$3($$item).isLastAssistantMessage,siblingInfo=()=>get$3($$item).siblingInfo;ChatMessage($$anchor2,{class:"mx-auto mt-12 w-full max-w-[48rem]",get message(){return message()},get toolMessages(){return toolMessages()},get isLastAssistantMessage(){return isLastAssistantMessage()},get siblingInfo(){return siblingInfo()}})});var node_1=sibling(node2,2);{var consequent_1=$$anchor2=>{const convId=user_derived(()=>activeConversation().id),pendingContent=user_derived(
-()=>agenticPendingSteeringMessageContent(get$3(convId)));var fragment_2=comment$2(),node_2=first_child(fragment_2);{var consequent=$$anchor3=>{{let $0=user_derived(()=>agenticPendingSteeringMessageExtras(get$3(convId)));ChatMessageUserPending($$anchor3,{class:"mx-auto mt-12 w-full max-w-[48rem]",get content(){return get$3(pendingContent)},get extras(){return get$3($0)},onSendImmediately:()=>chatStore.abortCurrentFlow(get$3(convId)),onEdit:(newContent,extras)=>agenticInjectSteeringMessage(get$3(convId),
-newContent,extras),onDelete:()=>agenticClearSteeringMessage(get$3(convId))})}};if_block(node_2,$$render=>{get$3(pendingContent)&&$$render(consequent)})}append($$anchor2,fragment_2)},d2=user_derived(()=>activeConversation()&&agenticPendingSteeringMessageContent(activeConversation().id)),consequent_3=$$anchor2=>{const convId=user_derived(()=>activeConversation().id),pendingContent=user_derived(()=>chatPendingMessageContent(get$3(convId)));var fragment_4=comment$2(),node_3=first_child(fragment_4);{
-var consequent_2=$$anchor3=>{{let $0=user_derived(()=>chatPendingMessageExtras(get$3(convId)));ChatMessageUserPending($$anchor3,{class:"mx-auto mt-12 w-full max-w-[48rem]",get content(){return get$3(pendingContent)},get extras(){return get$3($0)},onSendImmediately:()=>chatStore.abortCurrentFlow(get$3(convId)),onEdit:(newContent,extras)=>chatInjectPendingMessage(get$3(convId),newContent,extras),onDelete:()=>chatClearPendingMessage(get$3(convId))})}};if_block(node_3,$$render=>{get$3(pendingContent)&&
-$$render(consequent_2)})}append($$anchor2,fragment_4)},d_12=user_derived(()=>activeConversation()&&chatPendingMessageContent(activeConversation().id));if_block(node_1,$$render=>{get$3(d2)?$$render(consequent_1):get$3(d_12)&&$$render(consequent_3,1)})}append($$anchor,fragment),pop()}function isElementInViewport(node2){const rect=node2.getBoundingClientRect();return rect.top<window.innerHeight&&rect.bottom>0&&rect.left<window.innerWidth&&rect.right>0}function fadeInView(node2,options={}){const{duration:duration2=300,
-y=0,skipIfVisible=!1}=options;skipIfVisible&&isElementInViewport(node2)||(node2.style.opacity="0",node2.style.transform=`translateY(${y}px)`,node2.style.transition=`opacity ${duration2}ms ease-out, transform ${duration2}ms ease-out`,user_effect(()=>{const observer=new IntersectionObserver(entries=>{for(const entry of entries)entry.isIntersecting&&(requestAnimationFrame(()=>{node2.style.opacity="1",node2.style.transform="translateY(0)"}),observer.disconnect())},{threshold:.05});return observer.observe(
-node2),()=>{observer.disconnect()}}))}var root$1c=from_html("<div><!></div>");function ChatMessage($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),toolMessages=prop($$props,"toolMessages",19,()=>[]),isLastAssistantMessage=prop($$props,"isLastAssistantMessage",3,!1),siblingInfo=prop($$props,"siblingInfo",3,null);const chatActions=getChatActionsContext();let deletionInfo=state$1(null),editedContent=user_derived(()=>$$props.message.content),rawEditContent=user_derived(
-()=>{if($$props.message.role!==MessageRole.ASSISTANT)return;const sections=deriveAgenticSections($$props.message,toolMessages(),[],!1),parts=[];for(const section2 of sections)switch(section2.type){case AgenticSectionType.REASONING:case AgenticSectionType.REASONING_PENDING:parts.push(`${REASONING_TAGS.START}
+$$anchor3,fragment_1)},$$slots:{default:!0}}))})}append($$anchor,fragment),pop()}var root_3$M=from_html("<!> <span>MCP Servers</span>",1),root_7$o=from_html("<!> <span>Manage MCP Servers</span>",1),root_10$b=from_html('<span class="shrink-0 rounded bg-destructive/15 px-1.5 py-0.5 text-xs text-destructive">Error</span>'),root_9$i=from_html('<button type="button" class="flex w-full items-center justify-between gap-2 rounded-sm px-2 py-2 text-left transition-colors hover:bg-accent disabled:cursor-n\
+ot-allowed disabled:opacity-50"><div class="flex min-w-0 flex-1 items-center gap-2"><div class="min-w-0 flex-1"><!></div> <!></div> <!></button>'),root_8$o=from_html('<div class="max-h-64 overflow-y-auto"></div>'),root_12$7=from_html("<!> <span>Add MCP Servers</span>",1),root_11$c=from_html('<div class="px-2 py-3 text-center text-sm text-muted-foreground">No MCP servers configured</div> <!> <!>',1),root_2$Y=from_html("<!> <!>",1);function ChatFormActionAddMcpServersSubmenu($$anchor,$$props){push$1(
+$$props,!0);let mcpSearchQuery=state$1(""),allMcpServers=user_derived(()=>mcpStore.getServersSorted()),mcpServers=user_derived(()=>get$3(allMcpServers).filter(s2=>s2.enabled)),hasMcpServers=user_derived(()=>get$3(mcpServers).length>0),filteredMcpServers=user_derived(()=>{const query=get$3(mcpSearchQuery).toLowerCase().trim();return query?get$3(mcpServers).filter(s2=>{const name=getServerLabel(s2).toLowerCase(),url2=s2.url.toLowerCase();return name.includes(query)||url2.includes(query)}):get$3(mcpServers)});
+function getServerLabel(server){return mcpStore.getServerLabel(server)}function isServerEnabledForChat(serverId){return conversationsStore.isMcpServerEnabledForChat(serverId)}async function toggleServerForChat(serverId){await conversationsStore.toggleMcpServerForChat(serverId)}function handleMcpSubMenuOpen(open2){open2&&(set$1(mcpSearchQuery,""),mcpStore.runHealthChecksForServers(get$3(allMcpServers)))}function handleMcpSettingsClick(){$$props.onMcpSettingsClick?.(),goto(`${get$3(hasMcpServers)?
+"":"?add"}#/settings/mcp`)}var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$4,($$anchor2,DropdownMenu_Root)=>{DropdownMenu_Root($$anchor2,{children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Sub,($$anchor4,DropdownMenu_Sub)=>{DropdownMenu_Sub($$anchor4,{onOpenChange:handleMcpSubMenuOpen,children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$Y(),node_2=first_child(fragment_2);component(node_2,()=>Dropdown_menu_sub_trigger,
+($$anchor6,DropdownMenu_SubTrigger)=>{DropdownMenu_SubTrigger($$anchor6,{class:"flex cursor-pointer items-center gap-2",children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$M(),node_3=first_child(fragment_3);McpLogo(node_3,{class:"h-4 w-4"}),next$1(2),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var node_4=sibling(node_2,2);component(node_4,()=>Dropdown_menu_sub_content,($$anchor6,DropdownMenu_SubContent)=>{DropdownMenu_SubContent($$anchor6,{class:"w-72 pt-0",children:($$anchor7,$$slotProps3)=>{
+var fragment_4=comment$2(),node_5=first_child(fragment_4);{var consequent_1=$$anchor8=>{{const footer2=$$anchor9=>{var fragment_6=comment$2(),node_6=first_child(fragment_6);component(node_6,()=>Dropdown_menu_item,($$anchor10,DropdownMenu_Item)=>{DropdownMenu_Item($$anchor10,{class:"flex cursor-pointer items-center gap-2",onclick:handleMcpSettingsClick,children:($$anchor11,$$slotProps4)=>{var fragment_7=root_7$o(),node_7=first_child(fragment_7);Settings$1(node_7,{class:"h-4 w-4"}),next$1(2),append(
+$$anchor11,fragment_7)},$$slots:{default:!0}})}),append($$anchor9,fragment_6)};let $0=user_derived(()=>get$3(filteredMcpServers).length===0);DropdownMenuSearchable($$anchor8,{placeholder:"Search servers...",emptyMessage:"No servers found",get isEmpty(){return get$3($0)},get searchValue(){return get$3(mcpSearchQuery)},set searchValue($$value){set$1(mcpSearchQuery,$$value,!0)},footer:footer2,children:($$anchor9,$$slotProps4)=>{var div=root_8$o();each(div,21,()=>get$3(filteredMcpServers),server=>server.
+id,($$anchor10,server)=>{const healthState=user_derived(()=>mcpStore.getHealthCheckState(get$3(server).id)),hasError=user_derived(()=>get$3(healthState).status===HealthCheckStatus.ERROR),isEnabledForChat=user_derived(()=>isServerEnabledForChat(get$3(server).id)),displayName=user_derived(()=>getServerLabel(get$3(server))),faviconUrl=user_derived(()=>mcpStore.getServerFavicon(get$3(server).id));var button=root_9$i(),div_1=child(button),div_2=child(div_1),node_8=child(div_2);McpServerIdentity(node_8,
+{get displayName(){return get$3(displayName)},get faviconUrl(){return get$3(faviconUrl)},iconClass:"h-4 w-4",iconRounded:"rounded-sm",showVersion:!1,nameClass:"text-sm"}),reset(div_2);var node_9=sibling(div_2,2);{var consequent=$$anchor11=>{var span=root_10$b();append($$anchor11,span)};if_block(node_9,$$render=>{get$3(hasError)&&$$render(consequent)})}reset(div_1);var node_10=sibling(div_1,2);Switch(node_10,{get checked(){return get$3(isEnabledForChat)},get disabled(){return get$3(hasError)},onclick:e=>e.
+stopPropagation(),onCheckedChange:()=>toggleServerForChat(get$3(server).id)}),reset(button),template_effect(()=>button.disabled=get$3(hasError)),delegated("click",button,()=>!get$3(hasError)&&toggleServerForChat(get$3(server).id)),append($$anchor10,button)}),reset(div),append($$anchor9,div)},$$slots:{footer:!0,default:!0}})}},alternate=$$anchor8=>{var fragment_8=root_11$c(),node_11=sibling(first_child(fragment_8),2);component(node_11,()=>Dropdown_menu_separator,($$anchor9,DropdownMenu_Separator)=>{
+DropdownMenu_Separator($$anchor9,{})});var node_12=sibling(node_11,2);component(node_12,()=>Dropdown_menu_item,($$anchor9,DropdownMenu_Item_1)=>{DropdownMenu_Item_1($$anchor9,{class:"flex cursor-pointer items-center gap-2",onclick:handleMcpSettingsClick,children:($$anchor10,$$slotProps4)=>{var fragment_9=root_12$7(),node_13=first_child(fragment_9);Plus(node_13,{class:"h-4 w-4"}),next$1(2),append($$anchor10,fragment_9)},$$slots:{default:!0}})}),append($$anchor8,fragment_8)};if_block(node_5,$$render=>{
+get$3(hasMcpServers)?$$render(consequent_1):$$render(alternate,-1)})}append($$anchor7,fragment_4)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}delegate(["click"]);var root$1m=from_html('<input type="file"/>');function ChatFormFileInputInvisible($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),multiple=prop($$props,"multiple",3,!0),fileInputElement;
+function click(){fileInputElement?.click()}function handleFileSelect(event2){const input=event2.target;input.files&&$$props.onFileSelect?.(Array.from(input.files))}var $$exports={click},input_1=root$1m();return bind_this(input_1,$$value=>fileInputElement=$$value,()=>fileInputElement),template_effect(()=>{input_1.multiple=multiple(),set_class(input_1,1,`hidden ${className()??""}`)}),delegated("change",input_1,handleFileSelect),append($$anchor,input_1),pop($$exports)}delegate(["change"]);var root_1$F=from_html(
+"<div><!></div>");function ChatFormMcpResourcesList($$anchor,$$props){push$1($$props,!0);const attachments=user_derived(mcpResourceAttachments),hasAttachments=user_derived(mcpHasResourceAttachments);function handleRemove(attachmentId){mcpStore.removeResourceAttachment(attachmentId)}function handleResourceClick(uri2){$$props.onResourceClick?.(uri2)}var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var div=root_1$F(),node_1=child(div);HorizontalScrollCarousel(node_1,
+{gapSize:"2",children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_2=first_child(fragment_1);each(node_2,19,()=>get$3(attachments),attachment=>attachment.id,($$anchor4,attachment,i)=>{{let $0=user_derived(()=>get$3(i)===0?"ml-3":"");ChatAttachmentsListItemMcpResource($$anchor4,{get class(){return get$3($0)},get attachment(){return get$3(attachment)},onRemove:handleRemove,onclick:()=>handleResourceClick(get$3(attachment).resource.uri)})}}),append($$anchor3,fragment_1)},$$slots:{default:!0}}),
+reset(div),template_effect(()=>set_class(div,1,clsx($$props.class))),append($$anchor2,div)};if_block(node2,$$render=>{get$3(hasAttachments)&&$$render(consequent)})}append($$anchor,fragment),pop()}var root$1l=from_html('<div><textarea style="max-height: var(--max-message-height);"></textarea></div>');function ChatFormTextarea($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),disabled=prop($$props,"disabled",3,!1),placeholder=prop($$props,"placeholder",3,"Ask anything..\
+."),value=prop($$props,"value",15,""),textareaElement;onMount$1(()=>{textareaElement&&(autoResizeTextarea(textareaElement),textareaElement.focus())});function getElement(){return textareaElement}function focus2(){textareaElement?.focus()}function resetHeight(){textareaElement&&(textareaElement.style.height="1rem")}var $$exports={getElement,focus:focus2,resetHeight},div=root$1l(),textarea=child(div);return remove_textarea_child(textarea),bind_this(textarea,$$value=>textareaElement=$$value,()=>textareaElement),
+reset(div),template_effect(()=>{set_class(div,1,`flex-1 ${className()??""}`),set_class(textarea,1,clsx(["text-md min-h-12 w-full resize-none border-0 bg-transparent p-0 leading-6 outline-none placeholder:text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",disabled()&&"cursor-not-allowed"])),textarea.disabled=disabled(),set_attribute(textarea,"placeholder",placeholder())}),delegated("keydown",textarea,function(...$$args){$$props.onKeydown?.apply(this,$$args)}),delegated("input",
+textarea,event2=>{autoResizeTextarea(event2.currentTarget),$$props.onInput?.()}),event("paste",textarea,function(...$$args){$$props.onPaste?.apply(this,$$args)}),bind_value(textarea,value),append($$anchor,div),pop($$exports)}delegate(["keydown","input"]);const badgeVariants=tv({base:"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-\
+1 overflow-hidden whitespace-nowrap rounded-md border px-2 py-0.5 text-xs font-medium transition-[color,box-shadow] focus-visible:ring-[3px] [&>svg]:pointer-events-none [&>svg]:size-3",variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90 border-transparent",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90 border-transparent",tertiary:"bg-foreground/15 dark:bg-foreground/10 text-foreground [a&]:hover:bg-foreground/25 border-transparen\
+t",destructive:"bg-destructive [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/70 border-transparent text-white",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Badge($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),variant=prop($$props,"variant",3,"default"),restProps=rest_props($$props,["$$slots","$$events","$$legac\
+y","ref","href","class","variant","children"]);var fragment=comment$2(),node2=first_child(fragment);element$4(node2,()=>$$props.href?"a":"span",!1,($$element,$$anchor2)=>{bind_this($$element,$$value=>ref2($$value),()=>ref2()),attribute_effect($$element,$0=>({"data-slot":"badge",href:$$props.href,class:$0,...restProps}),[()=>cn$1(badgeVariants({variant:variant()}),$$props.class,"backdrop-blur-sm")]);var fragment_1=comment$2(),node_1=first_child(fragment_1);snippet(node_1,()=>$$props.children??noop$3),
+append($$anchor2,fragment_1)}),append($$anchor,fragment),pop()}var root_2$X=from_html('<div class="p-4"><!> <!></div>');function ChatFormPickerMcpPrompts($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),isOpen=prop($$props,"isOpen",7,!1),searchQuery=prop($$props,"searchQuery",3,""),prompts=state$1(proxy([])),isLoading2=state$1(!1),selectedPrompt=state$1(null),promptArgs=state$1(proxy({})),selectedIndex=state$1(0),internalSearchQuery=state$1(""),promptError=state$1(null),
+selectedIndexBeforeArgumentForm=state$1(null),suggestions=proxy({}),loadingSuggestions=proxy({}),activeAutocomplete=state$1(null),autocompleteIndex=state$1(0),serverSettingsMap=user_derived(()=>{const servers=mcpStore.getServers(),map2=new SvelteMap;for(const server of servers)map2.set(server.id,server);return map2});user_effect(()=>{isOpen()?(loadPrompts(),set$1(selectedIndex,0)):(set$1(selectedPrompt,null),set$1(promptArgs,{},!0),set$1(promptError,null))}),user_effect(()=>{get$3(filteredPrompts).
+length>0&&get$3(selectedIndex)>=get$3(filteredPrompts).length&&set$1(selectedIndex,0)});async function loadPrompts(){set$1(isLoading2,!0);try{const perChatOverrides=conversationsStore.getAllMcpServerOverrides();if(!await mcpStore.ensureInitialized(perChatOverrides)){set$1(prompts,[],!0);return}set$1(prompts,await mcpStore.getAllPrompts(),!0)}catch(error2){console.error("[ChatFormPickerMcpPrompts] Failed to load prompts:",error2),set$1(prompts,[],!0)}finally{set$1(isLoading2,!1)}}function handlePromptClick(prompt){
+const args=prompt.arguments??[];args.length>0?(set$1(selectedIndexBeforeArgumentForm,get$3(selectedIndex),!0),set$1(selectedPrompt,prompt,!0),set$1(promptArgs,{},!0),set$1(promptError,null),requestAnimationFrame(()=>{const firstInput=document.querySelector(`#arg-${args[0].name}`);firstInput&&firstInput.focus()})):executePrompt(prompt,{})}async function executePrompt(prompt,args){set$1(promptError,null);const placeholderId=uuid$1(),nonEmptyArgs=Object.fromEntries(Object.entries(args).filter(([,value])=>value.
+trim()!=="")),argsToPass=Object.keys(nonEmptyArgs).length>0?nonEmptyArgs:void 0;$$props.onPromptLoadStart?.(placeholderId,prompt,argsToPass),$$props.onClose?.();try{const result=await mcpStore.getPrompt(prompt.serverName,prompt.name,args);$$props.onPromptLoadComplete?.(placeholderId,result)}catch(error2){const errorMessage=error2 instanceof Error?error2.message:"Unknown error executing prompt";$$props.onPromptLoadError?.(placeholderId,errorMessage)}}function handleArgumentSubmit(event2){event2.preventDefault(),
+get$3(selectedPrompt)&&executePrompt(get$3(selectedPrompt),get$3(promptArgs))}const fetchCompletions=debounce(async(argName,value)=>{if(!get$3(selectedPrompt)||value.length<1){suggestions[argName]=[];return}loadingSuggestions[argName]=!0;try{const result=await mcpStore.getPromptCompletions(get$3(selectedPrompt).serverName,get$3(selectedPrompt).name,argName,value);if(result&&result.values.length>0){const filteredValues=result.values.filter(v=>v.trim()!=="");filteredValues.length>0?(suggestions[argName]=
+filteredValues,set$1(activeAutocomplete,argName,!0),set$1(autocompleteIndex,0)):suggestions[argName]=[]}else suggestions[argName]=[]}catch(error2){console.error("[ChatFormPickerMcpPrompts] Failed to fetch completions:",error2),suggestions[argName]=[]}finally{loadingSuggestions[argName]=!1}},200);function handleArgInput(argName,value){get$3(promptArgs)[argName]=value,fetchCompletions(argName,value)}function selectSuggestion(argName,value){get$3(promptArgs)[argName]=value,suggestions[argName]=[],set$1(
+activeAutocomplete,null)}function handleArgKeydown(event2,argName){const argSuggestions=suggestions[argName]??[];if(event2.key===KeyboardKey.ESCAPE){event2.preventDefault(),event2.stopPropagation(),handleCancelArgumentForm();return}argSuggestions.length===0||get$3(activeAutocomplete)!==argName||(event2.key===KeyboardKey.ARROW_DOWN?(event2.preventDefault(),set$1(autocompleteIndex,Math.min(get$3(autocompleteIndex)+1,argSuggestions.length-1),!0)):event2.key===KeyboardKey.ARROW_UP?(event2.preventDefault(),
+set$1(autocompleteIndex,Math.max(get$3(autocompleteIndex)-1,0),!0)):event2.key===KeyboardKey.ENTER&&argSuggestions[get$3(autocompleteIndex)]&&(event2.preventDefault(),event2.stopPropagation(),selectSuggestion(argName,argSuggestions[get$3(autocompleteIndex)])))}function handleArgBlur(argName){setTimeout(()=>{get$3(activeAutocomplete)===argName&&(suggestions[argName]=[],set$1(activeAutocomplete,null))},150)}function handleArgFocus(argName){(suggestions[argName]?.length??0)>0&&set$1(activeAutocomplete,
+argName,!0)}function handleCancelArgumentForm(){get$3(selectedIndexBeforeArgumentForm)!==null&&(set$1(selectedIndex,get$3(selectedIndexBeforeArgumentForm),!0),set$1(selectedIndexBeforeArgumentForm,null)),set$1(selectedPrompt,null),set$1(promptArgs,{},!0),set$1(promptError,null)}function handleKeydown(event2){return isOpen()?event2.key===KeyboardKey.ESCAPE?(event2.preventDefault(),get$3(selectedPrompt)?handleCancelArgumentForm():$$props.onClose?.(),!0):event2.key===KeyboardKey.ARROW_DOWN?(event2.
+preventDefault(),get$3(filteredPrompts).length>0&&set$1(selectedIndex,(get$3(selectedIndex)+1)%get$3(filteredPrompts).length),!0):event2.key===KeyboardKey.ARROW_UP?(event2.preventDefault(),get$3(filteredPrompts).length>0&&set$1(selectedIndex,get$3(selectedIndex)===0?get$3(filteredPrompts).length-1:get$3(selectedIndex)-1,!0),!0):event2.key===KeyboardKey.ENTER&&!get$3(selectedPrompt)?(event2.preventDefault(),get$3(filteredPrompts)[get$3(selectedIndex)]&&handlePromptClick(get$3(filteredPrompts)[get$3(
+selectedIndex)]),!0):!1:!1}let filteredPrompts=user_derived(()=>{const sortedServers=mcpStore.getServersSorted(),serverOrderMap=new Map(sortedServers.map((server,index2)=>[server.id,index2])),sortedPrompts=[...get$3(prompts)].sort((a,b)=>{const orderA=serverOrderMap.get(a.serverName)??Number.MAX_SAFE_INTEGER,orderB=serverOrderMap.get(b.serverName)??Number.MAX_SAFE_INTEGER;return orderA-orderB}),query=(searchQuery()||get$3(internalSearchQuery)).toLowerCase();return query?sortedPrompts.filter(prompt=>prompt.
+name.toLowerCase().includes(query)||prompt.title?.toLowerCase().includes(query)||prompt.description?.toLowerCase().includes(query)):sortedPrompts}),showSearchInput=user_derived(()=>get$3(prompts).length>3);var $$exports={handleKeydown};return ChatFormPickerPopover($$anchor,{get class(){return className()},srLabel:"Open prompt picker",get onClose(){return $$props.onClose},onKeydown:handleKeydown,get isOpen(){return isOpen()},set isOpen($$value){isOpen($$value)},children:($$anchor2,$$slotProps)=>{
+var fragment_1=comment$2(),node2=first_child(fragment_1);{var consequent_1=$$anchor3=>{const prompt=user_derived(()=>get$3(selectedPrompt)),server=user_derived(()=>get$3(serverSettingsMap).get(get$3(prompt).serverName)),serverLabel=user_derived(()=>get$3(server)?mcpStore.getServerLabel(get$3(server)):get$3(prompt).serverName);var div=root_2$X(),node_1=child(div);{const titleExtra=$$anchor4=>{var fragment_2=comment$2(),node_2=first_child(fragment_2);{var consequent=$$anchor5=>{Badge($$anchor5,{variant:"\
+secondary",children:($$anchor6,$$slotProps2)=>{next$1();var text2=text$8();template_effect(()=>set_text(text2,`${get$3(prompt).arguments.length??""} arg${get$3(prompt).arguments.length>1?"s":""}`)),append($$anchor6,text2)},$$slots:{default:!0}})};if_block(node_2,$$render=>{get$3(prompt).arguments?.length&&$$render(consequent)})}append($$anchor4,fragment_2)};let $0=user_derived(()=>get$3(prompt).title||get$3(prompt).name);ChatFormPickerItemHeader(node_1,{get server(){return get$3(server)},get serverLabel(){
+return get$3(serverLabel)},get title(){return get$3($0)},get description(){return get$3(prompt).description},titleExtra,$$slots:{titleExtra:!0}})}var node_3=sibling(node_1,2);ChatFormPromptPickerArgumentForm(node_3,{get prompt(){return get$3(selectedPrompt)},get promptArgs(){return get$3(promptArgs)},get suggestions(){return suggestions},get loadingSuggestions(){return loadingSuggestions},get activeAutocomplete(){return get$3(activeAutocomplete)},get autocompleteIndex(){return get$3(autocompleteIndex)},
+get promptError(){return get$3(promptError)},onArgInput:handleArgInput,onArgKeydown:handleArgKeydown,onArgBlur:handleArgBlur,onArgFocus:handleArgFocus,onSelectSuggestion:selectSuggestion,onSubmit:handleArgumentSubmit,onCancel:handleCancelArgumentForm}),reset(div),append($$anchor3,div)},alternate=$$anchor3=>{ChatFormPickerList($$anchor3,{get items(){return get$3(filteredPrompts)},get isLoading(){return get$3(isLoading2)},get selectedIndex(){return get$3(selectedIndex)},get showSearchInput(){return get$3(
+showSearchInput)},searchPlaceholder:"Search prompts...",emptyMessage:"No MCP prompts available",itemKey:prompt=>prompt.serverName+":"+prompt.name,get searchQuery(){return get$3(internalSearchQuery)},set searchQuery($$value){set$1(internalSearchQuery,$$value,!0)},item:($$anchor4,prompt=noop$3,index2=noop$3,isSelected=noop$3)=>{const server=user_derived(()=>get$3(serverSettingsMap).get(prompt().serverName)),serverLabel=user_derived(()=>get$3(server)?mcpStore.getServerLabel(get$3(server)):prompt().
+serverName);ChatFormPickerListItem($$anchor4,{get dataIndex(){return index2()},get isSelected(){return isSelected()},onclick:()=>handlePromptClick(prompt()),children:($$anchor5,$$slotProps2)=>{{const titleExtra=$$anchor6=>{var fragment_8=comment$2(),node_4=first_child(fragment_8);{var consequent_2=$$anchor7=>{Badge($$anchor7,{variant:"secondary",children:($$anchor8,$$slotProps3)=>{next$1();var text_1=text$8();template_effect(()=>set_text(text_1,`${prompt().arguments.length??""} arg${prompt().arguments.
+length>1?"s":""}`)),append($$anchor8,text_1)},$$slots:{default:!0}})};if_block(node_4,$$render=>{prompt().arguments?.length&&$$render(consequent_2)})}append($$anchor6,fragment_8)};let $0=user_derived(()=>prompt().title||prompt().name);ChatFormPickerItemHeader($$anchor5,{get server(){return get$3(server)},get serverLabel(){return get$3(serverLabel)},get title(){return get$3($0)},get description(){return prompt().description},titleExtra,$$slots:{titleExtra:!0}})}},$$slots:{default:!0}})},skeleton:$$anchor4=>{
+ChatFormPickerListItemSkeleton($$anchor4,{titleWidth:"w-32",showBadge:!0})},$$slots:{item:!0,skeleton:!0}})};if_block(node2,$$render=>{get$3(selectedPrompt)?$$render(consequent_1):$$render(alternate,-1)})}append($$anchor2,fragment_1)},$$slots:{default:!0}}),pop($$exports)}function Label($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(
+()=>cn$1("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",$$props.class));component(node2,()=>Label$1,($$anchor2,LabelPrimitive_Root)=>{LabelPrimitive_Root($$anchor2,spread_props({"data-slot":"label",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}
+var root_2$W=from_html('<span class="text-destructive">*</span>'),root_3$L=from_html('<span class="text-xs text-muted-foreground/50">...</span>'),root_1$E=from_html("<span> <!></span> <!>",1),root_5$r=from_html('<button type="button"> </button>'),root_4$w=from_html('<div class="absolute top-full right-0 left-0 z-10 mt-1 max-h-32 overflow-y-auto rounded-lg border border-border/50 bg-background shadow-lg"></div>'),root$1k=from_html('<div class="relative grid gap-1"><!> <!> <!></div>');function ChatFormPromptPickerArgumentInput($$anchor,$$props){
+push$1($$props,!0);let value=prop($$props,"value",3,""),suggestions=prop($$props,"suggestions",19,()=>[]),isLoadingSuggestions=prop($$props,"isLoadingSuggestions",3,!1),isAutocompleteActive=prop($$props,"isAutocompleteActive",3,!1),autocompleteIndex=prop($$props,"autocompleteIndex",3,0);var div=root$1k(),node2=child(div);Label(node2,{get for(){return`arg-${$$props.argument.name??""}`},class:"mb-1 text-muted-foreground",children:($$anchor2,$$slotProps)=>{var fragment=root_1$E(),span=first_child(fragment),
+text2=child(span),node_1=sibling(text2);{var consequent=$$anchor3=>{var span_1=root_2$W();append($$anchor3,span_1)};if_block(node_1,$$render=>{$$props.argument.required&&$$render(consequent)})}reset(span);var node_2=sibling(span,2);{var consequent_1=$$anchor3=>{var span_2=root_3$L();append($$anchor3,span_2)};if_block(node_2,$$render=>{isLoadingSuggestions()&&$$render(consequent_1)})}template_effect(()=>set_text(text2,`${$$props.argument.name??""} `)),append($$anchor2,fragment)},$$slots:{default:!0}});
+var node_3=sibling(node2,2);{let $0=user_derived(()=>$$props.argument.description||$$props.argument.name);Input(node_3,{get id(){return`arg-${$$props.argument.name??""}`},type:"text",get value(){return value()},oninput:e=>$$props.onInput(e.currentTarget.value),get onkeydown(){return $$props.onKeydown},get onblur(){return $$props.onBlur},get onfocus(){return $$props.onFocus},get placeholder(){return get$3($0)},get required(){return $$props.argument.required},autocomplete:"off"})}var node_4=sibling(
+node_3,2);{var consequent_2=$$anchor2=>{var div_1=root_4$w();each(div_1,22,suggestions,suggestion=>suggestion,($$anchor3,suggestion,i)=>{var button=root_5$r(),text_1=child(button,!0);reset(button),template_effect(()=>{set_class(button,1,`w-full px-3 py-1.5 text-left text-sm hover:bg-accent ${get$3(i)===autocompleteIndex()?"bg-accent":""}`),set_text(text_1,suggestion)}),delegated("mousedown",button,()=>$$props.onSelectSuggestion(suggestion)),append($$anchor3,button)}),reset(div_1),transition(3,div_1,
+()=>fly,()=>({y:-5,duration:100})),append($$anchor2,div_1)};if_block(node_4,$$render=>{isAutocompleteActive()&&suggestions().length>0&&$$render(consequent_2)})}reset(div),append($$anchor,div),pop()}delegate(["mousedown"]);var root_2$V=from_html('<div class="flex items-start gap-2 rounded-lg border border-destructive/50 bg-destructive/10 px-3 py-2 text-sm text-destructive" role="alert"><span class="shrink-0">⚠</span> <span> </span></div>'),root$1j=from_html('<form class="space-y-3 pt-4"><!> <!>\
+ <div class="mt-8 flex justify-end gap-2"><!> <!></div></form>');function ChatFormPromptPickerArgumentForm($$anchor,$$props){push$1($$props,!0);var form=root$1j(),node2=child(form);each(node2,17,()=>$$props.prompt.arguments??[],arg=>arg.name,($$anchor2,arg)=>{{let $0=user_derived(()=>$$props.promptArgs[get$3(arg).name]??""),$1=user_derived(()=>$$props.suggestions[get$3(arg).name]??[]),$2=user_derived(()=>$$props.loadingSuggestions[get$3(arg).name]??!1),$3=user_derived(()=>$$props.activeAutocomplete===
+get$3(arg).name),$4=user_derived(()=>$$props.activeAutocomplete===get$3(arg).name?$$props.autocompleteIndex:0);ChatFormPromptPickerArgumentInput($$anchor2,{get argument(){return get$3(arg)},get value(){return get$3($0)},get suggestions(){return get$3($1)},get isLoadingSuggestions(){return get$3($2)},get isAutocompleteActive(){return get$3($3)},get autocompleteIndex(){return get$3($4)},onInput:value=>$$props.onArgInput(get$3(arg).name,value),onKeydown:e=>$$props.onArgKeydown(e,get$3(arg).name),onBlur:()=>$$props.
+onArgBlur(get$3(arg).name),onFocus:()=>$$props.onArgFocus(get$3(arg).name),onSelectSuggestion:value=>$$props.onSelectSuggestion(get$3(arg).name,value)})}});var node_1=sibling(node2,2);{var consequent=$$anchor2=>{var div=root_2$V(),span=sibling(child(div),2),text2=child(span,!0);reset(span),reset(div),template_effect(()=>set_text(text2,$$props.promptError)),append($$anchor2,div)};if_block(node_1,$$render=>{$$props.promptError&&$$render(consequent)})}var div_1=sibling(node_1,2),node_2=child(div_1);
+Button(node_2,{type:"button",size:"sm",get onclick(){return $$props.onCancel},variant:"secondary",children:($$anchor2,$$slotProps)=>{next$1();var text_1=text$8("Cancel");append($$anchor2,text_1)},$$slots:{default:!0}});var node_3=sibling(node_2,2);Button(node_3,{size:"sm",type:"submit",children:($$anchor2,$$slotProps)=>{next$1();var text_2=text$8("Use Prompt");append($$anchor2,text_2)},$$slots:{default:!0}}),reset(div_1),reset(form),event("submit",form,function(...$$args){$$props.onSubmit?.apply(
+this,$$args)}),append($$anchor,form),pop()}function Popover($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15,!1),restProps=rest_props($$props,["$$slots","$$events","$$legacy","open"]);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Popover$1,($$anchor2,PopoverPrimitive_Root)=>{PopoverPrimitive_Root($$anchor2,spread_props(()=>restProps,{get open(){return open2()},set open($$value){open2($$value)}}))}),append($$anchor,fragment),pop()}function Popover_portal($$anchor,$$props){
+let restProps=rest_props($$props,["$$slots","$$events","$$legacy"]);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Portal$2,($$anchor2,PopoverPrimitive_Portal)=>{PopoverPrimitive_Portal($$anchor2,spread_props(()=>restProps))}),append($$anchor,fragment)}function Popover_content($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),sideOffset=prop($$props,"sideOffset",3,4),align=prop($$props,"align",3,"center"),collisionPadding=prop($$props,"collisionP\
+adding",3,8),avoidCollisions=prop($$props,"avoidCollisions",3,!0),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","sideOffset","side","align","collisionPadding","avoidCollisions","portalProps"]);Popover_portal($$anchor,spread_props(()=>$$props.portalProps,{children:($$anchor2,$$slotProps)=>{var fragment_1=comment$2(),node2=first_child(fragment_1);{let $0=user_derived(()=>cn$1("z-50 w-72 origin-(--bits-popover-content-transform-origin) rounded-md border bg-popover p-4 \
+text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",$$props.class));component(node2,()=>Popover_content$1,($$anchor3,PopoverPrimitive_Content)=>{PopoverPrimitive_Content(
+$$anchor3,spread_props({"data-slot":"popover-content",get sideOffset(){return sideOffset()},get side(){return $$props.side},get align(){return align()},get collisionPadding(){return collisionPadding()},get avoidCollisions(){return avoidCollisions()},get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor2,fragment_1)},$$slots:{default:!0}})),pop()}function Popover_trigger($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,
+"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("",$$props.class));component(node2,()=>Popover_trigger$1,($$anchor2,PopoverPrimitive_Trigger)=>{PopoverPrimitive_Trigger($$anchor2,spread_props({"data-slot":"popover-trigger",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}var root_2$U=from_html(
+'<span class="sr-only"> </span>'),root_1$D=from_html("<!> <!>",1);function ChatFormPickerPopover($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),isOpen=prop($$props,"isOpen",15,!1),srLabel=prop($$props,"srLabel",3,"Open picker");var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Popover,($$anchor2,Popover_Root)=>{Popover_Root($$anchor2,{onOpenChange:open2=>{open2||$$props.onClose?.()},get open(){return isOpen()},set open($$value){isOpen($$value)},
+children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$D(),node_1=first_child(fragment_1);component(node_1,()=>Popover_trigger,($$anchor4,Popover_Trigger)=>{Popover_Trigger($$anchor4,{class:"pointer-events-none absolute inset-0 opacity-0",tabindex:-1,"aria-hidden":"true",children:($$anchor5,$$slotProps2)=>{var span=root_2$U(),text2=child(span,!0);reset(span),template_effect(()=>set_text(text2,srLabel())),append($$anchor5,span)},$$slots:{default:!0}})});var node_2=sibling(node_1,2);component(node_2,
+()=>Popover_content,($$anchor4,Popover_Content)=>{Popover_Content($$anchor4,{side:"top",align:"start",sideOffset:12,get class(){return`w-[var(--bits-popover-anchor-width)] max-w-none rounded-xl border-border/50 p-0 shadow-xl ${className()??""}`},get onkeydown(){return $$props.onKeydown},onOpenAutoFocus:event2=>event2.preventDefault(),children:($$anchor5,$$slotProps2)=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);snippet(node_3,()=>$$props.children),append($$anchor5,fragment_2)},$$slots:{
+default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_2$T=from_html('<div class="absolute top-0 right-0 left-0 z-10 p-2 pb-0"><!></div>'),root_5$q=from_html('<div class="py-6 text-center text-sm text-muted-foreground"> </div>'),root_1$C=from_html("<!> <div><!></div> <!>",1);function ChatFormPickerList($$anchor,$$props){push$1($$props,!0);let searchQuery=prop($$props,"searchQuery",15),searchPlaceholder=prop($$props,"searchPlaceholder",3,"S\
+earch..."),emptyMessage=prop($$props,"emptyMessage",3,"No items available"),listContainer=state$1(null);user_effect(()=>{if(get$3(listContainer)&&$$props.selectedIndex>=0&&$$props.selectedIndex<$$props.items.length){const selectedElement=get$3(listContainer).querySelector(`[data-picker-index="${$$props.selectedIndex}"]`);selectedElement&&selectedElement.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}}),Scroll_area($$anchor,{children:($$anchor2,$$slotProps)=>{var fragment_1=root_1$C(),
+node2=first_child(fragment_1);{var consequent=$$anchor3=>{var div=root_2$T(),node_1=child(div);SearchInput(node_1,{get placeholder(){return searchPlaceholder()},get value(){return searchQuery()},set value($$value){searchQuery($$value)}}),reset(div),append($$anchor3,div)};if_block(node2,$$render=>{$$props.showSearchInput&&$$render(consequent)})}var div_1=sibling(node2,2),node_2=child(div_1);{var consequent_2=$$anchor3=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);{var consequent_1=$$anchor4=>{
+var fragment_3=comment$2(),node_4=first_child(fragment_3);snippet(node_4,()=>$$props.skeleton),append($$anchor4,fragment_3)};if_block(node_3,$$render=>{$$props.skeleton&&$$render(consequent_1)})}append($$anchor3,fragment_2)},consequent_3=$$anchor3=>{var div_2=root_5$q(),text2=child(div_2,!0);reset(div_2),template_effect(()=>set_text(text2,emptyMessage())),append($$anchor3,div_2)},alternate=$$anchor3=>{var fragment_4=comment$2(),node_5=first_child(fragment_4);each(node_5,19,()=>$$props.items,(itemData,index2)=>$$props.
+itemKey(itemData,index2),($$anchor4,itemData,index2)=>{var fragment_5=comment$2(),node_6=first_child(fragment_5);snippet(node_6,()=>$$props.item,()=>get$3(itemData),()=>get$3(index2),()=>get$3(index2)===$$props.selectedIndex),append($$anchor4,fragment_5)}),append($$anchor3,fragment_4)};if_block(node_2,$$render=>{$$props.isLoading?$$render(consequent_2):$$props.items.length===0?$$render(consequent_3,1):$$render(alternate,-1)})}reset(div_1),bind_this(div_1,$$value=>set$1(listContainer,$$value),()=>get$3(
+listContainer));var node_7=sibling(div_1,2);{var consequent_4=$$anchor3=>{var fragment_6=comment$2(),node_8=first_child(fragment_6);snippet(node_8,()=>$$props.footer),append($$anchor3,fragment_6)};if_block(node_7,$$render=>{$$props.footer&&$$render(consequent_4)})}template_effect(()=>set_class(div_1,1,clsx([`${CHAT_FORM_POPOVER_MAX_HEIGHT} p-2`,$$props.showSearchInput&&"pt-13"]))),append($$anchor2,fragment_1)},$$slots:{default:!0}}),pop()}var root$1i=from_html('<button type="button"><!></button>');
+function ChatFormPickerListItem($$anchor,$$props){let isSelected=prop($$props,"isSelected",3,!1);var button=root$1i(),node2=child(button);snippet(node2,()=>$$props.children),reset(button),template_effect(()=>{set_attribute(button,"data-picker-index",$$props.dataIndex),set_class(button,1,`flex w-full cursor-pointer items-start gap-3 rounded-lg px-3 py-2 text-left hover:bg-accent/50 ${isSelected()?"bg-accent/50":""}`)}),delegated("click",button,function(...$$args){$$props.onclick?.apply(this,$$args)}),
+append($$anchor,button)}delegate(["click"]);var root_1$B=from_html('<img alt="" class="h-3 w-3 shrink-0 rounded-sm"/>'),root_3$K=from_html('<p class="mt-0.5 truncate text-sm text-muted-foreground"> </p>'),root$1h=from_html('<div class="min-w-0 flex-1"><div class="mb-0.5 flex items-center gap-1.5 text-xs text-muted-foreground"><!> <span> </span></div> <div class="flex items-center gap-2"><span class="font-medium"> </span> <!></div> <!> <!></div>');function ChatFormPickerItemHeader($$anchor,$$props){
+push$1($$props,!0);let faviconUrl=user_derived(()=>$$props.server?mcpStore.getServerFavicon($$props.server.id):null);var div=root$1h(),div_1=child(div),node2=child(div_1);{var consequent=$$anchor2=>{var img=root_1$B();template_effect(()=>set_attribute(img,"src",get$3(faviconUrl))),event("error",img,e=>{e.currentTarget.style.display="none"}),replay_events(img),append($$anchor2,img)};if_block(node2,$$render=>{get$3(faviconUrl)&&$$render(consequent)})}var span=sibling(node2,2),text2=child(span,!0);
+reset(span),reset(div_1);var div_2=sibling(div_1,2),span_1=child(div_2),text_1=child(span_1,!0);reset(span_1);var node_1=sibling(span_1,2);{var consequent_1=$$anchor2=>{var fragment=comment$2(),node_2=first_child(fragment);snippet(node_2,()=>$$props.titleExtra),append($$anchor2,fragment)};if_block(node_1,$$render=>{$$props.titleExtra&&$$render(consequent_1)})}reset(div_2);var node_3=sibling(div_2,2);{var consequent_2=$$anchor2=>{var p2=root_3$K(),text_2=child(p2,!0);reset(p2),template_effect(()=>set_text(
+text_2,$$props.description)),append($$anchor2,p2)};if_block(node_3,$$render=>{$$props.description&&$$render(consequent_2)})}var node_4=sibling(node_3,2);{var consequent_3=$$anchor2=>{var fragment_1=comment$2(),node_5=first_child(fragment_1);snippet(node_5,()=>$$props.subtitle),append($$anchor2,fragment_1)};if_block(node_4,$$render=>{$$props.subtitle&&$$render(consequent_3)})}reset(div),template_effect(()=>{set_text(text2,$$props.serverLabel),set_text(text_1,$$props.title)}),append($$anchor,div),
+pop()}var root_1$A=from_html('<div class="h-4 w-12 animate-pulse rounded-full bg-muted"></div>'),root$1g=from_html('<div class="flex w-full items-start gap-3 rounded-lg px-3 py-2"><div class="min-w-0 flex-1 space-y-2"><div class="mb-2 flex items-center gap-1.5"><div class="h-3 w-3 shrink-0 animate-pulse rounded-sm bg-muted"></div> <div class="h-3 w-24 animate-pulse rounded bg-muted"></div></div> <div class="flex items-center gap-2"><div></div> <!></div> <div class="h-3 w-full animate-pulse round\
+ed bg-muted"></div></div></div>');function ChatFormPickerListItemSkeleton($$anchor,$$props){let titleWidth=prop($$props,"titleWidth",3,"w-48"),showBadge=prop($$props,"showBadge",3,!1);var div=root$1g(),div_1=child(div),div_2=sibling(child(div_1),2),div_3=child(div_2),node2=sibling(div_3,2);{var consequent=$$anchor2=>{var div_4=root_1$A();append($$anchor2,div_4)};if_block(node2,$$render=>{showBadge()&&$$render(consequent)})}reset(div_2),next$1(2),reset(div_1),reset(div),template_effect(()=>set_class(
+div_3,1,`h-4 ${titleWidth()??""} animate-pulse rounded bg-muted`)),append($$anchor,div)}var root_5$p=from_html('<span class="inline-flex items-center rounded-full bg-primary/10 px-1.5 py-0.5 text-[10px] font-medium text-primary">attached</span>'),root_6$q=from_html('<p class="mt-0.5 truncate text-xs text-muted-foreground/60"> </p>'),root_10$a=from_html("<!> Browse all",1);function ChatFormPickerMcpResources($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),isOpen=prop(
+$$props,"isOpen",7,!1),searchQuery=prop($$props,"searchQuery",3,""),resources=state$1(proxy([])),isLoading2=state$1(!1),selectedIndex=state$1(0),internalSearchQuery=state$1(""),serverSettingsMap=user_derived(()=>{const servers=mcpStore.getServers(),map2=new SvelteMap;for(const server of servers)map2.set(server.id,server);return map2});user_effect(()=>{isOpen()&&(loadResources(),set$1(selectedIndex,0))}),user_effect(()=>{get$3(filteredResources).length>0&&get$3(selectedIndex)>=get$3(filteredResources).
+length&&set$1(selectedIndex,0)});async function loadResources(){set$1(isLoading2,!0);try{const perChatOverrides=conversationsStore.getAllMcpServerOverrides();if(!await mcpStore.ensureInitialized(perChatOverrides)){set$1(resources,[],!0);return}await mcpStore.fetchAllResources(),set$1(resources,mcpResourceStore.getAllResourceInfos(),!0)}catch(error2){console.error("[ChatFormPickerMcpResources] Failed to load resources:",error2),set$1(resources,[],!0)}finally{set$1(isLoading2,!1)}}function handleResourceClick(resource){
+mcpStore.attachResource(resource.uri),$$props.onResourceSelect?.(resource),$$props.onClose?.()}function isResourceAttached(uri2){return mcpResourceStore.isAttached(uri2)}function handleKeydown(event2){return isOpen()?event2.key===KeyboardKey.ESCAPE?(event2.preventDefault(),$$props.onClose?.(),!0):event2.key===KeyboardKey.ARROW_DOWN?(event2.preventDefault(),get$3(filteredResources).length>0&&set$1(selectedIndex,(get$3(selectedIndex)+1)%get$3(filteredResources).length),!0):event2.key===KeyboardKey.
+ARROW_UP?(event2.preventDefault(),get$3(filteredResources).length>0&&set$1(selectedIndex,get$3(selectedIndex)===0?get$3(filteredResources).length-1:get$3(selectedIndex)-1,!0),!0):event2.key===KeyboardKey.ENTER?(event2.preventDefault(),get$3(filteredResources)[get$3(selectedIndex)]&&handleResourceClick(get$3(filteredResources)[get$3(selectedIndex)]),!0):!1:!1}let filteredResources=user_derived(()=>{const sortedServers=mcpStore.getServersSorted(),serverOrderMap=new Map(sortedServers.map((server,index2)=>[
+server.id,index2])),sortedResources=[...get$3(resources)].sort((a,b)=>{const orderA=serverOrderMap.get(a.serverName)??Number.MAX_SAFE_INTEGER,orderB=serverOrderMap.get(b.serverName)??Number.MAX_SAFE_INTEGER;return orderA-orderB}),query=(searchQuery()||get$3(internalSearchQuery)).toLowerCase();return query?sortedResources.filter(resource=>resource.name.toLowerCase().includes(query)||resource.title?.toLowerCase().includes(query)||resource.description?.toLowerCase().includes(query)||resource.uri.toLowerCase().
+includes(query)):sortedResources}),showSearchInput=user_derived(()=>get$3(resources).length>3);var $$exports={handleKeydown};return ChatFormPickerPopover($$anchor,{get class(){return className()},srLabel:"Open resource picker",get onClose(){return $$props.onClose},onKeydown:handleKeydown,get isOpen(){return isOpen()},set isOpen($$value){isOpen($$value)},children:($$anchor2,$$slotProps)=>{ChatFormPickerList($$anchor2,{get items(){return get$3(filteredResources)},get isLoading(){return get$3(isLoading2)},
+get selectedIndex(){return get$3(selectedIndex)},get showSearchInput(){return get$3(showSearchInput)},searchPlaceholder:"Search resources...",emptyMessage:"No MCP resources available",itemKey:resource=>resource.serverName+":"+resource.uri,get searchQuery(){return get$3(internalSearchQuery)},set searchQuery($$value){set$1(internalSearchQuery,$$value,!0)},item:($$anchor3,resource=noop$3,index2=noop$3,isSelected=noop$3)=>{const server=user_derived(()=>get$3(serverSettingsMap).get(resource().serverName)),
+serverLabel=user_derived(()=>get$3(server)?mcpStore.getServerLabel(get$3(server)):resource().serverName);ChatFormPickerListItem($$anchor3,{get dataIndex(){return index2()},get isSelected(){return isSelected()},onclick:()=>handleResourceClick(resource()),children:($$anchor4,$$slotProps2)=>{{const titleExtra=$$anchor5=>{var fragment_4=comment$2(),node2=first_child(fragment_4);{var consequent=$$anchor6=>{var span=root_5$p();append($$anchor6,span)},d2=user_derived(()=>isResourceAttached(resource().uri));
+if_block(node2,$$render=>{get$3(d2)&&$$render(consequent)})}append($$anchor5,fragment_4)},subtitle=$$anchor5=>{var p2=root_6$q(),text2=child(p2,!0);reset(p2),template_effect(()=>set_text(text2,resource().uri)),append($$anchor5,p2)};let $0=user_derived(()=>resource().title||resource().name);ChatFormPickerItemHeader($$anchor4,{get server(){return get$3(server)},get serverLabel(){return get$3(serverLabel)},get title(){return get$3($0)},get description(){return resource().description},titleExtra,subtitle,
+$$slots:{titleExtra:!0,subtitle:!0}})}},$$slots:{default:!0}})},skeleton:$$anchor3=>{ChatFormPickerListItemSkeleton($$anchor3,{})},footer:$$anchor3=>{var fragment_6=comment$2(),node_1=first_child(fragment_6);{var consequent_1=$$anchor4=>{Button($$anchor4,{class:"fixed right-3 bottom-3",type:"button",get onclick(){return $$props.onBrowse},variant:"secondary",size:"sm",children:($$anchor5,$$slotProps2)=>{var fragment_8=root_10$a(),node_2=first_child(fragment_8);Folder_open(node_2,{class:"h-3 w-3"}),
+next$1(),append($$anchor5,fragment_8)},$$slots:{default:!0}})};if_block(node_1,$$render=>{$$props.onBrowse&&get$3(resources).length>3&&$$render(consequent_1)})}append($$anchor3,fragment_6)},$$slots:{item:!0,skeleton:!0,footer:!0}})},$$slots:{default:!0}}),pop($$exports)}var root$1f=from_html("<!> <!>",1);function ChatFormPickers($$anchor,$$props){push$1($$props,!0);let promptPickerRef=state$1(void 0),resourcePickerRef=state$1(void 0);function handleKeydown(event2){return!!($$props.isPromptPickerOpen&&
+get$3(promptPickerRef)?.handleKeydown(event2)||$$props.isInlineResourcePickerOpen&&get$3(resourcePickerRef)?.handleKeydown(event2))}var $$exports={handleKeydown},fragment=root$1f(),node2=first_child(fragment);bind_this(ChatFormPickerMcpPrompts(node2,{get isOpen(){return $$props.isPromptPickerOpen},get searchQuery(){return $$props.promptSearchQuery},get onClose(){return $$props.onPromptPickerClose},get onPromptLoadStart(){return $$props.onPromptLoadStart},get onPromptLoadComplete(){return $$props.
+onPromptLoadComplete},get onPromptLoadError(){return $$props.onPromptLoadError}}),$$value=>set$1(promptPickerRef,$$value,!0),()=>get$3(promptPickerRef));var node_1=sibling(node2,2);return bind_this(ChatFormPickerMcpResources(node_1,{get isOpen(){return $$props.isInlineResourcePickerOpen},get searchQuery(){return $$props.resourceSearchQuery},get onClose(){return $$props.onInlineResourcePickerClose},get onResourceSelect(){return $$props.onInlineResourceSelect},get onBrowse(){return $$props.onInlineResourceBrowse}}),
+$$value=>set$1(resourcePickerRef,$$value,!0),()=>get$3(resourcePickerRef)),append($$anchor,fragment),pop($$exports)}const MESSAGE_EDIT_KEY=Symbol.for(CONTEXT_KEY_MESSAGE_EDIT);function setMessageEditContext(ctx){return setContext(MESSAGE_EDIT_KEY,ctx)}function getMessageEditContext(){return getContext(MESSAGE_EDIT_KEY)}const CHAT_ACTIONS_KEY=Symbol.for(CONTEXT_KEY_CHAT_ACTIONS);function setChatActionsContext(ctx){return setContext(CHAT_ACTIONS_KEY,ctx)}function getChatActionsContext(){return getContext(
+CHAT_ACTIONS_KEY)}const CHAT_SETTINGS_CONFIG_KEY=Symbol.for(CONTEXT_KEY_CHAT_SETTINGS_CONFIG);function setChatSettingsConfigContext(ctx){return setContext(CHAT_SETTINGS_CONFIG_KEY,ctx)}const PROCESSING_INFO_KEY=Symbol.for(CONTEXT_KEY_PROCESSING_INFO);function setProcessingInfoContext(ctx){return setContext(PROCESSING_INFO_KEY,ctx)}function getProcessingInfoContext(){return getContext(PROCESSING_INFO_KEY)}var root$1e=from_html("<!> <!>",1);function ChatMessages($$anchor,$$props){push$1($$props,!0);
+let messages=prop($$props,"messages",19,()=>[]),allConversationMessages=state$1(proxy([]));const currentConfig=config$1();setChatActionsContext({copy:async message=>{const asPlainText=!!currentConfig.copyTextAttachmentsAsPlainText,clipboardContent=formatMessageForClipboard(message.content,message.extra,asPlainText);await copyToClipboard(clipboardContent,"Message copied to clipboard")},delete:async message=>{await chatStore.deleteMessage(message.id),refreshAllMessages()},navigateToSibling:async siblingId=>{
+await conversationsStore.navigateToSibling(siblingId)},editWithBranching:async(message,newContent,newExtras)=>{$$props.onUserAction?.(),await chatStore.editMessageWithBranching(message.id,newContent,newExtras),refreshAllMessages()},editWithReplacement:async(message,newContent,shouldBranch)=>{$$props.onUserAction?.(),await chatStore.editAssistantMessage(message.id,newContent,shouldBranch),refreshAllMessages()},editUserMessagePreserveResponses:async(message,newContent,newExtras)=>{$$props.onUserAction?.(),
+await chatStore.editUserMessagePreserveResponses(message.id,newContent,newExtras),refreshAllMessages()},regenerateWithBranching:async(message,modelOverride)=>{$$props.onUserAction?.(),await chatStore.regenerateMessageWithBranching(message.id,modelOverride),refreshAllMessages()},continueAssistantMessage:async message=>{$$props.onUserAction?.(),await chatStore.continueAssistantMessage(message.id),refreshAllMessages()},forkConversation:async(message,options)=>{await conversationsStore.forkConversation(
+message.id,options)}});function refreshAllMessages(){const conversation=activeConversation();conversation?conversationsStore.getConversationMessages(conversation.id).then(messages2=>{set$1(allConversationMessages,messages2,!0)}):set$1(allConversationMessages,[],!0)}user_effect(()=>{activeConversation()&&refreshAllMessages()});let displayMessages=user_derived(()=>{if(!messages().length)return[];const filteredMessages=currentConfig.showSystemMessage?messages():messages().filter(msg=>msg.type!==MessageRole.
+SYSTEM),result=[];for(let i=0;i<filteredMessages.length;i++){const msg=filteredMessages[i];if(msg.role===MessageRole.TOOL)continue;const toolMessages=[];if(msg.role===MessageRole.ASSISTANT&&hasAgenticContent(msg)){let j=i+1;for(;j<filteredMessages.length;){const next2=filteredMessages[j];if(next2.role===MessageRole.TOOL)toolMessages.push(next2),j++;else if(next2.role===MessageRole.ASSISTANT)toolMessages.push(next2),j++;else break}i=j-1}else if(msg.role===MessageRole.ASSISTANT){let j=i+1;for(;j<filteredMessages.
+length&&filteredMessages[j].role===MessageRole.TOOL;)toolMessages.push(filteredMessages[j]),j++}const siblingInfo=getMessageSiblings(get$3(allConversationMessages),msg.id);result.push({message:msg,toolMessages,isLastAssistantMessage:!1,siblingInfo:siblingInfo||{message:msg,siblingIds:[msg.id],currentIndex:0,totalSiblings:1}})}for(let i=result.length-1;i>=0;i--)if(result[i].message.role===MessageRole.ASSISTANT){result[i].isLastAssistantMessage=!0;break}return result});var fragment=root$1e(),node2=first_child(
+fragment);each(node2,17,()=>get$3(displayMessages),({message,toolMessages,isLastAssistantMessage,siblingInfo})=>message.id,($$anchor2,$$item)=>{let message=()=>get$3($$item).message,toolMessages=()=>get$3($$item).toolMessages,isLastAssistantMessage=()=>get$3($$item).isLastAssistantMessage,siblingInfo=()=>get$3($$item).siblingInfo;ChatMessage($$anchor2,{class:"mx-auto mt-12 w-full max-w-[48rem]",get message(){return message()},get toolMessages(){return toolMessages()},get isLastAssistantMessage(){
+return isLastAssistantMessage()},get siblingInfo(){return siblingInfo()}})});var node_1=sibling(node2,2);{var consequent_1=$$anchor2=>{const convId=user_derived(()=>activeConversation().id),pendingContent=user_derived(()=>agenticPendingSteeringMessageContent(get$3(convId)));var fragment_2=comment$2(),node_2=first_child(fragment_2);{var consequent=$$anchor3=>{{let $0=user_derived(()=>agenticPendingSteeringMessageExtras(get$3(convId)));ChatMessageUserPending($$anchor3,{class:"mx-auto mt-12 w-full \
+max-w-[48rem]",get content(){return get$3(pendingContent)},get extras(){return get$3($0)},onSendImmediately:()=>chatStore.abortCurrentFlow(get$3(convId)),onEdit:(newContent,extras)=>agenticInjectSteeringMessage(get$3(convId),newContent,extras),onDelete:()=>agenticClearSteeringMessage(get$3(convId))})}};if_block(node_2,$$render=>{get$3(pendingContent)&&$$render(consequent)})}append($$anchor2,fragment_2)},d2=user_derived(()=>activeConversation()&&agenticPendingSteeringMessageContent(activeConversation().
+id)),consequent_3=$$anchor2=>{const convId=user_derived(()=>activeConversation().id),pendingContent=user_derived(()=>chatPendingMessageContent(get$3(convId)));var fragment_4=comment$2(),node_3=first_child(fragment_4);{var consequent_2=$$anchor3=>{{let $0=user_derived(()=>chatPendingMessageExtras(get$3(convId)));ChatMessageUserPending($$anchor3,{class:"mx-auto mt-12 w-full max-w-[48rem]",get content(){return get$3(pendingContent)},get extras(){return get$3($0)},onSendImmediately:()=>chatStore.abortCurrentFlow(
+get$3(convId)),onEdit:(newContent,extras)=>chatInjectPendingMessage(get$3(convId),newContent,extras),onDelete:()=>chatClearPendingMessage(get$3(convId))})}};if_block(node_3,$$render=>{get$3(pendingContent)&&$$render(consequent_2)})}append($$anchor2,fragment_4)},d_12=user_derived(()=>activeConversation()&&chatPendingMessageContent(activeConversation().id));if_block(node_1,$$render=>{get$3(d2)?$$render(consequent_1):get$3(d_12)&&$$render(consequent_3,1)})}append($$anchor,fragment),pop()}function isElementInViewport(node2){
+const rect=node2.getBoundingClientRect();return rect.top<window.innerHeight&&rect.bottom>0&&rect.left<window.innerWidth&&rect.right>0}function fadeInView(node2,options={}){const{duration:duration2=300,y=0,skipIfVisible=!1}=options;skipIfVisible&&isElementInViewport(node2)||(node2.style.opacity="0",node2.style.transform=`translateY(${y}px)`,node2.style.transition=`opacity ${duration2}ms ease-out, transform ${duration2}ms ease-out`,user_effect(()=>{const observer=new IntersectionObserver(entries=>{
+for(const entry of entries)entry.isIntersecting&&(requestAnimationFrame(()=>{node2.style.opacity="1",node2.style.transform="translateY(0)"}),observer.disconnect())},{threshold:.05});return observer.observe(node2),()=>{observer.disconnect()}}))}var root$1d=from_html("<div><!></div>");function ChatMessage($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),toolMessages=prop($$props,"toolMessages",19,()=>[]),isLastAssistantMessage=prop($$props,"isLastAssistantMessage",3,!1),
+siblingInfo=prop($$props,"siblingInfo",3,null);const chatActions=getChatActionsContext();let deletionInfo=state$1(null),editedContent=user_derived(()=>$$props.message.content),rawEditContent=user_derived(()=>{if($$props.message.role!==MessageRole.ASSISTANT)return;const sections=deriveAgenticSections($$props.message,toolMessages(),[],!1),parts=[];for(const section2 of sections)switch(section2.type){case AgenticSectionType.REASONING:case AgenticSectionType.REASONING_PENDING:parts.push(`${REASONING_TAGS.
+START}
${section2.content}
${REASONING_TAGS.END}`);break;case AgenticSectionType.TEXT:parts.push(section2.content);break;case AgenticSectionType.TOOL_CALL:case AgenticSectionType.TOOL_CALL_PENDING:case AgenticSectionType.TOOL_CALL_STREAMING:{const callObj={name:section2.toolName};if(section2.toolArgs)try{callObj.arguments=JSON.parse(section2.toolArgs)}catch{callObj.arguments=section2.toolArgs}parts.push(JSON.stringify(callObj,null,2)),section2.toolResult&&parts.push(`[Tool Result]
${section2.toolResult}`);break}}return parts.join(`
$$props.message)}function handleForkConversation(options){chatActions.forkConversation($$props.message,options)}function handleNavigateToSibling(siblingId){chatActions.navigateToSibling(siblingId)}async function handleSaveEdit(){if($$props.message.role===MessageRole.SYSTEM){const newContent=get$3(editedContent).trim();if(!newContent){const conversationDeleted=await chatStore.removeSystemPromptPlaceholder($$props.message.id);set$1(isEditing2,!1),conversationDeleted&&goto("#/");return}await DatabaseService.
updateMessage($$props.message.id,{content:newContent});const index2=conversationsStore.findMessageIndex($$props.message.id);index2!==-1&&conversationsStore.updateMessageAtIndex(index2,{content:newContent})}else if($$props.message.role===MessageRole.USER){const finalExtras=await getMergedExtras();chatActions.editWithBranching($$props.message,get$3(editedContent).trim(),finalExtras)}else chatActions.editWithReplacement($$props.message,get$3(editedContent),get$3(shouldBranchAfterEdit));set$1(isEditing2,
!1),set$1(shouldBranchAfterEdit,!1),set$1(editedUploadedFiles,[],!0)}async function handleSaveEditOnly(){if($$props.message.role===MessageRole.USER){const finalExtras=await getMergedExtras();chatActions.editUserMessagePreserveResponses($$props.message,get$3(editedContent).trim(),finalExtras)}set$1(isEditing2,!1),set$1(editedUploadedFiles,[],!0)}async function getMergedExtras(){if(get$3(editedUploadedFiles).length===0)return get$3(editedExtras);const plainFiles=snapshot(get$3(editedUploadedFiles)),
-newExtras=(await parseFilesToMessageExtras(plainFiles))?.extras||[];return[...get$3(editedExtras),...newExtras]}function handleShowDeleteDialogChange(show){set$1(showDeleteDialog,show,!0)}var div=root$1c(),node2=child(div);{var consequent=$$anchor2=>{ChatMessageSystem($$anchor2,{get class(){return className()},get deletionInfo(){return get$3(deletionInfo)},get message(){return $$props.message},onConfirmDelete:handleConfirmDelete,onCopy:handleCopy,onDelete:handleDelete2,onEdit:handleEdit,onNavigateToSibling:handleNavigateToSibling,
+newExtras=(await parseFilesToMessageExtras(plainFiles))?.extras||[];return[...get$3(editedExtras),...newExtras]}function handleShowDeleteDialogChange(show){set$1(showDeleteDialog,show,!0)}var div=root$1d(),node2=child(div);{var consequent=$$anchor2=>{ChatMessageSystem($$anchor2,{get class(){return className()},get deletionInfo(){return get$3(deletionInfo)},get message(){return $$props.message},onConfirmDelete:handleConfirmDelete,onCopy:handleCopy,onDelete:handleDelete2,onEdit:handleEdit,onNavigateToSibling:handleNavigateToSibling,
onShowDeleteDialogChange:handleShowDeleteDialogChange,get showDeleteDialog(){return get$3(showDeleteDialog)},get siblingInfo(){return siblingInfo()},get textareaElement(){return get$3(textareaElement)},set textareaElement($$value){set$1(textareaElement,$$value,!0)}})},consequent_1=$$anchor2=>{ChatMessageMcpPrompt($$anchor2,{get class(){return className()},get deletionInfo(){return get$3(deletionInfo)},get message(){return $$props.message},get mcpPrompt(){return get$3(mcpPromptExtra)},onConfirmDelete:handleConfirmDelete,
onCopy:handleCopy,onDelete:handleDelete2,onEdit:handleEdit,onNavigateToSibling:handleNavigateToSibling,onShowDeleteDialogChange:handleShowDeleteDialogChange,get showDeleteDialog(){return get$3(showDeleteDialog)},get siblingInfo(){return siblingInfo()}})},consequent_2=$$anchor2=>{ChatMessageUser($$anchor2,{get class(){return className()},get deletionInfo(){return get$3(deletionInfo)},get message(){return $$props.message},onConfirmDelete:handleConfirmDelete,onCopy:handleCopy,onDelete:handleDelete2,
onEdit:handleEdit,onForkConversation:handleForkConversation,onNavigateToSibling:handleNavigateToSibling,onShowDeleteDialogChange:handleShowDeleteDialogChange,get showDeleteDialog(){return get$3(showDeleteDialog)},get siblingInfo(){return siblingInfo()}})},alternate=$$anchor2=>{ChatMessageAssistant($$anchor2,{get class(){return className()},get deletionInfo(){return get$3(deletionInfo)},get isLastAssistantMessage(){return isLastAssistantMessage()},get message(){return $$props.message},get toolMessages(){
return toolMessages()},get messageContent(){return $$props.message.content},onConfirmDelete:handleConfirmDelete,onContinue:handleContinue,onCopy:handleCopy,onDelete:handleDelete2,onEdit:handleEdit,onForkConversation:handleForkConversation,onNavigateToSibling:handleNavigateToSibling,onRegenerate:handleRegenerate,onShowDeleteDialogChange:handleShowDeleteDialogChange,get showDeleteDialog(){return get$3(showDeleteDialog)},get siblingInfo(){return siblingInfo()},get textareaElement(){return get$3(textareaElement)},
-set textareaElement($$value){set$1(textareaElement,$$value,!0)}})};if_block(node2,$$render=>{$$props.message.role===MessageRole.SYSTEM?$$render(consequent):get$3(mcpPromptExtra)?$$render(consequent_1,1):$$props.message.role===MessageRole.USER?$$render(consequent_2,2):$$render(alternate,-1)})}reset(div),action(div,$$node=>fadeInView?.($$node)),append($$anchor,div),pop()}var root_2$T=from_html('<div class="agentic-text svelte-1uhcmx5"><!></div>'),root_7$n=from_html('<div class="rounded bg-muted/30\
- p-2 text-xs text-muted-foreground italic">Receiving arguments...</div>'),root_8$o=from_html('<div class="rounded bg-yellow-500/10 p-2 text-xs text-yellow-600 italic dark:text-yellow-400">Response was truncated</div>'),root_4$u=from_html('<div class="pt-3"><div class="my-3 flex items-center gap-2 text-xs text-muted-foreground"><span>Arguments:</span> <!></div> <!></div>'),root_11$b=from_html('<div class="pt-3"><div class="my-3 text-xs text-muted-foreground">Arguments:</div> <!></div>'),root_13$9=from_html(
-'<div class="rounded bg-muted/30 p-2 text-xs text-muted-foreground italic">Waiting for result...</div>'),root_16$2=from_html('<img class="mt-2 mb-2 h-auto max-w-full rounded-lg" loading="lazy"/>'),root_15$9=from_html('<div class="font-mono text-xs leading-relaxed whitespace-pre-wrap"> </div> <!>',1),root_14$5=from_html('<div class="overflow-auto rounded-lg border border-border bg-muted p-4"></div>'),root_17$5=from_html('<div class="rounded bg-muted/30 p-2 text-xs text-muted-foreground italic">No\
- output</div>'),root_10$a=from_html('<!> <div class="pt-3"><div class="my-3 flex items-center gap-2 text-xs text-muted-foreground"><span>Result:</span> <!></div> <!></div>',1),root_19$7=from_html('<div class="pt-3"><div class="text-xs leading-relaxed break-words whitespace-pre-wrap"> </div></div>'),root_21$3=from_html('<div class="pt-3"><div class="text-xs leading-relaxed break-words whitespace-pre-wrap"> </div></div>'),root_25$3=from_html('<div class="turn-stats svelte-1uhcmx5"><!></div>'),root_23$2=from_html(
-'<div class="agentic-turn my-2 hover:bg-muted/80 dark:hover:bg-muted/30 svelte-1uhcmx5"><span class="agentic-turn-label svelte-1uhcmx5"></span> <!> <!></div>'),root$1b=from_html('<div class="agentic-content svelte-1uhcmx5"><!> <!> <!></div>');function ChatMessageAgenticContent($$anchor,$$props){push$1($$props,!0);const renderSection=($$anchor2,section2=noop$3,index2=noop$3)=>{var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor3=>{var div=root_2$T(),node_1=child(div);{let $0=user_derived(
+set textareaElement($$value){set$1(textareaElement,$$value,!0)}})};if_block(node2,$$render=>{$$props.message.role===MessageRole.SYSTEM?$$render(consequent):get$3(mcpPromptExtra)?$$render(consequent_1,1):$$props.message.role===MessageRole.USER?$$render(consequent_2,2):$$render(alternate,-1)})}reset(div),action(div,$$node=>fadeInView?.($$node)),append($$anchor,div),pop()}var root_2$S=from_html('<div class="agentic-text svelte-1uhcmx5"><!></div>'),root_7$n=from_html('<div class="rounded bg-muted/30\
+ p-2 text-xs text-muted-foreground italic">Receiving arguments...</div>'),root_8$n=from_html('<div class="rounded bg-yellow-500/10 p-2 text-xs text-yellow-600 italic dark:text-yellow-400">Response was truncated</div>'),root_4$v=from_html('<div class="pt-3"><div class="my-3 flex items-center gap-2 text-xs text-muted-foreground"><span>Arguments:</span> <!></div> <!></div>'),root_11$b=from_html('<div class="pt-3"><div class="my-3 text-xs text-muted-foreground">Arguments:</div> <!></div>'),root_13$9=from_html(
+'<div class="rounded bg-muted/30 p-2 text-xs text-muted-foreground italic">Waiting for result...</div>'),root_16$2=from_html('<img class="mt-2 mb-2 h-auto max-w-full rounded-lg" loading="lazy"/>'),root_15$8=from_html('<div class="font-mono text-xs leading-relaxed whitespace-pre-wrap"> </div> <!>',1),root_14$5=from_html('<div class="overflow-auto rounded-lg border border-border bg-muted p-4"></div>'),root_17$6=from_html('<div class="rounded bg-muted/30 p-2 text-xs text-muted-foreground italic">No\
+ output</div>'),root_10$9=from_html('<!> <div class="pt-3"><div class="my-3 flex items-center gap-2 text-xs text-muted-foreground"><span>Result:</span> <!></div> <!></div>',1),root_19$7=from_html('<div class="pt-3"><div class="text-xs leading-relaxed break-words whitespace-pre-wrap"> </div></div>'),root_21$2=from_html('<div class="pt-3"><div class="text-xs leading-relaxed break-words whitespace-pre-wrap"> </div></div>'),root_25$3=from_html('<div class="turn-stats svelte-1uhcmx5"><!></div>'),root_23$3=from_html(
+'<div class="agentic-turn my-2 hover:bg-muted/80 dark:hover:bg-muted/30 svelte-1uhcmx5"><span class="agentic-turn-label svelte-1uhcmx5"></span> <!> <!></div>'),root$1c=from_html('<div class="agentic-content svelte-1uhcmx5"><!> <!> <!></div>');function ChatMessageAgenticContent($$anchor,$$props){push$1($$props,!0);const renderSection=($$anchor2,section2=noop$3,index2=noop$3)=>{var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor3=>{var div=root_2$S(),node_1=child(div);{let $0=user_derived(
()=>$$props.message?.extra);MarkdownContent(node_1,{get content(){return section2().content},get attachments(){return get$3($0)}})}reset(div),append($$anchor3,div)},consequent_4=$$anchor3=>{const streamingIcon=user_derived(()=>(isStreaming(),Loader_circle)),streamingIconClass=user_derived(()=>isStreaming()?"h-4 w-4 animate-spin":"h-4 w-4");{let $0=user_derived(()=>isExpanded(index2(),section2())),$1=user_derived(()=>section2().toolName||"Tool call"),$2=user_derived(()=>isStreaming()?"":"incomple\
-te");CollapsibleContentBlock($$anchor3,{get open(){return get$3($0)},class:"my-2",get icon(){return get$3(streamingIcon)},get iconClass(){return get$3(streamingIconClass)},get title(){return get$3($1)},get subtitle(){return get$3($2)},get isStreaming(){return isStreaming()},onToggle:()=>toggleExpanded(index2(),section2()),children:($$anchor4,$$slotProps)=>{var div_1=root_4$u(),div_2=child(div_1),node_2=sibling(child(div_2),2);{var consequent_1=$$anchor5=>{Loader_circle($$anchor5,{class:"h-3 w-3 \
-animate-spin"})};if_block(node_2,$$render=>{isStreaming()&&$$render(consequent_1)})}reset(div_2);var node_3=sibling(div_2,2);{var consequent_2=$$anchor5=>{{let $02=user_derived(()=>formatJsonPretty(section2().toolArgs));SyntaxHighlightedCode($$anchor5,{get code(){return get$3($02)},get language(){return FileTypeText.JSON},maxHeight:"20rem",class:"text-xs"})}},consequent_3=$$anchor5=>{var div_3=root_7$n();append($$anchor5,div_3)},alternate=$$anchor5=>{var div_4=root_8$o();append($$anchor5,div_4)};
+te");CollapsibleContentBlock($$anchor3,{get open(){return get$3($0)},class:"my-2",get icon(){return get$3(streamingIcon)},get iconClass(){return get$3(streamingIconClass)},get title(){return get$3($1)},get subtitle(){return get$3($2)},get isStreaming(){return isStreaming()},onToggle:()=>toggleExpanded(index2(),section2()),children:($$anchor4,$$slotProps)=>{var div_1=root_4$v(),div_2=child(div_1),node_2=sibling(child(div_2),2);{var consequent_1=$$anchor5=>{Loader_circle($$anchor5,{class:"h-3 w-3 \
+animate-spin"})};if_block(node_2,$$render=>{isStreaming()&&$$render(consequent_1)})}reset(div_2);var node_3=sibling(div_2,2);{var consequent_2=$$anchor5=>{{let $02=user_derived(()=>formatJsonPretty(section2().toolArgs));SyntaxHighlightedCode($$anchor5,{get code(){return get$3($02)},get language(){return FileTypeText.JSON},maxHeight:"20rem",class:"text-xs"})}},consequent_3=$$anchor5=>{var div_3=root_7$n();append($$anchor5,div_3)},alternate=$$anchor5=>{var div_4=root_8$n();append($$anchor5,div_4)};
if_block(node_3,$$render=>{section2().toolArgs?$$render(consequent_2):isStreaming()?$$render(consequent_3,1):$$render(alternate,-1)})}reset(div_1),append($$anchor4,div_1)},$$slots:{default:!0}})}},consequent_10=$$anchor3=>{const isPending=user_derived(()=>section2().type===AgenticSectionType.TOOL_CALL_PENDING),toolIcon=user_derived(()=>get$3(isPending)?Loader_circle:Wrench),toolIconClass=user_derived(()=>get$3(isPending)?"h-4 w-4 animate-spin":"h-4 w-4");{let $0=user_derived(()=>isExpanded(index2(),
-section2())),$1=user_derived(()=>section2().toolName||""),$2=user_derived(()=>get$3(isPending)?"executing...":void 0);CollapsibleContentBlock($$anchor3,{get open(){return get$3($0)},class:"my-2",get icon(){return get$3(toolIcon)},get iconClass(){return get$3(toolIconClass)},get title(){return get$3($1)},get subtitle(){return get$3($2)},get isStreaming(){return get$3(isPending)},onToggle:()=>toggleExpanded(index2(),section2()),children:($$anchor4,$$slotProps)=>{var fragment_5=root_10$a(),node_4=first_child(
+section2())),$1=user_derived(()=>section2().toolName||""),$2=user_derived(()=>get$3(isPending)?"executing...":void 0);CollapsibleContentBlock($$anchor3,{get open(){return get$3($0)},class:"my-2",get icon(){return get$3(toolIcon)},get iconClass(){return get$3(toolIconClass)},get title(){return get$3($1)},get subtitle(){return get$3($2)},get isStreaming(){return get$3(isPending)},onToggle:()=>toggleExpanded(index2(),section2()),children:($$anchor4,$$slotProps)=>{var fragment_5=root_10$9(),node_4=first_child(
fragment_5);{var consequent_5=$$anchor5=>{var div_5=root_11$b(),node_5=sibling(child(div_5),2);{let $02=user_derived(()=>formatJsonPretty(section2().toolArgs));SyntaxHighlightedCode(node_5,{get code(){return get$3($02)},get language(){return FileTypeText.JSON},maxHeight:"20rem",class:"text-xs"})}reset(div_5),append($$anchor5,div_5)};if_block(node_4,$$render=>{section2().toolArgs&§ion2().toolArgs!=="{}"&&$$render(consequent_5)})}var div_6=sibling(node_4,2),div_7=child(div_6),node_6=sibling(child(
-div_7),2);{var consequent_6=$$anchor5=>{Loader_circle($$anchor5,{class:"h-3 w-3 animate-spin"})};if_block(node_6,$$render=>{get$3(isPending)&&$$render(consequent_6)})}reset(div_7);var node_7=sibling(div_7,2);{var consequent_7=$$anchor5=>{var div_8=root_13$9();append($$anchor5,div_8)},consequent_9=$$anchor5=>{var div_9=root_14$5();each(div_9,21,()=>section2().parsedLines,index$2,($$anchor6,line)=>{var fragment_7=root_15$9(),div_10=first_child(fragment_7),text2=child(div_10,!0);reset(div_10);var node_8=sibling(
-div_10,2);{var consequent_8=$$anchor7=>{var img=root_16$2();template_effect(()=>{set_attribute(img,"src",get$3(line).image.base64Url),set_attribute(img,"alt",get$3(line).image.name)}),append($$anchor7,img)};if_block(node_8,$$render=>{get$3(line).image&&$$render(consequent_8)})}template_effect(()=>set_text(text2,get$3(line).text)),append($$anchor6,fragment_7)}),reset(div_9),append($$anchor5,div_9)},alternate_1=$$anchor5=>{var div_11=root_17$5();append($$anchor5,div_11)};if_block(node_7,$$render=>{
+div_7),2);{var consequent_6=$$anchor5=>{Loader_circle($$anchor5,{class:"h-3 w-3 animate-spin"})};if_block(node_6,$$render=>{get$3(isPending)&&$$render(consequent_6)})}reset(div_7);var node_7=sibling(div_7,2);{var consequent_7=$$anchor5=>{var div_8=root_13$9();append($$anchor5,div_8)},consequent_9=$$anchor5=>{var div_9=root_14$5();each(div_9,21,()=>section2().parsedLines,index$2,($$anchor6,line)=>{var fragment_7=root_15$8(),div_10=first_child(fragment_7),text2=child(div_10,!0);reset(div_10);var node_8=sibling(
+div_10,2);{var consequent_8=$$anchor7=>{var img=root_16$2();template_effect(()=>{set_attribute(img,"src",get$3(line).image.base64Url),set_attribute(img,"alt",get$3(line).image.name)}),append($$anchor7,img)};if_block(node_8,$$render=>{get$3(line).image&&$$render(consequent_8)})}template_effect(()=>set_text(text2,get$3(line).text)),append($$anchor6,fragment_7)}),reset(div_9),append($$anchor5,div_9)},alternate_1=$$anchor5=>{var div_11=root_17$6();append($$anchor5,div_11)};if_block(node_7,$$render=>{
get$3(isPending)?$$render(consequent_7):section2().toolResult?$$render(consequent_9,1):$$render(alternate_1,-1)})}reset(div_6),append($$anchor4,fragment_5)},$$slots:{default:!0}})}},consequent_11=$$anchor3=>{{let $0=user_derived(()=>isExpanded(index2(),section2()));CollapsibleContentBlock($$anchor3,{get open(){return get$3($0)},class:"my-2",get icon(){return Brain},title:"Reasoning",onToggle:()=>toggleExpanded(index2(),section2()),children:($$anchor4,$$slotProps)=>{var div_12=root_19$7(),div_13=child(
div_12),text_1=child(div_13,!0);reset(div_13),reset(div_12),template_effect(()=>set_text(text_1,section2().content)),append($$anchor4,div_12)},$$slots:{default:!0}})}},consequent_12=$$anchor3=>{const reasoningTitle=user_derived(()=>isStreaming()?"Reasoning...":"Reasoning"),reasoningSubtitle=user_derived(()=>isStreaming()?"":"incomplete");{let $0=user_derived(()=>isExpanded(index2(),section2()));CollapsibleContentBlock($$anchor3,{get open(){return get$3($0)},class:"my-2",get icon(){return Brain},
-get title(){return get$3(reasoningTitle)},get subtitle(){return get$3(reasoningSubtitle)},get isStreaming(){return isStreaming()},onToggle:()=>toggleExpanded(index2(),section2()),children:($$anchor4,$$slotProps)=>{var div_14=root_21$3(),div_15=child(div_14),text_2=child(div_15,!0);reset(div_15),reset(div_14),template_effect(()=>set_text(text_2,section2().content)),append($$anchor4,div_14)},$$slots:{default:!0}})}};if_block(node2,$$render=>{section2().type===AgenticSectionType.TEXT?$$render(consequent):
+get title(){return get$3(reasoningTitle)},get subtitle(){return get$3(reasoningSubtitle)},get isStreaming(){return isStreaming()},onToggle:()=>toggleExpanded(index2(),section2()),children:($$anchor4,$$slotProps)=>{var div_14=root_21$2(),div_15=child(div_14),text_2=child(div_15,!0);reset(div_15),reset(div_14),template_effect(()=>set_text(text_2,section2().content)),append($$anchor4,div_14)},$$slots:{default:!0}})}};if_block(node2,$$render=>{section2().type===AgenticSectionType.TEXT?$$render(consequent):
section2().type===AgenticSectionType.TOOL_CALL_STREAMING?$$render(consequent_4,1):section2().type===AgenticSectionType.TOOL_CALL||section2().type===AgenticSectionType.TOOL_CALL_PENDING?$$render(consequent_10,2):section2().type===AgenticSectionType.REASONING?$$render(consequent_11,3):section2().type===AgenticSectionType.REASONING_PENDING&&$$render(consequent_12,4)})}append($$anchor2,fragment)};let toolMessages=prop($$props,"toolMessages",19,()=>[]),isStreaming=prop($$props,"isStreaming",3,!1),isLastAssistantMessage=prop(
$$props,"isLastAssistantMessage",3,!1),highlightTurns=prop($$props,"highlightTurns",3,!1),expandedStates=proxy({});const showToolCallInProgress=user_derived(()=>config$1().showToolCallInProgress),showThoughtInProgress=user_derived(()=>config$1().showThoughtInProgress);let permissionDismissed=state$1(!1);const pendingPermission=user_derived(()=>isStreaming()&&isLastAssistantMessage()?agenticPendingPermissionRequest($$props.message.convId):null);let prevPendingRef=null;user_effect(()=>{get$3(pendingPermission)!==
prevPendingRef&&(prevPendingRef=get$3(pendingPermission),get$3(pendingPermission)&&set$1(permissionDismissed,!1))});function handlePermission(decision){set$1(permissionDismissed,!0),agenticResolvePermission($$props.message.convId,decision)}let continueDismissed=state$1(!1);const pendingContinue=user_derived(()=>isStreaming()&&isLastAssistantMessage()?agenticPendingContinueRequest($$props.message.convId):!1);let prevContinueRef=!1;user_effect(()=>{get$3(pendingContinue)!==prevContinueRef&&(prevContinueRef=
get$3(pendingContinue),get$3(pendingContinue)&&set$1(continueDismissed,!1))});function handleContinue(shouldContinue){set$1(continueDismissed,!0),agenticResolveContinue($$props.message.convId,shouldContinue)}const sections=user_derived(()=>deriveAgenticSections($$props.message,toolMessages(),[],isStreaming())),sectionsParsed=user_derived(()=>get$3(sections).map(section2=>({...section2,parsedLines:section2.toolResult?parseToolResultWithImages(section2.toolResult,section2.toolResultExtras||$$props.
message?.extra):[]}))),turnGroups=user_derived(()=>{const turns=[];let currentTurn=[],currentIndices=[],prevWasTool=!1;for(let i=0;i<get$3(sectionsParsed).length;i++){const section2=get$3(sectionsParsed)[i],isTool=section2.type===AgenticSectionType.TOOL_CALL||section2.type===AgenticSectionType.TOOL_CALL_PENDING||section2.type===AgenticSectionType.TOOL_CALL_STREAMING;!isTool&&prevWasTool&¤tTurn.length>0&&(turns.push({sections:currentTurn,flatIndices:currentIndices}),currentTurn=[],currentIndices=
[]),currentTurn.push(section2),currentIndices.push(i),prevWasTool=isTool}return currentTurn.length>0&&turns.push({sections:currentTurn,flatIndices:currentIndices}),turns});function getDefaultExpanded(section2){return section2.type===AgenticSectionType.TOOL_CALL_PENDING||section2.type===AgenticSectionType.TOOL_CALL_STREAMING?get$3(showToolCallInProgress):section2.type===AgenticSectionType.REASONING_PENDING?get$3(showThoughtInProgress):!1}function isExpanded(index2,section2){return expandedStates[index2]!==
-void 0?expandedStates[index2]:getDefaultExpanded(section2)}function toggleExpanded(index2,section2){const currentState=isExpanded(index2,section2);expandedStates[index2]=!currentState}function buildTurnAgenticTimings(stats){return{turns:1,toolCallsCount:stats.toolCalls.length,toolsMs:stats.toolsMs,toolCalls:stats.toolCalls,llm:stats.llm}}var div_16=root$1b(),node_9=child(div_16);{var consequent_14=$$anchor2=>{var fragment_10=comment$2(),node_10=first_child(fragment_10);each(node_10,17,()=>get$3(
-turnGroups),index$2,($$anchor3,turn,turnIndex)=>{const turnStats=user_derived(()=>$$props.message?.timings?.agentic?.perTurn?.[turnIndex]);var div_17=root_23$2(),span=child(div_17);span.textContent=`Turn ${turnIndex+1}`;var node_11=sibling(span,2);each(node_11,19,()=>get$3(turn).sections,(section2,sIdx)=>get$3(turn).flatIndices[sIdx],($$anchor4,section2,sIdx)=>{renderSection($$anchor4,()=>get$3(section2),()=>get$3(turn).flatIndices[get$3(sIdx)])});var node_12=sibling(node_11,2);{var consequent_13=$$anchor4=>{
+void 0?expandedStates[index2]:getDefaultExpanded(section2)}function toggleExpanded(index2,section2){const currentState=isExpanded(index2,section2);expandedStates[index2]=!currentState}function buildTurnAgenticTimings(stats){return{turns:1,toolCallsCount:stats.toolCalls.length,toolsMs:stats.toolsMs,toolCalls:stats.toolCalls,llm:stats.llm}}var div_16=root$1c(),node_9=child(div_16);{var consequent_14=$$anchor2=>{var fragment_10=comment$2(),node_10=first_child(fragment_10);each(node_10,17,()=>get$3(
+turnGroups),index$2,($$anchor3,turn,turnIndex)=>{const turnStats=user_derived(()=>$$props.message?.timings?.agentic?.perTurn?.[turnIndex]);var div_17=root_23$3(),span=child(div_17);span.textContent=`Turn ${turnIndex+1}`;var node_11=sibling(span,2);each(node_11,19,()=>get$3(turn).sections,(section2,sIdx)=>get$3(turn).flatIndices[sIdx],($$anchor4,section2,sIdx)=>{renderSection($$anchor4,()=>get$3(section2),()=>get$3(turn).flatIndices[get$3(sIdx)])});var node_12=sibling(node_11,2);{var consequent_13=$$anchor4=>{
var div_18=root_25$3(),node_13=child(div_18);{let $0=user_derived(()=>get$3(turnStats).toolCalls.length>0?buildTurnAgenticTimings(get$3(turnStats)):void 0);ChatMessageStatistics(node_13,{get promptTokens(){return get$3(turnStats).llm.prompt_n},get promptMs(){return get$3(turnStats).llm.prompt_ms},get predictedTokens(){return get$3(turnStats).llm.predicted_n},get predictedMs(){return get$3(turnStats).llm.predicted_ms},get agenticTimings(){return get$3($0)},get initialView(){return ChatMessageStatsView.
GENERATION},hideSummary:!0})}reset(div_18),append($$anchor4,div_18)};if_block(node_12,$$render=>{get$3(turnStats)&&$$render(consequent_13)})}reset(div_17),append($$anchor3,div_17)}),append($$anchor2,fragment_10)},alternate_2=$$anchor2=>{var fragment_12=comment$2(),node_14=first_child(fragment_12);each(node_14,17,()=>get$3(sectionsParsed),index$2,($$anchor3,section2,index2)=>{renderSection($$anchor3,()=>get$3(section2),()=>index2)}),append($$anchor2,fragment_12)};if_block(node_9,$$render=>{highlightTurns()&&
get$3(turnGroups).length>1?$$render(consequent_14):$$render(alternate_2,-1)})}var node_15=sibling(node_9,2);{var consequent_15=$$anchor2=>{ChatMessageActionCardPermissionRequest($$anchor2,{get toolName(){return get$3(pendingPermission).toolName},get serverLabel(){return get$3(pendingPermission).serverLabel},onDecision:handlePermission})};if_block(node_15,$$render=>{get$3(pendingPermission)&&!get$3(permissionDismissed)&&$$render(consequent_15)})}var node_16=sibling(node_15,2);{var consequent_16=$$anchor2=>{
-ChatMessageActionCardContinueRequest($$anchor2,{onDecision:handleContinue})};if_block(node_16,$$render=>{get$3(pendingContinue)&&!get$3(continueDismissed)&&$$render(consequent_16)})}reset(div_16),append($$anchor,div_16),pop()}var root$1a=from_html("<div><!></div>");function Button_group_root($$anchor,$$props){push$1($$props,!0);let restProps=rest_props($$props,["$$slots","$$events","$$legacy","class","children"]);var div=root$1a();attribute_effect(div,$0=>({class:$0,...restProps}),[()=>cn$1("fle\
-x items-center [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children),reset(div),append($$anchor,div),pop()}var root$19=from_html("<div></div>");function Button_group_separator($$anchor,$$props){push$1($$props,!0);let restProps=rest_props($$props,["$$slots","$$events","$$legacy"]);var div=root$19();attribute_effect(div,$0=>({class:$0,...restProps}),[()=>cn$1(
-"shrink-0 self-stretch bg-border","w-px")]),append($$anchor,div),pop()}var root_2$S=from_html('from <span class="font-semibold"> </span>',1),root_1$y=from_html('Allow use of <span class="font-semibold"> </span> <!> ?',1),root_5$p=from_html("<!> <!> <!>",1),root_10$9=from_html("Always allow <pre> </pre> tool",1),root_9$h=from_html("<!> <!>",1),root_4$t=from_html("<!> <!>",1),root_3$I=from_html("<!> <!>",1);function ChatMessageActionCardPermissionRequest($$anchor,$$props){push$1($$props,!0),ChatMessageActionCard(
-$$anchor,{get icon(){return Shield_question},message:$$anchor2=>{next$1();var fragment_1=root_1$y(),span=sibling(first_child(fragment_1)),text2=child(span,!0);reset(span);var node2=sibling(span,2);{var consequent=$$anchor3=>{var fragment_2=root_2$S(),span_1=sibling(first_child(fragment_2)),text_1=child(span_1,!0);reset(span_1),template_effect(()=>set_text(text_1,$$props.serverLabel)),append($$anchor3,fragment_2)};if_block(node2,$$render=>{$$props.serverLabel&&$$render(consequent)})}next$1(),template_effect(
-()=>set_text(text2,$$props.toolName)),append($$anchor2,fragment_1)},actions:$$anchor2=>{var fragment_3=root_3$I(),node_1=first_child(fragment_3);component(node_1,()=>Root$4,($$anchor3,DropdownMenu_Root)=>{DropdownMenu_Root($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_4=root_4$t(),node_2=first_child(fragment_4);component(node_2,()=>Button_group_root,($$anchor5,ButtonGroup_Root)=>{ButtonGroup_Root($$anchor5,{class:"overflow-hidden rounded-md bg-foreground text-white shadow-sm dark:bg\
--secondary dark:text-foreground",children:($$anchor6,$$slotProps2)=>{var fragment_5=root_5$p(),node_3=first_child(fragment_5);Button(node_3,{class:"rounded-none! shadow-none!",size:"sm",onclick:()=>$$props.onDecision(ToolPermissionDecision.ONCE),children:($$anchor7,$$slotProps3)=>{next$1();var text_2=text$8("Allow once");append($$anchor7,text_2)},$$slots:{default:!0}});var node_4=sibling(node_3,2);component(node_4,()=>Button_group_separator,($$anchor7,ButtonGroup_Separator)=>{ButtonGroup_Separator(
+ChatMessageActionCardContinueRequest($$anchor2,{onDecision:handleContinue})};if_block(node_16,$$render=>{get$3(pendingContinue)&&!get$3(continueDismissed)&&$$render(consequent_16)})}reset(div_16),append($$anchor,div_16),pop()}var root$1b=from_html("<div><!></div>");function Button_group_root($$anchor,$$props){push$1($$props,!0);let restProps=rest_props($$props,["$$slots","$$events","$$legacy","class","children"]);var div=root$1b();attribute_effect(div,$0=>({class:$0,...restProps}),[()=>cn$1("fle\
+x items-center [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children),reset(div),append($$anchor,div),pop()}var root$1a=from_html("<div></div>");function Button_group_separator($$anchor,$$props){push$1($$props,!0);let restProps=rest_props($$props,["$$slots","$$events","$$legacy"]);var div=root$1a();attribute_effect(div,$0=>({class:$0,...restProps}),[()=>cn$1(
+"shrink-0 self-stretch bg-border","w-px")]),append($$anchor,div),pop()}var root_2$R=from_html('from <span class="font-semibold"> </span>',1),root_1$z=from_html('Allow use of <span class="font-semibold"> </span> <!> ?',1),root_5$o=from_html("<!> <!> <!>",1),root_10$8=from_html("Always allow <pre> </pre> tool",1),root_9$h=from_html("<!> <!>",1),root_4$u=from_html("<!> <!>",1),root_3$J=from_html("<!> <!>",1);function ChatMessageActionCardPermissionRequest($$anchor,$$props){push$1($$props,!0),ChatMessageActionCard(
+$$anchor,{get icon(){return Shield_question},message:$$anchor2=>{next$1();var fragment_1=root_1$z(),span=sibling(first_child(fragment_1)),text2=child(span,!0);reset(span);var node2=sibling(span,2);{var consequent=$$anchor3=>{var fragment_2=root_2$R(),span_1=sibling(first_child(fragment_2)),text_1=child(span_1,!0);reset(span_1),template_effect(()=>set_text(text_1,$$props.serverLabel)),append($$anchor3,fragment_2)};if_block(node2,$$render=>{$$props.serverLabel&&$$render(consequent)})}next$1(),template_effect(
+()=>set_text(text2,$$props.toolName)),append($$anchor2,fragment_1)},actions:$$anchor2=>{var fragment_3=root_3$J(),node_1=first_child(fragment_3);component(node_1,()=>Root$4,($$anchor3,DropdownMenu_Root)=>{DropdownMenu_Root($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_4=root_4$u(),node_2=first_child(fragment_4);component(node_2,()=>Button_group_root,($$anchor5,ButtonGroup_Root)=>{ButtonGroup_Root($$anchor5,{class:"overflow-hidden rounded-md bg-foreground text-white shadow-sm dark:bg\
+-secondary dark:text-foreground",children:($$anchor6,$$slotProps2)=>{var fragment_5=root_5$o(),node_3=first_child(fragment_5);Button(node_3,{class:"rounded-none! shadow-none!",size:"sm",onclick:()=>$$props.onDecision(ToolPermissionDecision.ONCE),children:($$anchor7,$$slotProps3)=>{next$1();var text_2=text$8("Allow once");append($$anchor7,text_2)},$$slots:{default:!0}});var node_4=sibling(node_3,2);component(node_4,()=>Button_group_separator,($$anchor7,ButtonGroup_Separator)=>{ButtonGroup_Separator(
$$anchor7,{})});var node_5=sibling(node_4,2);component(node_5,()=>Dropdown_menu_trigger,($$anchor7,DropdownMenu_Trigger)=>{DropdownMenu_Trigger($$anchor7,{children:($$anchor8,$$slotProps3)=>{Button($$anchor8,{size:"sm",class:"rounded-none! !ps-2 shadow-none!",children:($$anchor9,$$slotProps4)=>{Chevron_down($$anchor9,{class:"h-3.5 w-3.5"})},$$slots:{default:!0}})},$$slots:{default:!0}})}),append($$anchor6,fragment_5)},$$slots:{default:!0}})});var node_6=sibling(node_2,2);component(node_6,()=>Dropdown_menu_content,
-($$anchor5,DropdownMenu_Content)=>{DropdownMenu_Content($$anchor5,{align:"start",class:"min-w-[8rem]",children:($$anchor6,$$slotProps2)=>{var fragment_8=root_9$h(),node_7=first_child(fragment_8);component(node_7,()=>Dropdown_menu_item,($$anchor7,DropdownMenu_Item)=>{DropdownMenu_Item($$anchor7,{onclick:()=>$$props.onDecision(ToolPermissionDecision.ALWAYS),children:($$anchor8,$$slotProps3)=>{next$1();var fragment_9=root_10$9(),pre=sibling(first_child(fragment_9)),text_3=child(pre,!0);reset(pre),next$1(),
+($$anchor5,DropdownMenu_Content)=>{DropdownMenu_Content($$anchor5,{align:"start",class:"min-w-[8rem]",children:($$anchor6,$$slotProps2)=>{var fragment_8=root_9$h(),node_7=first_child(fragment_8);component(node_7,()=>Dropdown_menu_item,($$anchor7,DropdownMenu_Item)=>{DropdownMenu_Item($$anchor7,{onclick:()=>$$props.onDecision(ToolPermissionDecision.ALWAYS),children:($$anchor8,$$slotProps3)=>{next$1();var fragment_9=root_10$8(),pre=sibling(first_child(fragment_9)),text_3=child(pre,!0);reset(pre),next$1(),
template_effect(()=>set_text(text_3,$$props.toolName)),append($$anchor8,fragment_9)},$$slots:{default:!0}})});var node_8=sibling(node_7,2);{var consequent_1=$$anchor7=>{var fragment_10=comment$2(),node_9=first_child(fragment_10);component(node_9,()=>Dropdown_menu_item,($$anchor8,DropdownMenu_Item_1)=>{DropdownMenu_Item_1($$anchor8,{onclick:()=>$$props.onDecision(ToolPermissionDecision.ALWAYS_SERVER),children:($$anchor9,$$slotProps3)=>{next$1();var text_4=text$8();template_effect(()=>set_text(text_4,
`Always allow all tools from ${$$props.serverLabel??""}`)),append($$anchor9,text_4)},$$slots:{default:!0}})}),append($$anchor7,fragment_10)},alternate=$$anchor7=>{const source2=user_derived(()=>toolsStore.getToolSource($$props.toolName)),providerName=user_derived(()=>get$3(source2)===ToolSource.BUILTIN?TOOL_SERVER_LABELS[ToolSource.BUILTIN]:get$3(source2)===ToolSource.CUSTOM?TOOL_SERVER_LABELS[ToolSource.CUSTOM]:"MCP Tools");var fragment_12=comment$2(),node_10=first_child(fragment_12);component(
node_10,()=>Dropdown_menu_item,($$anchor8,DropdownMenu_Item_2)=>{DropdownMenu_Item_2($$anchor8,{onclick:()=>$$props.onDecision(ToolPermissionDecision.ALWAYS_SERVER),children:($$anchor9,$$slotProps3)=>{next$1();var text_5=text$8();template_effect(()=>set_text(text_5,`Approve all tools from ${get$3(providerName)??""}`)),append($$anchor9,text_5)},$$slots:{default:!0}})}),append($$anchor7,fragment_12)};if_block(node_8,$$render=>{$$props.serverLabel?$$render(consequent_1):$$render(alternate,-1)})}append(
-$$anchor6,fragment_8)},$$slots:{default:!0}})}),append($$anchor4,fragment_4)},$$slots:{default:!0}})});var node_11=sibling(node_1,2);Button(node_11,{variant:"destructive",size:"sm",class:"text-destructive hover:text-destructive",onclick:()=>$$props.onDecision(ToolPermissionDecision.DENY),children:($$anchor3,$$slotProps)=>{next$1();var text_6=text$8("Deny");append($$anchor3,text_6)},$$slots:{default:!0}}),append($$anchor2,fragment_3)}}),pop()}var root$18=from_html('<div class="my-2 rounded-lg bor\
-der border-border bg-card p-3"><div class="mb-3 flex items-center gap-2 text-sm"><!> <span><!></span></div> <div class="flex flex-wrap items-center gap-2"><!></div></div>');function ChatMessageActionCard($$anchor,$$props){var div=root$18(),div_1=child(div),node2=child(div_1);component(node2,()=>$$props.icon,($$anchor2,IconComponent_1)=>{IconComponent_1($$anchor2,{class:"h-4 w-4 shrink-0 text-muted-foreground"})});var span=sibling(node2,2),node_1=child(span);snippet(node_1,()=>$$props.message),reset(
-span),reset(div_1);var div_2=sibling(div_1,2),node_2=child(div_2);snippet(node_2,()=>$$props.actions),reset(div_2),reset(div),append($$anchor,div)}var root_2$R=from_html("<!> <!>",1);function ChatMessageActionCardContinueRequest($$anchor,$$props){push$1($$props,!0),ChatMessageActionCard($$anchor,{get icon(){return Rotate_cw},message:$$anchor2=>{next$1();var text2=text$8("Agentic turn limit reached. Continue?");append($$anchor2,text2)},actions:$$anchor2=>{var fragment_1=root_2$R(),node2=first_child(
+$$anchor6,fragment_8)},$$slots:{default:!0}})}),append($$anchor4,fragment_4)},$$slots:{default:!0}})});var node_11=sibling(node_1,2);Button(node_11,{variant:"destructive",size:"sm",class:"text-destructive hover:text-destructive",onclick:()=>$$props.onDecision(ToolPermissionDecision.DENY),children:($$anchor3,$$slotProps)=>{next$1();var text_6=text$8("Deny");append($$anchor3,text_6)},$$slots:{default:!0}}),append($$anchor2,fragment_3)}}),pop()}var root$19=from_html('<div class="my-2 rounded-lg bor\
+der border-border bg-card p-3"><div class="mb-3 flex items-center gap-2 text-sm"><!> <span><!></span></div> <div class="flex flex-wrap items-center gap-2"><!></div></div>');function ChatMessageActionCard($$anchor,$$props){var div=root$19(),div_1=child(div),node2=child(div_1);component(node2,()=>$$props.icon,($$anchor2,IconComponent_1)=>{IconComponent_1($$anchor2,{class:"h-4 w-4 shrink-0 text-muted-foreground"})});var span=sibling(node2,2),node_1=child(span);snippet(node_1,()=>$$props.message),reset(
+span),reset(div_1);var div_2=sibling(div_1,2),node_2=child(div_2);snippet(node_2,()=>$$props.actions),reset(div_2),reset(div),append($$anchor,div)}var root_2$Q=from_html("<!> <!>",1);function ChatMessageActionCardContinueRequest($$anchor,$$props){push$1($$props,!0),ChatMessageActionCard($$anchor,{get icon(){return Rotate_cw},message:$$anchor2=>{next$1();var text2=text$8("Agentic turn limit reached. Continue?");append($$anchor2,text2)},actions:$$anchor2=>{var fragment_1=root_2$Q(),node2=first_child(
fragment_1);Button(node2,{size:"sm",onclick:()=>$$props.onDecision(!0),children:($$anchor3,$$slotProps)=>{next$1();var text_1=text$8("Continue");append($$anchor3,text_1)},$$slots:{default:!0}});var node_1=sibling(node2,2);Button(node_1,{variant:"destructive",size:"sm",class:"text-destructive hover:text-destructive",onclick:()=>$$props.onDecision(!1),children:($$anchor3,$$slotProps)=>{next$1();var text_2=text$8("Stop");append($$anchor3,text_2)},$$slots:{default:!0}}),append($$anchor2,fragment_1)}}),
-pop()}var root_6$q=from_html('<div class="flex items-center gap-2"><span class="text-xs text-muted-foreground">Show raw output</span> <!></div>'),root_7$m=from_html('<div class="flex flex-col gap-4 py-2"><div class="flex flex-col gap-2"><!> <!></div> <div class="flex items-center gap-2"><!> <!></div></div>'),root$17=from_html('<div><div><!> <div class="pointer-events-auto inset-0 flex items-center gap-1 opacity-100 transition-all duration-150"><!> <!> <!> <!> <!> <!></div></div> <!></div> <!> <!\
+pop()}var root_6$p=from_html('<div class="flex items-center gap-2"><span class="text-xs text-muted-foreground">Show raw output</span> <!></div>'),root_7$m=from_html('<div class="flex flex-col gap-4 py-2"><div class="flex flex-col gap-2"><!> <!></div> <div class="flex items-center gap-2"><!> <!></div></div>'),root$18=from_html('<div><div><!> <div class="pointer-events-auto inset-0 flex items-center gap-1 opacity-100 transition-all duration-150"><!> <!> <!> <!> <!> <!></div></div> <!></div> <!> <!\
>',1);function ChatMessageActionIcons($$anchor,$$props){push$1($$props,!0);let siblingInfo=prop($$props,"siblingInfo",3,null),showDeleteDialog=prop($$props,"showDeleteDialog",7),showRawOutputSwitch=prop($$props,"showRawOutputSwitch",3,!1),rawOutputEnabled=prop($$props,"rawOutputEnabled",3,!1),showForkDialog=state$1(!1),forkName=state$1(""),forkIncludeAttachments=state$1(!0);function handleConfirmDelete(){$$props.onConfirmDelete(),$$props.onShowDeleteDialogChange(!1)}function handleOpenForkDialog(){
-const conv=activeConversation();set$1(forkName,`Fork of ${conv?.name??"Conversation"}`),set$1(forkIncludeAttachments,!0),set$1(showForkDialog,!0)}function handleConfirmFork(){$$props.onForkConversation?.({name:get$3(forkName).trim(),includeAttachments:get$3(forkIncludeAttachments)}),set$1(showForkDialog,!1)}var fragment=root$17(),div=first_child(fragment),div_1=child(div),node2=child(div_1);{var consequent=$$anchor2=>{ChatMessageActionIconsBranchingControls($$anchor2,{get siblingInfo(){return siblingInfo()},
+const conv=activeConversation();set$1(forkName,`Fork of ${conv?.name??"Conversation"}`),set$1(forkIncludeAttachments,!0),set$1(showForkDialog,!0)}function handleConfirmFork(){$$props.onForkConversation?.({name:get$3(forkName).trim(),includeAttachments:get$3(forkIncludeAttachments)}),set$1(showForkDialog,!1)}var fragment=root$18(),div=first_child(fragment),div_1=child(div),node2=child(div_1);{var consequent=$$anchor2=>{ChatMessageActionIconsBranchingControls($$anchor2,{get siblingInfo(){return siblingInfo()},
get onNavigateToSibling(){return $$props.onNavigateToSibling}})};if_block(node2,$$render=>{siblingInfo()&&siblingInfo().totalSiblings>1&&$$render(consequent)})}var div_2=sibling(node2,2),node_1=child(div_2);ActionIcon(node_1,{get icon(){return Copy},tooltip:"Copy",get onclick(){return $$props.onCopy}});var node_2=sibling(node_1,2);{var consequent_1=$$anchor2=>{ActionIcon($$anchor2,{get icon(){return Square_pen},tooltip:"Edit",get onclick(){return $$props.onEdit}})};if_block(node_2,$$render=>{$$props.
onEdit&&$$render(consequent_1)})}var node_3=sibling(node_2,2);{var consequent_2=$$anchor2=>{ActionIcon($$anchor2,{get icon(){return Refresh_cw},tooltip:"Regenerate",onclick:()=>$$props.onRegenerate()})};if_block(node_3,$$render=>{$$props.role===MessageRole.ASSISTANT&&$$props.onRegenerate&&$$render(consequent_2)})}var node_4=sibling(node_3,2);{var consequent_3=$$anchor2=>{ActionIcon($$anchor2,{get icon(){return Arrow_right},tooltip:"Continue",get onclick(){return $$props.onContinue}})};if_block(node_4,
$$render=>{$$props.role===MessageRole.ASSISTANT&&$$props.onContinue&&$$render(consequent_3)})}var node_5=sibling(node_4,2);{var consequent_4=$$anchor2=>{ActionIcon($$anchor2,{get icon(){return Git_branch},tooltip:"Fork conversation",onclick:handleOpenForkDialog})};if_block(node_5,$$render=>{$$props.onForkConversation&&$$render(consequent_4)})}var node_6=sibling(node_5,2);ActionIcon(node_6,{get icon(){return Trash_2},tooltip:"Delete",get onclick(){return $$props.onDelete}}),reset(div_2),reset(div_1);
-var node_7=sibling(div_1,2);{var consequent_5=$$anchor2=>{var div_3=root_6$q(),node_8=sibling(child(div_3),2);Switch(node_8,{get checked(){return rawOutputEnabled()},onCheckedChange:checked=>$$props.onRawOutputToggle?.(checked)}),reset(div_3),append($$anchor2,div_3)};if_block(node_7,$$render=>{showRawOutputSwitch()&&$$render(consequent_5)})}reset(div);var node_9=sibling(div,2);{let $0=user_derived(()=>$$props.deletionInfo&&$$props.deletionInfo.totalCount>1?`This will delete ${$$props.deletionInfo.
+var node_7=sibling(div_1,2);{var consequent_5=$$anchor2=>{var div_3=root_6$p(),node_8=sibling(child(div_3),2);Switch(node_8,{get checked(){return rawOutputEnabled()},onCheckedChange:checked=>$$props.onRawOutputToggle?.(checked)}),reset(div_3),append($$anchor2,div_3)};if_block(node_7,$$render=>{showRawOutputSwitch()&&$$render(consequent_5)})}reset(div);var node_9=sibling(div,2);{let $0=user_derived(()=>$$props.deletionInfo&&$$props.deletionInfo.totalCount>1?`This will delete ${$$props.deletionInfo.
totalCount} messages including: ${$$props.deletionInfo.userMessages} user message${$$props.deletionInfo.userMessages>1?"s":""} and ${$$props.deletionInfo.assistantMessages} assistant response${$$props.deletionInfo.assistantMessages>1?"s":""}. All messages in this branch and their responses will be permanently removed. This action cannot be undone.`:"Are you sure you want to delete this message? This action cannot be undone."),$1=user_derived(()=>$$props.deletionInfo&&$$props.deletionInfo.totalCount>
1?`Delete ${$$props.deletionInfo.totalCount} Messages`:"Delete");DialogConfirmation(node_9,{title:"Delete Message",get description(){return get$3($0)},get confirmText(){return get$3($1)},cancelText:"Cancel",variant:"destructive",get icon(){return Trash_2},onConfirm:handleConfirmDelete,onCancel:()=>$$props.onShowDeleteDialogChange(!1),get open(){return showDeleteDialog()},set open($$value){showDeleteDialog($$value)}})}var node_10=sibling(node_9,2);DialogConfirmation(node_10,{title:"Fork Conversat\
ion",description:"Create a new conversation branching from this message.",confirmText:"Fork",cancelText:"Cancel",get icon(){return Git_branch},onConfirm:handleConfirmFork,onCancel:()=>set$1(showForkDialog,!1),get open(){return get$3(showForkDialog)},set open($$value){set$1(showForkDialog,$$value,!0)},children:($$anchor2,$$slotProps)=>{var div_4=root_7$m(),div_5=child(div_4),node_11=child(div_5);Label(node_11,{for:"fork-name",children:($$anchor3,$$slotProps2)=>{next$1();var text2=text$8("Title");
append($$anchor3,text2)},$$slots:{default:!0}});var node_12=sibling(node_11,2);Input(node_12,{id:"fork-name",class:"text-foreground",placeholder:"Enter fork name",type:"text",get value(){return get$3(forkName)},set value($$value){set$1(forkName,$$value,!0)}}),reset(div_5);var div_6=sibling(div_5,2),node_13=child(div_6);Checkbox(node_13,{id:"fork-attachments",get checked(){return get$3(forkIncludeAttachments)},onCheckedChange:checked=>{set$1(forkIncludeAttachments,checked===!0)}});var node_14=sibling(
node_13,2);Label(node_14,{for:"fork-attachments",class:"cursor-pointer text-sm font-normal",children:($$anchor3,$$slotProps2)=>{next$1();var text_1=text$8("Include all attachments");append($$anchor3,text_1)},$$slots:{default:!0}}),reset(div_6),reset(div_4),append($$anchor2,div_4)},$$slots:{default:!0}}),template_effect(()=>{set_class(div,1,`relative ${$$props.justify==="start"?"mt-2":""} flex h-6 items-center justify-between`),set_class(div_1,1,`${$$props.actionsPosition==="left"?"left-0":"right\
--0"} flex items-center gap-2 opacity-100 transition-opacity`)}),append($$anchor,fragment),pop()}var root_1$x=from_html('<div role="navigation"><!> <span class="px-1 font-mono text-xs"> </span> <!></div>');function ChatMessageActionIconsBranchingControls($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),hasPrevious=user_derived(()=>$$props.siblingInfo&&$$props.siblingInfo.currentIndex>0),hasNext=user_derived(()=>$$props.siblingInfo&&$$props.siblingInfo.currentIndex<$$props.
-siblingInfo.totalSiblings-1),nextSiblingId=user_derived(()=>get$3(hasNext)?$$props.siblingInfo.siblingIds[$$props.siblingInfo.currentIndex+1]:null),previousSiblingId=user_derived(()=>get$3(hasPrevious)?$$props.siblingInfo.siblingIds[$$props.siblingInfo.currentIndex-1]:null);var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var div=root_1$x(),node_1=child(div);{let $0=user_derived(()=>!get$3(hasPrevious)),$1=user_derived(()=>get$3(hasPrevious)?"":"!cursor-not-allowe\
+-0"} flex items-center gap-2 opacity-100 transition-opacity`)}),append($$anchor,fragment),pop()}var root_1$y=from_html('<div role="navigation"><!> <span class="px-1 font-mono text-xs"> </span> <!></div>');function ChatMessageActionIconsBranchingControls($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),hasPrevious=user_derived(()=>$$props.siblingInfo&&$$props.siblingInfo.currentIndex>0),hasNext=user_derived(()=>$$props.siblingInfo&&$$props.siblingInfo.currentIndex<$$props.
+siblingInfo.totalSiblings-1),nextSiblingId=user_derived(()=>get$3(hasNext)?$$props.siblingInfo.siblingIds[$$props.siblingInfo.currentIndex+1]:null),previousSiblingId=user_derived(()=>get$3(hasPrevious)?$$props.siblingInfo.siblingIds[$$props.siblingInfo.currentIndex-1]:null);var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var div=root_1$y(),node_1=child(div);{let $0=user_derived(()=>!get$3(hasPrevious)),$1=user_derived(()=>get$3(hasPrevious)?"":"!cursor-not-allowe\
d opacity-30");ActionIcon(node_1,{get icon(){return Chevron_left},tooltip:"Previous version",get disabled(){return get$3($0)},get class(){return`h-5 w-5 p-0 ${get$3($1)??""}`},onclick:()=>$$props.onNavigateToSibling?.(get$3(previousSiblingId))})}var span=sibling(node_1,2),text2=child(span);reset(span);var node_2=sibling(span,2);{let $0=user_derived(()=>!get$3(hasNext)),$1=user_derived(()=>get$3(hasNext)?"":"opacity-30");ActionIcon(node_2,{get icon(){return Chevron_right},tooltip:"Next version",get disabled(){
return get$3($0)},get class(){return`h-5 w-5 p-0 ${get$3($1)??""}`},onclick:()=>$$props.onNavigateToSibling?.(get$3(nextSiblingId))})}reset(div),template_effect(()=>{set_attribute(div,"aria-label",`Message version ${$$props.siblingInfo.currentIndex+1} of ${$$props.siblingInfo.totalSiblings??""}`),set_class(div,1,`flex items-center gap-1 text-xs text-muted-foreground ${className()??""}`),set_text(text2,`${$$props.siblingInfo.currentIndex+1}/${$$props.siblingInfo.totalSiblings??""}`)}),append($$anchor2,
-div)};if_block(node2,$$render=>{$$props.siblingInfo&&$$props.siblingInfo.totalSiblings>1&&$$render(consequent)})}append($$anchor,fragment),pop()}var root_3$H=from_html('<button type="button"><!> <span class="sr-only">Reading</span></button>'),root_4$s=from_html("<p>Reading (prompt processing)</p>"),root_2$Q=from_html("<!> <!>",1),root_6$p=from_html('<button type="button"><!> <span class="sr-only">Generation</span></button>'),root_7$l=from_html("<p> </p>"),root_5$o=from_html("<!> <!>",1),root_10$8=from_html(
-'<button type="button"><!> <span class="sr-only">Tools</span></button>'),root_11$a=from_html("<p>Tool calls</p>"),root_9$g=from_html("<!> <!>",1),root_14$4=from_html('<button type="button"><!> <span class="sr-only">Summary</span></button>'),root_15$8=from_html("<p>Agentic summary</p>"),root_13$8=from_html("<!> <!>",1),root_8$n=from_html("<!> <!>",1),root_16$1=from_html("<!> <!> <!>",1),root_17$4=from_html("<!> <!> <!>",1),root_18$5=from_html("<!> <!> <!>",1),root_19$6=from_html("<!> <!> <!>",1),
-root$16=from_html('<div class="inline-flex items-center text-xs text-muted-foreground"><div class="inline-flex items-center rounded-sm bg-muted-foreground/15 p-0.5"><!> <!> <!></div> <div class="flex items-center gap-1 px-2"><!></div></div>');function ChatMessageStatistics($$anchor,$$props){push$1($$props,!0);let isLive=prop($$props,"isLive",3,!1),isProcessingPrompt=prop($$props,"isProcessingPrompt",3,!1),initialView=prop($$props,"initialView",19,()=>ChatMessageStatsView.GENERATION),hideSummary=prop(
+div)};if_block(node2,$$render=>{$$props.siblingInfo&&$$props.siblingInfo.totalSiblings>1&&$$render(consequent)})}append($$anchor,fragment),pop()}var root_3$I=from_html('<button type="button"><!> <span class="sr-only">Reading</span></button>'),root_4$t=from_html("<p>Reading (prompt processing)</p>"),root_2$P=from_html("<!> <!>",1),root_6$o=from_html('<button type="button"><!> <span class="sr-only">Generation</span></button>'),root_7$l=from_html("<p> </p>"),root_5$n=from_html("<!> <!>",1),root_10$7=from_html(
+'<button type="button"><!> <span class="sr-only">Tools</span></button>'),root_11$a=from_html("<p>Tool calls</p>"),root_9$g=from_html("<!> <!>",1),root_14$4=from_html('<button type="button"><!> <span class="sr-only">Summary</span></button>'),root_15$7=from_html("<p>Agentic summary</p>"),root_13$8=from_html("<!> <!>",1),root_8$m=from_html("<!> <!>",1),root_16$1=from_html("<!> <!> <!>",1),root_17$5=from_html("<!> <!> <!>",1),root_18$5=from_html("<!> <!> <!>",1),root_19$6=from_html("<!> <!> <!>",1),
+root$17=from_html('<div class="inline-flex items-center text-xs text-muted-foreground"><div class="inline-flex items-center rounded-sm bg-muted-foreground/15 p-0.5"><!> <!> <!></div> <div class="flex items-center gap-1 px-2"><!></div></div>');function ChatMessageStatistics($$anchor,$$props){push$1($$props,!0);let isLive=prop($$props,"isLive",3,!1),isProcessingPrompt=prop($$props,"isProcessingPrompt",3,!1),initialView=prop($$props,"initialView",19,()=>ChatMessageStatsView.GENERATION),hideSummary=prop(
$$props,"hideSummary",3,!1),activeView=user_derived(initialView),hasAutoSwitchedToGeneration=state$1(!1);user_effect(()=>{$$props.onActiveViewChange?.(get$3(activeView))}),user_effect(()=>{isLive()&&(!get$3(hasAutoSwitchedToGeneration)&&!isProcessingPrompt()&&$$props.predictedTokens&&$$props.predictedTokens>0?(set$1(activeView,ChatMessageStatsView.GENERATION),set$1(hasAutoSwitchedToGeneration,!0)):get$3(hasAutoSwitchedToGeneration)||set$1(activeView,ChatMessageStatsView.READING))});let hasGenerationStats=user_derived(
()=>$$props.predictedTokens!==void 0&&$$props.predictedTokens>0&&$$props.predictedMs!==void 0&&$$props.predictedMs>0),tokensPerSecond=user_derived(()=>get$3(hasGenerationStats)?$$props.predictedTokens/$$props.predictedMs*MS_PER_SECOND:0),formattedTime=user_derived(()=>$$props.predictedMs!==void 0?formatPerformanceTime($$props.predictedMs):DEFAULT_PERFORMANCE_TIME),promptTokensPerSecond=user_derived(()=>$$props.promptTokens!==void 0&&$$props.promptMs!==void 0&&$$props.promptMs>0?$$props.promptTokens/
$$props.promptMs*MS_PER_SECOND:void 0),formattedPromptTime=user_derived(()=>$$props.promptMs!==void 0?formatPerformanceTime($$props.promptMs):void 0),hasPromptStats=user_derived(()=>$$props.promptTokens!==void 0&&$$props.promptMs!==void 0&&get$3(promptTokensPerSecond)!==void 0&&get$3(formattedPromptTime)!==void 0),isGenerationDisabled=user_derived(()=>isLive()&&!get$3(hasGenerationStats)),hasAgenticStats=user_derived(()=>$$props.agenticTimings!==void 0&&$$props.agenticTimings.toolCallsCount>0),agenticToolsPerSecond=user_derived(
()=>get$3(hasAgenticStats)&&$$props.agenticTimings.toolsMs>0?$$props.agenticTimings.toolCallsCount/$$props.agenticTimings.toolsMs*MS_PER_SECOND:0),formattedAgenticToolsTime=user_derived(()=>get$3(hasAgenticStats)?formatPerformanceTime($$props.agenticTimings.toolsMs):DEFAULT_PERFORMANCE_TIME),agenticTotalTimeMs=user_derived(()=>get$3(hasAgenticStats)?$$props.agenticTimings.toolsMs+$$props.agenticTimings.llm.predicted_ms+$$props.agenticTimings.llm.prompt_ms:0),formattedAgenticTotalTime=user_derived(
-()=>formatPerformanceTime(get$3(agenticTotalTimeMs)));var div=root$16(),div_1=child(div),node2=child(div_1);{var consequent=$$anchor2=>{var fragment=comment$2(),node_1=first_child(fragment);component(node_1,()=>Root$5,($$anchor3,Tooltip_Root)=>{Tooltip_Root($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_1=root_2$Q(),node_2=first_child(fragment_1);component(node_2,()=>Tooltip_trigger,($$anchor5,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor5,{children:($$anchor6,$$slotProps2)=>{var button=root_3$H(),
+()=>formatPerformanceTime(get$3(agenticTotalTimeMs)));var div=root$17(),div_1=child(div),node2=child(div_1);{var consequent=$$anchor2=>{var fragment=comment$2(),node_1=first_child(fragment);component(node_1,()=>Root$5,($$anchor3,Tooltip_Root)=>{Tooltip_Root($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_1=root_2$P(),node_2=first_child(fragment_1);component(node_2,()=>Tooltip_trigger,($$anchor5,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor5,{children:($$anchor6,$$slotProps2)=>{var button=root_3$I(),
node_3=child(button);Book_open_text(node_3,{class:"h-3 w-3"}),next$1(2),reset(button),template_effect(()=>set_class(button,1,`inline-flex h-5 w-5 items-center justify-center rounded-sm transition-colors ${get$3(activeView)===ChatMessageStatsView.READING?"bg-background text-foreground shadow-sm":"hover:text-foreground"}`)),delegated("click",button,()=>set$1(activeView,ChatMessageStatsView.READING)),append($$anchor6,button)},$$slots:{default:!0}})});var node_4=sibling(node_2,2);component(node_4,()=>Tooltip_content,
-($$anchor5,Tooltip_Content)=>{Tooltip_Content($$anchor5,{children:($$anchor6,$$slotProps2)=>{var p2=root_4$s();append($$anchor6,p2)},$$slots:{default:!0}})}),append($$anchor4,fragment_1)},$$slots:{default:!0}})}),append($$anchor2,fragment)};if_block(node2,$$render=>{(get$3(hasPromptStats)||isLive())&&$$render(consequent)})}var node_5=sibling(node2,2);component(node_5,()=>Root$5,($$anchor2,Tooltip_Root_1)=>{Tooltip_Root_1($$anchor2,{children:($$anchor3,$$slotProps)=>{var fragment_2=root_5$o(),node_6=first_child(
-fragment_2);component(node_6,()=>Tooltip_trigger,($$anchor4,Tooltip_Trigger_1)=>{Tooltip_Trigger_1($$anchor4,{children:($$anchor5,$$slotProps2)=>{var button_1=root_6$p(),node_7=child(button_1);Sparkles(node_7,{class:"h-3 w-3"}),next$1(2),reset(button_1),template_effect(()=>{set_class(button_1,1,`inline-flex h-5 w-5 items-center justify-center rounded-sm transition-colors ${get$3(activeView)===ChatMessageStatsView.GENERATION?"bg-background text-foreground shadow-sm":get$3(isGenerationDisabled)?"c\
+($$anchor5,Tooltip_Content)=>{Tooltip_Content($$anchor5,{children:($$anchor6,$$slotProps2)=>{var p2=root_4$t();append($$anchor6,p2)},$$slots:{default:!0}})}),append($$anchor4,fragment_1)},$$slots:{default:!0}})}),append($$anchor2,fragment)};if_block(node2,$$render=>{(get$3(hasPromptStats)||isLive())&&$$render(consequent)})}var node_5=sibling(node2,2);component(node_5,()=>Root$5,($$anchor2,Tooltip_Root_1)=>{Tooltip_Root_1($$anchor2,{children:($$anchor3,$$slotProps)=>{var fragment_2=root_5$n(),node_6=first_child(
+fragment_2);component(node_6,()=>Tooltip_trigger,($$anchor4,Tooltip_Trigger_1)=>{Tooltip_Trigger_1($$anchor4,{children:($$anchor5,$$slotProps2)=>{var button_1=root_6$o(),node_7=child(button_1);Sparkles(node_7,{class:"h-3 w-3"}),next$1(2),reset(button_1),template_effect(()=>{set_class(button_1,1,`inline-flex h-5 w-5 items-center justify-center rounded-sm transition-colors ${get$3(activeView)===ChatMessageStatsView.GENERATION?"bg-background text-foreground shadow-sm":get$3(isGenerationDisabled)?"c\
ursor-not-allowed opacity-40":"hover:text-foreground"}`),button_1.disabled=get$3(isGenerationDisabled)}),delegated("click",button_1,()=>!get$3(isGenerationDisabled)&&set$1(activeView,ChatMessageStatsView.GENERATION)),append($$anchor5,button_1)},$$slots:{default:!0}})});var node_8=sibling(node_6,2);component(node_8,()=>Tooltip_content,($$anchor4,Tooltip_Content_1)=>{Tooltip_Content_1($$anchor4,{children:($$anchor5,$$slotProps2)=>{var p_1=root_7$l(),text2=child(p_1,!0);reset(p_1),template_effect(()=>set_text(
-text2,get$3(isGenerationDisabled)?"Generation (waiting for tokens...)":"Generation (token output)")),append($$anchor5,p_1)},$$slots:{default:!0}})}),append($$anchor3,fragment_2)},$$slots:{default:!0}})});var node_9=sibling(node_5,2);{var consequent_2=$$anchor2=>{var fragment_3=root_8$n(),node_10=first_child(fragment_3);component(node_10,()=>Root$5,($$anchor3,Tooltip_Root_2)=>{Tooltip_Root_2($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_4=root_9$g(),node_11=first_child(fragment_4);component(
-node_11,()=>Tooltip_trigger,($$anchor5,Tooltip_Trigger_2)=>{Tooltip_Trigger_2($$anchor5,{children:($$anchor6,$$slotProps2)=>{var button_2=root_10$8(),node_12=child(button_2);Wrench(node_12,{class:"h-3 w-3"}),next$1(2),reset(button_2),template_effect(()=>set_class(button_2,1,`inline-flex h-5 w-5 items-center justify-center rounded-sm transition-colors ${get$3(activeView)===ChatMessageStatsView.TOOLS?"bg-background text-foreground shadow-sm":"hover:text-foreground"}`)),delegated("click",button_2,()=>set$1(
+text2,get$3(isGenerationDisabled)?"Generation (waiting for tokens...)":"Generation (token output)")),append($$anchor5,p_1)},$$slots:{default:!0}})}),append($$anchor3,fragment_2)},$$slots:{default:!0}})});var node_9=sibling(node_5,2);{var consequent_2=$$anchor2=>{var fragment_3=root_8$m(),node_10=first_child(fragment_3);component(node_10,()=>Root$5,($$anchor3,Tooltip_Root_2)=>{Tooltip_Root_2($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_4=root_9$g(),node_11=first_child(fragment_4);component(
+node_11,()=>Tooltip_trigger,($$anchor5,Tooltip_Trigger_2)=>{Tooltip_Trigger_2($$anchor5,{children:($$anchor6,$$slotProps2)=>{var button_2=root_10$7(),node_12=child(button_2);Wrench(node_12,{class:"h-3 w-3"}),next$1(2),reset(button_2),template_effect(()=>set_class(button_2,1,`inline-flex h-5 w-5 items-center justify-center rounded-sm transition-colors ${get$3(activeView)===ChatMessageStatsView.TOOLS?"bg-background text-foreground shadow-sm":"hover:text-foreground"}`)),delegated("click",button_2,()=>set$1(
activeView,ChatMessageStatsView.TOOLS)),append($$anchor6,button_2)},$$slots:{default:!0}})});var node_13=sibling(node_11,2);component(node_13,()=>Tooltip_content,($$anchor5,Tooltip_Content_2)=>{Tooltip_Content_2($$anchor5,{children:($$anchor6,$$slotProps2)=>{var p_2=root_11$a();append($$anchor6,p_2)},$$slots:{default:!0}})}),append($$anchor4,fragment_4)},$$slots:{default:!0}})});var node_14=sibling(node_10,2);{var consequent_1=$$anchor3=>{var fragment_5=comment$2(),node_15=first_child(fragment_5);
component(node_15,()=>Root$5,($$anchor4,Tooltip_Root_3)=>{Tooltip_Root_3($$anchor4,{children:($$anchor5,$$slotProps)=>{var fragment_6=root_13$8(),node_16=first_child(fragment_6);component(node_16,()=>Tooltip_trigger,($$anchor6,Tooltip_Trigger_3)=>{Tooltip_Trigger_3($$anchor6,{children:($$anchor7,$$slotProps2)=>{var button_3=root_14$4(),node_17=child(button_3);Layers(node_17,{class:"h-3 w-3"}),next$1(2),reset(button_3),template_effect(()=>set_class(button_3,1,`inline-flex h-5 w-5 items-center jus\
-tify-center rounded-sm transition-colors ${get$3(activeView)===ChatMessageStatsView.SUMMARY?"bg-background text-foreground shadow-sm":"hover:text-foreground"}`)),delegated("click",button_3,()=>set$1(activeView,ChatMessageStatsView.SUMMARY)),append($$anchor7,button_3)},$$slots:{default:!0}})});var node_18=sibling(node_16,2);component(node_18,()=>Tooltip_content,($$anchor6,Tooltip_Content_3)=>{Tooltip_Content_3($$anchor6,{children:($$anchor7,$$slotProps2)=>{var p_3=root_15$8();append($$anchor7,p_3)},
+tify-center rounded-sm transition-colors ${get$3(activeView)===ChatMessageStatsView.SUMMARY?"bg-background text-foreground shadow-sm":"hover:text-foreground"}`)),delegated("click",button_3,()=>set$1(activeView,ChatMessageStatsView.SUMMARY)),append($$anchor7,button_3)},$$slots:{default:!0}})});var node_18=sibling(node_16,2);component(node_18,()=>Tooltip_content,($$anchor6,Tooltip_Content_3)=>{Tooltip_Content_3($$anchor6,{children:($$anchor7,$$slotProps2)=>{var p_3=root_15$7();append($$anchor7,p_3)},
$$slots:{default:!0}})}),append($$anchor5,fragment_6)},$$slots:{default:!0}})}),append($$anchor3,fragment_5)};if_block(node_14,$$render=>{hideSummary()||$$render(consequent_1)})}append($$anchor2,fragment_3)};if_block(node_9,$$render=>{get$3(hasAgenticStats)&&$$render(consequent_2)})}reset(div_1);var div_2=sibling(div_1,2),node_19=child(div_2);{var consequent_3=$$anchor2=>{var fragment_7=root_16$1(),node_20=first_child(fragment_7);{let $0=user_derived(()=>$$props.predictedTokens?.toLocaleString());
ChatMessageStatisticsBadge(node_20,{class:"bg-transparent",get icon(){return Whole_word},get value(){return`${get$3($0)??""} tokens`},tooltipLabel:"Generated tokens"})}var node_21=sibling(node_20,2);ChatMessageStatisticsBadge(node_21,{class:"bg-transparent",get icon(){return Clock},get value(){return get$3(formattedTime)},tooltipLabel:"Generation time"});var node_22=sibling(node_21,2);{let $0=user_derived(()=>get$3(tokensPerSecond).toFixed(2));ChatMessageStatisticsBadge(node_22,{class:"bg-transp\
-arent",get icon(){return Gauge},get value(){return`${get$3($0)??""} t/s`},tooltipLabel:"Generation speed"})}append($$anchor2,fragment_7)},consequent_4=$$anchor2=>{var fragment_8=root_17$4(),node_23=first_child(fragment_8);ChatMessageStatisticsBadge(node_23,{class:"bg-transparent",get icon(){return Wrench},get value(){return`${$$props.agenticTimings.toolCallsCount??""} calls`},tooltipLabel:"Tool calls executed"});var node_24=sibling(node_23,2);ChatMessageStatisticsBadge(node_24,{class:"bg-transpa\
+arent",get icon(){return Gauge},get value(){return`${get$3($0)??""} t/s`},tooltipLabel:"Generation speed"})}append($$anchor2,fragment_7)},consequent_4=$$anchor2=>{var fragment_8=root_17$5(),node_23=first_child(fragment_8);ChatMessageStatisticsBadge(node_23,{class:"bg-transparent",get icon(){return Wrench},get value(){return`${$$props.agenticTimings.toolCallsCount??""} calls`},tooltipLabel:"Tool calls executed"});var node_24=sibling(node_23,2);ChatMessageStatisticsBadge(node_24,{class:"bg-transpa\
rent",get icon(){return Clock},get value(){return get$3(formattedAgenticToolsTime)},tooltipLabel:"Tool execution time"});var node_25=sibling(node_24,2);{let $0=user_derived(()=>get$3(agenticToolsPerSecond).toFixed(2));ChatMessageStatisticsBadge(node_25,{class:"bg-transparent",get icon(){return Gauge},get value(){return`${get$3($0)??""} calls/s`},tooltipLabel:"Tool execution rate"})}append($$anchor2,fragment_8)},consequent_5=$$anchor2=>{var fragment_9=root_18$5(),node_26=first_child(fragment_9);ChatMessageStatisticsBadge(
node_26,{class:"bg-transparent",get icon(){return Layers},get value(){return`${$$props.agenticTimings.turns??""} turns`},tooltipLabel:"Agentic turns (LLM calls)"});var node_27=sibling(node_26,2);{let $0=user_derived(()=>$$props.agenticTimings.llm.predicted_n.toLocaleString());ChatMessageStatisticsBadge(node_27,{class:"bg-transparent",get icon(){return Whole_word},get value(){return`${get$3($0)??""} tokens`},tooltipLabel:"Total tokens generated"})}var node_28=sibling(node_27,2);ChatMessageStatisticsBadge(
node_28,{class:"bg-transparent",get icon(){return Clock},get value(){return get$3(formattedAgenticTotalTime)},tooltipLabel:"Total time (LLM + tools)"}),append($$anchor2,fragment_9)},consequent_6=$$anchor2=>{var fragment_10=root_19$6(),node_29=first_child(fragment_10);ChatMessageStatisticsBadge(node_29,{class:"bg-transparent",get icon(){return Whole_word},get value(){return`${$$props.promptTokens??""} tokens`},tooltipLabel:"Prompt tokens"});var node_30=sibling(node_29,2);{let $0=user_derived(()=>get$3(
formattedPromptTime)??"0s");ChatMessageStatisticsBadge(node_30,{class:"bg-transparent",get icon(){return Clock},get value(){return get$3($0)},tooltipLabel:"Prompt processing time"})}var node_31=sibling(node_30,2);{let $0=user_derived(()=>get$3(promptTokensPerSecond).toFixed(2));ChatMessageStatisticsBadge(node_31,{class:"bg-transparent",get icon(){return Gauge},get value(){return`${get$3($0)??""} tokens/s`},tooltipLabel:"Prompt processing speed"})}append($$anchor2,fragment_10)};if_block(node_19,$$render=>{
-get$3(activeView)===ChatMessageStatsView.GENERATION&&get$3(hasGenerationStats)?$$render(consequent_3):get$3(activeView)===ChatMessageStatsView.TOOLS&&get$3(hasAgenticStats)?$$render(consequent_4,1):get$3(activeView)===ChatMessageStatsView.SUMMARY&&get$3(hasAgenticStats)?$$render(consequent_5,2):get$3(hasPromptStats)&&$$render(consequent_6,3)})}reset(div_2),reset(div),append($$anchor,div),pop()}delegate(["click"]);var root_6$o=from_html("<p> </p>"),root_2$P=from_html("<!> <!>",1);function ChatMessageStatisticsBadge($$anchor,$$props){
-push$1($$props,!0);let className=prop($$props,"class",3,"");function handleClick(){copyToClipboard(String($$props.value))}var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Root$5,($$anchor3,Tooltip_Root)=>{Tooltip_Root($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_2=root_2$P(),node_2=first_child(fragment_2);component(node_2,()=>Tooltip_trigger,($$anchor5,Tooltip_Trigger)=>{Tooltip_Trigger(
+get$3(activeView)===ChatMessageStatsView.GENERATION&&get$3(hasGenerationStats)?$$render(consequent_3):get$3(activeView)===ChatMessageStatsView.TOOLS&&get$3(hasAgenticStats)?$$render(consequent_4,1):get$3(activeView)===ChatMessageStatsView.SUMMARY&&get$3(hasAgenticStats)?$$render(consequent_5,2):get$3(hasPromptStats)&&$$render(consequent_6,3)})}reset(div_2),reset(div),append($$anchor,div),pop()}delegate(["click"]);var root_6$n=from_html("<p> </p>"),root_2$O=from_html("<!> <!>",1);function ChatMessageStatisticsBadge($$anchor,$$props){
+push$1($$props,!0);let className=prop($$props,"class",3,"");function handleClick(){copyToClipboard(String($$props.value))}var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Root$5,($$anchor3,Tooltip_Root)=>{Tooltip_Root($$anchor3,{children:($$anchor4,$$slotProps)=>{var fragment_2=root_2$O(),node_2=first_child(fragment_2);component(node_2,()=>Tooltip_trigger,($$anchor5,Tooltip_Trigger)=>{Tooltip_Trigger(
$$anchor5,{children:($$anchor6,$$slotProps2)=>{BadgeInfo($$anchor6,{get class(){return className()},onclick:handleClick,icon:$$anchor7=>{var fragment_4=comment$2(),node_3=first_child(fragment_4);component(node_3,()=>$$props.icon,($$anchor8,IconComponent_1)=>{IconComponent_1($$anchor8,{class:"h-3 w-3"})}),append($$anchor7,fragment_4)},children:($$anchor7,$$slotProps3)=>{next$1();var text2=text$8();template_effect(()=>set_text(text2,$$props.value)),append($$anchor7,text2)},$$slots:{icon:!0,default:!0}})},
-$$slots:{default:!0}})});var node_4=sibling(node_2,2);component(node_4,()=>Tooltip_content,($$anchor5,Tooltip_Content)=>{Tooltip_Content($$anchor5,{children:($$anchor6,$$slotProps2)=>{var p2=root_6$o(),text_1=child(p2,!0);reset(p2),template_effect(()=>set_text(text_1,$$props.tooltipLabel)),append($$anchor6,p2)},$$slots:{default:!0}})}),append($$anchor4,fragment_2)},$$slots:{default:!0}})}),append($$anchor2,fragment_1)},alternate=$$anchor2=>{BadgeInfo($$anchor2,{get class(){return className()},onclick:handleClick,
+$$slots:{default:!0}})});var node_4=sibling(node_2,2);component(node_4,()=>Tooltip_content,($$anchor5,Tooltip_Content)=>{Tooltip_Content($$anchor5,{children:($$anchor6,$$slotProps2)=>{var p2=root_6$n(),text_1=child(p2,!0);reset(p2),template_effect(()=>set_text(text_1,$$props.tooltipLabel)),append($$anchor6,p2)},$$slots:{default:!0}})}),append($$anchor4,fragment_2)},$$slots:{default:!0}})}),append($$anchor2,fragment_1)},alternate=$$anchor2=>{BadgeInfo($$anchor2,{get class(){return className()},onclick:handleClick,
icon:$$anchor3=>{var fragment_7=comment$2(),node_5=first_child(fragment_7);component(node_5,()=>$$props.icon,($$anchor4,IconComponent_2)=>{IconComponent_2($$anchor4,{class:"h-3 w-3"})}),append($$anchor3,fragment_7)},children:($$anchor3,$$slotProps)=>{next$1();var text_2=text$8();template_effect(()=>set_text(text_2,$$props.value)),append($$anchor3,text_2)},$$slots:{icon:!0,default:!0}})};if_block(node2,$$render=>{$$props.tooltipLabel?$$render(consequent):$$render(alternate,-1)})}append($$anchor,fragment),
-pop()}var root_3$G=from_html('<div class="max-w-[80%]"><!></div>'),root_2$O=from_html("<!> <!>",1),root$15=from_html('<div aria-label="MCP Prompt message with actions" role="group"><!></div>');function ChatMessageMcpPrompt($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),siblingInfo=prop($$props,"siblingInfo",3,null);const editCtx=getMessageEditContext();var div=root$15(),node2=child(div);{var consequent=$$anchor2=>{ChatMessageEditForm($$anchor2,{})},alternate=$$anchor2=>{
-var fragment_1=root_2$O(),node_1=first_child(fragment_1);ChatMessageMcpPromptContent(node_1,{get prompt(){return $$props.mcpPrompt},get variant(){return McpPromptVariant.MESSAGE},class:"w-full max-w-[80%]"});var node_2=sibling(node_1,2);{var consequent_1=$$anchor3=>{var div_1=root_3$G(),node_3=child(div_1);ChatMessageActionIcons(node_3,{actionsPosition:"right",get deletionInfo(){return $$props.deletionInfo},justify:"end",get onConfirmDelete(){return $$props.onConfirmDelete},get onCopy(){return $$props.
+pop()}var root_3$H=from_html('<div class="max-w-[80%]"><!></div>'),root_2$N=from_html("<!> <!>",1),root$16=from_html('<div aria-label="MCP Prompt message with actions" role="group"><!></div>');function ChatMessageMcpPrompt($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),siblingInfo=prop($$props,"siblingInfo",3,null);const editCtx=getMessageEditContext();var div=root$16(),node2=child(div);{var consequent=$$anchor2=>{ChatMessageEditForm($$anchor2,{})},alternate=$$anchor2=>{
+var fragment_1=root_2$N(),node_1=first_child(fragment_1);ChatMessageMcpPromptContent(node_1,{get prompt(){return $$props.mcpPrompt},get variant(){return McpPromptVariant.MESSAGE},class:"w-full max-w-[80%]"});var node_2=sibling(node_1,2);{var consequent_1=$$anchor3=>{var div_1=root_3$H(),node_3=child(div_1);ChatMessageActionIcons(node_3,{actionsPosition:"right",get deletionInfo(){return $$props.deletionInfo},justify:"end",get onConfirmDelete(){return $$props.onConfirmDelete},get onCopy(){return $$props.
onCopy},get onDelete(){return $$props.onDelete},get onEdit(){return $$props.onEdit},get onNavigateToSibling(){return $$props.onNavigateToSibling},get onShowDeleteDialogChange(){return $$props.onShowDeleteDialogChange},get siblingInfo(){return siblingInfo()},get showDeleteDialog(){return $$props.showDeleteDialog},get role(){return MessageRole.USER}}),reset(div_1),append($$anchor3,div_1)};if_block(node_2,$$render=>{$$props.message.timestamp&&$$render(consequent_1)})}append($$anchor2,fragment_1)};if_block(
-node2,$$render=>{editCtx.isEditing?$$render(consequent):$$render(alternate,-1)})}reset(div),template_effect(()=>set_class(div,1,`group flex flex-col items-end gap-3 md:gap-2 ${className()??""}`)),append($$anchor,div),pop()}var root$14=from_html("<div><!></div>");function Card($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$14();attribute_effect(div,$0=>({"data-slot":"ca\
-rd",class:$0,...restProps}),[()=>cn$1("flex flex-col gap-6 rounded-xl bg-card py-6 text-card-foreground shadow-sm",BOX_BORDER,$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}var root_3$F=from_html('<img alt="" class="h-3.5 w-3.5 shrink-0 rounded-sm"/>'),root_4$r=from_html("<span> </span>"),root_1$w=from_html("<!> <!>",1),root_8$m=from_html("<span> </span>"),root_9$f=from_html(
-'<span class="max-w-xs break-all"> </span>'),root_7$k=from_html("<!> <!>",1),root_5$n=from_html('<div class="flex flex-wrap justify-end gap-1"></div>'),root_11$9=from_html("<div><span> </span></div>"),root_13$7=from_html('<div><div class="space-y-2"><div class="h-3 w-3/4 animate-pulse rounded bg-foreground/20"></div> <div class="h-3 w-full animate-pulse rounded bg-foreground/20"></div> <div class="h-3 w-5/6 animate-pulse rounded bg-foreground/20"></div></div></div>'),root_17$3=from_html("<span> \
-</span>"),root_18$4=from_html("<span> </span>"),root_15$7=from_html("<div><span></span></div>"),root$13=from_html('<div><div class="flex items-center justify-between gap-2"><div class="inline-flex flex-wrap items-center gap-1.25 text-xs text-muted-foreground"><!> <!></div> <!></div> <!></div>');function ChatMessageMcpPromptContent($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),variant=prop($$props,"variant",19,()=>McpPromptVariant.MESSAGE),isLoading2=prop($$props,"\
+node2,$$render=>{editCtx.isEditing?$$render(consequent):$$render(alternate,-1)})}reset(div),template_effect(()=>set_class(div,1,`group flex flex-col items-end gap-3 md:gap-2 ${className()??""}`)),append($$anchor,div),pop()}var root$15=from_html("<div><!></div>");function Card($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$15();attribute_effect(div,$0=>({"data-slot":"ca\
+rd",class:$0,...restProps}),[()=>cn$1("flex flex-col gap-6 rounded-xl bg-card py-6 text-card-foreground shadow-sm",BOX_BORDER,$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}var root_3$G=from_html('<img alt="" class="h-3.5 w-3.5 shrink-0 rounded-sm"/>'),root_4$s=from_html("<span> </span>"),root_1$x=from_html("<!> <!>",1),root_8$l=from_html("<span> </span>"),root_9$f=from_html(
+'<span class="max-w-xs break-all"> </span>'),root_7$k=from_html("<!> <!>",1),root_5$m=from_html('<div class="flex flex-wrap justify-end gap-1"></div>'),root_11$9=from_html("<div><span> </span></div>"),root_13$7=from_html('<div><div class="space-y-2"><div class="h-3 w-3/4 animate-pulse rounded bg-foreground/20"></div> <div class="h-3 w-full animate-pulse rounded bg-foreground/20"></div> <div class="h-3 w-5/6 animate-pulse rounded bg-foreground/20"></div></div></div>'),root_17$4=from_html("<span> \
+</span>"),root_18$4=from_html("<span> </span>"),root_15$6=from_html("<div><span></span></div>"),root$14=from_html('<div><div class="flex items-center justify-between gap-2"><div class="inline-flex flex-wrap items-center gap-1.25 text-xs text-muted-foreground"><!> <!></div> <!></div> <!></div>');function ChatMessageMcpPromptContent($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),variant=prop($$props,"variant",19,()=>McpPromptVariant.MESSAGE),isLoading2=prop($$props,"\
isLoading",3,!1),hoveredArgKey=state$1(null),argumentEntries=user_derived(()=>Object.entries($$props.prompt.arguments??{})),hasArguments=user_derived(()=>$$props.prompt.arguments&&Object.keys($$props.prompt.arguments).length>0),hasContent=user_derived(()=>$$props.prompt.content&&$$props.prompt.content.trim().length>0),contentParts=user_derived(()=>{if(!$$props.prompt.content||!get$3(hasArguments))return[{text:$$props.prompt.content||"",argKey:null}];const parts=[];let remaining=$$props.prompt.content;
const valueToKey=new SvelteMap;for(const[key2,value]of get$3(argumentEntries))value&&value.trim()&&valueToKey.set(value,key2);const sortedValues=[...valueToKey.keys()].sort((a,b)=>b.length-a.length);for(;remaining.length>0;){let earliestMatch=null;for(const value of sortedValues){const index2=remaining.indexOf(value);index2!==-1&&(earliestMatch===null||index2<earliestMatch.index)&&(earliestMatch={index:index2,value,key:valueToKey.get(value)})}if(earliestMatch)earliestMatch.index>0&&parts.push({text:remaining.
slice(0,earliestMatch.index),argKey:null}),parts.push({text:earliestMatch.value,argKey:earliestMatch.key}),remaining=remaining.slice(earliestMatch.index+earliestMatch.value.length);else{parts.push({text:remaining,argKey:null});break}}return parts}),showArgBadges=user_derived(()=>get$3(hasArguments)&&!isLoading2()&&!$$props.loadError),isAttachment=user_derived(()=>variant()===McpPromptVariant.ATTACHMENT),textSizeClass=user_derived(()=>get$3(isAttachment)?"text-xs":"text-md"),paddingClass=user_derived(
-()=>get$3(isAttachment)?"px-3 py-2":"px-3.75 py-2.5"),maxHeightStyle=user_derived(()=>get$3(isAttachment)?"max-height: 6rem;":"max-height: var(--max-message-height);");const serverFavicon=user_derived(()=>mcpStore.getServerFavicon($$props.prompt.serverName)),serverDisplayName=user_derived(()=>mcpStore.getServerDisplayName($$props.prompt.serverName));var div=root$13(),div_1=child(div),div_2=child(div_1),node2=child(div_2);component(node2,()=>Root$5,($$anchor2,Tooltip_Root)=>{Tooltip_Root($$anchor2,
-{children:($$anchor3,$$slotProps)=>{var fragment=root_1$w(),node_1=first_child(fragment);component(node_1,()=>Tooltip_trigger,($$anchor4,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor4,{children:($$anchor5,$$slotProps2)=>{var fragment_1=comment$2(),node_2=first_child(fragment_1);{var consequent=$$anchor6=>{var img=root_3$F();template_effect(()=>set_attribute(img,"src",get$3(serverFavicon))),event("error",img,e=>{e.currentTarget.style.display="none"}),replay_events(img),append($$anchor6,img)};if_block(
-node_2,$$render=>{get$3(serverFavicon)&&$$render(consequent)})}append($$anchor5,fragment_1)},$$slots:{default:!0}})});var node_3=sibling(node_1,2);component(node_3,()=>Tooltip_content,($$anchor4,Tooltip_Content)=>{Tooltip_Content($$anchor4,{children:($$anchor5,$$slotProps2)=>{var span=root_4$r(),text2=child(span,!0);reset(span),template_effect(()=>set_text(text2,get$3(serverDisplayName))),append($$anchor5,span)},$$slots:{default:!0}})}),append($$anchor3,fragment)},$$slots:{default:!0}})});var node_4=sibling(
-node2,2);TruncatedText(node_4,{get text(){return $$props.prompt.name}}),reset(div_2);var node_5=sibling(div_2,2);{var consequent_1=$$anchor2=>{var div_3=root_5$n();each(div_3,21,()=>get$3(argumentEntries),([key2,value])=>key2,($$anchor3,$$item)=>{var $$array=user_derived(()=>to_array(get$3($$item),2));let key2=()=>get$3($$array)[0],value=()=>get$3($$array)[1];var fragment_2=comment$2(),node_6=first_child(fragment_2);component(node_6,()=>Root$5,($$anchor4,Tooltip_Root_1)=>{Tooltip_Root_1($$anchor4,
-{children:($$anchor5,$$slotProps)=>{var fragment_3=root_7$k(),node_7=first_child(fragment_3);component(node_7,()=>Tooltip_trigger,($$anchor6,Tooltip_Trigger_1)=>{Tooltip_Trigger_1($$anchor6,{children:($$anchor7,$$slotProps2)=>{var span_1=root_8$m(),text_1=child(span_1,!0);reset(span_1),template_effect(()=>{set_class(span_1,1,`rounded-sm bg-purple-200/60 px-1.5 py-0.5 text-[10px] leading-none text-purple-700 transition-opacity dark:bg-purple-800/40 dark:text-purple-300 ${get$3(hoveredArgKey)&&get$3(
+()=>get$3(isAttachment)?"px-3 py-2":"px-3.75 py-2.5"),maxHeightStyle=user_derived(()=>get$3(isAttachment)?"max-height: 6rem;":"max-height: var(--max-message-height);");const serverFavicon=user_derived(()=>mcpStore.getServerFavicon($$props.prompt.serverName)),serverDisplayName=user_derived(()=>mcpStore.getServerDisplayName($$props.prompt.serverName));var div=root$14(),div_1=child(div),div_2=child(div_1),node2=child(div_2);component(node2,()=>Root$5,($$anchor2,Tooltip_Root)=>{Tooltip_Root($$anchor2,
+{children:($$anchor3,$$slotProps)=>{var fragment=root_1$x(),node_1=first_child(fragment);component(node_1,()=>Tooltip_trigger,($$anchor4,Tooltip_Trigger)=>{Tooltip_Trigger($$anchor4,{children:($$anchor5,$$slotProps2)=>{var fragment_1=comment$2(),node_2=first_child(fragment_1);{var consequent=$$anchor6=>{var img=root_3$G();template_effect(()=>set_attribute(img,"src",get$3(serverFavicon))),event("error",img,e=>{e.currentTarget.style.display="none"}),replay_events(img),append($$anchor6,img)};if_block(
+node_2,$$render=>{get$3(serverFavicon)&&$$render(consequent)})}append($$anchor5,fragment_1)},$$slots:{default:!0}})});var node_3=sibling(node_1,2);component(node_3,()=>Tooltip_content,($$anchor4,Tooltip_Content)=>{Tooltip_Content($$anchor4,{children:($$anchor5,$$slotProps2)=>{var span=root_4$s(),text2=child(span,!0);reset(span),template_effect(()=>set_text(text2,get$3(serverDisplayName))),append($$anchor5,span)},$$slots:{default:!0}})}),append($$anchor3,fragment)},$$slots:{default:!0}})});var node_4=sibling(
+node2,2);TruncatedText(node_4,{get text(){return $$props.prompt.name}}),reset(div_2);var node_5=sibling(div_2,2);{var consequent_1=$$anchor2=>{var div_3=root_5$m();each(div_3,21,()=>get$3(argumentEntries),([key2,value])=>key2,($$anchor3,$$item)=>{var $$array=user_derived(()=>to_array(get$3($$item),2));let key2=()=>get$3($$array)[0],value=()=>get$3($$array)[1];var fragment_2=comment$2(),node_6=first_child(fragment_2);component(node_6,()=>Root$5,($$anchor4,Tooltip_Root_1)=>{Tooltip_Root_1($$anchor4,
+{children:($$anchor5,$$slotProps)=>{var fragment_3=root_7$k(),node_7=first_child(fragment_3);component(node_7,()=>Tooltip_trigger,($$anchor6,Tooltip_Trigger_1)=>{Tooltip_Trigger_1($$anchor6,{children:($$anchor7,$$slotProps2)=>{var span_1=root_8$l(),text_1=child(span_1,!0);reset(span_1),template_effect(()=>{set_class(span_1,1,`rounded-sm bg-purple-200/60 px-1.5 py-0.5 text-[10px] leading-none text-purple-700 transition-opacity dark:bg-purple-800/40 dark:text-purple-300 ${get$3(hoveredArgKey)&&get$3(
hoveredArgKey)!==key2()?"opacity-30":""}`),set_text(text_1,key2())}),event("mouseenter",span_1,()=>set$1(hoveredArgKey,key2(),!0)),event("mouseleave",span_1,()=>set$1(hoveredArgKey,null)),append($$anchor7,span_1)},$$slots:{default:!0}})});var node_8=sibling(node_7,2);component(node_8,()=>Tooltip_content,($$anchor6,Tooltip_Content_1)=>{Tooltip_Content_1($$anchor6,{children:($$anchor7,$$slotProps2)=>{var span_2=root_9$f(),text_2=child(span_2,!0);reset(span_2),template_effect(()=>set_text(text_2,value())),
append($$anchor7,span_2)},$$slots:{default:!0}})}),append($$anchor5,fragment_3)},$$slots:{default:!0}})}),append($$anchor3,fragment_2)}),reset(div_3),append($$anchor2,div_3)};if_block(node_5,$$render=>{get$3(showArgBadges)&&$$render(consequent_1)})}reset(div_1);var node_9=sibling(div_1,2);{var consequent_2=$$anchor2=>{Card($$anchor2,{class:"relative overflow-hidden rounded-[1.125rem] border border-destructive/50 bg-destructive/10 backdrop-blur-md",children:($$anchor3,$$slotProps)=>{var div_4=root_11$9(),
span_3=child(div_4),text_3=child(span_3,!0);reset(span_3),reset(div_4),template_effect(()=>{set_class(div_4,1,`overflow-y-auto ${get$3(paddingClass)??""}`),set_style(div_4,`${get$3(maxHeightStyle)??""} overflow-wrap: anywhere; word-break: break-word;`),set_class(span_3,1,`${get$3(textSizeClass)??""} text-destructive`),set_text(text_3,$$props.loadError)}),append($$anchor3,div_4)},$$slots:{default:!0}})},consequent_3=$$anchor2=>{Card($$anchor2,{class:"relative overflow-hidden rounded-[1.125rem] bo\
rder border-purple-200 bg-purple-500/10 px-1 py-2 backdrop-blur-md dark:border-purple-800 dark:bg-purple-500/20",children:($$anchor3,$$slotProps)=>{var div_5=root_13$7();template_effect(()=>{set_class(div_5,1,`overflow-y-auto ${get$3(paddingClass)??""}`),set_style(div_5,`${get$3(maxHeightStyle)??""} overflow-wrap: anywhere; word-break: break-word;`)}),append($$anchor3,div_5)},$$slots:{default:!0}})},consequent_5=$$anchor2=>{Card($$anchor2,{class:"relative overflow-hidden rounded-[1.125rem] borde\
-r border-purple-200 bg-purple-500/10 py-0 text-foreground backdrop-blur-md dark:border-purple-800 dark:bg-purple-500/20",children:($$anchor3,$$slotProps)=>{var div_6=root_15$7(),span_4=child(div_6);each(span_4,21,()=>get$3(contentParts),index$2,($$anchor4,part)=>{var fragment_7=comment$2(),node_10=first_child(fragment_7);{var consequent_4=$$anchor5=>{var span_5=root_17$3(),text_4=child(span_5,!0);reset(span_5),template_effect(()=>{set_class(span_5,1,`rounded-sm bg-purple-300/50 px-0.5 text-purpl\
+r border-purple-200 bg-purple-500/10 py-0 text-foreground backdrop-blur-md dark:border-purple-800 dark:bg-purple-500/20",children:($$anchor3,$$slotProps)=>{var div_6=root_15$6(),span_4=child(div_6);each(span_4,21,()=>get$3(contentParts),index$2,($$anchor4,part)=>{var fragment_7=comment$2(),node_10=first_child(fragment_7);{var consequent_4=$$anchor5=>{var span_5=root_17$4(),text_4=child(span_5,!0);reset(span_5),template_effect(()=>{set_class(span_5,1,`rounded-sm bg-purple-300/50 px-0.5 text-purpl\
e-900 transition-opacity dark:bg-purple-700/50 dark:text-purple-100 ${get$3(hoveredArgKey)&&get$3(hoveredArgKey)!==get$3(part).argKey?"opacity-30":""}`),set_text(text_4,get$3(part).text)}),event("mouseenter",span_5,()=>set$1(hoveredArgKey,get$3(part).argKey,!0)),event("mouseleave",span_5,()=>set$1(hoveredArgKey,null)),append($$anchor5,span_5)},alternate=$$anchor5=>{var span_6=root_18$4(),text_5=child(span_6,!0);reset(span_6),template_effect(()=>{set_class(span_6,1,`transition-opacity ${get$3(hoveredArgKey)?
"opacity-30":""}`),set_text(text_5,get$3(part).text)}),append($$anchor5,span_6)};if_block(node_10,$$render=>{get$3(part).argKey?$$render(consequent_4):$$render(alternate,-1)})}append($$anchor4,fragment_7)}),reset(span_4),reset(div_6),template_effect(()=>{set_class(div_6,1,`overflow-y-auto ${get$3(paddingClass)??""}`),set_style(div_6,`${get$3(maxHeightStyle)??""} overflow-wrap: anywhere; word-break: break-word;`),set_class(span_4,1,`${get$3(textSizeClass)??""} whitespace-pre-wrap`)}),append($$anchor3,
div_6)},$$slots:{default:!0}})};if_block(node_9,$$render=>{$$props.loadError?$$render(consequent_2):isLoading2()?$$render(consequent_3,1):get$3(hasContent)&&$$render(consequent_5,2)})}reset(div),template_effect(()=>set_class(div,1,`flex flex-col gap-2 ${className()??""}`)),append($$anchor,div),pop()}function useProcessingState(){let isMonitoring=state$1(!1),lastKnownState=state$1(null),lastKnownProcessingStats=state$1(null);const processingState=user_derived(()=>get$3(isMonitoring)?activeProcessingState():
tokensPerSecond>0&&details.push(`${stateToUse.tokensPerSecond.toFixed(1)} ${STATS_UNITS.TOKENS_PER_SECOND}`),stateToUse.speculative&&details.push("Speculative decoding enabled"),details}function shouldShowDetails(){return get$3(processingState)!==null&&get$3(processingState).status!=="idle"}function getPromptProgressText(){if(!get$3(processingState)?.promptProgress)return null;const{processed,total,cache:cache2}=get$3(processingState).promptProgress,actualProcessed=processed-cache2,actualTotal=total-
cache2,percent=Math.round(actualProcessed/actualTotal*100),eta=getETASecs(actualProcessed,actualTotal,get$3(processingState).promptProgress.time_ms);if(eta!==void 0){const etaSecs=Math.ceil(eta);return`Processing ${percent}% (ETA: ${etaSecs}s)`}return`Processing ${percent}%`}function getLiveProcessingStats(){if(get$3(processingState)?.promptProgress){const{processed,total,time_ms,cache:cache2}=get$3(processingState).promptProgress,actualProcessed=processed-cache2,actualTotal=total-cache2;if(actualProcessed>
0&&time_ms>0){const tokensPerSecond=actualProcessed/(time_ms/1e3);return{tokensProcessed:actualProcessed,totalTokens:actualTotal,timeMs:time_ms,tokensPerSecond}}}return get$3(lastKnownProcessingStats)}function getLiveGenerationStats(){if(!get$3(processingState))return null;const{tokensDecoded,tokensPerSecond}=get$3(processingState);if(tokensDecoded<=0)return null;const timeMs=tokensPerSecond&&tokensPerSecond>0?tokensDecoded/tokensPerSecond*1e3:0;return{tokensGenerated:tokensDecoded,timeMs,tokensPerSecond:tokensPerSecond||
-0}}return{get processingState(){return get$3(processingState)},getProcessingDetails,getTechnicalDetails,getProcessingMessage,getPromptProgressText,getLiveProcessingStats,getLiveGenerationStats,shouldShowDetails,startMonitoring,stopMonitoring}}var root_1$v=from_html('<div class="mt-6 w-full max-w-[48rem]"><div class="processing-container svelte-3902tz"><span class="processing-text svelte-3902tz"> </span></div></div>'),root_4$q=from_html('<pre class="raw-output svelte-3902tz"> </pre>'),root_6$n=from_html(
-'<div class="text-sm whitespace-pre-wrap"> </div>'),root_7$j=from_html('<div class="mt-4 w-full max-w-[48rem]"><div class="processing-container svelte-3902tz"><span class="processing-text svelte-3902tz"> </span></div></div>'),root_8$l=from_html('<div class="inline-flex flex-wrap items-start gap-2 text-xs text-muted-foreground"><!> <!></div>'),root$12=from_html('<div role="group" aria-label="Assistant message with actions"><!> <!> <!> <div class="info my-6 grid gap-4 tabular-nums"><!></div> <!></\
+0}}return{get processingState(){return get$3(processingState)},getProcessingDetails,getTechnicalDetails,getProcessingMessage,getPromptProgressText,getLiveProcessingStats,getLiveGenerationStats,shouldShowDetails,startMonitoring,stopMonitoring}}var root_1$w=from_html('<div class="mt-6 w-full max-w-[48rem]"><div class="processing-container svelte-3902tz"><span class="processing-text svelte-3902tz"> </span></div></div>'),root_4$r=from_html('<pre class="raw-output svelte-3902tz"> </pre>'),root_6$m=from_html(
+'<div class="text-sm whitespace-pre-wrap"> </div>'),root_7$j=from_html('<div class="mt-4 w-full max-w-[48rem]"><div class="processing-container svelte-3902tz"><span class="processing-text svelte-3902tz"> </span></div></div>'),root_8$k=from_html('<div class="inline-flex flex-wrap items-start gap-2 text-xs text-muted-foreground"><!> <!></div>'),root$13=from_html('<div role="group" aria-label="Assistant message with actions"><!> <!> <!> <div class="info my-6 grid gap-4 tabular-nums"><!></div> <!></\
div>');function ChatMessageAssistant($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),isLastAssistantMessage=prop($$props,"isLastAssistantMessage",3,!1),toolMessages=prop($$props,"toolMessages",19,()=>[]),siblingInfo=prop($$props,"siblingInfo",3,null);const editCtx=getMessageEditContext(),isAgentic=user_derived(()=>hasAgenticContent($$props.message,toolMessages())),hasReasoning=user_derived(()=>!!$$props.message.reasoningContent),processingState=useProcessingState();
let currentConfig=user_derived(config$1),isRouter=user_derived(isRouterMode),showRawOutput=state$1(!1),rawOutputContent=user_derived(()=>{const sections=deriveAgenticSections($$props.message,toolMessages(),[],!1),parts=[];for(const section2 of sections)switch(section2.type){case AgenticSectionType.REASONING:case AgenticSectionType.REASONING_PENDING:parts.push(`${REASONING_TAGS.START}
${section2.content}
`)}),activeStatsView=state$1(proxy(ChatMessageStatsView.GENERATION)),statsContainerEl=state$1(void 0);function getScrollParent(el){let parent=el.parentElement;for(;parent;){const style2=getComputedStyle(parent);if(/(auto|scroll)/.test(style2.overflowY))return parent;parent=parent.parentElement}return null}async function handleStatsViewChange(view){const el=get$3(statsContainerEl);if(!el){set$1(activeStatsView,view,!0);return}const scrollParent=getScrollParent(el);if(!scrollParent){set$1(activeStatsView,
view,!0);return}const yBefore=el.getBoundingClientRect().top;set$1(activeStatsView,view,!0),await tick();const delta=el.getBoundingClientRect().top-yBefore;delta!==0&&(scrollParent.scrollTop+=delta),requestAnimationFrame(()=>{const drift=el.getBoundingClientRect().top-yBefore;Math.abs(drift)>1&&(scrollParent.scrollTop+=drift)})}let highlightAgenticTurns=user_derived(()=>get$3(isAgentic)&&(get$3(currentConfig).alwaysShowAgenticTurns||get$3(activeStatsView)===ChatMessageStatsView.SUMMARY)),displayedModel=user_derived(
()=>$$props.message.model??null),isCurrentlyLoading=user_derived(isLoading),isStreaming=user_derived(isChatStreaming),hasNoContent=user_derived(()=>!$$props.message?.content?.trim()),isActivelyProcessing=user_derived(()=>get$3(isCurrentlyLoading)||get$3(isStreaming)),showProcessingInfoTop=user_derived(()=>$$props.message?.role===MessageRole.ASSISTANT&&get$3(isActivelyProcessing)&&get$3(hasNoContent)&&!get$3(isAgentic)&&isLastAssistantMessage()),showProcessingInfoBottom=user_derived(()=>$$props.message?.
-role===MessageRole.ASSISTANT&&get$3(isActivelyProcessing)&&(!get$3(hasNoContent)||get$3(isAgentic))&&isLastAssistantMessage());function handleCopyModel(){copyToClipboard(get$3(displayedModel)??"")}user_effect(()=>{(get$3(showProcessingInfoTop)||get$3(showProcessingInfoBottom))&&processingState.startMonitoring()});var div=root$12(),node2=child(div);{var consequent=$$anchor2=>{var div_1=root_1$v(),div_2=child(div_1),span=child(div_2),text2=child(span,!0);reset(span),reset(div_2),reset(div_1),template_effect(
-$0=>set_text(text2,$0),[()=>processingState.getPromptProgressText()??processingState.getProcessingMessage()??"Processing..."]),transition(1,div_1,()=>fade),append($$anchor2,div_1)};if_block(node2,$$render=>{get$3(showProcessingInfoTop)&&$$render(consequent)})}var node_1=sibling(node2,2);{var consequent_1=$$anchor2=>{ChatMessageEditForm($$anchor2,{})},consequent_3=$$anchor2=>{var fragment_1=comment$2(),node_2=first_child(fragment_1);{var consequent_2=$$anchor3=>{var pre=root_4$q(),text_1=child(pre,
+role===MessageRole.ASSISTANT&&get$3(isActivelyProcessing)&&(!get$3(hasNoContent)||get$3(isAgentic))&&isLastAssistantMessage());function handleCopyModel(){copyToClipboard(get$3(displayedModel)??"")}user_effect(()=>{(get$3(showProcessingInfoTop)||get$3(showProcessingInfoBottom))&&processingState.startMonitoring()});var div=root$13(),node2=child(div);{var consequent=$$anchor2=>{var div_1=root_1$w(),div_2=child(div_1),span=child(div_2),text2=child(span,!0);reset(span),reset(div_2),reset(div_1),template_effect(
+$0=>set_text(text2,$0),[()=>processingState.getPromptProgressText()??processingState.getProcessingMessage()??"Processing..."]),transition(1,div_1,()=>fade),append($$anchor2,div_1)};if_block(node2,$$render=>{get$3(showProcessingInfoTop)&&$$render(consequent)})}var node_1=sibling(node2,2);{var consequent_1=$$anchor2=>{ChatMessageEditForm($$anchor2,{})},consequent_3=$$anchor2=>{var fragment_1=comment$2(),node_2=first_child(fragment_1);{var consequent_2=$$anchor3=>{var pre=root_4$r(),text_1=child(pre,
!0);reset(pre),template_effect(()=>set_text(text_1,get$3(rawOutputContent)||"")),append($$anchor3,pre)},alternate=$$anchor3=>{{let $0=user_derived(isChatStreaming);ChatMessageAgenticContent($$anchor3,{get message(){return $$props.message},get toolMessages(){return toolMessages()},get isStreaming(){return get$3($0)},get isLastAssistantMessage(){return isLastAssistantMessage()},get highlightTurns(){return get$3(highlightAgenticTurns)}})}};if_block(node_2,$$render=>{get$3(showRawOutput)?$$render(consequent_2):
-$$render(alternate,-1)})}append($$anchor2,fragment_1)},alternate_1=$$anchor2=>{var div_3=root_6$n(),text_2=child(div_3,!0);reset(div_3),template_effect(()=>set_text(text_2,$$props.messageContent)),append($$anchor2,div_3)};if_block(node_1,$$render=>{editCtx.isEditing?$$render(consequent_1):$$props.message.role===MessageRole.ASSISTANT?$$render(consequent_3,1):$$render(alternate_1,-1)})}var node_3=sibling(node_1,2);{var consequent_4=$$anchor2=>{var div_4=root_7$j(),div_5=child(div_4),span_1=child(div_5),
-text_3=child(span_1,!0);reset(span_1),reset(div_5),reset(div_4),template_effect($0=>set_text(text_3,$0),[()=>processingState.getPromptProgressText()??processingState.getProcessingMessage()??"Processing..."]),transition(1,div_4,()=>fade),append($$anchor2,div_4)};if_block(node_3,$$render=>{get$3(showProcessingInfoBottom)&&$$render(consequent_4)})}var div_6=sibling(node_3,2),node_4=child(div_6);{var consequent_9=$$anchor2=>{var div_7=root_8$l(),node_5=child(div_7);{var consequent_5=$$anchor3=>{{let $0=user_derived(
+$$render(alternate,-1)})}append($$anchor2,fragment_1)},alternate_1=$$anchor2=>{var div_3=root_6$m(),text_2=child(div_3,!0);reset(div_3),template_effect(()=>set_text(text_2,$$props.messageContent)),append($$anchor2,div_3)};if_block(node_1,$$render=>{editCtx.isEditing?$$render(consequent_1):$$props.message.role===MessageRole.ASSISTANT?$$render(consequent_3,1):$$render(alternate_1,-1)})}var node_3=sibling(node_1,2);{var consequent_4=$$anchor2=>{var div_4=root_7$j(),div_5=child(div_4),span_1=child(div_5),
+text_3=child(span_1,!0);reset(span_1),reset(div_5),reset(div_4),template_effect($0=>set_text(text_3,$0),[()=>processingState.getPromptProgressText()??processingState.getProcessingMessage()??"Processing..."]),transition(1,div_4,()=>fade),append($$anchor2,div_4)};if_block(node_3,$$render=>{get$3(showProcessingInfoBottom)&&$$render(consequent_4)})}var div_6=sibling(node_3,2),node_4=child(div_6);{var consequent_9=$$anchor2=>{var div_7=root_8$k(),node_5=child(div_7);{var consequent_5=$$anchor3=>{{let $0=user_derived(
isLoading);ModelsSelectorDropdown($$anchor3,{get currentModel(){return get$3(displayedModel)},get disabled(){return get$3($0)},onModelChange:async(modelId,modelName)=>(modelsStore.getModelStatus(modelId)!==ServerModelStatus.LOADED&&await modelsStore.loadModel(modelId),$$props.onRegenerate(modelName),!0)})}},alternate_2=$$anchor3=>{{let $0=user_derived(()=>get$3(displayedModel)||void 0);ModelBadge($$anchor3,{get model(){return get$3($0)},onclick:handleCopyModel})}};if_block(node_5,$$render=>{get$3(
isRouter)?$$render(consequent_5):$$render(alternate_2,-1)})}var node_6=sibling(node_5,2);{var consequent_6=$$anchor3=>{const agentic=user_derived(()=>$$props.message.timings.agentic);{let $0=user_derived(()=>get$3(agentic)?get$3(agentic).llm.prompt_n:$$props.message.timings.prompt_n),$1=user_derived(()=>get$3(agentic)?get$3(agentic).llm.prompt_ms:$$props.message.timings.prompt_ms),$2=user_derived(()=>get$3(agentic)?get$3(agentic).llm.predicted_n:$$props.message.timings.predicted_n),$3=user_derived(
()=>get$3(agentic)?get$3(agentic).llm.predicted_ms:$$props.message.timings.predicted_ms);ChatMessageStatistics($$anchor3,{get promptTokens(){return get$3($0)},get promptMs(){return get$3($1)},get predictedTokens(){return get$3($2)},get predictedMs(){return get$3($3)},get agenticTimings(){return get$3(agentic)},onActiveViewChange:handleStatsViewChange})}},consequent_8=$$anchor3=>{const liveStats=user_derived(()=>processingState.getLiveProcessingStats()),genStats=user_derived(()=>processingState.getLiveGenerationStats()),
currentConfig).showMessageStats&&$$props.message.timings&&$$props.message.timings.predicted_n&&$$props.message.timings.predicted_ms?$$render(consequent_6):get$3(d2)&&$$render(consequent_8,1)})}reset(div_7),bind_this(div_7,$$value=>set$1(statsContainerEl,$$value),()=>get$3(statsContainerEl)),append($$anchor2,div_7)};if_block(node_4,$$render=>{get$3(displayedModel)&&$$render(consequent_9)})}reset(div_6);var node_8=sibling(div_6,2);{var consequent_10=$$anchor2=>{{let $0=user_derived(()=>get$3(currentConfig).
enableContinueGeneration&&!get$3(hasReasoning)?$$props.onContinue:void 0);ChatMessageActionIcons($$anchor2,{get role(){return MessageRole.ASSISTANT},justify:"start",actionsPosition:"left",get siblingInfo(){return siblingInfo()},get showDeleteDialog(){return $$props.showDeleteDialog},get deletionInfo(){return $$props.deletionInfo},get onCopy(){return $$props.onCopy},get onEdit(){return $$props.onEdit},get onRegenerate(){return $$props.onRegenerate},get onContinue(){return get$3($0)},get onForkConversation(){
return $$props.onForkConversation},get onDelete(){return $$props.onDelete},get onConfirmDelete(){return $$props.onConfirmDelete},get onNavigateToSibling(){return $$props.onNavigateToSibling},get onShowDeleteDialogChange(){return $$props.onShowDeleteDialogChange},get showRawOutputSwitch(){return get$3(currentConfig).showRawOutputSwitch},get rawOutputEnabled(){return get$3(showRawOutput)},onRawOutputToggle:enabled=>set$1(showRawOutput,enabled,!0)})}};if_block(node_8,$$render=>{$$props.message.timestamp&&
-!editCtx.isEditing&&$$render(consequent_10)})}reset(div),template_effect(()=>set_class(div,1,`text-md group w-full leading-7.5 ${className()??""}`,"svelte-3902tz")),append($$anchor,div),pop()}var root_1$u=from_html('<div class="flex items-center gap-2"><!> <label for="save-only-switch" class="cursor-pointer text-xs text-muted-foreground">Update without re-sending</label></div>'),root_2$N=from_html('<div class="flex items-center gap-2"><!> <label for="branch-after-edit" class="cursor-pointer text\
--xs text-muted-foreground">Branch conversation after edit</label></div>'),root_3$E=from_html("<div></div>"),root_4$p=from_html("<!> Cancel",1),root$11=from_html('<div class="relative w-full max-w-[80%]"><!></div> <div class="mt-2 flex w-full max-w-[80%] items-center justify-between"><!> <!></div> <!>',1);function ChatMessageEditForm($$anchor,$$props){push$1($$props,!0);const editCtx=getMessageEditContext();let saveWithoutRegenerate=state$1(!1),showDiscardDialog=state$1(!1),branchAfterEdit=state$1(
+!editCtx.isEditing&&$$render(consequent_10)})}reset(div),template_effect(()=>set_class(div,1,`text-md group w-full leading-7.5 ${className()??""}`,"svelte-3902tz")),append($$anchor,div),pop()}var root_1$v=from_html('<div class="flex items-center gap-2"><!> <label for="save-only-switch" class="cursor-pointer text-xs text-muted-foreground">Update without re-sending</label></div>'),root_2$M=from_html('<div class="flex items-center gap-2"><!> <label for="branch-after-edit" class="cursor-pointer text\
+-xs text-muted-foreground">Branch conversation after edit</label></div>'),root_3$F=from_html("<div></div>"),root_4$q=from_html("<!> Cancel",1),root$12=from_html('<div class="relative w-full max-w-[80%]"><!></div> <div class="mt-2 flex w-full max-w-[80%] items-center justify-between"><!> <!></div> <!>',1);function ChatMessageEditForm($$anchor,$$props){push$1($$props,!0);const editCtx=getMessageEditContext();let saveWithoutRegenerate=state$1(!1),showDiscardDialog=state$1(!1),branchAfterEdit=state$1(
!1),isUserMessage=user_derived(()=>editCtx.messageRole===MessageRole.USER),isAssistantMessage=user_derived(()=>editCtx.messageRole===MessageRole.ASSISTANT),hasUnsavedChanges=user_derived(()=>!!(editCtx.editedContent!==editCtx.originalContent||editCtx.editedUploadedFiles.length>0||editCtx.editedExtras.length!==editCtx.originalExtras.length||editCtx.editedExtras.some((extra,i)=>extra!==editCtx.originalExtras[i]))),hasAttachments=user_derived(()=>editCtx.editedExtras&&editCtx.editedExtras.length>0||
editCtx.editedUploadedFiles&&editCtx.editedUploadedFiles.length>0),canSubmit=user_derived(()=>editCtx.editedContent.trim().length>0||get$3(hasAttachments));function handleGlobalKeydown(event2){event2.key===KeyboardKey.ESCAPE&&(event2.preventDefault(),attemptCancel())}function attemptCancel(){get$3(hasUnsavedChanges)?set$1(showDiscardDialog,!0):editCtx.cancel()}function handleSubmit(){get$3(canSubmit)&&(get$3(isUserMessage)&&get$3(saveWithoutRegenerate)&&editCtx.showSaveOnlyOption?editCtx.saveOnly():
(get$3(isAssistantMessage)&&editCtx.setShouldBranchAfterEdit&&editCtx.setShouldBranchAfterEdit(get$3(branchAfterEdit)),editCtx.save()),set$1(saveWithoutRegenerate,!1),set$1(branchAfterEdit,!1))}function handleAttachmentRemove(index2){const newExtras=[...editCtx.editedExtras];newExtras.splice(index2,1),editCtx.setExtras(newExtras)}function handleUploadedFileRemove(fileId){const newFiles=editCtx.editedUploadedFiles.filter(f=>f.id!==fileId);editCtx.setUploadedFiles(newFiles)}async function handleFilesAdd(files){
-const processed=await processFilesToChatUploaded(files);editCtx.setUploadedFiles([...editCtx.editedUploadedFiles,...processed])}function handleUploadedFilesChange(files){editCtx.setUploadedFiles(files)}user_effect(()=>(chatStore.setEditModeActive(handleFilesAdd),()=>{chatStore.clearEditMode()}));var fragment=root$11();event("keydown",$window,handleGlobalKeydown);var div=first_child(fragment),node2=child(div);{let $0=user_derived(()=>editCtx.messageRole===MessageRole.USER),$1=user_derived(()=>editCtx.
+const processed=await processFilesToChatUploaded(files);editCtx.setUploadedFiles([...editCtx.editedUploadedFiles,...processed])}function handleUploadedFilesChange(files){editCtx.setUploadedFiles(files)}user_effect(()=>(chatStore.setEditModeActive(handleFilesAdd),()=>{chatStore.clearEditMode()}));var fragment=root$12();event("keydown",$window,handleGlobalKeydown);var div=first_child(fragment),node2=child(div);{let $0=user_derived(()=>editCtx.messageRole===MessageRole.USER),$1=user_derived(()=>editCtx.
messageRole===MessageRole.USER);ChatForm(node2,{get value(){return editCtx.editedContent},get attachments(){return editCtx.editedExtras},get uploadedFiles(){return editCtx.editedUploadedFiles},placeholder:"Edit your message...",showMcpPromptButton:!0,get showAddButton(){return get$3($0)},get showModelSelector(){return get$3($1)},get onValueChange(){return editCtx.setContent},onAttachmentRemove:handleAttachmentRemove,onUploadedFileRemove:handleUploadedFileRemove,onUploadedFilesChange:handleUploadedFilesChange,
-onFilesAdd:handleFilesAdd,onSubmit:handleSubmit})}reset(div);var div_1=sibling(div,2),node_1=child(div_1);{var consequent=$$anchor2=>{var div_2=root_1$u(),node_2=child(div_2);Switch(node_2,{id:"save-only-switch",class:"scale-75",get checked(){return get$3(saveWithoutRegenerate)},set checked($$value){set$1(saveWithoutRegenerate,$$value,!0)}}),next$1(2),reset(div_2),append($$anchor2,div_2)},consequent_1=$$anchor2=>{var div_3=root_2$N(),node_3=child(div_3);Switch(node_3,{id:"branch-after-edit",class:"\
-scale-75",get checked(){return get$3(branchAfterEdit)},set checked($$value){set$1(branchAfterEdit,$$value,!0)}}),next$1(2),reset(div_3),append($$anchor2,div_3)},alternate=$$anchor2=>{var div_4=root_3$E();append($$anchor2,div_4)};if_block(node_1,$$render=>{get$3(isUserMessage)&&editCtx.showSaveOnlyOption?$$render(consequent):get$3(isAssistantMessage)?$$render(consequent_1,1):$$render(alternate,-1)})}var node_4=sibling(node_1,2);Button(node_4,{class:"h-7 px-3 text-xs",onclick:attemptCancel,size:"s\
-m",variant:"ghost",children:($$anchor2,$$slotProps)=>{var fragment_1=root_4$p(),node_5=first_child(fragment_1);X(node_5,{class:"mr-1 h-3 w-3"}),next$1(),append($$anchor2,fragment_1)},$$slots:{default:!0}}),reset(div_1);var node_6=sibling(div_1,2);DialogConfirmation(node_6,{title:"Discard changes?",description:"You have unsaved changes. Are you sure you want to discard them?",confirmText:"Discard",cancelText:"Keep editing",variant:"destructive",get icon(){return Triangle_alert},get onConfirm(){return editCtx.
-cancel},onCancel:()=>set$1(showDiscardDialog,!1),get open(){return get$3(showDiscardDialog)},set open($$value){set$1(showDiscardDialog,$$value,!0)}}),append($$anchor,fragment),pop()}var root_3$D=from_html('<div class="max-w-[80%]"><!></div>'),root_2$M=from_html("<!> <!>",1),root$10=from_html('<div aria-label="User message with actions" role="group"><!></div>');function ChatMessageUser($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),siblingInfo=prop($$props,"siblingI\
-nfo",3,null);const editCtx=getMessageEditContext();var div=root$10(),node2=child(div);{var consequent=$$anchor2=>{ChatMessageEditForm($$anchor2,{})},alternate=$$anchor2=>{var fragment_1=root_2$M(),node_1=first_child(fragment_1);ChatMessageUserBubble(node_1,{get content(){return $$props.message.content},get attachments(){return $$props.message.extra},renderMarkdown:!0});var node_2=sibling(node_1,2);{var consequent_1=$$anchor3=>{var div_1=root_3$D(),node_3=child(div_1);ChatMessageActionIcons(node_3,
+onFilesAdd:handleFilesAdd,onSubmit:handleSubmit})}reset(div);var div_1=sibling(div,2),node_1=child(div_1);{var consequent=$$anchor2=>{var div_2=root_1$v(),node_2=child(div_2);Switch(node_2,{id:"save-only-switch",class:"scale-75",get checked(){return get$3(saveWithoutRegenerate)},set checked($$value){set$1(saveWithoutRegenerate,$$value,!0)}}),next$1(2),reset(div_2),append($$anchor2,div_2)},consequent_1=$$anchor2=>{var div_3=root_2$M(),node_3=child(div_3);Switch(node_3,{id:"branch-after-edit",class:"\
+scale-75",get checked(){return get$3(branchAfterEdit)},set checked($$value){set$1(branchAfterEdit,$$value,!0)}}),next$1(2),reset(div_3),append($$anchor2,div_3)},alternate=$$anchor2=>{var div_4=root_3$F();append($$anchor2,div_4)};if_block(node_1,$$render=>{get$3(isUserMessage)&&editCtx.showSaveOnlyOption?$$render(consequent):get$3(isAssistantMessage)?$$render(consequent_1,1):$$render(alternate,-1)})}var node_4=sibling(node_1,2);Button(node_4,{class:"h-7 px-3 text-xs",onclick:attemptCancel,size:"s\
+m",variant:"ghost",children:($$anchor2,$$slotProps)=>{var fragment_1=root_4$q(),node_5=first_child(fragment_1);X(node_5,{class:"mr-1 h-3 w-3"}),next$1(),append($$anchor2,fragment_1)},$$slots:{default:!0}}),reset(div_1);var node_6=sibling(div_1,2);DialogConfirmation(node_6,{title:"Discard changes?",description:"You have unsaved changes. Are you sure you want to discard them?",confirmText:"Discard",cancelText:"Keep editing",variant:"destructive",get icon(){return Triangle_alert},get onConfirm(){return editCtx.
+cancel},onCancel:()=>set$1(showDiscardDialog,!1),get open(){return get$3(showDiscardDialog)},set open($$value){set$1(showDiscardDialog,$$value,!0)}}),append($$anchor,fragment),pop()}var root_3$E=from_html('<div class="max-w-[80%]"><!></div>'),root_2$L=from_html("<!> <!>",1),root$11=from_html('<div aria-label="User message with actions" role="group"><!></div>');function ChatMessageUser($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),siblingInfo=prop($$props,"siblingI\
+nfo",3,null);const editCtx=getMessageEditContext();var div=root$11(),node2=child(div);{var consequent=$$anchor2=>{ChatMessageEditForm($$anchor2,{})},alternate=$$anchor2=>{var fragment_1=root_2$L(),node_1=first_child(fragment_1);ChatMessageUserBubble(node_1,{get content(){return $$props.message.content},get attachments(){return $$props.message.extra},renderMarkdown:!0});var node_2=sibling(node_1,2);{var consequent_1=$$anchor3=>{var div_1=root_3$E(),node_3=child(div_1);ChatMessageActionIcons(node_3,
{actionsPosition:"right",get deletionInfo(){return $$props.deletionInfo},justify:"end",get onConfirmDelete(){return $$props.onConfirmDelete},get onCopy(){return $$props.onCopy},get onDelete(){return $$props.onDelete},get onEdit(){return $$props.onEdit},get onForkConversation(){return $$props.onForkConversation},get onNavigateToSibling(){return $$props.onNavigateToSibling},get onShowDeleteDialogChange(){return $$props.onShowDeleteDialogChange},get siblingInfo(){return siblingInfo()},get showDeleteDialog(){
-return $$props.showDeleteDialog},get role(){return MessageRole.USER}}),reset(div_1),append($$anchor3,div_1)};if_block(node_2,$$render=>{$$props.message.timestamp&&$$render(consequent_1)})}append($$anchor2,fragment_1)};if_block(node2,$$render=>{editCtx.isEditing?$$render(consequent):$$render(alternate,-1)})}reset(div),template_effect(()=>set_class(div,1,`group flex flex-col items-end gap-3 md:gap-2 ${className()??""}`)),append($$anchor,div),pop()}var root_1$t=from_html('<div class="mb-2 max-w-[80\
-%]"><!></div>'),root_4$o=from_html("<div><!></div>"),root_5$m=from_html('<span class="text-md whitespace-pre-wrap"> </span>'),root$$=from_html("<!> <!>",1);function ChatMessageUserBubble($$anchor,$$props){push$1($$props,!0);let attachments=prop($$props,"attachments",19,()=>[]),renderMarkdown=prop($$props,"renderMarkdown",3,!1),textColorClass=prop($$props,"textColorClass",3,"text-foreground"),cardBgClass=prop($$props,"cardBgClass",3,"dark:bg-primary/15"),maxHeightStyle=prop($$props,"maxHeightStyl\
-e",3,"max-height: var(--max-message-height);"),isMultiline=state$1(!1),messageElement=state$1(void 0);const currentConfig=config$1();user_effect(()=>{if(!get$3(messageElement)||!$$props.content.trim())return;if($$props.content.includes(`
-`)){set$1(isMultiline,!0);return}const resizeObserver=new ResizeObserver(entries=>{for(const entry of entries){const element2=entry.target;set$1(isMultiline,element2.offsetHeight>24*1.5)}});return resizeObserver.observe(get$3(messageElement)),()=>{resizeObserver.disconnect()}});var fragment=root$$(),node2=first_child(fragment);{var consequent=$$anchor2=>{var div=root_1$t(),node_1=child(div);ChatAttachmentsList(node_1,{get attachments(){return attachments()},readonly:!0,imageHeight:"h-40"}),reset(
+return $$props.showDeleteDialog},get role(){return MessageRole.USER}}),reset(div_1),append($$anchor3,div_1)};if_block(node_2,$$render=>{$$props.message.timestamp&&$$render(consequent_1)})}append($$anchor2,fragment_1)};if_block(node2,$$render=>{editCtx.isEditing?$$render(consequent):$$render(alternate,-1)})}reset(div),template_effect(()=>set_class(div,1,`group flex flex-col items-end gap-3 md:gap-2 ${className()??""}`)),append($$anchor,div),pop()}var root_1$u=from_html('<div class="mb-2 max-w-[80\
+%]"><!></div>'),root_4$p=from_html("<div><!></div>"),root_5$l=from_html('<span class="text-md whitespace-pre-wrap"> </span>'),root$10=from_html("<!> <!>",1);function ChatMessageUserBubble($$anchor,$$props){push$1($$props,!0);let attachments=prop($$props,"attachments",19,()=>[]),renderMarkdown=prop($$props,"renderMarkdown",3,!1),textColorClass=prop($$props,"textColorClass",3,"text-foreground"),cardBgClass=prop($$props,"cardBgClass",3,"dark:bg-primary/15"),maxHeightStyle=prop($$props,"maxHeightSty\
+le",3,"max-height: var(--max-message-height);"),isMultiline=state$1(!1),messageElement=state$1(void 0);const currentConfig=config$1();user_effect(()=>{if(!get$3(messageElement)||!$$props.content.trim())return;if($$props.content.includes(`
+`)){set$1(isMultiline,!0);return}const resizeObserver=new ResizeObserver(entries=>{for(const entry of entries){const element2=entry.target;set$1(isMultiline,element2.offsetHeight>24*1.5)}});return resizeObserver.observe(get$3(messageElement)),()=>{resizeObserver.disconnect()}});var fragment=root$10(),node2=first_child(fragment);{var consequent=$$anchor2=>{var div=root_1$u(),node_1=child(div);ChatAttachmentsList(node_1,{get attachments(){return attachments()},readonly:!0,imageHeight:"h-40"}),reset(
div),append($$anchor2,div)};if_block(node2,$$render=>{attachments()&&attachments().length>0&&$$render(consequent)})}var node_2=sibling(node2,2);{var consequent_2=$$anchor2=>{{let $0=user_derived(()=>get$3(isMultiline)?"":void 0);Card($$anchor2,{get class(){return`max-w-[80%] overflow-y-auto rounded-[1.125rem] border-none bg-primary/5 px-3.75 py-1.5 ${textColorClass()??""} backdrop-blur-md data-[multiline]:py-2.5 ${cardBgClass()??""}`},get"data-multiline"(){return get$3($0)},get style(){return`${maxHeightStyle()??
-""} overflow-wrap: anywhere; word-break: break-word;`},children:($$anchor3,$$slotProps)=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);{var consequent_1=$$anchor4=>{var div_1=root_4$o(),node_4=child(div_1);MarkdownContent(node_4,{class:"markdown-user-content -my-4",get content(){return $$props.content}}),reset(div_1),bind_this(div_1,$$value=>set$1(messageElement,$$value),()=>get$3(messageElement)),append($$anchor4,div_1)},alternate=$$anchor4=>{var span=root_5$m(),text2=child(span,!0);
+""} overflow-wrap: anywhere; word-break: break-word;`},children:($$anchor3,$$slotProps)=>{var fragment_2=comment$2(),node_3=first_child(fragment_2);{var consequent_1=$$anchor4=>{var div_1=root_4$p(),node_4=child(div_1);MarkdownContent(node_4,{class:"markdown-user-content -my-4",get content(){return $$props.content}}),reset(div_1),bind_this(div_1,$$value=>set$1(messageElement,$$value),()=>get$3(messageElement)),append($$anchor4,div_1)},alternate=$$anchor4=>{var span=root_5$l(),text2=child(span,!0);
reset(span),bind_this(span,$$value=>set$1(messageElement,$$value),()=>get$3(messageElement)),template_effect(()=>set_text(text2,$$props.content)),append($$anchor4,span)};if_block(node_3,$$render=>{renderMarkdown()&¤tConfig.renderUserContentAsMarkdown?$$render(consequent_1):$$render(alternate,-1)})}append($$anchor3,fragment_2)},$$slots:{default:!0}})}},d2=user_derived(()=>$$props.content.trim());if_block(node_2,$$render=>{get$3(d2)&&$$render(consequent_2)})}append($$anchor,fragment),pop()}function useMessageEditContext(options){
let isEditing2=state$1(!1),editedContent=state$1(""),editedExtras=state$1(proxy([])),editedUploadedFiles=state$1(proxy([]));function handleEdit(){set$1(editedContent,options.getContent(),!0),set$1(editedExtras,[...options.getExtras()],!0),set$1(editedUploadedFiles,[],!0),set$1(isEditing2,!0)}async function handleSaveEdit(){const trimmed=get$3(editedContent).trim();if(!trimmed&&get$3(editedExtras).length===0&&get$3(editedUploadedFiles).length===0)return;let finalExtras=snapshot(get$3(editedExtras));
if(get$3(editedUploadedFiles).length>0){const plainFiles=snapshot(get$3(editedUploadedFiles)),newExtras=(await parseFilesToMessageExtras(plainFiles))?.extras||[];finalExtras=[...finalExtras,...newExtras]}options.onSave(trimmed,finalExtras.length>0?finalExtras:void 0),set$1(isEditing2,!1)}function handleCancelEdit(){set$1(isEditing2,!1)}return setMessageEditContext({get isEditing(){return get$3(isEditing2)},get editedContent(){return get$3(editedContent)},get editedExtras(){return get$3(editedExtras)},
get editedUploadedFiles(){return get$3(editedUploadedFiles)},get originalContent(){return options.getContent()},get originalExtras(){return options.getExtras()},get showSaveOnlyOption(){return options.showSaveOnlyOption??!1},get showBranchAfterEditOption(){return!1},get shouldBranchAfterEdit(){return!1},get messageRole(){return MessageRole.USER},setContent:c2=>{set$1(editedContent,c2,!0)},setExtras:e=>{set$1(editedExtras,e,!0)},setUploadedFiles:f=>{set$1(editedUploadedFiles,f,!0)},save:handleSaveEdit,
-saveOnly:handleSaveEdit,cancel:handleCancelEdit,startEdit:handleEdit}),{get isEditing(){return get$3(isEditing2)},handleEdit,handleSaveEdit,handleCancelEdit}}var root_2$L=from_html('<!> <div class="max-w-[80%]"><div class="relative flex h-6 items-center justify-between"><div class="right-0 flex items-center gap-2 opacity-100 transition-opacity"><div class="pointer-events-auto inset-0 flex items-center gap-1 opacity-0 transition-all duration-150 group-hover:opacity-100"><!> <!> <!></div></div></d\
-iv></div>',1),root$_=from_html('<div aria-label="Pending user message" role="group"><!></div>');function ChatMessageUserPending($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),extras=prop($$props,"extras",19,()=>[]);const processingInfoCtx=getProcessingInfoContext();let showProcessingInfo=user_derived(()=>processingInfoCtx.showProcessingInfo);const editCtx=useMessageEditContext({getContent:()=>$$props.content,getExtras:()=>extras(),onSave:(content2,extras2)=>$$props.
-onEdit(content2,extras2)});var div=root$_(),node2=child(div);{var consequent=$$anchor2=>{ChatMessageEditForm($$anchor2,{})},alternate=$$anchor2=>{var fragment_1=root_2$L(),node_1=first_child(fragment_1);ChatMessageUserBubble(node_1,{get content(){return $$props.content},get attachments(){return extras()},textColorClass:"text-muted-foreground",cardBgClass:"dark:bg-primary/8",maxHeightStyle:"overflow-wrap: anywhere; word-break: break-word;"});var div_1=sibling(node_1,2),div_2=child(div_1),div_3=child(
+saveOnly:handleSaveEdit,cancel:handleCancelEdit,startEdit:handleEdit}),{get isEditing(){return get$3(isEditing2)},handleEdit,handleSaveEdit,handleCancelEdit}}var root_2$K=from_html('<!> <div class="max-w-[80%]"><div class="relative flex h-6 items-center justify-between"><div class="right-0 flex items-center gap-2 opacity-100 transition-opacity"><div class="pointer-events-auto inset-0 flex items-center gap-1 opacity-0 transition-all duration-150 group-hover:opacity-100"><!> <!> <!></div></div></d\
+iv></div>',1),root$$=from_html('<div aria-label="Pending user message" role="group"><!></div>');function ChatMessageUserPending($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),extras=prop($$props,"extras",19,()=>[]);const processingInfoCtx=getProcessingInfoContext();let showProcessingInfo=user_derived(()=>processingInfoCtx.showProcessingInfo);const editCtx=useMessageEditContext({getContent:()=>$$props.content,getExtras:()=>extras(),onSave:(content2,extras2)=>$$props.
+onEdit(content2,extras2)});var div=root$$(),node2=child(div);{var consequent=$$anchor2=>{ChatMessageEditForm($$anchor2,{})},alternate=$$anchor2=>{var fragment_1=root_2$K(),node_1=first_child(fragment_1);ChatMessageUserBubble(node_1,{get content(){return $$props.content},get attachments(){return extras()},textColorClass:"text-muted-foreground",cardBgClass:"dark:bg-primary/8",maxHeightStyle:"overflow-wrap: anywhere; word-break: break-word;"});var div_1=sibling(node_1,2),div_2=child(div_1),div_3=child(
div_2),div_4=child(div_3),node_2=child(div_4);ActionIcon(node_2,{get icon(){return Square_pen},tooltip:"Edit",get onclick(){return editCtx.handleEdit}});var node_3=sibling(node_2,2);ActionIcon(node_3,{get icon(){return Trash_2},tooltip:"Delete",get onclick(){return $$props.onDelete}});var node_4=sibling(node_3,2);ActionIcon(node_4,{get icon(){return Arrow_up},tooltip:"Send immediately",get onclick(){return $$props.onSendImmediately}}),reset(div_4),reset(div_3),reset(div_2),reset(div_1),append($$anchor2,
-fragment_1)};if_block(node2,$$render=>{editCtx.isEditing?$$render(consequent):$$render(alternate,-1)})}reset(div),action(div,$$node=>fadeInView?.($$node)),template_effect(()=>set_class(div,1,`group flex flex-col items-end gap-3 transition-opacity hover:opacity-80 md:gap-2 ${className()??""} sticky ${get$3(showProcessingInfo)?"bottom-44":"bottom-32"}`)),append($$anchor,div),pop()}var root_2$K=from_html("<!> Cancel",1),root_3$C=from_html("<!> Save",1),root_1$s=from_html('<div class="w-full max-w-[\
-80%]"><textarea placeholder="Edit system message..."></textarea> <div class="mt-2 flex justify-end gap-2"><!> <!></div></div>'),root_7$i=from_html("<div><!></div>"),root_8$k=from_html("<span> </span>"),root_9$e=from_html('<div class="pointer-events-none absolute right-0 bottom-0 left-0 h-48 bg-gradient-to-t from-muted to-transparent"></div> <div class="pointer-events-none absolute right-0 bottom-4 left-0 flex justify-center opacity-0 transition-opacity group-hover/expand:opacity-100"><!></div>',
-1),root_11$8=from_html('<div class="mb-2 flex justify-center"><!></div>'),root_6$m=from_html("<div><!> <!></div> <!>",1),root_5$l=from_html('<div class="relative max-w-[80%]"><button type="button"><!></button></div>'),root_13$6=from_html('<div class="max-w-[80%]"><!></div>'),root_4$n=from_html("<!> <!>",1),root$Z=from_html('<div aria-label="System message with actions" role="group"><!></div>');function ChatMessageSystem($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),
+fragment_1)};if_block(node2,$$render=>{editCtx.isEditing?$$render(consequent):$$render(alternate,-1)})}reset(div),action(div,$$node=>fadeInView?.($$node)),template_effect(()=>set_class(div,1,`group flex flex-col items-end gap-3 transition-opacity hover:opacity-80 md:gap-2 ${className()??""} sticky ${get$3(showProcessingInfo)?"bottom-44":"bottom-32"}`)),append($$anchor,div),pop()}var root_2$J=from_html("<!> Cancel",1),root_3$D=from_html("<!> Save",1),root_1$t=from_html('<div class="w-full max-w-[\
+80%]"><textarea placeholder="Edit system message..."></textarea> <div class="mt-2 flex justify-end gap-2"><!> <!></div></div>'),root_7$i=from_html("<div><!></div>"),root_8$j=from_html("<span> </span>"),root_9$e=from_html('<div class="pointer-events-none absolute right-0 bottom-0 left-0 h-48 bg-gradient-to-t from-muted to-transparent"></div> <div class="pointer-events-none absolute right-0 bottom-4 left-0 flex justify-center opacity-0 transition-opacity group-hover/expand:opacity-100"><!></div>',
+1),root_11$8=from_html('<div class="mb-2 flex justify-center"><!></div>'),root_6$l=from_html("<div><!> <!></div> <!>",1),root_5$k=from_html('<div class="relative max-w-[80%]"><button type="button"><!></button></div>'),root_13$6=from_html('<div class="max-w-[80%]"><!></div>'),root_4$o=from_html("<!> <!>",1),root$_=from_html('<div aria-label="System message with actions" role="group"><!></div>');function ChatMessageSystem($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),
siblingInfo=prop($$props,"siblingInfo",3,null),textareaElement=prop($$props,"textareaElement",15);const editCtx=getMessageEditContext();function handleEditKeydown(event2){event2.key===KeyboardKey.ENTER&&!event2.shiftKey&&!isIMEComposing(event2)?(event2.preventDefault(),editCtx.save()):event2.key===KeyboardKey.ESCAPE&&(event2.preventDefault(),editCtx.cancel())}let isMultiline=state$1(!1),messageElement=state$1(void 0),isExpanded=state$1(!1),contentHeight=state$1(0);const MAX_HEIGHT=200,currentConfig=config$1();
let showExpandButton=user_derived(()=>get$3(contentHeight)>MAX_HEIGHT);user_effect(()=>{if(!get$3(messageElement)||!$$props.message.content.trim())return;$$props.message.content.includes(`
-`)&&set$1(isMultiline,!0);const resizeObserver=new ResizeObserver(entries=>{for(const entry of entries){const element2=entry.target;set$1(isMultiline,element2.offsetHeight>24*1.5),set$1(contentHeight,element2.scrollHeight,!0)}});return resizeObserver.observe(get$3(messageElement)),()=>{resizeObserver.disconnect()}});function toggleExpand(){set$1(isExpanded,!get$3(isExpanded))}var div=root$Z(),node2=child(div);{var consequent=$$anchor2=>{var div_1=root_1$s(),textarea=child(div_1);remove_textarea_child(
-textarea),bind_this(textarea,$$value=>textareaElement($$value),()=>textareaElement());var div_2=sibling(textarea,2),node_1=child(div_2);Button(node_1,{class:"h-8 px-3",get onclick(){return editCtx.cancel},size:"sm",variant:"outline",children:($$anchor3,$$slotProps)=>{var fragment=root_2$K(),node_2=first_child(fragment);X(node_2,{class:"mr-1 h-3 w-3"}),next$1(),append($$anchor3,fragment)},$$slots:{default:!0}});var node_3=sibling(node_1,2);{let $0=user_derived(()=>!editCtx.editedContent.trim());Button(
-node_3,{class:"h-8 px-3",get onclick(){return editCtx.save},get disabled(){return get$3($0)},size:"sm",children:($$anchor3,$$slotProps)=>{var fragment_1=root_3$C(),node_4=first_child(fragment_1);Check(node_4,{class:"mr-1 h-3 w-3"}),next$1(),append($$anchor3,fragment_1)},$$slots:{default:!0}})}reset(div_2),reset(div_1),template_effect(()=>{set_value(textarea,editCtx.editedContent),set_class(textarea,1,`min-h-[60px] w-full resize-none rounded-2xl px-3 py-2 text-sm ${INPUT_CLASSES??""}`)}),delegated(
-"keydown",textarea,handleEditKeydown),delegated("input",textarea,e=>editCtx.setContent(e.currentTarget.value)),append($$anchor2,div_1)},alternate_1=$$anchor2=>{var fragment_2=root_4$n(),node_5=first_child(fragment_2);{var consequent_4=$$anchor3=>{var div_3=root_5$l(),button=child(div_3),node_6=child(button);{let $0=user_derived(()=>get$3(isMultiline)?"":void 0);Card(node_6,{class:"overflow-y-auto rounded-[1.125rem] !border-2 !border-dashed !border-border/50 bg-muted px-3.75 py-1.5 data-[multilin\
-e]:py-2.5",get"data-multiline"(){return get$3($0)},style:"border: 2px dashed hsl(var(--border)); max-height: var(--max-message-height); overflow-wrap: anywhere; word-break: break-word;",children:($$anchor4,$$slotProps)=>{var fragment_3=root_6$m(),div_4=first_child(fragment_3),node_7=child(div_4);{var consequent_1=$$anchor5=>{var div_5=root_7$i(),node_8=child(div_5);MarkdownContent(node_8,{class:"markdown-system-content -my-4",get content(){return $$props.message.content}}),reset(div_5),bind_this(
-div_5,$$value=>set$1(messageElement,$$value),()=>get$3(messageElement)),template_effect(()=>set_class(div_5,1,clsx(get$3(isExpanded)?"cursor-text":""))),append($$anchor5,div_5)},alternate=$$anchor5=>{var span=root_8$k(),text2=child(span,!0);reset(span),bind_this(span,$$value=>set$1(messageElement,$$value),()=>get$3(messageElement)),template_effect(()=>{set_class(span,1,`text-md whitespace-pre-wrap ${get$3(isExpanded)?"cursor-text":""}`),set_text(text2,$$props.message.content)}),append($$anchor5,
+`)&&set$1(isMultiline,!0);const resizeObserver=new ResizeObserver(entries=>{for(const entry of entries){const element2=entry.target;set$1(isMultiline,element2.offsetHeight>24*1.5),set$1(contentHeight,element2.scrollHeight,!0)}});return resizeObserver.observe(get$3(messageElement)),()=>{resizeObserver.disconnect()}});function toggleExpand(){set$1(isExpanded,!get$3(isExpanded))}var div=root$_(),node2=child(div);{var consequent=$$anchor2=>{var div_1=root_1$t(),textarea=child(div_1);remove_textarea_child(
+textarea),bind_this(textarea,$$value=>textareaElement($$value),()=>textareaElement());var div_2=sibling(textarea,2),node_1=child(div_2);Button(node_1,{class:"h-8 px-3",get onclick(){return editCtx.cancel},size:"sm",variant:"outline",children:($$anchor3,$$slotProps)=>{var fragment=root_2$J(),node_2=first_child(fragment);X(node_2,{class:"mr-1 h-3 w-3"}),next$1(),append($$anchor3,fragment)},$$slots:{default:!0}});var node_3=sibling(node_1,2);{let $0=user_derived(()=>!editCtx.editedContent.trim());Button(
+node_3,{class:"h-8 px-3",get onclick(){return editCtx.save},get disabled(){return get$3($0)},size:"sm",children:($$anchor3,$$slotProps)=>{var fragment_1=root_3$D(),node_4=first_child(fragment_1);Check(node_4,{class:"mr-1 h-3 w-3"}),next$1(),append($$anchor3,fragment_1)},$$slots:{default:!0}})}reset(div_2),reset(div_1),template_effect(()=>{set_value(textarea,editCtx.editedContent),set_class(textarea,1,`min-h-[60px] w-full resize-none rounded-2xl px-3 py-2 text-sm ${INPUT_CLASSES??""}`)}),delegated(
+"keydown",textarea,handleEditKeydown),delegated("input",textarea,e=>editCtx.setContent(e.currentTarget.value)),append($$anchor2,div_1)},alternate_1=$$anchor2=>{var fragment_2=root_4$o(),node_5=first_child(fragment_2);{var consequent_4=$$anchor3=>{var div_3=root_5$k(),button=child(div_3),node_6=child(button);{let $0=user_derived(()=>get$3(isMultiline)?"":void 0);Card(node_6,{class:"overflow-y-auto rounded-[1.125rem] !border-2 !border-dashed !border-border/50 bg-muted px-3.75 py-1.5 data-[multilin\
+e]:py-2.5",get"data-multiline"(){return get$3($0)},style:"border: 2px dashed hsl(var(--border)); max-height: var(--max-message-height); overflow-wrap: anywhere; word-break: break-word;",children:($$anchor4,$$slotProps)=>{var fragment_3=root_6$l(),div_4=first_child(fragment_3),node_7=child(div_4);{var consequent_1=$$anchor5=>{var div_5=root_7$i(),node_8=child(div_5);MarkdownContent(node_8,{class:"markdown-system-content -my-4",get content(){return $$props.message.content}}),reset(div_5),bind_this(
+div_5,$$value=>set$1(messageElement,$$value),()=>get$3(messageElement)),template_effect(()=>set_class(div_5,1,clsx(get$3(isExpanded)?"cursor-text":""))),append($$anchor5,div_5)},alternate=$$anchor5=>{var span=root_8$j(),text2=child(span,!0);reset(span),bind_this(span,$$value=>set$1(messageElement,$$value),()=>get$3(messageElement)),template_effect(()=>{set_class(span,1,`text-md whitespace-pre-wrap ${get$3(isExpanded)?"cursor-text":""}`),set_text(text2,$$props.message.content)}),append($$anchor5,
span)};if_block(node_7,$$render=>{currentConfig.renderUserContentAsMarkdown?$$render(consequent_1):$$render(alternate,-1)})}var node_9=sibling(node_7,2);{var consequent_2=$$anchor5=>{var fragment_4=root_9$e(),div_6=sibling(first_child(fragment_4),2),node_10=child(div_6);Button(node_10,{class:"rounded-full px-4 py-1.5 text-xs shadow-md",size:"sm",variant:"outline",children:($$anchor6,$$slotProps2)=>{next$1();var text_1=text$8("Show full system message");append($$anchor6,text_1)},$$slots:{default:!0}}),
reset(div_6),append($$anchor5,fragment_4)};if_block(node_9,$$render=>{!get$3(isExpanded)&&get$3(showExpandButton)&&$$render(consequent_2)})}reset(div_4);var node_11=sibling(div_4,2);{var consequent_3=$$anchor5=>{var div_7=root_11$8(),node_12=child(div_7);Button(node_12,{class:"rounded-full px-4 py-1.5 text-xs",onclick:e=>{e.stopPropagation(),toggleExpand()},size:"sm",variant:"outline",children:($$anchor6,$$slotProps2)=>{next$1();var text_2=text$8("Collapse System Message");append($$anchor6,text_2)},
$$slots:{default:!0}}),reset(div_7),append($$anchor5,div_7)};if_block(node_11,$$render=>{get$3(isExpanded)&&get$3(showExpandButton)&&$$render(consequent_3)})}template_effect(()=>{set_class(div_4,1,`relative transition-all duration-300 ${get$3(isExpanded)?"cursor-text select-text":"select-none"}`),set_style(div_4,!get$3(isExpanded)&&get$3(showExpandButton)?`max-height: ${MAX_HEIGHT}px;`:"max-height: none;")}),append($$anchor4,fragment_3)},$$slots:{default:!0}})}reset(button),reset(div_3),template_effect(
()=>{!this._autoScrollEnabled||this._rafPending||(this._rafPending=!0,requestAnimationFrame(()=>{this._rafPending=!1,this._autoScrollEnabled&&this._container&&(isReverse?this._container.scrollTop=0:this._container.scrollTop=this._container.scrollHeight)}))}),this._mutationObserver.observe(this._container,{childList:!0,subtree:!0,characterData:!0})}_doStopObserving(){this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this._rafPending=!1}}function createAutoScrollController(options={}){
return new AutoScrollController(options)}function useKeyboardShortcuts(callbacks){function handleKeydown(event2){const isCmdOrCtrl=event2.metaKey||event2.ctrlKey;isCmdOrCtrl&&event2.key===KeyboardKey.K_LOWER&&(event2.preventDefault(),callbacks.activateSearchMode?.(),callbacks.onSearchActivated?.()),isCmdOrCtrl&&event2.shiftKey&&(event2.key===KeyboardKey.O_LOWER||event2.key===KeyboardKey.O_UPPER)&&(event2.preventDefault(),goto("?new_chat=true#/")),event2.shiftKey&&isCmdOrCtrl&&event2.key===KeyboardKey.
E_UPPER&&(event2.preventDefault(),callbacks.editActiveConversation?.()),isCmdOrCtrl&&event2.shiftKey&&(event2.key===KeyboardKey.D_LOWER||event2.key===KeyboardKey.D_UPPER)&&(event2.preventDefault(),callbacks.deleteActiveConversation?.()),isCmdOrCtrl&&event2.shiftKey&&event2.key===KeyboardKey.ARROW_UP&&(event2.preventDefault(),callbacks.navigateToPrevConversation?.()),isCmdOrCtrl&&event2.shiftKey&&event2.key===KeyboardKey.ARROW_DOWN&&(event2.preventDefault(),callbacks.navigateToNextConversation?.())}
-return{handleKeydown}}var root_5$k=from_html('<div class="mb-8 px-4 text-center"><h1 class="mb-2 text-2xl font-semibold tracking-tight md:text-3xl">Hello there</h1> <p class="text-muted-foreground md:text-lg"> </p></div>'),root_9$d=from_html('<span>Server unavailable</span> <button class="flex items-center gap-1.5 rounded-lg bg-destructive/20 px-2 py-1 text-xs font-medium hover:bg-destructive/30 disabled:opacity-50"><!> </button>',1),root_8$j=from_html("<!> <!> <!>",1),root_7$h=from_html('<div c\
-lass="pointer-events-auto mx-auto mb-4 max-w-[48rem] px-1"><!></div>'),root_3$B=from_html('<div aria-label="Chat interface with file drop zone" class="flex h-full flex-col-reverse overflow-y-auto px-4 md:px-6" role="main"><div class="flex grow flex-col pt-14"><!> <div><!> <!> <!> <div class="conversation-chat-form pointer-events-auto rounded-t-3xl"><!></div></div></div></div>'),root$Y=from_html("<!> <!> <!> <!> <!> <!>",1);function ChatScreen($$anchor,$$props){push$1($$props,!0);let showCenteredEmpty=prop(
+return{handleKeydown}}var root_5$j=from_html('<div class="mb-8 px-4 text-center"><h1 class="mb-2 text-2xl font-semibold tracking-tight md:text-3xl">Hello there</h1> <p class="text-muted-foreground md:text-lg"> </p></div>'),root_9$d=from_html('<span>Server unavailable</span> <button class="flex items-center gap-1.5 rounded-lg bg-destructive/20 px-2 py-1 text-xs font-medium hover:bg-destructive/30 disabled:opacity-50"><!> </button>',1),root_8$i=from_html("<!> <!> <!>",1),root_7$h=from_html('<div c\
+lass="pointer-events-auto mx-auto mb-4 max-w-[48rem] px-1"><!></div>'),root_3$C=from_html('<div aria-label="Chat interface with file drop zone" class="flex h-full flex-col-reverse overflow-y-auto px-4 md:px-6" role="main"><div class="flex grow flex-col pt-14"><!> <div><!> <!> <!> <div class="conversation-chat-form pointer-events-auto rounded-t-3xl"><!></div></div></div></div>'),root$Z=from_html("<!> <!> <!> <!> <!> <!>",1);function ChatScreen($$anchor,$$props){push$1($$props,!0);let showCenteredEmpty=prop(
$$props,"showCenteredEmpty",3,!1),disableAutoScroll=user_derived(()=>!!config$1().disableAutoScroll),chatScrollContainer=state$1(void 0),dragCounter=state$1(0),isDragOver=state$1(!1),showFileErrorDialog=state$1(!1),uploadedFiles=state$1(proxy([]));const autoScroll=createAutoScrollController({isColumnReverse:!0});let fileErrorData=state$1(proxy({generallyUnsupported:[],modalityUnsupported:[],modalityReasons:{},supportedTypes:[]})),showDeleteDialog=state$1(!1),showEmptyFileDialog=state$1(!1),emptyFileNames=state$1(
proxy([])),initialMessage=state$1(""),isEmpty=user_derived(()=>showCenteredEmpty()&&!activeConversation()&&activeMessages().length===0&&!isLoading()),activeErrorDialog=user_derived(errorDialog),isServerLoading=user_derived(serverLoading),hasPropsError=user_derived(()=>!!serverError()),isCurrentConversationLoading=user_derived(()=>isLoading()||isChatStreaming()),showProcessingInfo=user_derived(()=>get$3(isCurrentConversationLoading)||config$1().keepStatsVisible&&!!page$1.params.id||activeProcessingState()!==
null),isRouter=user_derived(isRouterMode),conversationModel=user_derived(()=>chatStore.getConversationModel(activeMessages())),activeModelId=user_derived(()=>{const options=modelOptions();if(!get$3(isRouter))return options.length>0?options[0].model:null;const selectedId=selectedModelId();if(selectedId){const model=options.find(m=>m.id===selectedId);if(model)return model.model}if(get$3(conversationModel)){const model=options.find(m=>m.model===get$3(conversationModel));if(model)return model.model}
snapshot(files):void 0,result=plainFiles?await parseFilesToMessageExtras(plainFiles,get$3(activeModelId)??void 0):void 0;if(result?.emptyFiles&&result.emptyFiles.length>0){if(set$1(emptyFileNames,result.emptyFiles,!0),set$1(showEmptyFileDialog,!0),files){const emptyFileNamesSet=new Set(result.emptyFiles);set$1(uploadedFiles,get$3(uploadedFiles).filter(file=>!emptyFileNamesSet.has(file.name)),!0)}return!1}const extras=result?.extras;return autoScroll.enable(),await chatStore.sendMessage(message,extras),
autoScroll.scrollToBottom(),!0}async function processFiles(files){const generallySupported=[],generallyUnsupported=[];for(const file of files)isFileTypeSupported(file.name,file.type)?generallySupported.push(file):generallyUnsupported.push(file);const capabilities={hasVision:get$3(hasVisionModality),hasAudio:get$3(hasAudioModality)},{supportedFiles,unsupportedFiles,modalityReasons}=filterFilesByModalities(generallySupported,capabilities);if([...generallyUnsupported,...unsupportedFiles].length>0){
const supportedTypes=["text files","PDFs"];get$3(hasVisionModality)&&supportedTypes.push("images"),get$3(hasAudioModality)&&supportedTypes.push("audio files"),set$1(fileErrorData,{generallyUnsupported,modalityUnsupported:unsupportedFiles,modalityReasons,supportedTypes},!0),set$1(showFileErrorDialog,!0)}if(supportedFiles.length>0){const processed=await processFilesToChatUploaded(supportedFiles,get$3(activeModelId)??void 0);set$1(uploadedFiles,[...get$3(uploadedFiles),...processed],!0)}}afterNavigate(
-()=>{get$3(disableAutoScroll)||autoScroll.enable()}),onMount$1(()=>{autoScroll.startObserving(),get$3(disableAutoScroll)||autoScroll.enable();const pendingDraft=chatStore.consumePendingDraft();pendingDraft&&(set$1(initialMessage,pendingDraft.message,!0),set$1(uploadedFiles,pendingDraft.files,!0))}),user_effect(()=>{autoScroll.setContainer(get$3(chatScrollContainer))}),user_effect(()=>{autoScroll.setDisabled(get$3(disableAutoScroll))});var fragment=root$Y();event("keydown",$window,handleKeydown);
-var node2=first_child(fragment);{var consequent=$$anchor2=>{ChatScreenDragOverlay($$anchor2)};if_block(node2,$$render=>{get$3(isDragOver)&&$$render(consequent)})}var node_1=sibling(node2,2);{var consequent_1=$$anchor2=>{ServerLoadingSplash($$anchor2,{})},alternate=$$anchor2=>{var div=root_3$B(),div_1=child(div),node_2=child(div_1);{var consequent_2=$$anchor3=>{{let $0=user_derived(activeMessages);ChatMessages($$anchor3,{get messages(){return get$3($0)},onUserAction:()=>{autoScroll.enable(),autoScroll.
-scrollToBottom()}})}};if_block(node_2,$$render=>{get$3(isEmpty)||$$render(consequent_2)})}var div_2=sibling(node_2,2),node_3=child(div_2);{var consequent_3=$$anchor3=>{var div_3=root_5$k(),p2=sibling(child(div_3),2),text2=child(p2);reset(p2),reset(div_3),action(div_3,($$node,$$action_arg)=>fadeInView?.($$node,$$action_arg),()=>({duration:300})),template_effect(()=>set_text(text2,`${serverStore.props?.modalities?.audio?"Record audio, type a message ":"Type a message"} or upload files to get start\
-ed`)),append($$anchor3,div_3)};if_block(node_3,$$render=>{get$3(isEmpty)&&$$render(consequent_3)})}var node_4=sibling(node_3,2);{var consequent_4=$$anchor3=>{ChatScreenProcessingInfo($$anchor3,{})};if_block(node_4,$$render=>{page$1.params.id&&$$render(consequent_4)})}var node_5=sibling(node_4,2);{var consequent_5=$$anchor3=>{var div_4=root_7$h(),node_6=child(div_4);component(node_6,()=>Alert,($$anchor4,Alert_Root)=>{Alert_Root($$anchor4,{variant:"destructive",children:($$anchor5,$$slotProps)=>{var fragment_5=root_8$j(),
+()=>{get$3(disableAutoScroll)||autoScroll.enable()}),onMount$1(()=>{autoScroll.startObserving(),get$3(disableAutoScroll)||autoScroll.enable();const pendingDraft=chatStore.consumePendingDraft();pendingDraft&&(set$1(initialMessage,pendingDraft.message,!0),set$1(uploadedFiles,pendingDraft.files,!0))}),user_effect(()=>{autoScroll.setContainer(get$3(chatScrollContainer))}),user_effect(()=>{autoScroll.setDisabled(get$3(disableAutoScroll))});var fragment=root$Z();event("keydown",$window,handleKeydown);
+var node2=first_child(fragment);{var consequent=$$anchor2=>{ChatScreenDragOverlay($$anchor2)};if_block(node2,$$render=>{get$3(isDragOver)&&$$render(consequent)})}var node_1=sibling(node2,2);{var consequent_1=$$anchor2=>{ServerLoadingSplash($$anchor2,{})},alternate=$$anchor2=>{var div=root_3$C(),div_1=child(div),node_2=child(div_1);{var consequent_2=$$anchor3=>{{let $0=user_derived(activeMessages);ChatMessages($$anchor3,{get messages(){return get$3($0)},onUserAction:()=>{autoScroll.enable(),autoScroll.
+scrollToBottom()}})}};if_block(node_2,$$render=>{get$3(isEmpty)||$$render(consequent_2)})}var div_2=sibling(node_2,2),node_3=child(div_2);{var consequent_3=$$anchor3=>{var div_3=root_5$j(),p2=sibling(child(div_3),2),text2=child(p2);reset(p2),reset(div_3),action(div_3,($$node,$$action_arg)=>fadeInView?.($$node,$$action_arg),()=>({duration:300})),template_effect(()=>set_text(text2,`${serverStore.props?.modalities?.audio?"Record audio, type a message ":"Type a message"} or upload files to get start\
+ed`)),append($$anchor3,div_3)};if_block(node_3,$$render=>{get$3(isEmpty)&&$$render(consequent_3)})}var node_4=sibling(node_3,2);{var consequent_4=$$anchor3=>{ChatScreenProcessingInfo($$anchor3,{})};if_block(node_4,$$render=>{page$1.params.id&&$$render(consequent_4)})}var node_5=sibling(node_4,2);{var consequent_5=$$anchor3=>{var div_4=root_7$h(),node_6=child(div_4);component(node_6,()=>Alert,($$anchor4,Alert_Root)=>{Alert_Root($$anchor4,{variant:"destructive",children:($$anchor5,$$slotProps)=>{var fragment_5=root_8$i(),
node_7=first_child(fragment_5);Triangle_alert(node_7,{class:"h-4 w-4"});var node_8=sibling(node_7,2);component(node_8,()=>Alert_title,($$anchor6,Alert_Title)=>{Alert_Title($$anchor6,{class:"flex items-center justify-between",children:($$anchor7,$$slotProps2)=>{var fragment_6=root_9$d(),button=sibling(first_child(fragment_6),2),node_9=child(button);{let $0=user_derived(()=>get$3(isServerLoading)?"animate-spin":"");Refresh_cw(node_9,{get class(){return`h-3 w-3 ${get$3($0)??""}`}})}var text_1=sibling(
node_9);reset(button),template_effect(()=>{button.disabled=get$3(isServerLoading),set_text(text_1,` ${get$3(isServerLoading)?"Retrying...":"Retry"}`)}),delegated("click",button,()=>serverStore.fetch()),append($$anchor7,fragment_6)},$$slots:{default:!0}})});var node_10=sibling(node_8,2);component(node_10,()=>Alert_description,($$anchor6,Alert_Description)=>{Alert_Description($$anchor6,{children:($$anchor7,$$slotProps2)=>{next$1();var text_2=text$8();template_effect($0=>set_text(text_2,$0),[()=>serverError()]),
append($$anchor7,text_2)},$$slots:{default:!0}})}),append($$anchor5,fragment_5)},$$slots:{default:!0}})}),reset(div_4),action(div_4,($$node,$$action_arg)=>fadeInView?.($$node,$$action_arg),()=>({y:10,duration:250})),append($$anchor3,div_4)};if_block(node_5,$$render=>{get$3(hasPropsError)&&$$render(consequent_5)})}var div_5=sibling(node_5,2),node_11=child(div_5);{let $0=user_derived(()=>get$3(hasPropsError)||isEditing());ChatScreenForm(node_11,{get disabled(){return get$3($0)},get initialMessage(){
template_effect(()=>set_class(div_2,1,`pointer-events-none ${get$3(isEmpty)?"absolute bottom-[calc(50dvh-7rem)]":"sticky bottom-4"} right-4 left-4 mt-auto pt-16 transition-all duration-200`)),event("dragenter",div,handleDragEnter),event("dragleave",div,handleDragLeave),event("dragover",div,handleDragOver),event("drop",div,handleDrop),event("scroll",div,handleScroll),append($$anchor2,div)};if_block(node_1,$$render=>{get$3(isServerLoading)?$$render(consequent_1):$$render(alternate,-1)})}var node_12=sibling(
node_1,2);DialogFileUploadError(node_12,{get fileErrorData(){return get$3(fileErrorData)},get open(){return get$3(showFileErrorDialog)},set open($$value){set$1(showFileErrorDialog,$$value,!0)}});var node_13=sibling(node_12,2);DialogConfirmation(node_13,{title:"Delete Conversation",description:"Are you sure you want to delete this conversation? This action cannot be undone and will permanently remove all messages in this conversation.",confirmText:"Delete",cancelText:"Cancel",variant:"destructive",
get icon(){return Trash_2},onConfirm:handleDeleteConfirm,onCancel:()=>set$1(showDeleteDialog,!1),get open(){return get$3(showDeleteDialog)},set open($$value){set$1(showDeleteDialog,$$value,!0)}});var node_14=sibling(node_13,2);DialogEmptyFileAlert(node_14,{get emptyFiles(){return get$3(emptyFileNames)},onOpenChange:open2=>{open2||set$1(emptyFileNames,[],!0)},get open(){return get$3(showEmptyFileDialog)},set open($$value){set$1(showEmptyFileDialog,$$value,!0)}});var node_15=sibling(node_14,2);{let $0=user_derived(
-()=>get$3(activeErrorDialog)?.message??""),$1=user_derived(()=>get$3(activeErrorDialog)?.contextInfo),$2=user_derived(()=>!!get$3(activeErrorDialog)),$3=user_derived(()=>get$3(activeErrorDialog)?.type??ErrorDialogType.SERVER);DialogChatError(node_15,{get message(){return get$3($0)},get contextInfo(){return get$3($1)},onOpenChange:handleErrorDialogOpenChange,get open(){return get$3($2)},get type(){return get$3($3)}})}append($$anchor,fragment),pop()}delegate(["click"]);var root$X=from_html('<div c\
-lass="pointer-events-none fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm"><div class="flex flex-col items-center justify-center rounded-2xl border-2 border-dashed border-border bg-background p-12 shadow-lg"><!> <p class="text-lg font-medium text-foreground">Attach a file</p> <p class="text-sm text-muted-foreground">Drop your files here to upload</p></div></div>');function ChatScreenDragOverlay($$anchor){var div=root$X(),div_1=child(div),node2=child(div_1);Upload(
+()=>get$3(activeErrorDialog)?.message??""),$1=user_derived(()=>get$3(activeErrorDialog)?.contextInfo),$2=user_derived(()=>!!get$3(activeErrorDialog)),$3=user_derived(()=>get$3(activeErrorDialog)?.type??ErrorDialogType.SERVER);DialogChatError(node_15,{get message(){return get$3($0)},get contextInfo(){return get$3($1)},onOpenChange:handleErrorDialogOpenChange,get open(){return get$3($2)},get type(){return get$3($3)}})}append($$anchor,fragment),pop()}delegate(["click"]);var root$Y=from_html('<div c\
+lass="pointer-events-none fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm"><div class="flex flex-col items-center justify-center rounded-2xl border-2 border-dashed border-border bg-background p-12 shadow-lg"><!> <p class="text-lg font-medium text-foreground">Attach a file</p> <p class="text-sm text-muted-foreground">Drop your files here to upload</p></div></div>');function ChatScreenDragOverlay($$anchor){var div=root$Y(),div_1=child(div),node2=child(div_1);Upload(
node2,{class:"mb-4 h-12 w-12 text-muted-foreground"}),next$1(4),reset(div_1),reset(div),append($$anchor,div)}class DraftMessagesStore{drafts=new Map;getDraftMessage(chatId){const key2=chatId??NEW_CHAT_DRAFT_KEY;return this.drafts.get(key2)??{message:"",files:[]}}saveDraftMessage(chatId,message,files){const key2=chatId??NEW_CHAT_DRAFT_KEY;message||files.length>0?this.drafts.set(key2,{message,files:[...files]}):this.drafts.delete(key2)}clearDraftMessage(chatId){const key2=chatId??NEW_CHAT_DRAFT_KEY;
this.drafts.delete(key2)}}const draftMessagesStore=new DraftMessagesStore;function useDraftMessages(options){onMount$1(()=>{const chatId=options.getChatId(),draft=draftMessagesStore.getDraftMessage(chatId);(draft.message||draft.files.length>0)&&!options.getInitialMessage()&&(options.setMessage(draft.message),options.setFiles(draft.files))}),beforeNavigate(()=>{const chatId=options.getChatId();draftMessagesStore.saveDraftMessage(chatId,options.getMessage(),options.getFiles())}),afterNavigate(navigation=>{
-if(navigation?.from!=null){const chatId=options.getChatId(),draft=draftMessagesStore.getDraftMessage(chatId);options.setMessage(draft.message),options.setFiles(draft.files)}});function clearDraft(){const chatId=options.getChatId();draftMessagesStore.clearDraftMessage(chatId)}return{clearDraft}}var root$W=from_html('<div class="relative mx-auto max-w-[48rem]"><!></div>');function ChatScreenForm($$anchor,$$props){push$1($$props,!0);let disabled=prop($$props,"disabled",3,!1),initialMessage=prop($$props,
+if(navigation?.from!=null){const chatId=options.getChatId(),draft=draftMessagesStore.getDraftMessage(chatId);options.setMessage(draft.message),options.setFiles(draft.files)}});function clearDraft(){const chatId=options.getChatId();draftMessagesStore.clearDraftMessage(chatId)}return{clearDraft}}var root$X=from_html('<div class="relative mx-auto max-w-[48rem]"><!></div>');function ChatScreenForm($$anchor,$$props){push$1($$props,!0);let disabled=prop($$props,"disabled",3,!1),initialMessage=prop($$props,
"initialMessage",3,""),isLoading2=prop($$props,"isLoading",3,!1),uploadedFiles=prop($$props,"uploadedFiles",31,()=>proxy([])),chatFormRef=state$1(void 0),chatId=user_derived(()=>page$1.params.id),hasLoadingAttachments=user_derived(()=>uploadedFiles().some(f=>f.isLoading)),message=user_derived(initialMessage),previousIsLoading=user_derived(isLoading2),previousInitialMessage=user_derived(initialMessage);const{clearDraft}=useDraftMessages({getChatId:()=>get$3(chatId),getMessage:()=>get$3(message),getFiles:()=>uploadedFiles(),
setMessage:m=>set$1(message,m),setFiles:f=>uploadedFiles(f),getInitialMessage:()=>initialMessage()});function handleFilesAdd(files){$$props.onFileUpload?.(files)}async function handleSubmit(){if(!get$3(message).trim()&&uploadedFiles().length===0||disabled()||get$3(hasLoadingAttachments)||!get$3(chatFormRef)?.checkModelSelected())return;const messageToSend=get$3(message).trim(),filesToSend=[...uploadedFiles()];set$1(message,""),uploadedFiles([]),clearDraft(),get$3(chatFormRef)?.resetTextareaHeight(),
await $$props.onSend?.(messageToSend,filesToSend)||(set$1(message,messageToSend),uploadedFiles(filesToSend))}function handleSystemPromptClick(){$$props.onSystemPromptAdd?.({message:get$3(message),files:uploadedFiles()})}function handleUploadedFileRemove(fileId){$$props.onFileRemove?.(fileId)}onMount$1(()=>{setTimeout(()=>get$3(chatFormRef)?.focus(),10)}),afterNavigate(navigation=>{navigation?.from!=null&&setTimeout(()=>get$3(chatFormRef)?.focus(),10)}),user_effect(()=>{initialMessage()!==get$3(previousInitialMessage)&&
-(set$1(message,initialMessage()),set$1(previousInitialMessage,initialMessage()))}),user_effect(()=>{get$3(previousIsLoading)&&!isLoading2()&&setTimeout(()=>get$3(chatFormRef)?.focus(),10),set$1(previousIsLoading,isLoading2())});var div=root$W(),node2=child(div);bind_this(ChatForm(node2,{get class(){return $$props.class},get disabled(){return disabled()},get isLoading(){return isLoading2()},showMcpPromptButton:!0,onFilesAdd:handleFilesAdd,get onStop(){return $$props.onStop},onSubmit:handleSubmit,
-onSystemPromptClick:handleSystemPromptClick,onUploadedFileRemove:handleUploadedFileRemove,get value(){return get$3(message)},set value($$value){set$1(message,$$value)},get uploadedFiles(){return uploadedFiles()},set uploadedFiles($$value){uploadedFiles($$value)}}),$$value=>set$1(chatFormRef,$$value,!0),()=>get$3(chatFormRef)),reset(div),append($$anchor,div),pop()}var root_1$r=from_html('<span class="chat-processing-info-detail pointer-events-auto backdrop-blur-sm svelte-1ktvj8d"> </span>'),root$V=from_html(
+(set$1(message,initialMessage()),set$1(previousInitialMessage,initialMessage()))}),user_effect(()=>{get$3(previousIsLoading)&&!isLoading2()&&setTimeout(()=>get$3(chatFormRef)?.focus(),10),set$1(previousIsLoading,isLoading2())});var div=root$X(),node2=child(div);bind_this(ChatForm(node2,{get class(){return $$props.class},get disabled(){return disabled()},get isLoading(){return isLoading2()},showMcpPromptButton:!0,onFilesAdd:handleFilesAdd,get onStop(){return $$props.onStop},onSubmit:handleSubmit,
+onSystemPromptClick:handleSystemPromptClick,onUploadedFileRemove:handleUploadedFileRemove,get value(){return get$3(message)},set value($$value){set$1(message,$$value)},get uploadedFiles(){return uploadedFiles()},set uploadedFiles($$value){uploadedFiles($$value)}}),$$value=>set$1(chatFormRef,$$value,!0),()=>get$3(chatFormRef)),reset(div),append($$anchor,div),pop()}var root_1$s=from_html('<span class="chat-processing-info-detail pointer-events-auto backdrop-blur-sm svelte-1ktvj8d"> </span>'),root$W=from_html(
'<div><div class="chat-processing-info-content svelte-1ktvj8d"></div></div>');function ChatScreenProcessingInfo($$anchor,$$props){push$1($$props,!0);const processingState=useProcessingState(),processingInfoCtx=getProcessingInfoContext();let showProcessingInfo=user_derived(()=>processingInfoCtx.showProcessingInfo),isCurrentConversationLoading=user_derived(isLoading),isStreaming=user_derived(isChatStreaming),processingDetails=user_derived(()=>processingState.getTechnicalDetails());user_effect(()=>{
const conversation=activeConversation();untrack$1(()=>chatStore.setActiveProcessingConversation(conversation?.id??null))}),user_effect(()=>{const keepStatsVisible=config$1().keepStatsVisible;if((keepStatsVisible||get$3(isCurrentConversationLoading)||get$3(isStreaming))&&processingState.startMonitoring(),!get$3(isCurrentConversationLoading)&&!get$3(isStreaming)&&!keepStatsVisible){const timeout=setTimeout(()=>{!config$1().keepStatsVisible&&!isChatStreaming()&&processingState.stopMonitoring()},PROCESSING_INFO_TIMEOUT);
-return()=>clearTimeout(timeout)}}),user_effect(()=>{const conversation=activeConversation(),messages=activeMessages();if(config$1().keepStatsVisible&&conversation){if(messages.length===0){untrack$1(()=>chatStore.clearProcessingState(conversation.id));return}!get$3(isCurrentConversationLoading)&&!get$3(isStreaming)&&untrack$1(()=>chatStore.restoreProcessingStateFromMessages(messages,conversation.id))}});var div=root$V(),div_1=child(div);each(div_1,20,()=>get$3(processingDetails),detail=>detail,($$anchor2,detail)=>{
-var span=root_1$r(),text2=child(span,!0);reset(span),template_effect(()=>set_text(text2,detail)),append($$anchor2,span)}),reset(div_1),reset(div),template_effect(()=>set_class(div,1,clsx(["chat-processing-info-container pointer-events-none",get$3(showProcessingInfo)&&"visible"]),"svelte-1ktvj8d")),append($$anchor,div),pop()}const emptyOptions$7={};function toString$1(value,options){const settings=emptyOptions$7,includeImageAlt=typeof settings.includeImageAlt=="boolean"?settings.includeImageAlt:!0,
+return()=>clearTimeout(timeout)}}),user_effect(()=>{const conversation=activeConversation(),messages=activeMessages();if(config$1().keepStatsVisible&&conversation){if(messages.length===0){untrack$1(()=>chatStore.clearProcessingState(conversation.id));return}!get$3(isCurrentConversationLoading)&&!get$3(isStreaming)&&untrack$1(()=>chatStore.restoreProcessingStateFromMessages(messages,conversation.id))}});var div=root$W(),div_1=child(div);each(div_1,20,()=>get$3(processingDetails),detail=>detail,($$anchor2,detail)=>{
+var span=root_1$s(),text2=child(span,!0);reset(span),template_effect(()=>set_text(text2,detail)),append($$anchor2,span)}),reset(div_1),reset(div),template_effect(()=>set_class(div,1,clsx(["chat-processing-info-container pointer-events-none",get$3(showProcessingInfo)&&"visible"]),"svelte-1ktvj8d")),append($$anchor,div),pop()}const emptyOptions$7={};function toString$1(value,options){const settings=emptyOptions$7,includeImageAlt=typeof settings.includeImageAlt=="boolean"?settings.includeImageAlt:!0,
includeHtml=typeof settings.includeHtml=="boolean"?settings.includeHtml:!0;return one$2(value,includeImageAlt,includeHtml)}function one$2(value,includeImageAlt,includeHtml){if(node(value)){if("value"in value)return value.type==="html"&&!includeHtml?"":value.value;if(includeImageAlt&&"alt"in value&&value.alt)return value.alt;if("children"in value)return all$2(value.children,includeImageAlt,includeHtml)}return Array.isArray(value)?all$2(value,includeImageAlt,includeHtml):""}function all$2(values,includeImageAlt,includeHtml){
const result=[];let index2=-1;for(;++index2<values.length;)result[index2]=one$2(values[index2],includeImageAlt,includeHtml);return result.join("")}function node(value){return!!(value&&typeof value=="object")}const element$3=document.createElement("i");function decodeNamedCharacterReference(value){const characterReference2="&"+value+";";element$3.innerHTML=characterReference2;const character=element$3.textContent;return character.charCodeAt(character.length-1)===59&&value!=="semi"||character===characterReference2?
!1:character}function splice(list2,start2,remove2,items2){const end=list2.length;let chunkStart=0,parameters;if(start2<0?start2=-start2>end?0:end+start2:start2=start2>end?end:start2,remove2=remove2>0?remove2:0,items2.length<1e4)parameters=Array.from(items2),parameters.unshift(start2,remove2),list2.splice(...parameters);else for(remove2&&list2.splice(start2,remove2);chunkStart<items2.length;)parameters=items2.slice(chunkStart,chunkStart+1e4),parameters.unshift(start2,0),list2.splice(...parameters),
value}function checkListItemIndent(state2){const style2=state2.options.listItemIndent||"one";if(style2!=="tab"&&style2!=="one"&&style2!=="mixed")throw new Error("Cannot serialize items with `"+style2+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return style2}function listItem$1(node2,parent,state2,info2){const listItemIndent=checkListItemIndent(state2);let bullet=state2.bulletCurrent||checkBullet(state2);parent&&parent.type==="list"&&parent.ordered&&(bullet=(typeof parent.
start=="number"&&parent.start>-1?parent.start:1)+(state2.options.incrementListMarker===!1?0:parent.children.indexOf(node2))+bullet);let size2=bullet.length+1;(listItemIndent==="tab"||listItemIndent==="mixed"&&(parent&&parent.type==="list"&&parent.spread||node2.spread))&&(size2=Math.ceil(size2/4)*4);const tracker=state2.createTracker(info2);tracker.move(bullet+" ".repeat(size2-bullet.length)),tracker.shift(size2);const exit2=state2.enter("listItem"),value=state2.indentLines(state2.containerFlow(node2,
tracker.current()),map2);return exit2(),value;function map2(line,index2,blank){return index2?(blank?"":" ".repeat(size2))+line:(blank?bullet:bullet+" ".repeat(size2-bullet.length))+line}}function paragraph$1(node2,_,state2,info2){const exit2=state2.enter("paragraph"),subexit=state2.enter("phrasing"),value=state2.containerPhrasing(node2,info2);return subexit(),exit2(),value}const phrasing=convert(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","in\
-lineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function root$U(node2,_,state2,info2){return(node2.children.some(function(d2){return phrasing(d2)})?state2.containerPhrasing:state2.containerFlow).call(state2,node2,info2)}function checkStrong(state2){const marker=state2.options.strong||"*";if(marker!=="*"&&marker!=="_")throw new Error("Cannot serialize strong with `"+marker+"` for `options.strong`, expected `*`, or `_`");return marker}strong$1.
+lineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function root$V(node2,_,state2,info2){return(node2.children.some(function(d2){return phrasing(d2)})?state2.containerPhrasing:state2.containerFlow).call(state2,node2,info2)}function checkStrong(state2){const marker=state2.options.strong||"*";if(marker!=="*"&&marker!=="_")throw new Error("Cannot serialize strong with `"+marker+"` for `options.strong`, expected `*`, or `_`");return marker}strong$1.
peek=strongPeek;function strong$1(node2,_,state2,info2){const marker=checkStrong(state2),exit2=state2.enter("strong"),tracker=state2.createTracker(info2),before=tracker.move(marker+marker);let between2=tracker.move(state2.containerPhrasing(node2,{after:marker,before,...tracker.current()}));const betweenHead=between2.charCodeAt(0),open2=encodeInfo(info2.before.charCodeAt(info2.before.length-1),betweenHead,marker);open2.inside&&(between2=encodeCharacterReference(betweenHead)+between2.slice(1));const betweenTail=between2.
charCodeAt(between2.length-1),close2=encodeInfo(info2.after.charCodeAt(0),betweenTail,marker);close2.inside&&(between2=between2.slice(0,-1)+encodeCharacterReference(betweenTail));const after=tracker.move(marker+marker);return exit2(),state2.attentionEncodeSurroundingInfo={after:close2.outside,before:open2.outside},before+between2+after}function strongPeek(_,_12,state2){return state2.options.strong||"*"}function text$5(node2,_,state2,info2){return state2.safe(node2.value,info2)}function checkRuleRepetition(state2){
const repetition=state2.options.ruleRepetition||3;if(repetition<3)throw new Error("Cannot serialize rules with repetition `"+repetition+"` for `options.ruleRepetition`, expected `3` or more");return repetition}function thematicBreak$1(_,_12,state2){const value=(checkRule(state2)+(state2.options.ruleSpaces?" ":"")).repeat(checkRuleRepetition(state2));return state2.options.ruleSpaces?value.slice(0,-1):value}const handle$1={blockquote:blockquote$1,break:hardBreak$1,code:code$2,definition,emphasis:emphasis$1,
-hardBreak:hardBreak$1,heading:heading$1,html:html$5,image:image$1,imageReference:imageReference$1,inlineCode:inlineCode$1,link:link$1,linkReference:linkReference$1,list:list$1,listItem:listItem$1,paragraph:paragraph$1,root:root$U,strong:strong$1,text:text$5,thematicBreak:thematicBreak$1},join$1=[joinDefaults];function joinDefaults(left,right,parent,state2){if(right.type==="code"&&formatCodeAsIndented(right,state2)&&(left.type==="list"||left.type===right.type&&formatCodeAsIndented(left,state2)))return!1;
+hardBreak:hardBreak$1,heading:heading$1,html:html$5,image:image$1,imageReference:imageReference$1,inlineCode:inlineCode$1,link:link$1,linkReference:linkReference$1,list:list$1,listItem:listItem$1,paragraph:paragraph$1,root:root$V,strong:strong$1,text:text$5,thematicBreak:thematicBreak$1},join$1=[joinDefaults];function joinDefaults(left,right,parent,state2){if(right.type==="code"&&formatCodeAsIndented(right,state2)&&(left.type==="list"||left.type===right.type&&formatCodeAsIndented(left,state2)))return!1;
if("spread"in parent&&typeof parent.spread=="boolean")return left.type==="paragraph"&&(left.type===right.type||right.type==="definition"||right.type==="heading"&&formatHeadingAsSetext(right,state2))?void 0:parent.spread?1:0}const fullPhrasingSpans=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],unsafe=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFenc\
edLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:fullPhrasingSpans},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"\
`}),child2.type==="element"&&child2.tagName==="p"&&!loose?children.push(...child2.children):children.push(child2)}const tail=results[results.length-1];tail&&(loose||tail.type!=="element"||tail.tagName!=="p")&&children.push({type:"text",value:`
`});const result={type:"element",tagName:"li",properties:properties2,children};return state2.patch(node2,result),state2.applyData(node2,result)}function listLoose(node2){let loose=!1;if(node2.type==="list"){loose=node2.spread||!1;const children=node2.children;let index2=-1;for(;!loose&&++index2<children.length;)loose=listItemLoose(children[index2])}return loose}function listItemLoose(node2){const spread=node2.spread;return spread??node2.children.length>1}function list(state2,node2){const properties2={},
results=state2.all(node2);let index2=-1;for(typeof node2.start=="number"&&node2.start!==1&&(properties2.start=node2.start);++index2<results.length;){const child2=results[index2];if(child2.type==="element"&&child2.tagName==="li"&&child2.properties&&Array.isArray(child2.properties.className)&&child2.properties.className.includes("task-list-item")){properties2.className=["contains-task-list"];break}}const result={type:"element",tagName:node2.ordered?"ol":"ul",properties:properties2,children:state2.
-wrap(results,!0)};return state2.patch(node2,result),state2.applyData(node2,result)}function paragraph(state2,node2){const result={type:"element",tagName:"p",properties:{},children:state2.all(node2)};return state2.patch(node2,result),state2.applyData(node2,result)}function root$T(state2,node2){const result={type:"root",children:state2.wrap(state2.all(node2))};return state2.patch(node2,result),state2.applyData(node2,result)}function strong(state2,node2){const result={type:"element",tagName:"strong",
+wrap(results,!0)};return state2.patch(node2,result),state2.applyData(node2,result)}function paragraph(state2,node2){const result={type:"element",tagName:"p",properties:{},children:state2.all(node2)};return state2.patch(node2,result),state2.applyData(node2,result)}function root$U(state2,node2){const result={type:"root",children:state2.wrap(state2.all(node2))};return state2.patch(node2,result),state2.applyData(node2,result)}function strong(state2,node2){const result={type:"element",tagName:"strong",
properties:{},children:state2.all(node2)};return state2.patch(node2,result),state2.applyData(node2,result)}const pointEnd=point("end"),pointStart=point("start");function point(type2){return point2;function point2(node2){const point3=node2&&node2.position&&node2.position[type2]||{};if(typeof point3.line=="number"&&point3.line>0&&typeof point3.column=="number"&&point3.column>0)return{line:point3.line,column:point3.column,offset:typeof point3.offset=="number"&&point3.offset>-1?point3.offset:void 0}}}
function position(node2){const start2=pointStart(node2),end=pointEnd(node2);if(start2&&end)return{start:start2,end}}function table(state2,node2){const rows=state2.all(node2),firstRow=rows.shift(),tableContent=[];if(firstRow){const head2={type:"element",tagName:"thead",properties:{},children:state2.wrap([firstRow],!0)};state2.patch(node2.children[0],head2),tableContent.push(head2)}if(rows.length>0){const body2={type:"element",tagName:"tbody",properties:{},children:state2.wrap(rows,!0)},start2=pointStart(
node2.children[1]),end=pointEnd(node2.children[node2.children.length-1]);start2&&end&&(body2.position={start:start2,end}),tableContent.push(body2)}const result={type:"element",tagName:"table",properties:{},children:state2.wrap(tableContent,!0)};return state2.patch(node2,result),state2.applyData(node2,result)}function tableRow(state2,node2,parent){const siblings2=parent?parent.children:void 0,tagName=(siblings2?siblings2.indexOf(node2):1)===0?"th":"td",align=parent&&parent.type==="table"?parent.align:
children:state2.wrap(cells2,!0)};return state2.patch(node2,result),state2.applyData(node2,result)}function tableCell(state2,node2){const result={type:"element",tagName:"td",properties:{},children:state2.all(node2)};return state2.patch(node2,result),state2.applyData(node2,result)}const tab=9,space=32;function trimLines(value){const source2=String(value),search2=/\r?\n|\r/g;let match=search2.exec(source2),last=0;const lines=[];for(;match;)lines.push(trimLine(source2.slice(last,match.index),last>0,
!0),match[0]),last=match.index+match[0].length,match=search2.exec(source2);return lines.push(trimLine(source2.slice(last),last>0,!1)),lines.join("")}function trimLine(value,start2,end){let startIndex=0,endIndex=value.length;if(start2){let code2=value.codePointAt(startIndex);for(;code2===tab||code2===space;)startIndex++,code2=value.codePointAt(startIndex)}if(end){let code2=value.codePointAt(endIndex-1);for(;code2===tab||code2===space;)endIndex--,code2=value.codePointAt(endIndex-1)}return endIndex>
startIndex?value.slice(startIndex,endIndex):""}function text$2(state2,node2){const result={type:"text",value:trimLines(String(node2.value))};return state2.patch(node2,result),state2.applyData(node2,result)}function thematicBreak(state2,node2){const result={type:"element",tagName:"hr",properties:{},children:[]};return state2.patch(node2,result),state2.applyData(node2,result)}const handlers={blockquote,break:hardBreak,code,delete:strikethrough,emphasis,footnoteReference,heading,html:html$4,imageReference,
-image,inlineCode,linkReference,link,listItem,list,paragraph,root:root$T,strong,table,tableCell,tableRow,text:text$2,thematicBreak,toml:ignore,yaml:ignore,definition:ignore,footnoteDefinition:ignore};function ignore(){}const VOID=-1,PRIMITIVE=0,ARRAY=1,OBJECT=2,DATE=3,REGEXP=4,MAP=5,SET=6,ERROR=7,BIGINT=8,env=typeof self=="object"?self:globalThis,deserializer=($,_)=>{const as=(out,index2)=>($.set(index2,out),out),unpair=index2=>{if($.has(index2))return $.get(index2);const[type2,value]=_[index2];switch(type2){case PRIMITIVE:case VOID:
+image,inlineCode,linkReference,link,listItem,list,paragraph,root:root$U,strong,table,tableCell,tableRow,text:text$2,thematicBreak,toml:ignore,yaml:ignore,definition:ignore,footnoteDefinition:ignore};function ignore(){}const VOID=-1,PRIMITIVE=0,ARRAY=1,OBJECT=2,DATE=3,REGEXP=4,MAP=5,SET=6,ERROR=7,BIGINT=8,env=typeof self=="object"?self:globalThis,deserializer=($,_)=>{const as=(out,index2)=>($.set(index2,out),out),unpair=index2=>{if($.has(index2))return $.get(index2);const[type2,value]=_[index2];switch(type2){case PRIMITIVE:case VOID:
return as(value,index2);case ARRAY:{const arr=as([],index2);for(const index3 of value)arr.push(unpair(index3));return arr}case OBJECT:{const object2=as({},index2);for(const[key2,index3]of value)object2[unpair(key2)]=unpair(index3);return object2}case DATE:return as(new Date(value),index2);case REGEXP:{const{source:source2,flags:flags2}=value;return as(new RegExp(source2,flags2),index2)}case MAP:{const map2=as(new Map,index2);for(const[key2,index3]of value)map2.set(unpair(key2),unpair(index3));return map2}case SET:{
const set2=as(new Set,index2);for(const index3 of value)set2.add(unpair(index3));return set2}case ERROR:{const{name,message}=value;return as(new env[name](message),index2)}case BIGINT:return as(BigInt(value),index2);case"BigInt":return as(Object(BigInt(value)),index2);case"ArrayBuffer":return as(new Uint8Array(value).buffer,value);case"DataView":{const{buffer}=new Uint8Array(value);return as(new DataView(buffer),value)}}return as(new env[type2](value),index2)};return unpair},deserialize=serialized=>deserializer(
new Map,serialized)(0),EMPTY="",{toString}={},{keys}=Object,typeOf=value=>{const type2=typeof value;if(type2!=="object"||!value)return[PRIMITIVE,type2];const asString=toString.call(value).slice(8,-1);switch(asString){case"Array":return[ARRAY,EMPTY];case"Object":return[OBJECT,EMPTY];case"Date":return[DATE,EMPTY];case"RegExp":return[REGEXP,EMPTY];case"Map":return[MAP,EMPTY];case"Set":return[SET,EMPTY];case"DataView":return[ARRAY,asString]}return asString.includes("Array")?[ARRAY,asString]:asString.
boolean||info2.overloadedBoolean)&&(value===""||normalize(value)===normalize(name)))return!0}return value}function style(styles2){const result=[];for(const[key2,value]of Object.entries(styles2))result.push([key2,value].join(": "));return result.join("; ")}function createAdjustMap(values){const result=new Map;for(const value of values)result.set(value.toLowerCase(),value);return result}const svgCaseSensitiveTagNames=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateT\
ransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],h=createH(html$2,"div"),s=createH(
svg,"g",svgCaseSensitiveTagNames),webNamespaces={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function fromDom(tree,options){return transform(tree,{})||{type:"root",children:[]}}function transform(node2,options){const transformed=one$1(node2,options);return transformed&&options.afterTransform&&options.afterTransform(node2,transformed),transformed}function one$1(node2,options){switch(node2.nodeType){case 1:return element$1(node2,options);case 3:return text$1(node2);case 8:
-return comment$1(node2);case 9:return root$S(node2,options);case 10:return doctype$1();case 11:return root$S(node2,options);default:return}}function root$S(node2,options){return{type:"root",children:all$1(node2,options)}}function doctype$1(){return{type:"doctype"}}function text$1(node2){return{type:"text",value:node2.nodeValue||""}}function comment$1(node2){return{type:"comment",value:node2.nodeValue||""}}function element$1(node2,options){const space2=node2.namespaceURI,x=space2===webNamespaces.
+return comment$1(node2);case 9:return root$T(node2,options);case 10:return doctype$1();case 11:return root$T(node2,options);default:return}}function root$T(node2,options){return{type:"root",children:all$1(node2,options)}}function doctype$1(){return{type:"doctype"}}function text$1(node2){return{type:"text",value:node2.nodeValue||""}}function comment$1(node2){return{type:"comment",value:node2.nodeValue||""}}function element$1(node2,options){const space2=node2.namespaceURI,x=space2===webNamespaces.
svg?s:h,tagName=space2===webNamespaces.html?node2.tagName.toLowerCase():node2.tagName,content2=space2===webNamespaces.html&&tagName==="template"?node2.content:node2,attributes=node2.getAttributeNames(),properties2={};let index2=-1;for(;++index2<attributes.length;)properties2[attributes[index2]]=node2.getAttribute(attributes[index2])||"";return x(tagName,properties2,all$1(content2,options))}function all$1(node2,options){const nodes2=node2.childNodes,children=[];let index2=-1;for(;++index2<nodes2.
length;){const child2=transform(nodes2[index2],options);child2!==void 0&&children.push(child2)}return children}new DOMParser;function fromHtmlIsomorphic(value,options){const node2=parseFragment(value);return fromDom(node2)}function parseFragment(value){const template=document.createElement("template");return template.innerHTML=value,template.content}const emptyOptions$1={},emptyClasses=[];function rehypeKatex(options){const settings=options||emptyOptions$1;return function(tree,file){visitParents(
tree,"element",function(element2,parents){const classes=Array.isArray(element2.properties.className)?element2.properties.className:emptyClasses,languageMath=classes.includes("language-math"),mathDisplay=classes.includes("math-display"),mathInline=classes.includes("math-inline");let displayMode=mathDisplay;if(!languageMath&&!mathDisplay&&!mathInline)return;let parent=parents[parents.length-1],scope2=element2;if(element2.tagName==="code"&&languageMath&&parent&&parent.type==="element"&&parent.tagName===
for(;++index2<values.length;){const last=state2.settings.tightAttributes?values[index2].charAt(values[index2].length-1):void 0;index2!==values.length-1&&last!=='"'&&last!=="'"&&(values[index2]+=" ")}return values.join("")}function serializeAttribute(state2,key2,value){const info2=find(state2.schema,key2),x=state2.settings.allowParseErrors&&state2.schema.space==="html"?0:1,y=state2.settings.allowDangerousCharacters?0:1;let quote=state2.quote,result;if(info2.overloadedBoolean&&(value===info2.attribute||
value==="")?value=!0:(info2.boolean||info2.overloadedBoolean)&&(typeof value!="string"||value===info2.attribute||value==="")&&(value=!!value),value==null||value===!1||typeof value=="number"&&Number.isNaN(value))return"";const name=stringifyEntities(info2.attribute,Object.assign({},state2.settings.characterReferences,{subset:constants.name[x][y]}));return value===!0||(value=Array.isArray(value)?(info2.commaSeparated?stringify$1:stringify)(value,{padLeft:!state2.settings.tightCommaSeparatedLists}):
String(value),state2.settings.collapseEmptyAttributes&&!value)?name:(state2.settings.preferUnquoted&&(result=stringifyEntities(value,Object.assign({},state2.settings.characterReferences,{attribute:!0,subset:constants.unquoted[x][y]}))),result!==value&&(state2.settings.quoteSmart&&ccount(value,quote)>ccount(value,state2.alternative)&&(quote=state2.alternative),result=quote+stringifyEntities(value,Object.assign({},state2.settings.characterReferences,{subset:(quote==="'"?constants.single:constants.
-double)[x][y],attribute:!0}))+quote),name+(result&&"="+result))}const textEntitySubset=["<","&"];function text(node2,_,parent,state2){return parent&&parent.type==="element"&&(parent.tagName==="script"||parent.tagName==="style")?node2.value:stringifyEntities(node2.value,Object.assign({},state2.settings.characterReferences,{subset:textEntitySubset}))}function raw(node2,index2,parent,state2){return state2.settings.allowDangerousHtml?node2.value:text(node2,index2,parent,state2)}function root$R(node2,_12,_22,state2){
-return state2.all(node2)}const handle=zwitch("type",{invalid,unknown,handlers:{comment,doctype,element,raw,root:root$R,text}});function invalid(node2){throw new Error("Expected node, not `"+node2+"`")}function unknown(node_){const node2=node_;throw new Error("Cannot compile unknown node `"+node2.type+"`")}const emptyOptions={},emptyCharacterReferences={},emptyChildren=[];function toHtml(tree,options){const options_=options||emptyOptions,quote=options_.quote||'"',alternative=quote==='"'?"'":'"';if(quote!==
+double)[x][y],attribute:!0}))+quote),name+(result&&"="+result))}const textEntitySubset=["<","&"];function text(node2,_,parent,state2){return parent&&parent.type==="element"&&(parent.tagName==="script"||parent.tagName==="style")?node2.value:stringifyEntities(node2.value,Object.assign({},state2.settings.characterReferences,{subset:textEntitySubset}))}function raw(node2,index2,parent,state2){return state2.settings.allowDangerousHtml?node2.value:text(node2,index2,parent,state2)}function root$S(node2,_12,_22,state2){
+return state2.all(node2)}const handle=zwitch("type",{invalid,unknown,handlers:{comment,doctype,element,raw,root:root$S,text}});function invalid(node2){throw new Error("Expected node, not `"+node2+"`")}function unknown(node_){const node2=node_;throw new Error("Cannot compile unknown node `"+node2.type+"`")}const emptyOptions={},emptyCharacterReferences={},emptyChildren=[];function toHtml(tree,options){const options_=options||emptyOptions,quote=options_.quote||'"',alternative=quote==='"'?"'":'"';if(quote!==
'"'&"e!=="'")throw new Error("Invalid quote `"+quote+"`, expected `'` or `\"`");return{one,all,settings:{omitOptionalTags:options_.omitOptionalTags||!1,allowParseErrors:options_.allowParseErrors||!1,allowDangerousCharacters:options_.allowDangerousCharacters||!1,quoteSmart:options_.quoteSmart||!1,preferUnquoted:options_.preferUnquoted||!1,tightAttributes:options_.tightAttributes||!1,upperDoctype:options_.upperDoctype||!1,tightDoctype:options_.tightDoctype||!1,bogusComments:options_.bogusComments||
!1,tightCommaSeparatedLists:options_.tightCommaSeparatedLists||!1,tightSelfClosing:options_.tightSelfClosing||!1,collapseEmptyAttributes:options_.collapseEmptyAttributes||!1,allowDangerousHtml:options_.allowDangerousHtml||!1,voids:options_.voids||htmlVoidElements,characterReferences:options_.characterReferences||emptyCharacterReferences,closeSelfClosing:options_.closeSelfClosing||!1,closeEmptyElements:options_.closeEmptyElements||!1},schema:options_.space==="svg"?svg:html$2,quote,alternative}.one(
Array.isArray(tree)?{type:"root",children:tree}:tree,void 0,void 0)}function one(node2,index2,parent){return handle(node2,index2,parent,this)}function all(parent){const results=[],children=parent&&parent.children||emptyChildren;let index2=-1;for(;++index2<children.length;)results[index2]=this.one(children[index2],index2,parent);return results.join("")}function rehypeStringify(options){const self2=this,settings={...self2.data("settings"),...options};self2.compiler=compiler2;function compiler2(tree){
js-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.\
hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}",githubLightCss="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-titl\
e.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#\
-24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}";var root_1$q=from_html('<div class="markdown-block svelte-wjdxdt"></div>'),root_2$J=from_html('<div class="markdown-block markdown-block--unstable svelte-wjdxdt" data-block-id="unstable"></div>'),root_3$A=from_html('<div c\
-lass="code-block-wrapper streaming-code-block relative svelte-wjdxdt"><div class="code-block-header svelte-wjdxdt"><span class="code-language"> </span> <!></div> <div class="streaming-code-scroll-container svelte-wjdxdt"><pre class="streaming-code-pre svelte-wjdxdt"><code></code></pre></div></div>'),root$Q=from_html("<div><!> <!> <!></div> <!>",1);function MarkdownContent($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),disableMath=prop($$props,"disableMath",3,!1),containerRef=state$1(
+24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}";var root_1$r=from_html('<div class="markdown-block svelte-wjdxdt"></div>'),root_2$I=from_html('<div class="markdown-block markdown-block--unstable svelte-wjdxdt" data-block-id="unstable"></div>'),root_3$B=from_html('<div c\
+lass="code-block-wrapper streaming-code-block relative svelte-wjdxdt"><div class="code-block-header svelte-wjdxdt"><span class="code-language"> </span> <!></div> <div class="streaming-code-scroll-container svelte-wjdxdt"><pre class="streaming-code-pre svelte-wjdxdt"><code></code></pre></div></div>'),root$R=from_html("<div><!> <!> <!></div> <!>",1);function MarkdownContent($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),disableMath=prop($$props,"disableMath",3,!1),containerRef=state$1(
void 0),renderedBlocks=state$1(proxy([])),unstableBlockHtml=state$1(""),incompleteCodeBlock=state$1(null),previewDialogOpen=state$1(!1),previewCode=state$1(""),previewLanguage=state$1("text"),streamingCodeScrollContainer=state$1(void 0);const streamingAutoScroll=createAutoScrollController();let pendingMarkdown=null,isProcessing=!1;const transformCache=new SvelteMap;let previousContent="";const themeStyleId=`highlight-theme-${window.idxThemeStyle=(window.idxThemeStyle??0)+1}`;let processor=user_derived(
()=>()=>{$$props.attachments;let proc=remark().use(remarkGfm);return disableMath()||(proc=proc.use(remarkMath)),proc=proc.use(remarkBreaks).use(remarkLiteralHtml).use(remarkRehype),disableMath()||(proc=proc.use(rehypeKatex)),proc.use(rehypeHighlight,{languages:grammars,aliases:{[FileTypeText.XML]:[FileTypeText.SVELTE,FileTypeText.VUE]}}).use(rehypeRestoreTableHtml).use(rehypeEnhanceLinks).use(rehypeEnhanceCodeBlocks).use(rehypeResolveAttachmentImages,{attachments:$$props.attachments}).use(rehypeRtlSupport).
use(rehypeStringify,{allowDangerousHtml:!0})});function cleanupEventListeners(){if(!get$3(containerRef))return;const copyButtons=get$3(containerRef).querySelectorAll(".copy-code-btn"),previewButtons=get$3(containerRef).querySelectorAll(".preview-code-btn");for(const button of copyButtons)button.removeEventListener("click",handleCopyClick);for(const button of previewButtons)button.removeEventListener("click",handlePreviewClick)}function cleanupHighlightTheme(){document.getElementById(themeStyleId)?.
containerRef).querySelectorAll(IMAGE_NOT_ERROR_BOUND_SELECTOR);for(const img of images)img.dataset[DATA_ERROR_BOUND_ATTR]=BOOL_TRUE_STRING,img.addEventListener("error",handleImageError)}function handleImageError(event2){const img=event2.target;if(!img||!img.src||img.src.startsWith(UrlProtocol.DATA)||img.dataset[DATA_ERROR_HANDLED_ATTR]===BOOL_TRUE_STRING)return;img.dataset[DATA_ERROR_HANDLED_ATTR]=BOOL_TRUE_STRING;const src=img.src,fallback2=document.createElement("div");fallback2.className="ima\
ge-load-error",fallback2.innerHTML=getImageErrorFallbackHtml(src),img.parentNode?.replaceChild(fallback2,img)}async function updateRenderedBlocks(markdown2){if(pendingMarkdown=markdown2,!isProcessing){isProcessing=!0;try{for(;pendingMarkdown!==null;){const nextMarkdown=pendingMarkdown;pendingMarkdown=null,await processMarkdown(nextMarkdown),pendingMarkdown!==null&&await new Promise(resolve2=>requestAnimationFrame(resolve2))}}catch(error2){console.error("Failed to process markdown:",error2),set$1(
renderedBlocks,[],!0),set$1(unstableBlockHtml,markdown2.replace(/\n/g,"<br>"),!0)}finally{isProcessing=!1}}}user_effect(()=>{const isDark=derivedMode.current===ColorMode.DARK;loadHighlightTheme(isDark)}),user_effect(()=>{updateRenderedBlocks($$props.content)}),user_effect(()=>{const hasRenderedBlocks=get$3(renderedBlocks).length>0,hasUnstableBlock=!!get$3(unstableBlockHtml);(hasRenderedBlocks||hasUnstableBlock)&&get$3(containerRef)&&(setupCodeBlockActions(),setupImageErrorHandlers())}),user_effect(
-()=>{streamingAutoScroll.setContainer(get$3(streamingCodeScrollContainer))}),user_effect(()=>{streamingAutoScroll.updateInterval(get$3(incompleteCodeBlock)!==null)}),onDestroy(()=>{cleanupEventListeners(),cleanupHighlightTheme(),streamingAutoScroll.destroy()});var fragment=root$Q(),div=first_child(fragment),node_1=child(div);each(node_1,17,()=>get$3(renderedBlocks),block2=>block2.id,($$anchor2,block2)=>{var div_1=root_1$q();html$6(div_1,()=>get$3(block2).html,!0),reset(div_1),action(div_1,($$node,$$action_arg)=>fadeInView?.(
-$$node,$$action_arg),()=>({skipIfVisible:!0})),template_effect(()=>set_attribute(div_1,"data-block-id",get$3(block2).id)),append($$anchor2,div_1)});var node_2=sibling(node_1,2);{var consequent=$$anchor2=>{var div_2=root_2$J();html$6(div_2,()=>get$3(unstableBlockHtml),!0),reset(div_2),append($$anchor2,div_2)};if_block(node_2,$$render=>{get$3(unstableBlockHtml)&&$$render(consequent)})}var node_3=sibling(node_2,2);{var consequent_1=$$anchor2=>{var div_3=root_3$A(),div_4=child(div_3),span=child(div_4),
+()=>{streamingAutoScroll.setContainer(get$3(streamingCodeScrollContainer))}),user_effect(()=>{streamingAutoScroll.updateInterval(get$3(incompleteCodeBlock)!==null)}),onDestroy(()=>{cleanupEventListeners(),cleanupHighlightTheme(),streamingAutoScroll.destroy()});var fragment=root$R(),div=first_child(fragment),node_1=child(div);each(node_1,17,()=>get$3(renderedBlocks),block2=>block2.id,($$anchor2,block2)=>{var div_1=root_1$r();html$6(div_1,()=>get$3(block2).html,!0),reset(div_1),action(div_1,($$node,$$action_arg)=>fadeInView?.(
+$$node,$$action_arg),()=>({skipIfVisible:!0})),template_effect(()=>set_attribute(div_1,"data-block-id",get$3(block2).id)),append($$anchor2,div_1)});var node_2=sibling(node_1,2);{var consequent=$$anchor2=>{var div_2=root_2$I();html$6(div_2,()=>get$3(unstableBlockHtml),!0),reset(div_2),append($$anchor2,div_2)};if_block(node_2,$$render=>{get$3(unstableBlockHtml)&&$$render(consequent)})}var node_3=sibling(node_2,2);{var consequent_1=$$anchor2=>{var div_3=root_3$B(),div_4=child(div_3),span=child(div_4),
text2=child(span,!0);reset(span);var node_4=sibling(span,2);{let $0=user_derived(()=>get$3(incompleteCodeBlock).language||"text");CodeBlockActions(node_4,{get code(){return get$3(incompleteCodeBlock).code},get language(){return get$3($0)},disabled:!0,onPreview:(code2,lang)=>{set$1(previewCode,code2,!0),set$1(previewLanguage,lang,!0),set$1(previewDialogOpen,!0)}})}reset(div_4);var div_5=sibling(div_4,2),pre=child(div_5),code_1=child(pre);html$6(code_1,()=>highlightCode(get$3(incompleteCodeBlock).
code,get$3(incompleteCodeBlock).language||"text"),!0),reset(code_1),reset(pre),reset(div_5),bind_this(div_5,$$value=>set$1(streamingCodeScrollContainer,$$value),()=>get$3(streamingCodeScrollContainer)),reset(div_3),template_effect(()=>{set_text(text2,get$3(incompleteCodeBlock).language||"text"),set_class(code_1,1,`hljs language-${(get$3(incompleteCodeBlock).language||"text")??""}`,"svelte-wjdxdt")}),event("scroll",div_5,()=>streamingAutoScroll.handleScroll()),append($$anchor2,div_3)};if_block(node_3,
$$render=>{get$3(incompleteCodeBlock)&&$$render(consequent_1)})}reset(div),bind_this(div,$$value=>set$1(containerRef,$$value),()=>get$3(containerRef));var node_5=sibling(div,2);DialogCodePreview(node_5,{get open(){return get$3(previewDialogOpen)},get code(){return get$3(previewCode)},get language(){return get$3(previewLanguage)},onOpenChange:handlePreviewDialogOpenChange}),template_effect($0=>set_class(div,1,`${className()??""}${$0??""}`,"svelte-wjdxdt"),[()=>config$1()[SETTINGS_KEYS.FULL_HEIGHT_CODE_BLOCKS]?
-" full-height-code-blocks":""]),append($$anchor,fragment),pop()}var root$P=from_html('<div><pre class="m-0 svelte-hp0zxr"><code class="hljs text-sm leading-relaxed svelte-hp0zxr"></code></pre></div>');function SyntaxHighlightedCode($$anchor,$$props){push$1($$props,!0);let language2=prop($$props,"language",3,"text"),className=prop($$props,"class",3,""),maxHeight=prop($$props,"maxHeight",3,"60vh"),maxWidth=prop($$props,"maxWidth",3,""),highlightedHtml=state$1("");function loadHighlightTheme(isDark){
+" full-height-code-blocks":""]),append($$anchor,fragment),pop()}var root$Q=from_html('<div><pre class="m-0 svelte-hp0zxr"><code class="hljs text-sm leading-relaxed svelte-hp0zxr"></code></pre></div>');function SyntaxHighlightedCode($$anchor,$$props){push$1($$props,!0);let language2=prop($$props,"language",3,"text"),className=prop($$props,"class",3,""),maxHeight=prop($$props,"maxHeight",3,"60vh"),maxWidth=prop($$props,"maxWidth",3,""),highlightedHtml=state$1("");function loadHighlightTheme(isDark){
document.querySelectorAll("style[data-highlight-theme-preview]").forEach(style3=>style3.remove());const style2=document.createElement("style");style2.setAttribute("data-highlight-theme-preview","true"),style2.textContent=isDark?githubDarkCss:githubLightCss,document.head.appendChild(style2)}user_effect(()=>{const isDark=derivedMode.current===ColorMode.DARK;loadHighlightTheme(isDark)}),user_effect(()=>{if(!$$props.code){set$1(highlightedHtml,"");return}try{const lang=language2().toLowerCase();if(HighlightJS$1.
-getLanguage(lang)){const result=HighlightJS$1.highlight($$props.code,{language:lang});set$1(highlightedHtml,result.value,!0)}else{const result=HighlightJS$1.highlightAuto($$props.code);set$1(highlightedHtml,result.value,!0)}}catch{set$1(highlightedHtml,$$props.code.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),!0)}});var div=root$P(),pre=child(div),code_1=child(pre);html$6(code_1,()=>get$3(highlightedHtml),!0),reset(code_1),reset(pre),reset(div),template_effect(()=>{set_class(div,
-1,`code-preview-wrapper rounded-lg border border-border bg-muted ${className()??""}`,"svelte-hp0zxr"),set_style(div,`max-height: ${maxHeight()??""}; max-width: ${maxWidth()??""};`)}),append($$anchor,div),pop()}var root_5$j=from_html('<span class="text-xs italic"> </span>'),root_3$z=from_html('<div class="flex items-center gap-2 text-muted-foreground"><!> <span class="font-mono text-sm font-medium"> </span> <!></div> <div><!> <span class="sr-only">Toggle content</span></div>',1),root_6$l=from_html(
-'<div class="overflow-y-auto border-t border-muted px-3 pb-3" style="min-height: var(--min-message-height); max-height: var(--max-message-height);"><!></div>'),root_2$I=from_html("<!> <!>",1);function CollapsibleContentBlock($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15,!1),className=prop($$props,"class",3,""),iconClass=prop($$props,"iconClass",3,"h-4 w-4"),isStreaming=prop($$props,"isStreaming",3,!1),contentContainer=state$1(void 0);const autoScroll=createAutoScrollController();
+getLanguage(lang)){const result=HighlightJS$1.highlight($$props.code,{language:lang});set$1(highlightedHtml,result.value,!0)}else{const result=HighlightJS$1.highlightAuto($$props.code);set$1(highlightedHtml,result.value,!0)}}catch{set$1(highlightedHtml,$$props.code.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),!0)}});var div=root$Q(),pre=child(div),code_1=child(pre);html$6(code_1,()=>get$3(highlightedHtml),!0),reset(code_1),reset(pre),reset(div),template_effect(()=>{set_class(div,
+1,`code-preview-wrapper rounded-lg border border-border bg-muted ${className()??""}`,"svelte-hp0zxr"),set_style(div,`max-height: ${maxHeight()??""}; max-width: ${maxWidth()??""};`)}),append($$anchor,div),pop()}var root_5$i=from_html('<span class="text-xs italic"> </span>'),root_3$A=from_html('<div class="flex items-center gap-2 text-muted-foreground"><!> <span class="font-mono text-sm font-medium"> </span> <!></div> <div><!> <span class="sr-only">Toggle content</span></div>',1),root_6$k=from_html(
+'<div class="overflow-y-auto border-t border-muted px-3 pb-3" style="min-height: var(--min-message-height); max-height: var(--max-message-height);"><!></div>'),root_2$H=from_html("<!> <!>",1);function CollapsibleContentBlock($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15,!1),className=prop($$props,"class",3,""),iconClass=prop($$props,"iconClass",3,"h-4 w-4"),isStreaming=prop($$props,"isStreaming",3,!1),contentContainer=state$1(void 0);const autoScroll=createAutoScrollController();
user_effect(()=>{autoScroll.setContainer(get$3(contentContainer))}),user_effect(()=>{autoScroll.updateInterval(open2()&&isStreaming())});function handleScroll(){autoScroll.handleScroll()}var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Collapsible,($$anchor2,Collapsible_Root)=>{Collapsible_Root($$anchor2,{get open(){return open2()},onOpenChange:value=>{open2(value),$$props.onToggle?.()},get class(){return className()},children:($$anchor3,$$slotProps)=>{Card($$anchor3,{class:"\
-gap-0 border-muted bg-muted/30 py-0",children:($$anchor4,$$slotProps2)=>{var fragment_2=root_2$I(),node_1=first_child(fragment_2);component(node_1,()=>Collapsible_trigger,($$anchor5,Collapsible_Trigger)=>{Collapsible_Trigger($$anchor5,{class:"flex w-full cursor-pointer items-center justify-between p-3",children:($$anchor6,$$slotProps3)=>{var fragment_3=root_3$z(),div=first_child(fragment_3),node_2=child(div);{var consequent=$$anchor7=>{var fragment_4=comment$2(),node_3=first_child(fragment_4);component(
-node_3,()=>$$props.icon,($$anchor8,IconComponent_1)=>{IconComponent_1($$anchor8,{get class(){return iconClass()}})}),append($$anchor7,fragment_4)};if_block(node_2,$$render=>{$$props.icon&&$$render(consequent)})}var span=sibling(node_2,2),text2=child(span,!0);reset(span);var node_4=sibling(span,2);{var consequent_1=$$anchor7=>{var span_1=root_5$j(),text_1=child(span_1,!0);reset(span_1),template_effect(()=>set_text(text_1,$$props.subtitle)),append($$anchor7,span_1)};if_block(node_4,$$render=>{$$props.
+gap-0 border-muted bg-muted/30 py-0",children:($$anchor4,$$slotProps2)=>{var fragment_2=root_2$H(),node_1=first_child(fragment_2);component(node_1,()=>Collapsible_trigger,($$anchor5,Collapsible_Trigger)=>{Collapsible_Trigger($$anchor5,{class:"flex w-full cursor-pointer items-center justify-between p-3",children:($$anchor6,$$slotProps3)=>{var fragment_3=root_3$A(),div=first_child(fragment_3),node_2=child(div);{var consequent=$$anchor7=>{var fragment_4=comment$2(),node_3=first_child(fragment_4);component(
+node_3,()=>$$props.icon,($$anchor8,IconComponent_1)=>{IconComponent_1($$anchor8,{get class(){return iconClass()}})}),append($$anchor7,fragment_4)};if_block(node_2,$$render=>{$$props.icon&&$$render(consequent)})}var span=sibling(node_2,2),text2=child(span,!0);reset(span);var node_4=sibling(span,2);{var consequent_1=$$anchor7=>{var span_1=root_5$i(),text_1=child(span_1,!0);reset(span_1),template_effect(()=>set_text(text_1,$$props.subtitle)),append($$anchor7,span_1)};if_block(node_4,$$render=>{$$props.
subtitle&&$$render(consequent_1)})}reset(div);var div_1=sibling(div,2),node_5=child(div_1);Chevrons_up_down(node_5,{class:"h-4 w-4"}),next$1(2),reset(div_1),template_effect($0=>{set_text(text2,$$props.title),set_class(div_1,1,$0)},[()=>clsx(buttonVariants({variant:"ghost",size:"sm",class:"h-6 w-6 p-0 text-muted-foreground hover:text-foreground"}))]),append($$anchor6,fragment_3)},$$slots:{default:!0}})});var node_6=sibling(node_1,2);component(node_6,()=>Collapsible_content,($$anchor5,Collapsible_Content)=>{
-Collapsible_Content($$anchor5,{children:($$anchor6,$$slotProps3)=>{var div_2=root_6$l(),node_7=child(div_2);snippet(node_7,()=>$$props.children),reset(div_2),bind_this(div_2,$$value=>set$1(contentContainer,$$value),()=>get$3(contentContainer)),event("scroll",div_2,handleScroll),append($$anchor6,div_2)},$$slots:{default:!0}})}),append($$anchor4,fragment_2)},$$slots:{default:!0}})},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}function Dialog_title($$anchor,$$props){push$1($$props,!0);let ref2=prop(
+Collapsible_Content($$anchor5,{children:($$anchor6,$$slotProps3)=>{var div_2=root_6$k(),node_7=child(div_2);snippet(node_7,()=>$$props.children),reset(div_2),bind_this(div_2,$$value=>set$1(contentContainer,$$value),()=>get$3(contentContainer)),event("scroll",div_2,handleScroll),append($$anchor6,div_2)},$$slots:{default:!0}})}),append($$anchor4,fragment_2)},$$slots:{default:!0}})},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}function Dialog_title($$anchor,$$props){push$1($$props,!0);let ref2=prop(
$$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("text-lg leading-none font-semibold",$$props.class));component(node2,()=>Dialog_title$1,($$anchor2,DialogPrimitive_Title)=>{DialogPrimitive_Title($$anchor2,spread_props({"data-slot":"dialog-title",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,
-fragment),pop()}var root$O=from_html("<div><!></div>");function Dialog_footer($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$O();attribute_effect(div,$0=>({"data-slot":"dialog-footer",class:$0,...restProps}),[()=>cn$1("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(
-div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}var root$N=from_html("<div><!></div>");function Dialog_header($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$N();attribute_effect(div,$0=>({"data-slot":"dialog-header",class:$0,...restProps}),[()=>cn$1("flex flex-col gap-2 text-center sm:text-left",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.
+fragment),pop()}var root$P=from_html("<div><!></div>");function Dialog_footer($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$P();attribute_effect(div,$0=>({"data-slot":"dialog-footer",class:$0,...restProps}),[()=>cn$1("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(
+div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}var root$O=from_html("<div><!></div>");function Dialog_header($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$O();attribute_effect(div,$0=>({"data-slot":"dialog-header",class:$0,...restProps}),[()=>cn$1("flex flex-col gap-2 text-center sm:text-left",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.
children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}function Dialog_overlay($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=\
-open]:fade-in-0",$$props.class));component(node2,()=>Dialog_overlay$1,($$anchor2,DialogPrimitive_Overlay)=>{DialogPrimitive_Overlay($$anchor2,spread_props({"data-slot":"dialog-overlay",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}var root_4$m=from_html('<!> <span class="sr-only">Close</span>',1),root_2$H=from_html("<!> <!>",1),root_1$p=from_html("<!> <!>",1);function Dialog_content($$anchor,$$props){push$1(
-$$props,!0);let ref2=prop($$props,"ref",15,null),showCloseButton=prop($$props,"showCloseButton",3,!0),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","portalProps","children","showCloseButton"]);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Portal$1,($$anchor2,Dialog_Portal)=>{Dialog_Portal($$anchor2,spread_props(()=>$$props.portalProps,{children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$p(),node_1=first_child(fragment_1);component(node_1,
+open]:fade-in-0",$$props.class));component(node2,()=>Dialog_overlay$1,($$anchor2,DialogPrimitive_Overlay)=>{DialogPrimitive_Overlay($$anchor2,spread_props({"data-slot":"dialog-overlay",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}var root_4$n=from_html('<!> <span class="sr-only">Close</span>',1),root_2$G=from_html("<!> <!>",1),root_1$q=from_html("<!> <!>",1);function Dialog_content($$anchor,$$props){push$1(
+$$props,!0);let ref2=prop($$props,"ref",15,null),showCloseButton=prop($$props,"showCloseButton",3,!0),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","portalProps","children","showCloseButton"]);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Portal$1,($$anchor2,Dialog_Portal)=>{Dialog_Portal($$anchor2,spread_props(()=>$$props.portalProps,{children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$q(),node_1=first_child(fragment_1);component(node_1,
()=>Dialog_overlay,($$anchor4,Dialog_Overlay)=>{Dialog_Overlay($$anchor4,{})});var node_2=sibling(node_1,2);{let $0=user_derived(()=>cn$1("fixed top-[50%] left-[50%] z-50 grid max-h-[100dvh] w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 overflow-y-auto rounded-lg border border-border/30 bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:\
-fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg md:max-h-[100vh]",$$props.class));component(node_2,()=>Dialog_content$1,($$anchor4,DialogPrimitive_Content)=>{DialogPrimitive_Content($$anchor4,spread_props({"data-slot":"dialog-content",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$H(),node_3=first_child(fragment_2);snippet(node_3,()=>$$props.children??noop$3);var node_4=sibling(node_3,
+fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg md:max-h-[100vh]",$$props.class));component(node_2,()=>Dialog_content$1,($$anchor4,DialogPrimitive_Content)=>{DialogPrimitive_Content($$anchor4,spread_props({"data-slot":"dialog-content",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)},children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$G(),node_3=first_child(fragment_2);snippet(node_3,()=>$$props.children??noop$3);var node_4=sibling(node_3,
2);{var consequent=$$anchor6=>{var fragment_3=comment$2(),node_5=first_child(fragment_3);component(node_5,()=>Dialog_close,($$anchor7,DialogPrimitive_Close)=>{DialogPrimitive_Close($$anchor7,{class:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:($$anchor8,$$slotProps3)=>{
-var fragment_4=root_4$m(),node_6=first_child(fragment_4);X(node_6,{}),next$1(2),append($$anchor8,fragment_4)},$$slots:{default:!0}})}),append($$anchor6,fragment_3)};if_block(node_4,$$render=>{showCloseButton()&&$$render(consequent)})}append($$anchor5,fragment_2)},$$slots:{default:!0}}))})}append($$anchor3,fragment_1)},$$slots:{default:!0}}))}),append($$anchor,fragment),pop()}function Dialog_description($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props(
+var fragment_4=root_4$n(),node_6=first_child(fragment_4);X(node_6,{}),next$1(2),append($$anchor8,fragment_4)},$$slots:{default:!0}})}),append($$anchor6,fragment_3)};if_block(node_4,$$render=>{showCloseButton()&&$$render(consequent)})}append($$anchor5,fragment_2)},$$slots:{default:!0}}))})}append($$anchor3,fragment_1)},$$slots:{default:!0}}))}),append($$anchor,fragment),pop()}function Dialog_description($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props(
$$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("text-sm text-muted-foreground",$$props.class));component(node2,()=>Dialog_description$1,($$anchor2,DialogPrimitive_Description)=>{DialogPrimitive_Description($$anchor2,spread_props({"data-slot":"dialog-description",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}const Root$2=Dialog,
-Portal$1=Portal$2;var root_1$o=from_html("<!> Add New Server",1),root_2$G=from_html('<div class="rounded-md border border-dashed p-4 text-sm text-muted-foreground">No MCP Servers configured yet. Add one to enable agentic features.</div>'),root_3$y=from_html('<div class="grid gap-3" style="grid-template-columns: repeat(auto-fill, minmax(min(32rem, calc(100dvw - 2rem)), 1fr));"></div>'),root$M=from_html('<div class="max-h-full overflow-auto"><div class="flex items-center gap-2 p-4 md:absolute md:t\
-op-8 md:left-8 md:px-0 md:py-2"><!> <h1 class="text-xl font-semibold md:text-2xl">MCP Servers</h1></div> <div class="sticky top-0 z-10 mt-4 flex items-start justify-end gap-4 px-8 py-4"><!></div> <!> <div><!> <!></div></div>');function SettingsMcpServers($$anchor,$$props){push$1($$props,!0);let servers=user_derived(()=>mcpStore.getServersSorted()),initialLoadComplete=state$1(!1),isAddingServer=state$1(!1);onMount$1(()=>{if(page$1.url.searchParams.has("add")){set$1(isAddingServer,!0);const newUrl=new URL(
-page$1.url);newUrl.searchParams.delete("add"),replaceState(newUrl,{})}}),user_effect(()=>{if(get$3(initialLoadComplete))return;get$3(servers).length>0&&get$3(servers).every(server=>{const state2=mcpStore.getHealthCheckState(server.id);return state2.status===HealthCheckStatus.SUCCESS||state2.status===HealthCheckStatus.ERROR})&&set$1(initialLoadComplete,!0)});var div=root$M(),div_1=child(div),node2=child(div_1);McpLogo(node2,{class:"h-5 w-5 md:h-6 md:w-6"}),next$1(2),reset(div_1);var div_2=sibling(
-div_1,2),node_1=child(div_2);Button(node_1,{variant:"outline",size:"sm",class:"shrink-0",onclick:()=>set$1(isAddingServer,!0),children:($$anchor2,$$slotProps)=>{var fragment=root_1$o(),node_2=first_child(fragment);Plus(node_2,{class:"h-4 w-4"}),next$1(),append($$anchor2,fragment)},$$slots:{default:!0}}),reset(div_2);var node_3=sibling(div_2,2);DialogMcpServerAddNew(node_3,{get open(){return get$3(isAddingServer)},set open($$value){set$1(isAddingServer,$$value,!0)}});var div_3=sibling(node_3,2),node_4=child(
-div_3);{var consequent=$$anchor2=>{var div_4=root_2$G();append($$anchor2,div_4)};if_block(node_4,$$render=>{get$3(servers).length===0&&!get$3(isAddingServer)&&$$render(consequent)})}var node_5=sibling(node_4,2);{var consequent_2=$$anchor2=>{var div_5=root_3$y();each(div_5,21,()=>get$3(servers),server=>server.id,($$anchor3,server)=>{var fragment_1=comment$2(),node_6=first_child(fragment_1);{var consequent_1=$$anchor4=>{McpServerCardSkeleton($$anchor4)},alternate=$$anchor4=>{{let $0=user_derived(()=>mcpStore.
-getServerFavicon(get$3(server).id)),$1=user_derived(()=>conversationsStore.isMcpServerEnabledForChat(get$3(server).id));McpServerCard($$anchor4,{get server(){return get$3(server)},get faviconUrl(){return get$3($0)},get enabled(){return get$3($1)},onToggle:async()=>{const wasEnabled=conversationsStore.isMcpServerEnabledForChat(get$3(server).id);await conversationsStore.toggleMcpServerForChat(get$3(server).id),wasEnabled||toolsStore.enableAllToolsForServer(get$3(server).id)},onUpdate:updates=>mcpStore.
-updateServer(get$3(server).id,updates),onDelete:()=>mcpStore.removeServer(get$3(server).id)})}};if_block(node_6,$$render=>{get$3(initialLoadComplete)?$$render(alternate,-1):$$render(consequent_1)})}append($$anchor3,fragment_1)}),reset(div_5),append($$anchor2,div_5)};if_block(node_5,$$render=>{get$3(servers).length>0&&$$render(consequent_2)})}reset(div_3),reset(div),template_effect(()=>set_class(div_3,1,`grid gap-5 md:space-y-4 ${$$props.class??""}`)),transition(1,div,()=>fade,()=>({duration:150})),
-append($$anchor,div),pop()}delegate(["click"]);var root_3$x=from_html("<!> Tools",1),root_5$i=from_html("<!> Resources",1),root_7$g=from_html("<!> Prompts",1),root_9$c=from_html("<!> Logging",1),root_11$7=from_html("<!> Completions",1),root_13$5=from_html("<!> Tasks",1),root_1$n=from_html("<!> <!> <!> <!> <!> <!>",1);function McpCapabilitiesBadges($$anchor,$$props){push$1($$props,!0);var fragment=comment$2(),node2=first_child(fragment);{var consequent_6=$$anchor2=>{var fragment_1=root_1$n(),node_1=first_child(
-fragment_1);{var consequent=$$anchor3=>{Badge($$anchor3,{variant:"outline",class:"h-5 gap-1 bg-green-50 px-1.5 text-[10px] dark:bg-green-950",children:($$anchor4,$$slotProps)=>{var fragment_3=root_3$x(),node_2=first_child(fragment_3);Wrench(node_2,{class:"h-3 w-3 text-green-600 dark:text-green-400"}),next$1(),append($$anchor4,fragment_3)},$$slots:{default:!0}})};if_block(node_1,$$render=>{$$props.capabilities.server.tools&&$$render(consequent)})}var node_3=sibling(node_1,2);{var consequent_1=$$anchor3=>{
-Badge($$anchor3,{variant:"outline",class:"h-5 gap-1 bg-blue-50 px-1.5 text-[10px] dark:bg-blue-950",children:($$anchor4,$$slotProps)=>{var fragment_5=root_5$i(),node_4=first_child(fragment_5);Database(node_4,{class:"h-3 w-3 text-blue-600 dark:text-blue-400"}),next$1(),append($$anchor4,fragment_5)},$$slots:{default:!0}})};if_block(node_3,$$render=>{$$props.capabilities.server.resources&&$$render(consequent_1)})}var node_5=sibling(node_3,2);{var consequent_2=$$anchor3=>{Badge($$anchor3,{variant:"o\
-utline",class:"h-5 gap-1 bg-purple-50 px-1.5 text-[10px] dark:bg-purple-950",children:($$anchor4,$$slotProps)=>{var fragment_7=root_7$g(),node_6=first_child(fragment_7);Message_square(node_6,{class:"h-3 w-3 text-purple-600 dark:text-purple-400"}),next$1(),append($$anchor4,fragment_7)},$$slots:{default:!0}})};if_block(node_5,$$render=>{$$props.capabilities.server.prompts&&$$render(consequent_2)})}var node_7=sibling(node_5,2);{var consequent_3=$$anchor3=>{Badge($$anchor3,{variant:"outline",class:"\
-h-5 gap-1 bg-orange-50 px-1.5 text-[10px] dark:bg-orange-950",children:($$anchor4,$$slotProps)=>{var fragment_9=root_9$c(),node_8=first_child(fragment_9);File_text(node_8,{class:"h-3 w-3 text-orange-600 dark:text-orange-400"}),next$1(),append($$anchor4,fragment_9)},$$slots:{default:!0}})};if_block(node_7,$$render=>{$$props.capabilities.server.logging&&$$render(consequent_3)})}var node_9=sibling(node_7,2);{var consequent_4=$$anchor3=>{Badge($$anchor3,{variant:"outline",class:"h-5 gap-1 bg-cyan-50\
- px-1.5 text-[10px] dark:bg-cyan-950",children:($$anchor4,$$slotProps)=>{var fragment_11=root_11$7(),node_10=first_child(fragment_11);Sparkles(node_10,{class:"h-3 w-3 text-cyan-600 dark:text-cyan-400"}),next$1(),append($$anchor4,fragment_11)},$$slots:{default:!0}})};if_block(node_9,$$render=>{$$props.capabilities.server.completions&&$$render(consequent_4)})}var node_11=sibling(node_9,2);{var consequent_5=$$anchor3=>{Badge($$anchor3,{variant:"outline",class:"h-5 gap-1 bg-pink-50 px-1.5 text-[10px\
-] dark:bg-pink-950",children:($$anchor4,$$slotProps)=>{var fragment_13=root_13$5(),node_12=first_child(fragment_13);List_checks(node_12,{class:"h-3 w-3 text-pink-600 dark:text-pink-400"}),next$1(),append($$anchor4,fragment_13)},$$slots:{default:!0}})};if_block(node_11,$$render=>{$$props.capabilities.server.tasks&&$$render(consequent_5)})}append($$anchor2,fragment_1)};if_block(node2,$$render=>{$$props.capabilities&&$$render(consequent_6)})}append($$anchor,fragment),pop()}var root_6$k=from_html('<\
-span class="ml-1"> </span>'),root_3$w=from_html("<!> <span> </span> <!>",1),root_9$b=from_html('<details class="ml-11"><summary class="cursor-pointer text-[10px] text-muted-foreground">details</summary> <pre class="mt-1 overflow-x-auto rounded bg-background/70 p-2 text-[10px] break-all whitespace-pre-wrap text-foreground/80"> </pre></details>'),root_8$i=from_html('<div><span class="shrink-0 text-muted-foreground"> </span> <!> <span class="break-all"> </span></div> <!>',1),root_7$f=from_html('<di\
-v class="max-h-64 space-y-0.5 overflow-y-auto rounded bg-muted/50 p-2 font-mono text-[10px]"></div>'),root_2$F=from_html('<div class="space-y-2"><!></div> <!>',1);function McpConnectionLogs($$anchor,$$props){push$1($$props,!0);let defaultExpanded=prop($$props,"defaultExpanded",3,!1),isExpanded=user_derived(defaultExpanded);function formatLogDetails(details){if(details==null)return"";try{return JSON.stringify(details,null,2)}catch{return String(details)}}var fragment=comment$2(),node2=first_child(
-fragment);{var consequent_3=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Collapsible,($$anchor3,Collapsible_Root)=>{Collapsible_Root($$anchor3,{get class(){return $$props.class},get open(){return get$3(isExpanded)},set open($$value){set$1(isExpanded,$$value)},children:($$anchor4,$$slotProps)=>{var fragment_2=root_2$F(),div=first_child(fragment_2),node_2=child(div);component(node_2,()=>Collapsible_trigger,($$anchor5,Collapsible_Trigger)=>{Collapsible_Trigger(
-$$anchor5,{class:"flex w-full items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:($$anchor6,$$slotProps2)=>{var fragment_3=root_3$w(),node_3=first_child(fragment_3);{var consequent=$$anchor7=>{Chevron_down($$anchor7,{class:"h-3.5 w-3.5"})},alternate=$$anchor7=>{Chevron_right($$anchor7,{class:"h-3.5 w-3.5"})};if_block(node_3,$$render=>{get$3(isExpanded)?$$render(consequent):$$render(alternate,-1)})}var span=sibling(node_3,2),text2=child(span);reset(span);var node_4=sibling(
-span,2);{var consequent_1=$$anchor7=>{var span_1=root_6$k(),text_1=child(span_1);reset(span_1),template_effect(()=>set_text(text_1,`· Connected in ${$$props.connectionTimeMs??""}ms`)),append($$anchor7,span_1)};if_block(node_4,$$render=>{$$props.connectionTimeMs!==void 0&&$$render(consequent_1)})}template_effect(()=>set_text(text2,`Connection Log (${$$props.logs.length??""})`)),append($$anchor6,fragment_3)},$$slots:{default:!0}})}),reset(div);var node_5=sibling(div,2);component(node_5,()=>Collapsible_content,
-($$anchor5,Collapsible_Content)=>{Collapsible_Content($$anchor5,{class:"mt-2",children:($$anchor6,$$slotProps2)=>{var div_1=root_7$f();each(div_1,21,()=>$$props.logs,log=>log.timestamp.getTime()+log.message,($$anchor7,log)=>{const IconComponent=user_derived(()=>getMcpLogLevelIcon(get$3(log).level));var fragment_6=root_8$i(),div_2=first_child(fragment_6),span_2=child(div_2),text_2=child(span_2,!0);reset(span_2);var node_6=sibling(span_2,2);component(node_6,()=>get$3(IconComponent),($$anchor8,IconComponent_1)=>{
-IconComponent_1($$anchor8,{class:"mt-0.5 h-3 w-3 shrink-0"})});var span_3=sibling(node_6,2),text_3=child(span_3,!0);reset(span_3),reset(div_2);var node_7=sibling(div_2,2);{var consequent_2=$$anchor8=>{var details_1=root_9$b(),pre=sibling(child(details_1),2),text_4=child(pre,!0);reset(pre),reset(details_1),template_effect($0=>set_text(text_4,$0),[()=>formatLogDetails(get$3(log).details)]),append($$anchor8,details_1)};if_block(node_7,$$render=>{get$3(log).details!==void 0&&$$render(consequent_2)})}
-template_effect(($0,$1)=>{set_class(div_2,1,$0),set_text(text_2,$1),set_text(text_3,get$3(log).message)},[()=>clsx(["flex items-start gap-1.5",getMcpLogLevelClass(get$3(log).level)]),()=>formatTime(get$3(log).timestamp)]),append($$anchor7,fragment_6)}),reset(div_1),append($$anchor6,div_1)},$$slots:{default:!0}})}),append($$anchor4,fragment_2)},$$slots:{default:!0}})}),append($$anchor2,fragment_1)};if_block(node2,$$render=>{$$props.logs.length>0&&$$render(consequent_3)})}append($$anchor,fragment),
-pop()}var root_1$m=from_html('<p class="mt-1.5 text-xs text-destructive"> </p>'),root_3$v=from_html('<span class="inline-flex gap-0.75 text-xs text-muted-foreground/60">(Run <pre>llama-server</pre> with <pre>--webui-mcp-proxy</pre> flag)</span>'),root_2$E=from_html('<label><!> <span><span class="text-xs text-muted-foreground">Use llama-server proxy</span> <br/> <!></span></label>'),root$L=from_html('<div class="grid gap-3"><div><label class="mb-2 block text-xs font-medium">Server URL <span class\
-="text-destructive">*</span></label> <!> <!> <!></div> <!></div>');function McpServerForm($$anchor,$$props){push$1($$props,!0);let useProxy=prop($$props,"useProxy",3,!1),urlError=prop($$props,"urlError",3,null),id2=prop($$props,"id",3,"server"),isWebSocket=user_derived(()=>$$props.url.toLowerCase().startsWith(UrlProtocol.WEBSOCKET)||$$props.url.toLowerCase().startsWith(UrlProtocol.WEBSOCKET_SECURE)),headerPairs=user_derived(()=>parseHeadersToArray($$props.headers));function updateHeaderPairs(newPairs){
-set$1(headerPairs,newPairs),$$props.onHeadersChange(serializeHeaders(newPairs))}var div=root$L(),div_1=child(div),label=child(div_1),node2=sibling(label,2);{let $0=user_derived(()=>urlError()?"border-destructive":"");Input(node2,{get id(){return`server-url-${id2()??""}`},type:"url",get placeholder(){return MCP_SERVER_URL_PLACEHOLDER},get value(){return $$props.url},oninput:e=>$$props.onUrlChange(e.currentTarget.value),get class(){return get$3($0)}})}var node_1=sibling(node2,2);{var consequent=$$anchor2=>{
-var p2=root_1$m(),text2=child(p2,!0);reset(p2),template_effect(()=>set_text(text2,urlError())),append($$anchor2,p2)};if_block(node_1,$$render=>{urlError()&&$$render(consequent)})}var node_2=sibling(node_1,2);{var consequent_2=$$anchor2=>{var label_1=root_2$E(),node_3=child(label_1);{let $0=user_derived(()=>!mcpStore.isProxyAvailable);Switch(node_3,{class:"mt-1",get id(){return`use-proxy-${id2()??""}`},get checked(){return useProxy()},get disabled(){return get$3($0)},onCheckedChange:checked=>$$props.
-onUseProxyChange?.(checked)})}var span=sibling(node_3,2),node_4=sibling(child(span),4);{var consequent_1=$$anchor3=>{var span_1=root_3$v();append($$anchor3,span_1)};if_block(node_4,$$render=>{mcpStore.isProxyAvailable||$$render(consequent_1)})}reset(span),reset(label_1),template_effect(()=>set_class(label_1,1,clsx(["mt-3 flex items-start gap-2",mcpStore.isProxyAvailable&&"cursor-pointer",!mcpStore.isProxyAvailable&&"opacity-80"]))),append($$anchor2,label_1)};if_block(node_2,$$render=>{!get$3(isWebSocket)&&
-$$props.onUseProxyChange&&$$render(consequent_2)})}reset(div_1);var node_5=sibling(div_1,2);KeyValuePairs(node_5,{class:"mt-2",get pairs(){return get$3(headerPairs)},onPairsChange:updateHeaderPairs,keyPlaceholder:"Header name",valuePlaceholder:"Value",addButtonLabel:"Add",emptyMessage:"No custom headers configured.",sectionLabel:"Custom Headers",sectionLabelOptional:!0}),reset(div),template_effect(()=>set_attribute(label,"for",`server-url-${id2()??""}`)),append($$anchor,div),pop()}var root$K=from_html(
-"<div></div>");function Skeleton($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var div=root$K();attribute_effect(div,$0=>({"data-slot":"skeleton",class:$0,...restProps}),[()=>cn$1("animate-pulse rounded-md bg-accent",$$props.class)]),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}var root_4$l=from_html('<p class="text-xs text-destructive"> </p>'),root_5$h=from_html(
-'<p class="line-clamp-2 text-xs text-muted-foreground"> </p>'),root_6$j=from_html('<div class="space-y-2"><div class="flex items-center gap-2"><!> <!></div> <div class="flex flex-wrap gap-1.5"><!> <!> <!></div></div> <div class="space-y-1.5"><div class="flex items-center gap-2"><!> <!></div></div>',1),root_7$e=from_html("<!> <!> <!>",1),root_12$6=from_html('<div class="flex flex-wrap items-center gap-1"><span class="text-[10px] text-muted-foreground"> </span></div>'),root_3$u=from_html('<!> <!> \
-<!> <div class="grid gap-3"><!></div> <div class="flex justify-between gap-4"><!> <!></div>',1),root$J=from_html("<!> <!>",1);function McpServerCard($$anchor,$$props){push$1($$props,!0);let healthState=user_derived(()=>mcpStore.getHealthCheckState($$props.server.id)),displayName=user_derived(()=>mcpStore.getServerLabel($$props.server)),isIdle=user_derived(()=>get$3(healthState).status===HealthCheckStatus.IDLE),isHealthChecking=user_derived(()=>get$3(healthState).status===HealthCheckStatus.CONNECTING),
-isConnected=user_derived(()=>get$3(healthState).status===HealthCheckStatus.SUCCESS),isError=user_derived(()=>get$3(healthState).status===HealthCheckStatus.ERROR),showSkeleton=user_derived(()=>get$3(isIdle)||get$3(isHealthChecking)),errorMessage=user_derived(()=>get$3(healthState).status===HealthCheckStatus.ERROR?get$3(healthState).message:void 0),tools=user_derived(()=>get$3(healthState).status===HealthCheckStatus.SUCCESS?get$3(healthState).tools:[]),connectionLogs=user_derived(()=>get$3(healthState).
-status===HealthCheckStatus.CONNECTING||get$3(healthState).status===HealthCheckStatus.SUCCESS||get$3(healthState).status===HealthCheckStatus.ERROR?get$3(healthState).logs:[]),successState=user_derived(()=>get$3(healthState).status===HealthCheckStatus.SUCCESS?get$3(healthState):null),serverInfo=user_derived(()=>get$3(successState)?.serverInfo),capabilities=user_derived(()=>get$3(successState)?.capabilities),transportType=user_derived(()=>get$3(successState)?.transportType),protocolVersion=user_derived(
+Portal$1=Portal$2;var root_1$p=from_html("<!> Add New Server",1),root_2$F=from_html('<div class="rounded-md border border-dashed p-4 text-sm text-muted-foreground">No MCP Servers configured yet. Add one to enable agentic features.</div>'),root_3$z=from_html('<div class="grid gap-3" style="grid-template-columns: repeat(auto-fill, minmax(min(32rem, calc(100dvw - 2rem)), 1fr));"></div>'),root$N=from_html('<div class="h-full max-h-[100dvh] overflow-y-auto"><div class="flex items-center gap-2 p-4 md:\
+absolute md:top-8 md:left-8 md:px-0 md:py-2"><!> <h1 class="text-xl font-semibold md:text-2xl">MCP Servers</h1></div> <div class="sticky top-0 z-10 mt-4 flex items-start gap-4 p-4 md:justify-end md:px-8"><!></div> <!> <div><!> <!></div></div>');function SettingsMcpServers($$anchor,$$props){push$1($$props,!0);let servers=user_derived(()=>mcpStore.getServersSorted()),initialLoadComplete=state$1(!1),isAddingServer=state$1(!1);onMount$1(()=>{if(page$1.url.searchParams.has("add")){set$1(isAddingServer,
+!0);const newUrl=new URL(page$1.url);newUrl.searchParams.delete("add"),replaceState(newUrl,{})}}),user_effect(()=>{if(get$3(initialLoadComplete))return;get$3(servers).length>0&&get$3(servers).every(server=>{const state2=mcpStore.getHealthCheckState(server.id);return state2.status===HealthCheckStatus.SUCCESS||state2.status===HealthCheckStatus.ERROR})&&set$1(initialLoadComplete,!0)});var div=root$N(),div_1=child(div),node2=child(div_1);McpLogo(node2,{class:"h-5 w-5 md:h-6 md:w-6"}),next$1(2),reset(
+div_1);var div_2=sibling(div_1,2),node_1=child(div_2);Button(node_1,{variant:"outline",size:"sm",class:"shrink-0",onclick:()=>set$1(isAddingServer,!0),children:($$anchor2,$$slotProps)=>{var fragment=root_1$p(),node_2=first_child(fragment);Plus(node_2,{class:"h-4 w-4"}),next$1(),append($$anchor2,fragment)},$$slots:{default:!0}}),reset(div_2);var node_3=sibling(div_2,2);DialogMcpServerAddNew(node_3,{get open(){return get$3(isAddingServer)},set open($$value){set$1(isAddingServer,$$value,!0)}});var div_3=sibling(
+node_3,2),node_4=child(div_3);{var consequent=$$anchor2=>{var div_4=root_2$F();append($$anchor2,div_4)};if_block(node_4,$$render=>{get$3(servers).length===0&&!get$3(isAddingServer)&&$$render(consequent)})}var node_5=sibling(node_4,2);{var consequent_2=$$anchor2=>{var div_5=root_3$z();each(div_5,21,()=>get$3(servers),server=>server.id,($$anchor3,server)=>{var fragment_1=comment$2(),node_6=first_child(fragment_1);{var consequent_1=$$anchor4=>{McpServerCardSkeleton($$anchor4)},alternate=$$anchor4=>{
+{let $0=user_derived(()=>conversationsStore.isMcpServerEnabledForChat(get$3(server).id));McpServerCard($$anchor4,{get server(){return get$3(server)},get enabled(){return get$3($0)},onToggle:async()=>{const wasEnabled=conversationsStore.isMcpServerEnabledForChat(get$3(server).id);await conversationsStore.toggleMcpServerForChat(get$3(server).id),wasEnabled||toolsStore.enableAllToolsForServer(get$3(server).id)},onUpdate:updates=>mcpStore.updateServer(get$3(server).id,updates),onDelete:()=>mcpStore.
+removeServer(get$3(server).id)})}};if_block(node_6,$$render=>{get$3(initialLoadComplete)?$$render(alternate,-1):$$render(consequent_1)})}append($$anchor3,fragment_1)}),reset(div_5),append($$anchor2,div_5)};if_block(node_5,$$render=>{get$3(servers).length>0&&$$render(consequent_2)})}reset(div_3),reset(div),template_effect(()=>set_class(div_3,1,`grid gap-5 md:space-y-4 ${$$props.class??""}`)),transition(1,div,()=>fade,()=>({duration:150})),append($$anchor,div),pop()}delegate(["click"]);var root_3$y=from_html(
+"<!> Tools",1),root_5$h=from_html("<!> Resources",1),root_7$g=from_html("<!> Prompts",1),root_9$c=from_html("<!> Logging",1),root_11$7=from_html("<!> Completions",1),root_13$5=from_html("<!> Tasks",1),root_1$o=from_html("<!> <!> <!> <!> <!> <!>",1);function McpCapabilitiesBadges($$anchor,$$props){push$1($$props,!0);var fragment=comment$2(),node2=first_child(fragment);{var consequent_6=$$anchor2=>{var fragment_1=root_1$o(),node_1=first_child(fragment_1);{var consequent=$$anchor3=>{Badge($$anchor3,
+{variant:"outline",class:"h-5 gap-1 bg-green-50 px-1.5 text-[10px] dark:bg-green-950",children:($$anchor4,$$slotProps)=>{var fragment_3=root_3$y(),node_2=first_child(fragment_3);Wrench(node_2,{class:"h-3 w-3 text-green-600 dark:text-green-400"}),next$1(),append($$anchor4,fragment_3)},$$slots:{default:!0}})};if_block(node_1,$$render=>{$$props.capabilities.server.tools&&$$render(consequent)})}var node_3=sibling(node_1,2);{var consequent_1=$$anchor3=>{Badge($$anchor3,{variant:"outline",class:"h-5 g\
+ap-1 bg-blue-50 px-1.5 text-[10px] dark:bg-blue-950",children:($$anchor4,$$slotProps)=>{var fragment_5=root_5$h(),node_4=first_child(fragment_5);Database(node_4,{class:"h-3 w-3 text-blue-600 dark:text-blue-400"}),next$1(),append($$anchor4,fragment_5)},$$slots:{default:!0}})};if_block(node_3,$$render=>{$$props.capabilities.server.resources&&$$render(consequent_1)})}var node_5=sibling(node_3,2);{var consequent_2=$$anchor3=>{Badge($$anchor3,{variant:"outline",class:"h-5 gap-1 bg-purple-50 px-1.5 te\
+xt-[10px] dark:bg-purple-950",children:($$anchor4,$$slotProps)=>{var fragment_7=root_7$g(),node_6=first_child(fragment_7);Message_square(node_6,{class:"h-3 w-3 text-purple-600 dark:text-purple-400"}),next$1(),append($$anchor4,fragment_7)},$$slots:{default:!0}})};if_block(node_5,$$render=>{$$props.capabilities.server.prompts&&$$render(consequent_2)})}var node_7=sibling(node_5,2);{var consequent_3=$$anchor3=>{Badge($$anchor3,{variant:"outline",class:"h-5 gap-1 bg-orange-50 px-1.5 text-[10px] dark:\
+bg-orange-950",children:($$anchor4,$$slotProps)=>{var fragment_9=root_9$c(),node_8=first_child(fragment_9);File_text(node_8,{class:"h-3 w-3 text-orange-600 dark:text-orange-400"}),next$1(),append($$anchor4,fragment_9)},$$slots:{default:!0}})};if_block(node_7,$$render=>{$$props.capabilities.server.logging&&$$render(consequent_3)})}var node_9=sibling(node_7,2);{var consequent_4=$$anchor3=>{Badge($$anchor3,{variant:"outline",class:"h-5 gap-1 bg-cyan-50 px-1.5 text-[10px] dark:bg-cyan-950",children:($$anchor4,$$slotProps)=>{
+var fragment_11=root_11$7(),node_10=first_child(fragment_11);Sparkles(node_10,{class:"h-3 w-3 text-cyan-600 dark:text-cyan-400"}),next$1(),append($$anchor4,fragment_11)},$$slots:{default:!0}})};if_block(node_9,$$render=>{$$props.capabilities.server.completions&&$$render(consequent_4)})}var node_11=sibling(node_9,2);{var consequent_5=$$anchor3=>{Badge($$anchor3,{variant:"outline",class:"h-5 gap-1 bg-pink-50 px-1.5 text-[10px] dark:bg-pink-950",children:($$anchor4,$$slotProps)=>{var fragment_13=root_13$5(),
+node_12=first_child(fragment_13);List_checks(node_12,{class:"h-3 w-3 text-pink-600 dark:text-pink-400"}),next$1(),append($$anchor4,fragment_13)},$$slots:{default:!0}})};if_block(node_11,$$render=>{$$props.capabilities.server.tasks&&$$render(consequent_5)})}append($$anchor2,fragment_1)};if_block(node2,$$render=>{$$props.capabilities&&$$render(consequent_6)})}append($$anchor,fragment),pop()}var root_6$j=from_html('<span class="ml-1"> </span>'),root_3$x=from_html("<!> <span> </span> <!>",1),root_9$b=from_html(
+'<details class="ml-11"><summary class="cursor-pointer text-[10px] text-muted-foreground">details</summary> <pre class="mt-1 overflow-x-auto rounded bg-background/70 p-2 text-[10px] break-all whitespace-pre-wrap text-foreground/80"> </pre></details>'),root_8$h=from_html('<div><span class="shrink-0 text-muted-foreground"> </span> <!> <span class="break-all"> </span></div> <!>',1),root_7$f=from_html('<div class="max-h-64 space-y-0.5 overflow-y-auto rounded bg-muted/50 p-2 font-mono text-[10px]"></\
+div>'),root_2$E=from_html('<div class="space-y-2"><!></div> <!>',1);function McpConnectionLogs($$anchor,$$props){push$1($$props,!0);let defaultExpanded=prop($$props,"defaultExpanded",3,!1),isExpanded=user_derived(defaultExpanded);function formatLogDetails(details){if(details==null)return"";try{return JSON.stringify(details,null,2)}catch{return String(details)}}var fragment=comment$2(),node2=first_child(fragment);{var consequent_3=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);
+component(node_1,()=>Collapsible,($$anchor3,Collapsible_Root)=>{Collapsible_Root($$anchor3,{get class(){return $$props.class},get open(){return get$3(isExpanded)},set open($$value){set$1(isExpanded,$$value)},children:($$anchor4,$$slotProps)=>{var fragment_2=root_2$E(),div=first_child(fragment_2),node_2=child(div);component(node_2,()=>Collapsible_trigger,($$anchor5,Collapsible_Trigger)=>{Collapsible_Trigger($$anchor5,{class:"flex w-full items-center gap-1 text-xs text-muted-foreground hover:text-\
+foreground",children:($$anchor6,$$slotProps2)=>{var fragment_3=root_3$x(),node_3=first_child(fragment_3);{var consequent=$$anchor7=>{Chevron_down($$anchor7,{class:"h-3.5 w-3.5"})},alternate=$$anchor7=>{Chevron_right($$anchor7,{class:"h-3.5 w-3.5"})};if_block(node_3,$$render=>{get$3(isExpanded)?$$render(consequent):$$render(alternate,-1)})}var span=sibling(node_3,2),text2=child(span);reset(span);var node_4=sibling(span,2);{var consequent_1=$$anchor7=>{var span_1=root_6$j(),text_1=child(span_1);reset(
+span_1),template_effect(()=>set_text(text_1,`· Connected in ${$$props.connectionTimeMs??""}ms`)),append($$anchor7,span_1)};if_block(node_4,$$render=>{$$props.connectionTimeMs!==void 0&&$$render(consequent_1)})}template_effect(()=>set_text(text2,`Connection Log (${$$props.logs.length??""})`)),append($$anchor6,fragment_3)},$$slots:{default:!0}})}),reset(div);var node_5=sibling(div,2);component(node_5,()=>Collapsible_content,($$anchor5,Collapsible_Content)=>{Collapsible_Content($$anchor5,{class:"m\
+t-2",children:($$anchor6,$$slotProps2)=>{var div_1=root_7$f();each(div_1,21,()=>$$props.logs,log=>log.timestamp.getTime()+log.message,($$anchor7,log)=>{const IconComponent=user_derived(()=>getMcpLogLevelIcon(get$3(log).level));var fragment_6=root_8$h(),div_2=first_child(fragment_6),span_2=child(div_2),text_2=child(span_2,!0);reset(span_2);var node_6=sibling(span_2,2);component(node_6,()=>get$3(IconComponent),($$anchor8,IconComponent_1)=>{IconComponent_1($$anchor8,{class:"mt-0.5 h-3 w-3 shrink-0"})});
+var span_3=sibling(node_6,2),text_3=child(span_3,!0);reset(span_3),reset(div_2);var node_7=sibling(div_2,2);{var consequent_2=$$anchor8=>{var details_1=root_9$b(),pre=sibling(child(details_1),2),text_4=child(pre,!0);reset(pre),reset(details_1),template_effect($0=>set_text(text_4,$0),[()=>formatLogDetails(get$3(log).details)]),append($$anchor8,details_1)};if_block(node_7,$$render=>{get$3(log).details!==void 0&&$$render(consequent_2)})}template_effect(($0,$1)=>{set_class(div_2,1,$0),set_text(text_2,
+$1),set_text(text_3,get$3(log).message)},[()=>clsx(["flex items-start gap-1.5",getMcpLogLevelClass(get$3(log).level)]),()=>formatTime(get$3(log).timestamp)]),append($$anchor7,fragment_6)}),reset(div_1),append($$anchor6,div_1)},$$slots:{default:!0}})}),append($$anchor4,fragment_2)},$$slots:{default:!0}})}),append($$anchor2,fragment_1)};if_block(node2,$$render=>{$$props.logs.length>0&&$$render(consequent_3)})}append($$anchor,fragment),pop()}var root_1$n=from_html('<p class="mt-1.5 text-xs text-des\
+tructive"> </p>'),root_3$w=from_html('<span class="inline-flex gap-0.75 text-xs text-muted-foreground/60">(Run <pre>llama-server</pre> with <pre>--webui-mcp-proxy</pre> flag)</span>'),root_2$D=from_html('<label><!> <span><span class="text-xs text-muted-foreground">Use llama-server proxy</span> <br/> <!></span></label>'),root$M=from_html('<div class="grid gap-3"><div><label class="mb-2 block text-xs font-medium">Server URL <span class="text-destructive">*</span></label> <!> <!> <!></div> <!></div\
+>');function McpServerForm($$anchor,$$props){push$1($$props,!0);let useProxy=prop($$props,"useProxy",3,!1),urlError=prop($$props,"urlError",3,null),id2=prop($$props,"id",3,"server"),isWebSocket=user_derived(()=>$$props.url.toLowerCase().startsWith(UrlProtocol.WEBSOCKET)||$$props.url.toLowerCase().startsWith(UrlProtocol.WEBSOCKET_SECURE)),headerPairs=user_derived(()=>parseHeadersToArray($$props.headers));function updateHeaderPairs(newPairs){set$1(headerPairs,newPairs),$$props.onHeadersChange(serializeHeaders(
+newPairs))}var div=root$M(),div_1=child(div),label=child(div_1),node2=sibling(label,2);{let $0=user_derived(()=>urlError()?"border-destructive":"");Input(node2,{get id(){return`server-url-${id2()??""}`},type:"url",get placeholder(){return MCP_SERVER_URL_PLACEHOLDER},get value(){return $$props.url},oninput:e=>$$props.onUrlChange(e.currentTarget.value),get class(){return get$3($0)}})}var node_1=sibling(node2,2);{var consequent=$$anchor2=>{var p2=root_1$n(),text2=child(p2,!0);reset(p2),template_effect(
+()=>set_text(text2,urlError())),append($$anchor2,p2)};if_block(node_1,$$render=>{urlError()&&$$render(consequent)})}var node_2=sibling(node_1,2);{var consequent_2=$$anchor2=>{var label_1=root_2$D(),node_3=child(label_1);{let $0=user_derived(()=>!mcpStore.isProxyAvailable);Switch(node_3,{class:"mt-1",get id(){return`use-proxy-${id2()??""}`},get checked(){return useProxy()},get disabled(){return get$3($0)},onCheckedChange:checked=>$$props.onUseProxyChange?.(checked)})}var span=sibling(node_3,2),node_4=sibling(
+child(span),4);{var consequent_1=$$anchor3=>{var span_1=root_3$w();append($$anchor3,span_1)};if_block(node_4,$$render=>{mcpStore.isProxyAvailable||$$render(consequent_1)})}reset(span),reset(label_1),template_effect(()=>set_class(label_1,1,clsx(["mt-3 flex items-start gap-2",mcpStore.isProxyAvailable&&"cursor-pointer",!mcpStore.isProxyAvailable&&"opacity-80"]))),append($$anchor2,label_1)};if_block(node_2,$$render=>{!get$3(isWebSocket)&&$$props.onUseProxyChange&&$$render(consequent_2)})}reset(div_1);
+var node_5=sibling(div_1,2);KeyValuePairs(node_5,{class:"mt-2",get pairs(){return get$3(headerPairs)},onPairsChange:updateHeaderPairs,keyPlaceholder:"Header name",valuePlaceholder:"Value",addButtonLabel:"Add",emptyMessage:"No custom headers configured.",sectionLabel:"Custom Headers",sectionLabelOptional:!0}),reset(div),template_effect(()=>set_attribute(label,"for",`server-url-${id2()??""}`)),append($$anchor,div),pop()}var root$L=from_html("<div></div>");function Skeleton($$anchor,$$props){push$1(
+$$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var div=root$L();attribute_effect(div,$0=>({"data-slot":"skeleton",class:$0,...restProps}),[()=>cn$1("animate-pulse rounded-md bg-accent",$$props.class)]),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}var root_4$m=from_html('<p class="text-xs text-destructive"> </p>'),root_5$g=from_html('<p class="line-clamp-2 text-xs text-muted-foreground">\
+ </p>'),root_6$i=from_html('<div class="space-y-2"><div class="flex items-center gap-2"><!> <!></div> <div class="flex flex-wrap gap-1.5"><!> <!> <!></div></div> <div class="space-y-1.5"><div class="flex items-center gap-2"><!> <!></div></div>',1),root_7$e=from_html("<!> <!> <!>",1),root_12$6=from_html('<div class="flex flex-wrap items-center gap-1"><span class="text-[10px] text-muted-foreground"> </span></div>'),root_3$v=from_html('<!> <!> <!> <div class="grid gap-3"><!></div> <div class="flex \
+justify-between gap-4"><!> <!></div>',1),root$K=from_html("<!> <!>",1);function McpServerCard($$anchor,$$props){push$1($$props,!0);let healthState=user_derived(()=>mcpStore.getHealthCheckState($$props.server.id)),displayName=user_derived(()=>mcpStore.getServerLabel($$props.server)),faviconUrl=user_derived(()=>mcpStore.getServerFavicon($$props.server.id)),isIdle=user_derived(()=>get$3(healthState).status===HealthCheckStatus.IDLE),isHealthChecking=user_derived(()=>get$3(healthState).status===HealthCheckStatus.
+CONNECTING),isConnected=user_derived(()=>get$3(healthState).status===HealthCheckStatus.SUCCESS),isError=user_derived(()=>get$3(healthState).status===HealthCheckStatus.ERROR),showSkeleton=user_derived(()=>get$3(isIdle)||get$3(isHealthChecking)),errorMessage=user_derived(()=>get$3(healthState).status===HealthCheckStatus.ERROR?get$3(healthState).message:void 0),tools=user_derived(()=>get$3(healthState).status===HealthCheckStatus.SUCCESS?get$3(healthState).tools:[]),connectionLogs=user_derived(()=>get$3(
+healthState).status===HealthCheckStatus.CONNECTING||get$3(healthState).status===HealthCheckStatus.SUCCESS||get$3(healthState).status===HealthCheckStatus.ERROR?get$3(healthState).logs:[]),successState=user_derived(()=>get$3(healthState).status===HealthCheckStatus.SUCCESS?get$3(healthState):null),serverInfo=user_derived(()=>get$3(successState)?.serverInfo),capabilities=user_derived(()=>get$3(successState)?.capabilities),transportType=user_derived(()=>get$3(successState)?.transportType),protocolVersion=user_derived(
()=>get$3(successState)?.protocolVersion),connectionTimeMs=user_derived(()=>get$3(successState)?.connectionTimeMs),instructions=user_derived(()=>get$3(successState)?.instructions),isEditing2=user_derived(()=>!$$props.server.url.trim()),showDeleteDialog=state$1(!1),editFormRef=state$1(null);function handleHealthCheck(){mcpStore.runHealthCheck($$props.server)}async function startEditing(){set$1(isEditing2,!0),await tick(),get$3(editFormRef)?.setInitialValues($$props.server.url,$$props.server.headers||
-"",$$props.server.useProxy||!1)}function cancelEditing(){$$props.server.url.trim()?set$1(isEditing2,!1):$$props.onDelete()}function saveEditing(url2,headers,useProxy){$$props.onUpdate({url:url2,headers:headers||void 0,useProxy}),set$1(isEditing2,!1),$$props.server.enabled&&url2&&setTimeout(()=>mcpStore.runHealthCheck({...$$props.server,url:url2,useProxy}),100)}function handleDeleteClick(){set$1(showDeleteDialog,!0)}var fragment=root$J(),node2=first_child(fragment);component(node2,()=>Card,($$anchor2,Card_Root)=>{
-Card_Root($$anchor2,{class:"!gap-3 bg-muted/30 p-4",children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{var consequent=$$anchor4=>{bind_this(McpServerCardEditForm($$anchor4,{get serverId(){return $$props.server.id},get serverUrl(){return $$props.server.url},get serverUseProxy(){return $$props.server.useProxy},onSave:saveEditing,onCancel:cancelEditing}),$$value=>set$1(editFormRef,$$value,!0),()=>get$3(editFormRef))},alternate_1=$$anchor4=>{var fragment_3=root_3$u(),
-node_2=first_child(fragment_3);{let $0=user_derived(()=>$$props.enabled??$$props.server.enabled);McpServerCardHeader(node_2,{get displayName(){return get$3(displayName)},get faviconUrl(){return $$props.faviconUrl},get enabled(){return get$3($0)},get disabled(){return get$3(isError)},get onToggle(){return $$props.onToggle},get serverInfo(){return get$3(serverInfo)},get capabilities(){return get$3(capabilities)},get transportType(){return get$3(transportType)}})}var node_3=sibling(node_2,2);{var consequent_1=$$anchor5=>{
-var p2=root_4$l(),text2=child(p2,!0);reset(p2),template_effect(()=>set_text(text2,get$3(errorMessage))),append($$anchor5,p2)};if_block(node_3,$$render=>{get$3(isError)&&get$3(errorMessage)&&$$render(consequent_1)})}var node_4=sibling(node_3,2);{var consequent_2=$$anchor5=>{var p_1=root_5$h(),text_1=child(p_1,!0);reset(p_1),template_effect(()=>set_text(text_1,get$3(serverInfo).description)),append($$anchor5,p_1)};if_block(node_4,$$render=>{get$3(isConnected)&&get$3(serverInfo)?.description&&$$render(
-consequent_2)})}var div=sibling(node_4,2),node_5=child(div);{var consequent_3=$$anchor5=>{var fragment_4=root_6$j(),div_1=first_child(fragment_4),div_2=child(div_1),node_6=child(div_2);Skeleton(node_6,{class:"h-4 w-4 rounded"});var node_7=sibling(node_6,2);Skeleton(node_7,{class:"h-3 w-24"}),reset(div_2);var div_3=sibling(div_2,2),node_8=child(div_3);Skeleton(node_8,{class:"h-5 w-16 rounded-full"});var node_9=sibling(node_8,2);Skeleton(node_9,{class:"h-5 w-20 rounded-full"});var node_10=sibling(
+"",$$props.server.useProxy||!1)}function cancelEditing(){$$props.server.url.trim()?set$1(isEditing2,!1):$$props.onDelete()}function saveEditing(url2,headers,useProxy){$$props.onUpdate({url:url2,headers:headers||void 0,useProxy}),set$1(isEditing2,!1),$$props.server.enabled&&url2&&setTimeout(()=>mcpStore.runHealthCheck({...$$props.server,url:url2,useProxy}),100)}function handleDeleteClick(){set$1(showDeleteDialog,!0)}var fragment=root$K(),node2=first_child(fragment);component(node2,()=>Card,($$anchor2,Card_Root)=>{
+Card_Root($$anchor2,{class:"!gap-3 bg-muted/30 p-4",children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);{var consequent=$$anchor4=>{bind_this(McpServerCardEditForm($$anchor4,{get serverId(){return $$props.server.id},get serverUrl(){return $$props.server.url},get serverUseProxy(){return $$props.server.useProxy},onSave:saveEditing,onCancel:cancelEditing}),$$value=>set$1(editFormRef,$$value,!0),()=>get$3(editFormRef))},alternate_1=$$anchor4=>{var fragment_3=root_3$v(),
+node_2=first_child(fragment_3);{let $0=user_derived(()=>$$props.enabled??$$props.server.enabled);McpServerCardHeader(node_2,{get displayName(){return get$3(displayName)},get faviconUrl(){return get$3(faviconUrl)},get enabled(){return get$3($0)},get disabled(){return get$3(isError)},get onToggle(){return $$props.onToggle},get serverInfo(){return get$3(serverInfo)},get capabilities(){return get$3(capabilities)},get transportType(){return get$3(transportType)}})}var node_3=sibling(node_2,2);{var consequent_1=$$anchor5=>{
+var p2=root_4$m(),text2=child(p2,!0);reset(p2),template_effect(()=>set_text(text2,get$3(errorMessage))),append($$anchor5,p2)};if_block(node_3,$$render=>{get$3(isError)&&get$3(errorMessage)&&$$render(consequent_1)})}var node_4=sibling(node_3,2);{var consequent_2=$$anchor5=>{var p_1=root_5$g(),text_1=child(p_1,!0);reset(p_1),template_effect(()=>set_text(text_1,get$3(serverInfo).description)),append($$anchor5,p_1)};if_block(node_4,$$render=>{get$3(isConnected)&&get$3(serverInfo)?.description&&$$render(
+consequent_2)})}var div=sibling(node_4,2),node_5=child(div);{var consequent_3=$$anchor5=>{var fragment_4=root_6$i(),div_1=first_child(fragment_4),div_2=child(div_1),node_6=child(div_2);Skeleton(node_6,{class:"h-4 w-4 rounded"});var node_7=sibling(node_6,2);Skeleton(node_7,{class:"h-3 w-24"}),reset(div_2);var div_3=sibling(div_2,2),node_8=child(div_3);Skeleton(node_8,{class:"h-5 w-16 rounded-full"});var node_9=sibling(node_8,2);Skeleton(node_9,{class:"h-5 w-20 rounded-full"});var node_10=sibling(
node_9,2);Skeleton(node_10,{class:"h-5 w-14 rounded-full"}),reset(div_3),reset(div_1);var div_4=sibling(div_1,2),div_5=child(div_4),node_11=child(div_5);Skeleton(node_11,{class:"h-4 w-4 rounded"});var node_12=sibling(node_11,2);Skeleton(node_12,{class:"h-3 w-32"}),reset(div_5),reset(div_4),append($$anchor5,fragment_4)},alternate=$$anchor5=>{var fragment_5=root_7$e(),node_13=first_child(fragment_5);{var consequent_4=$$anchor6=>{McpServerInfo($$anchor6,{get instructions(){return get$3(instructions)}})};
if_block(node_13,$$render=>{get$3(isConnected)&&get$3(instructions)&&$$render(consequent_4)})}var node_14=sibling(node_13,2);{var consequent_5=$$anchor6=>{McpServerCardToolsList($$anchor6,{get tools(){return get$3(tools)}})};if_block(node_14,$$render=>{get$3(tools).length>0&&$$render(consequent_5)})}var node_15=sibling(node_14,2);{var consequent_6=$$anchor6=>{McpConnectionLogs($$anchor6,{get logs(){return get$3(connectionLogs)},get connectionTimeMs(){return get$3(connectionTimeMs)}})};if_block(node_15,
$$render=>{get$3(connectionLogs).length>0&&$$render(consequent_6)})}append($$anchor5,fragment_5)};if_block(node_5,$$render=>{get$3(showSkeleton)?$$render(consequent_3):$$render(alternate,-1)})}reset(div);var div_6=sibling(div,2),node_16=child(div_6);{var consequent_7=$$anchor5=>{Skeleton($$anchor5,{class:"h-3 w-28"})},consequent_8=$$anchor5=>{var div_7=root_12$6(),span=child(div_7),text_2=child(span);reset(span),reset(div_7),template_effect(()=>set_text(text_2,`Protocol version: ${get$3(protocolVersion)??
""}`)),append($$anchor5,div_7)};if_block(node_16,$$render=>{get$3(showSkeleton)?$$render(consequent_7):get$3(protocolVersion)&&$$render(consequent_8,1)})}var node_17=sibling(node_16,2);McpServerCardActions(node_17,{get isHealthChecking(){return get$3(isHealthChecking)},onEdit:startEditing,onRefresh:handleHealthCheck,onDelete:handleDeleteClick}),reset(div_6),append($$anchor4,fragment_3)};if_block(node_1,$$render=>{get$3(isEditing2)?$$render(consequent):$$render(alternate_1,-1)})}append($$anchor3,
-fragment_1)},$$slots:{default:!0}})});var node_18=sibling(node2,2);McpServerCardDeleteDialog(node_18,{get displayName(){return get$3(displayName)},onOpenChange:open2=>set$1(showDeleteDialog,open2,!0),get onConfirm(){return $$props.onDelete},get open(){return get$3(showDeleteDialog)},set open($$value){set$1(showDeleteDialog,$$value,!0)}}),append($$anchor,fragment),pop()}var root_1$l=from_html('<img alt="" class="h-5 w-5 shrink-0 rounded"/>'),root_2$D=from_html('<div class="flex h-5 w-5 shrink-0 i\
-tems-center justify-center rounded bg-muted"><!></div>'),root_5$g=from_html('<a target="_blank" rel="noopener noreferrer" class="shrink-0 text-muted-foreground hover:text-foreground" aria-label="Open website"><!></a>'),root_8$h=from_html("<!> ",1),root_6$i=from_html('<div class="flex flex-wrap items-center gap-1.5"><!> <!></div>'),root$I=from_html('<div class="space-y-3"><div class="flex items-start justify-between gap-3"><div class="grid min-w-0 gap-3"><div class="flex items-center gap-2 overfl\
-ow-hidden"><!> <p class="min-w-0 shrink-0 truncate leading-none font-medium"> </p> <!> <!></div> <!></div> <div class="flex shrink-0 items-center pl-2"><!></div></div></div>');function McpServerCardHeader($$anchor,$$props){push$1($$props,!0);let disabled=prop($$props,"disabled",3,!1);var div=root$I(),div_1=child(div),div_2=child(div_1),div_3=child(div_2),node2=child(div_3);{var consequent=$$anchor2=>{var img=root_1$l();template_effect(()=>set_attribute(img,"src",$$props.faviconUrl)),event("error",
-img,e=>{e.currentTarget.style.display="none"}),replay_events(img),append($$anchor2,img)},alternate=$$anchor2=>{var div_4=root_2$D(),node_1=child(div_4);Cable(node_1,{class:"h-3 w-3 text-muted-foreground"}),reset(div_4),append($$anchor2,div_4)};if_block(node2,$$render=>{$$props.faviconUrl?$$render(consequent):$$render(alternate,-1)})}var p2=sibling(node2,2),text2=child(p2,!0);reset(p2);var node_2=sibling(p2,2);{var consequent_1=$$anchor2=>{Badge($$anchor2,{variant:"secondary",class:"h-4 min-w-0 t\
-runcate px-1 text-[10px]",children:($$anchor3,$$slotProps)=>{next$1();var text_1=text$8();template_effect(()=>set_text(text_1,`v${$$props.serverInfo.version??""}`)),append($$anchor3,text_1)},$$slots:{default:!0}})};if_block(node_2,$$render=>{$$props.serverInfo?.version&&$$render(consequent_1)})}var node_3=sibling(node_2,2);{var consequent_2=$$anchor2=>{var a=root_5$g(),node_4=child(a);External_link(node_4,{class:"h-3 w-3"}),reset(a),template_effect(()=>set_attribute(a,"href",$$props.serverInfo.websiteUrl)),
-append($$anchor2,a)};if_block(node_3,$$render=>{$$props.serverInfo?.websiteUrl&&$$render(consequent_2)})}reset(div_3);var node_5=sibling(div_3,2);{var consequent_6=$$anchor2=>{var div_5=root_6$i(),node_6=child(div_5);{var consequent_4=$$anchor3=>{const TransportIcon=user_derived(()=>MCP_TRANSPORT_ICONS[$$props.transportType]);Badge($$anchor3,{variant:"outline",class:"h-5 gap-1 px-1.5 text-[10px]",children:($$anchor4,$$slotProps)=>{var fragment_3=root_8$h(),node_7=first_child(fragment_3);{var consequent_3=$$anchor5=>{
-var fragment_4=comment$2(),node_8=first_child(fragment_4);component(node_8,()=>get$3(TransportIcon),($$anchor6,TransportIcon_1)=>{TransportIcon_1($$anchor6,{class:"h-3 w-3"})}),append($$anchor5,fragment_4)};if_block(node_7,$$render=>{get$3(TransportIcon)&&$$render(consequent_3)})}var text_2=sibling(node_7);template_effect(()=>set_text(text_2,` ${(MCP_TRANSPORT_LABELS[$$props.transportType]||$$props.transportType)??""}`)),append($$anchor4,fragment_3)},$$slots:{default:!0}})};if_block(node_6,$$render=>{
-$$props.transportType&&$$render(consequent_4)})}var node_9=sibling(node_6,2);{var consequent_5=$$anchor3=>{McpCapabilitiesBadges($$anchor3,{get capabilities(){return $$props.capabilities}})};if_block(node_9,$$render=>{$$props.capabilities&&$$render(consequent_5)})}reset(div_5),append($$anchor2,div_5)};if_block(node_5,$$render=>{($$props.capabilities||$$props.transportType)&&$$render(consequent_6)})}reset(div_2);var div_6=sibling(div_2,2),node_10=child(div_6);Switch(node_10,{get checked(){return $$props.
-enabled},get disabled(){return disabled()},get onCheckedChange(){return $$props.onToggle}}),reset(div_6),reset(div_1),reset(div),template_effect(()=>set_text(text2,$$props.displayName)),append($$anchor,div),pop()}var root$H=from_html('<div class="flex shrink-0 items-center gap-1"><!> <!> <!></div>');function McpServerCardActions($$anchor,$$props){var div=root$H(),node2=child(div);Button(node2,{variant:"ghost",size:"icon",class:"h-7 w-7",get onclick(){return $$props.onEdit},"aria-label":"Edit",children:($$anchor2,$$slotProps)=>{
-Pencil($$anchor2,{class:"h-3.5 w-3.5"})},$$slots:{default:!0}});var node_1=sibling(node2,2);Button(node_1,{variant:"ghost",size:"icon",class:"h-7 w-7",get onclick(){return $$props.onRefresh},get disabled(){return $$props.isHealthChecking},"aria-label":"Refresh",children:($$anchor2,$$slotProps)=>{Refresh_cw($$anchor2,{class:"h-3.5 w-3.5"})},$$slots:{default:!0}});var node_2=sibling(node_1,2);Button(node_2,{variant:"ghost",size:"icon",class:"hover:text-destructive-foreground h-7 w-7 text-destructi\
-ve hover:bg-destructive/10",get onclick(){return $$props.onDelete},"aria-label":"Delete",children:($$anchor2,$$slotProps)=>{Trash_2($$anchor2,{class:"h-3.5 w-3.5"})},$$slots:{default:!0}}),reset(div),append($$anchor,div)}var root_2$C=from_html("<!> <span> </span>",1),root_8$g=from_html('<p class="mt-1 text-xs text-muted-foreground"> </p>'),root_6$h=from_html("<div><!> <!></div>"),root_5$f=from_html('<div class="max-h-64 space-y-3 overflow-y-auto"></div>'),root_1$k=from_html("<!> <!>",1);function McpServerCardToolsList($$anchor,$$props){
-push$1($$props,!0);let isExpanded=state$1(!1),toolsCount=user_derived(()=>$$props.tools.length);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Collapsible,($$anchor2,Collapsible_Root)=>{Collapsible_Root($$anchor2,{get open(){return get$3(isExpanded)},set open($$value){set$1(isExpanded,$$value,!0)},children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$k(),node_1=first_child(fragment_1);component(node_1,()=>Collapsible_trigger,($$anchor4,Collapsible_Trigger)=>{Collapsible_Trigger(
-$$anchor4,{class:"flex w-full items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$C(),node_2=first_child(fragment_2);{var consequent=$$anchor6=>{Chevron_down($$anchor6,{class:"h-3.5 w-3.5"})},alternate=$$anchor6=>{Chevron_right($$anchor6,{class:"h-3.5 w-3.5"})};if_block(node_2,$$render=>{get$3(isExpanded)?$$render(consequent):$$render(alternate,-1)})}var span=sibling(node_2,2),text2=child(span);reset(span),template_effect(
-()=>set_text(text2,`${get$3(toolsCount)??""} tools available · Show details`)),append($$anchor5,fragment_2)},$$slots:{default:!0}})});var node_3=sibling(node_1,2);component(node_3,()=>Collapsible_content,($$anchor4,Collapsible_Content)=>{Collapsible_Content($$anchor4,{class:"mt-2",children:($$anchor5,$$slotProps2)=>{var div=root_5$f();each(div,21,()=>$$props.tools,tool=>tool.name,($$anchor6,tool)=>{var div_1=root_6$h(),node_4=child(div_1);Badge(node_4,{variant:"secondary",children:($$anchor7,$$slotProps3)=>{
-next$1();var text_1=text$8();template_effect(()=>set_text(text_1,get$3(tool).name)),append($$anchor7,text_1)},$$slots:{default:!0}});var node_5=sibling(node_4,2);{var consequent_1=$$anchor7=>{var p2=root_8$g(),text_2=child(p2,!0);reset(p2),template_effect(()=>set_text(text_2,get$3(tool).description)),append($$anchor7,p2)};if_block(node_5,$$render=>{get$3(tool).description&&$$render(consequent_1)})}reset(div_1),append($$anchor6,div_1)}),reset(div),append($$anchor5,div)},$$slots:{default:!0}})}),append(
-$$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root$G=from_html('<div class="space-y-4"><p class="font-medium">Configure Server</p> <!> <div class="flex items-center justify-end gap-2"><!> <!></div></div>');function McpServerCardEditForm($$anchor,$$props){push$1($$props,!0);let serverUseProxy=prop($$props,"serverUseProxy",3,!1),editUrl=user_derived(()=>$$props.serverUrl),editHeaders=state$1(""),editUseProxy=user_derived(serverUseProxy),urlError=user_derived(()=>{
-if(!get$3(editUrl).trim())return"URL is required";try{return new URL(get$3(editUrl)),null}catch{return"Invalid URL format"}}),canSave=user_derived(()=>!get$3(urlError));function handleSave(){get$3(canSave)&&$$props.onSave(get$3(editUrl).trim(),get$3(editHeaders).trim(),get$3(editUseProxy))}function setInitialValues(url2,headers,useProxy){set$1(editUrl,url2),set$1(editHeaders,headers,!0),set$1(editUseProxy,useProxy)}var $$exports={setInitialValues},div=root$G(),node2=sibling(child(div),2);{let $0=user_derived(
-()=>get$3(editUrl)?get$3(urlError):null);McpServerForm(node2,{get url(){return get$3(editUrl)},get headers(){return get$3(editHeaders)},get useProxy(){return get$3(editUseProxy)},onUrlChange:v=>set$1(editUrl,v),onHeadersChange:v=>set$1(editHeaders,v,!0),onUseProxyChange:v=>set$1(editUseProxy,v),get urlError(){return get$3($0)},get id(){return $$props.serverId}})}var div_1=sibling(node2,2),node_1=child(div_1);Button(node_1,{variant:"secondary",size:"sm",get onclick(){return $$props.onCancel},children:($$anchor2,$$slotProps)=>{
-next$1();var text2=text$8("Cancel");append($$anchor2,text2)},$$slots:{default:!0}});var node_2=sibling(node_1,2);{let $0=user_derived(()=>!get$3(canSave));Button(node_2,{size:"sm",onclick:handleSave,get disabled(){return get$3($0)},children:($$anchor2,$$slotProps)=>{next$1();var text_1=text$8();template_effect($02=>set_text(text_1,$02),[()=>$$props.serverUrl.trim()?"Update":"Add"]),append($$anchor2,text_1)},$$slots:{default:!0}})}return reset(div_1),reset(div),append($$anchor,div),pop($$exports)}
-function Alert_dialog_title($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("text-lg font-semibold",$$props.class));component(node2,()=>Dialog_title$1,($$anchor2,AlertDialogPrimitive_Title)=>{AlertDialogPrimitive_Title($$anchor2,spread_props({"data-slot":"alert-dialog-title",get class(){return get$3($0)}},()=>restProps,
-{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}function Alert_dialog_action($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1(buttonVariants(),$$props.class));component(node2,()=>Alert_dialog_action$1,($$anchor2,AlertDialogPrimitive_Action)=>{AlertDialogPrimitive_Action(
-$$anchor2,spread_props({"data-slot":"alert-dialog-action",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}function Alert_dialog_cancel($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1(buttonVariants({variant:"outline"}),$$props.
-class));component(node2,()=>Alert_dialog_cancel$1,($$anchor2,AlertDialogPrimitive_Cancel)=>{AlertDialogPrimitive_Cancel($$anchor2,spread_props({"data-slot":"alert-dialog-cancel",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}var root$F=from_html("<div><!></div>");function Alert_dialog_footer($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots",
-"$$events","$$legacy","ref","class","children"]);var div=root$F();attribute_effect(div,$0=>({"data-slot":"alert-dialog-footer",class:$0,...restProps}),[()=>cn$1("mt-6 flex flex-row gap-2 sm:mt-0 sm:justify-end [&>*]:flex-1 sm:[&>*]:flex-none",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}var root$E=from_html("<div><!></div>");function Alert_dialog_header($$anchor,$$props){push$1(
-$$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$E();attribute_effect(div,$0=>({"data-slot":"alert-dialog-header",class:$0,...restProps}),[()=>cn$1("flex flex-col gap-2 text-center sm:text-left",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}function Alert_dialog_overlay($$anchor,$$props){
-push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",$$props.class));component(node2,()=>Dialog_overlay$1,($$anchor2,AlertDialogPrimitive_Overlay)=>{AlertDialogPrimitive_Overlay($$anchor2,
-spread_props({"data-slot":"alert-dialog-overlay",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}var root_1$j=from_html("<!> <!>",1);function Alert_dialog_content($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","portalProps"]);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Portal$2,
-($$anchor2,AlertDialogPrimitive_Portal)=>{AlertDialogPrimitive_Portal($$anchor2,spread_props(()=>$$props.portalProps,{children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$j(),node_1=first_child(fragment_1);Alert_dialog_overlay(node_1,{});var node_2=sibling(node_1,2);{let $0=user_derived(()=>cn$1("fixed z-[999999] grid w-full gap-4 border bg-background p-6 shadow-lg duration-200","right-0 bottom-0 left-0 max-h-[100dvh] translate-x-0 translate-y-0 overflow-y-auto rounded-t-lg","data-[state=clo\
-sed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-bottom-full","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-full","sm:top-[50%] sm:right-auto sm:bottom-auto sm:left-[50%] sm:max-h-[100vh] sm:max-w-lg sm:translate-x-[-50%] sm:translate-y-[-50%] sm:rounded-lg","sm:data-[state=closed]:slide-out-to-bottom-0 sm:data-[state=closed]:zoom-out-95","sm:data-[state=open]:slide-in-from-bottom-0 sm:data-[state=open]:zoom-in-95",
-$$props.class));component(node_2,()=>Alert_dialog_content$1,($$anchor4,AlertDialogPrimitive_Content)=>{AlertDialogPrimitive_Content($$anchor4,spread_props({"data-slot":"alert-dialog-content",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor3,fragment_1)},$$slots:{default:!0}}))}),append($$anchor,fragment),pop()}function Alert_dialog_description($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props(
-$$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("text-sm text-muted-foreground",$$props.class));component(node2,()=>Dialog_description$1,($$anchor2,AlertDialogPrimitive_Description)=>{AlertDialogPrimitive_Description($$anchor2,spread_props({"data-slot":"alert-dialog-description",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),
-pop()}const Root$1=Alert_dialog,Portal=Portal$2;var root_5$e=from_html(`Are you sure you want to delete <strong> </strong>? This action cannot be
+fragment_1)},$$slots:{default:!0}})});var node_18=sibling(node2,2);McpServerCardDeleteDialog(node_18,{get displayName(){return get$3(displayName)},onOpenChange:open2=>set$1(showDeleteDialog,open2,!0),get onConfirm(){return $$props.onDelete},get open(){return get$3(showDeleteDialog)},set open($$value){set$1(showDeleteDialog,$$value,!0)}}),append($$anchor,fragment),pop()}var root_3$u=from_html("<!> ",1),root_1$m=from_html('<div class="flex flex-wrap items-center gap-1.5"><!> <!></div>'),root$J=from_html(
+'<div class="space-y-3"><div class="flex items-start justify-between gap-3"><div class="flex min-w-0 flex-col gap-3"><div class="inline-flex items-center gap-2"><!></div> <!></div> <div class="flex shrink-0 items-center pl-2"><!></div></div></div>');function McpServerCardHeader($$anchor,$$props){push$1($$props,!0);let disabled=prop($$props,"disabled",3,!1);var div=root$J(),div_1=child(div),div_2=child(div_1),div_3=child(div_2),node2=child(div_3);McpServerIdentity(node2,{get displayName(){return $$props.
+displayName},get faviconUrl(){return $$props.faviconUrl},get serverInfo(){return $$props.serverInfo},iconClass:"h-5 w-5",iconRounded:"rounded",nameClass:"leading-6 font-medium"}),reset(div_3);var node_1=sibling(div_3,2);{var consequent_3=$$anchor2=>{var div_4=root_1$m(),node_2=child(div_4);{var consequent_1=$$anchor3=>{const TransportIcon=user_derived(()=>MCP_TRANSPORT_ICONS[$$props.transportType]);Badge($$anchor3,{variant:"outline",class:"h-5 gap-1 px-1.5 text-[10px]",children:($$anchor4,$$slotProps)=>{
+var fragment_1=root_3$u(),node_3=first_child(fragment_1);{var consequent=$$anchor5=>{var fragment_2=comment$2(),node_4=first_child(fragment_2);component(node_4,()=>get$3(TransportIcon),($$anchor6,TransportIcon_1)=>{TransportIcon_1($$anchor6,{class:"h-3 w-3"})}),append($$anchor5,fragment_2)};if_block(node_3,$$render=>{get$3(TransportIcon)&&$$render(consequent)})}var text2=sibling(node_3);template_effect(()=>set_text(text2,` ${(MCP_TRANSPORT_LABELS[$$props.transportType]||$$props.transportType)??""}`)),
+append($$anchor4,fragment_1)},$$slots:{default:!0}})};if_block(node_2,$$render=>{$$props.transportType&&$$render(consequent_1)})}var node_5=sibling(node_2,2);{var consequent_2=$$anchor3=>{McpCapabilitiesBadges($$anchor3,{get capabilities(){return $$props.capabilities}})};if_block(node_5,$$render=>{$$props.capabilities&&$$render(consequent_2)})}reset(div_4),append($$anchor2,div_4)};if_block(node_1,$$render=>{($$props.capabilities||$$props.transportType)&&$$render(consequent_3)})}reset(div_2);var div_5=sibling(
+div_2,2),node_6=child(div_5);Switch(node_6,{get checked(){return $$props.enabled},get disabled(){return disabled()},get onCheckedChange(){return $$props.onToggle}}),reset(div_5),reset(div_1),reset(div),append($$anchor,div),pop()}var root$I=from_html('<div class="flex shrink-0 items-center gap-1"><!> <!> <!></div>');function McpServerCardActions($$anchor,$$props){var div=root$I(),node2=child(div);Button(node2,{variant:"ghost",size:"icon",class:"h-7 w-7",get onclick(){return $$props.onEdit},"aria-\
+label":"Edit",children:($$anchor2,$$slotProps)=>{Pencil($$anchor2,{class:"h-3.5 w-3.5"})},$$slots:{default:!0}});var node_1=sibling(node2,2);Button(node_1,{variant:"ghost",size:"icon",class:"h-7 w-7",get onclick(){return $$props.onRefresh},get disabled(){return $$props.isHealthChecking},"aria-label":"Refresh",children:($$anchor2,$$slotProps)=>{Refresh_cw($$anchor2,{class:"h-3.5 w-3.5"})},$$slots:{default:!0}});var node_2=sibling(node_1,2);Button(node_2,{variant:"ghost",size:"icon",class:"hover:t\
+ext-destructive-foreground h-7 w-7 text-destructive hover:bg-destructive/10",get onclick(){return $$props.onDelete},"aria-label":"Delete",children:($$anchor2,$$slotProps)=>{Trash_2($$anchor2,{class:"h-3.5 w-3.5"})},$$slots:{default:!0}}),reset(div),append($$anchor,div)}var root_2$C=from_html("<!> <span> </span>",1),root_8$g=from_html('<p class="mt-1 text-xs text-muted-foreground"> </p>'),root_6$h=from_html("<div><!> <!></div>"),root_5$f=from_html('<div class="max-h-64 space-y-3 overflow-y-auto">\
+</div>'),root_1$l=from_html("<!> <!>",1);function McpServerCardToolsList($$anchor,$$props){push$1($$props,!0);let isExpanded=state$1(!1),toolsCount=user_derived(()=>$$props.tools.length);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Collapsible,($$anchor2,Collapsible_Root)=>{Collapsible_Root($$anchor2,{get open(){return get$3(isExpanded)},set open($$value){set$1(isExpanded,$$value,!0)},children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$l(),node_1=first_child(fragment_1);
+component(node_1,()=>Collapsible_trigger,($$anchor4,Collapsible_Trigger)=>{Collapsible_Trigger($$anchor4,{class:"flex w-full items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$C(),node_2=first_child(fragment_2);{var consequent=$$anchor6=>{Chevron_down($$anchor6,{class:"h-3.5 w-3.5"})},alternate=$$anchor6=>{Chevron_right($$anchor6,{class:"h-3.5 w-3.5"})};if_block(node_2,$$render=>{get$3(isExpanded)?$$render(consequent):
+$$render(alternate,-1)})}var span=sibling(node_2,2),text2=child(span);reset(span),template_effect(()=>set_text(text2,`${get$3(toolsCount)??""} tools available · Show details`)),append($$anchor5,fragment_2)},$$slots:{default:!0}})});var node_3=sibling(node_1,2);component(node_3,()=>Collapsible_content,($$anchor4,Collapsible_Content)=>{Collapsible_Content($$anchor4,{class:"mt-2",children:($$anchor5,$$slotProps2)=>{var div=root_5$f();each(div,21,()=>$$props.tools,tool=>tool.name,($$anchor6,tool)=>{
+var div_1=root_6$h(),node_4=child(div_1);Badge(node_4,{variant:"secondary",children:($$anchor7,$$slotProps3)=>{next$1();var text_1=text$8();template_effect(()=>set_text(text_1,get$3(tool).name)),append($$anchor7,text_1)},$$slots:{default:!0}});var node_5=sibling(node_4,2);{var consequent_1=$$anchor7=>{var p2=root_8$g(),text_2=child(p2,!0);reset(p2),template_effect(()=>set_text(text_2,get$3(tool).description)),append($$anchor7,p2)};if_block(node_5,$$render=>{get$3(tool).description&&$$render(consequent_1)})}
+reset(div_1),append($$anchor6,div_1)}),reset(div),append($$anchor5,div)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root$H=from_html('<div class="space-y-4"><p class="font-medium">Configure Server</p> <!> <div class="flex items-center justify-end gap-2"><!> <!></div></div>');function McpServerCardEditForm($$anchor,$$props){push$1($$props,!0);let serverUseProxy=prop($$props,"serverUseProxy",3,!1),editUrl=user_derived(()=>$$props.
+serverUrl),editHeaders=state$1(""),editUseProxy=user_derived(serverUseProxy),urlError=user_derived(()=>{if(!get$3(editUrl).trim())return"URL is required";try{return new URL(get$3(editUrl)),null}catch{return"Invalid URL format"}}),canSave=user_derived(()=>!get$3(urlError));function handleSave(){get$3(canSave)&&$$props.onSave(get$3(editUrl).trim(),get$3(editHeaders).trim(),get$3(editUseProxy))}function setInitialValues(url2,headers,useProxy){set$1(editUrl,url2),set$1(editHeaders,headers,!0),set$1(
+editUseProxy,useProxy)}var $$exports={setInitialValues},div=root$H(),node2=sibling(child(div),2);{let $0=user_derived(()=>get$3(editUrl)?get$3(urlError):null);McpServerForm(node2,{get url(){return get$3(editUrl)},get headers(){return get$3(editHeaders)},get useProxy(){return get$3(editUseProxy)},onUrlChange:v=>set$1(editUrl,v),onHeadersChange:v=>set$1(editHeaders,v,!0),onUseProxyChange:v=>set$1(editUseProxy,v),get urlError(){return get$3($0)},get id(){return $$props.serverId}})}var div_1=sibling(
+node2,2),node_1=child(div_1);Button(node_1,{variant:"secondary",size:"sm",get onclick(){return $$props.onCancel},children:($$anchor2,$$slotProps)=>{next$1();var text2=text$8("Cancel");append($$anchor2,text2)},$$slots:{default:!0}});var node_2=sibling(node_1,2);{let $0=user_derived(()=>!get$3(canSave));Button(node_2,{size:"sm",onclick:handleSave,get disabled(){return get$3($0)},children:($$anchor2,$$slotProps)=>{next$1();var text_1=text$8();template_effect($02=>set_text(text_1,$02),[()=>$$props.serverUrl.
+trim()?"Update":"Add"]),append($$anchor2,text_1)},$$slots:{default:!0}})}return reset(div_1),reset(div),append($$anchor,div),pop($$exports)}function Alert_dialog_title($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("text-lg font-semibold",$$props.class));component(node2,()=>Dialog_title$1,($$anchor2,AlertDialogPrimitive_Title)=>{
+AlertDialogPrimitive_Title($$anchor2,spread_props({"data-slot":"alert-dialog-title",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}function Alert_dialog_action($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1(buttonVariants(),
+$$props.class));component(node2,()=>Alert_dialog_action$1,($$anchor2,AlertDialogPrimitive_Action)=>{AlertDialogPrimitive_Action($$anchor2,spread_props({"data-slot":"alert-dialog-action",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}function Alert_dialog_cancel($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","cl\
+ass"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1(buttonVariants({variant:"outline"}),$$props.class));component(node2,()=>Alert_dialog_cancel$1,($$anchor2,AlertDialogPrimitive_Cancel)=>{AlertDialogPrimitive_Cancel($$anchor2,spread_props({"data-slot":"alert-dialog-cancel",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}var root$G=from_html("<div><!></div>");function Alert_dialog_footer($$anchor,$$props){
+push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$G();attribute_effect(div,$0=>({"data-slot":"alert-dialog-footer",class:$0,...restProps}),[()=>cn$1("mt-6 flex flex-row gap-2 sm:mt-0 sm:justify-end [&>*]:flex-1 sm:[&>*]:flex-none",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(div,$$value=>ref2($$value),()=>ref2()),append($$anchor,div),
+pop()}var root$F=from_html("<div><!></div>");function Alert_dialog_header($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class","children"]);var div=root$F();attribute_effect(div,$0=>({"data-slot":"alert-dialog-header",class:$0,...restProps}),[()=>cn$1("flex flex-col gap-2 text-center sm:text-left",$$props.class)]);var node2=child(div);snippet(node2,()=>$$props.children??noop$3),reset(div),bind_this(div,
+$$value=>ref2($$value),()=>ref2()),append($$anchor,div),pop()}function Alert_dialog_overlay($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",$$props.class));component(
+node2,()=>Dialog_overlay$1,($$anchor2,AlertDialogPrimitive_Overlay)=>{AlertDialogPrimitive_Overlay($$anchor2,spread_props({"data-slot":"alert-dialog-overlay",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}var root_1$k=from_html("<!> <!>",1);function Alert_dialog_content($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy",
+"ref","class","portalProps"]);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Portal$2,($$anchor2,AlertDialogPrimitive_Portal)=>{AlertDialogPrimitive_Portal($$anchor2,spread_props(()=>$$props.portalProps,{children:($$anchor3,$$slotProps)=>{var fragment_1=root_1$k(),node_1=first_child(fragment_1);Alert_dialog_overlay(node_1,{});var node_2=sibling(node_1,2);{let $0=user_derived(()=>cn$1("fixed z-[999999] grid w-full gap-4 border bg-background p-6 shadow-lg duration-200","r\
+ight-0 bottom-0 left-0 max-h-[100dvh] translate-x-0 translate-y-0 overflow-y-auto rounded-t-lg","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-bottom-full","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-full","sm:top-[50%] sm:right-auto sm:bottom-auto sm:left-[50%] sm:max-h-[100vh] sm:max-w-lg sm:translate-x-[-50%] sm:translate-y-[-50%] sm:rounded-lg","sm:data-[state=closed]:slide-out-to-bottom-0 \
+sm:data-[state=closed]:zoom-out-95","sm:data-[state=open]:slide-in-from-bottom-0 sm:data-[state=open]:zoom-in-95",$$props.class));component(node_2,()=>Alert_dialog_content$1,($$anchor4,AlertDialogPrimitive_Content)=>{AlertDialogPrimitive_Content($$anchor4,spread_props({"data-slot":"alert-dialog-content",get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor3,fragment_1)},$$slots:{default:!0}}))}),append($$anchor,fragment),pop()}
+function Alert_dialog_description($$anchor,$$props){push$1($$props,!0);let ref2=prop($$props,"ref",15,null),restProps=rest_props($$props,["$$slots","$$events","$$legacy","ref","class"]);var fragment=comment$2(),node2=first_child(fragment);{let $0=user_derived(()=>cn$1("text-sm text-muted-foreground",$$props.class));component(node2,()=>Dialog_description$1,($$anchor2,AlertDialogPrimitive_Description)=>{AlertDialogPrimitive_Description($$anchor2,spread_props({"data-slot":"alert-dialog-description",
+get class(){return get$3($0)}},()=>restProps,{get ref(){return ref2()},set ref($$value){ref2($$value)}}))})}append($$anchor,fragment),pop()}const Root$1=Alert_dialog,Portal=Portal$2;var root_5$e=from_html(`Are you sure you want to delete <strong> </strong>? This action cannot be
undone.`,1),root_3$t=from_html("<!> <!>",1),root_6$g=from_html("<!> <!>",1),root_2$B=from_html("<!> <!>",1);function McpServerCardDeleteDialog($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$1,($$anchor2,AlertDialog_Root)=>{AlertDialog_Root($$anchor2,{get onOpenChange(){return $$props.onOpenChange},get open(){return open2()},set open($$value){open2($$value)},children:($$anchor3,$$slotProps)=>{
var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Alert_dialog_content,($$anchor4,AlertDialog_Content)=>{AlertDialog_Content($$anchor4,{children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$B(),node_2=first_child(fragment_2);component(node_2,()=>Alert_dialog_header,($$anchor6,AlertDialog_Header)=>{AlertDialog_Header($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$t(),node_3=first_child(fragment_3);component(node_3,()=>Alert_dialog_title,($$anchor8,AlertDialog_Title)=>{
AlertDialog_Title($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();var text2=text$8("Delete Server");append($$anchor9,text2)},$$slots:{default:!0}})});var node_4=sibling(node_3,2);component(node_4,()=>Alert_dialog_description,($$anchor8,AlertDialog_Description)=>{AlertDialog_Description($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();var fragment_4=root_5$e(),strong2=sibling(first_child(fragment_4)),text_1=child(strong2,!0);reset(strong2),next$1(),template_effect(()=>set_text(text_1,
$$props.displayName)),append($$anchor9,fragment_4)},$$slots:{default:!0}})}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var node_5=sibling(node_2,2);component(node_5,()=>Alert_dialog_footer,($$anchor6,AlertDialog_Footer)=>{AlertDialog_Footer($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_5=root_6$g(),node_6=first_child(fragment_5);component(node_6,()=>Alert_dialog_cancel,($$anchor8,AlertDialog_Cancel)=>{AlertDialog_Cancel($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();
var text_2=text$8("Cancel");append($$anchor9,text_2)},$$slots:{default:!0}})});var node_7=sibling(node_6,2);component(node_7,()=>Alert_dialog_action,($$anchor8,AlertDialog_Action)=>{AlertDialog_Action($$anchor8,{class:"text-destructive-foreground bg-destructive hover:bg-destructive/90",get onclick(){return $$props.onConfirm},children:($$anchor9,$$slotProps4)=>{next$1();var text_3=text$8("Delete");append($$anchor9,text_3)},$$slots:{default:!0}})}),append($$anchor7,fragment_5)},$$slots:{default:!0}})}),
-append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_1$i=from_html('<div class="flex items-center justify-between gap-4"><div class="flex items-center gap-2"><!> <!> <!></div> <!></div> <div class="flex flex-wrap gap-1.5"><!> <!> <!></div> <div class="space-y-1.5"><!> <!></div> <!> <div class="flex justify-end gap-2"><!> <!> <!></div>',1);function McpServerCardSkeleton($$anchor){Card($$anchor,{class:"\
-grid gap-3 p-4",children:($$anchor2,$$slotProps)=>{var fragment_1=root_1$i(),div=first_child(fragment_1),div_1=child(div),node2=child(div_1);Skeleton(node2,{class:"h-5 w-5 rounded"});var node_1=sibling(node2,2);Skeleton(node_1,{class:"h-5 w-28"});var node_2=sibling(node_1,2);Skeleton(node_2,{class:"h-5 w-12 rounded-full"}),reset(div_1);var node_3=sibling(div_1,2);Skeleton(node_3,{class:"h-6 w-11 rounded-full"}),reset(div);var div_2=sibling(div,2),node_4=child(div_2);Skeleton(node_4,{class:"h-5 w\
+append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_1$j=from_html('<div class="flex items-center justify-between gap-4"><div class="flex items-center gap-2"><!> <!> <!></div> <!></div> <div class="flex flex-wrap gap-1.5"><!> <!> <!></div> <div class="space-y-1.5"><!> <!></div> <!> <div class="flex justify-end gap-2"><!> <!> <!></div>',1);function McpServerCardSkeleton($$anchor){Card($$anchor,{class:"\
+grid gap-3 p-4",children:($$anchor2,$$slotProps)=>{var fragment_1=root_1$j(),div=first_child(fragment_1),div_1=child(div),node2=child(div_1);Skeleton(node2,{class:"h-5 w-5 rounded"});var node_1=sibling(node2,2);Skeleton(node_1,{class:"h-5 w-28"});var node_2=sibling(node_1,2);Skeleton(node_2,{class:"h-5 w-12 rounded-full"}),reset(div_1);var node_3=sibling(div_1,2);Skeleton(node_3,{class:"h-6 w-11 rounded-full"}),reset(div);var div_2=sibling(div,2),node_4=child(div_2);Skeleton(node_4,{class:"h-5 w\
-14 rounded-full"});var node_5=sibling(node_4,2);Skeleton(node_5,{class:"h-5 w-12 rounded-full"});var node_6=sibling(node_5,2);Skeleton(node_6,{class:"h-5 w-16 rounded-full"}),reset(div_2);var div_3=sibling(div_2,2),node_7=child(div_3);Skeleton(node_7,{class:"h-4 w-40"});var node_8=sibling(node_7,2);Skeleton(node_8,{class:"h-4 w-52"}),reset(div_3);var node_9=sibling(div_3,2);Skeleton(node_9,{class:"h-3.5 w-36"});var div_4=sibling(node_9,2),node_10=child(div_4);Skeleton(node_10,{class:"h-8 w-8 ro\
-unded"});var node_11=sibling(node_10,2);Skeleton(node_11,{class:"h-8 w-8 rounded"});var node_12=sibling(node_11,2);Skeleton(node_12,{class:"h-8 w-8 rounded"}),reset(div_4),append($$anchor2,fragment_1)},$$slots:{default:!0}})}var root_3$s=from_html("<!> <span>Server instructions</span>",1),root_6$f=from_html('<p class="rounded bg-muted/50 p-2 text-xs text-muted-foreground"> </p>'),root_2$A=from_html("<!> <!>",1);function McpServerInfo($$anchor,$$props){let isExpanded=state$1(!1);var fragment=comment$2(),
-node2=first_child(fragment);{var consequent_1=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Collapsible,($$anchor3,Collapsible_Root)=>{Collapsible_Root($$anchor3,{get class(){return $$props.class},get open(){return get$3(isExpanded)},set open($$value){set$1(isExpanded,$$value,!0)},children:($$anchor4,$$slotProps)=>{var fragment_2=root_2$A(),node_2=first_child(fragment_2);component(node_2,()=>Collapsible_trigger,($$anchor5,Collapsible_Trigger)=>{Collapsible_Trigger(
-$$anchor5,{class:"flex w-full items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:($$anchor6,$$slotProps2)=>{var fragment_3=root_3$s(),node_3=first_child(fragment_3);{var consequent=$$anchor7=>{Chevron_down($$anchor7,{class:"h-3.5 w-3.5"})},alternate=$$anchor7=>{Chevron_right($$anchor7,{class:"h-3.5 w-3.5"})};if_block(node_3,$$render=>{get$3(isExpanded)?$$render(consequent):$$render(alternate,-1)})}next$1(2),append($$anchor6,fragment_3)},$$slots:{default:!0}})});var node_4=sibling(
-node_2,2);component(node_4,()=>Collapsible_content,($$anchor5,Collapsible_Content)=>{Collapsible_Content($$anchor5,{class:"mt-2",children:($$anchor6,$$slotProps2)=>{var p2=root_6$f(),text2=child(p2,!0);reset(p2),template_effect(()=>set_text(text2,$$props.instructions)),append($$anchor6,p2)},$$slots:{default:!0}})}),append($$anchor4,fragment_2)},$$slots:{default:!0}})}),append($$anchor2,fragment_1)};if_block(node2,$$render=>{$$props.instructions&&$$render(consequent_1)})}append($$anchor,fragment)}
-var root_2$z=from_html('<span class="text-xs text-muted-foreground/50">...</span>'),root_1$h=from_html('<span> <span class="text-destructive">*</span></span> <!>',1),root_4$k=from_html('<button type="button"> </button>'),root_3$r=from_html('<div class="absolute top-full right-0 left-0 z-10 mt-1 max-h-32 overflow-y-auto rounded-lg border border-border/50 bg-background shadow-lg"></div>'),root$D=from_html('<div class="relative grid gap-1"><!> <!> <!></div>');function InputWithSuggestions($$anchor,$$props){
-push$1($$props,!0);let value=prop($$props,"value",3,""),suggestions=prop($$props,"suggestions",19,()=>[]),isLoadingSuggestions=prop($$props,"isLoadingSuggestions",3,!1),isAutocompleteActive=prop($$props,"isAutocompleteActive",3,!1),autocompleteIndex=prop($$props,"autocompleteIndex",3,0);var div=root$D(),node2=child(div);Label(node2,{get for(){return`tpl-arg-${$$props.name??""}`},class:"mb-1 text-muted-foreground",children:($$anchor2,$$slotProps)=>{var fragment=root_1$h(),span=first_child(fragment),
-text2=child(span);next$1(),reset(span);var node_1=sibling(span,2);{var consequent=$$anchor3=>{var span_1=root_2$z();append($$anchor3,span_1)};if_block(node_1,$$render=>{isLoadingSuggestions()&&$$render(consequent)})}template_effect(()=>set_text(text2,`${$$props.name??""} `)),append($$anchor2,fragment)},$$slots:{default:!0}});var node_2=sibling(node2,2);Input(node_2,{get id(){return`tpl-arg-${$$props.name??""}`},type:"text",get value(){return value()},oninput:e=>$$props.onInput(e.currentTarget.value),
-get onkeydown(){return $$props.onKeydown},get onblur(){return $$props.onBlur},get onfocus(){return $$props.onFocus},get placeholder(){return`Enter ${$$props.name??""}`},autocomplete:"off"});var node_3=sibling(node_2,2);{var consequent_1=$$anchor2=>{var div_1=root_3$r();each(div_1,22,suggestions,suggestion=>suggestion,($$anchor3,suggestion,i)=>{var button=root_4$k(),text_1=child(button,!0);reset(button),template_effect(()=>{set_class(button,1,`w-full px-3 py-1.5 text-left text-sm hover:bg-accent ${get$3(
-i)===autocompleteIndex()?"bg-accent":""}`),set_text(text_1,suggestion)}),delegated("mousedown",button,()=>$$props.onSelectSuggestion(suggestion)),append($$anchor3,button)}),reset(div_1),transition(3,div_1,()=>fly,()=>({y:-5,duration:100})),append($$anchor2,div_1)};if_block(node_3,$$render=>{isAutocompleteActive()&&suggestions().length>0&&$$render(consequent_1)})}reset(div),append($$anchor,div),pop()}delegate(["mousedown"]);var root_2$y=from_html('<span class="text-muted-foreground">(optional)</s\
-pan>'),root_1$g=from_html('<span class="text-xs font-medium"> <!></span>'),root_4$j=from_html('<div class="flex items-start gap-2"><!> <textarea class="flex-1 resize-none rounded-md border border-input bg-transparent px-3 py-2 text-sm leading-5 placeholder:text-muted-foreground focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none" rows="1"></textarea> <button type="button" class="mt-1.5 shrink-0 cursor-pointer rounded-md p-1 text-muted-foreground hover:bg-destructive/10 hover:\
-text-destructive" aria-label="Remove item"><!></button></div>'),root_3$q=from_html('<div class="space-y-3"></div>'),root_5$d=from_html('<p class="text-xs text-muted-foreground"> </p>'),root$C=from_html('<div><div class="mb-2 flex items-center justify-between"><!> <button type="button" class="inline-flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-foreground"><!> </button></div> <!></div>');function KeyValuePairs($$anchor,$$props){
-push$1($$props,!0);let className=prop($$props,"class",3,""),keyPlaceholder=prop($$props,"keyPlaceholder",3,"Key"),valuePlaceholder=prop($$props,"valuePlaceholder",3,"Value"),addButtonLabel=prop($$props,"addButtonLabel",3,"Add"),emptyMessage=prop($$props,"emptyMessage",3,"No items configured."),sectionLabelOptional=prop($$props,"sectionLabelOptional",3,!0);function addPair(){$$props.onPairsChange([...$$props.pairs,{key:"",value:""}])}function removePair(index2){$$props.onPairsChange($$props.pairs.
-filter((_,i)=>i!==index2))}function updatePairKey(index2,rawKey){const key2=sanitizeKeyValuePairKey(rawKey),newPairs=[...$$props.pairs];newPairs[index2]={...newPairs[index2],key:key2},$$props.onPairsChange(newPairs)}function trimPairKey(index2,key2){const trimmed=key2.trim();if(trimmed===key2)return;const newPairs=[...$$props.pairs];newPairs[index2]={...newPairs[index2],key:trimmed},$$props.onPairsChange(newPairs)}function updatePairValue(index2,rawValue){const value=sanitizeKeyValuePairValue(rawValue),
-newPairs=[...$$props.pairs];newPairs[index2]={...newPairs[index2],value},$$props.onPairsChange(newPairs)}function trimPairValue(index2,value){const trimmed=value.trim();if(trimmed===value)return;const newPairs=[...$$props.pairs];newPairs[index2]={...newPairs[index2],value:trimmed},$$props.onPairsChange(newPairs)}var div=root$C(),div_1=child(div),node2=child(div_1);{var consequent_1=$$anchor2=>{var span=root_1$g(),text2=child(span),node_1=sibling(text2);{var consequent=$$anchor3=>{var span_1=root_2$y();
-append($$anchor3,span_1)};if_block(node_1,$$render=>{sectionLabelOptional()&&$$render(consequent)})}reset(span),template_effect(()=>set_text(text2,`${$$props.sectionLabel??""} `)),append($$anchor2,span)};if_block(node2,$$render=>{$$props.sectionLabel&&$$render(consequent_1)})}var button=sibling(node2,2),node_2=child(button);Plus(node_2,{class:"h-3 w-3"});var text_1=sibling(node_2);reset(button),reset(div_1);var node_3=sibling(div_1,2);{var consequent_2=$$anchor2=>{var div_2=root_3$q();each(div_2,
-21,()=>$$props.pairs,index$2,($$anchor3,pair,index2)=>{var div_3=root_4$j(),node_4=child(div_3);Input(node_4,{type:"text",get placeholder(){return keyPlaceholder()},get value(){return get$3(pair).key},get maxlength(){return KEY_VALUE_PAIR_KEY_MAX_LENGTH},oninput:e=>updatePairKey(index2,e.currentTarget.value),onblur:e=>trimPairKey(index2,e.currentTarget.value),class:"flex-1"});var textarea=sibling(node_4,2);remove_textarea_child(textarea),action(textarea,$$node=>autoResizeTextarea?.($$node));var button_1=sibling(
-textarea,2),node_5=child(button_1);Trash_2(node_5,{class:"h-3.5 w-3.5"}),reset(button_1),reset(div_3),template_effect(()=>{set_attribute(textarea,"placeholder",valuePlaceholder()),set_value(textarea,get$3(pair).value),set_attribute(textarea,"maxlength",KEY_VALUE_PAIR_VALUE_MAX_LENGTH)}),delegated("input",textarea,e=>{updatePairValue(index2,e.currentTarget.value),autoResizeTextarea(e.currentTarget)}),event("blur",textarea,e=>trimPairValue(index2,e.currentTarget.value)),delegated("click",button_1,
-()=>removePair(index2)),append($$anchor3,div_3)}),reset(div_2),append($$anchor2,div_2)},alternate=$$anchor2=>{var p2=root_5$d(),text_2=child(p2,!0);reset(p2),template_effect(()=>set_text(text_2,emptyMessage())),append($$anchor2,p2)};if_block(node_3,$$render=>{$$props.pairs.length>0?$$render(consequent_2):$$render(alternate,-1)})}reset(div),template_effect(()=>{set_class(div,1,clsx(className())),set_text(text_1,` ${addButtonLabel()??""}`)}),delegated("click",button,addPair),append($$anchor,div),pop()}
-delegate(["click","input"]);var root$B=from_html('<div class="flex flex-col gap-2"><div class="mb-2 flex items-center gap-4"><!> <!></div> <h3 class="text-sm font-medium">Available resources</h3></div>');function McpResourcesBrowserHeader($$anchor,$$props){push$1($$props,!0);let searchQuery=prop($$props,"searchQuery",3,"");var div=root$B(),div_1=child(div),node2=child(div_1);SearchInput(node2,{placeholder:"Search resources...",get value(){return searchQuery()},onInput:value=>$$props.onSearch?.(value)});
-var node_1=sibling(node2,2);Button(node_1,{variant:"ghost",size:"sm",class:"h-8 w-8 p-0",get onclick(){return $$props.onRefresh},get disabled(){return $$props.isLoading},title:"Refresh resources",children:($$anchor2,$$slotProps)=>{var fragment=comment$2(),node_2=first_child(fragment);{var consequent=$$anchor3=>{Loader_circle($$anchor3,{class:"h-4 w-4 animate-spin"})},alternate=$$anchor3=>{Refresh_cw($$anchor3,{class:"h-4 w-4"})};if_block(node_2,$$render=>{$$props.isLoading?$$render(consequent):$$render(
-alternate,-1)})}append($$anchor2,fragment)},$$slots:{default:!0}}),reset(div_1),next$1(2),reset(div),append($$anchor,div),pop()}var root$A=from_html('<div class="py-4 text-center text-sm text-muted-foreground"><!></div>');function McpResourcesBrowserEmptyState($$anchor,$$props){var div=root$A(),node2=child(div);{var consequent=$$anchor2=>{var text2=text$8("Loading resources...");append($$anchor2,text2)},alternate=$$anchor2=>{var text_1=text$8("No resources available");append($$anchor2,text_1)};if_block(
-node2,$$render=>{$$props.isLoading?$$render(consequent):$$render(alternate,-1)})}reset(div),append($$anchor,div)}function resourceMatchesSearch(resource,query){return resource.title?.toLowerCase().includes(query)||resource.uri.toLowerCase().includes(query)}function buildResourceTree(resourceList,serverName,searchQuery){const root2={name:"root",children:new Map};if(!searchQuery||!searchQuery.trim()){for(const resource of resourceList){const pathParts=parseResourcePath(resource.uri);let current2=root2;
-for(let i=0;i<pathParts.length-1;i++){const part=pathParts[i];current2.children.has(part)||current2.children.set(part,{name:part,children:new Map}),current2=current2.children.get(part)}const fileName=pathParts[pathParts.length-1]||resource.name;current2.children.set(resource.uri,{name:fileName,resource:{...resource,serverName},children:new Map})}return root2}const query=searchQuery.toLowerCase();for(const resource of resourceList){if(!resourceMatchesSearch(resource,query))continue;const pathParts=parseResourcePath(
-resource.uri);let current2=root2;for(let i=0;i<pathParts.length-1;i++){const part=pathParts[i];current2.children.has(part)||current2.children.set(part,{name:part,children:new Map,isFiltered:!0}),current2=current2.children.get(part)}const fileName=pathParts[pathParts.length-1]||resource.name;current2.children.set(resource.uri,{name:fileName,resource:{...resource,serverName},children:new Map,isFiltered:!0})}function cleanupEmptyFolders(node2){if(node2.resource)return!0;const toDelete=[];for(const[
-name,child2]of node2.children.entries())cleanupEmptyFolders(child2)||toDelete.push(name);for(const name of toDelete)node2.children.delete(name);return node2.children.size>0}return cleanupEmptyFolders(root2),root2}function countTreeResources(node2){if(node2.resource)return 1;let count=0;for(const child2 of node2.children.values())count+=countTreeResources(child2);return count}function sortTreeChildren(children){return children.sort((a,b)=>{const aIsFolder=!a.resource&&a.children.size>0,bIsFolder=!b.
-resource&&b.children.size>0;return aIsFolder&&!bIsFolder?-1:!aIsFolder&&bIsFolder?1:a.name.localeCompare(b.name)})}var root_4$i=from_html('<!> <!> <span class="font-medium"> </span> <span class="text-xs text-muted-foreground"> </span>',1),root_7$d=from_html('<div class="ml-4 flex flex-col gap-0.5 border-l border-border/50 pl-2"></div>'),root_3$p=from_html("<!> <!>",1),root_9$a=from_html('<div class="group flex w-full items-center gap-2"><!> <button><!> <span class="min-w-0 flex-1 truncate text-l\
-eft"> </span></button></div>'),root_15$6=from_html('<img alt="" class="h-4 w-4 shrink-0 rounded-sm"/>'),root_12$5=from_html('<!> <span class="inline-flex flex-col items-start text-left"><span class="inline-flex items-center justify-start gap-1.5 font-medium"><!> </span> <span class="text-xs text-muted-foreground"> <!>)</span></span> <!>',1),root_19$5=from_html('<div class="py-1 text-xs text-red-500"> </div>'),root_20$1=from_html('<div class="py-1 text-xs text-muted-foreground">No resources</div>'),
-root_25$2=from_html('<div class="my-1 border-t border-border/30"></div>'),root_26$1=from_html('<button><!> <span class="min-w-0 flex-1 truncate text-left"> </span></button>'),root_24=from_html('<!> <div class="py-0.5 text-[11px] font-medium tracking-wide text-muted-foreground/70 uppercase">Templates</div> <!>',1),root_21$2=from_html("<!> <!>",1),root_18$3=from_html('<div class="ml-4 flex flex-col gap-0.5 border-l border-border/50 pl-2"><!></div>'),root_11$6=from_html("<!> <!>",1);function McpResourcesBrowserServerItem($$anchor,$$props){
-push$1($$props,!0);const renderTreeNode=($$anchor2,node2=noop$3,depth=noop$3,parentPath=noop$3)=>{const isFolder=user_derived(()=>!node2().resource&&node2().children.size>0),folderId=user_derived(()=>`${$$props.serverName}:${parentPath()}/${node2().name}`),isFolderExpanded=user_derived(()=>$$props.expandedFolders.has(get$3(folderId)));var fragment=comment$2(),node_1=first_child(fragment);{var consequent_1=$$anchor3=>{const folderCount=user_derived(()=>countTreeResources(node2()));var fragment_1=comment$2(),
-node_2=first_child(fragment_1);component(node_2,()=>Collapsible,($$anchor4,Collapsible_Root)=>{Collapsible_Root($$anchor4,{get open(){return get$3(isFolderExpanded)},onOpenChange:()=>$$props.onToggleFolder(get$3(folderId)),children:($$anchor5,$$slotProps)=>{var fragment_2=root_3$p(),node_3=first_child(fragment_2);component(node_3,()=>Collapsible_trigger,($$anchor6,Collapsible_Trigger)=>{Collapsible_Trigger($$anchor6,{class:"flex w-full items-center gap-2 rounded px-2 py-1 text-sm hover:bg-muted/\
-50",children:($$anchor7,$$slotProps2)=>{var fragment_3=root_4$i(),node_4=first_child(fragment_3);{var consequent=$$anchor8=>{Chevron_down($$anchor8,{class:"h-3 w-3"})},alternate=$$anchor8=>{Chevron_right($$anchor8,{class:"h-3 w-3"})};if_block(node_4,$$render=>{get$3(isFolderExpanded)?$$render(consequent):$$render(alternate,-1)})}var node_5=sibling(node_4,2);Folder_open(node_5,{class:"h-3.5 w-3.5 text-muted-foreground"});var span=sibling(node_5,2),text2=child(span,!0);reset(span);var span_1=sibling(
-span,2),text_1=child(span_1);reset(span_1),template_effect(()=>{set_text(text2,node2().name),set_text(text_1,`(${get$3(folderCount)??""})`)}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var node_6=sibling(node_3,2);component(node_6,()=>Collapsible_content,($$anchor6,Collapsible_Content)=>{Collapsible_Content($$anchor6,{children:($$anchor7,$$slotProps2)=>{var div=root_7$d();each(div,21,()=>sortTreeChildren([...node2().children.values()]),child2=>child2.resource?.uri||`${$$props.serverName}\
-:${parentPath()}/${node2().name}/${child2.name}`,($$anchor8,child2)=>{renderTreeNode($$anchor8,()=>get$3(child2),()=>depth()+1,()=>`${parentPath()}/${node2().name}`)}),reset(div),append($$anchor7,div)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},consequent_3=$$anchor3=>{const resource=user_derived(()=>node2().resource),ResourceIcon=user_derived(()=>getResourceIcon(get$3(resource).mimeType,get$3(resource).uri)),isSelected=user_derived(
-()=>isResourceSelected(get$3(resource))),resourceDisplayName=user_derived(()=>get$3(resource).title||getDisplayName(node2().name));var div_1=root_9$a(),node_7=child(div_1);{var consequent_2=$$anchor4=>{Checkbox($$anchor4,{get checked(){return get$3(isSelected)},onCheckedChange:checked=>handleCheckboxChange(get$3(resource),checked===!0),class:"h-4 w-4"})};if_block(node_7,$$render=>{$$props.onToggle&&$$render(consequent_2)})}var button=sibling(node_7,2),node_8=child(button);component(node_8,()=>get$3(
-ResourceIcon),($$anchor4,ResourceIcon_1)=>{ResourceIcon_1($$anchor4,{class:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})});var span_2=sibling(node_8,2),text_2=child(span_2,!0);reset(span_2),reset(button),reset(div_1),template_effect(()=>{set_class(button,1,clsx(["flex flex-1 items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors","hover:bg-muted/50",get$3(isSelected)&&"bg-muted"])),set_attribute(button,"title",get$3(resourceDisplayName)),set_text(text_2,get$3(resourceDisplayName))}),
-delegated("click",button,e=>handleResourceClick(get$3(resource),e)),append($$anchor3,div_1)};if_block(node_1,$$render=>{get$3(isFolder)?$$render(consequent_1):node2().resource&&$$render(consequent_3,1)})}append($$anchor2,fragment)};let searchQuery=prop($$props,"searchQuery",3,"");const hasResources=user_derived(()=>$$props.serverRes.resources.length>0),hasTemplates=user_derived(()=>$$props.serverRes.templates.length>0),hasContent=user_derived(()=>get$3(hasResources)||get$3(hasTemplates)),displayName=user_derived(
-()=>mcpStore.getServerDisplayName($$props.serverName)),favicon=user_derived(()=>mcpStore.getServerFavicon($$props.serverName)),resourceTree=user_derived(()=>buildResourceTree($$props.serverRes.resources,$$props.serverName,searchQuery())),templateInfos=user_derived(()=>$$props.serverRes.templates.map(t=>({uriTemplate:t.uriTemplate,name:t.name,title:t.title,description:t.description,mimeType:t.mimeType,serverName:$$props.serverName,annotations:t.annotations,icons:t.icons})));function handleResourceClick(resource,event2){
-$$props.onSelect?.(resource,event2.shiftKey)}function handleCheckboxChange(resource,checked){$$props.onToggle?.(resource,checked)}function isResourceSelected(resource){return $$props.selectedUris.has(resource.uri)}var fragment_8=comment$2(),node_9=first_child(fragment_8);component(node_9,()=>Collapsible,($$anchor2,Collapsible_Root_1)=>{Collapsible_Root_1($$anchor2,{get open(){return $$props.isExpanded},get onOpenChange(){return $$props.onToggleServer},children:($$anchor3,$$slotProps)=>{var fragment_9=root_11$6(),
-node_10=first_child(fragment_9);component(node_10,()=>Collapsible_trigger,($$anchor4,Collapsible_Trigger_1)=>{Collapsible_Trigger_1($$anchor4,{class:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-muted/50",children:($$anchor5,$$slotProps2)=>{var fragment_10=root_12$5(),node_11=first_child(fragment_10);{var consequent_4=$$anchor6=>{Chevron_down($$anchor6,{class:"h-3.5 w-3.5"})},alternate_1=$$anchor6=>{Chevron_right($$anchor6,{class:"h-3.5 w-3.5"})};if_block(node_11,$$render=>{
-$$props.isExpanded?$$render(consequent_4):$$render(alternate_1,-1)})}var span_3=sibling(node_11,2),span_4=child(span_3),node_12=child(span_4);{var consequent_5=$$anchor6=>{var img=root_15$6();template_effect(()=>set_attribute(img,"src",get$3(favicon))),event("error",img,e=>{e.currentTarget.style.display="none"}),replay_events(img),append($$anchor6,img)};if_block(node_12,$$render=>{get$3(favicon)&&$$render(consequent_5)})}var text_3=sibling(node_12);reset(span_4);var span_5=sibling(span_4,2),text_4=child(
-span_5),node_13=sibling(text_4);{var consequent_6=$$anchor6=>{var text_5=text$8();template_effect(()=>set_text(text_5,`, ${$$props.serverRes.templates.length??""} template${$$props.serverRes.templates.length!==1?"s":""}`)),append($$anchor6,text_5)};if_block(node_13,$$render=>{get$3(hasTemplates)&&$$render(consequent_6)})}next$1(),reset(span_5),reset(span_3);var node_14=sibling(span_3,2);{var consequent_7=$$anchor6=>{Loader_circle($$anchor6,{class:"ml-auto h-3 w-3 animate-spin text-muted-foregrou\
-nd"})};if_block(node_14,$$render=>{$$props.serverRes.loading&&$$render(consequent_7)})}template_effect(()=>{set_text(text_3,` ${get$3(displayName)??""}`),set_text(text_4,`(${$$props.serverRes.resources.length??""} resource${$$props.serverRes.resources.length!==1?"s":""}`)}),append($$anchor5,fragment_10)},$$slots:{default:!0}})});var node_15=sibling(node_10,2);component(node_15,()=>Collapsible_content,($$anchor4,Collapsible_Content_1)=>{Collapsible_Content_1($$anchor4,{children:($$anchor5,$$slotProps2)=>{
-var div_2=root_18$3(),node_16=child(div_2);{var consequent_8=$$anchor6=>{var div_3=root_19$5(),text_6=child(div_3);reset(div_3),template_effect(()=>set_text(text_6,`Error: ${$$props.serverRes.error??""}`)),append($$anchor6,div_3)},consequent_9=$$anchor6=>{var div_4=root_20$1();append($$anchor6,div_4)},alternate_2=$$anchor6=>{var fragment_15=root_21$2(),node_17=first_child(fragment_15);{var consequent_10=$$anchor7=>{var fragment_16=comment$2(),node_18=first_child(fragment_16);each(node_18,17,()=>sortTreeChildren(
-[...get$3(resourceTree).children.values()]),child2=>child2.resource?.uri||`${$$props.serverName}:${child2.name}`,($$anchor8,child2)=>{renderTreeNode($$anchor8,()=>get$3(child2),()=>1,()=>"")}),append($$anchor7,fragment_16)};if_block(node_17,$$render=>{get$3(hasResources)&&$$render(consequent_10)})}var node_19=sibling(node_17,2);{var consequent_12=$$anchor7=>{var fragment_18=root_24(),node_20=first_child(fragment_18);{var consequent_11=$$anchor8=>{var div_5=root_25$2();append($$anchor8,div_5)};if_block(
-node_20,$$render=>{get$3(hasResources)&&$$render(consequent_11)})}var node_21=sibling(node_20,4);each(node_21,17,()=>get$3(templateInfos),template=>template.uriTemplate,($$anchor8,template)=>{var button_1=root_26$1(),node_22=child(button_1);Braces(node_22,{class:"h-3.5 w-3.5 shrink-0 text-muted-foreground"});var span_6=sibling(node_22,2),text_7=child(span_6,!0);reset(span_6),reset(button_1),template_effect(()=>{set_class(button_1,1,clsx(["flex w-full items-center gap-2 rounded px-2 py-1 text-lef\
-t text-sm transition-colors","hover:bg-muted/50",$$props.selectedTemplateUri===get$3(template).uriTemplate&&"bg-muted"])),set_attribute(button_1,"title",get$3(template).uriTemplate),set_text(text_7,get$3(template).title||get$3(template).name)}),delegated("click",button_1,()=>$$props.onTemplateSelect(get$3(template))),append($$anchor8,button_1)}),append($$anchor7,fragment_18)};if_block(node_19,$$render=>{get$3(hasTemplates)&&$$props.onTemplateSelect&&$$render(consequent_12)})}append($$anchor6,fragment_15)};
-if_block(node_16,$$render=>{$$props.serverRes.error?$$render(consequent_8):get$3(hasContent)?$$render(alternate_2,-1):$$render(consequent_9,1)})}reset(div_2),append($$anchor5,div_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_9)},$$slots:{default:!0}})}),append($$anchor,fragment_8),pop()}delegate(["click"]);var root$z=from_html('<div><!> <div class="flex flex-col gap-1"><!></div></div>');function McpResourcesBrowser($$anchor,$$props){push$1($$props,!0);let selectedUris=prop($$props,"sele\
-ctedUris",19,()=>new Set),expandedServers=new SvelteSet,expandedFolders=new SvelteSet,searchQuery=state$1("");const resources=user_derived(mcpResources),isLoading2=user_derived(mcpResourcesLoading),filteredResources=user_derived(()=>{if(!get$3(searchQuery).trim())return get$3(resources);const query=get$3(searchQuery).toLowerCase(),filtered=new SvelteMap;for(const[serverName,serverRes]of get$3(resources).entries()){const filteredResources2=serverRes.resources.filter(r2=>r2.title?.toLowerCase().includes(
-query)||r2.uri.toLowerCase().includes(query)||serverName.toLowerCase().includes(query)),filteredTemplates=serverRes.templates.filter(t=>t.name?.toLowerCase().includes(query)||t.title?.toLowerCase().includes(query)||t.uriTemplate.toLowerCase().includes(query)||serverName.toLowerCase().includes(query));(filteredResources2.length>0||filteredTemplates.length>0||query.trim())&&filtered.set(serverName,{...serverRes,resources:filteredResources2,templates:filteredTemplates})}return filtered});user_effect(
-()=>{$$props.expandToUri&&get$3(resources).size>0&&autoExpandToResource($$props.expandToUri)});function autoExpandToResource(uri2){for(const[serverName,serverRes]of get$3(resources).entries())if(serverRes.resources.find(r2=>r2.uri===uri2)){expandedServers.add(serverName);const pathParts=parseResourcePath(uri2);if(pathParts.length>1){let currentPath="";for(let i=0;i<pathParts.length-1;i++){currentPath=`${currentPath}/${pathParts[i]}`;const folderId=`${serverName}:${currentPath}`;expandedFolders.add(
-folderId)}}break}}function toggleServer(serverName){expandedServers.has(serverName)?expandedServers.delete(serverName):expandedServers.add(serverName)}function toggleFolder(folderId){expandedFolders.has(folderId)?expandedFolders.delete(folderId):expandedFolders.add(folderId)}function handleRefresh(){mcpStore.fetchAllResources()}var div=root$z(),node2=child(div);McpResourcesBrowserHeader(node2,{get isLoading(){return get$3(isLoading2)},onRefresh:handleRefresh,onSearch:q2=>set$1(searchQuery,q2,!0),
-get searchQuery(){return get$3(searchQuery)}});var div_1=sibling(node2,2),node_1=child(div_1);{var consequent=$$anchor2=>{McpResourcesBrowserEmptyState($$anchor2,{get isLoading(){return get$3(isLoading2)}})},alternate=$$anchor2=>{var fragment_1=comment$2(),node_2=first_child(fragment_1);each(node_2,17,()=>[...get$3(filteredResources).entries()],([serverName,serverRes])=>serverName,($$anchor3,$$item)=>{var $$array=user_derived(()=>to_array(get$3($$item),2));let serverName=()=>get$3($$array)[0],serverRes=()=>get$3(
-$$array)[1];{let $0=user_derived(()=>expandedServers.has(serverName()));McpResourcesBrowserServerItem($$anchor3,{get serverName(){return serverName()},get serverRes(){return serverRes()},get isExpanded(){return get$3($0)},get selectedUris(){return selectedUris()},get selectedTemplateUri(){return $$props.selectedTemplateUri},get expandedFolders(){return expandedFolders},onToggleServer:()=>toggleServer(serverName()),onToggleFolder:toggleFolder,get onSelect(){return $$props.onSelect},get onToggle(){
-return $$props.onToggle},get onTemplateSelect(){return $$props.onTemplateSelect},get searchQuery(){return get$3(searchQuery)}})}}),append($$anchor2,fragment_1)};if_block(node_1,$$render=>{get$3(filteredResources).size===0?$$render(consequent):$$render(alternate,-1)})}reset(div_1),reset(div),template_effect(()=>set_class(div,1,clsx(["flex flex-col gap-2",$$props.class]))),append($$anchor,div),pop()}var root_1$f=from_html('<div class="flex flex-col items-center justify-center gap-2 py-8 text-muted\
--foreground"><!> <span class="text-sm">Select a resource to preview</span></div>'),root_3$o=from_html('<p class="mt-1 text-sm text-muted-foreground"> </p>'),root_5$c=from_html('<div class="flex items-center justify-center py-8"><!></div>'),root_6$e=from_html('<div class="flex flex-col items-center justify-center gap-2 py-8 text-red-500"><!> <span class="text-sm"> </span></div>'),root_8$f=from_html('<pre class="font-mono text-xs break-words whitespace-pre-wrap"> </pre>'),root_10$7=from_html('<img\
- alt="Resource content" class="max-w-full rounded"/>'),root_11$5=from_html('<div class="flex items-center gap-2 rounded bg-muted p-2 text-sm text-muted-foreground"><!> <span> </span></div>'),root_12$4=from_html('<div class="py-4 text-center text-sm text-muted-foreground">No content available</div>'),root_7$c=from_html("<!> <!> <!>",1),root_14$3=from_html('<span class="rounded bg-muted px-1.5 py-0.5"> </span>'),root_15$5=from_html('<span class="rounded bg-muted px-1.5 py-0.5"> </span>'),root_13$4=from_html(
-'<div class="flex flex-wrap gap-2 text-xs text-muted-foreground"><!> <!> <span class="rounded bg-muted px-1.5 py-0.5"> </span></div>'),root_2$x=from_html('<div class="flex items-start justify-between gap-2"><div class="min-w-0 flex-1"><h3 class="truncate font-medium"> </h3> <p class="truncate text-xs text-muted-foreground"> </p> <!></div> <div class="flex items-center gap-1"><!> <!></div></div> <div class="min-h-[200px] overflow-auto rounded-md border bg-muted/30 p-3 break-all"><!></div> <!>',1),
-root$y=from_html("<div><!></div>");function McpResourcePreview($$anchor,$$props){push$1($$props,!0);let content2=state$1(null),isLoading2=state$1(!1),error2=state$1(null);user_effect(()=>{$$props.resource?$$props.preloadedContent?(set$1(content2,$$props.preloadedContent,!0),set$1(isLoading2,!1),set$1(error2,null)):loadContent($$props.resource.uri):(set$1(content2,null),set$1(error2,null))});async function loadContent(uri2){set$1(isLoading2,!0),set$1(error2,null);try{const result=await mcpStore.readResource(
-uri2);result?set$1(content2,result,!0):set$1(error2,"Failed to load resource content")}catch(e){set$1(error2,e instanceof Error?e.message:"Unknown error",!0)}finally{set$1(isLoading2,!1)}}function handleDownload(){const text2=getResourceTextContent(get$3(content2));!text2||!$$props.resource||downloadResourceContent(text2,$$props.resource.mimeType||MimeTypeText.PLAIN,$$props.resource.name||"resource.txt")}var div=root$y(),node2=child(div);{var consequent=$$anchor2=>{var div_1=root_1$f(),node_1=child(
-div_1);File_text(node_1,{class:"h-8 w-8 opacity-50"}),next$1(2),reset(div_1),append($$anchor2,div_1)},alternate_1=$$anchor2=>{var fragment=root_2$x(),div_2=first_child(fragment),div_3=child(div_2),h3=child(div_3),text_1=child(h3,!0);reset(h3);var p2=sibling(h3,2),text_2=child(p2,!0);reset(p2);var node_2=sibling(p2,2);{var consequent_1=$$anchor3=>{var p_1=root_3$o(),text_3=child(p_1,!0);reset(p_1),template_effect(()=>set_text(text_3,$$props.resource.description)),append($$anchor3,p_1)};if_block(node_2,
-$$render=>{$$props.resource.description&&$$render(consequent_1)})}reset(div_3);var div_4=sibling(div_3,2),node_3=child(div_4);{let $0=user_derived(()=>getResourceTextContent(get$3(content2))),$1=user_derived(()=>!get$3(isLoading2)&&!!getResourceTextContent(get$3(content2)));ActionIconCopyToClipboard(node_3,{get text(){return get$3($0)},get canCopy(){return get$3($1)},ariaLabel:"Copy content"})}var node_4=sibling(node_3,2);{let $0=user_derived(()=>get$3(isLoading2)||!getResourceTextContent(get$3(
-content2)));Button(node_4,{variant:"ghost",size:"sm",class:"h-7 w-7 p-0",onclick:handleDownload,get disabled(){return get$3($0)},title:"Download content",children:($$anchor3,$$slotProps)=>{Download($$anchor3,{class:"h-3.5 w-3.5"})},$$slots:{default:!0}})}reset(div_4),reset(div_2);var div_5=sibling(div_2,2),node_5=child(div_5);{var consequent_2=$$anchor3=>{var div_6=root_5$c(),node_6=child(div_6);Loader_circle(node_6,{class:"h-6 w-6 animate-spin text-muted-foreground"}),reset(div_6),append($$anchor3,
-div_6)},consequent_3=$$anchor3=>{var div_7=root_6$e(),node_7=child(div_7);Circle_alert(node_7,{class:"h-6 w-6"});var span=sibling(node_7,2),text_4=child(span,!0);reset(span),reset(div_7),template_effect(()=>set_text(text_4,get$3(error2))),append($$anchor3,div_7)},consequent_7=$$anchor3=>{const textContent=user_derived(()=>getResourceTextContent(get$3(content2))),blobContent=user_derived(()=>getResourceBlobContent(get$3(content2)));var fragment_2=root_7$c(),node_8=first_child(fragment_2);{var consequent_4=$$anchor4=>{
-var pre=root_8$f(),text_5=child(pre,!0);reset(pre),template_effect(()=>set_text(text_5,get$3(textContent))),append($$anchor4,pre)};if_block(node_8,$$render=>{get$3(textContent)&&$$render(consequent_4)})}var node_9=sibling(node_8,2);each(node_9,17,()=>get$3(blobContent),blob=>blob.uri,($$anchor4,blob)=>{var fragment_3=comment$2(),node_10=first_child(fragment_3);{var consequent_5=$$anchor5=>{var img=root_10$7();template_effect($0=>set_attribute(img,"src",$0),[()=>createBase64DataUrl(get$3(blob).mimeType??
-MimeTypeApplication.OCTET_STREAM,get$3(blob).blob)]),append($$anchor5,img)},d2=user_derived(()=>isImageMimeType(get$3(blob).mimeType??MimeTypeApplication.OCTET_STREAM)),alternate=$$anchor5=>{var div_8=root_11$5(),node_11=child(div_8);File_text(node_11,{class:"h-4 w-4"});var span_1=sibling(node_11,2),text_6=child(span_1);reset(span_1),reset(div_8),template_effect(()=>set_text(text_6,`Binary content (${(get$3(blob).mimeType||"unknown type")??""})`)),append($$anchor5,div_8)};if_block(node_10,$$render=>{
-get$3(d2)?$$render(consequent_5):$$render(alternate,-1)})}append($$anchor4,fragment_3)});var node_12=sibling(node_9,2);{var consequent_6=$$anchor4=>{var div_9=root_12$4();append($$anchor4,div_9)};if_block(node_12,$$render=>{!get$3(textContent)&&get$3(blobContent).length===0&&$$render(consequent_6)})}append($$anchor3,fragment_2)};if_block(node_5,$$render=>{get$3(isLoading2)?$$render(consequent_2):get$3(error2)?$$render(consequent_3,1):get$3(content2)&&$$render(consequent_7,2)})}reset(div_5);var node_13=sibling(
-div_5,2);{var consequent_10=$$anchor3=>{var div_10=root_13$4(),node_14=child(div_10);{var consequent_8=$$anchor4=>{var span_2=root_14$3(),text_7=child(span_2,!0);reset(span_2),template_effect(()=>set_text(text_7,$$props.resource.mimeType)),append($$anchor4,span_2)};if_block(node_14,$$render=>{$$props.resource.mimeType&&$$render(consequent_8)})}var node_15=sibling(node_14,2);{var consequent_9=$$anchor4=>{var span_3=root_15$5(),text_8=child(span_3);reset(span_3),template_effect(()=>set_text(text_8,
-`Priority: ${$$props.resource.annotations.priority??""}`)),append($$anchor4,span_3)};if_block(node_15,$$render=>{$$props.resource.annotations?.priority!==void 0&&$$render(consequent_9)})}var span_4=sibling(node_15,2),text_9=child(span_4);reset(span_4),reset(div_10),template_effect(()=>set_text(text_9,`Server: ${$$props.resource.serverName??""}`)),append($$anchor3,div_10)};if_block(node_13,$$render=>{($$props.resource.mimeType||$$props.resource.annotations)&&$$render(consequent_10)})}template_effect(
-()=>{set_text(text_1,$$props.resource.title||$$props.resource.name),set_text(text_2,$$props.resource.uri)}),append($$anchor2,fragment)};if_block(node2,$$render=>{$$props.resource?$$render(alternate_1,-1):$$render(consequent)})}reset(div),template_effect(()=>set_class(div,1,clsx(["flex flex-col gap-3",$$props.class]))),append($$anchor,div),pop()}var root_2$w=from_html('<div class="rounded-md bg-muted/50 px-3 py-2"><p class="text-xs text-muted-foreground">Resolved URI:</p> <p class="mt-0.5 font-mo\
-no text-xs break-all"> </p></div>'),root$x=from_html('<form class="space-y-3"><!> <!> <div class="flex justify-end gap-2 pt-1"><!> <!></div></form>');function McpResourceTemplateForm($$anchor,$$props){push$1($$props,!0);const variables=user_derived(()=>extractTemplateVariables($$props.template.uriTemplate));let values=proxy({}),suggestions=proxy({}),loadingSuggestions=proxy({}),activeAutocomplete=state$1(null),autocompleteIndex=state$1(0);const expandedUri=user_derived(()=>expandTemplate($$props.
-template.uriTemplate,values)),isComplete=user_derived(()=>isTemplateComplete($$props.template.uriTemplate,values)),fetchCompletions=debounce(async(argName,value)=>{if(value.length<1){suggestions[argName]=[];return}loadingSuggestions[argName]=!0;try{const result=await mcpStore.getResourceCompletions($$props.template.serverName,$$props.template.uriTemplate,argName,value);if(result&&result.values.length>0){const filteredValues=result.values.filter(v=>v.trim()!=="");filteredValues.length>0?(suggestions[argName]=
-filteredValues,set$1(activeAutocomplete,argName,!0),set$1(autocompleteIndex,0)):suggestions[argName]=[]}else suggestions[argName]=[]}catch(error2){console.error("[McpResourceTemplateForm] Failed to fetch completions:",error2),suggestions[argName]=[]}finally{loadingSuggestions[argName]=!1}},200);function handleArgInput(argName,value){values[argName]=value,fetchCompletions(argName,value)}function selectSuggestion(argName,value){values[argName]=value,suggestions[argName]=[],set$1(activeAutocomplete,
-null)}function handleArgKeydown(event2,argName){const argSuggestions=suggestions[argName]??[];if(event2.key===KeyboardKey.ESCAPE){event2.preventDefault(),event2.stopPropagation(),argSuggestions.length>0&&get$3(activeAutocomplete)===argName?(suggestions[argName]=[],set$1(activeAutocomplete,null)):$$props.onCancel();return}argSuggestions.length===0||get$3(activeAutocomplete)!==argName||(event2.key===KeyboardKey.ARROW_DOWN?(event2.preventDefault(),set$1(autocompleteIndex,Math.min(get$3(autocompleteIndex)+
-1,argSuggestions.length-1),!0)):event2.key===KeyboardKey.ARROW_UP?(event2.preventDefault(),set$1(autocompleteIndex,Math.max(get$3(autocompleteIndex)-1,0),!0)):event2.key===KeyboardKey.ENTER&&argSuggestions[get$3(autocompleteIndex)]&&(event2.preventDefault(),event2.stopPropagation(),selectSuggestion(argName,argSuggestions[get$3(autocompleteIndex)])))}function handleArgBlur(argName){setTimeout(()=>{get$3(activeAutocomplete)===argName&&(suggestions[argName]=[],set$1(activeAutocomplete,null))},150)}
-function handleArgFocus(argName){const value=values[argName]??"";value.length>=MIN_AUTOCOMPLETE_INPUT_LENGTH&&fetchCompletions(argName,value)}function handleSubmit(event2){event2.preventDefault(),get$3(isComplete)&&$$props.onResolve(get$3(expandedUri),$$props.template.serverName)}var form=root$x(),node2=child(form);each(node2,17,()=>get$3(variables),variable=>variable.name,($$anchor2,variable)=>{{let $0=user_derived(()=>values[get$3(variable).name]??""),$1=user_derived(()=>suggestions[get$3(variable).
-name]??[]),$2=user_derived(()=>loadingSuggestions[get$3(variable).name]??!1),$3=user_derived(()=>get$3(activeAutocomplete)===get$3(variable).name),$4=user_derived(()=>get$3(activeAutocomplete)===get$3(variable).name?get$3(autocompleteIndex):0);InputWithSuggestions($$anchor2,{get name(){return get$3(variable).name},get value(){return get$3($0)},get suggestions(){return get$3($1)},get isLoadingSuggestions(){return get$3($2)},get isAutocompleteActive(){return get$3($3)},get autocompleteIndex(){return get$3(
-$4)},onInput:value=>handleArgInput(get$3(variable).name,value),onKeydown:e=>handleArgKeydown(e,get$3(variable).name),onBlur:()=>handleArgBlur(get$3(variable).name),onFocus:()=>handleArgFocus(get$3(variable).name),onSelectSuggestion:value=>selectSuggestion(get$3(variable).name,value)})}});var node_1=sibling(node2,2);{var consequent=$$anchor2=>{var div=root_2$w(),p2=sibling(child(div),2),text2=child(p2,!0);reset(p2),reset(div),template_effect(()=>set_text(text2,get$3(expandedUri))),append($$anchor2,
-div)};if_block(node_1,$$render=>{get$3(isComplete)&&$$render(consequent)})}var div_1=sibling(node_1,2),node_2=child(div_1);Button(node_2,{type:"button",size:"sm",variant:"secondary",get onclick(){return $$props.onCancel},children:($$anchor2,$$slotProps)=>{next$1();var text_1=text$8("Cancel");append($$anchor2,text_1)},$$slots:{default:!0}});var node_3=sibling(node_2,2);{let $0=user_derived(()=>!get$3(isComplete));Button(node_3,{size:"sm",type:"submit",get disabled(){return get$3($0)},children:($$anchor2,$$slotProps)=>{
-next$1();var text_2=text$8("Read Resource");append($$anchor2,text_2)},$$slots:{default:!0}})}reset(div_1),reset(form),event("submit",form,handleSubmit),append($$anchor,form),pop()}var root_5$b=from_html("<!> <!>",1),root_2$v=from_html('<!> <div class="space-y-4 py-4"><!></div> <!>',1);function DialogMcpServerAddNew($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15),newServerUrl=state$1(""),newServerHeaders=state$1(""),newServerUrlError=user_derived(()=>{if(!get$3(newServerUrl).
-trim())return"URL is required";try{return new URL(get$3(newServerUrl)),null}catch{return"Invalid URL format"}});function handleOpenChange(value){value||(set$1(newServerUrl,""),set$1(newServerHeaders,"")),open2(value),$$props.onOpenChange?.(value)}function saveNewServer(){if(get$3(newServerUrlError))return;const newServerId=uuid$1()??`${MCP_SERVER_ID_PREFIX}-${Date.now()}`;mcpStore.addServer({id:newServerId,enabled:!0,url:get$3(newServerUrl).trim(),headers:get$3(newServerHeaders).trim()||void 0}),
-conversationsStore.setMcpServerOverride(newServerId,!0),handleOpenChange(!1)}var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$2,($$anchor2,Dialog_Root)=>{Dialog_Root($$anchor2,{get open(){return open2()},onOpenChange:handleOpenChange,children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Dialog_content,($$anchor4,Dialog_Content)=>{Dialog_Content($$anchor4,{class:"sm:max-w-md",children:($$anchor5,$$slotProps2)=>{
-var fragment_2=root_2$v(),node_2=first_child(fragment_2);component(node_2,()=>Dialog_header,($$anchor6,Dialog_Header)=>{Dialog_Header($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_3=comment$2(),node_3=first_child(fragment_3);component(node_3,()=>Dialog_title,($$anchor8,Dialog_Title)=>{Dialog_Title($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();var text2=text$8("Add New Server");append($$anchor9,text2)},$$slots:{default:!0}})}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});
-var div=sibling(node_2,2),node_4=child(div);{let $0=user_derived(()=>get$3(newServerUrl)?get$3(newServerUrlError):null);McpServerForm(node_4,{get url(){return get$3(newServerUrl)},get headers(){return get$3(newServerHeaders)},onUrlChange:v=>set$1(newServerUrl,v,!0),onHeadersChange:v=>set$1(newServerHeaders,v,!0),get urlError(){return get$3($0)},id:"new-server"})}reset(div);var node_5=sibling(div,2);component(node_5,()=>Dialog_footer,($$anchor6,Dialog_Footer)=>{Dialog_Footer($$anchor6,{children:($$anchor7,$$slotProps3)=>{
-var fragment_4=root_5$b(),node_6=first_child(fragment_4);Button(node_6,{variant:"secondary",size:"sm",onclick:()=>handleOpenChange(!1),children:($$anchor8,$$slotProps4)=>{next$1();var text_1=text$8("Cancel");append($$anchor8,text_1)},$$slots:{default:!0}});var node_7=sibling(node_6,2);{let $0=user_derived(()=>!!get$3(newServerUrlError));Button(node_7,{variant:"default",size:"sm",onclick:saveNewServer,get disabled(){return get$3($0)},"aria-label":"Save",children:($$anchor8,$$slotProps4)=>{next$1();
-var text_2=text$8("Add");append($$anchor8,text_2)},$$slots:{default:!0}})}append($$anchor7,fragment_4)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_4$h=from_html("<!> ",1),root_3$n=from_html("<!> <!>",1),root_8$e=from_html("<!> <!>",1),root_2$u=from_html("<!> <!> <!>",1);function DialogConfirmation($$anchor,$$props){push$1($$props,!0);let confirmText=prop($$props,"c\
-onfirmText",3,"Confirm"),cancelText=prop($$props,"cancelText",3,"Cancel"),variant=prop($$props,"variant",3,"default");function handleKeydown(event2){event2.key===KeyboardKey.ENTER&&(event2.preventDefault(),$$props.onConfirm()),$$props.onKeydown?.(event2)}function handleOpenChange(newOpen){newOpen||$$props.onCancel()}var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$1,($$anchor2,AlertDialog_Root)=>{AlertDialog_Root($$anchor2,{get open(){return $$props.open},onOpenChange:handleOpenChange,
-children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Alert_dialog_content,($$anchor4,AlertDialog_Content)=>{AlertDialog_Content($$anchor4,{onkeydown:handleKeydown,children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$u(),node_2=first_child(fragment_2);component(node_2,()=>Alert_dialog_header,($$anchor6,AlertDialog_Header)=>{AlertDialog_Header($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$n(),node_3=first_child(
-fragment_3);component(node_3,()=>Alert_dialog_title,($$anchor8,AlertDialog_Title)=>{AlertDialog_Title($$anchor8,{class:"flex items-center gap-2",children:($$anchor9,$$slotProps4)=>{var fragment_4=root_4$h(),node_4=first_child(fragment_4);{var consequent=$$anchor10=>{const IconComponent=user_derived(()=>$$props.icon);var fragment_5=comment$2(),node_5=first_child(fragment_5);{let $0=user_derived(()=>variant()==="destructive"?"text-destructive":"");component(node_5,()=>get$3(IconComponent),($$anchor11,IconComponent_1)=>{
-IconComponent_1($$anchor11,{get class(){return`h-5 w-5 ${get$3($0)??""}`}})})}append($$anchor10,fragment_5)};if_block(node_4,$$render=>{$$props.icon&&$$render(consequent)})}var text2=sibling(node_4);template_effect(()=>set_text(text2,` ${$$props.title??""}`)),append($$anchor9,fragment_4)},$$slots:{default:!0}})});var node_6=sibling(node_3,2);component(node_6,()=>Alert_dialog_description,($$anchor8,AlertDialog_Description)=>{AlertDialog_Description($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();
-var text_1=text$8();template_effect(()=>set_text(text_1,$$props.description)),append($$anchor9,text_1)},$$slots:{default:!0}})}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var node_7=sibling(node_2,2);{var consequent_1=$$anchor6=>{var fragment_7=comment$2(),node_8=first_child(fragment_7);snippet(node_8,()=>$$props.children),append($$anchor6,fragment_7)};if_block(node_7,$$render=>{$$props.children&&$$render(consequent_1)})}var node_9=sibling(node_7,2);component(node_9,()=>Alert_dialog_footer,
-($$anchor6,AlertDialog_Footer)=>{AlertDialog_Footer($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_8=root_8$e(),node_10=first_child(fragment_8);component(node_10,()=>Alert_dialog_cancel,($$anchor8,AlertDialog_Cancel)=>{AlertDialog_Cancel($$anchor8,{get onclick(){return $$props.onCancel},children:($$anchor9,$$slotProps4)=>{next$1();var text_2=text$8();template_effect(()=>set_text(text_2,cancelText())),append($$anchor9,text_2)},$$slots:{default:!0}})});var node_11=sibling(node_10,2);{
-let $0=user_derived(()=>variant()==="destructive"?"bg-destructive text-white hover:bg-destructive/80":"");component(node_11,()=>Alert_dialog_action,($$anchor8,AlertDialog_Action)=>{AlertDialog_Action($$anchor8,{get onclick(){return $$props.onConfirm},get class(){return get$3($0)},children:($$anchor9,$$slotProps4)=>{next$1();var text_3=text$8();template_effect(()=>set_text(text_3,confirmText())),append($$anchor9,text_3)},$$slots:{default:!0}})})}append($$anchor7,fragment_8)},$$slots:{default:!0}})}),
-append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_3$m=from_html("<!> <!>",1),root_6$d=from_html("<!> <!>",1),root_2$t=from_html('<!> <div class="space-y-4 pt-2 pb-6"><div class="space-y-2"><p class="text-sm font-medium text-muted-foreground">Current title:</p> <p class="rounded-md bg-muted/50 p-3 text-sm font-medium"> </p></div> <div class="space-y-2"><p class="text-sm font-medium text-muted-fore\
-ground">New title would be:</p> <p class="rounded-md bg-muted/50 p-3 text-sm font-medium"> </p></div></div> <!>',1);function DialogConversationTitleUpdate($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$1,($$anchor2,AlertDialog_Root)=>{AlertDialog_Root($$anchor2,{get open(){return open2()},set open($$value){open2($$value)},children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(
-fragment_1);component(node_1,()=>Alert_dialog_content,($$anchor4,AlertDialog_Content)=>{AlertDialog_Content($$anchor4,{children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$t(),node_2=first_child(fragment_2);component(node_2,()=>Alert_dialog_header,($$anchor6,AlertDialog_Header)=>{AlertDialog_Header($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$m(),node_3=first_child(fragment_3);component(node_3,()=>Alert_dialog_title,($$anchor8,AlertDialog_Title)=>{AlertDialog_Title($$anchor8,
-{children:($$anchor9,$$slotProps4)=>{next$1();var text2=text$8("Update Conversation Title?");append($$anchor9,text2)},$$slots:{default:!0}})});var node_4=sibling(node_3,2);component(node_4,()=>Alert_dialog_description,($$anchor8,AlertDialog_Description)=>{AlertDialog_Description($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();var text_1=text$8("Do you want to update the conversation title to match the first message content?");append($$anchor9,text_1)},$$slots:{default:!0}})}),append($$anchor7,
-fragment_3)},$$slots:{default:!0}})});var div=sibling(node_2,2),div_1=child(div),p2=sibling(child(div_1),2),text_2=child(p2,!0);reset(p2),reset(div_1);var div_2=sibling(div_1,2),p_1=sibling(child(div_2),2),text_3=child(p_1,!0);reset(p_1),reset(div_2),reset(div);var node_5=sibling(div,2);component(node_5,()=>Alert_dialog_footer,($$anchor6,AlertDialog_Footer)=>{AlertDialog_Footer($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_4=root_6$d(),node_6=first_child(fragment_4);Button(node_6,{
-variant:"outline",get onclick(){return $$props.onCancel},children:($$anchor8,$$slotProps4)=>{next$1();var text_4=text$8("Keep Current Title");append($$anchor8,text_4)},$$slots:{default:!0}});var node_7=sibling(node_6,2);Button(node_7,{get onclick(){return $$props.onConfirm},children:($$anchor8,$$slotProps4)=>{next$1();var text_5=text$8("Update Title");append($$anchor8,text_5)},$$slots:{default:!0}}),append($$anchor7,fragment_4)},$$slots:{default:!0}})}),template_effect(()=>{set_text(text_2,$$props.
-currentTitle),set_text(text_3,$$props.newTitle)}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_4$g=from_html('<!> <span class="sr-only">Close preview</span>',1),root_3$l=from_html('<iframe sandbox="allow-scripts" class="code-preview-iframe"></iframe> <!>',1),root_2$s=from_html("<!> <!>",1);function DialogCodePreview($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15),iframeRef=state$1(
-null);user_effect(()=>{get$3(iframeRef)&&(open2()?get$3(iframeRef).srcdoc=$$props.code:get$3(iframeRef).srcdoc="")});function handleOpenChange(nextOpen){open2(nextOpen),$$props.onOpenChange?.(nextOpen)}var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Dialog,($$anchor2,DialogPrimitive_Root)=>{DialogPrimitive_Root($$anchor2,{get open(){return open2()},onOpenChange:handleOpenChange,children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(
-node_1,()=>Portal$2,($$anchor4,DialogPrimitive_Portal)=>{DialogPrimitive_Portal($$anchor4,{children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$s(),node_2=first_child(fragment_2);component(node_2,()=>Dialog_overlay$1,($$anchor6,DialogPrimitive_Overlay)=>{DialogPrimitive_Overlay($$anchor6,{class:"code-preview-overlay"})});var node_3=sibling(node_2,2);component(node_3,()=>Dialog_content$1,($$anchor6,DialogPrimitive_Content)=>{DialogPrimitive_Content($$anchor6,{class:"code-preview-content",children:($$anchor7,$$slotProps3)=>{
-var fragment_3=root_3$l(),iframe=first_child(fragment_3);bind_this(iframe,$$value=>set$1(iframeRef,$$value),()=>get$3(iframeRef));var node_4=sibling(iframe,2);component(node_4,()=>Dialog_close,($$anchor8,DialogPrimitive_Close)=>{DialogPrimitive_Close($$anchor8,{class:"code-preview-close absolute top-4 right-4 border-none bg-transparent text-white opacity-70 mix-blend-difference transition-opacity hover:opacity-100 focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:outline-none disabl\
-ed:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-8","aria-label":"Close preview",children:($$anchor9,$$slotProps4)=>{var fragment_4=root_4$g(),node_5=first_child(fragment_4);X(node_5,{}),next$1(2),append($$anchor9,fragment_4)},$$slots:{default:!0}})}),template_effect(()=>set_attribute(iframe,"title",`Preview ${$$props.language??""}`)),append($$anchor7,fragment_3)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),
-append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_3$k=from_html("<!> <!>",1),root_2$r=from_html("<!> <!>",1);function DialogChatAttachmentsPreview($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15,!1),uploadedFiles=prop($$props,"uploadedFiles",19,()=>[]),attachments=prop($$props,"attachments",19,()=>[]),previewFocusIndex=prop($$props,"previewFocusIndex",3,0);function handleClose(){open2(!1)}user_effect(()=>{if(!open2())return;function handleKeyDown(event2){
-const target2=event2.target;if(!(target2.tagName==="INPUT"||target2.tagName==="TEXTAREA"))switch(event2.key){case KeyboardKey.ARROW_LEFT:event2.preventDefault(),event2.stopPropagation(),document.dispatchEvent(new CustomEvent("chat-attachments-nav",{detail:-1}));break;case KeyboardKey.ARROW_RIGHT:event2.preventDefault(),event2.stopPropagation(),document.dispatchEvent(new CustomEvent("chat-attachments-nav",{detail:1}));break;case KeyboardKey.SPACE:event2.preventDefault(),event2.stopPropagation(),document.
-dispatchEvent(new CustomEvent("chat-attachments-nav",{detail:1}));break}}return document.addEventListener("keydown",handleKeyDown),()=>document.removeEventListener("keydown",handleKeyDown)});var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Dialog,($$anchor2,Dialog_Root)=>{Dialog_Root($$anchor2,{get open(){return open2()},set open($$value){open2($$value)},children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Portal$2,
-($$anchor4,Dialog_Portal)=>{Dialog_Portal($$anchor4,{children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$r(),node_2=first_child(fragment_2);component(node_2,()=>Dialog_overlay,($$anchor6,DialogUI_Overlay)=>{DialogUI_Overlay($$anchor6,{class:"bg-black/85",style:"z-index: 1000"})});var node_3=sibling(node_2,2);component(node_3,()=>Dialog_content$1,($$anchor6,Dialog_Content)=>{Dialog_Content($$anchor6,{class:"fixed inset-0 z-[1000] flex flex-col bg-transparent outline-none",children:($$anchor7,$$slotProps3)=>{
-var fragment_3=root_3$k(),node_4=first_child(fragment_3);component(node_4,()=>Dialog_close,($$anchor8,Dialog_Close)=>{Dialog_Close($$anchor8,{class:"absolute top-4 right-4 z-10 cursor-pointer text-white hover:text-gray-400",onclick:handleClose,"aria-label":"Close",children:($$anchor9,$$slotProps4)=>{X($$anchor9,{class:"size-4"})},$$slots:{default:!0}})});var node_5=sibling(node_4,2);ChatAttachmentsPreview(node_5,{get uploadedFiles(){return uploadedFiles()},get attachments(){return attachments()},
-get activeModelId(){return $$props.activeModelId},get previewFocusIndex(){return previewFocusIndex()},class:"min-h-0 flex-1"}),append($$anchor7,fragment_3)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_4$f=from_html("<!> ",1),root_3$j=from_html("<!> <!>",1),root_9$9=from_html('<p><span class="font-medium">Context size:</span> </p>'),root_8$d=from_html('<div class="mt\
--2 space-y-1 text-xs opacity-80"><p><span class="font-medium">Prompt tokens:</span> </p> <!></div>'),root_2$q=from_html('<!> <div><p class="font-medium"> </p> <!></div> <!>',1);function DialogChatError($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15);const isTimeout=user_derived(()=>$$props.type===ErrorDialogType.TIMEOUT),title2=user_derived(()=>get$3(isTimeout)?"TCP Timeout":"Server Error"),description2=user_derived(()=>get$3(isTimeout)?"The request did not receive a respo\
-nse from the server before timing out.":"The server responded with an error message. Review the details below."),iconClass=user_derived(()=>get$3(isTimeout)?"text-destructive":"text-amber-500"),badgeClass=user_derived(()=>get$3(isTimeout)?"border-destructive/40 bg-destructive/10 text-destructive":"border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-400");function handleOpenChange(newOpen){open2(newOpen),$$props.onOpenChange?.(newOpen)}var fragment=comment$2(),node2=first_child(fragment);
-component(node2,()=>Root$1,($$anchor2,AlertDialog_Root)=>{AlertDialog_Root($$anchor2,{get open(){return open2()},onOpenChange:handleOpenChange,children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Alert_dialog_content,($$anchor4,AlertDialog_Content)=>{AlertDialog_Content($$anchor4,{children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$q(),node_2=first_child(fragment_2);component(node_2,()=>Alert_dialog_header,($$anchor6,AlertDialog_Header)=>{
-AlertDialog_Header($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$j(),node_3=first_child(fragment_3);component(node_3,()=>Alert_dialog_title,($$anchor8,AlertDialog_Title)=>{AlertDialog_Title($$anchor8,{class:"flex items-center gap-2",children:($$anchor9,$$slotProps4)=>{var fragment_4=root_4$f(),node_4=first_child(fragment_4);{var consequent=$$anchor10=>{{let $0=user_derived(()=>`h-5 w-5 ${get$3(iconClass)}`);Timer_off($$anchor10,{get class(){return get$3($0)}})}},alternate=$$anchor10=>{
-{let $0=user_derived(()=>`h-5 w-5 ${get$3(iconClass)}`);Triangle_alert($$anchor10,{get class(){return get$3($0)}})}};if_block(node_4,$$render=>{get$3(isTimeout)?$$render(consequent):$$render(alternate,-1)})}var text2=sibling(node_4);template_effect(()=>set_text(text2,` ${get$3(title2)??""}`)),append($$anchor9,fragment_4)},$$slots:{default:!0}})});var node_5=sibling(node_3,2);component(node_5,()=>Alert_dialog_description,($$anchor8,AlertDialog_Description)=>{AlertDialog_Description($$anchor8,{children:($$anchor9,$$slotProps4)=>{
-next$1();var text_1=text$8();template_effect(()=>set_text(text_1,get$3(description2))),append($$anchor9,text_1)},$$slots:{default:!0}})}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var div=sibling(node_2,2),p2=child(div),text_2=child(p2,!0);reset(p2);var node_6=sibling(p2,2);{var consequent_2=$$anchor6=>{var div_1=root_8$d(),p_1=child(div_1),text_3=sibling(child(p_1));reset(p_1);var node_7=sibling(p_1,2);{var consequent_1=$$anchor7=>{var p_2=root_9$9(),text_4=sibling(child(p_2));reset(
-p_2),template_effect($0=>set_text(text_4,` ${$0??""}`),[()=>$$props.contextInfo.n_ctx.toLocaleString()]),append($$anchor7,p_2)};if_block(node_7,$$render=>{$$props.contextInfo.n_ctx&&$$render(consequent_1)})}reset(div_1),template_effect($0=>set_text(text_3,` ${$0??""}`),[()=>$$props.contextInfo.n_prompt_tokens.toLocaleString()]),append($$anchor6,div_1)};if_block(node_6,$$render=>{$$props.contextInfo&&$$render(consequent_2)})}reset(div);var node_8=sibling(div,2);component(node_8,()=>Alert_dialog_footer,
-($$anchor6,AlertDialog_Footer)=>{AlertDialog_Footer($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_8=comment$2(),node_9=first_child(fragment_8);component(node_9,()=>Alert_dialog_action,($$anchor8,AlertDialog_Action)=>{AlertDialog_Action($$anchor8,{onclick:()=>handleOpenChange(!1),children:($$anchor9,$$slotProps4)=>{next$1();var text_5=text$8("Close");append($$anchor9,text_5)},$$slots:{default:!0}})}),append($$anchor7,fragment_8)},$$slots:{default:!0}})}),template_effect(()=>{set_class(
-div,1,`rounded-lg border px-4 py-3 text-sm ${get$3(badgeClass)}`),set_text(text_2,$$props.message)}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_4$e=from_html("<!> Empty Files Detected",1),root_3$i=from_html("<!> <!>",1),root_6$c=from_html('<li class="font-mono text-sm"> </li>'),root_2$p=from_html('<!> <div class="space-y-3 text-sm"><div class="rounded-lg bg-muted p-3"><div class="mb-2 font\
--medium">Empty Files:</div> <ul class="list-inside list-disc space-y-1 text-muted-foreground"></ul></div> <div><div class="mb-2 font-medium">What happened:</div> <ul class="list-inside list-disc space-y-1 text-muted-foreground"><li>Empty files cannot be processed or sent to the AI model</li> <li>These files have been automatically removed from your attachments</li> <li>You can try uploading files with content instead</li></ul></div></div> <!>',1);function DialogEmptyFileAlert($$anchor,$$props){push$1(
-$$props,!0);let open2=prop($$props,"open",15);function handleOpenChange(newOpen){open2(newOpen),$$props.onOpenChange?.(newOpen)}var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$1,($$anchor2,AlertDialog_Root)=>{AlertDialog_Root($$anchor2,{get open(){return open2()},onOpenChange:handleOpenChange,children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Alert_dialog_content,($$anchor4,AlertDialog_Content)=>{AlertDialog_Content(
-$$anchor4,{children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$p(),node_2=first_child(fragment_2);component(node_2,()=>Alert_dialog_header,($$anchor6,AlertDialog_Header)=>{AlertDialog_Header($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$i(),node_3=first_child(fragment_3);component(node_3,()=>Alert_dialog_title,($$anchor8,AlertDialog_Title)=>{AlertDialog_Title($$anchor8,{class:"flex items-center gap-2",children:($$anchor9,$$slotProps4)=>{var fragment_4=root_4$e(),node_4=first_child(
-fragment_4);File_x(node_4,{class:"h-5 w-5 text-destructive"}),next$1(),append($$anchor9,fragment_4)},$$slots:{default:!0}})});var node_5=sibling(node_3,2);component(node_5,()=>Alert_dialog_description,($$anchor8,AlertDialog_Description)=>{AlertDialog_Description($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();var text2=text$8("The following files are empty and have been removed from your attachments:");append($$anchor9,text2)},$$slots:{default:!0}})}),append($$anchor7,fragment_3)},$$slots:{
-default:!0}})});var div=sibling(node_2,2),div_1=child(div),ul=sibling(child(div_1),2);each(ul,20,()=>$$props.emptyFiles,fileName=>fileName,($$anchor6,fileName)=>{var li2=root_6$c(),text_1=child(li2,!0);reset(li2),template_effect(()=>set_text(text_1,fileName)),append($$anchor6,li2)}),reset(ul),reset(div_1),next$1(2),reset(div);var node_6=sibling(div,2);component(node_6,()=>Alert_dialog_footer,($$anchor6,AlertDialog_Footer)=>{AlertDialog_Footer($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_5=comment$2(),
-node_7=first_child(fragment_5);component(node_7,()=>Alert_dialog_action,($$anchor8,AlertDialog_Action)=>{AlertDialog_Action($$anchor8,{onclick:()=>handleOpenChange(!1),children:($$anchor9,$$slotProps4)=>{next$1();var text_2=text$8("Got it");append($$anchor9,text_2)},$$slots:{default:!0}})}),append($$anchor7,fragment_5)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_4$d=from_html(
-"<!> <!>",1),root_8$c=from_html('<div class="rounded-md bg-destructive/10 px-3 py-2"><p class="font-mono text-sm break-all text-destructive"> </p> <p class="mt-1 text-xs text-muted-foreground">File type not supported</p></div>'),root_7$b=from_html('<div class="space-y-2"><h4 class="text-sm font-medium text-destructive">Unsupported File Types</h4> <div class="space-y-1"></div></div>'),root_10$6=from_html('<div class="rounded-md bg-destructive/10 px-3 py-2"><p class="font-mono text-sm break-all te\
-xt-destructive"> </p> <p class="mt-1 text-xs text-muted-foreground"> </p></div>'),root_9$8=from_html('<div class="space-y-2"><div class="space-y-1"></div></div>'),root_3$h=from_html('<!> <div class="!max-h-[50vh] min-h-0 flex-1 space-y-4 overflow-y-auto"><!> <!></div> <div class="rounded-md bg-muted/50 p-3"><h4 class="mb-2 text-sm font-medium">This model supports:</h4> <p class="text-sm text-muted-foreground"> </p></div> <!>',1),root_2$o=from_html("<!> <!>",1);function DialogFileUploadError($$anchor,$$props){
+unded"});var node_11=sibling(node_10,2);Skeleton(node_11,{class:"h-8 w-8 rounded"});var node_12=sibling(node_11,2);Skeleton(node_12,{class:"h-8 w-8 rounded"}),reset(div_4),append($$anchor2,fragment_1)},$$slots:{default:!0}})}var root_1$i=from_html('<img alt=""/>'),root_4$l=from_html('<a target="_blank" rel="noopener noreferrer" class="shrink-0 text-muted-foreground hover:text-foreground" aria-label="Open website"><!></a>'),root$E=from_html('<span class="flex min-w-0 items-center gap-1.5"><!> <!>\
+ <!> <!></span>');function McpServerIdentity($$anchor,$$props){push$1($$props,!0);let faviconUrl=prop($$props,"faviconUrl",3,null),iconClass=prop($$props,"iconClass",3,"h-5 w-5"),iconRounded=prop($$props,"iconRounded",3,"rounded-sm"),showVersion=prop($$props,"showVersion",3,!0),showWebsite=prop($$props,"showWebsite",3,!0),safeWebsiteUrl=user_derived(()=>$$props.serverInfo?.websiteUrl?sanitizeExternalUrl($$props.serverInfo.websiteUrl):null);var span=root$E(),node2=child(span);{var consequent=$$anchor2=>{
+var img=root_1$i();template_effect(()=>{set_attribute(img,"src",faviconUrl()),set_class(img,1,clsx(["shrink-0",iconRounded(),iconClass()]))}),event("error",img,e=>{e.currentTarget.style.display="none"}),replay_events(img),append($$anchor2,img)};if_block(node2,$$render=>{faviconUrl()&&$$render(consequent)})}var node_1=sibling(node2,2);{let $0=user_derived(()=>$$props.displayName??""),$1=user_derived(()=>$$props.nameClass??"");TruncatedText(node_1,{get text(){return get$3($0)},get class(){return get$3(
+$1)}})}var node_2=sibling(node_1,2);{var consequent_1=$$anchor2=>{Badge($$anchor2,{variant:"secondary",class:"h-4 min-w-0 shrink px-1 text-[10px]",children:($$anchor3,$$slotProps)=>{{let $0=user_derived(()=>`v${$$props.serverInfo.version}`);TruncatedText($$anchor3,{get text(){return get$3($0)}})}},$$slots:{default:!0}})};if_block(node_2,$$render=>{showVersion()&&$$props.serverInfo?.version&&$$render(consequent_1)})}var node_3=sibling(node_2,2);{var consequent_2=$$anchor2=>{var a=root_4$l(),node_4=child(
+a);External_link(node_4,{class:"h-3 w-3"}),reset(a),template_effect(()=>set_attribute(a,"href",get$3(safeWebsiteUrl))),delegated("click",a,e=>e.stopPropagation()),append($$anchor2,a)};if_block(node_3,$$render=>{showWebsite()&&get$3(safeWebsiteUrl)&&$$render(consequent_2)})}reset(span),append($$anchor,span),pop()}delegate(["click"]);var root_3$s=from_html("<!> <span>Server instructions</span>",1),root_6$f=from_html('<p class="rounded bg-muted/50 p-2 text-xs text-muted-foreground"> </p>'),root_2$A=from_html(
+"<!> <!>",1);function McpServerInfo($$anchor,$$props){let isExpanded=state$1(!1);var fragment=comment$2(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Collapsible,($$anchor3,Collapsible_Root)=>{Collapsible_Root($$anchor3,{get class(){return $$props.class},get open(){return get$3(isExpanded)},set open($$value){set$1(isExpanded,$$value,!0)},children:($$anchor4,$$slotProps)=>{var fragment_2=root_2$A(),node_2=first_child(
+fragment_2);component(node_2,()=>Collapsible_trigger,($$anchor5,Collapsible_Trigger)=>{Collapsible_Trigger($$anchor5,{class:"flex w-full items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:($$anchor6,$$slotProps2)=>{var fragment_3=root_3$s(),node_3=first_child(fragment_3);{var consequent=$$anchor7=>{Chevron_down($$anchor7,{class:"h-3.5 w-3.5"})},alternate=$$anchor7=>{Chevron_right($$anchor7,{class:"h-3.5 w-3.5"})};if_block(node_3,$$render=>{get$3(isExpanded)?$$render(
+consequent):$$render(alternate,-1)})}next$1(2),append($$anchor6,fragment_3)},$$slots:{default:!0}})});var node_4=sibling(node_2,2);component(node_4,()=>Collapsible_content,($$anchor5,Collapsible_Content)=>{Collapsible_Content($$anchor5,{class:"mt-2",children:($$anchor6,$$slotProps2)=>{var p2=root_6$f(),text2=child(p2,!0);reset(p2),template_effect(()=>set_text(text2,$$props.instructions)),append($$anchor6,p2)},$$slots:{default:!0}})}),append($$anchor4,fragment_2)},$$slots:{default:!0}})}),append(
+$$anchor2,fragment_1)};if_block(node2,$$render=>{$$props.instructions&&$$render(consequent_1)})}append($$anchor,fragment)}var root_2$z=from_html('<span class="text-xs text-muted-foreground/50">...</span>'),root_1$h=from_html('<span> <span class="text-destructive">*</span></span> <!>',1),root_4$k=from_html('<button type="button"> </button>'),root_3$r=from_html('<div class="absolute top-full right-0 left-0 z-10 mt-1 max-h-32 overflow-y-auto rounded-lg border border-border/50 bg-background shadow-l\
+g"></div>'),root$D=from_html('<div class="relative grid gap-1"><!> <!> <!></div>');function InputWithSuggestions($$anchor,$$props){push$1($$props,!0);let value=prop($$props,"value",3,""),suggestions=prop($$props,"suggestions",19,()=>[]),isLoadingSuggestions=prop($$props,"isLoadingSuggestions",3,!1),isAutocompleteActive=prop($$props,"isAutocompleteActive",3,!1),autocompleteIndex=prop($$props,"autocompleteIndex",3,0);var div=root$D(),node2=child(div);Label(node2,{get for(){return`tpl-arg-${$$props.
+name??""}`},class:"mb-1 text-muted-foreground",children:($$anchor2,$$slotProps)=>{var fragment=root_1$h(),span=first_child(fragment),text2=child(span);next$1(),reset(span);var node_1=sibling(span,2);{var consequent=$$anchor3=>{var span_1=root_2$z();append($$anchor3,span_1)};if_block(node_1,$$render=>{isLoadingSuggestions()&&$$render(consequent)})}template_effect(()=>set_text(text2,`${$$props.name??""} `)),append($$anchor2,fragment)},$$slots:{default:!0}});var node_2=sibling(node2,2);Input(node_2,
+{get id(){return`tpl-arg-${$$props.name??""}`},type:"text",get value(){return value()},oninput:e=>$$props.onInput(e.currentTarget.value),get onkeydown(){return $$props.onKeydown},get onblur(){return $$props.onBlur},get onfocus(){return $$props.onFocus},get placeholder(){return`Enter ${$$props.name??""}`},autocomplete:"off"});var node_3=sibling(node_2,2);{var consequent_1=$$anchor2=>{var div_1=root_3$r();each(div_1,22,suggestions,suggestion=>suggestion,($$anchor3,suggestion,i)=>{var button=root_4$k(),
+text_1=child(button,!0);reset(button),template_effect(()=>{set_class(button,1,`w-full px-3 py-1.5 text-left text-sm hover:bg-accent ${get$3(i)===autocompleteIndex()?"bg-accent":""}`),set_text(text_1,suggestion)}),delegated("mousedown",button,()=>$$props.onSelectSuggestion(suggestion)),append($$anchor3,button)}),reset(div_1),transition(3,div_1,()=>fly,()=>({y:-5,duration:100})),append($$anchor2,div_1)};if_block(node_3,$$render=>{isAutocompleteActive()&&suggestions().length>0&&$$render(consequent_1)})}
+reset(div),append($$anchor,div),pop()}delegate(["mousedown"]);var root_2$y=from_html('<span class="text-muted-foreground">(optional)</span>'),root_1$g=from_html('<span class="text-xs font-medium"> <!></span>'),root_4$j=from_html('<div class="flex items-start gap-2"><!> <textarea class="flex-1 resize-none rounded-md border border-input bg-transparent px-3 py-2 text-sm leading-5 placeholder:text-muted-foreground focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none" rows="1"></te\
+xtarea> <button type="button" class="mt-1.5 shrink-0 cursor-pointer rounded-md p-1 text-muted-foreground hover:bg-destructive/10 hover:text-destructive" aria-label="Remove item"><!></button></div>'),root_3$q=from_html('<div class="space-y-3"></div>'),root_5$d=from_html('<p class="text-xs text-muted-foreground"> </p>'),root$C=from_html('<div><div class="mb-2 flex items-center justify-between"><!> <button type="button" class="inline-flex cursor-pointer items-center gap-1 rounded-md px-1.5 py-1 tex\
+t-xs text-muted-foreground hover:bg-muted hover:text-foreground"><!> </button></div> <!></div>');function KeyValuePairs($$anchor,$$props){push$1($$props,!0);let className=prop($$props,"class",3,""),keyPlaceholder=prop($$props,"keyPlaceholder",3,"Key"),valuePlaceholder=prop($$props,"valuePlaceholder",3,"Value"),addButtonLabel=prop($$props,"addButtonLabel",3,"Add"),emptyMessage=prop($$props,"emptyMessage",3,"No items configured."),sectionLabelOptional=prop($$props,"sectionLabelOptional",3,!0);function addPair(){
+$$props.onPairsChange([...$$props.pairs,{key:"",value:""}])}function removePair(index2){$$props.onPairsChange($$props.pairs.filter((_,i)=>i!==index2))}function updatePairKey(index2,rawKey){const key2=sanitizeKeyValuePairKey(rawKey),newPairs=[...$$props.pairs];newPairs[index2]={...newPairs[index2],key:key2},$$props.onPairsChange(newPairs)}function trimPairKey(index2,key2){const trimmed=key2.trim();if(trimmed===key2)return;const newPairs=[...$$props.pairs];newPairs[index2]={...newPairs[index2],key:trimmed},
+$$props.onPairsChange(newPairs)}function updatePairValue(index2,rawValue){const value=sanitizeKeyValuePairValue(rawValue),newPairs=[...$$props.pairs];newPairs[index2]={...newPairs[index2],value},$$props.onPairsChange(newPairs)}function trimPairValue(index2,value){const trimmed=value.trim();if(trimmed===value)return;const newPairs=[...$$props.pairs];newPairs[index2]={...newPairs[index2],value:trimmed},$$props.onPairsChange(newPairs)}var div=root$C(),div_1=child(div),node2=child(div_1);{var consequent_1=$$anchor2=>{
+var span=root_1$g(),text2=child(span),node_1=sibling(text2);{var consequent=$$anchor3=>{var span_1=root_2$y();append($$anchor3,span_1)};if_block(node_1,$$render=>{sectionLabelOptional()&&$$render(consequent)})}reset(span),template_effect(()=>set_text(text2,`${$$props.sectionLabel??""} `)),append($$anchor2,span)};if_block(node2,$$render=>{$$props.sectionLabel&&$$render(consequent_1)})}var button=sibling(node2,2),node_2=child(button);Plus(node_2,{class:"h-3 w-3"});var text_1=sibling(node_2);reset(
+button),reset(div_1);var node_3=sibling(div_1,2);{var consequent_2=$$anchor2=>{var div_2=root_3$q();each(div_2,21,()=>$$props.pairs,index$2,($$anchor3,pair,index2)=>{var div_3=root_4$j(),node_4=child(div_3);Input(node_4,{type:"text",get placeholder(){return keyPlaceholder()},get value(){return get$3(pair).key},get maxlength(){return KEY_VALUE_PAIR_KEY_MAX_LENGTH},oninput:e=>updatePairKey(index2,e.currentTarget.value),onblur:e=>trimPairKey(index2,e.currentTarget.value),class:"flex-1"});var textarea=sibling(
+node_4,2);remove_textarea_child(textarea),action(textarea,$$node=>autoResizeTextarea?.($$node));var button_1=sibling(textarea,2),node_5=child(button_1);Trash_2(node_5,{class:"h-3.5 w-3.5"}),reset(button_1),reset(div_3),template_effect(()=>{set_attribute(textarea,"placeholder",valuePlaceholder()),set_value(textarea,get$3(pair).value),set_attribute(textarea,"maxlength",KEY_VALUE_PAIR_VALUE_MAX_LENGTH)}),delegated("input",textarea,e=>{updatePairValue(index2,e.currentTarget.value),autoResizeTextarea(
+e.currentTarget)}),event("blur",textarea,e=>trimPairValue(index2,e.currentTarget.value)),delegated("click",button_1,()=>removePair(index2)),append($$anchor3,div_3)}),reset(div_2),append($$anchor2,div_2)},alternate=$$anchor2=>{var p2=root_5$d(),text_2=child(p2,!0);reset(p2),template_effect(()=>set_text(text_2,emptyMessage())),append($$anchor2,p2)};if_block(node_3,$$render=>{$$props.pairs.length>0?$$render(consequent_2):$$render(alternate,-1)})}reset(div),template_effect(()=>{set_class(div,1,clsx(
+className())),set_text(text_1,` ${addButtonLabel()??""}`)}),delegated("click",button,addPair),append($$anchor,div),pop()}delegate(["click","input"]);var root$B=from_html('<div class="flex flex-col gap-2"><div class="mb-2 flex items-center gap-4"><!> <!></div> <h3 class="text-sm font-medium">Available resources</h3></div>');function McpResourcesBrowserHeader($$anchor,$$props){push$1($$props,!0);let searchQuery=prop($$props,"searchQuery",3,"");var div=root$B(),div_1=child(div),node2=child(div_1);SearchInput(
+node2,{placeholder:"Search resources...",get value(){return searchQuery()},onInput:value=>$$props.onSearch?.(value)});var node_1=sibling(node2,2);Button(node_1,{variant:"ghost",size:"sm",class:"h-8 w-8 p-0",get onclick(){return $$props.onRefresh},get disabled(){return $$props.isLoading},title:"Refresh resources",children:($$anchor2,$$slotProps)=>{var fragment=comment$2(),node_2=first_child(fragment);{var consequent=$$anchor3=>{Loader_circle($$anchor3,{class:"h-4 w-4 animate-spin"})},alternate=$$anchor3=>{
+Refresh_cw($$anchor3,{class:"h-4 w-4"})};if_block(node_2,$$render=>{$$props.isLoading?$$render(consequent):$$render(alternate,-1)})}append($$anchor2,fragment)},$$slots:{default:!0}}),reset(div_1),next$1(2),reset(div),append($$anchor,div),pop()}var root$A=from_html('<div class="py-4 text-center text-sm text-muted-foreground"><!></div>');function McpResourcesBrowserEmptyState($$anchor,$$props){var div=root$A(),node2=child(div);{var consequent=$$anchor2=>{var text2=text$8("Loading resources...");append(
+$$anchor2,text2)},alternate=$$anchor2=>{var text_1=text$8("No resources available");append($$anchor2,text_1)};if_block(node2,$$render=>{$$props.isLoading?$$render(consequent):$$render(alternate,-1)})}reset(div),append($$anchor,div)}function resourceMatchesSearch(resource,query){return resource.title?.toLowerCase().includes(query)||resource.uri.toLowerCase().includes(query)}function buildResourceTree(resourceList,serverName,searchQuery){const root2={name:"root",children:new Map};if(!searchQuery||
+!searchQuery.trim()){for(const resource of resourceList){const pathParts=parseResourcePath(resource.uri);let current2=root2;for(let i=0;i<pathParts.length-1;i++){const part=pathParts[i];current2.children.has(part)||current2.children.set(part,{name:part,children:new Map}),current2=current2.children.get(part)}const fileName=pathParts[pathParts.length-1]||resource.name;current2.children.set(resource.uri,{name:fileName,resource:{...resource,serverName},children:new Map})}return root2}const query=searchQuery.
+toLowerCase();for(const resource of resourceList){if(!resourceMatchesSearch(resource,query))continue;const pathParts=parseResourcePath(resource.uri);let current2=root2;for(let i=0;i<pathParts.length-1;i++){const part=pathParts[i];current2.children.has(part)||current2.children.set(part,{name:part,children:new Map,isFiltered:!0}),current2=current2.children.get(part)}const fileName=pathParts[pathParts.length-1]||resource.name;current2.children.set(resource.uri,{name:fileName,resource:{...resource,serverName},
+children:new Map,isFiltered:!0})}function cleanupEmptyFolders(node2){if(node2.resource)return!0;const toDelete=[];for(const[name,child2]of node2.children.entries())cleanupEmptyFolders(child2)||toDelete.push(name);for(const name of toDelete)node2.children.delete(name);return node2.children.size>0}return cleanupEmptyFolders(root2),root2}function countTreeResources(node2){if(node2.resource)return 1;let count=0;for(const child2 of node2.children.values())count+=countTreeResources(child2);return count}
+function sortTreeChildren(children){return children.sort((a,b)=>{const aIsFolder=!a.resource&&a.children.size>0,bIsFolder=!b.resource&&b.children.size>0;return aIsFolder&&!bIsFolder?-1:!aIsFolder&&bIsFolder?1:a.name.localeCompare(b.name)})}var root_4$i=from_html('<!> <!> <span class="font-medium"> </span> <span class="text-xs text-muted-foreground"> </span>',1),root_7$d=from_html('<div class="ml-4 flex flex-col gap-0.5 border-l border-border/50 pl-2"></div>'),root_3$p=from_html("<!> <!>",1),root_9$a=from_html(
+'<div class="group flex w-full items-center gap-2"><!> <button><!> <span class="min-w-0 flex-1 truncate text-left"> </span></button></div>'),root_12$5=from_html('<!> <span class="inline-flex flex-col items-start gap-1 text-left"><div class="inline-flex min-w-0 items-center gap-1.5"><!></div> <span class="text-xs text-muted-foreground"> <!>)</span></span> <!>',1),root_18$3=from_html('<div class="py-1 text-xs text-red-500"> </div>'),root_19$5=from_html('<div class="py-1 text-xs text-muted-foregrou\
+nd">No resources</div>'),root_24=from_html('<div class="my-1 border-t border-border/30"></div>'),root_25$2=from_html('<button><!> <span class="min-w-0 flex-1 truncate text-left"> </span></button>'),root_23$2=from_html('<!> <div class="py-0.5 text-[11px] font-medium tracking-wide text-muted-foreground/70 uppercase">Templates</div> <!>',1),root_20$1=from_html("<!> <!>",1),root_17$3=from_html('<div class="ml-4 flex flex-col gap-0.5 border-l border-border/50 pl-2"><!></div>'),root_11$6=from_html("<!\
+> <!>",1);function McpResourcesBrowserServerItem($$anchor,$$props){push$1($$props,!0);const renderTreeNode=($$anchor2,node2=noop$3,depth=noop$3,parentPath=noop$3)=>{const isFolder=user_derived(()=>!node2().resource&&node2().children.size>0),folderId=user_derived(()=>`${$$props.serverName}:${parentPath()}/${node2().name}`),isFolderExpanded=user_derived(()=>$$props.expandedFolders.has(get$3(folderId)));var fragment=comment$2(),node_1=first_child(fragment);{var consequent_1=$$anchor3=>{const folderCount=user_derived(
+()=>countTreeResources(node2()));var fragment_1=comment$2(),node_2=first_child(fragment_1);component(node_2,()=>Collapsible,($$anchor4,Collapsible_Root)=>{Collapsible_Root($$anchor4,{get open(){return get$3(isFolderExpanded)},onOpenChange:()=>$$props.onToggleFolder(get$3(folderId)),children:($$anchor5,$$slotProps)=>{var fragment_2=root_3$p(),node_3=first_child(fragment_2);component(node_3,()=>Collapsible_trigger,($$anchor6,Collapsible_Trigger)=>{Collapsible_Trigger($$anchor6,{class:"flex w-full \
+items-center gap-2 rounded px-2 py-1 text-sm hover:bg-muted/50",children:($$anchor7,$$slotProps2)=>{var fragment_3=root_4$i(),node_4=first_child(fragment_3);{var consequent=$$anchor8=>{Chevron_down($$anchor8,{class:"h-3 w-3"})},alternate=$$anchor8=>{Chevron_right($$anchor8,{class:"h-3 w-3"})};if_block(node_4,$$render=>{get$3(isFolderExpanded)?$$render(consequent):$$render(alternate,-1)})}var node_5=sibling(node_4,2);Folder_open(node_5,{class:"h-3.5 w-3.5 text-muted-foreground"});var span=sibling(
+node_5,2),text2=child(span,!0);reset(span);var span_1=sibling(span,2),text_1=child(span_1);reset(span_1),template_effect(()=>{set_text(text2,node2().name),set_text(text_1,`(${get$3(folderCount)??""})`)}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var node_6=sibling(node_3,2);component(node_6,()=>Collapsible_content,($$anchor6,Collapsible_Content)=>{Collapsible_Content($$anchor6,{children:($$anchor7,$$slotProps2)=>{var div=root_7$d();each(div,21,()=>sortTreeChildren([...node2().children.
+values()]),child2=>child2.resource?.uri||`${$$props.serverName}:${parentPath()}/${node2().name}/${child2.name}`,($$anchor8,child2)=>{renderTreeNode($$anchor8,()=>get$3(child2),()=>depth()+1,()=>`${parentPath()}/${node2().name}`)}),reset(div),append($$anchor7,div)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},consequent_3=$$anchor3=>{const resource=user_derived(()=>node2().resource),ResourceIcon=user_derived(()=>getResourceIcon(get$3(
+resource).mimeType,get$3(resource).uri)),isSelected=user_derived(()=>isResourceSelected(get$3(resource))),resourceDisplayName=user_derived(()=>get$3(resource).title||getDisplayName(node2().name));var div_1=root_9$a(),node_7=child(div_1);{var consequent_2=$$anchor4=>{Checkbox($$anchor4,{get checked(){return get$3(isSelected)},onCheckedChange:checked=>handleCheckboxChange(get$3(resource),checked===!0),class:"h-4 w-4"})};if_block(node_7,$$render=>{$$props.onToggle&&$$render(consequent_2)})}var button=sibling(
+node_7,2),node_8=child(button);component(node_8,()=>get$3(ResourceIcon),($$anchor4,ResourceIcon_1)=>{ResourceIcon_1($$anchor4,{class:"h-3.5 w-3.5 shrink-0 text-muted-foreground"})});var span_2=sibling(node_8,2),text_2=child(span_2,!0);reset(span_2),reset(button),reset(div_1),template_effect(()=>{set_class(button,1,clsx(["flex flex-1 items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors","hover:bg-muted/50",get$3(isSelected)&&"bg-muted"])),set_attribute(button,"title",get$3(resourceDisplayName)),
+set_text(text_2,get$3(resourceDisplayName))}),delegated("click",button,e=>handleResourceClick(get$3(resource),e)),append($$anchor3,div_1)};if_block(node_1,$$render=>{get$3(isFolder)?$$render(consequent_1):node2().resource&&$$render(consequent_3,1)})}append($$anchor2,fragment)};let searchQuery=prop($$props,"searchQuery",3,""),serverDisplayName=user_derived(()=>mcpStore.getServerDisplayName($$props.serverName)),serverFaviconUrl=user_derived(()=>mcpStore.getServerFavicon($$props.serverName));const hasResources=user_derived(
+()=>$$props.serverRes.resources.length>0),hasTemplates=user_derived(()=>$$props.serverRes.templates.length>0),hasContent=user_derived(()=>get$3(hasResources)||get$3(hasTemplates)),resourceTree=user_derived(()=>buildResourceTree($$props.serverRes.resources,$$props.serverName,searchQuery())),templateInfos=user_derived(()=>$$props.serverRes.templates.map(t=>({uriTemplate:t.uriTemplate,name:t.name,title:t.title,description:t.description,mimeType:t.mimeType,serverName:$$props.serverName,annotations:t.
+annotations,icons:t.icons})));function handleResourceClick(resource,event2){$$props.onSelect?.(resource,event2.shiftKey)}function handleCheckboxChange(resource,checked){$$props.onToggle?.(resource,checked)}function isResourceSelected(resource){return $$props.selectedUris.has(resource.uri)}var fragment_8=comment$2(),node_9=first_child(fragment_8);component(node_9,()=>Collapsible,($$anchor2,Collapsible_Root_1)=>{Collapsible_Root_1($$anchor2,{get open(){return $$props.isExpanded},get onOpenChange(){
+return $$props.onToggleServer},children:($$anchor3,$$slotProps)=>{var fragment_9=root_11$6(),node_10=first_child(fragment_9);component(node_10,()=>Collapsible_trigger,($$anchor4,Collapsible_Trigger_1)=>{Collapsible_Trigger_1($$anchor4,{class:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-muted/50",children:($$anchor5,$$slotProps2)=>{var fragment_10=root_12$5(),node_11=first_child(fragment_10);{var consequent_4=$$anchor6=>{Chevron_down($$anchor6,{class:"h-3.5 w-3.5"})},alternate_1=$$anchor6=>{
+Chevron_right($$anchor6,{class:"h-3.5 w-3.5"})};if_block(node_11,$$render=>{$$props.isExpanded?$$render(consequent_4):$$render(alternate_1,-1)})}var span_3=sibling(node_11,2),div_2=child(span_3),node_12=child(div_2);McpServerIdentity(node_12,{get displayName(){return get$3(serverDisplayName)},get faviconUrl(){return get$3(serverFaviconUrl)},iconClass:"h-4 w-4",showVersion:!1}),reset(div_2);var span_4=sibling(div_2,2),text_3=child(span_4),node_13=sibling(text_3);{var consequent_5=$$anchor6=>{var text_4=text$8();
+template_effect(()=>set_text(text_4,`, ${$$props.serverRes.templates.length??""} template${$$props.serverRes.templates.length!==1?"s":""}`)),append($$anchor6,text_4)};if_block(node_13,$$render=>{get$3(hasTemplates)&&$$render(consequent_5)})}next$1(),reset(span_4),reset(span_3);var node_14=sibling(span_3,2);{var consequent_6=$$anchor6=>{Loader_circle($$anchor6,{class:"ml-auto h-3 w-3 animate-spin text-muted-foreground"})};if_block(node_14,$$render=>{$$props.serverRes.loading&&$$render(consequent_6)})}
+template_effect(()=>set_text(text_3,`(${$$props.serverRes.resources.length??""} resource${$$props.serverRes.resources.length!==1?"s":""}`)),append($$anchor5,fragment_10)},$$slots:{default:!0}})});var node_15=sibling(node_10,2);component(node_15,()=>Collapsible_content,($$anchor4,Collapsible_Content_1)=>{Collapsible_Content_1($$anchor4,{children:($$anchor5,$$slotProps2)=>{var div_3=root_17$3(),node_16=child(div_3);{var consequent_7=$$anchor6=>{var div_4=root_18$3(),text_5=child(div_4);reset(div_4),
+template_effect(()=>set_text(text_5,`Error: ${$$props.serverRes.error??""}`)),append($$anchor6,div_4)},consequent_8=$$anchor6=>{var div_5=root_19$5();append($$anchor6,div_5)},alternate_2=$$anchor6=>{var fragment_15=root_20$1(),node_17=first_child(fragment_15);{var consequent_9=$$anchor7=>{var fragment_16=comment$2(),node_18=first_child(fragment_16);each(node_18,17,()=>sortTreeChildren([...get$3(resourceTree).children.values()]),child2=>child2.resource?.uri||`${$$props.serverName}:${child2.name}`,
+($$anchor8,child2)=>{renderTreeNode($$anchor8,()=>get$3(child2),()=>1,()=>"")}),append($$anchor7,fragment_16)};if_block(node_17,$$render=>{get$3(hasResources)&&$$render(consequent_9)})}var node_19=sibling(node_17,2);{var consequent_11=$$anchor7=>{var fragment_18=root_23$2(),node_20=first_child(fragment_18);{var consequent_10=$$anchor8=>{var div_6=root_24();append($$anchor8,div_6)};if_block(node_20,$$render=>{get$3(hasResources)&&$$render(consequent_10)})}var node_21=sibling(node_20,4);each(node_21,
+17,()=>get$3(templateInfos),template=>template.uriTemplate,($$anchor8,template)=>{var button_1=root_25$2(),node_22=child(button_1);Braces(node_22,{class:"h-3.5 w-3.5 shrink-0 text-muted-foreground"});var span_5=sibling(node_22,2),text_6=child(span_5,!0);reset(span_5),reset(button_1),template_effect(()=>{set_class(button_1,1,clsx(["flex w-full items-center gap-2 rounded px-2 py-1 text-left text-sm transition-colors","hover:bg-muted/50",$$props.selectedTemplateUri===get$3(template).uriTemplate&&"b\
+g-muted"])),set_attribute(button_1,"title",get$3(template).uriTemplate),set_text(text_6,get$3(template).title||get$3(template).name)}),delegated("click",button_1,()=>$$props.onTemplateSelect(get$3(template))),append($$anchor8,button_1)}),append($$anchor7,fragment_18)};if_block(node_19,$$render=>{get$3(hasTemplates)&&$$props.onTemplateSelect&&$$render(consequent_11)})}append($$anchor6,fragment_15)};if_block(node_16,$$render=>{$$props.serverRes.error?$$render(consequent_7):get$3(hasContent)?$$render(
+alternate_2,-1):$$render(consequent_8,1)})}reset(div_3),append($$anchor5,div_3)},$$slots:{default:!0}})}),append($$anchor3,fragment_9)},$$slots:{default:!0}})}),append($$anchor,fragment_8),pop()}delegate(["click"]);var root$z=from_html('<div><!> <div class="flex flex-col gap-1"><!></div></div>');function McpResourcesBrowser($$anchor,$$props){push$1($$props,!0);let selectedUris=prop($$props,"selectedUris",19,()=>new Set),expandedServers=new SvelteSet,expandedFolders=new SvelteSet,searchQuery=state$1(
+"");const resources=user_derived(mcpResources),isLoading2=user_derived(mcpResourcesLoading),filteredResources=user_derived(()=>{if(!get$3(searchQuery).trim())return get$3(resources);const query=get$3(searchQuery).toLowerCase(),filtered=new SvelteMap;for(const[serverName,serverRes]of get$3(resources).entries()){const filteredResources2=serverRes.resources.filter(r2=>r2.title?.toLowerCase().includes(query)||r2.uri.toLowerCase().includes(query)||serverName.toLowerCase().includes(query)),filteredTemplates=serverRes.
+templates.filter(t=>t.name?.toLowerCase().includes(query)||t.title?.toLowerCase().includes(query)||t.uriTemplate.toLowerCase().includes(query)||serverName.toLowerCase().includes(query));(filteredResources2.length>0||filteredTemplates.length>0||query.trim())&&filtered.set(serverName,{...serverRes,resources:filteredResources2,templates:filteredTemplates})}return filtered});user_effect(()=>{$$props.expandToUri&&get$3(resources).size>0&&autoExpandToResource($$props.expandToUri)});function autoExpandToResource(uri2){
+for(const[serverName,serverRes]of get$3(resources).entries())if(serverRes.resources.find(r2=>r2.uri===uri2)){expandedServers.add(serverName);const pathParts=parseResourcePath(uri2);if(pathParts.length>1){let currentPath="";for(let i=0;i<pathParts.length-1;i++){currentPath=`${currentPath}/${pathParts[i]}`;const folderId=`${serverName}:${currentPath}`;expandedFolders.add(folderId)}}break}}function toggleServer(serverName){expandedServers.has(serverName)?expandedServers.delete(serverName):expandedServers.
+add(serverName)}function toggleFolder(folderId){expandedFolders.has(folderId)?expandedFolders.delete(folderId):expandedFolders.add(folderId)}function handleRefresh(){mcpStore.fetchAllResources()}var div=root$z(),node2=child(div);McpResourcesBrowserHeader(node2,{get isLoading(){return get$3(isLoading2)},onRefresh:handleRefresh,onSearch:q2=>set$1(searchQuery,q2,!0),get searchQuery(){return get$3(searchQuery)}});var div_1=sibling(node2,2),node_1=child(div_1);{var consequent=$$anchor2=>{McpResourcesBrowserEmptyState(
+$$anchor2,{get isLoading(){return get$3(isLoading2)}})},alternate=$$anchor2=>{var fragment_1=comment$2(),node_2=first_child(fragment_1);each(node_2,17,()=>[...get$3(filteredResources).entries()],([serverName,serverRes])=>serverName,($$anchor3,$$item)=>{var $$array=user_derived(()=>to_array(get$3($$item),2));let serverName=()=>get$3($$array)[0],serverRes=()=>get$3($$array)[1];{let $0=user_derived(()=>expandedServers.has(serverName()));McpResourcesBrowserServerItem($$anchor3,{get serverName(){return serverName()},
+get serverRes(){return serverRes()},get isExpanded(){return get$3($0)},get selectedUris(){return selectedUris()},get selectedTemplateUri(){return $$props.selectedTemplateUri},get expandedFolders(){return expandedFolders},onToggleServer:()=>toggleServer(serverName()),onToggleFolder:toggleFolder,get onSelect(){return $$props.onSelect},get onToggle(){return $$props.onToggle},get onTemplateSelect(){return $$props.onTemplateSelect},get searchQuery(){return get$3(searchQuery)}})}}),append($$anchor2,fragment_1)};
+if_block(node_1,$$render=>{get$3(filteredResources).size===0?$$render(consequent):$$render(alternate,-1)})}reset(div_1),reset(div),template_effect(()=>set_class(div,1,clsx(["flex flex-col gap-2",$$props.class]))),append($$anchor,div),pop()}var root_1$f=from_html('<div class="flex flex-col items-center justify-center gap-2 py-8 text-muted-foreground"><!> <span class="text-sm">Select a resource to preview</span></div>'),root_3$o=from_html('<p class="mt-1 text-sm text-muted-foreground"> </p>'),root_5$c=from_html(
+'<div class="flex items-center justify-center py-8"><!></div>'),root_6$e=from_html('<div class="flex flex-col items-center justify-center gap-2 py-8 text-red-500"><!> <span class="text-sm"> </span></div>'),root_8$f=from_html('<pre class="font-mono text-xs break-words whitespace-pre-wrap"> </pre>'),root_10$6=from_html('<img alt="Resource content" class="max-w-full rounded"/>'),root_11$5=from_html('<div class="flex items-center gap-2 rounded bg-muted p-2 text-sm text-muted-foreground"><!> <span> <\
+/span></div>'),root_12$4=from_html('<div class="py-4 text-center text-sm text-muted-foreground">No content available</div>'),root_7$c=from_html("<!> <!> <!>",1),root_14$3=from_html('<span class="rounded bg-muted px-1.5 py-0.5"> </span>'),root_15$5=from_html('<span class="rounded bg-muted px-1.5 py-0.5"> </span>'),root_13$4=from_html('<div class="flex flex-wrap gap-2 text-xs text-muted-foreground"><!> <!> <span class="rounded bg-muted px-1.5 py-0.5"> </span></div>'),root_2$x=from_html('<div class\
+="flex items-start justify-between gap-2"><div class="min-w-0 flex-1"><h3 class="truncate font-medium"> </h3> <p class="truncate text-xs text-muted-foreground"> </p> <!></div> <div class="flex items-center gap-1"><!> <!></div></div> <div class="min-h-[200px] overflow-auto rounded-md border bg-muted/30 p-3 break-all"><!></div> <!>',1),root$y=from_html("<div><!></div>");function McpResourcePreview($$anchor,$$props){push$1($$props,!0);let content2=state$1(null),isLoading2=state$1(!1),error2=state$1(
+null);user_effect(()=>{$$props.resource?$$props.preloadedContent?(set$1(content2,$$props.preloadedContent,!0),set$1(isLoading2,!1),set$1(error2,null)):loadContent($$props.resource.uri):(set$1(content2,null),set$1(error2,null))});async function loadContent(uri2){set$1(isLoading2,!0),set$1(error2,null);try{const result=await mcpStore.readResource(uri2);result?set$1(content2,result,!0):set$1(error2,"Failed to load resource content")}catch(e){set$1(error2,e instanceof Error?e.message:"Unknown error",
+!0)}finally{set$1(isLoading2,!1)}}function handleDownload(){const text2=getResourceTextContent(get$3(content2));!text2||!$$props.resource||downloadResourceContent(text2,$$props.resource.mimeType||MimeTypeText.PLAIN,$$props.resource.name||"resource.txt")}var div=root$y(),node2=child(div);{var consequent=$$anchor2=>{var div_1=root_1$f(),node_1=child(div_1);File_text(node_1,{class:"h-8 w-8 opacity-50"}),next$1(2),reset(div_1),append($$anchor2,div_1)},alternate_1=$$anchor2=>{var fragment=root_2$x(),
+div_2=first_child(fragment),div_3=child(div_2),h3=child(div_3),text_1=child(h3,!0);reset(h3);var p2=sibling(h3,2),text_2=child(p2,!0);reset(p2);var node_2=sibling(p2,2);{var consequent_1=$$anchor3=>{var p_1=root_3$o(),text_3=child(p_1,!0);reset(p_1),template_effect(()=>set_text(text_3,$$props.resource.description)),append($$anchor3,p_1)};if_block(node_2,$$render=>{$$props.resource.description&&$$render(consequent_1)})}reset(div_3);var div_4=sibling(div_3,2),node_3=child(div_4);{let $0=user_derived(
+()=>getResourceTextContent(get$3(content2))),$1=user_derived(()=>!get$3(isLoading2)&&!!getResourceTextContent(get$3(content2)));ActionIconCopyToClipboard(node_3,{get text(){return get$3($0)},get canCopy(){return get$3($1)},ariaLabel:"Copy content"})}var node_4=sibling(node_3,2);{let $0=user_derived(()=>get$3(isLoading2)||!getResourceTextContent(get$3(content2)));Button(node_4,{variant:"ghost",size:"sm",class:"h-7 w-7 p-0",onclick:handleDownload,get disabled(){return get$3($0)},title:"Download co\
+ntent",children:($$anchor3,$$slotProps)=>{Download($$anchor3,{class:"h-3.5 w-3.5"})},$$slots:{default:!0}})}reset(div_4),reset(div_2);var div_5=sibling(div_2,2),node_5=child(div_5);{var consequent_2=$$anchor3=>{var div_6=root_5$c(),node_6=child(div_6);Loader_circle(node_6,{class:"h-6 w-6 animate-spin text-muted-foreground"}),reset(div_6),append($$anchor3,div_6)},consequent_3=$$anchor3=>{var div_7=root_6$e(),node_7=child(div_7);Circle_alert(node_7,{class:"h-6 w-6"});var span=sibling(node_7,2),text_4=child(
+span,!0);reset(span),reset(div_7),template_effect(()=>set_text(text_4,get$3(error2))),append($$anchor3,div_7)},consequent_7=$$anchor3=>{const textContent=user_derived(()=>getResourceTextContent(get$3(content2))),blobContent=user_derived(()=>getResourceBlobContent(get$3(content2)));var fragment_2=root_7$c(),node_8=first_child(fragment_2);{var consequent_4=$$anchor4=>{var pre=root_8$f(),text_5=child(pre,!0);reset(pre),template_effect(()=>set_text(text_5,get$3(textContent))),append($$anchor4,pre)};
+if_block(node_8,$$render=>{get$3(textContent)&&$$render(consequent_4)})}var node_9=sibling(node_8,2);each(node_9,17,()=>get$3(blobContent),blob=>blob.uri,($$anchor4,blob)=>{var fragment_3=comment$2(),node_10=first_child(fragment_3);{var consequent_5=$$anchor5=>{var img=root_10$6();template_effect($0=>set_attribute(img,"src",$0),[()=>createBase64DataUrl(get$3(blob).mimeType??MimeTypeApplication.OCTET_STREAM,get$3(blob).blob)]),append($$anchor5,img)},d2=user_derived(()=>isImageMimeType(get$3(blob).
+mimeType??MimeTypeApplication.OCTET_STREAM)),alternate=$$anchor5=>{var div_8=root_11$5(),node_11=child(div_8);File_text(node_11,{class:"h-4 w-4"});var span_1=sibling(node_11,2),text_6=child(span_1);reset(span_1),reset(div_8),template_effect(()=>set_text(text_6,`Binary content (${(get$3(blob).mimeType||"unknown type")??""})`)),append($$anchor5,div_8)};if_block(node_10,$$render=>{get$3(d2)?$$render(consequent_5):$$render(alternate,-1)})}append($$anchor4,fragment_3)});var node_12=sibling(node_9,2);
+{var consequent_6=$$anchor4=>{var div_9=root_12$4();append($$anchor4,div_9)};if_block(node_12,$$render=>{!get$3(textContent)&&get$3(blobContent).length===0&&$$render(consequent_6)})}append($$anchor3,fragment_2)};if_block(node_5,$$render=>{get$3(isLoading2)?$$render(consequent_2):get$3(error2)?$$render(consequent_3,1):get$3(content2)&&$$render(consequent_7,2)})}reset(div_5);var node_13=sibling(div_5,2);{var consequent_10=$$anchor3=>{var div_10=root_13$4(),node_14=child(div_10);{var consequent_8=$$anchor4=>{
+var span_2=root_14$3(),text_7=child(span_2,!0);reset(span_2),template_effect(()=>set_text(text_7,$$props.resource.mimeType)),append($$anchor4,span_2)};if_block(node_14,$$render=>{$$props.resource.mimeType&&$$render(consequent_8)})}var node_15=sibling(node_14,2);{var consequent_9=$$anchor4=>{var span_3=root_15$5(),text_8=child(span_3);reset(span_3),template_effect(()=>set_text(text_8,`Priority: ${$$props.resource.annotations.priority??""}`)),append($$anchor4,span_3)};if_block(node_15,$$render=>{$$props.
+resource.annotations?.priority!==void 0&&$$render(consequent_9)})}var span_4=sibling(node_15,2),text_9=child(span_4);reset(span_4),reset(div_10),template_effect(()=>set_text(text_9,`Server: ${$$props.resource.serverName??""}`)),append($$anchor3,div_10)};if_block(node_13,$$render=>{($$props.resource.mimeType||$$props.resource.annotations)&&$$render(consequent_10)})}template_effect(()=>{set_text(text_1,$$props.resource.title||$$props.resource.name),set_text(text_2,$$props.resource.uri)}),append($$anchor2,
+fragment)};if_block(node2,$$render=>{$$props.resource?$$render(alternate_1,-1):$$render(consequent)})}reset(div),template_effect(()=>set_class(div,1,clsx(["flex flex-col gap-3",$$props.class]))),append($$anchor,div),pop()}var root_2$w=from_html('<div class="rounded-md bg-muted/50 px-3 py-2"><p class="text-xs text-muted-foreground">Resolved URI:</p> <p class="mt-0.5 font-mono text-xs break-all"> </p></div>'),root$x=from_html('<form class="space-y-3"><!> <!> <div class="flex justify-end gap-2 pt-1\
+"><!> <!></div></form>');function McpResourceTemplateForm($$anchor,$$props){push$1($$props,!0);const variables=user_derived(()=>extractTemplateVariables($$props.template.uriTemplate));let values=proxy({}),suggestions=proxy({}),loadingSuggestions=proxy({}),activeAutocomplete=state$1(null),autocompleteIndex=state$1(0);const expandedUri=user_derived(()=>expandTemplate($$props.template.uriTemplate,values)),isComplete=user_derived(()=>isTemplateComplete($$props.template.uriTemplate,values)),fetchCompletions=debounce(
+async(argName,value)=>{if(value.length<1){suggestions[argName]=[];return}loadingSuggestions[argName]=!0;try{const result=await mcpStore.getResourceCompletions($$props.template.serverName,$$props.template.uriTemplate,argName,value);if(result&&result.values.length>0){const filteredValues=result.values.filter(v=>v.trim()!=="");filteredValues.length>0?(suggestions[argName]=filteredValues,set$1(activeAutocomplete,argName,!0),set$1(autocompleteIndex,0)):suggestions[argName]=[]}else suggestions[argName]=
+[]}catch(error2){console.error("[McpResourceTemplateForm] Failed to fetch completions:",error2),suggestions[argName]=[]}finally{loadingSuggestions[argName]=!1}},200);function handleArgInput(argName,value){values[argName]=value,fetchCompletions(argName,value)}function selectSuggestion(argName,value){values[argName]=value,suggestions[argName]=[],set$1(activeAutocomplete,null)}function handleArgKeydown(event2,argName){const argSuggestions=suggestions[argName]??[];if(event2.key===KeyboardKey.ESCAPE){
+event2.preventDefault(),event2.stopPropagation(),argSuggestions.length>0&&get$3(activeAutocomplete)===argName?(suggestions[argName]=[],set$1(activeAutocomplete,null)):$$props.onCancel();return}argSuggestions.length===0||get$3(activeAutocomplete)!==argName||(event2.key===KeyboardKey.ARROW_DOWN?(event2.preventDefault(),set$1(autocompleteIndex,Math.min(get$3(autocompleteIndex)+1,argSuggestions.length-1),!0)):event2.key===KeyboardKey.ARROW_UP?(event2.preventDefault(),set$1(autocompleteIndex,Math.max(
+get$3(autocompleteIndex)-1,0),!0)):event2.key===KeyboardKey.ENTER&&argSuggestions[get$3(autocompleteIndex)]&&(event2.preventDefault(),event2.stopPropagation(),selectSuggestion(argName,argSuggestions[get$3(autocompleteIndex)])))}function handleArgBlur(argName){setTimeout(()=>{get$3(activeAutocomplete)===argName&&(suggestions[argName]=[],set$1(activeAutocomplete,null))},150)}function handleArgFocus(argName){const value=values[argName]??"";value.length>=MIN_AUTOCOMPLETE_INPUT_LENGTH&&fetchCompletions(
+argName,value)}function handleSubmit(event2){event2.preventDefault(),get$3(isComplete)&&$$props.onResolve(get$3(expandedUri),$$props.template.serverName)}var form=root$x(),node2=child(form);each(node2,17,()=>get$3(variables),variable=>variable.name,($$anchor2,variable)=>{{let $0=user_derived(()=>values[get$3(variable).name]??""),$1=user_derived(()=>suggestions[get$3(variable).name]??[]),$2=user_derived(()=>loadingSuggestions[get$3(variable).name]??!1),$3=user_derived(()=>get$3(activeAutocomplete)===
+get$3(variable).name),$4=user_derived(()=>get$3(activeAutocomplete)===get$3(variable).name?get$3(autocompleteIndex):0);InputWithSuggestions($$anchor2,{get name(){return get$3(variable).name},get value(){return get$3($0)},get suggestions(){return get$3($1)},get isLoadingSuggestions(){return get$3($2)},get isAutocompleteActive(){return get$3($3)},get autocompleteIndex(){return get$3($4)},onInput:value=>handleArgInput(get$3(variable).name,value),onKeydown:e=>handleArgKeydown(e,get$3(variable).name),
+onBlur:()=>handleArgBlur(get$3(variable).name),onFocus:()=>handleArgFocus(get$3(variable).name),onSelectSuggestion:value=>selectSuggestion(get$3(variable).name,value)})}});var node_1=sibling(node2,2);{var consequent=$$anchor2=>{var div=root_2$w(),p2=sibling(child(div),2),text2=child(p2,!0);reset(p2),reset(div),template_effect(()=>set_text(text2,get$3(expandedUri))),append($$anchor2,div)};if_block(node_1,$$render=>{get$3(isComplete)&&$$render(consequent)})}var div_1=sibling(node_1,2),node_2=child(
+div_1);Button(node_2,{type:"button",size:"sm",variant:"secondary",get onclick(){return $$props.onCancel},children:($$anchor2,$$slotProps)=>{next$1();var text_1=text$8("Cancel");append($$anchor2,text_1)},$$slots:{default:!0}});var node_3=sibling(node_2,2);{let $0=user_derived(()=>!get$3(isComplete));Button(node_3,{size:"sm",type:"submit",get disabled(){return get$3($0)},children:($$anchor2,$$slotProps)=>{next$1();var text_2=text$8("Read Resource");append($$anchor2,text_2)},$$slots:{default:!0}})}
+reset(div_1),reset(form),event("submit",form,handleSubmit),append($$anchor,form),pop()}var root_5$b=from_html("<!> <!>",1),root_2$v=from_html('<!> <div class="space-y-4 py-4"><!></div> <!>',1);function DialogMcpServerAddNew($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15),newServerUrl=state$1(""),newServerHeaders=state$1(""),newServerUrlError=user_derived(()=>{if(!get$3(newServerUrl).trim())return"URL is required";try{return new URL(get$3(newServerUrl)),null}catch{return"In\
+valid URL format"}});function handleOpenChange(value){value||(set$1(newServerUrl,""),set$1(newServerHeaders,"")),open2(value),$$props.onOpenChange?.(value)}function saveNewServer(){if(get$3(newServerUrlError))return;const newServerId=uuid$1()??`${MCP_SERVER_ID_PREFIX}-${Date.now()}`;mcpStore.addServer({id:newServerId,enabled:!0,url:get$3(newServerUrl).trim(),headers:get$3(newServerHeaders).trim()||void 0}),conversationsStore.setMcpServerOverride(newServerId,!0),handleOpenChange(!1)}var fragment=comment$2(),
+node2=first_child(fragment);component(node2,()=>Root$2,($$anchor2,Dialog_Root)=>{Dialog_Root($$anchor2,{get open(){return open2()},onOpenChange:handleOpenChange,children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Dialog_content,($$anchor4,Dialog_Content)=>{Dialog_Content($$anchor4,{class:"sm:max-w-md",children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$v(),node_2=first_child(fragment_2);component(node_2,()=>Dialog_header,($$anchor6,Dialog_Header)=>{
+Dialog_Header($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_3=comment$2(),node_3=first_child(fragment_3);component(node_3,()=>Dialog_title,($$anchor8,Dialog_Title)=>{Dialog_Title($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();var text2=text$8("Add New Server");append($$anchor9,text2)},$$slots:{default:!0}})}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var div=sibling(node_2,2),node_4=child(div);{let $0=user_derived(()=>get$3(newServerUrl)?get$3(newServerUrlError):
+null);McpServerForm(node_4,{get url(){return get$3(newServerUrl)},get headers(){return get$3(newServerHeaders)},onUrlChange:v=>set$1(newServerUrl,v,!0),onHeadersChange:v=>set$1(newServerHeaders,v,!0),get urlError(){return get$3($0)},id:"new-server"})}reset(div);var node_5=sibling(div,2);component(node_5,()=>Dialog_footer,($$anchor6,Dialog_Footer)=>{Dialog_Footer($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_4=root_5$b(),node_6=first_child(fragment_4);Button(node_6,{variant:"seconda\
+ry",size:"sm",onclick:()=>handleOpenChange(!1),children:($$anchor8,$$slotProps4)=>{next$1();var text_1=text$8("Cancel");append($$anchor8,text_1)},$$slots:{default:!0}});var node_7=sibling(node_6,2);{let $0=user_derived(()=>!!get$3(newServerUrlError));Button(node_7,{variant:"default",size:"sm",onclick:saveNewServer,get disabled(){return get$3($0)},"aria-label":"Save",children:($$anchor8,$$slotProps4)=>{next$1();var text_2=text$8("Add");append($$anchor8,text_2)},$$slots:{default:!0}})}append($$anchor7,
+fragment_4)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_4$h=from_html("<!> ",1),root_3$n=from_html("<!> <!>",1),root_8$e=from_html("<!> <!>",1),root_2$u=from_html("<!> <!> <!>",1);function DialogConfirmation($$anchor,$$props){push$1($$props,!0);let confirmText=prop($$props,"confirmText",3,"Confirm"),cancelText=prop($$props,"cancelText",3,"Cancel"),variant=prop($$props,
+"variant",3,"default");function handleKeydown(event2){event2.key===KeyboardKey.ENTER&&(event2.preventDefault(),$$props.onConfirm()),$$props.onKeydown?.(event2)}function handleOpenChange(newOpen){newOpen||$$props.onCancel()}var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$1,($$anchor2,AlertDialog_Root)=>{AlertDialog_Root($$anchor2,{get open(){return $$props.open},onOpenChange:handleOpenChange,children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(
+fragment_1);component(node_1,()=>Alert_dialog_content,($$anchor4,AlertDialog_Content)=>{AlertDialog_Content($$anchor4,{onkeydown:handleKeydown,children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$u(),node_2=first_child(fragment_2);component(node_2,()=>Alert_dialog_header,($$anchor6,AlertDialog_Header)=>{AlertDialog_Header($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$n(),node_3=first_child(fragment_3);component(node_3,()=>Alert_dialog_title,($$anchor8,AlertDialog_Title)=>{
+AlertDialog_Title($$anchor8,{class:"flex items-center gap-2",children:($$anchor9,$$slotProps4)=>{var fragment_4=root_4$h(),node_4=first_child(fragment_4);{var consequent=$$anchor10=>{const IconComponent=user_derived(()=>$$props.icon);var fragment_5=comment$2(),node_5=first_child(fragment_5);{let $0=user_derived(()=>variant()==="destructive"?"text-destructive":"");component(node_5,()=>get$3(IconComponent),($$anchor11,IconComponent_1)=>{IconComponent_1($$anchor11,{get class(){return`h-5 w-5 ${get$3(
+$0)??""}`}})})}append($$anchor10,fragment_5)};if_block(node_4,$$render=>{$$props.icon&&$$render(consequent)})}var text2=sibling(node_4);template_effect(()=>set_text(text2,` ${$$props.title??""}`)),append($$anchor9,fragment_4)},$$slots:{default:!0}})});var node_6=sibling(node_3,2);component(node_6,()=>Alert_dialog_description,($$anchor8,AlertDialog_Description)=>{AlertDialog_Description($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();var text_1=text$8();template_effect(()=>set_text(text_1,
+$$props.description)),append($$anchor9,text_1)},$$slots:{default:!0}})}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var node_7=sibling(node_2,2);{var consequent_1=$$anchor6=>{var fragment_7=comment$2(),node_8=first_child(fragment_7);snippet(node_8,()=>$$props.children),append($$anchor6,fragment_7)};if_block(node_7,$$render=>{$$props.children&&$$render(consequent_1)})}var node_9=sibling(node_7,2);component(node_9,()=>Alert_dialog_footer,($$anchor6,AlertDialog_Footer)=>{AlertDialog_Footer(
+$$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_8=root_8$e(),node_10=first_child(fragment_8);component(node_10,()=>Alert_dialog_cancel,($$anchor8,AlertDialog_Cancel)=>{AlertDialog_Cancel($$anchor8,{get onclick(){return $$props.onCancel},children:($$anchor9,$$slotProps4)=>{next$1();var text_2=text$8();template_effect(()=>set_text(text_2,cancelText())),append($$anchor9,text_2)},$$slots:{default:!0}})});var node_11=sibling(node_10,2);{let $0=user_derived(()=>variant()==="destructive"?"b\
+g-destructive text-white hover:bg-destructive/80":"");component(node_11,()=>Alert_dialog_action,($$anchor8,AlertDialog_Action)=>{AlertDialog_Action($$anchor8,{get onclick(){return $$props.onConfirm},get class(){return get$3($0)},children:($$anchor9,$$slotProps4)=>{next$1();var text_3=text$8();template_effect(()=>set_text(text_3,confirmText())),append($$anchor9,text_3)},$$slots:{default:!0}})})}append($$anchor7,fragment_8)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),
+append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_3$m=from_html("<!> <!>",1),root_6$d=from_html("<!> <!>",1),root_2$t=from_html('<!> <div class="space-y-4 pt-2 pb-6"><div class="space-y-2"><p class="text-sm font-medium text-muted-foreground">Current title:</p> <p class="rounded-md bg-muted/50 p-3 text-sm font-medium"> </p></div> <div class="space-y-2"><p class="text-sm font-medium text-muted-foreground">New title would be:</p> <p class="rounded-md bg\
+-muted/50 p-3 text-sm font-medium"> </p></div></div> <!>',1);function DialogConversationTitleUpdate($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15);var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$1,($$anchor2,AlertDialog_Root)=>{AlertDialog_Root($$anchor2,{get open(){return open2()},set open($$value){open2($$value)},children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Alert_dialog_content,
+($$anchor4,AlertDialog_Content)=>{AlertDialog_Content($$anchor4,{children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$t(),node_2=first_child(fragment_2);component(node_2,()=>Alert_dialog_header,($$anchor6,AlertDialog_Header)=>{AlertDialog_Header($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$m(),node_3=first_child(fragment_3);component(node_3,()=>Alert_dialog_title,($$anchor8,AlertDialog_Title)=>{AlertDialog_Title($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();
+var text2=text$8("Update Conversation Title?");append($$anchor9,text2)},$$slots:{default:!0}})});var node_4=sibling(node_3,2);component(node_4,()=>Alert_dialog_description,($$anchor8,AlertDialog_Description)=>{AlertDialog_Description($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();var text_1=text$8("Do you want to update the conversation title to match the first message content?");append($$anchor9,text_1)},$$slots:{default:!0}})}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var div=sibling(
+node_2,2),div_1=child(div),p2=sibling(child(div_1),2),text_2=child(p2,!0);reset(p2),reset(div_1);var div_2=sibling(div_1,2),p_1=sibling(child(div_2),2),text_3=child(p_1,!0);reset(p_1),reset(div_2),reset(div);var node_5=sibling(div,2);component(node_5,()=>Alert_dialog_footer,($$anchor6,AlertDialog_Footer)=>{AlertDialog_Footer($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_4=root_6$d(),node_6=first_child(fragment_4);Button(node_6,{variant:"outline",get onclick(){return $$props.onCancel},
+children:($$anchor8,$$slotProps4)=>{next$1();var text_4=text$8("Keep Current Title");append($$anchor8,text_4)},$$slots:{default:!0}});var node_7=sibling(node_6,2);Button(node_7,{get onclick(){return $$props.onConfirm},children:($$anchor8,$$slotProps4)=>{next$1();var text_5=text$8("Update Title");append($$anchor8,text_5)},$$slots:{default:!0}}),append($$anchor7,fragment_4)},$$slots:{default:!0}})}),template_effect(()=>{set_text(text_2,$$props.currentTitle),set_text(text_3,$$props.newTitle)}),append(
+$$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_4$g=from_html('<!> <span class="sr-only">Close preview</span>',1),root_3$l=from_html('<iframe sandbox="allow-scripts" class="code-preview-iframe"></iframe> <!>',1),root_2$s=from_html("<!> <!>",1);function DialogCodePreview($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15),iframeRef=state$1(null);user_effect(()=>{get$3(iframeRef)&&(open2()?
+get$3(iframeRef).srcdoc=$$props.code:get$3(iframeRef).srcdoc="")});function handleOpenChange(nextOpen){open2(nextOpen),$$props.onOpenChange?.(nextOpen)}var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Dialog,($$anchor2,DialogPrimitive_Root)=>{DialogPrimitive_Root($$anchor2,{get open(){return open2()},onOpenChange:handleOpenChange,children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Portal$2,($$anchor4,DialogPrimitive_Portal)=>{
+DialogPrimitive_Portal($$anchor4,{children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$s(),node_2=first_child(fragment_2);component(node_2,()=>Dialog_overlay$1,($$anchor6,DialogPrimitive_Overlay)=>{DialogPrimitive_Overlay($$anchor6,{class:"code-preview-overlay"})});var node_3=sibling(node_2,2);component(node_3,()=>Dialog_content$1,($$anchor6,DialogPrimitive_Content)=>{DialogPrimitive_Content($$anchor6,{class:"code-preview-content",children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$l(),
+iframe=first_child(fragment_3);bind_this(iframe,$$value=>set$1(iframeRef,$$value),()=>get$3(iframeRef));var node_4=sibling(iframe,2);component(node_4,()=>Dialog_close,($$anchor8,DialogPrimitive_Close)=>{DialogPrimitive_Close($$anchor8,{class:"code-preview-close absolute top-4 right-4 border-none bg-transparent text-white opacity-70 mix-blend-difference transition-opacity hover:opacity-100 focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:outline-none disabled:pointer-events-none [&_\
+svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-8","aria-label":"Close preview",children:($$anchor9,$$slotProps4)=>{var fragment_4=root_4$g(),node_5=first_child(fragment_4);X(node_5,{}),next$1(2),append($$anchor9,fragment_4)},$$slots:{default:!0}})}),template_effect(()=>set_attribute(iframe,"title",`Preview ${$$props.language??""}`)),append($$anchor7,fragment_3)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},
+$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_3$k=from_html("<!> <!>",1),root_2$r=from_html("<!> <!>",1);function DialogChatAttachmentsPreview($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15,!1),uploadedFiles=prop($$props,"uploadedFiles",19,()=>[]),attachments=prop($$props,"attachments",19,()=>[]),previewFocusIndex=prop($$props,"previewFocusIndex",3,0);function handleClose(){open2(!1)}user_effect(()=>{if(!open2())return;function handleKeyDown(event2){const target2=event2.
+target;if(!(target2.tagName==="INPUT"||target2.tagName==="TEXTAREA"))switch(event2.key){case KeyboardKey.ARROW_LEFT:event2.preventDefault(),event2.stopPropagation(),document.dispatchEvent(new CustomEvent("chat-attachments-nav",{detail:-1}));break;case KeyboardKey.ARROW_RIGHT:event2.preventDefault(),event2.stopPropagation(),document.dispatchEvent(new CustomEvent("chat-attachments-nav",{detail:1}));break;case KeyboardKey.SPACE:event2.preventDefault(),event2.stopPropagation(),document.dispatchEvent(
+new CustomEvent("chat-attachments-nav",{detail:1}));break}}return document.addEventListener("keydown",handleKeyDown),()=>document.removeEventListener("keydown",handleKeyDown)});var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Dialog,($$anchor2,Dialog_Root)=>{Dialog_Root($$anchor2,{get open(){return open2()},set open($$value){open2($$value)},children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Portal$2,($$anchor4,Dialog_Portal)=>{
+Dialog_Portal($$anchor4,{children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$r(),node_2=first_child(fragment_2);component(node_2,()=>Dialog_overlay,($$anchor6,DialogUI_Overlay)=>{DialogUI_Overlay($$anchor6,{class:"bg-black/85",style:"z-index: 1000"})});var node_3=sibling(node_2,2);component(node_3,()=>Dialog_content$1,($$anchor6,Dialog_Content)=>{Dialog_Content($$anchor6,{class:"fixed inset-0 z-[1000] flex flex-col bg-transparent outline-none",children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$k(),
+node_4=first_child(fragment_3);component(node_4,()=>Dialog_close,($$anchor8,Dialog_Close)=>{Dialog_Close($$anchor8,{class:"absolute top-4 right-4 z-10 cursor-pointer text-white hover:text-gray-400",onclick:handleClose,"aria-label":"Close",children:($$anchor9,$$slotProps4)=>{X($$anchor9,{class:"size-4"})},$$slots:{default:!0}})});var node_5=sibling(node_4,2);ChatAttachmentsPreview(node_5,{get uploadedFiles(){return uploadedFiles()},get attachments(){return attachments()},get activeModelId(){return $$props.
+activeModelId},get previewFocusIndex(){return previewFocusIndex()},class:"min-h-0 flex-1"}),append($$anchor7,fragment_3)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_4$f=from_html("<!> ",1),root_3$j=from_html("<!> <!>",1),root_9$9=from_html('<p><span class="font-medium">Context size:</span> </p>'),root_8$d=from_html('<div class="mt-2 space-y-1 text-xs opacity-80"><p\
+><span class="font-medium">Prompt tokens:</span> </p> <!></div>'),root_2$q=from_html('<!> <div><p class="font-medium"> </p> <!></div> <!>',1);function DialogChatError($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15);const isTimeout=user_derived(()=>$$props.type===ErrorDialogType.TIMEOUT),title2=user_derived(()=>get$3(isTimeout)?"TCP Timeout":"Server Error"),description2=user_derived(()=>get$3(isTimeout)?"The request did not receive a response from the server before timing o\
+ut.":"The server responded with an error message. Review the details below."),iconClass=user_derived(()=>get$3(isTimeout)?"text-destructive":"text-amber-500"),badgeClass=user_derived(()=>get$3(isTimeout)?"border-destructive/40 bg-destructive/10 text-destructive":"border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-400");function handleOpenChange(newOpen){open2(newOpen),$$props.onOpenChange?.(newOpen)}var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$1,($$anchor2,AlertDialog_Root)=>{
+AlertDialog_Root($$anchor2,{get open(){return open2()},onOpenChange:handleOpenChange,children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Alert_dialog_content,($$anchor4,AlertDialog_Content)=>{AlertDialog_Content($$anchor4,{children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$q(),node_2=first_child(fragment_2);component(node_2,()=>Alert_dialog_header,($$anchor6,AlertDialog_Header)=>{AlertDialog_Header($$anchor6,{children:($$anchor7,$$slotProps3)=>{
+var fragment_3=root_3$j(),node_3=first_child(fragment_3);component(node_3,()=>Alert_dialog_title,($$anchor8,AlertDialog_Title)=>{AlertDialog_Title($$anchor8,{class:"flex items-center gap-2",children:($$anchor9,$$slotProps4)=>{var fragment_4=root_4$f(),node_4=first_child(fragment_4);{var consequent=$$anchor10=>{{let $0=user_derived(()=>`h-5 w-5 ${get$3(iconClass)}`);Timer_off($$anchor10,{get class(){return get$3($0)}})}},alternate=$$anchor10=>{{let $0=user_derived(()=>`h-5 w-5 ${get$3(iconClass)}`);
+Triangle_alert($$anchor10,{get class(){return get$3($0)}})}};if_block(node_4,$$render=>{get$3(isTimeout)?$$render(consequent):$$render(alternate,-1)})}var text2=sibling(node_4);template_effect(()=>set_text(text2,` ${get$3(title2)??""}`)),append($$anchor9,fragment_4)},$$slots:{default:!0}})});var node_5=sibling(node_3,2);component(node_5,()=>Alert_dialog_description,($$anchor8,AlertDialog_Description)=>{AlertDialog_Description($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();var text_1=text$8();
+template_effect(()=>set_text(text_1,get$3(description2))),append($$anchor9,text_1)},$$slots:{default:!0}})}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var div=sibling(node_2,2),p2=child(div),text_2=child(p2,!0);reset(p2);var node_6=sibling(p2,2);{var consequent_2=$$anchor6=>{var div_1=root_8$d(),p_1=child(div_1),text_3=sibling(child(p_1));reset(p_1);var node_7=sibling(p_1,2);{var consequent_1=$$anchor7=>{var p_2=root_9$9(),text_4=sibling(child(p_2));reset(p_2),template_effect($0=>set_text(
+text_4,` ${$0??""}`),[()=>$$props.contextInfo.n_ctx.toLocaleString()]),append($$anchor7,p_2)};if_block(node_7,$$render=>{$$props.contextInfo.n_ctx&&$$render(consequent_1)})}reset(div_1),template_effect($0=>set_text(text_3,` ${$0??""}`),[()=>$$props.contextInfo.n_prompt_tokens.toLocaleString()]),append($$anchor6,div_1)};if_block(node_6,$$render=>{$$props.contextInfo&&$$render(consequent_2)})}reset(div);var node_8=sibling(div,2);component(node_8,()=>Alert_dialog_footer,($$anchor6,AlertDialog_Footer)=>{
+AlertDialog_Footer($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_8=comment$2(),node_9=first_child(fragment_8);component(node_9,()=>Alert_dialog_action,($$anchor8,AlertDialog_Action)=>{AlertDialog_Action($$anchor8,{onclick:()=>handleOpenChange(!1),children:($$anchor9,$$slotProps4)=>{next$1();var text_5=text$8("Close");append($$anchor9,text_5)},$$slots:{default:!0}})}),append($$anchor7,fragment_8)},$$slots:{default:!0}})}),template_effect(()=>{set_class(div,1,`rounded-lg border px-4 \
+py-3 text-sm ${get$3(badgeClass)}`),set_text(text_2,$$props.message)}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_4$e=from_html("<!> Empty Files Detected",1),root_3$i=from_html("<!> <!>",1),root_6$c=from_html('<li class="font-mono text-sm"> </li>'),root_2$p=from_html('<!> <div class="space-y-3 text-sm"><div class="rounded-lg bg-muted p-3"><div class="mb-2 font-medium">Empty Files:</div> <u\
+l class="list-inside list-disc space-y-1 text-muted-foreground"></ul></div> <div><div class="mb-2 font-medium">What happened:</div> <ul class="list-inside list-disc space-y-1 text-muted-foreground"><li>Empty files cannot be processed or sent to the AI model</li> <li>These files have been automatically removed from your attachments</li> <li>You can try uploading files with content instead</li></ul></div></div> <!>',1);function DialogEmptyFileAlert($$anchor,$$props){push$1($$props,!0);let open2=prop(
+$$props,"open",15);function handleOpenChange(newOpen){open2(newOpen),$$props.onOpenChange?.(newOpen)}var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$1,($$anchor2,AlertDialog_Root)=>{AlertDialog_Root($$anchor2,{get open(){return open2()},onOpenChange:handleOpenChange,children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Alert_dialog_content,($$anchor4,AlertDialog_Content)=>{AlertDialog_Content($$anchor4,{children:($$anchor5,$$slotProps2)=>{
+var fragment_2=root_2$p(),node_2=first_child(fragment_2);component(node_2,()=>Alert_dialog_header,($$anchor6,AlertDialog_Header)=>{AlertDialog_Header($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$i(),node_3=first_child(fragment_3);component(node_3,()=>Alert_dialog_title,($$anchor8,AlertDialog_Title)=>{AlertDialog_Title($$anchor8,{class:"flex items-center gap-2",children:($$anchor9,$$slotProps4)=>{var fragment_4=root_4$e(),node_4=first_child(fragment_4);File_x(node_4,{class:"\
+h-5 w-5 text-destructive"}),next$1(),append($$anchor9,fragment_4)},$$slots:{default:!0}})});var node_5=sibling(node_3,2);component(node_5,()=>Alert_dialog_description,($$anchor8,AlertDialog_Description)=>{AlertDialog_Description($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();var text2=text$8("The following files are empty and have been removed from your attachments:");append($$anchor9,text2)},$$slots:{default:!0}})}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var div=sibling(
+node_2,2),div_1=child(div),ul=sibling(child(div_1),2);each(ul,20,()=>$$props.emptyFiles,fileName=>fileName,($$anchor6,fileName)=>{var li2=root_6$c(),text_1=child(li2,!0);reset(li2),template_effect(()=>set_text(text_1,fileName)),append($$anchor6,li2)}),reset(ul),reset(div_1),next$1(2),reset(div);var node_6=sibling(div,2);component(node_6,()=>Alert_dialog_footer,($$anchor6,AlertDialog_Footer)=>{AlertDialog_Footer($$anchor6,{children:($$anchor7,$$slotProps3)=>{var fragment_5=comment$2(),node_7=first_child(
+fragment_5);component(node_7,()=>Alert_dialog_action,($$anchor8,AlertDialog_Action)=>{AlertDialog_Action($$anchor8,{onclick:()=>handleOpenChange(!1),children:($$anchor9,$$slotProps4)=>{next$1();var text_2=text$8("Got it");append($$anchor9,text_2)},$$slots:{default:!0}})}),append($$anchor7,fragment_5)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_4$d=from_html("<!> <!\
+>",1),root_8$c=from_html('<div class="rounded-md bg-destructive/10 px-3 py-2"><p class="font-mono text-sm break-all text-destructive"> </p> <p class="mt-1 text-xs text-muted-foreground">File type not supported</p></div>'),root_7$b=from_html('<div class="space-y-2"><h4 class="text-sm font-medium text-destructive">Unsupported File Types</h4> <div class="space-y-1"></div></div>'),root_10$5=from_html('<div class="rounded-md bg-destructive/10 px-3 py-2"><p class="font-mono text-sm break-all text-dest\
+ructive"> </p> <p class="mt-1 text-xs text-muted-foreground"> </p></div>'),root_9$8=from_html('<div class="space-y-2"><div class="space-y-1"></div></div>'),root_3$h=from_html('<!> <div class="!max-h-[50vh] min-h-0 flex-1 space-y-4 overflow-y-auto"><!> <!></div> <div class="rounded-md bg-muted/50 p-3"><h4 class="mb-2 text-sm font-medium">This model supports:</h4> <p class="text-sm text-muted-foreground"> </p></div> <!>',1),root_2$o=from_html("<!> <!>",1);function DialogFileUploadError($$anchor,$$props){
push$1($$props,!0);let open2=prop($$props,"open",15);function handleOpenChange(newOpen){open2(newOpen),$$props.onOpenChange?.(newOpen)}var fragment=comment$2(),node2=first_child(fragment);component(node2,()=>Root$1,($$anchor2,AlertDialog_Root)=>{AlertDialog_Root($$anchor2,{get open(){return open2()},onOpenChange:handleOpenChange,children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Portal,($$anchor4,AlertDialog_Portal)=>{AlertDialog_Portal(
$$anchor4,{children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$o(),node_2=first_child(fragment_2);component(node_2,()=>Alert_dialog_overlay,($$anchor6,AlertDialog_Overlay)=>{AlertDialog_Overlay($$anchor6,{})});var node_3=sibling(node_2,2);component(node_3,()=>Alert_dialog_content,($$anchor6,AlertDialog_Content)=>{AlertDialog_Content($$anchor6,{class:"flex max-w-md flex-col",children:($$anchor7,$$slotProps3)=>{var fragment_3=root_3$h(),node_4=first_child(fragment_3);component(node_4,()=>Alert_dialog_header,
($$anchor8,AlertDialog_Header)=>{AlertDialog_Header($$anchor8,{children:($$anchor9,$$slotProps4)=>{var fragment_4=root_4$d(),node_5=first_child(fragment_4);component(node_5,()=>Alert_dialog_title,($$anchor10,AlertDialog_Title)=>{AlertDialog_Title($$anchor10,{children:($$anchor11,$$slotProps5)=>{next$1();var text2=text$8("File Upload Error");append($$anchor11,text2)},$$slots:{default:!0}})});var node_6=sibling(node_5,2);component(node_6,()=>Alert_dialog_description,($$anchor10,AlertDialog_Description)=>{
AlertDialog_Description($$anchor10,{class:"text-sm text-muted-foreground",children:($$anchor11,$$slotProps5)=>{next$1();var text_1=text$8("Some files cannot be uploaded with the current model.");append($$anchor11,text_1)},$$slots:{default:!0}})}),append($$anchor9,fragment_4)},$$slots:{default:!0}})});var div=sibling(node_4,2),node_7=child(div);{var consequent=$$anchor8=>{var div_1=root_7$b(),div_2=sibling(child(div_1),2);each(div_2,21,()=>$$props.fileErrorData.generallyUnsupported,file=>file.name,
($$anchor9,file)=>{var div_3=root_8$c(),p2=child(div_3),text_2=child(p2,!0);reset(p2),next$1(2),reset(div_3),template_effect(()=>set_text(text_2,get$3(file).name)),append($$anchor9,div_3)}),reset(div_2),reset(div_1),append($$anchor8,div_1)};if_block(node_7,$$render=>{$$props.fileErrorData.generallyUnsupported.length>0&&$$render(consequent)})}var node_8=sibling(node_7,2);{var consequent_1=$$anchor8=>{var div_4=root_9$8(),div_5=child(div_4);each(div_5,21,()=>$$props.fileErrorData.modalityUnsupported,
-file=>file.name,($$anchor9,file)=>{var div_6=root_10$6(),p_1=child(div_6),text_3=child(p_1,!0);reset(p_1);var p_2=sibling(p_1,2),text_4=child(p_2,!0);reset(p_2),reset(div_6),template_effect(()=>{set_text(text_3,get$3(file).name),set_text(text_4,$$props.fileErrorData.modalityReasons[get$3(file).name]||"Not supported by current model")}),append($$anchor9,div_6)}),reset(div_5),reset(div_4),append($$anchor8,div_4)};if_block(node_8,$$render=>{$$props.fileErrorData.modalityUnsupported.length>0&&$$render(
+file=>file.name,($$anchor9,file)=>{var div_6=root_10$5(),p_1=child(div_6),text_3=child(p_1,!0);reset(p_1);var p_2=sibling(p_1,2),text_4=child(p_2,!0);reset(p_2),reset(div_6),template_effect(()=>{set_text(text_3,get$3(file).name),set_text(text_4,$$props.fileErrorData.modalityReasons[get$3(file).name]||"Not supported by current model")}),append($$anchor9,div_6)}),reset(div_5),reset(div_4),append($$anchor8,div_4)};if_block(node_8,$$render=>{$$props.fileErrorData.modalityUnsupported.length>0&&$$render(
consequent_1)})}reset(div);var div_7=sibling(div,2),p_3=sibling(child(div_7),2),text_5=child(p_3,!0);reset(p_3),reset(div_7);var node_9=sibling(div_7,2);component(node_9,()=>Alert_dialog_footer,($$anchor8,AlertDialog_Footer)=>{AlertDialog_Footer($$anchor8,{children:($$anchor9,$$slotProps4)=>{var fragment_5=comment$2(),node_10=first_child(fragment_5);component(node_10,()=>Alert_dialog_action,($$anchor10,AlertDialog_Action)=>{AlertDialog_Action($$anchor10,{onclick:()=>handleOpenChange(!1),children:($$anchor11,$$slotProps5)=>{
next$1();var text_6=text$8("Got it");append($$anchor11,text_6)},$$slots:{default:!0}})}),append($$anchor9,fragment_5)},$$slots:{default:!0}})}),template_effect($0=>set_text(text_5,$0),[()=>$$props.fileErrorData.supportedTypes.join(", ")]),append($$anchor7,fragment_3)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_4$c=from_html("<!> Model Not Available",1),root_3$g=from_html(
"<!> <!>",1),root_7$a=from_html('<button type="button" class="group flex w-full items-center justify-between gap-2 rounded-sm px-3 py-2 text-left text-sm transition-colors hover:bg-accent hover:text-accent-foreground"><span class="min-w-0 truncate font-mono text-xs"> </span> <!></button>'),root_6$b=from_html('<div class="text-sm"><p class="mb-2 font-medium text-muted-foreground">Select an available model:</p> <div class="max-h-48 space-y-1 overflow-y-auto rounded-md border p-1"></div></div>'),root_2$n=from_html(
$$anchor15,{class:"align-middle font-medium",children:($$anchor16,$$slotProps6)=>{next$1();var text_27=text$8("Chat Template");append($$anchor16,text_27)},$$slots:{default:!0}})});var node_63=sibling(node_62,2);component(node_63,()=>Table_cell,($$anchor15,Table_Cell_25)=>{Table_Cell_25($$anchor15,{class:"py-10",children:($$anchor16,$$slotProps6)=>{var div_4=root_63(),pre=child(div_4),text_28=child(pre,!0);reset(pre),reset(div_4),template_effect(()=>set_text(text_28,get$3(serverProps2).chat_template)),
append($$anchor16,div_4)},$$slots:{default:!0}})}),append($$anchor14,fragment_42)},$$slots:{default:!0}})}),append($$anchor12,fragment_41)};if_block(node_60,$$render=>{get$3(serverProps2).chat_template&&$$render(consequent_9)})}append($$anchor11,fragment_9)},$$slots:{default:!0}})}),append($$anchor9,fragment_6)},$$slots:{default:!0}})}),append($$anchor7,fragment_5)};if_block(node_6,$$render=>{get$3(serverProps2)&&$$render(consequent_10)})}append($$anchor6,fragment_4)},consequent_12=$$anchor6=>{var div_5=root_64();
append($$anchor6,div_5)};if_block(node_5,$$render=>{get$3(isLoadingModels)||get$3(isLoadingRouterProps)?$$render(consequent):get$3(firstModel)?$$render(consequent_11,1):get$3(isLoadingModels)||$$render(consequent_12,2)})}reset(div),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_5$a=from_html('<span class="text-sm font-normal text-muted-foreground"> </span>'),root_4$a=from_html("<!> <span>MCP R\
-esources</span> <!>",1),root_3$d=from_html("<!> <!>",1),root_8$b=from_html('<p class="mb-4 text-xs text-muted-foreground"> </p>'),root_9$6=from_html('<div class="flex flex-1 items-center justify-center"><!></div>'),root_10$5=from_html('<div class="flex flex-1 flex-col items-center justify-center gap-2 text-red-500"><span class="text-sm"> </span> <!></div>'),root_7$9=from_html('<div class="flex h-full flex-col"><div class="mb-3 flex items-center gap-2"><!> <span class="text-sm font-medium"> </spa\
+esources</span> <!>",1),root_3$d=from_html("<!> <!>",1),root_8$b=from_html('<p class="mb-4 text-xs text-muted-foreground"> </p>'),root_9$6=from_html('<div class="flex flex-1 items-center justify-center"><!></div>'),root_10$4=from_html('<div class="flex flex-1 flex-col items-center justify-center gap-2 text-red-500"><span class="text-sm"> </span> <!></div>'),root_7$9=from_html('<div class="flex h-full flex-col"><div class="mb-3 flex items-center gap-2"><!> <span class="text-sm font-medium"> </spa\
n></div> <!> <div class="mb-4 rounded-md border border-border/50 bg-muted/30 px-3 py-2"><p class="font-mono text-xs break-all text-muted-foreground"> </p></div> <!></div>'),root_15$3=from_html('<div class="flex flex-col gap-10"></div>'),root_18$2=from_html('<div class="flex h-full items-center justify-center text-sm text-muted-foreground">Select a resource to preview</div>'),root_22=from_html("<!> Attach Resource",1),root_26=from_html("<!> ",1),root_19$3=from_html("<!> <!>",1),root_2$k=from_html(
'<!> <div class="flex h-[500px] min-w-0"><div class="w-72 shrink-0 overflow-y-auto border-r border-border/30 p-4"><!></div> <div class="min-w-0 flex-1 overflow-auto p-4"><!></div></div> <!>',1);function DialogMcpResourcesBrowser($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15,!1),selectedResources=new SvelteSet,lastSelectedUri=state$1(null),isAttaching=state$1(!1),selectedTemplate=state$1(null),templatePreviewUri=state$1(null),templatePreviewContent=state$1(null),templatePreviewLoading=state$1(
!1),templatePreviewError=state$1(null);const totalCount=user_derived(mcpTotalResourceCount);user_effect(()=>{open2()&&(loadResources(),$$props.preSelectedUri&&(selectedResources.clear(),selectedResources.add($$props.preSelectedUri),set$1(lastSelectedUri,$$props.preSelectedUri,!0)))});async function loadResources(){const perChatOverrides=conversationsStore.getAllMcpServerOverrides();await mcpStore.ensureInitialized(perChatOverrides)&&await mcpStore.fetchAllResources()}function handleOpenChange(newOpen){
fragment_4)},$$slots:{default:!0}})});var node_6=sibling(node_3,2);component(node_6,()=>Dialog_description,($$anchor8,Dialog_Description)=>{Dialog_Description($$anchor8,{children:($$anchor9,$$slotProps4)=>{next$1();var text_1=text$8("Browse and attach resources from connected MCP servers to your chat context.");append($$anchor9,text_1)},$$slots:{default:!0}})}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var div=sibling(node_2,2),div_1=child(div),node_7=child(div_1);McpResourcesBrowser(
node_7,{onSelect:handleResourceSelect,onToggle:handleResourceToggle,onTemplateSelect:handleTemplateSelect,get selectedUris(){return selectedResources},get selectedTemplateUri(){return get$3(selectedTemplateUri)},get expandToUri(){return $$props.preSelectedUri}}),reset(div_1);var div_2=sibling(div_1,2),node_8=child(div_2);{var consequent_4=$$anchor6=>{var div_3=root_7$9(),div_4=child(div_3),node_9=child(div_4);Braces(node_9,{class:"h-4 w-4 text-muted-foreground"});var span_1=sibling(node_9,2),text_2=child(
span_1,!0);reset(span_1),reset(div_4);var node_10=sibling(div_4,2);{var consequent_1=$$anchor7=>{var p2=root_8$b(),text_3=child(p2,!0);reset(p2),template_effect(()=>set_text(text_3,get$3(selectedTemplate).description)),append($$anchor7,p2)};if_block(node_10,$$render=>{get$3(selectedTemplate).description&&$$render(consequent_1)})}var div_5=sibling(node_10,2),p_1=child(div_5),text_4=child(p_1,!0);reset(p_1),reset(div_5);var node_11=sibling(div_5,2);{var consequent_2=$$anchor7=>{var div_6=root_9$6(),
-node_12=child(div_6);Loader_circle(node_12,{class:"h-6 w-6 animate-spin text-muted-foreground"}),reset(div_6),append($$anchor7,div_6)},consequent_3=$$anchor7=>{var div_7=root_10$5(),span_2=child(div_7),text_5=child(span_2,!0);reset(span_2);var node_13=sibling(span_2,2);Button(node_13,{size:"sm",variant:"outline",onclick:()=>{set$1(templatePreviewError,null)},children:($$anchor8,$$slotProps3)=>{next$1();var text_6=text$8("Try again");append($$anchor8,text_6)},$$slots:{default:!0}}),reset(div_7),template_effect(
+node_12=child(div_6);Loader_circle(node_12,{class:"h-6 w-6 animate-spin text-muted-foreground"}),reset(div_6),append($$anchor7,div_6)},consequent_3=$$anchor7=>{var div_7=root_10$4(),span_2=child(div_7),text_5=child(span_2,!0);reset(span_2);var node_13=sibling(span_2,2);Button(node_13,{size:"sm",variant:"outline",onclick:()=>{set$1(templatePreviewError,null)},children:($$anchor8,$$slotProps3)=>{next$1();var text_6=text$8("Try again");append($$anchor8,text_6)},$$slots:{default:!0}}),reset(div_7),template_effect(
()=>set_text(text_5,get$3(templatePreviewError))),append($$anchor7,div_7)},alternate=$$anchor7=>{McpResourceTemplateForm($$anchor7,{get template(){return get$3(selectedTemplate)},onResolve:handleTemplateResolve,onCancel:handleTemplateCancelForm})};if_block(node_11,$$render=>{get$3(templatePreviewLoading)?$$render(consequent_2):get$3(templatePreviewError)?$$render(consequent_3,1):$$render(alternate,-1)})}reset(div_3),template_effect(()=>{set_text(text_2,get$3(selectedTemplate).title||get$3(selectedTemplate).
name),set_text(text_4,get$3(selectedTemplate).uriTemplate)}),append($$anchor6,div_3)},consequent_5=$$anchor6=>{{let $0=user_derived(()=>({uri:get$3(templatePreviewUri)??"",name:get$3(templatePreviewUri)?.split("/").pop()||(get$3(templatePreviewUri)??""),serverName:get$3(selectedTemplate)?.serverName||""}));McpResourcePreview($$anchor6,{get resource(){return get$3($0)},get preloadedContent(){return get$3(templatePreviewContent)}})}},consequent_6=$$anchor6=>{const allResources=user_derived(getAllResourcesFlatInTreeOrder),
selectedResource=user_derived(()=>get$3(allResources).find(r2=>selectedResources.has(r2.uri)));{let $0=user_derived(()=>get$3(selectedResource)??null);McpResourcePreview($$anchor6,{get resource(){return get$3($0)}})}},consequent_8=$$anchor6=>{var div_8=root_15$3();each(div_8,21,getAllResourcesFlatInTreeOrder,resource=>resource.uri,($$anchor7,resource)=>{var fragment_8=comment$2(),node_14=first_child(fragment_8);{var consequent_7=$$anchor8=>{McpResourcePreview($$anchor8,{get resource(){return get$3(
$$render(alternate_2,-1)})}next$1(),append($$anchor9,fragment_12)},$$slots:{default:!0}})},alternate_4=$$anchor8=>{{let $0=user_derived(()=>selectedResources.size===0||get$3(isAttaching));Button($$anchor8,{onclick:handleAttach,get disabled(){return get$3($0)},children:($$anchor9,$$slotProps4)=>{var fragment_16=root_26(),node_19=first_child(fragment_16);{var consequent_11=$$anchor10=>{Loader_circle($$anchor10,{class:"mr-2 h-4 w-4 animate-spin"})},alternate_3=$$anchor10=>{Plus($$anchor10,{class:"m\
r-2 h-4 w-4"})};if_block(node_19,$$render=>{get$3(isAttaching)?$$render(consequent_11):$$render(alternate_3,-1)})}var text_8=sibling(node_19);template_effect(()=>set_text(text_8,` Attach ${selectedResources.size>0?`(${selectedResources.size})`:"Resource"}`)),append($$anchor9,fragment_16)},$$slots:{default:!0}})}};if_block(node_17,$$render=>{get$3(hasTemplateResult)?$$render(consequent_10):$$render(alternate_4,-1)})}append($$anchor7,fragment_10)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},
$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_7$8=from_html('<img alt="" class="h-3 w-3 shrink-0 rounded-sm"/>'),root_6$9=from_html('<span class="flex items-center gap-1 text-xs text-muted-foreground">· <!> </span>'),root_8$a=from_html('<span class="rounded bg-muted px-1.5 py-0.5 text-xs"> </span>'),root_5$9=from_html('<div class="flex items-center gap-2"><span class="text-xs text-muted-foreground"> </span> <!> <!></div>'),
-root_3$c=from_html("<!> <!>",1),root_10$4=from_html('<div class="flex items-center justify-center"><img class="max-h-[70vh] max-w-full rounded object-contain"/></div>'),root_12$3=from_html('<pre class="max-h-[70vh] overflow-auto rounded-md border bg-muted/30 p-4 font-mono text-sm break-words whitespace-pre-wrap"> </pre>'),root_13$2=from_html('<div class="py-8 text-center text-sm text-muted-foreground">No content available</div>'),root_2$j=from_html('<!> <div class="flex items-center justify-end \
+root_3$c=from_html("<!> <!>",1),root_10$3=from_html('<div class="flex items-center justify-center"><img class="max-h-[70vh] max-w-full rounded object-contain"/></div>'),root_12$3=from_html('<pre class="max-h-[70vh] overflow-auto rounded-md border bg-muted/30 p-4 font-mono text-sm break-words whitespace-pre-wrap"> </pre>'),root_13$2=from_html('<div class="py-8 text-center text-sm text-muted-foreground">No content available</div>'),root_2$j=from_html('<!> <div class="flex items-center justify-end \
gap-1"><!> <!></div> <div class="overflow-auto"><!></div>',1);function DialogMcpResourcePreview($$anchor,$$props){push$1($$props,!0);let open2=prop($$props,"open",15);const serverName=user_derived(()=>mcpStore.getServerDisplayName($$props.extra.serverName)),favicon=user_derived(()=>mcpStore.getServerFavicon($$props.extra.serverName));function getLanguage(){if($$props.extra.mimeType?.includes(MimeTypeIncludes.JSON))return MimeTypeIncludes.JSON;if($$props.extra.mimeType?.includes(MimeTypeIncludes.
JAVASCRIPT))return MimeTypeIncludes.JAVASCRIPT;if($$props.extra.mimeType?.includes(MimeTypeIncludes.TYPESCRIPT))return MimeTypeIncludes.TYPESCRIPT;const name=$$props.extra.name||$$props.extra.uri||"";return getLanguageFromFilename(name)||"plaintext"}function handleDownload(){$$props.extra.content&&downloadResourceContent($$props.extra.content,$$props.extra.mimeType||MimeTypeText.PLAIN,$$props.extra.name||DEFAULT_RESOURCE_FILENAME)}var fragment=comment$2(),node2=first_child(fragment);component(node2,
()=>Root$2,($$anchor2,Dialog_Root)=>{Dialog_Root($$anchor2,{get onOpenChange(){return $$props.onOpenChange},get open(){return open2()},set open($$value){open2($$value)},children:($$anchor3,$$slotProps)=>{var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Dialog_content,($$anchor4,Dialog_Content)=>{Dialog_Content($$anchor4,{class:"grid max-h-[90vh] max-w-5xl overflow-hidden sm:w-auto sm:max-w-6xl",children:($$anchor5,$$slotProps2)=>{var fragment_2=root_2$j(),node_2=first_child(
node_4,()=>Dialog_description,($$anchor8,Dialog_Description)=>{Dialog_Description($$anchor8,{children:($$anchor9,$$slotProps4)=>{var div=root_5$9(),span=child(div),text_1=child(span,!0);reset(span);var node_5=sibling(span,2);{var consequent_1=$$anchor10=>{var span_1=root_6$9(),node_6=sibling(child(span_1));{var consequent=$$anchor11=>{var img=root_7$8();template_effect(()=>set_attribute(img,"src",get$3(favicon))),event("error",img,e=>{e.currentTarget.style.display="none"}),replay_events(img),append(
$$anchor11,img)};if_block(node_6,$$render=>{get$3(favicon)&&$$render(consequent)})}var text_2=sibling(node_6);reset(span_1),template_effect(()=>set_text(text_2,` ${get$3(serverName)??""}`)),append($$anchor10,span_1)};if_block(node_5,$$render=>{get$3(serverName)&&$$render(consequent_1)})}var node_7=sibling(node_5,2);{var consequent_2=$$anchor10=>{var span_2=root_8$a(),text_3=child(span_2,!0);reset(span_2),template_effect(()=>set_text(text_3,$$props.extra.mimeType)),append($$anchor10,span_2)};if_block(
node_7,$$render=>{$$props.extra.mimeType&&$$render(consequent_2)})}reset(div),template_effect(()=>set_text(text_1,$$props.extra.uri)),append($$anchor9,div)},$$slots:{default:!0}})}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var div_1=sibling(node_2,2),node_8=child(div_1);{let $0=user_derived(()=>!!$$props.extra.content);ActionIconCopyToClipboard(node_8,{get text(){return $$props.extra.content},get canCopy(){return get$3($0)},ariaLabel:"Copy content"})}var node_9=sibling(node_8,2);{let $0=user_derived(
-()=>!$$props.extra.content);Button(node_9,{variant:"ghost",size:"sm",class:"h-7 w-7 p-0",onclick:handleDownload,get disabled(){return get$3($0)},title:"Download content",children:($$anchor6,$$slotProps3)=>{Download($$anchor6,{class:"h-3.5 w-3.5"})},$$slots:{default:!0}})}reset(div_1);var div_2=sibling(div_1,2),node_10=child(div_2);{var consequent_3=$$anchor6=>{var div_3=root_10$4(),img_1=child(div_3);reset(div_3),template_effect($0=>{set_attribute(img_1,"src",$0),set_attribute(img_1,"alt",$$props.
+()=>!$$props.extra.content);Button(node_9,{variant:"ghost",size:"sm",class:"h-7 w-7 p-0",onclick:handleDownload,get disabled(){return get$3($0)},title:"Download content",children:($$anchor6,$$slotProps3)=>{Download($$anchor6,{class:"h-3.5 w-3.5"})},$$slots:{default:!0}})}reset(div_1);var div_2=sibling(div_1,2),node_10=child(div_2);{var consequent_3=$$anchor6=>{var div_3=root_10$3(),img_1=child(div_3);reset(div_3),template_effect($0=>{set_attribute(img_1,"src",$0),set_attribute(img_1,"alt",$$props.
extra.name)},[()=>$$props.extra.content.startsWith("data:")?$$props.extra.content:`data:${$$props.extra.mimeType||"image/png"};base64,${$$props.extra.content}`]),append($$anchor6,div_3)},d2=user_derived(()=>isImageResource($$props.extra.mimeType,$$props.extra.uri)&&$$props.extra.content),consequent_4=$$anchor6=>{{let $0=user_derived(getLanguage);SyntaxHighlightedCode($$anchor6,{get code(){return $$props.extra.content},get language(){return get$3($0)},maxHeight:"70vh"})}},d_12=user_derived(()=>isCodeResource(
$$props.extra.mimeType,$$props.extra.uri)&&$$props.extra.content),consequent_5=$$anchor6=>{var pre=root_12$3(),text_4=child(pre,!0);reset(pre),template_effect(()=>set_text(text_4,$$props.extra.content)),append($$anchor6,pre)},alternate=$$anchor6=>{var div_4=root_13$2();append($$anchor6,div_4)};if_block(node_10,$$render=>{get$3(d2)?$$render(consequent_3):get$3(d_12)?$$render(consequent_4,1):$$props.extra.content?$$render(consequent_5,2):$$render(alternate,-1)})}reset(div_2),append($$anchor5,fragment_2)},
$$slots:{default:!0}})}),append($$anchor3,fragment_1)},$$slots:{default:!0}})}),append($$anchor,fragment),pop()}var root_1$e=from_html("<!> Reset to default",1),root_5$8=from_html("<!> <!>",1),root_8$9=from_html("<!> <!>",1),root_4$9=from_html("<!> <!>",1),root$q=from_html('<div class="sticky bottom-0 mx-auto mt-4 flex w-full justify-between p-6"><div class="flex gap-2"><!></div> <!></div> <!>',1);function SettingsChatFooter($$anchor,$$props){push$1($$props,!0);let showResetDialog=state$1(!1);function handleResetClick(){
append($$anchor4,p_3)};if_block(node_31,$$render=>{(get$3(field).help||SETTING_CONFIG_INFO[get$3(field).key])&&$$render(consequent_15)})}append($$anchor3,fragment_8)},consequent_19=$$anchor3=>{var div_8=root_28(),node_32=child(div_8);{let $0=user_derived(()=>!!$$props.localConfig[get$3(field).key]);Checkbox(node_32,{get id(){return get$3(field).key},get checked(){return get$3($0)},onCheckedChange:checked=>$$props.onConfigChange(get$3(field).key,checked),class:"mt-1"})}var div_9=sibling(node_32,2),
label=child(div_9),text_8=child(label),node_33=sibling(text_8);{var consequent_17=$$anchor4=>{Flask_conical($$anchor4,{class:"h-3.5 w-3.5 text-muted-foreground"})};if_block(node_33,$$render=>{get$3(field).isExperimental&&$$render(consequent_17)})}reset(label);var node_34=sibling(label,2);{var consequent_18=$$anchor4=>{var p_4=root_30(),text_9=child(p_4,!0);reset(p_4),template_effect(()=>set_text(text_9,get$3(field).help||SETTING_CONFIG_INFO[get$3(field).key])),append($$anchor4,p_4)};if_block(node_34,
$$render=>{(get$3(field).help||SETTING_CONFIG_INFO[get$3(field).key])&&$$render(consequent_18)})}reset(div_9),reset(div_8),template_effect(()=>{set_attribute(label,"for",get$3(field).key),set_text(text_8,`${get$3(field).label??""} `)}),append($$anchor3,div_8)};if_block(node_1,$$render=>{get$3(field).type===SettingsFieldType.INPUT?$$render(consequent_4):get$3(field).type===SettingsFieldType.TEXTAREA?$$render(consequent_8,1):get$3(field).type===SettingsFieldType.SELECT?$$render(consequent_16,2):get$3(
-field).type===SettingsFieldType.CHECKBOX&&$$render(consequent_19,3)})}reset(div),append($$anchor2,div)}),append($$anchor,fragment),pop()}delegate(["click"]);var root_1$9=from_html('<div class="py-8 text-center text-sm text-muted-foreground">No tools available</div>'),root_8$7=from_html('<img alt="" class="h-4 w-4 shrink-0 rounded-sm"/>'),root_5$7=from_html('<!> <span class="inline-flex min-w-0 items-center gap-1.5 font-medium"><!> <span class="truncate"> </span></span> <span class="ml-auto shrin\
-k-0 text-xs text-muted-foreground"> </span>',1),root_10$3=from_html('<div class="flex items-center gap-2 rounded px-2 py-1.5 text-sm hover:bg-muted/50"><!> <div class="flex w-16 shrink-0 justify-center"><!></div> <div class="flex w-20 shrink-0 justify-center"><!></div></div>'),root_9$4=from_html('<div class="ml-4 border-l border-border/50 pl-2"><div class="flex items-center gap-2 px-2 py-1 text-xs text-muted-foreground"><span class="min-w-0 flex-1">Tool</span> <span class="w-16 shrink-0 text-cen\
-ter">Enabled</span> <span class="w-20 shrink-0 text-center">Always allow</span></div> <!></div>'),root_4$8=from_html("<!> <!>",1),root_2$g=from_html('<div class="space-y-2"></div>');function SettingsChatToolsTab($$anchor,$$props){push$1($$props,!0);let expandedGroups=new SvelteSet,groups=user_derived(()=>toolsStore.toolGroups);function getFavicon(group){if(group.source!==ToolSource.MCP)return null;for(const server of mcpStore.getServersSorted())if(mcpStore.getServerLabel(server)===group.label)return mcpStore.
-getServerFavicon(server.id);return null}function toggleExpanded(label){expandedGroups.has(label)?expandedGroups.delete(label):expandedGroups.add(label)}var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var div=root_1$9();append($$anchor2,div)},alternate_1=$$anchor2=>{var div_1=root_2$g();each(div_1,21,()=>get$3(groups),group=>group.label,($$anchor3,group)=>{const isExpanded=user_derived(()=>expandedGroups.has(get$3(group).label)),favicon=user_derived(()=>getFavicon(
-get$3(group)));var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Collapsible,($$anchor4,Collapsible_Root)=>{Collapsible_Root($$anchor4,{get open(){return get$3(isExpanded)},onOpenChange:()=>toggleExpanded(get$3(group).label),children:($$anchor5,$$slotProps)=>{var fragment_2=root_4$8(),node_2=first_child(fragment_2);component(node_2,()=>Collapsible_trigger,($$anchor6,Collapsible_Trigger)=>{Collapsible_Trigger($$anchor6,{class:"flex w-full items-center gap-2 rounded-lg\
- px-3 py-2 text-sm hover:bg-muted/50",children:($$anchor7,$$slotProps2)=>{var fragment_3=root_5$7(),node_3=first_child(fragment_3);{var consequent_1=$$anchor8=>{Chevron_down($$anchor8,{class:"h-3.5 w-3.5 shrink-0"})},alternate=$$anchor8=>{Chevron_right($$anchor8,{class:"h-3.5 w-3.5 shrink-0"})};if_block(node_3,$$render=>{get$3(isExpanded)?$$render(consequent_1):$$render(alternate,-1)})}var span=sibling(node_3,2),node_4=child(span);{var consequent_2=$$anchor8=>{var img=root_8$7();template_effect(
-()=>set_attribute(img,"src",get$3(favicon))),event("error",img,e=>{e.currentTarget.style.display="none"}),replay_events(img),append($$anchor8,img)};if_block(node_4,$$render=>{get$3(favicon)&&$$render(consequent_2)})}var span_1=sibling(node_4,2),text2=child(span_1,!0);reset(span_1),reset(span);var span_2=sibling(span,2),text_1=child(span_2);reset(span_2),template_effect(()=>{set_text(text2,get$3(group).label),set_text(text_1,`${get$3(group).tools.length??""} tool${get$3(group).tools.length!==1?"s":
-""}`)}),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var node_5=sibling(node_2,2);component(node_5,()=>Collapsible_content,($$anchor6,Collapsible_Content)=>{Collapsible_Content($$anchor6,{children:($$anchor7,$$slotProps2)=>{var div_2=root_9$4(),node_6=sibling(child(div_2),2);each(node_6,17,()=>get$3(group).tools,tool=>tool.function.name,($$anchor8,tool)=>{const toolName=user_derived(()=>get$3(tool).function.name),isEnabled=user_derived(()=>toolsStore.isToolEnabled(get$3(toolName))),permissionKey=user_derived(
-()=>toolsStore.getPermissionKey(get$3(toolName))),isAlwaysAllowed=user_derived(()=>get$3(permissionKey)?permissionsStore.hasTool(get$3(permissionKey)):!1);var div_3=root_10$3(),node_7=child(div_3);TruncatedText(node_7,{get text(){return get$3(toolName)},class:"min-w-0 flex-1 truncate",showTooltip:!0});var div_4=sibling(node_7,2),node_8=child(div_4);Checkbox(node_8,{get checked(){return get$3(isEnabled)},onCheckedChange:()=>toolsStore.toggleTool(get$3(toolName)),class:"h-4 w-4"}),reset(div_4);var div_5=sibling(
-div_4,2),node_9=child(div_5);Checkbox(node_9,{get checked(){return get$3(isAlwaysAllowed)},onCheckedChange:()=>{get$3(isAlwaysAllowed)?permissionsStore.revokeTool(get$3(permissionKey)):permissionsStore.allowTool(get$3(permissionKey))},class:"h-4 w-4"}),reset(div_5),reset(div_3),append($$anchor8,div_3)}),reset(div_2),append($$anchor7,div_2)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)}),reset(div_1),append($$anchor2,div_1)};if_block(
-node2,$$render=>{get$3(groups).length===0?$$render(consequent):$$render(alternate_1,-1)})}append($$anchor,fragment),pop()}const summaryList=($$anchor,show=noop$3,verb=noop$3,items2=noop$3)=>{var fragment=comment$2(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{var div=root_2$f(),h5=child(div),text_1=child(h5);reset(h5);var ul=sibling(h5,2),node_1=child(ul);each(node_1,17,()=>items2().slice(0,10),conv=>conv.id,($$anchor3,conv)=>{var li2=root_3$a(),text_2=child(li2);reset(li2),template_effect(
-()=>set_text(text_2,`• ${(get$3(conv).name||"Untitled conversation")??""}`)),append($$anchor3,li2)});var node_2=sibling(node_1,2);{var consequent=$$anchor3=>{var li_1=root_4$7(),text_3=child(li_1);reset(li_1),template_effect(()=>set_text(text_3,`... and ${items2().length-10} more`)),append($$anchor3,li_1)};if_block(node_2,$$render=>{items2().length>10&&$$render(consequent)})}reset(ul),reset(div),template_effect(()=>set_text(text_1,`${verb()??""}
+field).type===SettingsFieldType.CHECKBOX&&$$render(consequent_19,3)})}reset(div),append($$anchor2,div)}),append($$anchor,fragment),pop()}delegate(["click"]);var root_1$9=from_html('<div class="py-8 text-center text-sm text-muted-foreground">No tools available</div>'),root_5$7=from_html('<!> <span class="inline-flex min-w-0 items-center gap-1.5 font-medium"><!></span> <span class="ml-auto shrink-0 text-xs text-muted-foreground"> </span>',1),root_9$4=from_html('<div class="flex items-center gap-2 \
+rounded px-2 py-1.5 text-sm hover:bg-muted/50"><!> <div class="flex w-16 shrink-0 justify-center"><!></div> <div class="flex w-20 shrink-0 justify-center"><!></div></div>'),root_8$7=from_html('<div class="ml-4 border-l border-border/50 pl-2"><div class="flex items-center gap-2 px-2 py-1 text-xs text-muted-foreground"><span class="min-w-0 flex-1">Tool</span> <span class="w-16 shrink-0 text-center">Enabled</span> <span class="w-20 shrink-0 text-center">Always allow</span></div> <!></div>'),root_4$8=from_html(
+"<!> <!>",1),root_2$g=from_html('<div class="space-y-2"></div>');function SettingsChatToolsTab($$anchor,$$props){push$1($$props,!0);let expandedGroups=new SvelteSet,groups=user_derived(()=>toolsStore.toolGroups);function toggleExpanded(label){expandedGroups.has(label)?expandedGroups.delete(label):expandedGroups.add(label)}var fragment=comment$2(),node2=first_child(fragment);{var consequent=$$anchor2=>{var div=root_1$9();append($$anchor2,div)},alternate_1=$$anchor2=>{var div_1=root_2$g();each(div_1,
+21,()=>get$3(groups),group=>group.label,($$anchor3,group)=>{const isExpanded=user_derived(()=>expandedGroups.has(get$3(group).label));var fragment_1=comment$2(),node_1=first_child(fragment_1);component(node_1,()=>Collapsible,($$anchor4,Collapsible_Root)=>{Collapsible_Root($$anchor4,{get open(){return get$3(isExpanded)},onOpenChange:()=>toggleExpanded(get$3(group).label),children:($$anchor5,$$slotProps)=>{var fragment_2=root_4$8(),node_2=first_child(fragment_2);component(node_2,()=>Collapsible_trigger,
+($$anchor6,Collapsible_Trigger)=>{Collapsible_Trigger($$anchor6,{class:"flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm hover:bg-muted/50",children:($$anchor7,$$slotProps2)=>{const faviconUrl=user_derived(()=>get$3(group).serverId?mcpStore.getServerFavicon(get$3(group).serverId):null);var fragment_3=root_5$7(),node_3=first_child(fragment_3);{var consequent_1=$$anchor8=>{Chevron_down($$anchor8,{class:"h-3.5 w-3.5 shrink-0"})},alternate=$$anchor8=>{Chevron_right($$anchor8,{class:"h-3.5\
+ w-3.5 shrink-0"})};if_block(node_3,$$render=>{get$3(isExpanded)?$$render(consequent_1):$$render(alternate,-1)})}var span=sibling(node_3,2),node_4=child(span);McpServerIdentity(node_4,{iconClass:"h-4 w-4",iconRounded:"rounded-sm",showVersion:!1,get displayName(){return get$3(group).label},get faviconUrl(){return get$3(faviconUrl)}}),reset(span);var span_1=sibling(span,2),text2=child(span_1);reset(span_1),template_effect(()=>set_text(text2,`${get$3(group).tools.length??""} tool${get$3(group).tools.
+length!==1?"s":""}`)),append($$anchor7,fragment_3)},$$slots:{default:!0}})});var node_5=sibling(node_2,2);component(node_5,()=>Collapsible_content,($$anchor6,Collapsible_Content)=>{Collapsible_Content($$anchor6,{children:($$anchor7,$$slotProps2)=>{var div_2=root_8$7(),node_6=sibling(child(div_2),2);each(node_6,17,()=>get$3(group).tools,tool=>tool.function.name,($$anchor8,tool)=>{const toolName=user_derived(()=>get$3(tool).function.name),isEnabled=user_derived(()=>toolsStore.isToolEnabled(get$3(toolName))),
+permissionKey=user_derived(()=>toolsStore.getPermissionKey(get$3(toolName))),isAlwaysAllowed=user_derived(()=>get$3(permissionKey)?permissionsStore.hasTool(get$3(permissionKey)):!1);var div_3=root_9$4(),node_7=child(div_3);TruncatedText(node_7,{get text(){return get$3(toolName)},class:"flex-1",showTooltip:!0});var div_4=sibling(node_7,2),node_8=child(div_4);Checkbox(node_8,{get checked(){return get$3(isEnabled)},onCheckedChange:()=>toolsStore.toggleTool(get$3(toolName)),class:"h-4 w-4"}),reset(div_4);
+var div_5=sibling(div_4,2),node_9=child(div_5);Checkbox(node_9,{get checked(){return get$3(isAlwaysAllowed)},onCheckedChange:()=>{get$3(isAlwaysAllowed)?permissionsStore.revokeTool(get$3(permissionKey)):permissionsStore.allowTool(get$3(permissionKey))},class:"h-4 w-4"}),reset(div_5),reset(div_3),append($$anchor8,div_3)}),reset(div_2),append($$anchor7,div_2)},$$slots:{default:!0}})}),append($$anchor5,fragment_2)},$$slots:{default:!0}})}),append($$anchor3,fragment_1)}),reset(div_1),append($$anchor2,
+div_1)};if_block(node2,$$render=>{get$3(groups).length===0?$$render(consequent):$$render(alternate_1,-1)})}append($$anchor,fragment),pop()}const summaryList=($$anchor,show=noop$3,verb=noop$3,items2=noop$3)=>{var fragment=comment$2(),node2=first_child(fragment);{var consequent_1=$$anchor2=>{var div=root_2$f(),h5=child(div),text_1=child(h5);reset(h5);var ul=sibling(h5,2),node_1=child(ul);each(node_1,17,()=>items2().slice(0,10),conv=>conv.id,($$anchor3,conv)=>{var li2=root_3$a(),text_2=child(li2);reset(
+li2),template_effect(()=>set_text(text_2,`• ${(get$3(conv).name||"Untitled conversation")??""}`)),append($$anchor3,li2)});var node_2=sibling(node_1,2);{var consequent=$$anchor3=>{var li_1=root_4$7(),text_3=child(li_1);reset(li_1),template_effect(()=>set_text(text_3,`... and ${items2().length-10} more`)),append($$anchor3,li_1)};if_block(node_2,$$render=>{items2().length>10&&$$render(consequent)})}reset(ul),reset(div),template_effect(()=>set_text(text_1,`${verb()??""}
${items2().length??""} conversation${items2().length===1?"":"s"}`)),append($$anchor2,div)};if_block(node2,$$render=>{show()&&items2().length>0&&$$render(consequent_1)})}append($$anchor,fragment)},section=($$anchor,title2=noop$3,description2=noop$3,IconComponent=noop$3,buttonText=noop$3,onclick=noop$3,opts=noop$3)=>{const buttonClass=user_derived(()=>opts()?.buttonClass??"justify-start justify-self-start md:w-auto"),buttonVariant=user_derived(()=>opts()?.buttonVariant??"outline");var div_1=root_5$6(),
h4=child(div_1),text_4=child(h4,!0);reset(h4);var p2=sibling(h4,2),text_5=child(p2,!0);reset(p2);var node_3=sibling(p2,2);Button(node_3,{get class(){return get$3(buttonClass)},get onclick(){return onclick()},get variant(){return get$3(buttonVariant)},children:($$anchor2,$$slotProps)=>{var fragment_1=root_6$7(),node_4=first_child(fragment_1);component(node_4,IconComponent,($$anchor3,IconComponent_1)=>{IconComponent_1($$anchor3,{class:"mr-2 h-4 w-4"})});var text_6=sibling(node_4);template_effect(()=>set_text(
text_6,` ${buttonText()??""}`)),append($$anchor2,fragment_1)},$$slots:{default:!0}});var node_5=sibling(node_3,2);{var consequent_2=$$anchor2=>{summaryList($$anchor2,()=>opts().summary.show,()=>opts().summary.verb,()=>opts().summary.items)};if_block(node_5,$$render=>{opts()?.summary&&$$render(consequent_2)})}reset(div_1),template_effect(()=>{set_class(div_1,1,`grid gap-1 ${opts()?.wrapperClass??""??""}`),set_class(h4,1,`mt-0 mb-2 text-sm font-medium ${opts()?.titleClass??""??""}`),set_text(text_4,
get currentModel(){return currentModel()},get activeId(){return ms.activeId},sectionHeaderClass:"px-2 py-2 text-xs font-semibold text-muted-foreground/60 select-none",orgHeaderClass:"px-2 py-2 text-xs font-semibold text-muted-foreground/60 select-none [&:not(:first-child)]:mt-2",get onSelect(){return ms.handleSelect},get onInfoClick(){return ms.handleInfoClick}}),reset(div_4),reset(div_2),append($$anchor7,fragment_7)},$$slots:{default:!0}})}),append($$anchor5,fragment_6)},$$slots:{default:!0}})}),
template_effect(()=>{set_class(button,1,clsx(["inline-grid cursor-pointer grid-cols-[1fr_auto_1fr] items-center gap-1.5 rounded-sm bg-background px-1.5 py-1 text-xs shadow-sm transition hover:bg-muted-foreground/20 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60 dark:bg-muted-foreground/15 dark:text-secondary-foreground",ms.isCurrentModelInCache?(forceForegroundText()||ms.isHighlightedCurrentModelActive,"\
text-foreground"):"bg-red-400/10 !text-red-400 hover:bg-red-400/20 hover:text-red-400",get$3(sheetOpen)&&"text-foreground"])),button.disabled=disabled()||ms.updating}),delegated("click",button,()=>ms.handleOpenChange(!0)),append($$anchor3,fragment_2)},alternate_2=$$anchor3=>{var button_2=root_16(),node_15=child(button_2);Package(node_15,{class:"h-3.5 w-3.5"});var node_16=sibling(node_15,2);{let $0=user_derived(()=>get$3(selectedOption)?.model||"");TruncatedText(node_16,{get text(){return get$3($0)},
-class:"min-w-0 font-medium"})}var node_17=sibling(node_16,2);{var consequent_7=$$anchor4=>{Loader_circle($$anchor4,{class:"h-3 w-3.5 animate-spin"})};if_block(node_17,$$render=>{ms.updating&&$$render(consequent_7)})}reset(button_2),template_effect(()=>{set_class(button_2,1,clsx(["inline-flex cursor-pointer items-center gap-1.5 rounded-sm bg-background px-1.5 py-1 text-xs shadow-sm transition hover:bg-muted-foreground/20 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visibl\
-e:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60 dark:bg-muted-foreground/15 dark:text-secondary-foreground",ms.isCurrentModelInCache?(forceForegroundText()||ms.isHighlightedCurrentModelActive,"text-foreground"):"bg-red-400/10 !text-red-400 hover:bg-red-400/20 hover:text-red-400"])),button_2.disabled=disabled()||ms.updating}),delegated("click",button_2,()=>ms.handleOpenChange(!0)),append($$anchor3,button_2)};if_block(node_2,$$render=>{ms.isRouter?$$render(consequent_6):$$render(alternate_2,
+class:"font-medium"})}var node_17=sibling(node_16,2);{var consequent_7=$$anchor4=>{Loader_circle($$anchor4,{class:"h-3 w-3.5 animate-spin"})};if_block(node_17,$$render=>{ms.updating&&$$render(consequent_7)})}reset(button_2),template_effect(()=>{set_class(button_2,1,clsx(["inline-flex cursor-pointer items-center gap-1.5 rounded-sm bg-background px-1.5 py-1 text-xs shadow-sm transition hover:bg-muted-foreground/20 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-o\
+ffset-2 disabled:cursor-not-allowed disabled:opacity-60 dark:bg-muted-foreground/15 dark:text-secondary-foreground",ms.isCurrentModelInCache?(forceForegroundText()||ms.isHighlightedCurrentModelActive,"text-foreground"):"bg-red-400/10 !text-red-400 hover:bg-red-400/20 hover:text-red-400"])),button_2.disabled=disabled()||ms.updating}),delegated("click",button_2,()=>ms.handleOpenChange(!0)),append($$anchor3,button_2)};if_block(node_2,$$render=>{ms.isRouter?$$render(consequent_6):$$render(alternate_2,
-1)})}append($$anchor2,fragment_1)};if_block(node2,$$render=>{ms.loading&&ms.options.length===0&&ms.isRouter?$$render(consequent):ms.options.length===0&&ms.isRouter?$$render(consequent_1,1):$$render(alternate_3,-1)})}reset(div);var node_18=sibling(div,2);{var consequent_8=$$anchor2=>{DialogModelInformation($$anchor2,{get open(){return ms.showModelDialog},onOpenChange:v=>ms.setShowModelDialog(v),get modelId(){return ms.infoModelId}})};if_block(node_18,$$render=>{ms.showModelDialog&&$$render(consequent_8)})}
return template_effect(()=>set_class(div,1,clsx(["relative inline-flex flex-col items-end gap-1",className()]))),append($$anchor,fragment),pop($$exports)}delegate(["click"]);var root_4$3=from_html("<span> </span>"),root_5$3=from_html("<span> </span>"),root_7$3=from_html("<span> </span>"),root_9$3=from_html("<span> </span>"),root_2$a=from_html('<span><span class="min-w-0 truncate font-medium"><!> </span> <!> <!> <!> <!></span>');function ModelId($$anchor,$$props){push$1($$props,!0);let hideOrgName=prop(
$$props,"hideOrgName",3,!1),showRaw=prop($$props,"showRaw",3,void 0),hideQuantization=prop($$props,"hideQuantization",3,!1),className=prop($$props,"class",3,""),rest=rest_props($$props,["$$slots","$$events","$$legacy","modelId","hideOrgName","showRaw","hideQuantization","aliases","tags","class"]);const badgeClass="inline-flex w-fit shrink-0 items-center justify-center whitespace-nowrap rounded-md border border-border/50 px-1 py-0 text-[10px] font-mono bg-foreground/15 dark:bg-foreground/10 text-\