diff --git a/examples/server/deps.sh b/examples/server/deps.sh
new file mode 100755
index 000000000..86ac2b852
--- /dev/null
+++ b/examples/server/deps.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+# Download and update deps for binary
+
+# get the directory of this script file
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+PUBLIC=$DIR/public
+
+curl https://npm.reversehttp.com/@preact/signals-core,@preact/signals,htm/preact,preact,preact/hooks,@microsoft/fetch-event-source > $PUBLIC/index.js
+
+echo "// Generated file, run deps.sh to update. Do not edit directly
+R\"htmlraw($(cat $PUBLIC/index.html))htmlraw\"
+" > $DIR/index.html.cpp
+
+echo "// Generated file, run deps.sh to update. Do not edit directly
+R\"jsraw($(cat $PUBLIC/index.js))jsraw\"
+" > $DIR/index.js.cpp
\ No newline at end of file
diff --git a/examples/server/index.html.cpp b/examples/server/index.html.cpp
new file mode 100644
index 000000000..4c5183edf
--- /dev/null
+++ b/examples/server/index.html.cpp
@@ -0,0 +1,278 @@
+// Generated file, run deps.sh to update. Do not edit directly
+R"htmlraw(
+
+
+
+
+ llama.cpp - chat
+
+
+
+
+
+
+
+
+
+
+)htmlraw"
+
diff --git a/examples/server/index.js b/examples/server/index.js
new file mode 100644
index 000000000..d4def2bad
--- /dev/null
+++ b/examples/server/index.js
@@ -0,0 +1 @@
+function t(){throw new Error("Cycle detected")}function e(){if(r>1){r--;return}let t,e=!1;while(void 0!==o){let i=o;o=void 0;_++;while(void 0!==i){const o=i.o;i.o=void 0;i.f&=-3;if(!(8&i.f)&&c(i))try{i.c()}catch(n){if(!e){t=n;e=!0}}i=o}}_=0;r--;if(e)throw t}function n(t){if(r>0)return t();r++;try{return t()}finally{e()}}let i,o,r=0,_=0,u=0;function s(t){if(void 0===i)return;let e=t.n;if(void 0===e||e.t!==i){e={i:0,S:t,p:i.s,n:void 0,t:i,e:void 0,x:void 0,r:e};if(void 0!==i.s)i.s.n=e;i.s=e;t.n=e;if(32&i.f)t.S(e);return e}else if(-1===e.i){e.i=0;if(void 0!==e.n){e.n.p=e.p;if(void 0!==e.p)e.p.n=e.n;e.p=i.s;e.n=void 0;i.s.n=e;i.s=e}return e}}function l(t){this.v=t;this.i=0;this.n=void 0;this.t=void 0}l.prototype.h=function(){return!0};l.prototype.S=function(t){if(this.t!==t&&void 0===t.e){t.x=this.t;if(void 0!==this.t)this.t.e=t;this.t=t}};l.prototype.U=function(t){if(void 0!==this.t){const e=t.e,n=t.x;if(void 0!==e){e.x=n;t.e=void 0}if(void 0!==n){n.e=e;t.x=void 0}if(t===this.t)this.t=n}};l.prototype.subscribe=function(t){const e=this;return b((function(){const n=e.value,i=32&this.f;this.f&=-33;try{t(n)}finally{this.f|=i}}))};l.prototype.valueOf=function(){return this.value};l.prototype.toString=function(){return this.value+""};l.prototype.toJSON=function(){return this.value};l.prototype.peek=function(){return this.v};Object.defineProperty(l.prototype,"value",{get(){const t=s(this);if(void 0!==t)t.i=this.i;return this.v},set(n){if(i instanceof d)!function(){throw new Error("Computed cannot have side-effects")}();if(n!==this.v){if(_>100)t();this.v=n;this.i++;u++;r++;try{for(let t=this.t;void 0!==t;t=t.x)t.t.N()}finally{e()}}}});function f(t){return new l(t)}function c(t){for(let e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function a(t){for(let e=t.s;void 0!==e;e=e.n){const n=e.S.n;if(void 0!==n)e.r=n;e.S.n=e;e.i=-1;if(void 0===e.n){t.s=e;break}}}function h(t){let e,n=t.s;while(void 0!==n){const t=n.p;if(-1===n.i){n.S.U(n);if(void 0!==t)t.n=n.n;if(void 0!==n.n)n.n.p=t}else e=n;n.S.n=n.r;if(void 0!==n.r)n.r=void 0;n=t}t.s=e}function d(t){l.call(this,void 0);this.x=t;this.s=void 0;this.g=u-1;this.f=4}(d.prototype=new l).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===u)return!0;this.g=u;this.f|=1;if(this.i>0&&!c(this)){this.f&=-2;return!0}const t=i;try{a(this);i=this;const t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(t){this.v=t;this.f|=16;this.i++}i=t;h(this);this.f&=-2;return!0};d.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(let t=this.s;void 0!==t;t=t.n)t.S.S(t)}l.prototype.S.call(this,t)};d.prototype.U=function(t){if(void 0!==this.t){l.prototype.U.call(this,t);if(void 0===this.t){this.f&=-33;for(let t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};d.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let t=this.t;void 0!==t;t=t.x)t.t.N()}};d.prototype.peek=function(){if(!this.h())t();if(16&this.f)throw this.v;return this.v};Object.defineProperty(d.prototype,"value",{get(){if(1&this.f)t();const e=s(this);this.h();if(void 0!==e)e.i=this.i;if(16&this.f)throw this.v;return this.v}});function p(t){return new d(t)}function v(t){const n=t.u;t.u=void 0;if("function"==typeof n){r++;const o=i;i=void 0;try{n()}catch(e){t.f&=-2;t.f|=8;y(t);throw e}finally{i=o;e()}}}function y(t){for(let e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0;t.s=void 0;v(t)}function m(t){if(i!==this)throw new Error("Out-of-order effect");h(this);i=t;this.f&=-2;if(8&this.f)y(this);e()}function g(t){this.x=t;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}g.prototype.c=function(){const t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const e=this.x();if("function"==typeof e)this.u=e}finally{t()}};g.prototype.S=function(){if(1&this.f)t();this.f|=1;this.f&=-9;v(this);a(this);r++;const e=i;i=this;return m.bind(this,e)};g.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=o;o=this}};g.prototype.d=function(){this.f|=8;if(!(1&this.f))y(this)};function b(t){const e=new g(t);try{e.c()}catch(t){e.d();throw t}return e.d.bind(e)}var k,w,S,x,E,C,H,U,N,P={},O=[],T=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$=Array.isArray;function D(t,e){for(var n in e)t[n]=e[n];return t}function A(t){var e=t.parentNode;e&&e.removeChild(t)}function W(t,e,n){var i,o,r,_={};for(r in e)"key"==r?i=e[r]:"ref"==r?o=e[r]:_[r]=e[r];if(arguments.length>2&&(_.children=arguments.length>3?k.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(r in t.defaultProps)void 0===_[r]&&(_[r]=t.defaultProps[r]);return V(t,_,i,o,null)}function V(t,e,n,i,o){var r={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++S:o};return null==o&&null!=w.vnode&&w.vnode(r),r}function L(){return{current:null}}function j(t){return t.children}function F(t,e){this.props=t,this.context=e}function M(t,e){if(null==e)return t.__?M(t.__,t.__.__k.indexOf(t)+1):null;for(var n;ee&&E.sort(U));q.__r=0}function B(t,e,n,i,o,r,_,u,s,l){var f,c,a,h,d,p,v,y=i&&i.__k||O,m=y.length;for(n.__k=[],f=0;f0?V(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(a=y[f])||a&&h.key==a.key&&h.type===a.type)y[f]=void 0;else for(c=0;c=0;e--)if((n=t.__k[e])&&(i=K(n)))return i;return null}function Q(t,e,n,i,o){var r;for(r in n)"children"===r||"key"===r||r in e||Y(t,r,null,n[r],i);for(r in e)o&&"function"!=typeof e[r]||"children"===r||"key"===r||"value"===r||"checked"===r||n[r]===e[r]||Y(t,r,e[r],n[r],i)}function X(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||T.test(e)?n:n+"px"}function Y(t,e,n,i,o){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||X(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||X(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?i||t.addEventListener(e,r?tt:Z,r):t.removeEventListener(e,r?tt:Z,r);else if("dangerouslySetInnerHTML"!==e){if(o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function Z(t){return this.l[t.type+!1](w.event?w.event(t):t)}function tt(t){return this.l[t.type+!0](w.event?w.event(t):t)}function et(t,e,n,i,o,r,_,u,s){var l,f,c,a,h,d,p,v,y,m,g,b,k,S,x,E=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(s=n.__h,u=e.__e=n.__e,e.__h=null,r=[u]),(l=w.__b)&&l(e);try{t:if("function"==typeof E){if(v=e.props,y=(l=E.contextType)&&i[l.__c],m=l?y?y.props.value:l.__:i,n.__c?p=(f=e.__c=n.__c).__=f.__E:("prototype"in E&&E.prototype.render?e.__c=f=new E(v,m):(e.__c=f=new F(v,m),f.constructor=E,f.render=_t),y&&y.sub(f),f.props=v,f.state||(f.state={}),f.context=m,f.__n=i,c=f.__d=!0,f.__h=[],f._sb=[]),null==f.__s&&(f.__s=f.state),null!=E.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=D({},f.__s)),D(f.__s,E.getDerivedStateFromProps(v,f.__s))),a=f.props,h=f.state,f.__v=e,c)null==E.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(null==E.getDerivedStateFromProps&&v!==a&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(v,m),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(v,f.__s,m)||e.__v===n.__v){for(e.__v!==n.__v&&(f.props=v,f.state=f.__s,f.__d=!1),f.__e=!1,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),g=0;g2&&(u.children=arguments.length>3?k.call(arguments,2):n),V(t.type,u,i||t.key,o||t.ref,null)}function ft(t,e){var n={__c:e="__cC"+N++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,R(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}k=O.slice,w={__e:function(t,e,n,i){for(var o,r,_;e=e.__;)if((o=e.__c)&&!o.__)try{if((r=o.constructor)&&null!=r.getDerivedStateFromError&&(o.setState(r.getDerivedStateFromError(t)),_=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,i||{}),_=o.__d),_)return o.__E=o}catch(e){t=e}throw t}},S=0,x=function(t){return null!=t&&void 0===t.constructor},F.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=D({},this.state),"function"==typeof t&&(t=t(D({},n),this.props)),t&&D(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),R(this))},F.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),R(this))},F.prototype.render=j,E=[],H="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,U=function(t,e){return t.__v.__b-e.__v.__b},q.__r=0,N=0;var ct,at,ht,dt,pt=0,vt=[],yt=[],mt=w.__b,gt=w.__r,bt=w.diffed,kt=w.__c,wt=w.unmount;function St(t,e){w.__h&&w.__h(at,t,pt||e),pt=0;var n=at.__H||(at.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:yt}),n.__[t]}function xt(t){return pt=1,Et(It,t)}function Et(t,e,n){var i=St(ct++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):It(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],n=i.t(e,t);e!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=at,!at.u)){var o=function(t,e,n){if(!i.__c.__H)return!0;var o=i.__c.__H.__.filter((function(t){return t.__c}));if(o.every((function(t){return!t.__N})))return!r||r.call(this,t,e,n);var _=!1;return o.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(_=!0)}})),!(!_&&i.__c.props===t)&&(!r||r.call(this,t,e,n))};at.u=!0;var r=at.shouldComponentUpdate,_=at.componentWillUpdate;at.componentWillUpdate=function(t,e,n){if(this.__e){var i=r;r=void 0,o(t,e,n),r=i}_&&_.call(this,t,e,n)},at.shouldComponentUpdate=o}return i.__N||i.__}function Ct(t,e){var n=St(ct++,3);!w.__s&&Mt(n.__H,e)&&(n.__=t,n.i=e,at.__H.__h.push(n))}function Ht(t,e){var n=St(ct++,4);!w.__s&&Mt(n.__H,e)&&(n.__=t,n.i=e,at.__h.push(n))}function Ut(t){return pt=5,Pt((function(){return{current:t}}),[])}function Nt(t,e,n){pt=6,Ht((function(){return"function"==typeof t?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0}),null==n?n:n.concat(t))}function Pt(t,e){var n=St(ct++,7);return Mt(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function Ot(t,e){return pt=8,Pt((function(){return t}),e)}function Tt(t){var e=at.context[t.__c],n=St(ct++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(at)),e.props.value):t.__}function $t(t,e){w.useDebugValue&&w.useDebugValue(e?e(t):t)}function Dt(t){var e=St(ct++,10),n=xt();return e.__=t,at.componentDidCatch||(at.componentDidCatch=function(t,i){e.__&&e.__(t,i),n[1](t)}),[n[0],function(){n[1](void 0)}]}function At(){var t=St(ct++,11);if(!t.__){for(var e=at.__v;null!==e&&!e.__m&&null!==e.__;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function Wt(){for(var t;t=vt.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(jt),t.__H.__h.forEach(Ft),t.__H.__h=[]}catch(u){t.__H.__h=[],w.__e(u,t.__v)}}w.__b=function(t){at=null,mt&&mt(t)},w.__r=function(t){gt&>(t),ct=0;var e=(at=t.__c).__H;e&&(ht===at?(e.__h=[],at.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=yt,t.__N=t.i=void 0}))):(e.__h.forEach(jt),e.__h.forEach(Ft),e.__h=[],ct=0)),ht=at},w.diffed=function(t){bt&&bt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==vt.push(e)&&dt===w.requestAnimationFrame||((dt=w.requestAnimationFrame)||Lt)(Wt)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==yt&&(t.__=t.__V),t.i=void 0,t.__V=yt}))),ht=at=null},w.__c=function(t,e){e.some((function(t){try{t.__h.forEach(jt),t.__h=t.__h.filter((function(t){return!t.__||Ft(t)}))}catch(f){e.some((function(t){t.__h&&(t.__h=[])})),e=[],w.__e(f,t.__v)}})),kt&&kt(t,e)},w.unmount=function(t){wt&&wt(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{jt(t)}catch(t){e=t}})),n.__H=void 0,e&&w.__e(e,n.__v))};var Vt="function"==typeof requestAnimationFrame;function Lt(t){var e,n=function(){clearTimeout(i),Vt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);Vt&&(e=requestAnimationFrame(n))}function jt(t){var e=at,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),at=e}function Ft(t){var e=at;t.__c=t.__(),at=e}function Mt(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function It(t,e){return"function"==typeof e?e(t):e}function Rt(t,e){w[t]=e.bind(null,w[t]||(()=>{}))}let qt,Bt;function Gt(t){if(Bt)Bt();Bt=t&&t.S()}function zt({data:t}){const e=Kt(t);e.value=t;const n=Pt(()=>{let t=this.__v;while(t=t.__)if(t.__c){t.__c.__$f|=4;break}this.__$u.c=()=>{this.base.data=n.peek()};return p(()=>{let t=e.value.value;return 0===t?0:!0===t?"":t||""})},[]);return n.value}zt.displayName="_st";Object.defineProperties(l.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:zt},props:{configurable:!0,get(){return{data:this}}},__b:{configurable:!0,value:1}});Rt("__b",(t,e)=>{if("string"==typeof e.type){let t,n=e.props;for(let i in n){if("children"===i)continue;let o=n[i];if(o instanceof l){if(!t)e.__np=t={};t[i]=o;n[i]=o.peek()}}}t(e)});Rt("__r",(t,e)=>{Gt();let n,i=e.__c;if(i){i.__$f&=-2;n=i.__$u;if(void 0===n)i.__$u=n=function(t){let e;b((function(){e=this}));e.c=()=>{i.__$f|=1;i.setState({})};return e}()}qt=i;Gt(n);t(e)});Rt("__e",(t,e,n,i)=>{Gt();qt=void 0;t(e,n,i)});Rt("diffed",(t,e)=>{Gt();qt=void 0;let n;if("string"==typeof e.type&&(n=e.__e)){let t=e.__np,i=e.props;if(t){let e=n.U;if(e)for(let n in e){let i=e[n];if(void 0!==i&&!(n in t)){i.d();e[n]=void 0}}else{e={};n.U=e}for(let o in t){let r=e[o],_=t[o];if(void 0===r){r=Jt(n,o,_,i);e[o]=r}else r.o(_,i)}}}t(e)});function Jt(t,e,n,i){const o=e in t&&void 0===t.ownerSVGElement,r=f(n);return{o:(t,e)=>{r.value=t;i=e},d:b(()=>{const n=r.value.value;if(i[e]!==n){i[e]=n;if(o)t[e]=n;else if(n)t.setAttribute(e,n);else t.removeAttribute(e)}})}}Rt("unmount",(t,e)=>{if("string"==typeof e.type){let t=e.__e;if(t){const e=t.U;if(e){t.U=void 0;for(let t in e){let n=e[t];if(n)n.d()}}}}else{let t=e.__c;if(t){const e=t.__$u;if(e){t.__$u=void 0;e.d()}}}t(e)});Rt("__h",(t,e,n,i)=>{if(i<3)e.__$f|=2;t(e,n,i)});F.prototype.shouldComponentUpdate=function(t,e){const n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(let i in e)return!0;for(let i in t)if("__source"!==i&&t[i]!==this.props[i])return!0;for(let i in this.props)if(!(i in t))return!0;return!1};function Kt(t){return Pt(()=>f(t),[])}function Qt(t){const e=Ut(t);e.current=t;qt.__$f|=4;return Pt(()=>p(()=>e.current()),[])}function Xt(t){const e=Ut(t);e.current=t;Ct(()=>b(()=>e.current()),[])}var Yt=function(t,e,n,i){var o;e[0]=0;for(var r=1;r=5&&((o||!t&&5===i)&&(_.push(i,0,o,n),i=6),t&&(_.push(i,t,0,n),i=6)),o=""},s=0;s"===e?(i=1,o=""):o=e+o[0]:r?e===r?r="":o+=e:'"'===e||"'"===e?r=e:">"===e?(u(),i=1):i&&("="===e?(i=5,n=o,o=""):"/"===e&&(i<5||">"===t[s][l+1])?(u(),3===i&&(_=_[0]),i=_,(_=_[0]).push(2,0,i),i=0):" "===e||"\t"===e||"\n"===e||"\r"===e?(u(),i=2):o+=e),3===i&&"!--"===o&&(i=4,_=_[0])}return u(),_}(t)),e),arguments,[])).length>1?e:e[0]}var ee=te.bind(W);async function ne(t,e){const n=t.getReader();let i;while(!(i=await n.read()).done){e(i.value)}}function ie(t){let e;let n;let i;let o=false;return function r(_){if(e===undefined){e=_;n=0;i=-1}else{e=re(e,_)}const u=e.length;let s=0;while(n0){const n=o.decode(_.subarray(0,u));const r=u+(_[u+1]===32?2:1);const s=o.decode(_.subarray(r));switch(n){case"data":i.data=i.data?i.data+"\n"+s:s;break;case"event":i.event=s;break;case"id":t(i.id=s);break;case"retry":const n=parseInt(s,10);if(!isNaN(n)){e(i.retry=n)}break}}}}function re(t,e){const n=new Uint8Array(t.length+e.length);n.set(t);n.set(e,t.length);return n}function _e(){return{data:"",event:"",id:"",retry:undefined}}var ue=undefined&&undefined.__rest||function(t,e){var n={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0)n[i]=t[i];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var o=0,i=Object.getOwnPropertySymbols(t);o{const a=Object.assign({},i);if(!a.accept){a.accept=se}let h;function d(){h.abort();if(!document.hidden){b()}}if(!s){document.addEventListener("visibilitychange",d)}let p=le;let v=0;function y(){document.removeEventListener("visibilitychange",d);window.clearTimeout(v);h.abort()}n===null||n===void 0?void 0:n.addEventListener("abort",()=>{y();e()});const m=l!==null&&l!==void 0?l:window.fetch;const g=o!==null&&o!==void 0?o:ae;async function b(){var n;h=new AbortController;try{const n=await m(t,Object.assign(Object.assign({},f),{headers:a,signal:h.signal}));await g(n);await ne(n.body,ie(oe(t=>{if(t){a[fe]=t}else{delete a[fe]}},t=>{p=t},r)));_===null||_===void 0?void 0:_();y();e()}catch(i){if(!h.signal.aborted){try{const t=(n=u===null||u===void 0?void 0:u(i))!==null&&n!==void 0?n:p;window.clearTimeout(v);v=window.setTimeout(b,t)}catch(o){y();c(o)}}}}b()})}function ae(t){const e=t.headers.get("content-type");if(!(e===null||e===void 0?void 0:e.startsWith(se))){throw new Error(`Expected content-type to be ${se}, Actual: ${e}`)}}export{F as Component,se as EventStreamContentType,j as Fragment,l as Signal,n as batch,lt as cloneElement,p as computed,ft as createContext,W as createElement,L as createRef,b as effect,ce as fetchEventSource,W as h,ee as html,st as hydrate,x as isValidElement,w as options,ut as render,f as signal,z as toChildArray,Ot as useCallback,Qt as useComputed,Tt as useContext,$t as useDebugValue,Ct as useEffect,Dt as useErrorBoundary,At as useId,Nt as useImperativeHandle,Ht as useLayoutEffect,Pt as useMemo,Et as useReducer,Ut as useRef,Kt as useSignal,Xt as useSignalEffect,xt as useState};
\ No newline at end of file
diff --git a/examples/server/index.js.cpp b/examples/server/index.js.cpp
new file mode 100644
index 000000000..96115e9df
--- /dev/null
+++ b/examples/server/index.js.cpp
@@ -0,0 +1,3 @@
+// Generated file, run deps.sh to update. Do not edit directly
+R"jsraw(function t(){throw new Error("Cycle detected")}function e(){if(r>1){r--;return}let t,e=!1;while(void 0!==o){let i=o;o=void 0;_++;while(void 0!==i){const o=i.o;i.o=void 0;i.f&=-3;if(!(8&i.f)&&c(i))try{i.c()}catch(n){if(!e){t=n;e=!0}}i=o}}_=0;r--;if(e)throw t}function n(t){if(r>0)return t();r++;try{return t()}finally{e()}}let i,o,r=0,_=0,u=0;function s(t){if(void 0===i)return;let e=t.n;if(void 0===e||e.t!==i){e={i:0,S:t,p:i.s,n:void 0,t:i,e:void 0,x:void 0,r:e};if(void 0!==i.s)i.s.n=e;i.s=e;t.n=e;if(32&i.f)t.S(e);return e}else if(-1===e.i){e.i=0;if(void 0!==e.n){e.n.p=e.p;if(void 0!==e.p)e.p.n=e.n;e.p=i.s;e.n=void 0;i.s.n=e;i.s=e}return e}}function l(t){this.v=t;this.i=0;this.n=void 0;this.t=void 0}l.prototype.h=function(){return!0};l.prototype.S=function(t){if(this.t!==t&&void 0===t.e){t.x=this.t;if(void 0!==this.t)this.t.e=t;this.t=t}};l.prototype.U=function(t){if(void 0!==this.t){const e=t.e,n=t.x;if(void 0!==e){e.x=n;t.e=void 0}if(void 0!==n){n.e=e;t.x=void 0}if(t===this.t)this.t=n}};l.prototype.subscribe=function(t){const e=this;return b((function(){const n=e.value,i=32&this.f;this.f&=-33;try{t(n)}finally{this.f|=i}}))};l.prototype.valueOf=function(){return this.value};l.prototype.toString=function(){return this.value+""};l.prototype.toJSON=function(){return this.value};l.prototype.peek=function(){return this.v};Object.defineProperty(l.prototype,"value",{get(){const t=s(this);if(void 0!==t)t.i=this.i;return this.v},set(n){if(i instanceof d)!function(){throw new Error("Computed cannot have side-effects")}();if(n!==this.v){if(_>100)t();this.v=n;this.i++;u++;r++;try{for(let t=this.t;void 0!==t;t=t.x)t.t.N()}finally{e()}}}});function f(t){return new l(t)}function c(t){for(let e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function a(t){for(let e=t.s;void 0!==e;e=e.n){const n=e.S.n;if(void 0!==n)e.r=n;e.S.n=e;e.i=-1;if(void 0===e.n){t.s=e;break}}}function h(t){let e,n=t.s;while(void 0!==n){const t=n.p;if(-1===n.i){n.S.U(n);if(void 0!==t)t.n=n.n;if(void 0!==n.n)n.n.p=t}else e=n;n.S.n=n.r;if(void 0!==n.r)n.r=void 0;n=t}t.s=e}function d(t){l.call(this,void 0);this.x=t;this.s=void 0;this.g=u-1;this.f=4}(d.prototype=new l).h=function(){this.f&=-3;if(1&this.f)return!1;if(32==(36&this.f))return!0;this.f&=-5;if(this.g===u)return!0;this.g=u;this.f|=1;if(this.i>0&&!c(this)){this.f&=-2;return!0}const t=i;try{a(this);i=this;const t=this.x();if(16&this.f||this.v!==t||0===this.i){this.v=t;this.f&=-17;this.i++}}catch(t){this.v=t;this.f|=16;this.i++}i=t;h(this);this.f&=-2;return!0};d.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(let t=this.s;void 0!==t;t=t.n)t.S.S(t)}l.prototype.S.call(this,t)};d.prototype.U=function(t){if(void 0!==this.t){l.prototype.U.call(this,t);if(void 0===this.t){this.f&=-33;for(let t=this.s;void 0!==t;t=t.n)t.S.U(t)}}};d.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let t=this.t;void 0!==t;t=t.x)t.t.N()}};d.prototype.peek=function(){if(!this.h())t();if(16&this.f)throw this.v;return this.v};Object.defineProperty(d.prototype,"value",{get(){if(1&this.f)t();const e=s(this);this.h();if(void 0!==e)e.i=this.i;if(16&this.f)throw this.v;return this.v}});function p(t){return new d(t)}function v(t){const n=t.u;t.u=void 0;if("function"==typeof n){r++;const o=i;i=void 0;try{n()}catch(e){t.f&=-2;t.f|=8;y(t);throw e}finally{i=o;e()}}}function y(t){for(let e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0;t.s=void 0;v(t)}function m(t){if(i!==this)throw new Error("Out-of-order effect");h(this);i=t;this.f&=-2;if(8&this.f)y(this);e()}function g(t){this.x=t;this.u=void 0;this.s=void 0;this.o=void 0;this.f=32}g.prototype.c=function(){const t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const e=this.x();if("function"==typeof e)this.u=e}finally{t()}};g.prototype.S=function(){if(1&this.f)t();this.f|=1;this.f&=-9;v(this);a(this);r++;const e=i;i=this;return m.bind(this,e)};g.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.o=o;o=this}};g.prototype.d=function(){this.f|=8;if(!(1&this.f))y(this)};function b(t){const e=new g(t);try{e.c()}catch(t){e.d();throw t}return e.d.bind(e)}var k,w,S,x,E,C,H,U,N,P={},O=[],T=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$=Array.isArray;function D(t,e){for(var n in e)t[n]=e[n];return t}function A(t){var e=t.parentNode;e&&e.removeChild(t)}function W(t,e,n){var i,o,r,_={};for(r in e)"key"==r?i=e[r]:"ref"==r?o=e[r]:_[r]=e[r];if(arguments.length>2&&(_.children=arguments.length>3?k.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(r in t.defaultProps)void 0===_[r]&&(_[r]=t.defaultProps[r]);return V(t,_,i,o,null)}function V(t,e,n,i,o){var r={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++S:o};return null==o&&null!=w.vnode&&w.vnode(r),r}function L(){return{current:null}}function j(t){return t.children}function F(t,e){this.props=t,this.context=e}function M(t,e){if(null==e)return t.__?M(t.__,t.__.__k.indexOf(t)+1):null;for(var n;ee&&E.sort(U));q.__r=0}function B(t,e,n,i,o,r,_,u,s,l){var f,c,a,h,d,p,v,y=i&&i.__k||O,m=y.length;for(n.__k=[],f=0;f0?V(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(a=y[f])||a&&h.key==a.key&&h.type===a.type)y[f]=void 0;else for(c=0;c=0;e--)if((n=t.__k[e])&&(i=K(n)))return i;return null}function Q(t,e,n,i,o){var r;for(r in n)"children"===r||"key"===r||r in e||Y(t,r,null,n[r],i);for(r in e)o&&"function"!=typeof e[r]||"children"===r||"key"===r||"value"===r||"checked"===r||n[r]===e[r]||Y(t,r,e[r],n[r],i)}function X(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||T.test(e)?n:n+"px"}function Y(t,e,n,i,o){var r;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||X(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||X(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])r=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+r]=n,n?i||t.addEventListener(e,r?tt:Z,r):t.removeEventListener(e,r?tt:Z,r);else if("dangerouslySetInnerHTML"!==e){if(o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&"rowSpan"!==e&&"colSpan"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function Z(t){return this.l[t.type+!1](w.event?w.event(t):t)}function tt(t){return this.l[t.type+!0](w.event?w.event(t):t)}function et(t,e,n,i,o,r,_,u,s){var l,f,c,a,h,d,p,v,y,m,g,b,k,S,x,E=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(s=n.__h,u=e.__e=n.__e,e.__h=null,r=[u]),(l=w.__b)&&l(e);try{t:if("function"==typeof E){if(v=e.props,y=(l=E.contextType)&&i[l.__c],m=l?y?y.props.value:l.__:i,n.__c?p=(f=e.__c=n.__c).__=f.__E:("prototype"in E&&E.prototype.render?e.__c=f=new E(v,m):(e.__c=f=new F(v,m),f.constructor=E,f.render=_t),y&&y.sub(f),f.props=v,f.state||(f.state={}),f.context=m,f.__n=i,c=f.__d=!0,f.__h=[],f._sb=[]),null==f.__s&&(f.__s=f.state),null!=E.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=D({},f.__s)),D(f.__s,E.getDerivedStateFromProps(v,f.__s))),a=f.props,h=f.state,f.__v=e,c)null==E.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(null==E.getDerivedStateFromProps&&v!==a&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(v,m),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(v,f.__s,m)||e.__v===n.__v){for(e.__v!==n.__v&&(f.props=v,f.state=f.__s,f.__d=!1),f.__e=!1,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),g=0;g2&&(u.children=arguments.length>3?k.call(arguments,2):n),V(t.type,u,i||t.key,o||t.ref,null)}function ft(t,e){var n={__c:e="__cC"+N++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,i;return this.getChildContext||(n=[],(i={})[e]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,R(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n}k=O.slice,w={__e:function(t,e,n,i){for(var o,r,_;e=e.__;)if((o=e.__c)&&!o.__)try{if((r=o.constructor)&&null!=r.getDerivedStateFromError&&(o.setState(r.getDerivedStateFromError(t)),_=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,i||{}),_=o.__d),_)return o.__E=o}catch(e){t=e}throw t}},S=0,x=function(t){return null!=t&&void 0===t.constructor},F.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=D({},this.state),"function"==typeof t&&(t=t(D({},n),this.props)),t&&D(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),R(this))},F.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),R(this))},F.prototype.render=j,E=[],H="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,U=function(t,e){return t.__v.__b-e.__v.__b},q.__r=0,N=0;var ct,at,ht,dt,pt=0,vt=[],yt=[],mt=w.__b,gt=w.__r,bt=w.diffed,kt=w.__c,wt=w.unmount;function St(t,e){w.__h&&w.__h(at,t,pt||e),pt=0;var n=at.__H||(at.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({__V:yt}),n.__[t]}function xt(t){return pt=1,Et(It,t)}function Et(t,e,n){var i=St(ct++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):It(void 0,e),function(t){var e=i.__N?i.__N[0]:i.__[0],n=i.t(e,t);e!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=at,!at.u)){var o=function(t,e,n){if(!i.__c.__H)return!0;var o=i.__c.__H.__.filter((function(t){return t.__c}));if(o.every((function(t){return!t.__N})))return!r||r.call(this,t,e,n);var _=!1;return o.forEach((function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(_=!0)}})),!(!_&&i.__c.props===t)&&(!r||r.call(this,t,e,n))};at.u=!0;var r=at.shouldComponentUpdate,_=at.componentWillUpdate;at.componentWillUpdate=function(t,e,n){if(this.__e){var i=r;r=void 0,o(t,e,n),r=i}_&&_.call(this,t,e,n)},at.shouldComponentUpdate=o}return i.__N||i.__}function Ct(t,e){var n=St(ct++,3);!w.__s&&Mt(n.__H,e)&&(n.__=t,n.i=e,at.__H.__h.push(n))}function Ht(t,e){var n=St(ct++,4);!w.__s&&Mt(n.__H,e)&&(n.__=t,n.i=e,at.__h.push(n))}function Ut(t){return pt=5,Pt((function(){return{current:t}}),[])}function Nt(t,e,n){pt=6,Ht((function(){return"function"==typeof t?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0}),null==n?n:n.concat(t))}function Pt(t,e){var n=St(ct++,7);return Mt(n.__H,e)?(n.__V=t(),n.i=e,n.__h=t,n.__V):n.__}function Ot(t,e){return pt=8,Pt((function(){return t}),e)}function Tt(t){var e=at.context[t.__c],n=St(ct++,9);return n.c=t,e?(null==n.__&&(n.__=!0,e.sub(at)),e.props.value):t.__}function $t(t,e){w.useDebugValue&&w.useDebugValue(e?e(t):t)}function Dt(t){var e=St(ct++,10),n=xt();return e.__=t,at.componentDidCatch||(at.componentDidCatch=function(t,i){e.__&&e.__(t,i),n[1](t)}),[n[0],function(){n[1](void 0)}]}function At(){var t=St(ct++,11);if(!t.__){for(var e=at.__v;null!==e&&!e.__m&&null!==e.__;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function Wt(){for(var t;t=vt.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(jt),t.__H.__h.forEach(Ft),t.__H.__h=[]}catch(u){t.__H.__h=[],w.__e(u,t.__v)}}w.__b=function(t){at=null,mt&&mt(t)},w.__r=function(t){gt&>(t),ct=0;var e=(at=t.__c).__H;e&&(ht===at?(e.__h=[],at.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=yt,t.__N=t.i=void 0}))):(e.__h.forEach(jt),e.__h.forEach(Ft),e.__h=[],ct=0)),ht=at},w.diffed=function(t){bt&&bt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==vt.push(e)&&dt===w.requestAnimationFrame||((dt=w.requestAnimationFrame)||Lt)(Wt)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==yt&&(t.__=t.__V),t.i=void 0,t.__V=yt}))),ht=at=null},w.__c=function(t,e){e.some((function(t){try{t.__h.forEach(jt),t.__h=t.__h.filter((function(t){return!t.__||Ft(t)}))}catch(f){e.some((function(t){t.__h&&(t.__h=[])})),e=[],w.__e(f,t.__v)}})),kt&&kt(t,e)},w.unmount=function(t){wt&&wt(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{jt(t)}catch(t){e=t}})),n.__H=void 0,e&&w.__e(e,n.__v))};var Vt="function"==typeof requestAnimationFrame;function Lt(t){var e,n=function(){clearTimeout(i),Vt&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,100);Vt&&(e=requestAnimationFrame(n))}function jt(t){var e=at,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),at=e}function Ft(t){var e=at;t.__c=t.__(),at=e}function Mt(t,e){return!t||t.length!==e.length||e.some((function(e,n){return e!==t[n]}))}function It(t,e){return"function"==typeof e?e(t):e}function Rt(t,e){w[t]=e.bind(null,w[t]||(()=>{}))}let qt,Bt;function Gt(t){if(Bt)Bt();Bt=t&&t.S()}function zt({data:t}){const e=Kt(t);e.value=t;const n=Pt(()=>{let t=this.__v;while(t=t.__)if(t.__c){t.__c.__$f|=4;break}this.__$u.c=()=>{this.base.data=n.peek()};return p(()=>{let t=e.value.value;return 0===t?0:!0===t?"":t||""})},[]);return n.value}zt.displayName="_st";Object.defineProperties(l.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:zt},props:{configurable:!0,get(){return{data:this}}},__b:{configurable:!0,value:1}});Rt("__b",(t,e)=>{if("string"==typeof e.type){let t,n=e.props;for(let i in n){if("children"===i)continue;let o=n[i];if(o instanceof l){if(!t)e.__np=t={};t[i]=o;n[i]=o.peek()}}}t(e)});Rt("__r",(t,e)=>{Gt();let n,i=e.__c;if(i){i.__$f&=-2;n=i.__$u;if(void 0===n)i.__$u=n=function(t){let e;b((function(){e=this}));e.c=()=>{i.__$f|=1;i.setState({})};return e}()}qt=i;Gt(n);t(e)});Rt("__e",(t,e,n,i)=>{Gt();qt=void 0;t(e,n,i)});Rt("diffed",(t,e)=>{Gt();qt=void 0;let n;if("string"==typeof e.type&&(n=e.__e)){let t=e.__np,i=e.props;if(t){let e=n.U;if(e)for(let n in e){let i=e[n];if(void 0!==i&&!(n in t)){i.d();e[n]=void 0}}else{e={};n.U=e}for(let o in t){let r=e[o],_=t[o];if(void 0===r){r=Jt(n,o,_,i);e[o]=r}else r.o(_,i)}}}t(e)});function Jt(t,e,n,i){const o=e in t&&void 0===t.ownerSVGElement,r=f(n);return{o:(t,e)=>{r.value=t;i=e},d:b(()=>{const n=r.value.value;if(i[e]!==n){i[e]=n;if(o)t[e]=n;else if(n)t.setAttribute(e,n);else t.removeAttribute(e)}})}}Rt("unmount",(t,e)=>{if("string"==typeof e.type){let t=e.__e;if(t){const e=t.U;if(e){t.U=void 0;for(let t in e){let n=e[t];if(n)n.d()}}}}else{let t=e.__c;if(t){const e=t.__$u;if(e){t.__$u=void 0;e.d()}}}t(e)});Rt("__h",(t,e,n,i)=>{if(i<3)e.__$f|=2;t(e,n,i)});F.prototype.shouldComponentUpdate=function(t,e){const n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(let i in e)return!0;for(let i in t)if("__source"!==i&&t[i]!==this.props[i])return!0;for(let i in this.props)if(!(i in t))return!0;return!1};function Kt(t){return Pt(()=>f(t),[])}function Qt(t){const e=Ut(t);e.current=t;qt.__$f|=4;return Pt(()=>p(()=>e.current()),[])}function Xt(t){const e=Ut(t);e.current=t;Ct(()=>b(()=>e.current()),[])}var Yt=function(t,e,n,i){var o;e[0]=0;for(var r=1;r=5&&((o||!t&&5===i)&&(_.push(i,0,o,n),i=6),t&&(_.push(i,t,0,n),i=6)),o=""},s=0;s"===e?(i=1,o=""):o=e+o[0]:r?e===r?r="":o+=e:'"'===e||"'"===e?r=e:">"===e?(u(),i=1):i&&("="===e?(i=5,n=o,o=""):"/"===e&&(i<5||">"===t[s][l+1])?(u(),3===i&&(_=_[0]),i=_,(_=_[0]).push(2,0,i),i=0):" "===e||"\t"===e||"\n"===e||"\r"===e?(u(),i=2):o+=e),3===i&&"!--"===o&&(i=4,_=_[0])}return u(),_}(t)),e),arguments,[])).length>1?e:e[0]}var ee=te.bind(W);async function ne(t,e){const n=t.getReader();let i;while(!(i=await n.read()).done){e(i.value)}}function ie(t){let e;let n;let i;let o=false;return function r(_){if(e===undefined){e=_;n=0;i=-1}else{e=re(e,_)}const u=e.length;let s=0;while(n0){const n=o.decode(_.subarray(0,u));const r=u+(_[u+1]===32?2:1);const s=o.decode(_.subarray(r));switch(n){case"data":i.data=i.data?i.data+"\n"+s:s;break;case"event":i.event=s;break;case"id":t(i.id=s);break;case"retry":const n=parseInt(s,10);if(!isNaN(n)){e(i.retry=n)}break}}}}function re(t,e){const n=new Uint8Array(t.length+e.length);n.set(t);n.set(e,t.length);return n}function _e(){return{data:"",event:"",id:"",retry:undefined}}var ue=undefined&&undefined.__rest||function(t,e){var n={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0)n[i]=t[i];if(t!=null&&typeof Object.getOwnPropertySymbols==="function")for(var o=0,i=Object.getOwnPropertySymbols(t);o{const a=Object.assign({},i);if(!a.accept){a.accept=se}let h;function d(){h.abort();if(!document.hidden){b()}}if(!s){document.addEventListener("visibilitychange",d)}let p=le;let v=0;function y(){document.removeEventListener("visibilitychange",d);window.clearTimeout(v);h.abort()}n===null||n===void 0?void 0:n.addEventListener("abort",()=>{y();e()});const m=l!==null&&l!==void 0?l:window.fetch;const g=o!==null&&o!==void 0?o:ae;async function b(){var n;h=new AbortController;try{const n=await m(t,Object.assign(Object.assign({},f),{headers:a,signal:h.signal}));await g(n);await ne(n.body,ie(oe(t=>{if(t){a[fe]=t}else{delete a[fe]}},t=>{p=t},r)));_===null||_===void 0?void 0:_();y();e()}catch(i){if(!h.signal.aborted){try{const t=(n=u===null||u===void 0?void 0:u(i))!==null&&n!==void 0?n:p;window.clearTimeout(v);v=window.setTimeout(b,t)}catch(o){y();c(o)}}}}b()})}function ae(t){const e=t.headers.get("content-type");if(!(e===null||e===void 0?void 0:e.startsWith(se))){throw new Error(`Expected content-type to be ${se}, Actual: ${e}`)}}export{F as Component,se as EventStreamContentType,j as Fragment,l as Signal,n as batch,lt as cloneElement,p as computed,ft as createContext,W as createElement,L as createRef,b as effect,ce as fetchEventSource,W as h,ee as html,st as hydrate,x as isValidElement,w as options,ut as render,f as signal,z as toChildArray,Ot as useCallback,Qt as useComputed,Tt as useContext,$t as useDebugValue,Ct as useEffect,Dt as useErrorBoundary,At as useId,Nt as useImperativeHandle,Ht as useLayoutEffect,Pt as useMemo,Et as useReducer,Ut as useRef,Kt as useSignal,Xt as useSignalEffect,xt as useState};)jsraw"
+
diff --git a/examples/server/server.html b/examples/server/public/index.html
similarity index 98%
rename from examples/server/server.html
rename to examples/server/public/index.html
index 6512d647e..2a21cf62b 100644
--- a/examples/server/server.html
+++ b/examples/server/public/index.html
@@ -67,7 +67,7 @@