orchestrator-server 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/index.js +355 -0
  2. package/package.json +60 -0
  3. package/prisma/migrations/20260422200035_init/migration.sql +23 -0
  4. package/prisma/migrations/migration_lock.toml +3 -0
  5. package/prisma/schema.prisma +49 -0
  6. package/prisma/seed.ts +186 -0
  7. package/prisma.config.ts +14 -0
  8. package/public/404.html +1 -0
  9. package/public/__next.__PAGE__.txt +9 -0
  10. package/public/__next._full.txt +18 -0
  11. package/public/__next._head.txt +6 -0
  12. package/public/__next._index.txt +5 -0
  13. package/public/__next._tree.txt +2 -0
  14. package/public/_next/static/3wVNKXGkEvcJKQQ41ykC8/_buildManifest.js +11 -0
  15. package/public/_next/static/3wVNKXGkEvcJKQQ41ykC8/_clientMiddlewareManifest.js +1 -0
  16. package/public/_next/static/3wVNKXGkEvcJKQQ41ykC8/_ssgManifest.js +1 -0
  17. package/public/_next/static/E8q98Qsrw4E60c3xYkyPl/_buildManifest.js +11 -0
  18. package/public/_next/static/E8q98Qsrw4E60c3xYkyPl/_clientMiddlewareManifest.js +1 -0
  19. package/public/_next/static/E8q98Qsrw4E60c3xYkyPl/_ssgManifest.js +1 -0
  20. package/public/_next/static/SwqlSKgnrxdsy4WFR-t8H/_buildManifest.js +11 -0
  21. package/public/_next/static/SwqlSKgnrxdsy4WFR-t8H/_clientMiddlewareManifest.js +1 -0
  22. package/public/_next/static/SwqlSKgnrxdsy4WFR-t8H/_ssgManifest.js +1 -0
  23. package/public/_next/static/aWmqEAVXz6UBBs_rqx3yi/_buildManifest.js +11 -0
  24. package/public/_next/static/aWmqEAVXz6UBBs_rqx3yi/_clientMiddlewareManifest.js +1 -0
  25. package/public/_next/static/aWmqEAVXz6UBBs_rqx3yi/_ssgManifest.js +1 -0
  26. package/public/_next/static/chunks/0.ash4e7s.y_n.js +1 -0
  27. package/public/_next/static/chunks/0227w9~5ech5o.js +6 -0
  28. package/public/_next/static/chunks/03~yq9q893hmn.js +1 -0
  29. package/public/_next/static/chunks/049jf9s0z~cli.js +5 -0
  30. package/public/_next/static/chunks/0mhs.xtrl10bx.css +1 -0
  31. package/public/_next/static/chunks/0njbtjaz48fw6.js +31 -0
  32. package/public/_next/static/chunks/0nv56i_s5cuzh.js +1 -0
  33. package/public/_next/static/chunks/0ozj8lowkja2v.js +1 -0
  34. package/public/_next/static/chunks/0rxy0xkqa_3on.js +6 -0
  35. package/public/_next/static/chunks/0th7jtcn7x3uc.js +6 -0
  36. package/public/_next/static/chunks/0v07aq9b8c~c4.js +5 -0
  37. package/public/_next/static/chunks/0wm_~5kuh.ots.js +31 -0
  38. package/public/_next/static/chunks/0x0nx44ub6fmc.js +1 -0
  39. package/public/_next/static/chunks/1365saokawb2b.css +1 -0
  40. package/public/_next/static/chunks/turbopack-0qtoh2fca~nc8.js +1 -0
  41. package/public/_next/static/chunks/turbopack-129sj.l69irpg.js +1 -0
  42. package/public/_next/static/mRojh1Ci0tjmSkgj_7ecu/_buildManifest.js +11 -0
  43. package/public/_next/static/mRojh1Ci0tjmSkgj_7ecu/_clientMiddlewareManifest.js +1 -0
  44. package/public/_next/static/mRojh1Ci0tjmSkgj_7ecu/_ssgManifest.js +1 -0
  45. package/public/_next/static/zGgAiq7Yp5kzCwj2dVIc8/_buildManifest.js +11 -0
  46. package/public/_next/static/zGgAiq7Yp5kzCwj2dVIc8/_clientMiddlewareManifest.js +1 -0
  47. package/public/_next/static/zGgAiq7Yp5kzCwj2dVIc8/_ssgManifest.js +1 -0
  48. package/public/_not-found/__next._full.txt +16 -0
  49. package/public/_not-found/__next._head.txt +6 -0
  50. package/public/_not-found/__next._index.txt +5 -0
  51. package/public/_not-found/__next._not-found.__PAGE__.txt +5 -0
  52. package/public/_not-found/__next._not-found.txt +5 -0
  53. package/public/_not-found/__next._tree.txt +2 -0
  54. package/public/_not-found.html +1 -0
  55. package/public/_not-found.txt +16 -0
  56. package/public/index.html +1 -0
  57. package/public/index.txt +18 -0
@@ -0,0 +1,6 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25661,(e,t,r)=>{"use strict";var n=e.r(34416),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useState,i=n.useEffect,a=n.useLayoutEffect,l=n.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!o(e,r)}catch(e){return!0}}var u="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),n=s({inst:{value:r,getSnapshot:t}}),o=n[0].inst,u=n[1];return a(function(){o.value=r,o.getSnapshot=t,c(o)&&u({inst:o})},[e,r,t]),i(function(){return c(o)&&u({inst:o}),e(function(){c(o)&&u({inst:o})})},[e]),l(r),r};r.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u},56032,(e,t,r)=>{"use strict";t.exports=e.r(25661)},20206,(e,t,r)=>{"use strict";var n=e.r(34416),o=e.r(56032),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=o.useSyncExternalStore,a=n.useRef,l=n.useEffect,c=n.useMemo,u=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,o){var d=a(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;var f=i(e,(d=c(function(){function e(e){if(!l){if(l=!0,i=e,e=n(e),void 0!==o&&h.hasValue){var t=h.value;if(o(t,e))return a=t}return a=e}if(t=a,s(i,e))return t;var r=n(e);return void 0!==o&&o(t,r)?(i=e,t):(i=e,a=r)}var i,a,l=!1,c=void 0===r?null:r;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,r,n,o]))[0],d[1]);return l(function(){h.hasValue=!0,h.value=f},[f]),u(f),f}},96482,(e,t,r)=>{"use strict";t.exports=e.r(20206)},17661,e=>{"use strict";let t,r,n,o,s,i,a;var l,c,u,d,h,f,p,m,g,b=e.i(54710),y=e.i(34416);let x=e.i(13073).default.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";async function v(){let e=await fetch(`${x}/agents`);if(!e.ok)throw Error(`Failed to fetch agents: ${e.status}`);return e.json()}async function w(e){let t=await fetch(`${x}/agent/${e}`);if(!t.ok)throw Error(`Failed to fetch agent: ${t.status}`);return t.json()}async function k(e){let t=await fetch(`${x}/agent/${e}/resolve`,{method:"POST"});if(!t.ok)throw Error(`Failed to resolve agent: ${t.status}`)}async function S(e){let t=await fetch(`${x}/agent/${e}/pause`,{method:"POST"});if(!t.ok)throw Error(`Failed to pause agent: ${t.status}`)}async function E(e){let t=await fetch(`${x}/agent/${e}/resume`,{method:"POST"});if(!t.ok)throw Error(`Failed to resume agent: ${t.status}`)}async function C(e,t){let r=await fetch(`${x}/agent/${e}/instruction`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({instruction:t})});if(!r.ok)throw Error(`Failed to send instruction: ${r.status}`)}let j=Object.create(null);j.open="0",j.close="1",j.ping="2",j.pong="3",j.message="4",j.upgrade="5",j.noop="6";let _=Object.create(null);Object.keys(j).forEach(e=>{_[j[e]]=e});let O={type:"error",data:"parser error"},T="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),N="function"==typeof ArrayBuffer,R=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,A=({type:e,data:t},r,n)=>{if(T&&t instanceof Blob)if(r)return n(t);else return M(t,n);if(N&&(t instanceof ArrayBuffer||R(t)))if(r)return n(t);else return M(new Blob([t]),n);return n(j[e]+(t||""))},M=(e,t)=>{let r=new FileReader;return r.onload=function(){t("b"+(r.result.split(",")[1]||""))},r.readAsDataURL(e)};function P(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",z="u"<typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<D.length;e++)z[D.charCodeAt(e)]=e;let I="function"==typeof ArrayBuffer,B=(e,t)=>{if("string"!=typeof e)return{type:"message",data:q(e,t)};let r=e.charAt(0);return"b"===r?{type:"message",data:L(e.substring(1),t)}:_[r]?e.length>1?{type:_[r],data:e.substring(1)}:{type:_[r]}:O},L=(e,t)=>I?q((e=>{let t=.75*e.length,r=e.length,n,o=0,s,i,a,l;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);let c=new ArrayBuffer(t),u=new Uint8Array(c);for(n=0;n<r;n+=4)s=z[e.charCodeAt(n)],i=z[e.charCodeAt(n+1)],a=z[e.charCodeAt(n+2)],l=z[e.charCodeAt(n+3)],u[o++]=s<<2|i>>4,u[o++]=(15&i)<<4|a>>2,u[o++]=(3&a)<<6|63&l;return c})(e),t):{base64:!0,data:e},q=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer;function W(e){return e.reduce((e,t)=>e+t.length,0)}function F(e,t){if(e[0].length===t)return e.shift();let r=new Uint8Array(t),n=0;for(let o=0;o<t;o++)r[o]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function H(e){if(e){var t=e;for(var r in H.prototype)t[r]=H.prototype[r];return t}}H.prototype.on=H.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},H.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},H.prototype.off=H.prototype.removeListener=H.prototype.removeAllListeners=H.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<n.length;o++)if((r=n[o])===t||r.fn===t){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},H.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){r=r.slice(0);for(var n=0,o=r.length;n<o;++n)r[n].apply(this,t)}return this},H.prototype.emitReserved=H.prototype.emit,H.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},H.prototype.hasListeners=function(e){return!!this.listeners(e).length};let $="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),U="u">typeof self?self:"u">typeof window?window:Function("return this")();function Y(e,...t){return t.reduce((t,r)=>(e.hasOwnProperty(r)&&(t[r]=e[r]),t),{})}let V=U.setTimeout,X=U.clearTimeout;function G(e,t){t.useNativeTimers?(e.setTimeoutFn=V.bind(U),e.clearTimeoutFn=X.bind(U)):(e.setTimeoutFn=U.setTimeout.bind(U),e.clearTimeoutFn=U.clearTimeout.bind(U))}function K(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class Q extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}}class J extends H{constructor(e){super(),this.writable=!1,G(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,r){return super.emitReserved("error",new Q(e,t,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return("opening"===this.readyState||"open"===this.readyState)&&(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=B(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return -1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&443!==Number(this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){let t=function(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}(e);return t.length?"?"+t:""}}class Z extends J{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||t()})),this.writable||(e++,this.once("drain",function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};((e,t)=>{let r=e.split("\x1e"),n=[];for(let e=0;e<r.length;e++){let o=B(r[e],t);if(n.push(o),"error"===o.type)break}return n})(e,this.socket.binaryType).forEach(t),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){var t;let r,n,o;this.writable=!1,t=e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})},n=Array(r=e.length),o=0,e.forEach((e,s)=>{A(e,!1,e=>{n[s]=e,++o===r&&t(n.join("\x1e"))})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=K()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}}let ee=!1;try{ee="u">typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}let et=ee;function er(){}class en extends Z{constructor(e){if(super(e),"u">typeof location){const t="https:"===location.protocol;let r=location.port;r||(r=t?"443":"80"),this.xd="u">typeof location&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,t){let r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(e,t)=>{this.onError("xhr post error",e,t)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,t)=>{this.onError("xhr poll error",e,t)}),this.pollXhr=e}}class eo extends H{constructor(e,t,r){super(),this.createRequest=e,G(this,r),this._opts=r,this._method=r.method||"GET",this._uri=t,this._data=void 0!==r.data?r.data:null,this._create()}_create(){var e;let t=Y(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(t);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders)for(let e in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}catch(e){}if("POST"===this._method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null==(e=this._opts.cookieJar)||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null==(e=this._opts.cookieJar)||e.parseCookies(r.getResponseHeader("set-cookie"))),4===r.readyState&&(200===r.status||1223===r.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof r.status?r.status:0)},0))},r.send(this._data)}catch(e){this.setTimeoutFn(()=>{this._onError(e)},0);return}"u">typeof document&&(this._index=eo.requestsCount++,eo.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=er,e)try{this._xhr.abort()}catch(e){}"u">typeof document&&delete eo.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}function es(){for(let e in eo.requests)eo.requests.hasOwnProperty(e)&&eo.requests[e].abort()}eo.requestsCount=0,eo.requests={},"u">typeof document&&("function"==typeof attachEvent?attachEvent("onunload",es):"function"==typeof addEventListener&&addEventListener("onpagehide"in U?"pagehide":"unload",es,!1));let ei=(o=ea({xdomain:!1}))&&null!==o.responseType;function ea(e){let t=e.xdomain;try{if("u">typeof XMLHttpRequest&&(!t||et))return new XMLHttpRequest}catch(e){}if(!t)try{return new U[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}}let el="u">typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class ec extends J{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,r=el?{}:Y(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,r)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let r=e[t],n=t===e.length-1;A(r,this.supportsBinary,e=>{try{this.doWrite(r,e)}catch(e){}n&&$(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=K()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}let eu=U.WebSocket||U.MozWebSocket,ed={websocket:class extends ec{createSocket(e,t,r){return el?new eu(e,t,r):t?new eu(e,t):new eu(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends J{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{var n,o;let s,i,a,l,c=(n=Number.MAX_SAFE_INTEGER,o=this.socket.binaryType,r||(r=new TextDecoder),s=[],i=0,a=-1,l=!1,new TransformStream({transform(e,t){for(s.push(e);;){if(0===i){if(1>W(s))break;let e=F(s,1);l=(128&e[0])==128,i=(a=127&e[0])<126?3:126===a?1:2}else if(1===i){if(2>W(s))break;let e=F(s,2);a=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),i=3}else if(2===i){if(8>W(s))break;let e=F(s,8),r=new DataView(e.buffer,e.byteOffset,e.length),n=r.getUint32(0);if(n>2097151){t.enqueue(O);break}a=0x100000000*n+r.getUint32(4),i=3}else{if(W(s)<a)break;let e=F(s,a);t.enqueue(B(l?e:r.decode(e),o)),i=0}if(0===a||a>n){t.enqueue(O);break}}}})),u=e.readable.pipeThrough(c).getReader(),d=new TransformStream({transform(e,r){var n;n=t=>{let n,o=t.length;if(o<126)new DataView((n=new Uint8Array(1)).buffer).setUint8(0,o);else if(o<65536){let e=new DataView((n=new Uint8Array(3)).buffer);e.setUint8(0,126),e.setUint16(1,o)}else{let e=new DataView((n=new Uint8Array(9)).buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(o))}e.data&&"string"!=typeof e.data&&(n[0]|=128),r.enqueue(n),r.enqueue(t)},T&&e.data instanceof Blob?e.data.arrayBuffer().then(P).then(n):N&&(e.data instanceof ArrayBuffer||R(e.data))?n(P(e.data)):A(e,!1,e=>{t||(t=new TextEncoder),n(t.encode(e))})}});d.readable.pipeTo(e.writable),this._writer=d.writable.getWriter();let h=()=>{u.read().then(({done:e,value:t})=>{e||(this.onPacket(t),h())}).catch(e=>{})};h();let f={type:"open"};this.query.sid&&(f.data=`{"sid":"${this.query.sid}"}`),this._writer.write(f).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let r=e[t],n=t===e.length-1;this._writer.write(r).then(()=>{n&&$(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null==(e=this._transport)||e.close()}},polling:class extends en{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=ei&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new eo(ea,this.uri(),e)}}},eh=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ef=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ep(e){var t,r;let n,o;if(e.length>8e3)throw"URI too long";let s=e,i=e.indexOf("["),a=e.indexOf("]");-1!=i&&-1!=a&&(e=e.substring(0,i)+e.substring(i,a).replace(/:/g,";")+e.substring(a,e.length));let l=eh.exec(e||""),c={},u=14;for(;u--;)c[ef[u]]=l[u]||"";return -1!=i&&-1!=a&&(c.source=s,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),n=(t=c.path).replace(/\/{2,9}/g,"/").split("/"),("/"==t.slice(0,1)||0===t.length)&&n.splice(0,1),"/"==t.slice(-1)&&n.splice(n.length-1,1),c.pathNames=n,r=c.query,o={},r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(o[t]=r)}),c.queryKey=o,c}let em="function"==typeof addEventListener&&"function"==typeof removeEventListener,eg=[];em&&addEventListener("offline",()=>{eg.forEach(e=>e())},!1);class eb extends H{constructor(e,t){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(t=e,e=null),e){const r=ep(e);t.hostname=r.host,t.secure="https"===r.protocol||"wss"===r.protocol,t.port=r.port,r.query&&(t.query=r.query)}else t.host&&(t.hostname=ep(t.host).host);G(this,t),this.secure=null!=t.secure?t.secure:"u">typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("u">typeof location?location.hostname:"localhost"),this.port=t.port||("u">typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{let t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},r=e.split("&");for(let e=0,n=r.length;e<n;e++){let n=r[e].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}(this.opts.query)),em&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},eg.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){let t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);let r=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);let e=this.opts.rememberUpgrade&&eb.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";let t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",eb.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let t=Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){let r=this.writeBuffer[t].data;if(r&&(e+="string"==typeof r?function(e){let t=0,r=0;for(let n=0,o=e.length;n<o;n++)(t=e.charCodeAt(n))<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(n++,r+=4);return r}(r):Math.ceil(1.33*(r.byteLength||r.size))),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,$(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,r){return this._sendPacket("message",e,t,r),this}send(e,t,r){return this._sendPacket("message",e,t,r),this}_sendPacket(e,t,r,n){if("function"==typeof t&&(n=t,t=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;let o={type:e,data:t,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return("opening"===this.readyState||"open"===this.readyState)&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(eb.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),em&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let e=eg.indexOf(this._offlineEventListener);-1!==e&&eg.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}eb.protocol=4;class ey extends eb{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),r=!1;eb.priorWebsocketSuccess=!1;let n=()=>{r||(t.send([{type:"ping",data:"probe"}]),t.once("packet",e=>{if(!r)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;eb.priorWebsocketSuccess="websocket"===t.name,this.transport.pause(()=>{r||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let e=Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}}))};function o(){r||(r=!0,c(),t.close(),t=null)}let s=e=>{let r=Error("probe error: "+e);r.transport=t.name,o(),this.emitReserved("upgradeError",r)};function i(){s("transport closed")}function a(){s("socket closed")}function l(e){t&&e.name!==t.name&&o()}let c=()=>{t.removeListener("open",n),t.removeListener("error",s),t.removeListener("close",i),this.off("close",a),this.off("upgrading",l)};t.once("open",n),t.once("error",s),t.once("close",i),this.once("close",a),this.once("upgrading",l),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{r||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}class ex extends ey{constructor(e,t={}){const r="object"==typeof e?e:t;(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(e=>ed[e]).filter(e=>!!e)),super(e,r)}}ex.protocol;let ev="function"==typeof ArrayBuffer,ew=Object.prototype.toString,ek="function"==typeof Blob||"u">typeof Blob&&"[object BlobConstructor]"===ew.call(Blob),eS="function"==typeof File||"u">typeof File&&"[object FileConstructor]"===ew.call(File);function eE(e){return ev&&(e instanceof ArrayBuffer||("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer))||ek&&e instanceof Blob||eS&&e instanceof File}let eC=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];(l=g||(g={}))[l.CONNECT=0]="CONNECT",l[l.DISCONNECT=1]="DISCONNECT",l[l.EVENT=2]="EVENT",l[l.ACK=3]="ACK",l[l.CONNECT_ERROR=4]="CONNECT_ERROR",l[l.BINARY_EVENT=5]="BINARY_EVENT",l[l.BINARY_ACK=6]="BINARY_ACK";class ej extends H{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},"function"==typeof e?{reviver:e}:e)}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw Error("got plaintext data when reconstructing a packet");let r=(t=this.decodeString(e)).type===g.BINARY_EVENT;r||t.type===g.BINARY_ACK?(t.type=r?g.EVENT:g.ACK,this.reconstructor=new e_(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(eE(e)||e.base64)if(this.reconstructor)(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw Error("got binary data when not reconstructing a packet");else throw Error("Unknown type: "+e)}decodeString(e){let t=0,r={type:Number(e.charAt(0))};if(void 0===g[r.type])throw Error("unknown packet type "+r.type);if(r.type===g.BINARY_EVENT||r.type===g.BINARY_ACK){let n=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);let o=e.substring(n,t);if(o!=Number(o)||"-"!==e.charAt(t))throw Error("Illegal attachments");let s=Number(o);if(!eO(s)||s<0)throw Error("Illegal attachments");if(s>this.opts.maxAttachments)throw Error("too many attachments");r.attachments=s}if("/"===e.charAt(t+1)){let n=t+1;for(;++t&&","!==e.charAt(t)&&t!==e.length;);r.nsp=e.substring(n,t)}else r.nsp="/";let n=e.charAt(t+1);if(""!==n&&Number(n)==n){let n=t+1;for(;++t;){let r=e.charAt(t);if(null==r||Number(r)!=r){--t;break}if(t===e.length)break}r.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){let n=this.tryParse(e.substr(t));if(ej.isPayloadValid(r.type,n))r.data=n;else throw Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case g.CONNECT:return eT(t);case g.DISCONNECT:return void 0===t;case g.CONNECT_ERROR:return"string"==typeof t||eT(t);case g.EVENT:case g.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===eC.indexOf(t[0]));case g.ACK:case g.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class e_{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t,r;let e=(t=this.reconPack,r=this.buffers,t.data=function e(t,r){if(!t)return t;if(t&&!0===t._placeholder){if("number"==typeof t.num&&t.num>=0&&t.num<r.length)return r[t.num];throw Error("illegal attachments")}if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=e(t[n],r);else if("object"==typeof t)for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=e(t[n],r));return t}(t.data,r),delete t.attachments,t);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}let eO=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function eT(e){return"[object Object]"===Object.prototype.toString.call(e)}function eN(e,t,r){return e.on(t,r),function(){e.off(t,r)}}e.s(["Decoder",0,ej,"Encoder",0,class{constructor(e){this.replacer=e}encode(e){return(e.type===g.EVENT||e.type===g.ACK)&&function e(t,r){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let r=0,n=t.length;r<n;r++)if(e(t[r]))return!0;return!1}if(eE(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1==arguments.length)return e(t.toJSON(),!0);for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return!0;return!1}(e)?this.encodeAsBinary({type:e.type===g.EVENT?g.BINARY_EVENT:g.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===g.BINARY_EVENT||e.type===g.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t,r,n=(t=[],r=e.data,e.data=function e(t,r){if(!t)return t;if(eE(t)){let e={_placeholder:!0,num:r.length};return r.push(t),e}if(Array.isArray(t)){let n=Array(t.length);for(let o=0;o<t.length;o++)n[o]=e(t[o],r);return n}if("object"==typeof t&&!(t instanceof Date)){let n={};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=e(t[o],r));return n}return t}(r,t),e.attachments=t.length,{packet:e,buffers:t}),o=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(o),s}},"PacketType",0,g,"isPacketValid",0,function(e){var t;return"string"==typeof e.nsp&&(void 0===(t=e.id)||eO(t))&&function(e,t){switch(e){case g.CONNECT:return void 0===t||eT(t);case g.DISCONNECT:return void 0===t;case g.EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===eC.indexOf(t[0]));case g.ACK:return Array.isArray(t);case g.CONNECT_ERROR:return"string"==typeof t||eT(t);default:return!1}}(e.type,e.data)},"protocol",0,5],53192);let eR=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class eA extends H{constructor(e,t,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[eN(e,"open",this.onopen.bind(this)),eN(e,"packet",this.onpacket.bind(this)),eN(e,"error",this.onerror.bind(this)),eN(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var r,n,o;if(eR.hasOwnProperty(e))throw Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let s={type:g.EVENT,data:t};if(s.options={},s.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){let e=this.ids++,r=t.pop();this._registerAckCallback(e,r),s.id=e}let i=null==(n=null==(r=this.io.engine)?void 0:r.transport)?void 0:n.writable,a=this.connected&&!(null==(o=this.io.engine)?void 0:o._hasPingExpired());return this.flags.volatile&&!i||(a?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(e,t){var r;let n=null!=(r=this.flags.timeout)?r:this._opts.ackTimeout;if(void 0===n){this.acks[e]=t;return}let o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,Error("operation has timed out"))},n),s=(...e)=>{this.io.clearTimeoutFn(o),t.apply(this,e)};s.withError=!0,this.acks[e]=s}emitWithAck(e,...t){return new Promise((r,n)=>{let o=(e,t)=>e?n(e):r(t);o.withError=!0,t.push(o),this.emit(e,...t)})}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());let r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...n)=>(this._queue[0],null!==e?r.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...n)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;let t=this._queue[0];(!t.pending||e)&&(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:g.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){let t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case g.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case g.EVENT:case g.BINARY_EVENT:this.onevent(e);break;case g.ACK:case g.BINARY_ACK:this.onack(e);break;case g.DISCONNECT:this.ondisconnect();break;case g.CONNECT_ERROR:this.destroy();let t=Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){let t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length)for(let t of this._anyListeners.slice())t.apply(this,e);super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,r=!1;return function(...n){r||(r=!0,t.packet({type:g.ACK,id:e,data:n}))}}onack(e){let t=this.acks[e.id];"function"==typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:g.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r]){t.splice(r,1);break}}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r]){t.splice(r,1);break}}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(let t of this._anyOutgoingListeners.slice())t.apply(this,e.data)}}var eM=e.i(53192);function eP(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}eP.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(1&Math.floor(10*t))==0?e-r:e+r}return 0|Math.min(e,this.max)},eP.prototype.reset=function(){this.attempts=0},eP.prototype.setMin=function(e){this.ms=e},eP.prototype.setMax=function(e){this.max=e},eP.prototype.setJitter=function(e){this.jitter=e};class eD extends H{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,G(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(r=t.randomizationFactor)?r:.5),this.backoff=new eP({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const n=t.parser||eM;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null==(t=this.backoff)||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null==(t=this.backoff)||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null==(t=this.backoff)||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new ex(this.uri,this.opts);let t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;let n=eN(t,"open",function(){r.onopen(),e&&e()}),o=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},s=eN(t,"error",o);if(!1!==this._timeout){let e=this._timeout,r=this.setTimeoutFn(()=>{n(),o(Error("timeout")),t.close()},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(n),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(eN(e,"ping",this.onping.bind(this)),eN(e,"data",this.ondata.bind(this)),eN(e,"error",this.onerror.bind(this)),eN(e,"close",this.onclose.bind(this)),eN(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){$(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new eA(this,e,t),this.nsps[e]=r),r}_destroy(e){for(let e of Object.keys(this.nsps))if(this.nsps[e].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var r;this.cleanup(),null==(r=this.engine)||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()}))},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}let ez={};function eI(e,t){let r;"object"==typeof e&&(t=e,e=void 0);let n=function(e,t="",r){let n=e;r=r||"u">typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==r?r.protocol+"//"+e:"https://"+e),n=ep(e)),!n.port&&(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";let o=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port+t,n.href=n.protocol+"://"+o+(r&&r.port===n.port?"":":"+n.port),n}(e,(t=t||{}).path||"/socket.io"),o=n.source,s=n.id,i=n.path,a=ez[s]&&i in ez[s].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||a?r=new eD(o,t):(ez[s]||(ez[s]=new eD(o,t)),r=ez[s]),n.query&&!t.query&&(t.query=n.queryKey),r.socket(n.path,t)}Object.assign(eI,{Manager:eD,Socket:eA,io:eI,connect:eI});let eB=null;function eL({error:e,onRetry:t}){return(0,b.jsxs)("header",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Orchestrator"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"Monitor your AI agents in real time"})]}),e&&(0,b.jsx)("button",{onClick:t,className:"rounded-lg bg-red-50 px-3 py-1.5 text-xs font-medium text-red-700 transition-colors hover:bg-red-100 dark:bg-red-950/30 dark:text-red-400 dark:hover:bg-red-950/50",children:"Connection error — retry"})]})}let eq=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),eW=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var eF={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let eH=(0,y.createContext)({}),e$=(0,y.forwardRef)(({color:e,size:t,strokeWidth:r,absoluteStrokeWidth:n,className:o="",children:s,iconNode:i,...a},l)=>{let{size:c=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:h="currentColor",className:f=""}=(0,y.useContext)(eH)??{},p=n??d?24*Number(r??u)/Number(t??c):r??u;return(0,y.createElement)("svg",{ref:l,...eF,width:t??c??eF.width,height:t??c??eF.height,stroke:e??h,strokeWidth:p,className:eq("lucide",f,o),...!s&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(a)&&{"aria-hidden":"true"},...a},[...i.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(s)?s:[s]])}),eU=(e,t)=>{let r=(0,y.forwardRef)(({className:r,...n},o)=>(0,y.createElement)(e$,{ref:o,iconNode:t,className:eq(`lucide-${eW(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...n}));return r.displayName=eW(e),r},eY=eU("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),eV=eU("triangle-alert",[["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",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),eX=eU("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),eG=eU("layers",[["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",key:"zw3jo"}],["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",key:"1wduqc"}],["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",key:"kqbvx6"}]]),eK=eU("circle-pause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);function eQ(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=function e(t){var r,n,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var s=t.length;for(r=0;r<s;r++)t[r]&&(n=e(t[r]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}(e))&&(n&&(n+=" "),n+=t);return n}let eJ=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),eZ=[],e0=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let n=e[t],o=r.nextPart.get(n);if(o){let r=e0(e,t+1,o);if(r)return r}let s=r.validators;if(null===s)return;let i=0===t?e.join("-"):e.slice(t).join("-"),a=s.length;for(let e=0;e<a;e++){let t=s[e];if(t.validator(i))return t.classGroupId}},e1=(e,t)=>{let r=eJ();for(let n in e)e2(e[n],r,n,t);return r},e2=(e,t,r,n)=>{let o=e.length;for(let s=0;s<o;s++)e5(e[s],t,r,n)},e5=(e,t,r,n)=>{"string"==typeof e?e4(e,t,r):"function"==typeof e?e3(e,t,r,n):e6(e,t,r,n)},e4=(e,t,r)=>{(""===e?t:e8(t,e)).classGroupId=r},e3=(e,t,r,n)=>{e9(e)?e2(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},e6=(e,t,r,n)=>{let o=Object.entries(e),s=o.length;for(let e=0;e<s;e++){let[s,i]=o[e];e2(i,e8(t,s),r,n)}},e8=(e,t)=>{let r=e,n=t.split("-"),o=n.length;for(let e=0;e<o;e++){let t=n[e],o=r.nextPart.get(t);o||(o=eJ(),r.nextPart.set(t,o)),r=o}return r},e9=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,e7=[],te=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),tt=/\s+/,tr=e=>{let t;if("string"==typeof e)return e;let r="";for(let n=0;n<e.length;n++)e[n]&&(t=tr(e[n]))&&(r&&(r+=" "),r+=t);return r},tn=[],to=e=>{let t=t=>t[e]||tn;return t.isThemeGetter=!0,t},ts=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ti=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ta=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,tl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,tu=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,td=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,th=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tf=e=>ta.test(e),tp=e=>!!e&&!Number.isNaN(Number(e)),tm=e=>!!e&&Number.isInteger(Number(e)),tg=e=>e.endsWith("%")&&tp(e.slice(0,-1)),tb=e=>tl.test(e),ty=()=>!0,tx=e=>tc.test(e)&&!tu.test(e),tv=()=>!1,tw=e=>td.test(e),tk=e=>th.test(e),tS=e=>!tj(e)&&!tP(e),tE=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),tC=e=>tF(e,tY,tv),tj=e=>ts.test(e),t_=e=>tF(e,tV,tx),tO=e=>tF(e,tX,tp),tT=e=>tF(e,tK,ty),tN=e=>tF(e,tG,tv),tR=e=>tF(e,t$,tv),tA=e=>tF(e,tU,tk),tM=e=>tF(e,tQ,tw),tP=e=>ti.test(e),tD=e=>tH(e,tV),tz=e=>tH(e,tG),tI=e=>tH(e,t$),tB=e=>tH(e,tY),tL=e=>tH(e,tU),tq=e=>tH(e,tQ,!0),tW=e=>tH(e,tK,!0),tF=(e,t,r)=>{let n=ts.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},tH=(e,t,r=!1)=>{let n=ti.exec(e);return!!n&&(n[1]?t(n[1]):r)},t$=e=>"position"===e||"percentage"===e,tU=e=>"image"===e||"url"===e,tY=e=>"length"===e||"size"===e||"bg-size"===e,tV=e=>"length"===e,tX=e=>"number"===e,tG=e=>"family-name"===e,tK=e=>"number"===e||"weight"===e,tQ=e=>"shadow"===e,tJ=((e,...t)=>{let r,n,o,s,i=e=>{let t=n(e);if(t)return t;let s=((e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:s,postfixLookupClassGroupIds:i}=t,a=[],l=e.trim().split(tt),c="";for(let e=l.length-1;e>=0;e-=1){let t,u=l[e],{isExternal:d,modifiers:h,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=r(u);if(d){c=u+(c.length>0?" "+c:c);continue}let g=!!m;if(g){let e=(t=n(p.substring(0,m)))&&i[t]?n(p):void 0;e&&e!==t&&(t=e,g=!1)}else t=n(p);if(!t){if(!g||!(t=n(p))){c=u+(c.length>0?" "+c:c);continue}g=!1}let b=0===h.length?"":1===h.length?h[0]:s(h).join(":"),y=f?b+"!":b,x=y+t;if(a.indexOf(x)>-1)continue;a.push(x);let v=o(t,g);for(let e=0;e<v.length;++e){let t=v[e];a.push(y+t)}c=u+(c.length>0?" "+c:c)}return c})(e,r);return o(e,s),s};return s=a=>{var l;let c;return n=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null),o=(o,s)=>{r[o]=s,++t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(o(e,t),t):void 0},set(e,t){e in r?r[e]=t:o(e,t)}}})((l=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:r}=e,n=e=>{let t,r=[],n=0,o=0,s=0,i=e.length;for(let a=0;a<i;a++){let i=e[a];if(0===n&&0===o){if(":"===i){r.push(e.slice(s,a)),s=a+1;continue}if("/"===i){t=a;continue}}"["===i?n++:"]"===i?n--:"("===i?o++:")"===i&&o--}let a=0===r.length?e:e.slice(s),l=a,c=!1;return a.endsWith("!")?(l=a.slice(0,-1),c=!0):a.startsWith("!")&&(l=a.slice(1),c=!0),te(r,c,l,t&&t>s?t-s:void 0)};if(t){let e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):te(e7,!1,t,void 0,!0)}if(r){let e=n;n=t=>r({className:t,parseClassName:e})}return n})(l),sortModifiers:(c=new Map,l.orderSensitiveModifiers.forEach((e,t)=>{c.set(e,1e6+t)}),e=>{let t=[],r=[];for(let n=0;n<e.length;n++){let o=e[n],s="["===o[0],i=c.has(o);s||i?(r.length>0&&(r.sort(),t.push(...r),r=[]),t.push(o)):r.push(o)}return r.length>0&&(r.sort(),t.push(...r)),t}),postfixLookupClassGroupIds:(e=>{let t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let e=0;e<r.length;e++)t[r[e]]=!0;return t})(l),...(e=>{let t=(e=>{let{theme:t,classGroups:r}=e;return e1(r,t)})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var r;let t,n,o;return -1===(r=e).slice(1,-1).indexOf(":")?void 0:(n=(t=r.slice(1,-1)).indexOf(":"),(o=t.slice(0,n))?"arbitrary.."+o:void 0)}let n=e.split("-"),o=+(""===n[0]&&n.length>1);return e0(n,o,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=n[e],o=r[e];if(t){if(o){let e=Array(o.length+t.length);for(let t=0;t<o.length;t++)e[t]=o[t];for(let r=0;r<t.length;r++)e[o.length+r]=t[r];return e}return t}return o||eZ}return r[e]||eZ}}})(l)}).cache.get,o=r.cache.set,s=i,i(a)},(...e)=>s(((...e)=>{let t,r,n=0,o="";for(;n<e.length;)(t=e[n++])&&(r=tr(t))&&(o&&(o+=" "),o+=r);return o})(...e))})(()=>{let e=to("color"),t=to("font"),r=to("text"),n=to("font-weight"),o=to("tracking"),s=to("leading"),i=to("breakpoint"),a=to("container"),l=to("spacing"),c=to("radius"),u=to("shadow"),d=to("inset-shadow"),h=to("text-shadow"),f=to("drop-shadow"),p=to("blur"),m=to("perspective"),g=to("aspect"),b=to("ease"),y=to("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...v(),tP,tj],k=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto","contain","none"],E=()=>[tP,tj,l],C=()=>[tf,"full","auto",...E()],j=()=>[tm,"none","subgrid",tP,tj],_=()=>["auto",{span:["full",tm,tP,tj]},tm,tP,tj],O=()=>[tm,"auto",tP,tj],T=()=>["auto","min","max","fr",tP,tj],N=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],R=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...E()],M=()=>[tf,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],P=()=>[tf,"screen","full","dvw","lvw","svw","min","max","fit",...E()],D=()=>[tf,"screen","full","lh","dvh","lvh","svh","min","max","fit",...E()],z=()=>[e,tP,tj],I=()=>[...v(),tI,tR,{position:[tP,tj]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",tB,tC,{size:[tP,tj]}],q=()=>[tg,tD,t_],W=()=>["","none","full",c,tP,tj],F=()=>["",tp,tD,t_],H=()=>["solid","dashed","dotted","double"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],U=()=>[tp,tg,tI,tR],Y=()=>["","none",p,tP,tj],V=()=>["none",tp,tP,tj],X=()=>["none",tp,tP,tj],G=()=>[tp,tP,tj],K=()=>[tf,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[tb],breakpoint:[tb],color:[ty],container:[tb],"drop-shadow":[tb],ease:["in","out","in-out"],font:[tS],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[tb],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[tb],shadow:[tb],spacing:["px",tp],text:[tb],"text-shadow":[tb],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",tf,tj,tP,g]}],container:["container"],"container-type":[{"@container":["","normal","size",tP,tj]}],"container-named":[tE],columns:[{columns:[tp,tj,tP,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{"inset-s":C(),start:C()}],end:[{"inset-e":C(),end:C()}],"inset-bs":[{"inset-bs":C()}],"inset-be":[{"inset-be":C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[tm,"auto",tP,tj]}],basis:[{basis:[tf,"full","auto",a,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[tp,tf,"auto","initial","none",tj]}],grow:[{grow:["",tp,tP,tj]}],shrink:[{shrink:["",tp,tP,tj]}],order:[{order:[tm,"first","last","none",tP,tj]}],"grid-cols":[{"grid-cols":j()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":j()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...N(),"normal"]}],"justify-items":[{"justify-items":[...R(),"normal"]}],"justify-self":[{"justify-self":["auto",...R()]}],"align-content":[{content:["normal",...N()]}],"align-items":[{items:[...R(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...R(),{baseline:["","last"]}]}],"place-content":[{"place-content":N()}],"place-items":[{"place-items":[...R(),"baseline"]}],"place-self":[{"place-self":["auto",...R()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pbs:[{pbs:E()}],pbe:[{pbe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:M()}],"inline-size":[{inline:["auto",...P()]}],"min-inline-size":[{"min-inline":["auto",...P()]}],"max-inline-size":[{"max-inline":["none",...P()]}],"block-size":[{block:["auto",...D()]}],"min-block-size":[{"min-block":["auto",...D()]}],"max-block-size":[{"max-block":["none",...D()]}],w:[{w:[a,"screen",...M()]}],"min-w":[{"min-w":[a,"screen","none",...M()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...M()]}],h:[{h:["screen","lh",...M()]}],"min-h":[{"min-h":["screen","lh","none",...M()]}],"max-h":[{"max-h":["screen","lh",...M()]}],"font-size":[{text:["base",r,tD,t_]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,tW,tT]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tg,tj]}],"font-family":[{font:[tz,tN,t]}],"font-features":[{"font-features":[tj]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,tP,tj]}],"line-clamp":[{"line-clamp":[tp,"none",tP,tO]}],leading:[{leading:[s,...E()]}],"list-image":[{"list-image":["none",tP,tj]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",tP,tj]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:z()}],"text-color":[{text:z()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:[tp,"from-font","auto",tP,t_]}],"text-decoration-color":[{decoration:z()}],"underline-offset":[{"underline-offset":[tp,"auto",tP,tj]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"tab-size":[{tab:[tm,tP,tj]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tP,tj]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",tP,tj]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},tm,tP,tj],radial:["",tP,tj],conic:[tm,tP,tj]},tL,tA]}],"bg-color":[{bg:z()}],"gradient-from-pos":[{from:q()}],"gradient-via-pos":[{via:q()}],"gradient-to-pos":[{to:q()}],"gradient-from":[{from:z()}],"gradient-via":[{via:z()}],"gradient-to":[{to:z()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-bs":[{"border-bs":F()}],"border-w-be":[{"border-be":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":F()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...H(),"hidden","none"]}],"divide-style":[{divide:[...H(),"hidden","none"]}],"border-color":[{border:z()}],"border-color-x":[{"border-x":z()}],"border-color-y":[{"border-y":z()}],"border-color-s":[{"border-s":z()}],"border-color-e":[{"border-e":z()}],"border-color-bs":[{"border-bs":z()}],"border-color-be":[{"border-be":z()}],"border-color-t":[{"border-t":z()}],"border-color-r":[{"border-r":z()}],"border-color-b":[{"border-b":z()}],"border-color-l":[{"border-l":z()}],"divide-color":[{divide:z()}],"outline-style":[{outline:[...H(),"none","hidden"]}],"outline-offset":[{"outline-offset":[tp,tP,tj]}],"outline-w":[{outline:["",tp,tD,t_]}],"outline-color":[{outline:z()}],shadow:[{shadow:["","none",u,tq,tM]}],"shadow-color":[{shadow:z()}],"inset-shadow":[{"inset-shadow":["none",d,tq,tM]}],"inset-shadow-color":[{"inset-shadow":z()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:z()}],"ring-offset-w":[{"ring-offset":[tp,t_]}],"ring-offset-color":[{"ring-offset":z()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":z()}],"text-shadow":[{"text-shadow":["none",h,tq,tM]}],"text-shadow-color":[{"text-shadow":z()}],opacity:[{opacity:[tp,tP,tj]}],"mix-blend":[{"mix-blend":[...$(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":$()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[tp]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":z()}],"mask-image-linear-to-color":[{"mask-linear-to":z()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":z()}],"mask-image-t-to-color":[{"mask-t-to":z()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":z()}],"mask-image-r-to-color":[{"mask-r-to":z()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":z()}],"mask-image-b-to-color":[{"mask-b-to":z()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":z()}],"mask-image-l-to-color":[{"mask-l-to":z()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":z()}],"mask-image-x-to-color":[{"mask-x-to":z()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":z()}],"mask-image-y-to-color":[{"mask-y-to":z()}],"mask-image-radial":[{"mask-radial":[tP,tj]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":z()}],"mask-image-radial-to-color":[{"mask-radial-to":z()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":v()}],"mask-image-conic-pos":[{"mask-conic":[tp]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":z()}],"mask-image-conic-to-color":[{"mask-conic-to":z()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",tP,tj]}],filter:[{filter:["","none",tP,tj]}],blur:[{blur:Y()}],brightness:[{brightness:[tp,tP,tj]}],contrast:[{contrast:[tp,tP,tj]}],"drop-shadow":[{"drop-shadow":["","none",f,tq,tM]}],"drop-shadow-color":[{"drop-shadow":z()}],grayscale:[{grayscale:["",tp,tP,tj]}],"hue-rotate":[{"hue-rotate":[tp,tP,tj]}],invert:[{invert:["",tp,tP,tj]}],saturate:[{saturate:[tp,tP,tj]}],sepia:[{sepia:["",tp,tP,tj]}],"backdrop-filter":[{"backdrop-filter":["","none",tP,tj]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[tp,tP,tj]}],"backdrop-contrast":[{"backdrop-contrast":[tp,tP,tj]}],"backdrop-grayscale":[{"backdrop-grayscale":["",tp,tP,tj]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[tp,tP,tj]}],"backdrop-invert":[{"backdrop-invert":["",tp,tP,tj]}],"backdrop-opacity":[{"backdrop-opacity":[tp,tP,tj]}],"backdrop-saturate":[{"backdrop-saturate":[tp,tP,tj]}],"backdrop-sepia":[{"backdrop-sepia":["",tp,tP,tj]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",tP,tj]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[tp,"initial",tP,tj]}],ease:[{ease:["linear","initial",b,tP,tj]}],delay:[{delay:[tp,tP,tj]}],animate:[{animate:["none",y,tP,tj]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,tP,tj]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:G()}],"skew-x":[{"skew-x":G()}],"skew-y":[{"skew-y":G()}],transform:[{transform:[tP,tj,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":["translate-none"],zoom:[{zoom:[tm,tP,tj]}],accent:[{accent:z()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:z()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",tP,tj]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":z()}],"scrollbar-track-color":[{"scrollbar-track":z()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mbs":[{"scroll-mbs":E()}],"scroll-mbe":[{"scroll-mbe":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pbs":[{"scroll-pbs":E()}],"scroll-pbe":[{"scroll-pbe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",tP,tj]}],fill:[{fill:["none",...z()]}],"stroke-w":[{stroke:[tp,tD,t_,tO]}],stroke:[{stroke:["none",...z()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function tZ(...e){return tJ(eQ(e))}function t0({className:e,size:t="default",...r}){return(0,b.jsx)("div",{"data-slot":"card","data-size":t,className:tZ("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...r})}function t1({className:e,...t}){return(0,b.jsx)("div",{"data-slot":"card-content",className:tZ("px-4 group-data-[size=sm]/card:px-3",e),...t})}function t2({className:e,...t}){return(0,b.jsx)("div",{"data-slot":"skeleton",className:tZ("animate-pulse rounded-md bg-muted",e),...t})}let t5=[{label:"Total Agents",icon:eG,color:"text-foreground",iconBg:"bg-muted"},{label:"Running",icon:eY,color:"text-blue-600 dark:text-blue-400",iconBg:"bg-blue-50 dark:bg-blue-950/30"},{label:"Paused",icon:eK,color:"text-amber-600 dark:text-amber-400",iconBg:"bg-amber-50 dark:bg-amber-950/30"},{label:"Needs Attention",icon:eV,color:"text-rose-600 dark:text-rose-400",iconBg:"bg-rose-50 dark:bg-rose-950/30"},{label:"Completed",icon:eX,color:"text-emerald-600 dark:text-emerald-400",iconBg:"bg-emerald-50 dark:bg-emerald-950/30"}];function t4({agents:e,loading:t}){let r=(0,y.useMemo)(()=>(function(e){let t=0,r=0,n=0,o=0;for(let s of e)"running"===s.status&&t++,"paused"===s.status&&r++,s.needsAttention&&n++,"done"===s.status&&o++;return[e.length,t,r,n,o]})(e),[e]);return(0,b.jsx)("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-5",children:t5.map(({label:e,icon:n,color:o,iconBg:s},i)=>(0,b.jsx)(t0,{children:(0,b.jsxs)(t1,{className:"flex items-center gap-4 p-5",children:[(0,b.jsx)("div",{className:tZ("rounded-lg p-2.5",s,o),children:(0,b.jsx)(n,{className:"h-4 w-4"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:e}),t?(0,b.jsx)(t2,{className:"mt-1 h-7 w-10"}):(0,b.jsx)("p",{className:"text-2xl font-semibold tracking-tight tabular-nums",children:r[i]})]})]})},e))})}function t3({agent:e,onResolve:t}){let[r,n]=(0,y.useState)(!1),o=(0,y.useCallback)(async()=>{n(!0);try{await k(e.id),t()}finally{n(!1)}},[e.id,t]);return(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4 rounded-lg border border-border bg-card px-4 py-2.5",children:[(0,b.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.name}),(0,b.jsx)("span",{className:"flex-1 truncate text-sm text-muted-foreground",children:e.attentionReason}),(0,b.jsx)("button",{type:"button",disabled:r,onClick:o,className:"shrink-0 rounded-lg bg-secondary px-3 py-1.5 text-xs font-medium text-foreground transition-colors hover:bg-secondary/80 disabled:opacity-50",children:r?"Resolving...":"Resolve"})]})}function t6({agents:e,onResolve:t}){let r=(0,y.useMemo)(()=>e.filter(e=>e.needsAttention),[e]);return 0===r.length?null:(0,b.jsxs)("div",{className:"rounded-xl border border-amber-500/40 bg-background p-4",children:[(0,b.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,b.jsx)(eV,{className:"h-4 w-4 text-amber-500"}),(0,b.jsxs)("h2",{className:"text-sm font-semibold text-amber-500",children:["Needs Attention (",r.length,")"]})]}),(0,b.jsx)("div",{className:"flex flex-col gap-2",children:r.map(e=>(0,b.jsx)(t3,{agent:e,onResolve:t},e.id))})]})}let t8=Symbol.for("constructDateFrom");function t9(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&t8 in e?e[t8](t):e instanceof Date?new e.constructor(t):new Date(t)}let t7={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function re(e){return (t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}let rt={date:re({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:re({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:re({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},rr={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function rn(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,o=r?.width?String(r.width):t;n=e.formattingValues[o]||e.formattingValues[t]}else{let t=e.defaultWidth,o=r?.width?String(r.width):e.defaultWidth;n=e.values[o]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function ro(e){return(t,r={})=>{let n,o=r.width,s=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;let a=i[0],l=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}(l,e=>e.test(a)):function(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}(l,e=>e.test(a));return n=e.valueCallback?e.valueCallback(c):c,{value:n=r.valueCallback?r.valueCallback(n):n,rest:t.slice(a.length)}}}let rs={code:"en-US",formatDistance:(e,t,r)=>{let n,o=t7[e];if(n="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),r?.addSuffix)if(r.comparison&&r.comparison>0)return"in "+n;else return n+" ago";return n},formatLong:rt,formatRelative:(e,t,r,n)=>rr[e],localize:{ordinalNumber:(e,t)=>{let r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:rn({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:rn({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:rn({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:rn({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:rn({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(c={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{let r=e.match(c.matchPattern);if(!r)return null;let n=r[0],o=e.match(c.parsePattern);if(!o)return null;let s=c.valueCallback?c.valueCallback(o[0]):o[0];return{value:s=t.valueCallback?t.valueCallback(s):s,rest:e.slice(n.length)}}),era:ro({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ro({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:ro({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ro({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ro({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},ri={};function ra(e,t){return t9(t||e,e)}function rl(e){let t=ra(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),e-r}function rc(e,...t){let r=t9.bind(null,e||t.find(e=>"object"==typeof e));return t.map(r)}function ru(e,t){let r=ra(e)-ra(t);return r<0?-1:r>0?1:r}function rd(e,t){return function(e,t,r){var n;let o,s=r?.locale??ri.locale??rs,i=ru(e,t);if(isNaN(i))throw RangeError("Invalid time value");let a=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:i}),[l,c]=rc(r?.in,...i>0?[t,e]:[e,t]),u=(n=void 0,e=>{let t=(n?Math[n]:Math.trunc)(e);return 0===t?0:t})((ra(c)-ra(l))/1e3),d=Math.round((u-(rl(c)-rl(l))/1e3)/60);if(d<2)if(r?.includeSeconds)if(u<5)return s.formatDistance("lessThanXSeconds",5,a);else if(u<10)return s.formatDistance("lessThanXSeconds",10,a);else if(u<20)return s.formatDistance("lessThanXSeconds",20,a);else if(u<40)return s.formatDistance("halfAMinute",0,a);else if(u<60)return s.formatDistance("lessThanXMinutes",1,a);else return s.formatDistance("xMinutes",1,a);else if(0===d)return s.formatDistance("lessThanXMinutes",1,a);else return s.formatDistance("xMinutes",d,a);if(d<45)return s.formatDistance("xMinutes",d,a);if(d<90)return s.formatDistance("aboutXHours",1,a);if(d<1440){let e=Math.round(d/60);return s.formatDistance("aboutXHours",e,a)}if(d<2520)return s.formatDistance("xDays",1,a);else if(d<43200){let e=Math.round(d/1440);return s.formatDistance("xDays",e,a)}else if(d<86400)return o=Math.round(d/43200),s.formatDistance("aboutXMonths",o,a);if((o=function(e,t){var r,n;let o,s,i,a,[l,c,u]=rc(void 0,e,e,t),d=ru(c,u),h=Math.abs(function(e,t){let[r,n]=rc(void 0,e,t);return 12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth())}(c,u));if(h<1)return 0;1===c.getMonth()&&c.getDate()>27&&c.setDate(30),c.setMonth(c.getMonth()-d*h);let f=ru(c,u)===-d;+(o=ra(l,void 0),r=void 0,(s=ra(o,r?.in)).setHours(23,59,59,999),s)==+(n=void 0,a=(i=ra(o,n?.in)).getMonth(),i.setFullYear(i.getFullYear(),a+1,0),i.setHours(23,59,59,999),i)&&1===h&&1===ru(l,u)&&(f=!1);let p=d*(h-f);return 0===p?0:p}(c,l))<12){let e=Math.round(d/43200);return s.formatDistance("xMonths",e,a)}{let e=o%12,t=Math.trunc(o/12);return e<3?s.formatDistance("aboutXYears",t,a):e<9?s.formatDistance("overXYears",t,a):s.formatDistance("almostXYears",t+1,a)}}(e,t9(e,Date.now()),t)}function rh({className:e,...t}){return(0,b.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,b.jsx)("table",{"data-slot":"table",className:tZ("w-full caption-bottom text-sm",e),...t})})}function rf({className:e,...t}){return(0,b.jsx)("thead",{"data-slot":"table-header",className:tZ("[&_tr]:border-b",e),...t})}function rp({className:e,...t}){return(0,b.jsx)("tbody",{"data-slot":"table-body",className:tZ("[&_tr:last-child]:border-0",e),...t})}function rm({className:e,...t}){return(0,b.jsx)("tr",{"data-slot":"table-row",className:tZ("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",e),...t})}function rg({className:e,...t}){return(0,b.jsx)("th",{"data-slot":"table-head",className:tZ("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",e),...t})}function rb({className:e,...t}){return(0,b.jsx)("td",{"data-slot":"table-cell",className:tZ("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",e),...t})}let ry={running:{label:"Running",dot:"bg-blue-500 animate-pulse",bg:"bg-blue-50 dark:bg-blue-950/20",text:"text-blue-700 dark:text-blue-400",border:"border-blue-200 dark:border-blue-800/60"},paused:{label:"Paused",dot:"bg-amber-400",bg:"bg-amber-50 dark:bg-amber-950/20",text:"text-amber-700 dark:text-amber-400",border:"border-amber-200 dark:border-amber-800/60"},waiting:{label:"Waiting",dot:"bg-indigo-400",bg:"bg-indigo-50 dark:bg-indigo-950/20",text:"text-indigo-700 dark:text-indigo-400",border:"border-indigo-200 dark:border-indigo-800/60"},error:{label:"Error",dot:"bg-red-500 animate-pulse",bg:"bg-red-50 dark:bg-red-950/20",text:"text-red-700 dark:text-red-400",border:"border-red-200 dark:border-red-800/60"},done:{label:"Done",dot:"bg-neutral-400 dark:bg-neutral-500",bg:"bg-neutral-50 dark:bg-neutral-800/30",text:"text-neutral-600 dark:text-neutral-400",border:"border-neutral-200 dark:border-neutral-700/60"}};function rx({status:e}){let t=ry[e]??ry.done;return(0,b.jsxs)("span",{className:tZ("inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-xs font-medium",t.bg,t.text,t.border),children:[(0,b.jsx)("span",{className:tZ("h-1.5 w-1.5 rounded-full",t.dot)}),t.label]})}let rv=eU("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),rw=`import { Agent } from "orchestrator-sdk";
2
+
3
+ const agent = new Agent("my-agent");
4
+ await agent.start();
5
+ await agent.step("doing something...");
6
+ await agent.end();`;function rk(){return(0,b.jsxs)("div",{className:"flex flex-col items-center gap-5 rounded-xl border border-dashed py-16 text-center",children:[(0,b.jsx)("div",{className:"rounded-full bg-muted p-3",children:(0,b.jsx)(rv,{className:"h-6 w-6 text-muted-foreground"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-base font-medium",children:"No agents yet"}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Install the SDK and start your first agent to see it here."})]}),(0,b.jsx)("code",{className:"rounded-lg bg-muted px-4 py-2 text-sm font-mono",children:"npm install orchestrator-sdk"}),(0,b.jsx)("pre",{className:"max-w-sm rounded-lg bg-muted px-6 py-4 text-left text-xs leading-relaxed font-mono",children:rw})]})}function rS(){return(0,b.jsxs)(rh,{children:[(0,b.jsx)(rf,{children:(0,b.jsxs)(rm,{children:[(0,b.jsx)(rg,{children:"Name"}),(0,b.jsx)(rg,{children:"Status"}),(0,b.jsx)(rg,{children:"Last message"}),(0,b.jsx)(rg,{className:"text-right",children:"Last update"})]})}),(0,b.jsx)(rp,{children:Array.from({length:4}).map((e,t)=>(0,b.jsxs)(rm,{children:[(0,b.jsx)(rb,{children:(0,b.jsx)(t2,{className:"h-4 w-28"})}),(0,b.jsx)(rb,{children:(0,b.jsx)(t2,{className:"h-5 w-16 rounded-full"})}),(0,b.jsx)(rb,{children:(0,b.jsx)(t2,{className:"h-4 w-48"})}),(0,b.jsx)(rb,{className:"text-right",children:(0,b.jsx)(t2,{className:"ml-auto h-4 w-24"})})]},t))})]})}function rE({agents:e,loading:t,onSelect:r}){let n=(0,y.useMemo)(()=>[...e].sort((e,t)=>new Date(t.lastUpdateAt).getTime()-new Date(e.lastUpdateAt).getTime()),[e]);return t?(0,b.jsx)(rS,{}):0===e.length?(0,b.jsx)(rk,{}):(0,b.jsx)("div",{className:"rounded-xl border",children:(0,b.jsxs)(rh,{children:[(0,b.jsx)(rf,{children:(0,b.jsxs)(rm,{className:"hover:bg-transparent",children:[(0,b.jsx)(rg,{children:"Name"}),(0,b.jsx)(rg,{children:"Status"}),(0,b.jsx)(rg,{children:"Last message"}),(0,b.jsx)(rg,{className:"text-right",children:"Last update"})]})}),(0,b.jsx)(rp,{children:n.map(e=>(0,b.jsxs)(rm,{className:"cursor-pointer transition-colors",onClick:()=>r(e.id),tabIndex:0,role:"button",onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),r(e.id))},children:[(0,b.jsx)(rb,{className:"font-medium",children:e.name}),(0,b.jsx)(rb,{children:(0,b.jsx)(rx,{status:e.status})}),(0,b.jsx)(rb,{className:"max-w-xs truncate text-muted-foreground",children:e.events[0]?.message??"—"}),(0,b.jsx)(rb,{className:"text-right text-muted-foreground",children:rd(new Date(e.lastUpdateAt),{addSuffix:!0})})]},e.id))})]})})}function rC(e,t){let r=ra(e,t?.in);return r.setHours(0,0,0,0),r}function rj(e,t){let r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??ri.weekStartsOn??ri.locale?.options?.weekStartsOn??0,n=ra(e,t?.in),o=n.getDay();return n.setDate(n.getDate()-(7*(o<r)+o-r)),n.setHours(0,0,0,0),n}function r_(e,t){return rj(e,{...t,weekStartsOn:1})}function rO(e,t){let r=ra(e,t?.in),n=r.getFullYear(),o=t9(r,0);o.setFullYear(n+1,0,4),o.setHours(0,0,0,0);let s=r_(o),i=t9(r,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);let a=r_(i);return r.getTime()>=s.getTime()?n+1:r.getTime()>=a.getTime()?n:n-1}function rT(e,t){let r=ra(e,t?.in),n=r.getFullYear(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??ri.firstWeekContainsDate??ri.locale?.options?.firstWeekContainsDate??1,s=t9(t?.in||e,0);s.setFullYear(n+1,0,o),s.setHours(0,0,0,0);let i=rj(s,t),a=t9(t?.in||e,0);a.setFullYear(n,0,o),a.setHours(0,0,0,0);let l=rj(a,t);return+r>=+i?n+1:+r>=+l?n:n-1}function rN(e,t){let r=Math.abs(e).toString().padStart(t,"0");return(e<0?"-":"")+r}let rR={y(e,t){let r=e.getFullYear(),n=r>0?r:1-r;return rN("yy"===t?n%100:n,t.length)},M(e,t){let r=e.getMonth();return"M"===t?String(r+1):rN(r+1,2)},d:(e,t)=>rN(e.getDate(),t.length),a(e,t){let r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>rN(e.getHours()%12||12,t.length),H:(e,t)=>rN(e.getHours(),t.length),m:(e,t)=>rN(e.getMinutes(),t.length),s:(e,t)=>rN(e.getSeconds(),t.length),S(e,t){let r=t.length;return rN(Math.trunc(e.getMilliseconds()*Math.pow(10,r-3)),t.length)}},rA={G:function(e,t,r){let n=+(e.getFullYear()>0);switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){let t=e.getFullYear();return r.ordinalNumber(t>0?t:1-t,{unit:"year"})}return rR.y(e,t)},Y:function(e,t,r,n){let o=rT(e,n),s=o>0?o:1-o;return"YY"===t?rN(s%100,2):"Yo"===t?r.ordinalNumber(s,{unit:"year"}):rN(s,t.length)},R:function(e,t){return rN(rO(e),t.length)},u:function(e,t){return rN(e.getFullYear(),t.length)},Q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return rN(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return rN(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){let n=e.getMonth();switch(t){case"M":case"MM":return rR.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){let n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return rN(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){let o,s,i,a,l=Math.round((rj(o=ra(e,n?.in),n)-(s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??ri.firstWeekContainsDate??ri.locale?.options?.firstWeekContainsDate??1,i=rT(o,n),(a=t9(n?.in||o,0)).setFullYear(i,0,s),a.setHours(0,0,0,0),rj(a,n)))/6048e5)+1;return"wo"===t?r.ordinalNumber(l,{unit:"week"}):rN(l,t.length)},I:function(e,t,r){let n,o,s,i=Math.round((r_(n=ra(e,void 0))-(o=rO(n,void 0),(s=t9(n,0)).setFullYear(o,0,4),s.setHours(0,0,0,0),r_(s)))/6048e5)+1;return"Io"===t?r.ordinalNumber(i,{unit:"week"}):rN(i,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):rR.d(e,t)},D:function(e,t,r){let n,o,s=function(e,t){let[r,n]=rc(void 0,e,t),o=rC(r),s=rC(n);return Math.round((o-rl(o)-(s-rl(s)))/864e5)}(o=ra(e,void 0),((n=ra(o,void 0)).setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n))+1;return"Do"===t?r.ordinalNumber(s,{unit:"dayOfYear"}):rN(s,t.length)},E:function(e,t,r){let n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){let o=e.getDay(),s=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return rN(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){let o=e.getDay(),s=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return rN(s,t.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){let n=e.getDay(),o=0===n?7:n;switch(t){case"i":return String(o);case"ii":return rN(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){let n,o=e.getHours();switch(n=12===o?"noon":0===o?"midnight":o/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){let n,o=e.getHours();switch(n=o>=17?"evening":o>=12?"afternoon":o>=4?"morning":"night",t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return rR.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):rR.H(e,t)},K:function(e,t,r){let n=e.getHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):rN(n,t.length)},k:function(e,t,r){let n=e.getHours();return(0===n&&(n=24),"ko"===t)?r.ordinalNumber(n,{unit:"hour"}):rN(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):rR.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):rR.s(e,t)},S:function(e,t){return rR.S(e,t)},X:function(e,t,r){let n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return rP(n);case"XXXX":case"XX":return rD(n);default:return rD(n,":")}},x:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"x":return rP(n);case"xxxx":case"xx":return rD(n);default:return rD(n,":")}},O:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+rM(n,":");default:return"GMT"+rD(n,":")}},z:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+rM(n,":");default:return"GMT"+rD(n,":")}},t:function(e,t,r){return rN(Math.trunc(e/1e3),t.length)},T:function(e,t,r){return rN(+e,t.length)}};function rM(e,t=""){let r=e>0?"-":"+",n=Math.abs(e),o=Math.trunc(n/60),s=n%60;return 0===s?r+String(o):r+String(o)+t+rN(s,2)}function rP(e,t){return e%60==0?(e>0?"-":"+")+rN(Math.abs(e)/60,2):rD(e,t)}function rD(e,t=""){let r=Math.abs(e);return(e>0?"-":"+")+rN(Math.trunc(r/60),2)+t+rN(r%60,2)}let rz=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},rI=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},rB={p:rI,P:(e,t)=>{let r,n=e.match(/(P+)(p+)?/)||[],o=n[1],s=n[2];if(!s)return rz(e,t);switch(o){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",rz(o,t)).replace("{{time}}",rI(s,t))}},rL=/^D+$/,rq=/^Y+$/,rW=["D","DD","YY","YYYY"],rF=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rH=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,r$=/^'([^]*?)'?$/,rU=/''/g,rY=/[a-zA-Z]/,rV=eU("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),rX=eU("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),rG=eU("coins",[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]]),rK=eU("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]),rQ=eU("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),rJ=eU("message-square-plus",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]]),rZ=eU("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]),r0=eU("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);e.s([],30266),e.i(30266);let r1=function(e,...t){let r=new URL("https://base-ui.com/production-error");return r.searchParams.set("code",e.toString()),t.forEach(e=>r.searchParams.append("args[]",e)),`Base UI error #${e}; visit ${r} for the full message.`},r2=y.createContext(void 0);function r5(e){let t=y.useContext(r2);if(!1===e&&void 0===t)throw Error(r1(27));return t}let r4={};function r3(e,t){let r=y.useRef(r4);return r.current===r4&&(r.current=e(t)),r}function r6(e,t,r,n){var o,s,i,a,l;let c=r3(r8).current;return o=c,s=e,i=t,a=r,l=n,(o.refs[0]!==s||o.refs[1]!==i||o.refs[2]!==a||o.refs[3]!==l)&&r9(c,[e,t,r,n]),c.callback}function r8(){return{callback:null,cleanup:null,refs:[]}}function r9(e,t){if(e.refs=t,t.every(e=>null==e)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),null!=r){let n=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let o=t[e];if(null!=o)switch(typeof o){case"function":{let t=o(r);"function"==typeof t&&(n[e]=t);break}case"object":o.current=r}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let r=t[e];if(null!=r)switch(typeof r){case"function":{let t=n[e];"function"==typeof t?t():r(null);break}case"object":r.current=null}}}}}}let r7=parseInt(y.version,10);function ne(e){if(!y.isValidElement(e))return null;let t=e.props;return(r7>=19?t?.ref:e.ref)??null}function nt(e,t){return e&&!t?e:!e&&t?t:e||t?{...e,...t}:void 0}function nr(){}Object.freeze([]);let nn=Object.freeze({}),no={};function ns(e,t,r,n,o){if(!r&&!n&&!o&&!e)return ni(t);let s=ni(e);return t&&(s=na(s,t)),r&&(s=na(s,r)),n&&(s=na(s,n)),o&&(s=na(s,o)),s}function ni(e){return nc(e)?{...nu(e,no)}:function(e){let t={...e};for(let e in t){let r=t[e];nl(e,r)&&(t[e]=nd(r))}return t}(e)}function na(e,t){return nc(t)?nu(t,e):function(e,t){if(!t)return e;for(let r in t){let n=t[r];switch(r){case"style":e[r]=nt(e.style,n);break;case"className":e[r]=nf(e.className,n);break;default:nl(r,n)?e[r]=function(e,t){return t?e?(...r)=>{let n=r[0];if(np(n)){nh(n);let o=t(...r);return n.baseUIHandlerPrevented||e?.(...r),o}let o=t(...r);return e?.(...r),o}:nd(t):e}(e[r],n):e[r]=n}}return e}(e,t)}function nl(e,t){let r=e.charCodeAt(0),n=e.charCodeAt(1),o=e.charCodeAt(2);return 111===r&&110===n&&o>=65&&o<=90&&("function"==typeof t||void 0===t)}function nc(e){return"function"==typeof e}function nu(e,t){return nc(e)?e(t):e??no}function nd(e){return e?(...t)=>{let r=t[0];return np(r)&&nh(r),e(...t)}:e}function nh(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function nf(e,t){return t?e?t+" "+e:t:e}function np(e){return null!=e&&"object"==typeof e&&"nativeEvent"in e}function nm(e,t,r={}){let n=t.render,o=function(e,t={}){var r,n,o;let{className:s,style:i,render:a}=e,{state:l=nn,ref:c,props:u,stateAttributesMapping:d,enabled:h=!0}=t,f=h?"function"==typeof s?s(l):s:void 0,p=h?"function"==typeof i?i(l):i:void 0,m=h?function(e,t){let r={};for(let n in e){let o=e[n];if(t?.hasOwnProperty(n)){let e=t[n](o);null!=e&&Object.assign(r,e);continue}!0===o?r[`data-${n.toLowerCase()}`]="":o&&(r[`data-${n.toLowerCase()}`]=o.toString())}return r}(l,d):nn,g=h&&u?function(e){if(Array.isArray(e)){if(0===e.length)return no;if(1===e.length)return ni(e[0]);let t=ni(e[0]);for(let r=1;r<e.length;r+=1)t=na(t,e[r]);return t}return ns(void 0,e)}(u):void 0,b=h?nt(m,g)??{}:nn;if("u">typeof document)if(h)if(Array.isArray(c)){let e;r=[b.ref,ne(a),...c],n=e=r3(r8).current,o=r,(n.refs.length!==o.length||n.refs.some((e,t)=>e!==o[t]))&&r9(e,r),b.ref=e.callback}else b.ref=r6(b.ref,ne(a),c);else r6(null,null);return h?(void 0!==f&&(b.className=nf(b.className,f)),void 0!==p&&(b.style=nt(b.style,p)),b):nn}(t,r);return!1===r.enabled?null:function(e,t,r,n){if(t){if("function"==typeof t)return t(r,n);let e=ns(r,t.props);e.ref=r.ref;let o=t;return o?.$$typeof===ng&&(o=y.Children.toArray(t)[0]),y.cloneElement(o,e)}if(e&&"string"==typeof e){var o,s;return o=e,s=r,"button"===o?(0,y.createElement)("button",{type:"button",...s,key:s.key}):"img"===o?(0,y.createElement)("img",{alt:"",...s,key:s.key}):y.createElement(o,s)}throw Error(r1(8))}(e,n,o,r.state??nn)}let ng=Symbol.for("react.lazy"),nb=((u={}).startingStyle="data-starting-style",u.endingStyle="data-ending-style",u),ny={[nb.startingStyle]:""},nx={[nb.endingStyle]:""},nv={transitionStatus:e=>"starting"===e?ny:"ending"===e?nx:null},nw=((d={}).open="data-open",d.closed="data-closed",d[d.startingStyle=nb.startingStyle]="startingStyle",d[d.endingStyle=nb.endingStyle]="endingStyle",d.anchorHidden="data-anchor-hidden",d.side="data-side",d.align="data-align",d),nk=((h={}).popupOpen="data-popup-open",h.pressed="data-pressed",h),nS={[nk.popupOpen]:""};nk.popupOpen,nk.pressed;let nE={[nw.open]:""},nC={[nw.closed]:""},nj={[nw.anchorHidden]:""},n_={open:e=>e?nS:null},nO={open:e=>e?nE:nC,anchorHidden:e=>e?nj:null},nT={...nO,...nv},nN=y.forwardRef(function(e,t){let{render:r,className:n,style:o,forceRender:s=!1,...i}=e,{store:a}=r5(),l=a.useState("open"),c=a.useState("nested"),u=a.useState("mounted");return nm("div",e,{state:{open:l,transitionStatus:a.useState("transitionStatus")},ref:[a.context.backdropRef,t],stateAttributesMapping:nT,props:[{role:"presentation",hidden:!u,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!c})});function nR(){return"u">typeof window}function nA(e){return nP(e)?(e.nodeName||"").toLowerCase():"#document"}function nM(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function nP(e){return!!nR()&&(e instanceof Node||e instanceof nM(e).Node)}function nD(e){return!!nR()&&(e instanceof Element||e instanceof nM(e).Element)}function nz(e){return!!nR()&&(e instanceof HTMLElement||e instanceof nM(e).HTMLElement)}function nI(e){return!(!nR()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof nM(e).ShadowRoot)}function nB(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=nq(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&"inline"!==o&&"contents"!==o}function nL(e){return/^(html|body|#document)$/.test(nA(e))}function nq(e){return nM(e).getComputedStyle(e)}let nW=y[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],nF=nW&&nW!==y.useLayoutEffect?nW:e=>e();function nH(e){let t=r3(n$).current;return t.next=e,nF(t.effect),t.trampoline}function n$(){let e={next:void 0,callback:nU,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function nU(){}let nY="u">typeof document?y.useLayoutEffect:()=>{},nV=y.createContext(void 0);function nX(e={}){let{disabled:t=!1,focusableWhenDisabled:r,tabIndex:n=0,native:o=!0,composite:s}=e,i=y.useRef(null),a=function(e=!1){let t=y.useContext(nV);if(void 0===t&&!e)throw Error(r1(16));return t}(!0),l=s??void 0!==a,{props:c}=function(e){let{focusableWhenDisabled:t,disabled:r,composite:n=!1,tabIndex:o=0,isNativeButton:s}=e,i=n&&!1!==t,a=n&&!1===t;return{props:y.useMemo(()=>{let e={onKeyDown(e){r&&t&&"Tab"!==e.key&&e.preventDefault()}};return n||(e.tabIndex=o,!s&&r&&(e.tabIndex=t?o:-1)),(s&&(t||i)||!s&&r)&&(e["aria-disabled"]=r),s&&(!t||a)&&(e.disabled=r),e},[n,r,t,i,a,s,o])}}({focusableWhenDisabled:r,disabled:t,composite:l,tabIndex:n,isNativeButton:o}),u=y.useCallback(()=>{let e=i.current;nG(e)&&l&&t&&void 0===c.disabled&&e.disabled&&(e.disabled=!1)},[t,c.disabled,l]);return nY(u,[u]),{getButtonProps:y.useCallback((e={})=>{let{onClick:r,onMouseDown:n,onKeyUp:s,onKeyDown:i,onPointerDown:a,...u}=e;return ns({type:o?"button":void 0,onClick(e){t?e.preventDefault():r?.(e)},onMouseDown(e){t||n?.(e)},onKeyDown(e){var n;if(t||(nh(e),i?.(e),e.baseUIHandlerPrevented))return;let s=e.target===e.currentTarget,a=e.currentTarget,c=nG(a),u=!o&&(n=a,!!(n?.tagName==="A"&&n?.href)),d=s&&(o?c:!u),h="Enter"===e.key,f=" "===e.key,p=a.getAttribute("role"),m=p?.startsWith("menuitem")||"option"===p||"gridcell"===p;if(s&&l&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),u||o&&c?(a.click(),e.preventBaseUIHandler()):d&&(r?.(e),e.preventBaseUIHandler());return}d&&(!o&&(f||h)&&e.preventDefault(),!o&&h&&r?.(e))},onKeyUp(e){t||((nh(e),s?.(e),e.target===e.currentTarget&&o&&l&&nG(e.currentTarget)&&" "===e.key)?e.preventDefault():!e.baseUIHandlerPrevented&&(e.target!==e.currentTarget||o||l||" "!==e.key||r?.(e)))},onPointerDown(e){t?e.preventDefault():a?.(e)}},o?void 0:{role:"button"},c,u)},[t,c,l,o]),buttonRef:nH(e=>{i.current=e,u()})}}function nG(e){return nz(e)&&"BUTTON"===e.tagName}function nK(e,t,r,n){let o=!1,s=!1,i=n??nn;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:r,...i}}e.s(["cancelOpen",0,"cancel-open","chipRemovePress",0,"chip-remove-press","clearPress",0,"clear-press","closePress",0,"close-press","closeWatcher",0,"close-watcher","decrementPress",0,"decrement-press","disabled",0,"disabled","drag",0,"drag","escapeKey",0,"escape-key","focusOut",0,"focus-out","imperativeAction",0,"imperative-action","incrementPress",0,"increment-press","inputBlur",0,"input-blur","inputChange",0,"input-change","inputClear",0,"input-clear","inputPaste",0,"input-paste","inputPress",0,"input-press","itemPress",0,"item-press","keyboard",0,"keyboard","linkPress",0,"link-press","listNavigation",0,"list-navigation","none",0,"none","outsidePress",0,"outside-press","pointer",0,"pointer","scrub",0,"scrub","siblingOpen",0,"sibling-open","swipe",0,"swipe","trackPress",0,"track-press","triggerFocus",0,"trigger-focus","triggerHover",0,"trigger-hover","triggerPress",0,"trigger-press","wheel",0,"wheel","windowResize",0,"window-resize"],85604);var nQ=e.i(85604),nQ=nQ;let nJ=y.forwardRef(function(e,t){let{render:r,className:n,disabled:o=!1,nativeButton:s=!0,style:i,...a}=e,{store:l}=r5(),c=l.useState("open"),{getButtonProps:u,buttonRef:d}=nX({disabled:o,native:s});return nm("button",e,{state:{disabled:o},ref:[t,d],props:[{onClick:function(e){c&&l.setOpen(!1,nK(nQ.closePress,e.nativeEvent))}},a,u]})}),nZ={...y},n0=0,n1=nZ.useId;function n2(e,t){if(void 0!==n1){let r=n1();return e??(t?`${t}-${r}`:r)}return function(e,t="mui"){let[r,n]=y.useState(e),o=e||r;return y.useEffect(()=>{null==r&&(n0+=1,n(`${t}-${n0}`))},[r,t]),o}(e,t)}function n5(e){return n2(e,"base-ui")}let n4=y.forwardRef(function(e,t){let{render:r,className:n,style:o,id:s,...i}=e,{store:a}=r5(),l=n5(s);return a.useSyncedValueWithCleanup("descriptionElementId",l),nm("p",e,{ref:t,props:[{id:l},i]})});function n3(e,t,r,n){return e.addEventListener(t,r,n),()=>{e.removeEventListener(t,r,n)}}function n6(...e){return()=>{for(let t=0;t<e.length;t+=1){let r=e[t];r&&r()}}}function n8(e){let t=r3(n9,e).current;return t.next=e,nY(t.effect),t}function n9(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}let n7=[];function oe(e){y.useEffect(e,n7)}class ot{static create(){return new ot}currentId=0;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,t()},e)}isStarted(){return 0!==this.currentId}clear=()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)};disposeEffect=()=>this.clear}function or(){let e=r3(ot.create).current;return oe(e.disposeEffect),e}let on="u">typeof navigator,oo=function(){if(!on)return{platform:"",maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}(),os=function(){if(!on)return"";let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}(),oi=function(){if(!on)return"";let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(" "):navigator.userAgent}(),oa="u">typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter:none"),ol="MacIntel"===oo.platform&&oo.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(oo.platform);on&&/firefox/i.test(oi);let oc=on&&/apple/i.test(navigator.vendor);on&&/Edg/i.test(oi);let ou=on&&/android/i.test(os)||/android/i.test(oi);on&&os.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;let od=oi.includes("jsdom/"),oh=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let r=0;r<t.length;r+=1)t[r]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,this.callbacksCount-=1)}};class of{static create(){return new of}static request(e){return oh.request(e)}static cancel(e){return oh.cancel(e)}currentId=null;request(e){this.cancel(),this.currentId=oh.request(()=>{this.currentId=null,e()})}cancel=()=>{null!==this.currentId&&(oh.cancel(this.currentId),this.currentId=null)};disposeEffect=()=>this.cancel}function op(){let e=r3(of.create).current;return oe(e.disposeEffect),e}function om(e){return e?.ownerDocument||document}let og={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ob={...og,position:"fixed",top:0,left:0};({...og,position:"absolute"});let oy=y.forwardRef(function(e,t){let[r,n]=y.useState();return nY(()=>{oc&&n("button")},[]),(0,b.jsx)("span",{...e,ref:t,style:ob,"aria-hidden":!r||void 0,tabIndex:0,role:r,"data-base-ui-focus-guard":""})});function ox(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ov(e,t){if(!e||!t)return!1;let r=t.getRootNode?.();if(e.contains(t))return!0;if(r&&nI(r)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ow(e){return"composedPath"in e?e.composedPath()[0]:e.target}let ok="data-base-ui-focusable",oS="active",oE="selected";function oC(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function oj(e){return nz(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function o_(e){return!!e&&"combobox"===e.getAttribute("role")&&oj(e)}function oO(e){return e?e.hasAttribute(ok)?e:e.querySelector(`[${ok}]`)||e:null}function oT(e,t){let r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function oN(e){let t=e.type;return"click"===t||"mousedown"===t||"keydown"===t||"keyup"===t}function oR(e,t=e?nq(e):null){var r;return!!e&&!!e.isConnected&&!!t&&"hidden"!==(r=t).visibility&&"collapse"!==r.visibility&&("function"==typeof e.checkVisibility?e.checkVisibility():"none"!==t.display&&"contents"!==t.display)}function oA(e){for(let t of Array.from(e.children))if("summary"===nA(t))return t;return null}function oM(e){let t=e?nA(e):"";return null!=e&&e.matches('a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]')&&("summary"!==t||null!=e.parentElement&&"details"===nA(e.parentElement)&&oA(e.parentElement)===e)&&("details"!==t||null==oA(e))&&("input"!==t||"hidden"!==e.type)}function oP(e){if(!oM(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=function(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let r=e.getRootNode();return nI(r)?r.host:null}(t)){let r=t!==e,n="slot"===nA(t);if(t.hasAttribute("inert")||r&&"details"===nA(t)&&!t.open&&!function(e,t){let r=oA(t);return!!r&&(e===r||ov(r,e))}(e,t)||t.hasAttribute("hidden")||!n&&!function(e,t){let r=nq(e);return t?"none"!==r.display:oR(e,r)}(t,r))return!1}return!0}function oD(e){let t=e.tabIndex;if(t<0){let t=nA(e);if("details"===t||"audio"===t||"video"===t||nz(e)&&e.isContentEditable)return 0}return t}function oz(e){return"input"!==nA(e)?null:"radio"===e.type&&""!==e.name?e:null}function oI(e){if(nz(e)&&"slot"===nA(e)){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return nz(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function oB(e){return oP(e)&&oD(e)>=0}function oL(e){let t=[];return!function e(t,r){oI(t).forEach(t=>{oM(t)&&r.push(t),e(t,r)})}(e,t),t.filter(oP)}function oq(e){let t=oL(e);return t.filter(e=>oD(e)>=0&&function(e,t){let r=oz(e);if(!r)return!0;let n=t.find(e=>{let t=oz(e);return t?.name===r.name&&t.form===r.form&&t.checked});return n?n===r:t.find(e=>{let t=oz(e);return t?.name===r.name&&t.form===r.form})===r}(e,t))}function oW(e,t){let r=oq(e),n=r.length;if(0===n)return;let o=ox(om(e)),s=r.indexOf(o);return r[-1===s?1===t?0:n-1:s+t]}function oF(e){return oW(om(e).body,1)||e}function oH(e){return oW(om(e).body,-1)||e}function o$(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!ov(r,n)}function oU(e){let t=[];!function e(t,r,n){oI(t).forEach(t=>{nz(t)&&t.matches(r)&&n.push(t),e(t,r,n)})}(e,"[data-tabindex]",t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}function oY(e,t,r=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!r||t.context?.open?[t]:[],...oY(e,t.id,r)])}function oV(e,t){let r=[],n=e.find(e=>e.id===t)?.parentId;for(;n;){let t=e.find(e=>e.id===n);n=t?.parentId,t&&(r=r.concat(t))}return r}var nQ=nQ;function oX(e){return`data-base-ui-${e}`}let oG=0;function oK(e,t={}){let{preventScroll:r=!1,cancelPrevious:n=!0,sync:o=!1}=t;n&&cancelAnimationFrame(oG);let s=()=>e?.focus({preventScroll:r});if(o)return s(),nr;let i=requestAnimationFrame(s);return oG=i,()=>{oG===i&&(cancelAnimationFrame(i),oG=0)}}let oQ={inert:new WeakMap,"aria-hidden":new WeakMap},oJ="data-base-ui-inert",oZ={inert:new WeakSet,"aria-hidden":new WeakSet},o0=new WeakMap,o1=0,o2=(e,t)=>t.map(t=>{if(e.contains(t))return t;let r=function e(t){return t?nI(t)?t.host:e(t.parentNode):null}(t);return e.contains(r)?r:null}).filter(e=>null!=e),o5=e=>{let t=new Set;return e.forEach(e=>{let r=e;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},o4=(e,t,r)=>{let n=[],o=e=>{!e||r.has(e)||Array.from(e.children).forEach(e=>{"script"!==nA(e)&&(t.has(e)?o(e):n.push(e))})};return o(e),n};function o3(e,t={}){let{ariaHidden:r=!1,inert:n=!1,mark:o=!0,markerIgnoreElements:s=[]}=t,i=om(e[0]).body;return function(e,t,r,n,{mark:o=!0,markerIgnoreElements:s=[]}){let i=n?"inert":r?"aria-hidden":null,a=null,l=null,c=o2(t,e),u=new Set(o?o2(t,s):[]),d=o?o4(t,o5(c),new Set(c)).filter(e=>!u.has(e)):[],h=[],f=[];if(i){let e=oQ[i],r=oZ[i];l=r,a=e;let n=o2(t,Array.from(t.querySelectorAll("[aria-live]"))),o=c.concat(n);o4(t,o5(o),new Set(o)).forEach(t=>{let n=t.getAttribute(i),o=null!==n&&"false"!==n,s=(e.get(t)||0)+1;e.set(t,s),h.push(t),1===s&&o&&r.add(t),o||t.setAttribute(i,"inert"===i?"":"true")})}return o&&d.forEach(e=>{let t=(o0.get(e)||0)+1;o0.set(e,t),f.push(e),1===t&&e.setAttribute(oJ,"")}),o1+=1,()=>{a&&h.forEach(e=>{let t=(a.get(e)||0)-1;a.set(e,t),t||(!l?.has(e)&&i&&e.removeAttribute(i),l?.delete(e))}),o&&f.forEach(e=>{let t=(o0.get(e)||0)-1;o0.set(e,t),t||e.removeAttribute(oJ)}),(o1-=1)||(oQ.inert=new WeakMap,oQ["aria-hidden"]=new WeakMap,oZ.inert=new WeakSet,oZ["aria-hidden"]=new WeakSet,o0=new WeakMap)}}(e,i,r,n,{mark:o,markerIgnoreElements:s})}var o6=e.i(47869),nQ=nQ;let o8="data-base-ui-click-trigger",o9={clipPath:"inset(50%)",position:"fixed",top:0,left:0},o7=y.createContext(null),se=oX("portal"),st=y.forwardRef(function(e,t){let{children:r,container:n,className:o,render:s,renderGuards:i,style:a,...l}=e,{portalNode:c,portalSubtree:u}=function(e={}){let{ref:t,container:r,componentProps:n=nn,elementProps:o}=e,s=n2(),i=y.useContext(o7),a=i?.portalNode,[l,c]=y.useState(null),[u,d]=y.useState(null),h=nH(e=>{null!==e&&d(e)}),f=y.useRef(null);nY(()=>{if(null===r){f.current&&(f.current=null,d(null),c(null));return}if(null==s)return;let e=(r&&(nP(r)?r:r.current))??a??document.body;if(null==e){f.current&&(f.current=null,d(null),c(null));return}f.current!==e&&(f.current=e,d(null),c(e))},[r,a,s]);let p=nm("div",n,{ref:[t,h],props:[{id:s,[se]:""},o]});return{portalNode:u,portalSubtree:l&&p?o6.createPortal(p,l):null}}({container:n,ref:t,componentProps:e,elementProps:l}),d=y.useRef(null),h=y.useRef(null),f=y.useRef(null),p=y.useRef(null),[m,g]=y.useState(null),x=y.useRef(!1),v=m?.modal,w=m?.open,k="boolean"==typeof i?i:!!m&&!m.modal&&m.open&&!!c;y.useEffect(()=>{if(c&&!v)return n6(n3(c,"focusin",e,!0),n3(c,"focusout",e,!0));function e(e){c&&e.relatedTarget&&o$(e)&&("focusin"===e.type?x.current&&(oU(c),x.current=!1):(oq(c).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}),x.current=!0))}},[c,v]),y.useEffect(()=>{c&&!1===w&&(oU(c),x.current=!1)},[w,c]);let S=y.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:h,beforeInsideRef:f,afterInsideRef:p,portalNode:c,setFocusManagerState:g}),[c]);return(0,b.jsxs)(y.Fragment,{children:[u,(0,b.jsxs)(o7.Provider,{value:S,children:[k&&c&&(0,b.jsx)(oy,{"data-type":"outside",ref:d,onFocus:e=>{if(o$(e,c))f.current?.focus();else{let e=oH(m?m.domReference:null);e?.focus()}}}),k&&c&&(0,b.jsx)("span",{"aria-owns":c.id,style:o9}),c&&o6.createPortal(r,c),k&&c&&(0,b.jsx)(oy,{"data-type":"outside",ref:h,onFocus:e=>{if(o$(e,c))p.current?.focus();else{let t=oF(m?m.domReference:null);t?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,nK(nQ.focusOut,e.nativeEvent))}}})]})]})}),sr=y.createContext(null),sn=y.createContext(null),so=()=>y.useContext(sr)?.id||null,ss=e=>{let t=y.useContext(sn);return e??t};function si(e){return null==e?e:"current"in e?e.current:e}let sa=[];function sl(){sa=sa.filter(e=>e.deref()?.isConnected)}function sc(){return sl(),sa[sa.length-1]?.deref()}function su(e,t){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;let r=oL(e).filter(e=>{let t=e.getAttribute("data-tabindex")||"";return oB(e)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),n=e.getAttribute("tabindex");t.current.includes("floating")||0===r.length?"0"!==n&&e.setAttribute("tabindex","0"):("-1"!==n||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function sd(e){let{context:t,children:r,disabled:n=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:l=!0,openInteractionType:c="",nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:h,externalTree:f,getInsideElements:p}=e,m="rootStore"in t?t.rootStore:t,g=m.useState("open"),x=m.useState("domReferenceElement"),v=m.useState("floatingElement"),{events:w,dataRef:k}=m.context,S=nH(()=>k.current.floatingContext?.nodeId),E=!1===o,C=o_(x)&&E,j=y.useRef(["content"]),_=n8(o),O=n8(s),T=n8(c),N=ss(f),R=y.useContext(o7),A=y.useRef(!1),M=y.useRef(!1),P=y.useRef(!1),D=y.useRef(null),z=y.useRef(""),I=y.useRef(""),B=y.useRef(null),L=y.useRef(null),q=r6(B,h,R?.beforeInsideRef),W=r6(L,R?.afterInsideRef),F=or(),H=or(),$=op(),U=null!=R,Y=oO(v),V=nH((e=Y)=>e?oq(e):[]),X=nH(()=>p?.().filter(e=>null!=e)??[]);y.useEffect(()=>{if(!n&&a)return n3(om(Y),"keydown",function(e){"Tab"===e.key&&ov(Y,ox(om(Y)))&&0===V().length&&!C&&(e.preventDefault(),e.stopPropagation())})},[n,x,Y,a,j,C,V]),y.useEffect(()=>{if(n||!g)return;let e=om(Y);function t(){P.current=!1}return n6(n3(e,"pointerdown",function(e){let t=ow(e),r=X();P.current=!(ov(v,t)||ov(x,t)||ov(R?.portalNode,t)||r.some(e=>e===t||ov(e,t))),I.current=e.pointerType||"keyboard",t?.closest(`[${o8}]`)&&(M.current=!0)},!0),n3(e,"pointerup",t,!0),n3(e,"pointercancel",t,!0),n3(e,"keydown",function(){I.current="keyboard"},!0))},[n,v,x,Y,g,R,X]),y.useEffect(()=>{if(n||!l)return;let e=om(Y);function t(t){let r=t.relatedTarget,n=t.currentTarget,o=ow(t);queueMicrotask(()=>{let s=S(),l=m.context.triggerElements,c=X(),h=r?.hasAttribute(oX("focus-guard"))&&[B.current,L.current,R?.beforeInsideRef.current,R?.afterInsideRef.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,si(d),si(u)].includes(r),f=!(ov(x,r)||ov(v,r)||ov(r,v)||ov(R?.portalNode,r)||c.some(e=>e===r||ov(e,r))||null!=r&&l.hasElement(r)||l.hasMatchingElement(e=>ov(e,r))||h||N&&(oY(N.nodesRef.current,s).find(e=>ov(e.context?.elements.floating,r)||ov(e.context?.elements.domReference,r))||oV(N.nodesRef.current,s).find(e=>[e.context?.elements.floating,oO(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(n===x&&Y&&su(Y,j),i&&n!==x&&!oR(o)&&ox(e)===e.body){if(nz(Y)&&(Y.focus(),"popup"===i))return void $.request(()=>{Y.focus()});let e=V(),t=D.current,r=(t&&e.includes(t)?t:null)||e[e.length-1]||Y;nz(r)&&r.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(C||!a)&&r&&f&&!M.current&&(C||r!==sc())&&(A.current=!0,m.setOpen(!1,nK(nQ.focusOut,t)))})}let r=nz(x)?x:null;if(v||r)return n6(r&&n3(r,"focusout",t),r&&n3(r,"pointerdown",function(){M.current=!0,H.start(0,()=>{M.current=!1})}),v&&n3(v,"focusin",function(e){let t=ow(e);oB(t)&&(D.current=t)}),v&&n3(v,"focusout",t),v&&R&&n3(v,"focusout",function(){P.current||(k.current.insideReactTree=!0,F.start(0,()=>{k.current.insideReactTree=!1}))},!0))},[n,x,v,Y,a,N,R,m,l,i,V,C,S,j,k,F,H,$,u,d,X]),y.useEffect(()=>{if(n||!v||!g)return;let e=Array.from(R?.portalNode?.querySelectorAll(`[${oX("portal")}]`)||[]),t=N?oV(N.nodesRef.current,S()):[],r=t.find(e=>o_(e.context?.elements.domReference||null))?.context?.elements.domReference,o=o3([v,...e,B.current,L.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,...X(),r,si(d),si(u),C?x:null].filter(e=>null!=e),{ariaHidden:a||C,mark:!1}),s=o3([v,...e].filter(e=>null!=e));return()=>{s(),o()}},[g,n,x,v,a,j,R,C,N,S,u,d,X]),nY(()=>{if(!g||n||!nz(Y))return;let e=ox(om(Y));queueMicrotask(()=>{let t,r=_.current,n="function"==typeof r?r(T.current||""):r;if(void 0===n||!1===n||ov(Y,e))return;let o=null,s=()=>(null==o&&(o=V(Y)),o[0]||Y);oK(t=(t=!0===n||null===n?s():si(n))||s(),{preventScroll:t===Y})})},[n,g,Y,E,V,_,T]),nY(()=>{var e;if(n||!Y)return;let t=om(Y);function r(e){var t,r,n,o;let s;if(e.open||(t=e.nativeEvent,r=I.current,s=nM(ow(t)),z.current=t instanceof s.KeyboardEvent?"keyboard":t instanceof s.FocusEvent?r||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof s.MouseEvent?r||(0===t.detail?"keyboard":"mouse"):""),e.reason===nQ.triggerHover&&"mouseleave"===e.nativeEvent.type&&(A.current=!0),e.reason===nQ.outsidePress)if(e.nested)A.current=!1;else if((""===(n=e.nativeEvent).pointerType&&n.isTrusted?0:ou&&n.pointerType?"click"!==n.type||1!==n.buttons:0!==n.detail||n.pointerType)&&(o=e.nativeEvent,od?1:(ou||0!==o.width||0!==o.height)&&(!ou||1!==o.width||1!==o.height||0!==o.pressure||0!==o.detail||"mouse"!==o.pointerType)&&(!(o.width<1)||!(o.height<1)||0!==o.pressure||0!==o.detail||"touch"!==o.pointerType))){let e=!1;om(Y).createElement("div").focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}else A.current=!1}return e=ox(t),sl(),e&&"body"!==nA(e)&&(sa.push(new WeakRef(e)),sa.length>20&&(sa=sa.slice(-20))),w.on("openchange",r),()=>{w.off("openchange",r);let e=ox(t),n=X(),o=ov(v,e)||n.some(t=>t===e||ov(t,e))||N&&oY(N.nodesRef.current,S(),!1).some(t=>ov(t.context?.elements.floating,e)),s=O.current,i=function(){let e=O.current,t="function"==typeof e?e(z.current):e;if(void 0===t||!1===t)return null;if(null===t&&(t=!0),"boolean"==typeof t){let e=x||sc();return e&&e.isConnected?e:null}let r=x||sc();return si(t)||r||null}();queueMicrotask(()=>{let r=i?oB(i)?i:oq(i)[0]||i:null;s&&!A.current&&nz(r)&&("boolean"!=typeof s||r===e||e===t.body||o)&&r.focus({preventScroll:!0}),A.current=!1})}},[n,v,Y,O,k,w,N,x,S,X]),nY(()=>{if(!oa||g||!v)return;let e=ox(om(v));nz(e)&&oj(e)&&ov(v,e)&&e.blur()},[g,v]),nY(()=>{if(!n&&R)return R.setFocusManagerState({modal:a,closeOnFocusOut:l,open:g,onOpenChange:m.setOpen,domReference:x}),()=>{R.setFocusManagerState(null)}},[n,R,a,g,m,l,x]),nY(()=>{if(!n&&Y)return su(Y,j),()=>{queueMicrotask(sl)}},[n,Y,j]);let G=!n&&(!a||!C)&&(U||a);return(0,b.jsxs)(y.Fragment,{children:[G&&(0,b.jsx)(oy,{"data-type":"inside",ref:q,onFocus:e=>{if(a){let e=V();oK(e[e.length-1])}else if(R?.portalNode)if(A.current=!1,o$(e,R.portalNode)){let e=oF(x);e?.focus()}else si(d??R.beforeOutsideRef)?.focus()}}),r,G&&(0,b.jsx)(oy,{"data-type":"inside",ref:W,onFocus:e=>{if(a)oK(V()[0]);else if(R?.portalNode)if(l&&(A.current=!0),o$(e,R.portalNode)){let e=oH(x);e?.focus()}else si(u??R.afterOutsideRef)?.focus()}})]})}let sh=((f={}).nestedDialogs="--nested-dialogs",f),sf=((p={})[p.open=nw.open]="open",p[p.closed=nw.closed]="closed",p[p.startingStyle=nw.startingStyle]="startingStyle",p[p.endingStyle=nw.endingStyle]="endingStyle",p.nested="data-nested",p.nestedDialogOpen="data-nested-dialog-open",p),sp=y.createContext(void 0);function sm(){let e=y.useContext(sp);if(void 0===e)throw Error(r1(26));return e}function sg(e){let{enabled:t=!0,open:r,ref:n,onComplete:o}=e,s=nH(o),i=function(e,t=!1,r=!0){let n=op();return nH((o,s=null)=>{n.cancel();let i=si(e);if(null==i)return;let a=()=>{o6.flushSync(o)};if("function"!=typeof i.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED)return void o();function l(){Promise.all(i.getAnimations().map(e=>e.finished)).then(()=>{s?.aborted||a()}).catch(()=>{if(r){s?.aborted||a();return}let e=i.getAnimations();!s?.aborted&&e.length>0&&e.some(e=>e.pending||"finished"!==e.playState)&&l()})}if(t){let e=nb.startingStyle;if(!i.hasAttribute(e))return void n.request(l);let t=new MutationObserver(()=>{i.hasAttribute(e)||(t.disconnect(),l())});return t.observe(i,{attributes:!0,attributeFilter:[e]}),void s?.addEventListener("abort",()=>t.disconnect(),{once:!0})}n.request(l)})}(n,r,!1);y.useEffect(()=>{if(!t)return;let e=new AbortController;return i(s,e.signal),()=>{e.abort()}},[t,r,s,i])}let sb="ArrowUp",sy="ArrowDown",sx="ArrowLeft",sv="ArrowRight";[...new Set([...new Set([sx,sv]),...new Set([sb,sy])])];let sw=new Set([sb,sy,sx,sv,"Home","End"]),sk={...nO,...nv,nestedDialogOpen:e=>e?{[sf.nestedDialogOpen]:""}:null},sS=y.forwardRef(function(e,t){let{className:r,finalFocus:n,initialFocus:o,render:s,style:i,...a}=e,{store:l}=r5(),c=l.useState("descriptionElementId"),u=l.useState("disablePointerDismissal"),d=l.useState("floatingRootContext"),h=l.useState("popupProps"),f=l.useState("modal"),p=l.useState("mounted"),m=l.useState("nested"),g=l.useState("nestedOpenDialogCount"),y=l.useState("open"),x=l.useState("openMethod"),v=l.useState("titleElementId"),w=l.useState("transitionStatus"),k=l.useState("role");sm(),sg({open:y,ref:l.context.popupRef,onComplete(){y&&l.context.onOpenChangeComplete?.(!0)}});let S=void 0===o?function(e){return"touch"!==e||l.context.popupRef.current}:o,E=nm("div",e,{state:{open:y,nested:m,transitionStatus:w,nestedDialogOpen:g>0},props:[h,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:k,tabIndex:-1,hidden:!p,onKeyDown(e){sw.has(e.key)&&e.stopPropagation()},style:{[sh.nestedDialogs]:g}},a],ref:[t,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:sk});return(0,b.jsx)(sd,{context:d,openInteractionType:x,disabled:!p,closeOnFocusOut:!u,initialFocus:S,returnFocus:n,modal:!1!==f,restoreFocus:"popup",children:E})}),sE=y.forwardRef(function(e,t){let r,{cutout:n,...o}=e;if(n){let e=n.getBoundingClientRect();r=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,b.jsx)("div",{ref:t,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:r}})}),sC=y.forwardRef(function(e,t){var r;let{keepMounted:n=!1,...o}=e,{store:s}=r5(),i=s.useState("mounted"),a=s.useState("modal"),l=s.useState("open");return i||n?(0,b.jsx)(sp.Provider,{value:n,children:(0,b.jsxs)(st,{ref:t,...o,children:[i&&!0===a&&(0,b.jsx)(sE,{ref:s.context.internalBackdropRef,inert:(r=!l,r7>=19?r:r?"true":void 0)}),e.children]})}):null}),sj={},s_={},sO="";class sT{lockCount=0;restore=null;timeoutLock=ot.create();timeoutUnlock=ot.create();acquire(e){return this.lockCount+=1,1===this.lockCount&&null===this.restore&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{this.lockCount-=1,0===this.lockCount&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{0===this.lockCount&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){let t,r,n,o,s;if(0===this.lockCount||null!==this.restore)return;let i=om(e).documentElement,a=nM(i).getComputedStyle(i).overflowY;if("hidden"===a||"clip"===a){this.restore=nr;return}let l=ol||!function(e){if("u"<typeof document)return!1;let t=om(e);return nM(t).innerWidth-t.documentElement.clientWidth>0}(e);this.restore=l?(r=(t=om(e)).documentElement,n=t.body,s={overflowY:(o=nB(r)?r:n).style.overflowY,overflowX:o.style.overflowX},Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}):function(e){let t=om(e),r=t.documentElement,n=t.body,o=nM(r),s=0,i=0,a=!1,l=of.create();if(oa&&(o.visualViewport?.scale??1)!==1)return()=>{};function c(){let t=o.getComputedStyle(r),l=o.getComputedStyle(n),c=(t.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=r.scrollTop,i=r.scrollLeft,sj={scrollbarGutter:r.style.scrollbarGutter,overflowY:r.style.overflowY,overflowX:r.style.overflowX},sO=r.style.scrollBehavior,s_={position:n.style.position,height:n.style.height,width:n.style.width,boxSizing:n.style.boxSizing,overflowY:n.style.overflowY,overflowX:n.style.overflowX,scrollBehavior:n.style.scrollBehavior};let u=r.scrollHeight>r.clientHeight,d=r.scrollWidth>r.clientWidth,h="scroll"===t.overflowY||"scroll"===l.overflowY,f="scroll"===t.overflowX||"scroll"===l.overflowX,p=Math.max(0,o.innerWidth-n.clientWidth),m=Math.max(0,o.innerHeight-n.clientHeight),g=parseFloat(l.marginTop)+parseFloat(l.marginBottom),b=parseFloat(l.marginLeft)+parseFloat(l.marginRight),y=nB(r)?r:n;if(a=function(e){if(!("u">typeof CSS&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||"u"<typeof document)return!1;let t=om(e),r=t.documentElement,n=t.body,o=nB(r)?r:n,s=o.style.overflowY,i=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";let a=o.offsetWidth;o.style.overflowY="hidden";let l=o.offsetWidth;return o.style.overflowY=s,r.style.scrollbarGutter=i,a===l}(e)){r.style.scrollbarGutter=c,y.style.overflowY="hidden",y.style.overflowX="hidden";return}Object.assign(r.style,{scrollbarGutter:c,overflowY:"hidden",overflowX:"hidden"}),(u||h)&&(r.style.overflowY="scroll"),(d||f)&&(r.style.overflowX="scroll"),Object.assign(n.style,{position:"relative",height:g||m?`calc(100dvh - ${g+m}px)`:"100dvh",width:b||p?`calc(100vw - ${b+p}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),n.scrollTop=s,n.scrollLeft=i,r.setAttribute("data-base-ui-scroll-locked",""),r.style.scrollBehavior="unset"}function u(){Object.assign(r.style,sj),Object.assign(n.style,s_),a||(r.scrollTop=s,r.scrollLeft=i,r.removeAttribute("data-base-ui-scroll-locked"),r.style.scrollBehavior=sO)}c();let d=n3(o,"resize",function(){u(),l.request(c)});return()=>{l.cancel(),u(),"function"==typeof o.removeEventListener&&d()}}(e)}}let sN=new sT;var nQ=nQ;let sR={intentional:"onClick",sloppy:"onPointerDown"};function sA(){return!1}function sM(e=[]){let t=e.map(e=>e?.reference),r=e.map(e=>e?.floating),n=e.map(e=>e?.item),o=e.map(e=>e?.trigger),s=y.useCallback(t=>sP(t,e,"reference"),t),i=y.useCallback(t=>sP(t,e,"floating"),r),a=y.useCallback(t=>sP(t,e,"item"),n),l=y.useCallback(t=>sP(t,e,"trigger"),o);return y.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:l}),[s,i,a,l])}function sP(e,t,r){let n=new Map,o="item"===r,s={};for(let t in"floating"===r&&(s.tabIndex=-1,s[ok]=""),e)o&&e&&(t===oS||t===oE)||(s[t]=e[t]);for(let i=0;i<t.length;i+=1){let a,l=t[i]?.[r];(a="function"==typeof l?e?l(e):null:l)&&sD(s,a,o,n)}return sD(s,e,o,n),s}function sD(e,t,r,n){for(let o in t){let s=t[o];r&&(o===oS||o===oE)||(o.startsWith("on")?(n.has(o)||n.set(o,[]),"function"==typeof s&&(n.get(o)?.push(s),e[o]=(...e)=>n.get(o)?.map(t=>t(...e)).find(e=>void 0!==e))):e[o]=s)}}let sz=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]),sI=(e,t,r,n,o,s,...i)=>{let a;if(i.length>0)throw Error(r1(1));if(e&&t&&r&&n&&o&&s)a=(i,a,l,c)=>s(e(i,a,l,c),t(i,a,l,c),r(i,a,l,c),n(i,a,l,c),o(i,a,l,c),a,l,c);else if(e&&t&&r&&n&&o)a=(s,i,a,l)=>o(e(s,i,a,l),t(s,i,a,l),r(s,i,a,l),n(s,i,a,l),i,a,l);else if(e&&t&&r&&n)a=(o,s,i,a)=>n(e(o,s,i,a),t(o,s,i,a),r(o,s,i,a),s,i,a);else if(e&&t&&r)a=(n,o,s,i)=>r(e(n,o,s,i),t(n,o,s,i),o,s,i);else if(e&&t)a=(r,n,o,s)=>t(e(r,n,o,s),n,o,s);else if(e)a=e;else throw Error("Missing arguments");return a};var sB=e.i(56032),sL=e.i(96482);let sq=r7>=19?function(e,t,r,n,o){let i;if(!s){let s;return s=y.useCallback(()=>t(e.getSnapshot(),r,n,o),[e,t,r,n,o]),(0,sB.useSyncExternalStore)(e.subscribe,s,s)}let a=s.syncIndex;return s.syncIndex+=1,s.didInitialize?(i=s.syncHooks[a]).store===e&&i.selector===t&&Object.is(i.a1,r)&&Object.is(i.a2,n)&&Object.is(i.a3,o)||(i.store!==e&&(s.didChangeStore=!0),i.store=e,i.selector=t,i.a1=r,i.a2=n,i.a3=o,i.didChange=!0):(i={store:e,selector:t,a1:r,a2:n,a3:o,value:t(e.getSnapshot(),r,n,o),didChange:!1},s.syncHooks.push(i)),i.value}:function(e,t,r,n,o){return(0,sL.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,r,n,o))};[].push({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let r=0;r<e.syncHooks.length;r+=1){let n=e.syncHooks[r],o=n.selector(n.store.state,n.a1,n.a2,n.a3);(n.didChange||!Object.is(n.value,o))&&(t=!0,n.value=o,n.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let r=new Set;for(let t of e.syncHooks)r.add(t.store);let n=[];for(let e of r)n.push(e.subscribe(t));return()=>{for(let e of n)e()}}),(0,sB.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});class sW{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let r of this.listeners){if(t!==this.updateTick)return;r(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t]))return void this.setState({...this.state,...e})}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,r,n){return sq(this,e,t,r,n)}}class sF extends sW{constructor(e,t={},r){super(e),this.context=t,this.selectors=r}useSyncedValue(e,t){y.useDebugValue(e),nY(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let r=this;nY(()=>(r.state[e]!==t&&r.set(e,t),()=>{r.set(e,void 0)}),[r,e,t])}useSyncedValues(e){let t=this;nY(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){y.useDebugValue(e);let r=void 0!==t;nY(()=>{r&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,r])}select(e,t,r,n){return(0,this.selectors[e])(this.state,t,r,n)}useState(e,t,r,n){return y.useDebugValue(e),sq(this,this.selectors[e],t,r,n)}useContextCallback(e,t){y.useDebugValue(e);let r=nH(t??nr);this.context[e]=r}useStateSetter(e){let t=y.useRef(void 0);return void 0===t.current&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let r,n=(r="function"==typeof e?e:this.selectors[e])(this.state);return t(n,n,this),this.subscribe(e=>{let o=r(e);if(!Object.is(n,o)){let e=n;n=o,t(o,e,this)}})}}let sH={open:sI(e=>e.open),transitionStatus:sI(e=>e.transitionStatus),domReferenceElement:sI(e=>e.domReferenceElement),referenceElement:sI(e=>e.positionReference??e.referenceElement),floatingElement:sI(e=>e.floatingElement),floatingId:sI(e=>e.floatingId)};class s$ extends sF{constructor(e){const{syncOnly:t,nested:r,onOpenChange:n,triggerElements:o,...s}=e;super({...s,positionReference:s.referenceElement,domReferenceElement:s.referenceElement},{onOpenChange:n,dataRef:{current:{}},events:function(){let e=new Map;return{emit(t,r){e.get(t)?.forEach(e=>e(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){e.get(t)?.delete(r)}}}(),nested:r,triggerElements:o},sH),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||null!=t&&oN(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let r={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit("openchange",r)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}}var nQ=nQ;class sU{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let r=this.idMap.get(e);r!==t&&(void 0!==r&&this.elementsSet.delete(r),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}let sY=sI(e=>e.triggerIdProp??e.activeTriggerId),sV={...{open:sI(e=>e.openProp??e.open),mounted:sI(e=>e.mounted),transitionStatus:sI(e=>e.transitionStatus),floatingRootContext:sI(e=>e.floatingRootContext),preventUnmountingOnClose:sI(e=>e.preventUnmountingOnClose),payload:sI(e=>e.payload),activeTriggerId:sY,activeTriggerElement:sI(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:sI((e,t)=>void 0!==t&&sY(e)===t),isOpenedByTrigger:sI((e,t)=>void 0!==t&&sY(e)===t&&e.open),isMountedByTrigger:sI((e,t)=>void 0!==t&&sY(e)===t&&e.mounted),triggerProps:sI((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:sI(e=>e.popupProps),popupElement:sI(e=>e.popupElement),positionerElement:sI(e=>e.positionerElement)},modal:sI(e=>e.modal),nested:sI(e=>e.nested),nestedOpenDialogCount:sI(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:sI(e=>e.nestedOpenDrawerCount),disablePointerDismissal:sI(e=>e.disablePointerDismissal),openMethod:sI(e=>e.openMethod),descriptionElementId:sI(e=>e.descriptionElementId),titleElementId:sI(e=>e.titleElementId),viewportElement:sI(e=>e.viewportElement),role:sI(e=>e.role)};class sX extends sF{constructor(e){super(function(e={}){return{...{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new s$({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new sU,floatingId:"",syncOnly:!1,nested:!1,onOpenChange:void 0}),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:nn,inactiveTriggerProps:nn,popupProps:nn},modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}(e),{popupRef:y.createRef(),backdropRef:y.createRef(),internalBackdropRef:y.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new sU,onOpenChange:void 0,onOpenChangeComplete:void 0},sV)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},e||null!=t.trigger||null==this.state.activeTriggerId||(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let r={open:e},n=t.trigger?.id??null;(n||e)&&(r.activeTriggerId=n,r.activeTriggerElement=t.trigger??null),this.update(r)};static useStore(e,t){let r=r3(()=>new sX(t)).current;return e??r}}let sG=y.createContext(!1),sK=((m={})[m.open=nw.open]="open",m[m.closed=nw.closed]="closed",m[m.startingStyle=nw.startingStyle]="startingStyle",m[m.endingStyle=nw.endingStyle]="endingStyle",m.nested="data-nested",m.nestedDialogOpen="data-nested-dialog-open",m),sQ={...nO,...nv,nested:e=>e?{[sK.nested]:""}:null,nestedDialogOpen:e=>e?{[sK.nestedDialogOpen]:""}:null},sJ=y.forwardRef(function(e,t){let{className:r,render:n,children:o,style:s,...i}=e,a=sm(),{store:l}=r5(),c=l.useState("open"),u=l.useState("nested"),d=l.useState("transitionStatus"),h=l.useState("nestedOpenDialogCount"),f=l.useState("mounted");return nm("div",e,{enabled:a||f,state:{open:c,nested:u,transitionStatus:d,nestedDialogOpen:h>0},ref:[t,l.useStateSetter("viewportElement")],stateAttributesMapping:sQ,props:[{role:"presentation",hidden:!f,style:{pointerEvents:c?void 0:"none"},children:o},i]})}),sZ=y.forwardRef(function(e,t){let{render:r,className:n,style:o,id:s,...i}=e,{store:a}=r5(),l=n5(s);return a.useSyncedValueWithCleanup("titleElementId",l),nm("h2",e,{ref:t,props:[{id:l},i]})});var nQ=nQ;let s0=y.forwardRef(function(e,t){var r;let n,o,s,i,a,{render:l,className:c,disabled:u=!1,nativeButton:d=!0,id:h,payload:f,handle:p,style:m,...g}=e,b=r5(!0),x=p?.store??b?.store;if(!x)throw Error(r1(79));let v=n5(h),w=x.useState("floatingRootContext"),k=x.useState("isOpenedByTrigger",v),S=y.useRef(null),{registerTrigger:E,isMountedByThisTrigger:C}=(r={payload:f},n=x.useState("isMountedByTrigger",v),o=y.useRef(null),s=y.useRef(null),i=y.useCallback(e=>{if(void 0!==v){if(null!==o.current){let e=o.current,t=s.current,r=x.context.triggerElements.getById(e);t&&r===t&&x.context.triggerElements.delete(e),o.current=null,s.current=null}null!==e&&(o.current=v,s.current=e,x.context.triggerElements.add(v,e))}},[x,v]),a=nH(e=>{if(i(e),!e||!x.select("open"))return;let t=x.select("activeTriggerId");t===v?x.update({activeTriggerElement:e,...r}):null==t&&x.update({activeTriggerId:v,activeTriggerElement:e,...r})}),nY(()=>{n&&x.update({activeTriggerElement:S.current,...r})},[n,x,S,...Object.values(r)]),{registerTrigger:a,isMountedByThisTrigger:n}),{getButtonProps:j,buttonRef:_}=nX({disabled:u,native:d}),O=sM([function(e,t={}){let r="rootStore"in e?e.rootStore:e,n=r.context.dataRef,{enabled:o=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:c=0,reason:u=nQ.triggerPress}=t,d=y.useRef(void 0),h=op(),f=or(),p=y.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,o=e.nativeEvent,p=r.select("open");if(0!==e.button||"click"===s||oT(t,!0)&&a)return;let m=n.current.openEvent,g=m?.type,b=r.select("domReferenceElement")!==e.currentTarget,y=p&&b||!(p&&i&&(!m||!l||"click"===g||"mousedown"===g)),x=ow(o);if(oj(x)){let e=nK(u,o,x);y&&"touch"===t&&c>0?f.start(c,()=>{r.setOpen(!0,e)}):r.setOpen(y,e);return}let v=e.currentTarget;h.request(()=>{let e=nK(u,o,v);y&&"touch"===t&&c>0?f.start(c,()=>{r.setOpen(!0,e)}):r.setOpen(y,e)})},onClick(e){if("mousedown-only"===s)return;let t=d.current;if("mousedown"===s&&t){d.current=void 0;return}if(oT(t,!0)&&a)return;let o=r.select("open"),h=n.current.openEvent,p=r.select("domReferenceElement")!==e.currentTarget,m=o&&p||!(o&&i&&(!h||!l||oN(h))),g=nK(u,e.nativeEvent,e.currentTarget);m&&"touch"===t&&c>0?f.start(c,()=>{r.setOpen(!0,g)}):r.setOpen(m,g)},onKeyDown(){d.current=void 0}}),[n,s,a,r,l,i,h,f,c,u]);return y.useMemo(()=>o?{reference:p}:nn,[o,p])}(w,{enabled:null!=w})]),T=x.useState("triggerProps",C);return nm("button",e,{state:{disabled:u,open:k},ref:[_,t,E,S],props:[O.getReferenceProps(),T,{[o8]:"",id:v},g,j],stateAttributesMapping:n_})});var nQ=nQ;class s1{constructor(e){this.store=e??new sX}open(e){let t=e?this.store.context.triggerElements.getById(e):void 0;this.store.setOpen(!0,nK(nQ.imperativeAction,void 0,t))}openWithPayload(e){this.store.set("payload",e),this.store.setOpen(!0,nK(nQ.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,nK(nQ.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}e.s(["Backdrop",0,nN,"Close",0,nJ,"Description",0,n4,"Handle",0,s1,"Popup",0,sS,"Portal",0,sC,"Root",0,function(e){let t,{children:r,open:o,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:u,handle:d,triggerId:h,defaultTriggerId:f=null}=e,p=r5(!0),m=y.useContext(sG),g=!!p,x=sX.useStore(d?.store,{open:s,openProp:o,activeTriggerId:f,triggerIdProp:h,modal:c,disablePointerDismissal:l,nested:g});(t=y.useRef(!0)).current&&(t.current=!1,(()=>{void 0===o&&!1===x.state.open&&!0===s&&x.update({open:!0,activeTriggerId:f})})()),x.useControlledProp("openProp",o),x.useControlledProp("triggerIdProp",h),x.useSyncedValues({disablePointerDismissal:l,nested:g,modal:c}),x.useContextCallback("onOpenChange",i),x.useContextCallback("onOpenChangeComplete",a);let v=x.useState("payload");!function(e){let t,{store:r,parentContext:o,actionsRef:s,isDrawer:i}=e,a=r.useState("open"),l=r.useState("disablePointerDismissal"),c=r.useState("modal"),u=r.useState("popupElement"),{openMethod:d,triggerProps:h}=function(e){let t,r,n,o,[s,i]=y.useState(null),a=nH((t,r)=>{e||i(r||(ol?"touch":""))});t=y.useRef(e),nY(()=>{t.current!==e&&r(t.current)},[e,r=nH(t=>{t&&!e&&i(null)})]),nY(()=>{t.current=e},[e]);let{onClick:l,onPointerDown:c}=(n=y.useRef(""),o=y.useCallback(e=>{e.defaultPrevented||(n.current=e.pointerType,a(e,e.pointerType))},[a]),{onClick:y.useCallback(e=>{0===e.detail?a(e,"keyboard"):(a(e,"pointerType"in e?e.pointerType:n.current),n.current="")},[a]),onPointerDown:o});return y.useMemo(()=>({openMethod:s,triggerProps:{onClick:l,onPointerDown:c}}),[s,l,c])}(a);nY(()=>{if(t&&!r.select("activeTriggerId")&&1===r.context.triggerElements.size){let e=r.context.triggerElements.entries().next();if(!e.done){let[t,n]=e.value;r.update({activeTriggerId:t,activeTriggerElement:n})}}},[t=r.useState("open"),r]);let{forceUnmount:f}=function(e,t){let{mounted:r,setMounted:n,transitionStatus:o}=function(e,t=!1,r=!1){let[n,o]=y.useState(e&&t?"idle":void 0),[s,i]=y.useState(e);return e&&!s&&(i(!0),o("starting")),e||!s||"ending"===n||r||o("ending"),e||s||"ending"!==n||o(void 0),nY(()=>{if(!e&&s&&"ending"!==n&&r){let e=of.request(()=>{o("ending")});return()=>{of.cancel(e)}}},[e,s,n,r]),nY(()=>{if(!e||t)return;let r=of.request(()=>{o(void 0)});return()=>{of.cancel(r)}},[t,e]),nY(()=>{if(!e||!t)return;e&&s&&"idle"!==n&&o("starting");let r=of.request(()=>{o("idle")});return()=>{of.cancel(r)}},[t,e,s,n]),{mounted:s,setMounted:i,transitionStatus:n}}(e);t.useSyncedValues({mounted:r,transitionStatus:o});let s=nH(()=>{n(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),t.context.onOpenChangeComplete?.(!1)});return sg({enabled:!t.useState("preventUnmountingOnClose"),open:e,ref:t.context.popupRef,onComplete(){e||s()}}),{forceUnmount:s,transitionStatus:o}}(a,r),p=y.useCallback(()=>{r.setOpen(!1,nK(nQ.imperativeAction))},[r]);y.useImperativeHandle(s,()=>({unmount:f,close:p}),[f,p]);let m=function(e){let{popupStore:t,treatPopupAsFloatingElement:r=!1,onOpenChange:n}=e,o=n2(),s=null!=so(),i=t.useState("open"),a=t.useState("activeTriggerElement"),l=t.useState(r?"popupElement":"positionerElement"),c=t.context.triggerElements,u=r3(()=>new s$({open:i,transitionStatus:void 0,referenceElement:a,floatingElement:l,triggerElements:c,onOpenChange:n,floatingId:o,syncOnly:!0,nested:s})).current;return nY(()=>{let e={open:i,floatingId:o,referenceElement:a,floatingElement:l};nD(a)&&(e.domReferenceElement=a),u.state.positionReference===u.state.referenceElement&&(e.positionReference=a),u.update(e)},[i,o,a,l,u]),u.context.onOpenChange=n,u.context.nested=s,u}({popupStore:r,onOpenChange:r.setOpen,treatPopupAsFloatingElement:!0}),[g,b]=y.useState(0),[x,v]=y.useState(0),w=0===g,k=function(e,t={}){let r="rootStore"in e?e.rootStore:e,n=r.useState("open"),o=r.useState("floatingId"),s=r.useState("domReferenceElement"),i=r.useState("floatingElement"),{role:a="dialog"}=t,l=n2(),c=s?.id||l,u=y.useMemo(()=>oO(i)?.id||o,[i,o]),d=sz.get(a)??a,h=null!=so(),f=y.useMemo(()=>"tooltip"===d||"label"===a?nn:{"aria-haspopup":"alertdialog"===d?"dialog":d,"aria-expanded":"false",..."listbox"===d&&{role:"combobox"},..."menu"===d&&h&&{role:"menuitem"},..."select"===a&&{"aria-autocomplete":"none"},..."combobox"===a&&{"aria-autocomplete":"list"}},[d,h,a]),p=y.useMemo(()=>"tooltip"===d||"label"===a?{[`aria-${"label"===a?"labelledby":"describedby"}`]:n?u:void 0}:{...f,"aria-expanded":n?"true":"false","aria-controls":n?u:void 0,..."menu"===d&&{id:c}},[d,u,n,c,a,f]),m=y.useMemo(()=>{let e={id:u,...d&&{role:d}};return"tooltip"===d||"label"===a?e:{...e,..."menu"===d&&{"aria-labelledby":c}}},[d,u,c,a]),g=y.useCallback(({active:e,selected:t})=>{let r={role:"option",...e&&{id:`${u}-fui-option`}};switch(a){case"select":case"combobox":return{...r,"aria-selected":t}}return{}},[u,a]);return y.useMemo(()=>({reference:p,floating:m,item:g,trigger:f}),[p,m,f,g])}(m),S=function(e,t={}){let r="rootStore"in e?e.rootStore:e,o=r.useState("open"),s=r.useState("floatingElement"),{dataRef:i}=r.context,{enabled:a=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="sloppy",referencePress:d=sA,referencePressEvent:h="sloppy",bubbles:f,externalTree:p}=t,m=ss(p),g=nH("function"==typeof c?c:()=>!1),b="function"==typeof c?g:c,x=!1!==b,v=nH(()=>u),w=y.useRef(!1),k=y.useRef(!1),S=y.useRef(!1),{escapeKey:E,outsidePress:C}={escapeKey:"boolean"==typeof f?f:f?.escapeKey??!1,outsidePress:"boolean"==typeof f?f:f?.outsidePress??!0},j=y.useRef(null),_=or(),O=or(),T=nH(()=>{O.clear(),i.current.insideReactTree=!1}),N=y.useRef(!1),R=y.useRef(""),A=nH(d),M=nH(e=>{if(!o||!a||!l||"Escape"!==e.key||N.current)return;let t=i.current.floatingContext?.nodeId,n=m?oY(m.nodesRef.current,t):[];if(!E&&n.length>0){let e=!0;if(n.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let s="nativeEvent"in e?e.nativeEvent:e,c=nK(nQ.escapeKey,s);r.setOpen(!1,c),E||c.isPropagationAllowed||e.stopPropagation()}),P=nH(()=>{i.current.insideReactTree=!0,O.start(0,T)});y.useEffect(()=>{if(!o||!a)return;i.current.__escapeKeyBubbles=E,i.current.__outsidePressBubbles=C;let e=new ot,t=new ot;function c(){S.current=!0,t.start(0,()=>{S.current=!1})}function u(){w.current=!1,k.current=!1}function d(){let e=R.current,t=v(),r="function"==typeof t?t():t;return"string"==typeof r?r:r["pen"!==e&&e?e:"mouse"]}function h(e){let t=i.current.floatingContext?.nodeId,n=m&&oY(m.nodesRef.current,t).some(t=>oC(e,t.context?.elements.floating));return oC(e,r.select("floatingElement"))||oC(e,r.select("domReferenceElement"))||n}function f(e){let n;if("intentional"===(n=d())&&"click"!==e.type||"sloppy"===n&&"click"===e.type||i.current.insideReactTree)return void T();let o=ow(e),s=`[${oX("inert")}]`,a=nD(o)?o.getRootNode():null,l=Array.from((nI(a)?a:om(r.select("floatingElement"))).querySelectorAll(s)),c=r.context.triggerElements;if(o&&(c.hasElement(o)||c.hasMatchingElement(e=>ov(e,o))))return;let u=nD(o)?o:null;for(;u&&!nL(u);){let e=function(e){var t;if("html"===nA(e))return e;let r=e.assignedSlot||e.parentNode||nI(e)&&e.host||(null==(t=(nP(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement);return nI(r)?r.host:r}(u);if(nL(e)||!nD(e))break;u=e}if(l.length&&nD(o)&&!o.matches("html,body")&&!ov(o,r.select("floatingElement"))&&l.every(e=>!ov(u,e)))return;if(nz(o)&&!("touches"in e)){let t=nL(o),r=nq(o),n=/auto|scroll/,s=t||n.test(r.overflowX),i=t||n.test(r.overflowY),a=s&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,l=i&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,c="rtl"===r.direction,u=l&&(c?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=a&&e.offsetY>o.clientHeight;if(u||d)return}if(h(e))return;if("intentional"===d()&&S.current){t.clear(),S.current=!1;return}if("function"==typeof b&&!b(e))return;let f=i.current.floatingContext?.nodeId,p=m?oY(m.nodesRef.current,f):[];if(p.length>0){let e=!0;if(p.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}r.setOpen(!1,nK(nQ.outsidePress,e)),T()}function p(e){if("sloppy"!==d()||!r.select("open")||!a||oC(e,r.select("floatingElement"))||oC(e,r.select("domReferenceElement")))return;let t=e.touches[0];t&&(j.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},_.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function g(e,t){let r=ow(e);if(!r)return;let n=n3(r,e.type,()=>{t(e),n()})}function y(e){_.clear(),"pointerdown"===e.type&&(R.current=e.pointerType),("mousedown"!==e.type||!j.current||j.current.dismissOnMouseDown)&&g(e,e=>{if("pointerdown"===e.type)"sloppy"!==d()||"touch"===e.pointerType||!r.select("open")||!a||oC(e,r.select("floatingElement"))||oC(e,r.select("domReferenceElement"))||f(e);else f(e)})}function O(e){if(!w.current)return;let r=k.current;if(u(),"intentional"===d()){if("pointercancel"===e.type){r&&c();return}h(e)||(r?c():("function"!=typeof b||b(e))&&(t.clear(),S.current=!0,T()))}}function A(e){if("sloppy"!==d()||!j.current||oC(e,r.select("floatingElement"))||oC(e,r.select("domReferenceElement")))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-j.current.startX),o=Math.abs(t.clientY-j.current.startY),s=Math.sqrt(n*n+o*o);s>5&&(j.current.dismissOnTouchEnd=!0),s>10&&(f(e),_.clear(),j.current=null)}function P(e){"sloppy"!==d()||!j.current||oC(e,r.select("floatingElement"))||oC(e,r.select("domReferenceElement"))||(j.current.dismissOnTouchEnd&&f(e),_.clear(),j.current=null)}let D=om(s),z=n6(l&&n6(n3(D,"keydown",M),n3(D,"compositionstart",function(){e.clear(),N.current=!0}),n3(D,"compositionend",function(){e.start(5*(null==n&&(n="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),!!n),()=>{N.current=!1})})),x&&n6(n3(D,"click",y,!0),n3(D,"pointerdown",y,!0),n3(D,"pointerup",O,!0),n3(D,"pointercancel",O,!0),n3(D,"mousedown",y,!0),n3(D,"mouseup",O,!0),n3(D,"touchstart",function(e){R.current="touch",g(e,p)},!0),n3(D,"touchmove",function(e){g(e,A)},!0),n3(D,"touchend",function(e){g(e,P)},!0)));return()=>{z(),e.clear(),t.clear(),u(),S.current=!1}},[i,s,l,x,b,o,a,E,C,M,T,v,m,r,_]),y.useEffect(T,[b,T]);let D=y.useMemo(()=>({onKeyDown:M,[sR[h]]:e=>{A()&&r.setOpen(!1,nK(nQ.triggerPress,e.nativeEvent))},..."intentional"!==h&&{onClick(e){A()&&r.setOpen(!1,nK(nQ.triggerPress,e.nativeEvent))}}}),[M,r,h,A]),z=nH(e=>{if(!o||!a||0!==e.button)return;let t=ow(e.nativeEvent);ov(r.select("floatingElement"),t)&&(w.current||(w.current=!0,k.current=!1))}),I=nH(e=>{!o||!a||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&w.current&&(k.current=!0)}),B=y.useMemo(()=>({onKeyDown:M,onPointerDown:I,onMouseDown:I,onClickCapture:P,onMouseDownCapture(e){P(),z(e)},onPointerDownCapture(e){P(),z(e)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[M,P,z,I]);return y.useMemo(()=>a?{reference:D,floating:B,trigger:D}:{},[a,D,B])}(m,{outsidePressEvent:()=>r.context.internalBackdropRef.current||r.context.backdropRef.current?"intentional":{mouse:"trap-focus"===c?"sloppy":"intentional",touch:"sloppy"},outsidePress(e){if(!r.context.outsidePressEnabledRef.current||"button"in e&&0!==e.button||"touches"in e&&1!==e.touches.length)return!1;let t=ow(e);return!!w&&!l&&(!c||!r.context.internalBackdropRef.current&&!r.context.backdropRef.current||r.context.internalBackdropRef.current===t||r.context.backdropRef.current===t||ov(t,u)&&!t?.hasAttribute("data-base-ui-portal"))},escapeKey:w});!function(e=!0,t=null){nY(()=>{if(e)return sN.acquire(t)},[e,t])}(a&&!0===c,u);let{getReferenceProps:E,getFloatingProps:C,getTriggerProps:j}=sM([k,S]);r.useContextCallback("onNestedDialogOpen",(e,t)=>{b(e),v(t)}),r.useContextCallback("onNestedDialogClose",()=>{b(0),v(0)}),y.useEffect(()=>(o?.onNestedDialogOpen&&a&&o.onNestedDialogOpen(g+1,x+ +!!i),o?.onNestedDialogClose&&!a&&o.onNestedDialogClose(),()=>{o?.onNestedDialogClose&&a&&o.onNestedDialogClose()}),[i,a,g,x,o]);let _=y.useMemo(()=>E(h),[E,h]),O=y.useMemo(()=>j(h),[j,h]),T=y.useMemo(()=>C(),[C]);r.useSyncedValues({openMethod:d,activeTriggerProps:_,inactiveTriggerProps:O,popupProps:T,floatingRootContext:m,nestedOpenDialogCount:g,nestedOpenDrawerCount:x})}({store:x,actionsRef:u,parentContext:p?.store.context,isDrawer:m,onOpenChange:i,triggerIdProp:h});let w=y.useMemo(()=>({store:x}),[x]);return(0,b.jsx)(sG.Provider,{value:!1,children:(0,b.jsx)(r2.Provider,{value:w,children:"function"==typeof r?r({payload:v}):r})})},"Title",0,sZ,"Trigger",0,s0,"Viewport",0,sJ,"createHandle",0,function(){return new s1}],6841);var s2=e.i(6841),s2=s2;let s5=y.forwardRef(function(e,t){let{render:r,className:n,disabled:o=!1,focusableWhenDisabled:s=!1,nativeButton:i=!0,style:a,...l}=e,{getButtonProps:c,buttonRef:u}=nX({disabled:o,focusableWhenDisabled:s,native:i});return nm("button",e,{state:{disabled:o},ref:[t,u],props:[l,c]})}),s4=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,s3=(i="group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",a={variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}},e=>{var t;if((null==a?void 0:a.variants)==null)return eQ(i,null==e?void 0:e.class,null==e?void 0:e.className);let{variants:r,defaultVariants:n}=a,o=Object.keys(r).map(t=>{let o=null==e?void 0:e[t],s=null==n?void 0:n[t];if(null===o)return null;let i=s4(o)||s4(s);return r[t][i]}),s=e&&Object.entries(e).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return eQ(i,o,null==a||null==(t=a.compoundVariants)?void 0:t.reduce((e,t)=>{let{class:r,className:o,...i}=t;return Object.entries(i).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...n,...s}[t]):({...n,...s})[t]===r})?[...e,r,o]:e},[]),null==e?void 0:e.class,null==e?void 0:e.className)});function s6({className:e,variant:t="default",size:r="default",...n}){return(0,b.jsx)(s5,{"data-slot":"button",className:tZ(s3({variant:t,size:r,className:e})),...n})}let s8=eU("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function s9({...e}){return(0,b.jsx)(s2.Root,{"data-slot":"sheet",...e})}function s7({...e}){return(0,b.jsx)(s2.Portal,{"data-slot":"sheet-portal",...e})}function ie({className:e,...t}){return(0,b.jsx)(s2.Backdrop,{"data-slot":"sheet-overlay",className:tZ("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function it({className:e,children:t,side:r="right",showCloseButton:n=!0,...o}){return(0,b.jsxs)(s7,{children:[(0,b.jsx)(ie,{}),(0,b.jsxs)(s2.Popup,{"data-slot":"sheet-content","data-side":r,className:tZ("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...o,children:[t,n&&(0,b.jsxs)(s2.Close,{"data-slot":"sheet-close",render:(0,b.jsx)(s6,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,b.jsx)(s8,{}),(0,b.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function ir({className:e,...t}){return(0,b.jsx)("div",{"data-slot":"sheet-header",className:tZ("flex flex-col gap-0.5 p-4",e),...t})}function io({className:e,...t}){return(0,b.jsx)(s2.Title,{"data-slot":"sheet-title",className:tZ("font-heading text-base font-medium text-foreground",e),...t})}function is({className:e,...t}){return(0,b.jsx)(s2.Description,{"data-slot":"sheet-description",className:tZ("text-sm text-muted-foreground",e),...t})}let ii=y.forwardRef(function(e,t){let{className:r,render:n,orientation:o="horizontal",style:s,...i}=e;return nm("div",e,{state:{orientation:o},ref:t,props:[{role:"separator","aria-orientation":o},i]})});function ia({className:e,orientation:t="horizontal",...r}){return(0,b.jsx)(ii,{"data-slot":"separator",orientation:t,className:tZ("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...r})}let il=eU("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),ic=eU("zap",[["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",key:"1xq2db"}]]);function iu({agent:e}){return e.currentGoal||e.currentTask?(0,b.jsx)(t0,{className:"mb-3 border-dashed",children:(0,b.jsxs)(t1,{className:"grid gap-3 p-4",children:[e.currentGoal&&(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.jsx)("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-violet-100 text-violet-600 dark:bg-violet-950/50 dark:text-violet-400",children:(0,b.jsx)(il,{className:"h-3 w-3"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Current Goal"}),(0,b.jsx)("p",{className:"text-sm text-foreground",children:e.currentGoal})]})]}),e.currentTask&&(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.jsx)("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-blue-100 text-blue-600 dark:bg-blue-950/50 dark:text-blue-400",children:(0,b.jsx)(ic,{className:"h-3 w-3"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Current Task"}),(0,b.jsx)("p",{className:"text-sm text-foreground",children:e.currentTask})]})]})]})}):null}var s2=s2;function id({agentId:e,open:t,onClose:r}){let[n,o]=y.useState(""),[s,i]=y.useState(!1);async function a(t){if(t.preventDefault(),n.trim()){i(!0);try{await C(e,n.trim()),o(""),r()}catch{}finally{i(!1)}}}return(0,b.jsx)(s2.Root,{open:t,onOpenChange:e=>!e&&r(),children:(0,b.jsxs)(s2.Portal,{children:[(0,b.jsx)(s2.Backdrop,{className:tZ("fixed inset-0 z-50 bg-black/40 transition-opacity duration-150","data-ending-style:opacity-0 data-starting-style:opacity-0")}),(0,b.jsxs)(s2.Popup,{className:tZ("fixed z-50 left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2","w-full max-w-md rounded-xl border bg-background p-6 shadow-xl","transition duration-150 data-ending-style:opacity-0 data-ending-style:scale-95","data-starting-style:opacity-0 data-starting-style:scale-95"),children:[(0,b.jsx)(s2.Title,{className:"mb-1 text-base font-semibold text-foreground",children:"Modify Instruction"}),(0,b.jsx)(s2.Description,{className:"mb-4 text-sm text-muted-foreground",children:"The agent will receive this instruction and adapt its execution."}),(0,b.jsxs)("form",{onSubmit:a,className:"flex flex-col gap-3",children:[(0,b.jsx)("textarea",{className:tZ("min-h-[100px] w-full resize-none rounded-lg border bg-muted/30 px-3 py-2","text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"),placeholder:"e.g. Use PostgreSQL instead of SQLite",value:n,onChange:e=>o(e.target.value),disabled:s,autoFocus:!0}),(0,b.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,b.jsx)(s2.Close,{render:(0,b.jsx)(s6,{type:"button",variant:"ghost"}),children:"Cancel"}),(0,b.jsx)(s6,{type:"submit",disabled:s||!n.trim(),children:s?"Sending…":"Send Instruction"})]})]})]})]})})}function ih({agentId:e,onClose:t}){let{agent:r,loading:n,refetch:o}=function(e){let[t,r]=(0,y.useState)(null),[n,o]=(0,y.useState)(!1),[s,i]=(0,y.useState)(null),a=(0,y.useCallback)(e=>{o(!0),i(null),w(e).then(r).catch(e=>i(e instanceof Error?e.message:"Failed to fetch agent")).finally(()=>o(!1))},[]);return(0,y.useEffect)(()=>{if(!e){r(null),i(null);return}a(e)},[e,a]),{agent:t,loading:n,error:s,refetch:(0,y.useCallback)(()=>{e&&a(e)},[e,a])}}(e),[s,i]=y.useState(null),[a,l]=y.useState(!1);async function c(){if(e){i("pause");try{await S(e),await o()}catch{}i(null)}}async function u(){if(e){i("resume");try{await E(e),await o()}catch{}i(null)}}return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s9,{open:!!e,onOpenChange:e=>!e&&t(),children:(0,b.jsxs)(it,{className:"flex w-full flex-col sm:max-w-lg",children:[(0,b.jsx)(ir,{children:n||!r?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(t2,{className:"h-5 w-36"}),(0,b.jsx)(t2,{className:"h-4 w-24"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(io,{className:"flex items-center gap-3",children:[r.name,(0,b.jsx)(rx,{status:r.status})]}),(0,b.jsx)(is,{children:(0,b.jsxs)("span",{className:"flex items-center gap-2",children:["Started ",function(e,t){let r=(void 0)??ri.locale??rs,n=(void 0)??void 0??ri.firstWeekContainsDate??ri.locale?.options?.firstWeekContainsDate??1,o=(void 0)??void 0??ri.weekStartsOn??ri.locale?.options?.weekStartsOn??0,s=ra(e,void 0);if(!(s instanceof Date||"object"==typeof s&&"[object Date]"===Object.prototype.toString.call(s))&&"number"!=typeof s||isNaN(+ra(s)))throw RangeError("Invalid time value");let i=t.match(rH).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,rB[t])(e,r.formatLong):e}).join("").match(rF).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let t=e[0];if("'"===t){var r;let t;return{isToken:!1,value:(t=(r=e).match(r$))?t[1].replace(rU,"'"):r}}if(rA[t])return{isToken:!0,value:e};if(t.match(rY))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});r.localize.preprocessor&&(i=r.localize.preprocessor(s,i));let a={firstWeekContainsDate:n,weekStartsOn:o,locale:r};return i.map(n=>{if(!n.isToken)return n.value;let o=n.value;return(rq.test(o)||rL.test(o))&&function(e,t,r){var n,o,s;let i,a=(n=e,o=t,s=r,i="Y"===n[0]?"years":"days of the month",`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${o}\`) for formatting ${i} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(a),rW.includes(e))throw RangeError(a)}(o,t,String(e)),(0,rA[o[0]])(s,o,r.localize,a)}).join("")}(new Date(r.createdAt),"MMM d, h:mm a"),r.attentionReason&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"·"}),(0,b.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:r.attentionReason})]})]})}),("running"===r.status||"paused"===r.status)&&(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:["running"===r.status?(0,b.jsxs)(s6,{size:"sm",variant:"outline",disabled:"pause"===s,onClick:c,className:"gap-1.5",children:[(0,b.jsx)(rK,{className:"h-3.5 w-3.5"}),"pause"===s?"Pausing…":"Pause"]}):(0,b.jsxs)(s6,{size:"sm",variant:"outline",disabled:"resume"===s,onClick:u,className:"gap-1.5 border-amber-200 text-amber-700 hover:bg-amber-50 dark:border-amber-800 dark:text-amber-400",children:[(0,b.jsx)(rQ,{className:"h-3.5 w-3.5"}),"resume"===s?"Resuming…":"Resume"]}),(0,b.jsxs)(s6,{size:"sm",variant:"outline",onClick:()=>l(!0),className:"gap-1.5",children:[(0,b.jsx)(rJ,{className:"h-3.5 w-3.5"}),"Modify Instruction"]})]})]})}),(0,b.jsx)(ia,{}),(0,b.jsx)("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:n||!r?(0,b.jsx)(ip,{}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(iu,{agent:r}),0===r.events.length?(0,b.jsx)("p",{className:"py-12 text-center text-sm text-muted-foreground",children:"No events recorded"}):(0,b.jsx)(im,{events:r.events})]})})]})}),e&&a&&(0,b.jsx)(id,{agentId:e,open:a,onClose:()=>{l(!1),o()}})]})}function ip(){return(0,b.jsx)("div",{className:"flex flex-col gap-3 pt-2",children:Array.from({length:5}).map((e,t)=>(0,b.jsx)(t2,{className:"h-14 w-full rounded-lg"},t))})}function im({events:e}){let t=[...e].reverse();return(0,b.jsxs)("div",{className:"relative flex flex-col gap-0 pt-2",children:[(0,b.jsx)("div",{className:"absolute left-[11px] top-6 bottom-2 w-px bg-border"}),t.map(e=>(0,b.jsx)(ig,{event:e},e.id))]})}function ig({event:e}){let{icon:t,iconClass:r,textClass:n}=function(e){switch(e){case"error":return{icon:rX,iconClass:"bg-red-100 text-red-600 dark:bg-red-950/50 dark:text-red-400",textClass:"font-medium text-red-700 dark:text-red-300"};case"warning":return{icon:eV,iconClass:"bg-amber-100 text-amber-600 dark:bg-amber-950/50 dark:text-amber-400",textClass:"text-amber-700 dark:text-amber-300"};case"paused":return{icon:eK,iconClass:"bg-amber-100 text-amber-600 dark:bg-amber-950/50 dark:text-amber-400",textClass:"text-muted-foreground italic"};case"resumed":return{icon:rZ,iconClass:"bg-emerald-100 text-emerald-600 dark:bg-emerald-950/50 dark:text-emerald-400",textClass:"text-muted-foreground italic"};case"instruction_modified":return{icon:r0,iconClass:"bg-blue-100 text-blue-600 dark:bg-blue-950/50 dark:text-blue-400",textClass:"text-blue-700 dark:text-blue-300"};default:return{icon:rV,iconClass:"bg-muted text-muted-foreground",textClass:"text-foreground"}}}(e.type);return(0,b.jsxs)("div",{className:"relative flex gap-3 py-2 pl-0",children:[(0,b.jsx)("div",{className:tZ("relative z-10 mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full ring-4 ring-background",r),children:(0,b.jsx)(t,{className:"h-3 w-3"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:tZ("text-sm leading-relaxed",n),children:e.message}),(0,b.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:rd(new Date(e.timestamp),{addSuffix:!0})}),(null!=e.tokens||null!=e.cost)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"·"}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground",children:[(0,b.jsx)(rG,{className:"h-3 w-3"}),null!=e.tokens&&(0,b.jsxs)("span",{children:[e.tokens," tokens"]}),null!=e.tokens&&null!=e.cost&&(0,b.jsx)("span",{children:"·"}),null!=e.cost&&(0,b.jsxs)("span",{children:["$",e.cost.toFixed(4)]})]})]})]})]})]})}e.s(["default",0,function(){let{agents:e,loading:t,error:r,refetch:n}=function(){var e;let[t,r]=(0,y.useState)([]),[n,o]=(0,y.useState)(!0),[s,i]=(0,y.useState)(null),a=(0,y.useCallback)(async()=>{try{let e=await v();r(e),i(null)}catch(e){i(e instanceof Error?e.message:"Failed to fetch")}finally{o(!1)}},[]);return(0,y.useEffect)(()=>{a()},[a]),e="agents:update",(0,y.useEffect)(()=>{let t=(eB||(eB=eI(x,{reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:5e3})),eB);return t.on(e,a),t.on("reconnect",a),()=>{t.off(e,a),t.off("reconnect",a)}},[e,a]),{agents:t,loading:n,error:s,refetch:a}}(),[o,s]=(0,y.useState)(null),i=(0,y.useCallback)(()=>s(null),[]);return(0,b.jsxs)("div",{className:"mx-auto flex w-full max-w-7xl flex-col gap-6 px-6 py-8",children:[(0,b.jsx)(eL,{error:r,onRetry:n}),(0,b.jsx)(t4,{agents:e,loading:t}),(0,b.jsx)(t6,{agents:e,onResolve:n}),(0,b.jsx)(rE,{agents:e,loading:t,onSelect:s}),(0,b.jsx)(ih,{agentId:o,onClose:i})]})}],17661)}]);